st-comp 0.0.215 → 0.0.216

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/es/CustomFunction.cjs +8 -1
  2. package/es/CustomFunction.js +532 -381
  3. package/es/FactorWarning.cjs +1 -1
  4. package/es/FactorWarning.js +28 -28
  5. package/es/Kline.cjs +1 -1
  6. package/es/Kline.js +10 -10
  7. package/es/KlineBasic.cjs +1 -1
  8. package/es/KlineBasic.js +18 -18
  9. package/es/KlineConfig.cjs +1 -1
  10. package/es/KlineConfig.js +15 -15
  11. package/es/KlineNew.cjs +1 -1
  12. package/es/KlineNew.js +9 -9
  13. package/es/KlinePlus.cjs +1 -1
  14. package/es/KlinePlus.js +11 -11
  15. package/es/Pagination.cjs +1 -1
  16. package/es/Pagination.js +13 -13
  17. package/es/PasswordPrompt.cjs +1 -1
  18. package/es/PasswordPrompt.js +2 -2
  19. package/es/Table.cjs +1 -1
  20. package/es/Table.js +29 -29
  21. package/es/User.cjs +1 -1
  22. package/es/User.js +18 -18
  23. package/es/VarSelectDialog.cjs +1 -1
  24. package/es/VarSelectDialog.js +17 -17
  25. package/es/VarietyAutoComplete.cjs +1 -1
  26. package/es/VarietyAutoComplete.js +22 -22
  27. package/es/VarietySearch.cjs +1 -1
  28. package/es/VarietySearch.js +26 -26
  29. package/es/VarietyTextCopy.cjs +1 -1
  30. package/es/VarietyTextCopy.js +9 -9
  31. package/es/VirtualTable.cjs +1 -1
  32. package/es/VirtualTable.js +5 -5
  33. package/es/{_initCloneObject-eaef9418.js → _initCloneObject-4f4401b6.js} +2 -2
  34. package/es/{_initCloneObject-52b6a510.cjs → _initCloneObject-6429d105.cjs} +1 -1
  35. package/es/{config-provider-a584d81e.cjs → config-provider-285ead82.cjs} +1 -1
  36. package/es/{config-provider-b16efd62.js → config-provider-e1736401.js} +3 -3
  37. package/es/{dropdown-071c5d7e.cjs → dropdown-6ba4a93d.cjs} +1 -1
  38. package/es/{dropdown-a59bba73.js → dropdown-73ca08ef.js} +2 -2
  39. package/es/{el-autocomplete-ba808eb6.js → el-autocomplete-2180fc5c.js} +5 -5
  40. package/es/{el-autocomplete-a07e9439.cjs → el-autocomplete-aeb7da33.cjs} +1 -1
  41. package/es/{el-button-eec58cff.cjs → el-button-0dbb2d4a.cjs} +1 -1
  42. package/es/{el-button-c95adb85.js → el-button-e8b725f0.js} +3 -3
  43. package/es/{el-checkbox-c25236a6.cjs → el-checkbox-b8c558ca.cjs} +1 -1
  44. package/es/{el-checkbox-7421ccd3.js → el-checkbox-df0def51.js} +3 -3
  45. package/es/{el-dialog-41ab8417.js → el-dialog-4330c5bd.js} +4 -4
  46. package/es/{el-dialog-ae86edb8.cjs → el-dialog-5028c704.cjs} +1 -1
  47. package/es/{el-form-item-c53c374d.js → el-form-item-b816e9f3.js} +5 -5
  48. package/es/{el-form-item-c3fe189b.cjs → el-form-item-f7e8255e.cjs} +1 -1
  49. package/es/{el-input-7fd293af.cjs → el-input-2e9268ac.cjs} +1 -1
  50. package/es/{el-input-2f75c4ba.js → el-input-bd1ce1e9.js} +4 -4
  51. package/es/{el-input-number-5193fe6d.js → el-input-number-088d2c66.js} +4 -4
  52. package/es/{el-input-number-22e21d16.cjs → el-input-number-153a3742.cjs} +1 -1
  53. package/es/{el-loading-cfd86c15.cjs → el-loading-03240202.cjs} +1 -1
  54. package/es/{el-loading-f6022062.js → el-loading-d0dac75f.js} +1 -1
  55. package/es/{el-menu-item-17dc717e.cjs → el-menu-item-b843f5ee.cjs} +1 -1
  56. package/es/{el-menu-item-7e881203.js → el-menu-item-c7202455.js} +4 -4
  57. package/es/{el-message-e544a8f5.js → el-message-290a93ff.js} +5 -5
  58. package/es/{el-message-5e6a6be9.cjs → el-message-3d8d9810.cjs} +1 -1
  59. package/es/{el-message-box-a93d2f6a.js → el-message-box-7a952ec7.js} +9 -9
  60. package/es/{el-message-box-c10adb52.cjs → el-message-box-aafae7ee.cjs} +1 -1
  61. package/es/{el-overlay-9e34965f.cjs → el-overlay-ab0b3c66.cjs} +1 -1
  62. package/es/{el-overlay-09ad71cd.js → el-overlay-f72f3f3d.js} +3 -3
  63. package/es/{el-popconfirm-70a976bf.cjs → el-popconfirm-a4a50f14.cjs} +1 -1
  64. package/es/{el-popconfirm-81dcd202.js → el-popconfirm-bdcb65fe.js} +4 -4
  65. package/es/{el-popper-b4f97157.js → el-popper-b0ef8ed3.js} +1 -1
  66. package/es/{el-popper-b6c99b28.cjs → el-popper-b37ec1ef.cjs} +1 -1
  67. package/es/{el-segmented-b868d074.js → el-segmented-d0a61f41.js} +2 -2
  68. package/es/{el-segmented-f8fce9ac.cjs → el-segmented-f505fd25.cjs} +1 -1
  69. package/es/{el-select-d8d91db1.cjs → el-select-91145989.cjs} +1 -1
  70. package/es/{el-select-95627997.js → el-select-d63dc0f6.js} +8 -8
  71. package/es/{el-table-column-c974cb96.cjs → el-table-column-4dae58f0.cjs} +1 -1
  72. package/es/{el-table-column-376cd907.js → el-table-column-5ad33084.js} +9 -9
  73. package/es/{el-tag-66cab138.js → el-tag-2da70fa3.js} +2 -2
  74. package/es/{el-tag-a33c4b22.cjs → el-tag-891b703d.cjs} +1 -1
  75. package/es/{el-text-c20a9f48.cjs → el-text-cfd2f326.cjs} +1 -1
  76. package/es/{el-text-ac60d0f2.js → el-text-d42a3be4.js} +1 -1
  77. package/es/{index-d91dc23f.js → index-0902dd2e.js} +2 -2
  78. package/es/{index-1f7d4f70.js → index-23d35abc.js} +1 -1
  79. package/es/{index-9b9ef5dd.cjs → index-25bc46bb.cjs} +1 -1
  80. package/es/{index-844bdd85.js → index-5108cae0.js} +2 -2
  81. package/es/{index-a871c3eb.js → index-598d418b.js} +92 -111
  82. package/es/{index-c108567d.cjs → index-6c252a43.cjs} +1 -1
  83. package/es/{index-f967d6c1.cjs → index-7a26fd8b.cjs} +1 -1
  84. package/es/index-7a85500c.cjs +1 -0
  85. package/es/{index-57672682.js → index-af3c738f.js} +2 -2
  86. package/es/{index-e5566b94.js → index-b99c0c42.js} +1 -1
  87. package/es/{index-88546436.js → index-d6a848ac.js} +2 -2
  88. package/es/{index-f3562b52.cjs → index-d7928b14.cjs} +1 -1
  89. package/es/{index-11547a0c.cjs → index-eb3ca89a.cjs} +1 -1
  90. package/es/{index-298075cf.cjs → index-f50a50b3.cjs} +1 -1
  91. package/es/style.css +1 -1
  92. package/es/{use-form-common-props-fd9b61a0.cjs → use-form-common-props-3b387353.cjs} +1 -1
  93. package/es/{use-form-common-props-815d48a6.js → use-form-common-props-b995a440.js} +12 -12
  94. package/es/{use-global-config-30d7d8ce.cjs → use-global-config-2a4156cd.cjs} +1 -1
  95. package/es/{use-global-config-b5e9d3d5.js → use-global-config-e20aee8c.js} +2 -2
  96. package/es/{validator-764a9db0.js → validator-6d23708b.js} +1 -1
  97. package/es/{validator-1b8a6128.cjs → validator-7dacff4f.cjs} +1 -1
  98. package/es/{zh-cn-e963c628.js → zh-cn-7530f035.js} +1 -1
  99. package/es/{zh-cn-90317f62.cjs → zh-cn-a3c3833a.cjs} +1 -1
  100. package/lib/bundle.js +1 -1
  101. package/lib/bundle.umd.cjs +169 -162
  102. package/lib/{index-5f11e3e4.js → index-19ce4b67.js} +20461 -20330
  103. package/lib/{python-e8c63eb9.js → python-033b059e.js} +1 -1
  104. package/lib/style.css +1 -1
  105. package/package.json +1 -1
  106. package/packages/CustomFunction/components/ManageDialog.vue +779 -0
  107. package/packages/CustomFunction/index.vue +17 -482
  108. package/packages/VarietyAutoComplete/index.vue +1 -1
  109. package/es/index-098c2447.cjs +0 -1
