feature(政策入库流程): 添加政策体系字段

This commit is contained in:
zyn
2024-01-25 11:41:05 +08:00
parent f275e3af85
commit 9424197fc4
4 changed files with 125 additions and 0 deletions
@@ -0,0 +1,80 @@
<template>
<el-drawer
title="政策体系"
:visible.sync="visible"
>
<div style="flex: 1">
<el-tree
ref="tree"
:data="treeList"
:props="defaultProps"
node-key="id"
highlight-current
:expand-on-click-node="false"
/>
</div>
<div class="demo-drawer-footer" style="height: 51px">
<el-button size="mini" @click="cancel">取消</el-button>
<el-button size="mini" type="primary" @click="submit">确定</el-button>
</div>
</el-drawer>
</template>
<script>
export default {
name: 'PolicyTree',
data () {
return {
visible: false,
getListStand: 'sarResource/ts-resource/getListStand',
treeList: [],
defaultProps: {
children: 'children',
label: 'menuName'
},
}
},
mounted () {
this.getList()
},
methods: {
getList () {
this.$http._getData(this.getListStand, {
sorDivide: 'FOREIGN_LAWS',
userId: this.$store.getters.userInfo.userId
}).then(res => {
if (res.ok) {
this.treeList = res.data
}
})
},
open (key) {
this.visible = true
this.$nextTick(() => {
key === '' ?
this.$refs.tree.setCurrentKey() :
this.$refs.tree.setCurrentKey(key)
})
},
cancel () {
this.visible = false
},
submit () {
const currentNode = this.$refs.tree.getCurrentNode()
if (!currentNode) {
this.$message({
message: '请选择政策体系',
type: 'warning'
})
return
}
this.$emit('choose', currentNode)
this.cancel()
}
}
}
</script>
<style scoped>
</style>