[add] 新增萤石摄像头抓拍相关逻辑,获取方阵内光伏板、桩点支柱立架、箱变、逆变器地理信息接口
This commit is contained in:
@ -5,7 +5,11 @@ VITE_APP_TITLE = 新能源项目管理平台
|
||||
VITE_APP_ENV = 'development'
|
||||
|
||||
# 开发环境
|
||||
VITE_APP_BASE_API = 'http://192.168.110.6:8899'
|
||||
VITE_APP_BASE_API = 'http://192.168.110.119:8899'
|
||||
|
||||
# 无人机接口地址
|
||||
|
||||
VITE_APP_BASE_DRONE_API = 'http://192.168.110.8:9136'
|
||||
|
||||
# 应用访问路径 例如使用前缀 /admin/
|
||||
VITE_APP_CONTEXT_PATH = '/'
|
||||
|
@ -14,7 +14,7 @@ VITE_APP_MONITOR_ADMIN = '/admin/applications'
|
||||
VITE_APP_SNAILJOB_ADMIN = '/snail-job'
|
||||
|
||||
# 生产环境
|
||||
VITE_APP_BASE_API = 'http://192.168.110.5:8899'
|
||||
VITE_APP_BASE_API = 'http://192.168.110.2:8899'
|
||||
|
||||
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
||||
VITE_BUILD_COMPRESS = gzip
|
||||
|
@ -4,7 +4,7 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<meta name="renderer" content="webkit" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<title>新能源项目管理平台</title>
|
||||
<!--[if lt IE 11
|
||||
@ -209,6 +209,8 @@
|
||||
<div class="load_title">正在加载系统资源,请耐心等待</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="./src/assets/sdk/YJEarth.min.js"></script>
|
||||
<script src="./src/utils/reconnecting-websocket.js"></script>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -20,8 +20,10 @@
|
||||
"url": "https://gitee.com/JavaLionLi/plus-ui.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"@amap/amap-jsapi-loader": "^1.0.1",
|
||||
"@element-plus/icons-vue": "2.3.1",
|
||||
"@highlightjs/vue-plugin": "2.1.0",
|
||||
"@turf/turf": "^7.2.0",
|
||||
"@vueup/vue-quill": "1.2.0",
|
||||
"@vueuse/core": "11.3.0",
|
||||
"animate.css": "4.1.1",
|
||||
@ -33,21 +35,32 @@
|
||||
"echarts": "5.5.0",
|
||||
"element-plus": "2.8.8",
|
||||
"esbuild": "^0.25.0",
|
||||
"ezuikit-js": "^8.1.10",
|
||||
"file-saver": "2.0.5",
|
||||
"fuse.js": "7.0.0",
|
||||
"highlight.js": "11.9.0",
|
||||
"image-conversion": "2.1.1",
|
||||
"js-cookie": "3.0.5",
|
||||
"js-md5": "^0.8.3",
|
||||
"jsencrypt": "3.3.2",
|
||||
"jszip": "^3.10.1",
|
||||
"lodash": "^4.17.21",
|
||||
"md5": "^2.3.0",
|
||||
"mitt": "^3.0.1",
|
||||
"nprogress": "0.2.0",
|
||||
"ol": "^10.5.0",
|
||||
"pinia": "2.2.6",
|
||||
"screenfull": "6.0.2",
|
||||
"spark-md5": "^3.0.2",
|
||||
"vue": "3.5.13",
|
||||
"vue-cropper": "1.1.1",
|
||||
"vue-i18n": "10.0.5",
|
||||
"vue-json-pretty": "2.4.0",
|
||||
"vue-print-nb": "^1.7.5",
|
||||
"vue-router": "4.4.5",
|
||||
"vue-types": "5.1.3",
|
||||
"vue3-print-nb": "^0.1.4",
|
||||
"vue3-scroll-seamless": "^1.0.6",
|
||||
"vxe-table": "4.5.22"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -70,6 +83,7 @@
|
||||
"fast-glob": "3.3.2",
|
||||
"globals": "15.12.0",
|
||||
"postcss": "8.4.36",
|
||||
"postcss-px-to-viewport": "^1.1.1",
|
||||
"prettier": "3.2.5",
|
||||
"sass": "1.72.0",
|
||||
"typescript": "5.7.2",
|
||||
|
@ -1,4 +1,4 @@
|
||||
<template>
|
||||
<template loading="true">
|
||||
<el-config-provider :locale="appStore.locale" :size="appStore.size">
|
||||
<router-view />
|
||||
</el-config-provider>
|
||||
@ -8,13 +8,33 @@
|
||||
import useSettingsStore from '@/store/modules/settings';
|
||||
import { handleThemeStyle } from '@/utils/theme';
|
||||
import useAppStore from '@/store/modules/app';
|
||||
|
||||
import { getProjectTeam } from './utils/projectTeam';
|
||||
const appStore = useAppStore();
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
// 初始化主题样式
|
||||
handleThemeStyle(useSettingsStore().theme);
|
||||
getProjectTeam();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
* {
|
||||
-webkit-touch-callout: none; /*系统默认菜单被禁用*/
|
||||
-webkit-user-select: none; /*webkit浏览器*/
|
||||
-khtml-user-select: none; /*早期浏览器*/
|
||||
-moz-user-select: none; /*火狐*/
|
||||
-ms-user-select: none; /*IE10*/
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
input {
|
||||
-webkit-user-select: auto; /*webkit浏览器*/
|
||||
user-select: auto;
|
||||
}
|
||||
textarea {
|
||||
user-select: auto;
|
||||
-webkit-user-select: auto; /*webkit浏览器*/
|
||||
}
|
||||
</style>
|
||||
|
@ -45,7 +45,8 @@ export interface MachineryForm extends BaseEntity {
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
principalPhone: string | number;
|
||||
provider: string | number;
|
||||
/**
|
||||
* 机械名称
|
||||
*/
|
||||
@ -82,7 +83,8 @@ export interface MachineryQuery extends PageQuery {
|
||||
* 机械名称
|
||||
*/
|
||||
machineryName?: string;
|
||||
|
||||
principalPhone: string | number;
|
||||
provider: string | number;
|
||||
/**
|
||||
* 机械型号
|
||||
*/
|
||||
|
@ -45,6 +45,8 @@ export interface CompanyForm extends BaseEntity {
|
||||
* 公司名称
|
||||
*/
|
||||
companyName?: string;
|
||||
principalPhone?: string;
|
||||
principal?: string;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
@ -72,6 +74,8 @@ export interface CompanyQuery extends PageQuery {
|
||||
* 公司名称
|
||||
*/
|
||||
companyName?: string;
|
||||
principalPhone?: string;
|
||||
principal?: string;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
|
@ -1,7 +1,33 @@
|
||||
import request from '@/utils/request';
|
||||
import request, { download } from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { ConstructionUserForm, ConstructionUserQuery, ConstructionUserVO } from '@/api/project/constructionUser/types';
|
||||
import {
|
||||
ConstructionUserForm,
|
||||
ConstructionUserQuery,
|
||||
ConstructionUserVO,
|
||||
skipType,
|
||||
ConstructionUserStatusForm,
|
||||
ConstructionUserPlayCardForm,
|
||||
ConstructionUserSalaryForm,
|
||||
ConstructionUserExitForm,
|
||||
ConstructionUserTemplateForm,
|
||||
ConstructionUserMembeForm,
|
||||
ConstructionMonthQuery
|
||||
} from '@/api/project/constructionUser/types';
|
||||
import { AttendanceMonthVO } from '../attendance/types';
|
||||
|
||||
/**
|
||||
* 查询施工人员月份考勤列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listConstructionMonth = (query?: ConstructionMonthQuery): AxiosPromise<AttendanceMonthVO[]> => {
|
||||
return request({
|
||||
url: '/project/constructionUser/list/attendance/month',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 查询施工人员列表
|
||||
* @param query
|
||||
@ -27,6 +53,28 @@ export const getConstructionUser = (id: string | number): AxiosPromise<Construct
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 人员迁移
|
||||
* @param data
|
||||
*/
|
||||
export const transferConstructionUser = (data: skipType) => {
|
||||
return request({
|
||||
url: '/project/constructionUser/change/project',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询项目以及项目下的分包公司列表
|
||||
*/
|
||||
export const getProjectContractorList = () => {
|
||||
return request({
|
||||
url: '/project/project/list/project/contractorList',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增施工人员
|
||||
* @param data
|
||||
@ -61,3 +109,97 @@ export const delConstructionUser = (id: string | number | Array<string | number>
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改施工人员在职状态
|
||||
* @param data
|
||||
*/
|
||||
export const updateConstructionUserStatus = (data: ConstructionUserStatusForm) => {
|
||||
return request({
|
||||
url: '/project/constructionUser/batch/status',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据项目id批量修改施工人员打卡状态
|
||||
* @param data
|
||||
*/
|
||||
export const updateConstructionUserPlayCardStatus = (data: ConstructionUserPlayCardForm) => {
|
||||
return request({
|
||||
url: '/project/constructionUser/batch/clock',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改施工人员打卡状态
|
||||
* @param data
|
||||
*/
|
||||
export const updateConstructionUserPlayCardOneStatus = (data: ConstructionUserPlayCardForm) => {
|
||||
return request({
|
||||
url: '/project/constructionUser/clock',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改施工人员工资
|
||||
* @param data
|
||||
*/
|
||||
export const updateConstructionUserSalary = (data: ConstructionUserSalaryForm) => {
|
||||
return request({
|
||||
url: '/project/constructionUser/salary',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询施工人员入退场记录
|
||||
* @param query
|
||||
*/
|
||||
export const getConstructionUserExit = (query: ConstructionUserExitForm) => {
|
||||
return request({
|
||||
url: '/project/constructionUserExit/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 下载施工人员文件存储模板
|
||||
* @param query
|
||||
*/
|
||||
export const dowloadConstructionUserTemplate = (query: ConstructionUserTemplateForm) => {
|
||||
let { projectId } = query;
|
||||
const fileName = projectId + '_project.zip';
|
||||
return download('/project/constructionUserFile/exportFileTemplate', query, fileName);
|
||||
};
|
||||
|
||||
/**
|
||||
* 施工人员退场
|
||||
* @param data
|
||||
*/
|
||||
export const delConstructionUserMember = (data: ConstructionUserMembeForm) => {
|
||||
return request({
|
||||
url: '/project/projectTeamMember/',
|
||||
method: 'delete',
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 上传施工人员文件压缩包,批量导入存储施工人员文件
|
||||
* @param data
|
||||
*/
|
||||
export const importConstructionUserInfo = (file: string) => {
|
||||
return request({
|
||||
url: '/project/constructionUserFile/upload/zip',
|
||||
method: 'post',
|
||||
data: { file }
|
||||
});
|
||||
};
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { ContractorVO } from '@/api/project/contractor/types';
|
||||
import { ProjectTeamVO } from '@/api/project/projectTeam/types';
|
||||
import { S } from 'node_modules/vite/dist/node/types.d-aGj9QkWt';
|
||||
|
||||
export interface ConstructionUserVO {
|
||||
/**
|
||||
@ -182,6 +183,118 @@ export interface ConstructionUserVO {
|
||||
*/
|
||||
createTime: string;
|
||||
}
|
||||
export interface skipType {
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId: string | number;
|
||||
|
||||
/**
|
||||
* 分包id
|
||||
*/
|
||||
contractorId: string | number;
|
||||
id: string | number;
|
||||
}
|
||||
|
||||
export interface ConstructionMonthQuery {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
userId: string | number;
|
||||
|
||||
/**
|
||||
* 打卡月份
|
||||
|
||||
*/
|
||||
clockMonth?: string | number;
|
||||
}
|
||||
|
||||
export interface ConstructionUserMembeForm {
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
id: string | number;
|
||||
/**
|
||||
* 用户姓名
|
||||
*/
|
||||
userName: string | number;
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
filePath: string;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string | number;
|
||||
}
|
||||
|
||||
export interface ConstructionUserTemplateForm {
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId: string | number;
|
||||
}
|
||||
|
||||
export interface ConstructionUserExitForm {
|
||||
/**
|
||||
* userId
|
||||
*/
|
||||
userId: number | string;
|
||||
}
|
||||
|
||||
export interface ConstructionUserSalaryForm {
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
id: number | string;
|
||||
|
||||
/**
|
||||
* 工资
|
||||
*/
|
||||
salary?: number | string;
|
||||
}
|
||||
|
||||
export interface ConstructionUserPlayCardForm {
|
||||
/**
|
||||
* 项目
|
||||
*/
|
||||
projectId?: string | number;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
id?: string | number;
|
||||
/**
|
||||
* 打卡状态
|
||||
*/
|
||||
clock: number | string;
|
||||
}
|
||||
|
||||
export interface skipOptionType {
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
projectName: string | number;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
id: string | number;
|
||||
/**
|
||||
* 子项
|
||||
*/
|
||||
contractorList: Array<skipTeamType>;
|
||||
}
|
||||
export interface skipTeamType {
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name: string | number;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
id: string | number;
|
||||
}
|
||||
|
||||
export interface ConstructionUserForm extends BaseEntity {
|
||||
/**
|
||||
@ -218,6 +331,10 @@ export interface ConstructionUserForm extends BaseEntity {
|
||||
* 分包公司id
|
||||
*/
|
||||
contractorId?: string | number;
|
||||
/**
|
||||
* 结算方式
|
||||
*/
|
||||
wageMeasureUnit?: string | number;
|
||||
|
||||
/**
|
||||
* 班组id
|
||||
@ -345,6 +462,11 @@ export interface ConstructionUserForm extends BaseEntity {
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface ConstructionUserStatusForm {
|
||||
status: number | string;
|
||||
idList: Array<string | number>;
|
||||
}
|
||||
|
||||
export interface ConstructionUserQuery extends PageQuery {
|
||||
/**
|
||||
* 微信id
|
||||
|
@ -51,6 +51,11 @@ export interface ContractorForm extends BaseEntity {
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { ProjectForm, ProjectQuery, ProjectVO } from '@/api/project/project/types';
|
||||
import { childProjectQuery, ProjectForm, ProjectQuery, ProjectVO } from '@/api/project/project/types';
|
||||
|
||||
/**
|
||||
* 查询项目列表
|
||||
@ -16,6 +16,19 @@ export const listProject = (query?: ProjectQuery): AxiosPromise<ProjectVO[]> =>
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询项目dxf
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listDXFProject = (id: string | number): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: '/project/projectFile/json/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询项目详细
|
||||
* @param id
|
||||
@ -51,6 +64,83 @@ export const updateProject = (data: ProjectForm) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 上传dxf文件
|
||||
* @param data
|
||||
*/
|
||||
export const upLoadProjectDXF = (data: any) => {
|
||||
return request({
|
||||
url: '/project/projectFile/upload/dxf',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 通过GeoJson新增设施-光伏板
|
||||
* @param data
|
||||
*/
|
||||
export const addProjectFacilities = (data: any) => {
|
||||
return request({
|
||||
url: '/facility/photovoltaicPanel/geoJson',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
'X-No-Cache': 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 通过GeoJson新增设施-光伏板桩点、立柱、支架
|
||||
* @param data
|
||||
*/
|
||||
export const addProjectPilePoint = (data: any) => {
|
||||
console.log('🚀 ~ addProjectPilePoint ~ data:', data);
|
||||
|
||||
return request({
|
||||
url: '/facility/photovoltaicPanelPoint/parts/geoJson',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 通过GeoJson新增设施-方阵
|
||||
* @param data
|
||||
*/
|
||||
export const addProjectSquare = (data: any) => {
|
||||
return request({
|
||||
url: '/facility/matrix/geoJson',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 通过GeoJson新增设施-箱变
|
||||
* @param data
|
||||
*/
|
||||
export const addBoxTransformer = (data: any) => {
|
||||
return request({
|
||||
url: '/facility/boxTransformer/geoJson',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 通过GeoJson新增设施-逆变器
|
||||
* @param data
|
||||
*/
|
||||
export const addInverter = (data: any) => {
|
||||
return request({
|
||||
url: '/facility/inverter/geoJson',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除项目
|
||||
* @param id
|
||||
@ -61,3 +151,26 @@ export const delProject = (id: string | number | Array<string | number>) => {
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增子项目
|
||||
* @param data
|
||||
*/
|
||||
export const addChildProject = (data: childProjectQuery) => {
|
||||
return request({
|
||||
url: '/project/project/sub',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询项目下的子项目列表
|
||||
* @param id
|
||||
*/
|
||||
export const getChildProject = (id: string | number): AxiosPromise<childProjectQuery[]> => {
|
||||
return request({
|
||||
url: '/project/project/list/sub/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
@ -2,7 +2,7 @@ export interface ProjectVO {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
id: string | number;
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
@ -13,7 +13,7 @@ export interface ProjectVO {
|
||||
* 项目简称
|
||||
*/
|
||||
shortName: string;
|
||||
|
||||
designId: string;
|
||||
/**
|
||||
* 父项目id
|
||||
*/
|
||||
@ -37,12 +37,12 @@ export interface ProjectVO {
|
||||
/**
|
||||
* 项目类型
|
||||
*/
|
||||
type: string;
|
||||
projectType: string;
|
||||
|
||||
/**
|
||||
* 项目类型(1光伏 2风电)
|
||||
*/
|
||||
isType: number;
|
||||
projectCategory: number;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
@ -113,6 +113,25 @@ export interface ProjectVO {
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: string;
|
||||
type?: string;
|
||||
}
|
||||
|
||||
export interface locationType {
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
lng: string;
|
||||
// 纬度
|
||||
lat: string;
|
||||
// 逆地理编码地址
|
||||
|
||||
projectSite: string;
|
||||
}
|
||||
|
||||
export interface childProjectQuery{
|
||||
projectName:string;
|
||||
pid:string;
|
||||
id?:string
|
||||
}
|
||||
|
||||
export interface ProjectForm extends BaseEntity {
|
||||
@ -146,6 +165,16 @@ export interface ProjectForm extends BaseEntity {
|
||||
*/
|
||||
picUrl?: string;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
lng?: string;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
lat?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ -154,12 +183,12 @@ export interface ProjectForm extends BaseEntity {
|
||||
/**
|
||||
* 项目类型
|
||||
*/
|
||||
type?: string;
|
||||
projectType?: string;
|
||||
|
||||
/**
|
||||
* 项目类型(1光伏 2风电)
|
||||
*/
|
||||
isType?: number;
|
||||
projectCategory?: number;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
@ -197,9 +226,14 @@ export interface ProjectForm extends BaseEntity {
|
||||
onStreamTime?: string;
|
||||
|
||||
/**
|
||||
* 打卡范围(09:00,18:00)
|
||||
* 打卡开始时间(09:00,18:00)
|
||||
*/
|
||||
punchRange?: string;
|
||||
playCardStart?: string;
|
||||
|
||||
/**
|
||||
* 打卡结束时间(09:00,18:00)
|
||||
*/
|
||||
playCardEnd?: string;
|
||||
|
||||
/**
|
||||
* 设计总量
|
||||
@ -256,12 +290,12 @@ export interface ProjectQuery extends PageQuery {
|
||||
/**
|
||||
* 项目类型
|
||||
*/
|
||||
type?: string;
|
||||
projectType?: string;
|
||||
|
||||
/**
|
||||
* 项目类型(1光伏 2风电)
|
||||
*/
|
||||
isType?: number;
|
||||
projectCategory?: number;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
@ -273,6 +307,16 @@ export interface ProjectQuery extends PageQuery {
|
||||
*/
|
||||
projectSite?: string;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
lng?: string;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
lat?: string;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
@ -299,9 +343,14 @@ export interface ProjectQuery extends PageQuery {
|
||||
onStreamTime?: string;
|
||||
|
||||
/**
|
||||
* 打卡范围(09:00,18:00)
|
||||
* 打卡开始时间(09:00,18:00)
|
||||
*/
|
||||
punchRange?: string;
|
||||
playCardStart?: string;
|
||||
|
||||
/**
|
||||
* 打卡结束时间(09:00,18:00)
|
||||
*/
|
||||
playCardEnd?: string;
|
||||
|
||||
/**
|
||||
* 设计总量
|
||||
|
@ -35,7 +35,7 @@ export interface ProjectTeamForm extends BaseEntity {
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
peopleNumber?: string | number;
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@ -62,7 +62,7 @@ export interface ProjectTeamQuery extends PageQuery {
|
||||
* 项目id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
peopleNumber?: string | number;
|
||||
/**
|
||||
* 班组名称
|
||||
*/
|
||||
@ -84,7 +84,7 @@ export interface ProjectTeamForemanResp {
|
||||
* 班组id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
foremanList: foremanQuery[];
|
||||
/**
|
||||
* 班组名称
|
||||
*/
|
||||
@ -94,7 +94,9 @@ export interface ProjectTeamForemanResp {
|
||||
* 项目id
|
||||
*/
|
||||
projectId: string | number;
|
||||
}
|
||||
|
||||
export interface foremanQuery {
|
||||
/**
|
||||
* 班组长id
|
||||
*/
|
||||
|
@ -24,6 +24,11 @@ export interface ProjectTeamMemberVO {
|
||||
*/
|
||||
postId: string | number;
|
||||
|
||||
/**
|
||||
* 施工人员姓名
|
||||
*/
|
||||
memberName: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
@ -61,3 +61,15 @@ export const delQuestionUserAnswer = (id: string | number | Array<string | numbe
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 上传线下考试试卷存储
|
||||
* @param data
|
||||
*/
|
||||
export const uploadQuestionUserAnswer = (data: any) => {
|
||||
return request({
|
||||
url: '/safety/questionUserAnswer/upload/zip',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
@ -1,33 +1,17 @@
|
||||
export interface QuestionUserAnswerVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId: string | number;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
userId: string | number;
|
||||
|
||||
/**
|
||||
* 题库id列表
|
||||
*/
|
||||
bankIdList: Array<string | number>;
|
||||
|
||||
/**
|
||||
* 答案列表
|
||||
*/
|
||||
answerList: Array<string>;
|
||||
|
||||
/**
|
||||
* 得分
|
||||
*/
|
||||
score: number;
|
||||
id: string | number;
|
||||
file: string;
|
||||
/**
|
||||
* 考试类型(1线上考试 2线下考试)
|
||||
*/
|
||||
/**
|
||||
* 考试时间(时间戳/秒)
|
||||
*/
|
||||
examTime: number;
|
||||
|
||||
/**
|
||||
* 用时时间(时间戳/秒)
|
||||
@ -38,11 +22,6 @@ export interface QuestionUserAnswerVO {
|
||||
* 及格线/总分(格式:60,100)
|
||||
*/
|
||||
pass: string;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
file: string;
|
||||
}
|
||||
|
||||
export interface QuestionUserAnswerForm extends BaseEntity {
|
||||
@ -50,7 +29,8 @@ export interface QuestionUserAnswerForm extends BaseEntity {
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
teamId?: string | number;
|
||||
userName?: string;
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@ -64,18 +44,23 @@ export interface QuestionUserAnswerForm extends BaseEntity {
|
||||
/**
|
||||
* 题库id列表
|
||||
*/
|
||||
bankIdList: Array<string | number>;
|
||||
bankId?: string | number;
|
||||
|
||||
/**
|
||||
* 答案列表
|
||||
*/
|
||||
answerList: Array<string>;
|
||||
answer?: string;
|
||||
|
||||
/**
|
||||
* 得分
|
||||
*/
|
||||
score?: number;
|
||||
|
||||
/**
|
||||
* 考试时间(时间戳/秒)
|
||||
*/
|
||||
examTime?: number;
|
||||
|
||||
/**
|
||||
* 用时时间(时间戳/秒)
|
||||
*/
|
||||
@ -93,45 +78,17 @@ export interface QuestionUserAnswerForm extends BaseEntity {
|
||||
}
|
||||
|
||||
export interface QuestionUserAnswerQuery extends PageQuery {
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
userId?: string | number;
|
||||
|
||||
teamId?: string | number;
|
||||
userName?: string;
|
||||
projectId?: string | number;
|
||||
/**
|
||||
* 题库id列表
|
||||
* 考试类型(1线上考试 2线下考试)
|
||||
*/
|
||||
bankIdList: Array<string | number>;
|
||||
|
||||
/**
|
||||
* 答案列表
|
||||
*/
|
||||
answerList: Array<string>;
|
||||
|
||||
/**
|
||||
* 得分
|
||||
*/
|
||||
score?: number;
|
||||
|
||||
/**
|
||||
* 用时时间(时间戳/秒)
|
||||
*/
|
||||
takeTime?: number;
|
||||
|
||||
/**
|
||||
* 及格线/总分(格式:60,100)
|
||||
*/
|
||||
pass?: string;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
file?: string;
|
||||
examType?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
|
@ -102,6 +102,7 @@ export interface SafetyLogForm extends BaseEntity {
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
creatorName?: string;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
@ -189,6 +190,7 @@ export interface SafetyLogQuery extends PageQuery {
|
||||
* 项目id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
creatorName?: string;
|
||||
|
||||
/**
|
||||
* 发生日期
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { IdAndNameVO } from '@/api/types';
|
||||
|
||||
export interface TeamMeetingVO {
|
||||
pictureUrlList: Array<string>;
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ -14,12 +15,12 @@ export interface TeamMeetingVO {
|
||||
/**
|
||||
* 班组
|
||||
*/
|
||||
team: IdAndNameVO;
|
||||
teamName: IdAndNameVO;
|
||||
|
||||
/**
|
||||
* 分包公司
|
||||
*/
|
||||
contractor: IdAndNameVO;
|
||||
contractorName: IdAndNameVO;
|
||||
|
||||
/**
|
||||
* 开会时间
|
||||
@ -29,7 +30,7 @@ export interface TeamMeetingVO {
|
||||
/**
|
||||
* 宣讲人
|
||||
*/
|
||||
compere: IdAndNameVO;
|
||||
compereName: IdAndNameVO;
|
||||
|
||||
/**
|
||||
* 参与人列表
|
||||
|
@ -1,4 +1,4 @@
|
||||
import request from '@/utils/request';
|
||||
import request, { download } from '@/utils/request';
|
||||
import { OssQuery, OssVO } from './types';
|
||||
import { AxiosPromise } from 'axios';
|
||||
|
||||
@ -26,3 +26,8 @@ export function delOss(ossId: string | number | Array<string | number>) {
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
// 下载OSS对象存储
|
||||
export function downLoadOss(ossId: { id?: string | number; idList?: string | number | Array<string | number> }, url: string, fileName: string) {
|
||||
return download(url, ossId, fileName);
|
||||
}
|
||||
|
@ -10,35 +10,69 @@
|
||||
:on-error="handleUploadError"
|
||||
:on-exceed="handleExceed"
|
||||
:on-success="handleUploadSuccess"
|
||||
:show-file-list="false"
|
||||
:show-file-list="isConstruction"
|
||||
:headers="headers"
|
||||
class="upload-file-uploader"
|
||||
:list-type="isConstruction ? 'picture-card' : 'text'"
|
||||
:accept="accept"
|
||||
:drag="isDarg"
|
||||
:data="data"
|
||||
>
|
||||
<!-- 上传按钮 -->
|
||||
<el-button type="primary">选取文件</el-button>
|
||||
</el-upload>
|
||||
<!-- 上传提示 -->
|
||||
<div v-if="showTip" class="el-upload__tip">
|
||||
请上传
|
||||
<template v-if="fileSize">
|
||||
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
|
||||
</template>
|
||||
<template v-if="fileType">
|
||||
格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b>
|
||||
</template>
|
||||
的文件
|
||||
</div>
|
||||
<!-- 文件列表 -->
|
||||
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
||||
<li v-for="(file, index) in fileList" :key="file.uid" class="el-upload-list__item ele-upload-list__item-content">
|
||||
<el-link :href="`${file.url}`" :underline="false" target="_blank">
|
||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
||||
</el-link>
|
||||
<div class="ele-upload-list__item-content-action">
|
||||
<el-button type="danger" link @click="handleDelete(index)">删除</el-button>
|
||||
<slot>
|
||||
<div>
|
||||
<!-- 上传按钮 -->
|
||||
<el-button v-if="!isConstruction && !isImportInfo && !isDarg" type="primary">选取文件</el-button>
|
||||
|
||||
<!-- 上传提示 -->
|
||||
<el-icon v-if="isDarg" class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div v-if="showTip" class="el-upload__tip" @click.stop>
|
||||
请上传
|
||||
<template v-if="fileSize">
|
||||
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
|
||||
</template>
|
||||
<template v-if="fileType">
|
||||
格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b>
|
||||
</template>
|
||||
的文件
|
||||
</div>
|
||||
<!-- 文件列表 -->
|
||||
<transition-group
|
||||
v-if="!isConstruction && !isImportInfo"
|
||||
class="upload-file-list el-upload-list el-upload-list--text"
|
||||
name="el-fade-in-linear"
|
||||
tag="ul"
|
||||
@click.stop
|
||||
>
|
||||
<li v-for="(file, index) in fileList" :key="file.uid" class="el-upload-list__item ele-upload-list__item-content">
|
||||
<el-link :href="`${file.url}`" :underline="false" target="_blank">
|
||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
||||
</el-link>
|
||||
<div class="ele-upload-list__item-content-action">
|
||||
<el-button type="danger" link @click="handleDelete(index)">删除</el-button>
|
||||
</div>
|
||||
</li>
|
||||
</transition-group>
|
||||
</div>
|
||||
</li>
|
||||
</transition-group>
|
||||
</slot>
|
||||
|
||||
<el-icon v-if="isConstruction"><Plus /></el-icon>
|
||||
<template #file="{ file }">
|
||||
<div class="pdf" v-if="isConstruction">
|
||||
<img src="@/assets/icons/svg/pdf.png" alt="" />
|
||||
<el-text class="w-148px text-center" truncated>
|
||||
<span>{{ file.name }}</span>
|
||||
</el-text>
|
||||
<div class="Shadow">
|
||||
<a :href="file.url" target="_blank">
|
||||
<el-icon class="mr"><View /></el-icon>
|
||||
</a>
|
||||
<a href="#">
|
||||
<el-icon @click="handleDelete(file.ossId, 'ossId')"><Delete /></el-icon>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -57,9 +91,19 @@ const props = defineProps({
|
||||
// 大小限制(MB)
|
||||
fileSize: propTypes.number.def(5),
|
||||
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||
fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf']),
|
||||
fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf', 'png', 'jpg', 'jpeg', 'zip']),
|
||||
// 是否显示提示
|
||||
isShowTip: propTypes.bool.def(true)
|
||||
isShowTip: propTypes.bool.def(true),
|
||||
//是否为施工人员上传
|
||||
isConstruction: propTypes.bool.def(false),
|
||||
//是否为上传zip文件
|
||||
isImportInfo: propTypes.bool.def(false),
|
||||
//ip地址
|
||||
uploadUrl: propTypes.string.def('/resource/oss/upload'),
|
||||
//可拖拽上传
|
||||
isDarg: propTypes.bool.def(false),
|
||||
// 其他参数
|
||||
data: propTypes.object.def({})
|
||||
});
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
@ -68,7 +112,7 @@ const number = ref(0);
|
||||
const uploadList = ref<any[]>([]);
|
||||
|
||||
const baseUrl = import.meta.env.VITE_APP_BASE_API;
|
||||
const uploadFileUrl = ref(baseUrl + '/resource/oss/upload'); // 上传文件服务器地址
|
||||
const uploadFileUrl = ref(baseUrl + props.uploadUrl); // 上传文件服务器地址
|
||||
const headers = ref(globalHeaders());
|
||||
|
||||
const fileList = ref<any[]>([]);
|
||||
@ -76,9 +120,14 @@ const showTip = computed(() => props.isShowTip && (props.fileType || props.fileS
|
||||
|
||||
const fileUploadRef = ref<ElUploadInstance>();
|
||||
|
||||
const accept = computed(() => {
|
||||
return props.fileType.map((value) => `.${value}`).join(',');
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
async (val) => {
|
||||
if (props.isImportInfo) return;
|
||||
if (val) {
|
||||
let temp = 1;
|
||||
// 首先将值转为数组
|
||||
@ -152,11 +201,16 @@ const handleUploadError = () => {
|
||||
// 上传成功回调
|
||||
const handleUploadSuccess = (res: any, file: UploadFile) => {
|
||||
if (res.code === 200) {
|
||||
uploadList.value.push({
|
||||
name: res.data.fileName,
|
||||
url: res.data.url,
|
||||
ossId: res.data.ossId
|
||||
});
|
||||
if (res.data) {
|
||||
uploadList.value.push({
|
||||
name: res.data.fileName,
|
||||
url: res.data.url,
|
||||
ossId: res.data.ossId
|
||||
});
|
||||
} else {
|
||||
uploadList.value.push({});
|
||||
}
|
||||
|
||||
uploadedSuccessfully();
|
||||
} else {
|
||||
number.value--;
|
||||
@ -168,19 +222,38 @@ const handleUploadSuccess = (res: any, file: UploadFile) => {
|
||||
};
|
||||
|
||||
// 删除文件
|
||||
const handleDelete = (index: number) => {
|
||||
let ossId = fileList.value[index].ossId;
|
||||
delOss(ossId);
|
||||
fileList.value.splice(index, 1);
|
||||
const handleDelete = async (index: string | number, type?: string) => {
|
||||
console.log('🚀 ~ handleDelete ~ index:', index);
|
||||
|
||||
await proxy?.$modal.confirm('是否确认删除此文件?').finally();
|
||||
if (type === 'ossId') {
|
||||
delOss(index);
|
||||
fileList.value = fileList.value.filter((f) => f.ossId !== index);
|
||||
} else {
|
||||
let ossId = fileList.value[index].ossId;
|
||||
delOss(ossId);
|
||||
index = parseInt(index as string);
|
||||
fileList.value.splice(index, 1);
|
||||
}
|
||||
emit('update:modelValue', listToString(fileList.value));
|
||||
};
|
||||
|
||||
// 上传结束处理
|
||||
const uploadedSuccessfully = () => {
|
||||
if (props.isImportInfo) {
|
||||
emit('update:modelValue', 'ok');
|
||||
fileUploadRef.value?.clearFiles();
|
||||
proxy?.$modal.closeLoading();
|
||||
proxy?.$modal.msgSuccess('导入成功');
|
||||
return;
|
||||
}
|
||||
console.log(number.value, uploadList.value);
|
||||
|
||||
if (number.value > 0 && uploadList.value.length === number.value) {
|
||||
fileList.value = fileList.value.filter((f) => f.url !== undefined).concat(uploadList.value);
|
||||
uploadList.value = [];
|
||||
number.value = 0;
|
||||
|
||||
emit('update:modelValue', listToString(fileList.value));
|
||||
proxy?.$modal.closeLoading();
|
||||
}
|
||||
@ -210,15 +283,35 @@ const listToString = (list: any[], separator?: string) => {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.upload-file-uploader {
|
||||
margin-bottom: 5px;
|
||||
.pdf {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
border-radius: 6px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
img {
|
||||
width: 40%;
|
||||
}
|
||||
&:hover {
|
||||
.Shadow {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
> span {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.upload-file-list .el-upload-list__item {
|
||||
border: 1px solid #e4e7ed;
|
||||
line-height: 2;
|
||||
margin-bottom: 10px;
|
||||
position: relative;
|
||||
.upload-file-list {
|
||||
margin: 0;
|
||||
.el-upload-list__item {
|
||||
border: 1px solid #e4e7ed;
|
||||
line-height: 2;
|
||||
margin-bottom: 0;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
|
||||
.upload-file-list .ele-upload-list__item-content {
|
||||
@ -227,8 +320,45 @@ const listToString = (list: any[], separator?: string) => {
|
||||
align-items: center;
|
||||
color: inherit;
|
||||
}
|
||||
.Shadow {
|
||||
align-items: center;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
color: #fff;
|
||||
cursor: default;
|
||||
display: inline-flex;
|
||||
font-size: 20px;
|
||||
height: 100%;
|
||||
justify-content: center;
|
||||
left: 0;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
transition: opacity 0.3s;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.ele-upload-list__item-content-action .el-link {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.el-icon.avatar-uploader-icon {
|
||||
border: 1px dashed #cdd0d6;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.el-icon.avatar-uploader-icon:hover {
|
||||
border-color: #409eff;
|
||||
}
|
||||
|
||||
.el-icon.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 200px;
|
||||
height: 178px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
@ -16,6 +16,7 @@
|
||||
:file-list="fileList"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:class="{ hide: fileList.length >= limit }"
|
||||
accept="image/png, image/jpeg, image/jpg"
|
||||
>
|
||||
<el-icon class="avatar-uploader-icon">
|
||||
<plus />
|
||||
|
@ -18,6 +18,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, watch } from 'vue';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { getProjectTeam } from '@/utils/projectTeam';
|
||||
|
||||
const userStore = useUserStore();
|
||||
const projects = computed(() => [
|
||||
@ -40,7 +41,7 @@ const handleSelect = (projectId: string) => {
|
||||
const selectedProject = projects.value.find((p) => p.id === projectId);
|
||||
if (selectedProject) {
|
||||
userStore.setSelectedProject(selectedProject);
|
||||
location.reload()
|
||||
console.log(userStore.selectedProject); // 打印选中的项目
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<el-menu :default-active="activeMenu" mode="horizontal" :ellipsis="false" @select="handleSelect">
|
||||
<template v-for="(item, index) in topMenus">
|
||||
<el-menu-item v-if="index < visibleNumber" :key="index" :style="{ '--theme': theme }" :index="item.path"
|
||||
><svg-icon v-if="item.meta && item.meta.icon && item.meta.icon !== '#'" :icon-class="item.meta ? item.meta.icon : ''" />
|
||||
{{ item.meta?.title }}</el-menu-item
|
||||
>
|
||||
<el-menu-item v-if="index < visibleNumber" :key="index" :style="{ '--theme': theme }" :index="item.path">
|
||||
<svg-icon v-if="item.meta && item.meta.icon && item.meta.icon !== '#'" :icon-class="item.meta ? item.meta.icon : ''" />
|
||||
{{ item.meta?.title }}
|
||||
</el-menu-item>
|
||||
</template>
|
||||
|
||||
<!-- 顶部菜单超出数量折叠 -->
|
||||
|
@ -55,6 +55,10 @@ const theme = computed(() => useSettingsStore().theme);
|
||||
watch(route, () => {
|
||||
addTags();
|
||||
moveToCurrentTag();
|
||||
//记录超过五个就删除第二个
|
||||
if (visitedViews.value?.length > 6) {
|
||||
closeSelectedTag(visitedViews.value[1]);
|
||||
}
|
||||
});
|
||||
watch(visible, (value) => {
|
||||
if (value) {
|
||||
|
@ -2,6 +2,7 @@ import { createApp } from 'vue';
|
||||
// global css
|
||||
import 'virtual:uno.css';
|
||||
import '@/assets/styles/index.scss';
|
||||
import '@/assets/iconfont/iconfont.css';
|
||||
import 'element-plus/theme-chalk/dark/css-vars.css';
|
||||
|
||||
// App、router、store
|
||||
@ -25,6 +26,14 @@ import HighLight from '@highlightjs/vue-plugin';
|
||||
import 'virtual:svg-icons-register';
|
||||
import ElementIcons from '@/plugins/svgicon';
|
||||
|
||||
//通信
|
||||
import mitt from 'mitt';
|
||||
|
||||
import '@/assets/fonts/fonts.scss';
|
||||
|
||||
//打印
|
||||
import print from 'vue3-print-nb';
|
||||
|
||||
// permission control
|
||||
import './permission';
|
||||
|
||||
@ -38,9 +47,22 @@ VXETable.config({
|
||||
zIndex: 999999
|
||||
});
|
||||
|
||||
//本地保存飞机配置
|
||||
import { setLocal } from './utils';
|
||||
setLocal('dockAir', 'http://192.168.110.24:9136');
|
||||
setLocal('aiUrl', 'http://192.168.110.23:8000');
|
||||
setLocal('host', '192.168.110.199');
|
||||
setLocal('rtmpPort', '1935');
|
||||
setLocal('rtcPort', '1985');
|
||||
setLocal('dockSocketUrl', 'ws://192.168.110.8:9136/websocket');
|
||||
|
||||
// 修改 el-dialog 默认点击遮照为不关闭
|
||||
/*import { ElDialog } from 'element-plus';
|
||||
ElDialog.props.closeOnClickModal.default = false;*/
|
||||
// **main.js**
|
||||
import { vue3ScrollSeamless } from 'vue3-scroll-seamless';
|
||||
import bus from './utils/bus';
|
||||
import $message from '@/plugins/modal';
|
||||
|
||||
const app = createApp(App);
|
||||
|
||||
@ -48,10 +70,16 @@ app.use(HighLight);
|
||||
app.use(ElementIcons);
|
||||
app.use(router);
|
||||
app.use(store);
|
||||
app.use(print);
|
||||
app.use(i18n);
|
||||
app.use(VXETable);
|
||||
app.use(plugins);
|
||||
app.use(bus);
|
||||
app.component('vue3ScrollSeamless', vue3ScrollSeamless);
|
||||
// 自定义指令
|
||||
directive(app);
|
||||
|
||||
app.mount('#app');
|
||||
|
||||
app.config.globalProperties.mittBus = mitt();
|
||||
app.config.globalProperties.$message = $message;
|
||||
|
@ -1,12 +1,22 @@
|
||||
const sessionCache = {
|
||||
set(key: string, value: any) {
|
||||
if (!sessionStorage) {
|
||||
return;
|
||||
}
|
||||
if (key != null && value != null) {
|
||||
sessionStorage.setItem(key, value);
|
||||
if (!sessionStorage || key == null || value == null) return;
|
||||
|
||||
try {
|
||||
const str = typeof value === 'string' ? value : JSON.stringify(value);
|
||||
|
||||
// 限制:如果数据超过 1MB,就不存
|
||||
if (str.length > 1024 * 1024) {
|
||||
console.warn(`sessionStorage.setItem(${key}) 跳过,数据过大(${(str.length / 1024).toFixed(2)} KB)`);
|
||||
return;
|
||||
}
|
||||
|
||||
sessionStorage.setItem(key, str);
|
||||
} catch (e) {
|
||||
console.error(`sessionStorage.setItem(${key}) 失败:`, e);
|
||||
}
|
||||
},
|
||||
|
||||
get(key: string) {
|
||||
if (!sessionStorage) {
|
||||
return null;
|
||||
|
@ -18,6 +18,18 @@ export default {
|
||||
msgWarning(content: any) {
|
||||
ElMessage.warning(content);
|
||||
},
|
||||
// 警告消息
|
||||
warning(content: any) {
|
||||
ElMessage.warning(content);
|
||||
},
|
||||
// 错误消息
|
||||
error(content: any) {
|
||||
ElMessage.error(content);
|
||||
},
|
||||
// 成功消息
|
||||
success(content: any) {
|
||||
ElMessage.success(content);
|
||||
},
|
||||
// 弹出提示
|
||||
alert(content: any) {
|
||||
ElMessageBox.alert(content, '系统提示');
|
||||
@ -34,6 +46,7 @@ export default {
|
||||
alertWarning(content: any) {
|
||||
ElMessageBox.alert(content, '系统提示', { type: 'warning' });
|
||||
},
|
||||
|
||||
// 通知提示
|
||||
notify(content: any) {
|
||||
ElNotification.info(content);
|
||||
|
@ -93,7 +93,22 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||
path: '/test',
|
||||
component: () => import('@/views/materials/materials/index.vue'),
|
||||
hidden: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/gisHome',
|
||||
component: () => import('@/views/gisHome/index.vue'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/drone',
|
||||
component: () => import('@/views/drone/index.vue'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/progress/progressPaper',
|
||||
component: () => import('@/views/progress/progressPaper/index.vue'),
|
||||
hidden: true
|
||||
},
|
||||
];
|
||||
|
||||
// 动态路由,基于用户权限动态去加载
|
||||
|
@ -5,15 +5,30 @@ import { LoginData, UserProject } from '@/api/types';
|
||||
import defAva from '@/assets/images/profile.jpg';
|
||||
import store from '@/store';
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
import { SpecialType } from '@/api/project/workWage/types';
|
||||
import { getProjectTeam } from '@/utils/projectTeam';
|
||||
import $cache from '@/plugins/cache';
|
||||
// 添加两个函数用于操作localStorage
|
||||
const saveSelectedProjectToStorage = (project) => {
|
||||
localStorage.setItem('selectedProject', JSON.stringify(project));
|
||||
// localStorage.setItem('selectedProject', JSON.stringify(project));
|
||||
$cache.local.setJSON('selectedProject', project);
|
||||
getProjectTeam();
|
||||
};
|
||||
const saveProjectTeamToStorage = (project) => {
|
||||
// localStorage.setItem('ProjectTeamList', JSON.stringify(project));
|
||||
$cache.local.setJSON('ProjectTeamList', project);
|
||||
};
|
||||
|
||||
const getSelectedProjectFromStorage = () => {
|
||||
const stored = localStorage.getItem('selectedProject');
|
||||
return stored ? JSON.parse(stored) : null;
|
||||
// localStorage.getItem('selectedProject');
|
||||
const stored = $cache.local.getJSON('selectedProject');
|
||||
return stored ? stored : null;
|
||||
};
|
||||
|
||||
const getProjectTeamListFromStorage = () => {
|
||||
const stored = $cache.local.getJSON('ProjectTeamList');
|
||||
|
||||
return stored ? stored : null;
|
||||
};
|
||||
|
||||
export const useUserStore = defineStore('user', () => {
|
||||
@ -29,6 +44,7 @@ export const useUserStore = defineStore('user', () => {
|
||||
const projects = ref<Array<{ id: string; name: string }>>([]);
|
||||
// 从localStorage获取缓存的项目,如果没有则默认为null
|
||||
const selectedProject = ref<{ id: string; name: string } | null>(getSelectedProjectFromStorage());
|
||||
const ProjectTeamList = ref<SpecialType[] | null>(getProjectTeamListFromStorage());
|
||||
|
||||
/**
|
||||
* 登录
|
||||
@ -99,7 +115,8 @@ export const useUserStore = defineStore('user', () => {
|
||||
permissions.value = [];
|
||||
removeToken();
|
||||
// 清除项目缓存
|
||||
localStorage.removeItem('selectedProject');
|
||||
$cache.local.remove('selectedProject');
|
||||
$cache.local.remove('ProjectTeamList');
|
||||
};
|
||||
|
||||
const setAvatar = (value: string) => {
|
||||
@ -112,14 +129,12 @@ export const useUserStore = defineStore('user', () => {
|
||||
|
||||
const setSelectedProject = (project: { id: string; name: string }) => {
|
||||
selectedProject.value = project;
|
||||
// 将选中的项目保存到localStorage
|
||||
saveSelectedProjectToStorage(project);
|
||||
};
|
||||
|
||||
// ** 切换项目后,需要清空当前项目下的所有缓存数据 **
|
||||
// 清空 pinia 缓存
|
||||
// store.$reset();
|
||||
// console.log("选择的新项目名称:" + selectedProject.value.name)
|
||||
// console.log("选择的新项目id:" + selectedProject.value.id)
|
||||
const setProjectTeamList = (project: SpecialType[]) => {
|
||||
ProjectTeamList.value = project;
|
||||
saveProjectTeamToStorage(project);
|
||||
};
|
||||
|
||||
return {
|
||||
@ -136,8 +151,10 @@ export const useUserStore = defineStore('user', () => {
|
||||
setAvatar,
|
||||
setProjects,
|
||||
setSelectedProject,
|
||||
setProjectTeamList,
|
||||
projects,
|
||||
selectedProject
|
||||
selectedProject,
|
||||
ProjectTeamList
|
||||
};
|
||||
});
|
||||
|
||||
|
5
plus-ui/src/types/global.d.ts
vendored
5
plus-ui/src/types/global.d.ts
vendored
@ -27,6 +27,8 @@ declare global {
|
||||
* 是否显示
|
||||
*/
|
||||
visible: boolean;
|
||||
details?: boolean;
|
||||
id?: string | number;
|
||||
}
|
||||
|
||||
declare interface UploadOption {
|
||||
@ -80,7 +82,8 @@ declare global {
|
||||
declare interface PageData<T, D> {
|
||||
form: T;
|
||||
queryParams: D;
|
||||
rules: ElFormRules;
|
||||
rules?: ElFormRules;
|
||||
memberRules?: ElFormRules;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { getLocal } from '.';
|
||||
|
||||
const TokenKey = 'Admin-Token';
|
||||
|
||||
const tokenStorage = useStorage<null | string>(TokenKey, null);
|
||||
@ -7,3 +9,27 @@ export const getToken = () => tokenStorage.value;
|
||||
export const setToken = (access_token: string) => (tokenStorage.value = access_token);
|
||||
|
||||
export const removeToken = () => (tokenStorage.value = null);
|
||||
|
||||
export const getDockSocketUrl = () => {
|
||||
return getLocal('dockSocketUrl');
|
||||
};
|
||||
|
||||
export const getHost = () => {
|
||||
return getLocal('host');
|
||||
};
|
||||
|
||||
export const getRtmpPort = () => {
|
||||
return getLocal('rtmpPort');
|
||||
};
|
||||
|
||||
export const getRtcPort = () => {
|
||||
return getLocal('rtcPort');
|
||||
};
|
||||
|
||||
export const getDockAir = () => {
|
||||
return getLocal('dockAir');
|
||||
};
|
||||
|
||||
export const getAiUrl = () => {
|
||||
return getLocal('aiUrl');
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
|
||||
import $cache from '@/plugins/cache';
|
||||
/**
|
||||
* 表格时间格式化
|
||||
*/
|
||||
@ -15,6 +15,14 @@ export const formatDate = (cellValue: string) => {
|
||||
return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
|
||||
};
|
||||
|
||||
export const setLocal = (key, value) => {
|
||||
return $cache.local.set(key, value);
|
||||
};
|
||||
|
||||
export const getLocal = (key) => {
|
||||
return $cache.local.get(key);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} time
|
||||
* @param {string} option
|
||||
@ -316,3 +324,5 @@ export const removeClass = (ele: HTMLElement, cls: string) => {
|
||||
export const isExternal = (path: string) => {
|
||||
return /^(https?:|http?:|mailto:|tel:)/.test(path);
|
||||
};
|
||||
|
||||
export { parseTime };
|
||||
|
@ -180,6 +180,7 @@ export function download(url: string, params: any, fileName: string) {
|
||||
return service.post(url, params, {
|
||||
transformRequest: [
|
||||
(params: any) => {
|
||||
|
||||
return tansParams(params);
|
||||
}
|
||||
],
|
||||
@ -188,6 +189,7 @@ export function download(url: string, params: any, fileName: string) {
|
||||
}).then(async (resp: any) => {
|
||||
const isLogin = blobValidate(resp);
|
||||
if (isLogin) {
|
||||
console.log("🚀 ~ download ~ resp:", resp)
|
||||
const blob = new Blob([resp]);
|
||||
FileSaver.saveAs(blob, fileName);
|
||||
} else {
|
||||
|
@ -21,18 +21,10 @@
|
||||
|
||||
<script setup name="Index" lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
// 模拟数据
|
||||
const userCount = ref(1234);
|
||||
const orderCount = ref(567);
|
||||
const visitCount = ref(8901);
|
||||
|
||||
const goToPage = (page: string) => {
|
||||
router.push(`/${page}`);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
@ -54,7 +54,7 @@ interface Props {
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
const emit = defineEmits(['submit']);
|
||||
const visible = ref<boolean>(false);
|
||||
const loading = ref<boolean>(false);
|
||||
|
||||
@ -90,6 +90,7 @@ const submitForm = () => {
|
||||
// 调用接口提交数据
|
||||
await addMachineryDetail({ ...form, machineryId: props.machineryId }).finally(() => (loading.value = false));
|
||||
ElMessage.success('提交成功');
|
||||
emit('submit');
|
||||
closeDialog();
|
||||
} catch (error) {
|
||||
ElMessage.error('提交失败');
|
||||
|
@ -10,9 +10,15 @@
|
||||
<el-table-column label="检验单位" align="center" prop="checkoutUnit" />
|
||||
<el-table-column label="检定日期/有效期" align="center" prop="checkoutDate" />
|
||||
<el-table-column label="入场时间" align="center" prop="entryTime" />
|
||||
<el-table-column label="图片" align="center" prop="pictureList.url">
|
||||
<el-table-column label="图片" align="center">
|
||||
<template #default="scope">
|
||||
<el-image :key="picture.id" v-for="picture in scope.row.pictureList" :src="picture.url" />
|
||||
<el-image
|
||||
:z-index="9999"
|
||||
:preview-src-list="imgList(scope.row.pictureList)"
|
||||
preview-teleported
|
||||
:src="scope.row.pictureList ? scope.row.pictureList[0].url : ''"
|
||||
class="w20"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
@ -39,7 +45,7 @@
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<el-dialog title="修改机械出入场详情" v-model="dialogRef" width="500px" append-to-body>
|
||||
<el-dialog title="修改机械出入场详情" v-model="dialogRef" width="700px" append-to-body>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="140px">
|
||||
<el-form-item label="出入场" prop="type">
|
||||
<el-select v-model="form.type" clearable placeholder="请选择出入场">
|
||||
@ -95,7 +101,6 @@ import { ref } from 'vue';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { machinery_entry_exit_type, sys_normal_disable } = toRefs<any>(proxy?.useDict('machinery_entry_exit_type', 'sys_normal_disable'));
|
||||
|
||||
interface Props {
|
||||
machineryId: string | number;
|
||||
}
|
||||
@ -141,6 +146,16 @@ const data = reactive<PageData<MachineryDetailForm, MachineryDetailQuery>>({
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
const imgList = computed(() => (list) => {
|
||||
let newList;
|
||||
if (list) {
|
||||
newList = list.map((item) => item.url);
|
||||
} else {
|
||||
newList = [''];
|
||||
}
|
||||
return newList;
|
||||
});
|
||||
|
||||
const machineryDetailList = ref<MachineryDetailVO[]>([]);
|
||||
/** 展开选中数据 */
|
||||
const getList = async () => {
|
||||
@ -185,7 +200,7 @@ const submitForm = () => {
|
||||
const closeDialog = () => {
|
||||
dialogRef.value = false;
|
||||
};
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
@ -54,9 +54,11 @@
|
||||
<el-table-column label="机械型号" align="center" prop="machineryNumber" />
|
||||
<el-table-column label="数量" align="center" prop="number" />
|
||||
<el-table-column label="负责人" align="center" prop="principal" />
|
||||
<el-table-column label="负责人电话" align="center" prop="principalPhone" />
|
||||
<el-table-column label="供应商" align="center" prop="provider" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding" width="300">
|
||||
<template #default="scope">
|
||||
<el-space wrap>
|
||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['machinery:machinery:edit']">修改 </el-button>
|
||||
@ -73,7 +75,7 @@
|
||||
</el-card>
|
||||
<!-- 添加或修改机械对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="machineryFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form ref="machineryFormRef" :model="form" :rules="rules" label-width="90px">
|
||||
<el-form-item label="机械名称" prop="machineryName">
|
||||
<el-input v-model="form.machineryName" placeholder="请输入机械名称" />
|
||||
</el-form-item>
|
||||
@ -86,6 +88,12 @@
|
||||
<el-form-item label="负责人" prop="principal">
|
||||
<el-input v-model="form.principal" placeholder="请输入负责人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人电话" prop="principalPhone">
|
||||
<el-input v-model="form.principalPhone" placeholder="请输入负责人电话" type="number" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商" prop="provider">
|
||||
<el-input v-model="form.provider" placeholder="请输入供应商" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
@ -97,7 +105,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<machinery-detail-add-dialog :machinery-id="currentMachineryId" ref="dialogRef" />
|
||||
<machinery-detail-add-dialog :machinery-id="currentMachineryId" ref="dialogRef" @submit="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -139,7 +147,9 @@ const initFormData: MachineryForm = {
|
||||
projectId: currentProject.value.id,
|
||||
number: undefined,
|
||||
principal: undefined,
|
||||
remark: undefined
|
||||
remark: undefined,
|
||||
principalPhone: undefined,
|
||||
provider: undefined
|
||||
};
|
||||
const data = reactive<PageData<MachineryForm, MachineryQuery>>({
|
||||
form: { ...initFormData },
|
||||
@ -151,7 +161,9 @@ const data = reactive<PageData<MachineryForm, MachineryQuery>>({
|
||||
projectId: currentProject.value.id,
|
||||
number: undefined,
|
||||
principal: undefined,
|
||||
params: {}
|
||||
params: {},
|
||||
principalPhone: undefined,
|
||||
provider: undefined
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }]
|
||||
@ -222,6 +234,7 @@ const submitForm = () => {
|
||||
machineryFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
if (form.value.id) {
|
||||
await updateMachinery(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -262,6 +275,20 @@ const handleAddMachineryDetail = (row?: MachineryVO) => {
|
||||
dialogRef.value.openDialog();
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
@ -8,7 +8,7 @@
|
||||
<el-input v-model="queryParams.companyName" placeholder="请输入公司名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="公司状态" prop="status">
|
||||
<el-select v-model="queryParams.status" clearable placeholder="请选择公司状态">
|
||||
<el-select v-model="queryParams.status" clearable placeholder="全部">
|
||||
<el-option v-for="item in sys_normal_disable" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -49,6 +49,8 @@
|
||||
<!-- <el-table-column label="主键id" align="center" prop="id" v-if="true" /> -->
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="公司名称" align="center" prop="companyName" />
|
||||
<el-table-column label="负责人" align="center" prop="principal" />
|
||||
<el-table-column label="负责人电话" align="center" prop="principalPhone" />
|
||||
<el-table-column label="公司状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
@ -72,10 +74,16 @@
|
||||
<!-- 添加或修改公司对话框 -->
|
||||
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="companyFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form ref="companyFormRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="公司名称" prop="companyName">
|
||||
<el-input v-model="form.companyName" placeholder="请输入公司名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人" prop="principal">
|
||||
<el-input v-model="form.principal" placeholder="请输入负责人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人电话" prop="principalPhone">
|
||||
<el-input v-model="form.principalPhone" placeholder="请输入负责人电话" type="number" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
@ -129,7 +137,9 @@ const initFormData: CompanyForm = {
|
||||
projectId: currentProject.value.id,
|
||||
status: undefined,
|
||||
remark: undefined,
|
||||
qualification: undefined
|
||||
qualification: undefined,
|
||||
principalPhone: undefined,
|
||||
principal: undefined
|
||||
};
|
||||
const data = reactive<PageData<CompanyForm, CompanyQuery>>({
|
||||
form: { ...initFormData },
|
||||
@ -140,10 +150,15 @@ const data = reactive<PageData<CompanyForm, CompanyQuery>>({
|
||||
projectId: currentProject.value.id,
|
||||
status: undefined,
|
||||
qualification: undefined,
|
||||
principalPhone: undefined,
|
||||
principal: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }]
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }],
|
||||
companyName: [{ required: true, message: '公司名字不能为空', trigger: 'blur' }],
|
||||
principal: [{ required: true, message: '负责人不能为空', trigger: 'blur' }],
|
||||
principalPhone: [{ required: true, message: '负责人电话不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
@ -211,6 +226,7 @@ const submitForm = () => {
|
||||
companyFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
if (form.value.id) {
|
||||
await updateCompany(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -243,6 +259,20 @@ const handleExport = () => {
|
||||
);
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
@ -42,18 +42,22 @@ const materialsDetail = ref<MaterialsVO>();
|
||||
const ossIdMap = ref<Record<string, string>>({});
|
||||
const ossMap = ref<Record<string, OssVO>>({}); // 存储 ossId -> 对象映射
|
||||
const getMaterialsDetail = async () => {
|
||||
console.log('getMaterialsDetail', props.materialsId);
|
||||
|
||||
loading.value = true;
|
||||
const res = await getMaterials(props.materialsId);
|
||||
if (res.data && res.code === 200) {
|
||||
materialsDetail.value = res.data;
|
||||
ossIdMap.value = res.data.fileOssMap;
|
||||
// 获取 value 列表
|
||||
if (res.data.fileOssMap) {
|
||||
if (res.data.fileOssMap && Object.keys(res.data.fileOssMap).length !== 0) {
|
||||
const values = Object.values(res.data.fileOssMap);
|
||||
const ossRes = await listByIds(values);
|
||||
ossMap.value = Object.fromEntries(ossRes.data.map((item) => [item.ossId, item]));
|
||||
}
|
||||
}
|
||||
console.log('ossMap', ossMap.value);
|
||||
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
|
@ -9,9 +9,9 @@
|
||||
<el-form-item label="材料数量" prop="number">
|
||||
<el-input-number v-model="form.number" placeholder="请输入预计使用数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="剩余库存数量" prop="residue">
|
||||
<!-- <el-form-item label="剩余库存数量" prop="residue">
|
||||
<el-input v-model="form.residue" placeholder="请输入剩余库存数量" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="出入库负责人" prop="operator">
|
||||
<el-input v-model="form.operator" placeholder="请输入出入库负责人" />
|
||||
</el-form-item>
|
||||
@ -58,6 +58,7 @@ interface Props {
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
const emit = defineEmits(['submit']);
|
||||
|
||||
const visible = ref<boolean>(false);
|
||||
const loading = ref<boolean>(false);
|
||||
@ -97,6 +98,7 @@ const submitForm = () => {
|
||||
// 调用接口提交数据
|
||||
await addMaterialsInventory({ ...form, materialsId: props.materialsId });
|
||||
ElMessage.success('提交成功');
|
||||
emit('submit');
|
||||
closeDialog();
|
||||
} catch (error) {
|
||||
ElMessage.error('提交失败');
|
||||
|
@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-table size="small" v-if="materialsInventoryList.length !== 0" :data="materialsInventoryList">
|
||||
<el-table-column label="" width="100" align="center" />
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="出入库" align="center" prop="outPut">
|
||||
<template #default="scope">
|
||||
|
@ -8,7 +8,7 @@
|
||||
<el-input v-model="queryParams.materialsName" placeholder="请输入材料名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="材料提供商" prop="companyId">
|
||||
<el-select v-model="queryParams.companyId" clearable placeholder="请选择材料提供商">
|
||||
<el-select v-model="queryParams.companyId" clearable placeholder="全部">
|
||||
<el-option v-for="item in companyOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -133,7 +133,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<materials-inventory-add-dialog :materials-id="currentMaterialsId" :project-id="currentProject.id" ref="dialogRef" />
|
||||
<materials-inventory-add-dialog :materials-id="currentMaterialsId" :project-id="currentProject.id" ref="dialogRef" @submit="getList" />
|
||||
<el-dialog title="材料详情" v-model="showDetailDrawer" width="700px">
|
||||
<materials-detail-drawer :materials-id="currentMaterialsId" />
|
||||
</el-dialog>
|
||||
@ -295,6 +295,7 @@ const submitForm = () => {
|
||||
materialsFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
if (form.value.id) {
|
||||
await updateMaterials({
|
||||
...form.value,
|
||||
@ -351,6 +352,20 @@ const handleOssUpdate = (ossId: string, value: string) => {
|
||||
}
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getCompanyList();
|
||||
|
@ -31,7 +31,7 @@
|
||||
<el-table v-loading="loading" :data="materialsInventoryList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="材料名称" align="center" prop="materialsVo.materialsName" />
|
||||
<el-table-column label="材料名称" align="center" prop="materialsName" />
|
||||
<el-table-column label="入库登记" align="center">
|
||||
<el-table-column label="数量" align="center" prop="number">
|
||||
<template #default="scope">
|
||||
@ -79,7 +79,7 @@
|
||||
<el-table-column label="处理方式" align="center" prop="disposition" />
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-space wrap>
|
||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['materials:materialsInventory:edit']">
|
||||
@ -90,7 +90,7 @@
|
||||
</el-button>
|
||||
</el-space>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
@ -225,12 +225,6 @@ const getList = async () => {
|
||||
materialsInventoryList.value = res.rows;
|
||||
total.value = res.total;
|
||||
const materialsMap = new Map();
|
||||
res.rows.forEach((record: MaterialsInventoryVO) => {
|
||||
const { id, materialsName } = record.materialsVo;
|
||||
if (!materialsMap.has(id)) {
|
||||
materialsMap.set(id, { id, materialsName });
|
||||
}
|
||||
});
|
||||
materialsOptions.value = Array.from(materialsMap.values());
|
||||
loading.value = false;
|
||||
};
|
||||
@ -281,6 +275,7 @@ const submitForm = () => {
|
||||
materialsInventoryFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
if (form.value.id) {
|
||||
await updateMaterialsInventory(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -312,6 +307,20 @@ const handleExport = () => {
|
||||
`materialsInventory_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
@ -157,6 +157,20 @@ const handleDelete = async (row?: ConstructionBlacklistVO) => {
|
||||
await getList();
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
@ -1,50 +1,138 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-descriptions v-loading="loading" title="用户信息" direction="vertical" border>
|
||||
<el-descriptions-item :rowspan="3" :width="200" label="人脸照">
|
||||
<el-image :src="userDetail?.facePicUrl" style="width: 150px; height: 150px" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="姓名">{{ userDetail?.userName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">{{ userDetail?.phone }}</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">
|
||||
<dict-tag :options="user_sex_type" :value="userDetail?.sex" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="年龄">{{ dayjs().diff(dayjs(userDetail?.sfzBirth), 'year') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="民族">{{ userDetail?.nation }}</el-descriptions-item>
|
||||
<el-descriptions-item label="籍贯">{{ userDetail?.nativePlace }}</el-descriptions-item>
|
||||
<el-descriptions-item label="身份证号码">{{ userDetail?.sfzNumber }}</el-descriptions-item>
|
||||
<el-descriptions-item label="身份证有效期">
|
||||
{{ dayjs(userDetail?.sfzStart).format('YYYY 年 MM 月 DD 日') }}
|
||||
—— {{ dayjs(userDetail?.sfzEnd).format('YYYY 年 MM 月 DD 日') }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="身份证地址">{{ userDetail?.sfzSite }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<br />
|
||||
<el-descriptions v-loading="loading" title="银行卡" direction="vertical" border>
|
||||
<el-descriptions-item label="银行卡号">{{ userDetail?.yhkNumber }}</el-descriptions-item>
|
||||
<el-descriptions-item label="银行开户行">{{ userDetail?.yhkOpeningBank }}</el-descriptions-item>
|
||||
<el-descriptions-item label="持卡人">{{ userDetail?.yhkCardholder }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<br />
|
||||
<el-descriptions v-loading="loading" title="单位信息" direction="vertical" border>
|
||||
<el-descriptions-item label="施工单位">{{ userDetail?.contractorVo?.name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="工种">
|
||||
<dict-tag :options="type_of_work" :value="userDetail?.typeOfWork" />
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<br />
|
||||
<el-descriptions :column="2" v-loading="loading" title="其他信息" direction="vertical" border>
|
||||
<el-descriptions-item label="班组">{{ userDetail?.teamVo?.teamName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="打卡状态">
|
||||
<dict-tag :options="user_clock_type" :value="userDetail?.clock" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="入场时间">
|
||||
{{ userDetail?.entryDate ? dayjs(userDetail?.entryDate).format('YYYY 年 MM 月 DD 日 HH:mm:ss') : '' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="离场时间">
|
||||
{{ userDetail?.leaveDate ? dayjs(userDetail?.leaveDate).format('YYYY 年 MM 月 DD 日 HH:mm:ss') : '' }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div class="block_box">
|
||||
<span>用户信息</span>
|
||||
<el-form label-width="130px">
|
||||
<el-row :gutter="20" justify="space-around">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="人脸照">
|
||||
<el-image :src="userDetail?.facePicUrl" style="width: 150px; height: 150px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名">
|
||||
{{ userDetail?.userName }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话">
|
||||
{{ userDetail?.phone }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别">
|
||||
<dict-tag :options="user_sex_type" :value="userDetail?.sex" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="年龄">
|
||||
{{ dayjs().diff(dayjs(userDetail?.sfzBirth), 'year') }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="民族">
|
||||
{{ userDetail?.nation }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="籍贯">
|
||||
{{ userDetail?.nativePlace }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号码">
|
||||
{{ userDetail?.sfzNumber }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号码">
|
||||
{{ userDetail?.sfzNumber }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证有效开始期">
|
||||
{{ dayjs(userDetail?.sfzStart).format('YYYY 年 MM 月 DD 日') }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证有效结束期">
|
||||
{{ dayjs(userDetail?.sfzEnd).format('YYYY 年 MM 月 DD 日') }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证地址">
|
||||
{{ userDetail?.sfzSite }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="block_box">
|
||||
<span>银行卡</span>
|
||||
<el-form label-width="130px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="银行卡号">
|
||||
{{ userDetail?.yhkNumber }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="银行开户行">
|
||||
{{ userDetail?.yhkOpeningBank }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="持卡人">
|
||||
{{ userDetail?.yhkCardholder }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="block_box">
|
||||
<span>单位信息</span>
|
||||
<el-form label-width="130px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="施工单位">
|
||||
{{ userDetail?.contractorVo?.name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工种">
|
||||
<dict-tag :options="type_of_work" :value="userDetail?.typeOfWork" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="block_box">
|
||||
<span>其他信息</span>
|
||||
<el-form label-width="130px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班组">
|
||||
{{ userDetail?.teamVo?.teamName }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="打卡状态">
|
||||
<dict-tag :options="user_clock_type" :value="userDetail?.clock" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="入场时间">
|
||||
{{ userDetail?.entryDate ? dayjs(userDetail?.entryDate).format('YYYY 年 MM 月 DD 日 HH:mm:ss') : '' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="离场时间">
|
||||
{{ userDetail?.leaveDate ? dayjs(userDetail?.leaveDate).format('YYYY 年 MM 月 DD 日 HH:mm:ss') : '' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -85,3 +173,16 @@ watch(
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.block_box {
|
||||
border: 1px solid #9eccfa;
|
||||
border-radius: 6px;
|
||||
padding: 10px 20px 20px 10px;
|
||||
margin: 15px;
|
||||
> span {
|
||||
color: #409eff;
|
||||
font-weight: 700;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -8,22 +8,22 @@
|
||||
<el-input v-model="queryParams.userName" placeholder="请输入人员姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分包公司" prop="contractorId">
|
||||
<el-select v-model="queryParams.contractorId" clearable placeholder="请选择分包公司">
|
||||
<el-select v-model="queryParams.contractorId" clearable placeholder="全部">
|
||||
<el-option v-for="item in contractorOpt" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班组" prop="contractorId">
|
||||
<el-select v-model="queryParams.teamId" clearable placeholder="请选择班组">
|
||||
<el-option v-for="item in projectTeamOpt" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-form-item label="班组" prop="teamId">
|
||||
<el-select v-model="queryParams.teamId" clearable placeholder="全部">
|
||||
<el-option v-for="item in ProjectTeam" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工种" prop="typeOfWork">
|
||||
<el-select v-model="queryParams.typeOfWork" clearable placeholder="请选择工种">
|
||||
<el-select v-model="queryParams.typeOfWork" clearable placeholder="全部">
|
||||
<el-option v-for="item in type_of_work" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="打卡" prop="clock">
|
||||
<el-select v-model="queryParams.clock" clearable placeholder="请选择打卡">
|
||||
<el-select v-model="queryParams.clock" clearable placeholder="全部">
|
||||
<el-option v-for="item in user_clock_type" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -62,6 +62,42 @@
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['project:constructionUser:export']">导出 </el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Edit" :disabled="multiple" @click="statusDialog = true">用户状态编辑 </el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-switch
|
||||
v-model="playCardStatus"
|
||||
class="ml-2"
|
||||
inline-prompt
|
||||
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
|
||||
:loading="playCardLoding"
|
||||
@change="handlePlayCardStatus"
|
||||
inactive-text="一键关闭打卡"
|
||||
active-text="一键开启打卡"
|
||||
/>
|
||||
</el-col>
|
||||
<el-row @mouseover="informationStatus = true" :gutter="10" @mouseout="informationStatus = false">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain>员工资料 </el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-show="informationStatus">
|
||||
<el-button type="primary" plain icon="Edit" @click="downloadTemplate">下载资料模板 </el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-show="informationStatus">
|
||||
<file-upload
|
||||
v-model="filePath"
|
||||
isImportInfo
|
||||
:isShowTip="false"
|
||||
uploadUrl="/project/constructionUserFile/upload/zip"
|
||||
:limit="1"
|
||||
:file-size="50"
|
||||
>
|
||||
<el-button type="warning" plain icon="Edit">导入员工资料 </el-button>
|
||||
</file-upload>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
@ -69,7 +105,11 @@
|
||||
<el-table v-loading="loading" :data="constructionUserList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="姓名" align="center" prop="userName" />
|
||||
<el-table-column label="姓名" align="center" prop="userName">
|
||||
<template #default="scope">
|
||||
<el-link type="primary" @click="handleUpdate(scope.row)">{{ scope.row.userName }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分包公司" align="center" prop="contractorVo.name" />
|
||||
<el-table-column label="班组" align="center" prop="teamId">
|
||||
<template #default="scope">
|
||||
@ -91,12 +131,31 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="打卡状态" align="center" prop="clock">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="user_clock_type" :value="scope.row.clock" />
|
||||
<el-switch
|
||||
v-model="scope.row.clock"
|
||||
class="ml-2"
|
||||
inline-prompt
|
||||
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
|
||||
active-text="开启"
|
||||
inactive-text="禁用"
|
||||
:loading="playCardLoding"
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
@change="handleClockStatus(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="薪水" align="center" min-width="180">
|
||||
<template #default="scope">
|
||||
<span class="flex justify-center">
|
||||
{{ scope.row.salary ? scope.row.salary : scope.row.standardSalary }}
|
||||
(<dict-tag :options="wage_measure_unit_type" :value="scope.row.wageMeasureUnit"></dict-tag>)
|
||||
</span>
|
||||
<div class="text-blue text-sm cursor-pointer" @click="openSalaryDialog(scope.row)">{{ scope.row.salary ? '取消变更' : '变更' }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入场时间" align="center" prop="entryDate" min-width="180" />
|
||||
<el-table-column label="离场时间" align="center" prop="leaveDate" min-width="180" />
|
||||
<el-table-column label="薪水" align="center" prop="salary" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
{{ scope.row.status == 0 ? '在职' : '离职' }}
|
||||
@ -112,12 +171,21 @@
|
||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['project:constructionUser:edit']">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button link type="warning" icon="Female" @click="handlePlayCard(scope.row)"> 打卡 </el-button>
|
||||
<el-button link type="danger" icon="Avatar" @click="handleJoinBlacklist(scope.row)" v-hasPermi="['project:constructionBlacklist:add']">
|
||||
黑名单
|
||||
</el-button>
|
||||
<!-- <el-button link type="primary" icon="Switch" @click="handleToggle(scope.row)"> 切换人脸 </el-button> -->
|
||||
<el-button link type="primary" icon="Switch" @click="handleChange(scope.row)"> 人员迁移 </el-button>
|
||||
<el-button link type="primary" icon="ChatLineSquare" @click="handleExit(scope.row)"> 入退场记录 </el-button>
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['project:constructionUser:remove']">
|
||||
删除
|
||||
</el-button>
|
||||
<el-tooltip content="红点:部分上传,绿点:已上传,无点:未上传" placement="right" effect="dark">
|
||||
<el-badge :is-dot="scope.row.fileUploadStatus != '1'" :type="uploadStatusColor(scope.row.fileUploadStatus)">
|
||||
<el-button link type="primary" icon="FolderAdd" @click="handleUpload(scope.row)">文件上传 </el-button>
|
||||
</el-badge>
|
||||
</el-tooltip>
|
||||
</el-space>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -132,7 +200,7 @@
|
||||
<div class="msg">用户信息</div>
|
||||
<div class="el-row">
|
||||
<div class="el-col el-col-24">
|
||||
<el-form-item label="人脸照" prop="pacePhoto">
|
||||
<el-form-item label="人脸照" prop="facePic">
|
||||
<image-upload v-model="form.facePic" :limit="1" :is-show-tip="false" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
@ -247,6 +315,13 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="el-col el-col-12">
|
||||
<el-form-item label="结算方式" prop="wageMeasureUnit">
|
||||
<el-select v-model="form.wageMeasureUnit" clearable placeholder="请选择结算方式">
|
||||
<el-option v-for="item in wage_measure_unit_type" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="el-col el-col-12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" style="width: 240px" />
|
||||
@ -262,9 +337,128 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="施工人员详情" v-model="showDetailDrawer">
|
||||
<el-dialog title="施工人员详情" v-model="showDetailDrawer" width="800px">
|
||||
<construction-user-detail :user-id="currentUserId" />
|
||||
</el-dialog>
|
||||
<el-dialog :title="skipName + '-人员迁移'" v-model="skip" width="500px">
|
||||
<el-form-item label="所属项目" label-width="130px">
|
||||
<el-select v-model="skipObject.projectId" @change="selectProject" placeholder="请选择所属项目" style="width: 240px">
|
||||
<el-option v-for="item in skipOptions" :key="item.id" :label="item.projectName" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="分包单位" label-width="130px">
|
||||
<el-select v-model="skipObject.contractorId" :disabled="!skipObject.projectId" placeholder="请选择分包单位" style="width: 240px">
|
||||
<el-option v-for="item in contractorList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="setUnits">确认</el-button>
|
||||
<el-button @click="skip = false"> 取消 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="上传文件" v-model="fileStatus" width="770px">
|
||||
<div class="image_upload" v-for="(item, index) in uploadPath" :key="item.value">
|
||||
<div class="title">{{ item.label }}</div>
|
||||
<div class="file_upload_all" v-if="item.value != 7">
|
||||
<file-upload v-model="item.path" isConstruction :isShowTip="false" :limit="10" :file-type="['pdf']" :file-size="50" />
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="updateProjectFile">确认</el-button>
|
||||
<el-button @click="fileStatus = false"> 取消 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog :title="skipName + '-切换人脸'" v-model="showFaceDrawer" width="770px">
|
||||
<div class="flex items-center justify-center">
|
||||
<el-form :model="form" ref="constructionUserFormRef" :rules="rules">
|
||||
<el-form-item>
|
||||
<image-upload v-model="form.facePic" :limit="1" :is-show-tip="false" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span
|
||||
><el-button type="primary" @click="submitForm">保存</el-button>
|
||||
<el-button @click="showFaceDrawer = false">取消</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="修改在职状态" v-model="statusDialog" width="30%">
|
||||
<el-form-item label="在职状态">
|
||||
<el-select v-model="vocationalStatus" placeholder="请选择状态">
|
||||
<el-option v-for="item in user_status_type" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<template #footer>
|
||||
<span
|
||||
><el-button type="primary" @click="handleEdit">保存</el-button>
|
||||
<el-button @click="statusDialog = false">取消</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="温馨提示" v-model="salaryStatus" width="30%">
|
||||
<span>请输入薪资</span>
|
||||
<el-input class="mt-xl" v-model="changeSalary" placeholder="" clearable @change=""></el-input>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button type="primary" @click="handleSalary">确认</el-button>
|
||||
<el-button @click="salaryStatus = false">取消</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="入场退场记录" v-model="exitStatus" width="600px">
|
||||
<div v-for="(item, index) in exitList">
|
||||
<el-timeline>
|
||||
<el-timeline-item color="#0bbd87" class="mb">
|
||||
{{ '入场时间:' + item.entryDate }}
|
||||
</el-timeline-item>
|
||||
<el-timeline-item color="rgb(255, 73, 73)">
|
||||
<div class="mb">{{ '退场时间:' + item.entryDate }}</div>
|
||||
<div class="pl-xl">
|
||||
<span class="text-coolgray font-bold">退场文件:<image-preview v-for="itm in item.pathUrl" :src="itm" width="100px" class="mr" /></span
|
||||
><br />
|
||||
<p class="mt text-coolgray">
|
||||
备注:<span class="text-blue">{{ item.remark }}</span>
|
||||
</p>
|
||||
</div>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="exitStatus = false">关闭</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog :title="`打卡记录`" v-model="playCardCalendar" width="770px" :close-on-click-modal="false">
|
||||
<el-calendar ref="calendar" v-model="calendarDay">
|
||||
<template #header="{ date }">
|
||||
<span>{{ date }}</span>
|
||||
<div class="status-detail flex items-center justify-between">
|
||||
<div class="green">全天考勤正常</div>
|
||||
<div class="orange">半勤</div>
|
||||
<div class="red">缺卡</div>
|
||||
<div class="gray">请假</div>
|
||||
</div>
|
||||
<el-date-picker v-model="monthValue" type="month" placeholder="请选择月份" @change="handleMonth" />
|
||||
</template>
|
||||
<template #date-cell="{ data }">
|
||||
<div
|
||||
class="w100% h100% position-relative m-0 monthDay"
|
||||
:class="data.isSelected ? 'is-selected' : ''"
|
||||
@click="handleViewPlayCard(playCardIdx(data), data)"
|
||||
>
|
||||
{{ data.day.split('-').slice(1).join('-') }}
|
||||
<div :style="{ background: playCardColor(data) }" v-if="playCardIdx(data) != -1"></div>
|
||||
</div>
|
||||
</template>
|
||||
</el-calendar>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -274,9 +468,26 @@ import {
|
||||
delConstructionUser,
|
||||
getConstructionUser,
|
||||
listConstructionUser,
|
||||
updateConstructionUser
|
||||
updateConstructionUser,
|
||||
getProjectContractorList,
|
||||
transferConstructionUser,
|
||||
updateConstructionUserStatus,
|
||||
updateConstructionUserPlayCardStatus,
|
||||
updateConstructionUserPlayCardOneStatus,
|
||||
updateConstructionUserSalary,
|
||||
getConstructionUserExit,
|
||||
dowloadConstructionUserTemplate,
|
||||
importConstructionUserInfo,
|
||||
listConstructionMonth
|
||||
} from '@/api/project/constructionUser';
|
||||
import { ConstructionUserForm, ConstructionUserQuery, ConstructionUserVO } from '@/api/project/constructionUser/types';
|
||||
import {
|
||||
ConstructionUserForm,
|
||||
ConstructionUserQuery,
|
||||
ConstructionUserVO,
|
||||
skipType,
|
||||
skipOptionType,
|
||||
skipTeamType
|
||||
} from '@/api/project/constructionUser/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { listContractor } from '@/api/project/contractor';
|
||||
import { listProjectTeam } from '@/api/project/projectTeam';
|
||||
@ -284,14 +495,28 @@ import { ContractorVO } from '@/api/project/contractor/types';
|
||||
import { ProjectTeamVO } from '@/api/project/projectTeam/types';
|
||||
import ConstructionUserDetail from '@/views/project/constructionUser/component/ConstructionUserDetail.vue';
|
||||
import { addConstructionBlacklist } from '@/api/project/constructionBlacklist';
|
||||
import { listConstructionUserFile, setConstructionUserFile } from '@/api/project/constructionUserFile';
|
||||
import {
|
||||
ConstructionUserFileVO,
|
||||
ConstructionUserExitVO,
|
||||
ConstructionUserFileForm,
|
||||
ConstructionUserFileQuery
|
||||
} from '@/api/project/constructionUserFile/types';
|
||||
import { ElLoadingService } from 'element-plus';
|
||||
import type { CalendarDateType, CalendarInstance } from 'element-plus';
|
||||
import { AttendanceMonthVO } from '@/api/project/attendance/types';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
|
||||
const calendar = ref<CalendarInstance>();
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { type_of_work, user_sex_type, user_clock_type } = toRefs<any>(proxy?.useDict('type_of_work', 'user_sex_type', 'user_clock_type'));
|
||||
|
||||
const { type_of_work, user_sex_type, user_clock_type, user_file_type, user_status_type, wage_measure_unit_type } = toRefs<any>(
|
||||
proxy?.useDict('type_of_work', 'user_sex_type', 'user_clock_type', 'user_file_type', 'user_status_type', 'wage_measure_unit_type')
|
||||
);
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const ProjectTeam = computed(() => userStore.ProjectTeamList);
|
||||
const constructionUserList = ref<ConstructionUserVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
@ -300,14 +525,42 @@ const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const skip = ref(false);
|
||||
const fileStatus = ref(false);
|
||||
const showFaceDrawer = ref(false);
|
||||
const statusDialog = ref(false);
|
||||
const playCardStatus = ref(false);
|
||||
const playCardLoding = ref(false);
|
||||
const playCardCalendar = ref(false);
|
||||
const salaryStatus = ref(false);
|
||||
const exitStatus = ref(false);
|
||||
const calendarDay = ref<Date | null>(null);
|
||||
const monthValue = ref<Date | null>(null);
|
||||
const informationStatus = ref(false);
|
||||
const filePath = ref<string>('');
|
||||
const exitList = ref<ConstructionUserExitVO[]>([]);
|
||||
const changeSalary = ref<string>('');
|
||||
const vocationalStatus = ref<number>(null);
|
||||
const fileList = ref<ConstructionUserFileVO[]>([]);
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const constructionUserFormRef = ref<ElFormInstance>();
|
||||
|
||||
const skipName = ref('');
|
||||
const calendarList = ref<Array<AttendanceMonthVO>>([]);
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
title: '',
|
||||
id: undefined
|
||||
});
|
||||
const baseUrl = import.meta.env.VITE_APP_BASE_API;
|
||||
//人员迁移条件
|
||||
const skipObject: skipType = reactive({
|
||||
id: '',
|
||||
projectId: '',
|
||||
contractorId: ''
|
||||
});
|
||||
const contractorList = ref<Array<skipTeamType>>([]);
|
||||
//项目列表
|
||||
const skipOptions = ref<Array<skipOptionType>>([]);
|
||||
|
||||
const initFormData: ConstructionUserForm = {
|
||||
id: undefined,
|
||||
@ -328,6 +581,7 @@ const initFormData: ConstructionUserForm = {
|
||||
sfzNumber: undefined,
|
||||
sfzStart: undefined,
|
||||
sfzEnd: undefined,
|
||||
wageMeasureUnit: undefined,
|
||||
sfzSite: undefined,
|
||||
sfzBirth: undefined,
|
||||
nativePlace: undefined,
|
||||
@ -376,13 +630,88 @@ const data = reactive<PageData<ConstructionUserForm, ConstructionUserQuery>>({
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }],
|
||||
clock: [{ required: true, message: '打卡不能为空', trigger: 'blur' }]
|
||||
clock: [{ required: true, message: '打卡不能为空', trigger: 'blur' }],
|
||||
facePic: [{ required: true, message: '人脸照不能为空', trigger: 'blur' }],
|
||||
userName: [{ required: true, message: '人员姓名不能为空', trigger: 'blur' }],
|
||||
projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }],
|
||||
contractorId: [{ required: true, message: '分包公司id不能为空', trigger: 'blur' }],
|
||||
teamId: [{ required: true, message: '班组id不能为空', trigger: 'blur' }],
|
||||
phone: [{ required: true, message: '联系电话不能为空', trigger: 'blur' }],
|
||||
nation: [{ required: true, message: '民族不能为空', trigger: 'blur' }],
|
||||
sfzFrontPic: [{ required: true, message: '身份证正面图片不能为空', trigger: 'blur' }],
|
||||
sfzBackPic: [{ required: true, message: '身份证背面图片不能为空', trigger: 'blur' }],
|
||||
sfzNumber: [{ required: true, message: '身份证号码不能为空', trigger: 'blur' }],
|
||||
sfzStart: [{ required: true, message: '身份证有效开始期不能为空', trigger: 'blur' }],
|
||||
sfzEnd: [{ required: true, message: '身份证有效结束期不能为空', trigger: 'blur' }],
|
||||
sfzSite: [{ required: true, message: '身份证地址不能为空', trigger: 'blur' }],
|
||||
sfzBirth: [{ required: true, message: '身份证出生日期不能为空', trigger: 'blur' }],
|
||||
nativePlace: [{ required: true, message: '籍贯不能为空', trigger: 'blur' }],
|
||||
yhkPic: [{ required: true, message: '银行卡图片不能为空', trigger: 'blur' }],
|
||||
yhkNumber: [{ required: true, message: '银行卡号不能为空', trigger: 'blur' }],
|
||||
yhkOpeningBank: [{ required: true, message: '开户行不能为空', trigger: 'blur' }],
|
||||
typeOfWork: [{ required: true, message: '工种(字典type_of_work)不能为空', trigger: 'blur' }],
|
||||
wageMeasureUnit: [{ required: true, message: '工资计量单位不能为空', trigger: 'blur' }],
|
||||
userRole: [{ required: true, message: '用户角色(1=普通用户,2=管理员)不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
/** 返回遍历文件对象 */
|
||||
const uploadPath = computed(() => {
|
||||
const list = JSON.parse(JSON.stringify(user_file_type.value));
|
||||
for (const item of fileList.value) {
|
||||
const targetType = item.fileType;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].value == targetType) {
|
||||
list[i] = { ...list[i], ...item }; // 合并对象
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (!list[i].hasOwnProperty('fileType')) {
|
||||
list[i].fileType = list[i].value;
|
||||
}
|
||||
}
|
||||
console.log(list);
|
||||
return list;
|
||||
});
|
||||
|
||||
/** 返回文件上传状态 */
|
||||
const uploadStatusColor = computed(() => (str: string) => {
|
||||
switch (str) {
|
||||
case '3':
|
||||
return 'success';
|
||||
case '2':
|
||||
return 'danger';
|
||||
default:
|
||||
return 'info';
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
//打卡时间下标
|
||||
const playCardIdx = computed(() => (date) => {
|
||||
return calendarList.value.findIndex((item) => item.clockDate == date.day);
|
||||
});
|
||||
|
||||
//打卡状态颜色
|
||||
const playCardColor = computed(() => (date) => {
|
||||
const idx = calendarList.value[playCardIdx.value(date)]?.status;
|
||||
switch (idx) {
|
||||
case '1':
|
||||
return 'green';
|
||||
case '2':
|
||||
return 'orange';
|
||||
case '3':
|
||||
return 'red';
|
||||
case '4':
|
||||
return 'gray';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
});
|
||||
|
||||
/** 查询施工人员列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
@ -392,6 +721,50 @@ const getList = async () => {
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 查看打卡记录详情 */
|
||||
const handleViewPlayCard = async (idx: number, data: any) => {
|
||||
if (data.type == 'next-month' || data.type == 'prev-month') {
|
||||
monthValue.value = data.date;
|
||||
handleCalendarMonth(monthValue.value);
|
||||
}
|
||||
|
||||
const statusColor = calendarList.value[idx]?.status;
|
||||
if (idx == -1 || statusColor == '4' || statusColor == '3') {
|
||||
return proxy?.$modal.msgWarning('暂无打卡记录数据');
|
||||
}
|
||||
const { downClockTime, downClockPic, upClockTime, upClockPic } = calendarList.value[idx]?.clockList;
|
||||
ElNotification({
|
||||
title: '温馨提示',
|
||||
dangerouslyUseHTMLString: true,
|
||||
message: `<div style="display: flex;flex-direction: row;align-items: center;margin-top: 15px;height:60px">
|
||||
<span>头像:</span>
|
||||
<div style="width: 50px;height: 50px;border-radius:15px;">
|
||||
<img src="${upClockPic}" style="width: 100%;height: 100%;border-radius:15px;">
|
||||
</div>
|
||||
</div><span>上班打卡时间:${upClockTime ? upClockTime : ''}</span><div style="display: flex;flex-direction: row;align-items: center;margin-top: 15px;height:60px">
|
||||
<span>头像:</span>
|
||||
<div style="width: 50px;height: 50px;border-radius:15px;">
|
||||
<img src="${downClockPic}" style="width: 100%;height: 100%;border-radius:15px;">
|
||||
</div>
|
||||
</div><span>下班打卡时间:${downClockTime ? downClockTime : ''}</span>`
|
||||
});
|
||||
};
|
||||
|
||||
const selectProject = (e: any) => {
|
||||
//选中项目筛选出项目下的分包单位并清空分包单位value
|
||||
contractorList.value = skipOptions.value.filter((item) => item.id == e)[0].contractorList;
|
||||
skipObject.contractorId = '';
|
||||
};
|
||||
|
||||
const setUnits = async () => {
|
||||
//人员迁移
|
||||
let res = await transferConstructionUser(skipObject);
|
||||
if (res.code == 200) {
|
||||
ElMessage.success(res.msg);
|
||||
skip.value = false;
|
||||
getList();
|
||||
}
|
||||
};
|
||||
const contractorOpt = ref();
|
||||
|
||||
/** 查询当前项目下的分包公司列表 */
|
||||
@ -409,27 +782,45 @@ const getContractorList = async () => {
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
const projectTeamOpt = ref([]);
|
||||
const handleMonth = async (e: any) => {
|
||||
calendarDay.value = e;
|
||||
handleCalendarMonth(e);
|
||||
};
|
||||
|
||||
/** 查询当前项目下的班组列表 */
|
||||
const getProjectTeamList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listProjectTeam({
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
orderByColumn: 'createTime',
|
||||
isAsc: 'desc',
|
||||
projectId: currentProject.value.id
|
||||
const handleCalendarMonth = async (e?) => {
|
||||
let clockMonth;
|
||||
if (e) {
|
||||
clockMonth = parseTime(e, '{y}-{m}');
|
||||
}
|
||||
|
||||
const res = await listConstructionMonth({ userId: dialog.id, clockMonth });
|
||||
calendarList.value = res.data;
|
||||
};
|
||||
|
||||
/** 上传安全协议书按钮操作 */
|
||||
|
||||
const updateProjectFile = async () => {
|
||||
buttonLoading.value = true;
|
||||
let fileList = uploadPath.value.map((item) => {
|
||||
return {
|
||||
fileId: item.path,
|
||||
fileType: item.fileType
|
||||
};
|
||||
});
|
||||
projectTeamOpt.value = res.rows.map((projectTeam: ProjectTeamVO) => ({
|
||||
value: projectTeam.id,
|
||||
label: projectTeam.teamName
|
||||
}));
|
||||
loading.value = false;
|
||||
const data = {
|
||||
userId: currentUserId.value,
|
||||
fileList
|
||||
};
|
||||
console.log('🚀 ~ updateProjectFile ~ data:', data);
|
||||
await setConstructionUserFile(data);
|
||||
proxy?.$modal.msgSuccess('上传成功');
|
||||
buttonLoading.value = false;
|
||||
fileStatus.value = false;
|
||||
await getList();
|
||||
};
|
||||
|
||||
const getTeamName = (teamId: string | number) => {
|
||||
const team = projectTeamOpt.value.find((item: any) => item.value === teamId);
|
||||
const team = ProjectTeam.value.find((item: any) => item.value === teamId);
|
||||
return team ? team.label : teamId;
|
||||
};
|
||||
|
||||
@ -489,11 +880,74 @@ const handleShowDrawer = (row?: ConstructionUserVO) => {
|
||||
showDetailDrawer.value = true;
|
||||
};
|
||||
|
||||
//打卡按钮
|
||||
const handlePlayCard = async (row: ConstructionUserVO) => {
|
||||
const _id = row?.id || ids.value[0];
|
||||
skipName.value = row?.userName;
|
||||
dialog.id = _id;
|
||||
await handleCalendarMonth();
|
||||
|
||||
playCardCalendar.value = true;
|
||||
};
|
||||
|
||||
//下载模板
|
||||
const downloadTemplate = async () => {
|
||||
const loadingInstance = ElLoadingService({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
const res = await dowloadConstructionUserTemplate({ projectId: currentProject.value.id });
|
||||
loadingInstance.close();
|
||||
};
|
||||
|
||||
//导入资料
|
||||
const importInformation = async () => {};
|
||||
|
||||
/** 人员迁移 */
|
||||
const handleChange = async (row: ConstructionUserVO) => {
|
||||
const _id = row?.id || ids.value[0];
|
||||
skipName.value = row?.userName;
|
||||
skipObject.id = _id;
|
||||
const res = await getProjectContractorList();
|
||||
skipOptions.value = res.data;
|
||||
skip.value = true;
|
||||
};
|
||||
|
||||
// //切换人脸
|
||||
// const handleToggle = async (row: ConstructionUserVO) => {
|
||||
// reset();
|
||||
// skipName.value = row?.userName;
|
||||
// const _id = row?.id || ids.value[0];
|
||||
// const res = await getConstructionUser(_id);
|
||||
// Object.assign(form.value, res.data);
|
||||
// showFaceDrawer.value = true;
|
||||
// };
|
||||
|
||||
const handleExit = async (row: ConstructionUserVO) => {
|
||||
const _id = row?.id || ids.value[0];
|
||||
currentUserId.value = _id;
|
||||
const res = await getConstructionUserExit({ userId: _id });
|
||||
exitList.value = res.rows;
|
||||
exitStatus.value = true;
|
||||
};
|
||||
|
||||
//上传按钮
|
||||
const handleUpload = async (row: ConstructionUserVO) => {
|
||||
const _id = row?.id || ids.value[0];
|
||||
currentUserId.value = _id;
|
||||
const res = await listConstructionUserFile({ userId: _id });
|
||||
fileList.value = res.data;
|
||||
fileStatus.value = true;
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
constructionUserFormRef.value?.validate(async (valid: boolean) => {
|
||||
console.log(valid);
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
if (form.value.id) {
|
||||
await updateConstructionUser(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -501,7 +955,10 @@ const submitForm = () => {
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
showFaceDrawer.value = false;
|
||||
await getList();
|
||||
} else {
|
||||
console.log(12);
|
||||
}
|
||||
});
|
||||
};
|
||||
@ -536,14 +993,149 @@ const handleExport = () => {
|
||||
`constructionUser_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
/** 用户状态编辑操作 */
|
||||
const handleEdit = async () => {
|
||||
if (!vocationalStatus.value) {
|
||||
proxy?.$modal.msgError('请选择状态');
|
||||
return;
|
||||
}
|
||||
const data = {
|
||||
idList: ids.value,
|
||||
status: vocationalStatus.value
|
||||
};
|
||||
await updateConstructionUserStatus(data);
|
||||
proxy?.$modal.msgSuccess('修改成功');
|
||||
getList();
|
||||
ids.value = [];
|
||||
statusDialog.value = false;
|
||||
};
|
||||
|
||||
//打开修改日薪
|
||||
const openSalaryDialog = (row: ConstructionUserVO) => {
|
||||
const _id = row?.id || ids.value[0];
|
||||
currentUserId.value = _id;
|
||||
if (row.salary) {
|
||||
setSalary();
|
||||
return;
|
||||
}
|
||||
console.log(row);
|
||||
salaryStatus.value = true;
|
||||
};
|
||||
|
||||
//变更日薪
|
||||
const handleSalary = async () => {
|
||||
if (!changeSalary.value) {
|
||||
proxy?.$modal.msgError('请输入薪资');
|
||||
return;
|
||||
}
|
||||
setSalary();
|
||||
};
|
||||
const setSalary = async () => {
|
||||
await updateConstructionUserSalary({ id: currentUserId.value, salary: changeSalary.value });
|
||||
proxy?.$modal.msgSuccess('修改成功');
|
||||
getList();
|
||||
changeSalary.value = '';
|
||||
salaryStatus.value = false;
|
||||
};
|
||||
|
||||
// 批量切换在职状态
|
||||
const handlePlayCardStatus = async (e) => {
|
||||
playCardLoding.value = true;
|
||||
const clock = e ? 1 : 0;
|
||||
await updateConstructionUserPlayCardStatus({ projectId: currentProject.value.id, clock });
|
||||
proxy?.$modal.msgSuccess('修改成功');
|
||||
getList();
|
||||
playCardLoding.value = false;
|
||||
};
|
||||
|
||||
// 切换在职状态
|
||||
const handleClockStatus = async (row: ConstructionUserVO) => {
|
||||
playCardLoding.value = true;
|
||||
await updateConstructionUserPlayCardOneStatus({ id: row.id, clock: row.clock });
|
||||
proxy?.$modal.msgSuccess('修改成功');
|
||||
getList();
|
||||
playCardLoding.value = false;
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getContractorList();
|
||||
getProjectTeamList();
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
<style scoped lang="scss">
|
||||
.status-detail {
|
||||
margin: 0 15px;
|
||||
position: relative;
|
||||
font-size: 12px;
|
||||
> div {
|
||||
margin: 0 15px;
|
||||
position: relative;
|
||||
font-size: 12px;
|
||||
&::before {
|
||||
position: absolute;
|
||||
content: '';
|
||||
display: inline-block;
|
||||
left: -15px;
|
||||
top: 30%;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.red {
|
||||
&::before {
|
||||
background-color: red;
|
||||
}
|
||||
}
|
||||
.gray {
|
||||
&::before {
|
||||
background-color: gray;
|
||||
}
|
||||
}
|
||||
.orange {
|
||||
&::before {
|
||||
background-color: orange;
|
||||
}
|
||||
}
|
||||
.green {
|
||||
&::before {
|
||||
background-color: green;
|
||||
}
|
||||
}
|
||||
}
|
||||
.monthDay {
|
||||
padding: 8px;
|
||||
> div {
|
||||
position: absolute;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
bottom: 8px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: auto;
|
||||
}
|
||||
.type2 {
|
||||
background: rgb(255, 0, 0);
|
||||
}
|
||||
.type3 {
|
||||
background: rgb(0, 128, 0);
|
||||
}
|
||||
}
|
||||
.block_box {
|
||||
border: 1px solid #9eccfa;
|
||||
border-radius: 6px;
|
||||
@ -557,4 +1149,27 @@ onMounted(() => {
|
||||
font-size: 14px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.image_upload {
|
||||
border-bottom: 1px solid #e3e3d7;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
.title {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
display: block;
|
||||
margin: 10px 0;
|
||||
width: 100%;
|
||||
font-family: cursive;
|
||||
}
|
||||
.information {
|
||||
display: none;
|
||||
}
|
||||
.informationStatus:hover .information {
|
||||
display: block;
|
||||
}
|
||||
::v-deep(.el-calendar) {
|
||||
.el-calendar-day {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -15,9 +15,10 @@
|
||||
<el-col :span="16">
|
||||
<file-upload
|
||||
v-model="ossIdMap[activeMenu]"
|
||||
:limit="1"
|
||||
:limit="20"
|
||||
:file-size="50"
|
||||
:file-type="['pdf']"
|
||||
isDarg
|
||||
@update:model-value="
|
||||
(args) => {
|
||||
handleOssUpdate(args);
|
||||
|
@ -122,16 +122,6 @@ const contractorFormRef = ref<ElFormInstance>();
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
//监听项目改变
|
||||
// watch(
|
||||
// () => currentProject.value,
|
||||
// (newId, oldId) => {
|
||||
// /* ... */
|
||||
// queryParams.value.projectId=newId.id
|
||||
// // getList()
|
||||
|
||||
// }
|
||||
// )
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
@ -145,7 +135,8 @@ const initFormData: ContractorForm = {
|
||||
custodian: undefined,
|
||||
custodianPhone: undefined,
|
||||
fileMap: undefined,
|
||||
remark: undefined
|
||||
remark: undefined,
|
||||
projectId: currentProject.value.id
|
||||
};
|
||||
const data = reactive<PageData<ContractorForm, ContractorQuery>>({
|
||||
form: { ...initFormData },
|
||||
@ -172,7 +163,6 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
/** 查询分包单位列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
|
||||
const res = await listContractor(queryParams.value);
|
||||
contractorList.value = res.rows;
|
||||
total.value = res.total;
|
||||
@ -231,6 +221,7 @@ const handleUpdate = async (row?: ContractorVO) => {
|
||||
const submitForm = () => {
|
||||
contractorFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
form.value.projectId = currentProject.value.id;
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateContractor(form.value).finally(() => (buttonLoading.value = false));
|
||||
@ -272,7 +263,20 @@ const handleContractorFile = (row?: ContractorVO) => {
|
||||
console.log(currentContractorId.value);
|
||||
visible.value = true;
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
console.log('监听项目id', queryParams.value.projectId, form.value.projectId);
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
@ -43,35 +43,100 @@
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="expand" width="50">
|
||||
<template #default="{ row }">
|
||||
<div class="w187.25 ml-12.5">
|
||||
<el-button class="mb" type="primary" size="small" @click="handleOpenSetChild(row.id)" icon="plus">添加子项目</el-button>
|
||||
|
||||
<el-table :data="row.children" border stripe>
|
||||
<el-table-column label="序号" type="index" width="55" align="center" />
|
||||
<el-table-column label="名称" align="center" prop="projectName" width="296" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="199" />
|
||||
<el-table-column fixed="right" align="center" label="操作" class-name="small-padding fixed-width" width="199">
|
||||
<template #default="scope">
|
||||
<el-space>
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
icon="Edit"
|
||||
@click="handleOpenSetChild(row.id, scope.row.id, scope.row.projectName)"
|
||||
v-hasPermi="['project:project:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button link type="danger" icon="Delete" @click="handleChildDel(scope.row.id)" v-hasPermi="['project:project:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</el-space>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
:type="scope.row.designId ? 'primary' : 'default'"
|
||||
:disabled="!scope.row.designId"
|
||||
@click="handleOpenLayer(scope.row)"
|
||||
v-loading.fullscreen.lock="fullscreenLoading"
|
||||
>{{ scope.row.projectName }}</el-link
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目简称" align="center" prop="shortName" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目类型" align="center" prop="type" />
|
||||
<el-table-column label="项目类别" align="center" prop="isType">
|
||||
<el-table-column label="项目类型" align="center" prop="projectType" width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="project_category_type" :value="scope.row.isType" />
|
||||
<dict-tag :options="project_type" :value="scope.row.projectType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目类别" align="center" prop="projectCategory">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="project_category_type" :value="scope.row.projectCategory" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目地址" align="center" prop="projectSite" />
|
||||
<el-table-column label="负责人" align="center" prop="principal" />
|
||||
<el-table-column label="负责人电话" align="center" prop="principalPhone" />
|
||||
<el-table-column label="实际容量" align="center" prop="actual" />
|
||||
<el-table-column label="计划容量" align="center" prop="plan" />
|
||||
<el-table-column label="负责人电话" align="center" prop="principalPhone" width="120" />
|
||||
<el-table-column label="实际容量(M)" align="center" prop="actual" width="100" />
|
||||
<el-table-column label="计划容量(M)" align="center" prop="plan" width="100" />
|
||||
<el-table-column label="开工时间" align="center" prop="onStreamTime" width="120" />
|
||||
<el-table-column label="打卡范围" align="center" prop="punchRange" />
|
||||
<el-table-column label="设计总量" align="center" prop="designTotal" />
|
||||
<!-- <el-table-column label="是否上传DXF" align="center" prop="designId" width="140">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
:type="scope.row.designId ? 'primary' : 'default'"
|
||||
:disabled="!scope.row.designId"
|
||||
@click="handleOpenLayer(scope.row)"
|
||||
v-loading.fullscreen.lock="fullscreenLoading"
|
||||
>{{ scope.row.designId ? '已上传' : '未上传' }}</el-link
|
||||
>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180" />
|
||||
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="260">
|
||||
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="400">
|
||||
<template #default="scope">
|
||||
<el-space>
|
||||
<el-button link type="primary" icon="FolderOpened" @click="handleShowUpload(scope.row)">导入安全协议书 </el-button>
|
||||
<file-upload
|
||||
:limit="1"
|
||||
:fileSize="200"
|
||||
:fileType="['dxf']"
|
||||
v-model:model-value="dxfFile"
|
||||
uploadUrl="/project/projectFile/upload/dxf"
|
||||
:data="{ projectId: scope.row.id }"
|
||||
>
|
||||
<el-button link type="primary" icon="upload">上传DXF </el-button>
|
||||
</file-upload>
|
||||
|
||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['project:project:edit']">修改 </el-button>
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['project:project:remove']">删除 </el-button>
|
||||
</el-space>
|
||||
@ -82,44 +147,136 @@
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改项目对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="770px" append-to-body>
|
||||
<el-form ref="projectFormRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input v-model="form.projectName" placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目简称" prop="shortName">
|
||||
<el-input v-model="form.shortName" placeholder="请输入项目简称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目地址" prop="projectSite">
|
||||
<el-input v-model="form.projectSite" placeholder="请输入项目地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人" prop="principal">
|
||||
<el-input v-model="form.principal" placeholder="请输入负责人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人电话" prop="principalPhone">
|
||||
<el-input v-model="form.principalPhone" placeholder="请输入负责人电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="实际容量" prop="actual">
|
||||
<el-input v-model="form.actual" placeholder="请输入实际容量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划容量" prop="plan">
|
||||
<el-input v-model="form.plan" placeholder="请输入计划容量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开工时间" prop="onStreamTime">
|
||||
<el-date-picker clearable v-model="form.onStreamTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择开工时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="打卡范围" prop="punchRange">
|
||||
<el-input v-model="form.punchRange" placeholder="请输入打卡范围" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设计总量" prop="designTotal">
|
||||
<el-input v-model="form.designTotal" placeholder="请输入设计总量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="安全协议书" prop="securityAgreement">
|
||||
<file-upload v-model="form.securityAgreement" :limit="1" :file-type="['pdf']" :file-size="50" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<div class="block-box">
|
||||
<div class="">基础信息</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input v-model="form.projectName" placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="项目简称" prop="shortName">
|
||||
<el-input v-model="form.shortName" placeholder="请输入项目简称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="负责人" prop="principal">
|
||||
<el-input v-model="form.principal" placeholder="请输入负责人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="负责人电话" prop="principalPhone">
|
||||
<el-input v-model="form.principalPhone" placeholder="请输入负责人电话" type="number" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="项目类型" prop="projectType" label-width="100px">
|
||||
<el-select v-model="form.projectType" placeholder="请选择项目类型" clearable>
|
||||
<el-option v-for="dict in project_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="项目类别" prop="projectCategory" label-width="100px">
|
||||
<el-select v-model="form.projectCategory" placeholder="请选择项目类别" clearable>
|
||||
<el-option v-for="dict in project_category_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="开工时间" prop="onStreamTime">
|
||||
<el-date-picker clearable v-model="form.onStreamTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择开工时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :push="3">
|
||||
<el-button type="primary" size="default" @click="amapStatus = true">获取经纬度</el-button>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="经度" prop="lng">
|
||||
<el-input v-model="form.lng" disabled placeholder="请输入经度" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="纬度" prop="lat">
|
||||
<el-input v-model="form.lat" disabled placeholder="请输入纬度" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="项目地址" prop="projectSite">
|
||||
<el-input v-model="form.projectSite" disabled placeholder="请输入项目地址" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="计划容量(M)" prop="plan">
|
||||
<el-input v-model="form.plan" placeholder="请输入计划容量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="实际容量(M)" prop="actual">
|
||||
<el-input v-model="form.actual" placeholder="请输入实际容量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="设计总量(M)" prop="designTotal">
|
||||
<el-input v-model="form.designTotal" placeholder="请输入设计总量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="项目排序" prop="remark">
|
||||
<el-input-number v-model="form.sort" :min="0" :max="10000" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="block-box">
|
||||
<div class="">打卡设置</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="打卡开始时间" prop="playCardStart" label-width="110px">
|
||||
<!-- <el-time-picker value-format="HH:mm" v-model="form.playCardStart" placeholder="请输入打卡开始时间" /> -->
|
||||
<el-time-select
|
||||
v-model="form.playCardStart"
|
||||
style="width: 100%"
|
||||
class="mr-4"
|
||||
placeholder="请输入打卡开始时间"
|
||||
value-format="HH:mm"
|
||||
start="00:00"
|
||||
step="00:15"
|
||||
end="23:59"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="打卡结束时间" prop="playCardEnd" label-width="110px">
|
||||
<!-- <el-time-picker value-format="HH:mm" v-model="form.playCardEnd" placeholder="请输入打卡结束时间" /> -->
|
||||
<el-time-select
|
||||
v-model="form.playCardEnd"
|
||||
style="width: 100%"
|
||||
:min-time="form.playCardStart"
|
||||
class="mr-4"
|
||||
placeholder="请输入打卡结束时间"
|
||||
value-format="HH:mm"
|
||||
start="00:00"
|
||||
step="00:15"
|
||||
end="23:59"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="安全协议书" prop="securityAgreement">
|
||||
<file-upload v-model="form.securityAgreement" :limit="1" :file-type="['pdf']" :file-size="50" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
@ -137,16 +294,52 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- //选取项目地址弹窗 -->
|
||||
<el-dialog v-model="amapStatus" :title="form.projectName + '-获取经纬度'" width="80%">
|
||||
<amap height="620px" @setLocation="setPoi"></amap>
|
||||
</el-dialog>
|
||||
<!-- 选取方阵地址 -->
|
||||
<el-dialog title="设置方阵" v-model="polygonStatus" width="1400px" :close-on-click-modal="false">
|
||||
<open-layers-map
|
||||
:project-id="projectId"
|
||||
:design-id="designId"
|
||||
@handleCheckChange="setCheckedNodes"
|
||||
@close="polygonStatus = false"
|
||||
></open-layers-map>
|
||||
</el-dialog>
|
||||
<el-dialog title="添加子项目" v-model="childProjectStatus" width="400">
|
||||
<span>填写子项目名称</span>
|
||||
<el-input v-model="childProjectForm.projectName"></el-input>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="childProjectStatus = false">取消</el-button>
|
||||
<el-button type="primary" @click="handleSetChild">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Project" lang="ts">
|
||||
import { addProject, delProject, getProject, listProject, updateProject } from '@/api/project/project';
|
||||
import { ProjectForm, ProjectQuery, ProjectVO } from '@/api/project/project/types';
|
||||
|
||||
import {
|
||||
addChildProject,
|
||||
addProject,
|
||||
addProjectFacilities,
|
||||
addProjectPilePoint,
|
||||
addProjectSquare,
|
||||
delProject,
|
||||
getChildProject,
|
||||
getProject,
|
||||
listProject,
|
||||
updateProject
|
||||
} from '@/api/project/project';
|
||||
import { ProjectForm, ProjectQuery, ProjectVO, childProjectQuery, locationType } from '@/api/project/project/types';
|
||||
import amap from '@/components/amap/index.vue';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { sys_normal_disable, project_category_type } = toRefs<any>(proxy?.useDict('sys_normal_disable', 'project_category_type'));
|
||||
|
||||
const { sys_normal_disable, project_category_type, project_type } = toRefs<any>(
|
||||
proxy?.useDict('sys_normal_disable', 'project_category_type', 'project_type')
|
||||
);
|
||||
const projectList = ref<ProjectVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
@ -155,13 +348,27 @@ const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const childProjectStatus = ref(false);
|
||||
const amapStatus = ref(false);
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const projectFormRef = ref<ElFormInstance>();
|
||||
const polygonStatus = ref(false);
|
||||
const dxfFile = ref(null);
|
||||
const projectId = ref<string>('');
|
||||
const designId = ref<string>('');
|
||||
const childProjectForm = reactive<childProjectQuery>({
|
||||
projectName: '',
|
||||
pid: '',
|
||||
id: ''
|
||||
});
|
||||
//被选中的节点
|
||||
const nodes = ref<any>([]);
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
const jsonData = ref(null);
|
||||
const fullscreenLoading = ref(false);
|
||||
|
||||
const initFormData: ProjectForm = {
|
||||
id: undefined,
|
||||
@ -171,19 +378,22 @@ const initFormData: ProjectForm = {
|
||||
status: undefined,
|
||||
picUrl: undefined,
|
||||
remark: undefined,
|
||||
type: undefined,
|
||||
isType: undefined,
|
||||
projectType: undefined,
|
||||
projectCategory: undefined,
|
||||
deletedAt: undefined,
|
||||
projectSite: undefined,
|
||||
principal: undefined,
|
||||
principalPhone: undefined,
|
||||
actual: undefined,
|
||||
lng: undefined,
|
||||
lat: undefined,
|
||||
plan: undefined,
|
||||
onStreamTime: undefined,
|
||||
punchRange: undefined,
|
||||
playCardStart: undefined,
|
||||
playCardEnd: undefined,
|
||||
designTotal: undefined,
|
||||
securityAgreement: undefined,
|
||||
sort: undefined,
|
||||
sort: 0,
|
||||
showHidden: undefined,
|
||||
isDelete: undefined
|
||||
};
|
||||
@ -197,16 +407,19 @@ const data = reactive<PageData<ProjectForm, ProjectQuery>>({
|
||||
pId: undefined,
|
||||
status: undefined,
|
||||
picUrl: undefined,
|
||||
type: undefined,
|
||||
isType: undefined,
|
||||
projectType: undefined,
|
||||
projectCategory: undefined,
|
||||
deletedAt: undefined,
|
||||
projectSite: undefined,
|
||||
principal: undefined,
|
||||
principalPhone: undefined,
|
||||
actual: undefined,
|
||||
lng: undefined,
|
||||
lat: undefined,
|
||||
plan: undefined,
|
||||
onStreamTime: undefined,
|
||||
punchRange: undefined,
|
||||
playCardStart: undefined,
|
||||
playCardEnd: undefined,
|
||||
designTotal: undefined,
|
||||
securityAgreement: undefined,
|
||||
sort: undefined,
|
||||
@ -215,10 +428,19 @@ const data = reactive<PageData<ProjectForm, ProjectQuery>>({
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
punchRange: [{ required: true, message: '打卡范围不能为空', trigger: 'blur' }],
|
||||
playCardStart: [{ required: true, message: '打卡开始时间不能为空', trigger: 'blur' }],
|
||||
playCardEnd: [{ required: true, message: '打卡结束时间不能为空', trigger: 'blur' }],
|
||||
projectName: [{ required: true, message: '项目名称不能为空', trigger: 'blur' }],
|
||||
shortName: [{ required: true, message: '项目简称不能为空', trigger: 'blur' }],
|
||||
projectSite: [{ required: true, message: '项目地址不能为空', trigger: 'blur' }]
|
||||
principalPhone: [{ required: true, message: '负责人电话不能为空', trigger: 'blur' }],
|
||||
principal: [{ required: true, message: '负责人不能为空', trigger: 'blur' }],
|
||||
projectType: [{ required: true, message: '项目类型不能为空', trigger: 'blur' }],
|
||||
projectCategory: [{ required: true, message: '项目类别不能为空', trigger: 'blur' }],
|
||||
projectSite: [{ required: true, message: '项目地址不能为空', trigger: 'blur' }],
|
||||
actual: [{ required: true, message: '实际容量不能为空', trigger: 'blur' }],
|
||||
lng: [{ required: true, message: '经度不能为空', trigger: 'blur' }],
|
||||
lat: [{ required: true, message: '纬度不能为空', trigger: 'blur' }],
|
||||
plan: [{ required: true, message: '计划容量不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
@ -243,6 +465,63 @@ const reset = () => {
|
||||
projectFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
// 设置位置信息
|
||||
const setPoi = (location: locationType) => {
|
||||
if (location) {
|
||||
console.log('🚀 ~ setPoi ~ poi:', location);
|
||||
form.value.lng = location.lng;
|
||||
form.value.lat = location.lat;
|
||||
form.value.projectSite = location.projectSite;
|
||||
}
|
||||
|
||||
amapStatus.value = false;
|
||||
};
|
||||
//设置需要上传的节点
|
||||
const setCheckedNodes = (nodeList: any) => {
|
||||
nodes.value = nodeList;
|
||||
};
|
||||
//上传节点
|
||||
// const addFacilities = async () => {
|
||||
// if (!layerType.value) {
|
||||
// return proxy?.$modal.msgError('请选择图层类型');
|
||||
// }
|
||||
// if (!nodes.value.length) {
|
||||
// return proxy?.$modal.msgError('请选择需要上传的图层');
|
||||
// }
|
||||
// const data = {
|
||||
// projectId: projectId.value,
|
||||
// nameGeoJson: null,
|
||||
// locationGeoJson: null,
|
||||
// pointGeoJson: null
|
||||
// };
|
||||
// loading.value = true;
|
||||
// if (layerType.value == 1) {
|
||||
// if (nodes.value[0].option == '名称') {
|
||||
// data.nameGeoJson = jsonData.value[nodes.value[0].location.index];
|
||||
// data.locationGeoJson = jsonData.value[nodes.value[1].location.index];
|
||||
// } else {
|
||||
// data.nameGeoJson = jsonData.value[nodes.value[1].location.index];
|
||||
// data.locationGeoJson = jsonData.value[nodes.value[0].location.index];
|
||||
// }
|
||||
// await addProjectFacilities(data);
|
||||
// await proxy?.$modal.msgSuccess('添加成功');
|
||||
// } else if (layerType.value == 2) {
|
||||
// data.pointGeoJson = jsonData.value[nodes.value[0].location.index];
|
||||
// await addProjectPilePoint(data);
|
||||
// await proxy?.$modal.msgSuccess('添加成功');
|
||||
// } else if (layerType.value == 3) {
|
||||
// if (nodes.value[0].option == '名称') {
|
||||
// data.nameGeoJson = jsonData.value[nodes.value[0].location.index];
|
||||
// data.locationGeoJson = jsonData.value[nodes.value[1].location.index];
|
||||
// } else {
|
||||
// data.nameGeoJson = jsonData.value[nodes.value[1].location.index];
|
||||
// data.locationGeoJson = jsonData.value[nodes.value[0].location.index];
|
||||
// }
|
||||
// await addProjectSquare(data);
|
||||
// await proxy?.$modal.msgSuccess('添加成功');
|
||||
// }
|
||||
// loading.value = false;
|
||||
// };
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
@ -276,12 +555,12 @@ const handleUpdate = async (row?: ProjectVO) => {
|
||||
const res = await getProject(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改项目';
|
||||
dialog.title = '修改-' + form.value.projectName;
|
||||
};
|
||||
|
||||
/** 上传安全协议书按钮操作 */
|
||||
const uploadVisible = ref<boolean>(false);
|
||||
const fileUploadParam = ref({
|
||||
const fileUploadParam = ref<{ id: string | number; securityAgreement: string }>({
|
||||
id: undefined,
|
||||
securityAgreement: undefined
|
||||
});
|
||||
@ -291,6 +570,12 @@ const handleShowUpload = (row?: ProjectVO) => {
|
||||
uploadVisible.value = true;
|
||||
};
|
||||
|
||||
const handleOpenLayer = async (row: ProjectVO) => {
|
||||
polygonStatus.value = true;
|
||||
projectId.value = row.id;
|
||||
designId.value = row.designId;
|
||||
};
|
||||
|
||||
const updateProjectFile = async () => {
|
||||
buttonLoading.value = true;
|
||||
await updateProject(fileUploadParam.value);
|
||||
@ -326,6 +611,50 @@ const handleDelete = async (row?: ProjectVO) => {
|
||||
await getList();
|
||||
};
|
||||
|
||||
//删除子项目
|
||||
const handleChildDel = async (id) => {
|
||||
await proxy?.$modal.confirm('是否确认删除项目编号为"' + id + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delProject(id);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
//增加/修改子项目
|
||||
const handleOpenSetChild = async (pid, id?, name?) => {
|
||||
childProjectStatus.value = true;
|
||||
childProjectForm.id = id;
|
||||
childProjectForm.pid = pid;
|
||||
childProjectForm.projectName = name;
|
||||
};
|
||||
|
||||
const resetChildQuert = () => {
|
||||
childProjectForm.id = '';
|
||||
childProjectForm.pid = '';
|
||||
childProjectForm.projectName = '';
|
||||
};
|
||||
|
||||
//增加/修改子项目
|
||||
const handleSetChild = async () => {
|
||||
if (!childProjectForm.projectName.trim()) return proxy.$modal.msgError('请填写项目名称');
|
||||
if (childProjectForm.id) {
|
||||
let res = await updateProject({ id: childProjectForm.id, projectName: childProjectForm.projectName });
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('修改成功');
|
||||
childProjectStatus.value = false;
|
||||
resetChildQuert();
|
||||
getList();
|
||||
}
|
||||
} else {
|
||||
let res = await addChildProject(childProjectForm);
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('添加成功');
|
||||
childProjectStatus.value = false;
|
||||
resetChildQuert();
|
||||
getList();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
@ -341,3 +670,17 @@ onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
.block-box {
|
||||
border: 1px solid #9eccfa;
|
||||
border-radius: 6px;
|
||||
padding: 10px 20px 0 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.block-box > div {
|
||||
color: #409eff;
|
||||
font-weight: 700;
|
||||
font-size: 14px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
|
@ -14,7 +14,7 @@
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button size="small" type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['project:projectTeamMember:add']"> 新增 </el-button>
|
||||
</el-col>
|
||||
@ -49,7 +49,7 @@
|
||||
导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
<el-table size="small" v-loading="loading" :data="projectTeamMemberList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
@ -66,8 +66,8 @@
|
||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['project:projectTeamMember:edit']">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['project:projectTeamMember:remove']">
|
||||
删除
|
||||
<el-button link type="danger" icon="Position" @click="handleExit(scope.row)" v-hasPermi="['project:projectTeamMember:remove']">
|
||||
退场
|
||||
</el-button>
|
||||
</el-space>
|
||||
</template>
|
||||
@ -85,7 +85,7 @@
|
||||
<!-- 添加或修改项目班组下的成员对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="projectTeamMemberFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="施工人员" prop="memberId">
|
||||
<el-form-item label="施工人员" prop="memberId" v-if="!form.id">
|
||||
<el-select v-model="form.memberId" clearable placeholder="请选择人员" filterable>
|
||||
<el-option v-for="item in userNotInTeamOpt" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<pagination
|
||||
@ -114,6 +114,27 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 上传退场记录 -->
|
||||
<el-dialog title="员工离场" v-model="memberStatus" width="30%">
|
||||
<el-form :model="memberForm" ref="memberFormRef" :rules="memberRules" label-width="100px" :inline="false">
|
||||
<el-form-item label="用户名">
|
||||
<el-input v-model="memberForm.userName" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="退场文件">
|
||||
<file-upload v-model="memberForm.filePath" :limit="10" :is-show-tip="false" :file-size="50" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="memberForm.remark" placeholder="请输入备注" type="textarea"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button type="primary" @click="submitMemberForm" :loading="buttonLoading">确定</el-button>
|
||||
<el-button @click="memberStatus = false">取消</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -129,8 +150,8 @@ import {
|
||||
} from '@/api/project/projectTeamMember';
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { listConstructionUser } from '@/api/project/constructionUser';
|
||||
import { ConstructionUserQuery, ConstructionUserVO } from '@/api/project/constructionUser/types';
|
||||
import { listConstructionUser, delConstructionUserMember } from '@/api/project/constructionUser';
|
||||
import { ConstructionUserQuery, ConstructionUserVO, ConstructionUserMembeForm } from '@/api/project/constructionUser/types';
|
||||
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
@ -138,10 +159,16 @@ const userStore = useUserStoreHook();
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { user_post_type } = toRefs<any>(proxy?.useDict('user_post_type'));
|
||||
|
||||
const memberStatus = ref(false);
|
||||
interface Props {
|
||||
projectTeamVo: ProjectTeamVO;
|
||||
}
|
||||
const memberForm = reactive<ConstructionUserMembeForm>({
|
||||
id: undefined,
|
||||
filePath: undefined,
|
||||
remark: undefined,
|
||||
userName: undefined
|
||||
});
|
||||
|
||||
const props = defineProps<Props>();
|
||||
// 是否可见
|
||||
@ -160,6 +187,9 @@ const data = reactive<PageData<ProjectTeamMemberForm, ProjectTeamMemberQuery>>({
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }]
|
||||
},
|
||||
memberRules: {
|
||||
filePath: [{ required: true, message: '请上传退场文件', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
const buttonLoading = ref(false);
|
||||
@ -170,12 +200,13 @@ const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const projectTeamMemberFormRef = ref<ElFormInstance>();
|
||||
const memberFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
const { queryParams, form, rules, memberRules } = toRefs(data);
|
||||
const projectTeamMemberList = ref<ProjectTeamMemberVO[]>([]);
|
||||
/** 查询项目班组下的成员列表 */
|
||||
const getList = async () => {
|
||||
@ -277,6 +308,31 @@ const submitForm = () => {
|
||||
});
|
||||
};
|
||||
|
||||
/** 确定退场按钮 */
|
||||
const submitMemberForm = async () => {
|
||||
memberFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
await delConstructionUserMember(memberForm).finally(() => (buttonLoading.value = false));
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
memberForm.filePath = undefined;
|
||||
memberForm.remark = undefined;
|
||||
}
|
||||
});
|
||||
memberStatus.value = false;
|
||||
};
|
||||
|
||||
/** 退场按钮操作 */
|
||||
const handleExit = async (row?: ProjectTeamMemberVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
memberForm.userName = row?.memberName;
|
||||
console.log('🚀 ~ handleDelete ~ row:', row);
|
||||
memberForm.id = row?.id;
|
||||
memberStatus.value = true;
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: ProjectTeamMemberVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
|
@ -43,6 +43,11 @@
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="班组名称" align="center" prop="teamName" />
|
||||
<el-table-column label="班组人数" align="center" prop="peopleNumber">
|
||||
<template #default="scope">
|
||||
<el-link type="primary" :underline="false" @click="handleUserList(scope.row)"> {{ scope.row.peopleNumber }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="打卡范围" align="center" prop="isClockIn">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="team_clock_type" :value="scope.row.isClockIn" />
|
||||
@ -86,7 +91,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog :title="currentRow.teamName" v-model="visible">
|
||||
<el-dialog :title="currentRow.teamName" v-model="visible" width="1000px">
|
||||
<user-list-dialog :projectTeamVo="currentRow" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
@ -134,7 +139,8 @@ const initFormData: ProjectTeamForm = {
|
||||
projectId: currentProject.value.id,
|
||||
teamName: undefined,
|
||||
isClockIn: undefined,
|
||||
remark: undefined
|
||||
remark: undefined,
|
||||
peopleNumber: undefined
|
||||
};
|
||||
const data = reactive<PageData<ProjectTeamForm, ProjectTeamQuery>>({
|
||||
form: { ...initFormData },
|
||||
@ -146,7 +152,8 @@ const data = reactive<PageData<ProjectTeamForm, ProjectTeamQuery>>({
|
||||
projectId: currentProject.value.id,
|
||||
teamName: undefined,
|
||||
isClockIn: undefined,
|
||||
params: {}
|
||||
params: {},
|
||||
peopleNumber: undefined
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }],
|
||||
@ -257,6 +264,19 @@ const handleExport = () => {
|
||||
`projectTeam_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
|
@ -5,20 +5,20 @@
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="工种" prop="workType">
|
||||
<el-select v-model="queryParams.workType" placeholder="请选择工种" clearable>
|
||||
<el-select v-model="queryParams.workType" placeholder="全部" clearable>
|
||||
<el-option v-for="dict in type_of_work" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工资计算方式" prop="wageCalculationType" label-width="100px">
|
||||
<el-select v-model="queryParams.wageCalculationType" placeholder="请选择工资计算方式" clearable>
|
||||
<el-select v-model="queryParams.wageCalculationType" placeholder="全部" clearable>
|
||||
<el-option v-for="dict in wageCalculationTypeList" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工资计量单位" prop="wageMeasureUnit" label-width="100px">
|
||||
<!-- <el-form-item label="工资计量单位" prop="wageMeasureUnit" label-width="100px">
|
||||
<el-select v-model="queryParams.wageMeasureUnit" placeholder="请选择工资计量单位" clearable>
|
||||
<el-option v-for="dict in wage_measure_unit_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
@ -100,7 +100,7 @@
|
||||
<el-input v-model="form.projectId" placeholder="请输入项目id" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="工种" prop="workType">
|
||||
<el-select v-model="form.workType" placeholder="请选择工种">
|
||||
<el-select v-model="form.workType" placeholder="请选择工种" :disabled="!form.id ? false : true">
|
||||
<el-option v-for="dict in type_of_work" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -110,18 +110,18 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工资计算方式" prop="wageCalculationType">
|
||||
<el-select v-model="form.wageCalculationType" placeholder="请选择工资计算方式">
|
||||
<el-select v-model="form.wageCalculationType" placeholder="请选择工资计算方式" :disabled="!form.id ? false : true">
|
||||
<el-option v-for="dict in wageCalculationTypeList" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工资标准" prop="wage">
|
||||
<el-input v-model="form.wage" placeholder="请输入工资标准" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工资计量单位" prop="wageMeasureUnit">
|
||||
<!-- <el-form-item label="工资计量单位" prop="wageMeasureUnit">
|
||||
<el-select v-model="form.wageMeasureUnit" placeholder="请选择工资计量单位">
|
||||
<el-option v-for="dict in wage_measure_unit_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
@ -266,6 +266,7 @@ const submitForm = () => {
|
||||
workWageFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
if (form.value.id) {
|
||||
await updateWorkWage(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -298,6 +299,20 @@ const handleExport = () => {
|
||||
);
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
@ -4,26 +4,13 @@
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="项目id" prop="projectId">
|
||||
<el-input v-model="queryParams.projectId" placeholder="请输入项目id" clearable @keyup.enter="handleQuery" />
|
||||
<el-form-item label="用户姓名" prop="userName">
|
||||
<el-input v-model="queryParams.userName" placeholder="请输入用户姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户id" prop="userId">
|
||||
<el-input v-model="queryParams.userId" placeholder="请输入用户id" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="题库id列表" prop="bankId">
|
||||
<el-input v-model="queryParams.bankId" placeholder="请输入题库id列表" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="答案列表" prop="answer">
|
||||
<el-input v-model="queryParams.answer" placeholder="请输入答案列表" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="得分" prop="score">
|
||||
<el-input v-model="queryParams.score" placeholder="请输入得分" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用时时间" prop="takeTime">
|
||||
<el-input v-model="queryParams.takeTime" placeholder="请输入用时时间" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="及格线/总分" prop="pass">
|
||||
<el-input v-model="queryParams.pass" placeholder="请输入及格线/总分" clearable @keyup.enter="handleQuery" />
|
||||
<el-form-item label="班组" prop="teamId">
|
||||
<el-select v-model="queryParams.teamId" clearable placeholder="全部">
|
||||
<el-option v-for="item in ProjectTeam" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
@ -38,26 +25,25 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['safety:questionUserAnswer:add']">新增 </el-button>
|
||||
<el-tooltip placement="top" effect="dark">
|
||||
<template #content>
|
||||
注:上传压缩包内的文件夹名称需设置为【姓名-身份证-满分-得分-及格分】, <br />
|
||||
例如:小明-5130112333654X-100-59-60
|
||||
</template>
|
||||
<file-upload
|
||||
:limit="1"
|
||||
v-model:model-value="filePath"
|
||||
isImportInfo
|
||||
:fileType="['zip']"
|
||||
uploadUrl="/safety/questionUserAnswer/upload/zip"
|
||||
:file-size="5000"
|
||||
:data="{ projectId: currentProject.id }"
|
||||
><el-button type="success" plain icon="Upload">上传线下安全考试</el-button></file-upload
|
||||
>
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['safety:questionUserAnswer:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['safety:questionUserAnswer:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['safety:questionUserAnswer:export']">导出 </el-button>
|
||||
<el-button type="primary" plain icon="Download" :disabled="single" @click="handleDownload()">批量下载试卷</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@ -65,89 +51,61 @@
|
||||
|
||||
<el-table v-loading="loading" :data="questionUserAnswerList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键id" align="center" prop="id" v-if="true" />
|
||||
<el-table-column label="项目id" align="center" prop="projectId" />
|
||||
<el-table-column label="用户id" align="center" prop="userId" />
|
||||
<el-table-column label="题库id列表" align="center" prop="bankId" />
|
||||
<el-table-column label="答案列表" align="center" prop="answer" />
|
||||
<el-table-column label="得分" align="center" prop="score" />
|
||||
<el-table-column label="用时时间" align="center" prop="takeTime" />
|
||||
<el-table-column label="主键id" align="center" prop="id" v-if="false" />
|
||||
<el-table-column label="姓名" align="center" prop="userName" />
|
||||
<el-table-column label="及格线/总分" align="center" prop="pass" />
|
||||
<el-table-column label="文件地址" align="center" prop="file" />
|
||||
<el-table-column label="得分" align="center" prop="score" />
|
||||
<el-table-column label="计划时间" align="center" prop="examTime" />
|
||||
<el-table-column label="用时时间" align="center" prop="takeTime" />
|
||||
<el-table-column label="考试时间" align="center" prop="createTime" />
|
||||
<el-table-column label="类型" align="center" prop="examType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="user_exam_type" :value="scope.row.examType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:questionUserAnswer:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['safety:questionUserAnswer:remove']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-link type="primary" :underline="false" :href="scope.row.fileUrl[0]" target="_blank">
|
||||
<el-button link type="primary" icon="View">预览试卷</el-button>
|
||||
</el-link>
|
||||
|
||||
<el-button link type="primary" icon="Download" @click="downloadOssOne(scope.row)">下载试卷</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改用户试卷存储对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="questionUserAnswerFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="项目id" prop="projectId">
|
||||
<el-input v-model="form.projectId" placeholder="请输入项目id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户id" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入用户id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="题库id列表" prop="bankId">
|
||||
<el-input v-model="form.bankId" placeholder="请输入题库id列表" />
|
||||
</el-form-item>
|
||||
<el-form-item label="答案列表" prop="answer">
|
||||
<el-input v-model="form.answer" placeholder="请输入答案列表" />
|
||||
</el-form-item>
|
||||
<el-form-item label="得分" prop="score">
|
||||
<el-input v-model="form.score" placeholder="请输入得分" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用时时间" prop="takeTime">
|
||||
<el-input v-model="form.takeTime" placeholder="请输入用时时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="及格线/总分" prop="pass">
|
||||
<el-input v-model="form.pass" placeholder="请输入及格线/总分" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件地址" prop="file">
|
||||
<file-upload v-model="form.file" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="QuestionUserAnswer" lang="ts">
|
||||
import {
|
||||
addQuestionUserAnswer,
|
||||
delQuestionUserAnswer,
|
||||
getQuestionUserAnswer,
|
||||
listQuestionUserAnswer,
|
||||
updateQuestionUserAnswer
|
||||
getQuestionUserAnswer,
|
||||
delQuestionUserAnswer,
|
||||
addQuestionUserAnswer,
|
||||
updateQuestionUserAnswer,
|
||||
uploadQuestionUserAnswer
|
||||
} from '@/api/safety/questionUserAnswer';
|
||||
import { QuestionUserAnswerForm, QuestionUserAnswerQuery, QuestionUserAnswerVO } from '@/api/safety/questionUserAnswer/types';
|
||||
import { QuestionUserAnswerVO, QuestionUserAnswerQuery, QuestionUserAnswerForm } from '@/api/safety/questionUserAnswer/types';
|
||||
import { downLoadOss } from '@/api/system/oss';
|
||||
import download from '@/plugins/download';
|
||||
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { blobValidate } from '@/utils/ruoyi';
|
||||
import FileSaver from 'file-saver';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { user_exam_type } = toRefs<any>(proxy?.useDict('user_exam_type'));
|
||||
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const ProjectTeam = computed(() => userStore.ProjectTeamList);
|
||||
|
||||
const questionUserAnswerList = ref<QuestionUserAnswerVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
@ -156,7 +114,7 @@ const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const filePath = ref<string>('');
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const questionUserAnswerFormRef = ref<ElFormInstance>();
|
||||
|
||||
@ -169,30 +127,32 @@ const initFormData: QuestionUserAnswerForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
userId: undefined,
|
||||
bankIdList: undefined,
|
||||
bankId: undefined,
|
||||
answer: undefined,
|
||||
userName: undefined,
|
||||
score: undefined,
|
||||
examTime: undefined,
|
||||
takeTime: undefined,
|
||||
pass: undefined,
|
||||
file: undefined
|
||||
file: undefined,
|
||||
teamId: undefined
|
||||
};
|
||||
const data = reactive<PageData<QuestionUserAnswerForm, QuestionUserAnswerQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
userId: undefined,
|
||||
bankIdList: undefined,
|
||||
answer: undefined,
|
||||
score: undefined,
|
||||
takeTime: undefined,
|
||||
pass: undefined,
|
||||
file: undefined,
|
||||
examType: undefined,
|
||||
teamId: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
userName: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }]
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }],
|
||||
projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }],
|
||||
userId: [{ required: true, message: '用户id不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
@ -234,63 +194,52 @@ const resetQuery = () => {
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: QuestionUserAnswerVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
single.value = selection.length == 0;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加用户试卷存储';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: QuestionUserAnswerVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getQuestionUserAnswer(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改用户试卷存储';
|
||||
// const handleUpdate = async (row?: QuestionUserAnswerVO) => {
|
||||
// reset();
|
||||
// const _id = row?.id || ids.value[0];
|
||||
// const res = await getQuestionUserAnswer(_id);
|
||||
// Object.assign(form.value, res.data);
|
||||
// dialog.visible = true;
|
||||
// dialog.title = '修改用户试卷存储';
|
||||
// };
|
||||
|
||||
/** 批量下载按钮操作 */
|
||||
const handleDownload = async () => {
|
||||
const _ids = ids.value;
|
||||
await downLoadOss({ idList: _ids }, '/safety/questionUserAnswer/exportFile', '安全考试.zip');
|
||||
};
|
||||
/** 下载单个按钮操作 */
|
||||
const downloadOssOne = async (row?: QuestionUserAnswerVO) => {
|
||||
await download.oss(row?.file);
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
questionUserAnswerFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateQuestionUserAnswer(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addQuestionUserAnswer(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
// const fileWatch = watch(
|
||||
// () => filePath.value,
|
||||
// (nid, oid) => {
|
||||
// uploadQuestionUserAnswer({ file: filePath.value, projectId: currentProject.value.id }).then((res) => {
|
||||
// console.log(res);
|
||||
// });
|
||||
// }
|
||||
// );
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: QuestionUserAnswerVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除用户试卷存储编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delQuestionUserAnswer(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'safety/questionUserAnswer/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`questionUserAnswer_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
|
@ -1,84 +1,120 @@
|
||||
<template>
|
||||
<el-card v-loading="loading">
|
||||
<h2 style="text-align: center; margin-top: 5px; font-weight: bold">安全生产监督检查通知书</h2>
|
||||
<el-row>
|
||||
<el-col :span="12" style="text-align: left">填报人:{{ safetyInspectionDetail?.creatorName }}</el-col>
|
||||
<el-col :span="12" style="text-align: right">填报时间:{{ safetyInspectionDetail?.createTime }}</el-col>
|
||||
</el-row>
|
||||
<el-descriptions :column="2" border style="margin-top: 8px" label-width="160px">
|
||||
<el-descriptions-item label-align="center" label="检查项目" :span="2">{{ currentProject?.name }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查类型">
|
||||
<dict-tag :options="safety_inspection_check_type" :value="safetyInspectionDetail?.checkType" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="违章类型">
|
||||
<dict-tag :options="safety_inspection_violation_type" :value="safetyInspectionDetail?.violationType" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查时间">{{ safetyInspectionDetail?.checkTime }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查人">{{ safetyInspectionDetail?.creatorName }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改人">{{ safetyInspectionDetail?.correctorName }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="要求整改期限">
|
||||
{{ dayjs(safetyInspectionDetail?.rectificationDeadline).format('YYYY 年 MM 月 DD 日') }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div class="table-title">巡检结果</div>
|
||||
<el-descriptions :column="2" border label-width="160px">
|
||||
<el-descriptions-item label-align="center" label="内容" :span="2">{{ safetyInspectionDetail?.hiddenDanger }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查附件" :span="2">
|
||||
<el-space wrap>
|
||||
<div v-for="item in checkFileList" :key="item.ossId">
|
||||
<span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileSuffix)">
|
||||
<image-preview :src="item.url" width="200px" />
|
||||
</span>
|
||||
<span v-else>
|
||||
<el-link :href="`${item.url}`" :underline="false" target="_blank">
|
||||
<span> {{ item.originalName }} </span>
|
||||
</el-link>
|
||||
</span>
|
||||
</div>
|
||||
</el-space>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查状态" :span="2">
|
||||
<el-steps style="max-width: 200px" :active="Number(safetyInspectionDetail?.status)" finish-status="success">
|
||||
<el-step v-for="item in safety_inspection_type" :key="item.value" :title="item.label" />
|
||||
</el-steps>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div class="table-title">整改情况</div>
|
||||
<el-descriptions :column="2" border label-width="160px">
|
||||
<el-descriptions-item label-align="center" label="班组">{{ safetyInspectionDetail?.teamName }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改日期">{{ safetyInspectionDetail?.rectificationTime }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改措施及完成情况" :span="2">
|
||||
{{ safetyInspectionDetail?.measure }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改附件" :span="2">
|
||||
<el-space wrap>
|
||||
<div v-for="item in rectificationFileList" :key="item.ossId">
|
||||
<span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileSuffix)">
|
||||
<image-preview :src="item.url" width="200px" />
|
||||
</span>
|
||||
<span v-else>
|
||||
<el-link :href="`${item.url}`" :underline="false" target="_blank">
|
||||
<span> {{ item.originalName }} </span>
|
||||
</el-link>
|
||||
</span>
|
||||
</div>
|
||||
</el-space>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div class="table-title">复查结果</div>
|
||||
<el-descriptions :column="2" border label-width="160px">
|
||||
<el-descriptions-item label-align="center" label="复查人">{{ safetyInspectionDetail?.creatorName }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="复查日期">{{ safetyInspectionDetail?.reviewTime }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="复查情况" :span="2">{{ safetyInspectionDetail?.review }} </el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<!-- <el-card v-loading="loading" body-class="printMe"> -->
|
||||
<div class="w75% m-a">
|
||||
<div id="printMe" class="pos-relative">
|
||||
<div class="resultIcon"><img :src="'../../../../../src/assets/icons/svg/' + inspectionType + '.png'" alt="" /></div>
|
||||
<h2 style="text-align: center; margin-top: 5px; font-weight: bold">安全生产监督检查通知书</h2>
|
||||
<el-row>
|
||||
<el-col :span="12" style="text-align: left">填报人:{{ safetyInspectionDetail?.creatorName }}</el-col>
|
||||
<el-col :span="12" style="text-align: right">填报时间:{{ safetyInspectionDetail?.createTime }}</el-col>
|
||||
</el-row>
|
||||
<el-descriptions :column="2" border style="margin-top: 8px" label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="检查项目" :span="2" class-name="zebra">{{ currentProject?.name }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查类型" label-class-name="white">
|
||||
<dict-tag :options="safety_inspection_check_type" :value="safetyInspectionDetail?.checkType" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="违章类型" label-class-name="white">
|
||||
<dict-tag :options="safety_inspection_violation_type" :value="safetyInspectionDetail?.violationType" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查时间" class-name="zebra">{{ safetyInspectionDetail?.checkTime }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查人" class-name="zebra">{{ safetyInspectionDetail?.creatorName }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改人" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.correctorName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="要求整改期限" label-class-name="white">
|
||||
{{ dayjs(safetyInspectionDetail?.rectificationDeadline).format('YYYY 年 MM 月 DD 日') }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions border direction="vertical" size="large">
|
||||
<el-descriptions-item label-align="center" label="巡检结果" class-name="none"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="内容" :span="2" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.hiddenDanger }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查附件" :span="2" label-class-name="white">
|
||||
<el-space wrap>
|
||||
<div v-for="item in checkFileList" :key="item.ossId">
|
||||
<span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileSuffix)">
|
||||
<image-preview :src="item.url" width="200px" />
|
||||
</span>
|
||||
<span v-else>
|
||||
<el-link :href="`${item.url}`" type="primary" :underline="false" target="_blank">
|
||||
<span> {{ item.originalName }} </span>
|
||||
</el-link>
|
||||
</span>
|
||||
</div>
|
||||
</el-space>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查状态" :span="2" label-class-name="white">
|
||||
<el-steps style="max-width: 200px" :active="Number(safetyInspectionDetail?.status)" finish-status="finish">
|
||||
<el-step v-for="item in safety_inspection_type" :key="item.value" :title="item.label" />
|
||||
</el-steps>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions border direction="vertical" size="large">
|
||||
<el-descriptions-item label-align="center" label="整改情况" class-name="none"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="班组" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.teamName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改日期" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.rectificationTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改措施及完成情况" :span="2" label-class-name="white">
|
||||
{{ safetyInspectionDetail?.measure }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改附件" :span="2" label-class-name="white">
|
||||
<el-space wrap>
|
||||
<div v-for="item in rectificationFileList" :key="item.ossId">
|
||||
<span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileSuffix)">
|
||||
<image-preview :src="item.url" width="200px" />
|
||||
</span>
|
||||
<span v-else>
|
||||
<el-link :href="`${item.url}`" :underline="false" target="_blank">
|
||||
<span> {{ item.originalName }} </span>
|
||||
</el-link>
|
||||
</span>
|
||||
</div>
|
||||
</el-space>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions border direction="vertical" size="large">
|
||||
<el-descriptions-item label-align="center" label="复查结果" class-name="none"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="复查人" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.creatorName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="复查日期" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.reviewTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="复查情况" :span="2" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.review }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- </el-card> -->
|
||||
<div class="dialog-footer">
|
||||
<div class="btn-item" @click="handleExport">
|
||||
<img src="../../../../assets/icons/svg/derived.png" />
|
||||
<span>导出</span>
|
||||
</div>
|
||||
<div class="btn-item" v-print="'#printMe'">
|
||||
<img src="../../../../assets/icons/svg/print.png" />
|
||||
<span>打印</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { SafetyInspectionVO } from '@/api/safety/safetyInspection/types';
|
||||
import { getSafetyInspection } from '@/api/safety/safetyInspection';
|
||||
import { listByIds } from '@/api/system/oss';
|
||||
import { downLoadOss, listByIds } from '@/api/system/oss';
|
||||
import { OssVO } from '@/api/system/oss/types';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
@ -99,6 +135,17 @@ const loading = ref<boolean>(false);
|
||||
const safetyInspectionDetail = ref<SafetyInspectionVO>();
|
||||
const checkFileList = ref<OssVO[]>();
|
||||
const rectificationFileList = ref<OssVO[]>();
|
||||
//检查状态图片
|
||||
const inspectionType = computed(() => {
|
||||
let imgName = 'successLogo';
|
||||
if (safetyInspectionDetail.value?.status == '2') imgName = 'rectification';
|
||||
if (safetyInspectionDetail.value?.reviewType == '1') imgName = 'successful';
|
||||
if (safetyInspectionDetail.value?.reviewType == '2') imgName = 'failure';
|
||||
console.log('🚀 ~ inspectionType ~ imgName:', imgName);
|
||||
|
||||
return imgName;
|
||||
});
|
||||
|
||||
const get = async () => {
|
||||
loading.value = true;
|
||||
const res = await getSafetyInspection(props.safetyInspectionId);
|
||||
@ -116,7 +163,12 @@ const get = async () => {
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
const handleExport = async () => {
|
||||
await downLoadOss({ id: safetyInspectionDetail.value.id }, '/safety/safetyInspection/export/word', '安全生产监督检查通知书.zip');
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
console.log('🚀 ~ onMounted ~ props.safetyInspectionId:', props.safetyInspectionId);
|
||||
get();
|
||||
});
|
||||
|
||||
@ -132,14 +184,60 @@ watch(
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.table-title {
|
||||
<style scoped lang="scss">
|
||||
#printMe {
|
||||
padding: 15px 20px 20px 20px !important;
|
||||
box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
:deep(.white) {
|
||||
background: #fff !important;
|
||||
}
|
||||
|
||||
:deep(.none) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
:deep(.zebra) {
|
||||
background: #f5f7fa;
|
||||
}
|
||||
|
||||
@page {
|
||||
size: auto;
|
||||
margin: 0mm;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
height: 200px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-end;
|
||||
height: 35px;
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
padding-bottom: 4px;
|
||||
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
position: absolute;
|
||||
top: 14%;
|
||||
right: 6%;
|
||||
background: #fff;
|
||||
box-shadow: 0 0 10px #ddd;
|
||||
text-align: center;
|
||||
padding: 20px 10px;
|
||||
|
||||
.btn-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.resultIcon {
|
||||
position: absolute;
|
||||
top: 100px;
|
||||
right: 50px;
|
||||
z-index: 10;
|
||||
width: 105px;
|
||||
height: 105px;
|
||||
img {
|
||||
width: 105px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -5,17 +5,17 @@
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="检查类型" prop="checkType">
|
||||
<el-select v-model="queryParams.checkType" placeholder="请选择检查类型" clearable>
|
||||
<el-select v-model="queryParams.checkType" placeholder="全部" clearable>
|
||||
<el-option v-for="dict in safety_inspection_check_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="违章类型" prop="violationType">
|
||||
<el-select v-model="queryParams.violationType" placeholder="请选择违章类型" clearable>
|
||||
<el-select v-model="queryParams.violationType" placeholder="全部" clearable>
|
||||
<el-option v-for="dict in safety_inspection_violation_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="处理状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择工单状态" clearable>
|
||||
<el-select v-model="queryParams.status" placeholder="全部" clearable>
|
||||
<el-option v-for="dict in safety_inspection_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -36,7 +36,7 @@
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['safety:safetyInspection:remove']">
|
||||
批量删除
|
||||
删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -54,10 +54,10 @@
|
||||
<dict-tag :options="safety_inspection_type" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查人" align="center" prop="creator.name" />
|
||||
<el-table-column label="检查时间" align="center" prop="checkTime" width="180">
|
||||
<el-table-column label="检查人" align="center" prop="correctorName" />
|
||||
<el-table-column label="检查时间" align="center" prop="rectificationDeadline" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d}') }}</span>
|
||||
<span>{{ parseTime(scope.row.rectificationDeadline, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查类型" align="center" prop="checkType">
|
||||
@ -70,7 +70,18 @@
|
||||
<dict-tag :options="safety_inspection_violation_type" :value="scope.row.violationType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="巡检结果" align="center" prop="inspectionResult" />
|
||||
<el-table-column label="巡检结果" align="center" prop="inspectionResult">
|
||||
<template #default="scope">
|
||||
<el-tooltip placement="top" effect="dark">
|
||||
<template #content>
|
||||
<div class="max-w-670px">{{ scope.row.inspectionResult }}</div>
|
||||
</template>
|
||||
<el-text truncated>
|
||||
{{ scope.row.inspectionResult }}
|
||||
</el-text>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="整改人" align="center" prop="correctorName" />
|
||||
<el-table-column label="复查状态" align="center" prop="reviewType">
|
||||
<template #default="scope">
|
||||
@ -84,11 +95,9 @@
|
||||
<el-button link type="primary" icon="View" @click="handleShowDialog(scope.row)" v-hasPermi="['safety:safetyInspection:query']">
|
||||
详情
|
||||
</el-button>
|
||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:safetyInspection:edit']">
|
||||
修改
|
||||
</el-button>
|
||||
<!-- <el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:safetyInspection:edit']">修改 </el-button> -->
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['safety:safetyInspection:remove']">
|
||||
修改
|
||||
删除
|
||||
</el-button>
|
||||
</el-space>
|
||||
</template>
|
||||
@ -119,7 +128,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="整改人" prop="correctorId">
|
||||
<el-select v-model="form.correctorId" placeholder="请选择整改人" disabled>
|
||||
<el-select v-model="form.correctorId" placeholder="请选择整改人" :disabled="!form.teamId">
|
||||
<el-option v-for="item in foremanOpt" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -149,7 +158,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="巡检工单详情" v-model="showDetailDialog">
|
||||
<el-dialog title="巡检工单详情" v-model="showDetailDialog" width="60vw">
|
||||
<safety-inspection-detail-dialog :safety-inspection-id="currentSafetyInspectionId" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
@ -167,11 +176,11 @@ import { SafetyInspectionForm, SafetyInspectionQuery, SafetyInspectionVO } from
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import SafetyInspectionDetailDialog from '@/views/safety/safetyInspection/component/SafetyInspectionDetailDialog.vue';
|
||||
import { listProjectTeamForeman } from '@/api/project/projectTeam';
|
||||
import { ProjectTeamForemanResp } from '@/api/project/projectTeam/types';
|
||||
import { foremanQuery, ProjectTeamForemanResp } from '@/api/project/projectTeam/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { safety_inspection_violation_type, review_type, reply_type, safety_inspection_type, safety_inspection_check_type } = toRefs<any>(
|
||||
proxy?.useDict('safety_inspection_violation_type', 'review_type', 'reply_type', 'safety_inspection_type', 'safety_inspection_check_type')
|
||||
const { safety_inspection_violation_type, review_type, safety_inspection_type, safety_inspection_check_type } = toRefs<any>(
|
||||
proxy?.useDict('safety_inspection_violation_type', 'review_type', 'safety_inspection_type', 'safety_inspection_check_type')
|
||||
);
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
@ -254,8 +263,8 @@ const data = reactive<PageData<SafetyInspectionForm, SafetyInspectionQuery>>({
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
const teamOpt = ref();
|
||||
const foremanOpt = ref();
|
||||
const teamOpt = ref([]);
|
||||
const foremanOpt = ref([]);
|
||||
const teamList = ref<ProjectTeamForemanResp[]>();
|
||||
/** 查询安全巡检工单列表 */
|
||||
const getList = async () => {
|
||||
@ -270,16 +279,17 @@ const getList = async () => {
|
||||
label: team.teamName,
|
||||
value: team.id
|
||||
}));
|
||||
foremanOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({
|
||||
label: team.foremanName,
|
||||
value: team.foremanId
|
||||
}));
|
||||
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
const changeForeman = (value: string | number) => {
|
||||
const team = teamList.value.find((team) => team.id === value);
|
||||
form.value.correctorId = team.foremanId;
|
||||
const team = teamList.value.filter((team) => team.id === value)[0];
|
||||
foremanOpt.value = team.foremanList?.map((foreman: foremanQuery) => ({
|
||||
label: foreman.foremanName,
|
||||
value: foreman.foremanId
|
||||
}));
|
||||
form.value.correctorId = '';
|
||||
};
|
||||
|
||||
/** 展开安全巡检工单详情对话框操作 */
|
||||
@ -287,6 +297,7 @@ const currentSafetyInspectionId = ref<string | number>();
|
||||
const showDetailDialog = ref<boolean>(false);
|
||||
const handleShowDialog = (row?: SafetyInspectionVO) => {
|
||||
currentSafetyInspectionId.value = row.id;
|
||||
|
||||
showDetailDialog.value = true;
|
||||
};
|
||||
|
||||
@ -343,6 +354,7 @@ const submitForm = () => {
|
||||
safetyInspectionFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
if (form.value.id) {
|
||||
await updateSafetyInspection(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -375,6 +387,20 @@ const handleExport = () => {
|
||||
);
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
@ -42,7 +42,7 @@
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="附件" :span="3">
|
||||
<el-space direction="vertical">
|
||||
<el-link v-for="item in fileList" :key="item.ossId" :href="`${item.url}`" :underline="false" target="_blank">
|
||||
<el-link v-for="item in fileList" :key="item.ossId" :href="`${item.url}`" type="primary" :underline="false" target="_blank">
|
||||
<span> {{ item.originalName }} </span>
|
||||
</el-link>
|
||||
</el-space>
|
||||
|
@ -7,6 +7,9 @@
|
||||
<el-form-item label="发生日期" prop="dateOfOccurrence">
|
||||
<el-date-picker clearable v-model="queryParams.dateOfOccurrence" type="date" value-format="YYYY-MM-DD" placeholder="请选择发生日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="录入人" prop="creatorName">
|
||||
<el-input clearable v-model="queryParams.creatorName" placeholder="请输入录入人" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
@ -48,7 +51,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="录入时间" align="center" prop="createTime" />
|
||||
<el-table-column label="录入人" align="center" prop="creator.name" />
|
||||
<el-table-column label="录入人" align="center" prop="creatorName" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
@ -56,7 +59,7 @@
|
||||
<el-button link type="primary" icon="View" @click="handleShowDialog(scope.row)" v-hasPermi="['safety:safetyLog:query']">
|
||||
详情
|
||||
</el-button>
|
||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:safetyLog:edit']"> 修改 </el-button>
|
||||
<!-- <el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:safetyLog:edit']"> 修改 </el-button> -->
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['safety:safetyLog:remove']"> 删除 </el-button>
|
||||
</el-space>
|
||||
</template>
|
||||
@ -67,7 +70,7 @@
|
||||
</el-card>
|
||||
<!-- 添加或修改安全日志对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="950px" append-to-body>
|
||||
<el-form ref="safetyLogFormRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form ref="safetyLogFormRef" :model="form" :rules="rules" label-width="250px">
|
||||
<el-form-item label="发生日期" prop="dateOfOccurrence">
|
||||
<el-date-picker clearable v-model="form.dateOfOccurrence" type="date" value-format="YYYY-MM-DD" placeholder="请选择发生日期">
|
||||
</el-date-picker>
|
||||
@ -176,6 +179,7 @@ const initFormData: SafetyLogForm = {
|
||||
stoppageOrOvertime: undefined,
|
||||
otherCondition: undefined,
|
||||
fileId: undefined,
|
||||
creatorName: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
const data = reactive<PageData<SafetyLogForm, SafetyLogQuery>>({
|
||||
@ -198,6 +202,7 @@ const data = reactive<PageData<SafetyLogForm, SafetyLogQuery>>({
|
||||
stoppageOrOvertime: undefined,
|
||||
otherCondition: undefined,
|
||||
remark: undefined,
|
||||
creatorName: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
@ -278,6 +283,7 @@ const submitForm = () => {
|
||||
safetyLogFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
if (form.value.id) {
|
||||
await updateSafetyLog(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -310,6 +316,20 @@ const handleExport = () => {
|
||||
);
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
@ -90,7 +90,7 @@
|
||||
<el-date-picker clearable v-model="form.scopeEnd" type="date" value-format="YYYY-MM-DD" placeholder="请选择周期范围结束" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件位置" prop="path">
|
||||
<file-upload v-model="form.path" :file-size="20" :limit="1" :file-type="['doc', 'docx']" />
|
||||
<div><file-upload v-model="form.path" :file-size="20" :limit="1" :file-type="['doc', 'docx']" /></div>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
@ -231,6 +231,7 @@ const submitForm = () => {
|
||||
safetyWeeklyReportFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
if (form.value.id) {
|
||||
await updateSafetyWeeklyReport(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -263,6 +264,20 @@ const handleExport = () => {
|
||||
);
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
@ -1,19 +1,19 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-descriptions v-loading="loading" :column="2">
|
||||
<el-descriptions-item :span="2" label="宣讲人">{{ teamMeetingDetail?.compere?.name }}</el-descriptions-item>
|
||||
<el-descriptions-item :span="2" label="宣讲人">{{ teamMeetingDetail?.compereName }}</el-descriptions-item>
|
||||
<el-descriptions-item :span="2" label="参与人">
|
||||
<span :key="item.id" v-for="item in teamMeetingDetail?.participantList">{{ item.name }},</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="班组名称">{{ teamMeetingDetail?.team.name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="施工单位">{{ teamMeetingDetail?.contractor.name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="班组名称">{{ teamMeetingDetail?.teamName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="施工单位">{{ teamMeetingDetail?.contractorName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="开会时间">{{ dayjs(teamMeetingDetail?.meetingDate).format('YYYY 年 MM 月 DD 日') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="上传时间">{{ teamMeetingDetail?.createTime }}</el-descriptions-item>
|
||||
<el-descriptions-item :span="2" label="班会内容">{{ teamMeetingDetail?.content }}</el-descriptions-item>
|
||||
<el-descriptions-item :span="2" label="班会图片">
|
||||
<el-space wrap>
|
||||
<span :key="item.id" v-for="item in teamMeetingDetail?.pictureUrl">
|
||||
<image-preview :src="item.name" width="200px" />
|
||||
<span :key="item" v-for="item in teamMeetingDetail?.pictureUrlList">
|
||||
<image-preview :src="item" width="200px" />
|
||||
</span>
|
||||
</el-space>
|
||||
</el-descriptions-item>
|
||||
|
@ -19,17 +19,17 @@
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['safety:teamMeeting:add']"> 新增 </el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['safety:teamMeeting:remove']">
|
||||
批量删除
|
||||
删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['safety:teamMeeting:export']">导出 </el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
@ -37,9 +37,9 @@
|
||||
<el-table v-loading="loading" :data="teamMeetingList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="宣讲人" align="center" prop="compere.name" />
|
||||
<el-table-column label="施工单位" align="center" prop="contractor.name" />
|
||||
<el-table-column label="班组名称" align="center" prop="team.name" />
|
||||
<el-table-column label="宣讲人" align="center" prop="compereName" />
|
||||
<el-table-column label="施工单位" align="center" prop="contractorName" />
|
||||
<el-table-column label="班组名称" align="center" prop="teamName" />
|
||||
<el-table-column label="参与人数" align="center">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.participantList.length + 1 }}</span>
|
||||
@ -50,6 +50,11 @@
|
||||
<span>{{ parseTime(scope.row.meetingDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上传时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {hh}:{mm}:{ss}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
@ -57,7 +62,7 @@
|
||||
<el-button link type="primary" icon="View" @click="handleShowDrawer(scope.row)" v-hasPermi="['safety:teamMeeting:query']">
|
||||
详情
|
||||
</el-button>
|
||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:teamMeeting:edit']"> 修改 </el-button>
|
||||
<!-- <el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:teamMeeting:edit']"> 修改 </el-button> -->
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['safety:teamMeeting:remove']">
|
||||
删除
|
||||
</el-button>
|
||||
@ -263,6 +268,20 @@ const handleExport = () => {
|
||||
);
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
@ -24,7 +24,9 @@
|
||||
"removeComments": true,
|
||||
// 允许默认导入
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"outDir": "dist",
|
||||
"rootDir": "."
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.vue", "src/types/**/*.d.ts", "vite.config.ts"],
|
||||
"exclude": ["node_modules", "dist", "**/*.js", "**/*.md", "src/**/*.md"]
|
||||
|
@ -121,7 +121,6 @@ security:
|
||||
- /*/api-docs/**
|
||||
- /warm-flow-ui/token-name
|
||||
- /other/ys7Device/webhook
|
||||
- /other/ys7Device/test
|
||||
|
||||
# 多租户配置
|
||||
tenant:
|
||||
|
@ -1,6 +1,7 @@
|
||||
package org.dromara.test;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.manager.ys7manager.Ys7Manager;
|
||||
import org.dromara.manager.ys7manager.Ys7RequestUtils;
|
||||
import org.dromara.manager.ys7manager.vo.Ys7QueryDeviceResponseVo;
|
||||
@ -13,6 +14,7 @@ import java.util.List;
|
||||
* @author lcj
|
||||
* @date 2025/6/12 17:06
|
||||
*/
|
||||
@Slf4j
|
||||
@SpringBootTest
|
||||
public class Ys7Test {
|
||||
|
||||
@ -26,4 +28,10 @@ public class Ys7Test {
|
||||
System.out.println(ys7QueryDeviceResponseVos);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCaptureDevicePic() {
|
||||
String pic = ys7Manager.getCaptureDevicePic("AE9470016", 1, 1);
|
||||
System.out.println(pic);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -16,8 +16,9 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.facility.domain.dto.matrix.*;
|
||||
import org.dromara.facility.domain.vo.matrix.FacMatrixVo;
|
||||
import org.dromara.facility.domain.vo.matrix.FacMatrixDetailGisVo;
|
||||
import org.dromara.facility.domain.vo.matrix.FacMatrixPositionGisVo;
|
||||
import org.dromara.facility.domain.vo.matrix.FacMatrixVo;
|
||||
import org.dromara.facility.service.IFacMatrixService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -79,6 +80,16 @@ public class FacMatrixController extends BaseController {
|
||||
return R.ok(facMatrixService.getMatrixDetailGis(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设施-方阵大屏位置详情
|
||||
*/
|
||||
@SaCheckPermission("facility:matrix:query")
|
||||
@GetMapping("/gis/position/{id}")
|
||||
public R<FacMatrixPositionGisVo> getPositionGis(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(facMatrixService.getPositionGis(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过GeoJson新增设施-方阵
|
||||
*/
|
||||
|
@ -0,0 +1,54 @@
|
||||
package org.dromara.facility.domain.vo.boxtransformer;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.Data;
|
||||
import org.dromara.facility.domain.FacBoxTransformer;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/6/18 16:22
|
||||
*/
|
||||
@Data
|
||||
public class FacBoxTransformerPositionGisVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -5381920624456948144L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 箱变名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 箱变位置
|
||||
*/
|
||||
private List<Double> positionList;
|
||||
|
||||
/**
|
||||
* 完成状态(0未开始 1进行中 2完成)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 对象转vo
|
||||
*/
|
||||
public static FacBoxTransformerPositionGisVo obj2vo(FacBoxTransformer obj) {
|
||||
FacBoxTransformerPositionGisVo vo = new FacBoxTransformerPositionGisVo();
|
||||
BeanUtils.copyProperties(obj, vo);
|
||||
String positions = obj.getPositions();
|
||||
List<Double> positionList = JSONUtil.toList(positions, Double.class);
|
||||
vo.setPositionList(positionList);
|
||||
return vo;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package org.dromara.facility.domain.vo.inverter;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.Data;
|
||||
import org.dromara.facility.domain.FacInverter;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/6/18 16:22
|
||||
*/
|
||||
@Data
|
||||
public class FacInverterPositionGisVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 497930244187026829L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 逆变器名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 逆变器位置
|
||||
*/
|
||||
private List<Double> positionList;
|
||||
|
||||
/**
|
||||
* 完成状态(0未开始 1进行中 2完成)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 对象转vo
|
||||
*/
|
||||
public static FacInverterPositionGisVo obj2vo(FacInverter obj) {
|
||||
FacInverterPositionGisVo vo = new FacInverterPositionGisVo();
|
||||
BeanUtils.copyProperties(obj, vo);
|
||||
String positions = obj.getPositions();
|
||||
List<Double> positionList = JSONUtil.toList(positions, Double.class);
|
||||
vo.setPositionList(positionList);
|
||||
return vo;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package org.dromara.facility.domain.vo.matrix;
|
||||
|
||||
import lombok.Data;
|
||||
import org.dromara.facility.domain.vo.boxtransformer.FacBoxTransformerPositionGisVo;
|
||||
import org.dromara.facility.domain.vo.inverter.FacInverterPositionGisVo;
|
||||
import org.dromara.facility.domain.vo.photovoltaicpanel.FacPhotovoltaicPanelPositionGisVo;
|
||||
import org.dromara.facility.domain.vo.photovoltaicpanelcolumn.FacPhotovoltaicPanelColumnPositionGisVo;
|
||||
import org.dromara.facility.domain.vo.photovoltaicpanelpoint.FacPhotovoltaicPanelPointPositionGisVo;
|
||||
import org.dromara.facility.domain.vo.photovoltaicpanelsupport.FacPhotovoltaicPanelSupportPositionGisVo;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/6/18 16:14
|
||||
*/
|
||||
@Data
|
||||
public class FacMatrixPositionGisVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 7720584094593327756L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 方阵名称
|
||||
*/
|
||||
private String matrixName;
|
||||
|
||||
/**
|
||||
* 方阵位置
|
||||
*/
|
||||
private List<List<Double>> positions;
|
||||
|
||||
/**
|
||||
* 逆变器位置
|
||||
*/
|
||||
private List<FacInverterPositionGisVo> inverterPositionList;
|
||||
|
||||
/**
|
||||
* 箱变位置
|
||||
*/
|
||||
private List<FacBoxTransformerPositionGisVo> boxTransformerPositionList;
|
||||
|
||||
/**
|
||||
* 光伏板位置
|
||||
*/
|
||||
private List<FacPhotovoltaicPanelPositionGisVo> photovoltaicPanelPositionList;
|
||||
|
||||
/**
|
||||
* 光伏板立柱位置
|
||||
*/
|
||||
private List<FacPhotovoltaicPanelColumnPositionGisVo> photovoltaicPanelColumnPositionList;
|
||||
|
||||
/**
|
||||
* 光伏板支架位置
|
||||
*/
|
||||
private List<FacPhotovoltaicPanelSupportPositionGisVo> photovoltaicPanelSupportPositionList;
|
||||
|
||||
/**
|
||||
* 光伏板桩点位置
|
||||
*/
|
||||
private List<FacPhotovoltaicPanelPointPositionGisVo> photovoltaicPanelPointPositionList;
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package org.dromara.facility.domain.vo.photovoltaicpanel;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.Data;
|
||||
import org.dromara.facility.domain.FacPhotovoltaicPanel;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/6/18 16:19
|
||||
*/
|
||||
@Data
|
||||
public class FacPhotovoltaicPanelPositionGisVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -851548161301247186L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 光伏板名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 光伏板位置
|
||||
*/
|
||||
private List<List<Double>> positionList;
|
||||
|
||||
/**
|
||||
* 完成状态(0未开始 1进行中 2完成)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 对象转VO
|
||||
*/
|
||||
public static FacPhotovoltaicPanelPositionGisVo obj2vo(FacPhotovoltaicPanel obj) {
|
||||
FacPhotovoltaicPanelPositionGisVo vo = new FacPhotovoltaicPanelPositionGisVo();
|
||||
BeanUtils.copyProperties(obj, vo);
|
||||
String positions = obj.getPositions();
|
||||
List<List<Double>> positionList = new ArrayList<>();
|
||||
List<String> arr = JSONUtil.toList(positions, String.class);
|
||||
for (String s : arr) {
|
||||
positionList.add(JSONUtil.toList(s, Double.class));
|
||||
}
|
||||
vo.setPositionList(positionList);
|
||||
return vo;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package org.dromara.facility.domain.vo.photovoltaicpanelcolumn;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.Data;
|
||||
import org.dromara.facility.domain.FacPhotovoltaicPanelColumn;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/6/18 16:25
|
||||
*/
|
||||
@Data
|
||||
public class FacPhotovoltaicPanelColumnPositionGisVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 8131058424226441681L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 光伏板立柱名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 光伏板立柱位置
|
||||
*/
|
||||
private List<Double> positionList;
|
||||
|
||||
/**
|
||||
* 完成状态(0未开始 1进行中 2完成)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 对象转vo
|
||||
*/
|
||||
public static FacPhotovoltaicPanelColumnPositionGisVo obj2vo(FacPhotovoltaicPanelColumn obj) {
|
||||
FacPhotovoltaicPanelColumnPositionGisVo vo = new FacPhotovoltaicPanelColumnPositionGisVo();
|
||||
BeanUtils.copyProperties(obj, vo);
|
||||
String positions = obj.getPositions();
|
||||
List<Double> positionList = JSONUtil.toList(positions, Double.class);
|
||||
vo.setPositionList(positionList);
|
||||
return vo;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package org.dromara.facility.domain.vo.photovoltaicpanelpoint;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.Data;
|
||||
import org.dromara.facility.domain.FacPhotovoltaicPanelPoint;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/6/18 16:25
|
||||
*/
|
||||
@Data
|
||||
public class FacPhotovoltaicPanelPointPositionGisVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -8626958457981310560L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 光伏板桩点名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 光伏板桩点位置
|
||||
*/
|
||||
private List<Double> positionList;
|
||||
|
||||
/**
|
||||
* 完成状态(0未开始 1进行中 2完成)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 对象转vo
|
||||
*/
|
||||
public static FacPhotovoltaicPanelPointPositionGisVo obj2vo(FacPhotovoltaicPanelPoint obj) {
|
||||
FacPhotovoltaicPanelPointPositionGisVo vo = new FacPhotovoltaicPanelPointPositionGisVo();
|
||||
BeanUtils.copyProperties(obj, vo);
|
||||
String positions = obj.getPositions();
|
||||
List<Double> positionList = JSONUtil.toList(positions, Double.class);
|
||||
vo.setPositionList(positionList);
|
||||
return vo;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package org.dromara.facility.domain.vo.photovoltaicpanelsupport;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.Data;
|
||||
import org.dromara.facility.domain.FacPhotovoltaicPanelSupport;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/6/18 16:25
|
||||
*/
|
||||
@Data
|
||||
public class FacPhotovoltaicPanelSupportPositionGisVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 330832487175547581L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 光伏板支架名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 光伏板支架位置
|
||||
*/
|
||||
private List<Double> positionList;
|
||||
|
||||
/**
|
||||
* 完成状态(0未开始 1进行中 2完成)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 对象转vo
|
||||
*/
|
||||
public static FacPhotovoltaicPanelSupportPositionGisVo obj2vo(FacPhotovoltaicPanelSupport obj){
|
||||
FacPhotovoltaicPanelSupportPositionGisVo vo = new FacPhotovoltaicPanelSupportPositionGisVo();
|
||||
BeanUtils.copyProperties(obj, vo);
|
||||
String positions = obj.getPositions();
|
||||
List<Double> positionList = JSONUtil.toList(positions, Double.class);
|
||||
vo.setPositionList(positionList);
|
||||
return vo;
|
||||
}
|
||||
|
||||
}
|
@ -8,6 +8,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.facility.domain.FacMatrix;
|
||||
import org.dromara.facility.domain.dto.matrix.*;
|
||||
import org.dromara.facility.domain.vo.matrix.FacMatrixDetailGisVo;
|
||||
import org.dromara.facility.domain.vo.matrix.FacMatrixPositionGisVo;
|
||||
import org.dromara.facility.domain.vo.matrix.FacMatrixVo;
|
||||
|
||||
import java.util.Collection;
|
||||
@ -129,4 +130,12 @@ public interface IFacMatrixService extends IService<FacMatrix> {
|
||||
*/
|
||||
FacMatrix getMatrixIdBy2Coordinates(List<FacMatrix> matrixList, List<List<Double>> coordinates);
|
||||
|
||||
/**
|
||||
* 获取设施-方阵位置信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 设施-方阵位置信息
|
||||
*/
|
||||
FacMatrixPositionGisVo getPositionGis(Long id);
|
||||
|
||||
}
|
||||
|
@ -18,11 +18,17 @@ import org.dromara.facility.domain.*;
|
||||
import org.dromara.facility.domain.dto.geojson.*;
|
||||
import org.dromara.facility.domain.dto.matrix.*;
|
||||
import org.dromara.facility.domain.enums.FacFinishStatusEnum;
|
||||
import org.dromara.facility.domain.vo.boxtransformer.FacBoxTransformerPositionGisVo;
|
||||
import org.dromara.facility.domain.vo.inverter.FacInverterPositionGisVo;
|
||||
import org.dromara.facility.domain.vo.matrix.FacMatrixDetailGisVo;
|
||||
import org.dromara.facility.domain.vo.matrix.FacMatrixPositionGisVo;
|
||||
import org.dromara.facility.domain.vo.matrix.FacMatrixVo;
|
||||
import org.dromara.facility.domain.vo.photovoltaicpanel.FacPhotovoltaicPanelPositionGisVo;
|
||||
import org.dromara.facility.domain.vo.photovoltaicpanelcolumn.FacPhotovoltaicPanelColumnPositionGisVo;
|
||||
import org.dromara.facility.domain.vo.photovoltaicpanelpoint.FacPhotovoltaicPanelPointPositionGisVo;
|
||||
import org.dromara.facility.domain.vo.photovoltaicpanelsupport.FacPhotovoltaicPanelSupportPositionGisVo;
|
||||
import org.dromara.facility.mapper.FacMatrixMapper;
|
||||
import org.dromara.facility.service.*;
|
||||
import org.dromara.progress.domain.PgsProgressCategory;
|
||||
import org.dromara.progress.service.IPgsProgressCategoryService;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.utils.JSTUtil;
|
||||
@ -311,7 +317,7 @@ public class FacMatrixServiceImpl extends ServiceImpl<FacMatrixMapper, FacMatrix
|
||||
if (!result) {
|
||||
throw new ServiceException("批量新增方阵失败,数据库异常", HttpStatus.ERROR);
|
||||
}
|
||||
Boolean save = progressCategoryService.insertByTemplate(projectId, matrixList,oldMatrixList);
|
||||
Boolean save = progressCategoryService.insertByTemplate(projectId, matrixList, oldMatrixList);
|
||||
if (!save) {
|
||||
throw new ServiceException("批量新增方阵进度分类失败,数据库异常", HttpStatus.ERROR);
|
||||
}
|
||||
@ -554,4 +560,112 @@ public class FacMatrixServiceImpl extends ServiceImpl<FacMatrixMapper, FacMatrix
|
||||
return matchMatrix;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设施-方阵位置信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 设施-方阵位置信息
|
||||
*/
|
||||
@Override
|
||||
public FacMatrixPositionGisVo getPositionGis(Long id) {
|
||||
FacMatrix matrix = this.getById(id);
|
||||
if (matrix == null) {
|
||||
throw new ServiceException("查询方阵失败,数据不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
Long projectId = matrix.getProjectId();
|
||||
FacMatrixPositionGisVo matrixPositionGisVo = new FacMatrixPositionGisVo();
|
||||
// 获取光伏板立柱信息
|
||||
List<FacPhotovoltaicPanelColumn> columnList = photovoltaicPanelColumnService.lambdaQuery()
|
||||
.select(
|
||||
FacPhotovoltaicPanelColumn::getId,
|
||||
FacPhotovoltaicPanelColumn::getName,
|
||||
FacPhotovoltaicPanelColumn::getPositions,
|
||||
FacPhotovoltaicPanelColumn::getStatus
|
||||
)
|
||||
.eq(FacPhotovoltaicPanelColumn::getProjectId, projectId)
|
||||
.list();
|
||||
List<FacPhotovoltaicPanelColumnPositionGisVo> columnVoList = columnList
|
||||
.stream().map(FacPhotovoltaicPanelColumnPositionGisVo::obj2vo).toList();
|
||||
matrixPositionGisVo.setPhotovoltaicPanelColumnPositionList(columnVoList);
|
||||
// 获取光伏板点信息
|
||||
List<FacPhotovoltaicPanelPoint> pointList = photovoltaicPanelPointService.lambdaQuery()
|
||||
.select(
|
||||
FacPhotovoltaicPanelPoint::getId,
|
||||
FacPhotovoltaicPanelPoint::getName,
|
||||
FacPhotovoltaicPanelPoint::getPositions,
|
||||
FacPhotovoltaicPanelPoint::getStatus
|
||||
)
|
||||
.eq(FacPhotovoltaicPanelPoint::getProjectId, projectId)
|
||||
.list();
|
||||
List<FacPhotovoltaicPanelPointPositionGisVo> pointVoList = pointList
|
||||
.stream().map(FacPhotovoltaicPanelPointPositionGisVo::obj2vo).toList();
|
||||
matrixPositionGisVo.setPhotovoltaicPanelPointPositionList(pointVoList);
|
||||
// 获取光伏板支架信息
|
||||
List<FacPhotovoltaicPanelSupport> supportList = photovoltaicPanelSupportService.lambdaQuery()
|
||||
.select(
|
||||
FacPhotovoltaicPanelSupport::getId,
|
||||
FacPhotovoltaicPanelSupport::getName,
|
||||
FacPhotovoltaicPanelSupport::getPositions,
|
||||
FacPhotovoltaicPanelSupport::getStatus
|
||||
)
|
||||
.eq(FacPhotovoltaicPanelSupport::getProjectId, projectId)
|
||||
.list();
|
||||
List<FacPhotovoltaicPanelSupportPositionGisVo> supportVoList = supportList
|
||||
.stream().map(FacPhotovoltaicPanelSupportPositionGisVo::obj2vo).toList();
|
||||
matrixPositionGisVo.setPhotovoltaicPanelSupportPositionList(supportVoList);
|
||||
// 获取光伏板信息
|
||||
List<FacPhotovoltaicPanel> panelList = photovoltaicPanelService.lambdaQuery()
|
||||
.select(
|
||||
FacPhotovoltaicPanel::getId,
|
||||
FacPhotovoltaicPanel::getName,
|
||||
FacPhotovoltaicPanel::getPositions,
|
||||
FacPhotovoltaicPanel::getStatus
|
||||
)
|
||||
.eq(FacPhotovoltaicPanel::getProjectId, projectId)
|
||||
.eq(FacPhotovoltaicPanel::getProgressCategoryName, "光伏板")
|
||||
.list();
|
||||
List<FacPhotovoltaicPanelPositionGisVo> panelVoList = panelList
|
||||
.stream().map(FacPhotovoltaicPanelPositionGisVo::obj2vo).toList();
|
||||
matrixPositionGisVo.setPhotovoltaicPanelPositionList(panelVoList);
|
||||
// 获取箱变信息
|
||||
List<FacBoxTransformer> boxTransformerList = boxTransformerService.lambdaQuery()
|
||||
.select(
|
||||
FacBoxTransformer::getId,
|
||||
FacBoxTransformer::getName,
|
||||
FacBoxTransformer::getPositions,
|
||||
FacBoxTransformer::getStatus
|
||||
)
|
||||
.eq(FacBoxTransformer::getProjectId, projectId)
|
||||
.eq(FacBoxTransformer::getProgressCategoryName, "箱变基础")
|
||||
.list();
|
||||
List<FacBoxTransformerPositionGisVo> boxTransformerVoList = boxTransformerList
|
||||
.stream().map(FacBoxTransformerPositionGisVo::obj2vo).toList();
|
||||
matrixPositionGisVo.setBoxTransformerPositionList(boxTransformerVoList);
|
||||
// 获取逆变器信息
|
||||
List<FacInverter> inverterList = inverterService.lambdaQuery()
|
||||
.select(
|
||||
FacInverter::getId,
|
||||
FacInverter::getName,
|
||||
FacInverter::getPositions,
|
||||
FacInverter::getStatus
|
||||
)
|
||||
.eq(FacInverter::getProjectId, projectId)
|
||||
.eq(FacInverter::getProgressCategoryName, "逆变器安装")
|
||||
.list();
|
||||
List<FacInverterPositionGisVo> inverterVoList = inverterList
|
||||
.stream().map(FacInverterPositionGisVo::obj2vo).toList();
|
||||
matrixPositionGisVo.setInverterPositionList(inverterVoList);
|
||||
// 封装方阵信息
|
||||
matrixPositionGisVo.setMatrixName(matrix.getMatrixName());
|
||||
matrixPositionGisVo.setId(matrix.getId());
|
||||
String positions = matrix.getPositions();
|
||||
List<List<Double>> positionList = new ArrayList<>();
|
||||
List<String> arr = JSONUtil.toList(positions, String.class);
|
||||
for (String s : arr) {
|
||||
positionList.add(JSONUtil.toList(s, Double.class));
|
||||
}
|
||||
matrixPositionGisVo.setPositions(positionList);
|
||||
return matrixPositionGisVo;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,140 @@
|
||||
package org.dromara.job.cycle;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.manager.ys7manager.Ys7Manager;
|
||||
import org.dromara.other.domain.OthDevicePreset;
|
||||
import org.dromara.other.domain.OthYs7Device;
|
||||
import org.dromara.other.domain.dto.ys7deviceimg.OthYs7DeviceImgCreateByCapture;
|
||||
import org.dromara.other.domain.enums.OthDeviceStatusEnum;
|
||||
import org.dromara.other.service.IOthDevicePresetService;
|
||||
import org.dromara.other.service.IOthYs7DeviceImgService;
|
||||
import org.dromara.other.service.IOthYs7DeviceService;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 定时同步萤石设备图片数据
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025/6/18 15:59
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class IncSyncYs7DeviceCapturePicData {
|
||||
|
||||
@Resource
|
||||
private IOthYs7DeviceService ys7DeviceService;
|
||||
|
||||
@Resource
|
||||
private IOthDevicePresetService devicePresetService;
|
||||
|
||||
@Resource
|
||||
private IOthYs7DeviceImgService ys7DeviceImgService;
|
||||
|
||||
@Resource
|
||||
private Ys7Manager ys7Manager;
|
||||
|
||||
private final ExecutorService executorService = Executors.newFixedThreadPool(5);
|
||||
|
||||
// 每 5 分钟执行一次
|
||||
@Scheduled(cron = "0 */5 * * * ?")
|
||||
public void run() {
|
||||
// 查询所有在线的摄像头设备,仅获取必要字段
|
||||
List<OthYs7Device> deviceList = ys7DeviceService.lambdaQuery()
|
||||
.select(OthYs7Device::getId, OthYs7Device::getDeviceSerial, OthYs7Device::getDeviceName)
|
||||
.eq(OthYs7Device::getStatus, OthDeviceStatusEnum.ONLINE.getValue())
|
||||
.list().subList(0, 10);
|
||||
// 提取设备序列号用于后续查询预置位
|
||||
List<String> deviceSerialList = deviceList.stream()
|
||||
.map(OthYs7Device::getDeviceSerial).toList();
|
||||
// 查询所有相关的摄像头预置位信息
|
||||
List<OthDevicePreset> presetList = devicePresetService.lambdaQuery()
|
||||
.in(OthDevicePreset::getDeviceSerial, deviceSerialList)
|
||||
.list();
|
||||
// 将预置位按设备序列号分组,便于后续查找
|
||||
Map<String, List<OthDevicePreset>> presetMap = presetList.stream()
|
||||
.collect(Collectors.groupingBy(OthDevicePreset::getDeviceSerial));
|
||||
// 存储抓拍图片结果,使用线程安全的列表
|
||||
List<OthYs7DeviceImgCreateByCapture> imgList = Collections.synchronizedList(new ArrayList<>());
|
||||
// 用于等待所有子任务完成的计数器
|
||||
CountDownLatch latch = new CountDownLatch(deviceList.size());
|
||||
// 遍历每个摄像头设备进行处理
|
||||
for (OthYs7Device ys7Device : deviceList) {
|
||||
executorService.submit(() -> {
|
||||
try {
|
||||
String deviceSerial = ys7Device.getDeviceSerial();
|
||||
List<OthDevicePreset> presets = presetMap.get(deviceSerial);
|
||||
// 如果存在预置位,则遍历每个预置位进行抓图
|
||||
if (presets != null && !presets.isEmpty()) {
|
||||
for (OthDevicePreset preset : presets) {
|
||||
OthYs7DeviceImgCreateByCapture img = new OthYs7DeviceImgCreateByCapture();
|
||||
img.setDeviceSerial(deviceSerial);
|
||||
img.setDeviceName(ys7Device.getDeviceName());
|
||||
int channelNo = preset.getChannelNo();
|
||||
int index = preset.getPresetIndex();
|
||||
// 调用摄像头移动到预置位
|
||||
boolean result = ys7Manager.moveDevicePreset(deviceSerial, channelNo, index);
|
||||
if (!result) {
|
||||
log.error("调用摄像头预置位失败:{}", deviceSerial);
|
||||
continue;
|
||||
}
|
||||
// 等待摄像头转动到位
|
||||
try {
|
||||
Thread.sleep(5000);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
log.error("线程中断", e);
|
||||
}
|
||||
// 抓取当前画面图片
|
||||
try {
|
||||
String url = ys7Manager.getCaptureDevicePic(deviceSerial, channelNo, 2);
|
||||
img.setUrl(url);
|
||||
imgList.add(img);
|
||||
} catch (Exception e) {
|
||||
log.error("摄像头 {} 通道:{},预置点序号:{},抓图失败:{}", deviceSerial, channelNo, index, e.getMessage());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 如果没有预置位,则直接对默认通道抓图
|
||||
OthYs7DeviceImgCreateByCapture img = new OthYs7DeviceImgCreateByCapture();
|
||||
img.setDeviceSerial(deviceSerial);
|
||||
img.setDeviceName(ys7Device.getDeviceName());
|
||||
try {
|
||||
String url = ys7Manager.getCaptureDevicePic(deviceSerial, 1, 2);
|
||||
img.setUrl(url);
|
||||
imgList.add(img);
|
||||
} catch (Exception e) {
|
||||
log.error("摄像头 {} 抓图失败:{}", deviceSerial, e.getMessage());
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
log.error("设备处理异常:{}", ys7Device.getDeviceSerial(), ex);
|
||||
} finally {
|
||||
// 不论成功与否,都减少计数器
|
||||
latch.countDown();
|
||||
}
|
||||
});
|
||||
}
|
||||
// 等待所有设备处理完成
|
||||
try {
|
||||
latch.await();
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
log.error("主线程中断", e);
|
||||
}
|
||||
// 输出抓图结果日志
|
||||
log.info("获取图片完成,共 {} 张:{}", imgList.size(), imgList);
|
||||
ys7DeviceImgService.saveCapturePic(imgList);
|
||||
}
|
||||
|
||||
}
|
@ -50,4 +50,10 @@ public interface Ys7Constant {
|
||||
* 清除设备预置点请求地址 Post
|
||||
*/
|
||||
String deleteDevicePresetUrlByPost = "https://open.ys7.com/api/lapp/device/preset/clear";
|
||||
|
||||
/**
|
||||
* 设备抓拍照片请求地址 Post
|
||||
*/
|
||||
String captureDeviceUrlByPost = "https://open.ys7.com/api/lapp/device/capture";
|
||||
|
||||
}
|
||||
|
@ -111,4 +111,16 @@ public class Ys7Manager {
|
||||
public Boolean deleteDevicePreset(String deviceSerial, int channelNo, int index) {
|
||||
return Ys7RequestUtils.deleteDevicePreset(getToken(), deviceSerial, channelNo, index);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备图片
|
||||
*
|
||||
* @param deviceSerial 设备序列号
|
||||
* @param channelNo 通道号
|
||||
* @param quality 视频清晰度,0-流畅,1-高清(720P),2-4CIF,3-1080P,4-400w
|
||||
* @return 抓拍后的图片路径
|
||||
*/
|
||||
public String getCaptureDevicePic(String deviceSerial, int channelNo, int quality) {
|
||||
return Ys7RequestUtils.getCaptureDevicePic(getToken(), deviceSerial, channelNo, quality);
|
||||
}
|
||||
}
|
||||
|
@ -249,4 +249,46 @@ public class Ys7RequestUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 抓拍设备图片
|
||||
*
|
||||
* @param accessToken accessToken
|
||||
* @param deviceSerial 设备序列号
|
||||
* @param channelNo 通道号,IPC设备填写1
|
||||
* @param quality 视频清晰度,0-流畅,1-高清(720P),2-4CIF,3-1080P,4-400w
|
||||
* @return 抓拍后的图片路径,图片保存有效期为2小时
|
||||
*/
|
||||
public static String getCaptureDevicePic(String accessToken, String deviceSerial, int channelNo, int quality) {
|
||||
if (StringUtils.isAnyBlank(accessToken, deviceSerial)) {
|
||||
throw new ServiceException("抓拍设备图片参数为空", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
if (quality < 0 || quality > 4) {
|
||||
quality = 0;
|
||||
}
|
||||
HashMap<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("accessToken", accessToken);
|
||||
paramMap.put("deviceSerial", deviceSerial);
|
||||
paramMap.put("channelNo", channelNo);
|
||||
paramMap.put("quality", quality);
|
||||
String errorMsg = "抓拍设备图片请求失败";
|
||||
try (HttpResponse response = HttpRequest.post(Ys7Constant.captureDeviceUrlByPost)
|
||||
.form(paramMap)
|
||||
.execute()) {
|
||||
if (!response.isOk()) {
|
||||
log.error("{}:{}", errorMsg, response.getStatus());
|
||||
throw new ServiceException(errorMsg + response.getStatus());
|
||||
}
|
||||
String body = response.body();
|
||||
Ys7ResponseVo responseVo = JSONUtil.toBean(body, Ys7ResponseVo.class);
|
||||
if (!responseVo.getCode().equals("200")) {
|
||||
log.error("{}:{}", errorMsg, responseVo.getMsg());
|
||||
throw new ServiceException(errorMsg + responseVo.getMsg());
|
||||
}
|
||||
String data = responseVo.getData();
|
||||
String picUrl = JSONUtil.parseObj(data).getStr("picUrl");
|
||||
log.info("抓拍设备图片请求成功,设备[{}]抓拍成功,通道:{},url:{}", deviceSerial, channelNo, picUrl);
|
||||
return picUrl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,32 @@
|
||||
package org.dromara.other.constant;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/6/18 19:11
|
||||
*/
|
||||
public interface Ys7DeviceImgConstant {
|
||||
|
||||
/**
|
||||
* 设备图片oss前缀
|
||||
*/
|
||||
String DEVICE_IMG_OSS_URL_PREFIX = "ys7/device/img/";
|
||||
|
||||
/**
|
||||
* 获取设备图片oss路径
|
||||
*
|
||||
* @param originalFilename 文件名原始名
|
||||
* @param deviceSerial 设备序列号
|
||||
* @return oss路径
|
||||
*/
|
||||
static String getDeviceImgOssPath(String originalFilename, String deviceSerial) {
|
||||
String suffix = FileUtil.getSuffix(originalFilename);
|
||||
String uuid = IdUtil.fastSimpleUUID();
|
||||
String date = DateUtils.getDate();
|
||||
String fileName = String.format("%s_%s.%s", date, uuid, suffix);
|
||||
return DEVICE_IMG_OSS_URL_PREFIX + deviceSerial + "/" + fileName;
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package org.dromara.other.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.other.domain.dto.ys7deviceimg.OthYs7DeviceImgQueryReq;
|
||||
import org.dromara.other.domain.vo.ys7deviceimg.OthYs7DeviceImgVo;
|
||||
import org.dromara.other.service.IOthYs7DeviceImgService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 萤石摄像头图片
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-06-18
|
||||
*/
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/other/ys7DeviceImg")
|
||||
public class OthYs7DeviceImgController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IOthYs7DeviceImgService othYs7DeviceImgService;
|
||||
|
||||
/**
|
||||
* 查询萤石摄像头图片列表
|
||||
*/
|
||||
@SaCheckPermission("other:ys7DeviceImg:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<OthYs7DeviceImgVo> list(OthYs7DeviceImgQueryReq req, PageQuery pageQuery) {
|
||||
return othYs7DeviceImgService.queryPageList(req, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出萤石摄像头图片列表
|
||||
*/
|
||||
@SaCheckPermission("other:ys7DeviceImg:export")
|
||||
@Log(title = "萤石摄像头图片", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(OthYs7DeviceImgQueryReq req, HttpServletResponse response) {
|
||||
List<OthYs7DeviceImgVo> list = othYs7DeviceImgService.queryList(req);
|
||||
ExcelUtil.exportExcel(list, "萤石摄像头图片", OthYs7DeviceImgVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取萤石摄像头图片详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("other:ys7DeviceImg:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<OthYs7DeviceImgVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(othYs7DeviceImgService.queryById(id));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package org.dromara.other.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 萤石摄像头图片对象 oth_ys7_device_img
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-06-18
|
||||
*/
|
||||
@Data
|
||||
@TableName("oth_ys7_device_img")
|
||||
public class OthYs7DeviceImg implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备序列号
|
||||
*/
|
||||
private String deviceSerial;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 图片地址
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package org.dromara.other.domain.dto.ys7deviceimg;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/6/18 18:34
|
||||
*/
|
||||
@Data
|
||||
public class OthYs7DeviceImgCreateByCapture implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 9152300524686055187L;
|
||||
|
||||
/**
|
||||
* 设备序列号
|
||||
*/
|
||||
private String deviceSerial;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 图片地址
|
||||
*/
|
||||
private String url;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package org.dromara.other.domain.dto.ys7deviceimg;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/6/18 15:06
|
||||
*/
|
||||
@Data
|
||||
public class OthYs7DeviceImgQueryReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 5264959525029608917L;
|
||||
|
||||
/**
|
||||
* 设备序列号
|
||||
*/
|
||||
private String deviceSerial;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package org.dromara.other.domain.vo.ys7deviceimg;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.other.domain.OthYs7DeviceImg;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 萤石摄像头图片视图对象 oth_ys7_device_img
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-06-18
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = OthYs7DeviceImg.class)
|
||||
public class OthYs7DeviceImgVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ExcelProperty(value = "主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备序列号
|
||||
*/
|
||||
@ExcelProperty(value = "设备序列号")
|
||||
private String deviceSerial;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@ExcelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 图片地址
|
||||
*/
|
||||
@ExcelProperty(value = "图片地址")
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package org.dromara.other.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.other.domain.OthYs7DeviceImg;
|
||||
import org.dromara.other.domain.dto.ys7deviceimg.OthYs7DeviceImgCreateByCapture;
|
||||
import org.dromara.other.domain.dto.ys7deviceimg.OthYs7DeviceImgQueryReq;
|
||||
import org.dromara.other.domain.vo.ys7deviceimg.OthYs7DeviceImgVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 萤石摄像头图片Service接口
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-06-18
|
||||
*/
|
||||
public interface IOthYs7DeviceImgService extends IService<OthYs7DeviceImg> {
|
||||
|
||||
/**
|
||||
* 查询萤石摄像头图片
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 萤石摄像头图片
|
||||
*/
|
||||
OthYs7DeviceImgVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询萤石摄像头图片列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 萤石摄像头图片分页列表
|
||||
*/
|
||||
TableDataInfo<OthYs7DeviceImgVo> queryPageList(OthYs7DeviceImgQueryReq req, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的萤石摄像头图片列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 萤石摄像头图片列表
|
||||
*/
|
||||
List<OthYs7DeviceImgVo> queryList(OthYs7DeviceImgQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取萤石摄像头图片视图
|
||||
*
|
||||
* @param ys7DeviceImg 萤石摄像头图片
|
||||
* @return 萤石摄像头图片视图
|
||||
*/
|
||||
OthYs7DeviceImgVo getVo(OthYs7DeviceImg ys7DeviceImg);
|
||||
|
||||
/**
|
||||
* 构建查询条件封装
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<OthYs7DeviceImg> buildQueryWrapper(OthYs7DeviceImgQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取萤石摄像头图片分页对象视图
|
||||
*
|
||||
* @param ys7DeviceImgPage 萤石摄像头图片分页对象
|
||||
* @return 萤石摄像头图片分页对象视图
|
||||
*/
|
||||
Page<OthYs7DeviceImgVo> getVoPage(Page<OthYs7DeviceImg> ys7DeviceImgPage);
|
||||
|
||||
/**
|
||||
* 保存抓拍图片
|
||||
*
|
||||
* @param imgList 抓拍图片列表
|
||||
*/
|
||||
void saveCapturePic(List<OthYs7DeviceImgCreateByCapture> imgList);
|
||||
}
|
@ -0,0 +1,186 @@
|
||||
package org.dromara.other.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.other.constant.Ys7DeviceImgConstant;
|
||||
import org.dromara.other.domain.OthYs7DeviceImg;
|
||||
import org.dromara.other.domain.dto.ys7deviceimg.OthYs7DeviceImgCreateByCapture;
|
||||
import org.dromara.other.domain.dto.ys7deviceimg.OthYs7DeviceImgQueryReq;
|
||||
import org.dromara.other.domain.vo.ys7deviceimg.OthYs7DeviceImgVo;
|
||||
import org.dromara.other.mapper.OthYs7DeviceImgMapper;
|
||||
import org.dromara.other.service.IOthYs7DeviceImgService;
|
||||
import org.dromara.system.domain.vo.SysOssUploadVo;
|
||||
import org.dromara.system.service.ISysOssService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 萤石摄像头图片Service业务层处理
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-06-18
|
||||
*/
|
||||
@Service
|
||||
public class OthYs7DeviceImgServiceImpl extends ServiceImpl<OthYs7DeviceImgMapper, OthYs7DeviceImg>
|
||||
implements IOthYs7DeviceImgService {
|
||||
|
||||
@Resource
|
||||
private ISysOssService ossService;
|
||||
|
||||
/**
|
||||
* 查询萤石摄像头图片
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 萤石摄像头图片
|
||||
*/
|
||||
@Override
|
||||
public OthYs7DeviceImgVo queryById(Long id) {
|
||||
OthYs7DeviceImg ys7DeviceImg = this.getById(id);
|
||||
if (ys7DeviceImg == null) {
|
||||
throw new ServiceException("萤石摄像头图片信息不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
return this.getVo(ys7DeviceImg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询萤石摄像头图片列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 萤石摄像头图片分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<OthYs7DeviceImgVo> queryPageList(OthYs7DeviceImgQueryReq req, PageQuery pageQuery) {
|
||||
Page<OthYs7DeviceImg> result = this.page(pageQuery.build(), this.buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的萤石摄像头图片列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 萤石摄像头图片列表
|
||||
*/
|
||||
@Override
|
||||
public List<OthYs7DeviceImgVo> queryList(OthYs7DeviceImgQueryReq req) {
|
||||
LambdaQueryWrapper<OthYs7DeviceImg> lqw = this.buildQueryWrapper(req);
|
||||
return this.list(lqw).stream().map(this::getVo).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取萤石摄像头图片视图
|
||||
*
|
||||
* @param ys7DeviceImg 萤石摄像头图片
|
||||
* @return 萤石摄像头图片视图
|
||||
*/
|
||||
@Override
|
||||
public OthYs7DeviceImgVo getVo(OthYs7DeviceImg ys7DeviceImg) {
|
||||
OthYs7DeviceImgVo vo = new OthYs7DeviceImgVo();
|
||||
if (ys7DeviceImg == null) {
|
||||
return vo;
|
||||
}
|
||||
BeanUtils.copyProperties(ys7DeviceImg, vo);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建查询条件封装
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<OthYs7DeviceImg> buildQueryWrapper(OthYs7DeviceImgQueryReq req) {
|
||||
LambdaQueryWrapper<OthYs7DeviceImg> lqw = new LambdaQueryWrapper<>();
|
||||
if (req == null) {
|
||||
return lqw;
|
||||
}
|
||||
String deviceSerial = req.getDeviceSerial();
|
||||
String deviceName = req.getDeviceName();
|
||||
lqw.like(StringUtils.isNotBlank(deviceSerial), OthYs7DeviceImg::getDeviceSerial, deviceSerial);
|
||||
lqw.like(StringUtils.isNotBlank(deviceName), OthYs7DeviceImg::getDeviceName, deviceName);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取萤石摄像头图片分页对象视图
|
||||
*
|
||||
* @param ys7DeviceImgPage 萤石摄像头图片分页对象
|
||||
* @return 萤石摄像头图片分页对象视图
|
||||
*/
|
||||
@Override
|
||||
public Page<OthYs7DeviceImgVo> getVoPage(Page<OthYs7DeviceImg> ys7DeviceImgPage) {
|
||||
List<OthYs7DeviceImg> ys7DeviceImgList = ys7DeviceImgPage.getRecords();
|
||||
Page<OthYs7DeviceImgVo> ys7DeviceImgVoPage = new Page<>(
|
||||
ys7DeviceImgPage.getCurrent(),
|
||||
ys7DeviceImgPage.getSize(),
|
||||
ys7DeviceImgPage.getTotal()
|
||||
);
|
||||
if (CollUtil.isEmpty(ys7DeviceImgList)) {
|
||||
return ys7DeviceImgVoPage;
|
||||
}
|
||||
List<OthYs7DeviceImgVo> ys7DeviceImgVoList = ys7DeviceImgList.stream().map(this::getVo).toList();
|
||||
ys7DeviceImgVoPage.setRecords(ys7DeviceImgVoList);
|
||||
return ys7DeviceImgVoPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存抓拍图片
|
||||
*
|
||||
* @param imgList 抓拍图片列表
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveCapturePic(List<OthYs7DeviceImgCreateByCapture> imgList) {
|
||||
List<OthYs7DeviceImg> saveList = new ArrayList<>();
|
||||
for (OthYs7DeviceImgCreateByCapture img : imgList) {
|
||||
OthYs7DeviceImg othYs7DeviceImg = new OthYs7DeviceImg();
|
||||
String url = img.getUrl();
|
||||
String deviceSerial = img.getDeviceSerial();
|
||||
String originalFilename = extractFilename(url);
|
||||
String deviceImgOssPath = Ys7DeviceImgConstant.getDeviceImgOssPath(originalFilename, deviceSerial);
|
||||
SysOssUploadVo uploadVo = ossService.uploadFileUrlWithNoSave(url, deviceImgOssPath);
|
||||
String ossUrl = uploadVo.getUrl();
|
||||
if (StringUtils.isNotBlank(ossUrl)) {
|
||||
othYs7DeviceImg.setDeviceSerial(deviceSerial);
|
||||
othYs7DeviceImg.setDeviceName(img.getDeviceName());
|
||||
othYs7DeviceImg.setUrl(ossUrl);
|
||||
saveList.add(othYs7DeviceImg);
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(saveList)) {
|
||||
boolean result = saveBatch(saveList);
|
||||
if (!result) {
|
||||
throw new ServiceException("批量新增图片失败,数据库异常", HttpStatus.ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 提取文件名
|
||||
*
|
||||
* @param url 文件路径
|
||||
* @return 文件名
|
||||
*/
|
||||
public static String extractFilename(String url) {
|
||||
int start = url.lastIndexOf("/") + 1;
|
||||
int end = url.indexOf("?", start);
|
||||
if (start > 0 && end > start) {
|
||||
return url.substring(start, end);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -70,6 +70,15 @@ public interface ISysOssService {
|
||||
*/
|
||||
SysOssUploadVo uploadWithNoSave(MultipartFile file, String filePath);
|
||||
|
||||
/**
|
||||
* 通过 url 上传到对象存储服务,不保存文件信息到数据库
|
||||
*
|
||||
* @param fileUrl 要上传的文件url
|
||||
* @param filePath 文件路径
|
||||
* @return 上传成功后的 SysOssVo 对象,包含文件信息
|
||||
*/
|
||||
SysOssUploadVo uploadFileUrlWithNoSave(String fileUrl, String filePath);
|
||||
|
||||
/**
|
||||
* 上传文件到对象存储服务,并保存文件信息到数据库
|
||||
*
|
||||
|
@ -2,6 +2,7 @@ package org.dromara.system.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@ -35,8 +36,13 @@ import org.springframework.http.MediaType;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.time.Duration;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@ -250,6 +256,41 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
|
||||
return uploadVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过 url 上传到对象存储服务,不保存文件信息到数据库
|
||||
*
|
||||
* @param fileUrl 要上传的文件url
|
||||
* @param filePath 文件路径
|
||||
* @return 上传成功后的 SysOssVo 对象,包含文件信息
|
||||
*/
|
||||
@Override
|
||||
public SysOssUploadVo uploadFileUrlWithNoSave(String fileUrl, String filePath) {
|
||||
UploadResult uploadResult;
|
||||
try {
|
||||
// 1. 打开远程连接获取 InputStream
|
||||
URI uri = URI.create(fileUrl);
|
||||
URL url = uri.toURL();
|
||||
URLConnection conn = url.openConnection();
|
||||
InputStream inputStream = conn.getInputStream();
|
||||
// 2. 获取内容长度和类型(部分服务器可能返回为 -1)
|
||||
long length = conn.getContentLengthLong(); // 有些服务可能为 -1,需要兜底处理
|
||||
String contentType = conn.getContentType();
|
||||
if (length <= 0) {
|
||||
byte[] bytes = IoUtil.readBytes(inputStream);
|
||||
length = bytes.length;
|
||||
inputStream = new ByteArrayInputStream(bytes); // 重置为 ByteArrayInputStream
|
||||
}
|
||||
// 3. 上传
|
||||
OssClient storage = OssFactory.instance();
|
||||
uploadResult = storage.upload(inputStream, filePath, length, contentType);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
SysOssUploadVo uploadVo = new SysOssUploadVo();
|
||||
uploadVo.setUrl(uploadResult.getUrl());
|
||||
return uploadVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件到对象存储服务,并保存文件信息到数据库
|
||||
*
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.other.mapper.OthDevicePresetMapper">
|
||||
|
||||
</mapper>
|
||||
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.other.mapper.OthYs7DeviceImgMapper">
|
||||
|
||||
</mapper>
|
@ -537,3 +537,23 @@ values(1933445976098406405, '摄像头预置位删除', 1933445976098406401, '4'
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1933445976098406406, '摄像头预置位导出', 1933445976098406401, '5', '#', '', 1, 0, 'F', '0', '0', 'other:devicePreset:export', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1935231471757307906, '萤石摄像头图片', '1933345067448147969', '1', 'ys7DeviceImg', 'other/ys7DeviceImg/index', 1, 0, 'C', '0', '0', 'other:ys7DeviceImg:list', '#', 103, 1, sysdate(), null, null, '萤石摄像头图片菜单');
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1935231471757307907, '萤石摄像头图片查询', 1935231471757307906, '1', '#', '', 1, 0, 'F', '0', '0', 'other:ys7DeviceImg:query', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1935231471757307908, '萤石摄像头图片新增', 1935231471757307906, '2', '#', '', 1, 0, 'F', '0', '0', 'other:ys7DeviceImg:add', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1935231471757307909, '萤石摄像头图片修改', 1935231471757307906, '3', '#', '', 1, 0, 'F', '0', '0', 'other:ys7DeviceImg:edit', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1935231471757307910, '萤石摄像头图片删除', 1935231471757307906, '4', '#', '', 1, 0, 'F', '0', '0', 'other:ys7DeviceImg:remove', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1935231471757307911, '萤石摄像头图片导出', 1935231471757307906, '5', '#', '', 1, 0, 'F', '0', '0', 'other:ys7DeviceImg:export', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
@ -1102,5 +1102,20 @@ CREATE TABLE `oth_device_preset`
|
||||
`preset_name` varchar(255) null comment '预置点',
|
||||
`create_time` datetime default CURRENT_TIMESTAMP null comment '创建时间',
|
||||
`update_time` datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
|
||||
primary key (`id`) using btree
|
||||
primary key (`id`) using btree,
|
||||
index `idx_device_serial` (`device_serial` asc) using btree comment '设备序列号'
|
||||
) comment = '摄像头预置位' collate = utf8mb4_unicode_ci;
|
||||
|
||||
DROP TABLE IF EXISTS `oth_ys7_device_img`;
|
||||
CREATE TABLE `oth_ys7_device_img`
|
||||
(
|
||||
`id` bigint not null auto_increment comment '主键id',
|
||||
`device_serial` varchar(255) not null comment '设备序列号',
|
||||
`device_name` varchar(255) null comment '设备名称',
|
||||
`url` varchar(512) not null comment '图片地址',
|
||||
`remark` varchar(512) null comment '备注',
|
||||
`create_time` datetime default CURRENT_TIMESTAMP null comment '创建时间',
|
||||
`update_time` datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
|
||||
primary key (`id`) using btree,
|
||||
index `idx_device_serial` (`device_serial` asc) using btree comment '设备序列号'
|
||||
) comment = '萤石摄像头图片' collate = utf8mb4_unicode_ci;
|
||||
|
Reference in New Issue
Block a user