diff --git a/.env.development b/.env.development index c0c88b4..515b421 100644 --- a/.env.development +++ b/.env.development @@ -6,3 +6,6 @@ VITE_APP_ENV = 'development' # 运检站管理/开发环境 VITE_APP_BASE_API = '/dev-api' + +#静态资源路径(服务器目录) +VITE_APP_PUBLIC_PATH = '' diff --git a/.env.production b/.env.production index e5a9d89..d1fe8f1 100644 --- a/.env.production +++ b/.env.production @@ -5,7 +5,10 @@ VITE_APP_TITLE = 运检站管理 VITE_APP_ENV = 'production' # 运检站管理/生产环境 -VITE_APP_BASE_API = '/prod-api' +VITE_APP_BASE_API = '/ynDigitalGadgets-prod-api' + +#静态资源路径(服务器目录) +VITE_APP_PUBLIC_PATH = '/ynDigitalGadgets' # 是否在打包时开启压缩,支持 gzip 和 brotli VITE_BUILD_COMPRESS = gzip \ No newline at end of file diff --git a/public/favicon.ico-1 b/public/favicon.ico-1 deleted file mode 100644 index e263760..0000000 Binary files a/public/favicon.ico-1 and /dev/null differ diff --git a/src/api/planMange/dailyPlan.js b/src/api/planMange/dailyPlan.js index 21802cb..da00969 100644 --- a/src/api/planMange/dailyPlan.js +++ b/src/api/planMange/dailyPlan.js @@ -1,36 +1,45 @@ import request from '@/utils/request' -// 计划管理- 查询列表 -export function listPlanAPI(query) { +// 日计划管理- 查询列表 +export function listDailyPlanAPI(query) { return request({ - url: '/personnel/getPersonnelList', + url: '/dayPlan/getDayPlanList', method: 'GET', params: query, }) } -// 计划管理- 新增 -export function addPlanAPI(data) { +// 日计划管理- 新增 +export function addDailyPlanAPI(data) { return request({ - url: '/personnel/addPersonnel', + url: '/dayPlan/addDayPlan', method: 'POST', data, }) } -// 计划管理- 修改 -export function updatePlanAPI(data) { +// 日计划管理- 新增弹框内获取的计划列表 +export function listDailyPlanPopupAPI(query) { return request({ - url: '/personnel/updatePersonnel', + url: '/monthlyPlan/getMonthlyPlanLists', + method: 'GET', + params: query, + }) +} + +// 日计划管理- 修改 +export function updateDailyPlanAPI(data) { + return request({ + url: '/dayPlan/updateDayPlan', method: 'POST', data, }) } -// 计划管理- 删除 -export function delPlanAPI(data) { +// 日计划管理- 删除 +export function delDailyPlanAPI(data) { return request({ - url: `/personnel/delPersonnel`, + url: `/dayPlan/delDayPlan`, method: 'POST', data, }) diff --git a/src/components/ComTable/index.vue b/src/components/ComTable/index.vue index a79fca2..00d9798 100644 --- a/src/components/ComTable/index.vue +++ b/src/components/ComTable/index.vue @@ -36,7 +36,7 @@ :formData=" Object.assign({}, searchFormRef?.getFormData() || {}, { pageNum: pagination.page, - pageSize: pagination.pageSize, + pageSize: pagination.limit, }) || {} " /> @@ -133,7 +133,7 @@ const loading = ref(false) const tableData = ref([]) const pagination = reactive({ page: 1, - pageSize: 10, + limit: 10, total: 0, }) @@ -187,7 +187,7 @@ const fetchData = async (formData = {}) => { ...formData, ...props.defaultQueryParams, pageNum: pagination.page, // 后端可能需要pageNum - pageSize: pagination.pageSize, // 后端可能需要pageSize + pageSize: pagination.limit, // 后端可能需要pageSize } const response = await props.loadData(params) diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 249cb27..ecbe5a9 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -112,7 +112,8 @@ function logout() { }) .then(() => { userStore.logOut().then(() => { - location.href = '/index' + // location.href = '/index' + location.href = import.meta.env.VITE_APP_PUBLIC_PATH + '/index' }) }) .catch(() => {}) @@ -130,136 +131,137 @@ function toggleTheme() { diff --git a/src/router/index.js b/src/router/index.js index 278397f..f40e626 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -194,7 +194,7 @@ export const dynamicRoutes = [ ] const router = createRouter({ - history: createWebHistory(), + history: createWebHistory(import.meta.env.VITE_APP_PUBLIC_PATH || '/'), routes: constantRoutes, scrollBehavior(to, from, savedPosition) { if (savedPosition) { diff --git a/src/utils/request.js b/src/utils/request.js index 4858891..8304385 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -104,7 +104,8 @@ service.interceptors.response.use( useUserStore() .logOut() .then(() => { - location.href = '/index' + // location.href = '/index' + location.href = import.meta.env.VITE_APP_PUBLIC_PATH + '/index' }) }) .catch(() => { diff --git a/src/views/basicManage/businessType/config.js b/src/views/basicManage/businessType/config.js index cb00256..fff4a88 100644 --- a/src/views/basicManage/businessType/config.js +++ b/src/views/basicManage/businessType/config.js @@ -15,12 +15,13 @@ export default { { prop: 'remark', label: '备注', + width: '200', }, ], dialogConfig: reactive({ outerVisible: false, - outerTitle: '新增业务类型', + outerTitle: '新建业务类型', outerWidth: '720px', minHeight: '320px', maxHeight: '80vh', diff --git a/src/views/basicManage/businessType/index.vue b/src/views/basicManage/businessType/index.vue index 091fb4e..131e601 100644 --- a/src/views/basicManage/businessType/index.vue +++ b/src/views/basicManage/businessType/index.vue @@ -122,7 +122,7 @@ const actionColumns = [ // 新增 const onHandleAdd = () => { editId.value = null - dialogConfig.outerTitle = '新增业务类型' + dialogConfig.outerTitle = '新建业务类型' dialogConfig.outerVisible = true // 重置表单数据 addAndEditForm.value = getInitFormData() diff --git a/src/views/basicManage/inspectionStation/config.js b/src/views/basicManage/inspectionStation/config.js index c9a9929..5fdff68 100644 --- a/src/views/basicManage/inspectionStation/config.js +++ b/src/views/basicManage/inspectionStation/config.js @@ -15,12 +15,13 @@ export default { { prop: 'remark', label: '备注', + width: '200', }, ], dialogConfig: reactive({ outerVisible: false, - outerTitle: '新增运检站', + outerTitle: '新建运检站', outerWidth: '720px', minHeight: '320px', maxHeight: '80vh', diff --git a/src/views/basicManage/inspectionStation/index.vue b/src/views/basicManage/inspectionStation/index.vue index 9b99396..0d9cfe2 100644 --- a/src/views/basicManage/inspectionStation/index.vue +++ b/src/views/basicManage/inspectionStation/index.vue @@ -132,7 +132,7 @@ const actionColumns = [ // 新增 const onHandleAdd = () => { editId.value = null - dialogConfig.outerTitle = '新增运检站' + dialogConfig.outerTitle = '新建运检站' dialogConfig.outerVisible = true // 重置表单数据 addAndEditForm.value = getInitFormData() diff --git a/src/views/basicManage/personCategory/config.js b/src/views/basicManage/personCategory/config.js index 0325225..b3147da 100644 --- a/src/views/basicManage/personCategory/config.js +++ b/src/views/basicManage/personCategory/config.js @@ -15,6 +15,7 @@ export default { { prop: 'remark', label: '备注', + width: '200', }, ], diff --git a/src/views/basicManage/personNature/config.js b/src/views/basicManage/personNature/config.js index 290a476..b7ee2b3 100644 --- a/src/views/basicManage/personNature/config.js +++ b/src/views/basicManage/personNature/config.js @@ -15,6 +15,7 @@ export default { { prop: 'remark', label: '备注', + width: '200', }, ], diff --git a/src/views/basicManage/planCategory/config.js b/src/views/basicManage/planCategory/config.js index cb00256..7e1fe72 100644 --- a/src/views/basicManage/planCategory/config.js +++ b/src/views/basicManage/planCategory/config.js @@ -4,23 +4,24 @@ export default { { type: 'input', prop: 'planMajorName', - placeholder: '请输入业务类型名称', + placeholder: '请输入计划类别名称', }, ], tableColumns: [ { prop: 'planMajorName', - label: '业务类型名称', + label: '计划类别名称', }, { prop: 'remark', label: '备注', + width: '200', }, ], dialogConfig: reactive({ outerVisible: false, - outerTitle: '新增业务类型', + outerTitle: '新建计划类别', outerWidth: '720px', minHeight: '320px', maxHeight: '80vh', diff --git a/src/views/basicManage/planProfessional/config.js b/src/views/basicManage/planProfessional/config.js index 7469ef5..c869e22 100644 --- a/src/views/basicManage/planProfessional/config.js +++ b/src/views/basicManage/planProfessional/config.js @@ -15,6 +15,7 @@ export default { { prop: 'remark', label: '备注', + width: '200', }, ], diff --git a/src/views/basicManage/position/config.js b/src/views/basicManage/position/config.js index 9e6a86d..19326d4 100644 --- a/src/views/basicManage/position/config.js +++ b/src/views/basicManage/position/config.js @@ -15,6 +15,7 @@ export default { { prop: 'remark', label: '备注', + width: '200', }, ], diff --git a/src/views/basicManage/projectDept/config.js b/src/views/basicManage/projectDept/config.js index d8b844f..87a946d 100644 --- a/src/views/basicManage/projectDept/config.js +++ b/src/views/basicManage/projectDept/config.js @@ -15,6 +15,7 @@ export default { { prop: 'remark', label: '备注', + width: '200', }, ], diff --git a/src/views/basicManage/workloadCategory/config.js b/src/views/basicManage/workloadCategory/config.js index 5c257df..1ca05db 100644 --- a/src/views/basicManage/workloadCategory/config.js +++ b/src/views/basicManage/workloadCategory/config.js @@ -20,6 +20,7 @@ export default { { prop: 'remark', label: '备注', + width: '200', }, ], diff --git a/src/views/personManage/Person/config.js b/src/views/personManage/Person/config.js index 8be1227..8d557f4 100644 --- a/src/views/personManage/Person/config.js +++ b/src/views/personManage/Person/config.js @@ -9,7 +9,7 @@ export const buildFormColumns = ( ) => [ { type: 'input', - prop: 'personName', + prop: 'name', placeholder: '请输入姓名', }, { diff --git a/src/views/personManage/Person/index.vue b/src/views/personManage/Person/index.vue index 791fb49..0ad94d8 100644 --- a/src/views/personManage/Person/index.vue +++ b/src/views/personManage/Person/index.vue @@ -17,8 +17,8 @@ @@ -75,7 +75,7 @@ const editId = ref(null) const { options: inspectionStationOptions } = useOptions( 'inspectionStationOptions', getInspectionStationSelectAPI, - { category: 0 }, + {}, ) const { options: positionOptions } = useOptions( 'positionOptions', @@ -207,8 +207,32 @@ const onCloseDialogOuter = (visible) => { } } +// 获取 longTermSecondment 的值,统一转换为字符串格式 +const getLongTermSecondmentValue = (row) => { + const value = row.longTermSecondment + if (value === null || value === undefined) { + return '0' + } + // 如果是数字,转换为字符串;如果已经是字符串,直接返回 + return String(value) +} + // 是否长期借调 -const onHandleLongTermSecondmentChange = (row) => { - console.log(row) +const onHandleLongTermSecondmentChange = (value, row) => { + // 更新 row 数据,保持与 switch 组件的值同步 + row.longTermSecondment = value + + // 组装参数:将字符串转换为数字('1' -> 1, '0' -> 0) + const params = { + id: row.id, + longTermSecondment: value === '1' ? 1 : 0, + } + + updatePersonAPI(params).then((res) => { + if (res.code === 200) { + proxy.$modal.msgSuccess('更新成功') + comTableRef.value?.refresh() + } + }) } diff --git a/src/views/planMange/dailyPlan/addForm.vue b/src/views/planMange/dailyPlan/addForm.vue index 549b94a..6c7d62d 100644 --- a/src/views/planMange/dailyPlan/addForm.vue +++ b/src/views/planMange/dailyPlan/addForm.vue @@ -1,102 +1,111 @@ diff --git a/src/views/planMange/dailyPlan/config.js b/src/views/planMange/dailyPlan/config.js index 5ac74a0..84fca36 100644 --- a/src/views/planMange/dailyPlan/config.js +++ b/src/views/planMange/dailyPlan/config.js @@ -55,11 +55,11 @@ export const buildFormColumns = () => [ // 月计划列表表格列 export const tableColumns = [ - { prop: 'stationName', label: '日期', fixed: true }, - { prop: 'majorName', label: '运检站', fixed: true }, - { prop: 'businessTypeName', label: '专业', fixed: true }, + { prop: 'dayPlan', label: '日期', fixed: true, width: '140' }, + { prop: 'inspectionStationName', label: '运检站', fixed: true }, + { prop: 'planMajorName', label: '专业', fixed: true }, { prop: 'projectName', label: '项目名称', fixed: true }, - { prop: 'workTask', label: '工作任务' }, + { prop: 'workContent', label: '工作任务' }, { prop: 'riskLevelName', label: '风险等级' }, { prop: 'categoryName', label: '计划工作量(基)' }, ] @@ -107,7 +107,7 @@ export const tableColumns_2 = [ export const dialogConfig = reactive({ outerVisible: false, - outerTitle: '新增计划', + outerTitle: '添加计划任务', outerWidth: '70%', // 根据图片缩小宽度更美观 minHeight: '70vh', maxHeight: '90vh', diff --git a/src/views/planMange/dailyPlan/edit.vue b/src/views/planMange/dailyPlan/edit.vue index b0384d6..c19a164 100644 --- a/src/views/planMange/dailyPlan/edit.vue +++ b/src/views/planMange/dailyPlan/edit.vue @@ -1,301 +1,671 @@ - diff --git a/src/views/planMange/dailyPlan/forms/projectForm.vue b/src/views/planMange/dailyPlan/forms/projectForm.vue new file mode 100644 index 0000000..882ca73 --- /dev/null +++ b/src/views/planMange/dailyPlan/forms/projectForm.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/planMange/dailyPlan/forms/repairForm.vue b/src/views/planMange/dailyPlan/forms/repairForm.vue new file mode 100644 index 0000000..b018d7b --- /dev/null +++ b/src/views/planMange/dailyPlan/forms/repairForm.vue @@ -0,0 +1,1034 @@ + + + + + diff --git a/src/views/planMange/dailyPlan/forms/runForm.vue b/src/views/planMange/dailyPlan/forms/runForm.vue new file mode 100644 index 0000000..b54f11f --- /dev/null +++ b/src/views/planMange/dailyPlan/forms/runForm.vue @@ -0,0 +1,591 @@ + + + + + diff --git a/src/views/planMange/dailyPlan/index.vue b/src/views/planMange/dailyPlan/index.vue index f9304c3..09fc001 100644 --- a/src/views/planMange/dailyPlan/index.vue +++ b/src/views/planMange/dailyPlan/index.vue @@ -2,9 +2,9 @@
- - - + + + 下载统计表 @@ -15,13 +15,15 @@ :key="tableType" :show-toolbar="true" :show-action="true" - :load-data="listPlanAPI" :form-columns="formColumns" + :load-data="listDailyPlanAPI" :table-columns="initTableColumns" :action-columns="actionColumns" + :defaultQueryParams="{ dayPlanType: tableType }" >