st-comp 0.0.183 → 0.0.185
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/CustomFunction.cjs +1 -1
- package/es/CustomFunction.js +35 -32
- package/es/style.css +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +1 -1
- package/lib/{index-841cf000.js → index-5955b737.js} +7 -4
- package/lib/{python-788b56d9.js → python-cf7a203d.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/CustomFunction/index.vue +4 -1
package/es/CustomFunction.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("./base-ef747d02.cjs");const O=require("./el-dialog-45250561.cjs");require("./el-overlay-39e2e96f.cjs");const
|
|
1
|
+
"use strict";require("./base-ef747d02.cjs");const O=require("./el-dialog-45250561.cjs");require("./el-overlay-39e2e96f.cjs");const $=require("./el-input-c663697a.cjs"),T=require("./el-button-338a49b7.cjs");require("./el-tag-a2e99294.cjs");const N=require("./el-select-8337856d.cjs");require("./el-scrollbar-802d874d.cjs");require("./el-popper-dca2de0d.cjs");const R=require("./el-popconfirm-08b4221f.cjs");require("./el-popover-0ea8fbf8.cjs");const e=require("vue"),m=require("./index-8feed26f.cjs"),p=require("./el-message-c500161d.cjs"),U=require("./_plugin-vue_export-helper-f246444f.cjs");require("./index-3a74eae4.cjs");require("./index-f1c702f6.cjs");require("./vnode-6d51e502.cjs");require("./scroll-b108dabd.cjs");require("./use-global-config-f3664595.cjs");require("./typescript-b63f8e83.cjs");require("./index-eea0bcb3.cjs");require("./index-e6deec5d.cjs");require("./debounce-0b77a317.cjs");require("./config-provider-d82ea78c.cjs");const j=l=>(e.pushScopeId("data-v-8a151cf0"),l=l(),e.popScopeId(),l),L={class:"custom-function"},P={class:"func-option"},W={class:"icons"},A={class:"custom-header"},H={class:"left"},G=["id"],J={class:"right"},K={style:{display:"flex","align-items":"center","margin-bottom":"10px"}},Q=j(()=>e.createElementVNode("span",null,"函数名称:",-1)),X={class:"dialog-footer"},Y={__name:"index",props:{size:{type:String,default:"small"},selectWidth:{type:String,default:"200px"}},emits:["insert"],setup(l,{emit:y}){const{request:_}=e.inject("stConfig"),c=e.ref(null),v=e.ref(null),E=y,u=e.ref(null),i=e.ref(""),d=e.ref([]),r=e.ref(!1),a=e.reactive({id:null,funcName:"",funcExpression:""}),h=e.ref(!1),x=async()=>{const{body:n}=await _.post("/common/qt/querySearchFunctions");if(d.value=n??[],u.value===null)i.value="";else{const t=d.value.find(({id:s})=>s===u.value);i.value=t?t.funcName:""}},C=n=>{var t;n?u.value=(t=d.value.find(s=>s.funcName===n))==null?void 0:t.id:u.value=null},q=async n=>{await _.post("/common/qt/deleteSearchFunctionById",{id:n.id}),x()},g=n=>{switch(!!n){case!1:{Object.assign(a,{id:null,funcName:"",funcExpression:""});break}case!0:{Object.assign(a,{id:n.id,funcName:n.funcName,funcExpression:n.funcExpression});break}}r.value=!0},w=async()=>{try{if(h.value=!0,a.funcExpression=c.value.getValue(),!a.funcName)return p.ElMessage.error("函数名称不可为空");if(!a.funcExpression)return p.ElMessage.error("函数内容不可为空");await _.post("/common/qt/saveOrUpdateSearchFunction",a),p.ElMessage.success("操作成功"),r.value=!1,await x()}finally{h.value=!1}},k=()=>{if(!i.value)return p.ElMessage.error("请先选择自定义函数后, 再执行插入");E("insert",` ${i.value}`)},b=()=>{v.value.open(c.value)};return e.onMounted(()=>{x()}),e.watch(()=>r.value,n=>{switch(n){case!0:{e.nextTick(()=>{var t,s;(t=c.value)==null||t.setValue(a.funcExpression),(s=c.value)==null||s.resize()});break}case!1:{v.value.close();break}}}),(n,t)=>{const s=m.ElIcon,S=R.ElPopconfirm,z=N.ElOption,F=N.ElSelect,f=T.ElButton,B=$.ElInput,D=e.resolveComponent("st-monacoEditor"),I=O.ElDialog,M=e.resolveComponent("st-varSelectDialog");return e.openBlock(),e.createElementBlock("div",L,[e.createVNode(F,{modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=o=>i.value=o),size:l.size,placeholder:"自定义函数",clearable:"",filterable:"",onChange:C,style:e.normalizeStyle({width:l.selectWidth})},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,o=>(e.openBlock(),e.createBlock(z,{key:o.id,label:o.funcName,value:o.funcName},{default:e.withCtx(()=>[e.createElementVNode("div",P,[e.createElementVNode("span",null,e.toDisplayString(o.funcName),1),e.createElementVNode("div",W,[e.createVNode(s,{onClick:e.withModifiers(V=>g(o),["stop"])},{default:e.withCtx(()=>[e.createVNode(e.unref(m.edit_default))]),_:2},1032,["onClick"]),e.createVNode(S,{title:"确认是否删除?","confirm-button-text":"确认","cancel-button-text":"取消",onConfirm:V=>q(o)},{reference:e.withCtx(()=>[e.createVNode(s,{onClick:e.withModifiers(()=>{},["stop"])},{default:e.withCtx(()=>[e.createVNode(e.unref(m.delete_default))]),_:1})]),_:2},1032,["onConfirm"])])])]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","size","style"]),e.createVNode(f,{type:"primary",size:l.size,onClick:k},{default:e.withCtx(()=>[e.createTextVNode(" 插入 ")]),_:1},8,["size"]),e.createVNode(f,{type:"primary",size:l.size,onClick:t[1]||(t[1]=o=>g())},{default:e.withCtx(()=>[e.createTextVNode(" 新建 ")]),_:1},8,["size"]),e.createVNode(I,{"modal-class":"add-or-edit-dialog",modelValue:r.value,"onUpdate:modelValue":t[4]||(t[4]=o=>r.value=o),width:"1000","align-center":"","append-to-body":"",draggable:"",overflow:"",modal:!1,"modal-penetrable":!0,"show-close":!1},{header:e.withCtx(({titleId:o,titleClass:V})=>[e.createElementVNode("div",A,[e.createElementVNode("div",H,[e.createElementVNode("span",{id:o,class:e.normalizeClass(V)},e.toDisplayString(a.id?"编辑自定义函数":"新建自定义函数"),11,G)]),e.createElementVNode("div",J,[e.createVNode(f,{size:"small",type:"primary",onClick:b},{default:e.withCtx(()=>[e.createTextVNode(" 变量选择器 ")]),_:1}),e.createVNode(s,{onClick:t[2]||(t[2]=te=>r.value=!1)},{default:e.withCtx(()=>[e.createVNode(e.unref(m.close_default))]),_:1})])])]),footer:e.withCtx(()=>[e.createElementVNode("div",X,[e.createVNode(f,{type:"primary",loading:h.value,onClick:w},{default:e.withCtx(()=>[e.createTextVNode(" 确定 ")]),_:1},8,["loading"])])]),default:e.withCtx(()=>[e.createElementVNode("div",K,[Q,e.createVNode(B,{modelValue:a.funcName,"onUpdate:modelValue":t[3]||(t[3]=o=>a.funcName=o),style:{width:"300px","margin-left":"10px"}},null,8,["modelValue"])]),e.createVNode(D,{ref_key:"stMonacoEditorRef",ref:c,language:"lua",style:{width:"968px",height:"400px"}},null,512)]),_:1},8,["modelValue"]),e.createVNode(M,{ref_key:"stVarSelectDialogRef",ref:v},null,512)])}}},Z=U._export_sfc(Y,[["__scopeId","data-v-8a151cf0"]]),ee={install(l){l.component("st-customFunction",Z)}};module.exports=ee;
|
package/es/CustomFunction.js
CHANGED
|
@@ -9,7 +9,7 @@ import "./el-scrollbar-31d72626.js";
|
|
|
9
9
|
import "./el-popper-05a8f271.js";
|
|
10
10
|
import { E as K } from "./el-popconfirm-16597a41.js";
|
|
11
11
|
import "./el-popover-4ed993c7.js";
|
|
12
|
-
import { inject as Q, ref as r, reactive as X, onMounted as Y, watch as Z, nextTick as ee, resolveComponent as V, openBlock as
|
|
12
|
+
import { inject as Q, ref as r, reactive as X, onMounted as Y, watch as Z, nextTick as ee, resolveComponent as V, openBlock as k, createElementBlock as w, createVNode as t, normalizeStyle as te, withCtx as l, Fragment as oe, renderList as ne, createBlock as le, createElementVNode as c, toDisplayString as N, withModifiers as z, unref as C, createTextVNode as v, normalizeClass as ae, pushScopeId as se, popScopeId as ie } from "vue";
|
|
13
13
|
import { e as ce, d as re, c as ue, E as de } from "./index-35129268.js";
|
|
14
14
|
import { E as g } from "./el-message-ba131b90.js";
|
|
15
15
|
import { _ as me } from "./_plugin-vue_export-helper-dad06003.js";
|
|
@@ -23,15 +23,15 @@ import "./index-657047bb.js";
|
|
|
23
23
|
import "./index-b132c1b1.js";
|
|
24
24
|
import "./debounce-5f2ec4be.js";
|
|
25
25
|
import "./config-provider-89aba243.js";
|
|
26
|
-
const pe = (
|
|
26
|
+
const pe = (a) => (se("data-v-8a151cf0"), a = a(), ie(), a), fe = { class: "custom-function" }, _e = { class: "func-option" }, ve = { class: "icons" }, ge = { class: "custom-header" }, ye = { class: "left" }, he = ["id"], Ee = { class: "right" }, xe = { style: { display: "flex", "align-items": "center", "margin-bottom": "10px" } }, be = /* @__PURE__ */ pe(() => /* @__PURE__ */ c("span", null, "函数名称:", -1)), ke = { class: "dialog-footer" }, Ce = {
|
|
27
27
|
__name: "index",
|
|
28
28
|
props: {
|
|
29
29
|
size: { type: String, default: "small" },
|
|
30
30
|
selectWidth: { type: String, default: "200px" }
|
|
31
31
|
},
|
|
32
32
|
emits: ["insert"],
|
|
33
|
-
setup(
|
|
34
|
-
const { request: y } = Q("stConfig"), m = r(null), h = r(null), I = F, p = r(null), u = r(""), f = r([]), d = r(!1),
|
|
33
|
+
setup(a, { emit: F }) {
|
|
34
|
+
const { request: y } = Q("stConfig"), m = r(null), h = r(null), I = F, p = r(null), u = r(""), f = r([]), d = r(!1), s = X({
|
|
35
35
|
id: null,
|
|
36
36
|
funcName: "",
|
|
37
37
|
funcExpression: ""
|
|
@@ -51,7 +51,7 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
51
51
|
}, S = (n) => {
|
|
52
52
|
switch (!!n) {
|
|
53
53
|
case !1: {
|
|
54
|
-
Object.assign(
|
|
54
|
+
Object.assign(s, {
|
|
55
55
|
id: null,
|
|
56
56
|
funcName: "",
|
|
57
57
|
funcExpression: ""
|
|
@@ -59,7 +59,7 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
59
59
|
break;
|
|
60
60
|
}
|
|
61
61
|
case !0: {
|
|
62
|
-
Object.assign(
|
|
62
|
+
Object.assign(s, {
|
|
63
63
|
id: n.id,
|
|
64
64
|
funcName: n.funcName,
|
|
65
65
|
funcExpression: n.funcExpression
|
|
@@ -70,18 +70,18 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
70
70
|
d.value = !0;
|
|
71
71
|
}, B = async () => {
|
|
72
72
|
try {
|
|
73
|
-
if (E.value = !0,
|
|
73
|
+
if (E.value = !0, s.funcExpression = m.value.getValue(), !s.funcName)
|
|
74
74
|
return g.error("函数名称不可为空");
|
|
75
|
-
if (!
|
|
75
|
+
if (!s.funcExpression)
|
|
76
76
|
return g.error("函数内容不可为空");
|
|
77
|
-
await y.post("/common/qt/saveOrUpdateSearchFunction",
|
|
77
|
+
await y.post("/common/qt/saveOrUpdateSearchFunction", s), g.success("操作成功"), d.value = !1, await x();
|
|
78
78
|
} finally {
|
|
79
79
|
E.value = !1;
|
|
80
80
|
}
|
|
81
81
|
}, q = () => {
|
|
82
82
|
if (!u.value)
|
|
83
83
|
return g.error("请先选择自定义函数后, 再执行插入");
|
|
84
|
-
I("insert", u.value);
|
|
84
|
+
I("insert", ` ${u.value}`);
|
|
85
85
|
}, M = () => {
|
|
86
86
|
h.value.open(m.value);
|
|
87
87
|
};
|
|
@@ -94,7 +94,7 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
94
94
|
case !0: {
|
|
95
95
|
ee(() => {
|
|
96
96
|
var e, i;
|
|
97
|
-
(e = m.value) == null || e.setValue(
|
|
97
|
+
(e = m.value) == null || e.setValue(s.funcExpression), (i = m.value) == null || i.resize();
|
|
98
98
|
});
|
|
99
99
|
break;
|
|
100
100
|
}
|
|
@@ -105,19 +105,20 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
), (n, e) => {
|
|
108
|
-
const i = de,
|
|
109
|
-
return
|
|
110
|
-
t(
|
|
108
|
+
const i = de, $ = K, R = H, U = J, _ = G, j = P, L = V("st-monacoEditor"), T = A, W = V("st-varSelectDialog");
|
|
109
|
+
return k(), w("div", fe, [
|
|
110
|
+
t(U, {
|
|
111
111
|
modelValue: u.value,
|
|
112
112
|
"onUpdate:modelValue": e[0] || (e[0] = (o) => u.value = o),
|
|
113
|
-
size:
|
|
113
|
+
size: a.size,
|
|
114
114
|
placeholder: "自定义函数",
|
|
115
115
|
clearable: "",
|
|
116
|
+
filterable: "",
|
|
116
117
|
onChange: D,
|
|
117
|
-
style: te({ width:
|
|
118
|
+
style: te({ width: a.selectWidth })
|
|
118
119
|
}, {
|
|
119
120
|
default: l(() => [
|
|
120
|
-
(
|
|
121
|
+
(k(!0), w(oe, null, ne(f.value, (o) => (k(), le(R, {
|
|
121
122
|
key: o.id,
|
|
122
123
|
label: o.funcName,
|
|
123
124
|
value: o.funcName
|
|
@@ -127,16 +128,18 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
127
128
|
c("span", null, N(o.funcName), 1),
|
|
128
129
|
c("div", ve, [
|
|
129
130
|
t(i, {
|
|
130
|
-
onClick: z((
|
|
131
|
+
onClick: z((b) => S(o), ["stop"])
|
|
131
132
|
}, {
|
|
132
133
|
default: l(() => [
|
|
133
134
|
t(C(ce))
|
|
134
135
|
]),
|
|
135
136
|
_: 2
|
|
136
137
|
}, 1032, ["onClick"]),
|
|
137
|
-
t(
|
|
138
|
+
t($, {
|
|
138
139
|
title: "确认是否删除?",
|
|
139
|
-
|
|
140
|
+
"confirm-button-text": "确认",
|
|
141
|
+
"cancel-button-text": "取消",
|
|
142
|
+
onConfirm: (b) => O(o)
|
|
140
143
|
}, {
|
|
141
144
|
reference: l(() => [
|
|
142
145
|
t(i, {
|
|
@@ -161,7 +164,7 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
161
164
|
}, 8, ["modelValue", "size", "style"]),
|
|
162
165
|
t(_, {
|
|
163
166
|
type: "primary",
|
|
164
|
-
size:
|
|
167
|
+
size: a.size,
|
|
165
168
|
onClick: q
|
|
166
169
|
}, {
|
|
167
170
|
default: l(() => [
|
|
@@ -171,7 +174,7 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
171
174
|
}, 8, ["size"]),
|
|
172
175
|
t(_, {
|
|
173
176
|
type: "primary",
|
|
174
|
-
size:
|
|
177
|
+
size: a.size,
|
|
175
178
|
onClick: e[1] || (e[1] = (o) => S())
|
|
176
179
|
}, {
|
|
177
180
|
default: l(() => [
|
|
@@ -192,13 +195,13 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
192
195
|
"modal-penetrable": !0,
|
|
193
196
|
"show-close": !1
|
|
194
197
|
}, {
|
|
195
|
-
header: l(({ titleId: o, titleClass:
|
|
198
|
+
header: l(({ titleId: o, titleClass: b }) => [
|
|
196
199
|
c("div", ge, [
|
|
197
200
|
c("div", ye, [
|
|
198
201
|
c("span", {
|
|
199
202
|
id: o,
|
|
200
|
-
class:
|
|
201
|
-
}, N(
|
|
203
|
+
class: ae(b)
|
|
204
|
+
}, N(s.id ? "编辑自定义函数" : "新建自定义函数"), 11, he)
|
|
202
205
|
]),
|
|
203
206
|
c("div", Ee, [
|
|
204
207
|
t(_, {
|
|
@@ -223,7 +226,7 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
223
226
|
])
|
|
224
227
|
]),
|
|
225
228
|
footer: l(() => [
|
|
226
|
-
c("div",
|
|
229
|
+
c("div", ke, [
|
|
227
230
|
t(_, {
|
|
228
231
|
type: "primary",
|
|
229
232
|
loading: E.value,
|
|
@@ -238,10 +241,10 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
238
241
|
]),
|
|
239
242
|
default: l(() => [
|
|
240
243
|
c("div", xe, [
|
|
241
|
-
|
|
244
|
+
be,
|
|
242
245
|
t(j, {
|
|
243
|
-
modelValue:
|
|
244
|
-
"onUpdate:modelValue": e[3] || (e[3] = (o) =>
|
|
246
|
+
modelValue: s.funcName,
|
|
247
|
+
"onUpdate:modelValue": e[3] || (e[3] = (o) => s.funcName = o),
|
|
245
248
|
style: { width: "300px", "margin-left": "10px" }
|
|
246
249
|
}, null, 8, ["modelValue"])
|
|
247
250
|
]),
|
|
@@ -261,9 +264,9 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
261
264
|
]);
|
|
262
265
|
};
|
|
263
266
|
}
|
|
264
|
-
}, Se = /* @__PURE__ */ me(Ce, [["__scopeId", "data-v-
|
|
265
|
-
install(
|
|
266
|
-
|
|
267
|
+
}, Se = /* @__PURE__ */ me(Ce, [["__scopeId", "data-v-8a151cf0"]]), Ye = {
|
|
268
|
+
install(a) {
|
|
269
|
+
a.component("st-customFunction", Se);
|
|
267
270
|
}
|
|
268
271
|
};
|
|
269
272
|
export {
|