Browse Source

页面优化

master
xuhuajiao 2 weeks ago
parent
commit
f8e32a61c1
  1. 2
      src/views/collectReorganizi/collectionLibrary/mixins/index.js
  2. 5
      src/views/collectReorganizi/collectionLibrary/module/advancedSearchModal.vue
  3. 10
      src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue
  4. 81
      src/views/components/category/PreviewForm.vue

2
src/views/collectReorganizi/collectionLibrary/mixins/index.js

@ -122,7 +122,7 @@ export const collectionLibraryCrud = {
}) })
}, },
getViewTableList(categoryLevel, parentsId, type) { getViewTableList(categoryLevel, parentsId, type) {
console.log(' this.query.condition', this.query.condition)
// console.log(' this.query.condition', this.query.condition)
const currentPageSize = localStorage.getItem('currentPageSize') const currentPageSize = localStorage.getItem('currentPageSize')
if (currentPageSize) { if (currentPageSize) {
this.page.size = parseInt(currentPageSize) this.page.size = parseInt(currentPageSize)

5
src/views/collectReorganizi/collectionLibrary/module/advancedSearchModal.vue

@ -259,12 +259,11 @@ export default {
}) })
}, },
getFieldCommon() { getFieldCommon() {
console.log('selectedCategory', this.selectedCategory)
const params = { const params = {
'categoryId': this.selectedCategory.id, 'categoryId': this.selectedCategory.id,
'categoryLevel': this.collectLevel 'categoryLevel': this.collectLevel
} }
console.log('params', params)
// console.log('params', params)
FetchInitCategoryInputFieldByPid(params).then((data) => { FetchInitCategoryInputFieldByPid(params).then((data) => {
if (data && data.length > 0) { if (data && data.length > 0) {
this.fieldOptions = data this.fieldOptions = data
@ -349,7 +348,7 @@ export default {
}, },
handleSearch() { handleSearch() {
const wheresql = this.checkConditions(this.conditionData) const wheresql = this.checkConditions(this.conditionData)
console.log('wheresql', wheresql)
// console.log('wheresql', wheresql)
if (wheresql) { if (wheresql) {
const conditions = JSON.parse(JSON.stringify(this.conditionData)) const conditions = JSON.parse(JSON.stringify(this.conditionData))
// localStorage // localStorage

10
src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue

@ -725,7 +725,6 @@ export default {
if (this.parentsData.parentsProjectId && this.isTitleType === 3) { if (this.parentsData.parentsProjectId && this.isTitleType === 3) {
console.log('项目下的案卷') console.log('项目下的案卷')
} else { } else {
console.log('111')
if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) { if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
this.$message({ message: '当前档案处于归档流程中,不可操作新增,请先确认!', offset: 8 }) this.$message({ message: '当前档案处于归档流程中,不可操作新增,请先确认!', offset: 8 })
return false return false
@ -736,7 +735,6 @@ export default {
this.quickPaper = true this.quickPaper = true
this.formTitle = '新增案卷' this.formTitle = '新增案卷'
} else { } else {
console.log('222')
this.quickPaperArcId = [] this.quickPaperArcId = []
this.formTitle = '新增' + this.collectTitle this.formTitle = '新增' + this.collectTitle
this.quickPaper = false this.quickPaper = false
@ -860,10 +858,10 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.previewForm.archivesType = 'add' this.$refs.previewForm.archivesType = 'add'
this.$refs.previewForm.activeIndex = this.activeIndex this.$refs.previewForm.activeIndex = this.activeIndex
console.log('this.parentsData.parentsAnjuanRow ', this.parentsData.parentsAnjuanRow)
console.log('this.collectTitle', this.collectTitle)
// console.log('this.parentsData.parentsAnjuanRow ', this.parentsData.parentsAnjuanRow)
// console.log('this.collectTitle', this.collectTitle)
const savePrevFromData = JSON.parse(localStorage.getItem('savePrevFromData')) const savePrevFromData = JSON.parse(localStorage.getItem('savePrevFromData'))
console.log('savePrevFromData', savePrevFromData)
// console.log('savePrevFromData', savePrevFromData)
if (savePrevFromData) { if (savePrevFromData) {
if ('record_no' in savePrevFromData && 'item_no' in savePrevFromData) { if ('record_no' in savePrevFromData && 'item_no' in savePrevFromData) {
@ -898,7 +896,7 @@ export default {
// fonds_noarchival_category_codearchive_ctg_noarchive_yearretentionrecord_nosigner // fonds_noarchival_category_codearchive_ctg_noarchive_yearretentionrecord_nosigner
const rowAjData = this.parentsData.parentsAnjuanRow const rowAjData = this.parentsData.parentsAnjuanRow
const fields = ['archive_ctg_no', 'archive_year', 'retention', 'record_no', 'signer'] const fields = ['archive_ctg_no', 'archive_year', 'retention', 'record_no', 'signer']
console.log('this.selectedCategory', this.selectedCategory)
// console.log('this.selectedCategory', this.selectedCategory)
const result = { is_entity: 1, 'fonds_no': this.selectedCategory.fondsNo, 'archival_category_code': this.selectedCategory.code } const result = { is_entity: 1, 'fonds_no': this.selectedCategory.fondsNo, 'archival_category_code': this.selectedCategory.code }
fields.forEach(field => { fields.forEach(field => {

81
src/views/components/category/PreviewForm.vue

@ -39,7 +39,7 @@
:class="{ 'treeselect-error': fieldErrors[item.fieldName] }" :class="{ 'treeselect-error': fieldErrors[item.fieldName] }"
@select="selectTree" @select="selectTree"
@open="openTree(item)" @open="openTree(item)"
@blur="() => { this.$refs.addOrUpdateForm.validateField(item.fieldName) }"
@close="() => { handleSelectClose(item.fieldName) }"
> >
<div slot="value-label" slot-scope="{ node }">{{ getAutoNameUnknown(node.label) }}</div> <div slot="value-label" slot-scope="{ node }">{{ getAutoNameUnknown(node.label) }}</div>
</treeselect> </treeselect>
@ -661,7 +661,6 @@ export default {
return row.level ? row.level === 3 : true return row.level ? row.level === 3 : true
}, },
normalizer(node) { normalizer(node) {
console.log('normalizer', node.dictionaryName)
if ((node.childDictionarys && !node.childDictionarys.length) || node.childDictionarys === null) { if ((node.childDictionarys && !node.childDictionarys.length) || node.childDictionarys === null) {
delete node.childDictionarys delete node.childDictionarys
} }
@ -991,7 +990,7 @@ export default {
this.$set(this.rules, 'item_no', [{ this.$set(this.rules, 'item_no', [{
validator: async(rule, value, callback) => { validator: async(rule, value, callback) => {
// //
console.log('this.archiveNoDuplicate', this.archiveNoDuplicate)
// console.log('this.archiveNoDuplicate', this.archiveNoDuplicate)
if (this.archiveNoDuplicate && this.maxItemNo !== null) { if (this.archiveNoDuplicate && this.maxItemNo !== null) {
callback(new Error(`可用起始件号建议: ${this.maxItemNo}`)) callback(new Error(`可用起始件号建议: ${this.maxItemNo}`))
} else { } else {
@ -1055,7 +1054,7 @@ export default {
} }
} else { } else {
if (item.dictionaryId) { if (item.dictionaryId) {
console.log('item.dictionaryId', item.dictionaryId)
// console.log('item.dictionaryId', item.dictionaryId)
// const params = { // const params = {
// 'pid': item.dictionaryId.id // 'pid': item.dictionaryId.id
// } // }
@ -1081,11 +1080,14 @@ export default {
.filter(parent => filterCodes.includes(parent.dictionaryCode)) // .filter(parent => filterCodes.includes(parent.dictionaryCode)) //
.map(topItem => topItem.childDictionarys) // .map(topItem => topItem.childDictionarys) //
.flat() // .flat() //
console.log('保留多级结构的子项:', filteredItems)
console.log('filteredItems', filteredItems)
// ID
const uniqueItems = this.removeDuplicateNodes(filteredItems)
if (item.isInputClass === 'select') { if (item.isInputClass === 'select') {
this.$set(item, 'options', filteredItems)
this.$set(item, 'options', uniqueItems)
} else if (item.isInputClass === 'popover') { } else if (item.isInputClass === 'popover') {
this.popoverTableData = filteredItems
this.popoverTableData = uniqueItems
this.popoverVisible = true this.popoverVisible = true
} }
}).catch(err => { }).catch(err => {
@ -1253,6 +1255,67 @@ export default {
} }
} }
} }
console.log('isRepeatHandle', item)
},
// treeselect close -
handleSelectClose(fieldName) {
console.log('handleSelectClose', fieldName)
if (this.$refs.addOrUpdateForm) {
//
this.$refs.addOrUpdateForm.validateField(fieldName)
//
const fieldItem = this.formPreviewData.find(item => item.fieldName === fieldName)
if (fieldItem && fieldItem.isRequired) {
const fieldValue = this.addOrUpdateForm[fieldName]
if (!fieldValue && fieldValue !== 0 && fieldValue !== false) {
//
this.$set(this.fieldErrors, fieldName, '请选择' + fieldItem.fieldCnName)
} else {
//
this.$set(this.fieldErrors, fieldName, '')
}
}
}
},
// ID
removeDuplicateNodes(nodes) {
const seenIds = new Set()
const result = []
const processNode = (node) => {
// ID
const nodeId = node.dictionaryName || node.id || node.code
if (nodeId && seenIds.has(nodeId)) {
return null //
}
if (nodeId) {
seenIds.add(nodeId)
}
//
if (node.childDictionarys && Array.isArray(node.childDictionarys)) {
const uniqueChildren = []
for (const child of node.childDictionarys) {
const processedChild = processNode(child)
if (processedChild) {
uniqueChildren.push(processedChild)
}
}
node.childDictionarys = uniqueChildren
}
return node
}
for (const node of nodes) {
const processedNode = processNode(node)
if (processedNode) {
result.push(processedNode)
}
}
return result
}, },
// tree - open // tree - open
openTree(item) { openTree(item) {
@ -1443,8 +1506,6 @@ export default {
if (item.fieldName === 'fonds_name' && this.isDesFormType !== 'category') { if (item.fieldName === 'fonds_name' && this.isDesFormType !== 'category') {
this.$set(this.addOrUpdateForm, item.fieldName, this.selectedCategory.fondName) this.$set(this.addOrUpdateForm, item.fieldName, this.selectedCategory.fondName)
} }
console.log('item', item)
console.log('item.isRequired', item.isRequired)
const rule = { const rule = {
required: !!item.isRequired, required: !!item.isRequired,
message: ((item.isInputClass === 'text' || item.isInputClass === 'textarea') ? '请输入' : '请选择') + item.fieldCnName, message: ((item.isInputClass === 'text' || item.isInputClass === 'textarea') ? '请输入' : '请选择') + item.fieldCnName,
@ -1634,7 +1695,7 @@ export default {
} }
const originalArchiveNo = this.addOrUpdateForm.archive_no const originalArchiveNo = this.addOrUpdateForm.archive_no
console.log('this.addOrUpdateForm', this.addOrUpdateForm)
// console.log('this.addOrUpdateForm', this.addOrUpdateForm)
// //
const isRepeatValid = await this.validateRepeatFieldsBeforeSubmit(formName) const isRepeatValid = await this.validateRepeatFieldsBeforeSubmit(formName)

Loading…
Cancel
Save