|
@@ -28,7 +28,6 @@
|
|
|
watchEffect,
|
|
|
computed,
|
|
|
unref,
|
|
|
- watch,
|
|
|
reactive,
|
|
|
toRefs,
|
|
|
onUpdated,
|
|
@@ -43,7 +42,7 @@
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
import { propTypes } from '/@/utils/propTypes';
|
|
|
|
|
|
- type OptionsItem = { label: string; value: string; disabled?: boolean };
|
|
|
+ type OptionsItem = { label: string; value: string | number; disabled?: boolean };
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'CustomApiTypeSelect',
|
|
@@ -59,7 +58,6 @@
|
|
|
propTypes.string,
|
|
|
propTypes.array,
|
|
|
]),
|
|
|
- hideid: Number,
|
|
|
numberToString: propTypes.bool,
|
|
|
api: {
|
|
|
type: Function as PropType<(arg?: Recordable) => Promise<OptionsItem[]>>,
|
|
@@ -112,13 +110,6 @@
|
|
|
props.immediate && fetch();
|
|
|
});
|
|
|
|
|
|
- watch(
|
|
|
- () => props.hideid,
|
|
|
- () => {
|
|
|
- fetch();
|
|
|
- },
|
|
|
- { deep: true }
|
|
|
- );
|
|
|
onUpdated(() => {
|
|
|
if (typeof props.value === 'string') {
|
|
|
reactData.disabled = true;
|
|
@@ -136,12 +127,10 @@
|
|
|
const result = await api(props.params);
|
|
|
const res: OptionsItem[] = [];
|
|
|
result.list.map((item) => {
|
|
|
- if (item.id !== props.hideid) {
|
|
|
- res.push({ label: item.name, value: item.id });
|
|
|
- }
|
|
|
+ res.push({ label: item.name, value: item.id });
|
|
|
});
|
|
|
if (props.type === 2) {
|
|
|
- res.unshift({ label: '会费', value: '0' });
|
|
|
+ res.unshift({ label: '会费', value: 0 });
|
|
|
}
|
|
|
if (Array.isArray(res)) {
|
|
|
options.value = res;
|