修改推送的懒加载

This commit is contained in:
qq787203167
2022-03-24 10:29:07 +08:00
parent 08ed9f9c63
commit 8619773213
3 changed files with 23 additions and 139 deletions
@@ -37,148 +37,14 @@
</template> </template>
<script> <script>
import { getAction, postAction } from '@/api/manage'
export default { export default {
name: 'index', name: 'index',
props: ['query', 'value'], props: ['query', 'value'],
data(){ data(){
return{ return{
loading:true, loading:true,
gData:[ gData:[],
{
title: 'parent 1',
key: '0-0',
children: [
{
title: '张晨成',
key: '0-0-0',
disabled: true,
children: [
{ title: 'leaf', key: '0-0-0-0' },
{ title: 'leaf', key: '0-0-0-1' },
],
},
{
title: 'parent 1-1',
key: '0-0-1',
children: [{ key: '0-0-1-0', title: 'zcvc' }],
},
],
}, {
title: 'parent 1',
key: '0-0',
children: [
{
title: '张晨成',
key: '0-0-0',
disabled: true,
children: [
{ title: 'leaf', key: '0-0-0-0' },
{ title: 'leaf', key: '0-0-0-1' },
],
},
{
title: 'parent 1-1',
key: '0-0-1',
children: [{ key: '0-0-1-0', title: 'zcvc' }],
},
],
}, {
title: 'parent 1',
key: '0-0',
children: [
{
title: '张晨成',
key: '0-0-0',
disabled: true,
children: [
{ title: 'leaf', key: '0-0-0-0' },
{ title: 'leaf', key: '0-0-0-1' },
],
},
{
title: 'parent 1-1',
key: '0-0-1',
children: [{ key: '0-0-1-0', title: 'zcvc' }],
},
],
}, {
title: 'parent 1',
key: '0-0',
children: [
{
title: '张晨成',
key: '0-0-0',
disabled: true,
children: [
{ title: 'leaf', key: '0-0-0-0' },
{ title: 'leaf', key: '0-0-0-1' },
],
},
{
title: 'parent 1-1',
key: '0-0-1',
children: [{ key: '0-0-1-0', title: 'zcvc' }],
},
],
}, {
title: 'parent 1',
key: '0-0',
children: [
{
title: '张晨成',
key: '0-0-0',
disabled: true,
children: [
{ title: 'leaf', key: '0-0-0-0' },
{ title: 'leaf', key: '0-0-0-1' },
],
},
{
title: 'parent 1-1',
key: '0-0-1',
children: [{ key: '0-0-1-0', title: 'zcvc' }],
},
],
}, {
title: 'parent 1',
key: '0-0',
children: [
{
title: '张晨成',
key: '0-0-0',
disabled: true,
children: [
{ title: 'leaf', key: '0-0-0-0' },
{ title: 'leaf', key: '0-0-0-1' },
],
},
{
title: 'parent 1-1',
key: '0-0-1',
children: [{ key: '0-0-1-0', title: 'zcvc' }],
},
],
}, {
title: 'parent 1',
key: '0-0',
children: [
{
title: '张晨成',
key: '0-0-0',
disabled: true,
children: [
{ title: 'leaf', key: '0-0-0-0' },
{ title: 'leaf', key: '0-0-0-1' },
],
},
{
title: 'parent 1-1',
key: '0-0-1',
children: [{ key: '0-0-1-0', title: 'zcvc' }],
},
],
},
],
autoExpandParent: true, autoExpandParent: true,
expandedKeys:[], expandedKeys:[],
visible: false, visible: false,
@@ -210,6 +76,17 @@
onChange(){ onChange(){
}, },
queryDepartUserTreeList() {
this.confirmLoading = true
getAction('sys/user/queryDepartUserTreeList', { departId: this.departId }).then((res) => {
this.confirmLoading = false
if (res.success) {
this.gData = res.result
} else {
this.gData = []
}
})
},
}, },
} }
</script> </script>
@@ -139,7 +139,7 @@
</div> </div>
</a-col> </a-col>
<a-col :span="24" v-else-if="item.field_show_type === '9'"> <a-col :span="24" v-else-if="item.field_show_type === '9' || item.field_show_type == 'sel_user'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.field_must_input == 1">*</span> <span class="Required" v-if="item.field_must_input == 1">*</span>
@@ -58,7 +58,7 @@
} }
}, },
mounted() { mounted() {
this.queryDepartUserTreeList()
}, },
methods: { methods: {
getPush(data) { getPush(data) {
@@ -108,7 +108,14 @@
}, },
queryDepartUserTreeList() { queryDepartUserTreeList() {
this.confirmLoading = true this.confirmLoading = true
getAction('sys/user/queryDepartUserTreeList', { departId: this.departId }).then((res) => { let gData = JSON.parse(JSON.stringify(this.gData))
if (gData && gData.length > 0) {
gData = JSON.stringify(gData)
}
postAction('sys/user/queryDepartUserTreeList', {
departId: this.departId,
json: gData
}).then((res) => {
this.confirmLoading = false this.confirmLoading = false
if (res.success) { if (res.success) {
this.gData = res.result this.gData = res.result