管道气线

This commit is contained in:
‘huanghaiixia’
2025-10-27 15:24:17 +08:00
parent 231ba89c53
commit fc3e7c10b7
16 changed files with 297 additions and 81 deletions

View File

@ -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();

View File

@ -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%' },