st-comp 0.0.183 → 0.0.184
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 +31 -29
- 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-89193973.js} +5 -3
- package/lib/{python-788b56d9.js → python-930b6755.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/CustomFunction/index.vue +2 -0
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 T=require("./el-input-c663697a.cjs"),$=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"),
|
|
1
|
+
"use strict";require("./base-ef747d02.cjs");const O=require("./el-dialog-45250561.cjs");require("./el-overlay-39e2e96f.cjs");const T=require("./el-input-c663697a.cjs"),$=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"),U=require("./_plugin-vue_export-helper-f246444f.cjs"),p=require("./el-message-c500161d.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-3bed8389"),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}},b=()=>{if(!i.value)return p.ElMessage.error("请先选择自定义函数后, 再执行插入");E("insert",i.value)},k=()=>{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=$.ElButton,B=T.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:"",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:b},{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:k},{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-3bed8389"]]),ee={install(l){l.component("st-customFunction",Z)}};module.exports=ee;
|
package/es/CustomFunction.js
CHANGED
|
@@ -9,10 +9,10 @@ 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
|
-
import { E as g } from "./el-message-ba131b90.js";
|
|
15
14
|
import { _ as me } from "./_plugin-vue_export-helper-dad06003.js";
|
|
15
|
+
import { E as g } from "./el-message-ba131b90.js";
|
|
16
16
|
import "./index-34592e82.js";
|
|
17
17
|
import "./index-2e331d74.js";
|
|
18
18
|
import "./vnode-8ddc4f78.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-3bed8389"), 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,11 +70,11 @@ 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
|
}
|
|
@@ -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
|
}
|
|
@@ -106,18 +106,18 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
106
106
|
}
|
|
107
107
|
), (n, e) => {
|
|
108
108
|
const i = de, R = K, U = H, $ = J, _ = G, j = P, L = V("st-monacoEditor"), T = A, W = V("st-varSelectDialog");
|
|
109
|
-
return
|
|
109
|
+
return k(), w("div", fe, [
|
|
110
110
|
t($, {
|
|
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
116
|
onChange: D,
|
|
117
|
-
style: te({ width:
|
|
117
|
+
style: te({ width: a.selectWidth })
|
|
118
118
|
}, {
|
|
119
119
|
default: l(() => [
|
|
120
|
-
(
|
|
120
|
+
(k(!0), w(oe, null, ne(f.value, (o) => (k(), le(U, {
|
|
121
121
|
key: o.id,
|
|
122
122
|
label: o.funcName,
|
|
123
123
|
value: o.funcName
|
|
@@ -127,7 +127,7 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
127
127
|
c("span", null, N(o.funcName), 1),
|
|
128
128
|
c("div", ve, [
|
|
129
129
|
t(i, {
|
|
130
|
-
onClick: z((
|
|
130
|
+
onClick: z((b) => S(o), ["stop"])
|
|
131
131
|
}, {
|
|
132
132
|
default: l(() => [
|
|
133
133
|
t(C(ce))
|
|
@@ -136,7 +136,9 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
136
136
|
}, 1032, ["onClick"]),
|
|
137
137
|
t(R, {
|
|
138
138
|
title: "确认是否删除?",
|
|
139
|
-
|
|
139
|
+
"confirm-button-text": "确认",
|
|
140
|
+
"cancel-button-text": "取消",
|
|
141
|
+
onConfirm: (b) => O(o)
|
|
140
142
|
}, {
|
|
141
143
|
reference: l(() => [
|
|
142
144
|
t(i, {
|
|
@@ -161,7 +163,7 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
161
163
|
}, 8, ["modelValue", "size", "style"]),
|
|
162
164
|
t(_, {
|
|
163
165
|
type: "primary",
|
|
164
|
-
size:
|
|
166
|
+
size: a.size,
|
|
165
167
|
onClick: q
|
|
166
168
|
}, {
|
|
167
169
|
default: l(() => [
|
|
@@ -171,7 +173,7 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
171
173
|
}, 8, ["size"]),
|
|
172
174
|
t(_, {
|
|
173
175
|
type: "primary",
|
|
174
|
-
size:
|
|
176
|
+
size: a.size,
|
|
175
177
|
onClick: e[1] || (e[1] = (o) => S())
|
|
176
178
|
}, {
|
|
177
179
|
default: l(() => [
|
|
@@ -192,13 +194,13 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
192
194
|
"modal-penetrable": !0,
|
|
193
195
|
"show-close": !1
|
|
194
196
|
}, {
|
|
195
|
-
header: l(({ titleId: o, titleClass:
|
|
197
|
+
header: l(({ titleId: o, titleClass: b }) => [
|
|
196
198
|
c("div", ge, [
|
|
197
199
|
c("div", ye, [
|
|
198
200
|
c("span", {
|
|
199
201
|
id: o,
|
|
200
|
-
class:
|
|
201
|
-
}, N(
|
|
202
|
+
class: ae(b)
|
|
203
|
+
}, N(s.id ? "编辑自定义函数" : "新建自定义函数"), 11, he)
|
|
202
204
|
]),
|
|
203
205
|
c("div", Ee, [
|
|
204
206
|
t(_, {
|
|
@@ -223,7 +225,7 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
223
225
|
])
|
|
224
226
|
]),
|
|
225
227
|
footer: l(() => [
|
|
226
|
-
c("div",
|
|
228
|
+
c("div", ke, [
|
|
227
229
|
t(_, {
|
|
228
230
|
type: "primary",
|
|
229
231
|
loading: E.value,
|
|
@@ -238,10 +240,10 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
238
240
|
]),
|
|
239
241
|
default: l(() => [
|
|
240
242
|
c("div", xe, [
|
|
241
|
-
|
|
243
|
+
be,
|
|
242
244
|
t(j, {
|
|
243
|
-
modelValue:
|
|
244
|
-
"onUpdate:modelValue": e[3] || (e[3] = (o) =>
|
|
245
|
+
modelValue: s.funcName,
|
|
246
|
+
"onUpdate:modelValue": e[3] || (e[3] = (o) => s.funcName = o),
|
|
245
247
|
style: { width: "300px", "margin-left": "10px" }
|
|
246
248
|
}, null, 8, ["modelValue"])
|
|
247
249
|
]),
|
|
@@ -261,9 +263,9 @@ const pe = (s) => (ae("data-v-44f08e3e"), s = s(), ie(), s), fe = { class: "cust
|
|
|
261
263
|
]);
|
|
262
264
|
};
|
|
263
265
|
}
|
|
264
|
-
}, Se = /* @__PURE__ */ me(Ce, [["__scopeId", "data-v-
|
|
265
|
-
install(
|
|
266
|
-
|
|
266
|
+
}, Se = /* @__PURE__ */ me(Ce, [["__scopeId", "data-v-3bed8389"]]), Ye = {
|
|
267
|
+
install(a) {
|
|
268
|
+
a.component("st-customFunction", Se);
|
|
267
269
|
}
|
|
268
270
|
};
|
|
269
271
|
export {
|