@keyiis/formula-editor
Advanced tools
+24
-2
@@ -80,2 +80,3 @@ import type { AllowedComponentProps } from 'vue'; | ||
| default?: any; | ||
| defaultUnSelect?: any; | ||
| } | undefined; | ||
@@ -218,2 +219,19 @@ useFormula?: boolean | undefined; | ||
| }, {}>; | ||
| ItemElement: DefineComponent<{ | ||
| item: { | ||
| type: PropType<IItem>; | ||
| required: true; | ||
| default: any; | ||
| }; | ||
| }, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, "dblclick"[], "dblclick", VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{ | ||
| item: { | ||
| type: PropType<IItem>; | ||
| required: true; | ||
| default: any; | ||
| }; | ||
| }>> & { | ||
| onDblclick?: ((...args: any[]) => any) | undefined; | ||
| }, { | ||
| item: IItem; | ||
| }, {}>; | ||
| }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("update:expression" | "update:itemIds")[], "update:expression" | "update:itemIds", VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{ | ||
@@ -405,3 +423,3 @@ originItems: { | ||
| /** | ||
| * 是否必填 | ||
| * 是否必填(如雇主没有填值会使用默认值) | ||
| */ | ||
@@ -458,5 +476,9 @@ requird?:boolean; | ||
| /** | ||
| * 默认值 | ||
| * 默认值(雇主在做工资时未录入时使用的值) | ||
| */ | ||
| default?:any; | ||
| /** | ||
| * 默认值(雇主的工资配置表中没有该项时使用的值) | ||
| */ | ||
| defaultUnSelect?:any; | ||
| }; | ||
@@ -463,0 +485,0 @@ /** |
+150
-121
@@ -1,6 +0,6 @@ | ||
| (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".set-formula-frame[data-v-f3a47261]{color:initial;flex:1;overflow:hidden;display:flex;border:1.5px solid #dcdfe6;border-radius:4px;height:300px}.set-formula-frame .items-pannel[data-v-f3a47261]{width:250px;display:flex;flex-direction:column;overflow:hidden;border-right:1.5px solid #dcdfe6}.set-formula-frame .items-pannel .search-ipt[data-v-f3a47261]{display:flex;align-items:center;box-sizing:border-box;height:33px}.set-formula-frame .items-pannel .search-ipt input[data-v-f3a47261]{flex:1;padding-left:5px;border:0;outline:none;font-size:16px}.set-formula-frame .items-pannel .search-ipt .clear-btn[data-v-f3a47261]{height:18px;width:18px;border:1.5px solid #9E9E9E;border-radius:50%;font-size:5px;font-weight:700;color:#9e9e9e;margin-right:5px;display:flex;justify-content:center;align-items:center;user-select:none;cursor:pointer}.set-formula-frame .items-pannel .sitems[data-v-f3a47261]{flex:1;overflow-y:auto;border-top:1.5px solid #dcdfe6;text-align:left}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261]{user-select:none;padding:5px;cursor:pointer;display:flex;align-items:center}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261] .el-icon{font-size:20px;padding:0;color:#409eff}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261]:not(:last-child){border-bottom:1px solid #eee}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261]:hover{background:#eee}.set-formula-frame .items-pannel .sitems .item-name[data-v-f3a47261]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.set-formula-frame .formula-tip[data-v-f3a47261]{border-radius:4px;font-size:5px;background:#409EFF;color:#fff;padding:0 5px;line-height:18px}.set-formula-frame .formula-pannel[data-v-f3a47261]{flex:1;display:flex;flex-direction:column}.set-formula-frame .formula-pannel .formula-hedaer[data-v-f3a47261]{display:flex;height:33px;border-bottom:1.5px solid #dcdfe6;align-items:center;padding:0 10px}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns[data-v-f3a47261]{margin-left:auto;display:flex;align-items:center}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns>*[data-v-f3a47261]{height:25px;cursor:pointer;margin-left:10px}.set-formula-frame .item-ghost[data-v-f3a47261]{float:left;width:0px;border:2px solid red;height:30px;overflow:hidden}.set-formula-frame .formula-pannel .formula[data-v-f3a47261]{flex:1;overflow-y:auto}.set-formula-frame .formula-pannel .formula .formula-item[data-v-f3a47261]{float:left;margin:2px;height:32px;overflow-y:hidden}.set-formula-frame .formula-pannel .formula .formula-item>*[data-v-f3a47261]{height:100%;overflow:hidden;display:flex;align-items:center;border-radius:5px;line-height:24px}.set-formula-frame .formula-pannel .formula .formula-item>*[data-v-f3a47261]:not(.input){border:none;justify-content:center;padding:0 5px;min-width:30px;cursor:pointer;color:#333;user-select:none}.set-formula-frame .formula-pannel .formula .formula-item .item[data-v-f3a47261]{background:#606266;color:#fff}.set-formula-frame .formula-pannel .formula .formula-item .item.use-formula[data-v-f3a47261]{background:#409EFF}.set-formula-frame .formula-pannel .formula .formula-item .operator[data-v-f3a47261]{font-size:25px;line-height:1;background:#eee}.set-formula-frame .formula-pannel .formula .formula-item .input[data-v-f3a47261]{display:flex;width:150px;align-items:center;border:1.5px solid #dcdfe6;background:#eee;box-sizing:border-box}.set-formula-frame .formula-pannel .formula .formula-item .input input[data-v-f3a47261]{flex:1;padding:5px;border:0;outline:none;min-width:50px;font-size:inherit;height:100%}.set-formula-frame .formula-pannel .formula .formula-item .input .move-handle[data-v-f3a47261]{padding:0 7px;cursor:pointer}.set-formula-frame .operators[data-v-f3a47261]{border-top:1.5px solid #dcdfe6}.set-formula-frame .operators>*[data-v-f3a47261]{float:left;padding:3px 5px;min-width:30px;margin:5px;cursor:pointer;background:#eee;color:#333;font-size:18px;border-radius:5px;border:none;text-align:center}.set-formula-frame[data-v-d455b305]{color:initial;flex:1;overflow:hidden;display:flex;border:1.5px solid #dcdfe6;border-radius:4px;height:300px}.set-formula-frame .items-pannel[data-v-d455b305]{width:250px;display:flex;flex-direction:column;overflow:hidden;border-right:1.5px solid #dcdfe6}.set-formula-frame .items-pannel .search-ipt[data-v-d455b305]{display:flex;align-items:center;box-sizing:border-box;height:33px}.set-formula-frame .items-pannel .search-ipt input[data-v-d455b305]{flex:1;padding-left:5px;border:0;outline:none;font-size:16px}.set-formula-frame .items-pannel .search-ipt .clear-btn[data-v-d455b305]{height:18px;width:18px;border:1.5px solid #9E9E9E;border-radius:50%;font-size:5px;font-weight:700;color:#9e9e9e;margin-right:5px;display:flex;justify-content:center;align-items:center;user-select:none;cursor:pointer}.set-formula-frame .items-pannel .sitems[data-v-d455b305]{flex:1;overflow-y:auto;border-top:1.5px solid #dcdfe6;text-align:left}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305]{user-select:none;padding:5px;cursor:pointer;display:flex;align-items:center}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305] .el-icon{font-size:20px;padding:0;color:#409eff}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305]:not(:last-child){border-bottom:1px solid #eee}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305]:hover{background:#eee}.set-formula-frame .items-pannel .sitems .item-name[data-v-d455b305]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.set-formula-frame .formula-tip[data-v-d455b305]{border-radius:4px;font-size:5px;background:#409EFF;color:#fff;padding:0 5px;line-height:18px}.set-formula-frame .formula-pannel[data-v-d455b305]{flex:1;display:flex;flex-direction:column}.set-formula-frame .formula-pannel .formula-hedaer[data-v-d455b305]{display:flex;height:33px;border-bottom:1.5px solid #dcdfe6;align-items:center;padding:0 10px}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns[data-v-d455b305]{margin-left:auto;display:flex;align-items:center}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns>*[data-v-d455b305]{height:25px;cursor:pointer;margin-left:10px}.set-formula-frame .formula-pannel[data-v-d455b305]{min-width:400px}.set-formula-frame .formula-pannel .script-content[data-v-d455b305]{text-align:initial;flex:1;overflow:auto}")),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})(); | ||
| var $ = Object.defineProperty; | ||
| var B = (e, t, o) => t in e ? $(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o; | ||
| var m = (e, t, o) => (B(e, typeof t != "symbol" ? t + "" : t, o), o); | ||
| import { defineComponent, ref, watch, onMounted, openBlock, createElementBlock, createElementVNode, withDirectives, vModelText, createCommentVNode, createVNode, unref, withCtx, toDisplayString, createBlock, normalizeClass, toRaw, pushScopeId, popScopeId, Fragment, renderList } from "vue"; | ||
| (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".item[data-v-0d254832]{background:#606266;color:#fff!important}.item.use-formula[data-v-0d254832]{background:#409EFF}.set-formula-frame[data-v-f3a47261]{color:initial;flex:1;overflow:hidden;display:flex;border:1.5px solid #dcdfe6;border-radius:4px;height:300px}.set-formula-frame .items-pannel[data-v-f3a47261]{width:250px;display:flex;flex-direction:column;overflow:hidden;border-right:1.5px solid #dcdfe6}.set-formula-frame .items-pannel .search-ipt[data-v-f3a47261]{display:flex;align-items:center;box-sizing:border-box;height:33px}.set-formula-frame .items-pannel .search-ipt input[data-v-f3a47261]{flex:1;padding-left:5px;border:0;outline:none;font-size:16px}.set-formula-frame .items-pannel .search-ipt .clear-btn[data-v-f3a47261]{height:18px;width:18px;border:1.5px solid #9E9E9E;border-radius:50%;font-size:5px;font-weight:700;color:#9e9e9e;margin-right:5px;display:flex;justify-content:center;align-items:center;user-select:none;cursor:pointer}.set-formula-frame .items-pannel .sitems[data-v-f3a47261]{flex:1;overflow-y:auto;border-top:1.5px solid #dcdfe6;text-align:left}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261]{user-select:none;padding:5px;cursor:pointer;display:flex;align-items:center}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261] .el-icon{font-size:20px;padding:0;color:#409eff}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261]:not(:last-child){border-bottom:1px solid #eee}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261]:hover{background:#eee}.set-formula-frame .items-pannel .sitems .item-name[data-v-f3a47261]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.set-formula-frame .formula-tip[data-v-f3a47261]{border-radius:4px;font-size:5px;background:#409EFF;color:#fff;padding:0 5px;line-height:18px}.set-formula-frame .formula-pannel[data-v-f3a47261]{flex:1;display:flex;flex-direction:column}.set-formula-frame .formula-pannel .formula-hedaer[data-v-f3a47261]{display:flex;height:33px;border-bottom:1.5px solid #dcdfe6;align-items:center;padding:0 10px}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns[data-v-f3a47261]{margin-left:auto;display:flex;align-items:center}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns>*[data-v-f3a47261]{height:25px;cursor:pointer;margin-left:10px}.set-formula-frame .item-ghost[data-v-f3a47261]{float:left;width:0px;border:2px solid red;height:30px;overflow:hidden}.set-formula-frame .formula-pannel .formula[data-v-f3a47261]{flex:1;overflow-y:auto}.set-formula-frame .formula-pannel .formula .formula-item[data-v-f3a47261]{float:left;margin:2px;height:32px;overflow-y:hidden}.set-formula-frame .formula-pannel .formula .formula-item>*[data-v-f3a47261]{height:100%;overflow:hidden;display:flex;align-items:center;border-radius:5px;line-height:24px}.set-formula-frame .formula-pannel .formula .formula-item>*[data-v-f3a47261]:not(.input){border:none;justify-content:center;padding:0 5px;min-width:30px;cursor:pointer;color:#333;user-select:none}.set-formula-frame .formula-pannel .formula .formula-item .operator[data-v-f3a47261]{font-size:25px;line-height:1;background:#eee}.set-formula-frame .formula-pannel .formula .formula-item .input[data-v-f3a47261]{display:flex;width:150px;align-items:center;border:1.5px solid #dcdfe6;background:#eee;box-sizing:border-box}.set-formula-frame .formula-pannel .formula .formula-item .input input[data-v-f3a47261]{flex:1;padding:5px;border:0;outline:none;min-width:50px;font-size:inherit;height:100%}.set-formula-frame .formula-pannel .formula .formula-item .input .move-handle[data-v-f3a47261]{padding:0 7px;cursor:pointer}.set-formula-frame .operators[data-v-f3a47261]{border-top:1.5px solid #dcdfe6}.set-formula-frame .operators>*[data-v-f3a47261]{float:left;padding:3px 5px;min-width:30px;margin:5px;cursor:pointer;background:#eee;color:#333;font-size:18px;border-radius:5px;border:none;text-align:center}.set-formula-frame[data-v-d455b305]{color:initial;flex:1;overflow:hidden;display:flex;border:1.5px solid #dcdfe6;border-radius:4px;height:300px}.set-formula-frame .items-pannel[data-v-d455b305]{width:250px;display:flex;flex-direction:column;overflow:hidden;border-right:1.5px solid #dcdfe6}.set-formula-frame .items-pannel .search-ipt[data-v-d455b305]{display:flex;align-items:center;box-sizing:border-box;height:33px}.set-formula-frame .items-pannel .search-ipt input[data-v-d455b305]{flex:1;padding-left:5px;border:0;outline:none;font-size:16px}.set-formula-frame .items-pannel .search-ipt .clear-btn[data-v-d455b305]{height:18px;width:18px;border:1.5px solid #9E9E9E;border-radius:50%;font-size:5px;font-weight:700;color:#9e9e9e;margin-right:5px;display:flex;justify-content:center;align-items:center;user-select:none;cursor:pointer}.set-formula-frame .items-pannel .sitems[data-v-d455b305]{flex:1;overflow-y:auto;border-top:1.5px solid #dcdfe6;text-align:left}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305]{user-select:none;padding:5px;cursor:pointer;display:flex;align-items:center}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305] .el-icon{font-size:20px;padding:0;color:#409eff}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305]:not(:last-child){border-bottom:1px solid #eee}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305]:hover{background:#eee}.set-formula-frame .items-pannel .sitems .item-name[data-v-d455b305]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.set-formula-frame .formula-tip[data-v-d455b305]{border-radius:4px;font-size:5px;background:#409EFF;color:#fff;padding:0 5px;line-height:18px}.set-formula-frame .formula-pannel[data-v-d455b305]{flex:1;display:flex;flex-direction:column}.set-formula-frame .formula-pannel .formula-hedaer[data-v-d455b305]{display:flex;height:33px;border-bottom:1.5px solid #dcdfe6;align-items:center;padding:0 10px}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns[data-v-d455b305]{margin-left:auto;display:flex;align-items:center}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns>*[data-v-d455b305]{height:25px;cursor:pointer;margin-left:10px}.set-formula-frame .items-pannel .sitem .previous[data-v-d455b305]{display:none;padding-left:10px;padding-right:10px;color:#f56c6c}.set-formula-frame .items-pannel .sitem:hover .previous[data-v-d455b305]{display:block!important}.set-formula-frame .formula-pannel[data-v-d455b305]{min-width:400px}.set-formula-frame .formula-pannel .script-content[data-v-d455b305]{text-align:initial;flex:1;overflow:auto}")),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})(); | ||
| var B = Object.defineProperty; | ||
| var x = (e, t, o) => t in e ? B(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o; | ||
| var v = (e, t, o) => (x(e, typeof t != "symbol" ? t + "" : t, o), o); | ||
| import { defineComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, ref, watch, onMounted, withDirectives, vModelText, createVNode, unref, withCtx, createBlock, toRaw, pushScopeId, popScopeId, Fragment, renderList } from "vue"; | ||
| import draggable from "vuedraggable"; | ||
@@ -11,3 +11,41 @@ import { Codemirror } from "vue-codemirror"; | ||
| import { oneDark } from "@codemirror/theme-one-dark"; | ||
| const _withScopeId$1 = (e) => (pushScopeId("data-v-f3a47261"), e = e(), popScopeId(), e), _hoisted_1$1 = { class: "set-formula-frame" }, _hoisted_2$1 = { class: "items-pannel" }, _hoisted_3$1 = { class: "search-ipt" }, _hoisted_4$1 = ["onDblclick"], _hoisted_5$1 = { class: "item-name" }, _hoisted_6$1 = { | ||
| const _sfc_main$2 = /* @__PURE__ */ defineComponent({ | ||
| __name: "Item", | ||
| props: { | ||
| item: { type: Object, required: !0, default: {} } | ||
| }, | ||
| emits: ["dblclick"], | ||
| setup(e, { emit: t }) { | ||
| return (o, a) => { | ||
| var s, i, p; | ||
| return openBlock(), createElementBlock( | ||
| "div", | ||
| { | ||
| class: normalizeClass(["item", { "use-formula": (i = (s = o.item) == null ? void 0 : s.config) == null ? void 0 : i.useFormula }]), | ||
| onDblclick: a[0] || (a[0] = (_) => t("dblclick")) | ||
| }, | ||
| [ | ||
| createElementVNode( | ||
| "span", | ||
| null, | ||
| toDisplayString((p = o.item) == null ? void 0 : p.name), | ||
| 1 | ||
| /* TEXT */ | ||
| ), | ||
| createCommentVNode(' <span class="formula-tip" v-if="element.src.config.useFormula">公式</span> '), | ||
| createCommentVNode(` <el-icon v-if="element.config?.useFormula">\r | ||
| <Connection />\r | ||
| </el-icon> `) | ||
| ], | ||
| 34 | ||
| /* CLASS, HYDRATE_EVENTS */ | ||
| ); | ||
| }; | ||
| } | ||
| }), Item_vue_vue_type_style_index_0_scoped_0d254832_lang = "", _export_sfc = (e, t) => { | ||
| const o = e.__vccOpts || e; | ||
| for (const [a, s] of t) | ||
| o[a] = s; | ||
| return o; | ||
| }, ItemElement = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-0d254832"], ["__file", "D:/projects/hrone/payslip/client/formula-editor/src/components/Item.vue"]]), _withScopeId$1 = (e) => (pushScopeId("data-v-f3a47261"), e = e(), popScopeId(), e), _hoisted_1$1 = { class: "set-formula-frame" }, _hoisted_2$1 = { class: "items-pannel" }, _hoisted_3$1 = { class: "search-ipt" }, _hoisted_4$1 = ["onDblclick"], _hoisted_5$1 = { class: "item-name" }, _hoisted_6$1 = { | ||
| key: 0, | ||
@@ -56,6 +94,6 @@ class: "formula-tip" | ||
| _hoisted_16$1 | ||
| ], _hoisted_18$1 = { class: "formula-item" }, _hoisted_19 = ["onDblclick"], _hoisted_20 = ["onDblclick"], _hoisted_21 = { | ||
| ], _hoisted_18$1 = { class: "formula-item" }, _hoisted_19$1 = ["onDblclick"], _hoisted_20 = { | ||
| key: 2, | ||
| class: "input" | ||
| }, _hoisted_22 = ["onUpdate:modelValue"], _hoisted_23 = ["onDblclick"], _hoisted_24 = ["onDblclick"], _sfc_main$1 = /* @__PURE__ */ defineComponent({ | ||
| }, _hoisted_21 = ["onUpdate:modelValue"], _hoisted_22 = ["onDblclick"], _hoisted_23 = ["onDblclick"], _sfc_main$1 = /* @__PURE__ */ defineComponent({ | ||
| __name: "EditFormula", | ||
@@ -157,3 +195,3 @@ props: { | ||
| let str = formula.reduce((e, t) => (t.type == "input" && e.push(t.val), t.type == "item" && e.push(getRandomInt(1, 100)), t.type == "operator" && e.push(t.val), e), []).join(" "); | ||
| console.log(str); | ||
| console.log(formula, str); | ||
| try { | ||
@@ -272,26 +310,15 @@ console.log(eval(str)), validResult.value = !0, emit("update:expression", clearSrc(formula)), emit("update:itemIds", extractItemId(formula)); | ||
| item: withCtx(({ element: o, index: a }) => { | ||
| var i, s; | ||
| var s; | ||
| return [ | ||
| createElementVNode("div", _hoisted_18$1, [ | ||
| o.type == "item" ? (openBlock(), createElementBlock("div", { | ||
| o.type == "item" ? (openBlock(), createBlock(ItemElement, { | ||
| key: 0, | ||
| class: normalizeClass(["item move-handle", { "use-formula": o.src.config.useFormula }]), | ||
| onDblclick: (c) => del(a) | ||
| }, [ | ||
| createElementVNode( | ||
| "span", | ||
| null, | ||
| toDisplayString((i = o.src) == null ? void 0 : i.name), | ||
| 1 | ||
| /* TEXT */ | ||
| ), | ||
| createCommentVNode(' <span class="formula-tip" v-if="element.src.config.useFormula">公式</span> '), | ||
| createCommentVNode(` <el-icon v-if="element.config?.useFormula">\r | ||
| <Connection />\r | ||
| </el-icon> `) | ||
| ], 42, _hoisted_19)) : createCommentVNode("v-if", !0), | ||
| class: "move-handle", | ||
| item: o.src, | ||
| onDblclick: (i) => del(a) | ||
| }, null, 8, ["item", "onDblclick"])) : createCommentVNode("v-if", !0), | ||
| o.type == "operator" ? (openBlock(), createElementBlock("div", { | ||
| key: 1, | ||
| class: "operator move-handle", | ||
| onDblclick: (c) => del(a) | ||
| onDblclick: (i) => del(a) | ||
| }, [ | ||
@@ -305,8 +332,8 @@ createElementVNode( | ||
| ) | ||
| ], 40, _hoisted_20)) : createCommentVNode("v-if", !0), | ||
| o.type == "input" ? (openBlock(), createElementBlock("div", _hoisted_21, [ | ||
| ], 40, _hoisted_19$1)) : createCommentVNode("v-if", !0), | ||
| o.type == "input" ? (openBlock(), createElementBlock("div", _hoisted_20, [ | ||
| withDirectives(createElementVNode("input", { | ||
| type: "number", | ||
| "onUpdate:modelValue": (c) => o.val = c | ||
| }, null, 8, _hoisted_22), [ | ||
| "onUpdate:modelValue": (i) => o.val = i | ||
| }, null, 8, _hoisted_21), [ | ||
| [vModelText, o.val] | ||
@@ -316,4 +343,4 @@ ]), | ||
| class: "move-handle", | ||
| onDblclick: (c) => del(a) | ||
| }, "⇄", 40, _hoisted_23), | ||
| onDblclick: (i) => del(a) | ||
| }, "⇄", 40, _hoisted_22), | ||
| createCommentVNode(` <el-input type="number" v-model="element.val">\r | ||
@@ -354,3 +381,3 @@ <template #prepend><el-icon class="move-handle" @dblclick="del(index)">\r | ||
| onDblclick: (a) => addOperator(o) | ||
| }, toDisplayString(o.name), 41, _hoisted_24)) | ||
| }, toDisplayString(o.name), 41, _hoisted_23)) | ||
| ]), | ||
@@ -363,8 +390,3 @@ _: 1 | ||
| } | ||
| }), EditFormula_vue_vue_type_style_index_0_scoped_f3a47261_lang = "", _export_sfc = (e, t) => { | ||
| const o = e.__vccOpts || e; | ||
| for (const [a, i] of t) | ||
| o[a] = i; | ||
| return o; | ||
| }, EditFormula = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-f3a47261"], ["__file", "D:/projects/hrone/payslip/client/formula-editor/src/components/EditFormula.vue"]]); | ||
| }), EditFormula_vue_vue_type_style_index_0_scoped_f3a47261_lang = "", EditFormula = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-f3a47261"], ["__file", "D:/projects/hrone/payslip/client/formula-editor/src/components/EditFormula.vue"]]); | ||
| class TestScriptRunner { | ||
@@ -377,3 +399,3 @@ constructor(e) { | ||
| */ | ||
| m(this, "perDefFuncs", new Proxy({}, { | ||
| v(this, "perDefFuncs", new Proxy({}, { | ||
| /** | ||
@@ -396,12 +418,12 @@ * 拦截所有属性和方法的调用,均返回0 | ||
| } | ||
| const _withScopeId = (e) => (pushScopeId("data-v-d455b305"), e = e(), popScopeId(), e), _hoisted_1 = { class: "set-formula-frame" }, _hoisted_2 = { class: "items-pannel" }, _hoisted_3 = { class: "search-ipt" }, _hoisted_4 = { class: "sitems" }, _hoisted_5 = ["onDblclick"], _hoisted_6 = { class: "item-name" }, _hoisted_7 = { | ||
| const _withScopeId = (e) => (pushScopeId("data-v-d455b305"), e = e(), popScopeId(), e), _hoisted_1 = { class: "set-formula-frame" }, _hoisted_2 = { class: "items-pannel" }, _hoisted_3 = { class: "search-ipt" }, _hoisted_4 = { class: "sitems" }, _hoisted_5 = { class: "sitem" }, _hoisted_6 = ["onDblclick"], _hoisted_7 = ["onDblclick"], _hoisted_8 = { | ||
| key: 0, | ||
| class: "formula-tip" | ||
| }, _hoisted_8 = { class: "formula-pannel" }, _hoisted_9 = { class: "formula-hedaer" }, _hoisted_10 = { | ||
| }, _hoisted_9 = { class: "formula-pannel" }, _hoisted_10 = { class: "formula-hedaer" }, _hoisted_11 = { | ||
| key: 0, | ||
| style: { color: "#67C23A" } | ||
| }, _hoisted_11 = { | ||
| }, _hoisted_12 = { | ||
| key: 1, | ||
| style: { color: "#F56C6C" } | ||
| }, _hoisted_12 = { class: "formula-hedaer-btns" }, _hoisted_13 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode( | ||
| }, _hoisted_13 = { class: "formula-hedaer-btns" }, _hoisted_14 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode( | ||
| "path", | ||
@@ -416,5 +438,5 @@ { | ||
| /* HOISTED */ | ||
| )), _hoisted_14 = [ | ||
| _hoisted_13 | ||
| ], _hoisted_15 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode( | ||
| )), _hoisted_15 = [ | ||
| _hoisted_14 | ||
| ], _hoisted_16 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode( | ||
| "path", | ||
@@ -429,3 +451,3 @@ { | ||
| /* HOISTED */ | ||
| )), _hoisted_16 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode( | ||
| )), _hoisted_17 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode( | ||
| "path", | ||
@@ -440,6 +462,6 @@ { | ||
| /* HOISTED */ | ||
| )), _hoisted_17 = [ | ||
| _hoisted_15, | ||
| _hoisted_16 | ||
| ], _hoisted_18 = { class: "script-content" }, defaultScript = `//请在这里编写脚本并return结果 | ||
| )), _hoisted_18 = [ | ||
| _hoisted_16, | ||
| _hoisted_17 | ||
| ], _hoisted_19 = { class: "script-content" }, defaultScript = `//请在这里编写脚本并return结果 | ||
| `, itemPattern = /\${(.*?)}/g, _sfc_main = /* @__PURE__ */ defineComponent({ | ||
@@ -454,14 +476,14 @@ __name: "EditScript", | ||
| setup(e, { emit: t }) { | ||
| const o = e, a = ref([]), i = ref(), s = ref(""); | ||
| class c extends WidgetType { | ||
| constructor(l) { | ||
| super(), this.itemId = l; | ||
| const o = e, a = ref([]), s = ref(), i = ref(""); | ||
| class p extends WidgetType { | ||
| constructor(l, n) { | ||
| super(), this.itemStr = l, this.pos = n; | ||
| } | ||
| eq(l) { | ||
| return this.itemId == l.itemId; | ||
| return this.itemStr == l.itemStr; | ||
| } | ||
| toDOM() { | ||
| var n; | ||
| let l = document.createElement("span"); | ||
| return l.style.cssText = ` | ||
| toDOM(l) { | ||
| var k; | ||
| let n = document.createElement("div"); | ||
| n.style.cssText = ` | ||
| border: 1px solid blue; | ||
@@ -471,14 +493,23 @@ border-radius: 4px; | ||
| color: #333; | ||
| background: #fff;`, l.innerText = (n = o.originItems.find((u) => u.id == this.itemId)) == null ? void 0 : n.name, l; | ||
| padding: 2px; | ||
| margin: 1px 3px; | ||
| display: inline-block; | ||
| background: #fff;`; | ||
| let [c, d] = this.itemStr.split("."), m = (k = o.originItems.find((S) => S.id == c)) == null ? void 0 : k.name; | ||
| return d == "pp" && (m += ":上期"), n.innerText = m, n; | ||
| } | ||
| // updateDOM(dom: HTMLElement, view: EditorView){ | ||
| // console.log("updateDOM",dom); | ||
| // return false; | ||
| // } | ||
| } | ||
| const _ = new MatchDecorator({ | ||
| regexp: itemPattern, | ||
| decoration: (r) => Decoration.replace({ | ||
| widget: new c(r[1]) | ||
| decoration: (r, l, n) => Decoration.replace({ | ||
| widget: new p(r[1], n) | ||
| }) | ||
| }), f = [ | ||
| }), y = [ | ||
| ViewPlugin.fromClass(class { | ||
| constructor(r) { | ||
| m(this, "placeholders"); | ||
| v(this, "placeholders"); | ||
| this.placeholders = _.createDeco(r); | ||
@@ -500,10 +531,10 @@ } | ||
| ]; | ||
| function v(r) { | ||
| function V(r) { | ||
| var l; | ||
| i.value = r.view, (l = i.value) == null || l.state.languageDataAt, console.log("handleReady", r); | ||
| s.value = r.view, (l = s.value) == null || l.state.languageDataAt, console.log("handleReady", r); | ||
| } | ||
| watch( | ||
| s, | ||
| i, | ||
| (r, l) => { | ||
| r && E(r); | ||
| r && N(r); | ||
| }, | ||
@@ -514,30 +545,30 @@ { deep: !0 } | ||
| onMounted(() => { | ||
| a.value = o.originItems, console.log("onMounted", o.script), h = o.script, s.value = o.script; | ||
| a.value = o.originItems, console.log("onMounted", o.script), h = o.script, i.value = o.script; | ||
| }); | ||
| function g(r) { | ||
| var n; | ||
| let l = i.value; | ||
| l.dispatch(l.state.replaceSelection("${" + r.id + "}")), console.log((n = i.value) == null ? void 0 : n.state); | ||
| function g(r, l) { | ||
| var d; | ||
| let n = s.value, c = r.id; | ||
| l && (c = `${c}.${l}`), n.dispatch(n.state.replaceSelection("${" + c + "}")), console.log((d = s.value) == null ? void 0 : d.state); | ||
| } | ||
| const d = ref(""); | ||
| const u = ref(""); | ||
| watch( | ||
| d, | ||
| u, | ||
| (r, l) => { | ||
| k(d.value); | ||
| E(u.value); | ||
| } | ||
| ); | ||
| function k(r) { | ||
| function E(r) { | ||
| r.length > 0 ? a.value = o.originItems.filter((l) => l.name && l.name.indexOf(r) > -1 || l.code && l.code.indexOf(r) > -1 || l.id && l.id.indexOf(r) > -1) : a.value = o.originItems; | ||
| } | ||
| function y() { | ||
| s.value = defaultScript, console.log("clearFormula", s.value); | ||
| function w() { | ||
| i.value = defaultScript, console.log("clearFormula", i.value); | ||
| } | ||
| function V() { | ||
| s.value = h, console.log("reset", s.value); | ||
| function I() { | ||
| i.value = h, console.log("reset", i.value); | ||
| } | ||
| function w(r, l) { | ||
| function $(r, l) { | ||
| return r = Math.ceil(r), l = Math.floor(l), Math.floor(Math.random() * (l - r)) + r; | ||
| } | ||
| const p = ref(!1); | ||
| function E(r = "") { | ||
| const f = ref(!1); | ||
| function N(r = "") { | ||
| if (r.length == 0) { | ||
@@ -550,6 +581,6 @@ t("update:script", r), t("update:itemIds", []); | ||
| let l = /* @__PURE__ */ new Set(); | ||
| const n = r.replace(itemPattern, (N, I) => (l.add(I), w(1, 100).toString())); | ||
| new TestScriptRunner(n).run(), p.value = !0, t("update:script", r), t("update:itemIds", Array.from(l)); | ||
| const n = r.replace(itemPattern, (d, m) => (l.add(m), $(1, 100).toString())); | ||
| new TestScriptRunner(n).run(), f.value = !0, t("update:script", r), t("update:itemIds", Array.from(l)); | ||
| } catch (l) { | ||
| console.error(l), p.value = !1; | ||
| console.error(l), f.value = !1; | ||
| } | ||
@@ -564,3 +595,3 @@ } | ||
| type: "text", | ||
| "onUpdate:modelValue": l[0] || (l[0] = (n) => d.value = n), | ||
| "onUpdate:modelValue": l[0] || (l[0] = (n) => u.value = n), | ||
| placeholder: "筛选" | ||
@@ -574,3 +605,3 @@ }, | ||
| vModelText, | ||
| d.value, | ||
| u.value, | ||
| void 0, | ||
@@ -580,6 +611,6 @@ { trim: !0 } | ||
| ]), | ||
| d.value.length > 0 ? (openBlock(), createElementBlock("div", { | ||
| u.value.length > 0 ? (openBlock(), createElementBlock("div", { | ||
| key: 0, | ||
| class: "clear-btn", | ||
| onClick: l[1] || (l[1] = (n) => d.value = "") | ||
| onClick: l[1] || (l[1] = (n) => u.value = "") | ||
| }, "✖")) : createCommentVNode("v-if", !0) | ||
@@ -592,19 +623,17 @@ ]), | ||
| renderList(a.value, (n) => { | ||
| var u; | ||
| return openBlock(), createElementBlock("div", { | ||
| class: "sitem", | ||
| onDblclick: (N) => g(n) | ||
| }, [ | ||
| createElementVNode( | ||
| "div", | ||
| _hoisted_6, | ||
| toDisplayString(n.name) + "(" + toDisplayString(n.code) + ")", | ||
| 1 | ||
| /* TEXT */ | ||
| ), | ||
| (u = n == null ? void 0 : n.config) != null && u.useFormula ? (openBlock(), createElementBlock("span", _hoisted_7, "公式")) : createCommentVNode("v-if", !0), | ||
| var c; | ||
| return openBlock(), createElementBlock("div", _hoisted_5, [ | ||
| createElementVNode("div", { | ||
| class: "item-name", | ||
| onDblclick: (d) => g(n) | ||
| }, toDisplayString(n.name) + "(" + toDisplayString(n.code) + ")", 41, _hoisted_6), | ||
| createElementVNode("div", { | ||
| class: "previous", | ||
| onDblclick: (d) => g(n, "pp") | ||
| }, "上期", 40, _hoisted_7), | ||
| (c = n == null ? void 0 : n.config) != null && c.useFormula ? (openBlock(), createElementBlock("span", _hoisted_8, "公式")) : createCommentVNode("v-if", !0), | ||
| createCommentVNode(` <el-icon v-if="element.config.useFormula">\r | ||
| <Connection />\r | ||
| </el-icon> `) | ||
| ], 40, _hoisted_5); | ||
| ]); | ||
| }), | ||
@@ -616,10 +645,10 @@ 256 | ||
| ]), | ||
| createElementVNode("div", _hoisted_8, [ | ||
| createElementVNode("div", _hoisted_9, [ | ||
| createElementVNode("div", _hoisted_9, [ | ||
| createElementVNode("div", _hoisted_10, [ | ||
| createElementVNode("div", null, [ | ||
| p.value ? (openBlock(), createElementBlock("span", _hoisted_10, "脚本验证通过!")) : (openBlock(), createElementBlock("span", _hoisted_11, "脚本验证失败!")) | ||
| f.value ? (openBlock(), createElementBlock("span", _hoisted_11, "脚本验证通过!")) : (openBlock(), createElementBlock("span", _hoisted_12, "脚本验证失败!")) | ||
| ]), | ||
| createElementVNode("div", _hoisted_12, [ | ||
| createElementVNode("div", _hoisted_13, [ | ||
| (openBlock(), createElementBlock("svg", { | ||
| onClick: V, | ||
| onClick: I, | ||
| t: "1684911643230", | ||
@@ -631,5 +660,5 @@ class: "icon", | ||
| "p-id": "3874" | ||
| }, _hoisted_14)), | ||
| }, _hoisted_15)), | ||
| (openBlock(), createElementBlock("svg", { | ||
| onClick: y, | ||
| onClick: w, | ||
| t: "1684911301803", | ||
@@ -641,3 +670,3 @@ class: "icon", | ||
| "p-id": "2719" | ||
| }, _hoisted_17)), | ||
| }, _hoisted_18)), | ||
| createCommentVNode(` <el-icon @click="clearFormula">\r | ||
@@ -648,6 +677,6 @@ <Delete />\r | ||
| ]), | ||
| createElementVNode("div", _hoisted_18, [ | ||
| createElementVNode("div", _hoisted_19, [ | ||
| createVNode(unref(Codemirror), { | ||
| modelValue: s.value, | ||
| "onUpdate:modelValue": l[2] || (l[2] = (n) => s.value = n), | ||
| modelValue: i.value, | ||
| "onUpdate:modelValue": l[2] || (l[2] = (n) => i.value = n), | ||
| placeholder: "Code goes here...", | ||
@@ -658,4 +687,4 @@ style: { height: "100%" }, | ||
| "tab-size": 2, | ||
| extensions: f, | ||
| onReady: v, | ||
| extensions: y, | ||
| onReady: V, | ||
| onChange: l[3] || (l[3] = (n) => console.log("change", n)), | ||
@@ -662,0 +691,0 @@ onFocus: l[4] || (l[4] = (n) => console.log("focus", n)), |
+13
-10
@@ -1,14 +0,14 @@ | ||
| (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".set-formula-frame[data-v-f3a47261]{color:initial;flex:1;overflow:hidden;display:flex;border:1.5px solid #dcdfe6;border-radius:4px;height:300px}.set-formula-frame .items-pannel[data-v-f3a47261]{width:250px;display:flex;flex-direction:column;overflow:hidden;border-right:1.5px solid #dcdfe6}.set-formula-frame .items-pannel .search-ipt[data-v-f3a47261]{display:flex;align-items:center;box-sizing:border-box;height:33px}.set-formula-frame .items-pannel .search-ipt input[data-v-f3a47261]{flex:1;padding-left:5px;border:0;outline:none;font-size:16px}.set-formula-frame .items-pannel .search-ipt .clear-btn[data-v-f3a47261]{height:18px;width:18px;border:1.5px solid #9E9E9E;border-radius:50%;font-size:5px;font-weight:700;color:#9e9e9e;margin-right:5px;display:flex;justify-content:center;align-items:center;user-select:none;cursor:pointer}.set-formula-frame .items-pannel .sitems[data-v-f3a47261]{flex:1;overflow-y:auto;border-top:1.5px solid #dcdfe6;text-align:left}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261]{user-select:none;padding:5px;cursor:pointer;display:flex;align-items:center}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261] .el-icon{font-size:20px;padding:0;color:#409eff}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261]:not(:last-child){border-bottom:1px solid #eee}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261]:hover{background:#eee}.set-formula-frame .items-pannel .sitems .item-name[data-v-f3a47261]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.set-formula-frame .formula-tip[data-v-f3a47261]{border-radius:4px;font-size:5px;background:#409EFF;color:#fff;padding:0 5px;line-height:18px}.set-formula-frame .formula-pannel[data-v-f3a47261]{flex:1;display:flex;flex-direction:column}.set-formula-frame .formula-pannel .formula-hedaer[data-v-f3a47261]{display:flex;height:33px;border-bottom:1.5px solid #dcdfe6;align-items:center;padding:0 10px}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns[data-v-f3a47261]{margin-left:auto;display:flex;align-items:center}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns>*[data-v-f3a47261]{height:25px;cursor:pointer;margin-left:10px}.set-formula-frame .item-ghost[data-v-f3a47261]{float:left;width:0px;border:2px solid red;height:30px;overflow:hidden}.set-formula-frame .formula-pannel .formula[data-v-f3a47261]{flex:1;overflow-y:auto}.set-formula-frame .formula-pannel .formula .formula-item[data-v-f3a47261]{float:left;margin:2px;height:32px;overflow-y:hidden}.set-formula-frame .formula-pannel .formula .formula-item>*[data-v-f3a47261]{height:100%;overflow:hidden;display:flex;align-items:center;border-radius:5px;line-height:24px}.set-formula-frame .formula-pannel .formula .formula-item>*[data-v-f3a47261]:not(.input){border:none;justify-content:center;padding:0 5px;min-width:30px;cursor:pointer;color:#333;user-select:none}.set-formula-frame .formula-pannel .formula .formula-item .item[data-v-f3a47261]{background:#606266;color:#fff}.set-formula-frame .formula-pannel .formula .formula-item .item.use-formula[data-v-f3a47261]{background:#409EFF}.set-formula-frame .formula-pannel .formula .formula-item .operator[data-v-f3a47261]{font-size:25px;line-height:1;background:#eee}.set-formula-frame .formula-pannel .formula .formula-item .input[data-v-f3a47261]{display:flex;width:150px;align-items:center;border:1.5px solid #dcdfe6;background:#eee;box-sizing:border-box}.set-formula-frame .formula-pannel .formula .formula-item .input input[data-v-f3a47261]{flex:1;padding:5px;border:0;outline:none;min-width:50px;font-size:inherit;height:100%}.set-formula-frame .formula-pannel .formula .formula-item .input .move-handle[data-v-f3a47261]{padding:0 7px;cursor:pointer}.set-formula-frame .operators[data-v-f3a47261]{border-top:1.5px solid #dcdfe6}.set-formula-frame .operators>*[data-v-f3a47261]{float:left;padding:3px 5px;min-width:30px;margin:5px;cursor:pointer;background:#eee;color:#333;font-size:18px;border-radius:5px;border:none;text-align:center}.set-formula-frame[data-v-d455b305]{color:initial;flex:1;overflow:hidden;display:flex;border:1.5px solid #dcdfe6;border-radius:4px;height:300px}.set-formula-frame .items-pannel[data-v-d455b305]{width:250px;display:flex;flex-direction:column;overflow:hidden;border-right:1.5px solid #dcdfe6}.set-formula-frame .items-pannel .search-ipt[data-v-d455b305]{display:flex;align-items:center;box-sizing:border-box;height:33px}.set-formula-frame .items-pannel .search-ipt input[data-v-d455b305]{flex:1;padding-left:5px;border:0;outline:none;font-size:16px}.set-formula-frame .items-pannel .search-ipt .clear-btn[data-v-d455b305]{height:18px;width:18px;border:1.5px solid #9E9E9E;border-radius:50%;font-size:5px;font-weight:700;color:#9e9e9e;margin-right:5px;display:flex;justify-content:center;align-items:center;user-select:none;cursor:pointer}.set-formula-frame .items-pannel .sitems[data-v-d455b305]{flex:1;overflow-y:auto;border-top:1.5px solid #dcdfe6;text-align:left}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305]{user-select:none;padding:5px;cursor:pointer;display:flex;align-items:center}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305] .el-icon{font-size:20px;padding:0;color:#409eff}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305]:not(:last-child){border-bottom:1px solid #eee}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305]:hover{background:#eee}.set-formula-frame .items-pannel .sitems .item-name[data-v-d455b305]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.set-formula-frame .formula-tip[data-v-d455b305]{border-radius:4px;font-size:5px;background:#409EFF;color:#fff;padding:0 5px;line-height:18px}.set-formula-frame .formula-pannel[data-v-d455b305]{flex:1;display:flex;flex-direction:column}.set-formula-frame .formula-pannel .formula-hedaer[data-v-d455b305]{display:flex;height:33px;border-bottom:1.5px solid #dcdfe6;align-items:center;padding:0 10px}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns[data-v-d455b305]{margin-left:auto;display:flex;align-items:center}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns>*[data-v-d455b305]{height:25px;cursor:pointer;margin-left:10px}.set-formula-frame .formula-pannel[data-v-d455b305]{min-width:400px}.set-formula-frame .formula-pannel .script-content[data-v-d455b305]{text-align:initial;flex:1;overflow:auto}")),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})(); | ||
| (function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vuedraggable"),require("vue-codemirror"),require("@codemirror/view"),require("@codemirror/lang-javascript"),require("@codemirror/theme-one-dark")):typeof define=="function"&&define.amd?define(["exports","vue","vuedraggable","vue-codemirror","@codemirror/view","@codemirror/lang-javascript","@codemirror/theme-one-dark"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.EditFormula={},e.Vue,e.vuedraggable,e["vue-codemirror"],e["@codemirror/view"],e["@codemirror/lang-javascript"],e["@codemirror/theme-one-dark"]))})(this,function(exports,vue,draggable,vueCodemirror,view,langJavascript,themeOneDark){"use strict";var x=Object.defineProperty;var $=(e,t,o)=>t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var p=(e,t,o)=>($(e,typeof t!="symbol"?t+"":t,o),o);const _withScopeId$1=e=>(vue.pushScopeId("data-v-f3a47261"),e=e(),vue.popScopeId(),e),_hoisted_1$1={class:"set-formula-frame"},_hoisted_2$1={class:"items-pannel"},_hoisted_3$1={class:"search-ipt"},_hoisted_4$1=["onDblclick"],_hoisted_5$1={class:"item-name"},_hoisted_6$1={key:0,class:"formula-tip"},_hoisted_7$1={class:"formula-pannel"},_hoisted_8$1={class:"formula-hedaer"},_hoisted_9$1={key:0},_hoisted_10$1={key:0,style:{color:"#67C23A"}},_hoisted_11$1={key:1,style:{color:"#F56C6C"}},_hoisted_12$1={class:"formula-hedaer-btns"},_hoisted_13$1=_withScopeId$1(()=>vue.createElementVNode("path",{d:"M931.07 384.75a368 368 0 0 0-704 95.25H64l192 192 192-192H288.91C312 333.51 439.12 221.13 592 221.13c169.21 0 306.87 137.66 306.87 306.87S761.21 834.87 592 834.87a307.37 307.37 0 0 1-194.56-69.55 30.57 30.57 0 0 0-38.79 47.25 368.1 368.1 0 0 0 572.42-427.82z","p-id":"3875",fill:"#707070"},null,-1)),_hoisted_14$1=[_hoisted_13$1],_hoisted_15$1=_withScopeId$1(()=>vue.createElementVNode("path",{d:"M764 208H656v-56H368v56H152v56h80v580a28 28 0 0 0 28 28h504a28 28 0 0 0 28-28V264h80v-56H764zM736 816H288V264h448v552z",fill:"#707070","p-id":"2720"},null,-1)),_hoisted_16$1=_withScopeId$1(()=>vue.createElementVNode("path",{d:"M392 368h56v360h-56zM576 368h56v360h-56z",fill:"#707070","p-id":"2721"},null,-1)),_hoisted_17$1=[_hoisted_15$1,_hoisted_16$1],_hoisted_18$1={class:"formula-item"},_hoisted_19=["onDblclick"],_hoisted_20=["onDblclick"],_hoisted_21={key:2,class:"input"},_hoisted_22=["onUpdate:modelValue"],_hoisted_23=["onDblclick"],_hoisted_24=["onDblclick"],_sfc_main$1=vue.defineComponent({__name:"EditFormula",props:{originItems:{type:Array,required:!0,default:[]},expression:{type:Array,required:!0,default:[]},itemIds:{type:Array,required:!0,default:[]}},emits:["update:expression","update:itemIds"],setup(__props,{emit}){const props=__props,items=vue.ref([]),operators=vue.ref([{name:"input",val:"录入"},{name:"+",val:"+"},{name:"-",val:"-"},{name:"×",val:"*"},{name:"/",val:"/"},{name:"(",val:"("},{name:")",val:")"}]),formula=vue.ref([]);vue.watch(formula,(e,t)=>{e&&validFormula(e)},{deep:!0});let originFormula=[];vue.onMounted(()=>{Array.isArray(props.expression)&&(formula.value=props.expression,originFormula=JSON.parse(JSON.stringify(props.expression))),items.value=props.originItems,initFormula()});function initFormula(){Array.isArray(props.expression)&&(formula.value=props.expression.map(e=>{if(e.type=="item"){let t=props.originItems.find(o=>o.id==e.val);if(t)return{...e,src:t}}else{let t=operators.value.find(o=>o.val==e.val);if(t)return{...e,src:t}}return e}),originFormula=JSON.parse(JSON.stringify(formula.value)))}function addItem(e){formula.value.push({_id:Date.now(),type:"item",val:e.id,src:vue.toRaw(e)})}function addOperator(e){formula.value.push({_id:Date.now(),type:"operator",val:e.val,src:vue.toRaw(e)})}function addInput(){formula.value.push({_id:Date.now(),type:"input",val:""})}function onAdd(e){if(console.log("onAdd",e),e.from.className=="sitems"){let t=items.value[e.oldIndex];t&&(formula.value[e.newIndex]={_id:Date.now(),type:"item",val:t.id,src:vue.toRaw(t)})}if(e.item.className=="operator"){let t=operators.value[e.oldIndex];t&&(formula.value[e.newIndex]={_id:Date.now(),type:"operator",val:t.val,src:vue.toRaw(t)})}e.item.className=="input"&&(formula.value[e.newIndex]={_id:Date.now(),type:"input",val:""})}function onEnd(e){console.log("onEnd",e)}function onSort(e){}function del(e){console.log("del",e,formula.value),formula.value.splice(e,1)}const searchKey=vue.ref("");vue.watch(searchKey,(e,t)=>{search(searchKey.value)});function search(e){e.length>0?items.value=props.originItems.filter(t=>t.name&&t.name.indexOf(e)>-1||t.code&&t.code.indexOf(e)>-1):items.value=props.originItems}function clearFormula(){formula.value=[],console.log("clearFormula",formula.value)}function resetFormula(){formula.value=JSON.parse(JSON.stringify(originFormula)),console.log("clearFormula",formula.value)}function getRandomInt(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e}const validResult=vue.ref(!1);function validFormula(formula=[]){if(formula.length==0){emit("update:expression",clearSrc(formula)),emit("update:itemIds",extractItemId(formula));return}let str=formula.reduce((e,t)=>(t.type=="input"&&e.push(t.val),t.type=="item"&&e.push(getRandomInt(1,100)),t.type=="operator"&&e.push(t.val),e),[]).join(" ");console.log(str);try{console.log(eval(str)),validResult.value=!0,emit("update:expression",clearSrc(formula)),emit("update:itemIds",extractItemId(formula))}catch(e){console.error(e),validResult.value=!1}}function clearSrc(e=[]){return e.map(t=>({...t,src:void 0}))}function extractItemId(e=[]){return e.reduce((t,o)=>(o.type=="item"&&t.push(o.val),t),[])}return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1,[vue.createElementVNode("div",_hoisted_2$1,[vue.createElementVNode("div",_hoisted_3$1,[vue.withDirectives(vue.createElementVNode("input",{type:"text","onUpdate:modelValue":t[0]||(t[0]=o=>searchKey.value=o),placeholder:"筛选"},null,512),[[vue.vModelText,searchKey.value,void 0,{trim:!0}]]),searchKey.value.length>0?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"clear-btn",onClick:t[1]||(t[1]=o=>searchKey.value="")},"✖")):vue.createCommentVNode("v-if",!0)]),vue.createVNode(vue.unref(draggable),{class:"sitems",modelValue:items.value,"onUpdate:modelValue":t[2]||(t[2]=o=>items.value=o),group:{name:"shared",pull:"clone",put:!1},sort:!1,"item-key":"id"},{item:vue.withCtx(({element:o})=>[vue.createElementVNode("div",{class:"sitem",onDblclick:a=>addItem(o)},[vue.createElementVNode("div",_hoisted_5$1,vue.toDisplayString(o.name)+"("+vue.toDisplayString(o.code)+")",1),o.config.useFormula?(vue.openBlock(),vue.createElementBlock("span",_hoisted_6$1,"公式")):vue.createCommentVNode("v-if",!0),vue.createCommentVNode(` <el-icon v-if="element.config.useFormula">\r | ||
| (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".item[data-v-0d254832]{background:#606266;color:#fff!important}.item.use-formula[data-v-0d254832]{background:#409EFF}.set-formula-frame[data-v-f3a47261]{color:initial;flex:1;overflow:hidden;display:flex;border:1.5px solid #dcdfe6;border-radius:4px;height:300px}.set-formula-frame .items-pannel[data-v-f3a47261]{width:250px;display:flex;flex-direction:column;overflow:hidden;border-right:1.5px solid #dcdfe6}.set-formula-frame .items-pannel .search-ipt[data-v-f3a47261]{display:flex;align-items:center;box-sizing:border-box;height:33px}.set-formula-frame .items-pannel .search-ipt input[data-v-f3a47261]{flex:1;padding-left:5px;border:0;outline:none;font-size:16px}.set-formula-frame .items-pannel .search-ipt .clear-btn[data-v-f3a47261]{height:18px;width:18px;border:1.5px solid #9E9E9E;border-radius:50%;font-size:5px;font-weight:700;color:#9e9e9e;margin-right:5px;display:flex;justify-content:center;align-items:center;user-select:none;cursor:pointer}.set-formula-frame .items-pannel .sitems[data-v-f3a47261]{flex:1;overflow-y:auto;border-top:1.5px solid #dcdfe6;text-align:left}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261]{user-select:none;padding:5px;cursor:pointer;display:flex;align-items:center}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261] .el-icon{font-size:20px;padding:0;color:#409eff}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261]:not(:last-child){border-bottom:1px solid #eee}.set-formula-frame .items-pannel .sitems .sitem[data-v-f3a47261]:hover{background:#eee}.set-formula-frame .items-pannel .sitems .item-name[data-v-f3a47261]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.set-formula-frame .formula-tip[data-v-f3a47261]{border-radius:4px;font-size:5px;background:#409EFF;color:#fff;padding:0 5px;line-height:18px}.set-formula-frame .formula-pannel[data-v-f3a47261]{flex:1;display:flex;flex-direction:column}.set-formula-frame .formula-pannel .formula-hedaer[data-v-f3a47261]{display:flex;height:33px;border-bottom:1.5px solid #dcdfe6;align-items:center;padding:0 10px}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns[data-v-f3a47261]{margin-left:auto;display:flex;align-items:center}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns>*[data-v-f3a47261]{height:25px;cursor:pointer;margin-left:10px}.set-formula-frame .item-ghost[data-v-f3a47261]{float:left;width:0px;border:2px solid red;height:30px;overflow:hidden}.set-formula-frame .formula-pannel .formula[data-v-f3a47261]{flex:1;overflow-y:auto}.set-formula-frame .formula-pannel .formula .formula-item[data-v-f3a47261]{float:left;margin:2px;height:32px;overflow-y:hidden}.set-formula-frame .formula-pannel .formula .formula-item>*[data-v-f3a47261]{height:100%;overflow:hidden;display:flex;align-items:center;border-radius:5px;line-height:24px}.set-formula-frame .formula-pannel .formula .formula-item>*[data-v-f3a47261]:not(.input){border:none;justify-content:center;padding:0 5px;min-width:30px;cursor:pointer;color:#333;user-select:none}.set-formula-frame .formula-pannel .formula .formula-item .operator[data-v-f3a47261]{font-size:25px;line-height:1;background:#eee}.set-formula-frame .formula-pannel .formula .formula-item .input[data-v-f3a47261]{display:flex;width:150px;align-items:center;border:1.5px solid #dcdfe6;background:#eee;box-sizing:border-box}.set-formula-frame .formula-pannel .formula .formula-item .input input[data-v-f3a47261]{flex:1;padding:5px;border:0;outline:none;min-width:50px;font-size:inherit;height:100%}.set-formula-frame .formula-pannel .formula .formula-item .input .move-handle[data-v-f3a47261]{padding:0 7px;cursor:pointer}.set-formula-frame .operators[data-v-f3a47261]{border-top:1.5px solid #dcdfe6}.set-formula-frame .operators>*[data-v-f3a47261]{float:left;padding:3px 5px;min-width:30px;margin:5px;cursor:pointer;background:#eee;color:#333;font-size:18px;border-radius:5px;border:none;text-align:center}.set-formula-frame[data-v-d455b305]{color:initial;flex:1;overflow:hidden;display:flex;border:1.5px solid #dcdfe6;border-radius:4px;height:300px}.set-formula-frame .items-pannel[data-v-d455b305]{width:250px;display:flex;flex-direction:column;overflow:hidden;border-right:1.5px solid #dcdfe6}.set-formula-frame .items-pannel .search-ipt[data-v-d455b305]{display:flex;align-items:center;box-sizing:border-box;height:33px}.set-formula-frame .items-pannel .search-ipt input[data-v-d455b305]{flex:1;padding-left:5px;border:0;outline:none;font-size:16px}.set-formula-frame .items-pannel .search-ipt .clear-btn[data-v-d455b305]{height:18px;width:18px;border:1.5px solid #9E9E9E;border-radius:50%;font-size:5px;font-weight:700;color:#9e9e9e;margin-right:5px;display:flex;justify-content:center;align-items:center;user-select:none;cursor:pointer}.set-formula-frame .items-pannel .sitems[data-v-d455b305]{flex:1;overflow-y:auto;border-top:1.5px solid #dcdfe6;text-align:left}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305]{user-select:none;padding:5px;cursor:pointer;display:flex;align-items:center}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305] .el-icon{font-size:20px;padding:0;color:#409eff}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305]:not(:last-child){border-bottom:1px solid #eee}.set-formula-frame .items-pannel .sitems .sitem[data-v-d455b305]:hover{background:#eee}.set-formula-frame .items-pannel .sitems .item-name[data-v-d455b305]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.set-formula-frame .formula-tip[data-v-d455b305]{border-radius:4px;font-size:5px;background:#409EFF;color:#fff;padding:0 5px;line-height:18px}.set-formula-frame .formula-pannel[data-v-d455b305]{flex:1;display:flex;flex-direction:column}.set-formula-frame .formula-pannel .formula-hedaer[data-v-d455b305]{display:flex;height:33px;border-bottom:1.5px solid #dcdfe6;align-items:center;padding:0 10px}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns[data-v-d455b305]{margin-left:auto;display:flex;align-items:center}.set-formula-frame .formula-pannel .formula-hedaer .formula-hedaer-btns>*[data-v-d455b305]{height:25px;cursor:pointer;margin-left:10px}.set-formula-frame .items-pannel .sitem .previous[data-v-d455b305]{display:none;padding-left:10px;padding-right:10px;color:#f56c6c}.set-formula-frame .items-pannel .sitem:hover .previous[data-v-d455b305]{display:block!important}.set-formula-frame .formula-pannel[data-v-d455b305]{min-width:400px}.set-formula-frame .formula-pannel .script-content[data-v-d455b305]{text-align:initial;flex:1;overflow:auto}")),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})(); | ||
| (function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vuedraggable"),require("vue-codemirror"),require("@codemirror/view"),require("@codemirror/lang-javascript"),require("@codemirror/theme-one-dark")):typeof define=="function"&&define.amd?define(["exports","vue","vuedraggable","vue-codemirror","@codemirror/view","@codemirror/lang-javascript","@codemirror/theme-one-dark"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.EditFormula={},e.Vue,e.vuedraggable,e["vue-codemirror"],e["@codemirror/view"],e["@codemirror/lang-javascript"],e["@codemirror/theme-one-dark"]))})(this,function(exports,vue,draggable,vueCodemirror,view,langJavascript,themeOneDark){"use strict";var S=Object.defineProperty;var B=(e,t,o)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var f=(e,t,o)=>(B(e,typeof t!="symbol"?t+"":t,o),o);const _sfc_main$2=vue.defineComponent({__name:"Item",props:{item:{type:Object,required:!0,default:{}}},emits:["dblclick"],setup(e,{emit:t}){return(o,i)=>{var s,a,v;return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["item",{"use-formula":(a=(s=o.item)==null?void 0:s.config)==null?void 0:a.useFormula}]),onDblclick:i[0]||(i[0]=m=>t("dblclick"))},[vue.createElementVNode("span",null,vue.toDisplayString((v=o.item)==null?void 0:v.name),1),vue.createCommentVNode(' <span class="formula-tip" v-if="element.src.config.useFormula">公式</span> '),vue.createCommentVNode(` <el-icon v-if="element.config?.useFormula">\r | ||
| <Connection />\r | ||
| </el-icon> `)],34)}}}),Item_vue_vue_type_style_index_0_scoped_0d254832_lang="",_export_sfc=(e,t)=>{const o=e.__vccOpts||e;for(const[i,s]of t)o[i]=s;return o},ItemElement=_export_sfc(_sfc_main$2,[["__scopeId","data-v-0d254832"],["__file","D:/projects/hrone/payslip/client/formula-editor/src/components/Item.vue"]]),_withScopeId$1=e=>(vue.pushScopeId("data-v-f3a47261"),e=e(),vue.popScopeId(),e),_hoisted_1$1={class:"set-formula-frame"},_hoisted_2$1={class:"items-pannel"},_hoisted_3$1={class:"search-ipt"},_hoisted_4$1=["onDblclick"],_hoisted_5$1={class:"item-name"},_hoisted_6$1={key:0,class:"formula-tip"},_hoisted_7$1={class:"formula-pannel"},_hoisted_8$1={class:"formula-hedaer"},_hoisted_9$1={key:0},_hoisted_10$1={key:0,style:{color:"#67C23A"}},_hoisted_11$1={key:1,style:{color:"#F56C6C"}},_hoisted_12$1={class:"formula-hedaer-btns"},_hoisted_13$1=_withScopeId$1(()=>vue.createElementVNode("path",{d:"M931.07 384.75a368 368 0 0 0-704 95.25H64l192 192 192-192H288.91C312 333.51 439.12 221.13 592 221.13c169.21 0 306.87 137.66 306.87 306.87S761.21 834.87 592 834.87a307.37 307.37 0 0 1-194.56-69.55 30.57 30.57 0 0 0-38.79 47.25 368.1 368.1 0 0 0 572.42-427.82z","p-id":"3875",fill:"#707070"},null,-1)),_hoisted_14$1=[_hoisted_13$1],_hoisted_15$1=_withScopeId$1(()=>vue.createElementVNode("path",{d:"M764 208H656v-56H368v56H152v56h80v580a28 28 0 0 0 28 28h504a28 28 0 0 0 28-28V264h80v-56H764zM736 816H288V264h448v552z",fill:"#707070","p-id":"2720"},null,-1)),_hoisted_16$1=_withScopeId$1(()=>vue.createElementVNode("path",{d:"M392 368h56v360h-56zM576 368h56v360h-56z",fill:"#707070","p-id":"2721"},null,-1)),_hoisted_17$1=[_hoisted_15$1,_hoisted_16$1],_hoisted_18$1={class:"formula-item"},_hoisted_19$1=["onDblclick"],_hoisted_20={key:2,class:"input"},_hoisted_21=["onUpdate:modelValue"],_hoisted_22=["onDblclick"],_hoisted_23=["onDblclick"],_sfc_main$1=vue.defineComponent({__name:"EditFormula",props:{originItems:{type:Array,required:!0,default:[]},expression:{type:Array,required:!0,default:[]},itemIds:{type:Array,required:!0,default:[]}},emits:["update:expression","update:itemIds"],setup(__props,{emit}){const props=__props,items=vue.ref([]),operators=vue.ref([{name:"input",val:"录入"},{name:"+",val:"+"},{name:"-",val:"-"},{name:"×",val:"*"},{name:"/",val:"/"},{name:"(",val:"("},{name:")",val:")"}]),formula=vue.ref([]);vue.watch(formula,(e,t)=>{e&&validFormula(e)},{deep:!0});let originFormula=[];vue.onMounted(()=>{Array.isArray(props.expression)&&(formula.value=props.expression,originFormula=JSON.parse(JSON.stringify(props.expression))),items.value=props.originItems,initFormula()});function initFormula(){Array.isArray(props.expression)&&(formula.value=props.expression.map(e=>{if(e.type=="item"){let t=props.originItems.find(o=>o.id==e.val);if(t)return{...e,src:t}}else{let t=operators.value.find(o=>o.val==e.val);if(t)return{...e,src:t}}return e}),originFormula=JSON.parse(JSON.stringify(formula.value)))}function addItem(e){formula.value.push({_id:Date.now(),type:"item",val:e.id,src:vue.toRaw(e)})}function addOperator(e){formula.value.push({_id:Date.now(),type:"operator",val:e.val,src:vue.toRaw(e)})}function addInput(){formula.value.push({_id:Date.now(),type:"input",val:""})}function onAdd(e){if(console.log("onAdd",e),e.from.className=="sitems"){let t=items.value[e.oldIndex];t&&(formula.value[e.newIndex]={_id:Date.now(),type:"item",val:t.id,src:vue.toRaw(t)})}if(e.item.className=="operator"){let t=operators.value[e.oldIndex];t&&(formula.value[e.newIndex]={_id:Date.now(),type:"operator",val:t.val,src:vue.toRaw(t)})}e.item.className=="input"&&(formula.value[e.newIndex]={_id:Date.now(),type:"input",val:""})}function onEnd(e){console.log("onEnd",e)}function onSort(e){}function del(e){console.log("del",e,formula.value),formula.value.splice(e,1)}const searchKey=vue.ref("");vue.watch(searchKey,(e,t)=>{search(searchKey.value)});function search(e){e.length>0?items.value=props.originItems.filter(t=>t.name&&t.name.indexOf(e)>-1||t.code&&t.code.indexOf(e)>-1):items.value=props.originItems}function clearFormula(){formula.value=[],console.log("clearFormula",formula.value)}function resetFormula(){formula.value=JSON.parse(JSON.stringify(originFormula)),console.log("clearFormula",formula.value)}function getRandomInt(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e}const validResult=vue.ref(!1);function validFormula(formula=[]){if(formula.length==0){emit("update:expression",clearSrc(formula)),emit("update:itemIds",extractItemId(formula));return}let str=formula.reduce((e,t)=>(t.type=="input"&&e.push(t.val),t.type=="item"&&e.push(getRandomInt(1,100)),t.type=="operator"&&e.push(t.val),e),[]).join(" ");console.log(formula,str);try{console.log(eval(str)),validResult.value=!0,emit("update:expression",clearSrc(formula)),emit("update:itemIds",extractItemId(formula))}catch(e){console.error(e),validResult.value=!1}}function clearSrc(e=[]){return e.map(t=>({...t,src:void 0}))}function extractItemId(e=[]){return e.reduce((t,o)=>(o.type=="item"&&t.push(o.val),t),[])}return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1,[vue.createElementVNode("div",_hoisted_2$1,[vue.createElementVNode("div",_hoisted_3$1,[vue.withDirectives(vue.createElementVNode("input",{type:"text","onUpdate:modelValue":t[0]||(t[0]=o=>searchKey.value=o),placeholder:"筛选"},null,512),[[vue.vModelText,searchKey.value,void 0,{trim:!0}]]),searchKey.value.length>0?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"clear-btn",onClick:t[1]||(t[1]=o=>searchKey.value="")},"✖")):vue.createCommentVNode("v-if",!0)]),vue.createVNode(vue.unref(draggable),{class:"sitems",modelValue:items.value,"onUpdate:modelValue":t[2]||(t[2]=o=>items.value=o),group:{name:"shared",pull:"clone",put:!1},sort:!1,"item-key":"id"},{item:vue.withCtx(({element:o})=>[vue.createElementVNode("div",{class:"sitem",onDblclick:i=>addItem(o)},[vue.createElementVNode("div",_hoisted_5$1,vue.toDisplayString(o.name)+"("+vue.toDisplayString(o.code)+")",1),o.config.useFormula?(vue.openBlock(),vue.createElementBlock("span",_hoisted_6$1,"公式")):vue.createCommentVNode("v-if",!0),vue.createCommentVNode(` <el-icon v-if="element.config.useFormula">\r | ||
| <Connection />\r | ||
| </el-icon> `)],40,_hoisted_4$1)]),_:1},8,["modelValue"])]),vue.createElementVNode("div",_hoisted_7$1,[vue.createElementVNode("div",_hoisted_8$1,[formula.value.length>0?(vue.openBlock(),vue.createElementBlock("div",_hoisted_9$1,[validResult.value?(vue.openBlock(),vue.createElementBlock("span",_hoisted_10$1,"公式验证通过!")):(vue.openBlock(),vue.createElementBlock("span",_hoisted_11$1,"公式验证失败!"))])):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",_hoisted_12$1,[(vue.openBlock(),vue.createElementBlock("svg",{onClick:resetFormula,t:"1684911643230",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"3874"},_hoisted_14$1)),(vue.openBlock(),vue.createElementBlock("svg",{onClick:clearFormula,t:"1684911301803",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2719"},_hoisted_17$1)),vue.createCommentVNode(` <el-icon @click="clearFormula">\r | ||
| <Delete />\r | ||
| </el-icon> `)])]),props.originItems.length>0?(vue.openBlock(),vue.createBlock(vue.unref(draggable),{key:0,class:"formula",modelValue:formula.value,"onUpdate:modelValue":t[3]||(t[3]=o=>formula.value=o),group:"shared",sort:!0,"item-key":"id",handle:".move-handle",onAdd,onEnd,onSort,"ghost-class":"item-ghost"},{item:vue.withCtx(({element:o,index:a})=>{var s,i;return[vue.createElementVNode("div",_hoisted_18$1,[o.type=="item"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["item move-handle",{"use-formula":o.src.config.useFormula}]),onDblclick:u=>del(a)},[vue.createElementVNode("span",null,vue.toDisplayString((s=o.src)==null?void 0:s.name),1),vue.createCommentVNode(' <span class="formula-tip" v-if="element.src.config.useFormula">公式</span> '),vue.createCommentVNode(` <el-icon v-if="element.config?.useFormula">\r | ||
| <Connection />\r | ||
| </el-icon> `)],42,_hoisted_19)):vue.createCommentVNode("v-if",!0),o.type=="operator"?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"operator move-handle",onDblclick:u=>del(a)},[vue.createElementVNode("span",null,vue.toDisplayString((i=o.src)==null?void 0:i.name),1)],40,_hoisted_20)):vue.createCommentVNode("v-if",!0),o.type=="input"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_21,[vue.withDirectives(vue.createElementVNode("input",{type:"number","onUpdate:modelValue":u=>o.val=u},null,8,_hoisted_22),[[vue.vModelText,o.val]]),vue.createElementVNode("div",{class:"move-handle",onDblclick:u=>del(a)},"⇄",40,_hoisted_23),vue.createCommentVNode(` <el-input type="number" v-model="element.val">\r | ||
| </el-icon> `)])]),props.originItems.length>0?(vue.openBlock(),vue.createBlock(vue.unref(draggable),{key:0,class:"formula",modelValue:formula.value,"onUpdate:modelValue":t[3]||(t[3]=o=>formula.value=o),group:"shared",sort:!0,"item-key":"id",handle:".move-handle",onAdd,onEnd,onSort,"ghost-class":"item-ghost"},{item:vue.withCtx(({element:o,index:i})=>{var s;return[vue.createElementVNode("div",_hoisted_18$1,[o.type=="item"?(vue.openBlock(),vue.createBlock(ItemElement,{key:0,class:"move-handle",item:o.src,onDblclick:a=>del(i)},null,8,["item","onDblclick"])):vue.createCommentVNode("v-if",!0),o.type=="operator"?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"operator move-handle",onDblclick:a=>del(i)},[vue.createElementVNode("span",null,vue.toDisplayString((s=o.src)==null?void 0:s.name),1)],40,_hoisted_19$1)):vue.createCommentVNode("v-if",!0),o.type=="input"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_20,[vue.withDirectives(vue.createElementVNode("input",{type:"number","onUpdate:modelValue":a=>o.val=a},null,8,_hoisted_21),[[vue.vModelText,o.val]]),vue.createElementVNode("div",{class:"move-handle",onDblclick:a=>del(i)},"⇄",40,_hoisted_22),vue.createCommentVNode(` <el-input type="number" v-model="element.val">\r | ||
| <template #prepend><el-icon class="move-handle" @dblclick="del(index)">\r | ||
| <Pointer />\r | ||
| </el-icon></template>\r | ||
| </el-input> `)])):vue.createCommentVNode("v-if",!0)])]}),_:1},8,["modelValue"])):vue.createCommentVNode("v-if",!0),vue.createVNode(vue.unref(draggable),{class:"operators",modelValue:operators.value,"onUpdate:modelValue":t[5]||(t[5]=o=>operators.value=o),group:{name:"shared",pull:"clone",put:!1},sort:!1,"item-key":"name"},{item:vue.withCtx(({element:o})=>[o.name=="input"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"input",onDblclick:t[4]||(t[4]=a=>addInput())},vue.toDisplayString(o.val),33)):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"operator",onDblclick:a=>addOperator(o)},vue.toDisplayString(o.name),41,_hoisted_24))]),_:1},8,["modelValue"])])]))}}),EditFormula_vue_vue_type_style_index_0_scoped_f3a47261_lang="",_export_sfc=(e,t)=>{const o=e.__vccOpts||e;for(const[a,s]of t)o[a]=s;return o},EditFormula=_export_sfc(_sfc_main$1,[["__scopeId","data-v-f3a47261"],["__file","D:/projects/hrone/payslip/client/formula-editor/src/components/EditFormula.vue"]]);class TestScriptRunner{constructor(e){p(this,"perDefFuncs",new Proxy({},{get:function(e,t){return console.log(`Calling method '${t}'`,e),()=>0}}));this.script=e}run(){let self=this,func=eval(`(self)=>{ ${this.script} }`),result=func(self);console.log(result)}}const _withScopeId=e=>(vue.pushScopeId("data-v-d455b305"),e=e(),vue.popScopeId(),e),_hoisted_1={class:"set-formula-frame"},_hoisted_2={class:"items-pannel"},_hoisted_3={class:"search-ipt"},_hoisted_4={class:"sitems"},_hoisted_5=["onDblclick"],_hoisted_6={class:"item-name"},_hoisted_7={key:0,class:"formula-tip"},_hoisted_8={class:"formula-pannel"},_hoisted_9={class:"formula-hedaer"},_hoisted_10={key:0,style:{color:"#67C23A"}},_hoisted_11={key:1,style:{color:"#F56C6C"}},_hoisted_12={class:"formula-hedaer-btns"},_hoisted_13=_withScopeId(()=>vue.createElementVNode("path",{d:"M931.07 384.75a368 368 0 0 0-704 95.25H64l192 192 192-192H288.91C312 333.51 439.12 221.13 592 221.13c169.21 0 306.87 137.66 306.87 306.87S761.21 834.87 592 834.87a307.37 307.37 0 0 1-194.56-69.55 30.57 30.57 0 0 0-38.79 47.25 368.1 368.1 0 0 0 572.42-427.82z","p-id":"3875",fill:"#707070"},null,-1)),_hoisted_14=[_hoisted_13],_hoisted_15=_withScopeId(()=>vue.createElementVNode("path",{d:"M764 208H656v-56H368v56H152v56h80v580a28 28 0 0 0 28 28h504a28 28 0 0 0 28-28V264h80v-56H764zM736 816H288V264h448v552z",fill:"#707070","p-id":"2720"},null,-1)),_hoisted_16=_withScopeId(()=>vue.createElementVNode("path",{d:"M392 368h56v360h-56zM576 368h56v360h-56z",fill:"#707070","p-id":"2721"},null,-1)),_hoisted_17=[_hoisted_15,_hoisted_16],_hoisted_18={class:"script-content"},defaultScript=`//请在这里编写脚本并return结果 | ||
| `,itemPattern=/\${(.*?)}/g,_sfc_main=vue.defineComponent({__name:"EditScript",props:{originItems:{type:Array,required:!0,default:[]},itemIds:{type:Array,required:!0,default:[]},script:{type:String,required:!0,default:defaultScript}},emits:["update:script","update:itemIds"],setup(e,{emit:t}){const o=e,a=vue.ref([]),s=vue.ref(),i=vue.ref("");class u extends view.WidgetType{constructor(r){super(),this.itemId=r}eq(r){return this.itemId==r.itemId}toDOM(){var n;let r=document.createElement("span");return r.style.cssText=` | ||
| </el-input> `)])):vue.createCommentVNode("v-if",!0)])]}),_:1},8,["modelValue"])):vue.createCommentVNode("v-if",!0),vue.createVNode(vue.unref(draggable),{class:"operators",modelValue:operators.value,"onUpdate:modelValue":t[5]||(t[5]=o=>operators.value=o),group:{name:"shared",pull:"clone",put:!1},sort:!1,"item-key":"name"},{item:vue.withCtx(({element:o})=>[o.name=="input"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"input",onDblclick:t[4]||(t[4]=i=>addInput())},vue.toDisplayString(o.val),33)):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"operator",onDblclick:i=>addOperator(o)},vue.toDisplayString(o.name),41,_hoisted_23))]),_:1},8,["modelValue"])])]))}}),EditFormula_vue_vue_type_style_index_0_scoped_f3a47261_lang="",EditFormula=_export_sfc(_sfc_main$1,[["__scopeId","data-v-f3a47261"],["__file","D:/projects/hrone/payslip/client/formula-editor/src/components/EditFormula.vue"]]);class TestScriptRunner{constructor(e){f(this,"perDefFuncs",new Proxy({},{get:function(e,t){return console.log(`Calling method '${t}'`,e),()=>0}}));this.script=e}run(){let self=this,func=eval(`(self)=>{ ${this.script} }`),result=func(self);console.log(result)}}const _withScopeId=e=>(vue.pushScopeId("data-v-d455b305"),e=e(),vue.popScopeId(),e),_hoisted_1={class:"set-formula-frame"},_hoisted_2={class:"items-pannel"},_hoisted_3={class:"search-ipt"},_hoisted_4={class:"sitems"},_hoisted_5={class:"sitem"},_hoisted_6=["onDblclick"],_hoisted_7=["onDblclick"],_hoisted_8={key:0,class:"formula-tip"},_hoisted_9={class:"formula-pannel"},_hoisted_10={class:"formula-hedaer"},_hoisted_11={key:0,style:{color:"#67C23A"}},_hoisted_12={key:1,style:{color:"#F56C6C"}},_hoisted_13={class:"formula-hedaer-btns"},_hoisted_14=_withScopeId(()=>vue.createElementVNode("path",{d:"M931.07 384.75a368 368 0 0 0-704 95.25H64l192 192 192-192H288.91C312 333.51 439.12 221.13 592 221.13c169.21 0 306.87 137.66 306.87 306.87S761.21 834.87 592 834.87a307.37 307.37 0 0 1-194.56-69.55 30.57 30.57 0 0 0-38.79 47.25 368.1 368.1 0 0 0 572.42-427.82z","p-id":"3875",fill:"#707070"},null,-1)),_hoisted_15=[_hoisted_14],_hoisted_16=_withScopeId(()=>vue.createElementVNode("path",{d:"M764 208H656v-56H368v56H152v56h80v580a28 28 0 0 0 28 28h504a28 28 0 0 0 28-28V264h80v-56H764zM736 816H288V264h448v552z",fill:"#707070","p-id":"2720"},null,-1)),_hoisted_17=_withScopeId(()=>vue.createElementVNode("path",{d:"M392 368h56v360h-56zM576 368h56v360h-56z",fill:"#707070","p-id":"2721"},null,-1)),_hoisted_18=[_hoisted_16,_hoisted_17],_hoisted_19={class:"script-content"},defaultScript=`//请在这里编写脚本并return结果 | ||
| `,itemPattern=/\${(.*?)}/g,_sfc_main=vue.defineComponent({__name:"EditScript",props:{originItems:{type:Array,required:!0,default:[]},itemIds:{type:Array,required:!0,default:[]},script:{type:String,required:!0,default:defaultScript}},emits:["update:script","update:itemIds"],setup(e,{emit:t}){const o=e,i=vue.ref([]),s=vue.ref(),a=vue.ref("");class v extends view.WidgetType{constructor(r,n){super(),this.itemStr=r,this.pos=n}eq(r){return this.itemStr==r.itemStr}toDOM(r){var k;let n=document.createElement("div");n.style.cssText=` | ||
| border: 1px solid blue; | ||
@@ -18,6 +18,9 @@ border-radius: 4px; | ||
| color: #333; | ||
| background: #fff;`,r.innerText=(n=o.originItems.find(d=>d.id==this.itemId))==null?void 0:n.name,r}}const m=new view.MatchDecorator({regexp:itemPattern,decoration:l=>view.Decoration.replace({widget:new u(l[1])})}),h=[view.ViewPlugin.fromClass(class{constructor(l){p(this,"placeholders");this.placeholders=m.createDeco(l)}update(l){this.placeholders=m.updateDeco(l,this.placeholders)}},{decorations:l=>l.placeholders,provide:l=>view.EditorView.atomicRanges.of(r=>{var n;return((n=r.plugin(l))==null?void 0:n.placeholders)||view.Decoration.none})}),langJavascript.javascript(),themeOneDark.oneDark];function f(l){var r;s.value=l.view,(r=s.value)==null||r.state.languageDataAt,console.log("handleReady",l)}vue.watch(i,(l,r)=>{l&&E(l)},{deep:!0});let _="";vue.onMounted(()=>{a.value=o.originItems,console.log("onMounted",o.script),_=o.script,i.value=o.script});function g(l){var n;let r=s.value;r.dispatch(r.state.replaceSelection("${"+l.id+"}")),console.log((n=s.value)==null?void 0:n.state)}const c=vue.ref("");vue.watch(c,(l,r)=>{k(c.value)});function k(l){l.length>0?a.value=o.originItems.filter(r=>r.name&&r.name.indexOf(l)>-1||r.code&&r.code.indexOf(l)>-1||r.id&&r.id.indexOf(l)>-1):a.value=o.originItems}function y(){i.value=defaultScript,console.log("clearFormula",i.value)}function V(){i.value=_,console.log("reset",i.value)}function w(l,r){return l=Math.ceil(l),r=Math.floor(r),Math.floor(Math.random()*(r-l))+l}const v=vue.ref(!1);function E(l=""){if(l.length==0){t("update:script",l),t("update:itemIds",[]);return}console.log(l);try{let r=new Set;const n=l.replace(itemPattern,(I,N)=>(r.add(N),w(1,100).toString()));new TestScriptRunner(n).run(),v.value=!0,t("update:script",l),t("update:itemIds",Array.from(r))}catch(r){console.error(r),v.value=!1}}return(l,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1,[vue.createElementVNode("div",_hoisted_2,[vue.createElementVNode("div",_hoisted_3,[vue.withDirectives(vue.createElementVNode("input",{type:"text","onUpdate:modelValue":r[0]||(r[0]=n=>c.value=n),placeholder:"筛选"},null,512),[[vue.vModelText,c.value,void 0,{trim:!0}]]),c.value.length>0?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"clear-btn",onClick:r[1]||(r[1]=n=>c.value="")},"✖")):vue.createCommentVNode("v-if",!0)]),vue.createElementVNode("div",_hoisted_4,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(a.value,n=>{var d;return vue.openBlock(),vue.createElementBlock("div",{class:"sitem",onDblclick:I=>g(n)},[vue.createElementVNode("div",_hoisted_6,vue.toDisplayString(n.name)+"("+vue.toDisplayString(n.code)+")",1),(d=n==null?void 0:n.config)!=null&&d.useFormula?(vue.openBlock(),vue.createElementBlock("span",_hoisted_7,"公式")):vue.createCommentVNode("v-if",!0),vue.createCommentVNode(` <el-icon v-if="element.config.useFormula">\r | ||
| padding: 2px; | ||
| margin: 1px 3px; | ||
| display: inline-block; | ||
| background: #fff;`;let[u,c]=this.itemStr.split("."),p=(k=o.originItems.find(N=>N.id==u))==null?void 0:k.name;return c=="pp"&&(p+=":上期"),n.innerText=p,n}}const m=new view.MatchDecorator({regexp:itemPattern,decoration:(l,r,n)=>view.Decoration.replace({widget:new v(l[1],n)})}),y=[view.ViewPlugin.fromClass(class{constructor(l){f(this,"placeholders");this.placeholders=m.createDeco(l)}update(l){this.placeholders=m.updateDeco(l,this.placeholders)}},{decorations:l=>l.placeholders,provide:l=>view.EditorView.atomicRanges.of(r=>{var n;return((n=r.plugin(l))==null?void 0:n.placeholders)||view.Decoration.none})}),langJavascript.javascript(),themeOneDark.oneDark];function V(l){var r;s.value=l.view,(r=s.value)==null||r.state.languageDataAt,console.log("handleReady",l)}vue.watch(a,(l,r)=>{l&&x(l)},{deep:!0});let h="";vue.onMounted(()=>{i.value=o.originItems,console.log("onMounted",o.script),h=o.script,a.value=o.script});function g(l,r){var c;let n=s.value,u=l.id;r&&(u=`${u}.${r}`),n.dispatch(n.state.replaceSelection("${"+u+"}")),console.log((c=s.value)==null?void 0:c.state)}const d=vue.ref("");vue.watch(d,(l,r)=>{w(d.value)});function w(l){l.length>0?i.value=o.originItems.filter(r=>r.name&&r.name.indexOf(l)>-1||r.code&&r.code.indexOf(l)>-1||r.id&&r.id.indexOf(l)>-1):i.value=o.originItems}function E(){a.value=defaultScript,console.log("clearFormula",a.value)}function $(){a.value=h,console.log("reset",a.value)}function I(l,r){return l=Math.ceil(l),r=Math.floor(r),Math.floor(Math.random()*(r-l))+l}const _=vue.ref(!1);function x(l=""){if(l.length==0){t("update:script",l),t("update:itemIds",[]);return}console.log(l);try{let r=new Set;const n=l.replace(itemPattern,(c,p)=>(r.add(p),I(1,100).toString()));new TestScriptRunner(n).run(),_.value=!0,t("update:script",l),t("update:itemIds",Array.from(r))}catch(r){console.error(r),_.value=!1}}return(l,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1,[vue.createElementVNode("div",_hoisted_2,[vue.createElementVNode("div",_hoisted_3,[vue.withDirectives(vue.createElementVNode("input",{type:"text","onUpdate:modelValue":r[0]||(r[0]=n=>d.value=n),placeholder:"筛选"},null,512),[[vue.vModelText,d.value,void 0,{trim:!0}]]),d.value.length>0?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"clear-btn",onClick:r[1]||(r[1]=n=>d.value="")},"✖")):vue.createCommentVNode("v-if",!0)]),vue.createElementVNode("div",_hoisted_4,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.value,n=>{var u;return vue.openBlock(),vue.createElementBlock("div",_hoisted_5,[vue.createElementVNode("div",{class:"item-name",onDblclick:c=>g(n)},vue.toDisplayString(n.name)+"("+vue.toDisplayString(n.code)+")",41,_hoisted_6),vue.createElementVNode("div",{class:"previous",onDblclick:c=>g(n,"pp")},"上期",40,_hoisted_7),(u=n==null?void 0:n.config)!=null&&u.useFormula?(vue.openBlock(),vue.createElementBlock("span",_hoisted_8,"公式")):vue.createCommentVNode("v-if",!0),vue.createCommentVNode(` <el-icon v-if="element.config.useFormula">\r | ||
| <Connection />\r | ||
| </el-icon> `)],40,_hoisted_5)}),256))])]),vue.createElementVNode("div",_hoisted_8,[vue.createElementVNode("div",_hoisted_9,[vue.createElementVNode("div",null,[v.value?(vue.openBlock(),vue.createElementBlock("span",_hoisted_10,"脚本验证通过!")):(vue.openBlock(),vue.createElementBlock("span",_hoisted_11,"脚本验证失败!"))]),vue.createElementVNode("div",_hoisted_12,[(vue.openBlock(),vue.createElementBlock("svg",{onClick:V,t:"1684911643230",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"3874"},_hoisted_14)),(vue.openBlock(),vue.createElementBlock("svg",{onClick:y,t:"1684911301803",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2719"},_hoisted_17)),vue.createCommentVNode(` <el-icon @click="clearFormula">\r | ||
| </el-icon> `)])}),256))])]),vue.createElementVNode("div",_hoisted_9,[vue.createElementVNode("div",_hoisted_10,[vue.createElementVNode("div",null,[_.value?(vue.openBlock(),vue.createElementBlock("span",_hoisted_11,"脚本验证通过!")):(vue.openBlock(),vue.createElementBlock("span",_hoisted_12,"脚本验证失败!"))]),vue.createElementVNode("div",_hoisted_13,[(vue.openBlock(),vue.createElementBlock("svg",{onClick:$,t:"1684911643230",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"3874"},_hoisted_15)),(vue.openBlock(),vue.createElementBlock("svg",{onClick:E,t:"1684911301803",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2719"},_hoisted_18)),vue.createCommentVNode(` <el-icon @click="clearFormula">\r | ||
| <Delete />\r | ||
| </el-icon> `)])]),vue.createElementVNode("div",_hoisted_18,[vue.createVNode(vue.unref(vueCodemirror.Codemirror),{modelValue:i.value,"onUpdate:modelValue":r[2]||(r[2]=n=>i.value=n),placeholder:"Code goes here...",style:{height:"100%"},autofocus:!0,"indent-with-tab":!0,"tab-size":2,extensions:h,onReady:f,onChange:r[3]||(r[3]=n=>console.log("change",n)),onFocus:r[4]||(r[4]=n=>console.log("focus",n)),onBlur:r[5]||(r[5]=n=>console.log("blur",n)),ref:"codeMirror"},null,8,["modelValue"])])])]))}}),EditScript_vue_vue_type_style_index_0_scoped_d455b305_lang="",EditScript=_export_sfc(_sfc_main,[["__scopeId","data-v-d455b305"],["__file","D:/projects/hrone/payslip/client/formula-editor/src/components/EditScript.vue"]]);exports.EditFormula=EditFormula,exports.EditScript=EditScript,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}); | ||
| </el-icon> `)])]),vue.createElementVNode("div",_hoisted_19,[vue.createVNode(vue.unref(vueCodemirror.Codemirror),{modelValue:a.value,"onUpdate:modelValue":r[2]||(r[2]=n=>a.value=n),placeholder:"Code goes here...",style:{height:"100%"},autofocus:!0,"indent-with-tab":!0,"tab-size":2,extensions:y,onReady:V,onChange:r[3]||(r[3]=n=>console.log("change",n)),onFocus:r[4]||(r[4]=n=>console.log("focus",n)),onBlur:r[5]||(r[5]=n=>console.log("blur",n)),ref:"codeMirror"},null,8,["modelValue"])])])]))}}),EditScript_vue_vue_type_style_index_0_scoped_d455b305_lang="",EditScript=_export_sfc(_sfc_main,[["__scopeId","data-v-d455b305"],["__file","D:/projects/hrone/payslip/client/formula-editor/src/components/EditScript.vue"]]);exports.EditFormula=EditFormula,exports.EditScript=EditScript,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}); |
+1
-1
| { | ||
| "name": "@keyiis/formula-editor", | ||
| "version": "0.0.13", | ||
| "version": "0.0.14", | ||
| "description": "A formula-editor", | ||
@@ -5,0 +5,0 @@ "types": "index.es.d.ts", |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
73270
4.25%1333
4.3%