Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
@@ -66,6 +66,28 @@ export interface InspectionPlanVO {
|
|||||||
*/
|
*/
|
||||||
remark: string;
|
remark: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划时间区间
|
||||||
|
*/
|
||||||
|
planDate?: any[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检月
|
||||||
|
*/
|
||||||
|
inspectionMonth?:string;
|
||||||
|
/**
|
||||||
|
* 巡检日
|
||||||
|
*/
|
||||||
|
inspectionDay?:string;
|
||||||
|
/**
|
||||||
|
* 巡检周
|
||||||
|
*/
|
||||||
|
inspectionWorkday?:string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
state?:string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface InspectionPlanForm extends BaseEntity {
|
export interface InspectionPlanForm extends BaseEntity {
|
||||||
@@ -133,6 +155,18 @@ export interface InspectionPlanForm extends BaseEntity {
|
|||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
remark?: string;
|
remark?: string;
|
||||||
|
/**
|
||||||
|
* 巡检月
|
||||||
|
*/
|
||||||
|
inspectionMonth?:string;
|
||||||
|
/**
|
||||||
|
* 巡检日
|
||||||
|
*/
|
||||||
|
inspectionDay?:string;
|
||||||
|
/**
|
||||||
|
* 巡检周
|
||||||
|
*/
|
||||||
|
inspectionWorkday?:string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,4 +230,16 @@ export interface InspectionPlanQuery extends PageQuery {
|
|||||||
* 日期范围参数
|
* 日期范围参数
|
||||||
*/
|
*/
|
||||||
params?: any;
|
params?: any;
|
||||||
|
/**
|
||||||
|
* 巡检月
|
||||||
|
*/
|
||||||
|
inspectionMonth?:string;
|
||||||
|
/**
|
||||||
|
* 巡检日
|
||||||
|
*/
|
||||||
|
inspectionDay?:string;
|
||||||
|
/**
|
||||||
|
* 巡检周
|
||||||
|
*/
|
||||||
|
inspectionWorkday?:string;
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,12 @@ import type {
|
|||||||
AccessControlForm,
|
AccessControlForm,
|
||||||
AccessControlQuery,
|
AccessControlQuery,
|
||||||
AccessControlVO,
|
AccessControlVO,
|
||||||
} from './model';
|
} from './model'
|
||||||
|
|
||||||
import type { ID, IDS, PageResult, TreeNode } from '#/api/common';
|
import type { ID, IDS, PageResult, TreeNode } from '#/api/common'
|
||||||
|
|
||||||
import { commonExport } from '#/api/helper';
|
import { commonExport } from '#/api/helper'
|
||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询门禁管理列表
|
* 查询门禁管理列表
|
||||||
@@ -18,7 +18,7 @@ export function accessControlList(params?: AccessControlQuery) {
|
|||||||
return requestClient.get<PageResult<AccessControlVO>>(
|
return requestClient.get<PageResult<AccessControlVO>>(
|
||||||
'/sis/accessControl/list',
|
'/sis/accessControl/list',
|
||||||
{ params },
|
{ params },
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,7 +27,7 @@ export function accessControlList(params?: AccessControlQuery) {
|
|||||||
* @returns 门禁管理列表
|
* @returns 门禁管理列表
|
||||||
*/
|
*/
|
||||||
export function accessControlExport(params?: AccessControlQuery) {
|
export function accessControlExport(params?: AccessControlQuery) {
|
||||||
return commonExport('/sis/accessControl/export', params ?? {});
|
return commonExport('/sis/accessControl/export', params ?? {})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,7 +36,7 @@ export function accessControlExport(params?: AccessControlQuery) {
|
|||||||
* @returns 门禁管理详情
|
* @returns 门禁管理详情
|
||||||
*/
|
*/
|
||||||
export function accessControlInfo(id: ID) {
|
export function accessControlInfo(id: ID) {
|
||||||
return requestClient.get<AccessControlVO>(`/sis/accessControl/${id}`);
|
return requestClient.get<AccessControlVO>(`/sis/accessControl/${id}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -45,7 +45,7 @@ export function accessControlInfo(id: ID) {
|
|||||||
* @returns void
|
* @returns void
|
||||||
*/
|
*/
|
||||||
export function accessControlAdd(data: AccessControlForm) {
|
export function accessControlAdd(data: AccessControlForm) {
|
||||||
return requestClient.postWithMsg<void>('/sis/accessControl', data);
|
return requestClient.postWithMsg<void>('/sis/accessControl', data)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,7 +54,7 @@ export function accessControlAdd(data: AccessControlForm) {
|
|||||||
* @returns void
|
* @returns void
|
||||||
*/
|
*/
|
||||||
export function accessControlUpdate(data: AccessControlForm) {
|
export function accessControlUpdate(data: AccessControlForm) {
|
||||||
return requestClient.putWithMsg<void>('/sis/accessControl', data);
|
return requestClient.putWithMsg<void>('/sis/accessControl', data)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,7 +63,7 @@ export function accessControlUpdate(data: AccessControlForm) {
|
|||||||
* @returns void
|
* @returns void
|
||||||
*/
|
*/
|
||||||
export function accessControlRemove(id: ID | IDS) {
|
export function accessControlRemove(id: ID | IDS) {
|
||||||
return requestClient.deleteWithMsg<void>(`/sis/accessControl/${id}`);
|
return requestClient.deleteWithMsg<void>(`/sis/accessControl/${id}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -71,5 +71,13 @@ export function accessControlRemove(id: ID | IDS) {
|
|||||||
* @returns void
|
* @returns void
|
||||||
*/
|
*/
|
||||||
export function queryTree() {
|
export function queryTree() {
|
||||||
return requestClient.get<TreeNode<Number>[]>(`/sis/accessControl/tree`);
|
return requestClient.get<TreeNode<Number>[]>(`/sis/accessControl/tree`)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步E8门禁
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function accessControlSync() {
|
||||||
|
return requestClient.get<void>(`/sis/accessControl/sync`)
|
||||||
}
|
}
|
||||||
|
@@ -65,7 +65,9 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await communityInfo(id);
|
const record = await communityInfo(id);
|
||||||
await formApi.setValues(record);
|
await formApi.setValues(record);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setupDeptSelect();
|
setupDeptSelect();
|
||||||
await markInitialized();
|
await markInitialized();
|
||||||
modalApi.modalLoading(false);
|
modalApi.modalLoading(false);
|
||||||
@@ -83,7 +85,10 @@ async function handleConfirm() {
|
|||||||
}
|
}
|
||||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||||
const data: CommunityForm = cloneDeep(await formApi.getValues());
|
const data: CommunityForm = cloneDeep(await formApi.getValues());
|
||||||
|
// data.cityFullName = currentSelectNode? currentSelectNode.fullName : data.cityFullName;
|
||||||
|
if (currentSelectNode?.fullName) {
|
||||||
data.cityFullName = currentSelectNode.fullName;
|
data.cityFullName = currentSelectNode.fullName;
|
||||||
|
}
|
||||||
await (isUpdate.value ? communityUpdate(data) : communityAdd(data));
|
await (isUpdate.value ? communityUpdate(data) : communityAdd(data));
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
emit('reload');
|
emit('reload');
|
||||||
|
@@ -42,14 +42,14 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
title: '地址',
|
title: '地址',
|
||||||
field: 'addr',
|
field: 'addr',
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: '经度',
|
// title: '经度',
|
||||||
field: 'lon',
|
// field: 'lon',
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: '维度',
|
// title: '维度',
|
||||||
field: 'lat',
|
// field: 'lat',
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: '占地面积',
|
title: '占地面积',
|
||||||
field: 'area',
|
field: 'area',
|
||||||
@@ -136,16 +136,16 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
label: '经度',
|
// label: '经度',
|
||||||
fieldName: 'lon',
|
// fieldName: 'lon',
|
||||||
component: 'Input',
|
// component: 'Input',
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
label: '维度',
|
// label: '维度',
|
||||||
fieldName: 'lat',
|
// fieldName: 'lat',
|
||||||
component: 'Input',
|
// component: 'Input',
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
label: '占地面积',
|
label: '占地面积',
|
||||||
fieldName: 'area',
|
fieldName: 'area',
|
||||||
|
@@ -39,7 +39,29 @@ const detailSchema = [
|
|||||||
api: async () => {
|
api: async () => {
|
||||||
const res = await plantsProductList({state:1,inventory:0});
|
const res = await plantsProductList({state:1,inventory:0});
|
||||||
plantListData = res.rows || [];
|
plantListData = res.rows || [];
|
||||||
return res;
|
|
||||||
|
// 获取当前模态框的数据,包含已添加的产品列表
|
||||||
|
const modalData = modalApi.getData();
|
||||||
|
const existingProducts = modalData?.existingProducts || [];
|
||||||
|
const currentProductId = modalData?.currentProductId;
|
||||||
|
|
||||||
|
// 过滤掉已经添加到产品列表中的产品
|
||||||
|
// 如果是编辑模式,需要排除当前正在编辑的产品
|
||||||
|
const filteredRows = res.rows.filter((item: any) => {
|
||||||
|
// 如果是编辑模式且是当前正在编辑的产品,则保留
|
||||||
|
if (currentProductId && item.id === currentProductId) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// 过滤掉已添加的产品
|
||||||
|
return !existingProducts.some((existing: any) =>
|
||||||
|
existing.productId === item.id || existing.id === item.id
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
...res,
|
||||||
|
rows: filteredRows
|
||||||
|
};
|
||||||
},
|
},
|
||||||
resultField: 'rows',
|
resultField: 'rows',
|
||||||
labelField: 'plantName',
|
labelField: 'plantName',
|
||||||
|
@@ -29,10 +29,10 @@ const [BasicForm, formApi] = useVbenForm({
|
|||||||
// 默认label宽度 px
|
// 默认label宽度 px
|
||||||
labelWidth: 120,
|
labelWidth: 120,
|
||||||
// 通用配置项 会影响到所有表单项
|
// 通用配置项 会影响到所有表单项
|
||||||
componentProps: computed(() => ({
|
componentProps: {
|
||||||
class: 'w-full',
|
class: 'w-full',
|
||||||
disabled: isReadonly.value,
|
disabled: isReadonly,
|
||||||
})),
|
},
|
||||||
},
|
},
|
||||||
schema: modalSchema(),
|
schema: modalSchema(),
|
||||||
showDefaultActions: false,
|
showDefaultActions: false,
|
||||||
@@ -143,10 +143,13 @@ const detailColumns = [
|
|||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
fixed: 'right' as const,
|
fixed: 'right' as const,
|
||||||
|
width: 200,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
function handleAddDetail() {
|
function handleAddDetail() {
|
||||||
detailModalApi.setData({});
|
detailModalApi.setData({
|
||||||
|
existingProducts: detailTable.value
|
||||||
|
});
|
||||||
detailModalApi.open();
|
detailModalApi.open();
|
||||||
}
|
}
|
||||||
//添加植物组合包产品
|
//添加植物组合包产品
|
||||||
@@ -169,7 +172,13 @@ function handleViewDetail(record: any) {
|
|||||||
}
|
}
|
||||||
// 编辑产品详情
|
// 编辑产品详情
|
||||||
function handleEditDetail(record: any, index: number) {
|
function handleEditDetail(record: any, index: number) {
|
||||||
detailModalApi.setData({ ...record, index, readonly: false });
|
detailModalApi.setData({
|
||||||
|
...record,
|
||||||
|
index,
|
||||||
|
readonly: false,
|
||||||
|
existingProducts: detailTable.value.filter((item: any, i: number) => i !== index),
|
||||||
|
currentProductId: record.productId || record.id
|
||||||
|
});
|
||||||
detailModalApi.open();
|
detailModalApi.open();
|
||||||
}
|
}
|
||||||
//分类字典
|
//分类字典
|
||||||
|
@@ -5,7 +5,7 @@ import { onMounted, ref } from 'vue';
|
|||||||
|
|
||||||
import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
|
import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
|
||||||
|
|
||||||
import { Button,Radio } from 'ant-design-vue';
|
import { Button,Radio,Spin } from 'ant-design-vue';
|
||||||
import type { RadioChangeEvent } from 'ant-design-vue';
|
import type { RadioChangeEvent } from 'ant-design-vue';
|
||||||
|
|
||||||
import { statisticsByTime,
|
import { statisticsByTime,
|
||||||
@@ -44,42 +44,30 @@ const timeUnit = ref<number>(1)
|
|||||||
const countOrderAndAmountDataAmount = ref<number>(0);
|
const countOrderAndAmountDataAmount = ref<number>(0);
|
||||||
const countOrderAndAmountDataOrder = ref<number>(0);
|
const countOrderAndAmountDataOrder = ref<number>(0);
|
||||||
const countAchievedRateData = ref<any>(null);
|
const countAchievedRateData = ref<any>(null);
|
||||||
const countCustomersData = ref<any>(null);
|
const countCustomersData = ref<any>(0);
|
||||||
const xAxisData = ref<any[]>([]);
|
const xAxisData = ref<any[]>([]);
|
||||||
const seriesData = ref<any[]>([]);
|
const seriesData = ref<any[]>([]);
|
||||||
onMounted(async () => {
|
const loading = ref(false);
|
||||||
// 任务数
|
async function fetchOrderAndAmount() {
|
||||||
const countOrderAndAmountData = await countOrderAndAmount();
|
const countOrderAndAmountData = await countOrderAndAmount();
|
||||||
countOrderAndAmountDataAmount.value = countOrderAndAmountData.amount;
|
countOrderAndAmountDataAmount.value = countOrderAndAmountData.amount;
|
||||||
countOrderAndAmountDataOrder.value = countOrderAndAmountData.num;
|
countOrderAndAmountDataOrder.value = countOrderAndAmountData.num;
|
||||||
//活跃用户
|
}
|
||||||
|
|
||||||
|
async function fetchCustomers() {
|
||||||
const countCustomersDataRes: any = await countCustomers();
|
const countCustomersDataRes: any = await countCustomers();
|
||||||
countCustomersData.value = countCustomersDataRes.count;
|
countCustomersData.value = countCustomersDataRes.count;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function fetchAchievedRate() {
|
||||||
const countAchievedRateDataRes: any = await countAchievedRate();
|
const countAchievedRateDataRes: any = await countAchievedRate();
|
||||||
countAchievedRateData.value = countAchievedRateDataRes.rate;
|
countAchievedRateData.value = countAchievedRateDataRes.rate;
|
||||||
// 查询订单数量趋势
|
}
|
||||||
|
|
||||||
|
async function fetchOrderTrend() {
|
||||||
const res = await statisticsByTime({ timeUnit: timeUnit.value });
|
const res = await statisticsByTime({ timeUnit: timeUnit.value });
|
||||||
xAxisData.value = res?.time ?? [];
|
xAxisData.value = res?.time ?? [];
|
||||||
seriesData.value = res?.counts ?? [];
|
seriesData.value = res?.counts ?? [];
|
||||||
// 租赁金额分布
|
|
||||||
const data = await countByRentalType();//返回的内容是amount: 1, type: "单点"
|
|
||||||
// 转换字段名为value和name
|
|
||||||
const convertedData = data.map((item: { amount: number; type: string }) => ({
|
|
||||||
value: item.amount,
|
|
||||||
name: item.type
|
|
||||||
}));
|
|
||||||
// 客户类型分配
|
|
||||||
const countByCusTypeData:any = await countByCusType();
|
|
||||||
//客户续租率趋势
|
|
||||||
const countRenewRateData:any = await countRenewRate();
|
|
||||||
// 养护任务完成情况
|
|
||||||
const countAchievedData:any = await countAchieved();
|
|
||||||
// 养护质量评分分布
|
|
||||||
const countByCusScoreData:any = await countByCusScore();
|
|
||||||
const countByCusScoreDataList = countByCusScoreData.map((item: { score: string; count: number }) => ({
|
|
||||||
value: item.count,
|
|
||||||
name: item.score
|
|
||||||
}));
|
|
||||||
renderEcharts({
|
renderEcharts({
|
||||||
tooltip: { trigger: 'axis' },
|
tooltip: { trigger: 'axis' },
|
||||||
xAxis: {
|
xAxis: {
|
||||||
@@ -87,11 +75,7 @@ onMounted(async () => {
|
|||||||
data: xAxisData.value,
|
data: xAxisData.value,
|
||||||
boundaryGap: false,
|
boundaryGap: false,
|
||||||
},
|
},
|
||||||
yAxis: { type: 'value',
|
yAxis: { type: 'value', axisLabel: { formatter: (value) => `${value * 100}%` } },
|
||||||
axisLabel: {
|
|
||||||
formatter: (value) => `${value * 100}%`
|
|
||||||
},
|
|
||||||
},
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '订单趋势',
|
name: '订单趋势',
|
||||||
@@ -101,13 +85,20 @@ onMounted(async () => {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function fetchLeasePie() {
|
||||||
|
const data = await countByRentalType();
|
||||||
|
const convertedData = data.map((item: { amount: number; type: string }) => ({
|
||||||
|
value: item.amount,
|
||||||
|
name: item.type,
|
||||||
|
}));
|
||||||
renderLeasePie({
|
renderLeasePie({
|
||||||
title: { text: '租赁金额分布', left: 'center' },
|
title: { text: '租赁金额分布', left: 'center' },
|
||||||
tooltip: { trigger: 'item' },
|
tooltip: { trigger: 'item' },
|
||||||
legend: { orient: 'vertical', left: 'left' },
|
legend: { orient: 'vertical', left: 'left' },
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
// name: '金额',
|
|
||||||
type: 'pie',
|
type: 'pie',
|
||||||
radius: '60%',
|
radius: '60%',
|
||||||
center: ['50%', '50%'],
|
center: ['50%', '50%'],
|
||||||
@@ -126,6 +117,10 @@ onMounted(async () => {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function fetchCustomerTypesBar() {
|
||||||
|
const countByCusTypeData: any = await countByCusType();
|
||||||
renderCustomerTypesBar({
|
renderCustomerTypesBar({
|
||||||
title: { text: '客户类型分布' },
|
title: { text: '客户类型分布' },
|
||||||
tooltip: { trigger: 'axis' },
|
tooltip: { trigger: 'axis' },
|
||||||
@@ -134,12 +129,7 @@ onMounted(async () => {
|
|||||||
data: ['企业客户', '个人客户', '政府机构', '商业地产', '其他'],
|
data: ['企业客户', '个人客户', '政府机构', '商业地产', '其他'],
|
||||||
boundaryGap: true,
|
boundaryGap: true,
|
||||||
},
|
},
|
||||||
yAxis: { type: 'value',
|
yAxis: { type: 'value' },
|
||||||
axisLabel: {
|
|
||||||
// formatter: (value: number) => `${parseInt(value.toString())}`
|
|
||||||
},
|
|
||||||
// interval: 0,
|
|
||||||
},
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '客户数',
|
name: '客户数',
|
||||||
@@ -148,16 +138,21 @@ onMounted(async () => {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function fetchCustomerRenewalLine() {
|
||||||
|
const countRenewRateData: any = await countRenewRate();
|
||||||
renderCustomerRenewalLine({
|
renderCustomerRenewalLine({
|
||||||
title: { text: '客户续租率趋势' },
|
title: { text: '客户续租率趋势' },
|
||||||
tooltip: { trigger: 'axis',
|
tooltip: {
|
||||||
|
trigger: 'axis',
|
||||||
formatter: function (params: any) {
|
formatter: function (params: any) {
|
||||||
let result = params[0].axisValue + '<br/>';
|
let result = params[0].axisValue + '<br/>';
|
||||||
params.forEach((item: any) => {
|
params.forEach((item: any) => {
|
||||||
result += item.marker + item.seriesName + ':' + item.data + '%<br/>';
|
result += item.marker + item.seriesName + ':' + item.data + '%<br/>';
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
@@ -166,9 +161,8 @@ onMounted(async () => {
|
|||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
axisLabel: {
|
axisLabel: { formatter: '{value}%' },
|
||||||
formatter: '{value}%',
|
},
|
||||||
}, },
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '续租率',
|
name: '续租率',
|
||||||
@@ -178,28 +172,28 @@ onMounted(async () => {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function fetchConservationTasksBar() {
|
||||||
|
const countAchievedData: any = await countAchieved();
|
||||||
renderConservationTasksBar({
|
renderConservationTasksBar({
|
||||||
title: { text: '养护任务完成情况' },
|
title: { text: '养护任务完成情况' },
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
axisPointer: { type: 'shadow' },
|
axisPointer: { type: 'shadow' },
|
||||||
formatter: function (params: any) {
|
formatter: function (params: any) {
|
||||||
// params 是一个数组,包含每个系列的当前项
|
|
||||||
let result = params[0].axisValue + '<br/>';
|
let result = params[0].axisValue + '<br/>';
|
||||||
params.forEach((item: any) => {
|
params.forEach((item: any) => {
|
||||||
if (item.seriesName === '完成率') {
|
if (item.seriesName === '完成率') {
|
||||||
// 假设原始数据是 80,显示为 80%
|
|
||||||
result += item.marker + item.seriesName + ':' + item.data + '%<br/>';
|
result += item.marker + item.seriesName + ':' + item.data + '%<br/>';
|
||||||
} else {
|
} else {
|
||||||
result += item.marker + item.seriesName + ':' + item.data + '<br/>';
|
result += item.marker + item.seriesName + ':' + item.data + '<br/>';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
|
||||||
},
|
},
|
||||||
legend: {
|
|
||||||
data: ['计划任务数', '已完成数', '完成率'],
|
|
||||||
},
|
},
|
||||||
|
legend: { data: ['计划任务数', '已完成数', '完成率'] },
|
||||||
xAxis: [
|
xAxis: [
|
||||||
{
|
{
|
||||||
type: 'category',
|
type: 'category',
|
||||||
@@ -207,49 +201,26 @@ onMounted(async () => {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
yAxis: [
|
yAxis: [
|
||||||
{
|
{ type: 'value', name: '任务数', min: 0, max: 200, position: 'left' },
|
||||||
type: 'value',
|
{ type: 'value', name: '完成率', min: 0, max: 100, position: 'right', axisLabel: { formatter: '{value}%' } },
|
||||||
name: '任务数',
|
|
||||||
min: 0,
|
|
||||||
max: 200,
|
|
||||||
position: 'left',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'value',
|
|
||||||
name: '完成率',
|
|
||||||
min: 0,
|
|
||||||
max: 100,
|
|
||||||
position: 'right',
|
|
||||||
axisLabel: {
|
|
||||||
formatter: '{value}%',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
series: [
|
series: [
|
||||||
{
|
{ name: '计划任务数', type: 'bar', data: countAchievedData.total || [] },
|
||||||
name: '计划任务数',
|
{ name: '已完成数', type: 'bar', data: countAchievedData.finish || [] },
|
||||||
type: 'bar',
|
{ name: '完成率', type: 'line', yAxisIndex: 1, data: countAchievedData.rate || [] },
|
||||||
data: countAchievedData.total || [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '已完成数',
|
|
||||||
type: 'bar',
|
|
||||||
data: countAchievedData.finish || [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '完成率',
|
|
||||||
type: 'line',
|
|
||||||
yAxisIndex: 1,
|
|
||||||
data: countAchievedData.rate || [],
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function fetchMaintenanceQualityScoresPei() {
|
||||||
|
const countByCusScoreData: any = await countByCusScore();
|
||||||
|
const countByCusScoreDataList = countByCusScoreData.map((item: { score: string; count: number }) => ({
|
||||||
|
value: item.count,
|
||||||
|
name: item.score,
|
||||||
|
}));
|
||||||
renderMaintenanceQualityScoresPei({
|
renderMaintenanceQualityScoresPei({
|
||||||
title: { text: '养护质量评分分布', left: 'center' },
|
title: { text: '养护质量评分分布', left: 'center' },
|
||||||
tooltip: {
|
tooltip: { trigger: 'item', formatter: '{b} : {d}%' },
|
||||||
trigger: 'item',
|
|
||||||
formatter: '{b} : {d}%',
|
|
||||||
},
|
|
||||||
legend: {
|
legend: {
|
||||||
orient: 'horizontal',
|
orient: 'horizontal',
|
||||||
left: 'center',
|
left: 'center',
|
||||||
@@ -263,13 +234,27 @@ onMounted(async () => {
|
|||||||
radius: '60%',
|
radius: '60%',
|
||||||
center: ['50%', '50%'],
|
center: ['50%', '50%'],
|
||||||
data: countByCusScoreDataList || [],
|
data: countByCusScoreDataList || [],
|
||||||
label: {
|
label: { formatter: '{b} {d}%', show: true },
|
||||||
formatter: '{b} {d}%',
|
|
||||||
show: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
loading.value = true;
|
||||||
|
try {
|
||||||
|
await fetchOrderAndAmount();
|
||||||
|
await fetchCustomers();
|
||||||
|
await fetchAchievedRate();
|
||||||
|
await fetchOrderTrend();
|
||||||
|
await fetchLeasePie();
|
||||||
|
await fetchCustomerTypesBar();
|
||||||
|
await fetchCustomerRenewalLine();
|
||||||
|
await fetchConservationTasksBar();
|
||||||
|
await fetchMaintenanceQualityScoresPei();
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
// 切换视图模式
|
// 切换视图模式
|
||||||
async function handleViewModeChange(e: RadioChangeEvent): Promise<void> {
|
async function handleViewModeChange(e: RadioChangeEvent): Promise<void> {
|
||||||
@@ -313,6 +298,7 @@ function formatNumber(num: number | string) {
|
|||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
|
<Spin :spinning="loading" size="large">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<div class="title-text">绿植租赁业务统计报表:</div>
|
<div class="title-text">绿植租赁业务统计报表:</div>
|
||||||
@@ -341,7 +327,7 @@ function formatNumber(num: number | string) {
|
|||||||
</div>
|
</div>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="title">绿植养护完成率</div>
|
<div class="title">绿植养护完成率</div>
|
||||||
<div class="number">{{ countAchievedRateData }}</div>
|
<div class="number">{{ countAchievedRateData || '0.00%' }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row-first">
|
<div class="row-first">
|
||||||
@@ -408,6 +394,7 @@ function formatNumber(num: number | string) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</Spin>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@@ -2,6 +2,7 @@ import type {FormSchemaGetter} from '#/adapter/form';
|
|||||||
import type {VxeGridProps} from '#/adapter/vxe-table';
|
import type {VxeGridProps} from '#/adapter/vxe-table';
|
||||||
import {getDictOptions} from "#/utils/dict";
|
import {getDictOptions} from "#/utils/dict";
|
||||||
import {renderDict} from "#/utils/render";
|
import {renderDict} from "#/utils/render";
|
||||||
|
import {z} from "#/adapter/form";
|
||||||
|
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
@@ -32,16 +33,14 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
{type: 'checkbox', width: 60},
|
{type: 'checkbox', width: 60},
|
||||||
{
|
{
|
||||||
title: '主键id',
|
title: '计划名称',
|
||||||
field: 'id',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '巡检计划名称',
|
|
||||||
field: 'planName',
|
field: 'planName',
|
||||||
|
minWidth: 180,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '巡检路线',
|
title: '巡检路线',
|
||||||
field: 'inspectionRouteId',
|
field: 'inspectionRouteId',
|
||||||
|
width: 180,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '巡检周期',
|
title: '巡检周期',
|
||||||
@@ -51,26 +50,22 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
return renderDict(row.inspectionPlanPeriod, 'wy_xjzq');
|
return renderDict(row.inspectionPlanPeriod, 'wy_xjzq');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '任务提前分组',
|
title: '任务提前分钟',
|
||||||
field: 'beforeTime',
|
field: 'beforeTime',
|
||||||
|
width: 120,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '开始日期',
|
title: '开始日期',
|
||||||
field: 'startDate',
|
field: 'startDate',
|
||||||
|
width: 120,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '结束日期',
|
title: '结束日期',
|
||||||
field: 'endDate',
|
field: 'endDate',
|
||||||
},
|
width: 120,
|
||||||
{
|
|
||||||
title: '开始时间',
|
|
||||||
field: 'startTime',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '结束时间',
|
|
||||||
field: 'endTime',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '签到方式',
|
title: '签到方式',
|
||||||
@@ -80,6 +75,7 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
return renderDict(row.signType, 'wy_xjqdfs');
|
return renderDict(row.signType, 'wy_xjqdfs');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
width: 120,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '是否允许补检',
|
title: '是否允许补检',
|
||||||
@@ -89,14 +85,13 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
return renderDict(row.canReexamine, 'wy_sf');
|
return renderDict(row.canReexamine, 'wy_sf');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
width: 120,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '选择员工',
|
title: '状态',
|
||||||
field: 'userId',
|
field: 'state',
|
||||||
},
|
width: 120,
|
||||||
{
|
slots:{default: 'state'}
|
||||||
title: '备注',
|
|
||||||
field: 'remark',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'action',
|
field: 'action',
|
||||||
@@ -118,7 +113,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '巡检计划名称',
|
label: '计划名称',
|
||||||
fieldName: 'planName',
|
fieldName: 'planName',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
@@ -126,61 +121,80 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
{
|
{
|
||||||
label: '巡检路线',
|
label: '巡检路线',
|
||||||
fieldName: 'inspectionRouteId',
|
fieldName: 'inspectionRouteId',
|
||||||
component: 'Input',
|
component: 'ApiSelect',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '巡检周期',
|
label: '巡检周期',
|
||||||
fieldName: 'inspectionPlanPeriod',
|
fieldName: 'inspectionPlanPeriod',
|
||||||
component: 'Input',
|
component: 'Select',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
options: getDictOptions('wy_xjzq'),
|
options: getDictOptions('wy_xjzq'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '任务提前分组',
|
label: '任务提前',
|
||||||
fieldName: 'beforeTime',
|
fieldName: 'beforeTime',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: z.number({
|
||||||
|
required_error: "请输入任务提前完成分钟数",
|
||||||
|
invalid_type_error: "请输入任务提前完成分钟数"
|
||||||
|
}),
|
||||||
|
slots: {default: 'beforeTime'},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '开始日期',
|
label: '周',
|
||||||
fieldName: 'startDate',
|
fieldName: 'inspectionWorkday',
|
||||||
component: 'DatePicker',
|
component: 'CheckboxGroup',
|
||||||
|
rules: 'selectRequired',
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
dependencies: {
|
||||||
|
show: (formValue) => formValue.inspectionPlanPeriod == '2',
|
||||||
|
triggerFields: ['inspectionPlanPeriod'],
|
||||||
|
},
|
||||||
componentProps: {
|
componentProps: {
|
||||||
showTime: true,
|
options: getDictOptions('wy_xq')
|
||||||
format: 'YYYY-MM-DD HH:mm:ss',
|
}
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
||||||
},
|
|
||||||
rules: 'required',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '结束日期',
|
label: '月',
|
||||||
fieldName: 'endDate',
|
fieldName: 'inspectionMonth',
|
||||||
component: 'DatePicker',
|
component: 'CheckboxGroup',
|
||||||
|
rules: 'selectRequired',
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
dependencies: {
|
||||||
|
show: (formValue) => formValue.inspectionPlanPeriod == '1',
|
||||||
|
triggerFields: ['inspectionPlanPeriod'],
|
||||||
|
},
|
||||||
componentProps: {
|
componentProps: {
|
||||||
showTime: true,
|
options: Array.from({ length: 12 }, (_, i) => ({
|
||||||
format: 'YYYY-MM-DD HH:mm:ss',
|
label: `${i + 1}月`,
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
value: (i + 1).toString(),
|
||||||
},
|
})),
|
||||||
rules: 'required',
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '开始时间',
|
label: '日',
|
||||||
fieldName: 'startTime',
|
fieldName: 'inspectionDay',
|
||||||
component: 'DatePicker',
|
component: 'CheckboxGroup',
|
||||||
|
rules: 'selectRequired',
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
dependencies: {
|
||||||
|
show: (formValue) => formValue.inspectionPlanPeriod == '1',
|
||||||
|
triggerFields: ['inspectionPlanPeriod'],
|
||||||
|
},
|
||||||
componentProps: {
|
componentProps: {
|
||||||
showTime: true,
|
options: Array.from({ length: 31 }, (_, i) => ({
|
||||||
format: 'YYYY-MM-DD HH:mm:ss',
|
label: `${i + 1}日`,
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
value: (i + 1).toString(),
|
||||||
},
|
})),
|
||||||
rules: 'required',
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '结束时间',
|
label: '计划日期',
|
||||||
fieldName: 'endTime',
|
fieldName: 'planDate',
|
||||||
component: 'DatePicker',
|
component: 'RangePicker',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
showTime: true,
|
showTime: true,
|
||||||
format: 'YYYY-MM-DD HH:mm:ss',
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
@@ -200,21 +214,28 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
{
|
{
|
||||||
label: '允许补检',
|
label: '允许补检',
|
||||||
fieldName: 'canReexamine',
|
fieldName: 'canReexamine',
|
||||||
component: 'Select',
|
component: 'RadioGroup',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
options: getDictOptions('wy_sf'),
|
options: getDictOptions('wy_sf'),
|
||||||
|
buttonStyle: 'solid',
|
||||||
},
|
},
|
||||||
rules: 'selectRequired',
|
rules: 'selectRequired',
|
||||||
|
defaultValue:'0'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '选择员工',
|
label: '巡检人员',
|
||||||
fieldName: 'userId',
|
fieldName: 'userId',
|
||||||
component: 'Input',
|
component: 'ApiSelect',
|
||||||
rules: 'required',
|
componentProps:{
|
||||||
|
mode: 'multiple',
|
||||||
|
},
|
||||||
|
rules: z.array(z.string()).min(1, { message: '请选择巡检人员' }),
|
||||||
|
formItemClass: 'col-span-2'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '备注',
|
label: '备注',
|
||||||
fieldName: 'remark',
|
fieldName: 'remark',
|
||||||
component: 'Input',
|
component: 'Textarea',
|
||||||
|
formItemClass: 'col-span-2'
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@@ -1,14 +1,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Recordable } from '@vben/types';
|
|
||||||
|
|
||||||
import { ref } from 'vue';
|
|
||||||
|
|
||||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||||
import { getVxePopupContainer } from '@vben/utils';
|
import { getVxePopupContainer } from '@vben/utils';
|
||||||
|
|
||||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
import dayjs from 'dayjs';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useVbenVxeGrid,
|
useVbenVxeGrid,
|
||||||
vxeCheckboxChecked,
|
vxeCheckboxChecked,
|
||||||
@@ -18,13 +12,16 @@ import {
|
|||||||
import {
|
import {
|
||||||
inspectionPlanExport,
|
inspectionPlanExport,
|
||||||
inspectionPlanList,
|
inspectionPlanList,
|
||||||
inspectionPlanRemove,
|
inspectionPlanRemove, inspectionPlanUpdate,
|
||||||
} from '#/api/property/inspectionManagement/inspectionPlan';
|
} from '#/api/property/inspectionManagement/inspectionPlan';
|
||||||
import type { InspectionPlanForm } from '#/api/property/inspectionManagement/inspectionPlan/model';
|
import type { InspectionPlanForm } from '#/api/property/inspectionManagement/inspectionPlan/model';
|
||||||
import { commonDownloadExcel } from '#/utils/file/download';
|
import { commonDownloadExcel } from '#/utils/file/download';
|
||||||
|
|
||||||
import inspectionPlanModal from './inspectionPlan-modal.vue';
|
import inspectionPlanModal from './inspectionPlan-modal.vue';
|
||||||
|
import inspectionPlanDetail from './plan-detail.vue';
|
||||||
import { columns, querySchema } from './data';
|
import { columns, querySchema } from './data';
|
||||||
|
import {TableSwitch} from "#/components/table";
|
||||||
|
import {useAccess} from "@vben/access";
|
||||||
|
|
||||||
const formOptions: VbenFormProps = {
|
const formOptions: VbenFormProps = {
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
@@ -35,15 +32,6 @@ const formOptions: VbenFormProps = {
|
|||||||
},
|
},
|
||||||
schema: querySchema(),
|
schema: querySchema(),
|
||||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
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 = {
|
const gridOptions: VxeGridProps = {
|
||||||
@@ -55,8 +43,6 @@ const gridOptions: VxeGridProps = {
|
|||||||
// 点击行选中
|
// 点击行选中
|
||||||
// trigger: 'row',
|
// trigger: 'row',
|
||||||
},
|
},
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
||||||
// columns: columns(),
|
|
||||||
columns,
|
columns,
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
keepSource: true,
|
keepSource: true,
|
||||||
@@ -87,11 +73,18 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
|||||||
const [InspectionPlanModal, modalApi] = useVbenModal({
|
const [InspectionPlanModal, modalApi] = useVbenModal({
|
||||||
connectedComponent: inspectionPlanModal,
|
connectedComponent: inspectionPlanModal,
|
||||||
});
|
});
|
||||||
|
const [InspectionPlanDetail, detailApi] = useVbenModal({
|
||||||
|
connectedComponent: inspectionPlanDetail,
|
||||||
|
});
|
||||||
|
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
modalApi.setData({});
|
modalApi.setData({});
|
||||||
modalApi.open();
|
modalApi.open();
|
||||||
}
|
}
|
||||||
|
function handleInfo(row: Required<InspectionPlanForm>) {
|
||||||
|
detailApi.setData({ id: row.id });
|
||||||
|
detailApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
async function handleEdit(row: Required<InspectionPlanForm>) {
|
async function handleEdit(row: Required<InspectionPlanForm>) {
|
||||||
modalApi.setData({ id: row.id });
|
modalApi.setData({ id: row.id });
|
||||||
@@ -122,6 +115,7 @@ function handleDownloadExcel() {
|
|||||||
fieldMappingTime: formOptions.fieldMappingTime,
|
fieldMappingTime: formOptions.fieldMappingTime,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
const { hasAccessByCodes } = useAccess();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -154,6 +148,12 @@ function handleDownloadExcel() {
|
|||||||
</template>
|
</template>
|
||||||
<template #action="{ row }">
|
<template #action="{ row }">
|
||||||
<Space>
|
<Space>
|
||||||
|
<ghost-button
|
||||||
|
v-access:code="['property:inspectionPlan:info']"
|
||||||
|
@click.stop="handleInfo(row)"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.info') }}
|
||||||
|
</ghost-button>
|
||||||
<ghost-button
|
<ghost-button
|
||||||
v-access:code="['property:inspectionPlan:edit']"
|
v-access:code="['property:inspectionPlan:edit']"
|
||||||
@click.stop="handleEdit(row)"
|
@click.stop="handleEdit(row)"
|
||||||
@@ -176,7 +176,20 @@ function handleDownloadExcel() {
|
|||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
</Space>
|
</Space>
|
||||||
</template>
|
</template>
|
||||||
|
<template #state="{row}">
|
||||||
|
<TableSwitch
|
||||||
|
checkedValue="0"
|
||||||
|
unCheckedValue="1"
|
||||||
|
checkedText="启用"
|
||||||
|
unCheckedText="停用"
|
||||||
|
v-model:value="row.state"
|
||||||
|
:api="() => inspectionPlanUpdate(row)"
|
||||||
|
:disabled="!hasAccessByCodes(['property:inspectionPlan:edit'])"
|
||||||
|
@reload="() => tableApi.query()"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<InspectionPlanModal @reload="tableApi.query()" />
|
<InspectionPlanModal @reload="tableApi.query()" />
|
||||||
|
<InspectionPlanDetail/>
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -6,10 +6,18 @@ import { $t } from '@vben/locales';
|
|||||||
import {cloneDeep} from '@vben/utils';
|
import {cloneDeep} from '@vben/utils';
|
||||||
|
|
||||||
import {useVbenForm} from '#/adapter/form';
|
import {useVbenForm} from '#/adapter/form';
|
||||||
import { inspectionPlanAdd, inspectionPlanInfo, inspectionPlanUpdate } from '#/api/property/inspectionManagement/inspectionPlan';
|
import {
|
||||||
|
inspectionPlanAdd,
|
||||||
|
inspectionPlanInfo,
|
||||||
|
inspectionPlanUpdate
|
||||||
|
} from '#/api/property/inspectionManagement/inspectionPlan';
|
||||||
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||||
|
|
||||||
import {modalSchema} from './data';
|
import {modalSchema} from './data';
|
||||||
|
import {personList} from "#/api/property/resident/person";
|
||||||
|
import {renderDictValue} from "#/utils/render";
|
||||||
|
import {inspectionRouteList} from "#/api/property/inspectionManagement/inspectionRoute";
|
||||||
|
import {InputNumber} from 'ant-design-vue'
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
@@ -21,7 +29,7 @@ const title = computed(() => {
|
|||||||
const [BasicForm, formApi] = useVbenForm({
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
// 默认占满两列
|
// 默认占满两列
|
||||||
formItemClass: 'col-span-2',
|
formItemClass: 'col-span-1',
|
||||||
// 默认label宽度 px
|
// 默认label宽度 px
|
||||||
labelWidth: 80,
|
labelWidth: 80,
|
||||||
// 通用配置项 会影响到所有表单项
|
// 通用配置项 会影响到所有表单项
|
||||||
@@ -43,7 +51,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
|||||||
|
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
// 在这里更改宽度
|
// 在这里更改宽度
|
||||||
class: 'w-[550px]',
|
class: 'w-[70%]',
|
||||||
fullscreenButton: false,
|
fullscreenButton: false,
|
||||||
onBeforeClose,
|
onBeforeClose,
|
||||||
onClosed: handleClosed,
|
onClosed: handleClosed,
|
||||||
@@ -53,12 +61,20 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
|
await queryLineData()
|
||||||
|
await queryPersonData()
|
||||||
const {id} = modalApi.getData() as { id?: number | string };
|
const {id} = modalApi.getData() as { id?: number | string };
|
||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await inspectionPlanInfo(id);
|
const record = await inspectionPlanInfo(id);
|
||||||
|
record.planDate = [record.startDate, record.endDate]
|
||||||
|
if(record.inspectionPlanPeriod=='1'){
|
||||||
|
record.inspectionMonth=record.inspectionMonth?.split(',')
|
||||||
|
record.inspectionDay=record.inspectionDay?.split(',')
|
||||||
|
}else {
|
||||||
|
record.inspectionWorkday=record.inspectionWorkday?.split(',')
|
||||||
|
}
|
||||||
|
record.userId=record.userId?.split(',')
|
||||||
await formApi.setValues(record);
|
await formApi.setValues(record);
|
||||||
}
|
}
|
||||||
await markInitialized();
|
await markInitialized();
|
||||||
@@ -76,6 +92,20 @@ async function handleConfirm() {
|
|||||||
}
|
}
|
||||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||||
const data = cloneDeep(await formApi.getValues());
|
const data = cloneDeep(await formApi.getValues());
|
||||||
|
if (data.planDate && data.planDate.length) {
|
||||||
|
data.startDate = data.planDate[0]
|
||||||
|
data.endDate = data.planDate[1]
|
||||||
|
}
|
||||||
|
if(data.inspectionPlanPeriod=='1'){
|
||||||
|
data.inspectionMonth=data.inspectionMonth?.join(',')
|
||||||
|
data.inspectionDay=data.inspectionDay?.join(',')
|
||||||
|
data.inspectionWorkday=undefined
|
||||||
|
}else {
|
||||||
|
data.inspectionWorkday=data.inspectionWorkday?.join(',')
|
||||||
|
data.inspectionMonth=undefined
|
||||||
|
data.inspectionDay=undefined
|
||||||
|
}
|
||||||
|
data.userId=data.userId?.join(',')
|
||||||
await (isUpdate.value ? inspectionPlanUpdate(data) : inspectionPlanAdd(data));
|
await (isUpdate.value ? inspectionPlanUpdate(data) : inspectionPlanAdd(data));
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
emit('reload');
|
emit('reload');
|
||||||
@@ -91,11 +121,79 @@ async function handleClosed() {
|
|||||||
await formApi.resetForm();
|
await formApi.resetForm();
|
||||||
resetInitialized();
|
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: 'userId',
|
||||||
|
}])
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检路线数据
|
||||||
|
*/
|
||||||
|
async function queryLineData() {
|
||||||
|
let params = {
|
||||||
|
pageSize: 1000,
|
||||||
|
pageNum: 1,
|
||||||
|
}
|
||||||
|
const res = await inspectionRouteList(params);
|
||||||
|
const options = res.rows.map((item) => ({
|
||||||
|
label: item.routeName,
|
||||||
|
value: item.id,
|
||||||
|
}));
|
||||||
|
formApi.updateSchema([{
|
||||||
|
componentProps: () => ({
|
||||||
|
options: options,
|
||||||
|
showSearch: true,
|
||||||
|
filterOption: filterOption
|
||||||
|
}),
|
||||||
|
fieldName: 'inspectionRouteId',
|
||||||
|
}])
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterOption = (input: string, option: any) => {
|
||||||
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<BasicModal :title="title">
|
<BasicModal :title="title">
|
||||||
<BasicForm />
|
<BasicForm>
|
||||||
|
<template #beforeTime="slotProps">
|
||||||
|
<div class="before-time">
|
||||||
|
<InputNumber id="inputNumber" v-bind="slotProps" :min="1"/>
|
||||||
|
<span class="tail-text">分钟完成</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</BasicForm>
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.before-time {
|
||||||
|
display: flex;
|
||||||
|
.tail-text {
|
||||||
|
width: 100px;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
font-weight: 500;
|
||||||
|
text-align: center;
|
||||||
|
line-height:32px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
@@ -0,0 +1,107 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import {shallowRef} from 'vue';
|
||||||
|
import {useVbenModal} from '@vben/common-ui';
|
||||||
|
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
import duration from 'dayjs/plugin/duration';
|
||||||
|
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||||
|
import {renderDict} from "#/utils/render";
|
||||||
|
import {inspectionPlanInfo} from "#/api/property/inspectionManagement/inspectionPlan";
|
||||||
|
import type {InspectionPlanVO} from "#/api/property/inspectionManagement/inspectionPlan/model";
|
||||||
|
|
||||||
|
dayjs.extend(duration);
|
||||||
|
dayjs.extend(relativeTime);
|
||||||
|
import {CheckboxGroup} from 'ant-design-vue'
|
||||||
|
import {getDictOptions} from "#/utils/dict";
|
||||||
|
|
||||||
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
|
onOpenChange: handleOpenChange,
|
||||||
|
onClosed() {
|
||||||
|
inspectionPlanDetail.value = null;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const inspectionPlanDetail = shallowRef<null | InspectionPlanVO>(null);
|
||||||
|
|
||||||
|
async function handleOpenChange(open: boolean) {
|
||||||
|
if (!open) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
modalApi.modalLoading(true);
|
||||||
|
const {id} = modalApi.getData() as { id: number | string };
|
||||||
|
const response = await inspectionPlanInfo(id);
|
||||||
|
inspectionPlanDetail.value = response;
|
||||||
|
if (inspectionPlanDetail.value.inspectionPlanPeriod == '1') {
|
||||||
|
inspectionPlanDetail.value.inspectionMonth = inspectionPlanDetail.value.inspectionMonth?.split(',');
|
||||||
|
inspectionPlanDetail.value.inspectionDay = inspectionPlanDetail.value.inspectionDay?.split(',');
|
||||||
|
} else {
|
||||||
|
inspectionPlanDetail.value.inspectionWorkday = inspectionPlanDetail.value.inspectionWorkday?.split(',');
|
||||||
|
}
|
||||||
|
inspectionPlanDetail.value.userId = inspectionPlanDetail.value.userId?.split(',');
|
||||||
|
modalApi.modalLoading(false);
|
||||||
|
}
|
||||||
|
const dayArr=Array.from({ length: 31 }, (_, i) => ({
|
||||||
|
label: `${i + 1}日`,
|
||||||
|
value: (i + 1).toString(),
|
||||||
|
}));
|
||||||
|
const monthArr=Array.from({ length: 12 }, (_, i) => ({
|
||||||
|
label: `${i + 1}月`,
|
||||||
|
value: (i + 1).toString(),
|
||||||
|
}))
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BasicModal :footer="false" :fullscreen-button="false" title="巡检计划详情" class="w-[70%]">
|
||||||
|
<Descriptions v-if="inspectionPlanDetail" size="small" :column="2" bordered
|
||||||
|
:labelStyle="{width:'100px'}">
|
||||||
|
<DescriptionsItem label="计划名称">
|
||||||
|
{{ inspectionPlanDetail.planName }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="巡检路线">
|
||||||
|
{{ inspectionPlanDetail.inspectionRouteId }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="巡检周期" v-if="inspectionPlanDetail.inspectionPlanPeriod!=null">
|
||||||
|
<component
|
||||||
|
:is="renderDict(inspectionPlanDetail.inspectionPlanPeriod,'wy_xjzq')"
|
||||||
|
/>
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="任务提前" v-if="inspectionPlanDetail.beforeTime!=null">
|
||||||
|
<span>{{ inspectionPlanDetail.beforeTime + ' 分钟完成' }}</span>
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="周" :span="2" v-if="inspectionPlanDetail.inspectionPlanPeriod=='2'">
|
||||||
|
<CheckboxGroup v-model:value="inspectionPlanDetail.inspectionWorkday"
|
||||||
|
:options="getDictOptions('wy_xq')"/>
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="月" :span="2" v-if="inspectionPlanDetail.inspectionPlanPeriod=='1'">
|
||||||
|
<CheckboxGroup v-model:value="inspectionPlanDetail.inspectionMonth"
|
||||||
|
:options="monthArr"/>
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="日" :span="2" v-if="inspectionPlanDetail.inspectionPlanPeriod=='1'">
|
||||||
|
<CheckboxGroup v-model:value="inspectionPlanDetail.inspectionDay"
|
||||||
|
:options="dayArr"/>
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="计划日期" :span="2">
|
||||||
|
{{ inspectionPlanDetail.startDate + '\xa0至\xa0' + inspectionPlanDetail.endDate }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="签到方式">
|
||||||
|
<component
|
||||||
|
:is="renderDict(inspectionPlanDetail.signType,'wy_xjqdfs')"
|
||||||
|
/>
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="允许补检">
|
||||||
|
<component
|
||||||
|
:is="renderDict(inspectionPlanDetail.canReexamine,'wy_sf')"
|
||||||
|
/>
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="巡检人员" :span="2">
|
||||||
|
{{ inspectionPlanDetail.projectName }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="备注" :span="2">
|
||||||
|
{{ inspectionPlanDetail.remark }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="状态" v-if="inspectionPlanDetail.state!=null">
|
||||||
|
<span>{{ inspectionPlanDetail.state == '1' ? '停用' : '启用' }}</span>
|
||||||
|
</DescriptionsItem>
|
||||||
|
</Descriptions>
|
||||||
|
</BasicModal>
|
||||||
|
</template>
|
@@ -175,20 +175,5 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
label: '备注',
|
label: '备注',
|
||||||
fieldName: 'remark',
|
fieldName: 'remark',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
}
|
||||||
{
|
|
||||||
label: '创建人id',
|
|
||||||
fieldName: 'createById',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '更新人id',
|
|
||||||
fieldName: 'updateById',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '搜索值',
|
|
||||||
fieldName: 'searchValue',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
@@ -155,12 +155,12 @@ function handleDownloadExcel() {
|
|||||||
</template>
|
</template>
|
||||||
<template #action="{ row }">
|
<template #action="{ row }">
|
||||||
<Space>
|
<Space>
|
||||||
<ghost-button
|
<!-- <ghost-button
|
||||||
v-access:code="['property:inspectionTask:edit']"
|
v-access:code="['property:inspectionTask:edit']"
|
||||||
@click.stop="handleEdit(row)"
|
@click.stop="handleEdit(row)"
|
||||||
>
|
>
|
||||||
{{ $t('pages.common.edit') }}
|
{{ $t('pages.common.edit') }}
|
||||||
</ghost-button>
|
</ghost-button> -->
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
:get-popup-container="getVxePopupContainer"
|
:get-popup-container="getVxePopupContainer"
|
||||||
placement="left"
|
placement="left"
|
||||||
|
@@ -3,7 +3,7 @@ import type { VxeGridProps } from '#/adapter/vxe-table';
|
|||||||
import { getPopupContainer } from '@vben/utils';
|
import { getPopupContainer } from '@vben/utils';
|
||||||
import { getDictOptions } from '#/utils/dict';
|
import { getDictOptions } from '#/utils/dict';
|
||||||
import { DictEnum } from '@vben/constants';
|
import { DictEnum } from '@vben/constants';
|
||||||
|
import { renderDict } from '#/utils/render';
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
@@ -57,10 +57,16 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
{
|
{
|
||||||
title: '是否可售',
|
title: '是否可售',
|
||||||
field: 'isForSale',
|
field: 'isForSale',
|
||||||
|
slots: {
|
||||||
|
default: ({ row }) => {
|
||||||
|
return renderDict(row.isForSale, DictEnum.wy_sf);
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
field: 'statusName',
|
field: 'statusName',
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'action',
|
field: 'action',
|
||||||
@@ -125,7 +131,11 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
{
|
{
|
||||||
label: '是否可售',
|
label: '是否可售',
|
||||||
fieldName: 'isForSale',
|
fieldName: 'isForSale',
|
||||||
component: 'Input',
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
getPopupContainer,
|
||||||
|
options: getDictOptions(DictEnum.wy_sf),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '状态',
|
label: '状态',
|
||||||
|
@@ -14,6 +14,7 @@ import {
|
|||||||
accessControlExport,
|
accessControlExport,
|
||||||
accessControlList,
|
accessControlList,
|
||||||
accessControlRemove,
|
accessControlRemove,
|
||||||
|
accessControlSync
|
||||||
} from '#/api/sis/accessControl';
|
} from '#/api/sis/accessControl';
|
||||||
import type { AccessControlForm } from '#/api/sis/accessControl/model';
|
import type { AccessControlForm } from '#/api/sis/accessControl/model';
|
||||||
import { commonDownloadExcel } from '#/utils/file/download';
|
import { commonDownloadExcel } from '#/utils/file/download';
|
||||||
@@ -98,6 +99,11 @@ async function handleDelete(row: Required<AccessControlForm>) {
|
|||||||
await tableApi.query();
|
await tableApi.query();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function handleSyncE8() {
|
||||||
|
await accessControlSync();
|
||||||
|
await tableApi.query();
|
||||||
|
}
|
||||||
|
|
||||||
function handleMultiDelete() {
|
function handleMultiDelete() {
|
||||||
const rows = tableApi.grid.getCheckboxRecords();
|
const rows = tableApi.grid.getCheckboxRecords();
|
||||||
const ids = rows.map((row: Required<AccessControlForm>) => row.id);
|
const ids = rows.map((row: Required<AccessControlForm>) => row.id);
|
||||||
@@ -129,6 +135,7 @@ function handleDownloadExcel() {
|
|||||||
<BasicTable table-title="门禁设备列表">
|
<BasicTable table-title="门禁设备列表">
|
||||||
<template #toolbar-tools>
|
<template #toolbar-tools>
|
||||||
<Space>
|
<Space>
|
||||||
|
<a-button @click="handleSyncE8">同步</a-button>
|
||||||
<a-button
|
<a-button
|
||||||
v-access:code="['property:accessControl:export']"
|
v-access:code="['property:accessControl:export']"
|
||||||
@click="handleDownloadExcel"
|
@click="handleDownloadExcel"
|
||||||
|
@@ -130,12 +130,9 @@ export const drawerSchema: FormSchemaGetter = () => [
|
|||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'phonenumber',
|
fieldName: 'phonenumber',
|
||||||
label: '手机号码',
|
label: '手机号码',
|
||||||
defaultValue: undefined,
|
|
||||||
rules: z
|
rules: z
|
||||||
.string()
|
.string()
|
||||||
.regex(/^1[3-9]\d{9}$/, '请输入正确的手机号码')
|
.regex(/^1[3-9]\d{9}$/, { message: '请输入正确的手机号' }),
|
||||||
.optional()
|
|
||||||
.or(z.literal('')),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
|
@@ -73,15 +73,9 @@ async function viteExtraAppConfigPlugin({
|
|||||||
async function getConfigSource() {
|
async function getConfigSource() {
|
||||||
const config = await loadEnv();
|
const config = await loadEnv();
|
||||||
const windowVariable = `window.${VBEN_ADMIN_PRO_APP_CONF}`;
|
const windowVariable = `window.${VBEN_ADMIN_PRO_APP_CONF}`;
|
||||||
// 确保变量不会被修改
|
// 只使用 Object.freeze 来防止配置被修改,不设置 window 对象属性为只读
|
||||||
let source = `${windowVariable}=${JSON.stringify(config)};`;
|
let source = `${windowVariable}=${JSON.stringify(config)};`;
|
||||||
source += `
|
source += `Object.freeze(${windowVariable});`;
|
||||||
Object.freeze(${windowVariable});
|
|
||||||
Object.defineProperty(window, "${VBEN_ADMIN_PRO_APP_CONF}", {
|
|
||||||
configurable: false,
|
|
||||||
writable: false,
|
|
||||||
});
|
|
||||||
`.replaceAll(/\s/g, '');
|
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@ export const DictEnum = {
|
|||||||
wy_fjzt: 'wy_fjzt', // 房间状态
|
wy_fjzt: 'wy_fjzt', // 房间状态
|
||||||
wy_direction_towards: 'direction_towards', // 房间朝向
|
wy_direction_towards: 'direction_towards', // 房间朝向
|
||||||
sis_device_status: 'sis_device_status', //设备在线状态
|
sis_device_status: 'sis_device_status', //设备在线状态
|
||||||
|
wy_sf:'wy_sf',//是否可售
|
||||||
SIS_ACCESS_CONTROL_DEVICE_TYPE: 'sis_access_control_device_type',
|
SIS_ACCESS_CONTROL_DEVICE_TYPE: 'sis_access_control_device_type',
|
||||||
SIS_LIB_TYPE: 'sis_lib_type',
|
SIS_LIB_TYPE: 'sis_lib_type',
|
||||||
WY_ZCSHZT: 'wy_zcshzt',
|
WY_ZCSHZT: 'wy_zcshzt',
|
||||||
|
Reference in New Issue
Block a user