@@ -1,146 +1,137 @@
1
1
  import "./base-a5af3db3.js";
2
- import { E as ce } from "./el-divider-4e059794.js";
2
+ import { E as Z } from "./el-button-e8b725f0.js";
3
+ import "./el-tag-2da70fa3.js";
4
+ import { E as _e, a as ve } from "./el-select-d63dc0f6.js";
3
5
  import "./el-scrollbar-323542e7.js";
4
- import { E as re } from "./el-dialog-41ab8417.js";
5
- import "./el-overlay-09ad71cd.js";
6
- import { E as j } from "./el-input-2f75c4ba.js";
7
- import { E as ue } from "./el-button-c95adb85.js";
8
- import "./el-tag-66cab138.js";
9
- import { E as de, a as me } from "./el-select-95627997.js";
10
- import "./el-popper-b4f97157.js";
11
- import { E as fe } from "./el-popconfirm-81dcd202.js";
6
+ import "./el-popper-b0ef8ed3.js";
7
+ import { inject as ee, ref as m, reactive as P, computed as ge, watch as he, nextTick as X, resolveComponent as G, openBlock as F, createBlock as H, withCtx as s, createElementVNode as l, normalizeClass as M, createVNode as t, unref as D, createTextVNode as b, createElementBlock as j, Fragment as te, renderList as oe, toDisplayString as q, withModifiers as xe, pushScopeId as ye, popScopeId as Ee, h as O, onMounted as be, normalizeStyle as Ve } from "vue";
8
+ import { E as Ce } from "./el-divider-4e059794.js";
9
+ import { E as ke } from "./el-dialog-4330c5bd.js";
10
+ import "./el-overlay-f72f3f3d.js";
11
+ import { E as we } from "./el-empty-33cb66f1.js";
12
+ import { E as Se } from "./el-popconfirm-bdcb65fe.js";
12
13
  import "./el-popover-4ed993c7.js";
13
- import { inject as pe, ref as u, reactive as L, onMounted as _e, watch as ve, nextTick as P, resolveComponent as W, openBlock as T, createElementBlock as A, createVNode as l, normalizeStyle as ge, withCtx as s, Fragment as he, renderList as Ee, createBlock as ye, createElementVNode as i, toDisplayString as $, withModifiers as q, unref as C, createTextVNode as v, normalizeClass as M, pushScopeId as xe, popScopeId as Ce, h as S } from "vue";
14
- import { d as we, e as Ve, a as ke, c as G, b as be, E as Se } from "./index-a871c3eb.js";
15
- import { _ as Ne } from "./_plugin-vue_export-helper-dad06003.js";
16
- import { E as p } from "./el-message-e544a8f5.js";
17
- import { E as Fe, a as $e } from "./el-form-item-c53c374d.js";
18
- import { E as ze } from "./el-message-box-a93d2f6a.js";
19
- import { E as De } from "./index-844bdd85.js";
20
- import "./use-form-common-props-815d48a6.js";
14
+ import { E as Y } from "./el-input-bd1ce1e9.js";
15
+ import { c as K, d as $e, a as Ne, b as De, E as Fe } from "./index-598d418b.js";
16
+ import { G as ze } from "./index-7ed0999e.js";
17
+ import { E } from "./el-message-290a93ff.js";
18
+ import { E as Ie } from "./el-message-box-7a952ec7.js";
19
+ import { E as Me, a as Oe } from "./el-form-item-b816e9f3.js";
20
+ import { _ as le } from "./_plugin-vue_export-helper-dad06003.js";
21
+ import { E as Be } from "./index-5108cae0.js";
22
+ import "./index-2e331d74.js";
23
+ import "./use-global-config-e20aee8c.js";
24
+ import "./use-form-common-props-b995a440.js";
21
25
  import "./index-960806da.js";
