This commit is contained in:
parent
77e2dce7cd
commit
6c17051046
|
|
@ -11,31 +11,32 @@
|
|||
@node-click="nodeClick"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<span>{{ data.contentName }}</span>
|
||||
|
||||
<el-icon
|
||||
v-if="data.level != 3"
|
||||
class="el-icon-circle-plus-outline icon-op"
|
||||
@click.stop="openDialog('add',data)"
|
||||
>
|
||||
<CirclePlus />
|
||||
</el-icon>
|
||||
|
||||
<el-icon
|
||||
v-if="data.level > 0"
|
||||
class="el-icon-edit icon-op"
|
||||
@click.stop="openDialog('edit',data)"
|
||||
>
|
||||
<Edit />
|
||||
</el-icon>
|
||||
|
||||
<el-icon
|
||||
v-if="data.level > 0"
|
||||
class="el-icon-delete icon-op"
|
||||
@click.stop="deleteNode(data)"
|
||||
>
|
||||
<Delete />
|
||||
</el-icon>
|
||||
<div class="tree-node-row">
|
||||
<span class="node-label">{{ data.contentName }}</span>
|
||||
<span class="node-actions">
|
||||
<el-icon
|
||||
v-if="data.level != 3"
|
||||
class="el-icon-circle-plus-outline icon-op"
|
||||
@click.stop="openDialog('add', data)"
|
||||
>
|
||||
<CirclePlus />
|
||||
</el-icon>
|
||||
<el-icon
|
||||
v-if="data.level > 0"
|
||||
class="el-icon-edit icon-op"
|
||||
@click.stop="openDialog('edit', data)"
|
||||
>
|
||||
<Edit />
|
||||
</el-icon>
|
||||
<el-icon
|
||||
v-if="data.level > 0"
|
||||
class="el-icon-delete icon-op"
|
||||
@click.stop="deleteNode(data)"
|
||||
>
|
||||
<Delete />
|
||||
</el-icon>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
</avue-tree>
|
||||
</basic-container>
|
||||
|
|
@ -95,7 +96,8 @@
|
|||
|
||||
<!-- 名称 -->
|
||||
<el-form-item label="分类名称" prop="contentName">
|
||||
<el-input type="textarea" :autosize="{ minRows: 4, maxRows: 6 }" maxlength="64" v-model="editForm.contentName" placeholder="请输入分类名称" />
|
||||
<el-input type="textarea" :autosize="{ minRows: 4, maxRows: 6 }" maxlength="64" v-model="editForm.contentName"
|
||||
placeholder="请输入分类名称" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 案卷排序号 -->
|
||||
|
|
@ -113,7 +115,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { ref } from "vue";
|
||||
import { ref } from 'vue';
|
||||
import {
|
||||
getArchivalCatalogueTreeApi,
|
||||
addArchiveLeftApi,
|
||||
|
|
@ -126,7 +128,7 @@ import {
|
|||
import { mapGetters } from 'vuex';
|
||||
// import { add, getDetail, getList, remove, update } from '@/api/data-collect/data-class-manage';
|
||||
export default {
|
||||
name: "ArchCatalogue",
|
||||
name: 'ArchCatalogue',
|
||||
data() {
|
||||
return {
|
||||
form: {},
|
||||
|
|
@ -137,12 +139,12 @@ export default {
|
|||
page: {
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
total: 0,
|
||||
total: 0
|
||||
},
|
||||
selectionList: [],
|
||||
|
||||
option: {
|
||||
height: "calc(100vh - 280px)",
|
||||
height: 'calc(100vh - 280px)',
|
||||
tip: false,
|
||||
searchShow: true,
|
||||
searchMenuSpan: 6,
|
||||
|
|
@ -159,24 +161,24 @@ export default {
|
|||
hide: true,
|
||||
type: 'input', // 不要用 static,用 input
|
||||
readonly: true, // 设置为只读
|
||||
disabled: true, // 设置为禁用
|
||||
disabled: true // 设置为禁用
|
||||
},
|
||||
|
||||
{
|
||||
label: "文件名称",
|
||||
label: '文件名称',
|
||||
labelWidth: 120,
|
||||
prop: "contentName",
|
||||
prop: 'contentName',
|
||||
search: true,
|
||||
type: "input",
|
||||
placeholder: "请输入文件名称",
|
||||
type: 'input',
|
||||
placeholder: '请输入文件名称',
|
||||
searchLabelWidth: 120,
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入文件名称',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '案卷期限',
|
||||
|
|
@ -186,9 +188,9 @@ export default {
|
|||
{
|
||||
required: true,
|
||||
message: '请输入案卷期限',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '档案标识代码',
|
||||
|
|
@ -202,16 +204,16 @@ export default {
|
|||
},
|
||||
props: {
|
||||
label: 'dictLabel',
|
||||
value: 'dictLabel',
|
||||
value: 'dictLabel'
|
||||
},
|
||||
slot: true,
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择档案标识代码',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
trigger: 'change'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '归档责任单位',
|
||||
|
|
@ -221,9 +223,9 @@ export default {
|
|||
{
|
||||
required: true,
|
||||
message: '请输入归档责任单位',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '所属专业',
|
||||
|
|
@ -233,9 +235,9 @@ export default {
|
|||
{
|
||||
required: true,
|
||||
message: '请输入所属专业',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '文件分类标记',
|
||||
|
|
@ -246,30 +248,30 @@ export default {
|
|||
dicMethod: 'post', // 指定为 POST 请求
|
||||
props: {
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
value: 'id'
|
||||
},
|
||||
slot: true,
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择文件分类标记',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
},
|
||||
trigger: 'change'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
treeDeptId: "0",
|
||||
treeLevel:0,
|
||||
treeDeptId: '0',
|
||||
treeLevel: 0,
|
||||
treeData: [],
|
||||
treeOption: {
|
||||
nodeKey: "id",
|
||||
nodeKey: 'id',
|
||||
menu: false,
|
||||
addBtn: false,
|
||||
props: { label: "contentName", children: "children" },
|
||||
props: { label: 'contentName', children: 'children' },
|
||||
level: null,
|
||||
defaultExpandAll: true,
|
||||
defaultExpandAll: true
|
||||
},
|
||||
|
||||
shareDialogVisible: false,
|
||||
|
|
@ -278,8 +280,8 @@ export default {
|
|||
selectedNodeName: '',
|
||||
|
||||
dialogVisible: false,
|
||||
dialogType: "add",
|
||||
editForm: { contentName:null,id:null,level:null,parentId:null,sort:null },
|
||||
dialogType: 'add',
|
||||
editForm: { contentName: null, id: null, level: null, parentId: null, sort: null },
|
||||
|
||||
treeOptions: [], // 原来的树数据
|
||||
treeForDialog: [], // 弹窗树数据
|
||||
|
|
@ -287,36 +289,36 @@ export default {
|
|||
menu: false,
|
||||
addBtn: false,
|
||||
searchShow: false,
|
||||
nodeKey: "id",
|
||||
nodeKey: 'id',
|
||||
props: {
|
||||
label: "contentName",
|
||||
children: "children",
|
||||
value: "id"
|
||||
label: 'contentName',
|
||||
children: 'children',
|
||||
value: 'id'
|
||||
},
|
||||
defaultExpandAll: true,
|
||||
multiple: false,
|
||||
checkStrictly: true,
|
||||
selectClick: true,
|
||||
selectClick: true
|
||||
},
|
||||
|
||||
sortTip: "",
|
||||
sortTip: '',
|
||||
dialogTitle: '',
|
||||
treeKey: 0, // 用于强制重新渲染
|
||||
selectedNodePath:'',
|
||||
selectedNodePath: ''
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapGetters(['permission']),
|
||||
permissionList() {
|
||||
let isLevel3 = this.treeLevel ===3;
|
||||
let isLevel3 = this.treeLevel === 3;
|
||||
return {
|
||||
addBtn: this.validData(this.permission.post_add, false) && isLevel3,
|
||||
addBtn: this.validData(this.permission.post_add, false) && isLevel3,
|
||||
viewBtn: this.validData(this.permission.post_view, false),
|
||||
delBtn: this.validData(this.permission.post_delete, false),
|
||||
editBtn: this.validData(this.permission.post_edit, false),
|
||||
editBtn: this.validData(this.permission.post_edit, false)
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
|
|
@ -343,7 +345,7 @@ export default {
|
|||
this.treeData = convert(rows);
|
||||
this.treeOptions = this.treeData; // 确保 treeOptions 也有 parentId
|
||||
} catch (err) {
|
||||
console.error("加载左树失败", err);
|
||||
console.error('加载左树失败', err);
|
||||
this.treeData = [];
|
||||
this.treeOptions = [];
|
||||
}
|
||||
|
|
@ -458,7 +460,7 @@ export default {
|
|||
return;
|
||||
}
|
||||
|
||||
const api = this.dialogType === "add" ? addArchiveLeftApi : editArchiveLeftApi;
|
||||
const api = this.dialogType === 'add' ? addArchiveLeftApi : editArchiveLeftApi;
|
||||
await api(this.editForm);
|
||||
this.dialogVisible = false;
|
||||
this.$message({ type: 'success', message: '操作成功!' });
|
||||
|
|
@ -508,7 +510,7 @@ export default {
|
|||
}
|
||||
} else {
|
||||
this.editForm.level = 1;
|
||||
this.sortTip = "";
|
||||
this.sortTip = '';
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -553,14 +555,14 @@ export default {
|
|||
rowSave(row, done, loading) {
|
||||
row.level = 4;
|
||||
row.parentId = this.selectedNodeId;
|
||||
row.classifyMark= row.classifyMarkId;
|
||||
row.classifyMark = row.classifyMarkId;
|
||||
|
||||
addArchiveRightApi(row).then(
|
||||
() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!',
|
||||
message: '操作成功!'
|
||||
});
|
||||
done();
|
||||
},
|
||||
|
|
@ -573,13 +575,13 @@ export default {
|
|||
rowUpdate(row, index, done, loading) {
|
||||
row.level = 4;
|
||||
row.parentId = this.selectedNodeId;
|
||||
row.classifyMark= row.classifyMarkId;
|
||||
row.classifyMark = row.classifyMarkId;
|
||||
editArchiveRightApi(row).then(
|
||||
() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!',
|
||||
message: '操作成功!'
|
||||
});
|
||||
done();
|
||||
},
|
||||
|
|
@ -593,7 +595,7 @@ export default {
|
|||
this.$confirm('确定将选择数据删除?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
return delArchiveApi(row.id);
|
||||
|
|
@ -602,7 +604,7 @@ export default {
|
|||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!',
|
||||
message: '操作成功!'
|
||||
});
|
||||
});
|
||||
},
|
||||
|
|
@ -610,7 +612,7 @@ export default {
|
|||
if (type === 'add') {
|
||||
this.$nextTick(() => {
|
||||
this.form.path = this.selectedNodePath;
|
||||
console.log("aaa=",this.form.path)
|
||||
console.log('aaa=', this.form.path);
|
||||
});
|
||||
}
|
||||
done();
|
||||
|
|
@ -628,8 +630,8 @@ export default {
|
|||
this.loading = true;
|
||||
let data = {
|
||||
...params,
|
||||
pageNum:page.currentPage,
|
||||
pageSize:page.pageSize,
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
parentId: this.treeDeptId
|
||||
};
|
||||
getArchivalCatalogueListApi(data).then(res => {
|
||||
|
|
@ -637,7 +639,7 @@ export default {
|
|||
this.page.total = data.total;
|
||||
this.data = data.rows;
|
||||
this.loading = false;
|
||||
if(data.rows.length){
|
||||
if (data.rows.length) {
|
||||
this.selectedNodePath = data.rows[0].path;
|
||||
}
|
||||
this.selectionClear();
|
||||
|
|
@ -647,7 +649,7 @@ export default {
|
|||
selectionClear() {
|
||||
this.selectionList = [];
|
||||
this.$refs.crud.toggleSelection();
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -656,31 +658,71 @@ export default {
|
|||
.full-height {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.box {
|
||||
height: 800px;
|
||||
}
|
||||
|
||||
.el-scrollbar {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.box .el-scrollbar__wrap {
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
.icon-op {
|
||||
font-size: 16px;
|
||||
margin-left: 6px;
|
||||
color: #409EFF;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.icon-op:hover {
|
||||
color: #66b1ff;
|
||||
}
|
||||
|
||||
.left-panel {
|
||||
border-right: 1px solid #e6e6e6;
|
||||
}
|
||||
|
||||
.right-panel {
|
||||
padding-left: 16px;
|
||||
}
|
||||
|
||||
.right-basic {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* 确保整行可 hover */
|
||||
.tree-node-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 4px 8px; /* 根据实际调整 */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 默认隐藏操作图标 */
|
||||
.tree-node-row .node-actions .icon-op {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transition: opacity 0.2s ease;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
/* 鼠标 hover 整行时显示 */
|
||||
.tree-node-row:hover .node-actions .icon-op {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
/* 可选:让操作区不占用布局空间(始终 reserve 位置) */
|
||||
.tree-node-row .node-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue