diff --git a/src/views/notice/NoticeDetail.vue b/src/views/notice/NoticeDetail.vue index 68f3d4e..73a4a87 100644 --- a/src/views/notice/NoticeDetail.vue +++ b/src/views/notice/NoticeDetail.vue @@ -19,6 +19,11 @@
+
+ + 附件下载 + +
@@ -70,6 +75,7 @@ export default { data () { return { model: {}, + path: '', queryParam: { noticeId: this.$route.query.id, isRead: 1 }, readCount: 0, unreadCount: 0, @@ -105,14 +111,12 @@ export default { // 加载数据方法 必须为 Promise 对象 loadData1: parameter => { return noticePagePerson(Object.assign(parameter, { noticeId: this.$route.query.id, isRead: 1 })).then((res) => { - console.log(res) this.readCount = res.total return res }) }, loadData2: parameter => { return noticePagePerson(Object.assign(parameter, { noticeId: this.$route.query.id, isRead: 0 })).then((res) => { - console.log(res) this.unreadCount = res.total return res }) @@ -137,6 +141,10 @@ export default { getDetail (id) { noticeGet({ id: id }).then(res => { this.model = res.data + const fileArr = JSON.parse(res.data.file) + if (fileArr.length > 0) { + this.path = fileArr[0].url + } }) }, readNotice (id) { @@ -155,6 +163,9 @@ export default { this.$refs.table2.refresh(true) }) } + }, + download () { + window.location.href = this.path // 文件下载 } } } diff --git a/src/views/person/PersonList.vue b/src/views/person/PersonList.vue index f57d8cb..3fa08b6 100644 --- a/src/views/person/PersonList.vue +++ b/src/views/person/PersonList.vue @@ -55,7 +55,8 @@ 离职 设置管理员 导出 - 批量导入 + 导入 + 导入模板下载 @@ -63,7 +64,7 @@
- + 学员 管理员 @@ -144,7 +145,7 @@ export default { data () { return { // 查询参数 - queryParam: { isAdmin: 2 }, + queryParam: { }, // 表头 columns: [ { @@ -176,7 +177,9 @@ export default { // 加载数据方法 必须为 Promise 对象 loadData: parameter => { if (!this.orgId) return [] - return personPage(Object.assign(parameter, this.queryParam)).then((res) => { + return personPage(Object.assign(parameter, this.queryParam, + { isAdmin: this.isAdmin, orgType: this.orgType, orgId: this.orgId } + )).then((res) => { return res }) }, @@ -193,6 +196,7 @@ export default { key: 'id', value: 'id' }, + isAdmin: 2, orgId: '', orgType: 1, spinning: false @@ -231,6 +235,7 @@ export default { this.selectedKeys = [] if (!res.code === 200 || !res.data.length) { this.orgTree = [] + this.$refs.table.refresh(true) return } this.orgTree = listToTree(res.data, [], rootParentId) @@ -284,7 +289,7 @@ export default { addPersonCertificate (record) { this.$router.push({ path: '/archives/certificate/EditCertificate', - query: { + query: { personId: record.id } }) @@ -384,7 +389,9 @@ export default { } }, personExport () { - personExport(this.queryParam).then(res => { + personExport(Object.assign(this.queryParam, + { isAdmin: this.isAdmin, orgType: this.orgType, orgId: this.orgId } + )).then(res => { downloadExportFile(res.data) }) }, @@ -414,6 +421,8 @@ export default { this.$message.success('导入成功!') this.$refs.table.refresh() this.spinning = false + }).catch(() => { + this.spinning = false }) } else { this.$message.error(res.data.msg) @@ -423,6 +432,7 @@ export default { .catch((err) => { this.$refs.inputFile.value = '' this.$message.error(err) + this.spinning = false }) }, @@ -430,21 +440,23 @@ export default { * 点击左侧机构树查询列表 */ handleClick (e) { - this.queryParam.orgId = e.toString() this.orgId = e.toString() - this.queryParam.orgType = this.orgType this.$refs.table.refresh(true) }, handleOk () { this.$refs.table.refresh() }, onRadioChange (e) { - this.queryParam.isAdmin = e.target.value + this.isAdmin = e.target.value this.$refs.table.refresh(true) }, onSelectChange (selectedRowKeys, selectedRows) { this.selectedRowKeys = selectedRowKeys this.selectedRows = selectedRows + }, + // 下载模板 + downloadDemo () { + window.location.href = '/dawa/sys/oss/show?id=3' } } } diff --git a/src/views/security/user/UserList.vue b/src/views/security/user/UserList.vue index cccecc2..c62c81e 100644 --- a/src/views/security/user/UserList.vue +++ b/src/views/security/user/UserList.vue @@ -28,8 +28,8 @@
- 新增用户 - + + 批量删除