Compare commits
177 Commits
d722c62f49
...
master
Author | SHA1 | Date | |
---|---|---|---|
e8d2650f9a | |||
5646112e44 | |||
82e971d98f | |||
d6da044b48 | |||
8c062feef0 | |||
bc59c2c22f | |||
90eceb508a | |||
f794f6a8a9 | |||
6cc969e56a | |||
6ca27444e0 | |||
2f2f8fb798 | |||
1de539ddde | |||
67b80d7687 | |||
b44fa6ee7f | |||
559bd55153 | |||
cc24027880 | |||
66b7cc44e9 | |||
5f3ae86698 | |||
84ff3d21b4 | |||
e88b8b41d8 | |||
48ea62150d | |||
5975d1b94d | |||
faababd9a4 | |||
c7f52fa107 | |||
28018815b7 | |||
bad1423acd | |||
f6f258c9b7 | |||
559e46dc41 | |||
67b7e64600 | |||
5c40b534f2 | |||
99b02c16eb | |||
c761c8ba0c | |||
882e1f7452 | |||
553a915027 | |||
ff5963b01d | |||
850b18d34c | |||
2afef1f33d | |||
29adc052c7 | |||
418a0a4e54 | |||
3d934e2e51 | |||
18c23a21a0 | |||
91f5b33e68 | |||
c8bcf9a28d | |||
69d17e29ff | |||
cb0a15e5fb | |||
b153c88cd5 | |||
7c55152cc3 | |||
3cad95d185 | |||
060fd5485e | |||
5fa41f6d85 | |||
a599e72a6b | |||
06a710d1f8 | |||
7b2c8e47dd | |||
a43cb1b390 | |||
ee9b7017f4 | |||
29df30ee82 | |||
76fa9960e0 | |||
e750414f02 | |||
006471bb1e | |||
c4d503f9b8 | |||
81fc3bf2ca | |||
3d1681e811 | |||
4b3ed5c2d5 | |||
28d6a77848 | |||
4139af5673 | |||
fc08c5525c | |||
5c7080a3da | |||
c090779319 | |||
36f93721ad | |||
957827e0e4 | |||
87fc96500a | |||
1a9927e60a | |||
bf13cbfbb7 | |||
ca4f180e7e | |||
6ed8a24745 | |||
5ff3cd67d0 | |||
7d15ff713c | |||
93be4f1891 | |||
79e7a20bd1 | |||
![]() |
79d650adb4 | ||
![]() |
69f0d4adb4 | ||
![]() |
4bc18e0e4c | ||
c75663a5c7 | |||
a025dc2321 | |||
2c6f431ba1 | |||
7aff23d72c | |||
ae46c42daa | |||
bff5b254c2 | |||
1aedec1270 | |||
0c2c709647 | |||
b0c29a6dd4 | |||
97dc93f3aa | |||
7edbeca307 | |||
65b13aced2 | |||
2b7b455f40 | |||
3cff90a31a | |||
023127fa78 | |||
d0b4d00f4b | |||
7529565364 | |||
81de99b015 | |||
78ff0f0c3d | |||
575ee16a87 | |||
fcd4051e90 | |||
f24ec168bf | |||
2cdbc64250 | |||
578aa61082 | |||
1db3c351e5 | |||
8da35d2d4b | |||
13f79986f8 | |||
d9b096c8ed | |||
8cf6df683d | |||
963c1ac9c0 | |||
12be6eb03b | |||
938bb0a52a | |||
09f850fccd | |||
1d1afb0162 | |||
bc73f02c47 | |||
f7462c254e | |||
931bdfcddd | |||
0a77934d8b | |||
![]() |
0d8bae5406 | ||
![]() |
b4f24df882 | ||
![]() |
489ec29184 | ||
899cefb73a | |||
5494d206d4 | |||
![]() |
c3f43f6e71 | ||
![]() |
73232037cc | ||
effcb9ef86 | |||
1e4c74230f | |||
ac30c32fcc | |||
ed8fa0f5b4 | |||
09db75ae58 | |||
e82a42b6a9 | |||
e0cf2f99f9 | |||
cf64e5fa19 | |||
![]() |
80d3739fb7 | ||
d9afe03c53 | |||
8bb861ca31 | |||
a048f3627e | |||
63d23bc447 | |||
3bb04f80eb | |||
117b574410 | |||
f4278ee9f1 | |||
cf17b814a8 | |||
f7e341bf08 | |||
01a71ea4c3 | |||
84140dc7e3 | |||
65e371d16e | |||
ee8e459aed | |||
6d6646ed3b | |||
fe2069a2e8 | |||
8bc05afd6d | |||
90531f1598 | |||
34b6f8e738 | |||
2beb771185 | |||
febe532404 | |||
0c9576039b | |||
e0a64edc14 | |||
8209630370 | |||
17c7bc0512 | |||
98d6dd0d9b | |||
28295b283e | |||
7ad4613fc8 | |||
523810a1da | |||
14d70b22d1 | |||
6f7c26a569 | |||
d9856230e6 | |||
cb32660b7b | |||
c847bd29e1 | |||
1b4124b913 | |||
0e38ea68fe | |||
b1fa25daf1 | |||
b7df7e350b | |||
3b51a615ed | |||
04b6fd0194 | |||
feb2eb68be | |||
90c803dfa3 |
@@ -1,37 +1,44 @@
|
||||
name: Gitea Actions Demo
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||
on: [push]
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- prod
|
||||
jobs:
|
||||
|
||||
Explore-Gitea-Actions:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu
|
||||
steps:
|
||||
|
||||
- name: Checkout code
|
||||
uses: http://47.109.37.87:3000/bichangxiong/checkout@v4 # 使用 Gitea 镜像
|
||||
- name: 拉取代码仓库
|
||||
uses: http://git.missmoc.top/mocheng/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1 # 只拉取最新一次提交
|
||||
|
||||
- name: Set up Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
fetch-depth: 1 # 只拉取最新的1个提交(浅克隆)
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: http://git.missmoc.top/mocheng/setup-node@v3
|
||||
with:
|
||||
node-version: 20.x
|
||||
- name: pnpm
|
||||
|
||||
- name: 安装pnpm
|
||||
run: npm i pnpm -g
|
||||
- name: node
|
||||
run: pnpm i
|
||||
- name: Build
|
||||
|
||||
- name: 安装依赖
|
||||
run: pnpm install
|
||||
continue-on-error: false # 依赖安装失败则终止工作流
|
||||
|
||||
- name: 构建项目
|
||||
run: pnpm build:antd
|
||||
- name: copy file via ssh password
|
||||
uses: appleboy/scp-action@v0.1.7
|
||||
with:
|
||||
host: 192.168.1.3
|
||||
username: root
|
||||
password: by@2025!
|
||||
port: 22
|
||||
source: "./apps/web-antd/dist"
|
||||
target: "/project/wl/web/dist"
|
||||
|
||||
|
||||
|
||||
continue-on-error: false # 构建失败则终止工作流
|
||||
|
||||
- name: 检查构建结果
|
||||
run: |
|
||||
if [ ! -d "./apps/web-antd/dist" ]; then
|
||||
echo "构建目录不存在,构建失败"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$(ls -A ./apps/web-antd/dist)" ]; then
|
||||
echo "构建目录为空,构建失败"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
- name: 通过SSH复制文件
|
||||
run: cp -rf ./apps/web-antd/dist/* /www/wwwroot/183.230.235.66_11010/property
|
@@ -1,23 +1,24 @@
|
||||
<!doctype html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<meta name="renderer" content="webkit" />
|
||||
<meta name="description" content="A Modern Back-end Management System" />
|
||||
<meta name="keywords" content="Vben Admin Vue3 Vite" />
|
||||
<meta name="author" content="Vben" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0"
|
||||
/>
|
||||
<!-- 由 vite 注入 VITE_APP_TITLE 变量,在 .env 文件内配置 -->
|
||||
<title><%= VITE_APP_TITLE %></title>
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<script type="text/javascript" src="/EasyPlayer-element.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<meta name="renderer" content="webkit"/>
|
||||
<meta name="description" content="A Modern Back-end Management System"/>
|
||||
<meta name="keywords" content="Vben Admin Vue3 Vite"/>
|
||||
<meta name="author" content="Vben"/>
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0"
|
||||
/>
|
||||
<!-- 由 vite 注入 VITE_APP_TITLE 变量,在 .env 文件内配置 -->
|
||||
<title><%= VITE_APP_TITLE %></title>
|
||||
<link rel="icon" href="/favicon.ico"/>
|
||||
<script type="text/javascript"
|
||||
src="https://api.map.baidu.com/api?v=3.0&ak=5GUquqE2yrgMo3BPIGcn89dU8uMhnbxG"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -27,6 +27,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design/icons-vue": "^7.0.1",
|
||||
"@dataview/datav-vue3": "0.0.0-test.1672506674342",
|
||||
"@jiaminghi/charts": "^0.2.18",
|
||||
"@jiaminghi/data-view": "^2.10.0",
|
||||
"@tinymce/tinymce-vue": "^6.0.1",
|
||||
"@vben/access": "workspace:*",
|
||||
"@vben/common-ui": "workspace:*",
|
||||
|
48
apps/web-antd/src/api/cockpit/cockpit.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 大屏接口
|
||||
*/
|
||||
|
||||
/**
|
||||
* 访客
|
||||
*/
|
||||
export function visitir() {
|
||||
return requestClient.get('/property/cockpit/visitor');
|
||||
}
|
||||
|
||||
/**
|
||||
*费用
|
||||
*/
|
||||
export function expenses() {
|
||||
return requestClient.get('/property/cockpit/expenses');
|
||||
}
|
||||
|
||||
/**
|
||||
* 物业人员配置
|
||||
*/
|
||||
export function propertyPerson() {
|
||||
return requestClient.get('/property/cockpit/propertyperson');
|
||||
}
|
||||
|
||||
/**
|
||||
* sos报警
|
||||
*/
|
||||
export function sos() {
|
||||
return requestClient.get('/property/cockpit/sos');
|
||||
}
|
||||
|
||||
/**
|
||||
* sos报警记录
|
||||
*/
|
||||
export function soslist() {
|
||||
return requestClient.get('/property/cockpit/soslist');
|
||||
}
|
||||
|
||||
/**
|
||||
* 工单
|
||||
*/
|
||||
export function workcount() {
|
||||
return requestClient.get('/property/cockpit/workcount');
|
||||
}
|
@@ -42,6 +42,14 @@ export function applicationAdd(data: ApplicationForm) {
|
||||
return requestClient.postWithMsg<void>('/property/application', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 领用审核
|
||||
* @param data
|
||||
*/
|
||||
export function applicationVerified(data: ApplicationForm) {
|
||||
return requestClient.postWithMsg<void>('/property/application/verified', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新资产领用
|
||||
* @param data
|
||||
|
@@ -59,7 +59,7 @@ export interface AssetVO {
|
||||
/**
|
||||
* 固定资产类型
|
||||
*/
|
||||
type: number;
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
|
@@ -1,27 +1,34 @@
|
||||
import type { ArrangementVO, ArrangementForm, ArrangementQuery } from './model';
|
||||
import type {
|
||||
ArrangementForm,
|
||||
ArrangementQuery,
|
||||
ArrangementVO,
|
||||
arrangmentListQuery,
|
||||
AttendanceUserGroup,
|
||||
} from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
import type { ID, IDS, PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询排班列表
|
||||
* @param params
|
||||
* @returns 排班列表
|
||||
*/
|
||||
export function arrangementList(params?: ArrangementQuery) {
|
||||
return requestClient.get<PageResult<ArrangementVO>>('/property/arrangement/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出排班列表
|
||||
* 分页查询排班列表
|
||||
* @param params
|
||||
* @returns 排班列表
|
||||
*/
|
||||
export function arrangementExport(params?: ArrangementQuery) {
|
||||
return commonExport('/property/arrangement/export', params ?? {});
|
||||
export function arrangementList(params?: ArrangementQuery) {
|
||||
return requestClient.get<PageResult<ArrangementVO>>(
|
||||
'/property/arrangement/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据月份查询排班列表
|
||||
* @param params
|
||||
* @returns 排班列表
|
||||
*/
|
||||
export function arrangementCalender(params?: ArrangementQuery) {
|
||||
return requestClient.get<any>('/property/arrangement/explore', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -59,3 +66,41 @@ export function arrangementUpdate(data: ArrangementForm) {
|
||||
export function arrangementRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/arrangement/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询某天排班详情列表
|
||||
* @param params
|
||||
* @returns 排班列表
|
||||
*/
|
||||
|
||||
export function arrangmentList(params?: arrangmentListQuery) {
|
||||
return requestClient.get<PageResult<ArrangementVO>>(
|
||||
'/property/arrangement/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询某天排班人员详情列表(班表视图)
|
||||
* @param params
|
||||
* @returns 排班列表
|
||||
*/
|
||||
|
||||
export function queryScheduleView(params?: arrangmentListQuery) {
|
||||
return requestClient.get<PageResult<AttendanceUserGroup>>(
|
||||
'/property/AttendanceUserGroup/queryScheduleView',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询某天排班人员详情列表
|
||||
* @param params
|
||||
* @returns 排班列表
|
||||
*/
|
||||
|
||||
export function queryCurrentSchedu() {
|
||||
return requestClient.get<AttendanceUserGroup[]>(
|
||||
'/property/AttendanceUserGroup/query/currentDay',
|
||||
);
|
||||
}
|
||||
|
@@ -9,38 +9,41 @@ export interface ArrangementVO {
|
||||
/**
|
||||
* 排班名称
|
||||
*/
|
||||
scheduleName: string;
|
||||
scheduleName?: string;
|
||||
|
||||
/**
|
||||
* 考勤组ID
|
||||
*/
|
||||
groupId: string | number;
|
||||
groupId?: string | number;
|
||||
|
||||
/**
|
||||
* 排班类型:1-固定班制,2-排班制
|
||||
*/
|
||||
scheduleType: number;
|
||||
scheduleType?: number;
|
||||
|
||||
/**
|
||||
* 日期类型:1-单个日期,2-长期有效,3-期间有效
|
||||
*/
|
||||
dateType: number;
|
||||
dateType?: number;
|
||||
|
||||
/**
|
||||
* 开始日期
|
||||
*/
|
||||
startDate: string;
|
||||
startDate?: string;
|
||||
|
||||
/**
|
||||
* 结束日期(仅date_type=3时有效)
|
||||
*/
|
||||
endDate: string;
|
||||
endDate?: string;
|
||||
|
||||
/**
|
||||
* 状态:0-未生效,1-已生效
|
||||
*/
|
||||
status: number;
|
||||
|
||||
status?: number;
|
||||
userGroupList?: any[];
|
||||
attendanceGroup?: any;
|
||||
dateType?: number;
|
||||
areaList: any[]; //区域
|
||||
}
|
||||
|
||||
export interface ArrangementForm extends BaseEntity {
|
||||
@@ -83,7 +86,14 @@ export interface ArrangementForm extends BaseEntity {
|
||||
* 状态:0-未生效,1-已生效
|
||||
*/
|
||||
status?: number;
|
||||
|
||||
/**
|
||||
* 排班人员详情
|
||||
*/
|
||||
userGroupList: any[];
|
||||
/**
|
||||
* 排班id
|
||||
*/
|
||||
scheduleId?: string | number;
|
||||
}
|
||||
|
||||
export interface ArrangementQuery extends PageQuery {
|
||||
@@ -123,7 +133,18 @@ export interface ArrangementQuery extends PageQuery {
|
||||
status?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
|
||||
/**
|
||||
* 月份
|
||||
*/
|
||||
month?: string;
|
||||
}
|
||||
export interface arrangmentListQuery extends PageQuery {
|
||||
currentDate: string; //某天的日期
|
||||
}
|
||||
export interface AttendanceUserGroup extends PageQuery {
|
||||
currentDate: string; //某天的日期
|
||||
}
|
||||
|
@@ -0,0 +1,61 @@
|
||||
import type { AttendanceAreaVO, AttendanceAreaForm, AttendanceAreaQuery } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询区域区域管理列表
|
||||
* @param params
|
||||
* @returns 区域区域管理列表
|
||||
*/
|
||||
export function attendanceAreaList(params?: AttendanceAreaQuery) {
|
||||
return requestClient.get<PageResult<AttendanceAreaVO>>('/property/attendanceArea/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出区域区域管理列表
|
||||
* @param params
|
||||
* @returns 区域区域管理列表
|
||||
*/
|
||||
export function attendanceAreaExport(params?: AttendanceAreaQuery) {
|
||||
return commonExport('/property/attendanceArea/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询区域区域管理详情
|
||||
* @param id id
|
||||
* @returns 区域区域管理详情
|
||||
*/
|
||||
export function attendanceAreaInfo(id: ID) {
|
||||
return requestClient.get<AttendanceAreaVO>(`/property/attendanceArea/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增区域区域管理
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function attendanceAreaAdd(data: AttendanceAreaForm) {
|
||||
return requestClient.postWithMsg<void>('/property/attendanceArea', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新区域区域管理
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function attendanceAreaUpdate(data: AttendanceAreaForm) {
|
||||
return requestClient.putWithMsg<void>('/property/attendanceArea', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除区域区域管理
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function attendanceAreaRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/attendanceArea/${id}`);
|
||||
}
|
68
apps/web-antd/src/api/property/attendanceManagement/attendanceArea/model.d.ts
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface AttendanceAreaVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 摄像机列表
|
||||
*/
|
||||
deviceManageId: any[];
|
||||
|
||||
/**
|
||||
* 区域
|
||||
*/
|
||||
area: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
reamark: string;
|
||||
areaDevice?: any[];
|
||||
}
|
||||
|
||||
export interface AttendanceAreaForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 摄像机id
|
||||
*/
|
||||
deviceManageId?: string | number;
|
||||
|
||||
/**
|
||||
* 区域
|
||||
*/
|
||||
area?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
reamark?: string;
|
||||
}
|
||||
|
||||
export interface AttendanceAreaQuery extends PageQuery {
|
||||
/**
|
||||
* 摄像机id
|
||||
*/
|
||||
deviceManageId?: string | number;
|
||||
|
||||
/**
|
||||
* 区域
|
||||
*/
|
||||
area?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
reamark?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@@ -59,3 +59,19 @@ export function workOrdersUpdate(data: WorkOrdersForm) {
|
||||
export function workOrdersRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/workOrders/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 派单
|
||||
* @param data
|
||||
*/
|
||||
export function workOrdersDispatch(data: WorkOrdersForm) {
|
||||
return requestClient.putWithMsg<void>('/property/workOrders/dispatch', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 抢单
|
||||
* @param data
|
||||
*/
|
||||
export function workOrdersGrab(data: WorkOrdersForm) {
|
||||
return requestClient.putWithMsg<void>('/property/workOrders/grab', data);
|
||||
}
|
||||
|
@@ -64,7 +64,7 @@ export interface WorkOrdersVO {
|
||||
/**
|
||||
* 评价
|
||||
*/
|
||||
serviceEvalua: string;
|
||||
serviceEvalua: number;
|
||||
|
||||
/**
|
||||
* 是否超时
|
||||
@@ -82,6 +82,8 @@ export interface WorkOrdersVO {
|
||||
* 评价图片
|
||||
*/
|
||||
imgUrl: string;
|
||||
|
||||
evaluateImgPath: string[];
|
||||
/**
|
||||
* 评价内容
|
||||
*/
|
||||
@@ -94,6 +96,16 @@ export interface WorkOrdersVO {
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
orderImgUrl: string;
|
||||
|
||||
orderImgPath: string[];
|
||||
|
||||
reportingType: string;
|
||||
|
||||
processingWeight: string;
|
||||
|
||||
}
|
||||
|
||||
|
@@ -12,6 +12,22 @@ import { requestClient } from '#/api/request';
|
||||
export function workOrdersTypeList(params?: WorkOrdersTypeQuery) {
|
||||
return requestClient.get<PageResult<WorkOrdersTypeVO>>('/property/workOrdersType/list', { params });
|
||||
}
|
||||
/**
|
||||
* 查询工单类型不分页
|
||||
* @param params
|
||||
* @returns 工单类型管理列表
|
||||
*/
|
||||
export function workOrdersTypeListAll(params?: WorkOrdersTypeQuery) {
|
||||
return requestClient.get<WorkOrdersTypeVO[]>('/property/workOrdersType/queryList', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询工单类型树结构
|
||||
* @param params
|
||||
*/
|
||||
export function workOrdersTypeTree(params?: WorkOrdersTypeQuery) {
|
||||
return requestClient.get<WorkOrdersTypeVO[]>('/property/workOrdersType/typeTree', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出工单类型管理列表
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
import type {PageQuery, BaseEntity} from '#/api/common';
|
||||
|
||||
export interface WorkOrdersTypeVO {
|
||||
/**
|
||||
@@ -34,7 +34,14 @@ export interface WorkOrdersTypeVO {
|
||||
/**
|
||||
* 是否支持转单(0支持,1不支持)
|
||||
*/
|
||||
isTransfers: number;
|
||||
isTransfers: string;
|
||||
|
||||
excludeId: string;
|
||||
/**
|
||||
* 处理优先级
|
||||
*/
|
||||
processingWeight: string;
|
||||
|
||||
}
|
||||
|
||||
export interface WorkOrdersTypeForm extends BaseEntity {
|
||||
@@ -72,6 +79,16 @@ export interface WorkOrdersTypeForm extends BaseEntity {
|
||||
* 是否支持转单(0支持,1不支持)
|
||||
*/
|
||||
isTransfers?: number;
|
||||
|
||||
/**
|
||||
* 上级类型id
|
||||
*/
|
||||
parentId?: string;
|
||||
|
||||
/**
|
||||
* 处理优先级
|
||||
*/
|
||||
processingWeight: string;
|
||||
}
|
||||
|
||||
export interface WorkOrdersTypeQuery extends PageQuery {
|
||||
@@ -106,7 +123,12 @@ export interface WorkOrdersTypeQuery extends PageQuery {
|
||||
isTransfers?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
|
||||
/**
|
||||
* 是否过滤子级
|
||||
*/
|
||||
filterSubNodes?: boolean;
|
||||
}
|
||||
|
@@ -144,6 +144,16 @@ export interface Clean_orderForm extends BaseEntity {
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 签到图片
|
||||
*/
|
||||
signImgUrl?: string;
|
||||
|
||||
/**
|
||||
* 评价图片
|
||||
*/
|
||||
imgUrl?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface Clean_orderQuery extends PageQuery {
|
||||
|
@@ -0,0 +1,61 @@
|
||||
import type { ActivitiesVO, ActivitiesForm, ActivitiesQuery } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询热门活动列表
|
||||
* @param params
|
||||
* @returns 热门活动列表
|
||||
*/
|
||||
export function activitiesList(params?: ActivitiesQuery) {
|
||||
return requestClient.get<PageResult<ActivitiesVO>>('/property/activities/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出热门活动列表
|
||||
* @param params
|
||||
* @returns 热门活动列表
|
||||
*/
|
||||
export function activitiesExport(params?: ActivitiesQuery) {
|
||||
return commonExport('/property/activities/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询热门活动详情
|
||||
* @param id id
|
||||
* @returns 热门活动详情
|
||||
*/
|
||||
export function activitiesInfo(id: ID) {
|
||||
return requestClient.get<ActivitiesVO>(`/property/activities/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增热门活动
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function activitiesAdd(data: ActivitiesForm) {
|
||||
return requestClient.postWithMsg<void>('/property/activities', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新热门活动
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function activitiesUpdate(data: ActivitiesForm) {
|
||||
return requestClient.putWithMsg<void>('/property/activities', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除热门活动
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function activitiesRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/activities/${id}`);
|
||||
}
|
129
apps/web-antd/src/api/property/customerService/activities/model.d.ts
vendored
Normal file
@@ -0,0 +1,129 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface ActivitiesVO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
title: string;
|
||||
|
||||
/**
|
||||
* 头部照片
|
||||
*/
|
||||
headImgUrl: string;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime: string;
|
||||
|
||||
/**
|
||||
* 活动内容
|
||||
*/
|
||||
activeContent: string;
|
||||
|
||||
/**
|
||||
* 状态(1.未开始 2.进行中 3.已结束)
|
||||
*/
|
||||
status: string;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue: string;
|
||||
|
||||
}
|
||||
|
||||
export interface ActivitiesForm extends BaseEntity {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* 头部照片
|
||||
*/
|
||||
headImgUrl?: string;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime?: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime?: string;
|
||||
|
||||
/**
|
||||
* 活动内容
|
||||
*/
|
||||
activeContent?: string;
|
||||
|
||||
/**
|
||||
* 状态(1.未开始 2.进行中 3.已结束)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface ActivitiesQuery extends PageQuery {
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* 头部照片
|
||||
*/
|
||||
headImgUrl?: string;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime?: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime?: string;
|
||||
|
||||
/**
|
||||
* 活动内容
|
||||
*/
|
||||
activeContent?: string;
|
||||
|
||||
/**
|
||||
* 状态(1.未开始 2.进行中 3.已结束)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
import type { FaqManagementVO, FaqManagementForm, FaqManagementQuery } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询常见问题管理列表
|
||||
* @param params
|
||||
* @returns 常见问题管理列表
|
||||
*/
|
||||
export function faqManagementList(params?: FaqManagementQuery) {
|
||||
return requestClient.get<PageResult<FaqManagementVO>>('/property/faqManagement/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出常见问题管理列表
|
||||
* @param params
|
||||
* @returns 常见问题管理列表
|
||||
*/
|
||||
export function faqManagementExport(params?: FaqManagementQuery) {
|
||||
return commonExport('/property/faqManagement/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询常见问题管理详情
|
||||
* @param id id
|
||||
* @returns 常见问题管理详情
|
||||
*/
|
||||
export function faqManagementInfo(id: ID) {
|
||||
return requestClient.get<FaqManagementVO>(`/property/faqManagement/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增常见问题管理
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function faqManagementAdd(data: FaqManagementForm) {
|
||||
return requestClient.postWithMsg<void>('/property/faqManagement', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新常见问题管理
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function faqManagementUpdate(data: FaqManagementForm) {
|
||||
return requestClient.putWithMsg<void>('/property/faqManagement', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除常见问题管理
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function faqManagementRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/faqManagement/${id}`);
|
||||
}
|
114
apps/web-antd/src/api/property/customerService/faqManagement/model.d.ts
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface FaqManagementVO {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
head: string;
|
||||
|
||||
/**
|
||||
* 分类
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* 浏览量
|
||||
*/
|
||||
pageView: number;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
contents: string;
|
||||
|
||||
/**
|
||||
* 状态(1草稿 2已发布)
|
||||
*/
|
||||
status: string;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue: string;
|
||||
|
||||
}
|
||||
|
||||
export interface FaqManagementForm extends BaseEntity {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
head?: string;
|
||||
|
||||
/**
|
||||
* 分类
|
||||
*/
|
||||
type?: string;
|
||||
|
||||
/**
|
||||
* 浏览量
|
||||
*/
|
||||
pageView?: number;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
contents?: string;
|
||||
|
||||
/**
|
||||
* 状态(1草稿 2已发布)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface FaqManagementQuery extends PageQuery {
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
head?: string;
|
||||
|
||||
/**
|
||||
* 分类
|
||||
*/
|
||||
type?: string;
|
||||
|
||||
/**
|
||||
* 浏览量
|
||||
*/
|
||||
pageView?: number;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
contents?: string;
|
||||
|
||||
/**
|
||||
* 状态(1草稿 2已发布)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@@ -10,6 +10,7 @@ export interface FeedbacksVO {
|
||||
* 反馈类型(0保修1保洁2会议)
|
||||
*/
|
||||
feedbackType: string;
|
||||
feedbackTypeName: string;
|
||||
|
||||
/**
|
||||
* 反馈人
|
||||
@@ -21,6 +22,11 @@ export interface FeedbacksVO {
|
||||
*/
|
||||
feedbackPersionPhone: string;
|
||||
|
||||
/**
|
||||
* 反馈人名称
|
||||
*/
|
||||
feedbackPersionName: string;
|
||||
|
||||
/**
|
||||
* 反馈内容
|
||||
*/
|
||||
@@ -50,6 +56,10 @@ export interface FeedbacksVO {
|
||||
* 客服电话
|
||||
*/
|
||||
serviceName: string;
|
||||
/**
|
||||
* 工单id
|
||||
*/
|
||||
orderId: string;
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,61 @@
|
||||
import type { QuestionVO, QuestionForm, QuestionQuery } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询调查问卷问题列表
|
||||
* @param params
|
||||
* @returns 调查问卷问题列表
|
||||
*/
|
||||
export function questionList(params?: QuestionQuery) {
|
||||
return requestClient.get<PageResult<QuestionVO>>('/property/question/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出调查问卷问题列表
|
||||
* @param params
|
||||
* @returns 调查问卷问题列表
|
||||
*/
|
||||
export function questionExport(params?: QuestionQuery) {
|
||||
return commonExport('/property/question/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询调查问卷问题详情
|
||||
* @param id id
|
||||
* @returns 调查问卷问题详情
|
||||
*/
|
||||
export function questionInfo(id: ID) {
|
||||
return requestClient.get<QuestionVO>(`/property/question/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增调查问卷问题
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function questionAdd(data: QuestionForm) {
|
||||
return requestClient.postWithMsg<void>('/property/question', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新调查问卷问题
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function questionUpdate(data: QuestionForm) {
|
||||
return requestClient.putWithMsg<void>('/property/question', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除调查问卷问题
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function questionRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/question/${id}`);
|
||||
}
|
145
apps/web-antd/src/api/property/customerService/questionnaire/question/model.d.ts
vendored
Normal file
@@ -0,0 +1,145 @@
|
||||
import type {PageQuery, BaseEntity} from '#/api/common';
|
||||
import type {
|
||||
QuestionItemForm, QuestionItemVO
|
||||
} from "#/api/property/customerService/questionnaire/questionItem/model";
|
||||
|
||||
export interface QuestionVO {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 调查问卷id
|
||||
*/
|
||||
questionnaireId: string | number;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
head: string;
|
||||
|
||||
/**
|
||||
* 问题类型(1单行文本2多行文本3单选题4多选题5评分题6日期选择)
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* 是否必填(1不必填2必填)
|
||||
*/
|
||||
isRequired: string;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
depict: string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort: number;
|
||||
|
||||
/**
|
||||
* 问题选项
|
||||
*/
|
||||
questionnaireQuestionItemVos: QuestionItemVO[];
|
||||
|
||||
options: string[];
|
||||
|
||||
answer: string;
|
||||
|
||||
rate:number;
|
||||
|
||||
checked:string[];
|
||||
|
||||
}
|
||||
|
||||
export interface QuestionForm extends BaseEntity {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 调查问卷id
|
||||
*/
|
||||
questionnaireId?: string | number;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
head?: string;
|
||||
|
||||
/**
|
||||
* 问题类型(1单行文本2多行文本3单选题4多选题5评分题6日期选择)
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* 是否必填(1不必填2必填)
|
||||
*/
|
||||
isRequired?: string;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
depict?: string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort?: number;
|
||||
|
||||
/**
|
||||
* 选项
|
||||
*/
|
||||
questionnaireQuestionItems: QuestionItemForm[]
|
||||
|
||||
/**
|
||||
* 评分预览
|
||||
*/
|
||||
rate?: number;
|
||||
|
||||
/**
|
||||
* 时间预览
|
||||
*/
|
||||
dateTime?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface QuestionQuery extends PageQuery {
|
||||
/**
|
||||
* 调查问卷id
|
||||
*/
|
||||
questionnaireId?: string | number;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
head?: string;
|
||||
|
||||
/**
|
||||
* 问题类型(1单行文本2多行文本3单选题4多选题5评分题6日期选择)
|
||||
*/
|
||||
type?: string;
|
||||
|
||||
/**
|
||||
* 是否必填(1不必填2必填)
|
||||
*/
|
||||
isRequired?: string;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
depict?: string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
import type { QuestionItemVO, QuestionItemForm, QuestionItemQuery } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询调查问卷问题选项列表
|
||||
* @param params
|
||||
* @returns 调查问卷问题选项列表
|
||||
*/
|
||||
export function questionItemList(params?: QuestionItemQuery) {
|
||||
return requestClient.get<PageResult<QuestionItemVO>>('/property/questionItem/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出调查问卷问题选项列表
|
||||
* @param params
|
||||
* @returns 调查问卷问题选项列表
|
||||
*/
|
||||
export function questionItemExport(params?: QuestionItemQuery) {
|
||||
return commonExport('/property/questionItem/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询调查问卷问题选项详情
|
||||
* @param id id
|
||||
* @returns 调查问卷问题选项详情
|
||||
*/
|
||||
export function questionItemInfo(id: ID) {
|
||||
return requestClient.get<QuestionItemVO>(`/property/questionItem/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增调查问卷问题选项
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function questionItemAdd(data: QuestionItemForm) {
|
||||
return requestClient.postWithMsg<void>('/property/questionItem', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新调查问卷问题选项
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function questionItemUpdate(data: QuestionItemForm) {
|
||||
return requestClient.putWithMsg<void>('/property/questionItem', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除调查问卷问题选项
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function questionItemRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/questionItem/${id}`);
|
||||
}
|
79
apps/web-antd/src/api/property/customerService/questionnaire/questionItem/model.d.ts
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface QuestionItemVO {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 问题id
|
||||
*/
|
||||
questionId: string | number;
|
||||
|
||||
/**
|
||||
* 选项内容
|
||||
*/
|
||||
itemContent: string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort: number;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface QuestionItemForm extends BaseEntity {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 问题id
|
||||
*/
|
||||
questionId?: string | number;
|
||||
|
||||
/**
|
||||
* 选项内容
|
||||
*/
|
||||
itemContent?: string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort?: number;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface QuestionItemQuery extends PageQuery {
|
||||
/**
|
||||
* 问题id
|
||||
*/
|
||||
questionId?: string | number;
|
||||
|
||||
/**
|
||||
* 选项内容
|
||||
*/
|
||||
itemContent?: string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
import type { QuestionnaireVO, QuestionnaireForm, QuestionnaireQuery } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询调查问卷列表
|
||||
* @param params
|
||||
* @returns 调查问卷列表
|
||||
*/
|
||||
export function questionnaireList(params?: QuestionnaireQuery) {
|
||||
return requestClient.get<PageResult<QuestionnaireVO>>('/property/questionnaire/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出调查问卷列表
|
||||
* @param params
|
||||
* @returns 调查问卷列表
|
||||
*/
|
||||
export function questionnaireExport(params?: QuestionnaireQuery) {
|
||||
return commonExport('/property/questionnaire/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询调查问卷详情
|
||||
* @param id id
|
||||
* @returns 调查问卷详情
|
||||
*/
|
||||
export function questionnaireInfo(id: ID) {
|
||||
return requestClient.get<QuestionnaireVO>(`/property/questionnaire/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增调查问卷
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function questionnaireAdd(data: QuestionnaireForm) {
|
||||
return requestClient.postWithMsg<void>('/property/questionnaire', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新调查问卷
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function questionnaireUpdate(data: QuestionnaireForm) {
|
||||
return requestClient.putWithMsg<void>('/property/questionnaire', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除调查问卷
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function questionnaireRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/questionnaire/${id}`);
|
||||
}
|
126
apps/web-antd/src/api/property/customerService/questionnaire/questionnaire/model.d.ts
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
import type {
|
||||
QuestionForm,
|
||||
QuestionVO
|
||||
} from "#/api/property/customerService/questionnaire/question/model";
|
||||
|
||||
export interface QuestionnaireVO {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
head: string;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
depict: string;
|
||||
|
||||
/**
|
||||
* 是否匿名收集
|
||||
*/
|
||||
isAnonyCollec: string;
|
||||
|
||||
/**
|
||||
* 是否多次提交
|
||||
*/
|
||||
isCommit: string;
|
||||
|
||||
/**
|
||||
* 截止日期
|
||||
*/
|
||||
deadline: string;
|
||||
|
||||
/**
|
||||
* 状态(1草稿2已发布3未发布)
|
||||
*/
|
||||
status: string;
|
||||
/**
|
||||
* 问题
|
||||
*/
|
||||
questionnaireQuestionVos:QuestionVO[];
|
||||
}
|
||||
|
||||
export interface QuestionnaireForm extends BaseEntity {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
head?: string;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
depict?: string;
|
||||
|
||||
/**
|
||||
* 是否匿名收集
|
||||
*/
|
||||
isAnonyCollec?: string;
|
||||
|
||||
/**
|
||||
* 是否多次提交
|
||||
*/
|
||||
isCommit?: string;
|
||||
|
||||
/**
|
||||
* 截止日期
|
||||
*/
|
||||
deadline?: string;
|
||||
|
||||
/**
|
||||
* 状态(1草稿2已发布3未发布)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 问题
|
||||
*/
|
||||
questionnaireQuestions:QuestionForm[];
|
||||
|
||||
}
|
||||
|
||||
export interface QuestionnaireQuery extends PageQuery {
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
head?: string;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
depict?: string;
|
||||
|
||||
/**
|
||||
* 是否匿名收集
|
||||
*/
|
||||
isAnonyCollec?: string;
|
||||
|
||||
/**
|
||||
* 是否多次提交
|
||||
*/
|
||||
isCommit?: string;
|
||||
|
||||
/**
|
||||
* 截止日期
|
||||
*/
|
||||
deadline?: string;
|
||||
|
||||
/**
|
||||
* 状态(1草稿2已发布3未发布)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@@ -0,0 +1,79 @@
|
||||
import type { LightInfoVO, LightInfoForm, LightInfoQuery } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询灯控开关信息列表
|
||||
* @param params
|
||||
* @returns 灯控开关信息列表
|
||||
*/
|
||||
export function lightInfoList(params?: LightInfoQuery) {
|
||||
return requestClient.get<PageResult<LightInfoVO>>('/property/lightInfo/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出灯控开关信息列表
|
||||
* @param params
|
||||
* @returns 灯控开关信息列表
|
||||
*/
|
||||
export function lightInfoExport(params?: LightInfoQuery) {
|
||||
return commonExport('/property/lightInfo/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询灯控开关信息详情
|
||||
* @param id id
|
||||
* @returns 灯控开关信息详情
|
||||
*/
|
||||
export function lightInfoInfo(id: ID) {
|
||||
return requestClient.get<LightInfoVO>(`/property/lightInfo/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增灯控开关信息
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function lightInfoAdd(data: LightInfoForm) {
|
||||
return requestClient.postWithMsg<void>('/property/lightInfo', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新灯控开关信息
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function lightInfoUpdate(data: LightInfoForm) {
|
||||
return requestClient.putWithMsg<void>('/property/lightInfo', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除灯控开关信息
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function lightInfoRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/lightInfo/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新灯控开关状态
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function switchSingleLight(data: LightInfoForm) {
|
||||
return requestClient.postWithMsg<void>('/property/lightInfo/switch', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新灯控开关状态
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function switchBatchLight(data: LightInfoForm) {
|
||||
return requestClient.postWithMsg<void>('/property/lightInfo/switch', data);
|
||||
}
|
134
apps/web-antd/src/api/property/energyManagement/lightInfo/model.d.ts
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface LightInfoVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 位置描述
|
||||
*/
|
||||
locationRemark: string;
|
||||
|
||||
/**
|
||||
* 开关状态(0:关,1:开)
|
||||
*/
|
||||
isOn: boolean;
|
||||
|
||||
/**
|
||||
* 灯控模块编码
|
||||
*/
|
||||
code: number;
|
||||
|
||||
/**
|
||||
* 园区编码
|
||||
*/
|
||||
communityId: string | number;
|
||||
|
||||
/**
|
||||
* 建筑名称
|
||||
*/
|
||||
buildingId: string | number;
|
||||
|
||||
/**
|
||||
* 单元编码
|
||||
*/
|
||||
unitId: string | number;
|
||||
|
||||
/**
|
||||
* 所属楼层ID
|
||||
*/
|
||||
floorId: string | number;
|
||||
|
||||
/**
|
||||
* 楼层
|
||||
*/
|
||||
floorName: string;
|
||||
|
||||
}
|
||||
|
||||
export interface LightInfoForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 位置描述
|
||||
*/
|
||||
locationRemark?: string;
|
||||
|
||||
/**
|
||||
* 开关状态(0:关,1:开)
|
||||
*/
|
||||
isOn: boolean;
|
||||
|
||||
/**
|
||||
* 灯控模块编码
|
||||
*/
|
||||
code?: number;
|
||||
|
||||
/**
|
||||
* 园区编码
|
||||
*/
|
||||
communityId?: string | number;
|
||||
|
||||
/**
|
||||
* 建筑名称
|
||||
*/
|
||||
buildingId?: string | number;
|
||||
|
||||
/**
|
||||
* 单元编码
|
||||
*/
|
||||
unitId?: string | number;
|
||||
|
||||
/**
|
||||
* 所属楼层ID
|
||||
*/
|
||||
floorId?: string | number;
|
||||
|
||||
}
|
||||
|
||||
export interface LightInfoQuery extends PageQuery {
|
||||
/**
|
||||
* 位置描述
|
||||
*/
|
||||
locationRemark?: string;
|
||||
|
||||
/**
|
||||
* 开关状态(0:关,1:开)
|
||||
*/
|
||||
isOn?: number;
|
||||
|
||||
/**
|
||||
* 灯控模块编码
|
||||
*/
|
||||
code?: number;
|
||||
|
||||
/**
|
||||
* 园区编码
|
||||
*/
|
||||
communityId?: string | number;
|
||||
|
||||
/**
|
||||
* 建筑名称
|
||||
*/
|
||||
buildingId?: string | number;
|
||||
|
||||
/**
|
||||
* 单元编码
|
||||
*/
|
||||
unitId?: string | number;
|
||||
|
||||
/**
|
||||
* 所属楼层ID
|
||||
*/
|
||||
floorId?: string | number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@@ -1,65 +1,65 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
import type { PageQuery, BaseEntity } from '#/api/common'
|
||||
|
||||
export interface MeterInfoVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
id: string | number
|
||||
|
||||
/**
|
||||
* 仪表名称
|
||||
*/
|
||||
meterName: string;
|
||||
meterName: string
|
||||
|
||||
/**
|
||||
* 仪表编码
|
||||
*/
|
||||
meterCode: string;
|
||||
meterCode: string
|
||||
|
||||
/**
|
||||
* 设备厂商
|
||||
*/
|
||||
factoryNo: string;
|
||||
factoryNo: string
|
||||
|
||||
/**
|
||||
* 设备类型(1-电表,2-水表,3-气表)
|
||||
*/
|
||||
meterType: number;
|
||||
meterType: number | String
|
||||
|
||||
/**
|
||||
* 计量单位(1-度,2-吨,3-立方米)
|
||||
*/
|
||||
meterUnit: number;
|
||||
meterUnit: number | String
|
||||
|
||||
/**
|
||||
* 安装位置
|
||||
*/
|
||||
installLocation: string;
|
||||
installLocation: string
|
||||
|
||||
/**
|
||||
* 初始读数
|
||||
*/
|
||||
initReading: number;
|
||||
initReading: number
|
||||
|
||||
/**
|
||||
* 最大量程
|
||||
*/
|
||||
maxRang: number;
|
||||
maxRang: number
|
||||
|
||||
/**
|
||||
* 通信状态
|
||||
*/
|
||||
communicationState: number;
|
||||
communicationState: number | String
|
||||
|
||||
/**
|
||||
* 运行状态
|
||||
*/
|
||||
runningState: number;
|
||||
runningState: number | String
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
remark: string
|
||||
|
||||
}
|
||||
|
||||
@@ -67,62 +67,67 @@ export interface MeterInfoForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
id?: string | number
|
||||
|
||||
/**
|
||||
* 仪表名称
|
||||
*/
|
||||
meterName?: string;
|
||||
meterName?: string
|
||||
|
||||
/**
|
||||
* 仪表编码
|
||||
*/
|
||||
meterCode?: string;
|
||||
meterCode?: string
|
||||
|
||||
/**
|
||||
* 设备厂商
|
||||
*/
|
||||
factoryNo?: string;
|
||||
factoryNo?: string
|
||||
|
||||
/**
|
||||
* 设备类型(1-电表,2-水表,3-气表)
|
||||
*/
|
||||
meterType?: number;
|
||||
meterType?: number
|
||||
|
||||
/**
|
||||
* 计量单位(1-度,2-吨,3-立方米)
|
||||
*/
|
||||
meterUnit?: number;
|
||||
meterUnit?: number
|
||||
|
||||
/**
|
||||
* 安装位置
|
||||
*/
|
||||
installLocation?: string;
|
||||
installLocation?: string
|
||||
|
||||
/**
|
||||
* 初始读数
|
||||
*/
|
||||
initReading?: number;
|
||||
initReading?: number
|
||||
|
||||
/**
|
||||
* 最大量程
|
||||
*/
|
||||
maxRang?: number;
|
||||
maxRang?: number
|
||||
|
||||
/**
|
||||
* 通信状态
|
||||
*/
|
||||
communicationState?: number;
|
||||
communicationState?: number
|
||||
|
||||
/**
|
||||
* 运行状态
|
||||
*/
|
||||
runningState?: number;
|
||||
runningState?: number
|
||||
|
||||
/**
|
||||
* 采集器IP
|
||||
*/
|
||||
hostIp?: string
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
remark?: string
|
||||
|
||||
}
|
||||
|
||||
@@ -130,55 +135,55 @@ export interface MeterInfoQuery extends PageQuery {
|
||||
/**
|
||||
* 仪表名称
|
||||
*/
|
||||
meterName?: string;
|
||||
meterName?: string
|
||||
|
||||
/**
|
||||
* 仪表编码
|
||||
*/
|
||||
meterCode?: string;
|
||||
meterCode?: string
|
||||
|
||||
/**
|
||||
* 设备厂商
|
||||
*/
|
||||
factoryNo?: string;
|
||||
factoryNo?: string
|
||||
|
||||
/**
|
||||
* 设备类型(1-电表,2-水表,3-气表)
|
||||
*/
|
||||
meterType?: number;
|
||||
meterType?: number
|
||||
|
||||
/**
|
||||
* 计量单位(1-度,2-吨,3-立方米)
|
||||
*/
|
||||
meterUnit?: number;
|
||||
meterUnit?: number
|
||||
|
||||
/**
|
||||
* 安装位置
|
||||
*/
|
||||
installLocation?: string;
|
||||
installLocation?: string
|
||||
|
||||
/**
|
||||
* 初始读数
|
||||
*/
|
||||
initReading?: number;
|
||||
initReading?: number
|
||||
|
||||
/**
|
||||
* 最大量程
|
||||
*/
|
||||
maxRang?: number;
|
||||
maxRang?: number
|
||||
|
||||
/**
|
||||
* 通信状态
|
||||
*/
|
||||
communicationState?: number;
|
||||
communicationState?: number
|
||||
|
||||
/**
|
||||
* 运行状态
|
||||
*/
|
||||
runningState?: number;
|
||||
runningState?: number
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
params?: any
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
import type { MeterRecordVO, MeterRecordForm, MeterRecordQuery } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询抄表记录列表
|
||||
* @param params
|
||||
* @returns 抄表记录列表
|
||||
*/
|
||||
export function meterRecordList(params?: MeterRecordQuery) {
|
||||
return requestClient.get<PageResult<MeterRecordVO>>('/property/meterRecord/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出抄表记录列表
|
||||
* @param params
|
||||
* @returns 抄表记录列表
|
||||
*/
|
||||
export function meterRecordExport(params?: MeterRecordQuery) {
|
||||
return commonExport('/property/meterRecord/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询抄表记录详情
|
||||
* @param id id
|
||||
* @returns 抄表记录详情
|
||||
*/
|
||||
export function meterRecordInfo(id: ID) {
|
||||
return requestClient.get<MeterRecordVO>(`/property/meterRecord/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增抄表记录
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function meterRecordAdd(data: MeterRecordForm) {
|
||||
return requestClient.postWithMsg<void>('/property/meterRecord', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新抄表记录
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function meterRecordUpdate(data: MeterRecordForm) {
|
||||
return requestClient.putWithMsg<void>('/property/meterRecord', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除抄表记录
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function meterRecordRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/meterRecord/${id}`);
|
||||
}
|
149
apps/web-antd/src/api/property/energyManagement/meterRecord/model.d.ts
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common'
|
||||
|
||||
export interface MeterRecordVO {
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
id: string | number
|
||||
|
||||
/**
|
||||
* 仪表编号
|
||||
*/
|
||||
meterId: string | number
|
||||
|
||||
/**
|
||||
* 仪表类型
|
||||
*/
|
||||
meterType: string | number
|
||||
|
||||
/**
|
||||
* 抄表员ID
|
||||
*/
|
||||
readerId: string | number
|
||||
|
||||
/**
|
||||
* 抄表时间
|
||||
*/
|
||||
readingTime: string
|
||||
|
||||
/**
|
||||
* 当前读数
|
||||
*/
|
||||
currentReading: number
|
||||
|
||||
/**
|
||||
* 上次读数
|
||||
*/
|
||||
previousReading: number
|
||||
|
||||
/**
|
||||
* 用量
|
||||
*/
|
||||
consumption: number
|
||||
|
||||
/**
|
||||
* 抄表方式(1手动 2自动 3用户上报)
|
||||
*/
|
||||
readingMethod: number
|
||||
|
||||
/**
|
||||
* 抄表照片
|
||||
*/
|
||||
imgOssid: string | number
|
||||
|
||||
}
|
||||
|
||||
export interface MeterRecordForm extends BaseEntity {
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
id?: string | number
|
||||
|
||||
/**
|
||||
* 仪表编号
|
||||
*/
|
||||
meterId?: string | number
|
||||
|
||||
/**
|
||||
* 抄表员ID
|
||||
*/
|
||||
readerId?: string | number
|
||||
|
||||
/**
|
||||
* 抄表时间
|
||||
*/
|
||||
readingTime?: string
|
||||
|
||||
/**
|
||||
* 当前读数
|
||||
*/
|
||||
currentReading?: number
|
||||
|
||||
/**
|
||||
* 上次读数
|
||||
*/
|
||||
previousReading?: number
|
||||
|
||||
/**
|
||||
* 用量
|
||||
*/
|
||||
consumption?: number
|
||||
|
||||
/**
|
||||
* 抄表方式(1手动 2自动 3用户上报)
|
||||
*/
|
||||
readingMethod?: number
|
||||
|
||||
/**
|
||||
* 抄表照片
|
||||
*/
|
||||
imgOssid?: string | number
|
||||
|
||||
}
|
||||
|
||||
export interface MeterRecordQuery extends PageQuery {
|
||||
/**
|
||||
* 仪表编号
|
||||
*/
|
||||
meterId?: string | number
|
||||
|
||||
/**
|
||||
* 抄表员ID
|
||||
*/
|
||||
readerId?: string | number
|
||||
|
||||
/**
|
||||
* 抄表时间
|
||||
*/
|
||||
readingTime?: string
|
||||
|
||||
/**
|
||||
* 当前读数
|
||||
*/
|
||||
currentReading?: number
|
||||
|
||||
/**
|
||||
* 上次读数
|
||||
*/
|
||||
previousReading?: number
|
||||
|
||||
/**
|
||||
* 用量
|
||||
*/
|
||||
consumption?: number
|
||||
|
||||
/**
|
||||
* 抄表方式(1手动 2自动 3用户上报)
|
||||
*/
|
||||
readingMethod?: number
|
||||
|
||||
/**
|
||||
* 抄表照片
|
||||
*/
|
||||
imgOssid?: string | number
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any
|
||||
}
|
@@ -61,9 +61,9 @@ export function floorRemove(id: ID | IDS) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据单元ID查询楼层
|
||||
* 根据楼层ID查询楼层
|
||||
* @param id id
|
||||
*/
|
||||
export function queryByUnitId(id: ID | IDS) {
|
||||
return requestClient.get<FloorVO[]>(`/property/floor/queryByUnitId/${id}`);
|
||||
export function queryByBuildingId(id: ID | IDS) {
|
||||
return requestClient.get<FloorVO[]>(`/property/floor/queryByBuildingId/${id}`);
|
||||
}
|
||||
|
@@ -32,20 +32,59 @@ export interface TaskDetailVO {
|
||||
patrolType: string;
|
||||
|
||||
/**
|
||||
* 签到类型
|
||||
* 签到类型(1.现场拍照、2.摄像头签到、3.现场扫码)
|
||||
*/
|
||||
signType: string;
|
||||
|
||||
/**
|
||||
* 实际巡检时间
|
||||
*/
|
||||
actualInspectionTime: string;
|
||||
|
||||
/**
|
||||
* 实际签到状态(1已签到2.未签到)
|
||||
*/
|
||||
actualSignState: string;
|
||||
|
||||
/**
|
||||
* 巡检状态(0未完成,1已完成)
|
||||
*/
|
||||
inspectionState: string;
|
||||
|
||||
/**
|
||||
* 巡检照片
|
||||
* 巡检图片
|
||||
*/
|
||||
inspectionImag
|
||||
e: string;
|
||||
inspectionImage: string;
|
||||
|
||||
/**
|
||||
* 计划巡检人
|
||||
*/
|
||||
planInspectionPerson: string;
|
||||
|
||||
/**
|
||||
* 实际巡检人
|
||||
*/
|
||||
actualInspectionPerson: string;
|
||||
|
||||
/**
|
||||
* 任务状态
|
||||
*/
|
||||
taskStatus: string;
|
||||
|
||||
/**
|
||||
* 巡检结果
|
||||
*/
|
||||
inspectionResults: string;
|
||||
|
||||
/**
|
||||
* 巡检描述
|
||||
*/
|
||||
inspectionDesc: string;
|
||||
|
||||
/**
|
||||
* 巡检位置
|
||||
*/
|
||||
inspectionLocation: string;
|
||||
|
||||
/**
|
||||
* 实际巡检时间
|
||||
@@ -67,6 +106,11 @@ e: string;
|
||||
*/
|
||||
pointEndTime: string;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue: string;
|
||||
|
||||
}
|
||||
|
||||
export interface TaskDetailForm extends BaseEntity {
|
||||
@@ -101,20 +145,60 @@ export interface TaskDetailForm extends BaseEntity {
|
||||
patrolType?: string;
|
||||
|
||||
/**
|
||||
* 签到类型
|
||||
* 签到类型(1.现场拍照、2.摄像头签到、3.现场扫码)
|
||||
*/
|
||||
signType?: string;
|
||||
|
||||
/**
|
||||
* 实际巡检时间
|
||||
*/
|
||||
actualInspectionTime?: string;
|
||||
|
||||
/**
|
||||
* 实际签到状态(1已签到2.未签到)
|
||||
*/
|
||||
actualSignState?: string;
|
||||
|
||||
/**
|
||||
* 巡检状态(0未完成,1已完成)
|
||||
*/
|
||||
inspectionState?: string;
|
||||
|
||||
/**
|
||||
* 巡检照片
|
||||
* 巡检图片
|
||||
*/
|
||||
inspectionImage?: string;
|
||||
|
||||
/**
|
||||
* 计划巡检人
|
||||
*/
|
||||
planInspectionPerson?: string;
|
||||
|
||||
/**
|
||||
* 实际巡检人
|
||||
*/
|
||||
actualInspectionPerson?: string;
|
||||
|
||||
/**
|
||||
* 任务状态
|
||||
*/
|
||||
taskStatus?: string;
|
||||
|
||||
/**
|
||||
* 巡检结果
|
||||
*/
|
||||
inspectionResults?: string;
|
||||
|
||||
/**
|
||||
* 巡检描述
|
||||
*/
|
||||
inspectionDesc?: string;
|
||||
|
||||
/**
|
||||
* 巡检位置
|
||||
*/
|
||||
inspectionLocation?: string;
|
||||
|
||||
/**
|
||||
* 实际巡检时间
|
||||
*/
|
||||
@@ -135,6 +219,11 @@ export interface TaskDetailForm extends BaseEntity {
|
||||
*/
|
||||
pointEndTime?: string;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface TaskDetailQuery extends PageQuery {
|
||||
@@ -164,20 +253,59 @@ export interface TaskDetailQuery extends PageQuery {
|
||||
patrolType?: string;
|
||||
|
||||
/**
|
||||
* 签到类型
|
||||
* 签到类型(1.现场拍照、2.摄像头签到、3.现场扫码)
|
||||
*/
|
||||
signType?: string;
|
||||
|
||||
/**
|
||||
* 实际巡检时间
|
||||
*/
|
||||
actualInspectionTime?: string;
|
||||
|
||||
/**
|
||||
* 实际签到状态(1已签到2.未签到)
|
||||
*/
|
||||
actualSignState?: string;
|
||||
|
||||
/**
|
||||
* 巡检状态(0未完成,1已完成)
|
||||
*/
|
||||
inspectionState?: string;
|
||||
|
||||
/**
|
||||
* 巡检照片
|
||||
* 巡检图片
|
||||
*/
|
||||
inspectionImag
|
||||
e?: string;
|
||||
inspectionImage?: string;
|
||||
|
||||
/**
|
||||
* 计划巡检人
|
||||
*/
|
||||
planInspectionPerson?: string;
|
||||
|
||||
/**
|
||||
* 实际巡检人
|
||||
*/
|
||||
actualInspectionPerson?: string;
|
||||
|
||||
/**
|
||||
* 任务状态
|
||||
*/
|
||||
taskStatus?: string;
|
||||
|
||||
/**
|
||||
* 巡检结果
|
||||
*/
|
||||
inspectionResults?: string;
|
||||
|
||||
/**
|
||||
* 巡检描述
|
||||
*/
|
||||
inspectionDesc?: string;
|
||||
|
||||
/**
|
||||
* 巡检位置
|
||||
*/
|
||||
inspectionLocation?: string;
|
||||
|
||||
/**
|
||||
* 实际巡检时间
|
||||
@@ -194,6 +322,11 @@ e?: string;
|
||||
*/
|
||||
pointEndTime?: string;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
|
@@ -46,6 +46,10 @@ export interface InspectionPointVO {
|
||||
*/
|
||||
searchValue: string;
|
||||
|
||||
itemName: string;
|
||||
|
||||
createTime: string;
|
||||
|
||||
}
|
||||
|
||||
export interface InspectionPointForm extends BaseEntity {
|
||||
|
@@ -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;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
|
@@ -24,13 +24,15 @@ export interface PersonVO {
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
gender: number
|
||||
gender: string | number
|
||||
|
||||
/**
|
||||
* 人脸图片
|
||||
*/
|
||||
img: string
|
||||
|
||||
imgPath?: string
|
||||
|
||||
/**
|
||||
* 所属单位id
|
||||
*/
|
||||
@@ -75,6 +77,14 @@ export interface PersonVO {
|
||||
|
||||
authEndDate?: string
|
||||
|
||||
authTime: any[]
|
||||
|
||||
rosterType?: string | number
|
||||
|
||||
email?: string
|
||||
|
||||
idCard?: string
|
||||
|
||||
}
|
||||
|
||||
export interface PersonForm extends BaseEntity {
|
||||
@@ -293,7 +303,7 @@ export interface Person extends BaseEntity {
|
||||
* @param file excel文件
|
||||
*/
|
||||
export interface PerssonImportParam {
|
||||
updateSupport: boolean;
|
||||
unitId: number;
|
||||
file: Blob | File;
|
||||
updateSupport: boolean
|
||||
unitId: number
|
||||
file: Blob | File
|
||||
}
|
||||
|
@@ -35,6 +35,7 @@ export interface Resident_unitVO {
|
||||
* 入驻位置
|
||||
*/
|
||||
location: string;
|
||||
locations: string[];
|
||||
|
||||
/**
|
||||
* 入驻时间
|
||||
@@ -65,6 +66,9 @@ export interface Resident_unitVO {
|
||||
* 权限组名称
|
||||
*/
|
||||
authGroupName?: string;
|
||||
// 授权期限
|
||||
authBegDate?:string;//开始
|
||||
authEndDate?:string;//结束
|
||||
|
||||
}
|
||||
|
||||
|
@@ -40,6 +40,10 @@ export interface AttachVO {
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: string;
|
||||
|
||||
quantity: number;
|
||||
|
||||
meetAttachId: string;
|
||||
}
|
||||
|
||||
export interface AttachForm extends BaseEntity {
|
||||
|
@@ -61,5 +61,5 @@ export function meetRemove(id: ID | IDS) {
|
||||
}
|
||||
|
||||
export function notlist(params?: MeetBo) {
|
||||
return requestClient.get<PageResult<MeetVO>>('/property/meet/notlist', { params });
|
||||
return requestClient.get<MeetVO[]>('/property/meet/notlist', { params });
|
||||
}
|
||||
|
@@ -67,6 +67,29 @@ export interface MeetVO {
|
||||
* 图片
|
||||
*/
|
||||
picture: string;
|
||||
|
||||
pictureArr: string[];
|
||||
/**
|
||||
* 开放时段开始时间
|
||||
*/
|
||||
openStartHours: string;
|
||||
/**
|
||||
* 开放时段结束时间
|
||||
*/
|
||||
openEndHours: string;
|
||||
|
||||
/**
|
||||
* 会议室类型
|
||||
*/
|
||||
meetingRoomType: string;
|
||||
/**
|
||||
* 位置
|
||||
*/
|
||||
locationName: string;
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
principalsName: string;
|
||||
}
|
||||
|
||||
export interface MeetForm extends BaseEntity {
|
||||
@@ -153,6 +176,17 @@ export interface MeetForm extends BaseEntity {
|
||||
*/
|
||||
picture: string;
|
||||
|
||||
pictureArr: string[];
|
||||
|
||||
/**
|
||||
* 开放时段开始时间
|
||||
*/
|
||||
openStartHours: string;
|
||||
/**
|
||||
* 开放时段结束时间
|
||||
*/
|
||||
openEndHours: string;
|
||||
|
||||
}
|
||||
|
||||
export interface MeetQuery extends PageQuery {
|
||||
@@ -240,7 +274,7 @@ export interface MeetQuery extends PageQuery {
|
||||
picture: string;
|
||||
}
|
||||
|
||||
export interface conferenceSettingsDetail extends BaseEntity {
|
||||
export interface ConferenceSettingsDetail{
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@@ -329,6 +363,16 @@ export interface conferenceSettingsDetail extends BaseEntity {
|
||||
* 图片
|
||||
*/
|
||||
picture: string;
|
||||
|
||||
/**
|
||||
* 开放时段开始时间
|
||||
*/
|
||||
openStartHours: string;
|
||||
/**
|
||||
* 开放时段结束时间
|
||||
*/
|
||||
openEndHours: string;
|
||||
|
||||
}
|
||||
|
||||
export interface MeetBo{
|
||||
|
@@ -70,6 +70,10 @@ export interface VisitorManagementVO {
|
||||
* 预约状态(0:待确认,1:已确认,2:已取消,3:已完成)
|
||||
*/
|
||||
serveStatus: number;
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
idCard: string;
|
||||
}
|
||||
|
||||
export interface VisitorManagementForm extends BaseEntity {
|
||||
|
@@ -2,12 +2,12 @@ import type {
|
||||
AccessControlForm,
|
||||
AccessControlQuery,
|
||||
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 { requestClient } from '#/api/request'
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询门禁管理列表
|
||||
@@ -18,7 +18,7 @@ export function accessControlList(params?: AccessControlQuery) {
|
||||
return requestClient.get<PageResult<AccessControlVO>>(
|
||||
'/sis/accessControl/list',
|
||||
{ params },
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -27,7 +27,7 @@ export function accessControlList(params?: AccessControlQuery) {
|
||||
* @returns 门禁管理列表
|
||||
*/
|
||||
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 门禁管理详情
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
export function accessControlRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/sis/accessControl/${id}`)
|
||||
return requestClient.deleteWithMsg<void>(`/sis/accessControl/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,7 +71,7 @@ export function accessControlRemove(id: ID | IDS) {
|
||||
* @returns void
|
||||
*/
|
||||
export function queryTree() {
|
||||
return requestClient.get<TreeNode<Number>[]>(`/sis/accessControl/tree`)
|
||||
return requestClient.get<TreeNode<Number>[]>(`/sis/accessControl/tree`);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,5 +79,12 @@ export function queryTree() {
|
||||
* @returns void
|
||||
*/
|
||||
export function accessControlSync() {
|
||||
return requestClient.get<void>(`/sis/accessControl/sync`)
|
||||
return requestClient.get<void>(`/sis/accessControl/sync`);
|
||||
}
|
||||
|
||||
export function remoteOpenDoor(params: any) {
|
||||
return requestClient.post<void>(
|
||||
`/sis/accessControl/e8/remoteOpenDoor`,
|
||||
params,
|
||||
);
|
||||
}
|
||||
|
77
apps/web-antd/src/api/sis/alarmEventAttachments/index.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import type {
|
||||
AlarmEventAttachmentsForm,
|
||||
AlarmEventAttachmentsQuery,
|
||||
AlarmEventAttachmentsVO,
|
||||
} from './model';
|
||||
|
||||
import type { ID, IDS, PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
* @param params
|
||||
* @returns 【请填写功能名称】列表
|
||||
*/
|
||||
export function alarmEventAttachmentsList(params?: AlarmEventAttachmentsQuery) {
|
||||
return requestClient.get<PageResult<AlarmEventAttachmentsVO>>(
|
||||
'/sis/alarmEventAttachments/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
export function queryAlarmEventAttachmentsList(id: ID) {
|
||||
return requestClient.get<AlarmEventAttachmentsVO[]>(
|
||||
'/sis/alarmEventAttachments/query/' + id,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出【请填写功能名称】列表
|
||||
* @param params
|
||||
* @returns 【请填写功能名称】列表
|
||||
*/
|
||||
export function alarmEventAttachmentsExport(
|
||||
params?: AlarmEventAttachmentsQuery,
|
||||
) {
|
||||
return commonExport('/sis/alarmEventAttachments/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】详情
|
||||
* @param id id
|
||||
* @returns 【请填写功能名称】详情
|
||||
*/
|
||||
export function alarmEventAttachmentsInfo(id: ID) {
|
||||
return requestClient.get<AlarmEventAttachmentsVO>(
|
||||
`/sis/alarmEventAttachments/${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function alarmEventAttachmentsAdd(data: AlarmEventAttachmentsForm) {
|
||||
return requestClient.postWithMsg<void>('/sis/alarmEventAttachments', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新【请填写功能名称】
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function alarmEventAttachmentsUpdate(data: AlarmEventAttachmentsForm) {
|
||||
return requestClient.putWithMsg<void>('/sis/alarmEventAttachments', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function alarmEventAttachmentsRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/sis/alarmEventAttachments/${id}`);
|
||||
}
|
71
apps/web-antd/src/api/sis/alarmEventAttachments/model.d.ts
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface AlarmEventAttachmentsVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 事件id
|
||||
*/
|
||||
eventId: string | number;
|
||||
|
||||
/**
|
||||
* 时间图片id
|
||||
*/
|
||||
ossId: string | number;
|
||||
|
||||
imagePath: string;
|
||||
|
||||
/**
|
||||
* 1:图片,2:文件;3视频
|
||||
*/
|
||||
type: number;
|
||||
|
||||
}
|
||||
|
||||
export interface AlarmEventAttachmentsForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 事件id
|
||||
*/
|
||||
eventId?: string | number;
|
||||
|
||||
/**
|
||||
* 时间图片id
|
||||
*/
|
||||
ossId?: string | number;
|
||||
|
||||
/**
|
||||
* 1:图片,2:文件;3视频
|
||||
*/
|
||||
type?: number;
|
||||
|
||||
}
|
||||
|
||||
export interface AlarmEventAttachmentsQuery extends PageQuery {
|
||||
/**
|
||||
* 事件id
|
||||
*/
|
||||
eventId?: string | number;
|
||||
|
||||
/**
|
||||
* 时间图片id
|
||||
*/
|
||||
ossId?: string | number;
|
||||
|
||||
/**
|
||||
* 1:图片,2:文件;3视频
|
||||
*/
|
||||
type?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
61
apps/web-antd/src/api/sis/alarmEventProcess/index.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import type { AlarmEventProcessVO, AlarmEventProcessForm, AlarmEventProcessQuery } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询告警信息处理流程记录列表
|
||||
* @param params
|
||||
* @returns 告警信息处理流程记录列表
|
||||
*/
|
||||
export function alarmEventProcessList(params?: AlarmEventProcessQuery) {
|
||||
return requestClient.get<PageResult<AlarmEventProcessVO>>('/sis/alarmEventProcess/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出告警信息处理流程记录列表
|
||||
* @param params
|
||||
* @returns 告警信息处理流程记录列表
|
||||
*/
|
||||
export function alarmEventProcessExport(params?: AlarmEventProcessQuery) {
|
||||
return commonExport('/sis/alarmEventProcess/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询告警信息处理流程记录详情
|
||||
* @param id id
|
||||
* @returns 告警信息处理流程记录详情
|
||||
*/
|
||||
export function alarmEventProcessInfo(id: ID) {
|
||||
return requestClient.get<AlarmEventProcessVO>(`/sis/alarmEventProcess/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增告警信息处理流程记录
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function alarmEventProcessAdd(data: AlarmEventProcessForm) {
|
||||
return requestClient.postWithMsg<void>('/sis/alarmEventProcess', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新告警信息处理流程记录
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function alarmEventProcessUpdate(data: AlarmEventProcessForm) {
|
||||
return requestClient.putWithMsg<void>('/sis/alarmEventProcess', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除告警信息处理流程记录
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function alarmEventProcessRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/sis/alarmEventProcess/${id}`);
|
||||
}
|
147
apps/web-antd/src/api/sis/alarmEventProcess/model.d.ts
vendored
Normal file
@@ -0,0 +1,147 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface AlarmEventProcessVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 告警记录主键id
|
||||
*/
|
||||
alarmId: string | number;
|
||||
|
||||
/**
|
||||
* 指派人员id
|
||||
*/
|
||||
solveId: string | number;
|
||||
|
||||
/**
|
||||
* 指派人员名称
|
||||
*/
|
||||
solveName: string;
|
||||
|
||||
/**
|
||||
* 工单问题回复内容
|
||||
*/
|
||||
workReply: string;
|
||||
|
||||
/**
|
||||
* 处理时间
|
||||
*/
|
||||
workReplyTime: string;
|
||||
|
||||
/**
|
||||
* 是否已接受任务 0:未接收;1:已接收
|
||||
*/
|
||||
receiveTaskTag: number;
|
||||
|
||||
/**
|
||||
* 10: 已上报待确认
|
||||
20:已确认待处理
|
||||
30: 处理中
|
||||
31:升级-转工单
|
||||
32:升级-协助
|
||||
40:已解决
|
||||
50:已关闭
|
||||
*/
|
||||
state: number;
|
||||
|
||||
}
|
||||
|
||||
export interface AlarmEventProcessForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 告警记录主键id
|
||||
*/
|
||||
alarmId?: string | number;
|
||||
|
||||
/**
|
||||
* 指派人员id
|
||||
*/
|
||||
solveId?: string | number;
|
||||
|
||||
/**
|
||||
* 指派人员名称
|
||||
*/
|
||||
solveName?: string;
|
||||
|
||||
/**
|
||||
* 工单问题回复内容
|
||||
*/
|
||||
workReply?: string;
|
||||
|
||||
/**
|
||||
* 处理时间
|
||||
*/
|
||||
workReplyTime?: string;
|
||||
|
||||
/**
|
||||
* 是否已接受任务 0:未接收;1:已接收
|
||||
*/
|
||||
receiveTaskTag?: number;
|
||||
|
||||
/**
|
||||
* 10: 已上报待确认
|
||||
20:已确认待处理
|
||||
30: 处理中
|
||||
31:升级-转工单
|
||||
32:升级-协助
|
||||
40:已解决
|
||||
50:已关闭
|
||||
*/
|
||||
state?: number;
|
||||
|
||||
}
|
||||
|
||||
export interface AlarmEventProcessQuery extends PageQuery {
|
||||
/**
|
||||
* 告警记录主键id
|
||||
*/
|
||||
alarmId?: string | number;
|
||||
|
||||
/**
|
||||
* 指派人员id
|
||||
*/
|
||||
solveId?: string | number;
|
||||
|
||||
/**
|
||||
* 指派人员名称
|
||||
*/
|
||||
solveName?: string;
|
||||
|
||||
/**
|
||||
* 工单问题回复内容
|
||||
*/
|
||||
workReply?: string;
|
||||
|
||||
/**
|
||||
* 处理时间
|
||||
*/
|
||||
workReplyTime?: string;
|
||||
|
||||
/**
|
||||
* 是否已接受任务 0:未接收;1:已接收
|
||||
*/
|
||||
receiveTaskTag?: number;
|
||||
|
||||
/**
|
||||
* 10: 已上报待确认
|
||||
20:已确认待处理
|
||||
30: 处理中
|
||||
31:升级-转工单
|
||||
32:升级-协助
|
||||
40:已解决
|
||||
50:已关闭
|
||||
*/
|
||||
state?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
95
apps/web-antd/src/api/sis/alarmEvents/index.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
import type { AlarmEventsForm, AlarmEventsQuery, AlarmEventsVO } from './model';
|
||||
|
||||
import type { ID, IDS, PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
* @param params
|
||||
* @returns 【请填写功能名称】列表
|
||||
*/
|
||||
export function alarmEventsList(params?: AlarmEventsQuery) {
|
||||
return requestClient.get<PageResult<AlarmEventsVO>>('/sis/alarmEvents/list', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
* @param params
|
||||
* @returns 【请填写功能名称】列表
|
||||
*/
|
||||
export function alarmEventsListCurr(params?: AlarmEventsQuery) {
|
||||
return requestClient.get<PageResult<AlarmEventsVO>>('/sis/alarmEvents/list/curr', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出【请填写功能名称】列表
|
||||
* @param params
|
||||
* @returns 【请填写功能名称】列表
|
||||
*/
|
||||
export function alarmEventsExport(params?: AlarmEventsQuery) {
|
||||
return commonExport('/sis/alarmEvents/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】详情
|
||||
* @param id id
|
||||
* @returns 【请填写功能名称】详情
|
||||
*/
|
||||
export function alarmEventsInfo(id: ID) {
|
||||
return requestClient.get<AlarmEventsVO>(`/sis/alarmEvents/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function alarmEventsAdd(data: AlarmEventsForm) {
|
||||
return requestClient.postWithMsg<void>('/sis/alarmEvents', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新【请填写功能名称】
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function alarmEventsUpdate(data: AlarmEventsForm) {
|
||||
return requestClient.putWithMsg<void>('/sis/alarmEvents', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function alarmEventsRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/sis/alarmEvents/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 告警指派
|
||||
* @returns void
|
||||
*/
|
||||
export function taskAssignment(params: any) {
|
||||
return requestClient.postWithMsg<void>(
|
||||
`/sis/alarmEvents/assignment`,
|
||||
params ?? {},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 告警处理完成
|
||||
* @returns void
|
||||
*/
|
||||
export function alarmEventComplete(params: any) {
|
||||
return requestClient.postWithMsg<void>(
|
||||
`/sis/alarmEvents/complete`,
|
||||
params ?? {},
|
||||
);
|
||||
}
|
159
apps/web-antd/src/api/sis/alarmEvents/model.d.ts
vendored
Normal file
@@ -0,0 +1,159 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface AlarmEventsVO {
|
||||
/**
|
||||
* 报警记录ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 报警事件类型
|
||||
*/
|
||||
type: number;
|
||||
|
||||
/**
|
||||
* 报警记录级别(1:一般,2:中级,3:紧急)
|
||||
*/
|
||||
level: number;
|
||||
|
||||
/**
|
||||
* 报警设备ip
|
||||
*/
|
||||
deviceIp: string;
|
||||
|
||||
/**
|
||||
* 报警设备名称
|
||||
*/
|
||||
deviceName: string;
|
||||
|
||||
/**
|
||||
* 设备所属区域id
|
||||
*/
|
||||
deviceGroupId: string | number;
|
||||
|
||||
/**
|
||||
* 设备所属区域名称
|
||||
*/
|
||||
deviceGroupName: string;
|
||||
|
||||
/**
|
||||
* 设备告警时间
|
||||
*/
|
||||
reportTime: string;
|
||||
|
||||
/**
|
||||
* 1:未处理,2:已处理-忽略,3:已处理-生成工单
|
||||
*/
|
||||
state: number;
|
||||
|
||||
/**
|
||||
* 工单id,需要state=3才会写入
|
||||
*/
|
||||
workOrderId: string | number;
|
||||
|
||||
}
|
||||
|
||||
export interface AlarmEventsForm extends BaseEntity {
|
||||
/**
|
||||
* 报警记录ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 报警事件类型
|
||||
*/
|
||||
type?: number;
|
||||
|
||||
/**
|
||||
* 报警记录级别(1:一般,2:中级,3:紧急)
|
||||
*/
|
||||
level?: number;
|
||||
|
||||
/**
|
||||
* 报警设备ip
|
||||
*/
|
||||
deviceIp?: string;
|
||||
|
||||
/**
|
||||
* 报警设备名称
|
||||
*/
|
||||
deviceName?: string;
|
||||
|
||||
/**
|
||||
* 设备所属区域id
|
||||
*/
|
||||
deviceGroupId?: string | number;
|
||||
|
||||
/**
|
||||
* 设备所属区域名称
|
||||
*/
|
||||
deviceGroupName?: string;
|
||||
|
||||
/**
|
||||
* 设备告警时间
|
||||
*/
|
||||
reportTime?: string;
|
||||
|
||||
/**
|
||||
* 1:未处理,2:已处理-忽略,3:已处理-生成工单
|
||||
*/
|
||||
state?: number;
|
||||
|
||||
/**
|
||||
* 工单id,需要state=3才会写入
|
||||
*/
|
||||
workOrderId?: string | number;
|
||||
|
||||
}
|
||||
|
||||
export interface AlarmEventsQuery extends PageQuery {
|
||||
/**
|
||||
* 报警事件类型
|
||||
*/
|
||||
type?: number;
|
||||
|
||||
/**
|
||||
* 报警记录级别(1:一般,2:中级,3:紧急)
|
||||
*/
|
||||
level?: number;
|
||||
|
||||
/**
|
||||
* 报警设备ip
|
||||
*/
|
||||
deviceIp?: string;
|
||||
|
||||
/**
|
||||
* 报警设备名称
|
||||
*/
|
||||
deviceName?: string;
|
||||
|
||||
/**
|
||||
* 设备所属区域id
|
||||
*/
|
||||
deviceGroupId?: string | number;
|
||||
|
||||
/**
|
||||
* 设备所属区域名称
|
||||
*/
|
||||
deviceGroupName?: string;
|
||||
|
||||
/**
|
||||
* 设备告警时间
|
||||
*/
|
||||
reportTime?: string;
|
||||
|
||||
/**
|
||||
* 1:未处理,2:已处理-忽略,3:已处理-生成工单
|
||||
*/
|
||||
state?: number;
|
||||
|
||||
/**
|
||||
* 工单id,需要state=3才会写入
|
||||
*/
|
||||
workOrderId?: string | number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
10
apps/web-antd/src/api/sis/authGroup/model.d.ts
vendored
@@ -21,6 +21,16 @@ export interface AuthGroupVO {
|
||||
*/
|
||||
isEnable: boolean;
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
acIds?: string[] | number[];
|
||||
|
||||
/**
|
||||
* 楼层id
|
||||
*/
|
||||
floorIds?: string[] | number[];
|
||||
|
||||
}
|
||||
|
||||
export interface AuthGroupForm extends BaseEntity {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
import type { BaseEntity, PageQuery } from '#/api/common';
|
||||
|
||||
export interface DeviceChannelVO {
|
||||
/**
|
||||
@@ -51,6 +51,13 @@ export interface DeviceChannelVO {
|
||||
*/
|
||||
channelNo: string;
|
||||
|
||||
nvrId: string;
|
||||
nvrFactoryNo: string;
|
||||
nvrIp: string;
|
||||
nvrPort: number;
|
||||
nvrAccount: string;
|
||||
nvrPwd: string;
|
||||
nvrChannelNo: string;
|
||||
}
|
||||
|
||||
export interface DeviceChannelForm extends BaseEntity {
|
||||
@@ -103,7 +110,6 @@ export interface DeviceChannelForm extends BaseEntity {
|
||||
* 设备通道编号
|
||||
*/
|
||||
channelNo?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DeviceChannelQuery extends PageQuery {
|
||||
@@ -153,7 +159,7 @@ export interface DeviceChannelQuery extends PageQuery {
|
||||
channelNo?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
@@ -80,6 +80,15 @@ export interface DeviceManageVO {
|
||||
* 门禁id
|
||||
*/
|
||||
accessControlId: string | number;
|
||||
|
||||
/**
|
||||
* 楼层id
|
||||
*/
|
||||
floorId: string | number;
|
||||
|
||||
lon: number;
|
||||
|
||||
lat: number;
|
||||
}
|
||||
|
||||
export interface DeviceManageForm extends BaseEntity {
|
||||
@@ -123,6 +132,10 @@ export interface DeviceManageForm extends BaseEntity {
|
||||
*/
|
||||
deviceMac?: string;
|
||||
|
||||
lon: number;
|
||||
|
||||
lat: number;
|
||||
|
||||
/**
|
||||
* 设备在线状态 0:离线 1:在线 2:未知
|
||||
*/
|
||||
@@ -165,6 +178,10 @@ export interface DeviceManageQuery extends PageQuery {
|
||||
*/
|
||||
deviceMac?: string;
|
||||
|
||||
lon?: number;
|
||||
|
||||
lat?: number;
|
||||
|
||||
/**
|
||||
* 设备在线状态 0:离线 1:在线 2:未知
|
||||
*/
|
||||
|
@@ -59,22 +59,3 @@ export function elevatorInfoUpdate(data: ElevatorInfoForm) {
|
||||
export function elevatorInfoRemove(elevatorId: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/sis/elevatorInfo/${elevatorId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增电梯⇄楼层关联
|
||||
* @param params
|
||||
* @returns void
|
||||
*/
|
||||
export function refAdd(data: ElevatorFloorRefForm) {
|
||||
return requestClient.postWithMsg<void>('/sis/elevatorInfo/ref/add', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询电梯⇄楼层关联
|
||||
* @param id
|
||||
* @returns void
|
||||
*/
|
||||
export function refQuery(id: ID) {
|
||||
return requestClient.get<ElevatorFloorRefVo[]>(`/sis/elevatorInfo/ref/${id}`);
|
||||
}
|
||||
|
||||
|
@@ -96,6 +96,22 @@ export interface ElevatorInfoVO {
|
||||
*/
|
||||
controlPwd: string
|
||||
|
||||
elevatorControlDeviceId: {
|
||||
value: number,
|
||||
deviceIp: string,
|
||||
deviceId: number,
|
||||
}
|
||||
|
||||
remoteCallElevatorDeviceId: {
|
||||
value: number,
|
||||
deviceIp: string,
|
||||
deviceId: number,
|
||||
}[]
|
||||
|
||||
/**
|
||||
* 建筑ID
|
||||
*/
|
||||
buildingId?: number | string
|
||||
}
|
||||
|
||||
export interface ElevatorInfoForm extends BaseEntity {
|
||||
@@ -195,10 +211,9 @@ export interface ElevatorInfoForm extends BaseEntity {
|
||||
controlPwd?: string
|
||||
|
||||
/**
|
||||
* 单元ID
|
||||
* 建筑ID
|
||||
*/
|
||||
unitId?: number
|
||||
|
||||
buildingId?: number
|
||||
}
|
||||
|
||||
export interface ElevatorInfoQuery extends PageQuery {
|
||||
@@ -299,9 +314,9 @@ export interface ElevatorInfoQuery extends PageQuery {
|
||||
}
|
||||
|
||||
export interface ElevatorFloorRefVo {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
/**
|
||||
*
|
||||
*/
|
||||
elevatorId: string | number
|
||||
|
||||
/**
|
||||
|
@@ -12,9 +12,21 @@ export function addStreamProxy(params?: any) {
|
||||
params,
|
||||
);
|
||||
}
|
||||
|
||||
export function addFFmpegStreamProxy(params?: any) {
|
||||
return requestClient.post<AddStreamProxyResult>(
|
||||
'sis/stream/realtime/addFfmpeg',
|
||||
'sis/stream/FFmpeg/proxy',
|
||||
params,
|
||||
);
|
||||
}
|
||||
|
||||
export function addMediaStreamProxy(params?: any) {
|
||||
return requestClient.post<AddStreamProxyResult>('sis/stream/proxy', params);
|
||||
}
|
||||
|
||||
export function addFFmpegMediaStreamProxy(params?: any) {
|
||||
return requestClient.post<AddStreamProxyResult>(
|
||||
'sis/stream/ffmpeg/proxy',
|
||||
params,
|
||||
);
|
||||
}
|
||||
|
Before Width: | Height: | Size: 556 KiB After Width: | Height: | Size: 553 KiB |
Before Width: | Height: | Size: 549 KiB After Width: | Height: | Size: 548 KiB |
BIN
apps/web-antd/src/assets/map/alarm1.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
apps/web-antd/src/assets/map/alarm2.png
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
apps/web-antd/src/assets/map/camear.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
apps/web-antd/src/assets/map/video-bg.png
Normal file
After Width: | Height: | Size: 17 KiB |
@@ -17,6 +17,8 @@ import { initSetupVbenForm } from './adapter/form';
|
||||
import App from './app.vue';
|
||||
import { router } from './router';
|
||||
|
||||
|
||||
|
||||
async function bootstrap(namespace: string) {
|
||||
// 初始化组件适配器
|
||||
await initComponentAdapter();
|
||||
@@ -43,6 +45,7 @@ async function bootstrap(namespace: string) {
|
||||
spinning: 'spinning',
|
||||
});
|
||||
|
||||
|
||||
// 国际化 i18n 配置
|
||||
await setupI18n(app);
|
||||
|
||||
@@ -59,6 +62,7 @@ async function bootstrap(namespace: string) {
|
||||
// 配置路由及路由守卫
|
||||
app.use(router);
|
||||
|
||||
|
||||
// 配置Motion插件
|
||||
const { MotionPlugin } = await import('@vben/plugins/motion');
|
||||
app.use(MotionPlugin);
|
||||
|
@@ -11,7 +11,6 @@ import {
|
||||
GiteeIcon,
|
||||
GitHubOutlined,
|
||||
UserOutlined,
|
||||
|
||||
} from '@vben/icons';
|
||||
import {
|
||||
BasicLayout,
|
||||
@@ -58,40 +57,40 @@ const menus = computed(() => {
|
||||
icon: UserOutlined,
|
||||
text: $t('ui.widgets.profile'),
|
||||
},
|
||||
{
|
||||
handler: () => {
|
||||
openWindow('https://gitee.com/dapppp/ruoyi-plus-vben5', {
|
||||
target: '_blank',
|
||||
});
|
||||
},
|
||||
icon: () => h(GiteeIcon, { class: 'text-red-800' }),
|
||||
text: 'Gitee项目地址',
|
||||
},
|
||||
{
|
||||
handler: () => {
|
||||
openWindow(VBEN_GITHUB_URL, {
|
||||
target: '_blank',
|
||||
});
|
||||
},
|
||||
icon: GitHubOutlined,
|
||||
text: 'Vben官方地址',
|
||||
},
|
||||
{
|
||||
handler: () => {
|
||||
openWindow(`${VBEN_GITHUB_URL}/issues`, {
|
||||
target: '_blank',
|
||||
});
|
||||
},
|
||||
icon: CircleHelp,
|
||||
text: $t('ui.widgets.qa'),
|
||||
},
|
||||
{
|
||||
handler: () => {
|
||||
router.push('/navigation');
|
||||
},
|
||||
// icon: TagOutlined,
|
||||
text: '返回导航',
|
||||
},
|
||||
// {
|
||||
// handler: () => {
|
||||
// openWindow('https://gitee.com/dapppp/ruoyi-plus-vben5', {
|
||||
// target: '_blank',
|
||||
// });
|
||||
// },
|
||||
// icon: () => h(GiteeIcon, { class: 'text-red-800' }),
|
||||
// text: 'Gitee项目地址',
|
||||
// },
|
||||
// {
|
||||
// handler: () => {
|
||||
// openWindow(VBEN_GITHUB_URL, {
|
||||
// target: '_blank',
|
||||
// });
|
||||
// },
|
||||
// icon: GitHubOutlined,
|
||||
// text: 'Vben官方地址',
|
||||
// },
|
||||
// {
|
||||
// handler: () => {
|
||||
// openWindow(`${VBEN_GITHUB_URL}/issues`, {
|
||||
// target: '_blank',
|
||||
// });
|
||||
// },
|
||||
// icon: CircleHelp,
|
||||
// text: $t('ui.widgets.qa'),
|
||||
// },
|
||||
// {
|
||||
// handler: () => {
|
||||
// router.push('/navigation');
|
||||
// },
|
||||
// // icon: TagOutlined,
|
||||
// text: '返回导航',
|
||||
// },
|
||||
];
|
||||
/**
|
||||
* 租户选中状态 不显示个人中心
|
||||
@@ -147,7 +146,7 @@ watch(
|
||||
:avatar
|
||||
:menus
|
||||
:text="userStore.userInfo?.realName"
|
||||
description="ann.vben@gmail.com"
|
||||
:description="userStore.userInfo?.roles[0]"
|
||||
tag-text="Pro"
|
||||
@logout="handleLogout"
|
||||
/>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import { initPreferences } from '@vben/preferences';
|
||||
import { unmountGlobalLoading } from '@vben/utils';
|
||||
import { overridesPreferences } from './preferences';
|
||||
|
||||
/**
|
||||
* 应用初始化完成之后再进行页面加载渲染
|
||||
*/
|
||||
|
@@ -125,8 +125,18 @@ const coreRoutes: RouteRecordRaw[] = [
|
||||
title: '物业大屏',
|
||||
requiresAuth: true, // 如果需要登录验证
|
||||
},
|
||||
}, {
|
||||
component: () => import('#/views/screen/security/index.vue'),
|
||||
},
|
||||
// {
|
||||
// component: () => import('#/views/screen/security/index.vue'),
|
||||
// name: 'security',
|
||||
// path: '/security',
|
||||
// meta: {
|
||||
// title: '安防大屏',
|
||||
// requiresAuth: true, // 如果需要登录验证
|
||||
// },
|
||||
// },
|
||||
{
|
||||
component: () => import('#/views/cockpit/security/index.vue'),
|
||||
name: 'security',
|
||||
path: '/security',
|
||||
meta: {
|
||||
@@ -143,15 +153,15 @@ const coreRoutes: RouteRecordRaw[] = [
|
||||
requiresAuth: true, // 如果需要登录验证
|
||||
},
|
||||
},
|
||||
{
|
||||
component: () => import('#/views/screen/security/index.vue'),
|
||||
name: 'security',
|
||||
path: '/security',
|
||||
meta: {
|
||||
title: '安防大屏',
|
||||
requiresAuth: true, // 如果需要登录验证
|
||||
},
|
||||
},
|
||||
// {
|
||||
// component: () => import('#/views/screen/security/index.vue'),
|
||||
// name: 'security',
|
||||
// path: '/security',
|
||||
// meta: {
|
||||
// title: '安防大屏',
|
||||
// requiresAuth: true, // 如果需要登录验证
|
||||
// },
|
||||
// },
|
||||
{
|
||||
component: () => import('#/views/screen/digitalIntelligence/index.vue'),
|
||||
name: 'digitalIntelligence',
|
||||
|
@@ -56,9 +56,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
if (accessStore.loginExpired) {
|
||||
accessStore.setLoginExpired(false);
|
||||
} else {
|
||||
onSuccess
|
||||
? await onSuccess?.()
|
||||
: await router.push('/navigation');
|
||||
onSuccess ? await onSuccess?.() : await router.push('/analytics');
|
||||
}
|
||||
|
||||
if (userInfo?.realName) {
|
||||
|
@@ -24,7 +24,7 @@ export const useNotifyStore = defineStore(
|
||||
* return才会被持久化 存储全部消息
|
||||
*/
|
||||
const notificationList = ref<NotificationItem[]>([]);
|
||||
|
||||
const sseList = ref<string[]>(["111"]);
|
||||
const userStore = useUserStore();
|
||||
const userId = computed(() => {
|
||||
return userStore.userInfo?.userId || '0';
|
||||
@@ -65,24 +65,33 @@ export const useNotifyStore = defineStore(
|
||||
if (!message) return;
|
||||
console.log(`接收到消息: ${message}`);
|
||||
|
||||
notification.success({
|
||||
description: message,
|
||||
duration: 3,
|
||||
message: $t('component.notice.received'),
|
||||
});
|
||||
try {
|
||||
// 尝试解析JSON
|
||||
const obj = JSON.parse(message);
|
||||
// 检查解析结果是否为对象且不为null
|
||||
if (obj.getType() ==="yvjin"){
|
||||
sseList.value.join(message)
|
||||
}
|
||||
} catch (e) {
|
||||
notification.success({
|
||||
description: message,
|
||||
duration: 3,
|
||||
message: $t('component.notice.received'),
|
||||
});
|
||||
|
||||
notificationList.value.unshift({
|
||||
// avatar: `https://api.multiavatar.com/${random(0, 10_000)}.png`, 随机头像
|
||||
avatar: SvgMessageUrl,
|
||||
date: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||
isRead: false,
|
||||
message,
|
||||
title: $t('component.notice.title'),
|
||||
userId: userId.value,
|
||||
});
|
||||
notificationList.value.unshift({
|
||||
// avatar: `https://api.multiavatar.com/${random(0, 10_000)}.png`, 随机头像
|
||||
avatar: SvgMessageUrl,
|
||||
date: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||
isRead: false,
|
||||
message,
|
||||
title: $t('component.notice.title'),
|
||||
userId: userId.value,
|
||||
});
|
||||
|
||||
// 需要手动置空 vue3在值相同时不会触发watch
|
||||
data.value = null;
|
||||
// 需要手动置空 vue3在值相同时不会触发watch
|
||||
data.value = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -96,6 +105,10 @@ export const useNotifyStore = defineStore(
|
||||
item.isRead = true;
|
||||
});
|
||||
}
|
||||
function getsseList(){
|
||||
console.log(sseList.value)
|
||||
return sseList.value
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置单条消息已读
|
||||
@@ -134,6 +147,8 @@ export const useNotifyStore = defineStore(
|
||||
$reset,
|
||||
clearAllMessage,
|
||||
notificationList,
|
||||
sseList,
|
||||
getsseList,
|
||||
notifications,
|
||||
setAllRead,
|
||||
setRead,
|
||||
|
21
apps/web-antd/src/utils/video.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* 验证浏览器是否支持播放h265 编码的视频流
|
||||
*/
|
||||
export function checkHEVCSupport() {
|
||||
const video = document.createElement('video');
|
||||
const h265Support = {
|
||||
hevc: false,
|
||||
hvc1: false,
|
||||
};
|
||||
|
||||
// 测试不同的HEVC MIME类型
|
||||
if (video.canPlayType) {
|
||||
h265Support.hevc =
|
||||
video.canPlayType('video/mp4; codecs="hev1.1.6.L93.B0"') !== '';
|
||||
h265Support.hvc1 =
|
||||
video.canPlayType('video/mp4; codecs="hvc1.1.6.L93.B0"') !== '';
|
||||
}
|
||||
const result = h265Support.hevc || h265Support.hvc1;
|
||||
console.log('当前浏览器是否支持h265:' + result);
|
||||
return result;
|
||||
}
|
116
apps/web-antd/src/views/cockpit/security/index.css
Normal file
@@ -0,0 +1,116 @@
|
||||
/* 自定义滚动条样式 */
|
||||
.scrollbar-thin {
|
||||
scrollbar-width: thin;
|
||||
}
|
||||
|
||||
.scrollbar-thumb-slate-700::-webkit-scrollbar-thumb {
|
||||
background-color: #334155;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.scrollbar-track-transparent::-webkit-scrollbar-track {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
/* 动画效果 */
|
||||
@keyframes ping {
|
||||
0%, 100% {
|
||||
opacity: 1;
|
||||
}
|
||||
50% {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
.animate-ping {
|
||||
animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
|
||||
}
|
||||
|
||||
/* 淡入动画 */
|
||||
@keyframes fadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(10px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.animate-fadeIn {
|
||||
animation: fadeIn 0.3s ease-out forwards;
|
||||
}
|
||||
|
||||
/* 数字计数器动画 */
|
||||
@keyframes countUp {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(5px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.counter-animation {
|
||||
animation: countUp 0.5s ease-out forwards;
|
||||
}
|
||||
|
||||
/* 网格背景图案 */
|
||||
.pattern-grid {
|
||||
background-image: linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
|
||||
linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
|
||||
background-size: 20px 20px;
|
||||
background-position: center center;
|
||||
}
|
||||
|
||||
/* 确保Canvas元素占满容器 */
|
||||
canvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* 自定义按钮反馈效果 */
|
||||
button:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
/* 卡片悬停效果增强 */
|
||||
div[class*="bg-slate-800/60"] {
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
div[class*="bg-slate-800/60"]:hover {
|
||||
box-shadow: 0 0 15px rgba(59, 130, 246, 0.1);
|
||||
}
|
||||
|
||||
/* 输入框焦点效果 */
|
||||
input:focus, textarea:focus {
|
||||
box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.5);
|
||||
}
|
||||
|
||||
/* 列表项悬停效果 */
|
||||
div[class*="cursor-pointer"] {
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
div[class*="cursor-pointer"]:hover {
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
/* 平滑滚动 */
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
/* 状态徽章样式优化 */
|
||||
span[class*="rounded-full"][class*="text-xs"] {
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
span[class*="rounded-full"][class*="text-xs"]:hover {
|
||||
transform: scale(1.05);
|
||||
}
|
894
apps/web-antd/src/views/cockpit/security/index.vue
Normal file
@@ -0,0 +1,894 @@
|
||||
<template>
|
||||
<div class="min-h-screen bg-slate-900 text-slate-100 flex flex-col overflow-hidden relative">
|
||||
<!-- 背景动态效果 -->
|
||||
<div class="absolute inset-0 bg-[radial-gradient(circle_at_center,rgba(59,130,246,0.15)_0,rgba(15,23,42,0)_70%)] pointer-events-none"></div>
|
||||
<div class="absolute inset-0 bg-grid pattern-grid pointer-events-none"></div>
|
||||
|
||||
<!-- 顶部标题区域 -->
|
||||
<header class="bg-slate-800/80 backdrop-blur-sm border-b border-slate-700 py-3 px-6 flex justify-between items-center z-10">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="bg-blue-600 rounded-lg w-10 h-10 flex items-center justify-center shadow-lg shadow-blue-600/20">
|
||||
<i class="fa fa-shield text-xl"></i>
|
||||
</div>
|
||||
<h1 class="text-2xl font-bold tracking-wide text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-cyan-300">
|
||||
预警监控指挥系统
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-6">
|
||||
<div class="flex items-center gap-2 text-slate-300">
|
||||
<i class="fa fa-clock-o"></i>
|
||||
<span>{{ currentTime }}</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-2 text-slate-300">
|
||||
<i class="fa fa-refresh"></i>
|
||||
<span>数据更新于: {{ currentTime }}</span>
|
||||
</div>
|
||||
<!-- <button class="bg-blue-600/20 hover:bg-blue-600/30 text-blue-300 px-4 py-2 rounded-lg transition-all duration-300 flex items-center gap-2 transform hover:scale-105">-->
|
||||
<!-- <i class="fa fa-download"></i>-->
|
||||
<!-- <span>导出报告</span>-->
|
||||
<!-- </button>-->
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- 主内容区域 -->
|
||||
<main class="flex-1 flex overflow-hidden p-4 gap-4">
|
||||
<!-- 左侧预警列表区域 -->
|
||||
<section class="w-1/4 flex flex-col gap-4">
|
||||
<!-- 预警分类统计 -->
|
||||
<div class="bg-slate-800/60 backdrop-blur-sm rounded-xl p-4 border border-slate-700/50 shadow-lg transform transition-all duration-300 hover:shadow-blue-500/10 hover:border-blue-500/20">
|
||||
<h2 class="text-lg font-semibold mb-3 flex items-center">
|
||||
<i class="fa fa-tags text-blue-400 mr-2"></i>
|
||||
预警分类统计
|
||||
</h2>
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<div class="bg-red-600/10 border border-red-500/30 rounded-lg p-3 transform transition-all duration-300 hover:scale-105 hover:shadow-lg hover:shadow-red-500/10">
|
||||
<div class="text-sm text-red-300">紧急预警</div>
|
||||
<div class="text-2xl font-bold text-red-400 mt-1 counter-animation">{{ stats.emergency }}</div>
|
||||
</div>
|
||||
<div class="bg-orange-600/10 border border-orange-500/30 rounded-lg p-3 transform transition-all duration-300 hover:scale-105 hover:shadow-lg hover:shadow-orange-500/10">
|
||||
<div class="text-sm text-orange-300">重要预警</div>
|
||||
<div class="text-2xl font-bold text-orange-400 mt-1 counter-animation">{{ stats.important }}</div>
|
||||
</div>
|
||||
<div class="bg-yellow-600/10 border border-yellow-500/30 rounded-lg p-3 transform transition-all duration-300 hover:scale-105 hover:shadow-lg hover:shadow-yellow-500/10">
|
||||
<div class="text-sm text-yellow-300">一般预警</div>
|
||||
<div class="text-2xl font-bold text-yellow-400 mt-1 counter-animation">{{ stats.normal }}</div>
|
||||
</div>
|
||||
<div class="bg-green-600/10 border border-green-500/30 rounded-lg p-3 transform transition-all duration-300 hover:scale-105 hover:shadow-lg hover:shadow-green-500/10">
|
||||
<div class="text-sm text-green-300">已处理</div>
|
||||
<div class="text-2xl font-bold text-green-400 mt-1 counter-animation">{{ stats.resolved }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 预警类型饼图 -->
|
||||
<!-- <div class="mt-4 h-40">-->
|
||||
<!-- <canvas ref="eventTypePieChart"></canvas>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
|
||||
<!-- 预警列表 -->
|
||||
<div class="bg-slate-800/60 backdrop-blur-sm rounded-xl p-4 border border-slate-700/50 shadow-lg flex-1 overflow-hidden flex flex-col transform transition-all duration-300 hover:shadow-blue-500/10 hover:border-blue-500/20">
|
||||
<div class="flex justify-between items-center mb-3">
|
||||
<h2 class="text-lg font-semibold flex items-center">
|
||||
<i class="fa fa-list-alt text-blue-400 mr-2"></i>
|
||||
预警列表
|
||||
</h2>
|
||||
<div class="relative">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="搜索预警..."
|
||||
class="bg-slate-700/50 text-sm rounded-lg px-3 py-1.5 w-40 focus:outline-none focus:ring-1 focus:ring-blue-500 transition-all duration-300 focus:w-48"
|
||||
>
|
||||
<i class="fa fa-search absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 text-sm"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="overflow-y-auto flex-1 scrollbar-thin scrollbar-thumb-slate-700 scrollbar-track-transparent">
|
||||
<div
|
||||
v-for="event in events"
|
||||
:key="event.id"
|
||||
@click="selectEvent(event)"
|
||||
class="p-3 rounded-lg border border-slate-700 mb-2 cursor-pointer transition-all duration-200 hover:border-blue-500/50 hover:bg-slate-700/30 flex items-center gap-3 transform hover:translate-x-1"
|
||||
:class="{ 'bg-blue-600/20 border-blue-500/50': selectedEvent?.id === event.id }"
|
||||
>
|
||||
<div class="w-2 h-2 rounded-full" :class="eventStatusColor(event.status)"></div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="font-medium text-sm truncate">{{ event.title }}</div>
|
||||
<div class="text-xs text-slate-400 mt-0.5">{{ event.location }} · {{ formatTime(event.time) }}</div>
|
||||
</div>
|
||||
<span class="text-xs px-2 py-0.5 rounded-full" :class="eventStatusBadgeClass(event.status)">
|
||||
{{ eventStatusText(event.status) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 中间地图区域 -->
|
||||
<section class="flex-1 flex flex-col gap-4">
|
||||
<div class="bg-slate-800/60 backdrop-blur-sm rounded-xl p-4 border border-slate-700/50 shadow-lg flex-1 relative overflow-hidden transform transition-all duration-300 hover:shadow-blue-500/10 hover:border-blue-500/20">
|
||||
<h2 class="text-lg font-semibold mb-3 flex items-center relative z-10">
|
||||
<i class="fa fa-map-marker text-blue-400 mr-2"></i>
|
||||
预警分布地图
|
||||
</h2>
|
||||
|
||||
<!-- 模拟地图 -->
|
||||
<div class="absolute inset-0 bg-slate-900/50 rounded-lg overflow-hidden">
|
||||
<div class="w-full h-full bg-[url('https://picsum.photos/id/1015/1200/800')] opacity-20 bg-cover bg-center"></div>
|
||||
|
||||
<!-- 网格线 -->
|
||||
<div class="absolute inset-0 grid grid-cols-8 grid-rows-6">
|
||||
<div v-for="i in 48" :key="i" class="border border-slate-700/30"></div>
|
||||
</div>
|
||||
|
||||
<!-- 预警标记点 -->
|
||||
<div
|
||||
v-for="event in events"
|
||||
:key="event.id"
|
||||
:style="{ left: `${event.position.x}%`, top: `${event.position.y}%` }"
|
||||
class="absolute transform -translate-x-1/2 -translate-y-1/2 cursor-pointer group"
|
||||
@click="selectEvent(event)"
|
||||
>
|
||||
<div
|
||||
class="w-3 h-3 rounded-full"
|
||||
:class="eventStatusColor(event.status)"
|
||||
></div>
|
||||
<div class="absolute -top-10 left-1/2 transform -translate-x-1/2 bg-slate-800 px-2 py-1 rounded text-xs opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap z-10">
|
||||
{{ event.title }}
|
||||
</div>
|
||||
<div
|
||||
class="absolute w-6 h-6 rounded-full animate-ping"
|
||||
:class="eventStatusPingClass(event.status)"
|
||||
style="animation-duration: 2s"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
<!-- 选中预警的高亮 -->
|
||||
<div
|
||||
v-if="selectedEvent"
|
||||
:style="{ left: `${selectedEvent.position.x}%`, top: `${selectedEvent.position.y}%` }"
|
||||
class="absolute transform -translate-x-1/2 -translate-y-1/2"
|
||||
>
|
||||
<div class="w-4 h-4 rounded-full bg-blue-500 border-2 border-white shadow-lg"></div>
|
||||
<div class="absolute w-8 h-8 rounded-full border-2 border-blue-500 animate-ping opacity-75" style="animation-duration: 1.5s"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 地图控制 -->
|
||||
<div class="absolute bottom-4 right-4 flex flex-col gap-2 z-10">
|
||||
<button class="bg-slate-800/80 hover:bg-slate-700 w-8 h-8 rounded-lg flex items-center justify-center transition-all duration-300 hover:scale-110">
|
||||
<i class="fa fa-plus text-sm"></i>
|
||||
</button>
|
||||
<button class="bg-slate-800/80 hover:bg-slate-700 w-8 h-8 rounded-lg flex items-center justify-center transition-all duration-300 hover:scale-110">
|
||||
<i class="fa fa-minus text-sm"></i>
|
||||
</button>
|
||||
<button class="bg-slate-800/80 hover:bg-slate-700 w-8 h-8 rounded-lg flex items-center justify-center transition-all duration-300 hover:scale-110">
|
||||
<i class="fa fa-location-arrow text-sm"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 处理时间和图表区域 -->
|
||||
<div class="bg-slate-800/60 backdrop-blur-sm rounded-xl p-4 border border-slate-700/50 shadow-lg h-64 transform transition-all duration-300 hover:shadow-blue-500/10 hover:border-blue-500/20">
|
||||
<h2 class="text-lg font-semibold mb-3 flex items-center">
|
||||
<i class="fa fa-line-chart text-blue-400 mr-2"></i>
|
||||
预警处理数据分析
|
||||
</h2>
|
||||
<div class="grid grid-cols-2 gap-4 h-48">
|
||||
<!-- 处理时间趋势折线图 -->
|
||||
<div>
|
||||
<h3 class="text-sm text-slate-300 mb-2">平均处理时间(分钟)</h3>
|
||||
<div class="h-36">
|
||||
<canvas ref="processingTimeChart"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 每日预警数量柱状图 -->
|
||||
<div>
|
||||
<h3 class="text-sm text-slate-300 mb-2">每日预警数量</h3>
|
||||
<div class="h-36">
|
||||
<canvas ref="dailyEventsChart"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 右侧处理状态和操作 -->
|
||||
<section class="w-1/4 flex flex-col gap-4">
|
||||
<!-- 预警详情 -->
|
||||
<div class="bg-slate-800/60 backdrop-blur-sm rounded-xl p-4 border border-slate-700/50 shadow-lg transform transition-all duration-300 hover:shadow-blue-500/10 hover:border-blue-500/20">
|
||||
<h2 class="text-lg font-semibold mb-3 flex items-center">
|
||||
<i class="fa fa-info-circle text-blue-400 mr-2"></i>
|
||||
预警详情
|
||||
</h2>
|
||||
|
||||
<div v-if="selectedEvent" class="space-y-3 animate-fadeIn">
|
||||
<div>
|
||||
<div class="text-xs text-slate-400">预警标题</div>
|
||||
<div class="font-medium">{{ selectedEvent.title }}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-xs text-slate-400">预警类型</div>
|
||||
<div class="font-medium">{{ selectedEvent.type }}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-xs text-slate-400">发生时间</div>
|
||||
<div class="font-medium">{{ formatDateTime(selectedEvent.time) }}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-xs text-slate-400">位置信息</div>
|
||||
<div class="font-medium">{{ selectedEvent.location }}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-xs text-slate-400">预警描述</div>
|
||||
<div class="text-sm text-slate-300 bg-slate-700/30 p-2 rounded-lg mt-1 hover:bg-slate-700/50 transition-colors duration-300">
|
||||
{{ selectedEvent.description }}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-xs text-slate-400">当前状态</div>
|
||||
<div class="flex items-center mt-1">
|
||||
<span class="text-sm px-2 py-0.5 rounded-full" :class="eventStatusBadgeClass(selectedEvent.status)">
|
||||
{{ eventStatusText(selectedEvent.status) }}
|
||||
</span>
|
||||
<span class="ml-2 text-xs text-slate-400">
|
||||
更新于: {{ formatTime(selectedEvent.updateTime) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else class="flex items-center justify-center h-48 text-slate-500">
|
||||
<div class="text-center">
|
||||
<i class="fa fa-hand-pointer-o text-2xl mb-2 animate-pulse"></i>
|
||||
<p>请从左侧列表或地图中选择一个预警</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 处理状态和操作 -->
|
||||
<div class="bg-slate-800/60 backdrop-blur-sm rounded-xl p-4 border border-slate-700/50 shadow-lg flex-1 flex flex-col transform transition-all duration-300 hover:shadow-blue-500/10 hover:border-blue-500/20">
|
||||
<h2 class="text-lg font-semibold mb-3 flex items-center">
|
||||
<i class="fa fa-cogs text-blue-400 mr-2"></i>
|
||||
处理操作
|
||||
</h2>
|
||||
|
||||
<div v-if="selectedEvent" class="flex-1 flex flex-col animate-fadeIn">
|
||||
<!-- 处理进度 -->
|
||||
<div class="mb-4">
|
||||
<div class="text-sm font-medium mb-2">处理进度</div>
|
||||
<div class="relative pt-1">
|
||||
<div class="flex mb-2 items-center justify-between">
|
||||
<div>
|
||||
<span class="text-xs font-semibold inline-block py-1 px-2 uppercase rounded-full text-blue-600 bg-blue-200/10">
|
||||
处理进度
|
||||
</span>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<span class="text-xs font-semibold inline-block text-blue-400">
|
||||
{{ processingProgress }}%
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overflow-hidden h-2 mb-4 text-xs flex rounded bg-slate-700/50">
|
||||
<div
|
||||
:style="{ width: `${processingProgress}%` }"
|
||||
class="shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-gradient-to-r from-blue-500 to-cyan-400 transition-all duration-1000 ease-out"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 处理记录 -->
|
||||
<div class="mb-4 flex-1 overflow-y-auto scrollbar-thin scrollbar-thumb-slate-700">
|
||||
<div class="text-sm font-medium mb-2">处理记录</div>
|
||||
<div class="space-y-3">
|
||||
<div v-for="record in selectedEvent.processingRecords" :key="record.id" class="flex gap-2 transform transition-all duration-300 hover:translate-x-1">
|
||||
<div class="mt-0.5 w-6 h-6 rounded-full bg-slate-700 flex items-center justify-center flex-shrink-0">
|
||||
<i class="fa fa-check text-xs text-slate-300"></i>
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-sm">{{ record.action }}</div>
|
||||
<div class="text-xs text-slate-400 mt-0.5">
|
||||
{{ record.user }} · {{ formatTime(record.time) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<div class="space-y-2 pt-2 border-t border-slate-700/50">
|
||||
<div class="flex gap-2">
|
||||
<button
|
||||
class="flex-1 bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg transition-all duration-300 flex items-center justify-center gap-1 text-sm transform hover:scale-[1.02] active:scale-[0.98]"
|
||||
:disabled="selectedEvent.status === 'resolved'"
|
||||
@click="markAsResolved"
|
||||
>
|
||||
<i class="fa fa-check"></i>
|
||||
<span>标记为已处理</span>
|
||||
</button>
|
||||
<button class="bg-slate-700 hover:bg-slate-600 text-white p-2 rounded-lg transition-all duration-300 transform hover:scale-110 active:scale-90">
|
||||
<i class="fa fa-comments"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-2">
|
||||
<button class="flex-1 bg-slate-700 hover:bg-slate-600 text-white px-4 py-2 rounded-lg transition-all duration-300 flex items-center justify-center gap-1 text-sm transform hover:scale-[1.02] active:scale-[0.98]">
|
||||
<i class="fa fa-user-plus"></i>
|
||||
<span>指派处理人</span>
|
||||
</button>
|
||||
<button class="flex-1 bg-slate-700 hover:bg-slate-600 text-white px-4 py-2 rounded-lg transition-all duration-300 flex items-center justify-center gap-1 text-sm transform hover:scale-[1.02] active:scale-[0.98]">
|
||||
<i class="fa fa-file-text-o"></i>
|
||||
<span>生成报告</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<textarea
|
||||
placeholder="输入处理备注..."
|
||||
class="w-full bg-slate-700/50 border border-slate-600 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500 resize-none h-16 transition-all duration-300 focus:border-blue-500/50"
|
||||
v-model="processingNote"
|
||||
></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else class="flex-1 flex items-center justify-center text-slate-500">
|
||||
<div class="text-center">
|
||||
<i class="fa fa-wrench text-2xl mb-2 animate-pulse"></i>
|
||||
<p>选择预警后显示处理操作</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, computed } from 'vue';
|
||||
import {useNotifyStore } from '#/store';
|
||||
// 处理备注
|
||||
const processingNote = ref('');
|
||||
|
||||
const list=useNotifyStore().sseList;
|
||||
list.map(item=>{
|
||||
|
||||
})
|
||||
// 模拟预警数据
|
||||
const events = ref([
|
||||
{
|
||||
id: 1,
|
||||
title: "设备故障报警",
|
||||
type: "设备故障",
|
||||
status: "emergency",
|
||||
time: "2023-10-15T08:23:45",
|
||||
updateTime: "2023-10-15T08:45:12",
|
||||
location: "一号厂房A区",
|
||||
description: "流水线三号设备突然停机,显示电机故障代码E109,需要紧急处理以避免生产线中断。",
|
||||
position: { x: 35, y: 40 },
|
||||
processingRecords: [
|
||||
{ id: 1, action: "接收到报警信息", user: "系统自动", time: "2023-10-15T08:23:45" },
|
||||
{ id: 2, action: "指派给维修组", user: "张经理", time: "2023-10-15T08:25:10" }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "安全门异常开启",
|
||||
type: "安全预警",
|
||||
status: "important",
|
||||
time: "2023-10-15T07:15:30",
|
||||
updateTime: "2023-10-15T07:30:22",
|
||||
location: "二号仓库入口",
|
||||
description: "非工作时间安全门被异常开启,系统已自动记录并触发警报,需检查是否有异常进入。",
|
||||
position: { x: 65, y: 30 },
|
||||
processingRecords: [
|
||||
{ id: 1, action: "接收到报警信息", user: "系统自动", time: "2023-10-15T07:15:30" },
|
||||
{ id: 2, action: "安保人员已前往查看", user: "李主管", time: "2023-10-15T07:17:05" },
|
||||
{ id: 3, action: "初步检查未发现异常", user: "王保安", time: "2023-10-15T07:30:22" }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: "温湿度超标",
|
||||
type: "环境异常",
|
||||
status: "normal",
|
||||
time: "2023-10-15T09:40:12",
|
||||
updateTime: "2023-10-15T09:40:12",
|
||||
location: "实验室B区",
|
||||
description: "实验室B区温湿度超出正常范围,当前温度26℃,湿度65%,需调整空调系统。",
|
||||
position: { x: 45, y: 60 },
|
||||
processingRecords: [
|
||||
{ id: 1, action: "接收到报警信息", user: "系统自动", time: "2023-10-15T09:40:12" }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: "物料短缺预警",
|
||||
type: "物料管理",
|
||||
status: "normal",
|
||||
time: "2023-10-15T10:15:22",
|
||||
updateTime: "2023-10-15T10:15:22",
|
||||
location: "原料仓库",
|
||||
description: "A类原材料库存低于警戒线,剩余数量约可维持2天生产,请及时采购补充。",
|
||||
position: { x: 25, y: 70 },
|
||||
processingRecords: [
|
||||
{ id: 1, action: "系统自动发出预警", user: "系统自动", time: "2023-10-15T10:15:22" }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
title: "网络中断恢复",
|
||||
type: "网络问题",
|
||||
status: "resolved",
|
||||
time: "2023-10-15T06:30:15",
|
||||
updateTime: "2023-10-15T07:05:33",
|
||||
location: "三号车间",
|
||||
description: "三号车间网络中断,影响设备数据上传,技术人员已修复,网络恢复正常。",
|
||||
position: { x: 75, y: 55 },
|
||||
processingRecords: [
|
||||
{ id: 1, action: "检测到网络中断", user: "系统自动", time: "2023-10-15T06:30:15" },
|
||||
{ id: 2, action: "技术人员前往处理", user: "赵主管", time: "2023-10-15T06:35:40" },
|
||||
{ id: 3, action: "网络已恢复正常", user: "孙工", time: "2023-10-15T07:05:33" }
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
||||
// 选中的预警
|
||||
const selectedEvent = ref(null);
|
||||
|
||||
// 统计数据
|
||||
const stats = ref({
|
||||
emergency: 1,
|
||||
important: 1,
|
||||
normal: 2,
|
||||
resolved: 1
|
||||
});
|
||||
|
||||
// 当前时间和最后更新时间
|
||||
const currentTime = ref("");
|
||||
const lastUpdateTime = ref("2023-10-15 10:30:45");
|
||||
|
||||
// 图表引用
|
||||
const eventTypePieChart = ref(null);
|
||||
const processingTimeChart = ref(null);
|
||||
const dailyEventsChart = ref(null);
|
||||
|
||||
// 处理进度(根据预警状态计算)
|
||||
const processingProgress = computed(() => {
|
||||
if (!selectedEvent.value) return 0;
|
||||
|
||||
switch(selectedEvent.value.status) {
|
||||
case 'emergency': return 30;
|
||||
case 'important': return 50;
|
||||
case 'normal': return 20;
|
||||
case 'resolved': return 100;
|
||||
default: return 0;
|
||||
}
|
||||
});
|
||||
|
||||
// 选择预警
|
||||
const selectEvent = (event) => {
|
||||
selectedEvent.value = event;
|
||||
};
|
||||
|
||||
// 标记为已处理
|
||||
const markAsResolved = () => {
|
||||
if (selectedEvent.value) {
|
||||
// 更新预警状态
|
||||
selectedEvent.value.status = 'resolved';
|
||||
selectedEvent.value.updateTime = new Date().toISOString();
|
||||
|
||||
// 添加处理记录
|
||||
if (processingNote.value.trim()) {
|
||||
selectedEvent.value.processingRecords.push({
|
||||
id: selectedEvent.value.processingRecords.length + 1,
|
||||
action: `标记为已处理: ${processingNote.value.trim()}`,
|
||||
user: "当前操作员",
|
||||
time: new Date().toISOString()
|
||||
});
|
||||
processingNote.value = '';
|
||||
} else {
|
||||
selectedEvent.value.processingRecords.push({
|
||||
id: selectedEvent.value.processingRecords.length + 1,
|
||||
action: "标记为已处理",
|
||||
user: "当前操作员",
|
||||
time: new Date().toISOString()
|
||||
});
|
||||
}
|
||||
|
||||
// 更新统计数据
|
||||
stats.value.resolved++;
|
||||
if (stats.value.emergency > 0) stats.value.emergency--;
|
||||
else if (stats.value.important > 0) stats.value.important--;
|
||||
else if (stats.value.normal > 0) stats.value.normal--;
|
||||
|
||||
// 重新绘制图表
|
||||
drawAllCharts();
|
||||
}
|
||||
};
|
||||
|
||||
// 格式化时间
|
||||
const formatTime = (timeString) => {
|
||||
const date = new Date(timeString);
|
||||
return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
|
||||
};
|
||||
|
||||
// 格式化日期时间
|
||||
const formatDateTime = (timeString) => {
|
||||
const date = new Date(timeString);
|
||||
return date.toLocaleString();
|
||||
};
|
||||
|
||||
// 预警状态文本
|
||||
const eventStatusText = (status) => {
|
||||
const statusMap = {
|
||||
'emergency': '紧急',
|
||||
'important': '重要',
|
||||
'normal': '一般',
|
||||
'resolved': '已处理'
|
||||
};
|
||||
return statusMap[status] || '未知';
|
||||
};
|
||||
|
||||
// 预警状态颜色
|
||||
const eventStatusColor = (status) => {
|
||||
const colorMap = {
|
||||
'emergency': 'bg-red-500',
|
||||
'important': 'bg-orange-500',
|
||||
'normal': 'bg-yellow-500',
|
||||
'resolved': 'bg-green-500'
|
||||
};
|
||||
return colorMap[status] || 'bg-slate-500';
|
||||
};
|
||||
|
||||
// 预警状态标记颜色(脉冲效果)
|
||||
const eventStatusPingClass = (status) => {
|
||||
const colorMap = {
|
||||
'emergency': 'bg-red-500/30',
|
||||
'important': 'bg-orange-500/30',
|
||||
'normal': 'bg-yellow-500/30',
|
||||
'resolved': 'bg-green-500/30'
|
||||
};
|
||||
return colorMap[status] || 'bg-slate-500/30';
|
||||
};
|
||||
|
||||
// 预警状态徽章样式
|
||||
const eventStatusBadgeClass = (status) => {
|
||||
const classMap = {
|
||||
'emergency': 'bg-red-500/20 text-red-400 border border-red-500/30',
|
||||
'important': 'bg-orange-500/20 text-orange-400 border border-orange-500/30',
|
||||
'normal': 'bg-yellow-500/20 text-yellow-400 border border-yellow-500/30',
|
||||
'resolved': 'bg-green-500/20 text-green-400 border border-green-500/30'
|
||||
};
|
||||
return classMap[status] || 'bg-slate-500/20 text-slate-400 border border-slate-500/30';
|
||||
};
|
||||
|
||||
// 更新当前时间
|
||||
const updateCurrentTime = () => {
|
||||
const now = new Date();
|
||||
currentTime.value = now.toLocaleString();
|
||||
};
|
||||
|
||||
// 绘制饼图 - 使用原生Canvas API
|
||||
const drawPieChart = (canvas, data) => {
|
||||
if (!canvas) return;
|
||||
|
||||
const ctx = canvas.getContext('2d');
|
||||
const width = canvas.width;
|
||||
const height = canvas.height;
|
||||
|
||||
// 清除画布
|
||||
ctx.clearRect(0, 0, width, height);
|
||||
|
||||
const centerX = width / 2;
|
||||
const centerY = height / 2;
|
||||
const radius = Math.min(width, height) / 3;
|
||||
|
||||
const total = data.values.reduce((sum, value) => sum + value, 0);
|
||||
let startAngle = 0;
|
||||
|
||||
data.values.forEach((value, index) => {
|
||||
const sliceAngle = 2 * Math.PI * (value / total);
|
||||
const color = data.colors[index];
|
||||
|
||||
// 绘制扇形
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(centerX, centerY);
|
||||
ctx.arc(centerX, centerY, radius, startAngle, startAngle + sliceAngle);
|
||||
ctx.closePath();
|
||||
ctx.fillStyle = color;
|
||||
ctx.fill();
|
||||
|
||||
// 添加边框
|
||||
ctx.strokeStyle = 'rgba(30, 41, 59, 0.8)';
|
||||
ctx.lineWidth = 1;
|
||||
ctx.stroke();
|
||||
|
||||
// 计算标签位置
|
||||
const labelAngle = startAngle + sliceAngle / 2;
|
||||
const labelRadius = radius + 15;
|
||||
const labelX = centerX + Math.cos(labelAngle) * labelRadius;
|
||||
const labelY = centerY + Math.sin(labelAngle) * labelRadius;
|
||||
|
||||
// 绘制标签
|
||||
ctx.fillStyle = '#e2e8f0';
|
||||
ctx.font = '10px sans-serif';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.fillText(`${data.labels[index]}: ${value}`, labelX, labelY);
|
||||
|
||||
startAngle += sliceAngle;
|
||||
});
|
||||
};
|
||||
|
||||
// 绘制折线图 - 使用原生Canvas API
|
||||
const drawLineChart = (canvas, data) => {
|
||||
if (!canvas) return;
|
||||
|
||||
const ctx = canvas.getContext('2d');
|
||||
const width = canvas.width;
|
||||
const height = canvas.height;
|
||||
|
||||
// 清除画布
|
||||
ctx.clearRect(0, 0, width, height);
|
||||
|
||||
// 边距
|
||||
const margin = { top: 10, right: 10, bottom: 20, left: 30 };
|
||||
const chartWidth = width - margin.left - margin.right;
|
||||
const chartHeight = height - margin.top - margin.bottom;
|
||||
|
||||
// 找到数据范围
|
||||
const maxValue = Math.max(...data.values);
|
||||
const minValue = 0;
|
||||
const valueRange = maxValue - minValue;
|
||||
|
||||
// 计算X轴和Y轴的比例
|
||||
const xScale = chartWidth / (data.values.length - 1);
|
||||
const yScale = chartHeight / valueRange;
|
||||
|
||||
// 绘制坐标轴
|
||||
ctx.beginPath();
|
||||
ctx.strokeStyle = 'rgba(148, 163, 184, 0.5)';
|
||||
ctx.lineWidth = 1;
|
||||
|
||||
// X轴
|
||||
ctx.moveTo(margin.left, margin.top + chartHeight);
|
||||
ctx.lineTo(margin.left + chartWidth, margin.top + chartHeight);
|
||||
ctx.stroke();
|
||||
|
||||
// Y轴
|
||||
ctx.moveTo(margin.left, margin.top);
|
||||
ctx.lineTo(margin.left, margin.top + chartHeight);
|
||||
ctx.stroke();
|
||||
|
||||
// 绘制网格线
|
||||
ctx.strokeStyle = 'rgba(148, 163, 184, 0.1)';
|
||||
|
||||
// 水平网格线
|
||||
const yGridCount = 5;
|
||||
for (let i = 0; i <= yGridCount; i++) {
|
||||
const y = margin.top + chartHeight - (i * chartHeight / yGridCount);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(margin.left, y);
|
||||
ctx.lineTo(margin.left + chartWidth, y);
|
||||
ctx.stroke();
|
||||
|
||||
// Y轴刻度
|
||||
ctx.fillStyle = 'rgba(148, 163, 184, 0.7)';
|
||||
ctx.font = '8px sans-serif';
|
||||
ctx.textAlign = 'right';
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.fillText(Math.round(i * valueRange / yGridCount), margin.left - 5, y);
|
||||
}
|
||||
|
||||
// 绘制数据线
|
||||
ctx.beginPath();
|
||||
data.values.forEach((value, index) => {
|
||||
const x = margin.left + index * xScale;
|
||||
const y = margin.top + chartHeight - (value - minValue) * yScale;
|
||||
|
||||
if (index === 0) {
|
||||
ctx.moveTo(x, y);
|
||||
} else {
|
||||
ctx.lineTo(x, y);
|
||||
}
|
||||
|
||||
// 绘制数据点
|
||||
ctx.fillStyle = data.lineColor;
|
||||
ctx.beginPath();
|
||||
ctx.arc(x, y, 3, 0, 2 * Math.PI);
|
||||
ctx.fill();
|
||||
|
||||
// 绘制白色边框
|
||||
ctx.strokeStyle = '#fff';
|
||||
ctx.lineWidth = 1;
|
||||
ctx.stroke();
|
||||
});
|
||||
|
||||
// 绘制线条
|
||||
ctx.strokeStyle = data.lineColor;
|
||||
ctx.lineWidth = 2;
|
||||
ctx.stroke();
|
||||
|
||||
// 填充区域
|
||||
ctx.lineTo(margin.left + (data.values.length - 1) * xScale, margin.top + chartHeight);
|
||||
ctx.lineTo(margin.left, margin.top + chartHeight);
|
||||
ctx.closePath();
|
||||
ctx.fillStyle = data.areaColor;
|
||||
ctx.fill();
|
||||
|
||||
// 绘制X轴标签
|
||||
data.labels.forEach((label, index) => {
|
||||
const x = margin.left + index * xScale;
|
||||
ctx.fillStyle = 'rgba(148, 163, 184, 0.7)';
|
||||
ctx.font = '8px sans-serif';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'top';
|
||||
ctx.fillText(label, x, margin.top + chartHeight + 5);
|
||||
});
|
||||
};
|
||||
|
||||
// 绘制柱状图 - 使用原生Canvas API
|
||||
const drawBarChart = (canvas, data) => {
|
||||
if (!canvas) return;
|
||||
|
||||
const ctx = canvas.getContext('2d');
|
||||
const width = canvas.width;
|
||||
const height = canvas.height;
|
||||
|
||||
// 清除画布
|
||||
ctx.clearRect(0, 0, width, height);
|
||||
|
||||
// 边距
|
||||
const margin = { top: 10, right: 10, bottom: 20, left: 30 };
|
||||
const chartWidth = width - margin.left - margin.right;
|
||||
const chartHeight = height - margin.top - margin.bottom;
|
||||
|
||||
// 找到数据范围
|
||||
const maxValue = Math.max(...data.values) * 1.1; // 留10%的余量
|
||||
const minValue = 0;
|
||||
const valueRange = maxValue - minValue;
|
||||
|
||||
// 计算X轴和Y轴的比例
|
||||
const barWidth = chartWidth / (data.values.length * 2);
|
||||
const xScale = chartWidth / (data.values.length);
|
||||
const yScale = chartHeight / valueRange;
|
||||
|
||||
// 绘制坐标轴
|
||||
ctx.beginPath();
|
||||
ctx.strokeStyle = 'rgba(148, 163, 184, 0.5)';
|
||||
ctx.lineWidth = 1;
|
||||
|
||||
// X轴
|
||||
ctx.moveTo(margin.left, margin.top + chartHeight);
|
||||
ctx.lineTo(margin.left + chartWidth, margin.top + chartHeight);
|
||||
ctx.stroke();
|
||||
|
||||
// Y轴
|
||||
ctx.moveTo(margin.left, margin.top);
|
||||
ctx.lineTo(margin.left, margin.top + chartHeight);
|
||||
ctx.stroke();
|
||||
|
||||
// 绘制网格线
|
||||
ctx.strokeStyle = 'rgba(148, 163, 184, 0.1)';
|
||||
|
||||
// 水平网格线
|
||||
const yGridCount = 5;
|
||||
for (let i = 0; i <= yGridCount; i++) {
|
||||
const y = margin.top + chartHeight - (i * chartHeight / yGridCount);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(margin.left, y);
|
||||
ctx.lineTo(margin.left + chartWidth, y);
|
||||
ctx.stroke();
|
||||
|
||||
// Y轴刻度
|
||||
ctx.fillStyle = 'rgba(148, 163, 184, 0.7)';
|
||||
ctx.font = '8px sans-serif';
|
||||
ctx.textAlign = 'right';
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.fillText(Math.round(i * valueRange / yGridCount), margin.left - 5, y);
|
||||
}
|
||||
|
||||
// 绘制柱子
|
||||
data.values.forEach((value, index) => {
|
||||
const x = margin.left + index * xScale + (xScale - barWidth) / 2;
|
||||
const barHeight = (value - minValue) * yScale;
|
||||
const y = margin.top + chartHeight - barHeight;
|
||||
|
||||
// 绘制柱子
|
||||
ctx.fillStyle = data.barColor;
|
||||
ctx.fillRect(x, y, barWidth, barHeight);
|
||||
|
||||
// 绘制柱子顶部的值
|
||||
ctx.fillStyle = 'rgba(226, 232, 240, 0.9)';
|
||||
ctx.font = '8px sans-serif';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'bottom';
|
||||
ctx.fillText(value, x + barWidth / 2, y - 3);
|
||||
});
|
||||
|
||||
// 绘制X轴标签
|
||||
data.labels.forEach((label, index) => {
|
||||
const x = margin.left + index * xScale + xScale / 2;
|
||||
ctx.fillStyle = 'rgba(148, 163, 184, 0.7)';
|
||||
ctx.font = '8px sans-serif';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'top';
|
||||
ctx.fillText(label, x, margin.top + chartHeight + 5);
|
||||
});
|
||||
};
|
||||
|
||||
// 绘制所有图表
|
||||
const drawAllCharts = () => {
|
||||
// 设置Canvas尺寸(考虑高DPI屏幕)
|
||||
const setupCanvas = (canvas) => {
|
||||
if (!canvas) return;
|
||||
const dpr = window.devicePixelRatio || 1;
|
||||
const rect = canvas.getBoundingClientRect();
|
||||
canvas.width = rect.width * dpr;
|
||||
canvas.height = rect.height * dpr;
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.scale(dpr, dpr);
|
||||
canvas.style.width = `${rect.width}px`;
|
||||
canvas.style.height = `${rect.height}px`;
|
||||
};
|
||||
|
||||
// 预警类型饼图数据
|
||||
const pieData = {
|
||||
labels: ['设备故障', '安全预警', '环境异常', '物料管理', '网络问题'],
|
||||
values: [1, 1, 1, 1, 1],
|
||||
colors: [
|
||||
'#3b82f6', // 蓝色
|
||||
'#f97316', // 橙色
|
||||
'#eab308', // 黄色
|
||||
'#10b981', // 绿色
|
||||
'#8b5cf6' // 紫色
|
||||
]
|
||||
};
|
||||
|
||||
// 处理时间折线图数据
|
||||
const lineData = {
|
||||
labels: ['1日', '2日', '3日', '4日', '5日', '6日', '7日'],
|
||||
values: [25, 32, 28, 45, 36, 22, 30],
|
||||
lineColor: '#3b82f6',
|
||||
areaColor: 'rgba(59, 130, 246, 0.1)'
|
||||
};
|
||||
|
||||
// 每日预警数量柱状图数据
|
||||
const barData = {
|
||||
labels: ['1日', '2日', '3日', '4日', '5日', '6日', '7日'],
|
||||
values: [8, 12, 5, 15, 7, 10, 5],
|
||||
barColor: '#06b6d4'
|
||||
};
|
||||
|
||||
// 设置并绘制图表
|
||||
// setupCanvas(eventTypePieChart.value);
|
||||
setupCanvas(processingTimeChart.value);
|
||||
setupCanvas(dailyEventsChart.value);
|
||||
|
||||
// drawPieChart(eventTypePieChart.value, pieData);
|
||||
drawLineChart(processingTimeChart.value, lineData);
|
||||
drawBarChart(dailyEventsChart.value, barData);
|
||||
};
|
||||
|
||||
// 页面加载时初始化
|
||||
onMounted(() => {
|
||||
// 默认选择第一个预警
|
||||
if (events.value.length > 0) {
|
||||
selectedEvent.value = events.value[0];
|
||||
}
|
||||
|
||||
// 初始化时间
|
||||
updateCurrentTime();
|
||||
setInterval(updateCurrentTime, 1000);
|
||||
|
||||
// 初始化图表
|
||||
drawAllCharts();
|
||||
|
||||
// 监听窗口大小变化,重新绘制图表
|
||||
window.addEventListener('resize', drawAllCharts);
|
||||
});
|
||||
</script>
|
@@ -26,7 +26,7 @@ onMounted(() => {
|
||||
{ name: '搜索引擎', value: 1048 },
|
||||
{ name: '直接访问', value: 735 },
|
||||
{ name: '邮件营销', value: 580 },
|
||||
{ name: '联盟广告', value: 484 },
|
||||
// { name: '联盟广告', value: 484 },
|
||||
],
|
||||
emphasis: {
|
||||
label: {
|
||||
|
@@ -25,29 +25,29 @@ const overviewItems: AnalysisOverviewItem[] = [
|
||||
icon: SvgCardIcon,
|
||||
title: '用户量',
|
||||
totalTitle: '总用户量',
|
||||
totalValue: 120_000,
|
||||
value: 2000,
|
||||
totalValue: 78,
|
||||
value: 15,
|
||||
},
|
||||
{
|
||||
icon: SvgCakeIcon,
|
||||
title: '访问量',
|
||||
totalTitle: '总访问量',
|
||||
totalValue: 500_000,
|
||||
value: 20_000,
|
||||
totalValue: 2_278,
|
||||
value: 461,
|
||||
},
|
||||
{
|
||||
icon: SvgDownloadIcon,
|
||||
title: '下载量',
|
||||
totalTitle: '总下载量',
|
||||
totalValue: 120_000,
|
||||
value: 8000,
|
||||
totalValue: 17,
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
icon: SvgBellIcon,
|
||||
title: '使用量',
|
||||
totalTitle: '总使用量',
|
||||
totalValue: 50_000,
|
||||
value: 5000,
|
||||
totalValue: 6_652,
|
||||
value: 3_739,
|
||||
},
|
||||
];
|
||||
|
||||
|
@@ -1,20 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import {computed, ref} 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 { type FormSchemaGetter, useVbenForm } from "#/adapter/form";
|
||||
import { applicationAdd, applicationInfo, applicationUpdate } from '#/api/property/assetManage/application';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
import {type FormSchemaGetter, useVbenForm} from "#/adapter/form";
|
||||
import {
|
||||
applicationAdd,
|
||||
applicationInfo,
|
||||
applicationUpdate
|
||||
} from '#/api/property/assetManage/application';
|
||||
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
import { assetTypeselect } from "#/api/property/assetType";
|
||||
import { depotList } from "#/api/property/assetManage/depot";
|
||||
import { suppliersList } from "#/api/property/assetManage/suppliers";
|
||||
import { assetList } from "#/api/property/assetManage/asset";
|
||||
import { userList } from "#/api/system/user";
|
||||
import {modalSchema} from './data';
|
||||
import {assetTypeselect} from "#/api/property/assetType";
|
||||
import {depotList} from "#/api/property/assetManage/depot";
|
||||
import {suppliersList} from "#/api/property/assetManage/suppliers";
|
||||
import {assetList} from "#/api/property/assetManage/asset";
|
||||
import {userList} from "#/api/system/user";
|
||||
import type {AssetVO} from "#/api/property/assetManage/asset/model";
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
@@ -39,7 +44,7 @@ const [BasicForm, formApi] = useVbenForm({
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
const {onBeforeClose, markInitialized, resetInitialized} = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
@@ -48,15 +53,15 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
|
||||
formApi.getValues().then(setupPackageSelect);
|
||||
|
||||
async function upSelectUser(nickName: string){
|
||||
const list=await userList({
|
||||
nickName:nickName,
|
||||
async function upSelectUser(nickName: string) {
|
||||
const list = await userList({
|
||||
nickName: nickName,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const options=list.map(item=>{
|
||||
item.label=item.userName;
|
||||
item.value=item.id;
|
||||
const options = list.map(item => {
|
||||
item.label = item.userName;
|
||||
item.value = item.id;
|
||||
})
|
||||
fromApi.updateSchema([
|
||||
{
|
||||
@@ -71,15 +76,15 @@ async function upSelectUser(nickName: string){
|
||||
]);
|
||||
}
|
||||
|
||||
async function upSelectAssets(assetsName: string){
|
||||
const list=await assetList({
|
||||
assetsName:assetsName,
|
||||
async function upSelectAssets(assetsName: string) {
|
||||
const list = await assetList({
|
||||
assetsName: assetsName,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const options=list.map(item=>{
|
||||
item.label=item.assetsName;
|
||||
item.value=item.id;
|
||||
const options = list.map(item => {
|
||||
item.label = item.assetsName;
|
||||
item.value = item.id;
|
||||
})
|
||||
fromApi.updateSchema([
|
||||
{
|
||||
@@ -94,15 +99,19 @@ async function upSelectAssets(assetsName: string){
|
||||
]);
|
||||
}
|
||||
|
||||
const assetsData = ref<AssetVO[]>([])
|
||||
|
||||
async function setupPackageSelect() {
|
||||
const users = await userList({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 1000,
|
||||
});
|
||||
const assets = await assetList({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 1000,
|
||||
params: {stock: 1} //库存不为0
|
||||
});
|
||||
assetsData.value = assets.rows
|
||||
const options = users.rows.map((item) => ({
|
||||
label: item.nickName,
|
||||
value: item.userId,
|
||||
@@ -121,7 +130,7 @@ async function setupPackageSelect() {
|
||||
},
|
||||
async select(userId) {
|
||||
await upSelectUser(userId);
|
||||
userId=""
|
||||
userId = ""
|
||||
},
|
||||
fieldName: 'userId',
|
||||
},
|
||||
@@ -131,18 +140,31 @@ async function setupPackageSelect() {
|
||||
optionLabelProp: 'label',
|
||||
options: assetOptions,
|
||||
showSearch: true,
|
||||
onChange: async (value: string) => {
|
||||
// 找到选中的服务数据
|
||||
const assetInfo = assetsData.value.find(item => item.id === value);
|
||||
if (assetInfo) {
|
||||
formApi.updateSchema([{
|
||||
componentProps: {
|
||||
max: assetInfo.stock,
|
||||
min: 1
|
||||
},
|
||||
fieldName: 'number',
|
||||
}])
|
||||
}
|
||||
},
|
||||
},
|
||||
async select(assetsId) {
|
||||
await upSelectAssets(assetsId);
|
||||
assetsId=""
|
||||
assetsId = ""
|
||||
},
|
||||
fieldName: 'assetId',
|
||||
},
|
||||
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
@@ -156,7 +178,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
const {id} = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
@@ -172,7 +194,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
const { valid } = await formApi.validate();
|
||||
const {valid} = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
@@ -197,7 +219,7 @@ async function handleClosed() {
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicForm />
|
||||
<BasicForm/>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
|
@@ -2,65 +2,65 @@ import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import { renderDict } from "#/utils/render";
|
||||
import { DictEnum } from '@vben/constants';
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
|
||||
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
// {
|
||||
// component: 'Input',
|
||||
// fieldName: 'assetId',
|
||||
// label: '资产id',
|
||||
// },
|
||||
// {
|
||||
// component: 'Input',
|
||||
// fieldName: 'userId',
|
||||
// label: '领用人id',
|
||||
// },
|
||||
// {
|
||||
// component: 'Input',
|
||||
// fieldName: 'number',
|
||||
// label: '数量',
|
||||
// },
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'assetId',
|
||||
label: '资产id',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'userId',
|
||||
label: '领用人id',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'number',
|
||||
label: '数量',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
component: 'Select',
|
||||
componentProps:{
|
||||
options:getDictOptions(DictEnum.WY_ZCSHZT)
|
||||
},
|
||||
fieldName: 'state',
|
||||
label: '状态',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'acceptanceUserId',
|
||||
label: '审批人id',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'acceptanceTime',
|
||||
label: '审批时间',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'applicationTime',
|
||||
label: '申请时间',
|
||||
label: '审核状态',
|
||||
},
|
||||
// {
|
||||
// component: 'Input',
|
||||
// fieldName: 'acceptanceUserId',
|
||||
// label: '审批人id',
|
||||
// },
|
||||
// {
|
||||
// component: 'DatePicker',
|
||||
// componentProps: {
|
||||
// showTime: true,
|
||||
// format: 'YYYY-MM-DD HH:mm:ss',
|
||||
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
// },
|
||||
// fieldName: 'acceptanceTime',
|
||||
// label: '审批时间',
|
||||
// },
|
||||
// {
|
||||
// component: 'DatePicker',
|
||||
// componentProps: {
|
||||
// showTime: true,
|
||||
// format: 'YYYY-MM-DD HH:mm:ss',
|
||||
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
// },
|
||||
// fieldName: 'applicationTime',
|
||||
// label: '申请时间',
|
||||
// },
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '主键',
|
||||
field: 'id',
|
||||
},
|
||||
{
|
||||
title: '资产',
|
||||
field: 'assetName',
|
||||
@@ -74,7 +74,11 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'number',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
title: '申请时间',
|
||||
field: 'applicationTime',
|
||||
},
|
||||
{
|
||||
title: '审核状态',
|
||||
field: 'state',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
@@ -90,14 +94,6 @@ export const columns: VxeGridProps['columns'] = [
|
||||
title: '审批时间',
|
||||
field: 'acceptanceTime',
|
||||
},
|
||||
{
|
||||
title: '申请时间',
|
||||
field: 'applicationTime',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
field: 'createTime',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
@@ -118,19 +114,25 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '资产id',
|
||||
label: '资产',
|
||||
fieldName: 'assetId',
|
||||
component: 'Select',
|
||||
rules:'selectRequired'
|
||||
},
|
||||
{
|
||||
label: '领用人id',
|
||||
label: '领用人',
|
||||
fieldName: 'userId',
|
||||
component: 'Select',
|
||||
rules:'selectRequired'
|
||||
},
|
||||
{
|
||||
label: '数量',
|
||||
fieldName: 'number',
|
||||
component: 'Input',
|
||||
component: 'InputNumber',
|
||||
componentProps:{
|
||||
min:1,
|
||||
},
|
||||
rules:'required'
|
||||
},
|
||||
// {
|
||||
// label: '状态',
|
||||
|
@@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
import {Page, useVbenModal, type VbenFormProps} from '@vben/common-ui';
|
||||
import {getVxePopupContainer} from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import {Modal, Popconfirm, Space} from 'ant-design-vue';
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
@@ -14,14 +14,15 @@ import {
|
||||
import {
|
||||
applicationExport,
|
||||
applicationList,
|
||||
applicationRemove,
|
||||
applicationRemove, applicationVerified,
|
||||
} from '#/api/property/assetManage/application';
|
||||
import type { ApplicationForm } from '#/api/property/assetManage/application/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
import type {ApplicationForm} from '#/api/property/assetManage/application/model';
|
||||
import {commonDownloadExcel} from '#/utils/file/download';
|
||||
|
||||
import applicationModal from './application-modal.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
|
||||
import {columns, querySchema} from './data';
|
||||
import {useUserStore} from "@vben/stores";
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
labelWidth: 80,
|
||||
@@ -50,7 +51,7 @@ const gridOptions: VxeGridProps = {
|
||||
pagerConfig: {},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues = {}) => {
|
||||
query: async ({page}, formValues = {}) => {
|
||||
return await applicationList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
@@ -81,7 +82,7 @@ function handleAdd() {
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<ApplicationForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.setData({id: row.id});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
@@ -90,6 +91,17 @@ async function handleDelete(row: Required<ApplicationForm>) {
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
||||
async function handleAudit(row: Required<ApplicationForm>, status: number) {
|
||||
const info = cloneDeep(row)
|
||||
info.state = status
|
||||
info.acceptanceTime = new Date()
|
||||
info.acceptanceUserId = userStore.userInfo?.userId
|
||||
await applicationVerified(info)
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<ApplicationForm>) => row.id);
|
||||
@@ -141,12 +153,29 @@ function handleDownloadExcel() {
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:application:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
<!-- <ghost-button-->
|
||||
<!-- v-access:code="['property:application:edit']"-->
|
||||
<!-- @click.stop="handleEdit(row)"-->
|
||||
<!-- >-->
|
||||
<!-- {{ $t('pages.common.edit') }}-->
|
||||
<!-- </ghost-button>-->
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="资产领用审核"
|
||||
@confirm="handleAudit(row,1)"
|
||||
cancelText="不通过"
|
||||
okText="通过"
|
||||
@cancel="handleAudit(row,2)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['property:application:edit']"
|
||||
@click.stop=""
|
||||
:disabled="row.state!=0"
|
||||
>
|
||||
审核
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
@@ -164,6 +193,6 @@ function handleDownloadExcel() {
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<ApplicationModal @reload="tableApi.query()" />
|
||||
<ApplicationModal @reload="tableApi.query()"/>
|
||||
</Page>
|
||||
</template>
|
||||
|
@@ -10,8 +10,6 @@ import { assetAdd, assetInfo, assetUpdate } from '#/api/property/assetManage/ass
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
import { packageSelectList } from "#/api/system/tenant-package";
|
||||
import { assetTypeselect } from "#/api/property/assetType";
|
||||
import { depotList } from "#/api/property/assetManage/depot";
|
||||
import { suppliersList } from "#/api/property/assetManage/suppliers";
|
||||
|
||||
@@ -25,9 +23,9 @@ const title = computed(() => {
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
formItemClass: 'col-span-1',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
labelWidth: 100,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
@@ -45,14 +43,9 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
},
|
||||
);
|
||||
|
||||
async function setupPackageSelect() {
|
||||
const tenantPackageList = await assetTypeselect();
|
||||
async function setupPackageSelect(assetTypeOptions) {
|
||||
const depot = await depotList();
|
||||
const suppliers =await suppliersList();
|
||||
const options = tenantPackageList.rows.map((item) => ({
|
||||
label: item.assetTypeName,
|
||||
value: item.id,
|
||||
}));
|
||||
const depotoptions = depot.rows.map((item) => ({
|
||||
label: item.depotName,
|
||||
value: item.id,
|
||||
@@ -67,7 +60,7 @@ async function setupPackageSelect() {
|
||||
componentProps: {
|
||||
optionFilterProp: 'label',
|
||||
optionLabelProp: 'label',
|
||||
options,
|
||||
options:assetTypeOptions,
|
||||
showSearch: true,
|
||||
},
|
||||
fieldName: 'model',
|
||||
@@ -96,7 +89,7 @@ async function setupPackageSelect() {
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
class: 'w-[70%]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
@@ -108,15 +101,15 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
const { id,assetTypeOptions } = modalApi.getData() as { id?: number | string,assetTypeOptions:any[] };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await assetInfo(id);
|
||||
record.type=record.type.toString()
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
await setupPackageSelect();
|
||||
await setupPackageSelect(assetTypeOptions);
|
||||
modalApi.modalLoading(false);
|
||||
},
|
||||
});
|
||||
|
@@ -6,7 +6,7 @@ import { DictEnum } from '@vben/constants';
|
||||
|
||||
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
export const querySchema: FormSchemaGetter = (assetTypeOptions) => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'name',
|
||||
@@ -14,6 +14,9 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps:{
|
||||
options: assetTypeOptions
|
||||
},
|
||||
fieldName: 'model',
|
||||
label: '资产类型',
|
||||
},
|
||||
@@ -32,54 +35,50 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{type: 'checkbox', width: 60},
|
||||
{
|
||||
title: '序号',
|
||||
field: 'id',
|
||||
slots: {
|
||||
default: ({ rowIndex }) => {
|
||||
return (rowIndex + 1).toString();
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '资产名称',
|
||||
field: 'name',
|
||||
minWidth: 180,
|
||||
},
|
||||
{
|
||||
title: '资产类型',
|
||||
field: 'modelName',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '规格',
|
||||
field: 'specs',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '价格',
|
||||
field: 'price',
|
||||
},
|
||||
{
|
||||
title: '库存',
|
||||
field: 'stock',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '计量单位',
|
||||
field: 'unit',
|
||||
},
|
||||
{
|
||||
title: '仓库',
|
||||
field: 'depotName',
|
||||
},
|
||||
{
|
||||
title: '描述信息',
|
||||
field: 'msg',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '供应商',
|
||||
field: 'suppliersName',
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: '仓库',
|
||||
field: 'depotName',
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: '库存',
|
||||
field: 'stock',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '入库时间',
|
||||
field: 'storageTime',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '固定资产',
|
||||
@@ -89,10 +88,12 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return renderDict(row.type, DictEnum.WY_SF);
|
||||
},
|
||||
},
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
field: 'createTime',
|
||||
title: '描述信息',
|
||||
field: 'msg',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
@@ -117,46 +118,56 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
label: '资产名称',
|
||||
fieldName: 'name',
|
||||
component: 'Input',
|
||||
rules:'required',
|
||||
},
|
||||
{
|
||||
label: '类型',
|
||||
fieldName: 'model',
|
||||
component: 'Select',
|
||||
rules:'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '规格',
|
||||
fieldName: 'specs',
|
||||
component: 'Textarea',
|
||||
component: 'Input',
|
||||
rules:'required',
|
||||
},
|
||||
{
|
||||
label: '价格',
|
||||
fieldName: 'price',
|
||||
component: 'Input',
|
||||
component: 'InputNumber',
|
||||
componentProps:{
|
||||
min:0,
|
||||
precision:2,
|
||||
},
|
||||
rules:'required',
|
||||
},
|
||||
{
|
||||
label: '库存',
|
||||
fieldName: 'stock',
|
||||
component: 'Input',
|
||||
component: 'InputNumber',
|
||||
componentProps:{
|
||||
min:0,
|
||||
},
|
||||
rules:'required',
|
||||
},
|
||||
{
|
||||
label: '计量单位',
|
||||
fieldName: 'unit',
|
||||
component: 'Input',
|
||||
rules:'required',
|
||||
},
|
||||
{
|
||||
label: '仓库',
|
||||
fieldName: 'depotId',
|
||||
component: 'Select',
|
||||
rules:'required',
|
||||
},
|
||||
{
|
||||
label: '描述信息',
|
||||
fieldName: 'msg',
|
||||
component: 'Textarea',
|
||||
},
|
||||
{
|
||||
label: '供应商id',
|
||||
label: '供应商',
|
||||
fieldName: 'suppliersId',
|
||||
component: 'Select',
|
||||
rules:'required',
|
||||
},
|
||||
{
|
||||
label: '入库时间',
|
||||
@@ -167,13 +178,23 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules:'required',
|
||||
},
|
||||
{
|
||||
label: '固定资产类型',
|
||||
label: '是否固定资产',
|
||||
fieldName: 'type',
|
||||
component: 'Select',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
buttonStyle: 'solid',
|
||||
options: getDictOptions('wy_sf'),
|
||||
},
|
||||
defaultValue:'0',
|
||||
rules:'required',
|
||||
},
|
||||
{
|
||||
label: '描述信息',
|
||||
fieldName: 'msg',
|
||||
component: 'Textarea',
|
||||
formItemClass:'col-span-2'
|
||||
},
|
||||
];
|
||||
|
@@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
import {Page, useVbenModal, type VbenFormProps} from '@vben/common-ui';
|
||||
import {getVxePopupContainer} from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import {Modal, Popconfirm, Space} from 'ant-design-vue';
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
@@ -16,22 +16,27 @@ import {
|
||||
assetList,
|
||||
assetRemove,
|
||||
} from '#/api/property/assetManage/asset';
|
||||
import type { AssetForm } from '#/api/property/assetManage/asset/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
import type {AssetForm} from '#/api/property/assetManage/asset/model';
|
||||
import {commonDownloadExcel} from '#/utils/file/download';
|
||||
|
||||
import assetModal from './asset-modal.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
import {columns, querySchema} from './data';
|
||||
import {assetTypeList} from "#/api/property/assetManage/assetType";
|
||||
import type {AssertType} from "vitest";
|
||||
import {computed, onMounted, ref} from "vue";
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
const assetTypeOptions=ref<AssertType[]>([])
|
||||
|
||||
const formOptions = computed(() => ({
|
||||
commonConfig: {
|
||||
labelWidth: 80,
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
schema: querySchema(),
|
||||
schema: querySchema(assetTypeOptions.value),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
};
|
||||
}));
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
checkboxConfig: {
|
||||
@@ -47,7 +52,7 @@ const gridOptions: VxeGridProps = {
|
||||
pagerConfig: {},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues = {}) => {
|
||||
query: async ({page}, formValues = {}) => {
|
||||
return await assetList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
@@ -73,12 +78,12 @@ const [AssetModal, modalApi] = useVbenModal({
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.setData({assetTypeOptions:assetTypeOptions.value});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<AssetForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.setData({id: row.id,assetTypeOptions:assetTypeOptions.value});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
@@ -106,6 +111,24 @@ function handleDownloadExcel() {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
});
|
||||
}
|
||||
|
||||
async function queryAssetType() {
|
||||
let params = {
|
||||
pageSize: 1000,
|
||||
pageNum: 1,
|
||||
}
|
||||
const res = await assetTypeList(params)
|
||||
assetTypeOptions.value = res.rows.map((item) => ({
|
||||
label: item.assetTypeName,
|
||||
value: item.id,
|
||||
}));
|
||||
return assetTypeOptions.value
|
||||
}
|
||||
|
||||
onMounted(()=>{
|
||||
queryAssetType()
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -161,6 +184,6 @@ function handleDownloadExcel() {
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<AssetModal @reload="tableApi.query()" />
|
||||
<AssetModal @reload="tableApi.query()"/>
|
||||
</Page>
|
||||
</template>
|
||||
|
@@ -61,5 +61,11 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
label: '排序',
|
||||
fieldName: 'sort',
|
||||
component: 'InputNumber',
|
||||
rules:'required',
|
||||
componentProps: {
|
||||
min: 0,
|
||||
precision: 0,
|
||||
step: 1
|
||||
},
|
||||
},
|
||||
];
|
||||
|
@@ -2,6 +2,8 @@ import type {FormSchemaGetter} from '#/adapter/form';
|
||||
import type {VxeGridProps} from '#/adapter/vxe-table';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
import {z} from "#/adapter/form";
|
||||
import {$t} from "@vben/locales";
|
||||
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
@@ -30,18 +32,10 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{type: 'checkbox', width: 60},
|
||||
{
|
||||
title: '序号',
|
||||
field: 'id',
|
||||
slots: {
|
||||
default: ({rowIndex}) => {
|
||||
return (rowIndex + 1).toString();
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '仓库名称',
|
||||
field: 'depotName',
|
||||
width:200
|
||||
},
|
||||
{
|
||||
title: '仓库类型',
|
||||
@@ -50,21 +44,23 @@ export const columns: VxeGridProps['columns'] = [
|
||||
default: ({row}) => {
|
||||
return renderDict(row.modelType, 'wy_cclx')
|
||||
}
|
||||
}
|
||||
},
|
||||
width:180
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
field: 'state',
|
||||
slots: {default: 'state'}
|
||||
slots: {default: 'state'},
|
||||
width:120
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
field: 'createTime',
|
||||
},
|
||||
{
|
||||
title: '描述信息',
|
||||
field: 'msg',
|
||||
},
|
||||
|
||||
{
|
||||
title: '创建时间',
|
||||
field: 'createTime',
|
||||
minWidth:180,
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
@@ -89,7 +85,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
label: '仓库名称',
|
||||
fieldName: 'depotName',
|
||||
component: 'Input',
|
||||
rules:'required'
|
||||
rules: z.string().min(1,'请输入仓库名称').max(30, { message: '仓库名称过长' }),
|
||||
},
|
||||
{
|
||||
label: '仓库类型',
|
||||
|
@@ -164,7 +164,7 @@ const { hasAccessByCodes } = useAccess();
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:depot:info']"
|
||||
v-access:code="['property:depot:query']"
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
|
@@ -1,65 +1,68 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
import {renderDict} from "#/utils/render";
|
||||
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'depotId',
|
||||
label: '仓库id',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'assetId',
|
||||
label: '资产id',
|
||||
},
|
||||
// {
|
||||
// component: 'Input',
|
||||
// fieldName: 'depotId',
|
||||
// label: '仓库id',
|
||||
// },
|
||||
// {
|
||||
// component: 'Input',
|
||||
// fieldName: 'assetId',
|
||||
// label: '资产id',
|
||||
// },
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options:getDictOptions('wy_cklzlx')
|
||||
},
|
||||
fieldName: 'type',
|
||||
label: '流转类型',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'time',
|
||||
label: '流转时间',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'userId',
|
||||
label: '操作人id',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'state',
|
||||
label: '状态',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'price',
|
||||
label: '价格',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'priceSum',
|
||||
label: '总价',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'number',
|
||||
label: '数量',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'supplierId',
|
||||
label: '供应商id',
|
||||
},
|
||||
// {
|
||||
// component: 'DatePicker',
|
||||
// componentProps: {
|
||||
// showTime: true,
|
||||
// format: 'YYYY-MM-DD HH:mm:ss',
|
||||
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
// },
|
||||
// fieldName: 'time',
|
||||
// label: '流转时间',
|
||||
// },
|
||||
// {
|
||||
// component: 'Input',
|
||||
// fieldName: 'userId',
|
||||
// label: '操作人id',
|
||||
// },
|
||||
// {
|
||||
// component: 'Input',
|
||||
// fieldName: 'state',
|
||||
// label: '状态',
|
||||
// },
|
||||
// {
|
||||
// component: 'Input',
|
||||
// fieldName: 'price',
|
||||
// label: '价格',
|
||||
// },
|
||||
// {
|
||||
// component: 'Input',
|
||||
// fieldName: 'priceSum',
|
||||
// label: '总价',
|
||||
// },
|
||||
// {
|
||||
// component: 'Input',
|
||||
// fieldName: 'number',
|
||||
// label: '数量',
|
||||
// },
|
||||
// {
|
||||
// component: 'Input',
|
||||
// fieldName: 'supplierId',
|
||||
// label: '供应商id',
|
||||
// },
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
@@ -67,64 +70,74 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '主键',
|
||||
field: 'id',
|
||||
title: '仓库',
|
||||
field: 'depotName',
|
||||
minWidth:150,
|
||||
},
|
||||
{
|
||||
title: '仓库id',
|
||||
field: 'depotId',
|
||||
},
|
||||
{
|
||||
title: '资产id',
|
||||
field: 'assetId',
|
||||
title: '资产',
|
||||
field: 'assetName',
|
||||
width:180,
|
||||
},
|
||||
{
|
||||
title: '流转类型',
|
||||
field: 'type',
|
||||
width:120,
|
||||
slots:{
|
||||
default:({row})=>{
|
||||
return renderDict(row.type,'wy_cklzlx')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
title: '数量',
|
||||
field: 'number',
|
||||
width:120,
|
||||
},
|
||||
{
|
||||
title: '流转时间',
|
||||
field: 'time',
|
||||
width:150,
|
||||
},
|
||||
{
|
||||
title: '操作人id',
|
||||
field: 'userId',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
field: 'state',
|
||||
title: '操作人',
|
||||
field: 'userName',
|
||||
width:150,
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
width:180,
|
||||
},
|
||||
{
|
||||
title: '价格',
|
||||
field: 'price',
|
||||
},
|
||||
{
|
||||
title: '总价',
|
||||
field: 'priceSum',
|
||||
},
|
||||
{
|
||||
title: '数量',
|
||||
field: 'number',
|
||||
},
|
||||
{
|
||||
title: '供应商id',
|
||||
field: 'supplierId',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
field: 'createTime',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 180,
|
||||
},
|
||||
// {
|
||||
// title: '状态',
|
||||
// field: 'state',
|
||||
// width:150,
|
||||
// },
|
||||
// {
|
||||
// title: '价格',
|
||||
// field: 'price',
|
||||
// },
|
||||
// {
|
||||
// title: '总价',
|
||||
// field: 'priceSum',
|
||||
// },
|
||||
// {
|
||||
// title: '供应商id',
|
||||
// field: 'supplierId',
|
||||
// },
|
||||
// {
|
||||
// title: '创建时间',
|
||||
// field: 'createTime',
|
||||
// },
|
||||
// {
|
||||
// field: 'action',
|
||||
// fixed: 'right',
|
||||
// slots: { default: 'action' },
|
||||
// title: '操作',
|
||||
// width: 180,
|
||||
// },
|
||||
];
|
||||
|
||||
export const modalSchema: FormSchemaGetter = () => [
|
||||
|
@@ -135,47 +135,47 @@ function handleDownloadExcel() {
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:log:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:log:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:log:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
</ghost-button>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认删除?"
|
||||
@confirm="handleDelete(row)"
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['property:log:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
<!-- <a-button-->
|
||||
<!-- :disabled="!vxeCheckboxChecked(tableApi)"-->
|
||||
<!-- danger-->
|
||||
<!-- type="primary"-->
|
||||
<!-- v-access:code="['property:log:remove']"-->
|
||||
<!-- @click="handleMultiDelete">-->
|
||||
<!-- {{ $t('pages.common.delete') }}-->
|
||||
<!-- </a-button>-->
|
||||
<!-- <a-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- v-access:code="['property:log:add']"-->
|
||||
<!-- @click="handleAdd"-->
|
||||
<!-- >-->
|
||||
<!-- {{ $t('pages.common.add') }}-->
|
||||
<!-- </a-button>-->
|
||||
</Space>
|
||||
</template>
|
||||
<!-- <template #action="{ row }">-->
|
||||
<!-- <Space>-->
|
||||
<!-- <ghost-button-->
|
||||
<!-- v-access:code="['property:log:edit']"-->
|
||||
<!-- @click.stop="handleEdit(row)"-->
|
||||
<!-- >-->
|
||||
<!-- {{ $t('pages.common.edit') }}-->
|
||||
<!-- </ghost-button>-->
|
||||
<!-- <Popconfirm-->
|
||||
<!-- :get-popup-container="getVxePopupContainer"-->
|
||||
<!-- placement="left"-->
|
||||
<!-- title="确认删除?"-->
|
||||
<!-- @confirm="handleDelete(row)"-->
|
||||
<!-- >-->
|
||||
<!-- <ghost-button-->
|
||||
<!-- danger-->
|
||||
<!-- v-access:code="['property:log:remove']"-->
|
||||
<!-- @click.stop=""-->
|
||||
<!-- >-->
|
||||
<!-- {{ $t('pages.common.delete') }}-->
|
||||
<!-- </ghost-button>-->
|
||||
<!-- </Popconfirm>-->
|
||||
<!-- </Space>-->
|
||||
<!-- </template>-->
|
||||
</BasicTable>
|
||||
<LogModal @reload="tableApi.query()" />
|
||||
</Page>
|
||||
|
@@ -5,9 +5,9 @@ import { getDictOptions } from '#/utils/dict';
|
||||
import { renderDict } from '#/utils/render';
|
||||
import { suppliersList } from '#/api/property/assetManage/suppliers';
|
||||
import { depotList } from '#/api/property/assetManage/depot';
|
||||
import { useUserStore } from '@vben/stores';
|
||||
// import { useUserStore } from '@vben/stores';
|
||||
|
||||
const userStore = useUserStore();
|
||||
// const userStore = useUserStore();
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
// {
|
||||
@@ -39,11 +39,13 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {},
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_zccgfs'),
|
||||
},
|
||||
fieldName: 'buyType',
|
||||
label: '采购方式',
|
||||
options: getDictOptions('wy_zccgfs'),
|
||||
},
|
||||
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
|
@@ -179,7 +179,7 @@ function handleDownloadExcel() {
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['domain:procurementApplication:audit']"
|
||||
v-access:code="['domain:procurementApplication:edit']"
|
||||
:disabled="row.state === '1' || row.state === '2'"
|
||||
type="primary"
|
||||
@click.stop="handleAudit(row)"
|
||||
@@ -187,7 +187,7 @@ function handleDownloadExcel() {
|
||||
审核
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['domain:procurementApplication:detail']"
|
||||
v-access:code="['domain:procurementApplication:query']"
|
||||
@click.stop="handleDetail(row)"
|
||||
>
|
||||
详情
|
||||
|
@@ -155,14 +155,14 @@ const { hasAccessByCodes } = useAccess();
|
||||
:unCheckedValue="0"
|
||||
v-model:value="row.state"
|
||||
:api="() => suppliersUpdate(row)"
|
||||
:disabled="!hasAccessByCodes(['property:suppliers:update'])"
|
||||
:disabled="!hasAccessByCodes(['property:suppliers:edit'])"
|
||||
@reload="() => tableApi.query()"
|
||||
/>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:suppliers:info']"
|
||||
v-access:code="['property:suppliers:query']"
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
|
@@ -1,20 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
assetTypeExport,
|
||||
assetTypeList,
|
||||
@@ -35,15 +27,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 = {
|
||||
@@ -138,8 +121,8 @@ function handleDownloadExcel() {
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:assetType:remove']"
|
||||
type="primary"
|
||||
v-access:code="['property:assetType:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
|
@@ -1,61 +1,53 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from "vue";
|
||||
import { computed, ref } 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 { useVbenForm } from '#/adapter/form';
|
||||
import {
|
||||
meterInfoAdd,
|
||||
meterInfoInfo,
|
||||
meterInfoUpdate,
|
||||
} from "#/api/property/meter/meterInfo";
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from "#/utils/popup";
|
||||
attendanceAreaAdd,
|
||||
attendanceAreaInfo,
|
||||
attendanceAreaUpdate,
|
||||
} from '#/api/property/attendanceManagement/attendanceArea';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
const props = defineProps({
|
||||
meterType: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
import { initMoalForm } from "./data";
|
||||
const modalSchema = initMoalForm(props.meterType);
|
||||
import { modalSchema } from './data';
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
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-1",
|
||||
formItemClass: 'col-span-2',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 120,
|
||||
|
||||
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-[900px]",
|
||||
class: 'w-[550px]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
@@ -70,11 +62,10 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
isUpdate.value = !!id;
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await meterInfoInfo(id);
|
||||
record.meterType = record.meterType.toString();
|
||||
record.meterUnit = record.meterUnit.toString();
|
||||
record.runningState = record.runningState.toString();
|
||||
record.communicationState = record.communicationState.toString();
|
||||
const record = await attendanceAreaInfo(id);
|
||||
record.deviceManageId = record.areaDevice
|
||||
.map((device: any) => device.remoteSisDeviceManage?.id || '')
|
||||
.filter((id: string) => id);
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
@@ -92,9 +83,11 @@ async function handleConfirm() {
|
||||
}
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
await (isUpdate.value ? meterInfoUpdate(data) : meterInfoAdd(data));
|
||||
await (isUpdate.value
|
||||
? attendanceAreaUpdate(data)
|
||||
: attendanceAreaAdd(data));
|
||||
resetInitialized();
|
||||
emit("reload");
|
||||
emit('reload');
|
||||
modalApi.close();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
@@ -114,4 +107,3 @@ async function handleClosed() {
|
||||
<BasicForm />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
@@ -0,0 +1,92 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import { deviceManageList } from '#/api/sis/deviceManage';
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'area',
|
||||
label: '区域',
|
||||
},
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '区域',
|
||||
field: 'area',
|
||||
width: 'auto',
|
||||
},
|
||||
{
|
||||
title: '摄像机',
|
||||
field: 'areaDevice',
|
||||
minWidth: 300,
|
||||
slots: {
|
||||
default: ({ row }: { row: any }) => {
|
||||
if (!row.areaDevice || !Array.isArray(row.areaDevice)) {
|
||||
return '';
|
||||
}
|
||||
return row.areaDevice
|
||||
.map((device: any) => device.remoteSisDeviceManage?.deviceName || '')
|
||||
.filter((deviceName: string) => deviceName)
|
||||
.join(', ');
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
title: '备注',
|
||||
field: 'reamark',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 180,
|
||||
},
|
||||
];
|
||||
|
||||
export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '主键id',
|
||||
fieldName: 'id',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
show: () => false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '区域',
|
||||
fieldName: 'area',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '摄像机',
|
||||
fieldName: 'deviceManageId',
|
||||
component: 'ApiSelect',
|
||||
rules: 'required',
|
||||
componentProps: {
|
||||
api: async () => {
|
||||
const res = await deviceManageList({
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
deviceType: 1,
|
||||
});
|
||||
return res;
|
||||
},
|
||||
resultField: 'rows',
|
||||
labelField: 'deviceName',
|
||||
valueField: 'id',
|
||||
mode: 'multiple',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
fieldName: 'reamark',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
@@ -9,24 +9,22 @@ import { getVxePopupContainer } from '@vben/utils';
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
type VxeGridProps,
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
meterInfoExport,
|
||||
meterInfoList,
|
||||
meterInfoRemove,
|
||||
} from '#/api/property/meter/meterInfo';
|
||||
import type { MeterInfoForm } from '#/api/property/meterInfo/model';
|
||||
attendanceAreaExport,
|
||||
attendanceAreaList,
|
||||
attendanceAreaRemove,
|
||||
} from '#/api/property/attendanceManagement/attendanceArea';
|
||||
import type { AttendanceAreaForm } from '#/api/property/attendanceManagement/attendanceArea/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import meterInfoModal from "../components/meterInfo-modal.vue";
|
||||
import { initQuerySchema, initColumns } from "../components/data";
|
||||
const columns = initColumns(1);
|
||||
const querySchema = initQuerySchema(1);
|
||||
import attendanceAreaModal from './attendanceArea-modal.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@@ -66,7 +64,7 @@ const gridOptions: VxeGridProps = {
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues = {}) => {
|
||||
return await meterInfoList({
|
||||
return await attendanceAreaList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
@@ -78,7 +76,7 @@ const gridOptions: VxeGridProps = {
|
||||
keyField: 'id',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'property-meterInfo-index'
|
||||
id: 'property-attendanceArea-index',
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
@@ -86,8 +84,8 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [MeterInfoModal, modalApi] = useVbenModal({
|
||||
connectedComponent: meterInfoModal,
|
||||
const [AttendanceAreaModal, modalApi] = useVbenModal({
|
||||
connectedComponent: attendanceAreaModal,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
@@ -95,44 +93,49 @@ function handleAdd() {
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<MeterInfoForm>) {
|
||||
async function handleEdit(row: Required<AttendanceAreaForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<MeterInfoForm>) {
|
||||
await meterInfoRemove(row.id);
|
||||
async function handleDelete(row: Required<AttendanceAreaForm>) {
|
||||
await attendanceAreaRemove(row.id);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<MeterInfoForm>) => row.id);
|
||||
const ids = rows.map((row: Required<AttendanceAreaForm>) => row.id);
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await meterInfoRemove(ids);
|
||||
await attendanceAreaRemove(ids);
|
||||
await tableApi.query();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(meterInfoExport, '水电气数据', tableApi.formApi.form.values, {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
});
|
||||
commonDownloadExcel(
|
||||
attendanceAreaExport,
|
||||
'区域区域管理数据',
|
||||
tableApi.formApi.form.values,
|
||||
{
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
},
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="水电气列表">
|
||||
<BasicTable table-title="区域区域管理列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
v-access:code="['property:meterInfo:export']"
|
||||
v-access:code="['property:attendanceArea:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
@@ -140,14 +143,15 @@ function handleDownloadExcel() {
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:meterInfo:remove']"
|
||||
@click="handleMultiDelete">
|
||||
type="primary"
|
||||
v-access:code="['property:attendanceArea:remove']"
|
||||
@click="handleMultiDelete"
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:meterInfo:add']"
|
||||
v-access:code="['property:attendanceArea:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
@@ -157,7 +161,7 @@ function handleDownloadExcel() {
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:meterInfo:edit']"
|
||||
v-access:code="['property:attendanceArea:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
@@ -170,7 +174,7 @@ function handleDownloadExcel() {
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['property:meterInfo:remove']"
|
||||
v-access:code="['property:attendanceArea:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
@@ -179,6 +183,6 @@ function handleDownloadExcel() {
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MeterInfoModal @reload="tableApi.query()" :meterType="1" />
|
||||
<AttendanceAreaModal @reload="tableApi.query()" />
|
||||
</Page>
|
||||
</template>
|
@@ -154,7 +154,7 @@ function handleDownloadExcel() {
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['Property:group:info']"
|
||||
v-access:code="['Property:group:query']"
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
@@ -187,7 +187,7 @@ function handleDownloadExcel() {
|
||||
:unCheckedValue="0"
|
||||
v-model:value="row.status"
|
||||
:api="() => groupUpdate(row)"
|
||||
:disabled="!hasAccessByCodes(['property:depot:edit'])"
|
||||
:disabled="!hasAccessByCodes(['Property:group:edit'])"
|
||||
@reload="() => tableApi.query()"
|
||||
/>
|
||||
</template>
|
||||
|
@@ -63,7 +63,6 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
];
|
||||
}
|
||||
record.status = record.status?.toString();
|
||||
console.log(record);
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
|
@@ -1,18 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, reactive, onMounted } from 'vue';
|
||||
import { reactive, onMounted, computed } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import {
|
||||
arrangementAdd,
|
||||
arrangementInfo,
|
||||
arrangementUpdate,
|
||||
} from '#/api/property/attendanceManagement/arrangement';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
import { useVbenVxeGrid, type VxeGridProps } from '#/adapter/vxe-table';
|
||||
import { modalSchema, attendanceColumns } from './data';
|
||||
import { arrangementAdd } from '#/api/property/attendanceManagement/arrangement';
|
||||
import {
|
||||
Radio,
|
||||
DatePicker,
|
||||
@@ -29,17 +20,53 @@ import dayjs from 'dayjs';
|
||||
import type { PersonVO } from './type';
|
||||
import { ref, h } from 'vue';
|
||||
import { Tag, Table } from 'ant-design-vue';
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
const isUpdate = ref(false);
|
||||
const title = computed(() => {
|
||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||
});
|
||||
const groupOptions = ref<any[]>([]);
|
||||
const groupMap = ref<Record<string, any>>({}); // 用于快速查找
|
||||
const tableData = reactive<
|
||||
{ dept: { unitId: string | number; unitName: string }; users: PersonVO[] }[]
|
||||
>([]);
|
||||
import { attendanceAreaList } from '#/api/property/attendanceManagement/attendanceArea';
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
//表单项
|
||||
let formModal = reactive<{
|
||||
id: string;
|
||||
groupId: string;
|
||||
attendanceType: string;
|
||||
dateType: number | undefined;
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
areaId: string[];
|
||||
userGroupList: any[];
|
||||
}>({
|
||||
id: '',
|
||||
groupId: '',
|
||||
attendanceType: '', //考勤组类型
|
||||
dateType: undefined, //日期类型:1-单个日期,2-长期有效,3-期间有效
|
||||
// dateSingle: null,
|
||||
// dateLong: null,
|
||||
// dateRange: [null, null],
|
||||
startDate: '', //开始日期
|
||||
endDate: '', //结束日期
|
||||
areaId: [], //区域
|
||||
userGroupList: [
|
||||
// scheduleId:undefined,//排班ID
|
||||
// employeeId:undefined,//员工ID
|
||||
// employeeName:undefined,//员工姓名
|
||||
// deptId:undefined,//部门ID
|
||||
// deptName:undefined,//部门名称
|
||||
], //考勤组人员列表
|
||||
});
|
||||
const formRef = ref();
|
||||
let singleDate = ref(''); //排班日期单个日期
|
||||
let longDate = ref(''); //排班日期从此日起长期有效
|
||||
let rangeDate = ref(['', '']); //排班日期在此期间有效
|
||||
const rules = {
|
||||
groupId: [{ required: true, message: '请选择考勤组' }],
|
||||
attendanceType: [{ required: true }],
|
||||
dateType: [{ required: true, message: '请选择排班日期' }],
|
||||
};
|
||||
const groupOptions = ref<any[]>([]); //考勤组
|
||||
const areaOptions = ref<any[]>([]); //区域
|
||||
const groupMap = ref<Record<string, any>>({}); // 用于快速查找
|
||||
let tableData = reactive<
|
||||
{ dept: { deptId: string | number; deptName: string }; users: PersonVO[] }[]
|
||||
>([]); //存放考勤组人员列表数据
|
||||
const columns = [
|
||||
{
|
||||
title: '序号',
|
||||
@@ -50,23 +77,44 @@ const columns = [
|
||||
},
|
||||
{
|
||||
title: '部门',
|
||||
dataIndex: ['dept', 'unitName'],
|
||||
dataIndex: ['dept', 'deptName'],
|
||||
key: 'dept',
|
||||
width: 120,
|
||||
customRender: ({ record }: { record: any }) => record.dept.unitName,
|
||||
customRender: ({
|
||||
record,
|
||||
}: {
|
||||
record: {
|
||||
dept: { deptId: string | number; deptName: string };
|
||||
users: PersonVO[];
|
||||
};
|
||||
}) => record.dept.deptName,
|
||||
},
|
||||
{
|
||||
title: '已选人数',
|
||||
dataIndex: 'users',
|
||||
key: 'userCount',
|
||||
width: 100,
|
||||
customRender: ({ record }: { record: any }) => record.users.length,
|
||||
customRender: ({
|
||||
record,
|
||||
}: {
|
||||
record: {
|
||||
dept: { deptId: string | number; deptName: string };
|
||||
users: PersonVO[];
|
||||
};
|
||||
}) => record.users.length,
|
||||
},
|
||||
{
|
||||
title: '人员',
|
||||
dataIndex: 'users',
|
||||
key: 'users',
|
||||
customRender: ({ record }: { record: any }) =>
|
||||
customRender: ({
|
||||
record,
|
||||
}: {
|
||||
record: {
|
||||
dept: { deptId: string | number; deptName: string };
|
||||
users: PersonVO[];
|
||||
};
|
||||
}) =>
|
||||
record.users.map((user: any) =>
|
||||
h(
|
||||
Tag,
|
||||
@@ -87,7 +135,7 @@ const columns = [
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 80,
|
||||
customRender: ({ record, index }: { record: any; index: number }) =>
|
||||
customRender: ({ index }: { index: number }) =>
|
||||
h(
|
||||
'a',
|
||||
{
|
||||
@@ -107,96 +155,73 @@ function handleRemoveRow(index: number) {
|
||||
tableData.splice(index, 1);
|
||||
}
|
||||
|
||||
function handleTableData(newTableData: any) {
|
||||
tableData.splice(0, tableData.length, ...newTableData);
|
||||
}
|
||||
//表单项
|
||||
const formModel = reactive<{
|
||||
id: string;
|
||||
groupId: string;
|
||||
attendanceType: string;
|
||||
dateType: number | undefined;
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
userGroupList: any[];
|
||||
}>({
|
||||
id: '',
|
||||
groupId: '',
|
||||
attendanceType: '', //考勤组类型
|
||||
dateType: undefined, //日期类型:1-单个日期,2-长期有效,3-期间有效
|
||||
// dateSingle: null,
|
||||
// dateLong: null,
|
||||
// dateRange: [null, null],
|
||||
startDate: '', //开始日期
|
||||
endDate: '', //结束日期
|
||||
userGroupList: [
|
||||
// scheduleId:undefined,//排班ID
|
||||
// employeeId:undefined,//员工ID
|
||||
// employeeName:undefined,//员工姓名
|
||||
// deptId:undefined,//部门ID
|
||||
// deptName:undefined,//部门名称
|
||||
], //考勤组人员列表
|
||||
});
|
||||
const singleDate = ref('');
|
||||
const longDate = ref('');
|
||||
const rangeDate = ref(['', '']);
|
||||
const formRef = ref();
|
||||
const rules = {
|
||||
groupId: [{ required: true, message: '请选择考勤组' }],
|
||||
attendanceType: [{ required: true }],
|
||||
dateType: [{ required: true, message: '请选择排班日期' }],
|
||||
};
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
},
|
||||
},
|
||||
schema: modalSchema(),
|
||||
showDefaultActions: false,
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
function handleTableData(
|
||||
newTableData: {
|
||||
dept: { deptId: string | number; deptName: string };
|
||||
users: PersonVO[];
|
||||
}[],
|
||||
) {
|
||||
// 如果现有数据为空,直接替换
|
||||
if (tableData.length === 0) {
|
||||
tableData.splice(0, 0, ...newTableData);
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果新数据为空,不做处理
|
||||
if (newTableData.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 处理有数据的情况
|
||||
for (const newItem of newTableData) {
|
||||
// 查找是否已存在相同部门
|
||||
const existingDeptIndex = tableData.findIndex(
|
||||
(item) => item.dept.deptId === newItem.dept.deptId,
|
||||
);
|
||||
|
||||
if (existingDeptIndex !== -1) {
|
||||
// 找到相同部门,检查人员是否有重复
|
||||
const existingDept = tableData[existingDeptIndex];
|
||||
for (const newUser of newItem.users) {
|
||||
// 检查该用户是否已存在
|
||||
const userExists = existingDept?.users.some(
|
||||
(existingUser) => existingUser.userId === newUser.userId,
|
||||
);
|
||||
if (!userExists) {
|
||||
// 用户不存在,添加到现有部门
|
||||
existingDept?.users.push(newUser);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 部门不存在,直接添加新部门
|
||||
tableData.push(newItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
},
|
||||
);
|
||||
const [UnitPersonModal, unitPersonmodalApi] = useVbenModal({
|
||||
connectedComponent: unitPersonModal,
|
||||
});
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[70%]',
|
||||
class: 'w-[85%]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
onConfirm: handleConfirm,
|
||||
onOpenChange: async (isOpen) => {
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
}
|
||||
await getGroupList();
|
||||
console.log(getDictOptions('wy_kqlx'));
|
||||
modalApi.modalLoading(true);
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await arrangementInfo(id);
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await getGroupList();
|
||||
await getAreaList();
|
||||
// await markInitialized();
|
||||
modalApi.modalLoading(false);
|
||||
},
|
||||
});
|
||||
const totalSelected: number = 0;
|
||||
const totalSelected = computed(() =>
|
||||
tableData.reduce((sum, row) => sum + (row.users?.length || 0), 0),
|
||||
);
|
||||
|
||||
function handleAdd() {
|
||||
unitPersonmodalApi.setData({});
|
||||
@@ -219,25 +244,29 @@ async function getGroupList() {
|
||||
groupMap.value[item.id] = item;
|
||||
});
|
||||
}
|
||||
async function getAreaList() {
|
||||
const res = await attendanceAreaList({ pageSize: 1000000000, pageNum: 1 });
|
||||
areaOptions.value = (res.rows || []).map((item) => ({
|
||||
label: item.area,
|
||||
value: item.id,
|
||||
}));
|
||||
}
|
||||
function chooseGroup(value: any) {
|
||||
console.log(value);
|
||||
const group = groupMap.value[value];
|
||||
if (group) {
|
||||
formModel.attendanceType = String(group.attendanceType);
|
||||
formModal.attendanceType = String(group.attendanceType);
|
||||
}
|
||||
}
|
||||
async function handleDateTypeChange(value: any) {
|
||||
formModel.dateType = value;
|
||||
formModal.dateType = value;
|
||||
}
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
// await formRef.value.validate(); // 先校验
|
||||
const data = formModel;
|
||||
await formRef.value.validate(); // 先校验
|
||||
const data = formModal;
|
||||
const { id } = modalApi.getData() as { id?: string };
|
||||
data.id = id ? id : '';
|
||||
console.log(data);
|
||||
|
||||
if (data.dateType == 1) {
|
||||
if (singleDate.value) {
|
||||
data.startDate = dayjs(singleDate.value).format('YYYY-MM-DD');
|
||||
@@ -264,9 +293,34 @@ async function handleConfirm() {
|
||||
data.endDate = dayjs(rangeDate.value[1]).format('YYYY-MM-DD');
|
||||
}
|
||||
}
|
||||
// await (isUpdate.value ? arrangementUpdate(data) : arrangementAdd(data));
|
||||
resetInitialized();
|
||||
for (const item of tableData) {
|
||||
for (const user of item.users) {
|
||||
data.userGroupList.push({
|
||||
deptId: item.dept.deptId, //部门ID
|
||||
deptName: item.dept.deptName, //部门名称
|
||||
employeeId: user.userId, //员工ID
|
||||
employeeName: user.userName, //员工姓名
|
||||
});
|
||||
}
|
||||
}
|
||||
await arrangementAdd(data);
|
||||
emit('reload');
|
||||
// 重置表单数据
|
||||
Object.assign(formModal, {
|
||||
id: '',
|
||||
groupId: '',
|
||||
attendanceType: '',
|
||||
dateType: undefined,
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
areaId: [],
|
||||
userGroupList: [],
|
||||
});
|
||||
// 重置其他数据
|
||||
tableData.length = 0;
|
||||
singleDate.value = '';
|
||||
longDate.value = '';
|
||||
rangeDate.value = ['', ''];
|
||||
modalApi.close();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
@@ -276,17 +330,34 @@ async function handleConfirm() {
|
||||
}
|
||||
|
||||
async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
// 重置表单数据
|
||||
Object.assign(formModal, {
|
||||
id: '',
|
||||
groupId: '',
|
||||
attendanceType: '',
|
||||
dateType: undefined,
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
areaId: [],
|
||||
userGroupList: [],
|
||||
});
|
||||
|
||||
// 重置其他数据
|
||||
tableData.length = 0;
|
||||
singleDate.value = '';
|
||||
longDate.value = '';
|
||||
rangeDate.value = ['', ''];
|
||||
|
||||
modalApi.close();
|
||||
}
|
||||
onMounted(() => {});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicModal title="新增">
|
||||
<!-- 顶部表单区 -->
|
||||
<Form
|
||||
:model="formModel"
|
||||
:model="formModal"
|
||||
:rules="rules"
|
||||
ref="formRef"
|
||||
layout="horizontal"
|
||||
@@ -295,7 +366,7 @@ onMounted(() => {});
|
||||
<div class="grid grid-cols-2 gap-x-8 gap-y-2">
|
||||
<FormItem name="groupId" label="请选择考勤组" class="mb-0">
|
||||
<Select
|
||||
v-model:value="formModel.groupId"
|
||||
v-model:value="formModal.groupId"
|
||||
:options="groupOptions"
|
||||
placeholder="请选择"
|
||||
@change="chooseGroup"
|
||||
@@ -305,12 +376,12 @@ onMounted(() => {});
|
||||
<Select
|
||||
:disabled="true"
|
||||
:options="getDictOptions('wy_kqlx')"
|
||||
v-model:value="formModel.attendanceType"
|
||||
v-model:value="formModal.attendanceType"
|
||||
placeholder="请选择考勤组"
|
||||
/>
|
||||
</FormItem>
|
||||
<FormItem label="排班日期" name="dateType" class="col-span-2 mb-0">
|
||||
<RadioGroup v-model:value="formModel.dateType" class="mr-4">
|
||||
<RadioGroup v-model:value="formModal.dateType" class="mr-4">
|
||||
<Radio value="1">
|
||||
<span>
|
||||
单个日期
|
||||
@@ -346,6 +417,15 @@ onMounted(() => {});
|
||||
</Radio>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
<FormItem name="areaId" label="请选择区域" class="mb-0">
|
||||
<Select
|
||||
v-model:value="formModal.areaId"
|
||||
:options="areaOptions"
|
||||
placeholder="请选择"
|
||||
mode="multiple"
|
||||
@change="chooseGroup"
|
||||
/>
|
||||
</FormItem>
|
||||
</div>
|
||||
</Form>
|
||||
<!-- 考勤组人员表格区 -->
|
||||
@@ -363,7 +443,7 @@ onMounted(() => {});
|
||||
:columns="columns"
|
||||
:dataSource="tableData"
|
||||
:pagination="false"
|
||||
rowKey="dept.unitId"
|
||||
rowKey="dept.deptId"
|
||||
bordered
|
||||
/>
|
||||
</div>
|
||||
|
@@ -1,89 +1,258 @@
|
||||
<script lang="ts" setup>
|
||||
import { Radio, Button, Calendar, DatePicker } from 'ant-design-vue';
|
||||
import { Radio, Button, Calendar, DatePicker, message } from 'ant-design-vue';
|
||||
import type { RadioChangeEvent, BadgeProps } from 'ant-design-vue';
|
||||
import { ref } from 'vue';
|
||||
import { ref, onMounted, reactive } from 'vue';
|
||||
import { Dayjs } from 'dayjs';
|
||||
import dayjs from 'dayjs';
|
||||
import arrangementModal from './arrangement-modal.vue';
|
||||
import workforceDetailModal from './workforce-detail.vue';
|
||||
import workforceDayDetailModal from './workforce-day-detail.vue';
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import type { PersonVO } from './type';
|
||||
import {
|
||||
arrangementCalender,
|
||||
arrangementRemove,
|
||||
} from '#/api/property/attendanceManagement/arrangement'; // 导入接口
|
||||
import { Modal } from 'ant-design-vue';
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'changeView', value: boolean): void;
|
||||
(e: 'changeView', value: 'calender' | 'schedule'): void;
|
||||
}>();
|
||||
const props = defineProps<{
|
||||
viewMode: 'calender' | 'schedule';
|
||||
}>();
|
||||
const selectedDate = ref();
|
||||
// 切换视图模式
|
||||
function handleViewModeChange(e: RadioChangeEvent): void {
|
||||
// 将父组件的isCalenderView变为true
|
||||
emit('changeView', e.target.value);
|
||||
}
|
||||
const calendarData = reactive<any[]>([]);
|
||||
const loading = ref(false);
|
||||
// 查询日历数据
|
||||
const fetchCalendarData = async () => {
|
||||
try {
|
||||
loading.value = true;
|
||||
const params = {
|
||||
month: selectedDate.value?.format('YYYY-MM') || dayjs().format('YYYY-MM'),
|
||||
};
|
||||
const res = await arrangementCalender(params);
|
||||
const currentMonth =
|
||||
selectedDate.value?.format('YYYY-MM') || dayjs().format('YYYY-MM'); //当前月份的开始日期
|
||||
|
||||
// 日历模拟数据
|
||||
// 清空之前的数据
|
||||
calendarData.length = 0;
|
||||
|
||||
// 生成日历渲染数据结构
|
||||
for (const row of res.rows) {
|
||||
if (row.endDate) {
|
||||
const startDate = dayjs(row.startDate);
|
||||
const endDate = dayjs(row.endDate);
|
||||
const currentMonthStart = dayjs(currentMonth).startOf('month');
|
||||
const currentMonthEnd = dayjs(currentMonth).endOf('month');
|
||||
|
||||
//当开始时间小于当前月份的开始日期
|
||||
if (
|
||||
startDate.isBefore(currentMonthStart) ||
|
||||
startDate.isSame(currentMonthStart, 'day')
|
||||
) {
|
||||
// 分析:
|
||||
//如果结束时间小于当前月份的结束时间,则生成当前月份开始时间到row.endDate结束时间的n条数据
|
||||
//如果结束时间大于等于当前月份的结束时间,则生成当前月份开始时间到当前月份结束时间(即当前月份天数)的n条数据
|
||||
// 实现:
|
||||
// 确定结束日期:取row.endDate和当前月份结束日期的较小值
|
||||
// 先判断当前日期与结束日期的大小,如果小则取实际结束时间endDate,否则取月份实际结束时间currentMonthEnd
|
||||
const actualEndDate = endDate.isBefore(currentMonthEnd)
|
||||
? endDate
|
||||
: currentMonthEnd;
|
||||
// 生成数据
|
||||
let currentDate = currentMonthStart;
|
||||
while (
|
||||
currentDate.isSame(actualEndDate, 'day') ||
|
||||
currentDate.isBefore(actualEndDate, 'day')
|
||||
) {
|
||||
calendarData.push({
|
||||
date: currentDate.format('YYYY-MM-DD'),
|
||||
item: {
|
||||
id: row.id,
|
||||
groupName: row.attendanceGroup.groupName,
|
||||
groupId: row.attendanceGroup.id,
|
||||
startDate: row.startDate,
|
||||
endDate: row.endDate,
|
||||
},
|
||||
});
|
||||
currentDate = currentDate.add(1, 'day');
|
||||
}
|
||||
} else {
|
||||
//当开始时间大于当前月份的开始日期
|
||||
//如果结束时间小于当前月份的结束时间,则生成开始时间到结束时间的n条数据
|
||||
// 确定结束日期:取row.endDate和当前月份结束日期的较小值
|
||||
const actualEndDate = endDate.isBefore(currentMonthEnd)
|
||||
? endDate
|
||||
: currentMonthEnd;
|
||||
// 生成从开始日期到实际结束日期的数据
|
||||
let currentDate = startDate;
|
||||
while (
|
||||
currentDate.isSame(actualEndDate, 'day') ||
|
||||
currentDate.isBefore(actualEndDate, 'day')
|
||||
) {
|
||||
calendarData.push({
|
||||
date: currentDate.format('YYYY-MM-DD'),
|
||||
item: {
|
||||
id: row.id,
|
||||
groupName: row.attendanceGroup.groupName,
|
||||
groupId: row.attendanceGroup.id,
|
||||
startDate: row.startDate,
|
||||
endDate: row.endDate,
|
||||
},
|
||||
});
|
||||
currentDate = currentDate.add(1, 'day');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 单个日期排班类型
|
||||
calendarData.push({
|
||||
date: row.startDate,
|
||||
item: {
|
||||
id: row.id,
|
||||
groupName: row.attendanceGroup.groupName,
|
||||
groupId: row.attendanceGroup.id,
|
||||
startDate: row.startDate,
|
||||
endDate: row.endDate,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
//变量calendarData,日期相同的数据放到一个对象中,数据结构为scheduleData
|
||||
|
||||
// 将calendarData按日期分组,形成scheduleData结构
|
||||
const groupedData = new Map<string, any[]>();
|
||||
|
||||
// 遍历calendarData,按日期分组
|
||||
calendarData.forEach((item) => {
|
||||
const date = item.date;
|
||||
if (!groupedData.has(date)) {
|
||||
groupedData.set(date, []);
|
||||
}
|
||||
groupedData.get(date)!.push(item.item);
|
||||
});
|
||||
|
||||
// 转换为scheduleData格式
|
||||
scheduleData.length = 0; // 清空原有数据
|
||||
groupedData.forEach((items, date) => {
|
||||
scheduleData.push({
|
||||
date: date,
|
||||
list: items.map((item) => ({
|
||||
type: 'success' as BadgeProps['status'],
|
||||
content: item.groupName || '排班安排',
|
||||
item: item,
|
||||
})),
|
||||
});
|
||||
});
|
||||
// 验证是否有重复日期
|
||||
const dateCounts = new Map<string, number>();
|
||||
calendarData.forEach((item) => {
|
||||
const count = dateCounts.get(item.date) || 0;
|
||||
dateCounts.set(item.date, count + 1);
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('获取日历数据失败:', error);
|
||||
message.error('获取日历数据失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
const scheduleData: {
|
||||
date: string;
|
||||
list: { type: BadgeProps['status']; content: string }[];
|
||||
}[] = [
|
||||
{ date: '2025-07-08', list: [{ type: 'warning', content: '7月8日事件' }] },
|
||||
{ date: '2025-07-06', list: [{ type: 'success', content: '8月8日事件' }] },
|
||||
// ...
|
||||
//组件需要数据结构 { date: '2025-07-08', list: [{ type: 'warning', content: '7月8日事件' }] },
|
||||
];
|
||||
// 切换视图模式
|
||||
function handleViewModeChange(e: RadioChangeEvent): void {
|
||||
emit('changeView', e.target.value);
|
||||
}
|
||||
|
||||
const getListData2 = (
|
||||
current: Dayjs,
|
||||
): { type: BadgeProps['status']; content: string }[] => {
|
||||
): { type: BadgeProps['status']; content: string; item?: any }[] => {
|
||||
const dateStr = current.format('YYYY-MM-DD');
|
||||
const found = scheduleData.find((item) => item.date === dateStr);
|
||||
return found ? found.list : [];
|
||||
};
|
||||
const getListData = (
|
||||
value: Dayjs,
|
||||
): { type: BadgeProps['status']; content: string }[] => {
|
||||
let listData: { type: BadgeProps['status']; content: string }[] | undefined;
|
||||
switch (value.date()) {
|
||||
case 8:
|
||||
listData = [
|
||||
{ type: 'warning', content: 'This is warning event.' },
|
||||
{ type: 'success', content: 'This is usual event.' },
|
||||
];
|
||||
break;
|
||||
case 10:
|
||||
listData = [
|
||||
{ type: 'warning', content: 'This is warning event.' },
|
||||
{ type: 'success', content: 'This is usual event.' },
|
||||
{ type: 'error', content: 'This is error event.' },
|
||||
];
|
||||
break;
|
||||
case 15:
|
||||
listData = [
|
||||
{ type: 'warning', content: 'This is warning event' },
|
||||
{ type: 'success', content: 'This is very long usual event。。....' },
|
||||
{ type: 'error', content: 'This is error event 1.' },
|
||||
{ type: 'error', content: 'This is error event 2.' },
|
||||
{ type: 'error', content: 'This is error event 3.' },
|
||||
{ type: 'error', content: 'This is error event 4.' },
|
||||
];
|
||||
break;
|
||||
default:
|
||||
|
||||
// 使用scheduleData结构
|
||||
if (scheduleData.length > 0) {
|
||||
const found = scheduleData.find((item) => item.date === dateStr);
|
||||
if (found) {
|
||||
return found.list;
|
||||
}
|
||||
}
|
||||
return listData || [];
|
||||
// 如果没有找到数据,返回空数组
|
||||
return [];
|
||||
};
|
||||
|
||||
const getMonthData = (value: Dayjs) => {
|
||||
if (value.month() === 8) {
|
||||
return 1394;
|
||||
}
|
||||
};
|
||||
function customHeader() {
|
||||
// 返回你想要的VNode或null
|
||||
// 返回想要的VNode或null
|
||||
return null; // 什么都不显示
|
||||
}
|
||||
const [ArrangementModal, modalApi] = useVbenModal({
|
||||
const [ArrangementModal, arrangementModalApi] = useVbenModal({
|
||||
connectedComponent: arrangementModal,
|
||||
});
|
||||
const [WorkforceDetailModal, workforceDetailModalApi] = useVbenModal({
|
||||
connectedComponent: workforceDetailModal,
|
||||
});
|
||||
const [WorkforceDayDetailModal, workforceDayDetailModalApi] = useVbenModal({
|
||||
connectedComponent: workforceDayDetailModal,
|
||||
});
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
arrangementModalApi.setData({});
|
||||
arrangementModalApi.open();
|
||||
}
|
||||
|
||||
// 编辑排班
|
||||
function handleEdit(item: any, date: string) {
|
||||
workforceDetailModalApi.setData({
|
||||
id: item.id as number | string,
|
||||
date: dayjs(date).format('YYYY-MM-DD'),
|
||||
});
|
||||
workforceDetailModalApi.open();
|
||||
// arrangementModalApi.setData({
|
||||
// id: item.id,
|
||||
// groupId: item.groupId,
|
||||
// startDate: item.startDate,
|
||||
// endDate: item.endDate,
|
||||
// });
|
||||
// arrangementModalApi.open();
|
||||
}
|
||||
|
||||
// 删除排班
|
||||
function handleDelete(item: any) {
|
||||
Modal.confirm({
|
||||
title: '确认删除',
|
||||
content: '确定要删除这个排班安排吗?',
|
||||
onOk: async () => {
|
||||
try {
|
||||
// 这里需要调用删除接口
|
||||
await arrangementRemove(item.id);
|
||||
message.success('删除成功');
|
||||
fetchCalendarData();
|
||||
} catch (error) {
|
||||
console.error('删除失败:', error);
|
||||
message.error('删除失败');
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 查看某日期的所有排班详情
|
||||
function handleViewDateDetails(date: string) {
|
||||
workforceDayDetailModalApi.setData({
|
||||
date: dayjs(date).format('YYYY-MM-DD'),
|
||||
});
|
||||
workforceDayDetailModalApi.open();
|
||||
}
|
||||
|
||||
// 页面初始化时加载数据
|
||||
onMounted(() => {
|
||||
fetchCalendarData();
|
||||
});
|
||||
|
||||
// 暴露方法给父组件调用
|
||||
defineExpose({
|
||||
fetchCalendarData,
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="flex h-full flex-col">
|
||||
@@ -98,11 +267,16 @@ function handleAdd() {
|
||||
</Radio.Group>
|
||||
<div class="my-auto flex gap-1">
|
||||
<div class="my-auto">排班日历</div>
|
||||
<DatePicker picker="month" v-model:value="selectedDate" />
|
||||
<DatePicker
|
||||
picker="month"
|
||||
v-model:value="selectedDate"
|
||||
@change="fetchCalendarData()"
|
||||
@select="fetchCalendarData()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<Button type="primary" @click="handleAdd">新增排班</Button>
|
||||
<Button type="primary" @click="handleAdd" v-access:code="['Property:arrangement:add']">新增排班</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-1 p-1">
|
||||
@@ -110,37 +284,51 @@ function handleAdd() {
|
||||
v-model:value="selectedDate"
|
||||
:mode="'month'"
|
||||
:headerRender="customHeader"
|
||||
:loading="loading"
|
||||
>
|
||||
<template #dateCellRender="{ current }">
|
||||
<ul class="events">
|
||||
<li v-for="item in getListData2(current)" :key="item.content">
|
||||
<span>
|
||||
<!-- <Badge :status="item.type" :text="item.content" /> -->
|
||||
<span>{{ item.content }}</span>
|
||||
<a style="margin-left: 4px; color: #1890ff; cursor: pointer"
|
||||
>编辑</a
|
||||
>
|
||||
<a style="margin-left: 4px; color: #ff4d4f; cursor: pointer"
|
||||
>删除</a
|
||||
>
|
||||
<div class="action-buttons">
|
||||
<a
|
||||
style="margin-left: 4px; color: #1890ff; cursor: pointer"
|
||||
@click.stop="handleEdit(item.item, current)"
|
||||
v-access:code="['Property:arrangement:edit']"
|
||||
|
||||
>
|
||||
编辑
|
||||
</a>
|
||||
<a
|
||||
style="margin-left: 4px; color: #ff4d4f; cursor: pointer"
|
||||
@click.stop="handleDelete(item.item)"
|
||||
v-access:code="['Property:arrangement:remove']"
|
||||
|
||||
>
|
||||
删除
|
||||
</a>
|
||||
</div>
|
||||
</span>
|
||||
</li>
|
||||
<a
|
||||
v-if="getListData2(current).length > 0"
|
||||
style="margin-left: 4px; color: #1890ff; cursor: pointer"
|
||||
>详情</a
|
||||
@click.stop="handleViewDateDetails(current)"
|
||||
v-access:code="['Property:userGroup:queryScheduleView']"
|
||||
>
|
||||
详情
|
||||
</a>
|
||||
</ul>
|
||||
</template>
|
||||
<template #monthCellRender="{ current }">
|
||||
<div v-if="getMonthData(current)" class="notes-month">
|
||||
<section>{{ getMonthData(current) }}</section>
|
||||
<span>Backlog number</span>
|
||||
</div>
|
||||
</template>
|
||||
</Calendar>
|
||||
</div>
|
||||
<ArrangementModal @reload="" />
|
||||
<!-- 新增排班弹窗 -->
|
||||
<ArrangementModal @reload="fetchCalendarData()" />
|
||||
<!-- 编辑排班弹窗 -->
|
||||
<WorkforceDetailModal @reload="fetchCalendarData()" />
|
||||
<!-- 查看某天的排班列表 -->
|
||||
<WorkforceDayDetailModal @reload="workforceDayDetailModalApi.close()" />
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
@@ -156,6 +344,32 @@ function handleAdd() {
|
||||
text-overflow: ellipsis;
|
||||
font-size: 12px;
|
||||
}
|
||||
.events li {
|
||||
margin-bottom: 4px;
|
||||
padding: 4px;
|
||||
/* background-color: #f6ffed; */
|
||||
/* border: 1px solid #b7eb8f; */
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.events li span {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.events li .action-buttons {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
.events li a {
|
||||
font-size: 11px;
|
||||
text-decoration: none;
|
||||
}
|
||||
.events li a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.notes-month {
|
||||
text-align: center;
|
||||
font-size: 28px;
|
||||
|
@@ -1,5 +1,7 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import { renderDict } from '#/utils/render';
|
||||
import { attendanceAreaList } from '#/api/property/attendanceManagement/attendanceArea';
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
@@ -57,7 +59,7 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
export const unitQuerySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'scheduleName',
|
||||
fieldName: 'userName',
|
||||
label: '姓名',
|
||||
},
|
||||
{
|
||||
@@ -81,34 +83,58 @@ export const columns: VxeGridProps['columns'] = [
|
||||
},
|
||||
{
|
||||
title: '人员',
|
||||
field: 'scheduleName',
|
||||
field: 'remoteUserVo.userName',
|
||||
width: 120,
|
||||
// width: 'auto',
|
||||
},
|
||||
{
|
||||
title: '单位',
|
||||
field: 'scheduleName',
|
||||
field: 'deptName',
|
||||
width: 'auto',
|
||||
},
|
||||
{
|
||||
title: '排班名称',
|
||||
field: 'scheduleName',
|
||||
minWidth: 120,
|
||||
},
|
||||
// {
|
||||
// title: '排班名称',
|
||||
// field: 'attendanceArrangement.scheduleName',
|
||||
// minWidth: 120,
|
||||
// },
|
||||
{
|
||||
title: '考勤组',
|
||||
field: 'groupId',
|
||||
field: 'attendanceGroup.groupName',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: '考勤类型',
|
||||
field: 'scheduleType',
|
||||
field: 'attendanceGroup.attendanceType',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(
|
||||
String(row.attendanceGroup.attendanceType),
|
||||
'wy_kqlx',
|
||||
);
|
||||
},
|
||||
},
|
||||
width: 'auto',
|
||||
},
|
||||
{
|
||||
title: '考勤时间',
|
||||
field: 'dateType',
|
||||
field: 'attendanceShift',
|
||||
minWidth: 200,
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
if (!row.attendanceShift) return '/';
|
||||
if (row.attendanceShift.startTime && row.attendanceShift.endTime) {
|
||||
if (
|
||||
row.attendanceShift.restEndTime &&
|
||||
row.attendanceShift.restStartTime
|
||||
) {
|
||||
return `${row.attendanceShift.startTime}~${row.attendanceShift.endTime} ${row.attendanceShift.restStartTime}~${row.attendanceShift.restEndTime}`;
|
||||
} else {
|
||||
return `${row.attendanceShift.startTime}~${row.attendanceShift.endTime}`;
|
||||
}
|
||||
}
|
||||
return '/';
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
@@ -175,12 +201,12 @@ export const unitColumns: VxeGridProps['columns'] = [
|
||||
},
|
||||
{
|
||||
title: '所属单位',
|
||||
field: 'unitName',
|
||||
field: 'deptName',
|
||||
width: 'auto',
|
||||
},
|
||||
{
|
||||
title: '电话',
|
||||
field: 'phone',
|
||||
field: 'phonenumber',
|
||||
minWidth: 120,
|
||||
},
|
||||
];
|
||||
@@ -236,6 +262,20 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '选择区域',
|
||||
fieldName: 'areaId',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: async () => {
|
||||
const res = await attendanceAreaList({ pageNum: 1, pageSize: 10000 });
|
||||
return res;
|
||||
},
|
||||
resultField: 'rows',
|
||||
labelField: '',
|
||||
valueField: '',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态:0-未生效,1-已生效',
|
||||
fieldName: 'status',
|
||||
@@ -246,3 +286,86 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
//排班日期详情
|
||||
export const workforceDayDetailColumns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '序号',
|
||||
field: 'id',
|
||||
width: 60,
|
||||
slots: {
|
||||
default: ({ rowIndex }) => {
|
||||
return (rowIndex + 1).toString();
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '考勤组',
|
||||
field: 'attendanceGroup.groupName',
|
||||
width: 'auto',
|
||||
},
|
||||
{
|
||||
title: '考勤类型',
|
||||
field: 'attendanceGroup.attendanceType',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(
|
||||
String(row.attendanceGroup.attendanceType),
|
||||
'wy_kqlx',
|
||||
);
|
||||
},
|
||||
},
|
||||
width: 'auto',
|
||||
},
|
||||
{
|
||||
title: '班次名称',
|
||||
field: 'shift.name',
|
||||
width: 'auto',
|
||||
},
|
||||
{
|
||||
title: '考勤时间',
|
||||
field: 'time',
|
||||
width: 'auto',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
if (row.shift.startTime && row.shift.endTime) {
|
||||
if (row.shift.restEndTime && row.shift.restStartTime) {
|
||||
return `${row.shift.startTime}~${row.shift.endTime} ${row.shift.restStartTime}~${row.shift.restEndTime}`;
|
||||
} else {
|
||||
return `${row.shift.startTime}~${row.shift.endTime}`;
|
||||
}
|
||||
}
|
||||
return '/';
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '区域',
|
||||
field: 'areaList',
|
||||
width: 'auto',
|
||||
slots: {
|
||||
default: ({ row }: { row: any }) => {
|
||||
if (!row.areaList || !Array.isArray(row.areaList)) {
|
||||
return '';
|
||||
}
|
||||
return row.areaList
|
||||
.map((item: any) => item.area || '')
|
||||
.filter((areaName: string) => areaName)
|
||||
.join(', ');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '班组人数',
|
||||
field: 'userCount',
|
||||
width: 100,
|
||||
slots: { default: 'userCount' },
|
||||
},
|
||||
{
|
||||
title: '人员',
|
||||
field: 'userGroupList',
|
||||
minWidth: 200,
|
||||
fixed: 'right',
|
||||
slots: { default: 'userGroupList' },
|
||||
},
|
||||
];
|
||||
|
@@ -0,0 +1,122 @@
|
||||
<script setup lang="ts">
|
||||
import type { PropType } from 'vue';
|
||||
import type { DeptTree } from '#/api/system/user/model';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { SyncOutlined } from '@ant-design/icons-vue';
|
||||
import { Empty, InputSearch, Skeleton, Tree } from 'ant-design-vue';
|
||||
import { getDeptTree } from '#/api/system/user';
|
||||
|
||||
defineOptions({ inheritAttrs: false });
|
||||
|
||||
withDefaults(defineProps<{ showSearch?: boolean }>(), { showSearch: true });
|
||||
|
||||
const emit = defineEmits<{
|
||||
/**
|
||||
* 点击刷新按钮的事件
|
||||
*/
|
||||
reload: [];
|
||||
/**
|
||||
* 点击节点的事件
|
||||
*/
|
||||
select: [];
|
||||
}>();
|
||||
|
||||
const selectDeptId = defineModel('selectDeptId', {
|
||||
required: true,
|
||||
type: Array as PropType<string[]>,
|
||||
});
|
||||
|
||||
const searchValue = defineModel('searchValue', {
|
||||
type: String,
|
||||
default: '',
|
||||
});
|
||||
|
||||
/** 部门数据源 */
|
||||
type DeptTreeArray = DeptTree[];
|
||||
const deptTreeArray = ref<DeptTreeArray>([]);
|
||||
/** 骨架屏加载 */
|
||||
const showTreeSkeleton = ref<boolean>(true);
|
||||
|
||||
async function loadTree() {
|
||||
showTreeSkeleton.value = true;
|
||||
searchValue.value = '';
|
||||
selectDeptId.value = [];
|
||||
const ret = await getDeptTree();
|
||||
deptTreeArray.value = ret;
|
||||
showTreeSkeleton.value = false;
|
||||
}
|
||||
|
||||
async function handleReload() {
|
||||
await loadTree();
|
||||
emit('reload');
|
||||
}
|
||||
|
||||
onMounted(loadTree);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :class="$attrs.class">
|
||||
<Skeleton
|
||||
:loading="showTreeSkeleton"
|
||||
:paragraph="{ rows: 8 }"
|
||||
active
|
||||
class="p-[8px]"
|
||||
>
|
||||
<div
|
||||
class="bg-background flex h-full flex-col overflow-y-auto rounded-lg"
|
||||
>
|
||||
<!-- 固定在顶部 必须加上bg-background背景色 否则会产生'穿透'效果 -->
|
||||
<div
|
||||
v-if="showSearch"
|
||||
class="bg-background z-100 sticky left-0 top-0 p-[8px]"
|
||||
>
|
||||
<InputSearch
|
||||
v-model:value="searchValue"
|
||||
:placeholder="$t('pages.common.search')"
|
||||
size="small"
|
||||
>
|
||||
<template #enterButton>
|
||||
<a-button @click="handleReload">
|
||||
<SyncOutlined class="text-primary" />
|
||||
</a-button>
|
||||
</template>
|
||||
</InputSearch>
|
||||
</div>
|
||||
<div class="h-full overflow-x-hidden px-[8px]">
|
||||
<Tree
|
||||
v-bind="$attrs"
|
||||
v-if="deptTreeArray.length > 0"
|
||||
v-model:selected-keys="selectDeptId"
|
||||
:class="$attrs.class"
|
||||
:field-names="{ title: 'label', key: 'id' }"
|
||||
:show-line="{ showLeafIcon: false }"
|
||||
:tree-data="deptTreeArray"
|
||||
:virtual="false"
|
||||
default-expand-all
|
||||
@select="$emit('select')"
|
||||
>
|
||||
<template #title="{ label }">
|
||||
<span v-if="label.indexOf(searchValue) > -1">
|
||||
{{ label.substring(0, label.indexOf(searchValue)) }}
|
||||
<span style="color: #f50">{{ searchValue }}</span>
|
||||
{{
|
||||
label.substring(
|
||||
label.indexOf(searchValue) + searchValue.length,
|
||||
)
|
||||
}}
|
||||
</span>
|
||||
<span v-else>{{ label }}</span>
|
||||
</template>
|
||||
</Tree>
|
||||
<!-- 仅本人数据权限 可以考虑直接不显示 -->
|
||||
<div v-else class="mt-5">
|
||||
<Empty
|
||||
:image="Empty.PRESENTED_IMAGE_SIMPLE"
|
||||
description="无部门数据"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Skeleton>
|
||||
</div>
|
||||
</template>
|
@@ -1,22 +1,36 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { ref, nextTick } from 'vue';
|
||||
import calendarView from './calendarView.vue';
|
||||
import scheduleView from './scheduleView.vue';
|
||||
const viewMode = ref<'calender' | 'schedule'>('calender');
|
||||
// const isCalenderView = ref(true);
|
||||
const calendarViewRef = ref();
|
||||
const scheduleViewRef = ref();
|
||||
|
||||
function handleViewModeChange(mode: 'calender' | 'schedule') {
|
||||
viewMode.value = mode;
|
||||
// 切换视图后,需要重新加载对应视图的数据
|
||||
nextTick(() => {
|
||||
if (mode === 'calender') {
|
||||
// 触发日历视图的数据加载
|
||||
calendarViewRef.value?.fetchCalendarData();
|
||||
} else if (mode === 'schedule') {
|
||||
// 触发班表视图的数据加载
|
||||
scheduleViewRef.value?.tableApi?.query();
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="h-full p-4">
|
||||
<div class="h-full bg-white p-4">
|
||||
<calendarView
|
||||
ref="calendarViewRef"
|
||||
v-show="viewMode === 'calender'"
|
||||
:viewMode="viewMode"
|
||||
@changeView="handleViewModeChange"
|
||||
/>
|
||||
<scheduleView
|
||||
ref="scheduleViewRef"
|
||||
v-show="viewMode === 'schedule'"
|
||||
:viewMode="viewMode"
|
||||
@changeView="handleViewModeChange"
|
||||
|
@@ -7,24 +7,28 @@ import { columns } from './data';
|
||||
import { useVbenVxeGrid, type VxeGridProps } from '#/adapter/vxe-table';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
import {
|
||||
arrangementList,
|
||||
queryScheduleView,
|
||||
arrangementRemove,
|
||||
} from '#/api/property/attendanceManagement/arrangement';
|
||||
import arrangementModal from './arrangement-modal.vue';
|
||||
import type { ArrangementForm } from '#/api/property/attendanceManagement/arrangement/model';
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
import { Popconfirm, Space } from 'ant-design-vue';
|
||||
const emit = defineEmits<{ (e: 'changeView', value: boolean): void }>();
|
||||
import dayjs from 'dayjs';
|
||||
const emit = defineEmits<{
|
||||
(e: 'changeView', value: 'calender' | 'schedule'): void;
|
||||
}>();
|
||||
const props = defineProps<{
|
||||
viewMode: 'calender' | 'schedule';
|
||||
}>();
|
||||
const value = ref<Dayjs>();
|
||||
const onPanelChange = (value: Dayjs, mode: string) => {
|
||||
console.log(value, mode);
|
||||
const onSelect = (value: Dayjs) => {
|
||||
currentDate.value = dayjs(value).format('YYYY-MM-DD');
|
||||
tableApi.query();
|
||||
};
|
||||
let currentDate = ref<string>(dayjs().format('YYYY-MM-DD'));
|
||||
// 切换视图模式
|
||||
function handleViewModeChange(e: RadioChangeEvent): void {
|
||||
// 将父组件的isCalenderView变为false
|
||||
emit('changeView', e.target.value);
|
||||
}
|
||||
|
||||
@@ -45,11 +49,11 @@ const gridOptions: VxeGridProps = {
|
||||
pagerConfig: {},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues = {}) => {
|
||||
return await arrangementList({
|
||||
query: async ({ page }) => {
|
||||
return await queryScheduleView({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
currentDate: currentDate.value,
|
||||
});
|
||||
},
|
||||
},
|
||||
@@ -78,15 +82,15 @@ function handleAdd() {
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<ArrangementForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<ArrangementForm>) {
|
||||
await arrangementRemove(row.id);
|
||||
await arrangementRemove(row.scheduleId);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
// 暴露方法给父组件调用
|
||||
defineExpose({
|
||||
tableApi,
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="h-full">
|
||||
@@ -110,12 +114,13 @@ async function handleDelete(row: Required<ArrangementForm>) {
|
||||
border: '1px solid #d9d9d9',
|
||||
borderRadius: '4px',
|
||||
}"
|
||||
class="calendar"
|
||||
>
|
||||
<Calendar
|
||||
v-model:value="value"
|
||||
:fullscreen="false"
|
||||
:mode="'month'"
|
||||
@panelChange="onPanelChange"
|
||||
@select="onSelect"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -124,24 +129,18 @@ async function handleDelete(row: Required<ArrangementForm>) {
|
||||
<BasicTable>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:arrangement:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
</ghost-button>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认删除?"
|
||||
title="确认移除?"
|
||||
@confirm="handleDelete(row)"
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['property:arrangement:remove']"
|
||||
v-access:code="['Property:arrangement:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
移除
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
@@ -153,4 +152,8 @@ async function handleDelete(row: Required<ArrangementForm>) {
|
||||
<ArrangementModal @reload="tableApi.query()" />
|
||||
</div>
|
||||
</template>
|
||||
<style></style>
|
||||
<style scoped>
|
||||
.calendar :deep(.ant-radio-group) {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,67 +1,52 @@
|
||||
//列表数据,用于展示人员列表
|
||||
export interface PersonVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
userId: string | number;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
userId: string;
|
||||
tenantId: string;
|
||||
deptId: number;
|
||||
userName: string;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone: string;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
gender: number;
|
||||
|
||||
/**
|
||||
* 人脸图片
|
||||
*/
|
||||
img: string;
|
||||
|
||||
/**
|
||||
* 所属单位id
|
||||
*/
|
||||
unitId: string | number;
|
||||
|
||||
/**
|
||||
* 所属单位名称
|
||||
*/
|
||||
unitName: string;
|
||||
|
||||
/**
|
||||
* 入驻位置
|
||||
*/
|
||||
locathon: string;
|
||||
|
||||
/**
|
||||
* 入驻时间
|
||||
*/
|
||||
time: string;
|
||||
|
||||
/**
|
||||
* 车牌号码
|
||||
*/
|
||||
carNumber: string;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
state: number | string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
nickName: string;
|
||||
userType: string;
|
||||
email: string;
|
||||
phonenumber: string;
|
||||
sex: string;
|
||||
avatar?: string;
|
||||
status: string;
|
||||
loginIp: string;
|
||||
loginDate: string;
|
||||
remark: string;
|
||||
createTime: string;
|
||||
dept: Dept;
|
||||
roles: Role[];
|
||||
roleIds?: string[];
|
||||
postIds?: number[];
|
||||
roleId: string;
|
||||
deptName: string;
|
||||
}
|
||||
export interface Dept {
|
||||
deptId: number;
|
||||
parentId: number;
|
||||
parentName?: string;
|
||||
ancestors: string;
|
||||
deptName: string;
|
||||
orderNum: number;
|
||||
leader: string;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
status: string;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
export interface Role {
|
||||
roleId: string;
|
||||
roleName: string;
|
||||
roleKey: string;
|
||||
roleSort: number;
|
||||
dataScope: string;
|
||||
menuCheckStrictly?: boolean;
|
||||
deptCheckStrictly?: boolean;
|
||||
status: string;
|
||||
remark: string;
|
||||
createTime?: string;
|
||||
flag: boolean;
|
||||
superAdmin: boolean;
|
||||
}
|
||||
|