This commit is contained in:
@@ -207,13 +207,13 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '计费单价',
|
||||
fieldName: 'unitPrice',
|
||||
component: 'Input',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '附加费',
|
||||
fieldName: 'surcharge',
|
||||
component: 'Input',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
},
|
||||
];
|
||||
|
@@ -52,16 +52,19 @@ async function fetchWorkOrderCount() {
|
||||
const satisfactionLevel = ref<EchartsUIType>();
|
||||
const { renderEcharts: renderSatisfactionLevel } = useEcharts(satisfactionLevel);
|
||||
async function fetchSatisfactionLevel() {
|
||||
seriesData.value = board.value.satisfactionRateList.map(item => {
|
||||
return `${item.value}`;
|
||||
})
|
||||
renderSatisfactionLevel({
|
||||
title: {text: '满意度指数',left: '18px'},
|
||||
tooltip: { trigger: 'item'},
|
||||
radar: {
|
||||
indicator: [
|
||||
{name: '1星', max: 1000},
|
||||
{name: '2星', max: 1000},
|
||||
{name: '3星', max: 1000},
|
||||
{name: '4星', max: 1000},
|
||||
{name: '5星', max: 1000},
|
||||
{name: '1星'},
|
||||
{name: '2星'},
|
||||
{name: '3星'},
|
||||
{name: '4星'},
|
||||
{name: '5星'},
|
||||
]
|
||||
},
|
||||
series: [
|
||||
@@ -70,7 +73,7 @@ async function fetchSatisfactionLevel() {
|
||||
name: '满意度指数',
|
||||
data: [
|
||||
{
|
||||
value: [500, 400, 800, 600, 400],
|
||||
value: seriesData.value,
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -157,8 +160,12 @@ async function fetchOrderTyper() {
|
||||
})
|
||||
}
|
||||
|
||||
const goToProperty = () => {
|
||||
router.push('/property')
|
||||
const goOrderPool = () => {
|
||||
router.push('/property/business/workOrders')
|
||||
}
|
||||
|
||||
const goToDo = () => {
|
||||
router.push('/property/business/workOrderPending')
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
@@ -180,7 +187,7 @@ onMounted(async () => {
|
||||
<div>
|
||||
<div>工单总数:</div>
|
||||
<div>{{ board.workOrdersTotal }}</div>
|
||||
<div style="color: #1890FF" @click="goToProperty()">点击前往工单池</div>
|
||||
<div style="color: #1890FF;cursor: pointer" @click="goOrderPool()">点击前往工单池</div>
|
||||
</div>
|
||||
<div class="icon-edit"><EditOutlined /></div>
|
||||
</div>
|
||||
@@ -188,7 +195,7 @@ onMounted(async () => {
|
||||
<div>
|
||||
<div>待派工单数:</div>
|
||||
<div>{{ board.notWorkOrdersTotal }}</div>
|
||||
<div style="color: #1890FF">点击前往工单待办</div>
|
||||
<div style="color: #1890FF;cursor: pointer" @click="goToDo()">点击前往工单待办</div>
|
||||
</div>
|
||||
<div class="icon-edit"><EditOutlined /></div>
|
||||
</div>
|
||||
@@ -226,8 +233,8 @@ onMounted(async () => {
|
||||
<div style="margin-left: 20px;line-height: 30px">
|
||||
<div>累计处理工单数</div>
|
||||
<div>12</div>
|
||||
<div>累计回复数</div>
|
||||
<div>2</div>
|
||||
<!-- <div>累计回复数</div>-->
|
||||
<!-- <div>2</div>-->
|
||||
</div>
|
||||
</div>
|
||||
<EchartsUI
|
||||
|
@@ -2,7 +2,14 @@
|
||||
import type {ContingenPlanVO} from '#/api/property/customerService/contingenPlan/model';
|
||||
import {shallowRef} from 'vue';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {Descriptions, DescriptionsItem, Rate} from 'ant-design-vue';
|
||||
import {
|
||||
Descriptions,
|
||||
DescriptionsItem,
|
||||
Divider,
|
||||
Rate,
|
||||
Timeline,
|
||||
TimelineItem
|
||||
} from 'ant-design-vue';
|
||||
import {contingenPlanInfo} from '#/api/property/customerService/contingenPlan';
|
||||
import {renderDict} from "#/utils/render";
|
||||
|
||||
@@ -14,7 +21,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
});
|
||||
|
||||
const contingenPlanIDetail = shallowRef<null | ContingenPlanVO>(null);
|
||||
|
||||
const handleRecords = shallowRef<null | ContingenPlanVO>(null);
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
@@ -23,6 +30,12 @@ async function handleOpenChange(open: boolean) {
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
const response = await contingenPlanInfo(id);
|
||||
contingenPlanIDetail.value = response;
|
||||
handleRecords.value = response.contingenPlanRecordVos.map(item => ({
|
||||
status: item.status,
|
||||
createTime: item.createTime,
|
||||
handlerName: item.dutyPersionName
|
||||
}));
|
||||
console.log(handleRecords.value)
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
</script>
|
||||
@@ -65,5 +78,19 @@ async function handleOpenChange(open: boolean) {
|
||||
<Rate :value="contingenPlanIDetail.grade" disabled />
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
|
||||
<Divider orientation="left" orientation-margin="0px">
|
||||
处理记录
|
||||
</Divider>
|
||||
<Timeline>
|
||||
<TimelineItem v-for="(item,index) in handleRecords" :key="index">
|
||||
<p style="display: flex;">类型:
|
||||
<component
|
||||
:is="renderDict(item.status,'pro_exercise_status')"
|
||||
/></p>
|
||||
<p>时间:{{item.createTime}}</p>
|
||||
<p>处理人:{{item.handlerName}}</p>
|
||||
</TimelineItem>
|
||||
</Timeline>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
@@ -15,7 +15,7 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
label: '预案类型',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
component: 'ApiSelect',
|
||||
fieldName: 'dutyPersion',
|
||||
label: '责任人',
|
||||
},
|
||||
@@ -92,7 +92,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 180,
|
||||
width: 240,
|
||||
},
|
||||
];
|
||||
|
||||
|
@@ -7,11 +7,12 @@ import {
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {onMounted} from "vue";
|
||||
import {
|
||||
contingenPlanExport,
|
||||
contingenPlanList,
|
||||
contingenPlanRemove,
|
||||
contingenPlanUpdate
|
||||
} from '#/api/property/customerService/contingenPlan';
|
||||
import type { ContingenPlanForm } from '#/api/property/customerService/contingenPlan/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
@@ -19,6 +20,8 @@ import { commonDownloadExcel } from '#/utils/file/download';
|
||||
import contingenPlanModal from './contingenPlan-modal.vue';
|
||||
import contingenPlanDetail from './contingenPlan-detail.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
import {personList} from "#/api/property/resident/person";
|
||||
import {renderDictValue} from "#/utils/render";
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@@ -93,6 +96,12 @@ async function handleDelete(row: Required<ContingenPlanForm>) {
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
async function handleExamine(row: Required<ContingenPlanForm>) {
|
||||
row.status = '1'
|
||||
await contingenPlanUpdate(row);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<ContingenPlanForm>) => row.id);
|
||||
@@ -112,6 +121,36 @@ function handleDownloadExcel() {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
});
|
||||
}
|
||||
|
||||
async function queryPersonData() {
|
||||
let params = {
|
||||
pageSize: 1000,
|
||||
pageNum: 1,
|
||||
}
|
||||
const res = await personList(params);
|
||||
const options = res.rows.map((user) => ({
|
||||
label: user.userName + '-' + renderDictValue(user.gender, 'sys_user_sex') + '-' + user.phone,
|
||||
value: user.id,
|
||||
}));
|
||||
tableApi.formApi.updateSchema([
|
||||
{
|
||||
componentProps: () => ({
|
||||
options: options,
|
||||
showSearch:true,
|
||||
filterOption: filterOption
|
||||
}),
|
||||
fieldName: 'dutyPersion',
|
||||
}
|
||||
])
|
||||
}
|
||||
|
||||
const filterOption = (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await queryPersonData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -144,12 +183,26 @@ function handleDownloadExcel() {
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<Popconfirm
|
||||
v-if="row.status === '0'"
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认审核?"
|
||||
@confirm="handleExamine(row)"
|
||||
>
|
||||
<ghost-button
|
||||
@click.stop=""
|
||||
>
|
||||
{{ '审核' }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
<ghost-button
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-if="row.status === '0'"
|
||||
v-access:code="['system:contingenPlan:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
|
@@ -122,11 +122,11 @@ function handleDownloadExcel() {
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['system:feedbacks:info']"
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
v-access:code="['system:feedbacks:info']"
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['system:feedbacks:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import {type FormSchemaGetter, z} from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
import {renderDict} from "#/utils/render";
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
@@ -11,57 +12,50 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_information_type'),
|
||||
},
|
||||
fieldName: 'type',
|
||||
label: '类型',
|
||||
label: '信息类型',
|
||||
},
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '信息ID',
|
||||
field: 'id',
|
||||
},
|
||||
{
|
||||
title: '标题',
|
||||
field: 'title',
|
||||
minWidth: 180
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
title: '信息类型',
|
||||
field: 'type',
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
title: '是否全小区公告',
|
||||
field: 'isAll',
|
||||
width: 150
|
||||
slots:{
|
||||
default: ({row})=>{
|
||||
return renderDict(row.type,'pro_information_type')
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
field: 'startTime',
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
field: 'endTime',
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
title: '公告内容',
|
||||
field: 'afficheContent',
|
||||
width: 150
|
||||
title: '发布人',
|
||||
field: 'issuers',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 180,
|
||||
width:'180'
|
||||
},
|
||||
];
|
||||
|
||||
@@ -78,26 +72,41 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '标题',
|
||||
fieldName: 'title',
|
||||
component: 'Textarea',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '类型',
|
||||
label: '公告类型',
|
||||
fieldName: 'type',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_information_type'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
fieldName: 'remark',
|
||||
component: 'Textarea',
|
||||
label: '全小区公告',
|
||||
fieldName: 'isAll',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_sf'),
|
||||
},
|
||||
rules: 'required',
|
||||
formItemClass: 'col-span-2',
|
||||
},
|
||||
{
|
||||
label: '是否全小区公告',
|
||||
fieldName: 'isAll',
|
||||
component: 'Input',
|
||||
label: '通知人',
|
||||
fieldName: 'noticePersion',
|
||||
component: 'ApiSelect',
|
||||
componentProps:{
|
||||
mode: 'multiple',
|
||||
},
|
||||
rules: z.array(z.string()).min(1, { message: '请选择巡检人员' }),
|
||||
formItemClass: 'col-span-2',
|
||||
dependencies: {
|
||||
show: (formValue) =>formValue.isAll==1 ,
|
||||
triggerFields: ['isAll'],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '开始时间',
|
||||
@@ -108,6 +117,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '结束时间',
|
||||
@@ -118,6 +128,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '公告内容',
|
||||
@@ -128,10 +139,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
// height: 400 // 高度 默认400
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '发布人',
|
||||
fieldName: 'issuers',
|
||||
component: 'Input',
|
||||
formItemClass: 'col-span-2'
|
||||
},
|
||||
];
|
||||
|
@@ -12,13 +12,11 @@ import {
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
noticesExport,
|
||||
noticesList,
|
||||
noticesRemove,
|
||||
} from '#/api/property/customerService/notices';
|
||||
import type { NoticesForm } from '#/api/property/customerService/notices/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import noticesDetail from './notices-detail.vue';
|
||||
import noticesModal from './notices-modal.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
|
||||
@@ -31,15 +29,6 @@ const formOptions: VbenFormProps = {
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
||||
// 不需要直接删除
|
||||
// fieldMappingTime: [
|
||||
// [
|
||||
// 'createTime',
|
||||
// ['params[beginTime]', 'params[endTime]'],
|
||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
||||
// ],
|
||||
// ],
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
@@ -84,6 +73,15 @@ const [NoticesModal, modalApi] = useVbenModal({
|
||||
connectedComponent: noticesModal,
|
||||
});
|
||||
|
||||
const [noticesDetailModal, noticesDetailApi] = useVbenModal({
|
||||
connectedComponent: noticesDetail,
|
||||
});
|
||||
|
||||
async function handleInfo(row: Required<NoticesForm>) {
|
||||
noticesDetailApi.setData({ id: row.id });
|
||||
noticesDetailApi.open();
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
@@ -112,12 +110,6 @@ function handleMultiDelete() {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(noticesExport, '客户服务-通知公告数据', tableApi.formApi.form.values, {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -125,12 +117,6 @@ function handleDownloadExcel() {
|
||||
<BasicTable table-title="通知公告列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
v-access:code="['domain:notices:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
@@ -150,6 +136,11 @@ function handleDownloadExcel() {
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['domain:notices:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
@@ -174,5 +165,6 @@ function handleDownloadExcel() {
|
||||
</template>
|
||||
</BasicTable>
|
||||
<NoticesModal @reload="tableApi.query()" />
|
||||
<noticesDetailModal/>
|
||||
</Page>
|
||||
</template>
|
||||
|
@@ -0,0 +1,60 @@
|
||||
<script setup lang="ts">
|
||||
import {shallowRef} from 'vue';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {noticesInfo} from "#/api/property/customerService/notices";
|
||||
import type {NoticesVO} from "#/api/property/customerService/notices/model";
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: handleOpenChange,
|
||||
onClosed() {
|
||||
noticesDetail.value = null;
|
||||
},
|
||||
});
|
||||
|
||||
const noticesDetail = shallowRef<null | NoticesVO>(null);
|
||||
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
noticesDetail.value = await noticesInfo(id);
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="意见反馈详情" class="w-[70%]">
|
||||
<Descriptions v-if="noticesDetail" size="small" :column="2" bordered
|
||||
:labelStyle="{width:'120px'}">
|
||||
<DescriptionsItem label="标题">
|
||||
{{ noticesDetail.title }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="公告类型">
|
||||
<component
|
||||
:is="renderDict(noticesDetail.type,'pro_information_type')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="全小区公告">
|
||||
<component
|
||||
:is="renderDict(noticesDetail.isAll,'wy_sf')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="通知人">
|
||||
{{ noticesDetail.noticePersion }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="开始时间">
|
||||
{{ noticesDetail.startTime }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="结束时间">
|
||||
{{ noticesDetail.endTime }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="公告内容">
|
||||
<div v-html="noticesDetail.afficheContent"></div>
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
</BasicModal>
|
||||
</template>
|
@@ -10,6 +10,8 @@ import { noticesAdd, noticesInfo, noticesUpdate } from '#/api/property/customerS
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
import {personList} from "#/api/property/resident/person";
|
||||
import {renderDictValue} from "#/utils/render";
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
@@ -21,7 +23,7 @@ const title = computed(() => {
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
formItemClass: 'col-span-1',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
@@ -43,7 +45,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
class: 'w-[60%]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
@@ -53,12 +55,15 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
await queryPersonData()
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await noticesInfo(id);
|
||||
if(record.isAll === '0'){
|
||||
record.noticePersion = null
|
||||
}
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
@@ -76,6 +81,7 @@ async function handleConfirm() {
|
||||
}
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
data.noticePersion = data.noticePersion?.join(',')
|
||||
await (isUpdate.value ? noticesUpdate(data) : noticesAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
@@ -91,6 +97,32 @@ async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
}
|
||||
|
||||
async function queryPersonData() {
|
||||
let params = {
|
||||
pageSize: 1000,
|
||||
pageNum: 1,
|
||||
}
|
||||
const res = await personList(params);
|
||||
const options = res.rows.map((user) => ({
|
||||
label: user.userName + '-' + renderDictValue(user.gender, 'sys_user_sex')
|
||||
+ '-' + user.phone + '-' + user.unitName,
|
||||
value: user.id,
|
||||
}));
|
||||
formApi.updateSchema([{
|
||||
componentProps: () => ({
|
||||
options: options,
|
||||
showSearch: true,
|
||||
filterOption: filterOption,
|
||||
mode: 'multiple',
|
||||
}),
|
||||
fieldName: 'noticePersion',
|
||||
}])
|
||||
}
|
||||
|
||||
const filterOption = (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
Reference in New Issue
Block a user