Commit 8834ad3a by fairyly

feat: 增加本地存储

parent 3169b6ce
<!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.48dcfffa9aad48e7af93ac4405d6edfa.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.430f6f10370fa87ea9e9.js></script><script type=text/javascript src=./static/js/vendor.2cff6c68669f76f7bb26.js></script><script type=text/javascript src=./static/js/app.4ad545414a2bd6f8aef7.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.7d8d9f0288e8ec2b99de5cd37b0f3c10.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.3969e50b04ec22393d1d.js></script><script type=text/javascript src=./static/js/vendor.2cff6c68669f76f7bb26.js></script><script type=text/javascript src=./static/js/app.4ad545414a2bd6f8aef7.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.
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(n,o,c){for(var f,d,i,u=0,b=[];u<n.length;u++)d=n[u],r[d]&&b.push(r[d][0]),r[d]=0;for(f in o)Object.prototype.hasOwnProperty.call(o,f)&&(e[f]=o[f]);for(a&&a(n,o,c);b.length;)b.shift()();if(c)for(u=0;u<c.length;u++)i=t(t.s=c[u]);return i};var n={},r={21:0};function t(a){if(n[a])return n[a].exports;var r=n[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.e=function(e){var a=r[e];if(0===a)return new Promise(function(e){e()});if(a)return a[2];var n=new Promise(function(n,t){a=r[e]=[n,t]});a[2]=n;var o=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,t.nc&&c.setAttribute("nonce",t.nc),c.src=t.p+"static/js/"+e+"."+{0:"1d32d63fa419a4b86bba",1:"9a1776fdc262362d75b8",2:"ed170b85a5d1ced841a3",3:"20599248eac439adeae8",4:"59cbb98ef3301b7d1be0",5:"afc7b726a46486df899a",6:"9e12ea68528f2ad5f9a5",7:"4c95fe66c59573d7da03",8:"c2a3c1c2b9ffb4687826",9:"4b8efecc95608bc88200",10:"ac7009c4a56552235c6f",11:"cdcdaabe8dd05b754b5f",12:"2bf38ff033ad1f7a922b",13:"b13f744cd55ac3168789",14:"840b162a636493a5d4f9",15:"b2964c8a20328a2a5e5f",16:"188fa59e318626239ae8",17:"17423916aa77b50f2ee3",18:"b918fbf8403d96eac90a"}[e]+".js";var f=setTimeout(d,12e4);function d(){c.onerror=c.onload=null,clearTimeout(f);var a=r[e];0!==a&&(a&&a[1](new Error("Loading chunk "+e+" failed.")),r[e]=void 0)}return c.onerror=c.onload=d,o.appendChild(c),n},t.m=e,t.c=n,t.d=function(e,a,n){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},t.p="./",t.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,o,c){for(var f,i,u,b=0,d=[];b<r.length;b++)i=r[b],a[i]&&d.push(a[i][0]),a[i]=0;for(f in o)Object.prototype.hasOwnProperty.call(o,f)&&(e[f]=o[f]);for(n&&n(r,o,c);d.length;)d.shift()();if(c)for(b=0;b<c.length;b++)u=t(t.s=c[b]);return u};var r={},a={21:0};function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}t.e=function(e){var n=a[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,t){n=a[e]=[r,t]});n[2]=r;var o=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,t.nc&&c.setAttribute("nonce",t.nc),c.src=t.p+"static/js/"+e+"."+{0:"1d32d63fa419a4b86bba",1:"9a1776fdc262362d75b8",2:"7eb416b6fbade61bfe6c",3:"20599248eac439adeae8",4:"59cbb98ef3301b7d1be0",5:"afc7b726a46486df899a",6:"9e12ea68528f2ad5f9a5",7:"4c95fe66c59573d7da03",8:"c2a3c1c2b9ffb4687826",9:"4b8efecc95608bc88200",10:"ac7009c4a56552235c6f",11:"cdcdaabe8dd05b754b5f",12:"2bf38ff033ad1f7a922b",13:"b13f744cd55ac3168789",14:"840b162a636493a5d4f9",15:"b2964c8a20328a2a5e5f",16:"188fa59e318626239ae8",17:"17423916aa77b50f2ee3",18:"b918fbf8403d96eac90a"}[e]+".js";var f=setTimeout(i,12e4);function i(){c.onerror=c.onload=null,clearTimeout(f);var n=a[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),a[e]=void 0)}return c.onerror=c.onload=i,o.appendChild(c),r},t.m=e,t.c=r,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="./",t.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-02-21 17:11:20
* @LastEditTime : 2020-02-22 09:55:10
-->
<!--
<contact-tree :itemData="itemData" v-model="itemData" ></contact-tree>
......@@ -83,7 +83,8 @@ export default {
if (item.isStore == 0 && !item.children.length) {
item.children = await that.getChildData(item);
}
if (item.expand) {
// 只有展开且不是门店的才会保存
if (item.expand && !item.isStore) {
localforage.setItem(item.departmentId, item);
} else {
localforage.removeItem(item.departmentId);
......@@ -136,17 +137,53 @@ export default {
});
});
});
},
async checkLocal(data) {
// const that = this;
return new Promise((resolve, reject) => {
localforage
.getItem(data.departmentId)
.then(value => {
// 当离线仓库中的值被载入时,此处代码运行
// console.log(value);
resolve(true);
})
.catch(function(err) {
// 当出错时,此处代码运行
resolve(false);
// console.log(err);
});
});
},
/**
* 获取存储的数据
*/
async getLocalData() {
const that = this;
for (let index = 0; index < that.itemData.length; index++) {
const flag = await that.checkLocal(that.itemData[index]);
if (flag) {
that.itemData[index].expand = true;
that.itemData[index].children = await that.getChildData(that.itemData[index]);
}
}
}
},
watch: {
value: function(newData, oldData) {
itemData: function(newData, oldData) {
const that = this;
that.trData = JSON.parse(JSON.stringify(newData));
if (newData.length) {
that.getLocalData();
}
}
},
mounted() {
const that = this;
that.trData = JSON.parse(JSON.stringify(that.value));
if (that.itemData.length) {
that.getLocalData();
}
}
/* beforeDestroy() {} */
};
......
......@@ -3,7 +3,7 @@
* @Author : 无尘
* @Date : 2020-02-13 14:02:40
* @LastEditors : 无尘
* @LastEditTime : 2020-02-21 15:26:36
* @LastEditTime : 2020-02-22 09:08:35
* @FilePath : \Hapi-demoj:\公司\haoban-3\src\components\company\depart-member.vue
-->
<!--
......@@ -55,13 +55,18 @@
</template>
<script>
/* eslint-disable */
import { _debounce } from '@/common/js/public';
import { getRequest, postRequest } from '@/api/api';
import errMsg from '@/common/js/error';
import showMsg from '@/common/js/showmsg';
import addMember from '@/components/company/add-member.vue';
import modDepart from '@/components/company/mod-depart.vue';
export default {
import {
_debounce
} from '@/common/js/public';
import {
getRequest,
postRequest
} from '@/api/api';
import errMsg from '@/common/js/error';
import showMsg from '@/common/js/showmsg';
import addMember from '@/components/company/add-member.vue';
import modDepart from '@/components/company/mod-depart.vue';
export default {
name: 'depart-list',
components: {
addMember,
......@@ -70,7 +75,7 @@ export default {
props: {
departObj: {
type: Object,
default() {
default () {
return {
departmentId: '',
departmentName: '',
......@@ -87,20 +92,16 @@ export default {
return {
searchInput: '',
activeFlag: '',
statusOptions: [
{
statusOptions: [{
value: '',
label: '所有状态'
},
{
}, {
value: '0',
label: '未激活'
},
{
}, {
value: '1',
label: '已激活'
}
],
}],
// 分页参数
currentPage: 1,
pageSize: 20,
......@@ -164,6 +165,7 @@ export default {
const that = this;
if (item) {
that.postInvite(item);
return false;
}
if (!that.multipleSelection.length) {
showMsg.showmsg('请先选择成员!', 'warning');
......@@ -337,21 +339,21 @@ export default {
that.getTableList();
}
}
};
};
</script>
<style lang="less" scoped>
.w-274 {
.w-274 {
width: 274px;
}
}
.m-l-6 {
.m-l-6 {
margin-left: 6px;
}
}
.depart-list-body {
.depart-list-body {
.depart-children-list {
padding: 16px 10px;
background: #f5f7fa;
}
}
}
</style>
\ No newline at end of file
......@@ -243,6 +243,7 @@ export default {
const that = this;
if (item) {
that.postInvite(item);
return false;
}
if (!that.multipleSelection.length) {
showMsg.showmsg('请先选择成员!', 'warning');
......
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