widget.qw 1.0.45 → 1.0.46
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/build/style.css +3 -3
- package/build/widget.qw.es.js +14 -4
- package/build/widget.qw.umd.js +14 -4
- package/package.json +1 -1
- package/src/components/ObjsEditor.vue +16 -3
- package/src/env.d.ts +8 -8
- package/src/views/objseditor/index.vue +112 -31
- package/tsconfig.json +19 -19
- package/tsconfig.node.json +8 -8
package/build/style.css
CHANGED
|
@@ -840,13 +840,13 @@
|
|
|
840
840
|
}
|
|
841
841
|
.widget .readonly-field[data-v-0c8e09c0] {
|
|
842
842
|
margin: 4px 0;
|
|
843
|
-
}.widget[data-v-
|
|
843
|
+
}.widget[data-v-756f99e9] {
|
|
844
844
|
background: #fff;
|
|
845
845
|
box-sizing: border-box;
|
|
846
846
|
height: 100%;
|
|
847
847
|
text-align: left;
|
|
848
848
|
}
|
|
849
|
-
.widget .option[data-v-
|
|
849
|
+
.widget .option[data-v-756f99e9] {
|
|
850
850
|
margin: 8px 8px;
|
|
851
851
|
padding: 5px 5px;
|
|
852
852
|
border-radius: 4px;
|
|
@@ -855,6 +855,6 @@
|
|
|
855
855
|
display: inline-block;
|
|
856
856
|
position: relative;
|
|
857
857
|
}
|
|
858
|
-
[data-v-
|
|
858
|
+
[data-v-756f99e9] .van-field__label {
|
|
859
859
|
margin: auto;
|
|
860
860
|
}
|
package/build/widget.qw.es.js
CHANGED
|
@@ -20880,7 +20880,7 @@ const _sfc_main$1 = {
|
|
|
20880
20880
|
}
|
|
20881
20881
|
};
|
|
20882
20882
|
var SingleApiPicker = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-0c8e09c0"]]);
|
|
20883
|
-
var ObjsEditor_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".widget[data-v-
|
|
20883
|
+
var ObjsEditor_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".widget[data-v-756f99e9] {\n background: #fff;\n box-sizing: border-box;\n height: 100%;\n text-align: left;\n}\n.widget .option[data-v-756f99e9] {\n margin: 8px 8px;\n padding: 5px 5px;\n border-radius: 4px;\n background-color: rgb(217, 236, 255);\n color: #409eff;\n display: inline-block;\n position: relative;\n}\n[data-v-756f99e9] .van-field__label {\n margin: auto;\n}")();
|
|
20884
20884
|
const _hoisted_1 = {
|
|
20885
20885
|
class: "widget"
|
|
20886
20886
|
};
|
|
@@ -20984,12 +20984,22 @@ const _sfc_main = {
|
|
|
20984
20984
|
let formatValues = v.map((e) => {
|
|
20985
20985
|
let kvs = Object.keys(e).map((k) => {
|
|
20986
20986
|
var _a2, _b2, _c2, _d2;
|
|
20987
|
+
console.log("1111111");
|
|
20988
|
+
console.log(props.schema[key]);
|
|
20989
|
+
console.log(key);
|
|
20990
|
+
console.log(v);
|
|
20991
|
+
console.log(k);
|
|
20987
20992
|
let label = props.schema[key].schema[k].label;
|
|
20988
20993
|
let formatValue = e[k];
|
|
20989
20994
|
if ((_b2 = (_a2 = props.schema[key].schema[k]) == null ? void 0 : _a2.schema) == null ? void 0 : _b2.options) {
|
|
20990
20995
|
let one = (_d2 = (_c2 = props.schema[key].schema[k]) == null ? void 0 : _c2.schema) == null ? void 0 : _d2.options.find((item2) => item2[Object.keys(item2)[1]] === formatValue);
|
|
20991
|
-
|
|
20996
|
+
if (one)
|
|
20997
|
+
formatValue = one[Object.keys(one)[0]];
|
|
20998
|
+
else
|
|
20999
|
+
formatValue = "";
|
|
20992
21000
|
}
|
|
21001
|
+
if (typeof formatValue === "boolean")
|
|
21002
|
+
formatValue = formatValue ? "\u662F" : "\u5426";
|
|
20993
21003
|
return `${label}:${formatValue}`;
|
|
20994
21004
|
});
|
|
20995
21005
|
return kvs.join(",");
|
|
@@ -20997,7 +21007,7 @@ const _sfc_main = {
|
|
|
20997
21007
|
return formatValues.join(" > ");
|
|
20998
21008
|
} else if ((_b = (_a = props.schema[key]) == null ? void 0 : _a.schema) == null ? void 0 : _b.options) {
|
|
20999
21009
|
let one = (_d = (_c = props.schema[key]) == null ? void 0 : _c.schema) == null ? void 0 : _d.options.find((item2) => item2[Object.keys(item2)[1]] === v);
|
|
21000
|
-
return one[Object.keys(one)[0]];
|
|
21010
|
+
return one ? one[Object.keys(one)[0]] : "";
|
|
21001
21011
|
} else {
|
|
21002
21012
|
return v;
|
|
21003
21013
|
}
|
|
@@ -21165,7 +21175,7 @@ const _sfc_main = {
|
|
|
21165
21175
|
};
|
|
21166
21176
|
}
|
|
21167
21177
|
};
|
|
21168
|
-
var ObjsEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
21178
|
+
var ObjsEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-756f99e9"]]);
|
|
21169
21179
|
const secret_notify = () => {
|
|
21170
21180
|
showNotify({ type: "danger", message: "\u4E25\u683C\u6267\u884C\u4FE1\u606F\u4FDD\u5BC6\u8981\u6C42\uFF0C\u5207\u5B9E\u9632\u8303\u4F01\u4E1A\u6CC4\u5BC6\u98CE\u9669", duration: 3e3 });
|
|
21171
21181
|
};
|
package/build/widget.qw.umd.js
CHANGED
|
@@ -20883,7 +20883,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
20883
20883
|
}
|
|
20884
20884
|
};
|
|
20885
20885
|
var SingleApiPicker = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-0c8e09c0"]]);
|
|
20886
|
-
var ObjsEditor_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".widget[data-v-
|
|
20886
|
+
var ObjsEditor_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".widget[data-v-756f99e9] {\n background: #fff;\n box-sizing: border-box;\n height: 100%;\n text-align: left;\n}\n.widget .option[data-v-756f99e9] {\n margin: 8px 8px;\n padding: 5px 5px;\n border-radius: 4px;\n background-color: rgb(217, 236, 255);\n color: #409eff;\n display: inline-block;\n position: relative;\n}\n[data-v-756f99e9] .van-field__label {\n margin: auto;\n}")();
|
|
20887
20887
|
const _hoisted_1 = {
|
|
20888
20888
|
class: "widget"
|
|
20889
20889
|
};
|
|
@@ -20987,12 +20987,22 @@ var __async = (__this, __arguments, generator) => {
|
|
|
20987
20987
|
let formatValues = v.map((e) => {
|
|
20988
20988
|
let kvs = Object.keys(e).map((k) => {
|
|
20989
20989
|
var _a2, _b2, _c2, _d2;
|
|
20990
|
+
console.log("1111111");
|
|
20991
|
+
console.log(props.schema[key]);
|
|
20992
|
+
console.log(key);
|
|
20993
|
+
console.log(v);
|
|
20994
|
+
console.log(k);
|
|
20990
20995
|
let label = props.schema[key].schema[k].label;
|
|
20991
20996
|
let formatValue = e[k];
|
|
20992
20997
|
if ((_b2 = (_a2 = props.schema[key].schema[k]) == null ? void 0 : _a2.schema) == null ? void 0 : _b2.options) {
|
|
20993
20998
|
let one = (_d2 = (_c2 = props.schema[key].schema[k]) == null ? void 0 : _c2.schema) == null ? void 0 : _d2.options.find((item2) => item2[Object.keys(item2)[1]] === formatValue);
|
|
20994
|
-
|
|
20999
|
+
if (one)
|
|
21000
|
+
formatValue = one[Object.keys(one)[0]];
|
|
21001
|
+
else
|
|
21002
|
+
formatValue = "";
|
|
20995
21003
|
}
|
|
21004
|
+
if (typeof formatValue === "boolean")
|
|
21005
|
+
formatValue = formatValue ? "\u662F" : "\u5426";
|
|
20996
21006
|
return `${label}:${formatValue}`;
|
|
20997
21007
|
});
|
|
20998
21008
|
return kvs.join(",");
|
|
@@ -21000,7 +21010,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21000
21010
|
return formatValues.join(" > ");
|
|
21001
21011
|
} else if ((_b = (_a = props.schema[key]) == null ? void 0 : _a.schema) == null ? void 0 : _b.options) {
|
|
21002
21012
|
let one = (_d = (_c = props.schema[key]) == null ? void 0 : _c.schema) == null ? void 0 : _d.options.find((item2) => item2[Object.keys(item2)[1]] === v);
|
|
21003
|
-
return one[Object.keys(one)[0]];
|
|
21013
|
+
return one ? one[Object.keys(one)[0]] : "";
|
|
21004
21014
|
} else {
|
|
21005
21015
|
return v;
|
|
21006
21016
|
}
|
|
@@ -21168,7 +21178,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21168
21178
|
};
|
|
21169
21179
|
}
|
|
21170
21180
|
};
|
|
21171
|
-
var ObjsEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
21181
|
+
var ObjsEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-756f99e9"]]);
|
|
21172
21182
|
const secret_notify = () => {
|
|
21173
21183
|
showNotify({ type: "danger", message: "\u4E25\u683C\u6267\u884C\u4FE1\u606F\u4FDD\u5BC6\u8981\u6C42\uFF0C\u5207\u5B9E\u9632\u8303\u4F01\u4E1A\u6CC4\u5BC6\u98CE\u9669", duration: 3e3 });
|
|
21174
21184
|
};
|
package/package.json
CHANGED
|
@@ -147,15 +147,28 @@ const key2value = (key, item) => {
|
|
|
147
147
|
if (Array.isArray(v)) {
|
|
148
148
|
let formatValues = v.map(e => {
|
|
149
149
|
let kvs = Object.keys(e).map(k => {
|
|
150
|
+
console.log('1111111')
|
|
151
|
+
console.log(props.schema[key])
|
|
152
|
+
console.log(key)
|
|
153
|
+
console.log(v)
|
|
154
|
+
console.log(k)
|
|
155
|
+
|
|
150
156
|
let label = props.schema[key].schema[k].label
|
|
151
157
|
let formatValue = e[k]
|
|
152
|
-
|
|
158
|
+
|
|
153
159
|
//下拉框选项,用选项的第二个属性value找选中的选项
|
|
154
160
|
//再取选项的第一个属性name作为标题
|
|
155
161
|
if (props.schema[key].schema[k]?.schema?.options) {
|
|
156
162
|
let one = props.schema[key].schema[k]?.schema?.options.find(item => item[Object.keys(item)[1]] === formatValue)
|
|
157
|
-
|
|
163
|
+
if(one)
|
|
164
|
+
formatValue = one[Object.keys(one)[0]]
|
|
165
|
+
else
|
|
166
|
+
formatValue = ''
|
|
158
167
|
}
|
|
168
|
+
|
|
169
|
+
if(typeof formatValue === 'boolean')
|
|
170
|
+
formatValue = formatValue ? '是' : '否'
|
|
171
|
+
|
|
159
172
|
return `${label}:${formatValue}`
|
|
160
173
|
})
|
|
161
174
|
return kvs.join(',')
|
|
@@ -167,7 +180,7 @@ const key2value = (key, item) => {
|
|
|
167
180
|
//再取选项的第一个属性name作为标题
|
|
168
181
|
else if (props.schema[key]?.schema?.options) {
|
|
169
182
|
let one = props.schema[key]?.schema?.options.find(item => item[Object.keys(item)[1]] === v)
|
|
170
|
-
return one[Object.keys(one)[0]]
|
|
183
|
+
return one ? one[Object.keys(one)[0]] : ''
|
|
171
184
|
}
|
|
172
185
|
else {
|
|
173
186
|
return v
|
package/src/env.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
2
|
-
|
|
3
|
-
declare module '*.vue' {
|
|
4
|
-
import type { DefineComponent } from 'vue'
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
|
6
|
-
const component: DefineComponent<{}, {}, any>
|
|
7
|
-
export default component
|
|
8
|
-
}
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
declare module '*.vue' {
|
|
4
|
+
import type { DefineComponent } from 'vue'
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
|
6
|
+
const component: DefineComponent<{}, {}, any>
|
|
7
|
+
export default component
|
|
8
|
+
}
|
|
@@ -9,59 +9,140 @@ import { onMounted, reactive, watch } from "vue";
|
|
|
9
9
|
|
|
10
10
|
const data = reactive({
|
|
11
11
|
schema: {
|
|
12
|
-
id:{
|
|
13
|
-
label: 'id',
|
|
14
|
-
type: 'String',
|
|
15
|
-
// 自动生成8位uuid默认值
|
|
16
|
-
default: 'uuid',
|
|
17
|
-
//此字段是隐藏值
|
|
18
|
-
auth: 'gone',
|
|
19
|
-
},
|
|
20
12
|
name: {
|
|
21
|
-
label: '
|
|
13
|
+
label: '房型',
|
|
22
14
|
type: 'String',
|
|
23
15
|
default: '',
|
|
24
|
-
auth:'required'
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
auth: 'required',
|
|
17
|
+
schema: {
|
|
18
|
+
options: [
|
|
19
|
+
{
|
|
20
|
+
label: "a",
|
|
21
|
+
value: "a",
|
|
22
|
+
materials: [
|
|
23
|
+
{
|
|
24
|
+
materialId: "jiFdBeVT",
|
|
25
|
+
quantity: 1,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
materialId: "v6tjBw4R",
|
|
29
|
+
quantity: 2,
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: "b",
|
|
35
|
+
value: "b",
|
|
36
|
+
materials: [
|
|
37
|
+
{
|
|
38
|
+
materialId: "jiFdBeVT",
|
|
39
|
+
quantity: 1,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
materialId: "v6tjBw4R",
|
|
43
|
+
quantity: 2,
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
31
49
|
},
|
|
32
|
-
quantity:{
|
|
33
|
-
label: '
|
|
50
|
+
quantity: {
|
|
51
|
+
label: '数量',
|
|
34
52
|
type: 'Number',
|
|
35
|
-
default:
|
|
36
|
-
auth: '
|
|
53
|
+
default: 1,
|
|
54
|
+
auth: 'required',
|
|
37
55
|
},
|
|
38
|
-
|
|
39
|
-
label: '
|
|
56
|
+
materials: {
|
|
57
|
+
label: '材料表',
|
|
40
58
|
type: 'Array',
|
|
41
59
|
default: [],
|
|
42
|
-
auth:'required',
|
|
60
|
+
auth: 'required',
|
|
43
61
|
schema: {
|
|
44
|
-
|
|
45
|
-
label: '
|
|
62
|
+
materialId: {
|
|
63
|
+
label: '材料id',
|
|
46
64
|
type: 'String',
|
|
47
65
|
default: '',
|
|
66
|
+
auth: 'required',
|
|
48
67
|
schema: {
|
|
49
|
-
options: [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
68
|
+
options: [
|
|
69
|
+
{
|
|
70
|
+
"name": "保温棉",
|
|
71
|
+
"materialId": "jiFdBeVT",
|
|
72
|
+
"specification": "6mm",
|
|
73
|
+
"unit": "m"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "保温棉",
|
|
77
|
+
"materialId": "v6tjBw4R",
|
|
78
|
+
"specification": "8mm",
|
|
79
|
+
"unit": "m"
|
|
80
|
+
}]
|
|
54
81
|
}
|
|
55
82
|
},
|
|
56
83
|
quantity: {
|
|
57
84
|
label: '数量',
|
|
58
85
|
type: 'Number',
|
|
59
|
-
default:
|
|
86
|
+
default: 0,
|
|
87
|
+
auth: 'required'
|
|
60
88
|
}
|
|
61
89
|
}
|
|
62
90
|
}
|
|
63
91
|
},
|
|
64
92
|
// schema: {
|
|
93
|
+
// id:{
|
|
94
|
+
// label: 'id',
|
|
95
|
+
// type: 'String',
|
|
96
|
+
// // 自动生成8位uuid默认值
|
|
97
|
+
// default: 'uuid',
|
|
98
|
+
// //此字段是隐藏值
|
|
99
|
+
// auth: 'gone',
|
|
100
|
+
// },
|
|
101
|
+
// name: {
|
|
102
|
+
// label: '房号',
|
|
103
|
+
// type: 'String',
|
|
104
|
+
// default: '',
|
|
105
|
+
// auth:'required'
|
|
106
|
+
// },
|
|
107
|
+
// finishQuantity:{
|
|
108
|
+
// label: '完成数量',
|
|
109
|
+
// type: 'Number',
|
|
110
|
+
// default: 0,
|
|
111
|
+
// auth: 'readonly'
|
|
112
|
+
// },
|
|
113
|
+
// quantity:{
|
|
114
|
+
// label: '每天最多完成数量',
|
|
115
|
+
// type: 'Number',
|
|
116
|
+
// default: 0,
|
|
117
|
+
// auth: 'option'
|
|
118
|
+
// },
|
|
119
|
+
// parts: {
|
|
120
|
+
// label: '空调',
|
|
121
|
+
// type: 'Array',
|
|
122
|
+
// default: [],
|
|
123
|
+
// auth:'required',
|
|
124
|
+
// schema: {
|
|
125
|
+
// partStandardId: {
|
|
126
|
+
// label: '名称',
|
|
127
|
+
// type: 'String',
|
|
128
|
+
// default: '',
|
|
129
|
+
// schema: {
|
|
130
|
+
// options: [{
|
|
131
|
+
// name:'内机',
|
|
132
|
+
// value: 'nj',
|
|
133
|
+
// title: '内机'
|
|
134
|
+
// }]
|
|
135
|
+
// }
|
|
136
|
+
// },
|
|
137
|
+
// quantity: {
|
|
138
|
+
// label: '数量',
|
|
139
|
+
// type: 'Number',
|
|
140
|
+
// default: 1,
|
|
141
|
+
// }
|
|
142
|
+
// }
|
|
143
|
+
// }
|
|
144
|
+
// },
|
|
145
|
+
// schema: {
|
|
65
146
|
// title: {
|
|
66
147
|
// label: '标题',
|
|
67
148
|
// type: 'String',
|
package/tsconfig.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "esnext",
|
|
4
|
-
"useDefineForClassFields": true,
|
|
5
|
-
"module": "esnext",
|
|
6
|
-
"moduleResolution": "node",
|
|
7
|
-
"strict": true,
|
|
8
|
-
"jsx": "preserve",
|
|
9
|
-
"sourceMap": true,
|
|
10
|
-
"resolveJsonModule": true,
|
|
11
|
-
"isolatedModules": true,
|
|
12
|
-
"esModuleInterop": true,
|
|
13
|
-
"lib": ["esnext", "dom"],
|
|
14
|
-
"skipLibCheck": true,
|
|
15
|
-
"allowJs": true,
|
|
16
|
-
},
|
|
17
|
-
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
|
|
18
|
-
"references": [{ "path": "./tsconfig.node.json" }]
|
|
19
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "esnext",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "esnext",
|
|
6
|
+
"moduleResolution": "node",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"jsx": "preserve",
|
|
9
|
+
"sourceMap": true,
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"isolatedModules": true,
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"lib": ["esnext", "dom"],
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"allowJs": true,
|
|
16
|
+
},
|
|
17
|
+
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
|
|
18
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
|
19
|
+
}
|
package/tsconfig.node.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"composite": true,
|
|
4
|
-
"module": "esnext",
|
|
5
|
-
"moduleResolution": "node"
|
|
6
|
-
},
|
|
7
|
-
"include": ["vite.config.ts"]
|
|
8
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"composite": true,
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"moduleResolution": "node"
|
|
6
|
+
},
|
|
7
|
+
"include": ["vite.config.ts"]
|
|
8
|
+
}
|