Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
This commit is contained in:
@@ -64,7 +64,7 @@ export interface WorkOrdersVO {
|
||||
/**
|
||||
* 评价
|
||||
*/
|
||||
serviceEvalua: string;
|
||||
serviceEvalua: number;
|
||||
|
||||
/**
|
||||
* 是否超时
|
||||
@@ -82,6 +82,8 @@ export interface WorkOrdersVO {
|
||||
* 评价图片
|
||||
*/
|
||||
imgUrl: string;
|
||||
|
||||
evaluateImgPath: string | undefined;
|
||||
/**
|
||||
* 评价内容
|
||||
*/
|
||||
@@ -99,6 +101,12 @@ export interface WorkOrdersVO {
|
||||
*/
|
||||
orderImgUrl: string;
|
||||
|
||||
orderImgPath: string|undefined;
|
||||
|
||||
reportingType: string;
|
||||
|
||||
processingWeight: string;
|
||||
|
||||
}
|
||||
|
||||
export interface HandleRecords {
|
||||
|
@@ -144,6 +144,16 @@ export interface Clean_orderForm extends BaseEntity {
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 签到图片
|
||||
*/
|
||||
signImgUrl?: string;
|
||||
|
||||
/**
|
||||
* 评价图片
|
||||
*/
|
||||
imgUrl?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface Clean_orderQuery extends PageQuery {
|
||||
|
@@ -21,6 +21,8 @@ export interface KnowledgeVO {
|
||||
*/
|
||||
covers: string;
|
||||
|
||||
coversPath: string|undefined;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
|
@@ -26,6 +26,8 @@ export interface PropertyVO {
|
||||
*/
|
||||
imgPath: string;
|
||||
|
||||
plantImg: string;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@@ -102,7 +104,6 @@ export interface PropertyForm extends BaseEntity {
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface PropertyQuery extends PageQuery {
|
||||
@@ -178,6 +179,8 @@ export interface plantsProduct extends BaseEntity {
|
||||
*/
|
||||
imgPath?: string;
|
||||
|
||||
plantImg: string |undefined;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
|
@@ -31,6 +31,8 @@ export interface PersonVO {
|
||||
*/
|
||||
img: string
|
||||
|
||||
imgPath?: string
|
||||
|
||||
/**
|
||||
* 所属单位id
|
||||
*/
|
||||
@@ -79,6 +81,10 @@ export interface PersonVO {
|
||||
|
||||
rosterType?: string | number
|
||||
|
||||
email?: string
|
||||
|
||||
idCard?: string
|
||||
|
||||
}
|
||||
|
||||
export interface PersonForm extends BaseEntity {
|
||||
|
@@ -67,6 +67,8 @@ export interface MeetVO {
|
||||
* 图片
|
||||
*/
|
||||
picture: string;
|
||||
|
||||
pictureArr: string[];
|
||||
/**
|
||||
* 开放时段开始时间
|
||||
*/
|
||||
@@ -75,6 +77,19 @@ export interface MeetVO {
|
||||
* 开放时段结束时间
|
||||
*/
|
||||
openEndHours: string;
|
||||
|
||||
/**
|
||||
* 会议室类型
|
||||
*/
|
||||
meetingRoomType: string;
|
||||
/**
|
||||
* 位置
|
||||
*/
|
||||
locationName: string;
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
principalsName: string;
|
||||
}
|
||||
|
||||
export interface MeetForm extends BaseEntity {
|
||||
@@ -161,6 +176,8 @@ export interface MeetForm extends BaseEntity {
|
||||
*/
|
||||
picture: string;
|
||||
|
||||
pictureArr: string[];
|
||||
|
||||
/**
|
||||
* 开放时段开始时间
|
||||
*/
|
||||
|
@@ -8,6 +8,7 @@ import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {workOrdersInfo} from "#/api/property/businessManagement/workOrders";
|
||||
import type {HandleRecords, WorkOrdersVO} from "#/api/property/businessManagement/workOrders/model";
|
||||
import {ossInfo} from "#/api/system/oss";
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
@@ -28,12 +29,24 @@ async function handleOpenChange(open: boolean) {
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
orderDetail.value = await workOrdersInfo(id);
|
||||
if(orderDetail.value){
|
||||
if(orderDetail.value.workOrdersRecordVoList){
|
||||
handleRecords.value = orderDetail.value.workOrdersRecordVoList.map( (item, index) => ({
|
||||
status: item.status,
|
||||
createTime: item.createTime,
|
||||
handlerName: index === 0 ? item.initiatorPeople : item.handlerName
|
||||
}))
|
||||
}
|
||||
try {
|
||||
if (orderDetail.value.orderImgUrl) {
|
||||
const res = await ossInfo([orderDetail.value.orderImgUrl]);
|
||||
orderDetail.value.orderImgPath = res?.[0]?.url
|
||||
}
|
||||
if (orderDetail.value.imgUrl) {
|
||||
const res = await ossInfo([orderDetail.value.imgUrl]);
|
||||
orderDetail.value.evaluateImgPath = res?.[0]?.url
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
@@ -100,11 +113,11 @@ async function handleOpenChange(open: boolean) {
|
||||
<DescriptionsItem label="评价内容" v-if="orderDetail.serviceEvaluaText" :span="2">
|
||||
{{ orderDetail.serviceEvaluaText }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="评价图片" v-if="orderDetail.imgUrl" :span="2">
|
||||
{{ orderDetail.imgUrl }}
|
||||
<DescriptionsItem label="评价图片" v-if="orderDetail.evaluateImgPath" :span="2">
|
||||
<img :src="orderDetail.evaluateImgPath" alt="图片加载失败" class="w-[100px] h-[100px]"/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="工单图片" v-if="orderDetail.orderImgUrl" :span="2">
|
||||
{{ orderDetail.orderImgUrl }}
|
||||
<DescriptionsItem label="工单图片" v-if="orderDetail.orderImgPath" :span="2">
|
||||
<img :src="orderDetail.orderImgPath" alt="图片加载失败" class="w-[100px] h-[100px]"/>
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
<Divider orientation="left" orientation-margin="0px">
|
||||
|
@@ -26,6 +26,7 @@ import cleanDetailModal from './clean-detail-modal.vue';
|
||||
// import { modalSchema } from './data';
|
||||
import { communityTree } from '#/api/property/community';
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
import type {Clean_orderForm} from "#/api/property/clean_order/model";
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
@@ -190,9 +191,13 @@ const modalSchema = [
|
||||
{
|
||||
label: '评价图片',
|
||||
fieldName: 'imgUrl',
|
||||
component: 'Input',
|
||||
component: 'ImageUpload',
|
||||
componentProps: {
|
||||
helpMessage: false,
|
||||
},
|
||||
dependencies: {
|
||||
show: () => (isReadonly.value ? true : false),
|
||||
show: (formValue:Clean_orderForm) =>
|
||||
isReadonly.value && formValue.imgUrl ? true : false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
@@ -216,7 +221,7 @@ const modalSchema = [
|
||||
helpMessage: false,
|
||||
},
|
||||
dependencies: {
|
||||
show: (formValue) =>
|
||||
show: (formValue:Clean_orderForm) =>
|
||||
isReadonly.value && formValue.signImgUrl ? true : false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
|
@@ -74,8 +74,8 @@ export const columns: VxeGridProps['columns'] = [
|
||||
},
|
||||
{
|
||||
title: '服务地址',
|
||||
field: 'location',
|
||||
width: '180',
|
||||
field: 'locationName',
|
||||
width: '260',
|
||||
},
|
||||
{
|
||||
title: '合计费用(元)',
|
||||
|
@@ -89,7 +89,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'inspectResult',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.inspectResult, 'pro_inspection_results');
|
||||
return row.inspectResult!=null? renderDict(row.inspectResult, 'pro_inspection_results'):'';
|
||||
},
|
||||
},
|
||||
minWidth: '120',
|
||||
@@ -152,6 +152,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
labelWidth: 100,
|
||||
formItemClass:'col-span-2'
|
||||
},
|
||||
{
|
||||
label: '服务地点',
|
||||
@@ -160,6 +161,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
defaultValue: undefined,
|
||||
rules: 'required',
|
||||
labelWidth: 100,
|
||||
formItemClass:'col-span-2'
|
||||
},
|
||||
{
|
||||
label: '服务类型',
|
||||
@@ -226,50 +228,51 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
rules: 'required',
|
||||
labelWidth: 100,
|
||||
},
|
||||
{
|
||||
label: '巡检结果',
|
||||
fieldName: 'inspectResult',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_inspection_results'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
labelWidth: 100,
|
||||
},
|
||||
{
|
||||
label: '处理措施',
|
||||
fieldName: 'measure',
|
||||
component: 'Textarea',
|
||||
rules: 'required',
|
||||
labelWidth: 100,
|
||||
},
|
||||
{
|
||||
label: '客户评分',
|
||||
fieldName: 'customerScore',
|
||||
component: 'Rate',
|
||||
componentProps: {
|
||||
allowHalf: false,
|
||||
count: 5,
|
||||
tooltips: ['1星', '2星', '3星', '4星', '5星'],
|
||||
defaultValue: 0,
|
||||
},
|
||||
rules: 'required',
|
||||
labelWidth: 100,
|
||||
},
|
||||
{
|
||||
label: '客户反馈',
|
||||
fieldName: 'customerAdvice',
|
||||
component: 'Textarea',
|
||||
labelWidth: 100,
|
||||
},
|
||||
{
|
||||
label: '处理状态',
|
||||
fieldName: 'state',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_processing_status'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
labelWidth: 100,
|
||||
},
|
||||
//
|
||||
// {
|
||||
// label: '巡检结果',
|
||||
// fieldName: 'inspectResult',
|
||||
// component: 'Select',
|
||||
// componentProps: {
|
||||
// options: getDictOptions('pro_inspection_results'),
|
||||
// },
|
||||
// rules: 'selectRequired',
|
||||
// labelWidth: 100,
|
||||
// },
|
||||
// {
|
||||
// label: '处理措施',
|
||||
// fieldName: 'measure',
|
||||
// component: 'Textarea',
|
||||
// rules: 'required',
|
||||
// labelWidth: 100,
|
||||
// },
|
||||
// {
|
||||
// label: '客户评分',
|
||||
// fieldName: 'customerScore',
|
||||
// component: 'Rate',
|
||||
// componentProps: {
|
||||
// allowHalf: false,
|
||||
// count: 5,
|
||||
// tooltips: ['1星', '2星', '3星', '4星', '5星'],
|
||||
// defaultValue: 0,
|
||||
// },
|
||||
// rules: 'required',
|
||||
// labelWidth: 100,
|
||||
// },
|
||||
// {
|
||||
// label: '客户反馈',
|
||||
// fieldName: 'customerAdvice',
|
||||
// component: 'Textarea',
|
||||
// labelWidth: 100,
|
||||
// },
|
||||
// {
|
||||
// label: '处理状态',
|
||||
// fieldName: 'state',
|
||||
// component: 'Select',
|
||||
// componentProps: {
|
||||
// options: getDictOptions('pro_processing_status'),
|
||||
// },
|
||||
// rules: 'selectRequired',
|
||||
// labelWidth: 100,
|
||||
// },
|
||||
];
|
||||
|
@@ -15,7 +15,6 @@ import type { PropertyForm } from '#/api/property/productManagement/model';
|
||||
import PlantsProductModal from './plantsProduct-modal.vue';
|
||||
import PlantsProductDetail from './plantsProduct-detail.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
import { ref } from 'vue';
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
labelWidth: 80,
|
||||
|
@@ -5,6 +5,7 @@ import {useVbenModal} from '@vben/common-ui';
|
||||
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||
import {plantsProductInfo} from '#/api/property/productManagement';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {ossInfo} from "#/api/system/oss";
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: handleOpenChange,
|
||||
@@ -21,8 +22,11 @@ async function handleOpenChange(open: boolean) {
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
const response = await plantsProductInfo(id);
|
||||
plantsProductDetail.value = response;
|
||||
plantsProductDetail.value = await plantsProductInfo(id);
|
||||
if(plantsProductDetail.value.imgPath){
|
||||
const res = await ossInfo([plantsProductDetail.value.imgPath]);
|
||||
plantsProductDetail.value.plantImg = res?.[0]?.url
|
||||
}
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
</script>
|
||||
@@ -55,15 +59,16 @@ async function handleOpenChange(open: boolean) {
|
||||
:is="renderDict(plantsProductDetail.state,'product_management_status')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="产品图片">
|
||||
<img :src="plantsProductDetail.imgPath" alt="">
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="备注">
|
||||
{{ plantsProductDetail.remark }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="创建时间">
|
||||
{{ plantsProductDetail.createTime }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="产品图片" :span="2">
|
||||
<img v-if="plantsProductDetail.plantImg" :src="plantsProductDetail.plantImg" alt="图片加载失败" class="w-[100px] h-[100px]" />
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="备注" :span="2">
|
||||
{{ plantsProductDetail.remark }}
|
||||
</DescriptionsItem>
|
||||
|
||||
</Descriptions>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
@@ -8,6 +8,7 @@ import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {knowledgeInfo} from "#/api/property/maintenance/knowledge";
|
||||
import type {KnowledgeVO} from "#/api/property/maintenance/knowledge/model";
|
||||
import {ossInfo} from "#/api/system/oss";
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
@@ -28,6 +29,14 @@ async function handleOpenChange(open: boolean) {
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
knowledgeDetail.value = await knowledgeInfo(id);
|
||||
if(knowledgeDetail.value.covers){
|
||||
try {
|
||||
const res = await ossInfo([knowledgeDetail.value.covers]);
|
||||
knowledgeDetail.value.coversPath = res?.[0]?.url;
|
||||
} catch (e) {
|
||||
knowledgeDetail.value.coversPath = '';
|
||||
}
|
||||
}
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
</script>
|
||||
@@ -50,7 +59,7 @@ async function handleOpenChange(open: boolean) {
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="封面" :span="2">
|
||||
<img style="width: 100px" :src="knowledgeDetail.covers"/>
|
||||
<img style="width: 100px" :src="knowledgeDetail.coversPath" alt="图片加载失败"/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="发布时间" :span="2">
|
||||
{{ knowledgeDetail.releaseTime}}
|
||||
|
@@ -24,6 +24,7 @@ import {getDictOptions} from "#/utils/dict";
|
||||
import type {KnowledgeForm, KnowledgeVO} from "#/api/property/maintenance/knowledge/model";
|
||||
import {renderDict} from "#/utils/render";
|
||||
import knowledgeDetail from '../knowledge/knowledge-detail.vue';
|
||||
import {ossInfo} from "#/api/system/oss";
|
||||
const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE;
|
||||
|
||||
const [KnowledgeModal, modalApi] = useVbenModal({
|
||||
@@ -66,6 +67,16 @@ const handleClean = () => {
|
||||
async function queryPageList() {
|
||||
const res = await knowledgeList(formState)
|
||||
pageList.value = res.rows
|
||||
for (const item of pageList.value) {
|
||||
if (item.covers) {
|
||||
try {
|
||||
const res = await ossInfo([item.covers]);
|
||||
item.coversPath = res?.[0]?.url;
|
||||
} catch (e) {
|
||||
item.coversPath = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
total.value = res.total
|
||||
}
|
||||
|
||||
@@ -132,7 +143,7 @@ async function handleInfo(row: Required<KnowledgeForm>) {
|
||||
<template #cover>
|
||||
<img class="card-img"
|
||||
alt="图片加载失败"
|
||||
:src="item.covers"/>
|
||||
:src="item.coversPath"/>
|
||||
</template>
|
||||
<CardMeta :title="item.title">
|
||||
<template #description>
|
||||
|
@@ -9,14 +9,15 @@ import duration from 'dayjs/plugin/duration';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
import {personInfo} from '#/api/property/resident/person';
|
||||
import type {Person} from "#/api/property/resident/person/model";
|
||||
import type {PersonVO} from "#/api/property/resident/person/model";
|
||||
import {accessControlColumns,carColumns} from "#/views/property/resident/person/data";
|
||||
import {renderDict, renderDictValue} from "#/utils/render";
|
||||
import {ossInfo} from "#/api/system/oss";
|
||||
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
const personDetail = shallowRef<null | Person>(null);
|
||||
const personDetail = shallowRef<null | PersonVO>(null);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: handleOpenChange,
|
||||
@@ -38,7 +39,10 @@ async function handleOpenChange(open: boolean) {
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
// 赋值
|
||||
personDetail.value = await personInfo(id);
|
||||
|
||||
if(personDetail.value.img){
|
||||
const res = await ossInfo([personDetail.value.img]);
|
||||
personDetail.value.imgPath = res?.[0]?.url
|
||||
}
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
|
||||
@@ -64,7 +68,7 @@ async function handleOpenChange(open: boolean) {
|
||||
<!-- {{ personDetail.locathon }}-->
|
||||
<!-- </DescriptionsItem>-->
|
||||
<DescriptionsItem label="人脸图片">
|
||||
{{ personDetail.img }}
|
||||
<img v-if="personDetail.imgPath" :src="personDetail.imgPath" alt="图片加载失败" class="w-[100px] h-[100px]" />
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="入驻时间">
|
||||
{{ personDetail.time}}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type {
|
||||
ConferenceSettingsDetail,
|
||||
MeetVO,
|
||||
} from '#/api/property/roomBooking/conferenceSettings/model';
|
||||
import {shallowRef} from 'vue';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
@@ -10,6 +10,7 @@ import duration from 'dayjs/plugin/duration';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import {meetInfo} from '#/api/property/roomBooking/conferenceSettings';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {ossInfo} from "#/api/system/oss";
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
@@ -21,7 +22,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
},
|
||||
});
|
||||
|
||||
const conferenceSettingsDetail = shallowRef<null | ConferenceSettingsDetail>(null);
|
||||
const conferenceSettingsDetail = shallowRef<null | MeetVO>(null);
|
||||
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
@@ -29,7 +30,18 @@ async function handleOpenChange(open: boolean) {
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
conferenceSettingsDetail.value =await meetInfo(id);
|
||||
conferenceSettingsDetail.value = await meetInfo(id);
|
||||
if (conferenceSettingsDetail.value?.picture) {
|
||||
const res = await ossInfo([conferenceSettingsDetail.value?.picture]);
|
||||
if (res) {
|
||||
let imgArr = [] as string[];
|
||||
res.forEach(item => {
|
||||
imgArr.push(item.url)
|
||||
})
|
||||
conferenceSettingsDetail.value.pictureArr = imgArr;
|
||||
}
|
||||
}
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
</script>
|
||||
@@ -56,7 +68,7 @@ async function handleOpenChange(open: boolean) {
|
||||
{{ conferenceSettingsDetail.baseService }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="负责人" :span="2">
|
||||
{{ conferenceSettingsDetail.principalsName+'-'+conferenceSettingsDetail.phoneNo }}
|
||||
{{ conferenceSettingsDetail.principalsName + '-' + conferenceSettingsDetail.phoneNo }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="费用模式" :span="conferenceSettingsDetail.expenseType=='2'?1:2">
|
||||
<component
|
||||
@@ -67,7 +79,9 @@ async function handleOpenChange(open: boolean) {
|
||||
{{ conferenceSettingsDetail.basePrice }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="会议室图片" :span="2">
|
||||
{{ conferenceSettingsDetail.picture }}
|
||||
<div v-if="conferenceSettingsDetail.pictureArr">
|
||||
<img v-for="item in conferenceSettingsDetail.pictureArr" style="width: 100px;margin: 5px 10px;display: inline-block" :src="item" alt="图片加载失败">
|
||||
</div>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="预约是否审核">
|
||||
<component
|
||||
@@ -75,7 +89,7 @@ async function handleOpenChange(open: boolean) {
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="开放时段" :span="2">
|
||||
{{ conferenceSettingsDetail.openStartHours+'-'+ conferenceSettingsDetail.openEndHours}}
|
||||
{{ conferenceSettingsDetail.openStartHours + '-' + conferenceSettingsDetail.openEndHours }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="会议室描述" :span="2">
|
||||
{{ conferenceSettingsDetail.descs }}
|
||||
|
@@ -78,6 +78,9 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
if (record.openStartHours&&record.openEndHours) {
|
||||
record.openHours = [dayjs(record.openStartHours, 'HH:mm'), dayjs(record.openEndHours, 'HH:mm')];
|
||||
}
|
||||
if(record.picture){
|
||||
record.pictureArr=record.picture.split(';',)
|
||||
}
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
@@ -99,6 +102,9 @@ async function handleConfirm() {
|
||||
data.openStartHours=data.openHours[0]?.format('HH:mm');
|
||||
data.openEndHours=data.openHours[1]?.format('HH:mm');
|
||||
}
|
||||
if(data.pictureArr){
|
||||
data.picture=data.pictureArr.join(';',)
|
||||
}
|
||||
await (isUpdate.value ? meetUpdate(data) : meetAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
|
@@ -184,7 +184,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
{
|
||||
label: '会议室图片',
|
||||
fieldName: 'picture',
|
||||
fieldName: 'pictureArr',
|
||||
component: 'ImageUpload',
|
||||
componentProps: {
|
||||
maxCount: 10, // 最大上传文件数 默认为1 为1会绑定为string而非string[]类型
|
||||
|
@@ -163,8 +163,8 @@ const { hasAccessByCodes } = useAccess();
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
<TableSwitch
|
||||
:checkedValue="0"
|
||||
:unCheckedValue="1"
|
||||
:checkedValue="1"
|
||||
:unCheckedValue="0"
|
||||
:checkedText="'启用'"
|
||||
:unCheckedText="'停用'"
|
||||
v-model:value="row.status"
|
||||
|
@@ -1,157 +1,171 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, onMounted } from 'vue'
|
||||
import { computed, ref, onMounted } from "vue";
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui'
|
||||
import { $t } from '@vben/locales'
|
||||
import { cloneDeep } from '@vben/utils'
|
||||
import { useVbenModal } from "@vben/common-ui";
|
||||
import { $t } from "@vben/locales";
|
||||
import { cloneDeep } from "@vben/utils";
|
||||
|
||||
import { useVbenForm } from '#/adapter/form'
|
||||
import { authGroupAdd, authGroupInfo, authGroupUpdate } from '#/api/sis/authGroup'
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'
|
||||
import { queryTree } from '#/api/sis/authRecord'
|
||||
import { message, Tree } from 'ant-design-vue'
|
||||
import { useVbenForm } from "#/adapter/form";
|
||||
import {
|
||||
authGroupAdd,
|
||||
authGroupInfo,
|
||||
authGroupUpdate,
|
||||
} from "#/api/sis/authGroup";
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from "#/utils/popup";
|
||||
import { queryTree } from "#/api/sis/authRecord";
|
||||
import { message, Tree } from "ant-design-vue";
|
||||
|
||||
import { modalSchema } from './data'
|
||||
import { modalSchema } from "./data";
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>()
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
const isUpdate = ref(false)
|
||||
const isUpdate = ref(false);
|
||||
const title = computed(() => {
|
||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add')
|
||||
})
|
||||
return isUpdate.value ? $t("pages.common.edit") : $t("pages.common.add");
|
||||
});
|
||||
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
formItemClass: "col-span-2",
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
}
|
||||
class: "w-full",
|
||||
},
|
||||
},
|
||||
schema: modalSchema(),
|
||||
showDefaultActions: false,
|
||||
wrapperClass: 'grid-cols-2',
|
||||
})
|
||||
wrapperClass: "grid-cols-2",
|
||||
});
|
||||
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
},
|
||||
)
|
||||
}
|
||||
);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
class: "w-[550px]",
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
onConfirm: handleConfirm,
|
||||
onOpenChange: async (isOpen) => {
|
||||
if (!isOpen) {
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true)
|
||||
loadDeviceTree()
|
||||
const { id } = modalApi.getData() as { id?: number | string }
|
||||
isUpdate.value = !!id
|
||||
modalApi.modalLoading(true);
|
||||
loadDeviceTree();
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
if (isUpdate.value && id) {
|
||||
const record = await authGroupInfo(id)
|
||||
const record = await authGroupInfo(id);
|
||||
|
||||
checkedKeys.value = (record.acIds || []).concat(record.floorIds || [])
|
||||
checkedKeys.value = (record.acIds || []).concat(record.floorIds || []);
|
||||
|
||||
await formApi.setValues(record)
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized()
|
||||
await markInitialized();
|
||||
|
||||
modalApi.modalLoading(false)
|
||||
modalApi.modalLoading(false);
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true)
|
||||
const { valid } = await formApi.validate()
|
||||
modalApi.lock(true);
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
if (eleIds.value.length === 0 && acIds.value.length === 0) {
|
||||
message.error('请选择授权设备')
|
||||
return
|
||||
message.error("请选择授权设备");
|
||||
return;
|
||||
}
|
||||
|
||||
const data = cloneDeep(await formApi.getValues())
|
||||
data.acIds = acIds.value
|
||||
data.eleIds = eleIds.value
|
||||
data.floorIds = floorIds.value
|
||||
await (isUpdate.value ? authGroupUpdate(data) : authGroupAdd(data))
|
||||
resetInitialized()
|
||||
emit('reload')
|
||||
modalApi.close()
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
data.acIds = acIds.value;
|
||||
data.eleIds = eleIds.value;
|
||||
data.floorIds = floorIds.value;
|
||||
await (isUpdate.value ? authGroupUpdate(data) : authGroupAdd(data));
|
||||
resetInitialized();
|
||||
emit("reload");
|
||||
modalApi.close();
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
console.error(error);
|
||||
} finally {
|
||||
modalApi.lock(false)
|
||||
modalApi.lock(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function handleClosed() {
|
||||
await formApi.resetForm()
|
||||
checkedKeys.value = []
|
||||
resetInitialized()
|
||||
await formApi.resetForm();
|
||||
checkedKeys.value = [];
|
||||
resetInitialized();
|
||||
}
|
||||
|
||||
|
||||
|
||||
const treeData = ref([])
|
||||
const treeData = ref([]);
|
||||
function loadDeviceTree() {
|
||||
queryTree().then((data: any) => {
|
||||
treeData.value = data
|
||||
})
|
||||
data[0].children.forEach((item: any) => {
|
||||
if (item.code === 2) {
|
||||
item.disabled = true;
|
||||
item.children.forEach((item: any) => {
|
||||
item.disabled = true;
|
||||
item.children.forEach((item: any) => {
|
||||
item.disabled = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
treeData.value = data;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
const fieldNames = {
|
||||
title: 'title',
|
||||
label: 'label',
|
||||
key: 'code',
|
||||
children: 'children',
|
||||
}
|
||||
title: "title",
|
||||
label: "label",
|
||||
key: "code",
|
||||
children: "children",
|
||||
};
|
||||
|
||||
const checkedKeys = ref<any[]>([])
|
||||
type Key = string | number
|
||||
const eleIds = ref<any[]>([])
|
||||
const acIds = ref<any[]>([])
|
||||
const floorIds = ref<any[]>([])
|
||||
function handleCheck(checked: Key[] | { checked: Key[]; halfChecked: Key[] }, info: any) {
|
||||
|
||||
acIds.value = []
|
||||
eleIds.value = []
|
||||
floorIds.value = []
|
||||
const checkedKeys = ref<any[]>([]);
|
||||
type Key = string | number;
|
||||
const eleIds = ref<any[]>([]);
|
||||
const acIds = ref<any[]>([]);
|
||||
const floorIds = ref<any[]>([]);
|
||||
function handleCheck(
|
||||
checked: Key[] | { checked: Key[]; halfChecked: Key[] },
|
||||
info: any
|
||||
) {
|
||||
acIds.value = [];
|
||||
eleIds.value = [];
|
||||
floorIds.value = [];
|
||||
|
||||
info.checkedNodesPositions.forEach((item: any) => {
|
||||
switch (item.node.label) {
|
||||
case 'accessControl':
|
||||
acIds.value = acIds.value.concat(item.node.code)
|
||||
break
|
||||
case 'floor':
|
||||
floorIds.value = floorIds.value.concat(item.node.code)
|
||||
eleIds.value = eleIds.value.concat(item.node.parentCode)
|
||||
break
|
||||
case 'elevator':
|
||||
eleIds.value = eleIds.value.concat(item.node.code)
|
||||
break
|
||||
case "accessControl":
|
||||
acIds.value = acIds.value.concat(item.node.code);
|
||||
break;
|
||||
case "floor":
|
||||
floorIds.value = floorIds.value.concat(item.node.code);
|
||||
eleIds.value = eleIds.value.concat(item.node.parentCode);
|
||||
break;
|
||||
case "elevator":
|
||||
eleIds.value = eleIds.value.concat(item.node.code);
|
||||
break;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// 去重
|
||||
acIds.value = [...new Set(acIds.value)]
|
||||
eleIds.value = [...new Set(eleIds.value)]
|
||||
floorIds.value = [...new Set(floorIds.value)]
|
||||
acIds.value = [...new Set(acIds.value)];
|
||||
eleIds.value = [...new Set(eleIds.value)];
|
||||
floorIds.value = [...new Set(floorIds.value)];
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -159,8 +173,11 @@ function handleCheck(checked: Key[] | { checked: Key[]; halfChecked: Key[] }, in
|
||||
<BasicModal :title="title">
|
||||
<BasicForm />
|
||||
<div class="p-4">
|
||||
<Tree checkable :tree-data="treeData" :fieldNames="fieldNames" v-model:checkedKeys="checkedKeys"
|
||||
:onCheck="handleCheck">
|
||||
<Tree checkable
|
||||
:tree-data="treeData"
|
||||
:fieldNames="fieldNames"
|
||||
v-model:checkedKeys="checkedKeys"
|
||||
:onCheck="handleCheck">
|
||||
</Tree>
|
||||
</div>
|
||||
</BasicModal>
|
||||
|
Reference in New Issue
Block a user