|
|
@ -107,7 +107,7 @@ |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import {MdpSelectMixin } from "../../mdp-ui/mixin/MdpSelectMixin.js" |
|
|
import {MdpSelectMixin } from "../../mdp-ui/mixin/MdpSelectMixin.js" |
|
|
var tableDataCacheMap=new Map(); |
|
|
|
|
|
|
|
|
const tableDataCacheMap=new Map(); |
|
|
export default { |
|
|
export default { |
|
|
components: { }, |
|
|
components: { }, |
|
|
name: 'mdp-select-table', |
|
|
name: 'mdp-select-table', |
|
|
@ -141,7 +141,7 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods:{ |
|
|
methods:{ |
|
|
getCacheList(){ |
|
|
|
|
|
|
|
|
getCacheList(){ |
|
|
var tableDataCacheList=tableDataCacheMap.get(this.codeKey) |
|
|
var tableDataCacheList=tableDataCacheMap.get(this.codeKey) |
|
|
if(!tableDataCacheList){ |
|
|
if(!tableDataCacheList){ |
|
|
tableDataCacheList=[] |
|
|
tableDataCacheList=[] |
|
|
@ -170,15 +170,8 @@ |
|
|
var tableDataCacheList=this.getCacheList(); |
|
|
var tableDataCacheList=this.getCacheList(); |
|
|
if(tableDataCacheList && tableDataCacheList.length>0){ |
|
|
if(tableDataCacheList && tableDataCacheList.length>0){ |
|
|
this.item={itemType:'4',options:tableDataCacheList} |
|
|
this.item={itemType:'4',options:tableDataCacheList} |
|
|
}else{ |
|
|
|
|
|
var tableDatasStr=localStorage.getItem(this.codeKey) |
|
|
|
|
|
if(tableDatasStr){ |
|
|
|
|
|
var tableDatas=JSON.parse(tableDatasStr) |
|
|
|
|
|
this.item={itemType:'4',options:tableDatas} |
|
|
|
|
|
this.setCacheList(tableDatas) |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.item={itemType:'4',options:[]} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
this.item={itemType:'4',options:[]} |
|
|
} |
|
|
} |
|
|
if(this.value){ |
|
|
if(this.value){ |
|
|
var mVals=[] |
|
|
var mVals=[] |
|
|
@ -233,9 +226,7 @@ |
|
|
this.onClose(); |
|
|
this.onClose(); |
|
|
this.$refs['tableDialog'].close(); |
|
|
this.$refs['tableDialog'].close(); |
|
|
}, |
|
|
}, |
|
|
onClose(){ |
|
|
|
|
|
var tableDataCacheList=this.getCacheList(); |
|
|
|
|
|
localStorage.setItem(this.codeKey,JSON.stringify(tableDataCacheList)); |
|
|
|
|
|
|
|
|
onClose(){ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
@ -244,12 +235,7 @@ |
|
|
this.initItemOptions(); |
|
|
this.initItemOptions(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
beforeDestroy(){ |
|
|
|
|
|
var tableDataCacheList=this.getCacheList(); |
|
|
|
|
|
localStorage.setItem(this.codeKey,JSON.stringify(tableDataCacheList)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
|