上下载点
This commit is contained in:
@ -7,10 +7,11 @@
|
||||
/>
|
||||
</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 { addLngBStationPng, getLngBStationPng, updateLngBStationPng, deleteLngBStationPng } from '/@/api/mdm/PipeGasDownloadPoint';
|
||||
import { getIngStation } from '/@/api/mdm/PipelineGgasLine';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { FormDataProps } from '/@/components/Designer/src/types';
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
@ -24,16 +25,16 @@
|
||||
const { filterFormSchemaAuth } = usePermission();
|
||||
const { mergeFormSchemas,mergeFormEventConfigs } = useFormConfig();
|
||||
const { currentRoute } = useRouter();
|
||||
|
||||
const isView = currentRoute.value.query.isView
|
||||
const RowKey = 'id';
|
||||
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'form-mounted']);
|
||||
const props = defineProps({
|
||||
fromPage: {
|
||||
type: Number,
|
||||
default: FromPageType.MENU,
|
||||
},
|
||||
}
|
||||
});
|
||||
const systemFormRef = ref();
|
||||
const systemFormRef = ref({});
|
||||
const data: { formDataProps: FormDataProps } = reactive({
|
||||
formDataProps: {schemas:[]} as FormDataProps,
|
||||
});
|
||||
@ -42,8 +43,42 @@
|
||||
});
|
||||
|
||||
let customFormEventConfigs=[];
|
||||
|
||||
watch(
|
||||
() => getFormModel(),
|
||||
(newVal) => {
|
||||
if (newVal.ownSign === 'Y') {
|
||||
data.formDataProps.schemas?.forEach(v => {
|
||||
if (v.field === 'staCodeLng') {
|
||||
v.componentProps.disabled = (isView ? true : 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
|
||||
v.componentProps.disabled = (isView ? true : false)
|
||||
}
|
||||
})
|
||||
try {
|
||||
// 合并渲染覆盖配置中的字段配置、表单事件配置
|
||||
await mergeCustomFormRenderConfig();
|
||||
|
||||
@ -448,11 +448,12 @@ export const formProps: FormProps = {
|
||||
key: 'ce59b928624a4277992077bd11f54e70',
|
||||
field: 'pipelineCode',
|
||||
label: '管道',
|
||||
type: 'input',
|
||||
component: 'Input',
|
||||
type: 'selectpipeline',
|
||||
component: 'SelectPipeline',
|
||||
colProps: { span: 8 },
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
getPopupContainer: () => document.body,
|
||||
width: '100%',
|
||||
span: '',
|
||||
defaultValue: '',
|
||||
@ -462,7 +463,7 @@ export const formProps: FormProps = {
|
||||
respNewRow: false,
|
||||
placeholder: '请输入管道',
|
||||
prefix: '',
|
||||
suffix: '',
|
||||
suffix: 'ant-design:ellipsis-outlined',
|
||||
addonBefore: '',
|
||||
addonAfter: '',
|
||||
disabled: false,
|
||||
@ -601,7 +602,7 @@ export const formProps: FormProps = {
|
||||
allowClear: false,
|
||||
showLabel: true,
|
||||
required: false,
|
||||
rules: [],
|
||||
rules: [{ pattern: '/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/', message: '邮箱格式错误\n' }],
|
||||
events: {},
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
@ -613,8 +614,8 @@ export const formProps: FormProps = {
|
||||
key: 'fa55f80f74364d5b95ed2d7a77f20e55',
|
||||
field: 'regionCode',
|
||||
label: '行政区域',
|
||||
type: 'select',
|
||||
component: 'XjrSelect',
|
||||
type: 'areacascader',
|
||||
component: 'AreaCascader',
|
||||
colProps: { span: 8 },
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
@ -623,34 +624,19 @@ export const formProps: FormProps = {
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请选择下拉选择',
|
||||
sepTextField: '',
|
||||
placeholder: '请选择区域',
|
||||
showLabel: true,
|
||||
showSearch: false,
|
||||
clearable: false,
|
||||
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' },
|
||||
],
|
||||
defaultSelect: '',
|
||||
datasourceType: 'staticData',
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
},
|
||||
dicOptions: [],
|
||||
allowClear: true,
|
||||
clearable: false,
|
||||
required: false,
|
||||
rules: [],
|
||||
events: {},
|
||||
isShow: true,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
fieldNames: {label: 'fullName', value: 'code', children: 'children'},
|
||||
excludeType: 'CONTINENT'
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '56e88c926247465caf62c6c52747205d',
|
||||
@ -778,9 +764,9 @@ 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: '',
|
||||
datasourceType: 'staticData',
|
||||
@ -819,15 +805,14 @@ export const formProps: FormProps = {
|
||||
showSearch: false,
|
||||
clearable: false,
|
||||
disabled: false,
|
||||
mode: 'multiple',
|
||||
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' },
|
||||
],
|
||||
defaultSelect: '',
|
||||
datasourceType: 'api',
|
||||
labelField: 'label',
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '1978056598125330433' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
@ -835,10 +820,11 @@ export const formProps: FormProps = {
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
},
|
||||
dicOptions: [],
|
||||
required: false,
|
||||
required: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
isShow: true,
|
||||
itemId: '1978056598125330433',
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
@ -849,14 +835,15 @@ export const formProps: FormProps = {
|
||||
type: 'number',
|
||||
component: 'InputNumber',
|
||||
colProps: { span: 8 },
|
||||
defaultValue: 0,
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
width: '100%',
|
||||
span: '',
|
||||
defaultValue: 0,
|
||||
min:0,
|
||||
defaultValue: '',
|
||||
step: 1,
|
||||
disabled: false,
|
||||
showLabel: true,
|
||||
|
||||
@ -102,7 +102,7 @@
|
||||
},
|
||||
schemas: customSearchFormSchema,
|
||||
fieldMapToTime: [],
|
||||
showResetButton: false,
|
||||
showResetButton: true,
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
||||
@ -121,13 +121,19 @@
|
||||
dataIndex: 'action',
|
||||
slots: { customRender: 'action' },
|
||||
},
|
||||
rowSelection: {
|
||||
type: 'checkbox',
|
||||
onChange: onSelectChange
|
||||
},
|
||||
tableSetting: {
|
||||
size: false,
|
||||
setting: false,
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
function onSelectChange(rowKeys: string[]) {
|
||||
selectedKeys.value = rowKeys;
|
||||
}
|
||||
function dbClickRow(record) {
|
||||
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
|
||||
return;
|
||||
@ -158,7 +164,8 @@
|
||||
query: {
|
||||
formPath: 'mdm/PipeGasDownloadPoint',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId:currentRoute.value.meta.formId,
|
||||
isView: true
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
const { filterFormSchemaAuth } = usePermission();
|
||||
const { mergeFormSchemas,mergeFormEventConfigs } = useFormConfig();
|
||||
const { currentRoute } = useRouter();
|
||||
|
||||
const isView = currentRoute.value.query.isView
|
||||
const RowKey = 'id';
|
||||
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'form-mounted']);
|
||||
const props = defineProps({
|
||||
@ -52,7 +52,7 @@ watch(
|
||||
if (newVal.ownSign === 'Y') {
|
||||
data.formDataProps.schemas?.forEach(v => {
|
||||
if (v.field === 'staCodeLng') {
|
||||
v.componentProps.disabled = false
|
||||
v.componentProps.disabled = (isView ? true : false)
|
||||
v.componentProps.required = true
|
||||
}
|
||||
})
|
||||
@ -80,6 +80,7 @@ watch(
|
||||
formProps.schemas?.forEach(v => {
|
||||
if (v.field === 'staCodeLng') {
|
||||
v.componentProps.staticOptions = b
|
||||
v.componentProps.disabled = (isView ? true : false)
|
||||
}
|
||||
})
|
||||
try {
|
||||
|
||||
@ -164,7 +164,8 @@
|
||||
query: {
|
||||
formPath: 'mdm/PipelineGgasLine',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId:currentRoute.value.meta.formId,
|
||||
isView:true
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user