This commit is contained in:
parent
c1ad9148d7
commit
4a70c7e7e5
|
|
@ -22,7 +22,6 @@ let defaultValue = ref({})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getData()
|
getData()
|
||||||
getDictLabel()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
function getDictLabel() {
|
function getDictLabel() {
|
||||||
|
|
@ -36,9 +35,10 @@ async function getData() {
|
||||||
if (cacheKey) {
|
if (cacheKey) {
|
||||||
const data = tools.data.get(cacheKey)
|
const data = tools.data.get(cacheKey)
|
||||||
if (data) {
|
if (data) {
|
||||||
tableData.value = data;
|
tableData.value = data
|
||||||
loading.value = false;
|
loading.value = false
|
||||||
return;
|
getDictLabel()
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const res = await dictConfig.api({key: props.type});
|
const res = await dictConfig.api({key: props.type});
|
||||||
|
|
@ -46,7 +46,8 @@ async function getData() {
|
||||||
if (cacheKey) {
|
if (cacheKey) {
|
||||||
tools.data.set(cacheKey, res.data, 7200)
|
tools.data.set(cacheKey, res.data, 7200)
|
||||||
}
|
}
|
||||||
loading.value = false;
|
loading.value = false
|
||||||
|
getDictLabel()
|
||||||
}
|
}
|
||||||
|
|
||||||
function genCacheKey() {
|
function genCacheKey() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue