update 文档拆分详情树节点模糊查询
This commit is contained in:
@@ -137,13 +137,13 @@ export default {
|
|||||||
columns: [
|
columns: [
|
||||||
// 标准号
|
// 标准号
|
||||||
{
|
{
|
||||||
dataIndex: 'serialNumber',
|
dataIndex: 'standardNumber',
|
||||||
title: this.$t('standardSelect.standardNumber'),
|
title: this.$t('standardSelect.standardNumber'),
|
||||||
width: 150
|
width: 150
|
||||||
},
|
},
|
||||||
// 标准名称
|
// 标准名称
|
||||||
{
|
{
|
||||||
dataIndex: 'title',
|
dataIndex: 'standardName',
|
||||||
title: this.$t('standardSelect.standardName'),
|
title: this.$t('standardSelect.standardName'),
|
||||||
width: 150
|
width: 150
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,9 +6,7 @@
|
|||||||
<a-input-search class="tree-search" v-model="searchValue" :placeholder="$t('nodeQuickLookup')" @search="onSearch" />
|
<a-input-search class="tree-search" v-model="searchValue" :placeholder="$t('nodeQuickLookup')" @search="onSearch" />
|
||||||
<div class="page-tree-box page-tree-box-has-search">
|
<div class="page-tree-box page-tree-box-has-search">
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<a-tree :show-line="true" :show-icon="false" :tree-data="treeData"
|
<a-tree :show-line="true" :show-icon="true" :tree-data="treeData" :selected-keys="selectedKeys">
|
||||||
:replace-fields="{key: 'id', title: 'name'}" :selected-keys="selectedKeys">
|
|
||||||
|
|
||||||
<template #title="record">
|
<template #title="record">
|
||||||
<div class="tree-operate-node"
|
<div class="tree-operate-node"
|
||||||
@mouseenter="handleTreeMouseover(record.id)"
|
@mouseenter="handleTreeMouseover(record.id)"
|
||||||
@@ -328,50 +326,19 @@ export default {
|
|||||||
// 获取左侧目录数据
|
// 获取左侧目录数据
|
||||||
loadMenuData () {
|
loadMenuData () {
|
||||||
const params = {
|
const params = {
|
||||||
infoId: this.infoId
|
infoId: this.infoId,
|
||||||
|
name: this.searchValue
|
||||||
}
|
}
|
||||||
this.loading = true
|
this.loading = true
|
||||||
getClauseTreeData(params).then(res => {
|
getClauseTreeData(params).then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.data = this.toTree(res.result)
|
this.treeData = res.result || []
|
||||||
this.treeData = [...this.data]
|
console.log(this.treeData)
|
||||||
// this.treeData = res.result || []
|
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 将数据拼成树形结构
|
|
||||||
toTree (config) {
|
|
||||||
// 删除 所有 children,以防止多次调用
|
|
||||||
config.forEach(function (item) {
|
|
||||||
delete item.children
|
|
||||||
})
|
|
||||||
// 将数据存储为 以 id 为 KEY 的 map 索引数据列
|
|
||||||
const map = {}
|
|
||||||
config.forEach((item) => {
|
|
||||||
if (!item.name) {
|
|
||||||
item.name = ''
|
|
||||||
}
|
|
||||||
item.label = item.name
|
|
||||||
item.key = item.id
|
|
||||||
item.title = item.name + (item.itemName ? ' ' + item.itemName : '')
|
|
||||||
map[item.id] = item
|
|
||||||
})
|
|
||||||
const val = []
|
|
||||||
config.forEach((item) => {
|
|
||||||
// 以当前遍历项,的pid,去map对象中找到索引的id
|
|
||||||
const parent = map[item.pid]
|
|
||||||
// 如果找到索引,那么说明此项不在顶级当中,那么需要把此项添加到,他对应的父级中
|
|
||||||
if (parent) {
|
|
||||||
(parent.children || (parent.children = [])).push(item)
|
|
||||||
} else {
|
|
||||||
// 如果没有在map中找到对应的索引ID,那么直接把 当前的item添加到 val结果集中,作为顶级
|
|
||||||
val.push(item)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return val
|
|
||||||
},
|
|
||||||
// 用于点击空白处隐藏增删改菜单
|
// 用于点击空白处隐藏增删改菜单
|
||||||
clearMenu () {
|
clearMenu () {
|
||||||
this.nodeTreeItem = null
|
this.nodeTreeItem = null
|
||||||
@@ -553,7 +520,7 @@ export default {
|
|||||||
this.loadMenuData()
|
this.loadMenuData()
|
||||||
},
|
},
|
||||||
onSearch () {
|
onSearch () {
|
||||||
|
this.loadMenuData()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
|
|||||||
@@ -99,26 +99,26 @@ export default {
|
|||||||
columns: [
|
columns: [
|
||||||
// 资料类型
|
// 资料类型
|
||||||
{
|
{
|
||||||
dataIndex: '1',
|
dataIndex: 'origin_dictText',
|
||||||
title: this.$t('docTool.split.dataType'),
|
title: this.$t('docTool.split.dataType'),
|
||||||
width: 150
|
width: 150
|
||||||
},
|
},
|
||||||
// 标准号
|
// 标准号
|
||||||
{
|
{
|
||||||
dataIndex: 'serial_number',
|
dataIndex: 'standardNumber',
|
||||||
title: this.$t('standardSelect.standardNumber'),
|
title: this.$t('standardSelect.standardNumber'),
|
||||||
width: 150
|
width: 150
|
||||||
},
|
},
|
||||||
// 标准名称
|
// 标准名称
|
||||||
{
|
{
|
||||||
dataIndex: 'title',
|
dataIndex: 'standardName',
|
||||||
title: this.$t('standardSelect.standardName'),
|
title: this.$t('standardSelect.standardName'),
|
||||||
width: 150
|
width: 150
|
||||||
},
|
},
|
||||||
// 文件状态
|
// 文件状态
|
||||||
{
|
{
|
||||||
dataIndex: 'text_info',
|
dataIndex: 'text_info',
|
||||||
title: this.$t('docTool.split.fileStatus'),
|
title: this.$t('docTool.comparison.textStatus'),
|
||||||
width: 150
|
width: 150
|
||||||
},
|
},
|
||||||
// 附件
|
// 附件
|
||||||
|
|||||||
Reference in New Issue
Block a user