提交 0ad491d2 authored 作者: gjx's avatar gjx

修改用户管理,添加统计页面,获取统计区域列表

上级 8d485ca8
......@@ -6,6 +6,7 @@ import { DEFAULT_FILTER_FN, DEFAULT_SORT_FN, FETCH_SETTING, DEFAULT_SIZE } from
import { propTypes } from '/@/utils/propTypes';
export const basicProps = {
listShow: propTypes.bool.def(true),//是否显示列表,给查看图表用的
clickToRowSelect: propTypes.bool.def(true),
isTreeTable: propTypes.bool.def(false),
tableSetting: propTypes.shape<TableSetting>({}),
......
......@@ -15,13 +15,13 @@
</tr>
<tr class="ant-table-cell ant-table-cell-ellipsis">
<td class="ant-table-cell ant-table-cell-ellipsis bgColor">公示</td>
<td class="ant-table-cell ant-table-cell-ellipsis">{{ data.gkfs == 1 ? "网址" : '其它' }}</td>
<td class="ant-table-cell ant-table-cell-ellipsis">{{ data.gkfs == 1 ? '网址' : '其它' }}</td>
<td class="ant-table-cell ant-table-cell-ellipsis bgColor">公示信息</td>
<td class="ant-table-cell ant-table-cell-ellipsis">{{ data?.gswz }}</td>
</tr>
<tr class="ant-table-cell ant-table-cell-ellipsis">
<td class="ant-table-cell ant-table-cell-ellipsis bgColor">{{ labelFirst }}工程措施开始日期</td>
<td class="ant-table-cell ant-table-cell-ellipsis">{{ data?.tmStar }}</td>
<td class="ant-table-cell ant-table-cell-ellipsis">{{ data?.tmStart }}</td>
<td class="ant-table-cell ant-table-cell-ellipsis bgColor">{{ labelFirst }}工程措施结束日期</td>
<td class="ant-table-cell ant-table-cell-ellipsis">{{ data?.tmEnd }}</td>
</tr>
......@@ -40,15 +40,15 @@
</template>
<script lang="ts" setup>
import { defineProps } from 'vue';
const props = defineProps({
data: {
type: Object,
default: () => ({}),
},
labelFirst: {
type: String,
default: ''
}
});
import { defineProps } from 'vue';
const props = defineProps({
data: {
type: Object,
default: () => ({}),
},
labelFirst: {
type: String,
default: '',
},
});
</script>
......@@ -40,7 +40,7 @@
</div>
</div>
</template>
<template #cbgymj="{ model, field }">
<template #cbqymj="{ model, field }">
<a-input-number v-model:value="model[field]" />
</template>
</BasicForm>
......@@ -97,7 +97,7 @@
if (model.wcc) {
model.cbSxz = false;
model.cbGzz = false;
model.cbgymj = 0; // 土壤污染物超标区域面积变为0
model.cbqymj = 0; // 土壤污染物超标区域面积变为0
}
};
//自定义表单字段
......@@ -142,9 +142,9 @@
},
{
label: '土壤污染物超标区域面积(m2)',
field: 'cbgymj',
field: 'cbqymj',
component: 'InputNumber',
slot: 'cbgymj',
slot: 'cbqymj',
ifShow: ({ values }) => {
console.log(values, 'values');
let flg = true;
......@@ -163,7 +163,7 @@
componentProps: ({ formModel, formActionType }) => {
return {
onchange: () => {
emit('gettrMj', formModel.cbgymj);
emit('gettrMj', formModel.cbqymj);
},
};
},
......
......@@ -194,7 +194,7 @@
},
{
label: `${props.labelFirst}工程措施开始日期`,
field: 'tmStar',
field: 'tmStart',
required: true,
component: 'DatePicker',
componentProps: {
......
<template>
<table class="" style="width: 100%" border="1" cellspacing="1">
<tbody>
</tbody><colgroup>
<col class="bg0" width="15%">
<col width="35%">
<col class="bg0" width="15%">
<col width="35%">
<table class="" style="width: 100%" border="1" cellspacing="1">
<tbody> </tbody
><colgroup>
<col class="bg0" width="15%" />
<col width="35%" />
<col class="bg0" width="15%" />
<col width="35%" />
</colgroup>
<tbody>
<tr class="ant-table-cell ant-table-cell-ellipsis" v-if="data.cbGzz || data.cbSxz">
<tr class="ant-table-cell ant-table-cell-ellipsis" v-if="data.cbGzz || data.cbSxz">
<td class="ant-table-cell ant-table-cell-ellipsis bgColor">土壤受污染程度</td>
<td class="ant-table-cell ant-table-cell-ellipsis">{{ data?.cbGzz?'管制值':'' }}{{ data?.cbSxz?'筛选值':'' }}</td>
<td class="ant-table-cell ant-table-cell-ellipsis">{{ data?.cbGzz ? '管制值' : '' }}{{ data?.cbSxz ? '筛选值' : '' }}</td>
<td class="ant-table-cell ant-table-cell-ellipsis bgColor">土壤污染物超标区域面积(m<sup>2</sup>)</td>
<td class="ant-table-cell ant-table-cell-ellipsis">{{ data?.cbgymj }}</td>
</tr>
<tr class="ant-table-cell ant-table-cell-ellipsis" v-else>
<td class="ant-table-cell ant-table-cell-ellipsis">{{ data?.cbqymj }}</td>
</tr>
<tr class="ant-table-cell ant-table-cell-ellipsis" v-else>
<td class="ant-table-cell ant-table-cell-ellipsis bgColor" width="15%">土壤受污染程度</td>
<td class="ant-table-cell ant-table-cell-ellipsis" colspan="3">未超出</td>
</tr>
<tr class="ant-table-cell ant-table-cell-ellipsis">
</tr>
<tr class="ant-table-cell ant-table-cell-ellipsis">
<td class="ant-table-cell ant-table-cell-ellipsis bgColor" v-if="data.cbSxz">土壤超过筛选值的污染物</td>
<td class="ant-table-cell ant-table-cell-ellipsis" v-if="data.cbSxz">{{ data?.wrwSxz }}</td>
<td class="ant-table-cell ant-table-cell-ellipsis bgColor" v-if="data.cbGzz">土壤超过管制值的污染物</td>
<td class="ant-table-cell ant-table-cell-ellipsis" v-if="data.cbGzz">{{ data?.wrwGzz }}</td>
</tr>
<tr class="ant-table-cell ant-table-cell-ellipsis">
</tr>
<tr class="ant-table-cell ant-table-cell-ellipsis">
<td class="ant-table-cell ant-table-cell-ellipsis bgColor">地下水是否污染</td>
<td class="ant-table-cell ant-table-cell-ellipsis">{{ data?.sfWr?'是':'否'}}</td>
<td class="ant-table-cell ant-table-cell-ellipsis">{{ data?.sfWr ? '是' : '否' }}</td>
<td class="ant-table-cell ant-table-cell-ellipsis bgColor">地下水是否作为饮用水源</td>
<td class="ant-table-cell ant-table-cell-ellipsis">{{ data?.sfYysy?'是':'否' }}</td>
</tr>
<td class="ant-table-cell ant-table-cell-ellipsis">{{ data?.sfYysy ? '是' : '否' }}</td>
</tr>
</tbody>
</table>
</table>
</template>
<script lang="ts" setup>
import { defineProps } from 'vue';
const props = defineProps({
const props = defineProps({
labelFirst: {
type: String,
default: '初步'
type: String,
default: '初步',
},
data:{
type: Object,
default: ()=>{}
data: {
type: Object,
default: () => {},
},
})
// function labelFn() {
// console.log('处理props数据',props);
// }
});
// function labelFn() {
// console.log('处理props数据',props);
// }
</script>
<style scoped>
table {
table {
border-collapse: collapse;
border: 1px #dfe6ec solid
}
border: 1px #dfe6ec solid;
}
tbody tr td {
tbody tr td {
padding: 6px;
height: 40px;
}
}
.bgColor {
.bgColor {
background-color: rgba(244, 247, 249, 0.8);
text-align: center;
}
</style>
\ No newline at end of file
}
</style>
......@@ -99,11 +99,11 @@
return false;
}
}
if (new Date(res.tmStar) > new Date(res.tmEnd)) {
if (new Date(res.tmStart) > new Date(res.tmEnd)) {
createMessage.warn('风险管控工程措施开始日期不能大于风险管控工程措施结束日期');
return;
}
// if (new Date(res.fbsj) > new Date(res.tmStar)) {
// if (new Date(res.fbsj) > new Date(res.tmStart)) {
// createMessage.warn('风险管控方案编制完成日期不能大于风险管控工程措施开始日期');
// return;
// }
......
......@@ -4,7 +4,7 @@ import { convertTreeData } from '/@/utils/modifFiled';
import { useUserStore } from '/@/store/modules/user';
import { ref } from 'vue';
const userStore:any = useUserStore();
const userStore: any = useUserStore();
export const useSuspectsData = () => {
const suspects = ref([]);
......@@ -42,7 +42,7 @@ export const useCategoryData = () => {
};
export const columns: BasicColumn[] = [
{
{
title: '市',
dataIndex: 'cityName',
},
......@@ -75,10 +75,10 @@ export const columns: BasicColumn[] = [
dataIndex: 'tcdw',
customRender: ({ record }: any) => {
if (record.tcwr == '0') {
return '未退出'
return '未退出'
} else if (record.tcwr == '1')
return '已退出'
else if(record.tcwr == '2') return '申请退出'
else if (record.tcwr == '2') return '申请退出'
},
},
{
......@@ -98,7 +98,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'cityCode',
component: 'ApiSelect',
ifShow: () => {
return userStore?.userInfo?.userIdentity=='1'?true:false
return userStore?.userInfo?.userIdentity == '1' ? true : false
},
componentProps: ({ formModel, formActionType }) => {
return {
......@@ -134,10 +134,10 @@ export const searchFormSchema: FormSchema[] = [
field: 'countryCode',
component: 'ApiSelect',
ifShow: () => {
return (userStore?.userInfo?.userIdentity=='2'|| userStore?.userInfo?.userIdentity=='1')?true:false
return (userStore?.userInfo?.userIdentity == '2' || userStore?.userInfo?.userIdentity == '1') ? true : false
},
componentProps: ({ formModel, formActionType }) => {
if (userStore?.userInfo?.userIdentity=='2') {
componentProps: ({ formModel, formActionType }) => {
if (userStore?.userInfo?.userIdentity == '2') {
const { updateSchema } = formActionType;
updateSchema({
label: '区县',
......
......@@ -135,11 +135,11 @@
return false;
}
}
if (new Date(res.tmStar) > new Date(res.tmEnd)) {
if (new Date(res.tmStart) > new Date(res.tmEnd)) {
createMessage.warn('管控及修复工程措施开始日期不能大于管控及修复工程措施结束日期');
return;
}
// if (new Date(res.fbsj) > new Date(res.tmStar)) {
// if (new Date(res.fbsj) > new Date(res.tmStart)) {
// createMessage.warn('管控及修复方案编制完成日期不能大于管控及修复工程措施开始日期');
// return;
// }
......
......@@ -422,7 +422,7 @@
if (!dsInfor.value?.wrdkjbxxb.zdmj) {
createMessage.warn('请先填写地块占地面积并保存地块信息');
return;
} else if (dsInfor.value?.wrdkjbxxb.zdmj < res.cbgymj) {
} else if (dsInfor.value?.wrdkjbxxb.zdmj < res.cbqymj) {
createMessage.warn('土壤污染物超标区域面积不能超过地块占地面积');
return;
}
......
......@@ -135,11 +135,11 @@
return false;
}
}
if (new Date(res.tmStar) > new Date(res.tmEnd)) {
if (new Date(res.tmStart) > new Date(res.tmEnd)) {
createMessage.warn('修复工程措施开始日期不能大于修复工程措施结束日期');
return;
}
// if (new Date(res.fbsj) > new Date(res.tmStar)) {
// if (new Date(res.fbsj) > new Date(res.tmStart)) {
// createMessage.warn('修复方案编制完成日期不能大于修复工程措施开始日期');
// return;
// }
......
......@@ -8,17 +8,31 @@
:showFooter="showFooter"
destroyOnClose
>
<BasicForm @register="registerForm" />
<BasicForm @register="registerForm">
<template #level="{ model, field }">
<a-select
v-model:value="model[field]"
placeholder="请选择"
@change="changLevel($event, model, '')"
:fieldNames="{ label: 'text', value: 'value' }"
:options="Options"
></a-select>
</template>
<template #codeRegion="{ model, field }">
<a-cascader v-model:value="model[field]" :options="Codeoptions" placeholder="请选择行政区域" :fieldNames="{ label: 'name', value: 'id' }" />
</template>
</BasicForm>
</BasicDrawer>
</template>
<script lang="ts" setup>
import { defineComponent, ref, computed, unref, useAttrs } from 'vue';
import { defineComponent, ref, computed, unref, useAttrs, toRaw } from 'vue';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from './user.data';
import { formSchema, getUserLevel } from './user.data';
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
import { saveOrUpdateUser, getUserRoles, getUserDepartList, getAllRolesListNoByTenant, getAllRolesList } from './user.api';
import { useDrawerAdaptiveWidth } from '/@/hooks/jeecg/useAdaptiveWidth';
import { getTenantId } from "/@/utils/auth";
import { getTenantId } from '/@/utils/auth';
import { getTown, cityTree } from '@/api/common/api';
// 声明Emits
const emit = defineEmits(['success', 'register']);
......@@ -73,6 +87,16 @@
//update-begin---author:zyf Date:20211210 for:避免空值显示异常------------
data.record.departIds = data.record.departIds == '' ? [] : data.record.departIds;
//update-begin---author:zyf Date:20211210 for:避免空值显示异常------------
await changLevel(data.record.userIdentity, data.record, 'edit');
// 行政区域的赋值
if (data.record.userIdentity != 1 && data.record.userIdentity != 2) {
// 判断是否包含,如果包含说明已经赋值了
if (!data.record.codeRegion.includes(',') && !Array.isArray(data.record.codeRegion)) {
data.record.codeRegion = `${data.record.cityCode},${data.record.codeRegion}`;
data.record.codeRegion = data.record.codeRegion.split(',');
}
}
}
//处理角色用户列表情况(和角色列表有关系)
data.selectedroles && (await setFieldsValue({ selectedroles: data.selectedroles }));
......@@ -103,23 +127,23 @@
show: !data?.departDisabled ?? false,
//update-begin---author:wangshuai ---date:20230424 for:【issues/4844】多租户模式下,新增或编辑用户,选择角色一栏,角色选项没有做租户隔离------------
//判断是否为多租户模式
componentProps:{
api: data.tenantSaas?getAllRolesList:getAllRolesListNoByTenant
}
componentProps: {
api: data.tenantSaas ? getAllRolesList : getAllRolesListNoByTenant,
},
//update-end---author:wangshuai ---date:20230424 for:【issues/4844】多租户模式下,新增或编辑用户,选择角色一栏,角色选项没有做租户隔离------------
},
//update-begin---author:wangshuai ---date:20230522 for:【issues/4935】租户用户编辑界面中租户下拉框未过滤,显示当前系统所有的租户------------
{
field: 'relTenantIds',
componentProps:{
componentProps: {
disabled: !!data.tenantSaas,
},
},
//update-end---author:wangshuai ---date:20230522 for:【issues/4935】租户用户编辑界面中租户下拉框未过滤,显示当前系统所有的租户------------
]);
//update-begin---author:wangshuai ---date:20230522 for:【issues/4935】租户用户编辑界面中租户下拉框未过滤,显示当前系统所有的租户------------
if(!unref(isUpdate) && data.tenantSaas){
await setFieldsValue({ relTenantIds: getTenantId().toString() })
if (!unref(isUpdate) && data.tenantSaas) {
await setFieldsValue({ relTenantIds: getTenantId().toString() });
}
//update-end---author:wangshuai ---date:20230522 for:【issues/4935】租户用户编辑界面中租户下拉框未过滤,显示当前系统所有的租户------------
// 无论新增还是编辑,都可以设置表单值
......@@ -136,6 +160,26 @@
//获取标题
const getTitle = computed(() => (!unref(isUpdate) ? '新增用户' : '编辑用户'));
const { adaptiveWidth } = useDrawerAdaptiveWidth();
const Options = getUserLevel().data;
const Codeoptions = ref<any>([]);
async function changLevel(v, model, type) {
if (type != 'edit') model.codeRegion = '';
if (v == '1') {
Codeoptions.value = [
{
name: '广东省',
id: '440000',
},
];
} else if (v == '2') {
const res = await getTown({ id: 440000 });
Codeoptions.value = res;
} else {
// 区县土地使用权人
const res = await cityTree();
Codeoptions.value = res[0].children;
}
}
//提交事件
async function handleSubmit() {
......@@ -144,12 +188,20 @@
setDrawerProps({ confirmLoading: true });
values.userIdentity === 1 && (values.departIds = '');
let isUpdateVal = unref(isUpdate);
const params = toRaw(values);
if (params.userIdentity != 1 && params.userIdentity != 2) {
const codeRegion = values.codeRegion.split(',');
params.cityCode = codeRegion[0];
params.codeRegion = codeRegion[1];
}
//提交表单
await saveOrUpdateUser(values, isUpdateVal);
await saveOrUpdateUser(params, isUpdateVal);
//关闭弹窗
closeDrawer();
//刷新列表
emit('success',{isUpdateVal ,values});
emit('success', { isUpdateVal, values });
} finally {
setDrawerProps({ confirmLoading: false });
}
......
......@@ -137,7 +137,6 @@
async function handleEdit(record: Recordable) {
// 用户等级要转正字符串
record.userIdentity = String(record.userIdentity);
console.log(record, 'record');
openDrawer(true, {
record,
isUpdate: true,
......
......@@ -155,6 +155,16 @@ export const searchFormSchema: FormSchema[] = [
// cityTree
},
];
// 获取等级
const userIdent = ref<any>([])
export const getUserLevel = () => {
const getIsSuspect = async () => {
userIdent.value = await dict({ key: 'user_levle' })
}
getIsSuspect();
return { data: userIdent };
}
// 新增
export const formSchema: FormSchema[] = [
{
......@@ -258,6 +268,7 @@ export const formSchema: FormSchema[] = [
field: 'userIdentity',
component: 'ApiSelect',
required: true,
slot: 'level',
componentProps: ({ formModel, formActionType }) => {
{
return {
......@@ -269,6 +280,7 @@ export const formSchema: FormSchema[] = [
const { updateSchema } = formActionType;
if (v) {
console.log(v, 'v')
formModel.codeRegion = ''
updateSchema({
field: 'codeRegion',
componentProps: {
......@@ -286,8 +298,8 @@ export const formSchema: FormSchema[] = [
field: 'codeRegion',
required: true,
component: 'JTreeSelect',
slot: 'codeRegion',
componentProps: ({ formModel, formActionType }) => {
console.log(formModel.codeRegion, '44444')
{
return {
url: '/sys/api/tree/xzbm',
......
<template>
<BasicTable @register="registerTable">
<template #form-userLevle="{ model, field }">
<a-select v-model:value="model[field]" placeholder="请选择" :fieldNames="{ label: 'text', value: 'value' }" :options="Options"></a-select>
</template>
<template #tableTitle>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
</template>
</BasicTable>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { BasicTable } from '@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { excedColumns, searchExcedFormSchema, getUserLevel } from './data';
import { excedList } from './api';
const { tableContext, onExportXls } = useListPage({
tableProps: {
title: '',
api: excedList,
columns: excedColumns,
canResize: false,
//定义rowSelection的类型,默认是checkbox多选,可以设置成radio单选
rowKey: 'wrdkid',
clickToRowSelect: true,
showActionColumn: false,
formConfig: {
labelWidth: 120,
schemas: searchExcedFormSchema,
autoSubmitOnEnter: true,
showAdvancedButton: false,
},
actionColumn: {
width: 120,
fixed: 'right',
},
},
});
const [registerTable, { reload }, { rowSelection, selectedRows, selectedRowKeys }] = tableContext;
const Options = getUserLevel().data;
</script>
import { defHttp } from '/@/utils/http/axios';
// 地区超标分析
export const excedList = (params) => {
return defHttp.get({ url: `/jsyd/dqcbfx`, params });
}
\ No newline at end of file
import { BasicColumn, FormSchema } from '/@/components/Table';
import { dict } from '/@/api/common/api'
import { useUserStore } from '/@/store/modules/user';
import { ref } from 'vue';
const userStore: any = useUserStore();
// 获取等级
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[] = [
{
title: '行政区划',
dataIndex: 'name',
resizable: true,
},
{
title: '地块总数',
dataIndex: 'total',
sorter: true,
resizable: true,
},
{
title: '未评审地块数量',
dataIndex: 'wpsTotal',
sorter: true,
resizable: true,
},
{
title: '未超标地块数量',
dataIndex: 'wcbTotal',
sorter: true,
resizable: true,
},
{
title: '超标地块数量',
dataIndex: 'cbTotal',
sorter: true,
resizable: true,
},
]
export const searchExcedFormSchema: FormSchema[] = [
{
label: '等级',
field: 'userIdentity',
component: 'ApiSelect',
show: () => {
return userStore?.userInfo?.userIdentity == '1' ? true : false
},
slot: 'userLevle'
},
{
label: '政策依据',
field: 'faliyiju',
component: 'JSearchSelect',
componentProps: {
dict: 'dk_zcyj',
},
},
// {
// label: '政策依据二级',
// field: 'faliErji',
// component: 'ApiSelect',
// show: ({ values }) => {
// return values?.faliyiju == 1
// },
// componentProps: {
// api: dict,
// params: { key: 'dk_zcyjej' },
// labelField: 'text',
// valueField: 'value'
// },
// },
]
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论