diff --git a/.env.development b/.env.development index 16dfc46..a1c58cc 100644 --- a/.env.development +++ b/.env.development @@ -12,9 +12,7 @@ VITE_APP_BASE_API = 'http://192.168.110.149:8899' # 罗成 # VITE_APP_BASE_API = 'http://192.168.110.213:8899' # 朱银 -# VITE_APP_BASE_API = 'http://192.168.110.149:8899' -#曾涛 -# VITE_APP_BASE_API = 'http://192.168.110.171:8899' +# VITE_APP_BASE_API = 'http://192.168.110.180:8899' # 无人机接口地址 diff --git a/public/catalog.xlsx b/public/catalog.xlsx new file mode 100644 index 0000000..7ebf378 Binary files /dev/null and b/public/catalog.xlsx differ diff --git a/public/enterRoad.xlsx b/public/enterRoad.xlsx new file mode 100644 index 0000000..b7f00ac Binary files /dev/null and b/public/enterRoad.xlsx differ diff --git a/public/landBlock.xlsx b/public/landBlock.xlsx new file mode 100644 index 0000000..25d39e0 Binary files /dev/null and b/public/landBlock.xlsx differ diff --git a/src/App.vue b/src/App.vue index c641c7d..a0780e4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -19,3 +19,11 @@ onMounted(() => { }); }); + diff --git a/src/api/contract/index.ts b/src/api/contract/index.ts index a5124c1..84e4e07 100644 --- a/src/api/contract/index.ts +++ b/src/api/contract/index.ts @@ -91,3 +91,11 @@ export const getDetailsList = (query: any): AxiosPromise => { params: query }); }; + +//获取版本详情 +export const getVersionDetails = (id: any): AxiosPromise => { + return request({ + url: '/tender/tenderPlanLimitList/getVersionDetail/' + id, + method: 'get' + }); +}; diff --git a/src/api/design/appointment/index.ts b/src/api/design/appointment/index.ts index 61fdca8..9deefc3 100644 --- a/src/api/design/appointment/index.ts +++ b/src/api/design/appointment/index.ts @@ -27,3 +27,11 @@ export const systemUserList = (query) => { params: query }); }; +// 查询 +export const desUserList = (query) => { + return request({ + url: '/design/drawingreviewReceipts/desUser/list', + method: 'get', + params: query + }); +}; diff --git a/src/api/design/drawingreview/index.ts b/src/api/design/drawingreview/index.ts index d28e0be..7ed39e6 100644 --- a/src/api/design/drawingreview/index.ts +++ b/src/api/design/drawingreview/index.ts @@ -56,7 +56,7 @@ export const fillOutTheDesignVerificationForm = (data) => { export const drawingreviewReceipts = (data) => { return request({ url: '/design/drawingreviewReceipts', - method: 'post', + method: 'put', data }); }; @@ -96,3 +96,10 @@ export const drawingreview = (id) => { method: 'get' }); }; +// 获取单据 +export const getDrawingreviewReceipts = (id) => { + return request({ + url: '/design/drawingreviewReceipts/review/' + id, + method: 'get' + }); +}; diff --git a/src/api/formalities/formalitiesAreConsolidated/index.ts b/src/api/formalities/formalitiesAreConsolidated/index.ts index 218187c..f6db0c1 100644 --- a/src/api/formalities/formalitiesAreConsolidated/index.ts +++ b/src/api/formalities/formalitiesAreConsolidated/index.ts @@ -5,6 +5,7 @@ import { FormalitiesAreConsolidatedForm, FormalitiesAreConsolidatedQuery } from '@/api/formalities/formalitiesAreConsolidated/types'; +import { ListOfFormalitiesQuery, ListOfFormalitiesVO } from '../listOfFormalities/types'; /** * 查询合规性手续合账列表 @@ -101,3 +102,17 @@ export const delFormalitiesAnnex = (id: string | number | Array method: 'delete' }); }; + +/** + * 查询手续办理清单模板属性列表 + * @param query + * @returns {*} + */ + +export const getTemplateTreeList = (query?: any): AxiosPromise => { + return request({ + url: '/formalities/formalitiesAreConsolidated/getTree', + method: 'get', + params: query + }); +}; diff --git a/src/api/formalities/listOfFormalities/index.ts b/src/api/formalities/listOfFormalities/index.ts index 427f8d8..61fcba2 100644 --- a/src/api/formalities/listOfFormalities/index.ts +++ b/src/api/formalities/listOfFormalities/index.ts @@ -75,3 +75,12 @@ export const getWhetherItExists = (id: string | number): AxiosPromise => { + return request({ + url: '/formalities/formalitiesAreConsolidated/addFormalities', + method: 'post', + data + }); +}; diff --git a/src/api/largeScreen/index.ts b/src/api/largeScreen/index.ts index 1a0da4c..87acda0 100644 --- a/src/api/largeScreen/index.ts +++ b/src/api/largeScreen/index.ts @@ -15,7 +15,7 @@ export const totalAmount = () => { /** * 查询项目位置列表 * - */ export const projectGis = (clientid) => { + */ export const projectGis = (clientid?: any) => { return request({ url: '/money/big/screen/project/gis', method: 'get', @@ -57,7 +57,8 @@ export const totalAmount = () => { /** * 支出合同分析 * - */ export const expensesAnalyze = (clientid) => { + */ +export const expensesAnalyze = (clientid) => { return request({ url: '/money/big/screen/expenses/analyze', method: 'get', @@ -79,14 +80,14 @@ export const totalAmount = () => { export const monthMoney = () => { return request({ url: '/money/big/screen/monthMoney', - method: 'get', + method: 'get' }); }; // 现金流 export const monthCash = () => { return request({ url: '/money/big/screen/monthCash', - method: 'get', + method: 'get' }); }; // 现金流总和 @@ -94,6 +95,6 @@ export const monthCash = () => { export const cashTotal = () => { return request({ url: '/money/big/screen/cashTotal', - method: 'get', + method: 'get' }); }; diff --git a/src/api/materials/batchPlan/index.ts b/src/api/materials/batchPlan/index.ts index c9231af..5b9690b 100644 --- a/src/api/materials/batchPlan/index.ts +++ b/src/api/materials/batchPlan/index.ts @@ -160,3 +160,13 @@ export const obtainTheVersion = (query: any) => { params: query }); }; +/** + * 获取到物资剩余量 + */ +export const mrpBaseRemaining = (query: any) => { + return request({ + url: '/cailiaoshebei/mrpBase/remaining', + method: 'get', + params: query + }); +}; diff --git a/src/api/materials/materialIssue/index.ts b/src/api/materials/materialIssue/index.ts index a366fa6..99af31a 100644 --- a/src/api/materials/materialIssue/index.ts +++ b/src/api/materials/materialIssue/index.ts @@ -68,3 +68,10 @@ export const getMaterialName = (id: any) => { method: 'get' }); }; +//获取出库记录 +export const inventoryList = (id: any) => { + return request({ + url: '/materials/materialIssue/inventory/list/' + id, + method: 'get' + }); +}; diff --git a/src/api/materials/materialReceive/index.ts b/src/api/materials/materialReceive/index.ts index 0e9f582..376e804 100644 --- a/src/api/materials/materialReceive/index.ts +++ b/src/api/materials/materialReceive/index.ts @@ -61,3 +61,16 @@ export const delMaterialReceive = (id: string | number | Array) method: 'delete' }); }; +/** + * 获取合同列表数据 + * @param id + */ +export const getContractNameList = (id: string | number | Array) => { + return request({ + url: '/materials/materialReceive/ctrList', + params: { + projectId: id + }, + method: 'get' + }); +}; diff --git a/src/api/menu.ts b/src/api/menu.ts index a3ae80e..fc1d542 100644 --- a/src/api/menu.ts +++ b/src/api/menu.ts @@ -3,9 +3,9 @@ import { AxiosPromise } from 'axios'; import { RouteRecordRaw } from 'vue-router'; // 获取路由 -export function getRouters(): AxiosPromise { +export function getRouters(id: string): AxiosPromise { return request({ - url: '/system/menu/getRouters', + url: '/system/menu/getRouters/' + id, method: 'get' }); } diff --git a/src/api/message/notice/index.ts b/src/api/message/notice/index.ts new file mode 100644 index 0000000..224934c --- /dev/null +++ b/src/api/message/notice/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { NoticeVO, NoticeForm, NoticeQuery } from '@/api/message/notice/types'; + +/** + * 查询消息列表 + * @param query + * @returns {*} + */ + +export const listNotice = (query?: NoticeQuery): AxiosPromise => { + return request({ + url: '/message/notice/list', + method: 'get', + params: query + }); +}; + +/** + * 查询消息详细 + * @param id + */ +export const getNotice = (id: string | number): AxiosPromise => { + return request({ + url: '/message/notice/' + id, + method: 'get' + }); +}; + +/** + * 新增消息 + * @param data + */ +export const addNotice = (data: NoticeForm) => { + return request({ + url: '/message/notice', + method: 'post', + data: data + }); +}; + +/** + * 修改消息 + * @param data + */ +export const updateNotice = (data: NoticeForm) => { + return request({ + url: '/message/notice', + method: 'put', + data: data + }); +}; + +/** + * 删除消息 + * @param id + */ +export const delNotice = (id: string | number | Array) => { + return request({ + url: '/message/notice/' + id, + method: 'delete' + }); +}; diff --git a/src/api/message/notice/types.ts b/src/api/message/notice/types.ts new file mode 100644 index 0000000..c38fdad --- /dev/null +++ b/src/api/message/notice/types.ts @@ -0,0 +1,156 @@ +export interface NoticeVO { + /** + * 主键ID + */ + id: string | number; + + /** + * 项目ID + */ + projectId: string | number; + + /** + * 接收通知的用户ID + */ + recipientId: string | number; + + /** + * 发送通知的用户ID(系统通知 0) + */ + senderId: string | number; + + /** + * 配置id + */ + configId: string | number; + + /** + * 详情id + */ + detailId: string | number; + + /** + * 通知内容 + */ + content: string; + + /** + * 查看状态(0未读 1已读) + */ + viewStatus: string; + + /** + * 查看时间 + */ + viewTime: string; + + /** + * 备注 + */ + remark: string; + +} + +export interface NoticeForm extends BaseEntity { + /** + * 主键ID + */ + id?: string | number; + + /** + * 项目ID + */ + projectId?: string | number; + + /** + * 接收通知的用户ID + */ + recipientId?: string | number; + + /** + * 发送通知的用户ID(系统通知 0) + */ + senderId?: string | number; + + /** + * 配置id + */ + configId?: string | number; + + /** + * 详情id + */ + detailId?: string | number; + + /** + * 通知内容 + */ + content?: string; + + /** + * 查看状态(0未读 1已读) + */ + viewStatus?: string; + + /** + * 查看时间 + */ + viewTime?: string; + + /** + * 备注 + */ + remark?: string; + +} + +export interface NoticeQuery extends PageQuery { + + /** + * 项目ID + */ + projectId?: string | number; + + /** + * 接收通知的用户ID + */ + recipientId?: string | number; + + /** + * 发送通知的用户ID(系统通知 0) + */ + senderId?: string | number; + + /** + * 配置id + */ + configId?: string | number; + + /** + * 详情id + */ + detailId?: string | number; + + /** + * 通知内容 + */ + content?: string; + + /** + * 查看状态(0未读 1已读) + */ + viewStatus?: string; + + /** + * 查看时间 + */ + viewTime?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/api/progress/progressCategory/index.ts b/src/api/progress/progressCategory/index.ts index ed4bb07..1f593bb 100644 --- a/src/api/progress/progressCategory/index.ts +++ b/src/api/progress/progressCategory/index.ts @@ -8,11 +8,10 @@ import { ProgressCategoryVO, ProgressCategoryForm, ProgressCategoryQuery } from * @returns {*} */ -export const listProgressCategory = (query?: ProgressCategoryQuery): AxiosPromise => { +export const listProgressCategory = (id?: string | number): AxiosPromise => { return request({ - url: '/progress/progressCategory/list', - method: 'get', - params: query + url: '/progress/progressCategory/listByParent/' + id, + method: 'get' }); }; @@ -70,3 +69,30 @@ export const downloadProgressCategory = (data) => { data }); }; + +/** + * 查询分项工程单价下拉树结构 + * @param query + * @returns {*} + */ +export const getCategoryTabList = (id?: string | number): AxiosPromise => { + return request({ + url: '/progress/progressCategory/listTopBySubProjectId/' + id, + method: 'get' + }); +}; + +/** + * 查询分项工程单价外层结构 + * @param query + * @returns {*} + */ +export const getCategoryList = (id?: string | number): AxiosPromise => { + return request({ + url: '/progress/progressCategory/list', + method: 'get', + params: { + parentId: id + } + }); +}; diff --git a/src/api/progress/progressCategory/types.ts b/src/api/progress/progressCategory/types.ts index c24a173..07aaa4f 100644 --- a/src/api/progress/progressCategory/types.ts +++ b/src/api/progress/progressCategory/types.ts @@ -97,6 +97,8 @@ export interface ProgressCategoryForm extends BaseEntity { id?: string | number; constructionPrice?: string | number; ownerPrice?: string | number; + relevancyStructure?: string; + /** * 父类别id */ diff --git a/src/api/progress/progressCategoryTemplate/index.ts b/src/api/progress/progressCategoryTemplate/index.ts index 3e80694..86e86e1 100644 --- a/src/api/progress/progressCategoryTemplate/index.ts +++ b/src/api/progress/progressCategoryTemplate/index.ts @@ -1,6 +1,10 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; -import { ProgressCategoryTemplateVO, ProgressCategoryTemplateForm, ProgressCategoryTemplateQuery } from '@/api/progress/progressCategoryTemplate/types'; +import { + ProgressCategoryTemplateVO, + ProgressCategoryTemplateForm, + ProgressCategoryTemplateQuery +} from '@/api/progress/progressCategoryTemplate/types'; /** * 查询进度类别模版列表 @@ -61,3 +65,22 @@ export const delProgressCategoryTemplate = (id: string | number | Array { + return request({ + url: '/progress/progressCategoryTemplate/listSystemTop/' + id, + method: 'get' + }); +}; + +/** + * 筛选查询进度类别模版列表 + * @param parentId + * @returns {*} + */ +export const listProgressCategoryTemplateByParent = (parentId: string | number): AxiosPromise => { + return request({ + url: '/progress/progressCategoryTemplate/listByParent/' + parentId, + method: 'get' + }); +}; diff --git a/src/api/progress/progressCategoryTemplate/types.ts b/src/api/progress/progressCategoryTemplate/types.ts index 66ee461..1d6a507 100644 --- a/src/api/progress/progressCategoryTemplate/types.ts +++ b/src/api/progress/progressCategoryTemplate/types.ts @@ -12,7 +12,7 @@ export interface ProgressCategoryTemplateVO { * 计量方式(0无 1数量 2百分比) */ unitType: string; - + parentId?: string | number; /** * 工作类型 */ @@ -39,7 +39,9 @@ export interface ProgressCategoryTemplateForm extends BaseEntity { * 主键id */ id?: string | number; - + parentId?: string | number; + constructionType?: string; + relevancyStructure?: string; /** * 父类别id */ @@ -76,7 +78,8 @@ export interface ProgressCategoryTemplateQuery { * 父类别id */ pid?: string | number; - + parentId?: string | number; + constructionType?: string; /** * 类别名称 */ diff --git a/src/api/project/contractor/types.ts b/src/api/project/contractor/types.ts index f041fa6..0d4ab3f 100644 --- a/src/api/project/contractor/types.ts +++ b/src/api/project/contractor/types.ts @@ -28,10 +28,10 @@ export interface ContractorVO { * 管理人联系电话 */ custodianPhone: string; - /** + /** * 分包类型 */ - contractorType?: string; + contractorType?: string; /** * 公司相关文件 @@ -54,6 +54,14 @@ export interface ContractorForm extends BaseEntity { * 主键id */ id?: string | number; + /** + * 供应商id + */ + supplierId?: string | number; + /** + * 供应商 + */ + supplier?: string; /** * 主键id @@ -127,10 +135,10 @@ export interface ContractorQuery extends PageQuery { * 管理人联系电话 */ custodianPhone?: string; - /** + /** * 分包类型 */ - contractorType?: string; + contractorType?: string; /** * 日期范围参数 diff --git a/src/api/project/project/index.ts b/src/api/project/project/index.ts index 5b76894..04d5b65 100644 --- a/src/api/project/project/index.ts +++ b/src/api/project/project/index.ts @@ -186,3 +186,14 @@ export const uploadProjectFile = (data: any) => { data: data }); }; + +/** + * 切换项目 + * @param id + */ +export const changeProject = (id: string | number) => { + return request({ + url: '/project/project/changeProject/' + id, + method: 'get' + }); +}; diff --git a/src/api/supplierInput/supplierInput/index.ts b/src/api/supplierInput/supplierInput/index.ts index 719aa11..834b072 100644 --- a/src/api/supplierInput/supplierInput/index.ts +++ b/src/api/supplierInput/supplierInput/index.ts @@ -8,7 +8,7 @@ import { SupplierInputVO, SupplierInputForm, SupplierInputQuery } from '@/api/su * @returns {*} */ -export const listSupplierInput = (query?: SupplierInputQuery): AxiosPromise => { +export const listSupplierInput = (query?: any): AxiosPromise => { return request({ url: '/supplierInput/supplierInput/list', method: 'get', diff --git a/src/api/system/landTransfer/enterRoad/index.ts b/src/api/system/landTransfer/enterRoad/index.ts index c3e093c..a575127 100644 --- a/src/api/system/landTransfer/enterRoad/index.ts +++ b/src/api/system/landTransfer/enterRoad/index.ts @@ -61,3 +61,12 @@ export const delEnterRoad = (id: string | number | Array) => { method: 'delete' }); }; + +// 道路信息导入 +export const importEnterRoad = (projectId: any, data: any) => { + return request({ + url: '/land/enterRoad/upload/' + projectId, + method: 'post', + data: data + }); +}; \ No newline at end of file diff --git a/src/api/system/landTransfer/landBlock/index.ts b/src/api/system/landTransfer/landBlock/index.ts index d543334..06e3aad 100644 --- a/src/api/system/landTransfer/landBlock/index.ts +++ b/src/api/system/landTransfer/landBlock/index.ts @@ -76,3 +76,12 @@ export const delLandBlock = (id: string | number | Array) => { method: 'delete' }); }; + +// 地块信息导入 +export const importLandBlock = (projectId:any,data: any) => { + return request({ + url: '/land/landBlock/upload/'+projectId, + method: 'post', + data: data + }); +}; diff --git a/src/api/system/landTransfer/landTransferLedger/index.ts b/src/api/system/landTransfer/landTransferLedger/index.ts index 2fdefb9..fbd949e 100644 --- a/src/api/system/landTransfer/landTransferLedger/index.ts +++ b/src/api/system/landTransfer/landTransferLedger/index.ts @@ -69,3 +69,13 @@ export const delLandTransferLedger = (id: string | number | Array) => { + return request({ + url: '/land/landTransferLedger/count/' + id, + method: 'get' + }); +}; diff --git a/src/api/system/menu/index.ts b/src/api/system/menu/index.ts index 7a0cf74..15cf1b5 100644 --- a/src/api/system/menu/index.ts +++ b/src/api/system/menu/index.ts @@ -68,3 +68,11 @@ export const delMenu = (menuId: string | number) => { method: 'delete' }); }; + +// 获取所有路由 +export const getAllRouters = () => { + return request({ + url: '/system/menu/getAllRouters', + method: 'get' + }); +}; diff --git a/src/api/system/post/index.ts b/src/api/system/post/index.ts index a910be8..54a64b2 100644 --- a/src/api/system/post/index.ts +++ b/src/api/system/post/index.ts @@ -75,3 +75,11 @@ export function getRoleList(deptId?: number | string): AxiosPromise { } }); } + +// 获取部门下的项目列表 +export function getProjectByDeptId(deptId?: number | string): AxiosPromise { + return request({ + url: '/system/dept/projectIdList/' + deptId, + method: 'get' + }); +} diff --git a/src/api/system/user/types.ts b/src/api/system/user/types.ts index 4bdca11..88461ad 100644 --- a/src/api/system/user/types.ts +++ b/src/api/system/user/types.ts @@ -60,19 +60,20 @@ export interface UserForm { nickName?: string; password: string; phonenumber?: string; + projectRoles?: any[]; email?: string; sex?: string; status: string; remark?: string; postIds: string[]; - roleIds: string[]; filePath?: string; } export interface UserInfoVO { user: UserVO; roles: RoleVO[]; - roleIds: string[]; + + projectRoles: any[]; posts: PostVO[]; postIds: string[]; roleGroup: string; diff --git a/src/api/tender/index.ts b/src/api/tender/index.ts index 10a75dd..5b45d9a 100644 --- a/src/api/tender/index.ts +++ b/src/api/tender/index.ts @@ -122,11 +122,10 @@ export const editStatus = (query: any): AxiosPromise => { data: query }); }; -//获取审核状态 -export const getApproval = (id) => { +//获取版本详情 +export const getVersionDetail = (id: any) => { return request({ - url: '/tender/tenderPlanLimitList/getVersionDetail', - method: 'get', - params: { versions: id } + url: '/tender/tenderPlanLimitList/getVersionDetail/' + id, + method: 'get' }); }; diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue index 5011b9d..265c016 100644 --- a/src/components/FileUpload/index.vue +++ b/src/components/FileUpload/index.vue @@ -11,6 +11,7 @@ :on-exceed="handleExceed" :on-success="handleUploadSuccess" :show-file-list="showFileList" + :on-preview="handlePreview" :headers="headers" class="upload-file-uploader" :list-type="isConstruction ? 'picture-card' : 'text'" @@ -48,7 +49,13 @@ tag="ul" @click.stop > -
  • +
  • {{ getFileName(file.name) }} @@ -213,31 +220,27 @@ watch( ); // 上传前校检格式和大小 const handleBeforeUpload = (file: any) => { - // 校检文件类型 - if (props.fileType.length) { - const fileName = file.name.split('.'); - const fileExt = fileName[fileName.length - 1]; - const isTypeOk = props.fileType.indexOf(fileExt) >= 0; - if (!isTypeOk) { - proxy?.$modal.msgError(`文件格式不正确, 请上传${props.fileType.join('/')}格式文件!`); - return false; - } + if (!validateFile(file)) return false; + proxy?.$modal.loading('正在上传文件,请稍候...'); + number.value++; + return true; +}; + +//校检格式和大小 +const validateFile = (file: File) => { + const ext = file.name.split('.').pop()?.toLowerCase(); + if (props.fileType.length && !props.fileType.includes(ext!)) { + proxy?.$modal.msgError(`文件格式不正确,请上传 ${props.fileType.join('/')} 格式文件!`); + return false; } - // 校检文件名是否包含特殊字符 if (file.name.includes(',')) { proxy?.$modal.msgError('文件名不正确,不能包含英文逗号!'); return false; } - // 校检文件大小 - if (props.fileSize) { - const isLt = file.size / 1024 / 1024 < props.fileSize; - if (!isLt) { - proxy?.$modal.msgError(`上传文件大小不能超过 ${props.fileSize} MB!`); - return false; - } + if (props.fileSize && file.size / 1024 / 1024 > props.fileSize) { + proxy?.$modal.msgError(`上传文件大小不能超过 ${props.fileSize} MB!`); + return false; } - proxy?.$modal.loading('正在上传文件,请稍候...'); - number.value++; return true; }; @@ -278,13 +281,25 @@ const handleUploadSuccess = (res: any, file: UploadFileWithOssId) => { uploadedSuccessfully(res); }; -const handleChange = (file: any, fileList: any) => { +const handleChange = (file: any, filelist: any) => { + if (!props.autoUpload) { + // 手动上传模式:在选中文件时拦截非法文件 + const isValid = validateFile(file.raw || file); + if (!isValid) { + fileUploadRef.value?.handleRemove(file); // 直接移除非法文件 + console.log(file, filelist, fileList.value); + fileList.value = [...fileList.value]; // 触发列表更新 + return; + } + } // 记录 status = 'ready' 的文件 if (file.status === 'ready') { pendingFiles.value.push(file); + fileList.value = pendingFiles.value; } + console.log(fileList.value); - emit('handleChange', file, fileList); + emit('handleChange', file, filelist); }; // 删除文件 @@ -294,6 +309,12 @@ const handleRemove = (file: any, fileList: any) => { emit('handleRemove', file, fileList); }; +const handlePreview = (file: any) => { + if (file.url) { + window.open(file.url); + } +}; + // 删除文件 const handleDelete = async (index: string | number, type?: string) => { await proxy?.$modal.confirm('是否确认删除此文件?').finally(); @@ -332,11 +353,6 @@ const uploadedSuccessfully = (res: any) => { emit('update:modelValue', listToString(fileList.value)); proxy?.$modal.closeLoading(); } - // if (props.autoUpload && props.limit === fileList.value.length) { - // fileUploadRef.value?.clearFiles(); - // fileList.value = []; - // emit('update:modelValue', ''); // 同步到外部 v-model - // } props.onUploadSuccess?.(fileList.value, res); }; @@ -400,6 +416,11 @@ const submitUpload = async () => { if (!pendingFiles.value.length) { return 'noFile'; } + const validFiles = pendingFiles.value.filter((f: any) => validateFile(f.raw || f)); + if (!validFiles.length) { + proxy?.$modal.msgError('没有符合条件的文件可上传'); + return; + } try { proxy?.$modal.loading('正在上传文件,请稍候...'); const formData = new FormData(); diff --git a/src/components/Process/submitVerify.vue b/src/components/Process/submitVerify.vue index 03000a9..f678b11 100644 --- a/src/components/Process/submitVerify.vue +++ b/src/components/Process/submitVerify.vue @@ -185,6 +185,10 @@ const props = defineProps({ taskVariables: { type: Object as () => Record, default: () => {} + }, + businessId1: { + type: String, + default: '' } }); //遮罩层 @@ -336,6 +340,9 @@ const handleCompleteTask = async () => { } if (isDrawing.value) { isShowSubmit.value = true; + nextTick(() => { + detailFormTeRef.value.getInfo(props.businessId1); + }); return; } await proxy?.$modal.confirm('是否确认提交?'); @@ -538,6 +545,9 @@ const handleTermination = async () => { const handleTerminationTask = async () => { if (isDrawing.value) { isShowTermination.value = true; + nextTick(() => { + detailFormTeRef.value.getInfo(props.businessId); + }); return; } const params = { diff --git a/src/components/ProjectSelector/index.vue b/src/components/ProjectSelector/index.vue index 5ba301d..1259482 100644 --- a/src/components/ProjectSelector/index.vue +++ b/src/components/ProjectSelector/index.vue @@ -1,5 +1,5 @@ , @@ -49,7 +55,22 @@ const props = defineProps({ default: '' } }); +const total = ref(0); +onMounted(() => { + if (onlyOneChild.value.meta?.title == '我的待办' || props.item.meta?.title == '我的任务') { + console.log(44444444); + getWaitingList(); + } +}); +// 获取我的待办 +//分页 +const getWaitingList = () => { + pageByTaskWait({ pageNum: 1, pageSize: 10 }).then((resp) => { + console.log(resp); + total.value = resp.total; + }); +}; const onlyOneChild = ref({}); const hasOneShowingChild = (parent: RouteRecordRaw, children?: RouteRecordRaw[]) => { @@ -64,12 +85,12 @@ const hasOneShowingChild = (parent: RouteRecordRaw, children?: RouteRecordRaw[]) return true; }); - // When there is only one child router, the child router is displayed by default + // 只有一个子路由时默认显示子路由 if (showingChildren.length === 1) { return true; } - // Show parent if there are no child router to display + // 没有子路由可显示时显示父路由 if (showingChildren.length === 0) { onlyOneChild.value = { ...parent, path: '', noShowingChildren: true }; return true; @@ -98,4 +119,49 @@ const hasTitle = (title: string | undefined): string => { } return title; }; +//用深度监听 消息 +watch( + () => noticeStore.state.value.notices, + (newVal) => { + if (onlyOneChild.value.meta?.title == '我的待办') { + console.log(121212121); + + let time = setTimeout(() => { + getWaitingList(); + clearTimeout(time); + }, 500); + } + }, + { deep: true } +); + + diff --git a/src/layout/components/notice/index.vue b/src/layout/components/notice/index.vue index 78ca0c8..3d6afc9 100644 --- a/src/layout/components/notice/index.vue +++ b/src/layout/components/notice/index.vue @@ -51,11 +51,12 @@ const getTableData = async () => { //点击消息,写入已读 const onNewsClick = (item: any) => { newsList.value[item].read = true; + console.log('🚀 ~ onNewsClick ~ newsList.value[item]:', newsList.value[item]); //并且写入pinia noticeStore.state.value.notices = newsList.value; //如果有formPath,就前往 if (newsList.value[item].route) { - proxy?.$tab.openPage('/' + newsList.value[item].route, '', { id: newsList.value[item].detailId, type: 'view' }); + proxy?.$tab.openPage(newsList.value[item].route, '', { id: newsList.value[item].detailId, type: 'view' }); } }; diff --git a/src/permission.ts b/src/permission.ts index 9e4507a..6162675 100644 --- a/src/permission.ts +++ b/src/permission.ts @@ -1,3 +1,4 @@ +import $cache from '@/plugins/cache'; import { to as tos } from 'await-to-js'; import router from './router'; import NProgress from 'nprogress'; @@ -9,6 +10,8 @@ import useUserStore from '@/store/modules/user'; import useSettingsStore from '@/store/modules/settings'; import usePermissionStore from '@/store/modules/permission'; +let isFirst = false; + NProgress.configure({ showSpinner: false }); const whiteList = ['/login', '/register', '/social-callback', '/register*', '/register/*', '/materials/purchaseDoc/uploadCode']; @@ -16,54 +19,64 @@ const isWhiteList = (path: string) => { return whiteList.some((pattern) => isPathMatch(pattern, path)); }; -router.beforeEach(async (to, from, next) => { +router.beforeEach(async (to, from) => { NProgress.start(); - if (to.path == '/indexEquipment' || to.path == '/materials/purchaseDoc/uploadCode' || to.path == '/codeDetail') { - next(); - } else if (getToken()) { - to.meta.title && useSettingsStore().setTitle(to.meta.title); - /* has token*/ - if (to.path === '/login') { - next({ path: '/' }); - NProgress.done(); - } else if (isWhiteList(to.path)) { - next(); - } else { - if (useUserStore().roles.length === 0) { - isRelogin.show = true; - // 判断当前用户是否已拉取完user_info信息 - const [err] = await tos(useUserStore().getInfo()); - if (err) { - await useUserStore().logout(); - ElMessage.error(err); - next({ path: '/' }); - } else { - isRelogin.show = false; - const accessRoutes = await usePermissionStore().generateRoutes(); - // 根据roles权限生成可访问的路由表 - accessRoutes.forEach((route) => { - if (!isHttp(route.path)) { - router.addRoute(route); // 动态添加可访问路由表 - } - }); - // @ts-expect-error hack方法 确保addRoutes已完成 - next({ path: to.path, replace: true, params: to.params, query: to.query, hash: to.hash, name: to.name as string }); // hack方法 确保addRoutes已完成 - } - } else { - next(); - } - } - } else { - // 没有token - if (isWhiteList(to.path)) { - // 在免登录白名单,直接进入 - next(); - } else { - const redirect = encodeURIComponent(to.fullPath || '/'); - next(`/login?redirect=${redirect}`); // 否则全部重定向到登录页 - NProgress.done(); - } + + // 特殊页面放行 + if (['/indexEquipment', '/materials/purchaseDoc/uploadCode', '/codeDetail'].includes(to.path)) { + return true; } + + // 已登录 + if (getToken()) { + if (to.meta.title) useSettingsStore().setTitle(to.meta.title); + + if (to.path === '/login') { + NProgress.done(); + return { path: '/' }; + } + + if (isWhiteList(to.path)) { + return true; + } + if ((!isFirst && useUserStore().roles.length === 0) || $cache.local.getJSON('isCheckRole') === 'true') { + isFirst = true; + isRelogin.show = true; + + const [err] = await tos(useUserStore().getInfo()); + + if (err) { + await useUserStore().logout(); + ElMessage.error(err); + NProgress.done(); + return { path: '/' }; + } + + isRelogin.show = false; + const accessRoutes = await usePermissionStore().generateRoutes(); + accessRoutes.forEach((route) => { + if (!isHttp(route.path)) router.addRoute(route); + }); + + $cache.local.remove('isCheckRole'); + + // 确保路由已添加后再跳转 + return { ...to, replace: true }; + } + + return true; + } else { + isFirst = false; + } + + // 未登录 + if (isWhiteList(to.path)) { + return true; + } + + const redirect = encodeURIComponent(to.fullPath || '/'); + NProgress.done(); + return { path: `/login?redirect=${redirect}` }; }); router.afterEach(() => { diff --git a/src/router/index.ts b/src/router/index.ts index a14689d..083d2d1 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,6 +1,7 @@ import { createWebHistory, createRouter, RouteRecordRaw } from 'vue-router'; /* Layout */ import Layout from '@/layout/index.vue'; +import usePermissionStore from '@/store/modules/permission'; /** * Note: 路由配置项 @@ -65,11 +66,7 @@ export const constantRoutes: RouteRecordRaw[] = [ component: () => import('@/views/register.vue'), hidden: true }, - { - path: '/:pathMatch(.*)*', - component: () => import('@/views/error/404.vue'), - hidden: true - }, + { path: '/401', component: () => import('@/views/error/401.vue'), @@ -134,10 +131,16 @@ export const constantRoutes: RouteRecordRaw[] = [ component: () => import('@/views/gis2D/index.vue'), hidden: true }, + { path: '/materials/purchaseDoc/uploadCode', component: () => import('@/views/materials/purchaseDoc/uploadCode.vue'), hidden: true + }, + { + path: '/:pathMatch(.*)*', + component: () => import('@/views/error/404.vue'), + hidden: true } ]; @@ -231,3 +234,11 @@ const router = createRouter({ }); export default router; + +export function resetRouter() { + router.getRoutes().forEach((route) => { + if (route.name && !constantRoutes.find((r) => r.name === route.name)) { + router.hasRoute(route.name) && router.removeRoute(route.name); + } + }); +} diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index 43fcef8..7efcf2d 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -10,6 +10,7 @@ import ParentView from '@/components/ParentView/index.vue'; import InnerLink from '@/layout/components/InnerLink/index.vue'; import { createCustomNameComponent } from '@/utils/createCustomNameComponent'; +import { useUserStoreHook } from './user'; // 匹配views里面所有的.vue文件 const modules = import.meta.glob('./../../views/**/*.vue'); @@ -44,7 +45,7 @@ export const usePermissionStore = defineStore('permission', () => { sidebarRouters.value = routes; }; const generateRoutes = async (): Promise => { - const res = await getRouters(); + const res = await getRouters(useUserStoreHook().selectedProject?.id || '0'); const { data } = res; const sdata = JSON.parse(JSON.stringify(data)); const rdata = JSON.parse(JSON.stringify(data)); diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index e62d8ae..086d45c 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -28,7 +28,6 @@ const getSelectedProjectFromStorage = () => { const getProjectTeamListFromStorage = () => { const stored = $cache.local.getJSON('ProjectTeamList'); console.log('获取缓存的项目班组列表:', stored); - return stored ? stored : null; }; @@ -41,7 +40,9 @@ export const useUserStore = defineStore('user', () => { const deptId = ref(''); const avatar = ref(''); const roles = ref>([]); // 用户角色编码集合 → 判断路由权限 - const permissions = ref>([]); // 用户权限编码集合 → 判断按钮权限 + const permissions = ref>([]); // 用户权限编码集合 → 判断按钮权限 + const permissionList = ref>([]); // 用户所有权限列表 + const roleList = ref>([]); // 用户所有角色列表 const projects = ref>([]); // 从localStorage获取缓存的项目,如果没有则默认为null @@ -66,15 +67,32 @@ export const useUserStore = defineStore('user', () => { // 获取用户信息 const getInfo = async (): Promise => { + // **新增项目数据获取** + const [projectErr, projectRes] = await to(getUserProject()); + if (projectRes?.data) { + const projectList = projectRes.data.map((p) => ({ + id: p.projectId, + name: p.projectName || '未知项目' + })); + setProjects(projectList); + // 如果有缓存的选中项目,且该项目在当前项目列表中存在,则使用缓存的项目 + const storedProject = getSelectedProjectFromStorage(); + if (storedProject && projectList.some((p) => p.id === storedProject.id)) { + setSelectedProject(storedProject); + } else if (projectList.length > 0) { + // 否则默认选择第一个项目 + setSelectedProject(projectList[0]); + } + } const [err, res] = await to(getUserInfo()); if (res) { const data = res.data; const user = data.user; const profile = user.avatar == '' || user.avatar == null ? defAva : user.avatar; - if (data.roles && data.roles.length > 0) { - roles.value = data.roles; - permissions.value = data.permissions; + permissionList.value = data.permissions; + roleList.value = data.roles; + setRoles(); } else { roles.value = ['ROLE_DEFAULT']; } @@ -85,30 +103,38 @@ export const useUserStore = defineStore('user', () => { tenantId.value = user.tenantId; deptId.value = user.deptId; - // **新增项目数据获取** - const [projectErr, projectRes] = await to(getUserProject()); - if (projectRes?.data) { - const projectList = projectRes.data.map((p) => ({ - id: p.projectId, - name: p.projectName || '未知项目' - })); - - setProjects(projectList); - - // 如果有缓存的选中项目,且该项目在当前项目列表中存在,则使用缓存的项目 - const storedProject = getSelectedProjectFromStorage(); - if (storedProject && projectList.some((p) => p.id === storedProject.id)) { - setSelectedProject(storedProject); - } else if (projectList.length > 0) { - // 否则默认选择第一个项目 - setSelectedProject(projectList[0]); - } - } - return Promise.resolve(); } return Promise.reject(err); }; + const setInfo = async () => { + const [err, res] = await to(getUserInfo()); + if (res) { + const data = res.data; + const user = data.user; + const profile = user.avatar == '' || user.avatar == null ? defAva : user.avatar; + if (data.roles && data.roles.length > 0) { + permissionList.value = data.permissions; + roleList.value = data.roles; + setRoles(); + } else { + roles.value = ['ROLE_DEFAULT']; + } + name.value = user.userName; + nickname.value = user.nickName; + avatar.value = profile; + userId.value = user.userId; + tenantId.value = user.tenantId; + deptId.value = user.deptId; + } + }; + + const setRoles = () => { + const projectRole = roleList.value.find((item) => item.projectId == selectedProject.value?.id)?.projectRoles || []; + roles.value = projectRole; + const projectPermissions = permissionList.value.find((item) => item.projectId == selectedProject.value?.id)?.projectPermissions || []; + permissions.value = projectPermissions; + }; // 注销 const logout = async (): Promise => { @@ -158,7 +184,9 @@ export const useUserStore = defineStore('user', () => { setProjectTeamList, projects, selectedProject, - ProjectTeamList + ProjectTeamList, + setInfo, + setRoles }; }); diff --git a/src/utils/sse.ts b/src/utils/sse.ts index 464727c..897d3ac 100644 --- a/src/utils/sse.ts +++ b/src/utils/sse.ts @@ -20,7 +20,6 @@ export const initSSE = (url: any) => { }); watch(error, () => { - console.log('SSE connection error:', error.value); error.value = null; }); @@ -31,9 +30,12 @@ export const initSSE = (url: any) => { try { if (JSON.parse(data.value)) { const obj = JSON.parse(data.value); - route1 = obj.route; - label = obj.message; - detailId = obj.detailId; + route1 = obj.type; + if (obj.type == 'count') { + return; + } + label = obj.content; + // detailId = obj.detailId; data.value = null; } } catch (error) { diff --git a/src/views/biddingManagemen/appointment/index.vue b/src/views/biddingManagemen/appointment/index.vue index ce519ad..c71349c 100644 --- a/src/views/biddingManagemen/appointment/index.vue +++ b/src/views/biddingManagemen/appointment/index.vue @@ -10,12 +10,11 @@ @click="isDisabled = false" class="px-8 py-2.5 transition-all duration-300 font-medium" v-if="isDisabled" - v-hasPermi="['cailiaoshebei:purchaseUser:addOrUpdate']" + v-hasPermi="['bidding:biddingUser:add']" > 点击编辑 - @@ -30,7 +29,6 @@ -
    确认提交 @@ -53,22 +51,14 @@ diff --git a/src/views/biddingManagemen/listOfWinningBids/index.vue b/src/views/biddingManagemen/listOfWinningBids/index.vue index 02a45c0..47210c6 100644 --- a/src/views/biddingManagemen/listOfWinningBids/index.vue +++ b/src/views/biddingManagemen/listOfWinningBids/index.vue @@ -1,8 +1,7 @@