提交 2cc9bfdf 编写于 作者: tony001's avatar tony001

修复部门选择组件

上级 1296000b
...@@ -103,7 +103,7 @@ export default class AppDepartmentSelect extends Vue { ...@@ -103,7 +103,7 @@ export default class AppDepartmentSelect extends Vue {
* @type {*} * @type {*}
* @memberof AppDepartmentSelect * @memberof AppDepartmentSelect
*/ */
public oldurl: any[] = []; public oldurl: any;
/** /**
* 获取节点数据 * 获取节点数据
...@@ -136,14 +136,14 @@ export default class AppDepartmentSelect extends Vue { ...@@ -136,14 +136,14 @@ export default class AppDepartmentSelect extends Vue {
} }
this.oldurl = _url; this.oldurl = _url;
// 缓存机制 // 缓存机制
const result:any = this.$store.getters.getDepData(this.filter); const result:any = this.$store.getters.getDepData(_url);
if(result){ if(result){
this.Nodesdata = result; this.Nodesdata = result;
return; return;
} }
this.$http.get(_url).then((response: any) => { this.$http.get(_url).then((response: any) => {
this.Nodesdata = response.data; this.Nodesdata = response.data;
this.$store.commit('addDepData', { srfkey: this.filter, depData: response.data }); this.$store.commit('addDepData', { srfkey: _url, depData: response.data });
}).catch((response: any) => { }).catch((response: any) => {
if (!response || !response.status || !response.data) { if (!response || !response.status || !response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.error') as string), desc: (this.$t('app.commonWords.sysException') as string) }); this.$Notice.error({ title: (this.$t('app.commonWords.error') as string), desc: (this.$t('app.commonWords.sysException') as string) });
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册