更换手机端法规库标准体系树接口

This commit is contained in:
zyn
2023-10-11 09:54:49 +08:00
parent 59e39ef5a5
commit 3d917dec00
2 changed files with 37 additions and 12 deletions
@@ -10,7 +10,7 @@
<van-icon name="cross" size="22px" @click="handleCancel" /> <van-icon name="cross" size="22px" @click="handleCancel" />
</h3> </h3>
<div class="popup-main"> <div class="popup-main">
<standardSystemTree ref="standardSystemTreeRef" @checkedKey="getCheckedKey"></standardSystemTree> <standardSystemTree ref="standardSystemTreeRef" :data="standardSystemTreeData" :loading="loading" @checkedKey="getCheckedKey"></standardSystemTree>
</div> </div>
<div class="popup-footer"> <div class="popup-footer">
<el-button class="common-button-primary" size="mini" icon="el-icon-check" type="primary" @click="handleOk">确定</el-button> <el-button class="common-button-primary" size="mini" icon="el-icon-check" type="primary" @click="handleOk">确定</el-button>
@@ -30,6 +30,8 @@ export default {
return { return {
popupShow: true, popupShow: true,
checkedKeys: [], // 选择的标准体系 checkedKeys: [], // 选择的标准体系
standardSystemTreeData: [],
loading: false
} }
}, },
props: { props: {
@@ -39,8 +41,12 @@ export default {
required: true required: true
} }
}, },
created () {
this.getData()
},
methods: { methods: {
open () { open () {
this.getData()
this.$refs.standardSystemTreeRef.setCheckedKeys(this.initKeys) this.$refs.standardSystemTreeRef.setCheckedKeys(this.initKeys)
this.popupShow = true this.popupShow = true
}, },
@@ -68,6 +74,17 @@ export default {
// this.open() // this.open()
// } // }
}, },
async getData () {
const res = await this.$http._getData('lawss/sarMenuStandardLimit/getListStandLimit',{
dicId:'9m4qqqaansxmox5e82zm'
},{
_this:this,
loading: 'loading'
})
if (res.ok && res.data) {
this.standardSystemTreeData = res.data
}
},
} }
} }
</script> </script>
@@ -1,8 +1,15 @@
<template> <template>
<el-tree class="popup-tree" ref="tree" :data="data" :props="defaultProps" <div>
<loading :loading="loading">加载中...</loading>
<el-tree
class="popup-tree"
ref="tree"
:data="data"
:props="defaultProps"
:lazy="false" :lazy="false"
:show-checkbox="true" :show-checkbox="true"
node-key="id" node-key="id"
:default-expanded-keys="['aaaaaaaaaaaaaaaaaaaaaa']"
:check-strictly="true" :check-strictly="true"
:expand-on-click-node="false" :expand-on-click-node="false"
:check-on-click-node="true" :check-on-click-node="true"
@@ -11,6 +18,7 @@
@node-click="handleNodeClick" @node-click="handleNodeClick"
@check-change="handleCheckChange"> @check-change="handleCheckChange">
</el-tree> </el-tree>
</div>
</template> </template>
<script> <script>
@@ -18,7 +26,7 @@ export default {
name: "standardSystemTree", name: "standardSystemTree",
data () { data () {
return { return {
data: [], // data: [],
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'menuName' label: 'menuName'
@@ -27,17 +35,17 @@ export default {
checkedKeys: [] checkedKeys: []
} }
}, },
created () { props: {
this.getStandardSystem() data: {
type: Array,
required: true
},
loading: {
type: Boolean,
default: false
}
}, },
methods: { methods: {
getStandardSystem () {
this.$http._getData('sys/dictype/getDicTypeListCode').then(res => {
if (res.ok && res.data) {
this.data = res.data.TXLBBUSS // 标准体系
}
})
},
handleNodeClick (data, node, element) { handleNodeClick (data, node, element) {
// console.log(data, node, element) // console.log(data, node, element)
}, },