提交 babf9c16 authored 作者: 张耀丹's avatar 张耀丹

建设用地土壤污染状况调查清单=》全部地块=》完善信息:行业分类

上级 a0d483e2
......@@ -28,10 +28,13 @@ export const checkList = (params) => defHttp.get({ url: Api.checkList, params })
// 获取地市行政区域
export const getTown = (params) => {
if (params?.id)
return defHttp.get({ url: `/sys/api/xzbm/${params.id}` });
else
if (params instanceof Object) {
if (params?.id) {
return defHttp.get({ url: `/sys/api/xzbm/${params.id}` });
}
} else if (typeof params === 'number' || typeof params === 'string') {
return defHttp.get({ url: `/sys/api/xzbm/${params}` });
}
}
// 行政区域划分三级树形
export const cityTree = () => {
......
......@@ -413,103 +413,27 @@ export const formSchema: FormSchema[] = [
formModel.hydl = null;
formModel.hyzl = null;
formModel.hyxl = null;
if (val == 1) {
updateSchema({
field: 'hyml',
componentProps: ({ formModel, formActionType }) => {
return {
options: allCategory.value.filter(item => item['is42']),
onChange: (val: any) => {
const { updateSchema } = formActionType;
if (val) {
treeD.value = allCategory.value.filter((item: any) => item.value === val)
formModel.hydl = null;
formModel.hyzl = null;
formModel.hyxl = null;
updateSchema({
field: 'hydl',
componentProps: ({ formModel, formActionType }) => {
return {
options: treeD.value[0].children,
onChange: (valD: any) => {
const { updateSchema } = formActionType;
if (valD) {
formModel.hyzl = null;
formModel.hyxl = null;
treeZ.value = treeD?.value[0].children.filter((item: any) => item.value === valD)
updateSchema({
field: 'hyzl',
componentProps: ({ formModel, formActionType }) => {
return {
options: treeZ.value[0].children,
onChange: (valZ: any) => {
const { updateSchema } = formActionType;
formModel.hyxl = null;
if (valZ) {
treeX.value = treeZ.value[0].children.filter((item: any) => item.value === valZ)
updateSchema({
field: 'hyxl',
componentProps: {
options: treeX.value[0].children
}
})
}
}
}
}
})
}
}
}
},
});
}
}
}
},
// componentProps: {
// },
});
} else {
updateSchema({
field: 'hyml',
componentProps: ({ formModel, formActionType }) => {
return {
options: allCategory.value,
onChange: (val: any) => {
const { updateSchema } = formActionType;
updateSchema({
field: 'hyml',
componentProps: ({ formModel, formActionType }) => {
return {
options: val == 1 ? allCategory.value.filter(item => item['is42']) : allCategory.value,
onChange: (val: any) => {
const { updateSchema } = formActionType;
if (val) {
treeD.value = allCategory.value.filter((item: any) => item.value === val)
formModel.hydl = null;
formModel.hyzl = null;
formModel.hyxl = null;
updateSchema({
field: 'hydl',
componentProps: ({ formModel, formActionType }) => {
return {
options: treeD.value[0].children,
onChange: (valD: any) => {
console.log('hydl:', valD);
const { updateSchema } = formActionType;
if (valD != 99) {
formModel.hyzl = null;
formModel.hyxl = null;
formModel.hydlQt = null;
treeZ.value = treeD?.value[0].children.filter((item: any) => item.value === valD)
updateSchema({
field: 'hydlQt',
ifShow: false,
})
updateSchema({
field: 'hyzl',
ifShow: true,
})
updateSchema({
field: 'hyxl',
ifShow: true,
})
updateSchema({
field: 'hyzl',
......@@ -518,7 +442,6 @@ export const formSchema: FormSchema[] = [
options: treeZ.value[0].children,
onChange: (valZ: any) => {
const { updateSchema } = formActionType;
formModel.hyxl = null;
if (valZ) {
treeX.value = treeZ.value[0].children.filter((item: any) => item.value === valZ)
updateSchema({
......@@ -532,33 +455,16 @@ export const formSchema: FormSchema[] = [
}
}
})
} else {
updateSchema({
field: 'hydlQt',
ifShow: true,
})
updateSchema({
field: 'hyzl',
ifShow: false,
})
updateSchema({
field: 'hyxl',
ifShow: false,
})
}
}
}
},
});
}
}
},
});
}
}
},
});
},
};
},
......@@ -580,7 +486,12 @@ export const formSchema: FormSchema[] = [
} else
treeM.value = allCategory.value
return {
options: treeM?.value
options: treeM?.value,
onChange: () => {
formModel.hydl = null;
formModel.hyzl = null;
formModel.hyxl = null;
}
}
}
},
......@@ -596,7 +507,14 @@ export const formSchema: FormSchema[] = [
console.log(formModel.hyml, 'formModel.hyml')
treeD.value = treeM.value.filter((item: any) => item.value === formModel.hyml)
return {
options: treeD?.value[0]?.children || []
options: treeD?.value[0]?.children || [],
onChange: (valD: any) => {
formModel.hyzl = null;
formModel.hyxl = null;
if (valD != 99) {
formModel.hydlQt = null;
}
}
}
}
......@@ -608,12 +526,15 @@ export const formSchema: FormSchema[] = [
labelWidth: 5,
colProps: { span: 5 },
component: 'Select',
ifShow: true,
ifShow: ({ values }) => values.hydl != 99,
componentProps: ({ formModel, formActionType }) => {
if (treeD?.value.length > 0) {
treeZ.value = treeD?.value[0].children.filter((item: any) => item.value === formModel.hydl)
return {
options: treeZ?.value[0]?.children || []
options: treeZ?.value[0]?.children || [],
onChange: () => {
formModel.hyxl = null;
}
}
}
......@@ -627,7 +548,7 @@ export const formSchema: FormSchema[] = [
labelWidth: 5,
colProps: { span: 4 },
component: 'Select',
ifShow: true,
ifShow: ({ values }) => values.hydl != 99,
componentProps: ({ formModel, formActionType }) => {
if (treeZ?.value.length > 0) {
treeX.value = treeZ?.value[0]?.children.filter((item: any) => item.value === formModel.hyzl)
......@@ -641,7 +562,7 @@ export const formSchema: FormSchema[] = [
{
label: '',
field: 'hydlQt',
ifShow: false,
ifShow: ({ values }) => values.hydl == 99,
labelWidth: 5,
colProps: { span: 4 },
component: 'Input',
......@@ -997,4 +918,4 @@ function handeCount(formActionType, formModel) {
},
});
}
}
\ No newline at end of file
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论