liyu-pc-base 1.0.405 → 1.0.409
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FieldRender-BqD17c1E.js +2 -0
- package/dist/{FieldRender-UzUAL9We.js → FieldRender-D31r6qkp.js} +1 -1
- package/dist/{FieldRender-UzUAL9We.js.map → FieldRender-D31r6qkp.js.map} +1 -1
- package/dist/{FieldRender2-BMUnkV6x.js → FieldRender2-CnS4qeov.js} +4 -4
- package/dist/{FieldRender2-BMUnkV6x.js.map → FieldRender2-CnS4qeov.js.map} +1 -1
- package/dist/{FormRender3-BLiNQoGq.js → FormRender3-CCdB88mS.js} +2 -2
- package/dist/{FormRender3-BLiNQoGq.js.map → FormRender3-CCdB88mS.js.map} +1 -1
- package/dist/FormRender3-DU5jfVFh.js +2 -0
- package/dist/{ImportExcelModal-D8gn1GDH.js → ImportExcelModal-C4tdTnYK.js} +2 -2
- package/dist/ImportExcelModal-C4tdTnYK.js.map +1 -0
- package/dist/{RemoteSelectPro-BJ_SEx8h.js → RemoteSelectPro-BuaxspIh.js} +1 -1
- package/dist/{RemoteSelectPro-BJ_SEx8h.js.map → RemoteSelectPro-BuaxspIh.js.map} +1 -1
- package/dist/SearchRender-R7GmoRMs.js +2 -0
- package/dist/{SearchRender-Cx7P_fBW.js → SearchRender-vGnupD_1.js} +1 -1
- package/dist/{SearchRender-Cx7P_fBW.js.map → SearchRender-vGnupD_1.js.map} +1 -1
- package/dist/{TinymceEditor-CVjG74fa.js → TinymceEditor-CiIRNR2c.js} +1 -1
- package/dist/{TinymceEditor-CVjG74fa.js.map → TinymceEditor-CiIRNR2c.js.map} +1 -1
- package/dist/components/index.js +7 -7
- package/dist/index.js +1 -1
- package/dist/{tableModal-ClBkGDKM.js → tableModal-Cf2V1-zL.js} +1 -1
- package/dist/{tableModal-ClBkGDKM.js.map → tableModal-Cf2V1-zL.js.map} +1 -1
- package/dist/tablePro-BaiTKi_V.js +2 -0
- package/dist/{tablePro-CSdiA8RU.js → tablePro-D4PxgHEP.js} +2 -2
- package/dist/{tablePro-CSdiA8RU.js.map → tablePro-D4PxgHEP.js.map} +1 -1
- package/dist/utils/hooks/useFetchData.js +1 -1
- package/dist/utils/hooks/useFetchData.js.map +1 -1
- package/package.json +1 -1
- package/dist/FieldRender-6VqJZEl_.js +0 -2
- package/dist/FormRender3-CER9Ee8J.js +0 -2
- package/dist/ImportExcelModal-D8gn1GDH.js.map +0 -1
- package/dist/SearchRender-CdaFKuAy.js +0 -2
- package/dist/tablePro-BIBr4QUu.js +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./_plugin-vue_export-helper-D3hKq4w_.js";
|
|
2
2
|
import { s as t } from "./function-H7GI-Ydw.js";
|
|
3
|
-
import { d as n } from "./TinymceEditor-
|
|
4
|
-
import { t as r } from "./FieldRender2-
|
|
3
|
+
import { d as n } from "./TinymceEditor-CiIRNR2c.js";
|
|
4
|
+
import { t as r } from "./FieldRender2-CnS4qeov.js";
|
|
5
5
|
import { Fragment as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createSlots as c, createTextVNode as l, createVNode as u, defineComponent as d, openBlock as f, reactive as p, ref as m, renderList as h, resolveComponent as g, toDisplayString as _, watch as v, withCtx as y } from "vue";
|
|
6
6
|
import { message as b } from "ant-design-vue";
|
|
7
7
|
//#region src/components/FormRender/FieldCol.vue?vue&type=script&lang.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormRender3-BLiNQoGq.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 type: Object,\n default: null,\n },\n globalInnerModel: {\n type: Object,\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 type: Object,\n default: null,\n },\n globalInnerModel: {\n type: Object,\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 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 <field-col\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 } 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 type: Object,\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'],\n setup(props, { emit }) {\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 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 };\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 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 <field-col\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 } 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 type: Object,\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'],\n setup(props, { emit }) {\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 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 };\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,GACD;CACD,OAAO;EACL,OAAO;GACL,MAAM;GACN,UAAU;GACX;EACD,UAAU;GACR,MAAM;GACN,eAAe;GAChB;EACD,SAAS;GACP,MAAM;GACN,UAAU;GACV,eAAe;GAChB;EACD,eAAe;GACb,MAAM;GACN,eAAe;GAChB;EACD,iBAAiB;GACf,MAAM;GACN,SAAS;GACV;EACD,YAAY;GACV,MAAM;GACN,eAAe;GAChB;EACD,SAAS;GACP,MAAM;GACN,SAAS;GACV;EACD,YAAY;GACV,MAAM;GACN,SAAS;GACV;EACD,kBAAkB;GAChB,MAAM;GACN,SAAS;GACV;EACD,cAAc;GACZ,MAAM;GACN,SAAS;GACV;EACD,aAAa;GACX,MAAM;GACN,eAAe,EAAE;GAClB;EACD,qBAAqB;GACnB,MAAM;GACN,eAAe;GAChB;EACF;CACD,OAAO,CAAC,gBAAgB,eAAe;CACvC,MAAM,GAAO,EAAE,WAAQ;AAQrB,SAAO;GAAE,eAPa,EAAI,GAAK;GAOP,gBANF,MAAU;AAC9B,MAAK,gBAAgB,EAAO;;GAKS,gBAHjB,MAAU;AAC9B,MAAK,gBAAgB,EAAO;;GAEwB;;CAEzD,CAAC;;;;;aCnGA,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,GAA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
|
|
1
|
+
{"version":3,"file":"FormRender3-CCdB88mS.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 type: Object,\n default: null,\n },\n globalInnerModel: {\n type: Object,\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 type: Object,\n default: null,\n },\n globalInnerModel: {\n type: Object,\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 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 <field-col\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 } 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 type: Object,\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'],\n setup(props, { emit }) {\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 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 };\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 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 <field-col\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 } 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 type: Object,\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'],\n setup(props, { emit }) {\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 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 };\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,GACD;CACD,OAAO;EACL,OAAO;GACL,MAAM;GACN,UAAU;GACX;EACD,UAAU;GACR,MAAM;GACN,eAAe;GAChB;EACD,SAAS;GACP,MAAM;GACN,UAAU;GACV,eAAe;GAChB;EACD,eAAe;GACb,MAAM;GACN,eAAe;GAChB;EACD,iBAAiB;GACf,MAAM;GACN,SAAS;GACV;EACD,YAAY;GACV,MAAM;GACN,eAAe;GAChB;EACD,SAAS;GACP,MAAM;GACN,SAAS;GACV;EACD,YAAY;GACV,MAAM;GACN,SAAS;GACV;EACD,kBAAkB;GAChB,MAAM;GACN,SAAS;GACV;EACD,cAAc;GACZ,MAAM;GACN,SAAS;GACV;EACD,aAAa;GACX,MAAM;GACN,eAAe,EAAE;GAClB;EACD,qBAAqB;GACnB,MAAM;GACN,eAAe;GAChB;EACF;CACD,OAAO,CAAC,gBAAgB,eAAe;CACvC,MAAM,GAAO,EAAE,WAAQ;AAQrB,SAAO;GAAE,eAPa,EAAI,GAAK;GAOP,gB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BAAuB,EAAA;KACvB,gBAAc,EAAA;KACd,gBAAc,EAAA;;;;;;;;;;;;;;;;;IAlE3B,GAAA;;GAAA,GAAA;MAmBgB,EAAI,eAAe,EAAA,KAAK,iBAAiB,SAAM,KAAQ,EAAA,mBAAA;GAnBvE,MAoBW;GApBX,IAAA,QAsB8B,CAtB9B,EAAA,EAsBa,EAAI,WAAU,EAAA,EAAA,CAAA,CAAA;GAtB3B,KAAA;MAAA,KAAA,EAAA,CAAA,EAAA,KAAA;EAAA,GAAA"}
|
|
@@ -114,9 +114,9 @@ var h = o({
|
|
|
114
114
|
"volume",
|
|
115
115
|
"weight"
|
|
116
116
|
].includes(e.type)) try {
|
|
117
|
-
l = Number(l);
|
|
117
|
+
l = Number(l), (!Number.isFinite(l) || Number.isNaN(l)) && (f = `值 "${i}" 不是数字`);
|
|
118
118
|
} catch {
|
|
119
|
-
f = `值 "${
|
|
119
|
+
f = `值 "${i}" 不是数字`;
|
|
120
120
|
}
|
|
121
121
|
r[o] = {
|
|
122
122
|
value: l === void 0 ? null : l,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImportExcelModal-C4tdTnYK.js","names":[],"sources":["../src/components/form-modal/ImportExcelModal/ImportExcelModal.vue","../src/components/form-modal/ImportExcelModal/ImportExcelModal.vue"],"sourcesContent":["<template>\n <a-modal\n :title=\"title\"\n width=\"800px\"\n :open=\"true\"\n :maskClosable=\"false\"\n :confirmLoading=\"loading\"\n centered\n :footer=\"null\"\n @cancel=\"\n () => {\n // resetFields();\n $emit('cancel');\n }\n \"\n >\n <a-upload\n :multiple=\"false\"\n v-model:file-list=\"fileList\"\n @remove=\"handleRemove\"\n :customRequest=\"customRequestFun\"\n >\n <a-button\n type=\"primary\"\n v-if=\"fileList.length == 0\"\n >\n <plus-outlined />\n 选择文件\n </a-button>\n </a-upload>\n </a-modal>\n</template>\n\n<script lang=\"ts\">\nimport { PlusOutlined } from '@ant-design/icons-vue';\nimport { defineComponent, ref } from 'vue';\nimport { message } from 'ant-design-vue';\nimport { read, utils } from 'xlsx';\nimport { getApiData } from 'liyu-pc-base/api/api-model';\n\ninterface FileItem {\n uid: string;\n fid?: number;\n name?: string;\n status?: string;\n response?: Response;\n percent?: number;\n url: string;\n preview?: string;\n originFileObj?: any;\n}\n\nexport default defineComponent({\n name: 'ImportExcelModal',\n components: { PlusOutlined },\n props: {\n title: {\n type: String,\n required: true,\n },\n configList: {\n type: Array,\n required: true,\n default: () => [],\n },\n },\n emits: ['ok', 'cancel'],\n setup(props, { emit }) {\n const fileList = ref<FileItem[]>([]);\n const loading = ref(false);\n\n const customRequest = async (options: any) => {\n const { file, onSuccess, onError } = options;\n loading.value = true;\n const reader = new FileReader();\n reader.onload = async (e: any) => {\n try {\n const data = new Uint8Array(e.target.result);\n const workbook = read(data, { type: 'array' });\n const firstSheetName = workbook.SheetNames[0];\n const worksheet = workbook.Sheets[firstSheetName];\n\n // 获取表头以确定列索引\n const sheetData: any[][] = utils.sheet_to_json(worksheet, { header: 1 });\n const headers = (sheetData[0] || []).map(h => (h ? String(h).trim() : ''));\n const jsonData: any[] = utils.sheet_to_json(worksheet);\n\n console.log('Excel Headers:', headers);\n console.log('Excel JSON Data:', jsonData);\n\n const apiCache: any = {};\n const remoteSelectCols = props.configList.filter(\n (col: any) => col.type === 'remoteselectpro' && col.postUrl,\n );\n if (remoteSelectCols.length > 0) {\n for (const col of remoteSelectCols as any[]) {\n const targetLabel = col.label ? String(col.label).trim() : '';\n const fieldLabels = jsonData\n .map((row: any) => {\n const rowKeys = Object.keys(row);\n const key = rowKeys.find(k => k.trim() === targetLabel);\n return key ? String(row[key]).trim() : null;\n })\n .filter(v => v !== null && v !== '');\n const uniqueLabels = [...new Set(fieldLabels)];\n\n if (uniqueLabels.length > 0) {\n apiCache[col.name] = {};\n const lKey = col.labelKey || 'name';\n const vKey = col.valueKey || 'id';\n\n await Promise.all(\n uniqueLabels.map(async label => {\n const getLabel = (opt: any) => {\n if (\n col.labelKeyList &&\n col.labelKeyList.length > 0 &&\n col.labelKeyType !== 1\n ) {\n return col.labelKeyList\n .map(k => (opt[k] !== undefined && opt[k] !== null ? String(opt[k]) : ''))\n .join(col.labelSpace || '-');\n }\n return opt[lKey] !== undefined && opt[lKey] !== null ? String(opt[lKey]) : '';\n };\n if (col.options && col.options.find(opt => getLabel(opt) === label)) {\n return;\n }\n\n try {\n const conditions = [];\n if (col.labelKeyList && col.labelKeyList.length > 0 && col.labelSpace) {\n const lableValue = label.split(col.labelSpace);\n if (lableValue.length === col.labelKeyList.length) {\n const conditionItem = [];\n col.labelKeyList.forEach((key: any, index: any) => {\n conditionItem.push({\n field_name: key,\n operator: 'eq',\n value: [lableValue[index]],\n format: 'choices',\n class_name: 'str',\n });\n });\n conditions.push(conditionItem);\n }\n } else {\n conditions.push([\n {\n field_name: lKey,\n operator: 'eq',\n value: [label],\n format: 'choices',\n class_name: 'str',\n },\n ]);\n }\n const params: any = {\n current: 1,\n pageSize: 50,\n is_pagination: true,\n conditions: conditions,\n };\n const res = await getApiData(params, col.postUrl, false, {\n skip_error: true,\n });\n if (res && res.data && res.data.length > 0) {\n const matched = res.data.find(opt => getLabel(opt) === label);\n if (matched) {\n apiCache[col.name][label] = matched;\n }\n }\n } catch (err) {\n console.error('Fetch remote select error', err);\n }\n }),\n );\n }\n }\n }\n\n if (jsonData.length === 0) {\n message.info('Excel文件中未检测到数据行(除表头外),请检查文件');\n loading.value = false;\n if (onSuccess) onSuccess();\n return;\n }\n\n let matchCount = 0;\n const result = jsonData.map((row: any, rowIndex: number) => {\n const mappedRow: any = {};\n // 处理 row 的 key,也进行 trim\n const rowKeys = Object.keys(row);\n const trimmedRow: any = {};\n rowKeys.forEach(k => {\n trimmedRow[k.trim()] = row[k];\n });\n\n props.configList.forEach((col: any) => {\n const targetLabel = col.label ? String(col.label).trim() : '';\n let excelValue = trimmedRow[targetLabel];\n if (excelValue !== undefined && excelValue !== null) {\n excelValue = String(excelValue).trim();\n }\n const name = col.name;\n\n if (excelValue !== undefined && excelValue !== null && excelValue !== '')\n matchCount++;\n\n // 查找列索引用于 excel_position\n const colIndex = headers.indexOf(targetLabel);\n const excel_position =\n colIndex !== -1 ? `${utils.encode_col(colIndex)}${rowIndex + 2}` : '';\n\n let value = excelValue;\n let raw_value = excelValue;\n let error = null;\n\n const selectTypes = [\n 'select',\n 'radio',\n 'checkbox',\n 'treeselect',\n 'cascader',\n 'remoteselectpro',\n ];\n if (selectTypes.includes(col.type)) {\n const vKey = col.valueKey || (col.type === 'remoteselectpro' ? 'id' : 'value');\n const lKey = col.labelKey || (col.type === 'remoteselectpro' ? 'name' : 'label');\n const getLabel = (opt: any) => {\n if (col.labelKeyList && col.labelKeyList.length > 0 && col.labelKeyType !== 1) {\n return col.labelKeyList\n .map(k => (opt[k] !== undefined && opt[k] !== null ? String(opt[k]) : ''))\n .join(col.labelSpace || '-');\n }\n return opt[lKey] !== undefined && opt[lKey] !== null ? String(opt[lKey]) : '';\n };\n let option = null;\n if (col.options && col.options.length > 0) {\n option = col.options.find((opt: any) => getLabel(opt) === excelValue);\n }\n if (!option && col.type === 'remoteselectpro' && apiCache[col.name]) {\n option = apiCache[col.name][excelValue];\n }\n\n if (option) {\n value = option[vKey];\n raw_value = getLabel(option);\n } else if (excelValue !== undefined && excelValue !== null && excelValue !== '') {\n let valueOption = null;\n if (col.options && col.options.length > 0) {\n valueOption = col.options.find((opt: any) => String(opt[vKey]) === excelValue);\n }\n if (valueOption) {\n value = valueOption[vKey];\n raw_value = getLabel(valueOption);\n } else {\n error = `选项 \"${excelValue}\" 不存在`;\n }\n }\n }\n if (['number', 'money', 'volume', 'weight'].includes(col.type)) {\n try {\n value = Number(value);\n if (!Number.isFinite(value) || Number.isNaN(value)) {\n error = `值 \"${excelValue}\" 不是数字`;\n }\n } catch (e) {\n error = `值 \"${excelValue}\" 不是数字`;\n }\n }\n mappedRow[name] = {\n value: value === undefined ? null : value,\n raw_value: raw_value === undefined ? null : raw_value,\n excel_position: excel_position,\n error: error,\n };\n });\n return mappedRow;\n });\n\n if (matchCount === 0) {\n message.warning('Excel表头与配置不匹配,请检查表头名称是否正确');\n if (onError) onError();\n return;\n }\n\n if (result.length > 0) {\n emit('ok', result);\n if (onSuccess) onSuccess();\n } else {\n message.info('未识别到Excel文件中数据,请确认文件是否正确');\n if (onError) onError();\n }\n } catch (err) {\n console.error(err);\n message.error('解析Excel失败');\n try {\n if (onError) onError();\n } catch (e) {}\n } finally {\n loading.value = false;\n }\n };\n reader.onerror = () => {\n loading.value = false;\n message.error('文件读取失败');\n try {\n if (onError) onError();\n } catch (e) {}\n };\n reader.readAsArrayBuffer(file);\n };\n\n const customRequestFun = (options: any) => {\n customRequest(options);\n return false;\n };\n\n const handleRemove = (file: any) => {\n const index = fileList.value.indexOf(file);\n fileList.value.splice(index, 1);\n };\n\n return {\n props,\n loading,\n handleRemove,\n customRequest,\n customRequestFun,\n fileList,\n };\n },\n});\n</script>\n","<template>\n <a-modal\n :title=\"title\"\n width=\"800px\"\n :open=\"true\"\n :maskClosable=\"false\"\n :confirmLoading=\"loading\"\n centered\n :footer=\"null\"\n @cancel=\"\n () => {\n // resetFields();\n $emit('cancel');\n }\n \"\n >\n <a-upload\n :multiple=\"false\"\n v-model:file-list=\"fileList\"\n @remove=\"handleRemove\"\n :customRequest=\"customRequestFun\"\n >\n <a-button\n type=\"primary\"\n v-if=\"fileList.length == 0\"\n >\n <plus-outlined />\n 选择文件\n </a-button>\n </a-upload>\n </a-modal>\n</template>\n\n<script lang=\"ts\">\nimport { PlusOutlined } from '@ant-design/icons-vue';\nimport { defineComponent, ref } from 'vue';\nimport { message } from 'ant-design-vue';\nimport { read, utils } from 'xlsx';\nimport { getApiData } from 'liyu-pc-base/api/api-model';\n\ninterface FileItem {\n uid: string;\n fid?: number;\n name?: string;\n status?: string;\n response?: Response;\n percent?: number;\n url: string;\n preview?: string;\n originFileObj?: any;\n}\n\nexport default defineComponent({\n name: 'ImportExcelModal',\n components: { PlusOutlined },\n props: {\n title: {\n type: String,\n required: true,\n },\n configList: {\n type: Array,\n required: true,\n default: () => [],\n },\n },\n emits: ['ok', 'cancel'],\n setup(props, { emit }) {\n const fileList = ref<FileItem[]>([]);\n const loading = ref(false);\n\n const customRequest = async (options: any) => {\n const { file, onSuccess, onError } = options;\n loading.value = true;\n const reader = new FileReader();\n reader.onload = async (e: any) => {\n try {\n const data = new Uint8Array(e.target.result);\n const workbook = read(data, { type: 'array' });\n const firstSheetName = workbook.SheetNames[0];\n const worksheet = workbook.Sheets[firstSheetName];\n\n // 获取表头以确定列索引\n const sheetData: any[][] = utils.sheet_to_json(worksheet, { header: 1 });\n const headers = (sheetData[0] || []).map(h => (h ? String(h).trim() : ''));\n const jsonData: any[] = utils.sheet_to_json(worksheet);\n\n console.log('Excel Headers:', headers);\n console.log('Excel JSON Data:', jsonData);\n\n const apiCache: any = {};\n const remoteSelectCols = props.configList.filter(\n (col: any) => col.type === 'remoteselectpro' && col.postUrl,\n );\n if (remoteSelectCols.length > 0) {\n for (const col of remoteSelectCols as any[]) {\n const targetLabel = col.label ? String(col.label).trim() : '';\n const fieldLabels = jsonData\n .map((row: any) => {\n const rowKeys = Object.keys(row);\n const key = rowKeys.find(k => k.trim() === targetLabel);\n return key ? String(row[key]).trim() : null;\n })\n .filter(v => v !== null && v !== '');\n const uniqueLabels = [...new Set(fieldLabels)];\n\n if (uniqueLabels.length > 0) {\n apiCache[col.name] = {};\n const lKey = col.labelKey || 'name';\n const vKey = col.valueKey || 'id';\n\n await Promise.all(\n uniqueLabels.map(async label => {\n const getLabel = (opt: any) => {\n if (\n col.labelKeyList &&\n col.labelKeyList.length > 0 &&\n col.labelKeyType !== 1\n ) {\n return col.labelKeyList\n .map(k => (opt[k] !== undefined && opt[k] !== null ? String(opt[k]) : ''))\n .join(col.labelSpace || '-');\n }\n return opt[lKey] !== undefined && opt[lKey] !== null ? String(opt[lKey]) : '';\n };\n if (col.options && col.options.find(opt => getLabel(opt) === label)) {\n return;\n }\n\n try {\n const conditions = [];\n if (col.labelKeyList && col.labelKeyList.length > 0 && col.labelSpace) {\n const lableValue = label.split(col.labelSpace);\n if (lableValue.length === col.labelKeyList.length) {\n const conditionItem = [];\n col.labelKeyList.forEach((key: any, index: any) => {\n conditionItem.push({\n field_name: key,\n operator: 'eq',\n value: [lableValue[index]],\n format: 'choices',\n class_name: 'str',\n });\n });\n conditions.push(conditionItem);\n }\n } else {\n conditions.push([\n {\n field_name: lKey,\n operator: 'eq',\n value: [label],\n format: 'choices',\n class_name: 'str',\n },\n ]);\n }\n const params: any = {\n current: 1,\n pageSize: 50,\n is_pagination: true,\n conditions: conditions,\n };\n const res = await getApiData(params, col.postUrl, false, {\n skip_error: true,\n });\n if (res && res.data && res.data.length > 0) {\n const matched = res.data.find(opt => getLabel(opt) === label);\n if (matched) {\n apiCache[col.name][label] = matched;\n }\n }\n } catch (err) {\n console.error('Fetch remote select error', err);\n }\n }),\n );\n }\n }\n }\n\n if (jsonData.length === 0) {\n message.info('Excel文件中未检测到数据行(除表头外),请检查文件');\n loading.value = false;\n if (onSuccess) onSuccess();\n return;\n }\n\n let matchCount = 0;\n const result = jsonData.map((row: any, rowIndex: number) => {\n const mappedRow: any = {};\n // 处理 row 的 key,也进行 trim\n const rowKeys = Object.keys(row);\n const trimmedRow: any = {};\n rowKeys.forEach(k => {\n trimmedRow[k.trim()] = row[k];\n });\n\n props.configList.forEach((col: any) => {\n const targetLabel = col.label ? String(col.label).trim() : '';\n let excelValue = trimmedRow[targetLabel];\n if (excelValue !== undefined && excelValue !== null) {\n excelValue = String(excelValue).trim();\n }\n const name = col.name;\n\n if (excelValue !== undefined && excelValue !== null && excelValue !== '')\n matchCount++;\n\n // 查找列索引用于 excel_position\n const colIndex = headers.indexOf(targetLabel);\n const excel_position =\n colIndex !== -1 ? `${utils.encode_col(colIndex)}${rowIndex + 2}` : '';\n\n let value = excelValue;\n let raw_value = excelValue;\n let error = null;\n\n const selectTypes = [\n 'select',\n 'radio',\n 'checkbox',\n 'treeselect',\n 'cascader',\n 'remoteselectpro',\n ];\n if (selectTypes.includes(col.type)) {\n const vKey = col.valueKey || (col.type === 'remoteselectpro' ? 'id' : 'value');\n const lKey = col.labelKey || (col.type === 'remoteselectpro' ? 'name' : 'label');\n const getLabel = (opt: any) => {\n if (col.labelKeyList && col.labelKeyList.length > 0 && col.labelKeyType !== 1) {\n return col.labelKeyList\n .map(k => (opt[k] !== undefined && opt[k] !== null ? String(opt[k]) : ''))\n .join(col.labelSpace || '-');\n }\n return opt[lKey] !== undefined && opt[lKey] !== null ? String(opt[lKey]) : '';\n };\n let option = null;\n if (col.options && col.options.length > 0) {\n option = col.options.find((opt: any) => getLabel(opt) === excelValue);\n }\n if (!option && col.type === 'remoteselectpro' && apiCache[col.name]) {\n option = apiCache[col.name][excelValue];\n }\n\n if (option) {\n value = option[vKey];\n raw_value = getLabel(option);\n } else if (excelValue !== undefined && excelValue !== null && excelValue !== '') {\n let valueOption = null;\n if (col.options && col.options.length > 0) {\n valueOption = col.options.find((opt: any) => String(opt[vKey]) === excelValue);\n }\n if (valueOption) {\n value = valueOption[vKey];\n raw_value = getLabel(valueOption);\n } else {\n error = `选项 \"${excelValue}\" 不存在`;\n }\n }\n }\n if (['number', 'money', 'volume', 'weight'].includes(col.type)) {\n try {\n value = Number(value);\n if (!Number.isFinite(value) || Number.isNaN(value)) {\n error = `值 \"${excelValue}\" 不是数字`;\n }\n } catch (e) {\n error = `值 \"${excelValue}\" 不是数字`;\n }\n }\n mappedRow[name] = {\n value: value === undefined ? null : value,\n raw_value: raw_value === undefined ? null : raw_value,\n excel_position: excel_position,\n error: error,\n };\n });\n return mappedRow;\n });\n\n if (matchCount === 0) {\n message.warning('Excel表头与配置不匹配,请检查表头名称是否正确');\n if (onError) onError();\n return;\n }\n\n if (result.length > 0) {\n emit('ok', result);\n if (onSuccess) onSuccess();\n } else {\n message.info('未识别到Excel文件中数据,请确认文件是否正确');\n if (onError) onError();\n }\n } catch (err) {\n console.error(err);\n message.error('解析Excel失败');\n try {\n if (onError) onError();\n } catch (e) {}\n } finally {\n loading.value = false;\n }\n };\n reader.onerror = () => {\n loading.value = false;\n message.error('文件读取失败');\n try {\n if (onError) onError();\n } catch (e) {}\n };\n reader.readAsArrayBuffer(file);\n };\n\n const customRequestFun = (options: any) => {\n customRequest(options);\n return false;\n };\n\n const handleRemove = (file: any) => {\n const index = fileList.value.indexOf(file);\n fileList.value.splice(index, 1);\n };\n\n return {\n props,\n loading,\n handleRemove,\n customRequest,\n customRequestFun,\n fileList,\n };\n },\n});\n</script>\n"],"mappings":";;;;;;;AAoDA,IAAA,IAAe,EAAgB;CAC7B,MAAM;CACN,YAAY,EAAE,iBAAc;CAC5B,OAAO;EACL,OAAO;GACL,MAAM;GACN,UAAU;GACX;EACD,YAAY;GACV,MAAM;GACN,UAAU;GACV,eAAe,EAAE;GAClB;EACF;CACD,OAAO,CAAC,MAAM,SAAS;CACvB,MAAM,GAAO,EAAE,WAAQ;EACrB,IAAM,IAAW,EAAgB,EAAE,CAAC,EAC9B,IAAU,EAAI,GAAM,EAEpB,IAAgB,OAAO,MAAiB;GAC5C,IAAM,EAAE,SAAM,cAAW,eAAY;AACrC,KAAQ,QAAQ;GAChB,IAAM,IAAS,IAAI,YAAY;AA6O/B,GA5OA,EAAO,SAAS,OAAO,MAAW;AAChC,QAAI;KAEF,IAAM,IAAW,EADJ,IAAI,WAAW,EAAE,OAAO,OAAO,EAChB,EAAE,MAAM,SAAS,CAAC,EACxC,IAAiB,EAAS,WAAW,IACrC,IAAY,EAAS,OAAO,IAI5B,KADqB,EAAM,cAAc,GAAW,EAAE,QAAQ,GAAG,CAAC,CAC7C,MAAM,EAAE,EAAE,KAAI,MAAM,IAAI,OAAO,EAAE,CAAC,MAAK,GAAI,GAAI,EACpE,IAAkB,EAAM,cAAc,EAAU;AAGtD,KADA,QAAQ,IAAI,kBAAkB,EAAQ,EACtC,QAAQ,IAAI,oBAAoB,EAAS;KAEzC,IAAM,IAAgB,EAAE,EAClB,IAAm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Bb,SAAA,QA0ByB,CAAjB,EAAiB,EAAA,EAAA,AAAA,EAAA,OA1BzB,EA0ByB,SAEnB,CAAA,CAAA;IA5BN,GAAA;SAAA,EAAA,IAAA,GAAA,CAAA,CAAA;GAAA,GAAA;;;;;;EAAA,GAAA"}
|
|
@@ -718,7 +718,7 @@ var re = /* @__PURE__ */ a(Y, [["render", ne]]), ie = /* @__PURE__ */ e(v(), 1),
|
|
|
718
718
|
}, { deep: !0 });
|
|
719
719
|
let K = (e) => {
|
|
720
720
|
u.value = e, G();
|
|
721
|
-
}, q = D(() => import("./tableModal-
|
|
721
|
+
}, q = D(() => import("./tableModal-Cf2V1-zL.js"));
|
|
722
722
|
return {
|
|
723
723
|
props: e,
|
|
724
724
|
modalRef: i,
|