liyu-pc-base 1.0.407 → 1.0.413
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-BtVHqH5T.js +2 -0
- package/dist/{FieldRender-D31r6qkp.js → FieldRender-DskvKT0O.js} +1 -1
- package/dist/{FieldRender-D31r6qkp.js.map → FieldRender-DskvKT0O.js.map} +1 -1
- package/dist/{FieldRender2-CnS4qeov.js → FieldRender2-Bi-2umbv.js} +4 -4
- package/dist/{FieldRender2-CnS4qeov.js.map → FieldRender2-Bi-2umbv.js.map} +1 -1
- package/dist/FormRender3-BIe94gk3.js +2 -0
- package/dist/{FormRender3-CCdB88mS.js → FormRender3-DnRt6BH0.js} +2 -2
- package/dist/{FormRender3-CCdB88mS.js.map → FormRender3-DnRt6BH0.js.map} +1 -1
- package/dist/{ImportExcelModal-C4tdTnYK.js → ImportExcelModal-RqLC4zwa.js} +118 -18
- package/dist/ImportExcelModal-RqLC4zwa.js.map +1 -0
- package/dist/{RemoteSelectPro-BuaxspIh.js → RemoteSelectPro-DXCAqoi5.js} +1 -1
- package/dist/{RemoteSelectPro-BuaxspIh.js.map → RemoteSelectPro-DXCAqoi5.js.map} +1 -1
- package/dist/{SearchRender-vGnupD_1.js → SearchRender-PFQ2bLV3.js} +1 -1
- package/dist/{SearchRender-vGnupD_1.js.map → SearchRender-PFQ2bLV3.js.map} +1 -1
- package/dist/SearchRender-vHcwEsFw.js +2 -0
- package/dist/{TinymceEditor-CiIRNR2c.js → TinymceEditor-Z6uOTa2S.js} +1 -1
- package/dist/{TinymceEditor-CiIRNR2c.js.map → TinymceEditor-Z6uOTa2S.js.map} +1 -1
- package/dist/components/index.js +7 -7
- package/dist/index.js +1 -1
- package/dist/{tableModal-Cf2V1-zL.js → tableModal-DZd3vWHO.js} +1 -1
- package/dist/{tableModal-Cf2V1-zL.js.map → tableModal-DZd3vWHO.js.map} +1 -1
- package/dist/{tablePro-D4PxgHEP.js → tablePro-D1_7IFQF.js} +2 -2
- package/dist/{tablePro-D4PxgHEP.js.map → tablePro-D1_7IFQF.js.map} +1 -1
- package/dist/tablePro-zFwGfk2A.js +2 -0
- 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-BqD17c1E.js +0 -2
- package/dist/FormRender3-DU5jfVFh.js +0 -2
- package/dist/ImportExcelModal-C4tdTnYK.js.map +0 -1
- package/dist/SearchRender-R7GmoRMs.js +0 -2
- package/dist/tablePro-BaiTKi_V.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-Z6uOTa2S.js";
|
|
4
|
+
import { t as r } from "./FieldRender2-Bi-2umbv.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-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,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,G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"}
|
|
1
|
+
{"version":3,"file":"FormRender3-DnRt6BH0.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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f,yBAAuB,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"}
|
|
@@ -2,12 +2,104 @@ import { t as e } from "./_plugin-vue_export-helper-D3hKq4w_.js";
|
|
|
2
2
|
import { getApiData as t } from "./api/api-model.js";
|
|
3
3
|
import { createBlock as n, createCommentVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, openBlock as s, ref as c, resolveComponent as l, withCtx as u } from "vue";
|
|
4
4
|
import { message as d } from "ant-design-vue";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
5
|
+
import f from "dayjs";
|
|
6
|
+
import { PlusOutlined as p } from "@ant-design/icons-vue";
|
|
7
|
+
import { read as m, utils as h } from "xlsx";
|
|
8
|
+
//#region src/utils/dateUtil.ts
|
|
9
|
+
function g(e, t = "datepicker", n) {
|
|
10
|
+
if (e == null || e === "") return {
|
|
11
|
+
value: "",
|
|
12
|
+
isValid: !0
|
|
13
|
+
};
|
|
14
|
+
let r = n || (t === "datepicker" ? "YYYY-MM-DD" : "HH:mm:ss");
|
|
15
|
+
try {
|
|
16
|
+
let n = null;
|
|
17
|
+
if (typeof e == "number") {
|
|
18
|
+
if (e > 0 && e < 1) {
|
|
19
|
+
let t = Math.round(e * 24 * 60 * 60), r = Math.floor(t / 3600), i = Math.floor(t % 3600 / 60), a = t % 60;
|
|
20
|
+
n = f().hour(r).minute(i).second(a);
|
|
21
|
+
} else if (e >= 1) {
|
|
22
|
+
let t = e - Math.floor(e);
|
|
23
|
+
if (t > 0) {
|
|
24
|
+
let r = f("1900-01-01"), i = Math.floor(e), a;
|
|
25
|
+
a = i <= 60 ? r.add(i - 1, "day") : r.add(i - 2, "day");
|
|
26
|
+
let o = Math.round(t * 24 * 60 * 60), s = Math.floor(o / 3600), c = Math.floor(o % 3600 / 60), l = o % 60;
|
|
27
|
+
n = a.hour(s).minute(c).second(l);
|
|
28
|
+
} else {
|
|
29
|
+
let t = f("1900-01-01"), r = Math.floor(e);
|
|
30
|
+
n = r >= 1 && r <= 6e4 ? r <= 60 ? t.add(r - 1, "day") : t.add(r - 2, "day") : null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (!n && typeof e == "string") {
|
|
35
|
+
let t = e.trim();
|
|
36
|
+
if (/^\d+\.\d+$/.test(t)) {
|
|
37
|
+
let e = parseFloat(t);
|
|
38
|
+
if (e >= 0 && e < 1) {
|
|
39
|
+
let t = Math.round(e * 24 * 60 * 60), r = Math.floor(t / 3600), i = Math.floor(t % 3600 / 60), a = t % 60;
|
|
40
|
+
n = f().hour(r).minute(i).second(a);
|
|
41
|
+
} else if (e >= 1) {
|
|
42
|
+
let t = f("1900-01-01"), r = Math.floor(e), i = e - r, a;
|
|
43
|
+
a = r <= 60 ? t.add(r - 1, "day") : t.add(r - 2, "day");
|
|
44
|
+
let o = Math.round(i * 24 * 60 * 60), s = Math.floor(o / 3600), c = Math.floor(o % 3600 / 60), l = o % 60;
|
|
45
|
+
n = a.hour(s).minute(c).second(l);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (!n && /^\d+$/.test(t)) {
|
|
49
|
+
let e = f("1900-01-01"), r = parseInt(t, 10);
|
|
50
|
+
r >= 1 && r <= 6e4 && (n = r <= 60 ? e.add(r - 1, "day") : e.add(r - 2, "day"));
|
|
51
|
+
}
|
|
52
|
+
if (!n) {
|
|
53
|
+
let e = [
|
|
54
|
+
"YYYY-MM-DD HH:mm:ss",
|
|
55
|
+
"YYYY-MM-DD HH:mm",
|
|
56
|
+
"YYYY-MM-DD",
|
|
57
|
+
"YYYY/MM/DD HH:mm:ss",
|
|
58
|
+
"YYYY/MM/DD HH:mm",
|
|
59
|
+
"YYYY/MM/DD",
|
|
60
|
+
"HH:mm:ss",
|
|
61
|
+
"HH:mm"
|
|
62
|
+
], r = t, i = t.match(/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})(.*)$/);
|
|
63
|
+
if (i) {
|
|
64
|
+
let [, e, t, n, a] = i;
|
|
65
|
+
r = `${e}-${t.padStart(2, "0")}-${n.padStart(2, "0")}${a}`;
|
|
66
|
+
}
|
|
67
|
+
for (let t of e) {
|
|
68
|
+
let e = f(r, t, !0);
|
|
69
|
+
if (e.isValid()) {
|
|
70
|
+
n = e;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (!n) {
|
|
75
|
+
let e = f(t);
|
|
76
|
+
e.isValid() && (n = e);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (!n && f.isDayjs(e) && (n = e), !n || !n.isValid()) return {
|
|
81
|
+
value: String(e),
|
|
82
|
+
isValid: !1,
|
|
83
|
+
error: `值 "${e}" 无法解析为${t === "datepicker" ? "日期" : "时间"}`
|
|
84
|
+
};
|
|
85
|
+
let i;
|
|
86
|
+
return i = n.format(r), {
|
|
87
|
+
value: i,
|
|
88
|
+
isValid: !0
|
|
89
|
+
};
|
|
90
|
+
} catch {
|
|
91
|
+
return {
|
|
92
|
+
value: String(e),
|
|
93
|
+
isValid: !1,
|
|
94
|
+
error: `值 "${e}" 解析失败`
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
7
99
|
//#region src/components/form-modal/ImportExcelModal/ImportExcelModal.vue?vue&type=script&lang.ts
|
|
8
|
-
var
|
|
100
|
+
var _ = o({
|
|
9
101
|
name: "ImportExcelModal",
|
|
10
|
-
components: { PlusOutlined:
|
|
102
|
+
components: { PlusOutlined: p },
|
|
11
103
|
props: {
|
|
12
104
|
title: {
|
|
13
105
|
type: String,
|
|
@@ -27,16 +119,16 @@ var h = o({
|
|
|
27
119
|
let c = new FileReader();
|
|
28
120
|
c.onload = async (r) => {
|
|
29
121
|
try {
|
|
30
|
-
let a =
|
|
122
|
+
let a = m(new Uint8Array(r.target.result), { type: "array" }), c = a.SheetNames[0], l = a.Sheets[c], u = (h.sheet_to_json(l, { header: 1 })[0] || []).map((e) => e ? String(e).trim() : ""), f = h.sheet_to_json(l);
|
|
31
123
|
console.log("Excel Headers:", u), console.log("Excel JSON Data:", f);
|
|
32
|
-
let
|
|
33
|
-
if (
|
|
124
|
+
let p = {}, _ = e.configList.filter((e) => e.type === "remoteselectpro" && e.postUrl);
|
|
125
|
+
if (_.length > 0) for (let e of _) {
|
|
34
126
|
let n = e.label ? String(e.label).trim() : "", r = f.map((e) => {
|
|
35
127
|
let t = Object.keys(e).find((e) => e.trim() === n);
|
|
36
128
|
return t ? String(e[t]).trim() : null;
|
|
37
129
|
}).filter((e) => e !== null && e !== ""), i = [...new Set(r)];
|
|
38
130
|
if (i.length > 0) {
|
|
39
|
-
|
|
131
|
+
p[e.name] = {};
|
|
40
132
|
let n = e.labelKey || "name";
|
|
41
133
|
e.valueKey, await Promise.all(i.map(async (r) => {
|
|
42
134
|
let i = (t) => e.labelKeyList && e.labelKeyList.length > 0 && e.labelKeyType !== 1 ? e.labelKeyList.map((e) => t[e] !== void 0 && t[e] !== null ? String(t[e]) : "").join(e.labelSpace || "-") : t[n] !== void 0 && t[n] !== null ? String(t[n]) : "";
|
|
@@ -71,7 +163,7 @@ var h = o({
|
|
|
71
163
|
}, e.postUrl, !1, { skip_error: !0 });
|
|
72
164
|
if (o && o.data && o.data.length > 0) {
|
|
73
165
|
let t = o.data.find((e) => i(e) === r);
|
|
74
|
-
t && (
|
|
166
|
+
t && (p[e.name][r] = t);
|
|
75
167
|
}
|
|
76
168
|
} catch (e) {
|
|
77
169
|
console.error("Fetch remote select error", e);
|
|
@@ -83,7 +175,7 @@ var h = o({
|
|
|
83
175
|
d.info("Excel文件中未检测到数据行(除表头外),请检查文件"), i.value = !1, o && o();
|
|
84
176
|
return;
|
|
85
177
|
}
|
|
86
|
-
let
|
|
178
|
+
let v = 0, y = f.map((t, n) => {
|
|
87
179
|
let r = {}, i = Object.keys(t), a = {};
|
|
88
180
|
return i.forEach((e) => {
|
|
89
181
|
a[e.trim()] = t[e];
|
|
@@ -91,8 +183,8 @@ var h = o({
|
|
|
91
183
|
let t = e.label ? String(e.label).trim() : "", i = a[t];
|
|
92
184
|
i != null && (i = String(i).trim());
|
|
93
185
|
let o = e.name;
|
|
94
|
-
i != null && i !== "" &&
|
|
95
|
-
let s = u.indexOf(t), c = s === -1 ? "" : `${
|
|
186
|
+
i != null && i !== "" && v++;
|
|
187
|
+
let s = u.indexOf(t), c = s === -1 ? "" : `${h.encode_col(s)}${n + 2}`, l = i, d = i, f = null;
|
|
96
188
|
if ([
|
|
97
189
|
"select",
|
|
98
190
|
"radio",
|
|
@@ -102,7 +194,7 @@ var h = o({
|
|
|
102
194
|
"remoteselectpro"
|
|
103
195
|
].includes(e.type)) {
|
|
104
196
|
let t = e.valueKey || (e.type === "remoteselectpro" ? "id" : "value"), n = e.labelKey || (e.type === "remoteselectpro" ? "name" : "label"), r = (t) => e.labelKeyList && e.labelKeyList.length > 0 && e.labelKeyType !== 1 ? e.labelKeyList.map((e) => t[e] !== void 0 && t[e] !== null ? String(t[e]) : "").join(e.labelSpace || "-") : t[n] !== void 0 && t[n] !== null ? String(t[n]) : "", a = null;
|
|
105
|
-
if (e.options && e.options.length > 0 && (a = e.options.find((e) => r(e) === i)), !a && e.type === "remoteselectpro" &&
|
|
197
|
+
if (e.options && e.options.length > 0 && (a = e.options.find((e) => r(e) === i)), !a && e.type === "remoteselectpro" && p[e.name] && (a = p[e.name][i]), a) l = a[t], d = r(a);
|
|
106
198
|
else if (i != null && i !== "") {
|
|
107
199
|
let n = null;
|
|
108
200
|
e.options && e.options.length > 0 && (n = e.options.find((e) => String(e[t]) === i)), n ? (l = n[t], d = r(n)) : f = `选项 "${i}" 不存在`;
|
|
@@ -118,6 +210,14 @@ var h = o({
|
|
|
118
210
|
} catch {
|
|
119
211
|
f = `值 "${i}" 不是数字`;
|
|
120
212
|
}
|
|
213
|
+
if (["timepicker"].includes(e.type)) {
|
|
214
|
+
let t = g(i, "timepicker", e.format);
|
|
215
|
+
t.isValid ? l = t.value : f = t.error || `值 "${i}" 不是时间`;
|
|
216
|
+
}
|
|
217
|
+
if (["datepicker"].includes(e.type)) {
|
|
218
|
+
let t = g(i, "datepicker", e.format);
|
|
219
|
+
t.isValid ? l = t.value : f = t.error || `值 "${i}" 不是日期`;
|
|
220
|
+
}
|
|
121
221
|
r[o] = {
|
|
122
222
|
value: l === void 0 ? null : l,
|
|
123
223
|
raw_value: d === void 0 ? null : d,
|
|
@@ -126,11 +226,11 @@ var h = o({
|
|
|
126
226
|
};
|
|
127
227
|
}), r;
|
|
128
228
|
});
|
|
129
|
-
if (
|
|
229
|
+
if (v === 0) {
|
|
130
230
|
d.warning("Excel表头与配置不匹配,请检查表头名称是否正确"), s && s();
|
|
131
231
|
return;
|
|
132
232
|
}
|
|
133
|
-
|
|
233
|
+
y.length > 0 ? (n("ok", y), o && o()) : (d.info("未识别到Excel文件中数据,请确认文件是否正确"), s && s());
|
|
134
234
|
} catch (e) {
|
|
135
235
|
console.error(e), d.error("解析Excel失败");
|
|
136
236
|
try {
|
|
@@ -161,7 +261,7 @@ var h = o({
|
|
|
161
261
|
});
|
|
162
262
|
//#endregion
|
|
163
263
|
//#region src/components/form-modal/ImportExcelModal/ImportExcelModal.vue
|
|
164
|
-
function
|
|
264
|
+
function v(e, t, o, c, d, f) {
|
|
165
265
|
let p = l("plus-outlined"), m = l("a-button"), h = l("a-upload"), g = l("a-modal");
|
|
166
266
|
return s(), n(g, {
|
|
167
267
|
title: e.title,
|
|
@@ -198,6 +298,6 @@ function g(e, t, o, c, d, f) {
|
|
|
198
298
|
_: 1
|
|
199
299
|
}, 8, ["title", "confirmLoading"]);
|
|
200
300
|
}
|
|
201
|
-
var
|
|
301
|
+
var y = /* @__PURE__ */ e(_, [["render", v]]);
|
|
202
302
|
//#endregion
|
|
203
|
-
export {
|
|
303
|
+
export { y as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImportExcelModal-RqLC4zwa.js","names":[],"sources":["../src/utils/dateUtil.ts","../src/components/form-modal/ImportExcelModal/ImportExcelModal.vue","../src/components/form-modal/ImportExcelModal/ImportExcelModal.vue"],"sourcesContent":["import dayjs, { Dayjs } from 'dayjs';\n\n/**\n * 解析Excel日期/时间值\n * 支持的格式:\n * 1. Excel数字格式(1-5位数字,表示从1900-01-01开始的天数)\n * 2. Excel时间小数格式(0.508472222222222,表示一天中的比例)\n * 3. Excel日期时间混合格式(42716.5084722222,整数部分是日期,小数部分是时间)\n * 4. 字符串日期格式:2026-01-01, 2026-1-1, 2026/01/01, 2026/1/1, 等\n * 5. 字符串时间格式:14:30:00, 14:30, 2026-01-01 14:30:00, 等\n * 6. dayjs对象\n * \n * @param value - 需要解析的值\n * @param type - 字段类型:'datepicker' 或 'timepicker'\n * @param format - 输出格式,默认日期'YYYY-MM-DD',时间'HH:mm:ss'\n * @returns { value: string, isValid: boolean, error?: string }\n */\nexport function parseExcelDate(\n value: any,\n type: 'datepicker' | 'timepicker' = 'datepicker',\n format?: string,\n): { value: string; isValid: boolean; error?: string } {\n if (value === undefined || value === null || value === '') {\n return { value: '', isValid: true };\n }\n\n const defaultFormat = type === 'datepicker' ? 'YYYY-MM-DD' : 'HH:mm:ss';\n const outputFormat = format || defaultFormat;\n\n try {\n let parsedDate: Dayjs | null = null;\n\n // 情况1:纯数字格式(Excel序列号或时间小数)- 仅处理真正的数字类型\n // 字符串格式的纯数字会放在字符串解析流程中\n if (typeof value === 'number') {\n // 检查是否为小数(时间格式或日期+时间)\n if (value > 0 && value < 1) {\n // Excel时间小数格式:0.508472222222222 表示一天中的时间比例\n const totalSeconds = Math.round(value * 24 * 60 * 60);\n const hours = Math.floor(totalSeconds / 3600);\n const minutes = Math.floor((totalSeconds % 3600) / 60);\n const seconds = totalSeconds % 60;\n \n // 创建一个基准日期,然后设置时间\n parsedDate = dayjs()\n .hour(hours)\n .minute(minutes)\n .second(seconds);\n } else if (value >= 1) {\n // 检查是否包含小数部分(日期+时间混合)\n const decimalPart = value - Math.floor(value);\n \n if (decimalPart > 0) {\n // 日期+时间混合格式:42716.5084722222\n const excelEpoch = dayjs('1900-01-01');\n const datePart = Math.floor(value);\n \n // 处理Excel的1900年闰年bug\n let dateResult: Dayjs;\n if (datePart <= 60) {\n dateResult = excelEpoch.add(datePart - 1, 'day');\n } else {\n dateResult = excelEpoch.add(datePart - 2, 'day');\n }\n \n // 处理时间部分\n const totalSeconds = Math.round(decimalPart * 24 * 60 * 60);\n const hours = Math.floor(totalSeconds / 3600);\n const minutes = Math.floor((totalSeconds % 3600) / 60);\n const seconds = totalSeconds % 60;\n \n parsedDate = dateResult\n .hour(hours)\n .minute(minutes)\n .second(seconds);\n } else {\n // 纯日期序列号:1表示1900-01-01\n const excelEpoch = dayjs('1900-01-01');\n const daysSinceEpoch = Math.floor(value);\n \n // 有效的Excel日期范围检查(1-60000)\n if (daysSinceEpoch >= 1 && daysSinceEpoch <= 60000) {\n // 处理Excel的1900年闰年bug\n if (daysSinceEpoch <= 60) {\n // 1-60号之间直接处理(包括虚拟的2月29日)\n parsedDate = excelEpoch.add(daysSinceEpoch - 1, 'day');\n } else {\n // 61及以后减1来跳过虚拟的2月29日\n parsedDate = excelEpoch.add(daysSinceEpoch - 2, 'day');\n }\n } else {\n // 如果数字不在有效范围内,作为普通字符串再尝试解析\n parsedDate = null;\n }\n }\n }\n }\n \n // 情况2:字符串格式(包括字符串格式的纯数字和小数)\n if (!parsedDate && typeof value === 'string') {\n const trimmedValue = value.trim();\n\n // 检查是否为小数字符串(时间或日期+时间格式)\n // 例如:\\\"0.508472222222222\\\" 表示时间,\\\"42716.5084722222\\\" 表示日期+时间\n if (/^\\d+\\.\\d+$/.test(trimmedValue)) {\n const decimalValue = parseFloat(trimmedValue);\n \n if (decimalValue >= 0 && decimalValue < 1) {\n // 纯时间小数格式:0-0.99999 对应 00:00:00-23:59:59\n const totalSeconds = Math.round(decimalValue * 24 * 60 * 60);\n const hours = Math.floor(totalSeconds / 3600);\n const minutes = Math.floor((totalSeconds % 3600) / 60);\n const seconds = totalSeconds % 60;\n \n // 创建一个基准日期,然后设置时间\n parsedDate = dayjs()\n .hour(hours)\n .minute(minutes)\n .second(seconds);\n } else if (decimalValue >= 1) {\n // 日期+时间混合格式:42716.5084722222 = 42716天 + 0.5084722222天的时间\n const excelEpoch = dayjs('1900-01-01');\n const datePart = Math.floor(decimalValue);\n const timePart = decimalValue - datePart;\n \n // 处理Excel的1900年闰年bug\n let dateResult: Dayjs;\n if (datePart <= 60) {\n dateResult = excelEpoch.add(datePart - 1, 'day');\n } else {\n dateResult = excelEpoch.add(datePart - 2, 'day');\n }\n \n // 处理时间部分\n const totalSeconds = Math.round(timePart * 24 * 60 * 60);\n const hours = Math.floor(totalSeconds / 3600);\n const minutes = Math.floor((totalSeconds % 3600) / 60);\n const seconds = totalSeconds % 60;\n \n parsedDate = dateResult\n .hour(hours)\n .minute(minutes)\n .second(seconds);\n }\n }\n\n // 检查是否为纯数字字符串,如果是则作为Excel序列号处理\n if (!parsedDate && /^\\d+$/.test(trimmedValue)) {\n const excelEpoch = dayjs('1900-01-01');\n const daysSinceEpoch = parseInt(trimmedValue, 10);\n \n // 有效的Excel日期范围检查(1-60000)\n if (daysSinceEpoch >= 1 && daysSinceEpoch <= 60000) {\n // 处理Excel的1900年闰年bug\n if (daysSinceEpoch <= 60) {\n parsedDate = excelEpoch.add(daysSinceEpoch - 1, 'day');\n } else {\n parsedDate = excelEpoch.add(daysSinceEpoch - 2, 'day');\n }\n }\n }\n\n // 如果不是纯数字或解析失败,尝试作为日期字符串解析\n if (!parsedDate) {\n // 尝试多种日期格式\n const formats = [\n 'YYYY-MM-DD HH:mm:ss', // 2026-01-01 14:30:00\n 'YYYY-MM-DD HH:mm', // 2026-01-01 14:30\n 'YYYY-MM-DD', // 2026-01-01\n 'YYYY/MM/DD HH:mm:ss', // 2026/01/01 14:30:00\n 'YYYY/MM/DD HH:mm', // 2026/01/01 14:30\n 'YYYY/MM/DD', // 2026/01/01\n 'HH:mm:ss', // 14:30:00\n 'HH:mm', // 14:30\n ];\n\n // 特殊处理格式如 \"2026-1-1\" 或 \"2026/1/1\"\n let normalizedValue = trimmedValue;\n \n // 检测是否为 YYYY-M-D 或 YYYY/M/D 格式并转换为 YYYY-MM-DD\n const singleDigitDateMatch = trimmedValue.match(/^(\\d{4})[-/](\\d{1,2})[-/](\\d{1,2})(.*)$/);\n if (singleDigitDateMatch) {\n const [, year, month, day, rest] = singleDigitDateMatch;\n const paddedMonth = month.padStart(2, '0');\n const paddedDay = day.padStart(2, '0');\n normalizedValue = `${year}-${paddedMonth}-${paddedDay}${rest}`;\n }\n\n // 尝试解析\n for (const fmt of formats) {\n const parsed = dayjs(normalizedValue, fmt, true);\n if (parsed.isValid()) {\n parsedDate = parsed;\n break;\n }\n }\n\n // 如果仍未解析,尝试dayjs的智能解析(作为最后手段)\n if (!parsedDate) {\n const fallbackParsed = dayjs(trimmedValue);\n if (fallbackParsed.isValid()) {\n parsedDate = fallbackParsed;\n }\n }\n }\n }\n \n // 情况3:dayjs对象\n if (!parsedDate && dayjs.isDayjs(value)) {\n parsedDate = value;\n }\n\n // 验证解析结果\n if (!parsedDate || !parsedDate.isValid()) {\n return {\n value: String(value),\n isValid: false,\n error: `值 \"${value}\" 无法解析为${type === 'datepicker' ? '日期' : '时间'}`,\n };\n }\n\n // 根据类型格式化输出\n let formattedValue: string;\n if (type === 'datepicker') {\n formattedValue = parsedDate.format(outputFormat);\n } else {\n // timepicker:仅提取时间部分\n formattedValue = parsedDate.format(outputFormat);\n }\n\n return {\n value: formattedValue,\n isValid: true,\n };\n } catch (err) {\n return {\n value: String(value),\n isValid: false,\n error: `值 \"${value}\" 解析失败`,\n };\n }\n}\n\n/**\n * 批量解析日期数组\n */\nexport function parseExcelDateArray(\n values: any[],\n type: 'datepicker' | 'timepicker' = 'datepicker',\n format?: string,\n) {\n return values.map(v => parseExcelDate(v, type, format));\n}\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';\nimport dayjs from 'dayjs';\nimport { parseExcelDate } from 'liyu-pc-base/utils/dateUtil';\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 if (['timepicker'].includes(col.type)) {\n const result = parseExcelDate(excelValue, 'timepicker', col.format);\n if (result.isValid) {\n value = result.value;\n } else {\n error = result.error || `值 \"${excelValue}\" 不是时间`;\n }\n }\n if (['datepicker'].includes(col.type)) {\n const result = parseExcelDate(excelValue, 'datepicker', col.format);\n if (result.isValid) {\n value = result.value;\n } else {\n error = result.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';\nimport dayjs from 'dayjs';\nimport { parseExcelDate } from 'liyu-pc-base/utils/dateUtil';\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 if (['timepicker'].includes(col.type)) {\n const result = parseExcelDate(excelValue, 'timepicker', col.format);\n if (result.isValid) {\n value = result.value;\n } else {\n error = result.error || `值 \"${excelValue}\" 不是时间`;\n }\n }\n if (['datepicker'].includes(col.type)) {\n const result = parseExcelDate(excelValue, 'datepicker', col.format);\n if (result.isValid) {\n value = result.value;\n } else {\n error = result.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":";;;;;;;;AAiBA,SAAgB,EACd,GACA,IAAoC,cACpC,GACqD;AACrD,KAAI,KAAiC,QAAQ,MAAU,GACrD,QAAO;EAAE,OAAO;EAAI,SAAS;EAAM;CAIrC,IAAM,IAAe,MADC,MAAS,eAAe,eAAe;AAG7D,KAAI;EACF,IAAI,IAA2B;AAI/B,MAAI,OAAO,KAAU;OAEf,IAAQ,KAAK,IAAQ,GAAG;IAE1B,IAAM,IAAe,KAAK,MAAM,IAAQ,KAAK,KAAK,GAAG,EAC/C,IAAQ,KAAK,MAAM,IAAe,KAAK,EACvC,IAAU,KAAK,MAAO,IAAe,OAAQ,GAAG,EAChD,IAAU,IAAe;AAG/B,QAAa,GAAO,CACjB,KAAK,EAAM,CACX,OAAO,EAAQ,CACf,OAAO,EAAQ;cACT,KAAS,GAAG;IAErB,IAAM,IAAc,IAAQ,KAAK,MAAM,EAAM;AAE7C,QAAI,IAAc,GAAG;KAEnB,IAAM,IAAa,EAAM,aAAa,EAChC,IAAW,KAAK,MAAM,EAAM,EAG9B;AACJ,KAGE,IAHE,KAAY,KACD,EAAW,IAAI,IAAW,GAAG,MAAM,GAEnC,EAAW,IAAI,IAAW,GAAG,MAAM;KAIlD,IAAM,IAAe,KAAK,MAAM,IAAc,KAAK,KAAK,GAAG,EACrD,IAAQ,KAAK,MAAM,IAAe,KAAK,EACvC,IAAU,KAAK,MAAO,IAAe,OAAQ,GAAG,EAChD,IAAU,I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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-DZd3vWHO.js"));
|
|
722
722
|
return {
|
|
723
723
|
props: e,
|
|
724
724
|
modalRef: i,
|