st-comp 0.0.190 → 0.0.191
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 +6 -6
- package/es/style.css +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +1 -1
- package/lib/{index-32d6f9e8.js → index-55131964.js} +7 -7
- package/lib/{python-56c2a4dd.js → python-fd5f6563.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/CustomFunction/index.vue +3 -3
package/es/CustomFunction.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("./base-ef747d02.cjs");const O=require("./el-dialog-a24f4f8f.cjs");require("./el-overlay-ef92f51f.cjs");const $=require("./el-input-06243b61.cjs"),T=require("./el-button-5973d99c.cjs");require("./el-tag-fe492a6d.cjs");const g=require("./el-select-6d813c15.cjs");require("./el-scrollbar-05815cf5.cjs");require("./el-popper-c9e0136d.cjs");const R=require("./el-popconfirm-58a1b946.cjs");require("./el-popover-0ea8fbf8.cjs");const e=require("vue"),u=require("./index-eab8a286.cjs"),
|
|
1
|
+
"use strict";require("./base-ef747d02.cjs");const O=require("./el-dialog-a24f4f8f.cjs");require("./el-overlay-ef92f51f.cjs");const $=require("./el-input-06243b61.cjs"),T=require("./el-button-5973d99c.cjs");require("./el-tag-fe492a6d.cjs");const g=require("./el-select-6d813c15.cjs");require("./el-scrollbar-05815cf5.cjs");require("./el-popper-c9e0136d.cjs");const R=require("./el-popconfirm-58a1b946.cjs");require("./el-popover-0ea8fbf8.cjs");const e=require("vue"),u=require("./index-eab8a286.cjs"),U=require("./_plugin-vue_export-helper-f246444f.cjs"),_=require("./el-message-0aeea1a3.cjs");require("./index-bb833443.cjs");require("./index-9780a537.cjs");require("./index-f1c702f6.cjs");require("./vnode-b906ae6d.cjs");require("./scroll-b108dabd.cjs");require("./use-global-config-c2c5ca8f.cjs");require("./index-ca7dbd47.cjs");require("./typescript-b63f8e83.cjs");require("./index-7e4e0bd3.cjs");require("./index-eea0bcb3.cjs");require("./index-a9d4ef0f.cjs");require("./debounce-62f5b6e8.cjs");require("./config-provider-79c2df1b.cjs");const j=s=>(e.pushScopeId("data-v-f9f6252c"),s=s(),e.popScopeId(),s),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(s,{emit:y}){const{request:v}=e.inject("stConfig"),c=e.ref(null),h=e.ref(null),E=y,d=e.ref(null),r=e.ref(""),f=e.ref([]),i=e.ref(!1),l=e.reactive({id:null,funcName:"",funcExpression:""}),x=e.ref(!1),N=async()=>{const{body:n}=await v.post("/common/qt/querySearchFunctions");if(f.value=n??[],d.value===null)r.value="";else{const t=f.value.find(({id:a})=>a===d.value);r.value=t?t.funcName:""}},C=n=>{var t;n?d.value=(t=f.value.find(a=>a.funcName===n))==null?void 0:t.id:d.value=null},q=async n=>{await v.post("/common/qt/deleteSearchFunctionById",{id:n.id}),N()},V=(n,t)=>{switch(!!n){case!1:{Object.assign(l,{id:null,funcName:"",funcExpression:""});break}case!0:{Object.assign(l,{id:n.id,funcName:n.funcName,funcExpression:n.funcExpression});break}}t&&(l.id=null,l.funcName=`${l.funcName}-复制`),i.value=!0},w=async()=>{try{if(x.value=!0,l.funcExpression=c.value.getValue(),!l.funcName)return _.ElMessage.error("函数名称不可为空");if(!l.funcExpression)return _.ElMessage.error("函数内容不可为空");await v.post("/common/qt/saveOrUpdateSearchFunction",l),_.ElMessage.success("操作成功"),i.value=!1,await N()}finally{x.value=!1}},k=()=>{if(!r.value)return _.ElMessage.error("请先选择自定义函数后, 再执行插入");E("insert",r.value)},b=()=>{h.value.open(c.value)};return e.onMounted(()=>{N()}),e.watch(()=>i.value,n=>{switch(n){case!0:{e.nextTick(()=>{var t,a;(t=c.value)==null||t.setValue(l.funcExpression),(a=c.value)==null||a.resize()});break}case!1:{h.value.close();break}}}),(n,t)=>{const a=u.ElIcon,S=R.ElPopconfirm,z=g.ElOption,F=g.ElSelect,m=T.ElButton,M=$.ElInput,B=e.resolveComponent("st-monacoEditor"),D=O.ElDialog,I=e.resolveComponent("st-varSelectDialog");return e.openBlock(),e.createElementBlock("div",L,[e.createVNode(F,{modelValue:r.value,"onUpdate:modelValue":t[0]||(t[0]=o=>r.value=o),size:s.size,placeholder:"自定义函数","no-match-text":"无匹配选项","no-data-text":"无选项数据",clearable:"",filterable:"",onChange:C,style:e.normalizeStyle({width:s.selectWidth})},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.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(a,{onClick:e.withModifiers(p=>V(o,!0),["stop"])},{default:e.withCtx(()=>[e.createVNode(e.unref(u.document_copy_default))]),_:2},1032,["onClick"]),e.createVNode(a,{onClick:e.withModifiers(p=>V(o),["stop"])},{default:e.withCtx(()=>[e.createVNode(e.unref(u.edit_default))]),_:2},1032,["onClick"]),e.createVNode(S,{title:"确认是否删除?","confirm-button-text":"确认","cancel-button-text":"取消",onConfirm:p=>q(o)},{reference:e.withCtx(()=>[e.createVNode(a,{onClick:e.withModifiers(()=>{},["stop"])},{default:e.withCtx(()=>[e.createVNode(e.unref(u.delete_default))]),_:1})]),_:2},1032,["onConfirm"])])])]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","size","style"]),e.createVNode(m,{type:"primary",size:s.size,onClick:k},{default:e.withCtx(()=>[e.createTextVNode(" 插入 ")]),_:1},8,["size"]),e.createVNode(m,{type:"primary",size:s.size,onClick:t[1]||(t[1]=o=>V())},{default:e.withCtx(()=>[e.createTextVNode(" 新建 ")]),_:1},8,["size"]),e.createVNode(D,{"modal-class":"add-or-edit-dialog",modelValue:i.value,"onUpdate:modelValue":t[4]||(t[4]=o=>i.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:p})=>[e.createElementVNode("div",A,[e.createElementVNode("div",H,[e.createElementVNode("span",{id:o,class:e.normalizeClass(p)},e.toDisplayString(l.id?"编辑自定义函数":"新建自定义函数"),11,G)]),e.createElementVNode("div",J,[e.createVNode(m,{size:"small",type:"primary",onClick:b},{default:e.withCtx(()=>[e.createTextVNode(" 变量选择器 ")]),_:1}),e.createVNode(a,{onClick:t[2]||(t[2]=te=>i.value=!1)},{default:e.withCtx(()=>[e.createVNode(e.unref(u.close_default))]),_:1})])])]),footer:e.withCtx(()=>[e.createElementVNode("div",X,[e.createVNode(m,{type:"primary",loading:x.value,onClick:w},{default:e.withCtx(()=>[e.createTextVNode(" 确定 ")]),_:1},8,["loading"])])]),default:e.withCtx(()=>[e.createElementVNode("div",K,[Q,e.createVNode(M,{modelValue:l.funcName,"onUpdate:modelValue":t[3]||(t[3]=o=>l.funcName=o),style:{width:"300px","margin-left":"10px"}},null,8,["modelValue"])]),e.createVNode(B,{ref_key:"stMonacoEditorRef",ref:c,language:"lua",style:{width:"968px",height:"400px"}},null,512)]),_:1},8,["modelValue"]),e.createVNode(I,{ref_key:"stVarSelectDialogRef",ref:h},null,512)])}}},Z=U._export_sfc(Y,[["__scopeId","data-v-f9f6252c"]]),ee={install(s){s.component("st-customFunction",Z)}};module.exports=ee;
|
package/es/CustomFunction.js
CHANGED
|
@@ -10,9 +10,9 @@ import "./el-popper-d236d5d3.js";
|
|
|
10
10
|
import { E as K } from "./el-popconfirm-6f9a189f.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 N, 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 z, withModifiers as S, unref as g, createTextVNode as y, normalizeClass as ae, pushScopeId as se, popScopeId as ie } from "vue";
|
|
13
|
-
import {
|
|
14
|
-
import { E as h } from "./el-message-179d8e61.js";
|
|
13
|
+
import { d as ce, e as re, a as ue, c as de, E as me } from "./index-524e4e84.js";
|
|
15
14
|
import { _ as pe } from "./_plugin-vue_export-helper-dad06003.js";
|
|
15
|
+
import { E as h } from "./el-message-179d8e61.js";
|
|
16
16
|
import "./index-482f09b5.js";
|
|
17
17
|
import "./index-89502796.js";
|
|
18
18
|
import "./index-2e331d74.js";
|
|
@@ -26,7 +26,7 @@ import "./index-657047bb.js";
|
|
|
26
26
|
import "./index-7926ee44.js";
|
|
27
27
|
import "./debounce-ccdceb02.js";
|
|
28
28
|
import "./config-provider-eb54307e.js";
|
|
29
|
-
const fe = (i) => (se("data-v-
|
|
29
|
+
const fe = (i) => (se("data-v-f9f6252c"), i = i(), ie(), i), _e = { class: "custom-function" }, ve = { class: "func-option" }, ge = { class: "icons" }, ye = { class: "custom-header" }, he = { class: "left" }, xe = ["id"], Ee = { class: "right" }, be = { style: { display: "flex", "align-items": "center", "margin-bottom": "10px" } }, ke = /* @__PURE__ */ fe(() => /* @__PURE__ */ c("span", null, "函数名称:", -1)), Ce = { class: "dialog-footer" }, Ne = {
|
|
30
30
|
__name: "index",
|
|
31
31
|
props: {
|
|
32
32
|
size: { type: String, default: "small" },
|
|
@@ -133,7 +133,7 @@ const fe = (i) => (se("data-v-f0259594"), i = i(), ie(), i), _e = { class: "cust
|
|
|
133
133
|
c("span", null, z(o.funcName), 1),
|
|
134
134
|
c("div", ge, [
|
|
135
135
|
t(s, {
|
|
136
|
-
onClick: S((v) => C(o), ["stop"])
|
|
136
|
+
onClick: S((v) => C(o, !0), ["stop"])
|
|
137
137
|
}, {
|
|
138
138
|
default: l(() => [
|
|
139
139
|
t(g(ce))
|
|
@@ -141,7 +141,7 @@ const fe = (i) => (se("data-v-f0259594"), i = i(), ie(), i), _e = { class: "cust
|
|
|
141
141
|
_: 2
|
|
142
142
|
}, 1032, ["onClick"]),
|
|
143
143
|
t(s, {
|
|
144
|
-
onClick: S((v) => C(o
|
|
144
|
+
onClick: S((v) => C(o), ["stop"])
|
|
145
145
|
}, {
|
|
146
146
|
default: l(() => [
|
|
147
147
|
t(g(re))
|
|
@@ -277,7 +277,7 @@ const fe = (i) => (se("data-v-f0259594"), i = i(), ie(), i), _e = { class: "cust
|
|
|
277
277
|
]);
|
|
278
278
|
};
|
|
279
279
|
}
|
|
280
|
-
}, Se = /* @__PURE__ */ pe(Ne, [["__scopeId", "data-v-
|
|
280
|
+
}, Se = /* @__PURE__ */ pe(Ne, [["__scopeId", "data-v-f9f6252c"]]), ot = {
|
|
281
281
|
install(i) {
|
|
282
282
|
i.component("st-customFunction", Se);
|
|
283
283
|
}
|