管道气线
This commit is contained in:
@ -44,13 +44,6 @@
|
||||
let customFormEventConfigs=[];
|
||||
|
||||
onMounted(async () => {
|
||||
const treeData = await getTreeData({})
|
||||
formProps.schemas?.forEach(v => {
|
||||
if (v.field == 'regionCode') {
|
||||
v.componentProps.options = treeData
|
||||
}
|
||||
})
|
||||
console.log(formProps.schemas, 667)
|
||||
try {
|
||||
// 合并渲染覆盖配置中的字段配置、表单事件配置
|
||||
await mergeCustomFormRenderConfig();
|
||||
@ -125,7 +118,7 @@
|
||||
async function setFormDataFromId(rowId, skipUpdate) {
|
||||
try {
|
||||
let record = await getLngBBank(rowId);
|
||||
record = {...record, regionCode: (record.regionCode || []).split(',')}
|
||||
record = {...record}
|
||||
if (skipUpdate) {
|
||||
return record;
|
||||
}
|
||||
@ -158,7 +151,7 @@
|
||||
try {
|
||||
values[RowKey] = rowId;
|
||||
state.formModel = values;
|
||||
let saveVal = await updateLngBBank({...values, regionCode: (values.regionCode||[]).join(',')});
|
||||
let saveVal = await updateLngBBank({...values});
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:提交表单
|
||||
@ -169,7 +162,7 @@
|
||||
async function add(values) {
|
||||
try {
|
||||
state.formModel = values;
|
||||
let saveVal = await addLngBBank({...values, regionCode: (values.regionCode||[]).join(',')});
|
||||
let saveVal = await addLngBBank({...values});
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:提交表单
|
||||
|
||||
@ -329,58 +329,33 @@ export const formProps: FormProps = {
|
||||
},
|
||||
},
|
||||
{
|
||||
key: '4',
|
||||
key: '1485b829c80a493bb55f37d1c839ccc9',
|
||||
field: 'regionCode',
|
||||
label: '所属国家/地区',
|
||||
type: 'cascader',
|
||||
component: 'Cascader',
|
||||
type: 'areacascader',
|
||||
component: 'AreaCascader',
|
||||
colProps: { span: 8 },
|
||||
defaultValue: [],
|
||||
componentProps: {
|
||||
options: [
|
||||
// {
|
||||
// value: 'zhejiang',
|
||||
// label: '浙江省',
|
||||
// children: [
|
||||
// {
|
||||
// value: 'hangzhou',
|
||||
// label: '杭州市',
|
||||
// children: [
|
||||
// {
|
||||
// value: 'xihu',
|
||||
// label: '西湖区',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// ],
|
||||
// }
|
||||
],
|
||||
fieldNames: {label: 'fullName', value: 'code', children: 'children'},
|
||||
width: '100%',
|
||||
span: '',
|
||||
defaultValue: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请选择',
|
||||
maxlength: null,
|
||||
prefix: '',
|
||||
suffix: '',
|
||||
addonBefore: '',
|
||||
addonAfter: '',
|
||||
disabled: false,
|
||||
allowClear: false,
|
||||
showLabel: true,
|
||||
required: false,
|
||||
rules: [],
|
||||
events: {},
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
width: '100%',
|
||||
span: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请选择区域',
|
||||
showLabel: true,
|
||||
disabled: false,
|
||||
allowClear: true,
|
||||
clearable: false,
|
||||
required: false,
|
||||
rules: [],
|
||||
events: {},
|
||||
isShow: true,
|
||||
style: { width: '100%' },
|
||||
fieldNames: {label: 'fullName', value: 'code', children: 'children'},
|
||||
excludeType: 'CONTINENT'
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '6461a5e152124abca28bd2114dd577e6',
|
||||
field: 'swift',
|
||||
@ -519,15 +494,16 @@ export const formProps: FormProps = {
|
||||
},
|
||||
{
|
||||
key: '8',
|
||||
field: 'soft',
|
||||
field: 'sort',
|
||||
label: '显示顺序',
|
||||
type: 'input',
|
||||
component: 'InputNumber',
|
||||
colProps: { span: 8 },
|
||||
defaultValue: '',
|
||||
defaultValue: null,
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
min:0,
|
||||
defaultValue: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
|
||||
@ -236,13 +236,13 @@ export const formProps: FormProps = {
|
||||
colProps: { span: 8 },
|
||||
defaultValue: null,
|
||||
componentProps: {
|
||||
min:0,
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
width: '100%',
|
||||
span: '',
|
||||
defaultValue: null,
|
||||
min: 0,
|
||||
max: null,
|
||||
step: 1,
|
||||
maxlength: null,
|
||||
|
||||
@ -7,10 +7,10 @@
|
||||
/>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref,onBeforeMount,onMounted } from 'vue';
|
||||
import { reactive, ref,onBeforeMount,onMounted,watch } from 'vue';
|
||||
import { formProps, formEventConfigs ,formConfig} from './config';
|
||||
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
|
||||
import { addLngBPngLine, getLngBPngLine, updateLngBPngLine, deleteLngBPngLine } from '/@/api/mdm/PipelineGgasLine';
|
||||
import { addLngBPngLine, getLngBPngLine, updateLngBPngLine, deleteLngBPngLine, getIngStation } from '/@/api/mdm/PipelineGgasLine';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { FormDataProps } from '/@/components/Designer/src/types';
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
@ -33,7 +33,9 @@
|
||||
default: FromPageType.MENU,
|
||||
},
|
||||
});
|
||||
const systemFormRef = ref();
|
||||
const systemFormRef = ref({
|
||||
|
||||
});
|
||||
const data: { formDataProps: FormDataProps } = reactive({
|
||||
formDataProps: {schemas:[]} as FormDataProps,
|
||||
});
|
||||
@ -43,7 +45,43 @@
|
||||
|
||||
let customFormEventConfigs=[];
|
||||
|
||||
|
||||
watch(
|
||||
() => getFormModel(),
|
||||
(newVal) => {
|
||||
if (newVal.ownSign === 'Y') {
|
||||
data.formDataProps.schemas?.forEach(v => {
|
||||
if (v.field === 'staCodeLng') {
|
||||
v.componentProps.disabled = false
|
||||
v.componentProps.required = true
|
||||
}
|
||||
})
|
||||
} else {
|
||||
data.formDataProps.schemas?.forEach(v => {
|
||||
if (v.field === 'staCodeLng') {
|
||||
v.componentProps.disabled = true
|
||||
v.componentProps.required = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
onMounted(async () => {
|
||||
const a = await getIngStation({ownSign :'Y', valid : 'Y'})
|
||||
const b = a.map(v => {
|
||||
return {
|
||||
label: v.fullName,
|
||||
value: v.code
|
||||
}
|
||||
})
|
||||
formProps.schemas?.forEach(v => {
|
||||
if (v.field === 'staCodeLng') {
|
||||
v.componentProps.staticOptions = b
|
||||
}
|
||||
})
|
||||
try {
|
||||
// 合并渲染覆盖配置中的字段配置、表单事件配置
|
||||
await mergeCustomFormRenderConfig();
|
||||
|
||||
@ -348,11 +348,11 @@ export const formProps: FormProps = {
|
||||
disabled: false,
|
||||
mode: '',
|
||||
staticOptions: [
|
||||
{ key: 1, label: 'Option 1', value: 'Option 1' },
|
||||
{ key: 2, label: 'Option 2', value: 'Option 2' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' },
|
||||
// { key: 1, label: 'Option 1', value: 'Option 1' },
|
||||
// { key: 2, label: 'Option 2', value: 'Option 2' },
|
||||
// { key: 3, label: 'Option 3', value: 'Option 3' },
|
||||
],
|
||||
defaultSelect: 'Option 1',
|
||||
defaultSelect: '',
|
||||
datasourceType: 'staticData',
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
@ -376,14 +376,14 @@ export const formProps: FormProps = {
|
||||
type: 'number',
|
||||
component: 'InputNumber',
|
||||
colProps: { span: 8 },
|
||||
defaultValue: 0,
|
||||
defaultValue: null,
|
||||
componentProps: {
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
width: '100%',
|
||||
span: '',
|
||||
defaultValue: 0,
|
||||
defaultValue: null,
|
||||
step: 1,
|
||||
disabled: false,
|
||||
showLabel: true,
|
||||
@ -391,6 +391,7 @@ export const formProps: FormProps = {
|
||||
required: false,
|
||||
subTotal: false,
|
||||
isShow: true,
|
||||
min:0,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
|
||||
@ -289,7 +289,7 @@ export const formProps: FormProps = {
|
||||
width: '100%',
|
||||
span: '',
|
||||
defaultValue: null,
|
||||
min: null,
|
||||
min: 0,
|
||||
max: null,
|
||||
step: 1,
|
||||
maxlength: null,
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
} from 'vue';
|
||||
const modalVisible = ref(false);
|
||||
const logId = ref('')
|
||||
const logPath = ref('/mdm/TaxRate/datalog');
|
||||
const logPath = ref('/mdm/taxRate/datalog');
|
||||
import { DataLog } from '/@/components/pcitc';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
Reference in New Issue
Block a user