22
26
  import "./index-d77a7336.js";
23
- import "./index-2e331d74.js";
24
- import "./vnode-5ddb7ed1.js";
25
- import "./scroll-679bd6bf.js";
26
- import "./use-global-config-b5e9d3d5.js";
27
- import "./index-e5566b94.js";
28
- import "./typescript-7ae59c4c.js";
29
- import "./index-d91dc23f.js";
27
+ import "./index-b99c0c42.js";
30
28
  import "./index-657047bb.js";
31
- import "./index-57672682.js";
29
+ import "./index-af3c738f.js";
32
30
  import "./castArray-7741a212.js";
31
+ import "./index-0902dd2e.js";
32
+ import "./scroll-679bd6bf.js";
33
33
  import "./debounce-8d53f4dd.js";
34
- import "./config-provider-b16efd62.js";
35
- import "./_initCloneObject-eaef9418.js";
36
- import "./validator-764a9db0.js";
37
- const H = (d) => (xe("data-v-ff7c4544"), d = d(), Ce(), d), Ie = { class: "custom-function" }, Be = { class: "func-option" }, Oe = { class: "icons" }, Te = { class: "custom-header" }, qe = { class: "left" }, Me = ["id"], Ue = { class: "right" }, Re = { class: "func-name" }, je = { class: "left" }, Le = /* @__PURE__ */ H(() => /* @__PURE__ */ i("span", null, "函数名称:", -1)), Pe = { class: "right" }, We = /* @__PURE__ */ H(() => /* @__PURE__ */ i("div", { class: "tip-box" }, "Tip: 公式里可以使用变量, 变量名命名格式: ${变量名}, 后续可在应用函数时填写具体值, 系统会自动换算", -1)), Ae = { class: "dialog-footer" }, Ge = { class: "custom-header" }, He = { class: "left" }, Je = ["id"], Ke = { class: "right" }, Qe = { class: "content" }, Xe = { class: "dialog-footer" }, Ye = {
38
- __name: "index",
34
+ import "./vnode-5ddb7ed1.js";
35
+ import "./typescript-7ae59c4c.js";
36
+ import "./config-provider-e1736401.js";
37
+ import "./validator-6d23708b.js";
38
+ import "./_initCloneObject-4f4401b6.js";
39
+ const J = (f) => (ye("data-v-8af089bb"), f = f(), Ee(), f), Ue = { class: "custom-header" }, Re = { class: "left" }, qe = ["id"], je = { class: "right" }, Te = { class: "manage-dialog-body" }, Ae = { class: "func-list" }, Le = { class: "search" }, We = /* @__PURE__ */ J(() => /* @__PURE__ */ l("span", null, "输入函数关键字", -1)), Pe = ["onClick"], Ge = { class: "icon-box" }, Ke = { class: "rule-form" }, He = { class: "header" }, Je = /* @__PURE__ */ J(() => /* @__PURE__ */ l("span", null, "函数名称:", -1)), Qe = { class: "right" }, Xe = /* @__PURE__ */ J(() => /* @__PURE__ */ l("div", { class: "tip-box" }, "说明: 公式里可以使用变量, 变量名命名格式: ${变量名}, 后续可在应用函数时填写具体值, 系统会自动换算", -1)), Ye = { class: "custom-header" }, Ze = { class: "left" }, et = ["id"], tt = { class: "right" }, ot = { class: "dialog-footer" }, lt = { class: "custom-header" }, nt = { class: "left" }, st = ["id"], at = { class: "right" }, it = { class: "content" }, rt = { class: "dialog-footer" }, ut = {
40
+ __name: "ManageDialog",
39
41
  props: {
40
- size: { type: String, default: "small" },
41
- selectWidth: { type: String, default: "200px" }
42
+ data: {
43
+ type: Array,
44
+ default: () => []
45
+ }
42
46
  },
43
- emits: ["insert"],
44
- setup(d, { emit: J }) {
45
- const { request: N } = pe("stConfig"), g = u(null), z = u(null), K = J, F = u(null), h = u(""), w = u([]), E = u(!1), r = L({
47
+ emits: ["refreshData"],
48
+ setup(f, { expose: T, emit: A }) {
49
+ const { request: z } = ee("stConfig"), p = m(null), V = m(null), x = A, y = f, C = m(!1), k = P({
50
+ save: !1,
51
+ test: !1
52
+ }), w = m(null), I = ge(() => w.value ? y.data.filter((o) => o.funcName.includes(w.value)) : y.data), a = P({
46
53
  id: null,
47
54
  funcName: "",
48
55
  funcExpression: ""
49
- }), D = u(!1), y = u(!1), I = u(!1), _ = L({
56
+ }), u = m(""), d = P({
50
57
  result: null,
51
58
  detail: "",
52
59
  code: ""
53
- }), B = async () => {
54
- const { body: t } = await N.post("/common/qt/querySearchFunctions");
55
- if (w.value = t ?? [], F.value === null)
56
- h.value = "";
57
- else {
58
- const e = w.value.find(({ id: o }) => o === F.value);
59
- h.value = e ? e.funcName : "";
60
- }
61
- }, Q = (t) => {
60
+ }), S = m(!1), h = m(!1), v = () => {
61
+ var o;
62
+ Object.assign(a, {
63
+ id: null,
64
+ funcName: "",
65
+ funcExpression: ""
66
+ }), u.value = "", (o = p.value) == null || o.setValue(a.funcExpression);
67
+ }, Q = (o) => {
62
68
  var e;
63
- t ? F.value = (e = w.value.find((o) => o.funcName === t)) == null ? void 0 : e.id : F.value = null;
64
- }, X = async (t) => {
65
- await N.post("/common/qt/deleteSearchFunctionById", { id: t.id }), B();
66
- }, O = (t, e) => {
67
- switch (!!t) {
68
- case !1: {
69
- Object.assign(r, {
70
- id: null,
71
- funcName: "",
72
- funcExpression: ""
73
- });
74
- break;
75
- }
76
- case !0: {
77
- Object.assign(r, {
78
- id: t.id,
79
- funcName: t.funcName,
80
- funcExpression: t.funcExpression
81
- });
82
- break;
83
- }
84
- }
85
- e && (r.id = null, r.funcName = `${r.funcName}-复制`), E.value = !0;
86
- }, Y = async () => {
69
+ Object.assign(a, {
70
+ id: o.id,
71
+ funcName: o.funcName,
72
+ funcExpression: o.funcExpression
73
+ }), u.value = "", (e = p.value) == null || e.setValue(a.funcExpression);
74
+ }, ne = (o) => {
75
+ var e;
76
+ Object.assign(a, {
77
+ id: null,
78
+ funcName: `${o.funcName}-复制`,
79
+ funcExpression: o.funcExpression
80
+ }), u.value = "", (e = p.value) == null || e.setValue(a.funcExpression);
81
+ }, se = async (o) => {
82
+ var e;
83
+ o.id === a.id && (Object.assign(a, {
84
+ id: null,
85
+ funcName: "",
86
+ funcExpression: ""
87
+ }), (e = p.value) == null || e.setValue(a.funcExpression)), await z.post("/common/qt/deleteSearchFunctionById", { id: o.id }), x("refreshData");
88
+ }, ae = ze(async () => {
87
89
  try {
88
- if (D.value = !0, r.funcExpression = g.value.getValue(), !r.funcName)
89
- return p.error("函数名称不可为空");
90
- if (!r.funcExpression)
91
- return p.error("函数内容不可为空");
92
- await N.post("/common/qt/saveOrUpdateSearchFunction", r), p.success("操作成功"), E.value = !1, await B();
90
+ if (k.save = !0, a.funcExpression = p.value.getValue(), !a.funcName)
91
+ return E.error("函数名称不可为空");
92
+ if (!a.funcExpression)
93
+ return E.error("函数内容不可为空");
94
+ await z.post("/common/qt/saveOrUpdateSearchFunction", a), E.success("操作成功"), x("refreshData"), a.id || v();
93
95
  } finally {
94
- D.value = !1;
96
+ k.save = !1;
95
97
  }
96
- }, U = () => {
97
- if (!h.value)
98
- return p.error("请先选择自定义函数后, 再执行插入");
99
- const { funcName: t, funcExpression: e } = w.value.find((o) => o.funcName === h.value);
100
- K("insert", t, e);
101
- }, Z = (t) => {
102
- const e = /\$\{([^}]*)\}/g, o = [];
103
- let c;
104
- for (; (c = e.exec(t)) !== null; )
105
- o.push(c[1]);
106
- return [...new Set(o)];
107
- }, ee = (t, e) => t.replace(/\$\{([^}]*)\}/g, (o, c) => e[c] !== void 0 ? e[c] : o), te = (t) => new Promise((e) => {
108
- const o = u(
109
- t.reduce((n, m) => (n[m] = "", n), {})
110
- ), c = u({}), V = () => {
111
- let n = !0;
112
- const m = {};
113
- return t.forEach((f) => {
114
- var b;
115
- (b = o.value[f]) != null && b.trim() || (m[f] = `请输入${f}的值`, n = !1);
116
- }), c.value = m, n;
98
+ }), ie = (o) => new Promise((e) => {
99
+ const i = m(
100
+ o.reduce((c, g) => (c[g] = "", c), {})
101
+ ), r = m({}), _ = () => {
102
+ let c = !0;
103
+ const g = {};
104
+ return o.forEach(($) => {
105
+ var U;
106
+ (U = i.value[$]) != null && U.trim() || (g[$] = `请输入${$}的值`, c = !1);
107
+ }), r.value = g, c;
117
108
  };
118
- ze({
109
+ Ie({
119
110
  title: "填写变量值用于接口测试",
120
- message: S({
111
+ message: O({
121
112
  setup() {
122
- return () => S("div", [
123
- S(
124
- Fe,
113
+ return () => O("div", [
114
+ O(
115
+ Me,
125
116
  {
126
- model: o.value
117
+ model: i.value
127
118
  },
128
- () => t.map(
129
- (n) => S(
130
- $e,
119
+ () => o.map(
120
+ (c) => O(
121
+ Oe,
131
122
  {
132
- label: `${n}: `,
133
- prop: n,
134
- error: c.value[n],
123
+ label: `${c}: `,
124
+ prop: c,
125
+ error: r.value[c],
135
126
  "label-width": "90px"
136
127
  },
137
- () => S(j, {
138
- modelValue: o.value[n],
139
- "onUpdate:modelValue": (m) => {
140
- o.value[n] = m, c.value[n] && delete c.value[n];
128
+ () => O(Y, {
129
+ modelValue: i.value[c],
130
+ "onUpdate:modelValue": (g) => {
131
+ i.value[c] = g, r.value[c] && delete r.value[c];
141
132
  },
142
- placeholder: `请输入 ${n} 的值`,
143
- status: c.value[n] ? "error" : ""
133
+ placeholder: `请输入 ${c} 的值`,
134
+ status: r.value[c] ? "error" : ""
144
135
  })
145
136
  )
146
137
  )
@@ -152,324 +143,484 @@ const H = (d) => (xe("data-v-ff7c4544"), d = d(), Ce(), d), Ie = { class: "custo
152
143
  confirmButtonText: "确定",
153
144
  cancelButtonText: "取消",
154
145
  customClass: "variable-input-dialog",
155
- beforeClose: async (n, m, f) => {
156
- n !== "confirm" && (e(!1), f()), await P(), V() && (e({ ...o.value }), f());
146
+ beforeClose: async (c, g, $) => {
147
+ c !== "confirm" && (e(!1), $()), await X(), _() && (e({ ...i.value }), $());
157
148
  }
158
149
  }).catch(() => e(!1));
159
- }), oe = async () => {
160
- try {
161
- I.value = !0;
162
- let t = g.value.getValue();
163
- if (!t)
164
- return p.error("函数内容不可为空");
165
- if (/\$\{[^}]*\}/.test(t)) {
166
- const V = Z(t), k = await te(V);
167
- if (!k)
168
- return;
169
- t = ee(t, k);
150
+ }), re = (o) => {
151
+ const e = /\$\{([^}]*)\}/g, i = [];
152
+ let r;
153
+ for (; (r = e.exec(o)) !== null; )
154
+ i.push(r[1]);
155
+ return [...new Set(i)];
156
+ }, ue = (o, e) => o.replace(/\$\{([^}]*)\}/g, (i, r) => e[r] !== void 0 ? e[r] : i), ce = (o) => o ? o.split(`
157
+ `).reduce((e, i) => {
158
+ const r = i.trim().replace(/\s+/gi, " ").split(" ")[0];
159
+ return r && e.push(r), e;
160
+ }, []) : [], L = async (o) => {
161
+ switch (o) {
162
+ case "open": {
163
+ if (!p.value.getValue())
164
+ return E.error("函数内容不可为空");
165
+ S.value = !0;
166
+ break;
167
+ }
168
+ case "submit": {
169
+ let e = p.value.getValue();
170
+ if (!e)
171
+ return E.error("函数内容不可为空");
172
+ if (/\$\{[^}]*\}/.test(e)) {
173
+ const i = re(e), r = await ie(i);
174
+ if (!r)
175
+ return;
176
+ e = ue(e, r);
177
+ }
178
+ S.value = !1;
179
+ try {
180
+ k.test = !0;
181
+ const i = {
182
+ codes: ce(u.value),
183
+ factorSelectExpr: e
184
+ }, { body: r } = await z.post("/common/qt/testFactorSelect", i), { result: _, detail: B } = r;
185
+ Object.assign(d, { result: _, detail: B, code: i.factorSelectExpr }), _ === 1 ? E.success("测试通过") : (E.error("测试未能通过"), h.value = !0);
186
+ } finally {
187
+ k.test = !1;
188
+ }
189
+ break;
190
+ }
191
+ case "log": {
192
+ if (d.result === null)
193
+ return E.warning("请先进行测试, 等待测试完成后可查看日志");
194
+ h.value = !0;
195
+ break;
170
196
  }
171
- const { body: e } = await N.post("/common/qt/testFactorSelect", { factorSelectExpr: t }), { result: o, detail: c } = e;
172
- Object.assign(_, { result: o, detail: c, code: t }), o === 1 ? p.success("测试通过") : (p.error("测试未能通过"), y.value = !0);
173
- } finally {
174
- I.value = !1;
175
197
  }
176
- }, le = () => {
177
- if (_.result === null)
178
- return p.warning("请先进行测试, 等待测试完成后可查看日志");
179
- y.value = !0;
180
- }, ne = () => {
181
- z.value.open(g.value);
198
+ }, de = () => {
199
+ V.value.open(p.value);
182
200
  };
183
- return _e(() => {
184
- B();
185
- }), ve(
186
- () => E.value,
187
- (t) => {
188
- switch (t) {
201
+ return he(
202
+ () => C.value,
203
+ (o) => {
204
+ switch (o) {
189
205
  case !0: {
190
- P(() => {
191
- var e, o;
192
- (e = g.value) == null || e.setValue(r.funcExpression), (o = g.value) == null || o.resize();
193
- }), Object.assign(_, {
194
- result: null,
195
- detail: ""
206
+ X(() => {
207
+ var e;
208
+ (e = p.value) == null || e.resize(), w.value = null, I.value.length ? Q(I.value[0]) : v(), Object.assign(d, {
209
+ result: null,
210
+ detail: "",
211
+ code: ""
212
+ });
196
213
  });
197
214
  break;
198
215
  }
199
216
  case !1: {
200
- z.value.close();
217
+ V.value.close(), S.value = !1, h.value = !1;
201
218
  break;
202
219
  }
203
220
  }
204
221
  }
205
- ), (t, e) => {
206
- const o = Se, c = fe, V = de, k = me, n = ue, m = j, f = W("st-monacoEditor"), b = re, R = De, se = ce, ae = W("st-varSelectDialog");
207
- return T(), A("div", Ie, [
208
- l(k, {
209
- modelValue: h.value,
210
- "onUpdate:modelValue": e[0] || (e[0] = (a) => h.value = a),
211
- size: d.size,
212
- placeholder: "自定义函数",
213
- "no-match-text": "无匹配选项",
214
- "no-data-text": "无选项数据",
215
- clearable: "",
216
- filterable: "",
217
- onChange: Q,
218
- style: ge({ width: d.selectWidth })
219
- }, {
220
- default: s(() => [
221
- (T(!0), A(he, null, Ee(w.value, (a) => (T(), ye(V, {
222
- key: a.id,
223
- label: a.funcName,
224
- value: a.funcName,
225
- onClick: U
226
- }, {
227
- default: s(() => [
228
- i("div", Be, [
229
- i("span", null, $(a.funcName), 1),
230
- i("div", Oe, [
231
- l(o, {
232
- onClick: q((x) => O(a, !0), ["stop"])
233
- }, {
234
- default: s(() => [
235
- l(C(we))
236
- ]),
237
- _: 2
238
- }, 1032, ["onClick"]),
239
- l(o, {
240
- onClick: q((x) => O(a), ["stop"])
241
- }, {
242
- default: s(() => [
243
- l(C(Ve))
244
- ]),
245
- _: 2
246
- }, 1032, ["onClick"]),
247
- l(c, {
248
- title: "确认是否删除?",
249
- "confirm-button-text": "确认",
250
- "cancel-button-text": "取消",
251
- onConfirm: (x) => X(a)
252
- }, {
253
- reference: s(() => [
254
- l(o, {
255
- onClick: q(() => {
256
- }, ["stop"])
257
- }, {
258
- default: s(() => [
259
- l(C(ke))
260
- ]),
261
- _: 1
262
- })
263
- ]),
264
- _: 2
265
- }, 1032, ["onConfirm"])
266
- ])
267
- ])
268
- ]),
269
- _: 2
270
- }, 1032, ["label", "value"]))), 128))
271
- ]),
272
- _: 1
273
- }, 8, ["modelValue", "size", "style"]),
274
- l(n, {
275
- type: "primary",
276
- size: d.size,
277
- onClick: U
278
- }, {
279
- default: s(() => [
280
- v(" 插入 ")
281
- ]),
282
- _: 1
283
- }, 8, ["size"]),
284
- l(n, {
285
- type: "primary",
286
- size: d.size,
287
- onClick: e[1] || (e[1] = (a) => O())
288
- }, {
289
- default: s(() => [
290
- v(" 新建 ")
291
- ]),
292
- _: 1
293
- }, 8, ["size"]),
294
- l(b, {
295
- "modal-class": "add-or-edit-dialog",
296
- modelValue: E.value,
297
- "onUpdate:modelValue": e[4] || (e[4] = (a) => E.value = a),
298
- width: "1000",
299
- "align-center": "",
300
- "append-to-body": "",
301
- draggable: "",
302
- overflow: "",
303
- modal: !1,
304
- "modal-penetrable": !0,
305
- "show-close": !1
306
- }, {
307
- header: s(({ titleId: a, titleClass: x }) => [
308
- i("div", Te, [
309
- i("div", qe, [
310
- i("span", {
311
- id: a,
312
- class: M(x)
313
- }, $(r.id ? "编辑自定义函数" : "新建自定义函数"), 11, Me)
314
- ]),
315
- i("div", Ue, [
316
- l(n, {
317
- size: "small",
222
+ ), T({
223
+ open: () => {
224
+ C.value = !0;
225
+ }
226
+ }), (o, e) => {
227
+ const i = Fe, r = Y, _ = Z, B = Se, c = we, g = Be, $ = G("st-monacoEditor"), U = G("st-varSelectDialog"), me = G("st-varietyAutoComplete"), W = ke, fe = Ce;
228
+ return F(), H(W, {
229
+ "modal-class": "manage-dialog",
230
+ modelValue: C.value,
231
+ "onUpdate:modelValue": e[13] || (e[13] = (n) => C.value = n),
232
+ width: "1600",
233
+ "align-center": "",
234
+ "append-to-body": "",
235
+ overflow: "",
236
+ modal: !1,
237
+ "modal-penetrable": !0,
238
+ "show-close": !1
239
+ }, {
240
+ header: s(({ titleId: n, titleClass: N }) => [
241
+ l("div", Ue, [
242
+ l("div", Re, [
243
+ l("span", {
244
+ id: n,
245
+ class: M(N)
246
+ }, " 自定义函数管理面板 ", 10, qe)
247
+ ]),
248
+ l("div", je, [
249
+ t(i, {
250
+ onClick: e[0] || (e[0] = (R) => C.value = !1)
251
+ }, {
252
+ default: s(() => [
253
+ t(D(K))
254
+ ]),
255
+ _: 1
256
+ })
257
+ ])
258
+ ])
259
+ ]),
260
+ default: s(() => [
261
+ l("div", Te, [
262
+ l("div", Ae, [
263
+ l("div", Le, [
264
+ We,
265
+ t(r, {
266
+ modelValue: w.value,
267
+ "onUpdate:modelValue": e[1] || (e[1] = (n) => w.value = n),
268
+ clearable: ""
269
+ }, null, 8, ["modelValue"]),
270
+ t(_, {
318
271
  type: "primary",
319
- onClick: ne
272
+ onClick: v
320
273
  }, {
321
274
  default: s(() => [
322
- v(" 变量选择器 ")
323
- ]),
324
- _: 1
325
- }),
326
- l(o, {
327
- onClick: e[2] || (e[2] = (ie) => E.value = !1)
328
- }, {
329
- default: s(() => [
330
- l(C(G))
275
+ b("新建")
331
276
  ]),
332
277
  _: 1
333
278
  })
334
- ])
335
- ])
336
- ]),
337
- footer: s(() => [
338
- i("div", Ae, [
339
- l(n, {
340
- type: "primary",
341
- loading: D.value,
342
- onClick: Y
343
- }, {
279
+ ]),
280
+ t(g, { class: "list" }, {
344
281
  default: s(() => [
345
- v(" 确定 ")
282
+ I.value.length ? (F(!0), j(te, { key: 0 }, oe(I.value, (n) => (F(), j("div", {
283
+ key: n.id,
284
+ class: M([{ "active-list-item": a.id === n.id }, "list-item"])
285
+ }, [
286
+ l("span", {
287
+ class: "func-name",
288
+ onClick: (N) => Q(n)
289
+ }, q(n.funcName), 9, Pe),
290
+ l("div", Ge, [
291
+ t(i, null, {
292
+ default: s(() => [
293
+ t(D($e), {
294
+ onClick: (N) => ne(n)
295
+ }, null, 8, ["onClick"])
296
+ ]),
297
+ _: 2
298
+ }, 1024),
299
+ t(B, {
300
+ title: "确认是否删除?",
301
+ "confirm-button-text": "确认",
302
+ "cancel-button-text": "取消",
303
+ onConfirm: (N) => se(n)
304
+ }, {
305
+ reference: s(() => [
306
+ t(i, {
307
+ onClick: xe(() => {
308
+ }, ["stop"])
309
+ }, {
310
+ default: s(() => [
311
+ t(D(Ne))
312
+ ]),
313
+ _: 1
314
+ })
315
+ ]),
316
+ _: 2
317
+ }, 1032, ["onConfirm"])
318
+ ])
319
+ ], 2))), 128)) : (F(), H(c, {
320
+ key: 1,
321
+ description: "暂无数据"
322
+ }))
346
323
  ]),
347
324
  _: 1
348
- }, 8, ["loading"])
325
+ })
326
+ ]),
327
+ l("div", Ke, [
328
+ l("div", He, [
329
+ Je,
330
+ t(r, {
331
+ modelValue: a.funcName,
332
+ "onUpdate:modelValue": e[2] || (e[2] = (n) => a.funcName = n)
333
+ }, null, 8, ["modelValue"]),
334
+ l("div", Qe, [
335
+ t(_, {
336
+ type: "primary",
337
+ onClick: D(ae),
338
+ loading: k.save
339
+ }, {
340
+ default: s(() => [
341
+ b(" 保存 ")
342
+ ]),
343
+ _: 1
344
+ }, 8, ["onClick", "loading"]),
345
+ t(_, {
346
+ loading: k.test,
347
+ onClick: e[3] || (e[3] = (n) => L("open"))
348
+ }, {
349
+ default: s(() => [
350
+ b(" 测试 ")
351
+ ]),
352
+ _: 1
353
+ }, 8, ["loading"]),
354
+ t(_, {
355
+ icon: D(De),
356
+ onClick: e[4] || (e[4] = (n) => L("log"))
357
+ }, {
358
+ default: s(() => [
359
+ b(" 日志明细 ")
360
+ ]),
361
+ _: 1
362
+ }, 8, ["icon"]),
363
+ t(_, {
364
+ type: "primary",
365
+ onClick: de
366
+ }, {
367
+ default: s(() => [
368
+ b(" 变量选择器 ")
369
+ ]),
370
+ _: 1
371
+ })
372
+ ])
373
+ ]),
374
+ Xe,
375
+ t($, {
376
+ ref_key: "stMonacoEditorRef",
377
+ ref: p,
378
+ language: "lua",
379
+ style: { width: "100%", height: "calc(80vh - 75px)" }
380
+ }, null, 512)
349
381
  ])
350
382
  ]),
351
- default: s(() => [
352
- i("div", Re, [
353
- i("div", je, [
354
- Le,
355
- l(m, {
356
- modelValue: r.funcName,
357
- "onUpdate:modelValue": e[3] || (e[3] = (a) => r.funcName = a)
358
- }, null, 8, ["modelValue"])
359
- ]),
360
- i("div", Pe, [
361
- l(n, {
383
+ t(U, {
384
+ ref_key: "stVarSelectDialogRef",
385
+ ref: V
386
+ }, null, 512),
387
+ t(W, {
388
+ "modal-class": "test-variety-dialog",
389
+ modelValue: S.value,
390
+ "onUpdate:modelValue": e[9] || (e[9] = (n) => S.value = n),
391
+ width: "500",
392
+ "align-center": "",
393
+ "append-to-body": "",
394
+ overflow: "",
395
+ modal: !1,
396
+ "modal-penetrable": !0,
397
+ "show-close": !1
398
+ }, {
399
+ header: s(({ titleId: n, titleClass: N }) => [
400
+ l("div", Ye, [
401
+ l("div", Ze, [
402
+ l("span", {
403
+ id: n,
404
+ class: M(N)
405
+ }, " 测试品种 ", 10, et)
406
+ ]),
407
+ l("div", tt, [
408
+ t(me, {
409
+ label: "",
410
+ onSelect: e[5] || (e[5] = ({ name: R, code: pe }) => u.value += `${pe} ${R}
411
+ `)
412
+ }),
413
+ t(i, {
414
+ onClick: e[6] || (e[6] = (R) => S.value = !1)
415
+ }, {
416
+ default: s(() => [
417
+ t(D(K))
418
+ ]),
419
+ _: 1
420
+ })
421
+ ])
422
+ ])
423
+ ]),
424
+ footer: s(() => [
425
+ l("div", ot, [
426
+ t(_, {
362
427
  type: "primary",
363
- loading: I.value,
364
- onClick: oe
428
+ onClick: e[8] || (e[8] = (n) => L("submit"))
365
429
  }, {
366
430
  default: s(() => [
367
- v(" 测试 ")
431
+ b(" 确认 ")
368
432
  ]),
369
433
  _: 1
370
- }, 8, ["loading"]),
371
- l(n, {
372
- icon: C(be),
373
- onClick: le
434
+ })
435
+ ])
436
+ ]),
437
+ default: s(() => [
438
+ t(r, {
439
+ class: "full-height-textarea",
440
+ modelValue: u.value,
441
+ "onUpdate:modelValue": e[7] || (e[7] = (n) => u.value = n),
442
+ resize: "none",
443
+ type: "textarea",
444
+ placeholder: `不填写时, 默认为000001 平安银行
445
+ 格式示例:
446
+ hc8888    热轧卷板期货指数
447
+ sp8888    纸浆期货指数
448
+ bu8888    石油沥青期货指数`
449
+ }, null, 8, ["modelValue"])
450
+ ]),
451
+ _: 1
452
+ }, 8, ["modelValue"]),
453
+ t(W, {
454
+ "modal-class": "log-dialog",
455
+ modelValue: h.value,
456
+ "onUpdate:modelValue": e[12] || (e[12] = (n) => h.value = n),
457
+ width: "830",
458
+ "align-center": "",
459
+ "append-to-body": "",
460
+ draggable: "",
461
+ overflow: "",
462
+ modal: !1,
463
+ "modal-penetrable": !0,
464
+ "show-close": !1
465
+ }, {
466
+ header: s(({ titleId: n, titleClass: N }) => [
467
+ l("div", lt, [
468
+ l("div", nt, [
469
+ l("span", {
470
+ id: n,
471
+ class: M(N)
472
+ }, " 日志明细 ", 10, st)
473
+ ]),
474
+ l("div", at, [
475
+ t(i, {
476
+ onClick: e[10] || (e[10] = (R) => h.value = !1)
477
+ }, {
478
+ default: s(() => [
479
+ t(D(K))
480
+ ]),
481
+ _: 1
482
+ })
483
+ ])
484
+ ])
485
+ ]),
486
+ footer: s(() => [
487
+ l("div", rt, [
488
+ t(_, {
489
+ onClick: e[11] || (e[11] = (n) => h.value = !1)
374
490
  }, {
375
491
  default: s(() => [
376
- v(" 日志明细 ")
492
+ b(" 关闭 ")
377
493
  ]),
378
494
  _: 1
379
- }, 8, ["icon"])
495
+ })
380
496
  ])
381
497
  ]),
382
- We,
383
- l(f, {
384
- ref_key: "stMonacoEditorRef",
385
- ref: g,
386
- language: "lua",
387
- style: { width: "968px", height: "400px" }
388
- }, null, 512)
389
- ]),
390
- _: 1
391
- }, 8, ["modelValue"]),
392
- l(b, {
393
- "modal-class": "log-dialog",
394
- modelValue: y.value,
395
- "onUpdate:modelValue": e[7] || (e[7] = (a) => y.value = a),
396
- width: "830",
397
- "align-center": "",
398
- "append-to-body": "",
399
- draggable: "",
400
- overflow: "",
401
- modal: !1,
402
- "modal-penetrable": !0,
403
- "show-close": !1
404
- }, {
405
- header: s(({ titleId: a, titleClass: x }) => [
406
- i("div", Ge, [
407
- i("div", He, [
408
- i("span", {
409
- id: a,
410
- class: M(x)
411
- }, " 日志明细 ", 10, Je)
412
- ]),
413
- i("div", Ke, [
414
- l(o, {
415
- onClick: e[5] || (e[5] = (ie) => y.value = !1)
498
+ default: s(() => [
499
+ l("div", it, [
500
+ t(g, {
501
+ class: "code",
502
+ height: "600px"
416
503
  }, {
417
504
  default: s(() => [
418
- l(C(G))
505
+ l("pre", null, q(d.code), 1)
506
+ ]),
507
+ _: 1
508
+ }),
509
+ t(fe, { direction: "vertical" }),
510
+ t(g, { height: "600px" }, {
511
+ default: s(() => [
512
+ l("pre", {
513
+ class: M(d.result === 1 ? "success-log" : "error-log")
514
+ }, q(d.result === 1 ? `✅️ 测试通过
515
+ ${d.detail}` : d.detail), 3)
419
516
  ]),
420
517
  _: 1
421
518
  })
422
519
  ])
423
- ])
520
+ ]),
521
+ _: 1
522
+ }, 8, ["modelValue"])
523
+ ]),
524
+ _: 1
525
+ }, 8, ["modelValue"]);
526
+ };
527
+ }
528
+ }, ct = /* @__PURE__ */ le(ut, [["__scopeId", "data-v-8af089bb"]]);
529
+ const dt = { class: "custom-function" }, mt = { class: "func-option" }, ft = {
530
+ __name: "index",
531
+ props: {
532
+ size: { type: String, default: "small" },
533
+ selectWidth: { type: String, default: "200px" }
534
+ },
535
+ emits: ["insert"],
536
+ setup(f, { emit: T }) {
537
+ const { request: A } = ee("stConfig"), z = m(null), p = T, V = m(null), x = m(""), y = m([]), C = async () => {
538
+ const { body: a } = await A.post("/common/qt/querySearchFunctions");
539
+ if (y.value = a ?? [], V.value === null)
540
+ x.value = "";
541
+ else {
542
+ const u = y.value.find(({ id: d }) => d === V.value);
543
+ x.value = u ? u.funcName : "";
544
+ }
545
+ }, k = (a) => {
546
+ var u;
547
+ a ? V.value = (u = y.value.find((d) => d.funcName === a)) == null ? void 0 : u.id : V.value = null;
548
+ }, w = () => {
549
+ if (!x.value)
550
+ return E.error("请先选择自定义函数后, 再执行插入");
551
+ const { funcName: a, funcExpression: u } = y.value.find((d) => d.funcName === x.value);
552
+ p("insert", a, u);
553
+ }, I = () => {
554
+ z.value.open();
555
+ };
556
+ return be(() => {
557
+ C();
558
+ }), (a, u) => {
559
+ const d = _e, S = ve, h = Z;
560
+ return F(), j("div", dt, [
561
+ t(S, {
562
+ modelValue: x.value,
563
+ "onUpdate:modelValue": u[0] || (u[0] = (v) => x.value = v),
564
+ size: f.size,
565
+ placeholder: "自定义函数",
566
+ "no-match-text": "无匹配选项",
567
+ "no-data-text": "无选项数据",
568
+ clearable: "",
569
+ filterable: "",
570
+ onChange: k,
571
+ style: Ve({ width: f.selectWidth })
572
+ }, {
573
+ default: s(() => [
574
+ (F(!0), j(te, null, oe(y.value, (v) => (F(), H(d, {
575
+ key: v.id,
576
+ label: v.funcName,
577
+ value: v.funcName,
578
+ onClick: w
579
+ }, {
580
+ default: s(() => [
581
+ l("div", mt, [
582
+ l("span", null, q(v.funcName), 1)
583
+ ])
584
+ ]),
585
+ _: 2
586
+ }, 1032, ["label", "value"]))), 128))
424
587
  ]),
425
- footer: s(() => [
426
- i("div", Xe, [
427
- l(n, {
428
- onClick: e[6] || (e[6] = (a) => y.value = !1)
429
- }, {
430
- default: s(() => [
431
- v(" 关闭 ")
432
- ]),
433
- _: 1
434
- })
435
- ])
588
+ _: 1
589
+ }, 8, ["modelValue", "size", "style"]),
590
+ t(h, {
591
+ type: "primary",
592
+ size: f.size,
593
+ onClick: w
594
+ }, {
595
+ default: s(() => [
596
+ b(" 插入 ")
436
597
  ]),
598
+ _: 1
599
+ }, 8, ["size"]),
600
+ t(h, {
601
+ type: "primary",
602
+ size: f.size,
603
+ onClick: u[1] || (u[1] = (v) => I())
604
+ }, {
437
605
  default: s(() => [
438
- i("div", Qe, [
439
- l(R, {
440
- class: "code",
441
- height: "600px"
442
- }, {
443
- default: s(() => [
444
- i("pre", null, $(_.code), 1)
445
- ]),
446
- _: 1
447
- }),
448
- l(se, { direction: "vertical" }),
449
- l(R, { height: "600px" }, {
450
- default: s(() => [
451
- i("pre", {
452
- class: M(_.result === 1 ? "success-log" : "error-log")
453
- }, $(_.result === 1 ? "测试通过 √" : _.detail), 3)
454
- ]),
455
- _: 1
456
- })
457
- ])
606
+ b(" 函数管理 ")
458
607
  ]),
459
608
  _: 1
460
- }, 8, ["modelValue"]),
461
- l(ae, {
462
- ref_key: "stVarSelectDialogRef",
463
- ref: z
464
- }, null, 512)
609
+ }, 8, ["size"]),
610
+ t(ct, {
611
+ ref_key: "ManageDialogRef",
612
+ ref: z,
613
+ data: y.value,
614
+ onRefreshData: C
615
+ }, null, 8, ["data"])
465
616
  ]);
466
617
  };
467
618
  }
468
- }, Ze = /* @__PURE__ */ Ne(Ye, [["__scopeId", "data-v-ff7c4544"]]), Tt = {
469
- install(d) {
470
- d.component("st-customFunction", Ze);
619
+ }, pt = /* @__PURE__ */ le(ft, [["__scopeId", "data-v-853b69f4"]]), Zt = {
620
+ install(f) {
621
+ f.component("st-customFunction", pt);
471
622
  }
472
623
  };
473
624
  export {
474
- Tt as default
625
+ Zt as default
475
626
  };