st-comp 0.0.184 → 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 +9 -8
- package/es/style.css +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +1 -1
- package/lib/{index-89193973.js → index-5955b737.js} +5 -4
- package/lib/{python-930b6755.js → python-cf7a203d.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/CustomFunction/index.vue +2 -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
|
@@ -11,8 +11,8 @@ import { E as K } from "./el-popconfirm-16597a41.js";
|
|
|
11
11
|
import "./el-popover-4ed993c7.js";
|
|
12
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 { _ as me } from "./_plugin-vue_export-helper-dad06003.js";
|
|
15
14
|
import { E as g } from "./el-message-ba131b90.js";
|
|
15
|
+
import { _ as me } from "./_plugin-vue_export-helper-dad06003.js";
|
|
16
16
|
import "./index-34592e82.js";
|
|
17
17
|
import "./index-2e331d74.js";
|
|
18
18
|
import "./vnode-8ddc4f78.js";
|
|
@@ -23,7 +23,7 @@ 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 = (a) => (se("data-v-
|
|
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" },
|
|
@@ -81,7 +81,7 @@ const pe = (a) => (se("data-v-3bed8389"), a = a(), ie(), a), fe = { class: "cust
|
|
|
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
|
};
|
|
@@ -105,19 +105,20 @@ const pe = (a) => (se("data-v-3bed8389"), a = a(), ie(), a), fe = { class: "cust
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
), (n, e) => {
|
|
108
|
-
const i = de,
|
|
108
|
+
const i = de, $ = K, R = H, U = J, _ = G, j = P, L = V("st-monacoEditor"), T = A, W = V("st-varSelectDialog");
|
|
109
109
|
return k(), w("div", fe, [
|
|
110
|
-
t(
|
|
110
|
+
t(U, {
|
|
111
111
|
modelValue: u.value,
|
|
112
112
|
"onUpdate:modelValue": e[0] || (e[0] = (o) => u.value = o),
|
|
113
113
|
size: a.size,
|
|
114
114
|
placeholder: "自定义函数",
|
|
115
115
|
clearable: "",
|
|
116
|
+
filterable: "",
|
|
116
117
|
onChange: D,
|
|
117
118
|
style: te({ width: a.selectWidth })
|
|
118
119
|
}, {
|
|
119
120
|
default: l(() => [
|
|
120
|
-
(k(!0), w(oe, null, ne(f.value, (o) => (k(), le(
|
|
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
|
|
@@ -134,7 +135,7 @@ const pe = (a) => (se("data-v-3bed8389"), a = a(), ie(), a), fe = { class: "cust
|
|
|
134
135
|
]),
|
|
135
136
|
_: 2
|
|
136
137
|
}, 1032, ["onClick"]),
|
|
137
|
-
t(
|
|
138
|
+
t($, {
|
|
138
139
|
title: "确认是否删除?",
|
|
139
140
|
"confirm-button-text": "确认",
|
|
140
141
|
"cancel-button-text": "取消",
|
|
@@ -263,7 +264,7 @@ const pe = (a) => (se("data-v-3bed8389"), a = a(), ie(), a), fe = { class: "cust
|
|
|
263
264
|
]);
|
|
264
265
|
};
|
|
265
266
|
}
|
|
266
|
-
}, Se = /* @__PURE__ */ me(Ce, [["__scopeId", "data-v-
|
|
267
|
+
}, Se = /* @__PURE__ */ me(Ce, [["__scopeId", "data-v-8a151cf0"]]), Ye = {
|
|
267
268
|
install(a) {
|
|
268
269
|
a.component("st-customFunction", Se);
|
|
269
270
|
}
|