mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-09-17 19:06:39 +08:00
Pre Merge pull request !78 from 一点点/master
This commit is contained in:
commit
91b78824bd
@ -54,17 +54,27 @@
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
dictList: {
|
||||
type: Array,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
|
||||
// -------------------------- 查询 字典数据 --------------------------
|
||||
|
||||
const dictList = ref([]);
|
||||
const dictList = ref(props.dictList || []);
|
||||
async function queryDict() {
|
||||
if (props.dictList) {
|
||||
dictList.value = props.dictList;
|
||||
return;
|
||||
}
|
||||
let response = await dictApi.getAllDict();
|
||||
dictList.value = response.data;
|
||||
}
|
||||
|
||||
onMounted(queryDict);
|
||||
if (!props.dictList) {
|
||||
queryDict();
|
||||
}
|
||||
|
||||
// -------------------------- 选中 相关、事件 --------------------------
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
|
@ -68,7 +68,7 @@
|
||||
</template>
|
||||
|
||||
<template v-if="column.dataIndex === 'dict'">
|
||||
<DictCodeSelect ref="dictRef" v-model:value="record.dict" />
|
||||
<DictCodeSelect ref="dictRef" v-model:value="record.dict" :dict-list="dictList" />
|
||||
</template>
|
||||
|
||||
<template v-if="column.dataIndex === 'enumName'">
|
||||
@ -84,8 +84,16 @@
|
||||
import DictCodeSelect from '/@/components/support/dict-code-select/index.vue';
|
||||
import { convertUpperCamel, convertLowerCamel } from '/@/utils/str-util';
|
||||
import _ from 'lodash';
|
||||
import { dictApi } from '/@/api/support/dict-api';
|
||||
|
||||
const dictRef = ref();
|
||||
const dictList = ref([]);
|
||||
async function loadDictList() {
|
||||
const response = await dictApi.getAllDict();
|
||||
dictList.value = response.data;
|
||||
}
|
||||
loadDictList();
|
||||
|
||||
function refreshDict() {
|
||||
dictRef.value.queryDict();
|
||||
}
|
||||
|
@ -54,17 +54,27 @@
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
dictList: {
|
||||
type: Array,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
|
||||
// -------------------------- 查询 字典数据 --------------------------
|
||||
|
||||
const dictList = ref([]);
|
||||
const dictList = ref(props.dictList || []);
|
||||
async function queryDict() {
|
||||
if (props.dictList) {
|
||||
dictList.value = props.dictList;
|
||||
return;
|
||||
}
|
||||
let response = await dictApi.getAllDict();
|
||||
dictList.value = response.data;
|
||||
}
|
||||
|
||||
onMounted(queryDict);
|
||||
if (!props.dictList) {
|
||||
queryDict();
|
||||
}
|
||||
|
||||
// -------------------------- 选中 相关、事件 --------------------------
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
|
@ -68,7 +68,7 @@
|
||||
</template>
|
||||
|
||||
<template v-if="column.dataIndex === 'dict'">
|
||||
<DictCodeSelect ref="dictRef" v-model:value="record.dict" />
|
||||
<DictCodeSelect ref="dictRef" v-model:value="record.dict" :dict-list="dictList" />
|
||||
</template>
|
||||
|
||||
<template v-if="column.dataIndex === 'enumName'">
|
||||
@ -83,9 +83,17 @@
|
||||
import { checkExistEnum, convertJavaEnumName, getJavaType, getJsType, JavaTypeList, JsTypeList } from '../../code-generator-util';
|
||||
import DictCodeSelect from '/@/components/support/dict-code-select/index.vue';
|
||||
import { convertUpperCamel, convertLowerCamel } from '/@/utils/str-util';
|
||||
import { dictApi } from '/@/api/support/dict-api';
|
||||
import _ from 'lodash';
|
||||
|
||||
const dictRef = ref();
|
||||
const dictList = ref([]);
|
||||
async function loadDictList() {
|
||||
const response = await dictApi.getAllDict();
|
||||
dictList.value = response.data;
|
||||
}
|
||||
loadDictList();
|
||||
|
||||
function refreshDict() {
|
||||
dictRef.value.queryDict();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user