From 3db7d72afb2241a13fbb50b83e77ac9bb0cdfe65 Mon Sep 17 00:00:00 2001
From: xuhuajiao <13476289682@163.com>
Date: Mon, 30 Oct 2023 17:18:38 +0800
Subject: [PATCH] =?UTF-8?q?20231030=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86bug?=
=?UTF-8?q?=E9=9C=80=E6=B1=82=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/components/category/PreviewForm.vue | 9 +-
.../archiveScopeManage/module/tableList.vue | 24 ++--
.../archivesCategory/fieldManage/index.vue | 2 +-
src/views/system/dept/index.vue | 3 +-
src/views/system/fieldCorresManage/index.vue | 6 +-
.../fileLibraryManage/fieldManage/index.vue | 2 +-
src/views/system/groupManage/index.vue | 105 +++++++++++-------
src/views/system/role/index.vue | 98 ++++++++--------
8 files changed, 146 insertions(+), 103 deletions(-)
diff --git a/src/views/components/category/PreviewForm.vue b/src/views/components/category/PreviewForm.vue
index 3142f54..3482891 100644
--- a/src/views/components/category/PreviewForm.vue
+++ b/src/views/components/category/PreviewForm.vue
@@ -75,20 +75,20 @@
-
+
-
+
-
+
@@ -779,6 +779,9 @@ export default {
background-color: transparent;
@include input_style;
}
+ ::v-deep .vue-treeselect__control{
+ height: 32px !important;
+ }
::v-deep .el-input__prefix {
text-align: right;
right: 5px !important;
diff --git a/src/views/system/archiveScopeManage/module/tableList.vue b/src/views/system/archiveScopeManage/module/tableList.vue
index d6a37eb..0a56d09 100644
--- a/src/views/system/archiveScopeManage/module/tableList.vue
+++ b/src/views/system/archiveScopeManage/module/tableList.vue
@@ -54,23 +54,25 @@
placeholder="选择门类之后再选择档案分类"
/>
-
-
-
+
+
+
+
+
+
+
+
+
+
是
否
-
-
-
-
-
-
+
{{ scope.row.retention === 0 ? '永久' : scope.row.retention === 1 ? '定期30年' : '定期10年' }}
@@ -192,8 +194,8 @@ export default {
scopeCode: [{ required: true, message: '编码不可为空', trigger: 'blur' }],
scopeName: [{ required: true, message: '名称不可为空', trigger: 'blur' }],
isTop: [{ required: true, message: '请选择是否为顶级分类', trigger: 'change' }],
- pid: [{ required: true, message: '请选择上级分类', trigger: 'change' }],
- retention: [{ required: true, message: '请选择保管期限', trigger: 'change' }]
+ pid: [{ required: true, message: '请选择上级分类', trigger: 'change' }]
+ // retention: [{ required: true, message: '请选择保管期限', trigger: 'change' }]
},
permission: {
add: ['admin', 'scope:add'],
diff --git a/src/views/system/archivesCategory/fieldManage/index.vue b/src/views/system/archivesCategory/fieldManage/index.vue
index fa96869..6ffb1c8 100644
--- a/src/views/system/archivesCategory/fieldManage/index.vue
+++ b/src/views/system/archivesCategory/fieldManage/index.vue
@@ -10,7 +10,7 @@
-
+
diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue
index e915c45..92828a6 100644
--- a/src/views/system/dept/index.vue
+++ b/src/views/system/dept/index.vue
@@ -173,7 +173,8 @@ export default {
reset: true,
download: false,
group: false
- }
+ },
+ queryOnPresenterCreated: false
})
},
mixins: [presenter(), header(), form(defaultForm), crud()],
diff --git a/src/views/system/fieldCorresManage/index.vue b/src/views/system/fieldCorresManage/index.vue
index 10cfae5..92166a8 100644
--- a/src/views/system/fieldCorresManage/index.vue
+++ b/src/views/system/fieldCorresManage/index.vue
@@ -92,7 +92,7 @@
@selection-change="crud.selectionChangeHandler"
@cell-dblclick="tableDoubleClick"
>
-
+
@@ -139,7 +139,7 @@ export default {
add: true,
edit: false,
del: true,
- reset: false,
+ reset: true,
download: false,
group: false
}
@@ -210,6 +210,7 @@ export default {
// 不存在对应关系时
this.$refs.corresForm.corresVisible = true
this.$refs.corresForm.title = '新增对应关系'
+ this.$refs.corresForm.cuform.ruleName = null
this.$refs.corresForm.documentName = null
this.$refs.corresForm.cuform.documentId = this.form.documentId
this.$refs.corresForm.categoryName = this.selectedCategoryName
@@ -253,6 +254,7 @@ export default {
this.$refs.corresForm.leftLoading = false
})
// 门类字段
+ console.log('categoryId', categoryId)
FetchInitCategoryFieldByPid({ categoryId: categoryId, isType: 2 }).then((res) => {
this.$refs.corresForm.targetData = res.sort((a, b) => {
if (a.isInput !== b.isInput) {
diff --git a/src/views/system/fileLibraryManage/fieldManage/index.vue b/src/views/system/fileLibraryManage/fieldManage/index.vue
index bb3ea8c..390d4db 100644
--- a/src/views/system/fileLibraryManage/fieldManage/index.vue
+++ b/src/views/system/fileLibraryManage/fieldManage/index.vue
@@ -10,7 +10,7 @@
-
+
diff --git a/src/views/system/groupManage/index.vue b/src/views/system/groupManage/index.vue
index 3b55d8e..0548294 100644
--- a/src/views/system/groupManage/index.vue
+++ b/src/views/system/groupManage/index.vue
@@ -111,13 +111,12 @@
@click="saveCategory"
>保存
-
+
import crudfonds from '@/api/system/fonds'
-import { FetchCategoryMenuChildren } from '@/api/system/category/category'
+// FetchCategoryMenuChildren
+import { FetchCategoryMenu } from '@/api/system/category/category'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
@@ -159,7 +159,7 @@ export default {
mixins: [presenter(), header(), form(defaultForm), crud()],
data() {
return {
- defaultProps: { children: 'children', label: 'cnName', isLeaf: 'leaf' },
+ defaultProps: { children: 'children', label: 'cnName' },
currentId: 0, categoryLoading: false, showButton: false,
categoryDatas: [], categoryIds: [], depts: [], deptDatas: [], // 多选时使用
categoryAllData: [],
@@ -191,7 +191,8 @@ export default {
],
blurryTime: null,
deleteData: [], // 删除选中的data
- chooseNode: null
+ chooseNode: null,
+ categoryTreeData: []
}
},
computed: {
@@ -201,15 +202,32 @@ export default {
},
created() {
},
+ mounted() {
+ FetchCategoryMenu().then(res => {
+ this.categoryDatas = this.filterData(res)
+ })
+ },
methods: {
- getCategoryDataList(node, resolve) {
- setTimeout(() => {
- if (node.level > 2) return resolve([])
- FetchCategoryMenuChildren(node.data.id ? node.data.id : 0).then(res => {
- resolve(res)
- })
- }, 100)
+ // getCategoryDataList(node, resolve) {
+ // setTimeout(() => {
+ // if (node.level > 2) return resolve([])
+ // FetchCategoryMenuChildren(node.data.id ? node.data.id : 0).then(res => {
+ // resolve(res)
+ // })
+ // }, 100)
+ // },
+ filterData(data) {
+ return data.filter(node => {
+ this.$set(node, 'isChecked', false)
+ if (node.children && node.children.length > 0) {
+ node.children = this.filterData(node.children) // 递归处理子节点
+ }
+ return node.isType !== 3 // 过滤掉isType为3的节点
+ })
},
+ // getCategoryDataList(node, resolve) {
+ // resolve(this.categoryTreeData)
+ // },
[CRUD.HOOK.beforeRefresh]() {
if (this.blurryTime) {
this.crud.query.startTime = this.blurryTime[0]
@@ -240,9 +258,13 @@ export default {
this.$refs.category.setCheckedKeys([])
// 保存当前的角色id
this.currentId = val.fondsId
+ console.log('val', val)
+ console.log('this.currentId', this.currentId)
crudfonds.FetchFondsDetail({ id: this.currentId }).then((res) => {
+ console.log(res)
// 初始化默认选中的key
this.categoryIds = []
+ console.log(res.categorys)
if (res.categorys) {
res.categorys.forEach(function(data) {
_this.categoryIds.push(data.id)
@@ -315,36 +337,38 @@ export default {
}).catch(() => {
})
},
- categoryChange(categorys) {
- console.log(categorys)
- if (categorys.pid === 0) {
- categorys.isChecked = !categorys.isChecked
- this.categoryIds.push(categorys.id)
- this.categoryAllData.forEach(childIds => {
- if (categorys.isChecked) {
- const index = this.categoryIds.indexOf(childIds.id)
- if (index !== -1) {
- this.categoryIds.splice(index, 1)
- }
- this.categoryIds.push(childIds.id)
- } else {
- this.categoryIds = []
- }
- })
- } else {
- if (this.categoryIds.indexOf(categorys.id) !== -1) {
- const index = this.categoryIds.indexOf(categorys.id)
- if (index !== -1) {
- this.categoryIds.splice(index, 1)
- }
- } else {
- const index = this.categoryIds.indexOf(categorys.id)
- if (index === -1) {
- this.categoryIds.push(categorys.id)
+ findNodeById(id, nodes) {
+ for (const node of nodes) {
+ if (node.id === id) {
+ return node
+ } else if (node.children.length > 0) {
+ const foundNode = this.findNodeById(id, node.children)
+ if (foundNode) {
+ return foundNode
}
}
}
- this.$refs.category.setCheckedKeys(this.categoryIds)
+ return null
+ },
+ getAllChildIds(id, nodes) {
+ const node = this.findNodeById(id, nodes)
+ if (node) {
+ let childIds = [node.id]
+ for (const child of node.children) {
+ childIds = childIds.concat(this.getAllChildIds(child.id, nodes))
+ }
+ return childIds
+ } else {
+ return []
+ }
+ },
+ categoryChange(categorys) {
+ console.log(categorys)
+ console.log(this.categoryDatas)
+ const childrenIds = this.getAllChildIds(categorys.id, this.categoryDatas)
+ console.log('childrenIds', childrenIds)
+ console.log(this.$refs.category.getCheckedKeys())
+ this.categoryIds = this.$refs.category.getCheckedKeys()
},
// 保存菜单
saveCategory() {
@@ -369,6 +393,7 @@ export default {
update() {
// 无刷新更新 表格数据
crudfonds.FetchInitFondsList().then(res => {
+ console.log(res)
for (let i = 0; i < this.crud.data.length; i++) {
if (res.fondsId === this.crud.data[i].fondsId) {
this.crud.data[i] = res
diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue
index a26bb6d..534aa9a 100644
--- a/src/views/system/role/index.vue
+++ b/src/views/system/role/index.vue
@@ -106,16 +106,14 @@
node-key="id"
@check="menuChange"
/>
+
{
const resArr = []
- res.forEach(item => {
- resArr.push({
- fondsName: item.fondsName,
- id: item.id,
- leaf: true
+ resArr.push({ fondsName: '全宗选择', id: 0, isChecked: false, children: [] })
+ if (resArr[0].id === 0) {
+ res.forEach(item => {
+ resArr[0].children.push({
+ fondsName: item.fondsName,
+ id: item.id
+ })
})
- })
+ }
this.fondsAllData = resArr
+ console.log(this.fondsAllData)
})
},
methods: {
@@ -269,9 +270,9 @@ export default {
})
if (val.fonds) {
- if (this.fondsAllData.length === val.fonds.length) {
- _this.fondIds.push(0)
- }
+ // if (this.fondsAllData.length === val.fonds.length) {
+ // _this.fondIds.push(0)
+ // }
val.fonds.forEach(function(data) {
_this.fondIds.push(data.id)
})
@@ -301,6 +302,7 @@ export default {
menuChange(menu) {
// 获取该节点的所有子节点,id 包含自身
getChild(menu.id).then(childIds => {
+ console.log(childIds)
// 判断是否在 menuIds 中,如果存在则删除,否则添加
if (this.menuIds.indexOf(menu.id) !== -1) {
for (let i = 0; i < childIds.length; i++) {
@@ -321,34 +323,36 @@ export default {
})
},
fondsChange(fonds) {
- if (fonds.id === 0) {
- fonds.isChecked = !fonds.isChecked
- this.fondIds.push(fonds.id)
- this.fondsAllData.forEach(childIds => {
- if (fonds.isChecked) {
- const index = this.fondIds.indexOf(childIds.id)
- if (index !== -1) {
- this.fondIds.splice(index, 1)
- }
- this.fondIds.push(childIds.id)
- } else {
- this.fondIds = []
- }
- })
- } else {
- if (this.fondIds.indexOf(fonds.id) !== -1) {
- const index = this.fondIds.indexOf(fonds.id)
- if (index !== -1) {
- this.fondIds.splice(index, 1)
- }
- } else {
- const index = this.fondIds.indexOf(fonds.id)
- if (index === -1) {
- this.fondIds.push(fonds.id)
- }
- }
- }
- this.$refs.fonds.setCheckedKeys(this.fondIds)
+ console.log(this.$refs.fonds.getCheckedKeys())
+ this.fondIds = this.$refs.fonds.getCheckedKeys()
+ // if (fonds.id === 0) {
+ // fonds.isChecked = !fonds.isChecked
+ // this.fondIds.push(fonds.id)
+ // this.fondsAllData.forEach(childIds => {
+ // if (fonds.isChecked) {
+ // const index = this.fondIds.indexOf(childIds.id)
+ // if (index !== -1) {
+ // this.fondIds.splice(index, 1)
+ // }
+ // this.fondIds.push(childIds.id)
+ // } else {
+ // this.fondIds = []
+ // }
+ // })
+ // } else {
+ // if (this.fondIds.indexOf(fonds.id) !== -1) {
+ // const index = this.fondIds.indexOf(fonds.id)
+ // if (index !== -1) {
+ // this.fondIds.splice(index, 1)
+ // }
+ // } else {
+ // const index = this.fondIds.indexOf(fonds.id)
+ // if (index === -1) {
+ // this.fondIds.push(fonds.id)
+ // }
+ // }
+ // }
+ // this.$refs.fonds.setCheckedKeys(this.fondIds)
},
// 保存菜单
saveMenu() {
@@ -391,8 +395,14 @@ export default {
update() {
// 无刷新更新 表格数据
crudRoles.get(this.currentId).then(res => {
+ console.log('222', this.crud.data)
for (let i = 0; i < this.crud.data.length; i++) {
- if (res.id === this.crud.data[i].id) {
+ if (res.menus[i].id === this.crud.data[i].menus.id) {
+ this.crud.data[i] = res
+ break
+ }
+ console.log(res.fonds)
+ if (res.fonds.id === this.crud.data[i].fonds.id) {
this.crud.data[i] = res
break
}