Commit 3f66451e by 无尘

fix: 修改加载数据

parent 35c73788
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>好办管理平台</title><link rel=stylesheet type=text/css href=//web-1251519181.file.myqcloud.com/custom-element/custom-element.1.0.24.css><link href=./static/css/app.d33922c2ac6c2f292a6bbdceec82e159.css rel=stylesheet></head><body style="min-width: 1400px;" class=damolish><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.04.js></script><script>// Raven.config('https://3715a345910d4c768e7a1ec14619c2d5@sentry.io/1413672').install();</script><script type=text/javascript src=./static/js/manifest.d18538165d277e62daad.js></script><script type=text/javascript src=./static/js/vendor.335cad076562a197329f.js></script><script type=text/javascript src=./static/js/app.55a0cb0b72cf6df9cf7f.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>好办管理平台</title><link rel=stylesheet type=text/css href=//web-1251519181.file.myqcloud.com/custom-element/custom-element.1.0.24.css><link href=./static/css/app.62664f255d95056837bd6c49781c96cc.css rel=stylesheet></head><body style="min-width: 1400px;" class=damolish><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.04.js></script><script>// Raven.config('https://3715a345910d4c768e7a1ec14619c2d5@sentry.io/1413672').install();</script><script type=text/javascript src=./static/js/manifest.6be0a64dbb5fbe6a8e7f.js></script><script type=text/javascript src=./static/js/vendor.335cad076562a197329f.js></script><script type=text/javascript src=./static/js/app.55a0cb0b72cf6df9cf7f.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){var a=window.webpackJsonp;window.webpackJsonp=function(c,b,n){for(var r,t,o,i=0,u=[];i<c.length;i++)t=c[i],d[t]&&u.push(d[t][0]),d[t]=0;for(r in b)Object.prototype.hasOwnProperty.call(b,r)&&(e[r]=b[r]);for(a&&a(c,b,n);u.length;)u.shift()();if(n)for(i=0;i<n.length;i++)o=f(f.s=n[i]);return o};var c={},d={58:0};function f(a){if(c[a])return c[a].exports;var d=c[a]={i:a,l:!1,exports:{}};return e[a].call(d.exports,d,d.exports,f),d.l=!0,d.exports}f.e=function(e){var a=d[e];if(0===a)return new Promise(function(e){e()});if(a)return a[2];var c=new Promise(function(c,f){a=d[e]=[c,f]});a[2]=c;var b=document.getElementsByTagName("head")[0],n=document.createElement("script");n.type="text/javascript",n.charset="utf-8",n.async=!0,n.timeout=12e4,f.nc&&n.setAttribute("nonce",f.nc),n.src=f.p+"static/js/"+e+"."+{0:"83a072cec90957dd8f55",1:"06c4e42e62c1f75191f0",2:"1441f3b0a7a4d6f65301",3:"eab247ccd84a997b8c8d",4:"b1b70b72a2056a444bf9",5:"d4caf87b1116172ee258",6:"0f70421ba87368bd298c",7:"90d30d8c00a90b9333db",8:"113a01cbde4f9dc49579",9:"32124306f51addce87d6",10:"2cd7b84af97cebc94561",11:"4f74c2560b17f99d9138",12:"157592ccccfa257add4a",13:"0d68645672dcb454f898",14:"9b0fd682e7ff9de7493b",15:"29cae9284cd18c5b808b",16:"12b6ab72b571e6a73456",17:"4222227083825101d06f",18:"1dfa0a3b4d4d47e3ac5d",19:"0204c6cb4ef2cb194122",20:"94895617563b8bf7b676",21:"f34b5b7d7ed709a81ced",22:"51cad6c06a4346ad3d98",23:"aa2316fd5ccdeef3be73",24:"496cf15d85085c983f9a",25:"1c54fdb2f2e8a6093ec4",26:"9f12894d65bf5d1ab991",27:"217dc34d1a705f1d98da",28:"dd640edca207ff7b4253",29:"7d6c9d10137d4d7d3844",30:"1334efac7a44d3caa4ef",31:"ba62ea98b639eaa74411",32:"9c8c613cfefcd805f405",33:"8ddfca621d99bf4d559e",34:"14e6e7e735c37f03b612",35:"6d5fa42b3d602a57463a",36:"809e47d23b218f52f636",37:"860a72f76833353f798d",38:"3f861eca97b1c8871a06",39:"7b282fabac2507c85ac7",40:"53becd7862834557ce9a",41:"18d9be7099b9f4f60188",42:"0bab3b078dce6ba8de09",43:"55ceed7d0eee798713ae",44:"dc7cbe13e01626016eaf",45:"779a749f328ebdad6494",46:"2854cfc5dfc7bf9c8c6a",47:"92eb14302f83a336d9e1",48:"7924df130d5da2e421e2",49:"1172d8a0393b3303db5a",50:"5ab5fda7e3b1566f6715",51:"a7277fbe98145edd7729",52:"430cd7d5ca507f1b9672",53:"bdf7402197597faaef29",54:"cab6ce716d545d15caf9",55:"9271504a8071ec123f01"}[e]+".js";var r=setTimeout(t,12e4);function t(){n.onerror=n.onload=null,clearTimeout(r);var a=d[e];0!==a&&(a&&a[1](new Error("Loading chunk "+e+" failed.")),d[e]=void 0)}return n.onerror=n.onload=t,b.appendChild(n),c},f.m=e,f.c=c,f.d=function(e,a,c){f.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:c})},f.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(a,"a",a),a},f.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},f.p="./",f.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
!function(e){var a=window.webpackJsonp;window.webpackJsonp=function(c,b,n){for(var r,t,o,i=0,u=[];i<c.length;i++)t=c[i],d[t]&&u.push(d[t][0]),d[t]=0;for(r in b)Object.prototype.hasOwnProperty.call(b,r)&&(e[r]=b[r]);for(a&&a(c,b,n);u.length;)u.shift()();if(n)for(i=0;i<n.length;i++)o=f(f.s=n[i]);return o};var c={},d={58:0};function f(a){if(c[a])return c[a].exports;var d=c[a]={i:a,l:!1,exports:{}};return e[a].call(d.exports,d,d.exports,f),d.l=!0,d.exports}f.e=function(e){var a=d[e];if(0===a)return new Promise(function(e){e()});if(a)return a[2];var c=new Promise(function(c,f){a=d[e]=[c,f]});a[2]=c;var b=document.getElementsByTagName("head")[0],n=document.createElement("script");n.type="text/javascript",n.charset="utf-8",n.async=!0,n.timeout=12e4,f.nc&&n.setAttribute("nonce",f.nc),n.src=f.p+"static/js/"+e+"."+{0:"83a072cec90957dd8f55",1:"06c4e42e62c1f75191f0",2:"1441f3b0a7a4d6f65301",3:"92b8ff702ab4b1a2f70f",4:"b1b70b72a2056a444bf9",5:"ff1725b10d20a33ded19",6:"0f70421ba87368bd298c",7:"90d30d8c00a90b9333db",8:"113a01cbde4f9dc49579",9:"32124306f51addce87d6",10:"2cd7b84af97cebc94561",11:"4f74c2560b17f99d9138",12:"157592ccccfa257add4a",13:"0d68645672dcb454f898",14:"9b0fd682e7ff9de7493b",15:"29cae9284cd18c5b808b",16:"12b6ab72b571e6a73456",17:"4222227083825101d06f",18:"1dfa0a3b4d4d47e3ac5d",19:"0204c6cb4ef2cb194122",20:"94895617563b8bf7b676",21:"f34b5b7d7ed709a81ced",22:"51cad6c06a4346ad3d98",23:"aa2316fd5ccdeef3be73",24:"496cf15d85085c983f9a",25:"1c54fdb2f2e8a6093ec4",26:"9f12894d65bf5d1ab991",27:"217dc34d1a705f1d98da",28:"dd640edca207ff7b4253",29:"7d6c9d10137d4d7d3844",30:"1334efac7a44d3caa4ef",31:"ba62ea98b639eaa74411",32:"9c8c613cfefcd805f405",33:"8ddfca621d99bf4d559e",34:"14e6e7e735c37f03b612",35:"6d5fa42b3d602a57463a",36:"809e47d23b218f52f636",37:"860a72f76833353f798d",38:"3f861eca97b1c8871a06",39:"7b282fabac2507c85ac7",40:"53becd7862834557ce9a",41:"18d9be7099b9f4f60188",42:"0bab3b078dce6ba8de09",43:"55ceed7d0eee798713ae",44:"dc7cbe13e01626016eaf",45:"779a749f328ebdad6494",46:"2854cfc5dfc7bf9c8c6a",47:"92eb14302f83a336d9e1",48:"7924df130d5da2e421e2",49:"1172d8a0393b3303db5a",50:"5ab5fda7e3b1566f6715",51:"a7277fbe98145edd7729",52:"430cd7d5ca507f1b9672",53:"bdf7402197597faaef29",54:"cab6ce716d545d15caf9",55:"9271504a8071ec123f01"}[e]+".js";var r=setTimeout(t,12e4);function t(){n.onerror=n.onload=null,clearTimeout(r);var a=d[e];0!==a&&(a&&a[1](new Error("Loading chunk "+e+" failed.")),d[e]=void 0)}return n.onerror=n.onload=t,b.appendChild(n),c},f.m=e,f.c=c,f.d=function(e,a,c){f.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:c})},f.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(a,"a",a),a},f.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},f.p="./",f.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2019-08-14 16:51:07
* @LastEditors: 无尘
* @LastEditTime: 2020-03-21 13:52:37
* @LastEditTime: 2020-03-21 14:04:46
-->
<!--
<contact-tree :itemData="itemData" v-model="itemData" ></contact-tree>
......@@ -17,7 +17,7 @@ import contactTree from '/components/company/contact-tree.vue';
<li class="contact-li" v-for="(item, index) in itemData" :key="index + 'gic'">
<div :class="['li-cell cursor-pointer', departObj.departmentId == item.departmentId ? 'li-cell-active' : '']" @click="toggleExpand(item)">
<div class="li-cell-p" :style="{ 'margin-left': (item.level + 1) * 20 + 'px' }">
<span :class="['font-12 color-606266', item.isStore == 1 || !item.hasSonNode ? 'color-fff' : '', item.expand ? 'el-icon-caret-bottom' : 'el-icon-caret-right']"></span><span v-if="item.loading" class="el-tree-node__loading-icon el-icon-loading"></span><span :class="['font-14 p-l-10 p-r-10 iconfont', item.isStore == 1 ? 'icondianpu-kuai' : 'iconqiye-tianchong', item.bindFlag == 1 ? 'color-2f54eb' : 'color-dedfe6']"></span><span class="font-14 color-606266 span-departName">{{ item.departmentName }}</span>
<span :class="['font-12 color-606266', item.isStore == 1 || !item.hasSonNode ? 'color-fff' : '', item.expand ? 'el-icon-caret-bottom' : 'el-icon-caret-right']"></span><span v-if="item.loading" class="el-tree-node__loading-icon el-icon-loading"></span><span :class="['font-14 p-r-10 iconfont', !!item.loading ? '' : 'p-l-10', item.isStore == 1 ? 'icondianpu-kuai' : 'iconqiye-tianchong', item.bindFlag == 1 ? 'color-2f54eb' : 'color-dedfe6']"></span><span class="font-14 color-606266 span-departName">{{ item.departmentName }}</span>
</div>
</div>
<li-row v-if="item.expand" :departObj="departObj" :itemData="item.children" @getSelectData="getSelectData"></li-row
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2019-08-14 16:51:07
* @LastEditors: 无尘
* @LastEditTime: 2020-03-21 11:09:05
* @LastEditTime: 2020-03-21 14:12:59
-->
<!--
<org-tree v-if="item.children.length" :itemData="item.children" ></org-tree>
......@@ -16,7 +16,7 @@ import orgTree from './org-tree.vue';
<draggable :list="itemData" class="org-component" :options="leftOption" :move="onMove" @start="isDragging = true" @end="itemMoveEnd">
<li v-for="(item, index) in itemData" :key="index + 'gic'">
<div class="li-cell li-cell-copy cursor-pointer" @click="toggleExpand(item)">
<span :class="['font-12 color-606266', item.isStore == 1 || !item.children.length ? 'color-fff' : '', item.expand ? 'el-icon-caret-bottom' : 'el-icon-caret-right']"></span><span :class="['font-14 p-l-10 p-r-10 iconfont', item.isStore == 1 ? 'icondianpu-kuai' : 'iconqiye-tianchong', item.bindFlag == 1 ? 'color-2f54eb' : 'color-dedfe6']"></span><span class="font-14 color-606266">{{ item.label }}</span>
<span :class="['font-12 color-606266', item.isStore == 1 || !item.children.length ? 'color-fff' : '', item.expand ? 'el-icon-caret-bottom' : 'el-icon-caret-right']"></span><span v-if="item.loading" class="el-tree-node__loading-icon el-icon-loading"></span><span :class="['font-14 p-r-10 iconfont', !!item.loading ? '' : 'p-l-10', item.isStore == 1 ? 'icondianpu-kuai' : 'iconqiye-tianchong', item.bindFlag == 1 ? 'color-2f54eb' : 'color-dedfe6']"></span><span class="font-14 color-606266">{{ item.label }}</span>
</div>
<li-row v-show="!!item.children.length && item.expand" :wxData="wxData" :itemObj="item" :itemData="item.children"></li-row>
</li>
......@@ -75,8 +75,10 @@ export default {
// console.log(item);
item.expand = item.expand ? false : true;
// 点击的时候,如果非门店且子级是空的需要请求获取子级
if (item.isStore == 0 && !item.children.length && !item.loaded) {
if (item.isStore == 0 && !item.children.length && !item.loaded && item.hasSonNode == true) {
item.loading = true;
item.children = await that.getChildData(item);
item.loading = false;
}
},
/**
......@@ -102,6 +104,7 @@ export default {
if (resData.result.length) {
item.loaded = true;
resData.result.forEach(ele => {
ele.loading = false;
ele.expand = false;
ele.children = [];
ele.level = item.level + 1;
......@@ -205,7 +208,9 @@ export default {
that.itemData[index].expand = false;
// 获取子集的时候会加一个加载的标志,来避免移动后重复加载子集
if (!that.itemData[index].loaded && that.itemData[index].isStore == 0 && that.itemData[index].hasSonNode == true) {
that.itemData[index].loading = true;
that.itemData[index].children = await that.getChildData(that.itemData[index]);
that.itemData[index].loading = false;
}
}
}
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2019-08-14 16:51:07
* @LastEditors: 无尘
* @LastEditTime: 2020-03-21 11:09:22
* @LastEditTime: 2020-03-21 14:21:36
-->
<!--
<wx-tree v-model="itemData" ></wx-tree>
......@@ -18,7 +18,7 @@ import wxTree from './wx-tree.vue';
<div class="li-cell cursor-pointer">
<div class="li-cell-inner flex flex-space-between boder-box p-r-20" :style="{ 'margin-left': (item.level + 1) * 20 + 'px' }">
<div class="tree-left" :title="item.gicEnterpriseName" @click="toggleExpand(item)">
<span :class="['font-12 color-606266 el-icon-expand', item.isStore == 1 || !item.hasSonNode ? 'color-fff' : '', item.expand ? 'el-icon-caret-bottom' : 'el-icon-caret-right']"></span><span :class="['font-14 p-l-10 p-r-10 iconfont', item.isStore == 1 ? 'icondianpu-kuai' : 'iconqiye-tianchong', item.bindFlag == 1 ? 'color-2f54eb' : 'color-dedfe6']"></span><span class="font-14 color-606266">{{ item.label }}</span>
<span :class="['font-12 color-606266 el-icon-expand', item.isStore == 1 || !item.hasSonNode ? 'color-fff' : '', item.expand ? 'el-icon-caret-bottom' : 'el-icon-caret-right']"></span><span v-if="item.loading" class="el-tree-node__loading-icon el-icon-loading"></span><span :class="['font-14 p-r-10 iconfont', !!item.loading ? '' : 'p-l-10', item.isStore == 1 ? 'icondianpu-kuai' : 'iconqiye-tianchong', item.bindFlag == 1 ? 'color-2f54eb' : 'color-dedfe6']"></span><span class="font-14 color-606266">{{ item.label }}</span>
</div>
<div class="tree-right">
<el-button v-if="item.isStore == 0" type="text" @click.stop="addChild(item)">添加子部门</el-button>
......@@ -87,16 +87,6 @@ export default {
},
computed: {},
methods: {
findNearestComponent(element, componentName) {
let target = element;
while (target && target.tagName !== 'BODY') {
if (target.__vue__ && target.__vue__.$options.name === componentName) {
return target.__vue__;
}
target = target.parentNode;
}
return null;
},
/**
* 刷新数据
*/
......@@ -440,7 +430,9 @@ export default {
}
// 点击的时候,如果非门店且子级是空的需要请求获取子级
if (item.isStore == 0 && !item.children.length && !item.loaded) {
item.loading = true;
item.children = await that.getChildData(item);
item.loading = false;
}
// 只有展开且不是门店的才会保存
if (item.expand && !item.isStore) {
......@@ -635,6 +627,7 @@ export default {
if (resData.result.length) {
item.loaded = true;
resData.result.forEach(ele => {
ele.loading = false;
ele.expand = false;
ele.children = [];
ele.level = item.level + 1;
......@@ -698,7 +691,9 @@ export default {
that.itemData[index].expand = true;
// 获取子集的时候会加一个加载的标志,来避免移动后重复加载子集
if (!that.itemData[index].loaded && that.itemData[index].isStore == 0 && that.itemData[index].hasSonNode == true) {
that.itemData[index].loading = true;
that.itemData[index].children = await that.getChildData(that.itemData[index]);
that.itemData[index].loading = false;
}
// 拖拽进去
if (that.itemData[index].loaded && !that.itemData[index].children.length) {
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-03-20 15:19:51
* @LastEditTime: 2020-03-21 14:18:09
-->
<template>
<div class="my-customer-wrap common-set-wrap">
......@@ -275,6 +275,7 @@ export default {
if (resData.errorCode == 1) {
if (resData.result.length) {
resData.result.forEach(ele => {
ele.loading = false;
ele.expand = false;
ele.children = [];
ele.level = 0;
......@@ -306,6 +307,7 @@ export default {
if (resData.errorCode == 1) {
if (!!resData.result && resData.result.length) {
resData.result.forEach(ele => {
ele.loading = false;
ele.expand = false;
ele.children = [];
ele.level = 0;
......@@ -399,7 +401,9 @@ export default {
}
// 点击的时候,如果非门店且子级是空的需要请求获取子级
if (item.isStore == 0 && !item.children.length) {
item.loading = true;
item.children = await that.getChildData(item);
item.loading = false;
}
// 只有展开且不是门店的才会保存
......@@ -429,6 +433,7 @@ export default {
if (resData.result.length) {
item.loaded = true;
resData.result.forEach(ele => {
ele.loading = false;
ele.expand = false;
ele.children = [];
ele.level = item.level + 1;
......@@ -478,7 +483,11 @@ export default {
const flag = await that.checkLocal(that.wxData[index]);
if (flag) {
that.wxData[index].expand = true;
that.wxData[index].children = await that.getChildData(that.wxData[index]);
if (that.wxData[index].isStore == 0 && that.wxData[index].hasSonNode == true) {
that.wxData[index].loading = true;
that.wxData[index].children = await that.getChildData(that.wxData[index]);
that.wxData[index].loading = false;
}
}
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment