liyu-pc-base 1.0.921 → 1.0.923

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.
Files changed (24) hide show
  1. package/dist/{FieldRender-BOg7nm5z.js → FieldRender-DnOLSXTl.js} +1 -1
  2. package/dist/{FieldRender-BOg7nm5z.js.map → FieldRender-DnOLSXTl.js.map} +1 -1
  3. package/dist/{FieldRender2-_MtcDkI5.js → FieldRender2-CvxGe238.js} +2 -2
  4. package/dist/{FieldRender2-_MtcDkI5.js.map → FieldRender2-CvxGe238.js.map} +1 -1
  5. package/dist/{FormRender3-BtY9d91e.js → FormRender3-CAxOQgue.js} +1 -1
  6. package/dist/{FormRender3-BtY9d91e.js.map → FormRender3-CAxOQgue.js.map} +1 -1
  7. package/dist/{RemoteSelectPro-CcWTS4f6.js → RemoteSelectPro-CcL_vU1K.js} +1 -1
  8. package/dist/{RemoteSelectPro-CcWTS4f6.js.map → RemoteSelectPro-CcL_vU1K.js.map} +1 -1
  9. package/dist/{SearchRender-ByarFel1.js → SearchRender-Dr_qnvZM.js} +1 -1
  10. package/dist/{SearchRender-ByarFel1.js.map → SearchRender-Dr_qnvZM.js.map} +1 -1
  11. package/dist/components/index.js +7 -7
  12. package/dist/{dbViewConfig-RGSyUx3F.js → dbViewConfig-BF0QZ_mT.js} +1 -1
  13. package/dist/{dbViewConfig-RGSyUx3F.js.map → dbViewConfig-BF0QZ_mT.js.map} +1 -1
  14. package/dist/{detailTablePro-CqcVbn8O.js → detailTablePro-DxgfGYN3.js} +1 -1
  15. package/dist/{detailTablePro-CqcVbn8O.js.map → detailTablePro-DxgfGYN3.js.map} +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/liyu-pc-base.css +1 -1
  18. package/dist/{tableModal-DSKuV-hn.js → tableModal-DZE5wntG.js} +1 -1
  19. package/dist/{tableModal-DSKuV-hn.js.map → tableModal-DZE5wntG.js.map} +1 -1
  20. package/dist/{tablePageHost-B_BOlBNA.js → tablePageHost-hE_1hQv4.js} +82 -44
  21. package/dist/{tablePageHost-B_BOlBNA.js.map → tablePageHost-hE_1hQv4.js.map} +1 -1
  22. package/dist/{tablePro-IAcxxAGI.js → tablePro-t2yDX9oW.js} +16 -11
  23. package/dist/{tablePro-IAcxxAGI.js.map → tablePro-t2yDX9oW.js.map} +1 -1
  24. package/package.json +1 -1
@@ -2,7 +2,7 @@ import { r as e } from "./rolldown-runtime-DY7j01NX.js";
2
2
  import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { s as n } from "./function-BhYSb8ls.js";
4
4
  import { u as r } from "./TinymceEditor-waI-dlC5.js";
5
- import { t as i } from "./FieldRender2-_MtcDkI5.js";
5
+ import { t as i } from "./FieldRender2-CvxGe238.js";
6
6
  import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createSlots as u, createTextVNode as d, createVNode as f, defineComponent as p, openBlock as m, provide as h, reactive as g, ref as _, renderList as v, resolveComponent as y, toDisplayString as b, watch as x, withCtx as S } from "vue";
7
7
  import { message as C } from "ant-design-vue";
8
8
  //#region src/components/FormRender/FieldCol.vue?vue&type=script&lang.ts
