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