@fangzhongya/vue-archive 0.0.43 → 0.0.44
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("vue"),
|
|
1
|
+
"use strict";const s=require("vue"),T=require("./retrie/index.vue.cjs");;/* empty css */const o=require("./code.cjs"),k={key:0,class:"set-props"},q=s.defineComponent({__name:"set-props",props:{name:String,list:Array},emits:["change"],setup(i,{emit:p}){const l=i,m=p,u=s.ref({}),f=s.ref(0),c=s.ref({}),r=s.ref([]);function d(){c.value={};const n=[];l.list?.forEach(t=>{let e=t.name;if(!e.includes(".")&&(e=(e.split("/")[0]||"").trim(),e)){c.value[e]=o.getDefaultValue(t);const{arr:g,type:v,dataType:b}=o.getSpecType(t);u.value[e]=g;let V={label:_(e,t),prop:e,type:v,dataType:b,select:e};n.push(V)}}),r.value=n}function _(n,t){let e=n+": { "+(t.type||"any")+" } "+t.description;return t.default&&(e+=" 默认值="+t.default),t.selectable&&(e+=" 可选值="+t.selectable),e}function h(n,t){let e=Object.assign({},n);m("change",e,t)}let a;function y(){clearTimeout(a),a=setTimeout(()=>{d()},400)}return s.watch(()=>l.name,()=>{r.value=[],s.nextTick(()=>{y()})},{immediate:!0}),(n,t)=>r.value&&r.value.length>0?(s.openBlock(),s.createElementBlock("div",k,[s.createVNode(T,{refresh:f.value,modelValue:c.value,selects:u.value,list:r.value,name:l.name,onQuery:h},null,8,["refresh","modelValue","selects","list","name"])])):s.createCommentVNode("",!0)}});module.exports=q;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as v, ref as n, watch as T, nextTick as k, createElementBlock as x, createCommentVNode as j, openBlock as B, createVNode as C } from "vue";
|
|
2
2
|
import E from "./retrie/index.vue.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
4
|
+
import { getDefaultValue as N, getSpecType as S } from "./code.js";
|
|
5
|
+
const w = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "set-props"
|
|
8
8
|
}, R = /* @__PURE__ */ v({
|
|
@@ -13,16 +13,16 @@ const S = {
|
|
|
13
13
|
},
|
|
14
14
|
emits: ["change"],
|
|
15
15
|
setup(i, { emit: u }) {
|
|
16
|
-
const
|
|
16
|
+
const a = i, m = u, r = n({}), p = n(0), o = n({}), l = n([]);
|
|
17
17
|
function f() {
|
|
18
|
-
|
|
18
|
+
o.value = {};
|
|
19
19
|
const s = [];
|
|
20
|
-
|
|
20
|
+
a.list?.forEach((t) => {
|
|
21
21
|
let e = t.name;
|
|
22
|
-
if (e.includes(".")
|
|
23
|
-
|
|
24
|
-
const { arr: y, type: b, dataType: g } =
|
|
25
|
-
|
|
22
|
+
if (!e.includes(".") && (e = (e.split("/")[0] || "").trim(), e)) {
|
|
23
|
+
o.value[e] = N(t);
|
|
24
|
+
const { arr: y, type: b, dataType: g } = S(t);
|
|
25
|
+
r.value[e] = y;
|
|
26
26
|
let V = {
|
|
27
27
|
label: d(e, t),
|
|
28
28
|
prop: e,
|
|
@@ -49,7 +49,7 @@ const S = {
|
|
|
49
49
|
}, 400);
|
|
50
50
|
}
|
|
51
51
|
return T(
|
|
52
|
-
() =>
|
|
52
|
+
() => a.name,
|
|
53
53
|
() => {
|
|
54
54
|
l.value = [], k(() => {
|
|
55
55
|
_();
|
|
@@ -58,13 +58,13 @@ const S = {
|
|
|
58
58
|
{
|
|
59
59
|
immediate: !0
|
|
60
60
|
}
|
|
61
|
-
), (s, t) => l.value && l.value.length > 0 ? (B(), x("div",
|
|
61
|
+
), (s, t) => l.value && l.value.length > 0 ? (B(), x("div", w, [
|
|
62
62
|
C(E, {
|
|
63
63
|
refresh: p.value,
|
|
64
|
-
modelValue:
|
|
65
|
-
selects:
|
|
64
|
+
modelValue: o.value,
|
|
65
|
+
selects: r.value,
|
|
66
66
|
list: l.value,
|
|
67
|
-
name:
|
|
67
|
+
name: a.name,
|
|
68
68
|
onQuery: h
|
|
69
69
|
}, null, 8, ["refresh", "modelValue", "selects", "list", "name"])
|
|
70
70
|
])) : j("", !0);
|