From 7eff02eb9b5cbaad48c6c8dc925740b8511b3448 Mon Sep 17 00:00:00 2001 From: wangxiaoshuang <825034831@qq.com> Date: Fri, 25 Oct 2024 15:26:21 +0800 Subject: [PATCH] 1 --- .../components/SignatureTemplate/index.vue | 170 ++++++++++-------- 1 file changed, 99 insertions(+), 71 deletions(-) diff --git a/src/views/dictionary/attachment/components/SignatureTemplate/index.vue b/src/views/dictionary/attachment/components/SignatureTemplate/index.vue index 3a09238c..d2af93cc 100644 --- a/src/views/dictionary/attachment/components/SignatureTemplate/index.vue +++ b/src/views/dictionary/attachment/components/SignatureTemplate/index.vue @@ -2,27 +2,18 @@ @@ -175,7 +191,7 @@ const searchDataDefault = () => { FileTypeId: '', Name: '', PageIndex: 1, - PageSize: 20 + PageSize: 20, } } export default { @@ -193,7 +209,7 @@ export default { editVisible: false, previewVisible: false, title: '', - loading: false + loading: false, } }, mounted() { @@ -203,22 +219,24 @@ export default { // 获取系统文件数据 getList() { this.loading = true - getSystemDocumentList(this.searchData).then(res => { - this.loading = false - const { CurrentPageData, TotalCount } = res.Result - CurrentPageData.forEach(item => { - item.NeedConfirmedUserTypes = [] - item.NeedConfirmedUserTypeIds = [] - item.NeedConfirmedUserTypeList.forEach((i) => { - item.NeedConfirmedUserTypes.push(i.UserTypeShortName) - item.NeedConfirmedUserTypeIds.push(i.NeedConfirmUserTypeId) + getSystemDocumentList(this.searchData) + .then((res) => { + this.loading = false + const { CurrentPageData, TotalCount } = res.Result + CurrentPageData.forEach((item) => { + item.NeedConfirmedUserTypes = [] + item.NeedConfirmedUserTypeIds = [] + item.NeedConfirmedUserTypeList.forEach((i) => { + item.NeedConfirmedUserTypes.push(i.UserTypeShortName) + item.NeedConfirmedUserTypeIds.push(i.NeedConfirmUserTypeId) + }) }) + this.list = CurrentPageData + this.total = TotalCount + }) + .catch(() => { + this.loading = false }) - this.list = CurrentPageData - this.total = TotalCount - }).catch(() => { - this.loading = false - }) }, // 新增 handleAdd() { @@ -230,7 +248,9 @@ export default { handlePreview(row) { const { Name, FullFilePath } = row this.currentPath = FullFilePath - this.currentType = row.Name ? Name.substring(Name.lastIndexOf('.') + 1).toLocaleLowerCase() : '' + this.currentType = row.Name + ? Name.substring(Name.lastIndexOf('.') + 1).toLocaleLowerCase() + : '' this.previewVisible = true }, // 编辑 @@ -244,39 +264,47 @@ export default { this.$confirm('是否确认废除此文件?', { type: 'warning', distinguishCancelAndClose: true, - }) .then(() => { this.loading = true userAbandonDoc(row.Id, true) - .then(res => { + .then((res) => { this.loading = false if (res.IsSuccess) { this.getList() - this.$message.success(this.$t('common:message:savedSuccessfully')) + this.$message.success( + this.$t('common:message:savedSuccessfully') + ) } - }).catch(() => { this.loading = false }) - }).catch(() => {}) + }) + .catch(() => { + this.loading = false + }) + }) + .catch(() => {}) }, // 删除 handleDelete(row) { this.$confirm(this.$t('trials:staffResearch:message:confirmDel'), { type: 'warning', - distinguishCancelAndClose: true + distinguishCancelAndClose: true, + }).then(() => { + this.loading = true + deleteSystemDocument(row.Id) + .then((res) => { + this.loading = false + if (res.IsSuccess) { + this.list.splice( + this.list.findIndex((item) => item.Id === row.Id), + 1 + ) + this.$message.success('删除成功!') + } + }) + .catch(() => { + this.loading = false + }) }) - .then(() => { - this.loading = true - deleteSystemDocument(row.Id) - .then(res => { - this.loading = false - if (res.IsSuccess) { - this.list.splice(this.list.findIndex(item => item.Id === row.Id), 1) - this.$message.success('删除成功!') - } - }).catch(() => { - this.loading = false - }) - }) }, // 关闭弹窗 closeDialog() { @@ -305,7 +333,7 @@ export default { this.searchData.SortField = column.prop this.searchData.PageIndex = 1 this.getList() - } - } + }, + }, }