@gct-paas/excel 0.1.16 → 0.1.18
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/{BaseComponent-DJNL1tGs.js → BaseComponent-xTm5lvAr.js} +1 -0
- package/dist/{VueVideoPlayer-Db7qcsRE.js → VueVideoPlayer-D3u-ZHom.js} +2 -2
- package/dist/{agg-design-BjqRVeg1.js → agg-design-D7CkIPCA.js} +1 -1
- package/dist/{agg-props-CrdosdGr.js → agg-props-DNNO9ucx.js} +1 -1
- package/dist/{agg-style-CfZoOE-b.js → agg-style-v_94dzX8.js} +1 -1
- package/dist/{align-editor-BaNT0jhx.js → align-editor-COpCDpFf.js} +1 -1
- package/dist/{attach-fields-editor-CThobu8X.js → attach-fields-editor-o_7W-2sr.js} +2 -2
- package/dist/{barcode-design-CHjIeaiJ.js → barcode-design-CvsGGAio.js} +2 -2
- package/dist/base/index.es.js +347 -53
- package/dist/{base-font-editor-BiSPxwVH.js → base-font-editor-BmC423aB.js} +2 -2
- package/dist/{boolean-design-BYAdX-h5.js → boolean-design-Hc8Es5l1.js} +2 -2
- package/dist/{boolean-props-jKvjhdlG.js → boolean-props-CGamLGXA.js} +3 -3
- package/dist/{boolean-style-RsMRzVBL.js → boolean-style-m-WuSO6S.js} +4 -4
- package/dist/{cell-upload-JxFLM1bV.js → cell-upload-CiXVE0Ii.js} +2 -2
- package/dist/date-range-editor-BZkhUU-x.js +470 -0
- package/dist/{date-time-design-Du8pmDo-.js → date-time-design-B_oFOcft.js} +1 -1
- package/dist/date-time-props-hGnSGQKc.js +105 -0
- package/dist/{date-time-style-DSEnmxAE.js → date-time-style-CGKG8i3K.js} +1 -1
- package/dist/{decimal-design-C2GbzP9k.js → decimal-design-B5Artgk6.js} +1 -1
- package/dist/{decimal-display-mode-CagizhJW.js → decimal-display-mode-C4XUezoP.js} +2 -2
- package/dist/{decimal-props-CGLqWy8I.js → decimal-props-Q37uOcWl.js} +4 -4
- package/dist/{decimal-style-6j22QKYO.js → decimal-style-C2CnGPVG.js} +1 -1
- package/dist/{default-value-editor.vue_vue_type_script_setup_true_name_default-value-editor_lang-C5K6qhB-.js → default-value-editor.vue_vue_type_script_setup_true_name_default-value-editor_lang-DTnbLBVW.js} +109 -39
- package/dist/{diagonal-design-Cq3oxdHe.js → diagonal-design-CyUvkcvp.js} +2 -2
- package/dist/{document-quick-fillin.vue_vue_type_style_index_0_scoped_a18386ab_lang-Bbu6cwRC.js → document-quick-fillin.vue_vue_type_style_index_0_scoped_a18386ab_lang-DKTGEH4Q.js} +2295 -1388
- package/dist/{document-sub-table-action-rz6gyez5.js → document-sub-table-action-Cy6Rd8OS.js} +384 -193
- package/dist/{double-design-CyXEqcV7.js → double-design-D_ipWcRm.js} +1 -1
- package/dist/{double-props-DaJoio1W.js → double-props-D4FGbfe2.js} +4 -4
- package/dist/{double-style-B4lIth-J.js → double-style-BbD_6_Os.js} +1 -1
- package/dist/{edit.utils-CXmmCnxE-DW8ClKe9.js → edit.utils-CXmmCnxE-BK4QnSP-.js} +1 -1
- package/dist/{enum-design-DSx09tOO.js → enum-design-lOufLU6Z.js} +2 -2
- package/dist/{enum-props-CJNuQLJ_.js → enum-props-brKRP5Uz.js} +4 -4
- package/dist/{enum-style-5N5xmgRJ.js → enum-style-BQQHkDUD.js} +2 -2
- package/dist/excel.css +943 -440
- package/dist/{exceljs.min-D9gV8q6H.js → exceljs.min-CUwGyNAf.js} +2 -2
- package/dist/{expression-design-BJDbafot.js → expression-design-BPEci3dg.js} +1 -1
- package/dist/{expression-props-BpHbrsle.js → expression-props-Cvg-9V-B.js} +1 -1
- package/dist/{expression-style-qPh81w7Q.js → expression-style-Dv3Hl8lm.js} +1 -1
- package/dist/{file-design-B7si04Bi.js → file-design-BIzi6cpq.js} +1 -1
- package/dist/{file-props-DTtOnHQy.js → file-props-oV2U7bpO.js} +2 -2
- package/dist/{file-style-C6KW_szu.js → file-style-CZrxokgP.js} +1 -1
- package/dist/{font-editor-DgGgvmB2.js → font-editor-B41KgpWJ.js} +3 -3
- package/dist/{form-annotation-controller-KcMm2QYA.js → form-annotation-controller-CdNmJKv-.js} +87 -31
- package/dist/{image-design-B92Xkcf-.js → image-design-C3FEtW6i.js} +2 -2
- package/dist/{image-design-CCfpT4Rp.js → image-design-DMfBfSkD.js} +2 -2
- package/dist/{image-props-DZgfzMta.js → image-props-DPibJk7n.js} +1 -1
- package/dist/{image-style-DX6Q_gF4.js → image-style-DLudd5Vt.js} +1 -1
- package/dist/{index-Bnbl3VER.js → index-B1CG-75q.js} +2 -2
- package/dist/{index-tbaOl7Nd.js → index-B1r6-Uxf.js} +1 -1
- package/dist/{index-bvhV6lsn.js → index-B7lz2J6V.js} +14 -7
- package/dist/{index-DRd2oRK1.js → index-B8ey1U_N.js} +2 -2
- package/dist/{index-BXMOCfWv.js → index-B8wKNUsK.js} +2 -2
- package/dist/{index-DzIKEtWw.js → index-BOis3jsA.js} +1 -1
- package/dist/{index-BYl8cK0A.js → index-BZ1jj7Nu.js} +1 -1
- package/dist/{index-DsASTvC2.js → index-BgZkpQKh.js} +1 -1
- package/dist/{index-Bg-x1hF6.js → index-BiNVmD5v.js} +2 -2
- package/dist/{index-BEBKoAOg.js → index-Bppcm2iQ.js} +2 -2
- package/dist/{index-Dsj3FuVs.js → index-Bvjplnz_.js} +2 -2
- package/dist/{index-DgHRTRH5.js → index-C5bYd42n.js} +2 -2
- package/dist/{index-BzhFcvnJ.js → index-CUIGN7Rt.js} +2 -2
- package/dist/{index-B2iip4UC.js → index-Cjz0GLDq.js} +2 -2
- package/dist/{index-DOFSbVSN.js → index-CkYbgRrH.js} +1 -1
- package/dist/{index-BB5uSbo3.js → index-Cn_c3-eW.js} +1 -1
- package/dist/{index-Be7TFwwX.js → index-Cp7mC3Qt.js} +4 -2
- package/dist/{index-DFgGQBCZ.js → index-CtiiIgjs.js} +2 -2
- package/dist/{index-D6diRqWG.js → index-D0YZX_c7.js} +2 -2
- package/dist/{index-DRKvAxuA.js → index-D7fFpHaN.js} +1 -1
- package/dist/{index-C8qPy1oW.js → index-DAqYc474.js} +2 -2
- package/dist/{index-p-Q3DQmv.js → index-DDpNgyvD.js} +3 -3
- package/dist/{index-IUYnmIJe.js → index-DFoELlwd.js} +1 -1
- package/dist/{index-DJISlRXi.js → index-DHVK-P9J.js} +4 -2
- package/dist/{index-BhzF0Rp3.js → index-DH_EZe8p.js} +4 -3
- package/dist/{index-CIoB2iny.js → index-DJIzgsog.js} +1 -1
- package/dist/{index-Doxcf2Zs.js → index-DPQkm6_v.js} +2 -2
- package/dist/{index-CtTSTTkq.js → index-DsNRjyQD.js} +2 -2
- package/dist/{index-Da7W9uBC.js → index-I_FRG0Ho.js} +2 -2
- package/dist/{index-CmaPtyCh.js → index-oSIIidoF.js} +4 -2
- package/dist/{index-rn6aiccW.js → index-rXMzwu77.js} +3 -3
- package/dist/{index-XbgrTOMF.js → index-vZZ5q2xJ.js} +1 -1
- package/dist/{index-Cw_YFCZT.js → index-yih5hGsL.js} +1467 -1345
- package/dist/index.es.js +6 -5
- package/dist/{integer-design-CPzJPZon.js → integer-design-DhkNa9IA.js} +1 -1
- package/dist/{integer-props-deCDvNET.js → integer-props-c_aQpjaT.js} +4 -4
- package/dist/{integer-style-DwZIRXEW.js → integer-style-CS5v7Bhq.js} +1 -1
- package/dist/{mb-render-Bejyn-ep.js → mb-render-Cs7LUxzk.js} +1 -1
- package/dist/{number-input-ex-CgwOH18n.js → number-input-ex-CwKIHfk1.js} +1 -1
- package/dist/{org-props-BeFVQ-QY.js → org-props-BcbW62Jg.js} +2 -2
- package/dist/{org-style-CLVWLtyd.js → org-style-Bk7mgML3.js} +1 -1
- package/dist/{pagination-design-CT0EQmxW.js → pagination-design-B1KyJUAG.js} +2 -2
- package/dist/paper-widget-design-Cp0ioo8c.js +4 -0
- package/dist/{qrcode-design-CjOkp2xa.js → qrcode-design-EafZURDZ.js} +1 -1
- package/dist/{ref-autofill-editor-B2KcQvyt.js → ref-autofill-editor-OtclaSqy.js} +2 -2
- package/dist/{ref-props-DPnt_pys.js → ref-props-C95McyZp.js} +3 -3
- package/dist/{ref-style-D0XKTtP1.js → ref-style-BxdvOF-4.js} +1 -1
- package/dist/regex-editor-BGukvOEI.js +796 -0
- package/dist/{revo-grid.entry-ztDhASK3.js → revo-grid.entry-BeRVTVKO.js} +1 -1
- package/dist/{revogr-attribution_7.entry-BtXV91vv.js → revogr-attribution_7.entry-CHtbU2lV.js} +3 -3
- package/dist/{revogr-clipboard_3.entry-DXpq4oNb.js → revogr-clipboard_3.entry-DnvQ-Rl7.js} +2 -2
- package/dist/{revogr-data_4.entry-WA1PNcGb.js → revogr-data_4.entry-DLRSuaN8.js} +2 -2
- package/dist/{revogr-filter-panel.entry-unpVAD7l.js → revogr-filter-panel.entry-BDkhY-74.js} +1 -1
- package/dist/{select-render-type-editor.vue_vue_type_script_setup_true_lang-CqaEwsvS.js → select-render-type-editor.vue_vue_type_script_setup_true_lang-ChESg_eM.js} +2 -2
- package/dist/{serialnumber-design-ClArHZWU.js → serialnumber-design-CRaym9J-.js} +1 -1
- package/dist/shared/index.es.js +16 -16
- package/dist/{signature-design-Cg2Ejj3g.js → signature-design-BJHfLDNV.js} +1 -1
- package/dist/{signature-props-CNuLBWtc.js → signature-props-B9hfppHh.js} +3 -3
- package/dist/{signature-style-DtlZdeFB.js → signature-style-DM4rqHnN.js} +1 -1
- package/dist/{single-field-drop-COLR9RIu.js → single-field-drop-eClQhTSv.js} +2 -2
- package/dist/{size-editor-DyGGEX3s.js → size-editor-BjlCmEWf.js} +1 -1
- package/dist/src/adapter/index.d.ts +1 -0
- package/dist/src/adapter/setup.d.ts +1 -1
- package/dist/src/nocode-base/src/_utils_/uuid.d.ts +6 -1
- package/dist/src/nocode-base/src/constant/index.d.ts +11 -0
- package/dist/src/nocode-base/src/hooks/annotation/collect-annotation-items.d.ts +15 -0
- package/dist/src/nocode-base/src/hooks/annotation/form-annotation-controller.d.ts +5 -2
- package/dist/src/nocode-base/src/hooks/annotation/form-change-row.d.ts +60 -0
- package/dist/src/nocode-base/src/hooks/annotation/index.d.ts +2 -0
- package/dist/src/nocode-base/src/hooks/app-info/index.d.ts +2 -2
- package/dist/src/nocode-base/src/hooks/index.d.ts +2 -1
- package/dist/src/nocode-base/src/hooks/model-relation/index.d.ts +1 -1
- package/dist/src/nocode-base/src/hooks/service-util/sn-rule.d.ts +1 -1
- package/dist/src/nocode-base/src/hooks/useFormHook.d.ts +1 -1
- package/dist/src/nocode-base/src/hooks/useRenderData.d.ts +4 -2
- package/dist/src/nocode-base/src/hooks/useRenderPageFactory.d.ts +36 -4
- package/dist/src/nocode-base/src/hooks/useValidator.d.ts +6 -6
- package/dist/src/nocode-base/src/hooks/validation/admission.d.ts +19 -0
- package/dist/src/nocode-base/src/hooks/validation/attach.d.ts +24 -0
- package/dist/src/nocode-base/src/hooks/validation/createValidateFactory.d.ts +35 -0
- package/dist/src/nocode-base/src/hooks/validation/formRulesStore.d.ts +15 -0
- package/dist/src/nocode-base/src/hooks/validation/merge.d.ts +24 -0
- package/dist/src/nocode-base/src/hooks/validation/runValidation.d.ts +17 -0
- package/dist/src/nocode-base/src/hooks/validation/scheduler.d.ts +12 -0
- package/dist/src/nocode-base/src/hooks/validation/types.d.ts +44 -0
- package/dist/src/nocode-base/src/hooks/validation/useFormValidator.d.ts +39 -0
- package/dist/src/nocode-base/src/hooks/validation/utils.d.ts +24 -0
- package/dist/src/nocode-base/src/hooks/validation/waitForSettle.d.ts +17 -0
- package/dist/src/nocode-base/src/interface/render.d.ts +1 -1
- package/dist/src/nocode-base/src/types/common/base.d.ts +14 -2
- package/dist/src/nocode-base/src/types/fields/i-datepicker.d.ts +5 -1
- package/dist/src/nocode-base/src/types/fields/i-datetimepicker.d.ts +5 -1
- package/dist/src/nocode-base/src/types/fields/i-inputdouble.d.ts +5 -1
- package/dist/src/nocode-base/src/types/fields/i-inputnumber.d.ts +5 -1
- package/dist/src/nocode-base/src/types/fields/i-trace.d.ts +27 -1
- package/dist/src/nocode-base/src/types/widgets/i-paper.d.ts +2 -0
- package/dist/src/online-form/src/components/version-diff/index/types.d.ts +2 -0
- package/dist/src/online-form/src/views/__cell_widgets__/common/keep-exception-highlight-editor/keep-exception-highlight-editor.vue.d.ts +10 -0
- package/dist/src/online-form/src/views/__cell_widgets__/common/regex-editor/common-regex-api.d.ts +11 -0
- package/dist/src/online-form/src/views/__cell_widgets__/common/regex-editor/editor.d.ts +8 -0
- package/dist/src/online-form/src/views/designer/hooks/useAllSpreadSheets.d.ts +12 -0
- package/dist/src/online-form/src/views/designer/hooks/useModelFields.d.ts +1 -1
- package/dist/src/online-form/src/views/designer/hooks/useSpreadSheet.d.ts +16 -0
- package/dist/src/online-form/src/views/designer/modules/panel/comps/signature-config/field-tree-select.vue.d.ts +2 -2
- package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/common/add-builtin-param/add-builtin-param-select.vue.d.ts +2 -2
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/form-field-tree-select.vue.d.ts +2 -2
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/material-rdo-select.vue.d.ts +2 -2
- package/dist/src/online-form/src/views/designer/types/index.d.ts +2 -0
- package/dist/src/online-form/src/views/designer/utils/xlsx-parser.d.ts +3 -0
- package/dist/src/online-form/src/views/render/__components__/_common_/widget-component.vue.d.ts +3 -1
- package/dist/src/shared/components/DoubleInput/double-input.vue.d.ts +5 -0
- package/dist/src/shared/components/rdo-tree-select/rdo-tree-select.vue.d.ts +2 -2
- package/dist/src/shared/utils/host-api.d.ts +3 -11
- package/dist/{text-design-DjJS6aM4.js → text-design-BGxM7gzI.js} +2 -2
- package/dist/{text-design-490okDpw.js → text-design-C3RhersV.js} +2 -2
- package/dist/{text-props-Dh4S3iN0.js → text-props-CIpXslMv.js} +21 -252
- package/dist/{text-style-BGeNrOMv.js → text-style-BPjaT5Ic.js} +1 -1
- package/dist/{throttle-Cpk1LoGk-BWXeZXFZ.js → throttle-Cpk1LoGk-LNQ7rPwu.js} +1 -1
- package/dist/{timediff-design-DEh9xNVa.js → timediff-design-DqVuVrmx.js} +1 -1
- package/dist/{trace-design-Dk0irY70.js → trace-design-IbjVLAhv.js} +2 -2
- package/dist/{trace-props-DRBrPqIq.js → trace-props-C-F_eDG2.js} +53 -16
- package/dist/{trace-style-6lXlaJ2o.js → trace-style-DRenZ1n1.js} +1 -1
- package/dist/{user-props-yasRJPzM.js → user-props-qQx7HZ7T.js} +2 -2
- package/dist/{user-style-dkDUDf63.js → user-style-BPFOx0xn.js} +1 -1
- package/dist/{value-editor.vue_vue_type_style_index_0_lang-8rhhfLv7.js → value-editor.vue_vue_type_style_index_0_lang-Crnt5d7x.js} +2 -2
- package/dist/{version-select-dvsx-Ifv.js → version-select-BkZzH36D.js} +1 -1
- package/dist/web-render/index.es.js +4 -4
- package/dist/{widget-barcode-BfzXe5MQ.js → widget-barcode-CPZjarSa.js} +4 -4
- package/dist/{widget-diagonal-R5qdvCvE.js → widget-diagonal-DebN3u9t.js} +3 -3
- package/dist/{widget-image-C0zAtiuf.js → widget-image-BSMWxm9c.js} +5 -5
- package/dist/{widget-line-z4TTPDkL.js → widget-line-CyavTHOV.js} +2 -2
- package/dist/{widget-pagination-CeO9pmmu.js → widget-pagination-ZCBdy6HQ.js} +5 -5
- package/dist/{widget-power-CP1DLxkZ.js → widget-power-B1NFysHT.js} +3 -3
- package/dist/{widget-qrcode-Boz_t9l9.js → widget-qrcode-B0TTSoSK.js} +3 -3
- package/dist/{widget-rangelimit-B9kRG_Fa.js → widget-rangelimit-C_ureKDr.js} +3 -3
- package/dist/{widget-serialnumber-BBUxx4nB.js → widget-serialnumber-Dq15dHnk.js} +1 -1
- package/dist/{widget-text-qvLZssGe.js → widget-text-B9EXKFiM.js} +5 -5
- package/dist/{widget-timediff-BBmssjfJ.js → widget-timediff-BhLrQuGb.js} +2 -2
- package/package.json +1 -1
- package/dist/date-format-editor-BZ89hVjL.js +0 -240
- package/dist/date-time-props-BWvuzNXX.js +0 -265
- package/dist/paper-widget-design-DKBVqvH3.js +0 -4
- package/dist/src/nocode-base/src/hooks/form-model/fetcher.d.ts +0 -40
- package/dist/src/nocode-base/src/interface/data.d.ts +0 -47
- package/dist/src/nocode-base/src/interface/util.d.ts +0 -108
|
@@ -0,0 +1,796 @@
|
|
|
1
|
+
import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, createVNode, createElementVNode, renderSlot, toDisplayString, ref, reactive, watch, onBeforeUnmount, withModifiers, Fragment, withCtx, createTextVNode, renderList, normalizeClass, createCommentVNode, onMounted, createBlock, normalizeStyle, toRaw } from "vue";
|
|
2
|
+
import { isNil, cloneDeep } from "lodash-es";
|
|
3
|
+
import { _ as _export_sfc, i as api, D as useModal } from "./document-quick-fillin.vue_vue_type_style_index_0_scoped_a18386ab_lang-DKTGEH4Q.js";
|
|
4
|
+
import { F as FormItem } from "./index-yih5hGsL.js";
|
|
5
|
+
import { message } from "ant-design-vue";
|
|
6
|
+
const _hoisted_1$3 = { class: "number-range" };
|
|
7
|
+
const _hoisted_2$2 = { class: "middle" };
|
|
8
|
+
const _hoisted_3$2 = { class: "length-sep" };
|
|
9
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
10
|
+
__name: "number-range",
|
|
11
|
+
props: {
|
|
12
|
+
min: {},
|
|
13
|
+
max: {},
|
|
14
|
+
precision: { default: 0 },
|
|
15
|
+
disabled: { type: Boolean, default: false },
|
|
16
|
+
lowerLimit: { default: 0 },
|
|
17
|
+
upperLimit: { default: Infinity },
|
|
18
|
+
minPlaceholder: { default: $t("sys.inputText") },
|
|
19
|
+
maxPlaceholder: { default: $t("sys.inputText") }
|
|
20
|
+
},
|
|
21
|
+
emits: ["update:min", "update:max"],
|
|
22
|
+
setup(__props, { emit: __emit }) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const emit = __emit;
|
|
25
|
+
const minValue = computed({
|
|
26
|
+
get() {
|
|
27
|
+
return props.min;
|
|
28
|
+
},
|
|
29
|
+
set(v) {
|
|
30
|
+
emit("update:min", v);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const maxValue = computed({
|
|
34
|
+
get() {
|
|
35
|
+
return props.max;
|
|
36
|
+
},
|
|
37
|
+
set(v) {
|
|
38
|
+
emit("update:max", v);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const minLimit = computed(() => {
|
|
42
|
+
const lowerLimit = props.lowerLimit;
|
|
43
|
+
const upperLimit = isNil(maxValue.value) ? props.upperLimit : maxValue.value;
|
|
44
|
+
return {
|
|
45
|
+
lowerLimit,
|
|
46
|
+
upperLimit
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
const maxLimit = computed(() => {
|
|
50
|
+
const lowerLimit = isNil(minValue.value) ? props.lowerLimit : minValue.value;
|
|
51
|
+
const upperLimit = props.upperLimit;
|
|
52
|
+
return {
|
|
53
|
+
lowerLimit,
|
|
54
|
+
upperLimit
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
return (_ctx, _cache) => {
|
|
58
|
+
const _component_a_input_number = resolveComponent("a-input-number");
|
|
59
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
60
|
+
createVNode(_component_a_input_number, {
|
|
61
|
+
value: minValue.value,
|
|
62
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => minValue.value = $event),
|
|
63
|
+
min: minLimit.value.lowerLimit,
|
|
64
|
+
max: minLimit.value.upperLimit,
|
|
65
|
+
disabled: __props.disabled,
|
|
66
|
+
precision: __props.precision,
|
|
67
|
+
placeholder: __props.minPlaceholder,
|
|
68
|
+
controls: false,
|
|
69
|
+
size: "small"
|
|
70
|
+
}, null, 8, ["value", "min", "max", "disabled", "precision", "placeholder"]),
|
|
71
|
+
createElementVNode("div", _hoisted_2$2, [
|
|
72
|
+
renderSlot(_ctx.$slots, "middle", {}, () => [
|
|
73
|
+
createElementVNode("span", _hoisted_3$2, toDisplayString(_ctx.$t("sys.fieldTypeProps.to")), 1)
|
|
74
|
+
], true)
|
|
75
|
+
]),
|
|
76
|
+
createVNode(_component_a_input_number, {
|
|
77
|
+
value: maxValue.value,
|
|
78
|
+
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => maxValue.value = $event),
|
|
79
|
+
min: maxLimit.value.lowerLimit,
|
|
80
|
+
max: maxLimit.value.upperLimit,
|
|
81
|
+
disabled: __props.disabled,
|
|
82
|
+
precision: __props.precision,
|
|
83
|
+
placeholder: __props.maxPlaceholder,
|
|
84
|
+
controls: false,
|
|
85
|
+
size: "small"
|
|
86
|
+
}, null, 8, ["value", "min", "max", "disabled", "precision", "placeholder"])
|
|
87
|
+
]);
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const NumberRange = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-e847ebd6"]]);
|
|
92
|
+
async function fetchCommonRegexList() {
|
|
93
|
+
const data = await api.platform.regexp.getList?.() || [];
|
|
94
|
+
return (data || []).filter((item) => !item.sysBuiltin);
|
|
95
|
+
}
|
|
96
|
+
async function createCommonRegex(payload) {
|
|
97
|
+
await api.platform.regexp.post?.(payload);
|
|
98
|
+
}
|
|
99
|
+
async function updateCommonRegex(id, payload) {
|
|
100
|
+
await api.platform.regexp.putId?.({ id }, payload);
|
|
101
|
+
}
|
|
102
|
+
async function deleteCommonRegex(id) {
|
|
103
|
+
await api.platform.regexp.delete?.({ ids: id });
|
|
104
|
+
}
|
|
105
|
+
const _hoisted_1$2 = { class: "common-regex-panel__header" };
|
|
106
|
+
const _hoisted_2$1 = { class: "common-regex-panel__title" };
|
|
107
|
+
const _hoisted_3$1 = { class: "common-regex-panel__empty" };
|
|
108
|
+
const _hoisted_4$1 = { class: "common-regex-panel__empty-tip" };
|
|
109
|
+
const _hoisted_5$1 = { class: "common-regex-panel__header has-border" };
|
|
110
|
+
const _hoisted_6$1 = { class: "common-regex-panel__title" };
|
|
111
|
+
const _hoisted_7$1 = { class: "common-regex-panel__list" };
|
|
112
|
+
const _hoisted_8$1 = { class: "common-regex-panel__item-main" };
|
|
113
|
+
const _hoisted_9$1 = ["title"];
|
|
114
|
+
const _hoisted_10$1 = ["title"];
|
|
115
|
+
const _hoisted_11$1 = { class: "common-regex-panel__item-actions" };
|
|
116
|
+
const _hoisted_12$1 = ["onClick"];
|
|
117
|
+
const _hoisted_13$1 = ["onClick"];
|
|
118
|
+
const _hoisted_14 = ["onClick"];
|
|
119
|
+
const _hoisted_15 = { class: "common-regex-panel__header has-border" };
|
|
120
|
+
const _hoisted_16 = { class: "common-regex-panel__title" };
|
|
121
|
+
const _hoisted_17 = { class: "common-regex-panel__form" };
|
|
122
|
+
const _hoisted_18 = { class: "common-regex-panel__form-item" };
|
|
123
|
+
const _hoisted_19 = { class: "common-regex-panel__form-label is-required" };
|
|
124
|
+
const _hoisted_20 = {
|
|
125
|
+
key: 0,
|
|
126
|
+
class: "error"
|
|
127
|
+
};
|
|
128
|
+
const _hoisted_21 = { class: "common-regex-panel__form-item" };
|
|
129
|
+
const _hoisted_22 = { class: "common-regex-panel__form-label is-required" };
|
|
130
|
+
const _hoisted_23 = {
|
|
131
|
+
key: 0,
|
|
132
|
+
class: "error"
|
|
133
|
+
};
|
|
134
|
+
const _hoisted_24 = { class: "common-regex-panel__form-footer" };
|
|
135
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
136
|
+
__name: "common-regex-panel",
|
|
137
|
+
props: {
|
|
138
|
+
list: {}
|
|
139
|
+
},
|
|
140
|
+
emits: ["update:list", "fill", "delete-confirm"],
|
|
141
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
142
|
+
const props = __props;
|
|
143
|
+
const emit = __emit;
|
|
144
|
+
const panelRef = ref();
|
|
145
|
+
const view = ref("list");
|
|
146
|
+
const formMode = ref("create");
|
|
147
|
+
const confirmId = ref();
|
|
148
|
+
const saving = ref(false);
|
|
149
|
+
const editingId = ref();
|
|
150
|
+
const formState = reactive({
|
|
151
|
+
name: "",
|
|
152
|
+
value: ""
|
|
153
|
+
});
|
|
154
|
+
const formErrors = reactive({
|
|
155
|
+
name: "",
|
|
156
|
+
value: ""
|
|
157
|
+
});
|
|
158
|
+
watch(
|
|
159
|
+
() => props.list,
|
|
160
|
+
() => {
|
|
161
|
+
if (view.value === "form") return;
|
|
162
|
+
closeConfirm();
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
function resetForm() {
|
|
166
|
+
formState.name = "";
|
|
167
|
+
formState.value = "";
|
|
168
|
+
formErrors.name = "";
|
|
169
|
+
formErrors.value = "";
|
|
170
|
+
editingId.value = void 0;
|
|
171
|
+
}
|
|
172
|
+
function openCreate() {
|
|
173
|
+
closeConfirm();
|
|
174
|
+
formMode.value = "create";
|
|
175
|
+
resetForm();
|
|
176
|
+
view.value = "form";
|
|
177
|
+
}
|
|
178
|
+
function openEdit(item) {
|
|
179
|
+
closeConfirm();
|
|
180
|
+
formMode.value = "edit";
|
|
181
|
+
editingId.value = item.id;
|
|
182
|
+
formState.name = item.name || "";
|
|
183
|
+
formState.value = item.value || "";
|
|
184
|
+
formErrors.name = "";
|
|
185
|
+
formErrors.value = "";
|
|
186
|
+
view.value = "form";
|
|
187
|
+
}
|
|
188
|
+
function closeConfirm() {
|
|
189
|
+
confirmId.value = void 0;
|
|
190
|
+
emit("delete-confirm", null);
|
|
191
|
+
}
|
|
192
|
+
function openDeleteConfirm(item, event) {
|
|
193
|
+
const overlay = panelRef.value?.closest(".regex-common-panel-overlay");
|
|
194
|
+
const btn = event.currentTarget;
|
|
195
|
+
if (!overlay || !btn || !item.id) return;
|
|
196
|
+
const overlayRect = overlay.getBoundingClientRect();
|
|
197
|
+
const btnRect = btn.getBoundingClientRect();
|
|
198
|
+
confirmId.value = item.id;
|
|
199
|
+
emit("delete-confirm", {
|
|
200
|
+
item,
|
|
201
|
+
style: {
|
|
202
|
+
right: `${overlayRect.right - btnRect.right}px`,
|
|
203
|
+
top: `${btnRect.top - overlayRect.top - 8}px`
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
function backToList() {
|
|
208
|
+
resetForm();
|
|
209
|
+
closeConfirm();
|
|
210
|
+
view.value = "list";
|
|
211
|
+
}
|
|
212
|
+
onBeforeUnmount(() => {
|
|
213
|
+
closeConfirm();
|
|
214
|
+
});
|
|
215
|
+
function validateFormField(field, options) {
|
|
216
|
+
const checkRequired = options?.checkRequired ?? true;
|
|
217
|
+
formErrors[field] = "";
|
|
218
|
+
const text = formState[field] ?? "";
|
|
219
|
+
if (field === "name" && text.length > 100) {
|
|
220
|
+
formErrors.name = $t("sys.regexEditor.maxNChars", { n: 100 });
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
if (field === "value" && text.length > 500) {
|
|
224
|
+
formErrors.value = $t("sys.regexEditor.maxNChars", { n: 500 });
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
if (checkRequired && !text.trim()) {
|
|
228
|
+
formErrors[field] = field === "name" ? $t("sys.regexEditor.pleaseInputName") : $t("sys.regexEditor.pleaseInputRegex");
|
|
229
|
+
return false;
|
|
230
|
+
}
|
|
231
|
+
if (field === "name" && text.trim()) {
|
|
232
|
+
const duplicated = props.list.find(
|
|
233
|
+
(d) => d.name === formState.name.trim() && d.id !== editingId.value
|
|
234
|
+
);
|
|
235
|
+
if (duplicated) {
|
|
236
|
+
formErrors.name = $t("sys.regexEditor.repeatRegName");
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return true;
|
|
241
|
+
}
|
|
242
|
+
function validateForm() {
|
|
243
|
+
const nameOk = validateFormField("name", { checkRequired: true });
|
|
244
|
+
const valueOk = validateFormField("value", { checkRequired: true });
|
|
245
|
+
return nameOk && valueOk;
|
|
246
|
+
}
|
|
247
|
+
async function refreshList() {
|
|
248
|
+
const next = await fetchCommonRegexList();
|
|
249
|
+
emit("update:list", next);
|
|
250
|
+
}
|
|
251
|
+
async function onSaveForm() {
|
|
252
|
+
if (!validateForm()) return;
|
|
253
|
+
saving.value = true;
|
|
254
|
+
try {
|
|
255
|
+
const payload = {
|
|
256
|
+
name: formState.name.trim(),
|
|
257
|
+
value: formState.value.trim()
|
|
258
|
+
};
|
|
259
|
+
if (formMode.value === "edit" && editingId.value) {
|
|
260
|
+
await updateCommonRegex(editingId.value, payload);
|
|
261
|
+
} else {
|
|
262
|
+
await createCommonRegex(payload);
|
|
263
|
+
}
|
|
264
|
+
await refreshList();
|
|
265
|
+
resetForm();
|
|
266
|
+
view.value = "list";
|
|
267
|
+
} catch (err) {
|
|
268
|
+
message.error(err?.message || $t("sys.operationFailed"));
|
|
269
|
+
} finally {
|
|
270
|
+
saving.value = false;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
function onFill(item) {
|
|
274
|
+
emit("fill", item);
|
|
275
|
+
}
|
|
276
|
+
async function onDelete(item) {
|
|
277
|
+
if (!item.id) return;
|
|
278
|
+
try {
|
|
279
|
+
await deleteCommonRegex(item.id);
|
|
280
|
+
closeConfirm();
|
|
281
|
+
await refreshList();
|
|
282
|
+
} catch (err) {
|
|
283
|
+
message.error(err?.message || $t("sys.operationFailed"));
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
__expose({
|
|
287
|
+
openCreate,
|
|
288
|
+
closeConfirm,
|
|
289
|
+
deleteItem: onDelete
|
|
290
|
+
});
|
|
291
|
+
return (_ctx, _cache) => {
|
|
292
|
+
const _component_a_button = resolveComponent("a-button");
|
|
293
|
+
const _component_a_input = resolveComponent("a-input");
|
|
294
|
+
return openBlock(), createElementBlock("div", {
|
|
295
|
+
ref_key: "panelRef",
|
|
296
|
+
ref: panelRef,
|
|
297
|
+
class: "common-regex-panel",
|
|
298
|
+
onClick: withModifiers(closeConfirm, ["stop"])
|
|
299
|
+
}, [
|
|
300
|
+
view.value === "list" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
301
|
+
!__props.list.length ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
302
|
+
createElementVNode("div", _hoisted_1$2, [
|
|
303
|
+
createElementVNode("span", _hoisted_2$1, toDisplayString(_ctx.$t("sys.regexEditor.commonReg")), 1)
|
|
304
|
+
]),
|
|
305
|
+
createElementVNode("div", _hoisted_3$1, [
|
|
306
|
+
_cache[7] || (_cache[7] = createElementVNode("i", { class: "iconfont icon-changyongzhengzequesheng common-regex-panel__empty-icon" }, null, -1)),
|
|
307
|
+
createElementVNode("div", _hoisted_4$1, toDisplayString(_ctx.$t("sys.regexEditor.noCommon")), 1),
|
|
308
|
+
createVNode(_component_a_button, {
|
|
309
|
+
type: "primary",
|
|
310
|
+
size: "small",
|
|
311
|
+
onClick: openCreate
|
|
312
|
+
}, {
|
|
313
|
+
default: withCtx(() => [
|
|
314
|
+
_cache[6] || (_cache[6] = createElementVNode("i", { class: "iconfont icon-chuangjian common-regex-panel__empty-btn-add-icon" }, null, -1)),
|
|
315
|
+
createTextVNode(" " + toDisplayString(_ctx.$t("sys.add")), 1)
|
|
316
|
+
]),
|
|
317
|
+
_: 1
|
|
318
|
+
})
|
|
319
|
+
])
|
|
320
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
321
|
+
createElementVNode("div", _hoisted_5$1, [
|
|
322
|
+
createElementVNode("span", _hoisted_6$1, toDisplayString(_ctx.$t("sys.regexEditor.commonReg")), 1),
|
|
323
|
+
createElementVNode("button", {
|
|
324
|
+
class: "common-regex-panel__add",
|
|
325
|
+
type: "button",
|
|
326
|
+
onClick: openCreate
|
|
327
|
+
}, [
|
|
328
|
+
_cache[8] || (_cache[8] = createElementVNode("i", { class: "iconfont icon-chuangjian" }, null, -1)),
|
|
329
|
+
createTextVNode(" " + toDisplayString(_ctx.$t("sys.regexEditor.addCommon")), 1)
|
|
330
|
+
])
|
|
331
|
+
]),
|
|
332
|
+
createElementVNode("div", {
|
|
333
|
+
class: "common-regex-panel__scrollbar",
|
|
334
|
+
onScroll: closeConfirm
|
|
335
|
+
}, [
|
|
336
|
+
createElementVNode("div", _hoisted_7$1, [
|
|
337
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.list, (item) => {
|
|
338
|
+
return openBlock(), createElementBlock("div", {
|
|
339
|
+
key: item.id,
|
|
340
|
+
class: "common-regex-panel__item"
|
|
341
|
+
}, [
|
|
342
|
+
createElementVNode("div", _hoisted_8$1, [
|
|
343
|
+
createElementVNode("div", {
|
|
344
|
+
class: "common-regex-panel__item-name",
|
|
345
|
+
title: item.name
|
|
346
|
+
}, toDisplayString(item.name), 9, _hoisted_9$1),
|
|
347
|
+
createElementVNode("div", {
|
|
348
|
+
class: "common-regex-panel__item-value",
|
|
349
|
+
title: item.value
|
|
350
|
+
}, toDisplayString(item.value), 9, _hoisted_10$1)
|
|
351
|
+
]),
|
|
352
|
+
createElementVNode("div", _hoisted_11$1, [
|
|
353
|
+
createElementVNode("button", {
|
|
354
|
+
class: "action-fill",
|
|
355
|
+
type: "button",
|
|
356
|
+
onClick: ($event) => onFill(item)
|
|
357
|
+
}, toDisplayString(_ctx.$t("sys.regexEditor.fill")), 9, _hoisted_12$1),
|
|
358
|
+
!item.sysBuiltin ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
359
|
+
createElementVNode("button", {
|
|
360
|
+
class: "action-icon action-edit",
|
|
361
|
+
type: "button",
|
|
362
|
+
onClick: ($event) => openEdit(item)
|
|
363
|
+
}, [..._cache[9] || (_cache[9] = [
|
|
364
|
+
createElementVNode("i", { class: "iconfont icon-bianji" }, null, -1)
|
|
365
|
+
])], 8, _hoisted_13$1),
|
|
366
|
+
createElementVNode("button", {
|
|
367
|
+
class: normalizeClass(["action-icon action-delete", { "is-active": confirmId.value === item.id }]),
|
|
368
|
+
type: "button",
|
|
369
|
+
onClick: withModifiers(($event) => openDeleteConfirm(item, $event), ["stop"])
|
|
370
|
+
}, [..._cache[10] || (_cache[10] = [
|
|
371
|
+
createElementVNode("i", { class: "iconfont icon-shanchu2" }, null, -1)
|
|
372
|
+
])], 10, _hoisted_14)
|
|
373
|
+
], 64)) : createCommentVNode("", true)
|
|
374
|
+
])
|
|
375
|
+
]);
|
|
376
|
+
}), 128))
|
|
377
|
+
])
|
|
378
|
+
], 32)
|
|
379
|
+
], 64))
|
|
380
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
381
|
+
createElementVNode("div", _hoisted_15, [
|
|
382
|
+
createElementVNode("span", _hoisted_16, toDisplayString(formMode.value === "edit" ? _ctx.$t("sys.regexEditor.editCommon") : _ctx.$t("sys.regexEditor.addCommon")), 1)
|
|
383
|
+
]),
|
|
384
|
+
createElementVNode("div", _hoisted_17, [
|
|
385
|
+
createElementVNode("div", _hoisted_18, [
|
|
386
|
+
createElementVNode("div", _hoisted_19, toDisplayString(_ctx.$t("sys.name")), 1),
|
|
387
|
+
createVNode(_component_a_input, {
|
|
388
|
+
value: formState.name,
|
|
389
|
+
"onUpdate:value": [
|
|
390
|
+
_cache[0] || (_cache[0] = ($event) => formState.name = $event),
|
|
391
|
+
_cache[1] || (_cache[1] = ($event) => validateFormField("name", { checkRequired: false }))
|
|
392
|
+
],
|
|
393
|
+
placeholder: _ctx.$t("sys.inputText"),
|
|
394
|
+
"allow-clear": "",
|
|
395
|
+
onBlur: _cache[2] || (_cache[2] = ($event) => validateFormField("name"))
|
|
396
|
+
}, null, 8, ["value", "placeholder"]),
|
|
397
|
+
formErrors.name ? (openBlock(), createElementBlock("div", _hoisted_20, toDisplayString(formErrors.name), 1)) : createCommentVNode("", true)
|
|
398
|
+
]),
|
|
399
|
+
createElementVNode("div", _hoisted_21, [
|
|
400
|
+
createElementVNode("div", _hoisted_22, toDisplayString(_ctx.$t("sys.regexEditor.regex")), 1),
|
|
401
|
+
createVNode(_component_a_input, {
|
|
402
|
+
value: formState.value,
|
|
403
|
+
"onUpdate:value": [
|
|
404
|
+
_cache[3] || (_cache[3] = ($event) => formState.value = $event),
|
|
405
|
+
_cache[4] || (_cache[4] = ($event) => validateFormField("value", { checkRequired: false }))
|
|
406
|
+
],
|
|
407
|
+
placeholder: _ctx.$t("sys.inputText"),
|
|
408
|
+
"allow-clear": "",
|
|
409
|
+
onBlur: _cache[5] || (_cache[5] = ($event) => validateFormField("value"))
|
|
410
|
+
}, null, 8, ["value", "placeholder"]),
|
|
411
|
+
formErrors.value ? (openBlock(), createElementBlock("div", _hoisted_23, toDisplayString(formErrors.value), 1)) : createCommentVNode("", true)
|
|
412
|
+
]),
|
|
413
|
+
createElementVNode("div", _hoisted_24, [
|
|
414
|
+
createVNode(_component_a_button, {
|
|
415
|
+
size: "small",
|
|
416
|
+
onMousedown: withModifiers(backToList, ["prevent"])
|
|
417
|
+
}, {
|
|
418
|
+
default: withCtx(() => [
|
|
419
|
+
createTextVNode(toDisplayString(_ctx.$t("sys.cancelText")), 1)
|
|
420
|
+
]),
|
|
421
|
+
_: 1
|
|
422
|
+
}),
|
|
423
|
+
createVNode(_component_a_button, {
|
|
424
|
+
type: "primary",
|
|
425
|
+
size: "small",
|
|
426
|
+
loading: saving.value,
|
|
427
|
+
onClick: onSaveForm
|
|
428
|
+
}, {
|
|
429
|
+
default: withCtx(() => [
|
|
430
|
+
createTextVNode(toDisplayString(_ctx.$t("sys.saveText")), 1)
|
|
431
|
+
]),
|
|
432
|
+
_: 1
|
|
433
|
+
}, 8, ["loading"])
|
|
434
|
+
])
|
|
435
|
+
])
|
|
436
|
+
], 64))
|
|
437
|
+
], 512);
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
const CommonRegexPanel = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-ea0a344b"]]);
|
|
442
|
+
const _hoisted_1$1 = { class: "regex-editor-modal" };
|
|
443
|
+
const _hoisted_2 = { class: "regex-editor-modal__item" };
|
|
444
|
+
const _hoisted_3 = { class: "regex-editor-modal__label" };
|
|
445
|
+
const _hoisted_4 = { class: "regex-editor-modal__regex-row" };
|
|
446
|
+
const _hoisted_5 = { class: "regex-editor-modal__regex-main" };
|
|
447
|
+
const _hoisted_6 = {
|
|
448
|
+
key: 0,
|
|
449
|
+
class: "regex-editor-modal__tags"
|
|
450
|
+
};
|
|
451
|
+
const _hoisted_7 = ["onClick"];
|
|
452
|
+
const _hoisted_8 = { class: "regex-common-panel-overlay__clip" };
|
|
453
|
+
const _hoisted_9 = { class: "delete-confirm__title" };
|
|
454
|
+
const _hoisted_10 = { class: "delete-confirm__actions" };
|
|
455
|
+
const _hoisted_11 = {
|
|
456
|
+
key: 0,
|
|
457
|
+
class: "error"
|
|
458
|
+
};
|
|
459
|
+
const _hoisted_12 = { class: "regex-editor-modal__item regex-editor-modal__item--hint" };
|
|
460
|
+
const _hoisted_13 = {
|
|
461
|
+
key: 0,
|
|
462
|
+
class: "error"
|
|
463
|
+
};
|
|
464
|
+
const TAG_NAME_MAX = 12;
|
|
465
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
466
|
+
__name: "regex-editor-modal",
|
|
467
|
+
props: {
|
|
468
|
+
value: {},
|
|
469
|
+
modal: {}
|
|
470
|
+
},
|
|
471
|
+
setup(__props) {
|
|
472
|
+
const props = __props;
|
|
473
|
+
const formState = reactive({
|
|
474
|
+
regex: void 0,
|
|
475
|
+
regexHint: void 0
|
|
476
|
+
});
|
|
477
|
+
const errors = reactive({});
|
|
478
|
+
const commonList = ref([]);
|
|
479
|
+
const panelShown = ref(false);
|
|
480
|
+
const commonPanelRef = ref(null);
|
|
481
|
+
const deleteConfirm = ref(null);
|
|
482
|
+
watch(
|
|
483
|
+
() => props.value,
|
|
484
|
+
(v) => {
|
|
485
|
+
Object.assign(formState, cloneDeep(v) || { regex: void 0, regexHint: void 0 });
|
|
486
|
+
},
|
|
487
|
+
{ immediate: true }
|
|
488
|
+
);
|
|
489
|
+
async function loadCommonList() {
|
|
490
|
+
try {
|
|
491
|
+
commonList.value = await fetchCommonRegexList();
|
|
492
|
+
} catch {
|
|
493
|
+
commonList.value = [];
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
onMounted(() => {
|
|
497
|
+
loadCommonList();
|
|
498
|
+
});
|
|
499
|
+
async function onPanelVisibleChange(visible) {
|
|
500
|
+
panelShown.value = visible;
|
|
501
|
+
if (!visible) {
|
|
502
|
+
deleteConfirm.value = null;
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
await loadCommonList();
|
|
506
|
+
}
|
|
507
|
+
function onDeleteConfirmChange(payload) {
|
|
508
|
+
deleteConfirm.value = payload;
|
|
509
|
+
}
|
|
510
|
+
function onCancelDelete() {
|
|
511
|
+
commonPanelRef.value?.closeConfirm?.();
|
|
512
|
+
}
|
|
513
|
+
async function onConfirmDelete() {
|
|
514
|
+
const item = deleteConfirm.value?.item;
|
|
515
|
+
if (!item) return;
|
|
516
|
+
await commonPanelRef.value?.deleteItem?.(item);
|
|
517
|
+
}
|
|
518
|
+
onBeforeUnmount(() => {
|
|
519
|
+
deleteConfirm.value = null;
|
|
520
|
+
panelShown.value = false;
|
|
521
|
+
});
|
|
522
|
+
function truncateName(name) {
|
|
523
|
+
const text = name || "";
|
|
524
|
+
if (text.length <= TAG_NAME_MAX) return text;
|
|
525
|
+
return `${text.slice(0, TAG_NAME_MAX)}...`;
|
|
526
|
+
}
|
|
527
|
+
function isNameTruncated(name) {
|
|
528
|
+
return (name || "").length > TAG_NAME_MAX;
|
|
529
|
+
}
|
|
530
|
+
function fillRegex(item) {
|
|
531
|
+
formState.regex = item.value || "";
|
|
532
|
+
validateField("regex", { checkRequired: false });
|
|
533
|
+
}
|
|
534
|
+
function onFillFromPanel(item) {
|
|
535
|
+
fillRegex(item);
|
|
536
|
+
panelShown.value = false;
|
|
537
|
+
}
|
|
538
|
+
const validateField = (field, options) => {
|
|
539
|
+
const checkRequired = options?.checkRequired ?? true;
|
|
540
|
+
errors[field] = "";
|
|
541
|
+
const text = String(formState[field] ?? "");
|
|
542
|
+
if (field === "regex" && text.length > 500) {
|
|
543
|
+
errors.regex = $t("sys.regexEditor.maxNChars", { n: 500 });
|
|
544
|
+
return false;
|
|
545
|
+
}
|
|
546
|
+
if (field === "regexHint" && text.length > 100) {
|
|
547
|
+
errors.regexHint = $t("sys.regexEditor.maxNChars", { n: 100 });
|
|
548
|
+
return false;
|
|
549
|
+
}
|
|
550
|
+
if (checkRequired && field === "regexHint" && formState.regex && !text.trim()) {
|
|
551
|
+
errors.regexHint = $t("sys.regexEditor.pleaseInputHint");
|
|
552
|
+
return false;
|
|
553
|
+
}
|
|
554
|
+
return true;
|
|
555
|
+
};
|
|
556
|
+
const validateAll = () => {
|
|
557
|
+
const regexOk = validateField("regex", { checkRequired: false });
|
|
558
|
+
const hintOk = validateField("regexHint", { checkRequired: true });
|
|
559
|
+
return regexOk && hintOk;
|
|
560
|
+
};
|
|
561
|
+
async function onSave() {
|
|
562
|
+
if (!validateAll()) {
|
|
563
|
+
return { ok: false };
|
|
564
|
+
}
|
|
565
|
+
return {
|
|
566
|
+
ok: true,
|
|
567
|
+
data: [
|
|
568
|
+
toRaw({
|
|
569
|
+
regex: formState.regex || void 0,
|
|
570
|
+
regexHint: formState.regex ? formState.regexHint : void 0
|
|
571
|
+
})
|
|
572
|
+
]
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
useModal(onSave);
|
|
576
|
+
return (_ctx, _cache) => {
|
|
577
|
+
const _component_a_input = resolveComponent("a-input");
|
|
578
|
+
const _component_a_tooltip = resolveComponent("a-tooltip");
|
|
579
|
+
const _component_a_button = resolveComponent("a-button");
|
|
580
|
+
const _component_a_dropdown = resolveComponent("a-dropdown");
|
|
581
|
+
const _component_a_textarea = resolveComponent("a-textarea");
|
|
582
|
+
const _component_view_container = resolveComponent("view-container");
|
|
583
|
+
return openBlock(), createBlock(_component_view_container, null, {
|
|
584
|
+
default: withCtx(() => [
|
|
585
|
+
createElementVNode("div", _hoisted_1$1, [
|
|
586
|
+
createElementVNode("div", _hoisted_2, [
|
|
587
|
+
createElementVNode("div", _hoisted_3, toDisplayString(_ctx.$t("sys.regexEditor.regex")), 1),
|
|
588
|
+
createElementVNode("div", _hoisted_4, [
|
|
589
|
+
createElementVNode("div", _hoisted_5, [
|
|
590
|
+
createVNode(_component_a_input, {
|
|
591
|
+
value: formState.regex,
|
|
592
|
+
"onUpdate:value": [
|
|
593
|
+
_cache[0] || (_cache[0] = ($event) => formState.regex = $event),
|
|
594
|
+
_cache[1] || (_cache[1] = ($event) => validateField("regex", { checkRequired: false }))
|
|
595
|
+
],
|
|
596
|
+
placeholder: _ctx.$t("sys.inputText"),
|
|
597
|
+
"allow-clear": "",
|
|
598
|
+
onBlur: _cache[2] || (_cache[2] = ($event) => validateField("regex"))
|
|
599
|
+
}, null, 8, ["value", "placeholder"]),
|
|
600
|
+
commonList.value.length ? (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
601
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(commonList.value, (item) => {
|
|
602
|
+
return openBlock(), createBlock(_component_a_tooltip, {
|
|
603
|
+
key: item.id,
|
|
604
|
+
title: isNameTruncated(item.name) ? item.name : void 0
|
|
605
|
+
}, {
|
|
606
|
+
default: withCtx(() => [
|
|
607
|
+
createElementVNode("button", {
|
|
608
|
+
type: "button",
|
|
609
|
+
class: "regex-tag",
|
|
610
|
+
onClick: ($event) => fillRegex(item)
|
|
611
|
+
}, toDisplayString(truncateName(item.name)), 9, _hoisted_7)
|
|
612
|
+
]),
|
|
613
|
+
_: 2
|
|
614
|
+
}, 1032, ["title"]);
|
|
615
|
+
}), 128))
|
|
616
|
+
])) : createCommentVNode("", true)
|
|
617
|
+
]),
|
|
618
|
+
createVNode(_component_a_dropdown, {
|
|
619
|
+
visible: panelShown.value,
|
|
620
|
+
trigger: ["click"],
|
|
621
|
+
placement: "bottomRight",
|
|
622
|
+
destroyPopupOnHide: true,
|
|
623
|
+
overlayClassName: "regex-common-panel-dropdown",
|
|
624
|
+
align: { offset: [0, 8] },
|
|
625
|
+
onVisibleChange: onPanelVisibleChange
|
|
626
|
+
}, {
|
|
627
|
+
overlay: withCtx(() => [
|
|
628
|
+
createElementVNode("div", {
|
|
629
|
+
class: "regex-common-panel-overlay",
|
|
630
|
+
onMousedown: _cache[6] || (_cache[6] = withModifiers(() => {
|
|
631
|
+
}, ["stop"])),
|
|
632
|
+
onClick: _cache[7] || (_cache[7] = withModifiers(() => {
|
|
633
|
+
}, ["stop"]))
|
|
634
|
+
}, [
|
|
635
|
+
createElementVNode("div", _hoisted_8, [
|
|
636
|
+
panelShown.value ? (openBlock(), createBlock(CommonRegexPanel, {
|
|
637
|
+
key: 0,
|
|
638
|
+
ref_key: "commonPanelRef",
|
|
639
|
+
ref: commonPanelRef,
|
|
640
|
+
list: commonList.value,
|
|
641
|
+
"onUpdate:list": _cache[3] || (_cache[3] = ($event) => commonList.value = $event),
|
|
642
|
+
onFill: onFillFromPanel,
|
|
643
|
+
onDeleteConfirm: onDeleteConfirmChange
|
|
644
|
+
}, null, 8, ["list"])) : createCommentVNode("", true)
|
|
645
|
+
]),
|
|
646
|
+
deleteConfirm.value ? (openBlock(), createElementBlock("div", {
|
|
647
|
+
key: 0,
|
|
648
|
+
class: "delete-confirm",
|
|
649
|
+
style: normalizeStyle(deleteConfirm.value.style),
|
|
650
|
+
onMousedown: _cache[4] || (_cache[4] = withModifiers(() => {
|
|
651
|
+
}, ["stop"])),
|
|
652
|
+
onClick: _cache[5] || (_cache[5] = withModifiers(() => {
|
|
653
|
+
}, ["stop"]))
|
|
654
|
+
}, [
|
|
655
|
+
createElementVNode("div", _hoisted_9, [
|
|
656
|
+
_cache[11] || (_cache[11] = createElementVNode("i", { class: "iconfont icon-jinggao1 delete-confirm__icon" }, null, -1)),
|
|
657
|
+
createElementVNode("span", null, toDisplayString(_ctx.$t("sys.confirmExecution")), 1)
|
|
658
|
+
]),
|
|
659
|
+
createElementVNode("div", _hoisted_10, [
|
|
660
|
+
createVNode(_component_a_button, {
|
|
661
|
+
size: "small",
|
|
662
|
+
onClick: onCancelDelete
|
|
663
|
+
}, {
|
|
664
|
+
default: withCtx(() => [
|
|
665
|
+
createTextVNode(toDisplayString(_ctx.$t("sys.cancelText")), 1)
|
|
666
|
+
]),
|
|
667
|
+
_: 1
|
|
668
|
+
}),
|
|
669
|
+
createVNode(_component_a_button, {
|
|
670
|
+
type: "primary",
|
|
671
|
+
size: "small",
|
|
672
|
+
onClick: onConfirmDelete
|
|
673
|
+
}, {
|
|
674
|
+
default: withCtx(() => [
|
|
675
|
+
createTextVNode(toDisplayString(_ctx.$t("sys.okText")), 1)
|
|
676
|
+
]),
|
|
677
|
+
_: 1
|
|
678
|
+
})
|
|
679
|
+
])
|
|
680
|
+
], 36)) : createCommentVNode("", true)
|
|
681
|
+
], 32)
|
|
682
|
+
]),
|
|
683
|
+
default: withCtx(() => [
|
|
684
|
+
createVNode(_component_a_tooltip, {
|
|
685
|
+
title: panelShown.value ? void 0 : _ctx.$t("sys.regexEditor.commonReg")
|
|
686
|
+
}, {
|
|
687
|
+
default: withCtx(() => [
|
|
688
|
+
createElementVNode("button", {
|
|
689
|
+
type: "button",
|
|
690
|
+
class: normalizeClass(["regex-editor-modal__bookmark", { active: panelShown.value }])
|
|
691
|
+
}, [..._cache[12] || (_cache[12] = [
|
|
692
|
+
createElementVNode("i", { class: "iconfont icon-changyongzhengze regex-editor-modal__bookmark-icon" }, null, -1)
|
|
693
|
+
])], 2)
|
|
694
|
+
]),
|
|
695
|
+
_: 1
|
|
696
|
+
}, 8, ["title"])
|
|
697
|
+
]),
|
|
698
|
+
_: 1
|
|
699
|
+
}, 8, ["visible"])
|
|
700
|
+
]),
|
|
701
|
+
errors.regex ? (openBlock(), createElementBlock("div", _hoisted_11, toDisplayString(errors.regex), 1)) : createCommentVNode("", true)
|
|
702
|
+
]),
|
|
703
|
+
createElementVNode("div", _hoisted_12, [
|
|
704
|
+
createElementVNode("div", {
|
|
705
|
+
class: normalizeClass(["regex-editor-modal__label", { "is-required": !!formState.regex }])
|
|
706
|
+
}, toDisplayString(_ctx.$t("sys.regexEditor.hint")), 3),
|
|
707
|
+
createVNode(_component_a_textarea, {
|
|
708
|
+
value: formState.regexHint,
|
|
709
|
+
"onUpdate:value": [
|
|
710
|
+
_cache[8] || (_cache[8] = ($event) => formState.regexHint = $event),
|
|
711
|
+
_cache[9] || (_cache[9] = ($event) => validateField("regexHint", { checkRequired: false }))
|
|
712
|
+
],
|
|
713
|
+
placeholder: _ctx.$t("sys.inputText"),
|
|
714
|
+
rows: 3,
|
|
715
|
+
onBlur: _cache[10] || (_cache[10] = ($event) => validateField("regexHint"))
|
|
716
|
+
}, null, 8, ["value", "placeholder"]),
|
|
717
|
+
errors.regexHint ? (openBlock(), createElementBlock("div", _hoisted_13, toDisplayString(errors.regexHint), 1)) : createCommentVNode("", true)
|
|
718
|
+
])
|
|
719
|
+
])
|
|
720
|
+
]),
|
|
721
|
+
_: 1
|
|
722
|
+
});
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
const RegexEditorModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-add4864b"]]);
|
|
727
|
+
const _hoisted_1 = { class: "regex-editor__label" };
|
|
728
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
729
|
+
__name: "regex-editor",
|
|
730
|
+
props: {
|
|
731
|
+
regex: {},
|
|
732
|
+
regexHint: {},
|
|
733
|
+
disabled: { type: Boolean }
|
|
734
|
+
},
|
|
735
|
+
emits: ["update:regex", "update:regexHint"],
|
|
736
|
+
setup(__props, { emit: __emit }) {
|
|
737
|
+
const props = __props;
|
|
738
|
+
const emit = __emit;
|
|
739
|
+
const hasRegex = computed(() => !!(props.regex && props.regexHint));
|
|
740
|
+
const openModal = async () => {
|
|
741
|
+
if (props.disabled) return;
|
|
742
|
+
const result = await window.NocodeAdapter.utils.overlay.modal(
|
|
743
|
+
RegexEditorModal,
|
|
744
|
+
{
|
|
745
|
+
value: hasRegex.value ? { regex: props.regex, regexHint: props.regexHint } : void 0
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
title: $t("sys.regexEditor.config"),
|
|
749
|
+
width: 640,
|
|
750
|
+
minHeight: 250,
|
|
751
|
+
showFooter: true,
|
|
752
|
+
okText: $t("sys.okText"),
|
|
753
|
+
cancelText: $t("sys.cancelText")
|
|
754
|
+
}
|
|
755
|
+
);
|
|
756
|
+
if (!result.ok) return;
|
|
757
|
+
const data = result.data?.[0] || {};
|
|
758
|
+
emit("update:regex", data.regex);
|
|
759
|
+
emit("update:regexHint", data.regexHint);
|
|
760
|
+
};
|
|
761
|
+
return (_ctx, _cache) => {
|
|
762
|
+
const _component_a_tooltip = resolveComponent("a-tooltip");
|
|
763
|
+
return openBlock(), createBlock(FormItem, { inline: false }, {
|
|
764
|
+
label: withCtx(() => [
|
|
765
|
+
createElementVNode("div", _hoisted_1, [
|
|
766
|
+
createElementVNode("span", null, toDisplayString(_ctx.$t("sys.regexEditor.regexValidate")), 1),
|
|
767
|
+
createVNode(_component_a_tooltip, {
|
|
768
|
+
placement: "top",
|
|
769
|
+
"overlay-class-name": "regex-editor-popper"
|
|
770
|
+
}, {
|
|
771
|
+
title: withCtx(() => [
|
|
772
|
+
createTextVNode(toDisplayString(_ctx.$t("sys.regexEditor.validateTip")), 1)
|
|
773
|
+
]),
|
|
774
|
+
default: withCtx(() => [
|
|
775
|
+
_cache[0] || (_cache[0] = createElementVNode("i", { class: "iconfont icon-assist regex-editor__tip" }, null, -1))
|
|
776
|
+
]),
|
|
777
|
+
_: 1
|
|
778
|
+
})
|
|
779
|
+
])
|
|
780
|
+
]),
|
|
781
|
+
default: withCtx(() => [
|
|
782
|
+
createElementVNode("div", {
|
|
783
|
+
class: normalizeClass(["regex-editor__button", [hasRegex.value ? "primary" : "default", __props.disabled && "is-disabled"]]),
|
|
784
|
+
onClick: openModal
|
|
785
|
+
}, toDisplayString(hasRegex.value ? _ctx.$t("sys.regexEditor.editExpr") : _ctx.$t("sys.regexEditor.addExpr")), 3)
|
|
786
|
+
]),
|
|
787
|
+
_: 1
|
|
788
|
+
});
|
|
789
|
+
};
|
|
790
|
+
}
|
|
791
|
+
});
|
|
792
|
+
const RegexEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b9fb4434"]]);
|
|
793
|
+
export {
|
|
794
|
+
NumberRange as N,
|
|
795
|
+
RegexEditor as R
|
|
796
|
+
};
|