update 国内标准体系联调、车型项目库详情、用户新增编辑开启工号字段
This commit is contained in:
@@ -2,44 +2,51 @@
|
||||
<a-card :bordered="false" class="page-left-right-layout">
|
||||
<!-- 树部分-->
|
||||
<div class="page-left-box">
|
||||
<!-- $t('standardRegulationLibrary.domesticStandard.treeSearchPlaceholder')-->
|
||||
<a-input-search v-model="treeInput" :placeholder="$t('standardRegulationLibrary.domesticStandard.treeSearchPlaceholder')"
|
||||
@search="handleTreeSearch" />
|
||||
<a-tree :show-line="true" :show-icon="true" :tree-data="treeData" :selected-keys="selectedTreeKeys">
|
||||
<a-icon type="folder" slot="folder" class="tree-icon" />
|
||||
<a-spin :spinning="loading">
|
||||
<!-- $t('standardRegulationLibrary.domesticStandard.treeSearchPlaceholder')-->
|
||||
<a-input-search v-model="treeInput"
|
||||
:placeholder="$t('standardRegulationLibrary.domesticStandard.treeSearchPlaceholder')"
|
||||
@search="handleTreeSearch" />
|
||||
<a-tree :show-line="true" :show-icon="true" :tree-data="treeData">
|
||||
<a-icon type="folder" slot="folder" class="tree-icon" />
|
||||
<a-icon type="file" slot="file" class="tree-icon" />
|
||||
|
||||
<template #custom="record">
|
||||
<div class="tree-operate-node"
|
||||
@mouseenter="handleTreeMouseover(record.key)"
|
||||
@mouseleave="handleTreeMouseout(record.key)"
|
||||
@click="handleSelectTreeNode(record)">
|
||||
<a-tooltip>
|
||||
<template #title>
|
||||
{{ record.nodeName }}
|
||||
<template #custom="record">
|
||||
<div class="tree-operate-node"
|
||||
@mouseenter="handleTreeMouseover(record.key)"
|
||||
@mouseleave="handleTreeMouseout(record.key)"
|
||||
@click="handleSelectTreeNode(record)">
|
||||
<a-tooltip>
|
||||
<template #title>
|
||||
{{ record.nodeName }}
|
||||
</template>
|
||||
<span class="tree-node-custom-title">{{ record.nodeName }}</span>
|
||||
</a-tooltip>
|
||||
<template v-if="record.key === mouseInNodeKey">
|
||||
<!-- 新增-->
|
||||
<a-button icon="plus"
|
||||
class="tree-operate-node-btn"
|
||||
@click.stop="handleAddTreeNode(record)"
|
||||
v-has="'domesticStandard:tree:add'"></a-button>
|
||||
<!-- 编辑,根节点不能编辑-->
|
||||
<a-button class="tree-operate-node-btn"
|
||||
@click.stop="handleEditTreeNode(record)"
|
||||
v-has="'domesticStandard:tree:edit'"
|
||||
v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value">
|
||||
<i class="iconfont icon-bianji" />
|
||||
</a-button>
|
||||
<!-- 删除,根节点不能删除-->
|
||||
<a-button class="tree-operate-node-btn"
|
||||
v-has="'domesticStandard:tree:delete'"
|
||||
v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value"
|
||||
@click.stop="handleDelTreeNode(record)">
|
||||
<i class="iconfont icon-shanchu_" />
|
||||
</a-button>
|
||||
</template>
|
||||
<span class="tree-node-custom-title">{{ record.nodeName }}</span>
|
||||
</a-tooltip>
|
||||
<template v-if="record.key === mouseInNodeKey">
|
||||
<!-- 新增-->
|
||||
<a-button icon="plus"
|
||||
class="tree-operate-node-btn"
|
||||
@click.stop="handleAddTreeNode(record)"
|
||||
v-has="'domesticStandard:tree:add'"></a-button>
|
||||
<!-- 编辑-->
|
||||
<a-button class="tree-operate-node-btn" @click.stop="handleEditTreeNode(record)" v-has="'domesticStandard:tree:edit'">
|
||||
<i class="iconfont icon-bianji" />
|
||||
</a-button>
|
||||
<!-- 删除,根节点不能删除-->
|
||||
<a-button class="tree-operate-node-btn"
|
||||
v-has="'domesticStandard:tree:delete'"
|
||||
v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value"
|
||||
@click.stop="handleDelTreeNode(record)">
|
||||
<i class="iconfont icon-shanchu_" />
|
||||
</a-button>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</a-tree>
|
||||
</div>
|
||||
</template>
|
||||
</a-tree>
|
||||
</a-spin>
|
||||
</div>
|
||||
<!-- 表格部分-->
|
||||
<div class="page-right-box">
|
||||
@@ -178,41 +185,19 @@ import Search from '../../../components/customField/Search.vue'
|
||||
import JTable from '../../../components/jero/JTable.vue'
|
||||
import DomesticStandardModal from './modules/DomesticStandardModal.vue'
|
||||
import {
|
||||
getDomesticStandardTableHeader,
|
||||
getDomesticStandardSearchForm,
|
||||
shareDomesticStandard,
|
||||
deleteDomesticSystemTree,
|
||||
configDomesticStandard,
|
||||
removeDomesticStandard
|
||||
deleteDomesticSystemTree,
|
||||
getDomesticStandardSearchForm,
|
||||
getDomesticStandardTableHeader,
|
||||
getDomesticStandardTree,
|
||||
removeDomesticStandard,
|
||||
shareDomesticStandard
|
||||
} from '../../../api/standardRegulationLibraryApi'
|
||||
import { YesOrNoEnum, StandardSystemTreeNodeType, TagsTypeEnums } from '../../../enums/commonEnums'
|
||||
import { StandardSystemTreeNodeType, TagsTypeEnums, YesOrNoEnum } from '../../../enums/commonEnums'
|
||||
import UserSelectModal from '../../../components/selection/UserSelectModal.vue'
|
||||
import DomesticSystemTreeModal from './modules/DomesticSystemTreeModal.vue'
|
||||
import StandardSelectionModal from '../../../components/selection/StandardSelectionModal.vue'
|
||||
|
||||
const apiTreeData = [
|
||||
{
|
||||
nodeName: 'parent 1',
|
||||
key: '0-0',
|
||||
nodeType: '1',
|
||||
child: [
|
||||
{
|
||||
nodeName: '张晨成',
|
||||
key: '0-0-0',
|
||||
child: [
|
||||
{ nodeName: 'leaf', key: '0-0-0-0' },
|
||||
{ nodeName: 'leaf', key: '0-0-0-1' }
|
||||
]
|
||||
},
|
||||
{
|
||||
nodeName: 'parent 1-1',
|
||||
key: '0-0-1',
|
||||
child: [{ key: '0-0-1-0', nodeName: 'zcvc' }]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
export default {
|
||||
name: 'DomesticStandardList',
|
||||
components: { Search, JTable, DomesticStandardModal, UserSelectModal, DomesticSystemTreeModal, StandardSelectionModal },
|
||||
@@ -280,7 +265,14 @@ export default {
|
||||
* 获取树数据
|
||||
*/
|
||||
initTreeData () {
|
||||
this.treeData = this.dealTreeData(apiTreeData)
|
||||
getDomesticStandardTree().then(res => {
|
||||
if (res.success) {
|
||||
const treeData = res.result || []
|
||||
this.treeData = this.dealTreeData(treeData)
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 处理树数据,加入自定义的节点插槽
|
||||
@@ -289,11 +281,13 @@ export default {
|
||||
*/
|
||||
dealTreeData (treeData) {
|
||||
return treeData.map(item => {
|
||||
if (item.child && item.child.length > 0) {
|
||||
if (item.children && item.children.length > 0) {
|
||||
item.scopedSlots = { icon: 'folder', title: 'custom' }
|
||||
item.children = this.dealTreeData(item.children)
|
||||
} else if (item.nodeType === StandardSystemTreeNodeType.ROOT_NODE.value) {
|
||||
item.scopedSlots = { icon: 'folder', title: 'custom' }
|
||||
item.children = this.dealTreeData(item.child)
|
||||
} else {
|
||||
item.scopedSlots = { title: 'custom' }
|
||||
item.scopedSlots = { icon: 'file', title: 'custom' }
|
||||
}
|
||||
return item
|
||||
})
|
||||
@@ -382,7 +376,7 @@ export default {
|
||||
* @param dataRef
|
||||
*/
|
||||
handleAddTreeNode ({ dataRef }) {
|
||||
this.$refs.treeModal.add({ parentId: dataRef.key })
|
||||
this.$refs.treeModal.add({ parentId: dataRef.id, parentCode: dataRef.nodeCode })
|
||||
},
|
||||
/**
|
||||
* 编辑树节点
|
||||
@@ -400,7 +394,7 @@ export default {
|
||||
title: this.$t('confirmDeletion'),
|
||||
content: this.$t('areYouSure'),
|
||||
onOk: () => {
|
||||
deleteDomesticSystemTree({ ids: dataRef.id }).then((res) => {
|
||||
deleteDomesticSystemTree({ id: dataRef.id }).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.modalFormOk()
|
||||
@@ -537,4 +531,8 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .ant-tree li span.ant-tree-switcher.ant-tree-switcher-noop {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
+2
-1
@@ -13,7 +13,7 @@
|
||||
<a-input :placeholder="$t('pleaseEnter') + $t('standardRegulationLibrary.nodeName')"
|
||||
@change="event => event.target.value = event.target.value.trim()"
|
||||
:maxLength="50"
|
||||
v-decorator="[ 'nodeName', validatorRules.nodeName]" />
|
||||
v-decorator="['nodeName', validatorRules.nodeName]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
|
||||
@@ -69,6 +69,7 @@ export default {
|
||||
if (!err) {
|
||||
this.confirmLoading = true
|
||||
const formData = Object.assign(this.model, values)
|
||||
formData.nodeOrder = '0'
|
||||
let submitFunc
|
||||
if (this.model.id) {
|
||||
submitFunc = editDomesticSystemTree
|
||||
|
||||
Reference in New Issue
Block a user