From afa90a9e057054678ecfbe1b142ea89d3b225779 Mon Sep 17 00:00:00 2001 From: xuhuajiao <13476289682@163.com> Date: Thu, 26 Oct 2023 17:33:21 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E5=BD=92=E6=A1=A3/=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/category/category.js | 10 +++- src/store/modules/user.js | 15 +++-- src/views/login.vue | 16 ++++-- src/views/prearchiveLibrary/index.vue | 2 +- .../prearchiveLibrary/module/batchFile.vue | 55 ++++++++++++++++--- src/views/prearchiveLibrary/module/data.json | 22 -------- src/views/prearchiveLibrary/module/scope.vue | 10 +++- .../descriptionPreview/index.vue | 4 +- .../archivesCategory/fieldManage/index.vue | 2 +- .../archivesCategory/fileNoFormat/index.vue | 4 +- .../archivesCategory/listBrowsing/index.vue | 6 +- src/views/system/dept/index.vue | 4 +- src/views/system/fieldCorresManage/index.vue | 4 +- .../fileLibraryManage/listBrowsing/index.vue | 2 +- src/views/system/metadata/dataList/index.vue | 2 +- src/views/system/user/index.vue | 32 +++++++---- 16 files changed, 124 insertions(+), 66 deletions(-) delete mode 100644 src/views/prearchiveLibrary/module/data.json diff --git a/src/api/system/category/category.js b/src/api/system/category/category.js index a8fa74a..733254e 100644 --- a/src/api/system/category/category.js +++ b/src/api/system/category/category.js @@ -96,6 +96,14 @@ export function FetchInitCategoryField(params) { }) } +export function FetchCategoryFieldManage(params) { + return request({ + url: 'api/category/categoryFieldManage', + method: 'get', + params + }) +} + // 著录界面排序 export function FetchUpardicSort(data) { return request({ @@ -114,4 +122,4 @@ export function FetchInitCategoryFieldByPid(params) { }) } -export default { add, edit, del, FetchCategoryMenu, FetchInitCategoryField, FetchUpardicSort, FetchInitCategoryFieldByPid } +export default { add, edit, del, FetchCategoryMenu, FetchInitCategoryField, FetchCategoryFieldManage, FetchUpardicSort, FetchInitCategoryFieldByPid } diff --git a/src/store/modules/user.js b/src/store/modules/user.js index fad38af..ac85c84 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -31,12 +31,15 @@ const user = { const rememberMe = userInfo.rememberMe return new Promise((resolve, reject) => { login(userInfo.username, userInfo.password, userInfo.code, userInfo.uuid).then(res => { - setToken(res.token, rememberMe) - commit('SET_TOKEN', res.token) - setUserInfo(res.user, commit) - // 第一次加载菜单时用到, 具体见 src 目录下的 permission.js - commit('SET_LOAD_MENUS', true) - resolve() + console.log(res.message) + if (res.code !== 500) { + setToken(res.token, rememberMe) + commit('SET_TOKEN', res.token) + setUserInfo(res.user, commit) + // 第一次加载菜单时用到, 具体见 src 目录下的 permission.js + commit('SET_LOAD_MENUS', true) + } + resolve(res) }).catch(error => { reject(error) }) diff --git a/src/views/login.vue b/src/views/login.vue index 630d0fc..16c4c2e 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -183,11 +183,19 @@ export default { } this.$store .dispatch('Login', user) - .then(() => { + .then((res) => { this.loading = false - this.$router.push({ path: this.redirect || '/' }) - }) - .catch(() => { + if (res.code === 500) { + this.$message({ + message: res.message, + type: 'warning', + duration: 5000 + }) + this.getCode() + } else { + this.$router.push({ path: this.redirect || '/' }) + } + }).catch(res => { this.loading = false this.getCode() }) diff --git a/src/views/prearchiveLibrary/index.vue b/src/views/prearchiveLibrary/index.vue index 7384013..01224ae 100644 --- a/src/views/prearchiveLibrary/index.vue +++ b/src/views/prearchiveLibrary/index.vue @@ -241,7 +241,7 @@ export default { }, getFormInfo(params, type) { PrearchiveCrud.FetchDoeditDocument(params).then(data => { - const showFiledAll = data.showFiled.filter(item => item.displayOrder).sort((a, b) => a.displayOrder - b.displayOrder) + const showFiledAll = data.showFiled.filter(item => item.isSequence).sort((a, b) => a.isSequence - b.isSequence) this.$nextTick(() => { this.formPreviewData = showFiledAll this.formVisible = true diff --git a/src/views/prearchiveLibrary/module/batchFile.vue b/src/views/prearchiveLibrary/module/batchFile.vue index 898401f..df4a872 100644 --- a/src/views/prearchiveLibrary/module/batchFile.vue +++ b/src/views/prearchiveLibrary/module/batchFile.vue @@ -100,7 +100,7 @@
@@ -172,7 +172,8 @@ export default { leftLoading: false, rightLoading: false, isCorrField: true, - allCorrField: [] + allCorrField: [], + isTest: false } }, watch: { @@ -217,6 +218,7 @@ export default { this.allFieldData = [] this.allCorrField = [] this.isCorrField = true + this.isTest = false }, // 目标门类 getCategoryDataTree() { @@ -290,7 +292,23 @@ export default { }) }, handleSelectCategory(val) { + console.log(val) this.selectedCategoryName = val.cnName + this.form.categoryId = val.id + this.batchCategory = val + // this.getArchivesScopeByCategoryId() + const params = { + 'categoryId': this.form.categoryId + } + FetchArchivesScopeByCategoryId(params).then(res => { + if (Array.isArray(res) && res.length === 1) { + this.form.scope = res[0].scopeName + } else { + this.form.scope = null + console.log('有多个“归档范围”') + } + this.getCheckRepeat() + }) }, // 归档范围选择 selectScope() { @@ -337,6 +355,7 @@ export default { this.selectStatus = [] this.allFieldData = [] this.form.ruleName = res.id + this.getDetailsByDocumentIdAndCategoryId() } this.fieldLoading = false @@ -346,19 +365,36 @@ export default { selectChangeFiedType(index) { this.options.forEach((item) => { if (this.selectStatus[index].fiedType === 2) { - this.selectStatus.splice(index, 1, { mode: false, fiedType: this.selectStatus[index].fiedType, value: this.allFieldData[index].categoryFieldId.isDefaultValue, field: item, isInput: item.isInput }) + if (!this.isCorrField) { + this.selectStatus.splice(index, 1, { mode: false, fiedType: this.selectStatus[index].fiedType, value: this.selectStatus[index].fiedType === 1 ? this.selectStatus[index].value : this.allCorrField[index].isDefaultValue, field: item, isInput: item.isInput }) + } else { + this.selectStatus.splice(index, 1, { mode: false, fiedType: this.selectStatus[index].fiedType, value: this.allFieldData[index].categoryFieldId.isDefaultValue, field: item, isInput: item.isInput }) + } } else { + if (!this.isCorrField) { + this.isTest = true + } else { + this.isTest = false + } this.selectStatus.splice(index, 1, { mode: true, fiedType: this.selectStatus[index].fiedType, value: '', field: item, isInput: item.isInput }) } }) }, selectChange(index) { this.options.forEach((item) => { - if (this.selectStatus[index].fiedType === 1) { - this.selectStatus.splice(index, 1, { mode: false, fiedType: 1, value: this.selectStatus[index].value, field: item, isInput: item.isInput }) + if (!this.isCorrField && this.allCorrField[index].isDefaultValue !== '') { + if (this.isTest) { + this.selectStatus.splice(index, 1, { mode: false, fiedType: 1, value: this.selectStatus[index].value, field: item, isInput: item.isInput }) + } else { + this.selectStatus.splice(index, 1, { mode: false, fiedType: 2, value: this.allCorrField[index].isDefaultValue === '' ? this.selectStatus[index].value : this.allCorrField[index].isDefaultValue, field: item, isInput: item.isInput }) + } } else { - if (item.fieldCnName === this.selectStatus[index].value) { - this.selectStatus.splice(index, 1, { mode: false, fiedType: this.allFieldData[index].categoryFieldId.isDefaultValue === '' ? 1 : 2, value: this.allFieldData[index].categoryFieldId.isDefaultValue === '' ? this.selectStatus[index].value : this.allFieldData[index].categoryFieldId.isDefaultValue, field: item, isInput: item.isInput }) + if (this.selectStatus[index].fiedType === 1) { + this.selectStatus.splice(index, 1, { mode: false, fiedType: 1, value: this.selectStatus[index].value, field: item, isInput: item.isInput }) + } else { + if (item.fieldCnName === this.selectStatus[index].value) { + this.selectStatus.splice(index, 1, { mode: false, fiedType: this.allFieldData[index].categoryFieldId.isDefaultValue === '' ? 1 : 2, value: this.allFieldData[index].categoryFieldId.isDefaultValue === '' ? this.selectStatus[index].value : this.allFieldData[index].categoryFieldId.isDefaultValue, field: item, isInput: item.isInput }) + } } } }) @@ -378,7 +414,10 @@ export default { }) this.selectedCategoryName = null this.allFieldData = [] - done() + this.allCorrField = [] + this.isTest = false + this.batchCategory = {} + // done() }, handleComfirmBatchToFile() { // const getIndicesByMode = (modeValue) => { diff --git a/src/views/prearchiveLibrary/module/data.json b/src/views/prearchiveLibrary/module/data.json deleted file mode 100644 index c805ad5..0000000 --- a/src/views/prearchiveLibrary/module/data.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "id": 1, - "label": "字段A", - "isType": 1 - }, - { - "id": 2, - "label": "字段B", - "isType": 0 - }, - { - "id": 3, - "label": "字段C", - "isType": 1 - }, - { - "id": 4, - "label": "字段D", - "isType": 1 - } -] diff --git a/src/views/prearchiveLibrary/module/scope.vue b/src/views/prearchiveLibrary/module/scope.vue index ef71312..b6e36ad 100644 --- a/src/views/prearchiveLibrary/module/scope.vue +++ b/src/views/prearchiveLibrary/module/scope.vue @@ -25,7 +25,7 @@
import PreviewForm from '@/views/components/category/PreviewForm' import SettingForm from '@/views/components/category/SettingForm' -import { FetchInitCategoryField } from '@/api/system/category/category' +import { FetchCategoryFieldManage } from '@/api/system/category/category' import { edit } from '@/api/system/category/fieldManage' import { FetchUpardicSort } from '@/api/system/category/category' export default { @@ -107,7 +107,7 @@ export default { getArchivesType(setField) { // 门类切换时,表单校验清除 this.$refs.previewForm1.$refs['addOrUpdateForm'].clearValidate() - FetchInitCategoryField({ categoryId: this.selectedCategory.id, isType: 2 }).then(res => { + FetchCategoryFieldManage({ categoryId: this.selectedCategory.id, isType: 2 }).then(res => { this.allFieldsData.splice(0, this.allFieldsData.length) this.isInputFields.splice(0, this.isInputFields.length) if (!setField) { diff --git a/src/views/system/archivesCategory/fieldManage/index.vue b/src/views/system/archivesCategory/fieldManage/index.vue index 93ee978..fa96869 100644 --- a/src/views/system/archivesCategory/fieldManage/index.vue +++ b/src/views/system/archivesCategory/fieldManage/index.vue @@ -87,7 +87,7 @@ export default { cruds() { return CRUD({ tag: 'field', - url: 'api/category/initCategoryField', + url: 'api/category/categoryFieldManage', crudMethod: fieldCrudMethod, title: '字段', optShow: { diff --git a/src/views/system/archivesCategory/fileNoFormat/index.vue b/src/views/system/archivesCategory/fileNoFormat/index.vue index 3eba8a2..ecd9e02 100644 --- a/src/views/system/archivesCategory/fileNoFormat/index.vue +++ b/src/views/system/archivesCategory/fileNoFormat/index.vue @@ -55,7 +55,7 @@