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

地区超标分析

上级 b4ac30a8
<template> <template>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #form-userLevle="{ model, field }">
<a-select
v-model:value="model[field]"
placeholder="请选择"
@change="change(model)"
:fieldNames="{ label: 'text', value: 'value' }"
:options="Options"
></a-select>
</template>
<template #tableTitle> <template #tableTitle>
<a-button type="primary" preIcon="ant-design:export-outlined" v-auth="'dqcb-dc'" @click="onExportXls"> 导出</a-button> <a-button type="primary" preIcon="ant-design:export-outlined" v-auth="'dqcb-dc'" @click="onExportXls"> 导出</a-button>
</template> </template>
...@@ -17,7 +8,7 @@ ...@@ -17,7 +8,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { BasicTable } from '@/components/Table'; import { BasicTable } from '@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage'; import { useListPage } from '/@/hooks/system/useListPage';
import { excedColumns, searchExcedFormSchema, getUserLevel } from './data'; import { excedColumns, searchExcedFormSchema } from './data';
import { excedList, dqcbfxExcel } from './api'; import { excedList, dqcbfxExcel } from './api';
const { tableContext, onExportXls } = useListPage({ const { tableContext, onExportXls } = useListPage({
...@@ -60,9 +51,4 @@ ...@@ -60,9 +51,4 @@
}, },
}); });
const [registerTable, { setColumns }, {}] = tableContext; const [registerTable, { setColumns }, {}] = tableContext;
const Options = getUserLevel().data;
function change(model) {
model.cityCode = '';
}
</script> </script>
...@@ -38,27 +38,6 @@ export const useCategoryData = () => { ...@@ -38,27 +38,6 @@ export const useCategoryData = () => {
} }
return { data: treeData, changeIsSuspect }; return { data: treeData, changeIsSuspect };
}; };
// 获取等级
const userIdent = ref<any>([])
export const getUserLevel = () => {
const getIsSuspect = async () => {
if (userStore?.userInfo?.userIdentity == '1') {
userIdent.value = [{
text: '市',
value: '1'
}, {
text: '县',
value: '2'
}
]
}
};
getIsSuspect();
return { data: userIdent };
}
export const excedColumns: BasicColumn[] = [ export const excedColumns: BasicColumn[] = [
{ {
...@@ -92,32 +71,74 @@ export const excedColumns: BasicColumn[] = [ ...@@ -92,32 +71,74 @@ export const excedColumns: BasicColumn[] = [
}, },
] ]
export const searchExcedFormSchema: FormSchema[] = [ export const searchExcedFormSchema: FormSchema[] = [
{
label: '等级',
field: 'level',
component: 'ApiSelect',
show: () => {
return userStore?.userInfo?.userIdentity == '1' ? true : false
},
slot: 'userLevle'
},
{ {
label: '市', label: '市',
field: 'cityCode', field: 'cityCode',
component: 'ApiSelect', component: 'ApiSelect',
show: ({ values }) => { ifShow: () => {
return values.level == '2' ? true : false return userStore?.userInfo?.userIdentity == '1' ? true : false
}, },
componentProps: () => { componentProps: ({ formModel, formActionType }) => {
return { return {
api: getTown, api: getTown,
params: 440000, // 市编码 params: 440000, // 市编码
labelField: 'name', labelField: 'name',
valueField: 'id', valueField: 'id',
onChange: (val: any) => {
const { updateSchema } = formActionType;
formModel.countryCode = undefined;
if (val) {
updateSchema({
field: 'countryCode',
componentProps: {
api: getTown,
params: val,
labelField: 'name',
valueField: 'id',
},
});
} else {
updateSchema({
field: 'countryCode',
componentProps: {
api: undefined,
labelField: 'name',
valueField: 'id',
},
});
}
},
}; };
}, },
}, },
{
label: '县',
field: 'countryCode',
component: 'ApiSelect',
ifShow: () => {
return (userStore?.userInfo?.userIdentity == '2' || userStore?.userInfo?.userIdentity == '1') ? true : false
},
componentProps: ({ formModel, formActionType }) => {
if (userStore?.userInfo?.userIdentity == '2') {
const { updateSchema } = formActionType;
updateSchema({
label: '县',
field: 'countryCode',
ifShow: true,
componentProps: {
api: getTown,
params: userStore?.userInfo?.codeRegion,
labelField: 'name',
valueField: 'id',
},
});
}
return {
labelField: 'name',
valueField: 'id',
}
},
},
// { // {
// label: '政策依据', // label: '政策依据',
// field: 'faliyiju', // field: 'faliyiju',
...@@ -1214,4 +1235,4 @@ export const DcseachFormSchema: FormSchema[] = [ ...@@ -1214,4 +1235,4 @@ export const DcseachFormSchema: FormSchema[] = [
placeholder: '地块名称或地块编码' placeholder: '地块名称或地块编码'
} }
}, },
] ]
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论