Commit 35c73788 by 无尘

fix: 修改加载数据

parent e26b9c5f
<!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.84bfc4deef0fe4292ba0f470ad16f496.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.ad3686ec4c3cc2a2e1f6.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> <!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 \ 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 c=window.webpackJsonp;window.webpackJsonp=function(a,b,n){for(var r,t,o,i=0,u=[];i<a.length;i++)t=a[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(c&&c(a,b,n);u.length;)u.shift()();if(n)for(i=0;i<n.length;i++)o=f(f.s=n[i]);return o};var a={},d={58:0};function f(c){if(a[c])return a[c].exports;var d=a[c]={i:c,l:!1,exports:{}};return e[c].call(d.exports,d,d.exports,f),d.l=!0,d.exports}f.e=function(e){var c=d[e];if(0===c)return new Promise(function(e){e()});if(c)return c[2];var a=new Promise(function(a,f){c=d[e]=[a,f]});c[2]=a;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:"861c48eb3c5265387582",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 c=d[e];0!==c&&(c&&c[1](new Error("Loading chunk "+e+" failed.")),d[e]=void 0)}return n.onerror=n.onload=t,b.appendChild(n),a},f.m=e,f.c=a,f.d=function(e,c,a){f.o(e,c)||Object.defineProperty(e,c,{configurable:!1,enumerable:!0,get:a})},f.n=function(e){var c=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(c,"a",c),c},f.o=function(e,c){return Object.prototype.hasOwnProperty.call(e,c)},f.p="./",f.oe=function(e){throw console.error(e),e}}([]); !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 \ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-08-14 16:51:07 * @Date: 2019-08-14 16:51:07
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-03-21 13:43:59 * @LastEditTime: 2020-03-21 13:52:37
--> -->
<!-- <!--
<contact-tree :itemData="itemData" v-model="itemData" ></contact-tree> <contact-tree :itemData="itemData" v-model="itemData" ></contact-tree>
...@@ -17,7 +17,7 @@ import contactTree from '/components/company/contact-tree.vue'; ...@@ -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'"> <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 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' }"> <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="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-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>
</div> </div>
</div> </div>
<li-row v-if="item.expand" :departObj="departObj" :itemData="item.children" @getSelectData="getSelectData"></li-row <li-row v-if="item.expand" :departObj="departObj" :itemData="item.children" @getSelectData="getSelectData"></li-row
...@@ -61,14 +61,14 @@ export default { ...@@ -61,14 +61,14 @@ export default {
parentId: '', parentId: '',
isStore: '', isStore: '',
staffCount: '', staffCount: '',
bindFlag: '' bindFlag: '',
loading: false
}; };
} }
} }
}, },
data() { data() {
return { return {
loading: false,
rightOption: { rightOption: {
group: { group: {
name: 'people', name: 'people',
...@@ -99,9 +99,9 @@ export default { ...@@ -99,9 +99,9 @@ export default {
// console.log(item); // console.log(item);
item.expand = item.expand ? false : true; item.expand = item.expand ? false : true;
if (item.isStore == 0 && !item.children.length) { if (item.isStore == 0 && !item.children.length) {
that.loading = true; item.loading = true;
item.children = await that.getChildData(item); item.children = await that.getChildData(item);
that.loading = false; item.loading = false;
} }
// 只有展开且不是门店的才会保存 // 只有展开且不是门店的才会保存
if (item.expand && !item.isStore) { if (item.expand && !item.isStore) {
...@@ -139,6 +139,7 @@ export default { ...@@ -139,6 +139,7 @@ export default {
if (resData.errorCode == 1) { if (resData.errorCode == 1) {
if (resData.result.length) { if (resData.result.length) {
resData.result.forEach(ele => { resData.result.forEach(ele => {
ele.loading = false;
ele.expand = false; ele.expand = false;
ele.children = []; ele.children = [];
ele.level = item.level + 1; ele.level = item.level + 1;
...@@ -188,9 +189,9 @@ export default { ...@@ -188,9 +189,9 @@ export default {
const flag = await that.checkLocal(that.itemData[index]); const flag = await that.checkLocal(that.itemData[index]);
if (flag && that.itemData[index].isStore == 0 && that.itemData[index].hasSonNode == true) { if (flag && that.itemData[index].isStore == 0 && that.itemData[index].hasSonNode == true) {
that.itemData[index].expand = true; that.itemData[index].expand = true;
that.loading = true; that.itemData[index].loading = true;
that.itemData[index].children = await that.getChildData(that.itemData[index]); that.itemData[index].children = await that.getChildData(that.itemData[index]);
that.loading = false; that.itemData[index].loading = false;
} }
} }
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-03-20 14:36:37 * @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-03-17 18:33:18 * @LastEditTime: 2020-03-21 13:56:54
--> -->
<template> <template>
<div class="contacts-wrap common-set-wrap"> <div class="contacts-wrap common-set-wrap">
...@@ -113,6 +113,7 @@ export default { ...@@ -113,6 +113,7 @@ export default {
*/ */
changeDepart(obj) { changeDepart(obj) {
const that = this; const that = this;
that.$set(obj, 'loading', false);
that.departObj = obj; that.departObj = obj;
}, },
/** /**
...@@ -132,6 +133,7 @@ export default { ...@@ -132,6 +133,7 @@ export default {
if (resData.errorCode == 1) { if (resData.errorCode == 1) {
if (resData.result.length) { if (resData.result.length) {
resData.result.forEach(ele => { resData.result.forEach(ele => {
ele.loading = false;
ele.expand = false; ele.expand = false;
ele.children = []; ele.children = [];
ele.level = item.level + 1; ele.level = item.level + 1;
...@@ -160,6 +162,7 @@ export default { ...@@ -160,6 +162,7 @@ export default {
const that = this; const that = this;
console.log(that.departObj, obj); console.log(that.departObj, obj);
that.$set(that.departObj, 'hasSonNode', true); that.$set(that.departObj, 'hasSonNode', true);
that.$set(that.departObj, 'loading', false);
that.departObj.children = await that.getChildData(that.departObj); that.departObj.children = await that.getChildData(that.departObj);
that.$forceUpdate(); that.$forceUpdate();
}, },
...@@ -192,6 +195,7 @@ export default { ...@@ -192,6 +195,7 @@ export default {
}, },
getSearchSelectData(obj) { getSearchSelectData(obj) {
const that = this; const that = this;
obj.loading = false;
that.departObj = obj; that.departObj = obj;
}, },
/** /**
...@@ -235,6 +239,7 @@ export default { ...@@ -235,6 +239,7 @@ export default {
if (resData.errorCode == 1) { if (resData.errorCode == 1) {
if (!!resData.result && resData.result.length) { if (!!resData.result && resData.result.length) {
resData.result.forEach(ele => { resData.result.forEach(ele => {
ele.loading = false;
ele.expand = false; ele.expand = false;
ele.children = []; ele.children = [];
ele.level = 0; ele.level = 0;
......
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