diff --git a/src/views/partner/api/file.js b/src/views/partner/api/file.js index 2ac0661..9c50009 100644 --- a/src/views/partner/api/file.js +++ b/src/views/partner/api/file.js @@ -8,6 +8,14 @@ export function listInspectionFile(query) { params: query }) } +// 查询inspectionFile列表(权限) +export function listByPermission(query) { + return request({ + url: '/inspectionFile/inspectionFile/listByPermission', + method: 'get', + params: query + }) +} // 根据文件id获取有权限的用户id export function getUserIdsByFileId(query) { return request({ @@ -40,6 +48,13 @@ export function getInspectionFile(id) { method: 'get' }) } +// 查询inspectionFile修改记录 +export function getFileRecord(id) { + return request({ + url: '/system/fileRecord/get/' + id, + method: 'get' + }) +} // 新增inspectionFile export function addInspectionFile(data) { diff --git a/src/views/partner/file/file.vue b/src/views/partner/file/file.vue index 6073664..7cd7b2d 100644 --- a/src/views/partner/file/file.vue +++ b/src/views/partner/file/file.vue @@ -51,49 +51,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -108,7 +65,10 @@
编辑
下载
-
分配权限
+
+ 分配权限 +
+
历史版本
删除
@@ -130,6 +90,28 @@
+ + +
+ + + + + +
+ +
+ @@ -179,7 +161,7 @@ import { getInspectionFile, delInspectionFile, addInspectionFile, - updateInspectionFile, listStaff, assignAuthority, getUserIdsByFileId + updateInspectionFile, listStaff, assignAuthority, getUserIdsByFileId, listByPermission, getFileRecord } from "../api/file"; import inspFileUpload from '@/components/FileUpload/index.vue' @@ -204,6 +186,7 @@ export default { inspectionFileList: [], // 弹出层标题 title: "", + drawer: false, // 是否显示弹出层 open: false, // 是否显示弹出层(分配权限) @@ -226,20 +209,31 @@ export default { // 员工列表 staffList: [], selectStaffList: [], - fileId: '' + fileId: '', + drawerData: {}, }; }, created() { this.getList(); + this.listByPermission() }, methods: { + formatDate(timestamp) { + if (!timestamp) return ""; + const date = new Date(timestamp); + return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, "0")}-${date.getDate().toString().padStart(2, "0")}`; + }, backFile() { if (this.fatherId) { getInspectionFile(this.fatherId).then(response => { this.queryParams.fatherId = response.data.fatherId this.fatherId = response.data.fatherId this.queryParams.pageNum = 1 - this.getList() + const data = { + fatherId: this.fatherId, + fileName: this.fatherId === '' || this.fatherId == null || this.fatherId === undefined ? this.queryParams.fileName : '' + } + this.getFolderList(data) }); } @@ -250,6 +244,28 @@ export default { this.isShow = true this.getStaffList() }, + drawerShow(id) { + getFileRecord(id).then(response => { + this.drawer = true + this.drawerData = response.data + }) + }, + /** 查询inspectionFile列表 */ + // getList() { + // this.loading = true; + // this.queryParams.params = {}; + // // if (null != this.daterangeWarnTime && '' != this.daterangeWarnTime) { + // // 123 + // // this.queryParams.params["beginWarnTime"] = this.daterangeWarnTime[0]; + // // this.queryParams.params["endWarnTime"] = this.daterangeWarnTime[1]; + // // } + // listInspectionFile(this.queryParams).then(response => { + // this.inspectionFileList = response.data; + // this.queryParams.fatherId = response.data[0].fatherId; + // // this.total = response.total; + // this.loading = false; + // }); + // }, /** 查询inspectionFile列表 */ getList() { this.loading = true; @@ -259,20 +275,20 @@ export default { // this.queryParams.params["beginWarnTime"] = this.daterangeWarnTime[0]; // this.queryParams.params["endWarnTime"] = this.daterangeWarnTime[1]; // } - listInspectionFile(this.queryParams).then(response => { - this.inspectionFileList = response.data.records; - this.queryParams.fatherId = response.data.records[0].fatherId; - this.total = response.total; + listByPermission(this.queryParams).then(response => { + this.inspectionFileList = response.data; + this.queryParams.fatherId = response.data[0].fatherId; this.loading = false; }); }, getFolderList(data) { this.loading = true; - listInspectionFile(data).then(response => { - this.inspectionFileList = response.data.records; - if (response.data.records.length > 0) { - this.queryParams.fatherId = response.data.records[0].fatherId; - this.total = response.total; + // listInspectionFile(data).then(response => { + listByPermission(data).then(response => { + this.inspectionFileList = response.data; + if (response.data.length > 0) { + this.queryParams.fatherId = response.data[0].fatherId; + // this.total = response.total; this.loading = false; } }); @@ -299,18 +315,19 @@ export default { }) }, /**根据文件id获取有权限的用户id*/ - getUserIdsByFileId(fileId){ + getUserIdsByFileId(fileId) { const data = { fileId: fileId } getUserIdsByFileId(data).then(res => { this.selectStaffList = res.data + console.log('当前文件权限', this.selectStaffList) }) }, downloadFile(item) { // 创建一个 元素 // const link = document.createElement('a'); - let href = "https://www.nuoyunr.com/minio" + item.filePath; // 文件路径 + let href = "https://www.nuoyunr.com/minio/" + item.filePath; // 文件路径 // var lastIndexOf = item.filePath.lastIndexOf("."); // link.download = item.fileName+item.filePath.substr(lastIndexOf); // 下载的文件名 window.open(href); @@ -381,6 +398,10 @@ export default { /** 提交按钮 */ submitForm() { this.$refs["form"].validate(valid => { + if (!this.form.filePath && this.form.type == "2") { + this.$modal.msgError("请上传文件"); + return false; + } if (valid) { if (this.form.id != null) { updateInspectionFile(this.form).then(response => { @@ -484,4 +505,44 @@ export default { color: #F56C6C; cursor: pointer; } +/* 增加步骤间距 */ +.custom-step { + margin-bottom: 35px; +} + +/* 统一样式容器 */ +.step-content { + display: flex; + flex-direction: column; + gap: 8px; /* 调整子元素间距 */ + padding: 5px 0; +} + +/* 时间样式 */ +.step-time { + font-size: 14px; + //color: #666; +} + +/* 文件名称高亮 */ +.step-file-name { + font-weight: bold; + font-size: 15px; +} + +/* 下载按钮样式 */ +.step-download { + font-size: 14px; + color: #409EFF; + cursor: pointer; + text-decoration: underline; +} + +.step-download:hover { + color: #307ec7; +} +/deep/.el-drawer__header { + font-size: 22px; +} +