@@ -1 +1 @@
1
- {"version":3,"file":"FormRender3-BtY9d91e.js","names":[],"sources":["../src/components/FormRender/FieldCol.vue","../src/components/FormRender/FieldCol.vue","../src/components/FormRender/FormRender3.vue","../src/components/FormRender/FormRender3.vue"],"sourcesContent":["<template>\n <a-col\n :span=\"is_show_field ? (field_item.span !== undefined ? field_item.span : 24) : 0\"\n :offset=\"field_item.offset\"\n :push=\"field_item.push\"\n :pull=\"field_item.pull\"\n >\n <field-render-2\n v-model:value=\"model[field_item.name]\"\n v-model:label=\"model[field_item.name + '.label']\"\n v-model:is_show_field=\"is_show_field\"\n :field=\"field_item\"\n :formModel=\"model\"\n :outModel=\"outModel\"\n :key=\"field_item.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field_item.datasource ? field_item.datasource : field_item.name]\"\n :alwaysShowGroup=\"alwaysShowGroup\"\n :context=\"context\"\n :inner-model=\"innerModel\"\n :global-inner-model=\"globalInnerModel\"\n :nestValidate=\"nestValidate\"\n :base-key-path=\"baseKeyPath\"\n :worker-host-functions=\"workerHostFunctions\"\n @update_model=\"onUpdateModel\"\n @update_name2=\"onUpdateName2\"\n />\n </a-col>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, ref } from 'vue';\nimport FieldRender2 from 'liyu-pc-base/components/FormRender/FieldRender2.vue';\n\nexport default defineComponent({\n name: 'FieldCol',\n components: {\n FieldRender2,\n },\n props: {\n model: {\n type: Object,\n required: true,\n },\n outModel: {\n type: Object,\n default: () => {},\n },\n options: {\n type: Object,\n required: true,\n default: () => {},\n },\n validateInfos: {\n type: Object,\n default: () => {},\n },\n alwaysShowGroup: {\n type: Boolean,\n default: false,\n },\n field_item: {\n type: Object,\n default: () => {},\n },\n context: {\n type: Object,\n default: null,\n },\n innerModel: {\n default: null,\n },\n globalInnerModel: {\n default: null,\n },\n nestValidate: {\n type: Object as PropType<Record<string, any> | null>,\n default: null,\n },\n baseKeyPath: {\n type: Array,\n default: () => [],\n },\n workerHostFunctions: {\n type: Object,\n default: () => {},\n },\n },\n emits: ['update_model', 'update_name2'],\n setup(props, { emit }) {\n const is_show_field = ref(true);\n const onUpdateModel = params => {\n emit('update_model', params);\n };\n const onUpdateName2 = params => {\n emit('update_name2', params);\n };\n return { is_show_field, onUpdateModel, onUpdateName2 };\n },\n});\n</script>\n<style lang=\"less\" scoped>\n.cards {\n ::v-deep(.ant-card-head) {\n padding: 0 8px;\n min-height: 44px;\n background-color: rgba(0, 0, 0, 0.02);\n }\n}\n</style>\n","<template>\n <a-col\n :span=\"is_show_field ? (field_item.span !== undefined ? field_item.span : 24) : 0\"\n :offset=\"field_item.offset\"\n :push=\"field_item.push\"\n :pull=\"field_item.pull\"\n >\n <field-render-2\n v-model:value=\"model[field_item.name]\"\n v-model:label=\"model[field_item.name + '.label']\"\n v-model:is_show_field=\"is_show_field\"\n :field=\"field_item\"\n :formModel=\"model\"\n :outModel=\"outModel\"\n :key=\"field_item.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field_item.datasource ? field_item.datasource : field_item.name]\"\n :alwaysShowGroup=\"alwaysShowGroup\"\n :context=\"context\"\n :inner-model=\"innerModel\"\n :global-inner-model=\"globalInnerModel\"\n :nestValidate=\"nestValidate\"\n :base-key-path=\"baseKeyPath\"\n :worker-host-functions=\"workerHostFunctions\"\n @update_model=\"onUpdateModel\"\n @update_name2=\"onUpdateName2\"\n />\n </a-col>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, ref } from 'vue';\nimport FieldRender2 from 'liyu-pc-base/components/FormRender/FieldRender2.vue';\n\nexport default defineComponent({\n name: 'FieldCol',\n components: {\n FieldRender2,\n },\n props: {\n model: {\n type: Object,\n required: true,\n },\n outModel: {\n type: Object,\n default: () => {},\n },\n options: {\n type: Object,\n required: true,\n default: () => {},\n },\n validateInfos: {\n type: Object,\n default: () => {},\n },\n alwaysShowGroup: {\n type: Boolean,\n default: false,\n },\n field_item: {\n type: Object,\n default: () => {},\n },\n context: {\n type: Object,\n default: null,\n },\n innerModel: {\n default: null,\n },\n globalInnerModel: {\n default: null,\n },\n nestValidate: {\n type: Object as PropType<Record<string, any> | null>,\n default: null,\n },\n baseKeyPath: {\n type: Array,\n default: () => [],\n },\n workerHostFunctions: {\n type: Object,\n default: () => {},\n },\n },\n emits: ['update_model', 'update_name2'],\n setup(props, { emit }) {\n const is_show_field = ref(true);\n const onUpdateModel = params => {\n emit('update_model', params);\n };\n const onUpdateName2 = params => {\n emit('update_name2', params);\n };\n return { is_show_field, onUpdateModel, onUpdateName2 };\n },\n});\n</script>\n<style lang=\"less\" scoped>\n.cards {\n ::v-deep(.ant-card-head) {\n padding: 0 8px;\n min-height: 44px;\n background-color: rgba(0, 0, 0, 0.02);\n }\n}\n</style>\n","<template>\n <a-form\n autocomplete=\"off\"\n :model=\"model\"\n :rules=\"form.rules\"\n :layout=\"form.settings.layout\"\n scrollToFirstError\n class=\"cards\"\n :validateTrigger=\"false\"\n >\n <template\n v-for=\"(row, index) in form.dynamicFieldList\"\n :key=\"index\"\n >\n <a-card\n :body-style=\"{ padding: '10px 10px 0' }\"\n style=\"margin-bottom: 5px\"\n >\n <template\n v-if=\"row.group_name && (form.dynamicFieldList.length > 1 || alwaysShowGroup)\"\n #title\n >\n {{ row.group_name }}\n </template>\n <template #extra>\n <div\n class=\"group-custom-btn-list\"\n v-if=\"row.custom_btn_list && row.custom_btn_list.length > 0\"\n >\n <template v-for=\"btn in row.custom_btn_list\">\n <debug-code\n :action_code_id=\"btn.action_code_id\"\n v-model:code=\"btn.code\"\n >\n <a-button\n v-if=\"!lockStructure || btn.show_on_modify\"\n size=\"small\"\n :type=\"btn.type\"\n :danger=\"btn.danger\"\n @click=\"handleCustomBtnClick(btn)\"\n >\n {{ btn.label }}\n </a-button>\n </debug-code>\n </template>\n </div>\n </template>\n <a-row\n :gutter=\"5\"\n type=\"flex\"\n >\n <template v-if=\"getColFieldList(row?.children).length > 0\">\n <a-col\n v-for=\"col in getColFieldList(row?.children)\"\n :key=\"col[0]\"\n :xl=\"24 / getColFieldList(row?.children).length\"\n :lg=\"24\"\n :md=\"24\"\n :sm=\"24\"\n :xs=\"24\"\n >\n <field-col\n v-for=\"(field_item, i) in row?.children.slice(col[0], col[1])\"\n :key=\"i\"\n :model=\"model\"\n :out-model=\"outModel\"\n :options=\"options\"\n :validate-infos=\"validateInfos\"\n :always-show-group=\"alwaysShowGroup\"\n :field_item=\"field_item\"\n :context=\"context\"\n :inner-model=\"_innerModel\"\n :global-inner-model=\"_globalInnerModel\"\n :nestValidate=\"nestValidate\"\n :base-key-path=\"baseKeyPath\"\n :worker-host-functions=\"workerHostFunctions\"\n @update_model=\"onUpdateModel\"\n @update_name2=\"onUpdateName2\"\n ></field-col>\n </a-col>\n </template>\n <field-col\n v-else\n v-for=\"(field_item, i) in row?.children\"\n :key=\"i\"\n :model=\"model\"\n :out-model=\"outModel\"\n :options=\"options\"\n :validate-infos=\"validateInfos\"\n :always-show-group=\"alwaysShowGroup\"\n :field_item=\"field_item\"\n :context=\"context\"\n :inner-model=\"_innerModel\"\n :global-inner-model=\"_globalInnerModel\"\n :nestValidate=\"nestValidate\"\n :base-key-path=\"baseKeyPath\"\n :worker-host-functions=\"workerHostFunctions\"\n @update_model=\"onUpdateModel\"\n @update_name2=\"onUpdateName2\"\n ></field-col>\n </a-row>\n </a-card>\n </template>\n </a-form>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, watch, reactive, PropType, provide, computed } from 'vue';\nimport FieldCol from './FieldCol.vue';\nimport { executeScriptInWorker } from 'liyu-pc-base/utils/function';\nimport { message } from 'ant-design-vue';\nimport debugCode from 'liyu-pc-base/components/FormRender/debugCode.vue';\n\nexport default defineComponent({\n name: 'FormRender3',\n components: {\n FieldCol,\n debugCode,\n },\n props: {\n model: {\n type: Object,\n required: true,\n },\n outModel: {\n type: Object,\n default: () => {},\n },\n form: {\n type: Object,\n required: true,\n },\n options: {\n type: Object,\n required: true,\n default: () => {},\n },\n validateInfos: {\n type: Object,\n default: () => {},\n },\n alwaysShowGroup: {\n type: Boolean,\n default: false,\n },\n context: {\n type: Object,\n default: null,\n },\n innerModel: {\n type: Object,\n default: null,\n },\n globalInnerModel: {\n default: null,\n },\n nestValidate: {\n type: Object as PropType<Record<string, any> | null>,\n default: null,\n },\n baseKeyPath: {\n type: Array,\n default: () => [],\n },\n workerHostFunctions: {\n type: Object,\n default: () => {},\n },\n // 修改模式传入 true:深层 FormTemplate/FormItem 隐藏系统按钮与行删除(provide 给子组件)\n lockStructure: {\n type: Boolean,\n default: false,\n },\n },\n emits: ['update_model'],\n setup(props, { emit }) {\n // 向深层子组件(FieldCol → FormTemplate/FormItem 等)提供 lockStructure,避免逐层透传\n provide('FORM_LOCK_STRUCTURE', computed(() => props.lockStructure));\n // 解决传入非响应式数据时,动态增加is_show_field无用正常相应问题\n if (props.form.watch) {\n for (let k in props.form.watch) {\n watch(\n () => props.model[k],\n () => {\n props.form.watch[k](props.model, props.form);\n },\n );\n }\n }\n const _globalInnerModel = props.globalInnerModel || reactive({});\n const _innerModel = props.innerModel || _globalInnerModel;\n\n // 支持 form.settings.col 分列(与 FormRender fields 模式一致):\n // settings.col 数组每项表示该列容纳的字段个数,如 [11, 11, 12] 表示三列,分别放 11/11/12 个字段\n // 返回每列的 [start, end) 区间;未配置 col 或 children 为空时返回 [](保持单列原逻辑)\n const getColFieldList = (children: any[]): Array<[number, number]> => {\n const col = props.form?.settings?.col;\n if (!col || col.length === 0 || !children || children.length === 0) {\n return [];\n }\n const list: Array<[number, number]> = [];\n let a = 0;\n col.forEach((item: number, i: number) => {\n a = a + item;\n if (i === 0) {\n list.push([0, a]);\n } else {\n list.push([a - item, a]);\n }\n });\n return list;\n };\n\n const validate = () => {\n return (props.form as any).validate();\n };\n const onUpdateModel = params => {\n emit('update_model', params);\n };\n const onUpdateName2 = params => {\n emit('update_model', params);\n };\n const handleCustomBtnClick = async btn => {\n if (btn.code) {\n let res;\n try {\n res = await executeScriptInWorker(\n btn.code,\n {\n context: props.context,\n formModel: props.model,\n keyPath: [...props.baseKeyPath, btn.group_name],\n },\n props.workerHostFunctions || {},\n );\n } catch (e) {\n message.error(e.message);\n return;\n }\n if (res) {\n Object.assign(props.model, res);\n }\n }\n };\n return {\n validate,\n onUpdateModel,\n onUpdateName2,\n _globalInnerModel,\n _innerModel,\n handleCustomBtnClick,\n getColFieldList,\n };\n },\n});\n</script>\n\n<style lang=\"less\" scoped>\n.cards {\n ::v-deep(.ant-card-head) {\n padding: 0 8px;\n min-height: 44px;\n background-color: rgba(0, 0, 0, 0.02);\n }\n}\n.group-custom-btn-list {\n display: inline-flex;\n gap: 5px;\n flex-wrap: wrap;\n margin-right: 2px;\n}\n</style>\n","<template>\n <a-form\n autocomplete=\"off\"\n :model=\"model\"\n :rules=\"form.rules\"\n :layout=\"form.settings.layout\"\n scrollToFirstError\n class=\"cards\"\n :validateTrigger=\"false\"\n >\n <template\n v-for=\"(row, index) in form.dynamicFieldList\"\n :key=\"index\"\n >\n <a-card\n :body-style=\"{ padding: '10px 10px 0' }\"\n style=\"margin-bottom: 5px\"\n >\n <template\n v-if=\"row.group_name && (form.dynamicFieldList.length > 1 || alwaysShowGroup)\"\n #title\n >\n {{ row.group_name }}\n </template>\n <template #extra>\n <div\n class=\"group-custom-btn-list\"\n v-if=\"row.custom_btn_list && row.custom_btn_list.length > 0\"\n >\n <template v-for=\"btn in row.custom_btn_list\">\n <debug-code\n :action_code_id=\"btn.action_code_id\"\n v-model:code=\"btn.code\"\n >\n <a-button\n v-if=\"!lockStructure || btn.show_on_modify\"\n size=\"small\"\n :type=\"btn.type\"\n :danger=\"btn.danger\"\n @click=\"handleCustomBtnClick(btn)\"\n >\n {{ btn.label }}\n </a-button>\n </debug-code>\n </template>\n </div>\n </template>\n <a-row\n :gutter=\"5\"\n type=\"flex\"\n >\n <template v-if=\"getColFieldList(row?.children).length > 0\">\n <a-col\n v-for=\"col in getColFieldList(row?.children)\"\n :key=\"col[0]\"\n :xl=\"24 / getColFieldList(row?.children).length\"\n :lg=\"24\"\n :md=\"24\"\n :sm=\"24\"\n :xs=\"24\"\n >\n <field-col\n v-for=\"(field_item, i) in row?.children.slice(col[0], col[1])\"\n :key=\"i\"\n :model=\"model\"\n :out-model=\"outModel\"\n :options=\"options\"\n :validate-infos=\"validateInfos\"\n :always-show-group=\"alwaysShowGroup\"\n :field_item=\"field_item\"\n :context=\"context\"\n :inner-model=\"_innerModel\"\n :global-inner-model=\"_globalInnerModel\"\n :nestValidate=\"nestValidate\"\n :base-key-path=\"baseKeyPath\"\n :worker-host-functions=\"workerHostFunctions\"\n @update_model=\"onUpdateModel\"\n @update_name2=\"onUpdateName2\"\n ></field-col>\n </a-col>\n </template>\n <field-col\n v-else\n v-for=\"(field_item, i) in row?.children\"\n :key=\"i\"\n :model=\"model\"\n :out-model=\"outModel\"\n :options=\"options\"\n :validate-infos=\"validateInfos\"\n :always-show-group=\"alwaysShowGroup\"\n :field_item=\"field_item\"\n :context=\"context\"\n :inner-model=\"_innerModel\"\n :global-inner-model=\"_globalInnerModel\"\n :nestValidate=\"nestValidate\"\n :base-key-path=\"baseKeyPath\"\n :worker-host-functions=\"workerHostFunctions\"\n @update_model=\"onUpdateModel\"\n @update_name2=\"onUpdateName2\"\n ></field-col>\n </a-row>\n </a-card>\n </template>\n </a-form>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, watch, reactive, PropType, provide, computed } from 'vue';\nimport FieldCol from './FieldCol.vue';\nimport { executeScriptInWorker } from 'liyu-pc-base/utils/function';\nimport { message } from 'ant-design-vue';\nimport debugCode from 'liyu-pc-base/components/FormRender/debugCode.vue';\n\nexport default defineComponent({\n name: 'FormRender3',\n components: {\n FieldCol,\n debugCode,\n },\n props: {\n model: {\n type: Object,\n required: true,\n },\n outModel: {\n type: Object,\n default: () => {},\n },\n form: {\n type: Object,\n required: true,\n },\n options: {\n type: Object,\n required: true,\n default: () => {},\n },\n validateInfos: {\n type: Object,\n default: () => {},\n },\n alwaysShowGroup: {\n type: Boolean,\n default: false,\n },\n context: {\n type: Object,\n default: null,\n },\n innerModel: {\n type: Object,\n default: null,\n },\n globalInnerModel: {\n default: null,\n },\n nestValidate: {\n type: Object as PropType<Record<string, any> | null>,\n default: null,\n },\n baseKeyPath: {\n type: Array,\n default: () => [],\n },\n workerHostFunctions: {\n type: Object,\n default: () => {},\n },\n // 修改模式传入 true:深层 FormTemplate/FormItem 隐藏系统按钮与行删除(provide 给子组件)\n lockStructure: {\n type: Boolean,\n default: false,\n },\n },\n emits: ['update_model'],\n setup(props, { emit }) {\n // 向深层子组件(FieldCol → FormTemplate/FormItem 等)提供 lockStructure,避免逐层透传\n provide('FORM_LOCK_STRUCTURE', computed(() => props.lockStructure));\n // 解决传入非响应式数据时,动态增加is_show_field无用正常相应问题\n if (props.form.watch) {\n for (let k in props.form.watch) {\n watch(\n () => props.model[k],\n () => {\n props.form.watch[k](props.model, props.form);\n },\n );\n }\n }\n const _globalInnerModel = props.globalInnerModel || reactive({});\n const _innerModel = props.innerModel || _globalInnerModel;\n\n // 支持 form.settings.col 分列(与 FormRender fields 模式一致):\n // settings.col 数组每项表示该列容纳的字段个数,如 [11, 11, 12] 表示三列,分别放 11/11/12 个字段\n // 返回每列的 [start, end) 区间;未配置 col 或 children 为空时返回 [](保持单列原逻辑)\n const getColFieldList = (children: any[]): Array<[number, number]> => {\n const col = props.form?.settings?.col;\n if (!col || col.length === 0 || !children || children.length === 0) {\n return [];\n }\n const list: Array<[number, number]> = [];\n let a = 0;\n col.forEach((item: number, i: number) => {\n a = a + item;\n if (i === 0) {\n list.push([0, a]);\n } else {\n list.push([a - item, a]);\n }\n });\n return list;\n };\n\n const validate = () => {\n return (props.form as any).validate();\n };\n const onUpdateModel = params => {\n emit('update_model', params);\n };\n const onUpdateName2 = params => {\n emit('update_model', params);\n };\n const handleCustomBtnClick = async btn => {\n if (btn.code) {\n let res;\n try {\n res = await executeScriptInWorker(\n btn.code,\n {\n context: props.context,\n formModel: props.model,\n keyPath: [...props.baseKeyPath, btn.group_name],\n },\n props.workerHostFunctions || {},\n );\n } catch (e) {\n message.error(e.message);\n return;\n }\n if (res) {\n Object.assign(props.model, res);\n }\n }\n };\n return {\n validate,\n onUpdateModel,\n onUpdateName2,\n _globalInnerModel,\n _innerModel,\n handleCustomBtnClick,\n getColFieldList,\n };\n },\n});\n</script>\n\n<style lang=\"less\" scoped>\n.cards {\n ::v-deep(.ant-card-head) {\n padding: 0 8px;\n min-height: 44px;\n background-color: rgba(0, 0, 0, 0.02);\n }\n}\n.group-custom-btn-list {\n display: inline-flex;\n gap: 5px;\n flex-wrap: wrap;\n margin-right: 2px;\n}\n</style>\n"],"mappings":";;;;;;;;AAiCA,IAAA,IAAe,EAAgB;CAC7B,MAAM;CACN,YAAY,EACV,cAAA,EACF;CACA,OAAO;EACL,OAAO;GACL,MAAM;GACN,UAAU;EACZ;EACA,UAAU;GAC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Ba,GAAA,MA9E3B,EA8D0C,GAAK,SAAS,MAAM,EAAG,IAAK,EAAG,EAAA,IAAjD,GAAY,YADtB,EAiBa,GAAA;MAfV,KAAK;MACL,OAAO,EAAA;MACP,aAAW,EAAA;MACX,SAAS,EAAA;MACT,kBAAgB,EAAA;MAChB,qBAAmB,EAAA;MACP;MACZ,SAAS,EAAA;MACT,eAAa,EAAA;MACb,sBAAoB,EAAA;MACpB,cAAc,EAAA;MACd,iBAAe,EAAA;MACf,yBAAuB,EAAA;MACvB,gBAAc,EAAA;MACd,gBAAc,EAAA;;;;;;;;;;;;;;;;;KA7E/B,GAAA;wCAiFU,EAkBa,GAAA,EAnGvB,KAAA,EAAA,GAAA,EAmFsC,GAAK,WAAvB,GAAY,YAFtB,EAkBa,GAAA;KAfV,KAAK;KACL,OAAO,EAAA;KACP,aAAW,EAAA;KACX,SAAS,EAAA;KACT,kBAAgB,EAAA;KAChB,qBAAmB,EAAA;KACP;KACZ,SAAS,EAAA;KACT,eAAa,EAAA;KACb,sBAAoB,EAAA;KACpB,cAAc,EAAA;KACd,iBAAe,EAAA;KACf,yBAAuB,EAAA;KACvB,gBAAc,EAAA;KACd,gBAAc,EAAA;;;;;;;;;;;;;;;;;IAlG3B,GAAA;;GAAA,GAAA;MAmBgB,EAAI,eAAe,EAAA,KAAK,iBAAiB,SAAM,KAAQ,EAAA,mBAAA;GAnBvE,MAoBW;GApBX,IAAA,QAsB8B,CAtB9B,EAAA,EAsBa,EAAI,UAAU,GAAA,CAAA,CAAA,CAAA;GAtB3B,KAAA;MAAA,KAAA,CAAA,CAAA,GAAA,IAAA;EAAA,GAAA"}
1
+ {"version":3,"file":"FormRender3-CAxOQgue.js","names":[],"sources":["../src/components/FormRender/FieldCol.vue","../src/components/FormRender/FieldCol.vue","../src/components/FormRender/FormRender3.vue","../src/components/FormRender/FormRender3.vue"],"sourcesContent":["<template>\n <a-col\n :span=\"is_show_field ? (field_item.span !== undefined ? field_item.span : 24) : 0\"\n :offset=\"field_item.offset\"\n :push=\"field_item.push\"\n :pull=\"field_item.pull\"\n >\n <field-render-2\n v-model:value=\"model[field_item.name]\"\n v-model:label=\"model[field_item.name + '.label']\"\n v-model:is_show_field=\"is_show_field\"\n :field=\"field_item\"\n :formModel=\"model\"\n :outModel=\"outModel\"\n :key=\"field_item.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field_item.datasource ? field_item.datasource : field_item.name]\"\n :alwaysShowGroup=\"alwaysShowGroup\"\n :context=\"context\"\n :inner-model=\"innerModel\"\n :global-inner-model=\"globalInnerModel\"\n :nestValidate=\"nestValidate\"\n :base-key-path=\"baseKeyPath\"\n :worker-host-functions=\"workerHostFunctions\"\n @update_model=\"onUpdateModel\"\n @update_name2=\"onUpdateName2\"\n />\n </a-col>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, ref } from 'vue';\nimport FieldRender2 from 'liyu-pc-base/components/FormRender/FieldRender2.vue';\n\nexport default defineComponent({\n name: 'FieldCol',\n components: {\n FieldRender2,\n },\n props: {\n model: {\n type: Object,\n required: true,\n },\n outModel: {\n type: Object,\n default: () => {},\n },\n options: {\n type: Object,\n required: true,\n default: () => {},\n },\n validateInfos: {\n type: Object,\n default: () => {},\n },\n alwaysShowGroup: {\n type: Boolean,\n default: false,\n },\n field_item: {\n type: Object,\n default: () => {},\n },\n context: {\n type: Object,\n default: null,\n },\n innerModel: {\n default: null,\n },\n globalInnerModel: {\n default: null,\n },\n nestValidate: {\n type: Object as PropType<Record<string, any> | null>,\n default: null,\n },\n baseKeyPath: {\n type: Array,\n default: () => [],\n },\n workerHostFunctions: {\n type: Object,\n default: () => {},\n },\n },\n emits: ['update_model', 'update_name2'],\n setup(props, { emit }) {\n const is_show_field = ref(true);\n const onUpdateModel = params => {\n emit('update_model', params);\n };\n const onUpdateName2 = params => {\n emit('update_name2', params);\n };\n return { is_show_field, onUpdateModel, onUpdateName2 };\n },\n});\n</script>\n<style lang=\"less\" scoped>\n.cards {\n ::v-deep(.ant-card-head) {\n padding: 0 8px;\n min-height: 44px;\n background-color: rgba(0, 0, 0, 0.02);\n }\n}\n</style>\n","<template>\n <a-col\n :span=\"is_show_field ? (field_item.span !== undefined ? field_item.span : 24) : 0\"\n :offset=\"field_item.offset\"\n :push=\"field_item.push\"\n :pull=\"field_item.pull\"\n >\n <field-render-2\n v-model:value=\"model[field_item.name]\"\n v-model:label=\"model[field_item.name + '.label']\"\n v-model:is_show_field=\"is_show_field\"\n :field=\"field_item\"\n :formModel=\"model\"\n :outModel=\"outModel\"\n :key=\"field_item.name\"\n :validateInfos=\"validateInfos\"\n :options=\"options[field_item.datasource ? field_item.datasource : field_item.name]\"\n :alwaysShowGroup=\"alwaysShowGroup\"\n :context=\"context\"\n :inner-model=\"innerModel\"\n :global-inner-model=\"globalInnerModel\"\n :nestValidate=\"nestValidate\"\n :base-key-path=\"baseKeyPath\"\n :worker-host-functions=\"workerHostFunctions\"\n @update_model=\"onUpdateModel\"\n @update_name2=\"onUpdateName2\"\n />\n </a-col>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, ref } from 'vue';\nimport FieldRender2 from 'liyu-pc-base/components/FormRender/FieldRender2.vue';\n\nexport default defineComponent({\n name: 'FieldCol',\n components: {\n FieldRender2,\n },\n props: {\n model: {\n type: Object,\n required: true,\n },\n outModel: {\n type: Object,\n default: () => {},\n },\n options: {\n type: Object,\n required: true,\n default: () => {},\n },\n validateInfos: {\n type: Object,\n default: () => {},\n },\n alwaysShowGroup: {\n type: Boolean,\n default: false,\n },\n field_item: {\n type: Object,\n default: () => {},\n },\n context: {\n type: Object,\n default: null,\n },\n innerModel: {\n default: null,\n },\n globalInnerModel: {\n default: null,\n },\n nestValidate: {\n type: Object as PropType<Record<string, any> | null>,\n default: null,\n },\n baseKeyPath: {\n type: Array,\n default: () => [],\n },\n workerHostFunctions: {\n type: Object,\n default: () => {},\n },\n },\n emits: ['update_model', 'update_name2'],\n setup(props, { emit }) {\n const is_show_field = ref(true);\n const onUpdateModel = params => {\n emit('update_model', params);\n };\n const onUpdateName2 = params => {\n emit('update_name2', params);\n };\n return { is_show_field, onUpdateModel, onUpdateName2 };\n },\n});\n</script>\n<style lang=\"less\" scoped>\n.cards {\n ::v-deep(.ant-card-head) {\n padding: 0 8px;\n min-height: 44px;\n background-color: rgba(0, 0, 0, 0.02);\n }\n}\n</style>\n","<template>\n <a-form\n autocomplete=\"off\"\n :model=\"model\"\n :rules=\"form.rules\"\n :layout=\"form.settings.layout\"\n scrollToFirstError\n class=\"cards\"\n :validateTrigger=\"false\"\n >\n <template\n v-for=\"(row, index) in form.dynamicFieldList\"\n :key=\"index\"\n >\n <a-card\n :body-style=\"{ padding: '10px 10px 0' }\"\n style=\"margin-bottom: 5px\"\n >\n <template\n v-if=\"row.group_name && (form.dynamicFieldList.length > 1 || alwaysShowGroup)\"\n #title\n >\n {{ row.group_name }}\n </template>\n <template #extra>\n <div\n class=\"group-custom-btn-list\"\n v-if=\"row.custom_btn_list && row.custom_btn_list.length > 0\"\n >\n <template v-for=\"btn in row.custom_btn_list\">\n <debug-code\n :action_code_id=\"btn.action_code_id\"\n v-model:code=\"btn.code\"\n >\n <a-button\n v-if=\"!lockStructure || btn.show_on_modify\"\n size=\"small\"\n :type=\"btn.type\"\n :danger=\"btn.danger\"\n @click=\"handleCustomBtnClick(btn)\"\n >\n {{ btn.label }}\n </a-button>\n </debug-code>\n </template>\n </div>\n </template>\n <a-row\n :gutter=\"5\"\n type=\"flex\"\n >\n <template v-if=\"getColFieldList(row?.children).length > 0\">\n <a-col\n v-for=\"col in getColFieldList(row?.children)\"\n :key=\"col[0]\"\n :xl=\"24 / getColFieldList(row?.children).length\"\n :lg=\"24\"\n :md=\"24\"\n :sm=\"24\"\n :xs=\"24\"\n >\n <field-col\n v-for=\"(field_item, i) in row?.children.slice(col[0], col[1])\"\n :key=\"i\"\n :model=\"model\"\n :out-model=\"outModel\"\n :options=\"options\"\n :validate-infos=\"validateInfos\"\n :always-show-group=\"alwaysShowGroup\"\n :field_item=\"field_item\"\n :context=\"context\"\n :inner-model=\"_innerModel\"\n :global-inner-model=\"_globalInnerModel\"\n :nestValidate=\"nestValidate\"\n :base-key-path=\"baseKeyPath\"\n :worker-host-functions=\"workerHostFunctions\"\n @update_model=\"onUpdateModel\"\n @update_name2=\"onUpdateName2\"\n ></field-col>\n </a-col>\n </template>\n <field-col\n v-else\n v-for=\"(field_item, i) in row?.children\"\n :key=\"i\"\n :model=\"model\"\n :out-model=\"outModel\"\n :options=\"options\"\n :validate-infos=\"validateInfos\"\n :always-show-group=\"alwaysShowGroup\"\n :field_item=\"field_item\"\n :context=\"context\"\n :inner-model=\"_innerModel\"\n :global-inner-model=\"_globalInnerModel\"\n :nestValidate=\"nestValidate\"\n :base-key-path=\"baseKeyPath\"\n :worker-host-functions=\"workerHostFunctions\"\n @update_model=\"onUpdateModel\"\n @update_name2=\"onUpdateName2\"\n ></field-col>\n </a-row>\n </a-card>\n </template>\n </a-form>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, watch, reactive, PropType, provide, computed } from 'vue';\nimport FieldCol from './FieldCol.vue';\nimport { executeScriptInWorker } from 'liyu-pc-base/utils/function';\nimport { message } from 'ant-design-vue';\nimport debugCode from 'liyu-pc-base/components/FormRender/debugCode.vue';\n\nexport default defineComponent({\n name: 'FormRender3',\n components: {\n FieldCol,\n debugCode,\n },\n props: {\n model: {\n type: Object,\n required: true,\n },\n outModel: {\n type: Object,\n default: () => {},\n },\n form: {\n type: Object,\n required: true,\n },\n options: {\n type: Object,\n required: true,\n default: () => {},\n },\n validateInfos: {\n type: Object,\n default: () => {},\n },\n alwaysShowGroup: {\n type: Boolean,\n default: false,\n },\n context: {\n type: Object,\n default: null,\n },\n innerModel: {\n type: Object,\n default: null,\n },\n globalInnerModel: {\n default: null,\n },\n nestValidate: {\n type: Object as PropType<Record<string, any> | null>,\n default: null,\n },\n baseKeyPath: {\n type: Array,\n default: () => [],\n },\n workerHostFunctions: {\n type: Object,\n default: () => {},\n },\n // 修改模式传入 true:深层 FormTemplate/FormItem 隐藏系统按钮与行删除(provide 给子组件)\n lockStructure: {\n type: Boolean,\n default: false,\n },\n },\n emits: ['update_model'],\n setup(props, { emit }) {\n // 向深层子组件(FieldCol → FormTemplate/FormItem 等)提供 lockStructure,避免逐层透传\n provide('FORM_LOCK_STRUCTURE', computed(() => props.lockStructure));\n // 解决传入非响应式数据时,动态增加is_show_field无用正常相应问题\n if (props.form.watch) {\n for (let k in props.form.watch) {\n watch(\n () => props.model[k],\n () => {\n props.form.watch[k](props.model, props.form);\n },\n );\n }\n }\n const _globalInnerModel = props.globalInnerModel || reactive({});\n const _innerModel = props.innerModel || _globalInnerModel;\n\n // 支持 form.settings.col 分列(与 FormRender fields 模式一致):\n // settings.col 数组每项表示该列容纳的字段个数,如 [11, 11, 12] 表示三列,分别放 11/11/12 个字段\n // 返回每列的 [start, end) 区间;未配置 col 或 children 为空时返回 [](保持单列原逻辑)\n const getColFieldList = (children: any[]): Array<[number, number]> => {\n const col = props.form?.settings?.col;\n if (!col || col.length === 0 || !children || children.length === 0) {\n return [];\n }\n const list: Array<[number, number]> = [];\n let a = 0;\n col.forEach((item: number, i: number) => {\n a = a + item;\n if (i === 0) {\n list.push([0, a]);\n } else {\n list.push([a - item, a]);\n }\n });\n return list;\n };\n\n const validate = () => {\n return (props.form as any).validate();\n };\n const onUpdateModel = params => {\n emit('update_model', params);\n };\n const onUpdateName2 = params => {\n emit('update_model', params);\n };\n const handleCustomBtnClick = async btn => {\n if (btn.code) {\n let res;\n try {\n res = await executeScriptInWorker(\n btn.code,\n {\n context: props.context,\n formModel: props.model,\n keyPath: [...props.baseKeyPath, btn.group_name],\n },\n props.workerHostFunctions || {},\n );\n } catch (e) {\n message.error(e.message);\n return;\n }\n if (res) {\n Object.assign(props.model, res);\n }\n }\n };\n return {\n validate,\n onUpdateModel,\n onUpdateName2,\n _globalInnerModel,\n _innerModel,\n handleCustomBtnClick,\n getColFieldList,\n };\n },\n});\n</script>\n\n<style lang=\"less\" scoped>\n.cards {\n ::v-deep(.ant-card-head) {\n padding: 0 8px;\n min-height: 44px;\n background-color: rgba(0, 0, 0, 0.02);\n }\n}\n.group-custom-btn-list {\n display: inline-flex;\n gap: 5px;\n flex-wrap: wrap;\n margin-right: 2px;\n}\n</style>\n","<template>\n <a-form\n autocomplete=\"off\"\n :model=\"model\"\n :rules=\"form.rules\"\n :layout=\"form.settings.layout\"\n scrollToFirstError\n class=\"cards\"\n :validateTrigger=\"false\"\n >\n <template\n v-for=\"(row, index) in form.dynamicFieldList\"\n :key=\"index\"\n >\n <a-card\n :body-style=\"{ padding: '10px 10px 0' }\"\n style=\"margin-bottom: 5px\"\n >\n <template\n v-if=\"row.group_name && (form.dynamicFieldList.length > 1 || alwaysShowGroup)\"\n #title\n >\n {{ row.group_name }}\n </template>\n <template #extra>\n <div\n class=\"group-custom-btn-list\"\n v-if=\"row.custom_btn_list && row.custom_btn_list.length > 0\"\n >\n <template v-for=\"btn in row.custom_btn_list\">\n <debug-code\n :action_code_id=\"btn.action_code_id\"\n v-model:code=\"btn.code\"\n >\n <a-button\n v-if=\"!lockStructure || btn.show_on_modify\"\n size=\"small\"\n :type=\"btn.type\"\n :danger=\"btn.danger\"\n @click=\"handleCustomBtnClick(btn)\"\n >\n {{ btn.label }}\n </a-button>\n </debug-code>\n </template>\n </div>\n </template>\n <a-row\n :gutter=\"5\"\n type=\"flex\"\n >\n <template v-if=\"getColFieldList(row?.children).length > 0\">\n <a-col\n v-for=\"col in getColFieldList(row?.children)\"\n :key=\"col[0]\"\n :xl=\"24 / getColFieldList(row?.children).length\"\n :lg=\"24\"\n :md=\"24\"\n :sm=\"24\"\n :xs=\"24\"\n >\n <field-col\n v-for=\"(field_item, i) in row?.children.slice(col[0], col[1])\"\n :key=\"i\"\n :model=\"model\"\n :out-model=\"outModel\"\n :options=\"options\"\n :validate-infos=\"validateInfos\"\n :always-show-group=\"alwaysShowGroup\"\n :field_item=\"field_item\"\n :context=\"context\"\n :inner-model=\"_innerModel\"\n :global-inner-model=\"_globalInnerModel\"\n :nestValidate=\"nestValidate\"\n :base-key-path=\"baseKeyPath\"\n :worker-host-functions=\"workerHostFunctions\"\n @update_model=\"onUpdateModel\"\n @update_name2=\"onUpdateName2\"\n ></field-col>\n </a-col>\n </template>\n <field-col\n v-else\n v-for=\"(field_item, i) in row?.children\"\n :key=\"i\"\n :model=\"model\"\n :out-model=\"outModel\"\n :options=\"options\"\n :validate-infos=\"validateInfos\"\n :always-show-group=\"alwaysShowGroup\"\n :field_item=\"field_item\"\n :context=\"context\"\n :inner-model=\"_innerModel\"\n :global-inner-model=\"_globalInnerModel\"\n :nestValidate=\"nestValidate\"\n :base-key-path=\"baseKeyPath\"\n :worker-host-functions=\"workerHostFunctions\"\n @update_model=\"onUpdateModel\"\n @update_name2=\"onUpdateName2\"\n ></field-col>\n </a-row>\n </a-card>\n </template>\n </a-form>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, watch, reactive, PropType, provide, computed } from 'vue';\nimport FieldCol from './FieldCol.vue';\nimport { executeScriptInWorker } from 'liyu-pc-base/utils/function';\nimport { message } from 'ant-design-vue';\nimport debugCode from 'liyu-pc-base/components/FormRender/debugCode.vue';\n\nexport default defineComponent({\n name: 'FormRender3',\n components: {\n FieldCol,\n debugCode,\n },\n props: {\n model: {\n type: Object,\n required: true,\n },\n outModel: {\n type: Object,\n default: () => {},\n },\n form: {\n type: Object,\n required: true,\n },\n options: {\n type: Object,\n required: true,\n default: () => {},\n },\n validateInfos: {\n type: Object,\n default: () => {},\n },\n alwaysShowGroup: {\n type: Boolean,\n default: false,\n },\n context: {\n type: Object,\n default: null,\n },\n innerModel: {\n type: Object,\n default: null,\n },\n globalInnerModel: {\n default: null,\n },\n nestValidate: {\n type: Object as PropType<Record<string, any> | null>,\n default: null,\n },\n baseKeyPath: {\n type: Array,\n default: () => [],\n },\n workerHostFunctions: {\n type: Object,\n default: () => {},\n },\n // 修改模式传入 true:深层 FormTemplate/FormItem 隐藏系统按钮与行删除(provide 给子组件)\n lockStructure: {\n type: Boolean,\n default: false,\n },\n },\n emits: ['update_model'],\n setup(props, { emit }) {\n // 向深层子组件(FieldCol → FormTemplate/FormItem 等)提供 lockStructure,避免逐层透传\n provide('FORM_LOCK_STRUCTURE', computed(() => props.lockStructure));\n // 解决传入非响应式数据时,动态增加is_show_field无用正常相应问题\n if (props.form.watch) {\n for (let k in props.form.watch) {\n watch(\n () => props.model[k],\n () => {\n props.form.watch[k](props.model, props.form);\n },\n );\n }\n }\n const _globalInnerModel = props.globalInnerModel || reactive({});\n const _innerModel = props.innerModel || _globalInnerModel;\n\n // 支持 form.settings.col 分列(与 FormRender fields 模式一致):\n // settings.col 数组每项表示该列容纳的字段个数,如 [11, 11, 12] 表示三列,分别放 11/11/12 个字段\n // 返回每列的 [start, end) 区间;未配置 col 或 children 为空时返回 [](保持单列原逻辑)\n const getColFieldList = (children: any[]): Array<[number, number]> => {\n const col = props.form?.settings?.col;\n if (!col || col.length === 0 || !children || children.length === 0) {\n return [];\n }\n const list: Array<[number, number]> = [];\n let a = 0;\n col.forEach((item: number, i: number) => {\n a = a + item;\n if (i === 0) {\n list.push([0, a]);\n } else {\n list.push([a - item, a]);\n }\n });\n return list;\n };\n\n const validate = () => {\n return (props.form as any).validate();\n };\n const onUpdateModel = params => {\n emit('update_model', params);\n };\n const onUpdateName2 = params => {\n emit('update_model', params);\n };\n const handleCustomBtnClick = async btn => {\n if (btn.code) {\n let res;\n try {\n res = await executeScriptInWorker(\n btn.code,\n {\n context: props.context,\n formModel: props.model,\n keyPath: [...props.baseKeyPath, btn.group_name],\n },\n props.workerHostFunctions || {},\n );\n } catch (e) {\n message.error(e.message);\n return;\n }\n if (res) {\n Object.assign(props.model, res);\n }\n }\n };\n return {\n validate,\n onUpdateModel,\n onUpdateName2,\n _globalInnerModel,\n _innerModel,\n handleCustomBtnClick,\n getColFieldList,\n };\n },\n});\n</script>\n\n<style lang=\"less\" scoped>\n.cards {\n ::v-deep(.ant-card-head) {\n padding: 0 8px;\n min-height: 44px;\n background-color: rgba(0, 0, 0, 0.02);\n }\n}\n.group-custom-btn-list {\n display: inline-flex;\n gap: 5px;\n flex-wrap: wrap;\n margin-right: 2px;\n}\n</style>\n"],"mappings":";;;;;;;;AAiCA,IAAA,IAAe,EAAgB;CAC7B,MAAM;CACN,YAAY,EACV,cAAA,EACF;CACA,OAAO;EACL,OAAO;GACL,MAAM;GACN,UAAU;EACZ;EACA,UAAU;GACR,MAAM;GACN,eAAe,CAAC;EAClB;EACA,SAAS;GACP,MAAM;GACN,UAAU;GACV,eAAe,CAAC;EAClB;EACA,eAAe;GACb,MAAM;GACN,eAAe,CAAC;EAClB;EACA,iBAAiB;GACf,MAAM;GACN,SAAS;EACX;EACA,YAAY;GACV,MAAM;GACN,eAAe,CAAC;EAClB;EACA,SAAS;GACP,MAAM;GACN,SAAS;EACX;EACA,YAAY,EACV,SAAS,KACX;EACA,kBAAkB,EAChB,SAAS,KACX;EACA,cAAc;GACZ,MAAM;GACN,SAAS;EACX;EACA,aAAa;GACX,MAAM;GACN,eAAe,CAAC;EAClB;EACA,qBAAqB;GACnB,MAAM;GACN,eAAe,CAAC;EAClB;CACF;CACA,OAAO,CAAC,gBAAgB,cAAc;CACtC,MAAM,GAAO,EAAE,WAAQ;EAQrB,OAAO;GAAE,eAPa,EAAI,EAOjB;GAAe,gBANF,MAAU;IAC9B,EAAK,gBAAgB,CAAM;GAC7B;GAIuC,gBAHjB,MAAU;IAC9B,EAAK,gBAAgB,CAAM;GAC7B;EACqD;CACvD;AACF,CAAC;;;;;aCjGC,EA0BQ,GAAA;EAzBL,MAAM,EAAA,gBAAiB,EAAA,WAAW,SAAS,KAAA,IAA2B,KAAf,EAAA,WAAW,OAAI;EACtE,QAAQ,EAAA,WAAW;EACnB,MAAM,EAAA,WAAW;EACjB,MAAM,EAAA,WAAW;;EALtB,SAAA,QA0BM,EAAA,EAAA,GAnBF,EAmBE,GAAA;GAlBQ,OAAO,EAAA,MAAM,EAAA,WAAW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3B,KAAA;MAAA,KAAA,CAAA,CAAA,GAAA,IAAA;EAAA,GAAA"}
@@ -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-DSKuV-hn.js")), fe = () => {
324
+ }, de = m(() => import("./tableModal-DZE5wntG.js")), fe = () => {
325
325
  let e = [];
326
326
  k.value = "";
327
327
  let t = "checkbox";
@@ -1 +1 @@
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,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,EAAM,SAAS,GAAG,MAC3B,IAAM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c,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-CcL_vU1K.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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,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,7 +1,7 @@
1
1
  import { r as e } from "./rolldown-runtime-DY7j01NX.js";
2
2
  import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { t as n } from "./lodash-CMVwnWxD.js";
4
- import { t as r } from "./FieldRender2-_MtcDkI5.js";
4
+ import { t as r } from "./FieldRender2-CvxGe238.js";
5
5
  import { Fragment as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, openBlock as d, renderList as f, renderSlot as p, resolveComponent as m, toDisplayString as h, vShow as g, watch as _, withCtx as v, withDirectives as y } from "vue";
6
6
  import b from "moment";
7
7
  import { CloseOutlined as x, LeftOutlined as S, RightOutlined as C } from "@ant-design/icons-vue";