liyu-pc-base 1.0.918 → 1.0.921
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{FieldRender-B2-PUCQc.js → FieldRender-BOg7nm5z.js} +3 -3
- package/dist/{FieldRender-B2-PUCQc.js.map → FieldRender-BOg7nm5z.js.map} +1 -1
- package/dist/{FieldRender2-CiVGIlDy.js → FieldRender2-_MtcDkI5.js} +7 -7
- package/dist/{FieldRender2-CiVGIlDy.js.map → FieldRender2-_MtcDkI5.js.map} +1 -1
- package/dist/{FormRender3-CBOCISAF.js → FormRender3-BtY9d91e.js} +3 -3
- package/dist/{FormRender3-CBOCISAF.js.map → FormRender3-BtY9d91e.js.map} +1 -1
- package/dist/{RemoteModal-Bcj3dfNQ.js → RemoteModal-Dqy32RFN.js} +1 -1
- package/dist/{RemoteModal-Bcj3dfNQ.js.map → RemoteModal-Dqy32RFN.js.map} +1 -1
- package/dist/{RemoteSelectPro-BjPxetAs.js → RemoteSelectPro-CcWTS4f6.js} +2 -2
- package/dist/{RemoteSelectPro-BjPxetAs.js.map → RemoteSelectPro-CcWTS4f6.js.map} +1 -1
- package/dist/{RemoteTable-Wk-bmeCF.js → RemoteTable-D_12PvNS.js} +2 -2
- package/dist/{RemoteTable-Wk-bmeCF.js.map → RemoteTable-D_12PvNS.js.map} +1 -1
- package/dist/{RemoteTreeSelectPro-D2RSKzFr.js → RemoteTreeSelectPro-CXMOariR.js} +1 -1
- package/dist/{RemoteTreeSelectPro-D2RSKzFr.js.map → RemoteTreeSelectPro-CXMOariR.js.map} +1 -1
- package/dist/{SearchRender-BEcL6EIz.js → SearchRender-ByarFel1.js} +1 -1
- package/dist/{SearchRender-BEcL6EIz.js.map → SearchRender-ByarFel1.js.map} +1 -1
- package/dist/{TinymceEditor-BLPIZIaP.js → TinymceEditor-waI-dlC5.js} +3 -3
- package/dist/{TinymceEditor-BLPIZIaP.js.map → TinymceEditor-waI-dlC5.js.map} +1 -1
- package/dist/components/index.js +11 -11
- package/dist/{dbViewConfig-mc_jPjGP.js → dbViewConfig-RGSyUx3F.js} +2 -2
- package/dist/{dbViewConfig-mc_jPjGP.js.map → dbViewConfig-RGSyUx3F.js.map} +1 -1
- package/dist/{detailTablePro-BCOlFgNP.js → detailTablePro-CqcVbn8O.js} +1 -1
- package/dist/{detailTablePro-BCOlFgNP.js.map → detailTablePro-CqcVbn8O.js.map} +1 -1
- package/dist/{function-DQjzcDkk.js → function-BhYSb8ls.js} +96 -88
- package/dist/function-BhYSb8ls.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/liyu-pc-base.css +1 -1
- package/dist/{tableModal-BTHAw0Vf.js → tableModal-DSKuV-hn.js} +1 -1
- package/dist/{tableModal-BTHAw0Vf.js.map → tableModal-DSKuV-hn.js.map} +1 -1
- package/dist/{tablePageHost-BlcCmf1E.js → tablePageHost-B_BOlBNA.js} +8416 -7870
- package/dist/tablePageHost-B_BOlBNA.js.map +1 -0
- package/dist/{tablePro-B0JfEkkl.js → tablePro-IAcxxAGI.js} +6 -6
- package/dist/{tablePro-B0JfEkkl.js.map → tablePro-IAcxxAGI.js.map} +1 -1
- package/dist/utils/function.js +1 -1
- package/dist/utils/hooks/useFetchData.js +1 -1
- package/package.json +1 -1
- package/dist/function-DQjzcDkk.js.map +0 -1
- package/dist/tablePageHost-BlcCmf1E.js.map +0 -1
|
@@ -3,7 +3,7 @@ import { N as t, g as n } from "./init-plugin-CvgtEpwY.js";
|
|
|
3
3
|
import { t as r } from "./boldenText-Bv8Zo7Vh.js";
|
|
4
4
|
import { t as i } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
5
5
|
import { getApiData as a } from "./api/api-model.js";
|
|
6
|
-
import { P as o, n as s } from "./function-
|
|
6
|
+
import { P as o, n as s } from "./function-BhYSb8ls.js";
|
|
7
7
|
import { t as c } from "./modal-tools-CrXdI5sg.js";
|
|
8
8
|
import { t as l } from "./md5-WIoeWMjT.js";
|
|
9
9
|
import { resolveContextValue as ee } from "./components/FormRender/utils.js";
|
|
@@ -321,7 +321,7 @@ var w = /* @__PURE__ */ e(l(), 1), T = { class: "remote-select-pro" }, se = {
|
|
|
321
321
|
}, { deep: !0 });
|
|
322
322
|
let ue = (e) => {
|
|
323
323
|
k.value = e, $();
|
|
324
|
-
}, de = m(() => import("./tableModal-
|
|
324
|
+
}, de = m(() => import("./tableModal-DSKuV-hn.js")), fe = () => {
|
|
325
325
|
let e = [];
|
|
326
326
|
k.value = "";
|
|
327
327
|
let t = "checkbox";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteSelectPro-BjPxetAs.js","names":[],"sources":["../src/components/FormRender/RemoteSelectPro/RemoteSelectPro.vue","../src/components/FormRender/RemoteSelectPro/RemoteSelectPro.vue"],"sourcesContent":["<template>\n <div class=\"remote-select-pro\">\n <a-select\n v-model:value=\"modalRef.selectedRows\"\n :allow-clear=\"field.allowClear !== false\"\n :default-value=\"field.defaultValue\"\n :disabled=\"field.disabled\"\n :filter-option=\"filterOption\"\n :maxTagCount=\"field.maxTagCount ? field.maxTagCount : 'responsive'\"\n :mode=\"field.mode == 'default' ? null : field.mode\"\n :placeholder=\"placeholder\"\n :show-search=\"field.show_search !== false\"\n size=\"small\"\n :autoClearSearchValue=\"false\"\n @change=\"handleChange\"\n @search=\"handleSearch\"\n style=\"min-width: 120px\"\n >\n <a-select-option\n v-for=\"option in datasource\"\n :key=\"option.value\"\n :value=\"option.value\"\n >\n <bold-matcher\n :text=\"option.label\"\n :pattern=\"searchText\"\n :color=\"field.searchColor\"\n />\n </a-select-option>\n </a-select>\n\n <div\n v-if=\"field.table?.enable\"\n class=\"table-search-icon\"\n style=\"margin-right: 5px\"\n >\n <FileSearchOutlined @click=\"handleOpenTable\" />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, defineAsyncComponent, onMounted, onUnmounted, reactive, ref, watch } from 'vue';\nimport { debounce, isEqual } from 'lodash-es';\nimport { convertValueByClassName, isNotEmpty } from 'liyu-pc-base/utils/function';\nimport BoldMatcher from 'liyu-pc-base/components/FormRender/RemoteSelect/boldenText.vue';\nimport { getApiData } from 'liyu-pc-base/api/api-model';\nimport { useRequiredConditionStore, required_condition_event_obj } from 'liyu-pc-base/init-plugin';\nimport modalBox from 'liyu-pc-base/components/form-modal/modal-tools';\nimport md5 from 'blueimp-md5';\nimport { useRoute } from 'vue-router';\nimport { resolveContextValue } from 'liyu-pc-base/components/FormRender/utils';\n\ndefineOptions({\n name: 'RemoteSelectPro',\n});\n\ntype Field = {\n label: string;\n mode: 'multiple' | 'tags' | 'combobox' | 'default';\n cb?: any;\n select_style: any;\n default: string;\n name: string;\n postUrl: string;\n searchConditions: any;\n queryType: string;\n simpleSearchConditions: any;\n maxTagCount: number;\n allowClear: boolean;\n defaultValue: any;\n disabled: boolean;\n show_search: boolean;\n searchColor: string;\n required_condition: any;\n defaultValueType: string;\n globalDefaultKey: string;\n globalDefaultField: string;\n extendedFields: string[];\n table: any;\n};\ninterface Props {\n field: Field;\n valueKey?: string;\n labelKeyType?: number;\n labelKey?: string;\n labelSpace?: string;\n labelKeyList?: any[];\n value?: Array<any> | number | string | null;\n label?: Array<any> | string;\n formModel: Record<string, any>;\n outModel?: Record<string, any>;\n placeholder?: string;\n init_model?: Record<string, any>;\n is_input?: boolean;\n init_watch?: Record<string, any>;\n is_form_design?: boolean;\n innerModel?: any;\n globalInnerModel?: any;\n context?: Record<string, any> | null;\n baseKeyPath?: any;\n}\nconst props = withDefaults(defineProps<Props>(), {\n labelKeyType: 0,\n labelSpace: '-',\n labelKeyList: () => [],\n value: null,\n label: () => [],\n outModel: () => ({}),\n init_model: () => ({}),\n is_input: false,\n init_watch: () => ({}),\n is_form_design: false,\n innerModel: null,\n globalInnerModel: null,\n context: null,\n baseKeyPath: () => [],\n});\n\nconst emit = defineEmits<{\n 'update:value': [value: any];\n 'update:label': [value: any];\n}>();\nconst modalRef = reactive({\n selectedRows: new Array<number | any>(),\n datasource: new Array<any>(),\n});\nconst route = useRoute();\nconst tableKey = ref('remoteSelectPro');\nconst tableConfig = ref(null);\nconst searchText = ref('');\nconst requiredConditionStore = useRequiredConditionStore();\nconst getConditionsItem = (value: any, list: any, item: any) => {\n if (item.operator === 'not_blank_not_null') {\n list.push({\n field_name: item.field_name,\n operator: item.operator,\n value: [],\n format: item.format,\n class_name: item.class_name,\n });\n } else if (value instanceof Array) {\n const [first] = value;\n if (isNotEmpty(first)) {\n list.push({\n field_name: item.field_name,\n operator: item.operator,\n value: convertValueByClassName(value, item.class_name),\n format: item.format,\n class_name: item.class_name,\n });\n }\n } else if (isNotEmpty(value)) {\n let val = value;\n if (item.operator === 'in' || item.operator === 'notin') {\n if (value.includes('[')) {\n val = JSON.parse(value);\n } else if (value.includes(',')) {\n val = value.split(',');\n }\n if (item.class_name === 'int') {\n val = val.map(Number);\n }\n }\n list.push({\n field_name: item.field_name,\n operator: item.operator,\n value: convertValueByClassName(val instanceof Array ? val : [val], item.class_name),\n format: item.format,\n class_name: item.class_name,\n });\n }\n};\n\n/**\n * 解析相对于 baseKeyPath 的表达式,从 props.context 中获取值。\n * 核心算法已移至 utils.ts 的 resolveContextValue,这里仅做 props 绑定。\n */\nconst resolveContextValueWrapper = (selectName: string): any => {\n const value = resolveContextValue(selectName, props.context, [\n 'formModel',\n ...(props.baseKeyPath || []),\n ]);\n return value;\n};\n\n/**\n * searchType === 1 时按 key 同时处理 outModel 与 formModel:\n * 1. outModel 中存在该字段且有值(非 undefined / null)时,优先取 outModel 的值;\n * 2. 否则回退到 formModel 中的同名字段。\n * 注意:不能用 `outModel ? outModel : formModel` 做「对象级」二选一 ——\n * outModel 有默认值 `{}`(恒为真值),且它可能只包含部分字段,\n * 对象级判断会导致 formModel 兜底永远不生效。这里必须做「字段级」查找。\n */\nconst resolveModelValue = (selectName: any): { found: boolean; value: any } => {\n if (\n props.outModel &&\n Object.prototype.hasOwnProperty.call(props.outModel, selectName) &&\n props.outModel[selectName] !== undefined &&\n props.outModel[selectName] !== null\n ) {\n return { found: true, value: props.outModel[selectName] };\n }\n if (props.formModel && Object.prototype.hasOwnProperty.call(props.formModel, selectName)) {\n return { found: true, value: props.formModel[selectName] };\n }\n return { found: false, value: undefined };\n};\n\nconst getConditions = (has_search = true) => {\n const conditions = [];\n let search_conditions = [\n [\n {\n searchType: 3,\n field_name: 'is_active',\n operator: 'eq',\n value: [true],\n format: 'choices',\n class_name: 'bool',\n },\n ],\n ];\n if (props.field.searchConditions) {\n search_conditions = props.field.searchConditions;\n }\n search_conditions.forEach((item: any) => {\n const list = [];\n item.forEach((item1: any) => {\n if (item1.searchType === 1) {\n // outModel 优先、formModel 兜底,两者同时参与查找\n const resolved = resolveModelValue(item1.select_name);\n if (resolved.found) {\n getConditionsItem(resolved.value, list, item1);\n }\n } else if (item1.searchType === 2) {\n Object.keys(props.formModel).forEach((key: any) => {\n if (item1.select_name == key) {\n getConditionsItem(props.formModel[key], list, item1);\n }\n });\n } else if (item1.searchType === 3) {\n getConditionsItem(item1.value, list, item1);\n } else if (item1.searchType === 4) {\n getConditionsItem(resolveContextValueWrapper(item1.select_name), list, item1);\n } else {\n getConditionsItem(item1.value, list, item1);\n }\n });\n conditions.push(list);\n });\n if (searchText.value && has_search) {\n searchConfig.pageSize = 50;\n if (props?.labelKeyList && props?.labelKeyList?.length > 0) {\n props.labelKeyList.forEach((key: any, index: any) => {\n let subSearch = conditions[index];\n if (!subSearch) {\n subSearch = [];\n conditions[index] = subSearch;\n }\n subSearch.push({\n field_name: key,\n operator: 'icontains',\n format: 'input',\n value: [searchText.value],\n class_name: 'str',\n });\n });\n } else {\n if (conditions.length === 0) {\n conditions.push([\n {\n field_name: get_label_key(),\n operator: 'icontains',\n format: 'input',\n value: [searchText.value],\n class_name: 'str',\n },\n ]);\n } else {\n for (const item of conditions) {\n item.push({\n field_name: get_label_key(),\n operator: 'icontains',\n format: 'input',\n value: [searchText.value],\n class_name: 'str',\n });\n }\n }\n }\n }\n return conditions;\n};\nconst getSimpleSearchParams = (has_search = true) => {\n const params = {};\n if (props.field.simpleSearchConditions) {\n props.field.simpleSearchConditions.forEach((item: any) => {\n if (item.searchType === 1) {\n // outModel 优先、formModel 兜底,两者同时参与查找\n const resolved = resolveModelValue(item.select_name);\n if (resolved.found) {\n params[item.field_name] = resolved.value;\n }\n } else if (item.searchType === 2) {\n Object.keys(props.formModel).forEach((key: any) => {\n if (item.select_name == key) {\n const value = props.formModel[key];\n params[item.field_name] = value;\n }\n });\n } else if (item.searchType === 3) {\n params[item.field_name] = item.value;\n } else if (item.searchType === 4) {\n params[item.field_name] = resolveContextValueWrapper(item.select_name);\n }\n });\n }\n if (searchText.value && has_search) {\n if (props?.labelKeyList && props?.labelKeyList?.length > 0) {\n props.labelKeyList.forEach((key: any) => {\n params[key] = searchText.value;\n });\n } else {\n params[get_label_key()] = searchText.value;\n }\n }\n return params;\n};\n\nconst searchConfig: any = {\n current: 1,\n pageSize: 200,\n is_pagination: true,\n request_source: 'strict',\n is_active: true,\n ...props.init_model, // 普通查询条件\n column_fields: [],\n sort_fields: [],\n conditions: [],\n simpleSearchParams: {},\n};\n\nconst get_value_key = () => {\n return props.valueKey || 'id';\n};\n\nconst get_label_key = () => {\n return props.labelKey || 'name';\n};\n\nconst get_sort_fields = () => {\n const list = [];\n if (props?.labelKeyList && props?.labelKeyList?.length > 0 && props.labelKeyType !== 1) {\n list.push(...props.labelKeyList);\n } else {\n list.push(get_label_key());\n }\n return list;\n};\n\nconst getColumnFields = () => {\n const list = [];\n if (props?.labelKeyList && props?.labelKeyList?.length > 0 && props.labelKeyType !== 1) {\n list.push(get_value_key(), ...props.labelKeyList);\n } else {\n list.push(get_value_key(), get_label_key());\n }\n if (props.field?.extendedFields && props.field?.extendedFields.length > 0) {\n list.push(...props.field.extendedFields);\n }\n // 去重\n const uniqueList = [...new Set(list)];\n searchConfig.column_fields = [].concat(uniqueList);\n};\n\ngetColumnFields();\nsearchConfig.sort_fields = get_sort_fields();\nif (props.init_model?.sort_fields) {\n searchConfig.sort_fields = props.init_model?.sort_fields;\n}\n\nconst checkEqualSelected = (value: any) => {\n if (Array.isArray(modalRef.selectedRows)) {\n if (modalRef.selectedRows.includes(value)) {\n return true;\n }\n } else {\n if (modalRef.selectedRows === value) {\n return true;\n }\n }\n return false;\n};\n\n/**\n * 对已选值数组去重。\n * 多选模式下,搜索区多次「展开/隐藏」会导致组件反复挂载初始化,\n * 若沿用 push 方式累积,值会重复(如 [1,2] -> [1,2,1,2]),\n * 这里统一在「初始化赋值 / 外部模型同步 / 值上抛」三处出口做去重。\n * 以 String(item) 作为去重键,兼容 id 字段下 1 与 '1' 混用的情况。\n */\nconst dedupeSelected = (list: any[] | null | undefined): any[] => {\n if (!Array.isArray(list)) {\n return [];\n }\n const seen = new Set<string>();\n const result: any[] = [];\n list.forEach(item => {\n const key = String(item);\n if (!seen.has(key)) {\n seen.add(key);\n result.push(item);\n }\n });\n return result;\n};\n\nconst datasource = computed(() => {\n return modalRef.datasource.map(item => {\n // 已经选择的数据不处理labelKeyList\n if (props.labelKeyList && props.labelKeyList.length > 0 && props?.labelKeyType !== 1) {\n const label = [];\n for (const key of props.labelKeyList) {\n label.push(item[key as string]);\n }\n return {\n value: item[get_value_key()],\n label: label.join(props.labelSpace),\n };\n } else {\n return {\n value: item[get_value_key()],\n label: item[get_label_key()],\n };\n }\n });\n});\nconst getDefaultValue = (dataList: any) => {\n if (dataList && !Array.isArray(dataList)) {\n dataList = [dataList];\n }\n if (\n props.field.default &&\n !props.formModel[props.field.name] &&\n props.field.mode == 'default' &&\n dataList.length > 0\n ) {\n props.formModel[props.field.name] = dataList[0];\n const foundItem = modalRef.datasource.find(item => {\n if (item[get_value_key()] == dataList[0]) {\n return true;\n }\n });\n if (foundItem) {\n emit('update:label', foundItem[get_label_key()]);\n }\n }\n if (props.field.mode == 'default') {\n const selectItems: any = datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label);\n emit('update:label', selectItems.length > 0 ? selectItems[0] : '');\n } else {\n emit(\n 'update:label',\n datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label),\n );\n }\n};\nconst setInnerModel = () => {\n if (props.field.mode === 'default') {\n const rawItems = modalRef.datasource.filter((item: any) =>\n checkEqualSelected(item[get_value_key()]),\n );\n if (props.innerModel) {\n props.innerModel[props.field.name] = rawItems[0];\n }\n } else {\n const rawItems = modalRef.datasource.filter((item: any) =>\n checkEqualSelected(item[get_value_key()]),\n );\n if (props.innerModel) {\n props.innerModel[props.field.name] = rawItems;\n }\n }\n};\n\nlet oldParams = {};\nwatch(\n // outModel 参与 searchType===1 的取值(见 resolveModelValue),必须一并监听:\n // 否则外部模型变化时查询条件不会重建。下方 isEqual(oldParams, newParams) 会比对新旧参数,\n // 参数没变就不会真的刷新,不会多打请求。\n () => [props.formModel, props.context, props.outModel],\n () => {\n const newParams = getQueryParams(false);\n if (!isEqual(oldParams, newParams)) {\n oldParams = newParams;\n delayRefresh(true);\n }\n },\n { deep: true },\n);\n\nwatch(\n () => props.formModel[props.field.name],\n () => {\n if (props.field.mode === 'default') {\n if (props.formModel[props.field.name] || props.formModel[props.field.name] === 0) {\n modalRef.selectedRows = [props.formModel[props.field.name]];\n } else {\n modalRef.selectedRows = [];\n }\n const selectItems: any = datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label);\n emit('update:label', selectItems.length > 0 ? selectItems[0] : '');\n } else {\n // 注意:赋值时必须用「去重后的拷贝」,不能直接引用 formModel 里的原数组,\n // 否则组件内部数组会与外部 searchConditions 的值数组共享同一引用,\n // 一旦后续再对 selectedRows 做任何原地修改(如 push),会反向污染外部模型造成值重复\n if (props.formModel[props.field.name] && props.formModel[props.field.name].length > 0) {\n modalRef.selectedRows = dedupeSelected([...props.formModel[props.field.name]]);\n } else {\n modalRef.selectedRows = [];\n }\n emit(\n 'update:label',\n datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label),\n );\n }\n },\n);\n\nwatch(\n () => props.value,\n () => {\n setInnerModel();\n },\n { deep: true },\n);\n\nconst handleRequiredConditionChange = (key: string) => {\n if (props.field.required_condition) {\n const item = props.field.required_condition.find((item: any) => item.key === key);\n if (item) {\n delayRefresh(true);\n }\n }\n};\n\nonMounted(() => {\n let tmpKey = `${route.path}_${props.field.name}_${props.field.postUrl}`;\n tableKey.value = 'remoteselectpro:' + md5(tmpKey);\n initDataSource();\n required_condition_event_obj().on('required_condition_change', handleRequiredConditionChange);\n refresh();\n});\n\nonUnmounted(() => {\n required_condition_event_obj().off('required_condition_change', handleRequiredConditionChange);\n});\nconst initDataSource = () => {\n // 统一的值转换:valueKey 为 id 时,尽量转成 Number,与历史逻辑保持一致\n const convertValue = (item: any) => {\n if (get_value_key() === 'id') {\n if (isNaN(Number(item))) {\n return item;\n } else {\n return Number(item);\n }\n } else {\n return item;\n }\n };\n let list: any[] = [];\n if (props.field.mode === 'default') {\n if (props.value || props.value === 0) {\n list.push(convertValue(props.value));\n }\n } else {\n if (typeof props.value === 'string') {\n list = (props.value as string).split(',').map(convertValue);\n } else if (props.value instanceof Array) {\n list = props.value.map(convertValue);\n } else if (props.value != null) {\n list.push(convertValue(props.value));\n }\n }\n // 必须用「去重后赋值」替代原 push 逻辑:\n // 该组件在搜索区反复显示/隐藏时会多次挂载,每次挂载都会执行到这里,\n // 若 push 到已存在值的数组上(或与外部模型共享引用的数组上),多选值会重复累积\n modalRef.selectedRows = dedupeSelected(list);\n};\nconst handleChange = () => {\n if (props.field.mode == 'default') {\n emit('update:value', modalRef.selectedRows);\n const selectItems: any = datasource.value\n .filter((item: any) => {\n return modalRef.selectedRows == item.value;\n })\n .map((item: any) => item.label);\n emit('update:label', selectItems.length > 0 ? selectItems[0] : '');\n } else {\n // 出口兜底去重:antd 多选对已有重复值时仍会按 [...mergedValues, val] 追加,\n // 这里先对值去重再上抛,保证外部 searchConditions/formModel 中不会出现重复\n modalRef.selectedRows = dedupeSelected(modalRef.selectedRows);\n emit('update:value', modalRef.selectedRows);\n emit(\n 'update:label',\n datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label),\n );\n }\n};\nconst getRequiredConditionObj = () => {\n const required_condition = props.field.required_condition;\n const required_condition_obj = {};\n if (required_condition) {\n required_condition.forEach((item: any) => {\n const value = requiredConditionStore.value_map[item.key];\n if (value !== undefined && value !== null) {\n required_condition_obj[item.field_name] = value;\n }\n });\n }\n return required_condition_obj;\n};\n\n/**\n * 补充之前选择的项对应的数据\n */\nconst externDataSource = async (params: any, selectedRows: any) => {\n if (selectedRows && !Array.isArray(selectedRows)) {\n selectedRows = [selectedRows];\n }\n if (selectedRows && selectedRows.length > 0) {\n const notFoundValues = [];\n selectedRows.forEach((item1: any) => {\n if (!modalRef.datasource.some(item => item[get_value_key()] === item1)) {\n notFoundValues.push(item1);\n }\n });\n if (notFoundValues.length > 0) {\n const obj = { ...params };\n if (props.field.queryType === 'simple') {\n let value = notFoundValues as any;\n if (value instanceof Array && value.length > 0) {\n value = value.join(',');\n }\n obj[get_value_key()] = value;\n } else {\n if (obj.conditions && obj.conditions.length > 0) {\n obj.conditions[0].push({\n class_name: 'int',\n operator: 'in',\n value: notFoundValues,\n format: 'remote',\n field_name: get_value_key(),\n });\n } else {\n obj.conditions = [[]];\n obj.conditions[0].push({\n class_name: 'int',\n operator: 'in',\n value: notFoundValues,\n format: 'remote',\n field_name: get_value_key(),\n });\n }\n }\n const res1 = await getApiData({ ...obj }, props.field.postUrl, false, {\n skip_error: true,\n });\n modalRef.datasource = modalRef.datasource.concat(res1?.data || []);\n }\n }\n};\nconst getQueryParams = (has_search = true) => {\n let params: any = {};\n if (props.field.queryType === 'simple') {\n searchConfig.simpleSearchParams = getSimpleSearchParams(has_search);\n params = {\n ...searchConfig,\n ...searchConfig.simpleSearchParams,\n required_condition: getRequiredConditionObj(),\n };\n delete params.conditions;\n delete params.simpleSearchParams;\n } else {\n searchConfig.conditions = getConditions(has_search);\n params = { ...searchConfig, required_condition: getRequiredConditionObj() };\n delete params.simpleSearchParams;\n }\n return params;\n};\n\nconst refresh = async (clear = false) => {\n // modalRef.datasource.length = 0;\n // 不清空modalRef.datasource,保留原始数据,如果是输入过滤条件筛选的数据,需要去重后,追加到datasource里\n if (props.field.postUrl) {\n if (clear) {\n modalRef.datasource.length = 0;\n }\n const is_first = modalRef.datasource.length === 0;\n const params = getQueryParams();\n const res = await getApiData(params, props.field.postUrl, false, { skip_error: true });\n if (res?.data?.length > 0) {\n const rowKey = get_value_key();\n const new_list = res?.data.filter(i => {\n const f = modalRef.datasource.find(j => {\n return i[rowKey] == j[rowKey];\n });\n return !f;\n });\n modalRef.datasource = modalRef.datasource.concat(new_list);\n if (is_first) {\n await externDataSource(params, modalRef.selectedRows);\n }\n setInnerModel();\n }\n\n if (props.field.defaultValueType === 'first' && !props.is_form_design) {\n if (!props.formModel[props.field.name]) {\n if (props.field.mode === 'default' || !props.field.mode) {\n emit('update:label', modalRef.datasource[0][get_label_key()]);\n emit('update:value', modalRef.datasource[0][get_value_key()]);\n } else {\n emit('update:label', [modalRef.datasource[0][get_label_key()]]);\n emit('update:value', [modalRef.datasource[0][get_value_key()]]);\n }\n }\n } else if (props.field.defaultValueType === 'global' && !props.is_form_design) {\n if (!props.formModel[props.field.name]) {\n const globalDefaultKey = props.field.globalDefaultKey;\n const globalDefaultField = props.field.globalDefaultField;\n const globalDefaultValue = requiredConditionStore.value_map[globalDefaultKey];\n if (globalDefaultValue) {\n const globalDefaultItem = modalRef.datasource.find(\n item1 => item1[globalDefaultField] === globalDefaultValue,\n );\n if (globalDefaultItem) {\n if (props.field.mode === 'default' || !props.field.mode) {\n emit('update:label', globalDefaultItem[get_label_key()]);\n emit('update:value', globalDefaultItem[get_value_key()]);\n } else {\n emit('update:label', [globalDefaultItem[get_label_key()]]);\n emit('update:value', [globalDefaultItem[get_value_key()]]);\n }\n }\n }\n }\n } else {\n getDefaultValue(modalRef.selectedRows);\n }\n }\n};\nconst delayRefresh: any = debounce((clear = false) => {\n refresh(clear);\n}, 500);\n\nwatch(\n () => [\n props.labelKeyList,\n props.labelKey,\n props.labelKeyType,\n props.valueKey,\n props.labelSpace,\n props.field.postUrl,\n ],\n (newValue, oldValue) => {\n if (!isEqual(newValue, oldValue)) {\n getColumnFields();\n searchConfig.sort_fields = get_sort_fields();\n delayRefresh(true);\n }\n },\n { deep: true },\n);\n\nwatch(\n () => [props.field.searchConditions, props.field.queryType, props.field.simpleSearchConditions],\n (newValue, oldValue) => {\n if (!isEqual(newValue, oldValue)) {\n delayRefresh(true);\n }\n },\n { deep: true },\n);\n\nconst handleSearch = (str: any) => {\n searchText.value = str;\n delayRefresh();\n};\n\nconst tableModal = defineAsyncComponent(() => import('./tableModal.vue'));\n\nconst handleOpenTable = () => {\n let currentValue = [];\n searchText.value = '';\n let rowSelectionType = 'checkbox';\n if (props.field.mode === 'default') {\n rowSelectionType = 'radio';\n }\n if (!datasource.value) {\n currentValue = [];\n } else {\n currentValue = datasource.value.filter((item: any) => checkEqualSelected(item.value));\n }\n tableConfig.value = {\n key: tableKey.value,\n title: props.field.label || props.field.name,\n rowSelectionType,\n columns: props.field.table?.columns || [],\n search_config: props.field.table?.search_config || [],\n list_url: props.field.postUrl,\n is_selection: true,\n is_pagination: true,\n hide_header: true,\n };\n const init_model = props.init_model || {};\n if (props.field.queryType === 'simple') {\n tableConfig.value['query_params'] = { ...init_model, ...getSimpleSearchParams() };\n } else {\n const conditions = getConditions();\n tableConfig.value['query_params'] = init_model;\n if (conditions.length > 0 && conditions[0].length > 0) {\n tableConfig.value['base_conditions'] = conditions[0];\n }\n }\n const required_condition = getRequiredConditionObj();\n if (required_condition) {\n tableConfig.value['query_params'] = {\n ...tableConfig.value['query_params'],\n required_condition,\n };\n }\n const tempModal = reactive({\n open: true,\n loading: false,\n component: tableModal,\n isMultiple: props.field.mode !== 'default',\n tableConfig: tableConfig.value,\n labelKey: props.labelKey || 'name',\n value: currentValue,\n labelKeyList: props.labelKeyList || [],\n labelKeyType: props.labelKeyType || 1,\n labelSpace: props.labelSpace || '-',\n valueKey: props.valueKey || 'id',\n ok: async (data: any) => {\n const selectedValues = data.map((item: any) => item.value) || [];\n const selectedLabels = data.map((item: any) => item.label) || [];\n const params = getQueryParams();\n if (props.field.mode == 'default') {\n if (selectedValues.length == 0) {\n modalRef.selectedRows = undefined;\n emit('update:value', modalRef.selectedRows);\n emit('update:label', undefined);\n } else {\n modalRef.selectedRows = selectedValues[0];\n await externDataSource(params, selectedValues[0]);\n emit('update:value', modalRef.selectedRows);\n emit('update:label', selectedLabels[0]);\n }\n } else {\n modalRef.selectedRows = selectedValues;\n await externDataSource(params, selectedValues);\n emit('update:value', modalRef.selectedRows);\n emit('update:label', selectedLabels);\n }\n },\n cancel: () => {\n console.log('cancel');\n },\n });\n modalBox(tempModal);\n};\n\nconst filterOption = (val: string, option: any) => {\n if (datasource.value instanceof Array) {\n const f: any = datasource.value.find(item => {\n return item['value'] == option.key;\n });\n if (f) {\n return String(f['label']).toLowerCase().indexOf(val.toLowerCase()) >= 0;\n } else {\n return false;\n }\n }\n};\n</script>\n<style scoped lang=\"less\">\n.remote-select-pro {\n display: flex;\n align-items: flex-start;\n gap: 4px;\n flex-wrap: nowrap;\n // 禁用状态下文字保持黑色,不显示为灰色\n :deep(.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector) {\n color: #000;\n }\n :deep(.ant-select-disabled .ant-select-selection-item) {\n color: #000;\n }\n}\n.ant-input-group.ant-input-group-compact {\n .remote-select-pro {\n display: flex;\n }\n}\n.ant-form-inline {\n .ant-input-group.ant-input-group-compact {\n .remote-select-pro {\n display: inline-flex;\n }\n }\n}\n.table-search-icon {\n color: black;\n font-size: 17px;\n}\n</style>\n","<template>\n <div class=\"remote-select-pro\">\n <a-select\n v-model:value=\"modalRef.selectedRows\"\n :allow-clear=\"field.allowClear !== false\"\n :default-value=\"field.defaultValue\"\n :disabled=\"field.disabled\"\n :filter-option=\"filterOption\"\n :maxTagCount=\"field.maxTagCount ? field.maxTagCount : 'responsive'\"\n :mode=\"field.mode == 'default' ? null : field.mode\"\n :placeholder=\"placeholder\"\n :show-search=\"field.show_search !== false\"\n size=\"small\"\n :autoClearSearchValue=\"false\"\n @change=\"handleChange\"\n @search=\"handleSearch\"\n style=\"min-width: 120px\"\n >\n <a-select-option\n v-for=\"option in datasource\"\n :key=\"option.value\"\n :value=\"option.value\"\n >\n <bold-matcher\n :text=\"option.label\"\n :pattern=\"searchText\"\n :color=\"field.searchColor\"\n />\n </a-select-option>\n </a-select>\n\n <div\n v-if=\"field.table?.enable\"\n class=\"table-search-icon\"\n style=\"margin-right: 5px\"\n >\n <FileSearchOutlined @click=\"handleOpenTable\" />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, defineAsyncComponent, onMounted, onUnmounted, reactive, ref, watch } from 'vue';\nimport { debounce, isEqual } from 'lodash-es';\nimport { convertValueByClassName, isNotEmpty } from 'liyu-pc-base/utils/function';\nimport BoldMatcher from 'liyu-pc-base/components/FormRender/RemoteSelect/boldenText.vue';\nimport { getApiData } from 'liyu-pc-base/api/api-model';\nimport { useRequiredConditionStore, required_condition_event_obj } from 'liyu-pc-base/init-plugin';\nimport modalBox from 'liyu-pc-base/components/form-modal/modal-tools';\nimport md5 from 'blueimp-md5';\nimport { useRoute } from 'vue-router';\nimport { resolveContextValue } from 'liyu-pc-base/components/FormRender/utils';\n\ndefineOptions({\n name: 'RemoteSelectPro',\n});\n\ntype Field = {\n label: string;\n mode: 'multiple' | 'tags' | 'combobox' | 'default';\n cb?: any;\n select_style: any;\n default: string;\n name: string;\n postUrl: string;\n searchConditions: any;\n queryType: string;\n simpleSearchConditions: any;\n maxTagCount: number;\n allowClear: boolean;\n defaultValue: any;\n disabled: boolean;\n show_search: boolean;\n searchColor: string;\n required_condition: any;\n defaultValueType: string;\n globalDefaultKey: string;\n globalDefaultField: string;\n extendedFields: string[];\n table: any;\n};\ninterface Props {\n field: Field;\n valueKey?: string;\n labelKeyType?: number;\n labelKey?: string;\n labelSpace?: string;\n labelKeyList?: any[];\n value?: Array<any> | number | string | null;\n label?: Array<any> | string;\n formModel: Record<string, any>;\n outModel?: Record<string, any>;\n placeholder?: string;\n init_model?: Record<string, any>;\n is_input?: boolean;\n init_watch?: Record<string, any>;\n is_form_design?: boolean;\n innerModel?: any;\n globalInnerModel?: any;\n context?: Record<string, any> | null;\n baseKeyPath?: any;\n}\nconst props = withDefaults(defineProps<Props>(), {\n labelKeyType: 0,\n labelSpace: '-',\n labelKeyList: () => [],\n value: null,\n label: () => [],\n outModel: () => ({}),\n init_model: () => ({}),\n is_input: false,\n init_watch: () => ({}),\n is_form_design: false,\n innerModel: null,\n globalInnerModel: null,\n context: null,\n baseKeyPath: () => [],\n});\n\nconst emit = defineEmits<{\n 'update:value': [value: any];\n 'update:label': [value: any];\n}>();\nconst modalRef = reactive({\n selectedRows: new Array<number | any>(),\n datasource: new Array<any>(),\n});\nconst route = useRoute();\nconst tableKey = ref('remoteSelectPro');\nconst tableConfig = ref(null);\nconst searchText = ref('');\nconst requiredConditionStore = useRequiredConditionStore();\nconst getConditionsItem = (value: any, list: any, item: any) => {\n if (item.operator === 'not_blank_not_null') {\n list.push({\n field_name: item.field_name,\n operator: item.operator,\n value: [],\n format: item.format,\n class_name: item.class_name,\n });\n } else if (value instanceof Array) {\n const [first] = value;\n if (isNotEmpty(first)) {\n list.push({\n field_name: item.field_name,\n operator: item.operator,\n value: convertValueByClassName(value, item.class_name),\n format: item.format,\n class_name: item.class_name,\n });\n }\n } else if (isNotEmpty(value)) {\n let val = value;\n if (item.operator === 'in' || item.operator === 'notin') {\n if (value.includes('[')) {\n val = JSON.parse(value);\n } else if (value.includes(',')) {\n val = value.split(',');\n }\n if (item.class_name === 'int') {\n val = val.map(Number);\n }\n }\n list.push({\n field_name: item.field_name,\n operator: item.operator,\n value: convertValueByClassName(val instanceof Array ? val : [val], item.class_name),\n format: item.format,\n class_name: item.class_name,\n });\n }\n};\n\n/**\n * 解析相对于 baseKeyPath 的表达式,从 props.context 中获取值。\n * 核心算法已移至 utils.ts 的 resolveContextValue,这里仅做 props 绑定。\n */\nconst resolveContextValueWrapper = (selectName: string): any => {\n const value = resolveContextValue(selectName, props.context, [\n 'formModel',\n ...(props.baseKeyPath || []),\n ]);\n return value;\n};\n\n/**\n * searchType === 1 时按 key 同时处理 outModel 与 formModel:\n * 1. outModel 中存在该字段且有值(非 undefined / null)时,优先取 outModel 的值;\n * 2. 否则回退到 formModel 中的同名字段。\n * 注意:不能用 `outModel ? outModel : formModel` 做「对象级」二选一 ——\n * outModel 有默认值 `{}`(恒为真值),且它可能只包含部分字段,\n * 对象级判断会导致 formModel 兜底永远不生效。这里必须做「字段级」查找。\n */\nconst resolveModelValue = (selectName: any): { found: boolean; value: any } => {\n if (\n props.outModel &&\n Object.prototype.hasOwnProperty.call(props.outModel, selectName) &&\n props.outModel[selectName] !== undefined &&\n props.outModel[selectName] !== null\n ) {\n return { found: true, value: props.outModel[selectName] };\n }\n if (props.formModel && Object.prototype.hasOwnProperty.call(props.formModel, selectName)) {\n return { found: true, value: props.formModel[selectName] };\n }\n return { found: false, value: undefined };\n};\n\nconst getConditions = (has_search = true) => {\n const conditions = [];\n let search_conditions = [\n [\n {\n searchType: 3,\n field_name: 'is_active',\n operator: 'eq',\n value: [true],\n format: 'choices',\n class_name: 'bool',\n },\n ],\n ];\n if (props.field.searchConditions) {\n search_conditions = props.field.searchConditions;\n }\n search_conditions.forEach((item: any) => {\n const list = [];\n item.forEach((item1: any) => {\n if (item1.searchType === 1) {\n // outModel 优先、formModel 兜底,两者同时参与查找\n const resolved = resolveModelValue(item1.select_name);\n if (resolved.found) {\n getConditionsItem(resolved.value, list, item1);\n }\n } else if (item1.searchType === 2) {\n Object.keys(props.formModel).forEach((key: any) => {\n if (item1.select_name == key) {\n getConditionsItem(props.formModel[key], list, item1);\n }\n });\n } else if (item1.searchType === 3) {\n getConditionsItem(item1.value, list, item1);\n } else if (item1.searchType === 4) {\n getConditionsItem(resolveContextValueWrapper(item1.select_name), list, item1);\n } else {\n getConditionsItem(item1.value, list, item1);\n }\n });\n conditions.push(list);\n });\n if (searchText.value && has_search) {\n searchConfig.pageSize = 50;\n if (props?.labelKeyList && props?.labelKeyList?.length > 0) {\n props.labelKeyList.forEach((key: any, index: any) => {\n let subSearch = conditions[index];\n if (!subSearch) {\n subSearch = [];\n conditions[index] = subSearch;\n }\n subSearch.push({\n field_name: key,\n operator: 'icontains',\n format: 'input',\n value: [searchText.value],\n class_name: 'str',\n });\n });\n } else {\n if (conditions.length === 0) {\n conditions.push([\n {\n field_name: get_label_key(),\n operator: 'icontains',\n format: 'input',\n value: [searchText.value],\n class_name: 'str',\n },\n ]);\n } else {\n for (const item of conditions) {\n item.push({\n field_name: get_label_key(),\n operator: 'icontains',\n format: 'input',\n value: [searchText.value],\n class_name: 'str',\n });\n }\n }\n }\n }\n return conditions;\n};\nconst getSimpleSearchParams = (has_search = true) => {\n const params = {};\n if (props.field.simpleSearchConditions) {\n props.field.simpleSearchConditions.forEach((item: any) => {\n if (item.searchType === 1) {\n // outModel 优先、formModel 兜底,两者同时参与查找\n const resolved = resolveModelValue(item.select_name);\n if (resolved.found) {\n params[item.field_name] = resolved.value;\n }\n } else if (item.searchType === 2) {\n Object.keys(props.formModel).forEach((key: any) => {\n if (item.select_name == key) {\n const value = props.formModel[key];\n params[item.field_name] = value;\n }\n });\n } else if (item.searchType === 3) {\n params[item.field_name] = item.value;\n } else if (item.searchType === 4) {\n params[item.field_name] = resolveContextValueWrapper(item.select_name);\n }\n });\n }\n if (searchText.value && has_search) {\n if (props?.labelKeyList && props?.labelKeyList?.length > 0) {\n props.labelKeyList.forEach((key: any) => {\n params[key] = searchText.value;\n });\n } else {\n params[get_label_key()] = searchText.value;\n }\n }\n return params;\n};\n\nconst searchConfig: any = {\n current: 1,\n pageSize: 200,\n is_pagination: true,\n request_source: 'strict',\n is_active: true,\n ...props.init_model, // 普通查询条件\n column_fields: [],\n sort_fields: [],\n conditions: [],\n simpleSearchParams: {},\n};\n\nconst get_value_key = () => {\n return props.valueKey || 'id';\n};\n\nconst get_label_key = () => {\n return props.labelKey || 'name';\n};\n\nconst get_sort_fields = () => {\n const list = [];\n if (props?.labelKeyList && props?.labelKeyList?.length > 0 && props.labelKeyType !== 1) {\n list.push(...props.labelKeyList);\n } else {\n list.push(get_label_key());\n }\n return list;\n};\n\nconst getColumnFields = () => {\n const list = [];\n if (props?.labelKeyList && props?.labelKeyList?.length > 0 && props.labelKeyType !== 1) {\n list.push(get_value_key(), ...props.labelKeyList);\n } else {\n list.push(get_value_key(), get_label_key());\n }\n if (props.field?.extendedFields && props.field?.extendedFields.length > 0) {\n list.push(...props.field.extendedFields);\n }\n // 去重\n const uniqueList = [...new Set(list)];\n searchConfig.column_fields = [].concat(uniqueList);\n};\n\ngetColumnFields();\nsearchConfig.sort_fields = get_sort_fields();\nif (props.init_model?.sort_fields) {\n searchConfig.sort_fields = props.init_model?.sort_fields;\n}\n\nconst checkEqualSelected = (value: any) => {\n if (Array.isArray(modalRef.selectedRows)) {\n if (modalRef.selectedRows.includes(value)) {\n return true;\n }\n } else {\n if (modalRef.selectedRows === value) {\n return true;\n }\n }\n return false;\n};\n\n/**\n * 对已选值数组去重。\n * 多选模式下,搜索区多次「展开/隐藏」会导致组件反复挂载初始化,\n * 若沿用 push 方式累积,值会重复(如 [1,2] -> [1,2,1,2]),\n * 这里统一在「初始化赋值 / 外部模型同步 / 值上抛」三处出口做去重。\n * 以 String(item) 作为去重键,兼容 id 字段下 1 与 '1' 混用的情况。\n */\nconst dedupeSelected = (list: any[] | null | undefined): any[] => {\n if (!Array.isArray(list)) {\n return [];\n }\n const seen = new Set<string>();\n const result: any[] = [];\n list.forEach(item => {\n const key = String(item);\n if (!seen.has(key)) {\n seen.add(key);\n result.push(item);\n }\n });\n return result;\n};\n\nconst datasource = computed(() => {\n return modalRef.datasource.map(item => {\n // 已经选择的数据不处理labelKeyList\n if (props.labelKeyList && props.labelKeyList.length > 0 && props?.labelKeyType !== 1) {\n const label = [];\n for (const key of props.labelKeyList) {\n label.push(item[key as string]);\n }\n return {\n value: item[get_value_key()],\n label: label.join(props.labelSpace),\n };\n } else {\n return {\n value: item[get_value_key()],\n label: item[get_label_key()],\n };\n }\n });\n});\nconst getDefaultValue = (dataList: any) => {\n if (dataList && !Array.isArray(dataList)) {\n dataList = [dataList];\n }\n if (\n props.field.default &&\n !props.formModel[props.field.name] &&\n props.field.mode == 'default' &&\n dataList.length > 0\n ) {\n props.formModel[props.field.name] = dataList[0];\n const foundItem = modalRef.datasource.find(item => {\n if (item[get_value_key()] == dataList[0]) {\n return true;\n }\n });\n if (foundItem) {\n emit('update:label', foundItem[get_label_key()]);\n }\n }\n if (props.field.mode == 'default') {\n const selectItems: any = datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label);\n emit('update:label', selectItems.length > 0 ? selectItems[0] : '');\n } else {\n emit(\n 'update:label',\n datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label),\n );\n }\n};\nconst setInnerModel = () => {\n if (props.field.mode === 'default') {\n const rawItems = modalRef.datasource.filter((item: any) =>\n checkEqualSelected(item[get_value_key()]),\n );\n if (props.innerModel) {\n props.innerModel[props.field.name] = rawItems[0];\n }\n } else {\n const rawItems = modalRef.datasource.filter((item: any) =>\n checkEqualSelected(item[get_value_key()]),\n );\n if (props.innerModel) {\n props.innerModel[props.field.name] = rawItems;\n }\n }\n};\n\nlet oldParams = {};\nwatch(\n // outModel 参与 searchType===1 的取值(见 resolveModelValue),必须一并监听:\n // 否则外部模型变化时查询条件不会重建。下方 isEqual(oldParams, newParams) 会比对新旧参数,\n // 参数没变就不会真的刷新,不会多打请求。\n () => [props.formModel, props.context, props.outModel],\n () => {\n const newParams = getQueryParams(false);\n if (!isEqual(oldParams, newParams)) {\n oldParams = newParams;\n delayRefresh(true);\n }\n },\n { deep: true },\n);\n\nwatch(\n () => props.formModel[props.field.name],\n () => {\n if (props.field.mode === 'default') {\n if (props.formModel[props.field.name] || props.formModel[props.field.name] === 0) {\n modalRef.selectedRows = [props.formModel[props.field.name]];\n } else {\n modalRef.selectedRows = [];\n }\n const selectItems: any = datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label);\n emit('update:label', selectItems.length > 0 ? selectItems[0] : '');\n } else {\n // 注意:赋值时必须用「去重后的拷贝」,不能直接引用 formModel 里的原数组,\n // 否则组件内部数组会与外部 searchConditions 的值数组共享同一引用,\n // 一旦后续再对 selectedRows 做任何原地修改(如 push),会反向污染外部模型造成值重复\n if (props.formModel[props.field.name] && props.formModel[props.field.name].length > 0) {\n modalRef.selectedRows = dedupeSelected([...props.formModel[props.field.name]]);\n } else {\n modalRef.selectedRows = [];\n }\n emit(\n 'update:label',\n datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label),\n );\n }\n },\n);\n\nwatch(\n () => props.value,\n () => {\n setInnerModel();\n },\n { deep: true },\n);\n\nconst handleRequiredConditionChange = (key: string) => {\n if (props.field.required_condition) {\n const item = props.field.required_condition.find((item: any) => item.key === key);\n if (item) {\n delayRefresh(true);\n }\n }\n};\n\nonMounted(() => {\n let tmpKey = `${route.path}_${props.field.name}_${props.field.postUrl}`;\n tableKey.value = 'remoteselectpro:' + md5(tmpKey);\n initDataSource();\n required_condition_event_obj().on('required_condition_change', handleRequiredConditionChange);\n refresh();\n});\n\nonUnmounted(() => {\n required_condition_event_obj().off('required_condition_change', handleRequiredConditionChange);\n});\nconst initDataSource = () => {\n // 统一的值转换:valueKey 为 id 时,尽量转成 Number,与历史逻辑保持一致\n const convertValue = (item: any) => {\n if (get_value_key() === 'id') {\n if (isNaN(Number(item))) {\n return item;\n } else {\n return Number(item);\n }\n } else {\n return item;\n }\n };\n let list: any[] = [];\n if (props.field.mode === 'default') {\n if (props.value || props.value === 0) {\n list.push(convertValue(props.value));\n }\n } else {\n if (typeof props.value === 'string') {\n list = (props.value as string).split(',').map(convertValue);\n } else if (props.value instanceof Array) {\n list = props.value.map(convertValue);\n } else if (props.value != null) {\n list.push(convertValue(props.value));\n }\n }\n // 必须用「去重后赋值」替代原 push 逻辑:\n // 该组件在搜索区反复显示/隐藏时会多次挂载,每次挂载都会执行到这里,\n // 若 push 到已存在值的数组上(或与外部模型共享引用的数组上),多选值会重复累积\n modalRef.selectedRows = dedupeSelected(list);\n};\nconst handleChange = () => {\n if (props.field.mode == 'default') {\n emit('update:value', modalRef.selectedRows);\n const selectItems: any = datasource.value\n .filter((item: any) => {\n return modalRef.selectedRows == item.value;\n })\n .map((item: any) => item.label);\n emit('update:label', selectItems.length > 0 ? selectItems[0] : '');\n } else {\n // 出口兜底去重:antd 多选对已有重复值时仍会按 [...mergedValues, val] 追加,\n // 这里先对值去重再上抛,保证外部 searchConditions/formModel 中不会出现重复\n modalRef.selectedRows = dedupeSelected(modalRef.selectedRows);\n emit('update:value', modalRef.selectedRows);\n emit(\n 'update:label',\n datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label),\n );\n }\n};\nconst getRequiredConditionObj = () => {\n const required_condition = props.field.required_condition;\n const required_condition_obj = {};\n if (required_condition) {\n required_condition.forEach((item: any) => {\n const value = requiredConditionStore.value_map[item.key];\n if (value !== undefined && value !== null) {\n required_condition_obj[item.field_name] = value;\n }\n });\n }\n return required_condition_obj;\n};\n\n/**\n * 补充之前选择的项对应的数据\n */\nconst externDataSource = async (params: any, selectedRows: any) => {\n if (selectedRows && !Array.isArray(selectedRows)) {\n selectedRows = [selectedRows];\n }\n if (selectedRows && selectedRows.length > 0) {\n const notFoundValues = [];\n selectedRows.forEach((item1: any) => {\n if (!modalRef.datasource.some(item => item[get_value_key()] === item1)) {\n notFoundValues.push(item1);\n }\n });\n if (notFoundValues.length > 0) {\n const obj = { ...params };\n if (props.field.queryType === 'simple') {\n let value = notFoundValues as any;\n if (value instanceof Array && value.length > 0) {\n value = value.join(',');\n }\n obj[get_value_key()] = value;\n } else {\n if (obj.conditions && obj.conditions.length > 0) {\n obj.conditions[0].push({\n class_name: 'int',\n operator: 'in',\n value: notFoundValues,\n format: 'remote',\n field_name: get_value_key(),\n });\n } else {\n obj.conditions = [[]];\n obj.conditions[0].push({\n class_name: 'int',\n operator: 'in',\n value: notFoundValues,\n format: 'remote',\n field_name: get_value_key(),\n });\n }\n }\n const res1 = await getApiData({ ...obj }, props.field.postUrl, false, {\n skip_error: true,\n });\n modalRef.datasource = modalRef.datasource.concat(res1?.data || []);\n }\n }\n};\nconst getQueryParams = (has_search = true) => {\n let params: any = {};\n if (props.field.queryType === 'simple') {\n searchConfig.simpleSearchParams = getSimpleSearchParams(has_search);\n params = {\n ...searchConfig,\n ...searchConfig.simpleSearchParams,\n required_condition: getRequiredConditionObj(),\n };\n delete params.conditions;\n delete params.simpleSearchParams;\n } else {\n searchConfig.conditions = getConditions(has_search);\n params = { ...searchConfig, required_condition: getRequiredConditionObj() };\n delete params.simpleSearchParams;\n }\n return params;\n};\n\nconst refresh = async (clear = false) => {\n // modalRef.datasource.length = 0;\n // 不清空modalRef.datasource,保留原始数据,如果是输入过滤条件筛选的数据,需要去重后,追加到datasource里\n if (props.field.postUrl) {\n if (clear) {\n modalRef.datasource.length = 0;\n }\n const is_first = modalRef.datasource.length === 0;\n const params = getQueryParams();\n const res = await getApiData(params, props.field.postUrl, false, { skip_error: true });\n if (res?.data?.length > 0) {\n const rowKey = get_value_key();\n const new_list = res?.data.filter(i => {\n const f = modalRef.datasource.find(j => {\n return i[rowKey] == j[rowKey];\n });\n return !f;\n });\n modalRef.datasource = modalRef.datasource.concat(new_list);\n if (is_first) {\n await externDataSource(params, modalRef.selectedRows);\n }\n setInnerModel();\n }\n\n if (props.field.defaultValueType === 'first' && !props.is_form_design) {\n if (!props.formModel[props.field.name]) {\n if (props.field.mode === 'default' || !props.field.mode) {\n emit('update:label', modalRef.datasource[0][get_label_key()]);\n emit('update:value', modalRef.datasource[0][get_value_key()]);\n } else {\n emit('update:label', [modalRef.datasource[0][get_label_key()]]);\n emit('update:value', [modalRef.datasource[0][get_value_key()]]);\n }\n }\n } else if (props.field.defaultValueType === 'global' && !props.is_form_design) {\n if (!props.formModel[props.field.name]) {\n const globalDefaultKey = props.field.globalDefaultKey;\n const globalDefaultField = props.field.globalDefaultField;\n const globalDefaultValue = requiredConditionStore.value_map[globalDefaultKey];\n if (globalDefaultValue) {\n const globalDefaultItem = modalRef.datasource.find(\n item1 => item1[globalDefaultField] === globalDefaultValue,\n );\n if (globalDefaultItem) {\n if (props.field.mode === 'default' || !props.field.mode) {\n emit('update:label', globalDefaultItem[get_label_key()]);\n emit('update:value', globalDefaultItem[get_value_key()]);\n } else {\n emit('update:label', [globalDefaultItem[get_label_key()]]);\n emit('update:value', [globalDefaultItem[get_value_key()]]);\n }\n }\n }\n }\n } else {\n getDefaultValue(modalRef.selectedRows);\n }\n }\n};\nconst delayRefresh: any = debounce((clear = false) => {\n refresh(clear);\n}, 500);\n\nwatch(\n () => [\n props.labelKeyList,\n props.labelKey,\n props.labelKeyType,\n props.valueKey,\n props.labelSpace,\n props.field.postUrl,\n ],\n (newValue, oldValue) => {\n if (!isEqual(newValue, oldValue)) {\n getColumnFields();\n searchConfig.sort_fields = get_sort_fields();\n delayRefresh(true);\n }\n },\n { deep: true },\n);\n\nwatch(\n () => [props.field.searchConditions, props.field.queryType, props.field.simpleSearchConditions],\n (newValue, oldValue) => {\n if (!isEqual(newValue, oldValue)) {\n delayRefresh(true);\n }\n },\n { deep: true },\n);\n\nconst handleSearch = (str: any) => {\n searchText.value = str;\n delayRefresh();\n};\n\nconst tableModal = defineAsyncComponent(() => import('./tableModal.vue'));\n\nconst handleOpenTable = () => {\n let currentValue = [];\n searchText.value = '';\n let rowSelectionType = 'checkbox';\n if (props.field.mode === 'default') {\n rowSelectionType = 'radio';\n }\n if (!datasource.value) {\n currentValue = [];\n } else {\n currentValue = datasource.value.filter((item: any) => checkEqualSelected(item.value));\n }\n tableConfig.value = {\n key: tableKey.value,\n title: props.field.label || props.field.name,\n rowSelectionType,\n columns: props.field.table?.columns || [],\n search_config: props.field.table?.search_config || [],\n list_url: props.field.postUrl,\n is_selection: true,\n is_pagination: true,\n hide_header: true,\n };\n const init_model = props.init_model || {};\n if (props.field.queryType === 'simple') {\n tableConfig.value['query_params'] = { ...init_model, ...getSimpleSearchParams() };\n } else {\n const conditions = getConditions();\n tableConfig.value['query_params'] = init_model;\n if (conditions.length > 0 && conditions[0].length > 0) {\n tableConfig.value['base_conditions'] = conditions[0];\n }\n }\n const required_condition = getRequiredConditionObj();\n if (required_condition) {\n tableConfig.value['query_params'] = {\n ...tableConfig.value['query_params'],\n required_condition,\n };\n }\n const tempModal = reactive({\n open: true,\n loading: false,\n component: tableModal,\n isMultiple: props.field.mode !== 'default',\n tableConfig: tableConfig.value,\n labelKey: props.labelKey || 'name',\n value: currentValue,\n labelKeyList: props.labelKeyList || [],\n labelKeyType: props.labelKeyType || 1,\n labelSpace: props.labelSpace || '-',\n valueKey: props.valueKey || 'id',\n ok: async (data: any) => {\n const selectedValues = data.map((item: any) => item.value) || [];\n const selectedLabels = data.map((item: any) => item.label) || [];\n const params = getQueryParams();\n if (props.field.mode == 'default') {\n if (selectedValues.length == 0) {\n modalRef.selectedRows = undefined;\n emit('update:value', modalRef.selectedRows);\n emit('update:label', undefined);\n } else {\n modalRef.selectedRows = selectedValues[0];\n await externDataSource(params, selectedValues[0]);\n emit('update:value', modalRef.selectedRows);\n emit('update:label', selectedLabels[0]);\n }\n } else {\n modalRef.selectedRows = selectedValues;\n await externDataSource(params, selectedValues);\n emit('update:value', modalRef.selectedRows);\n emit('update:label', selectedLabels);\n }\n },\n cancel: () => {\n console.log('cancel');\n },\n });\n modalBox(tempModal);\n};\n\nconst filterOption = (val: string, option: any) => {\n if (datasource.value instanceof Array) {\n const f: any = datasource.value.find(item => {\n return item['value'] == option.key;\n });\n if (f) {\n return String(f['label']).toLowerCase().indexOf(val.toLowerCase()) >= 0;\n } else {\n return false;\n }\n }\n};\n</script>\n<style scoped lang=\"less\">\n.remote-select-pro {\n display: flex;\n align-items: flex-start;\n gap: 4px;\n flex-wrap: nowrap;\n // 禁用状态下文字保持黑色,不显示为灰色\n :deep(.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector) {\n color: #000;\n }\n :deep(.ant-select-disabled .ant-select-selection-item) {\n color: #000;\n }\n}\n.ant-input-group.ant-input-group-compact {\n .remote-select-pro {\n display: flex;\n }\n}\n.ant-form-inline {\n .ant-input-group.ant-input-group-compact {\n .remote-select-pro {\n display: inline-flex;\n }\n }\n}\n.table-search-icon {\n color: black;\n font-size: 17px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsGA,IAAM,IAAQ,GAiBR,IAAO,GAIP,IAAW,EAAS;GACxB,cAAc,CAAwB;GACtC,YAAY,CAAe;EAC7B,CAAC,GACK,KAAQ,GAAS,GACjB,IAAW,EAAI,iBAAiB,GAChC,IAAc,EAAI,IAAI,GACtB,IAAa,EAAI,EAAE,GACnB,IAAyB,EAA0B,GACnD,KAAqB,GAAY,GAAW,MAAc;GAC9D,IAAI,EAAK,aAAa,sBACpB,EAAK,KAAK;IACR,YAAY,EAAK;IACjB,UAAU,EAAK;IACf,OAAO,CAAC;IACR,QAAQ,EAAK;IACb,YAAY,EAAK;GACnB,CAAC;QACI,IAAI,aAAiB,OAAO;IACjC,IAAM,CAAC,KAAS;IAChB,AAAI,EAAW,CAAK,KAClB,EAAK,KAAK;KACR,YAAY,EAAK;KACjB,UAAU,EAAK;KACf,OAAO,EAAwB,GAAO,EAAK,UAAU;KACrD,QAAQ,EAAK;KACb,YAAY,EAAK;IACnB,CAAC;GAEL,OAAO,IAAI,EAAW,CAAK,GAAG;IAC5B,IAAI,IAAM;IAWV,CAVI,EAAK,aAAa,QAAQ,EAAK,aAAa,aAC1C,EAAM,SAAS,GAAG,IACpB,IAAM,KAAK,MAAM,CAAK,IACb,EAA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AAY;IAC5B,OAAO;IACP,cAAc,EAAM,gBAAgB,CAAC;IACrC,cAAc,EAAM,gBAAgB;IACpC,YAAY,EAAM,cAAc;IAChC,UAAU,EAAM,YAAY;IAC5B,IAAI,OAAO,MAAc;KACvB,IAAM,IAAiB,EAAK,KAAK,MAAc,EAAK,KAAK,KAAK,CAAC,GACzD,IAAiB,EAAK,KAAK,MAAc,EAAK,KAAK,KAAK,CAAC,GACzD,IAAS,EAAe;KAC9B,AAAI,EAAM,MAAM,QAAQ,YAClB,EAAe,UAAU,KAC3B,EAAS,eAAe,KAAA,GACxB,EAAK,gBAAgB,EAAS,YAAY,GAC1C,EAAK,gBAAgB,KAAA,CAAS,MAE9B,EAAS,eAAe,EAAe,IACvC,MAAM,EAAiB,GAAQ,EAAe,EAAE,GAChD,EAAK,gBAAgB,EAAS,YAAY,GAC1C,EAAK,gBAAgB,EAAe,EAAE,MAGxC,EAAS,eAAe,GACxB,MAAM,EAAiB,GAAQ,CAAc,GAC7C,EAAK,gBAAgB,EAAS,YAAY,GAC1C,EAAK,gBAAgB,CAAc;IAEvC;IACA,cAAc;KACZ,QAAQ,IAAI,QAAQ;IACtB;GACF,CACS,CAAS;EACpB,GAEM,MAAgB,GAAa,MAAgB;GACjD,IAAI,EAAW,iBAAiB,OAAO;IACrC,IAAM,IAAS,EAAW,MAAM,MAAK,MAC5B,EAAK,SAAY,EAAO,GAChC;IAIC,OAHE,IACK,OAAO,EAAE,KAAQ,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAI,YAAY,CAAC,KAAK,IAE/D;GAEX;EACF"}
|
|
1
|
+
{"version":3,"file":"RemoteSelectPro-CcWTS4f6.js","names":[],"sources":["../src/components/FormRender/RemoteSelectPro/RemoteSelectPro.vue","../src/components/FormRender/RemoteSelectPro/RemoteSelectPro.vue"],"sourcesContent":["<template>\n <div class=\"remote-select-pro\">\n <a-select\n v-model:value=\"modalRef.selectedRows\"\n :allow-clear=\"field.allowClear !== false\"\n :default-value=\"field.defaultValue\"\n :disabled=\"field.disabled\"\n :filter-option=\"filterOption\"\n :maxTagCount=\"field.maxTagCount ? field.maxTagCount : 'responsive'\"\n :mode=\"field.mode == 'default' ? null : field.mode\"\n :placeholder=\"placeholder\"\n :show-search=\"field.show_search !== false\"\n size=\"small\"\n :autoClearSearchValue=\"false\"\n @change=\"handleChange\"\n @search=\"handleSearch\"\n style=\"min-width: 120px\"\n >\n <a-select-option\n v-for=\"option in datasource\"\n :key=\"option.value\"\n :value=\"option.value\"\n >\n <bold-matcher\n :text=\"option.label\"\n :pattern=\"searchText\"\n :color=\"field.searchColor\"\n />\n </a-select-option>\n </a-select>\n\n <div\n v-if=\"field.table?.enable\"\n class=\"table-search-icon\"\n style=\"margin-right: 5px\"\n >\n <FileSearchOutlined @click=\"handleOpenTable\" />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, defineAsyncComponent, onMounted, onUnmounted, reactive, ref, watch } from 'vue';\nimport { debounce, isEqual } from 'lodash-es';\nimport { convertValueByClassName, isNotEmpty } from 'liyu-pc-base/utils/function';\nimport BoldMatcher from 'liyu-pc-base/components/FormRender/RemoteSelect/boldenText.vue';\nimport { getApiData } from 'liyu-pc-base/api/api-model';\nimport { useRequiredConditionStore, required_condition_event_obj } from 'liyu-pc-base/init-plugin';\nimport modalBox from 'liyu-pc-base/components/form-modal/modal-tools';\nimport md5 from 'blueimp-md5';\nimport { useRoute } from 'vue-router';\nimport { resolveContextValue } from 'liyu-pc-base/components/FormRender/utils';\n\ndefineOptions({\n name: 'RemoteSelectPro',\n});\n\ntype Field = {\n label: string;\n mode: 'multiple' | 'tags' | 'combobox' | 'default';\n cb?: any;\n select_style: any;\n default: string;\n name: string;\n postUrl: string;\n searchConditions: any;\n queryType: string;\n simpleSearchConditions: any;\n maxTagCount: number;\n allowClear: boolean;\n defaultValue: any;\n disabled: boolean;\n show_search: boolean;\n searchColor: string;\n required_condition: any;\n defaultValueType: string;\n globalDefaultKey: string;\n globalDefaultField: string;\n extendedFields: string[];\n table: any;\n};\ninterface Props {\n field: Field;\n valueKey?: string;\n labelKeyType?: number;\n labelKey?: string;\n labelSpace?: string;\n labelKeyList?: any[];\n value?: Array<any> | number | string | null;\n label?: Array<any> | string;\n formModel: Record<string, any>;\n outModel?: Record<string, any>;\n placeholder?: string;\n init_model?: Record<string, any>;\n is_input?: boolean;\n init_watch?: Record<string, any>;\n is_form_design?: boolean;\n innerModel?: any;\n globalInnerModel?: any;\n context?: Record<string, any> | null;\n baseKeyPath?: any;\n}\nconst props = withDefaults(defineProps<Props>(), {\n labelKeyType: 0,\n labelSpace: '-',\n labelKeyList: () => [],\n value: null,\n label: () => [],\n outModel: () => ({}),\n init_model: () => ({}),\n is_input: false,\n init_watch: () => ({}),\n is_form_design: false,\n innerModel: null,\n globalInnerModel: null,\n context: null,\n baseKeyPath: () => [],\n});\n\nconst emit = defineEmits<{\n 'update:value': [value: any];\n 'update:label': [value: any];\n}>();\nconst modalRef = reactive({\n selectedRows: new Array<number | any>(),\n datasource: new Array<any>(),\n});\nconst route = useRoute();\nconst tableKey = ref('remoteSelectPro');\nconst tableConfig = ref(null);\nconst searchText = ref('');\nconst requiredConditionStore = useRequiredConditionStore();\nconst getConditionsItem = (value: any, list: any, item: any) => {\n if (item.operator === 'not_blank_not_null') {\n list.push({\n field_name: item.field_name,\n operator: item.operator,\n value: [],\n format: item.format,\n class_name: item.class_name,\n });\n } else if (value instanceof Array) {\n const [first] = value;\n if (isNotEmpty(first)) {\n list.push({\n field_name: item.field_name,\n operator: item.operator,\n value: convertValueByClassName(value, item.class_name),\n format: item.format,\n class_name: item.class_name,\n });\n }\n } else if (isNotEmpty(value)) {\n let val = value;\n if (item.operator === 'in' || item.operator === 'notin') {\n if (value.includes('[')) {\n val = JSON.parse(value);\n } else if (value.includes(',')) {\n val = value.split(',');\n }\n if (item.class_name === 'int') {\n val = val.map(Number);\n }\n }\n list.push({\n field_name: item.field_name,\n operator: item.operator,\n value: convertValueByClassName(val instanceof Array ? val : [val], item.class_name),\n format: item.format,\n class_name: item.class_name,\n });\n }\n};\n\n/**\n * 解析相对于 baseKeyPath 的表达式,从 props.context 中获取值。\n * 核心算法已移至 utils.ts 的 resolveContextValue,这里仅做 props 绑定。\n */\nconst resolveContextValueWrapper = (selectName: string): any => {\n const value = resolveContextValue(selectName, props.context, [\n 'formModel',\n ...(props.baseKeyPath || []),\n ]);\n return value;\n};\n\n/**\n * searchType === 1 时按 key 同时处理 outModel 与 formModel:\n * 1. outModel 中存在该字段且有值(非 undefined / null)时,优先取 outModel 的值;\n * 2. 否则回退到 formModel 中的同名字段。\n * 注意:不能用 `outModel ? outModel : formModel` 做「对象级」二选一 ——\n * outModel 有默认值 `{}`(恒为真值),且它可能只包含部分字段,\n * 对象级判断会导致 formModel 兜底永远不生效。这里必须做「字段级」查找。\n */\nconst resolveModelValue = (selectName: any): { found: boolean; value: any } => {\n if (\n props.outModel &&\n Object.prototype.hasOwnProperty.call(props.outModel, selectName) &&\n props.outModel[selectName] !== undefined &&\n props.outModel[selectName] !== null\n ) {\n return { found: true, value: props.outModel[selectName] };\n }\n if (props.formModel && Object.prototype.hasOwnProperty.call(props.formModel, selectName)) {\n return { found: true, value: props.formModel[selectName] };\n }\n return { found: false, value: undefined };\n};\n\nconst getConditions = (has_search = true) => {\n const conditions = [];\n let search_conditions = [\n [\n {\n searchType: 3,\n field_name: 'is_active',\n operator: 'eq',\n value: [true],\n format: 'choices',\n class_name: 'bool',\n },\n ],\n ];\n if (props.field.searchConditions) {\n search_conditions = props.field.searchConditions;\n }\n search_conditions.forEach((item: any) => {\n const list = [];\n item.forEach((item1: any) => {\n if (item1.searchType === 1) {\n // outModel 优先、formModel 兜底,两者同时参与查找\n const resolved = resolveModelValue(item1.select_name);\n if (resolved.found) {\n getConditionsItem(resolved.value, list, item1);\n }\n } else if (item1.searchType === 2) {\n Object.keys(props.formModel).forEach((key: any) => {\n if (item1.select_name == key) {\n getConditionsItem(props.formModel[key], list, item1);\n }\n });\n } else if (item1.searchType === 3) {\n getConditionsItem(item1.value, list, item1);\n } else if (item1.searchType === 4) {\n getConditionsItem(resolveContextValueWrapper(item1.select_name), list, item1);\n } else {\n getConditionsItem(item1.value, list, item1);\n }\n });\n conditions.push(list);\n });\n if (searchText.value && has_search) {\n searchConfig.pageSize = 50;\n if (props?.labelKeyList && props?.labelKeyList?.length > 0) {\n props.labelKeyList.forEach((key: any, index: any) => {\n let subSearch = conditions[index];\n if (!subSearch) {\n subSearch = [];\n conditions[index] = subSearch;\n }\n subSearch.push({\n field_name: key,\n operator: 'icontains',\n format: 'input',\n value: [searchText.value],\n class_name: 'str',\n });\n });\n } else {\n if (conditions.length === 0) {\n conditions.push([\n {\n field_name: get_label_key(),\n operator: 'icontains',\n format: 'input',\n value: [searchText.value],\n class_name: 'str',\n },\n ]);\n } else {\n for (const item of conditions) {\n item.push({\n field_name: get_label_key(),\n operator: 'icontains',\n format: 'input',\n value: [searchText.value],\n class_name: 'str',\n });\n }\n }\n }\n }\n return conditions;\n};\nconst getSimpleSearchParams = (has_search = true) => {\n const params = {};\n if (props.field.simpleSearchConditions) {\n props.field.simpleSearchConditions.forEach((item: any) => {\n if (item.searchType === 1) {\n // outModel 优先、formModel 兜底,两者同时参与查找\n const resolved = resolveModelValue(item.select_name);\n if (resolved.found) {\n params[item.field_name] = resolved.value;\n }\n } else if (item.searchType === 2) {\n Object.keys(props.formModel).forEach((key: any) => {\n if (item.select_name == key) {\n const value = props.formModel[key];\n params[item.field_name] = value;\n }\n });\n } else if (item.searchType === 3) {\n params[item.field_name] = item.value;\n } else if (item.searchType === 4) {\n params[item.field_name] = resolveContextValueWrapper(item.select_name);\n }\n });\n }\n if (searchText.value && has_search) {\n if (props?.labelKeyList && props?.labelKeyList?.length > 0) {\n props.labelKeyList.forEach((key: any) => {\n params[key] = searchText.value;\n });\n } else {\n params[get_label_key()] = searchText.value;\n }\n }\n return params;\n};\n\nconst searchConfig: any = {\n current: 1,\n pageSize: 200,\n is_pagination: true,\n request_source: 'strict',\n is_active: true,\n ...props.init_model, // 普通查询条件\n column_fields: [],\n sort_fields: [],\n conditions: [],\n simpleSearchParams: {},\n};\n\nconst get_value_key = () => {\n return props.valueKey || 'id';\n};\n\nconst get_label_key = () => {\n return props.labelKey || 'name';\n};\n\nconst get_sort_fields = () => {\n const list = [];\n if (props?.labelKeyList && props?.labelKeyList?.length > 0 && props.labelKeyType !== 1) {\n list.push(...props.labelKeyList);\n } else {\n list.push(get_label_key());\n }\n return list;\n};\n\nconst getColumnFields = () => {\n const list = [];\n if (props?.labelKeyList && props?.labelKeyList?.length > 0 && props.labelKeyType !== 1) {\n list.push(get_value_key(), ...props.labelKeyList);\n } else {\n list.push(get_value_key(), get_label_key());\n }\n if (props.field?.extendedFields && props.field?.extendedFields.length > 0) {\n list.push(...props.field.extendedFields);\n }\n // 去重\n const uniqueList = [...new Set(list)];\n searchConfig.column_fields = [].concat(uniqueList);\n};\n\ngetColumnFields();\nsearchConfig.sort_fields = get_sort_fields();\nif (props.init_model?.sort_fields) {\n searchConfig.sort_fields = props.init_model?.sort_fields;\n}\n\nconst checkEqualSelected = (value: any) => {\n if (Array.isArray(modalRef.selectedRows)) {\n if (modalRef.selectedRows.includes(value)) {\n return true;\n }\n } else {\n if (modalRef.selectedRows === value) {\n return true;\n }\n }\n return false;\n};\n\n/**\n * 对已选值数组去重。\n * 多选模式下,搜索区多次「展开/隐藏」会导致组件反复挂载初始化,\n * 若沿用 push 方式累积,值会重复(如 [1,2] -> [1,2,1,2]),\n * 这里统一在「初始化赋值 / 外部模型同步 / 值上抛」三处出口做去重。\n * 以 String(item) 作为去重键,兼容 id 字段下 1 与 '1' 混用的情况。\n */\nconst dedupeSelected = (list: any[] | null | undefined): any[] => {\n if (!Array.isArray(list)) {\n return [];\n }\n const seen = new Set<string>();\n const result: any[] = [];\n list.forEach(item => {\n const key = String(item);\n if (!seen.has(key)) {\n seen.add(key);\n result.push(item);\n }\n });\n return result;\n};\n\nconst datasource = computed(() => {\n return modalRef.datasource.map(item => {\n // 已经选择的数据不处理labelKeyList\n if (props.labelKeyList && props.labelKeyList.length > 0 && props?.labelKeyType !== 1) {\n const label = [];\n for (const key of props.labelKeyList) {\n label.push(item[key as string]);\n }\n return {\n value: item[get_value_key()],\n label: label.join(props.labelSpace),\n };\n } else {\n return {\n value: item[get_value_key()],\n label: item[get_label_key()],\n };\n }\n });\n});\nconst getDefaultValue = (dataList: any) => {\n if (dataList && !Array.isArray(dataList)) {\n dataList = [dataList];\n }\n if (\n props.field.default &&\n !props.formModel[props.field.name] &&\n props.field.mode == 'default' &&\n dataList.length > 0\n ) {\n props.formModel[props.field.name] = dataList[0];\n const foundItem = modalRef.datasource.find(item => {\n if (item[get_value_key()] == dataList[0]) {\n return true;\n }\n });\n if (foundItem) {\n emit('update:label', foundItem[get_label_key()]);\n }\n }\n if (props.field.mode == 'default') {\n const selectItems: any = datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label);\n emit('update:label', selectItems.length > 0 ? selectItems[0] : '');\n } else {\n emit(\n 'update:label',\n datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label),\n );\n }\n};\nconst setInnerModel = () => {\n if (props.field.mode === 'default') {\n const rawItems = modalRef.datasource.filter((item: any) =>\n checkEqualSelected(item[get_value_key()]),\n );\n if (props.innerModel) {\n props.innerModel[props.field.name] = rawItems[0];\n }\n } else {\n const rawItems = modalRef.datasource.filter((item: any) =>\n checkEqualSelected(item[get_value_key()]),\n );\n if (props.innerModel) {\n props.innerModel[props.field.name] = rawItems;\n }\n }\n};\n\nlet oldParams = {};\nwatch(\n // outModel 参与 searchType===1 的取值(见 resolveModelValue),必须一并监听:\n // 否则外部模型变化时查询条件不会重建。下方 isEqual(oldParams, newParams) 会比对新旧参数,\n // 参数没变就不会真的刷新,不会多打请求。\n () => [props.formModel, props.context, props.outModel],\n () => {\n const newParams = getQueryParams(false);\n if (!isEqual(oldParams, newParams)) {\n oldParams = newParams;\n delayRefresh(true);\n }\n },\n { deep: true },\n);\n\nwatch(\n () => props.formModel[props.field.name],\n () => {\n if (props.field.mode === 'default') {\n if (props.formModel[props.field.name] || props.formModel[props.field.name] === 0) {\n modalRef.selectedRows = [props.formModel[props.field.name]];\n } else {\n modalRef.selectedRows = [];\n }\n const selectItems: any = datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label);\n emit('update:label', selectItems.length > 0 ? selectItems[0] : '');\n } else {\n // 注意:赋值时必须用「去重后的拷贝」,不能直接引用 formModel 里的原数组,\n // 否则组件内部数组会与外部 searchConditions 的值数组共享同一引用,\n // 一旦后续再对 selectedRows 做任何原地修改(如 push),会反向污染外部模型造成值重复\n if (props.formModel[props.field.name] && props.formModel[props.field.name].length > 0) {\n modalRef.selectedRows = dedupeSelected([...props.formModel[props.field.name]]);\n } else {\n modalRef.selectedRows = [];\n }\n emit(\n 'update:label',\n datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label),\n );\n }\n },\n);\n\nwatch(\n () => props.value,\n () => {\n setInnerModel();\n },\n { deep: true },\n);\n\nconst handleRequiredConditionChange = (key: string) => {\n if (props.field.required_condition) {\n const item = props.field.required_condition.find((item: any) => item.key === key);\n if (item) {\n delayRefresh(true);\n }\n }\n};\n\nonMounted(() => {\n let tmpKey = `${route.path}_${props.field.name}_${props.field.postUrl}`;\n tableKey.value = 'remoteselectpro:' + md5(tmpKey);\n initDataSource();\n required_condition_event_obj().on('required_condition_change', handleRequiredConditionChange);\n refresh();\n});\n\nonUnmounted(() => {\n required_condition_event_obj().off('required_condition_change', handleRequiredConditionChange);\n});\nconst initDataSource = () => {\n // 统一的值转换:valueKey 为 id 时,尽量转成 Number,与历史逻辑保持一致\n const convertValue = (item: any) => {\n if (get_value_key() === 'id') {\n if (isNaN(Number(item))) {\n return item;\n } else {\n return Number(item);\n }\n } else {\n return item;\n }\n };\n let list: any[] = [];\n if (props.field.mode === 'default') {\n if (props.value || props.value === 0) {\n list.push(convertValue(props.value));\n }\n } else {\n if (typeof props.value === 'string') {\n list = (props.value as string).split(',').map(convertValue);\n } else if (props.value instanceof Array) {\n list = props.value.map(convertValue);\n } else if (props.value != null) {\n list.push(convertValue(props.value));\n }\n }\n // 必须用「去重后赋值」替代原 push 逻辑:\n // 该组件在搜索区反复显示/隐藏时会多次挂载,每次挂载都会执行到这里,\n // 若 push 到已存在值的数组上(或与外部模型共享引用的数组上),多选值会重复累积\n modalRef.selectedRows = dedupeSelected(list);\n};\nconst handleChange = () => {\n if (props.field.mode == 'default') {\n emit('update:value', modalRef.selectedRows);\n const selectItems: any = datasource.value\n .filter((item: any) => {\n return modalRef.selectedRows == item.value;\n })\n .map((item: any) => item.label);\n emit('update:label', selectItems.length > 0 ? selectItems[0] : '');\n } else {\n // 出口兜底去重:antd 多选对已有重复值时仍会按 [...mergedValues, val] 追加,\n // 这里先对值去重再上抛,保证外部 searchConditions/formModel 中不会出现重复\n modalRef.selectedRows = dedupeSelected(modalRef.selectedRows);\n emit('update:value', modalRef.selectedRows);\n emit(\n 'update:label',\n datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label),\n );\n }\n};\nconst getRequiredConditionObj = () => {\n const required_condition = props.field.required_condition;\n const required_condition_obj = {};\n if (required_condition) {\n required_condition.forEach((item: any) => {\n const value = requiredConditionStore.value_map[item.key];\n if (value !== undefined && value !== null) {\n required_condition_obj[item.field_name] = value;\n }\n });\n }\n return required_condition_obj;\n};\n\n/**\n * 补充之前选择的项对应的数据\n */\nconst externDataSource = async (params: any, selectedRows: any) => {\n if (selectedRows && !Array.isArray(selectedRows)) {\n selectedRows = [selectedRows];\n }\n if (selectedRows && selectedRows.length > 0) {\n const notFoundValues = [];\n selectedRows.forEach((item1: any) => {\n if (!modalRef.datasource.some(item => item[get_value_key()] === item1)) {\n notFoundValues.push(item1);\n }\n });\n if (notFoundValues.length > 0) {\n const obj = { ...params };\n if (props.field.queryType === 'simple') {\n let value = notFoundValues as any;\n if (value instanceof Array && value.length > 0) {\n value = value.join(',');\n }\n obj[get_value_key()] = value;\n } else {\n if (obj.conditions && obj.conditions.length > 0) {\n obj.conditions[0].push({\n class_name: 'int',\n operator: 'in',\n value: notFoundValues,\n format: 'remote',\n field_name: get_value_key(),\n });\n } else {\n obj.conditions = [[]];\n obj.conditions[0].push({\n class_name: 'int',\n operator: 'in',\n value: notFoundValues,\n format: 'remote',\n field_name: get_value_key(),\n });\n }\n }\n const res1 = await getApiData({ ...obj }, props.field.postUrl, false, {\n skip_error: true,\n });\n modalRef.datasource = modalRef.datasource.concat(res1?.data || []);\n }\n }\n};\nconst getQueryParams = (has_search = true) => {\n let params: any = {};\n if (props.field.queryType === 'simple') {\n searchConfig.simpleSearchParams = getSimpleSearchParams(has_search);\n params = {\n ...searchConfig,\n ...searchConfig.simpleSearchParams,\n required_condition: getRequiredConditionObj(),\n };\n delete params.conditions;\n delete params.simpleSearchParams;\n } else {\n searchConfig.conditions = getConditions(has_search);\n params = { ...searchConfig, required_condition: getRequiredConditionObj() };\n delete params.simpleSearchParams;\n }\n return params;\n};\n\nconst refresh = async (clear = false) => {\n // modalRef.datasource.length = 0;\n // 不清空modalRef.datasource,保留原始数据,如果是输入过滤条件筛选的数据,需要去重后,追加到datasource里\n if (props.field.postUrl) {\n if (clear) {\n modalRef.datasource.length = 0;\n }\n const is_first = modalRef.datasource.length === 0;\n const params = getQueryParams();\n const res = await getApiData(params, props.field.postUrl, false, { skip_error: true });\n if (res?.data?.length > 0) {\n const rowKey = get_value_key();\n const new_list = res?.data.filter(i => {\n const f = modalRef.datasource.find(j => {\n return i[rowKey] == j[rowKey];\n });\n return !f;\n });\n modalRef.datasource = modalRef.datasource.concat(new_list);\n if (is_first) {\n await externDataSource(params, modalRef.selectedRows);\n }\n setInnerModel();\n }\n\n if (props.field.defaultValueType === 'first' && !props.is_form_design) {\n if (!props.formModel[props.field.name]) {\n if (props.field.mode === 'default' || !props.field.mode) {\n emit('update:label', modalRef.datasource[0][get_label_key()]);\n emit('update:value', modalRef.datasource[0][get_value_key()]);\n } else {\n emit('update:label', [modalRef.datasource[0][get_label_key()]]);\n emit('update:value', [modalRef.datasource[0][get_value_key()]]);\n }\n }\n } else if (props.field.defaultValueType === 'global' && !props.is_form_design) {\n if (!props.formModel[props.field.name]) {\n const globalDefaultKey = props.field.globalDefaultKey;\n const globalDefaultField = props.field.globalDefaultField;\n const globalDefaultValue = requiredConditionStore.value_map[globalDefaultKey];\n if (globalDefaultValue) {\n const globalDefaultItem = modalRef.datasource.find(\n item1 => item1[globalDefaultField] === globalDefaultValue,\n );\n if (globalDefaultItem) {\n if (props.field.mode === 'default' || !props.field.mode) {\n emit('update:label', globalDefaultItem[get_label_key()]);\n emit('update:value', globalDefaultItem[get_value_key()]);\n } else {\n emit('update:label', [globalDefaultItem[get_label_key()]]);\n emit('update:value', [globalDefaultItem[get_value_key()]]);\n }\n }\n }\n }\n } else {\n getDefaultValue(modalRef.selectedRows);\n }\n }\n};\nconst delayRefresh: any = debounce((clear = false) => {\n refresh(clear);\n}, 500);\n\nwatch(\n () => [\n props.labelKeyList,\n props.labelKey,\n props.labelKeyType,\n props.valueKey,\n props.labelSpace,\n props.field.postUrl,\n ],\n (newValue, oldValue) => {\n if (!isEqual(newValue, oldValue)) {\n getColumnFields();\n searchConfig.sort_fields = get_sort_fields();\n delayRefresh(true);\n }\n },\n { deep: true },\n);\n\nwatch(\n () => [props.field.searchConditions, props.field.queryType, props.field.simpleSearchConditions],\n (newValue, oldValue) => {\n if (!isEqual(newValue, oldValue)) {\n delayRefresh(true);\n }\n },\n { deep: true },\n);\n\nconst handleSearch = (str: any) => {\n searchText.value = str;\n delayRefresh();\n};\n\nconst tableModal = defineAsyncComponent(() => import('./tableModal.vue'));\n\nconst handleOpenTable = () => {\n let currentValue = [];\n searchText.value = '';\n let rowSelectionType = 'checkbox';\n if (props.field.mode === 'default') {\n rowSelectionType = 'radio';\n }\n if (!datasource.value) {\n currentValue = [];\n } else {\n currentValue = datasource.value.filter((item: any) => checkEqualSelected(item.value));\n }\n tableConfig.value = {\n key: tableKey.value,\n title: props.field.label || props.field.name,\n rowSelectionType,\n columns: props.field.table?.columns || [],\n search_config: props.field.table?.search_config || [],\n list_url: props.field.postUrl,\n is_selection: true,\n is_pagination: true,\n hide_header: true,\n };\n const init_model = props.init_model || {};\n if (props.field.queryType === 'simple') {\n tableConfig.value['query_params'] = { ...init_model, ...getSimpleSearchParams() };\n } else {\n const conditions = getConditions();\n tableConfig.value['query_params'] = init_model;\n if (conditions.length > 0 && conditions[0].length > 0) {\n tableConfig.value['base_conditions'] = conditions[0];\n }\n }\n const required_condition = getRequiredConditionObj();\n if (required_condition) {\n tableConfig.value['query_params'] = {\n ...tableConfig.value['query_params'],\n required_condition,\n };\n }\n const tempModal = reactive({\n open: true,\n loading: false,\n component: tableModal,\n isMultiple: props.field.mode !== 'default',\n tableConfig: tableConfig.value,\n labelKey: props.labelKey || 'name',\n value: currentValue,\n labelKeyList: props.labelKeyList || [],\n labelKeyType: props.labelKeyType || 1,\n labelSpace: props.labelSpace || '-',\n valueKey: props.valueKey || 'id',\n ok: async (data: any) => {\n const selectedValues = data.map((item: any) => item.value) || [];\n const selectedLabels = data.map((item: any) => item.label) || [];\n const params = getQueryParams();\n if (props.field.mode == 'default') {\n if (selectedValues.length == 0) {\n modalRef.selectedRows = undefined;\n emit('update:value', modalRef.selectedRows);\n emit('update:label', undefined);\n } else {\n modalRef.selectedRows = selectedValues[0];\n await externDataSource(params, selectedValues[0]);\n emit('update:value', modalRef.selectedRows);\n emit('update:label', selectedLabels[0]);\n }\n } else {\n modalRef.selectedRows = selectedValues;\n await externDataSource(params, selectedValues);\n emit('update:value', modalRef.selectedRows);\n emit('update:label', selectedLabels);\n }\n },\n cancel: () => {\n console.log('cancel');\n },\n });\n modalBox(tempModal);\n};\n\nconst filterOption = (val: string, option: any) => {\n if (datasource.value instanceof Array) {\n const f: any = datasource.value.find(item => {\n return item['value'] == option.key;\n });\n if (f) {\n return String(f['label']).toLowerCase().indexOf(val.toLowerCase()) >= 0;\n } else {\n return false;\n }\n }\n};\n</script>\n<style scoped lang=\"less\">\n.remote-select-pro {\n display: flex;\n align-items: flex-start;\n gap: 4px;\n flex-wrap: nowrap;\n // 禁用状态下文字保持黑色,不显示为灰色\n :deep(.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector) {\n color: #000;\n }\n :deep(.ant-select-disabled .ant-select-selection-item) {\n color: #000;\n }\n}\n.ant-input-group.ant-input-group-compact {\n .remote-select-pro {\n display: flex;\n }\n}\n.ant-form-inline {\n .ant-input-group.ant-input-group-compact {\n .remote-select-pro {\n display: inline-flex;\n }\n }\n}\n.table-search-icon {\n color: black;\n font-size: 17px;\n}\n</style>\n","<template>\n <div class=\"remote-select-pro\">\n <a-select\n v-model:value=\"modalRef.selectedRows\"\n :allow-clear=\"field.allowClear !== false\"\n :default-value=\"field.defaultValue\"\n :disabled=\"field.disabled\"\n :filter-option=\"filterOption\"\n :maxTagCount=\"field.maxTagCount ? field.maxTagCount : 'responsive'\"\n :mode=\"field.mode == 'default' ? null : field.mode\"\n :placeholder=\"placeholder\"\n :show-search=\"field.show_search !== false\"\n size=\"small\"\n :autoClearSearchValue=\"false\"\n @change=\"handleChange\"\n @search=\"handleSearch\"\n style=\"min-width: 120px\"\n >\n <a-select-option\n v-for=\"option in datasource\"\n :key=\"option.value\"\n :value=\"option.value\"\n >\n <bold-matcher\n :text=\"option.label\"\n :pattern=\"searchText\"\n :color=\"field.searchColor\"\n />\n </a-select-option>\n </a-select>\n\n <div\n v-if=\"field.table?.enable\"\n class=\"table-search-icon\"\n style=\"margin-right: 5px\"\n >\n <FileSearchOutlined @click=\"handleOpenTable\" />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, defineAsyncComponent, onMounted, onUnmounted, reactive, ref, watch } from 'vue';\nimport { debounce, isEqual } from 'lodash-es';\nimport { convertValueByClassName, isNotEmpty } from 'liyu-pc-base/utils/function';\nimport BoldMatcher from 'liyu-pc-base/components/FormRender/RemoteSelect/boldenText.vue';\nimport { getApiData } from 'liyu-pc-base/api/api-model';\nimport { useRequiredConditionStore, required_condition_event_obj } from 'liyu-pc-base/init-plugin';\nimport modalBox from 'liyu-pc-base/components/form-modal/modal-tools';\nimport md5 from 'blueimp-md5';\nimport { useRoute } from 'vue-router';\nimport { resolveContextValue } from 'liyu-pc-base/components/FormRender/utils';\n\ndefineOptions({\n name: 'RemoteSelectPro',\n});\n\ntype Field = {\n label: string;\n mode: 'multiple' | 'tags' | 'combobox' | 'default';\n cb?: any;\n select_style: any;\n default: string;\n name: string;\n postUrl: string;\n searchConditions: any;\n queryType: string;\n simpleSearchConditions: any;\n maxTagCount: number;\n allowClear: boolean;\n defaultValue: any;\n disabled: boolean;\n show_search: boolean;\n searchColor: string;\n required_condition: any;\n defaultValueType: string;\n globalDefaultKey: string;\n globalDefaultField: string;\n extendedFields: string[];\n table: any;\n};\ninterface Props {\n field: Field;\n valueKey?: string;\n labelKeyType?: number;\n labelKey?: string;\n labelSpace?: string;\n labelKeyList?: any[];\n value?: Array<any> | number | string | null;\n label?: Array<any> | string;\n formModel: Record<string, any>;\n outModel?: Record<string, any>;\n placeholder?: string;\n init_model?: Record<string, any>;\n is_input?: boolean;\n init_watch?: Record<string, any>;\n is_form_design?: boolean;\n innerModel?: any;\n globalInnerModel?: any;\n context?: Record<string, any> | null;\n baseKeyPath?: any;\n}\nconst props = withDefaults(defineProps<Props>(), {\n labelKeyType: 0,\n labelSpace: '-',\n labelKeyList: () => [],\n value: null,\n label: () => [],\n outModel: () => ({}),\n init_model: () => ({}),\n is_input: false,\n init_watch: () => ({}),\n is_form_design: false,\n innerModel: null,\n globalInnerModel: null,\n context: null,\n baseKeyPath: () => [],\n});\n\nconst emit = defineEmits<{\n 'update:value': [value: any];\n 'update:label': [value: any];\n}>();\nconst modalRef = reactive({\n selectedRows: new Array<number | any>(),\n datasource: new Array<any>(),\n});\nconst route = useRoute();\nconst tableKey = ref('remoteSelectPro');\nconst tableConfig = ref(null);\nconst searchText = ref('');\nconst requiredConditionStore = useRequiredConditionStore();\nconst getConditionsItem = (value: any, list: any, item: any) => {\n if (item.operator === 'not_blank_not_null') {\n list.push({\n field_name: item.field_name,\n operator: item.operator,\n value: [],\n format: item.format,\n class_name: item.class_name,\n });\n } else if (value instanceof Array) {\n const [first] = value;\n if (isNotEmpty(first)) {\n list.push({\n field_name: item.field_name,\n operator: item.operator,\n value: convertValueByClassName(value, item.class_name),\n format: item.format,\n class_name: item.class_name,\n });\n }\n } else if (isNotEmpty(value)) {\n let val = value;\n if (item.operator === 'in' || item.operator === 'notin') {\n if (value.includes('[')) {\n val = JSON.parse(value);\n } else if (value.includes(',')) {\n val = value.split(',');\n }\n if (item.class_name === 'int') {\n val = val.map(Number);\n }\n }\n list.push({\n field_name: item.field_name,\n operator: item.operator,\n value: convertValueByClassName(val instanceof Array ? val : [val], item.class_name),\n format: item.format,\n class_name: item.class_name,\n });\n }\n};\n\n/**\n * 解析相对于 baseKeyPath 的表达式,从 props.context 中获取值。\n * 核心算法已移至 utils.ts 的 resolveContextValue,这里仅做 props 绑定。\n */\nconst resolveContextValueWrapper = (selectName: string): any => {\n const value = resolveContextValue(selectName, props.context, [\n 'formModel',\n ...(props.baseKeyPath || []),\n ]);\n return value;\n};\n\n/**\n * searchType === 1 时按 key 同时处理 outModel 与 formModel:\n * 1. outModel 中存在该字段且有值(非 undefined / null)时,优先取 outModel 的值;\n * 2. 否则回退到 formModel 中的同名字段。\n * 注意:不能用 `outModel ? outModel : formModel` 做「对象级」二选一 ——\n * outModel 有默认值 `{}`(恒为真值),且它可能只包含部分字段,\n * 对象级判断会导致 formModel 兜底永远不生效。这里必须做「字段级」查找。\n */\nconst resolveModelValue = (selectName: any): { found: boolean; value: any } => {\n if (\n props.outModel &&\n Object.prototype.hasOwnProperty.call(props.outModel, selectName) &&\n props.outModel[selectName] !== undefined &&\n props.outModel[selectName] !== null\n ) {\n return { found: true, value: props.outModel[selectName] };\n }\n if (props.formModel && Object.prototype.hasOwnProperty.call(props.formModel, selectName)) {\n return { found: true, value: props.formModel[selectName] };\n }\n return { found: false, value: undefined };\n};\n\nconst getConditions = (has_search = true) => {\n const conditions = [];\n let search_conditions = [\n [\n {\n searchType: 3,\n field_name: 'is_active',\n operator: 'eq',\n value: [true],\n format: 'choices',\n class_name: 'bool',\n },\n ],\n ];\n if (props.field.searchConditions) {\n search_conditions = props.field.searchConditions;\n }\n search_conditions.forEach((item: any) => {\n const list = [];\n item.forEach((item1: any) => {\n if (item1.searchType === 1) {\n // outModel 优先、formModel 兜底,两者同时参与查找\n const resolved = resolveModelValue(item1.select_name);\n if (resolved.found) {\n getConditionsItem(resolved.value, list, item1);\n }\n } else if (item1.searchType === 2) {\n Object.keys(props.formModel).forEach((key: any) => {\n if (item1.select_name == key) {\n getConditionsItem(props.formModel[key], list, item1);\n }\n });\n } else if (item1.searchType === 3) {\n getConditionsItem(item1.value, list, item1);\n } else if (item1.searchType === 4) {\n getConditionsItem(resolveContextValueWrapper(item1.select_name), list, item1);\n } else {\n getConditionsItem(item1.value, list, item1);\n }\n });\n conditions.push(list);\n });\n if (searchText.value && has_search) {\n searchConfig.pageSize = 50;\n if (props?.labelKeyList && props?.labelKeyList?.length > 0) {\n props.labelKeyList.forEach((key: any, index: any) => {\n let subSearch = conditions[index];\n if (!subSearch) {\n subSearch = [];\n conditions[index] = subSearch;\n }\n subSearch.push({\n field_name: key,\n operator: 'icontains',\n format: 'input',\n value: [searchText.value],\n class_name: 'str',\n });\n });\n } else {\n if (conditions.length === 0) {\n conditions.push([\n {\n field_name: get_label_key(),\n operator: 'icontains',\n format: 'input',\n value: [searchText.value],\n class_name: 'str',\n },\n ]);\n } else {\n for (const item of conditions) {\n item.push({\n field_name: get_label_key(),\n operator: 'icontains',\n format: 'input',\n value: [searchText.value],\n class_name: 'str',\n });\n }\n }\n }\n }\n return conditions;\n};\nconst getSimpleSearchParams = (has_search = true) => {\n const params = {};\n if (props.field.simpleSearchConditions) {\n props.field.simpleSearchConditions.forEach((item: any) => {\n if (item.searchType === 1) {\n // outModel 优先、formModel 兜底,两者同时参与查找\n const resolved = resolveModelValue(item.select_name);\n if (resolved.found) {\n params[item.field_name] = resolved.value;\n }\n } else if (item.searchType === 2) {\n Object.keys(props.formModel).forEach((key: any) => {\n if (item.select_name == key) {\n const value = props.formModel[key];\n params[item.field_name] = value;\n }\n });\n } else if (item.searchType === 3) {\n params[item.field_name] = item.value;\n } else if (item.searchType === 4) {\n params[item.field_name] = resolveContextValueWrapper(item.select_name);\n }\n });\n }\n if (searchText.value && has_search) {\n if (props?.labelKeyList && props?.labelKeyList?.length > 0) {\n props.labelKeyList.forEach((key: any) => {\n params[key] = searchText.value;\n });\n } else {\n params[get_label_key()] = searchText.value;\n }\n }\n return params;\n};\n\nconst searchConfig: any = {\n current: 1,\n pageSize: 200,\n is_pagination: true,\n request_source: 'strict',\n is_active: true,\n ...props.init_model, // 普通查询条件\n column_fields: [],\n sort_fields: [],\n conditions: [],\n simpleSearchParams: {},\n};\n\nconst get_value_key = () => {\n return props.valueKey || 'id';\n};\n\nconst get_label_key = () => {\n return props.labelKey || 'name';\n};\n\nconst get_sort_fields = () => {\n const list = [];\n if (props?.labelKeyList && props?.labelKeyList?.length > 0 && props.labelKeyType !== 1) {\n list.push(...props.labelKeyList);\n } else {\n list.push(get_label_key());\n }\n return list;\n};\n\nconst getColumnFields = () => {\n const list = [];\n if (props?.labelKeyList && props?.labelKeyList?.length > 0 && props.labelKeyType !== 1) {\n list.push(get_value_key(), ...props.labelKeyList);\n } else {\n list.push(get_value_key(), get_label_key());\n }\n if (props.field?.extendedFields && props.field?.extendedFields.length > 0) {\n list.push(...props.field.extendedFields);\n }\n // 去重\n const uniqueList = [...new Set(list)];\n searchConfig.column_fields = [].concat(uniqueList);\n};\n\ngetColumnFields();\nsearchConfig.sort_fields = get_sort_fields();\nif (props.init_model?.sort_fields) {\n searchConfig.sort_fields = props.init_model?.sort_fields;\n}\n\nconst checkEqualSelected = (value: any) => {\n if (Array.isArray(modalRef.selectedRows)) {\n if (modalRef.selectedRows.includes(value)) {\n return true;\n }\n } else {\n if (modalRef.selectedRows === value) {\n return true;\n }\n }\n return false;\n};\n\n/**\n * 对已选值数组去重。\n * 多选模式下,搜索区多次「展开/隐藏」会导致组件反复挂载初始化,\n * 若沿用 push 方式累积,值会重复(如 [1,2] -> [1,2,1,2]),\n * 这里统一在「初始化赋值 / 外部模型同步 / 值上抛」三处出口做去重。\n * 以 String(item) 作为去重键,兼容 id 字段下 1 与 '1' 混用的情况。\n */\nconst dedupeSelected = (list: any[] | null | undefined): any[] => {\n if (!Array.isArray(list)) {\n return [];\n }\n const seen = new Set<string>();\n const result: any[] = [];\n list.forEach(item => {\n const key = String(item);\n if (!seen.has(key)) {\n seen.add(key);\n result.push(item);\n }\n });\n return result;\n};\n\nconst datasource = computed(() => {\n return modalRef.datasource.map(item => {\n // 已经选择的数据不处理labelKeyList\n if (props.labelKeyList && props.labelKeyList.length > 0 && props?.labelKeyType !== 1) {\n const label = [];\n for (const key of props.labelKeyList) {\n label.push(item[key as string]);\n }\n return {\n value: item[get_value_key()],\n label: label.join(props.labelSpace),\n };\n } else {\n return {\n value: item[get_value_key()],\n label: item[get_label_key()],\n };\n }\n });\n});\nconst getDefaultValue = (dataList: any) => {\n if (dataList && !Array.isArray(dataList)) {\n dataList = [dataList];\n }\n if (\n props.field.default &&\n !props.formModel[props.field.name] &&\n props.field.mode == 'default' &&\n dataList.length > 0\n ) {\n props.formModel[props.field.name] = dataList[0];\n const foundItem = modalRef.datasource.find(item => {\n if (item[get_value_key()] == dataList[0]) {\n return true;\n }\n });\n if (foundItem) {\n emit('update:label', foundItem[get_label_key()]);\n }\n }\n if (props.field.mode == 'default') {\n const selectItems: any = datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label);\n emit('update:label', selectItems.length > 0 ? selectItems[0] : '');\n } else {\n emit(\n 'update:label',\n datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label),\n );\n }\n};\nconst setInnerModel = () => {\n if (props.field.mode === 'default') {\n const rawItems = modalRef.datasource.filter((item: any) =>\n checkEqualSelected(item[get_value_key()]),\n );\n if (props.innerModel) {\n props.innerModel[props.field.name] = rawItems[0];\n }\n } else {\n const rawItems = modalRef.datasource.filter((item: any) =>\n checkEqualSelected(item[get_value_key()]),\n );\n if (props.innerModel) {\n props.innerModel[props.field.name] = rawItems;\n }\n }\n};\n\nlet oldParams = {};\nwatch(\n // outModel 参与 searchType===1 的取值(见 resolveModelValue),必须一并监听:\n // 否则外部模型变化时查询条件不会重建。下方 isEqual(oldParams, newParams) 会比对新旧参数,\n // 参数没变就不会真的刷新,不会多打请求。\n () => [props.formModel, props.context, props.outModel],\n () => {\n const newParams = getQueryParams(false);\n if (!isEqual(oldParams, newParams)) {\n oldParams = newParams;\n delayRefresh(true);\n }\n },\n { deep: true },\n);\n\nwatch(\n () => props.formModel[props.field.name],\n () => {\n if (props.field.mode === 'default') {\n if (props.formModel[props.field.name] || props.formModel[props.field.name] === 0) {\n modalRef.selectedRows = [props.formModel[props.field.name]];\n } else {\n modalRef.selectedRows = [];\n }\n const selectItems: any = datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label);\n emit('update:label', selectItems.length > 0 ? selectItems[0] : '');\n } else {\n // 注意:赋值时必须用「去重后的拷贝」,不能直接引用 formModel 里的原数组,\n // 否则组件内部数组会与外部 searchConditions 的值数组共享同一引用,\n // 一旦后续再对 selectedRows 做任何原地修改(如 push),会反向污染外部模型造成值重复\n if (props.formModel[props.field.name] && props.formModel[props.field.name].length > 0) {\n modalRef.selectedRows = dedupeSelected([...props.formModel[props.field.name]]);\n } else {\n modalRef.selectedRows = [];\n }\n emit(\n 'update:label',\n datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label),\n );\n }\n },\n);\n\nwatch(\n () => props.value,\n () => {\n setInnerModel();\n },\n { deep: true },\n);\n\nconst handleRequiredConditionChange = (key: string) => {\n if (props.field.required_condition) {\n const item = props.field.required_condition.find((item: any) => item.key === key);\n if (item) {\n delayRefresh(true);\n }\n }\n};\n\nonMounted(() => {\n let tmpKey = `${route.path}_${props.field.name}_${props.field.postUrl}`;\n tableKey.value = 'remoteselectpro:' + md5(tmpKey);\n initDataSource();\n required_condition_event_obj().on('required_condition_change', handleRequiredConditionChange);\n refresh();\n});\n\nonUnmounted(() => {\n required_condition_event_obj().off('required_condition_change', handleRequiredConditionChange);\n});\nconst initDataSource = () => {\n // 统一的值转换:valueKey 为 id 时,尽量转成 Number,与历史逻辑保持一致\n const convertValue = (item: any) => {\n if (get_value_key() === 'id') {\n if (isNaN(Number(item))) {\n return item;\n } else {\n return Number(item);\n }\n } else {\n return item;\n }\n };\n let list: any[] = [];\n if (props.field.mode === 'default') {\n if (props.value || props.value === 0) {\n list.push(convertValue(props.value));\n }\n } else {\n if (typeof props.value === 'string') {\n list = (props.value as string).split(',').map(convertValue);\n } else if (props.value instanceof Array) {\n list = props.value.map(convertValue);\n } else if (props.value != null) {\n list.push(convertValue(props.value));\n }\n }\n // 必须用「去重后赋值」替代原 push 逻辑:\n // 该组件在搜索区反复显示/隐藏时会多次挂载,每次挂载都会执行到这里,\n // 若 push 到已存在值的数组上(或与外部模型共享引用的数组上),多选值会重复累积\n modalRef.selectedRows = dedupeSelected(list);\n};\nconst handleChange = () => {\n if (props.field.mode == 'default') {\n emit('update:value', modalRef.selectedRows);\n const selectItems: any = datasource.value\n .filter((item: any) => {\n return modalRef.selectedRows == item.value;\n })\n .map((item: any) => item.label);\n emit('update:label', selectItems.length > 0 ? selectItems[0] : '');\n } else {\n // 出口兜底去重:antd 多选对已有重复值时仍会按 [...mergedValues, val] 追加,\n // 这里先对值去重再上抛,保证外部 searchConditions/formModel 中不会出现重复\n modalRef.selectedRows = dedupeSelected(modalRef.selectedRows);\n emit('update:value', modalRef.selectedRows);\n emit(\n 'update:label',\n datasource.value\n .filter((item: any) => checkEqualSelected(item.value))\n .map((item: any) => item.label),\n );\n }\n};\nconst getRequiredConditionObj = () => {\n const required_condition = props.field.required_condition;\n const required_condition_obj = {};\n if (required_condition) {\n required_condition.forEach((item: any) => {\n const value = requiredConditionStore.value_map[item.key];\n if (value !== undefined && value !== null) {\n required_condition_obj[item.field_name] = value;\n }\n });\n }\n return required_condition_obj;\n};\n\n/**\n * 补充之前选择的项对应的数据\n */\nconst externDataSource = async (params: any, selectedRows: any) => {\n if (selectedRows && !Array.isArray(selectedRows)) {\n selectedRows = [selectedRows];\n }\n if (selectedRows && selectedRows.length > 0) {\n const notFoundValues = [];\n selectedRows.forEach((item1: any) => {\n if (!modalRef.datasource.some(item => item[get_value_key()] === item1)) {\n notFoundValues.push(item1);\n }\n });\n if (notFoundValues.length > 0) {\n const obj = { ...params };\n if (props.field.queryType === 'simple') {\n let value = notFoundValues as any;\n if (value instanceof Array && value.length > 0) {\n value = value.join(',');\n }\n obj[get_value_key()] = value;\n } else {\n if (obj.conditions && obj.conditions.length > 0) {\n obj.conditions[0].push({\n class_name: 'int',\n operator: 'in',\n value: notFoundValues,\n format: 'remote',\n field_name: get_value_key(),\n });\n } else {\n obj.conditions = [[]];\n obj.conditions[0].push({\n class_name: 'int',\n operator: 'in',\n value: notFoundValues,\n format: 'remote',\n field_name: get_value_key(),\n });\n }\n }\n const res1 = await getApiData({ ...obj }, props.field.postUrl, false, {\n skip_error: true,\n });\n modalRef.datasource = modalRef.datasource.concat(res1?.data || []);\n }\n }\n};\nconst getQueryParams = (has_search = true) => {\n let params: any = {};\n if (props.field.queryType === 'simple') {\n searchConfig.simpleSearchParams = getSimpleSearchParams(has_search);\n params = {\n ...searchConfig,\n ...searchConfig.simpleSearchParams,\n required_condition: getRequiredConditionObj(),\n };\n delete params.conditions;\n delete params.simpleSearchParams;\n } else {\n searchConfig.conditions = getConditions(has_search);\n params = { ...searchConfig, required_condition: getRequiredConditionObj() };\n delete params.simpleSearchParams;\n }\n return params;\n};\n\nconst refresh = async (clear = false) => {\n // modalRef.datasource.length = 0;\n // 不清空modalRef.datasource,保留原始数据,如果是输入过滤条件筛选的数据,需要去重后,追加到datasource里\n if (props.field.postUrl) {\n if (clear) {\n modalRef.datasource.length = 0;\n }\n const is_first = modalRef.datasource.length === 0;\n const params = getQueryParams();\n const res = await getApiData(params, props.field.postUrl, false, { skip_error: true });\n if (res?.data?.length > 0) {\n const rowKey = get_value_key();\n const new_list = res?.data.filter(i => {\n const f = modalRef.datasource.find(j => {\n return i[rowKey] == j[rowKey];\n });\n return !f;\n });\n modalRef.datasource = modalRef.datasource.concat(new_list);\n if (is_first) {\n await externDataSource(params, modalRef.selectedRows);\n }\n setInnerModel();\n }\n\n if (props.field.defaultValueType === 'first' && !props.is_form_design) {\n if (!props.formModel[props.field.name]) {\n if (props.field.mode === 'default' || !props.field.mode) {\n emit('update:label', modalRef.datasource[0][get_label_key()]);\n emit('update:value', modalRef.datasource[0][get_value_key()]);\n } else {\n emit('update:label', [modalRef.datasource[0][get_label_key()]]);\n emit('update:value', [modalRef.datasource[0][get_value_key()]]);\n }\n }\n } else if (props.field.defaultValueType === 'global' && !props.is_form_design) {\n if (!props.formModel[props.field.name]) {\n const globalDefaultKey = props.field.globalDefaultKey;\n const globalDefaultField = props.field.globalDefaultField;\n const globalDefaultValue = requiredConditionStore.value_map[globalDefaultKey];\n if (globalDefaultValue) {\n const globalDefaultItem = modalRef.datasource.find(\n item1 => item1[globalDefaultField] === globalDefaultValue,\n );\n if (globalDefaultItem) {\n if (props.field.mode === 'default' || !props.field.mode) {\n emit('update:label', globalDefaultItem[get_label_key()]);\n emit('update:value', globalDefaultItem[get_value_key()]);\n } else {\n emit('update:label', [globalDefaultItem[get_label_key()]]);\n emit('update:value', [globalDefaultItem[get_value_key()]]);\n }\n }\n }\n }\n } else {\n getDefaultValue(modalRef.selectedRows);\n }\n }\n};\nconst delayRefresh: any = debounce((clear = false) => {\n refresh(clear);\n}, 500);\n\nwatch(\n () => [\n props.labelKeyList,\n props.labelKey,\n props.labelKeyType,\n props.valueKey,\n props.labelSpace,\n props.field.postUrl,\n ],\n (newValue, oldValue) => {\n if (!isEqual(newValue, oldValue)) {\n getColumnFields();\n searchConfig.sort_fields = get_sort_fields();\n delayRefresh(true);\n }\n },\n { deep: true },\n);\n\nwatch(\n () => [props.field.searchConditions, props.field.queryType, props.field.simpleSearchConditions],\n (newValue, oldValue) => {\n if (!isEqual(newValue, oldValue)) {\n delayRefresh(true);\n }\n },\n { deep: true },\n);\n\nconst handleSearch = (str: any) => {\n searchText.value = str;\n delayRefresh();\n};\n\nconst tableModal = defineAsyncComponent(() => import('./tableModal.vue'));\n\nconst handleOpenTable = () => {\n let currentValue = [];\n searchText.value = '';\n let rowSelectionType = 'checkbox';\n if (props.field.mode === 'default') {\n rowSelectionType = 'radio';\n }\n if (!datasource.value) {\n currentValue = [];\n } else {\n currentValue = datasource.value.filter((item: any) => checkEqualSelected(item.value));\n }\n tableConfig.value = {\n key: tableKey.value,\n title: props.field.label || props.field.name,\n rowSelectionType,\n columns: props.field.table?.columns || [],\n search_config: props.field.table?.search_config || [],\n list_url: props.field.postUrl,\n is_selection: true,\n is_pagination: true,\n hide_header: true,\n };\n const init_model = props.init_model || {};\n if (props.field.queryType === 'simple') {\n tableConfig.value['query_params'] = { ...init_model, ...getSimpleSearchParams() };\n } else {\n const conditions = getConditions();\n tableConfig.value['query_params'] = init_model;\n if (conditions.length > 0 && conditions[0].length > 0) {\n tableConfig.value['base_conditions'] = conditions[0];\n }\n }\n const required_condition = getRequiredConditionObj();\n if (required_condition) {\n tableConfig.value['query_params'] = {\n ...tableConfig.value['query_params'],\n required_condition,\n };\n }\n const tempModal = reactive({\n open: true,\n loading: false,\n component: tableModal,\n isMultiple: props.field.mode !== 'default',\n tableConfig: tableConfig.value,\n labelKey: props.labelKey || 'name',\n value: currentValue,\n labelKeyList: props.labelKeyList || [],\n labelKeyType: props.labelKeyType || 1,\n labelSpace: props.labelSpace || '-',\n valueKey: props.valueKey || 'id',\n ok: async (data: any) => {\n const selectedValues = data.map((item: any) => item.value) || [];\n const selectedLabels = data.map((item: any) => item.label) || [];\n const params = getQueryParams();\n if (props.field.mode == 'default') {\n if (selectedValues.length == 0) {\n modalRef.selectedRows = undefined;\n emit('update:value', modalRef.selectedRows);\n emit('update:label', undefined);\n } else {\n modalRef.selectedRows = selectedValues[0];\n await externDataSource(params, selectedValues[0]);\n emit('update:value', modalRef.selectedRows);\n emit('update:label', selectedLabels[0]);\n }\n } else {\n modalRef.selectedRows = selectedValues;\n await externDataSource(params, selectedValues);\n emit('update:value', modalRef.selectedRows);\n emit('update:label', selectedLabels);\n }\n },\n cancel: () => {\n console.log('cancel');\n },\n });\n modalBox(tempModal);\n};\n\nconst filterOption = (val: string, option: any) => {\n if (datasource.value instanceof Array) {\n const f: any = datasource.value.find(item => {\n return item['value'] == option.key;\n });\n if (f) {\n return String(f['label']).toLowerCase().indexOf(val.toLowerCase()) >= 0;\n } else {\n return false;\n }\n }\n};\n</script>\n<style scoped lang=\"less\">\n.remote-select-pro {\n display: flex;\n align-items: flex-start;\n gap: 4px;\n flex-wrap: nowrap;\n // 禁用状态下文字保持黑色,不显示为灰色\n :deep(.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector) {\n color: #000;\n }\n :deep(.ant-select-disabled .ant-select-selection-item) {\n color: #000;\n }\n}\n.ant-input-group.ant-input-group-compact {\n .remote-select-pro {\n display: flex;\n }\n}\n.ant-form-inline {\n .ant-input-group.ant-input-group-compact {\n .remote-select-pro {\n display: inline-flex;\n }\n }\n}\n.table-search-icon {\n color: black;\n font-size: 17px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsGA,IAAM,IAAQ,GAiBR,IAAO,GAIP,IAAW,EAAS;GACxB,cAAc,CAAwB;GACtC,YAAY,CAAe;EAC7B,CAAC,GACK,KAAQ,GAAS,GACjB,IAA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,CAAc,GAC7C,EAAK,gBAAgB,EAAS,YAAY,GAC1C,EAAK,gBAAgB,CAAc;IAEvC;IACA,cAAc;KACZ,QAAQ,IAAI,QAAQ;IACtB;GACF,CACS,CAAS;EACpB,GAEM,MAAgB,GAAa,MAAgB;GACjD,IAAI,EAAW,iBAAiB,OAAO;IACrC,IAAM,IAAS,EAAW,MAAM,MAAK,MAC5B,EAAK,SAAY,EAAO,GAChC;IAIC,OAHE,IACK,OAAO,EAAE,KAAQ,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAI,YAAY,CAAC,KAAK,IAE/D;GAEX;EACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { O as e } from "./init-plugin-CvgtEpwY.js";
|
|
2
2
|
import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
3
|
-
import { _ as n, h as r, p as i, w as a } from "./function-
|
|
3
|
+
import { _ as n, h as r, p as i, w as a } from "./function-BhYSb8ls.js";
|
|
4
4
|
import { useFetchData as o } from "./utils/hooks/useFetchData.js";
|
|
5
|
-
import { i as s, r as c } from "./RemoteModal-
|
|
5
|
+
import { i as s, r as c } from "./RemoteModal-Dqy32RFN.js";
|
|
6
6
|
import { useTableDynamicColumns as l } from "./utils/hooks/useTableColumn.js";
|
|
7
7
|
import { Fragment as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createSlots as h, createTextVNode as g, createVNode as _, defineComponent as v, onMounted as y, openBlock as b, reactive as x, ref as S, renderList as C, resolveComponent as w, toDisplayString as T, watch as E, withCtx as D } from "vue";
|
|
8
8
|
import { message as O } from "ant-design-vue";
|