@duxweb/dvha-pro 1.1.21 → 1.1.22
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/dist/cjs/component.cjs +1 -1
- package/dist/cjs/components/cascaderPanel/cascaderPanel.cjs +1 -0
- package/dist/cjs/components/chart/echart.cjs +1 -1
- package/dist/cjs/components/dashboard/helloBig.cjs +1 -1
- package/dist/cjs/components/data/dynamicData.cjs +1 -1
- package/dist/cjs/components/data/selectModal.cjs +1 -1
- package/dist/cjs/components/designEditor/editor/setting.cjs +1 -1
- package/dist/cjs/components/designEditor/editor.cjs +1 -1
- package/dist/cjs/components/drawer/drawer.cjs +1 -1
- package/dist/cjs/components/flowEditor/components/setting.cjs +1 -1
- package/dist/cjs/components/form/drawerForm.cjs +1 -1
- package/dist/cjs/components/form/formItem.cjs +1 -1
- package/dist/cjs/components/form/modalForm.cjs +1 -1
- package/dist/cjs/components/form/pageForm.cjs +1 -1
- package/dist/cjs/components/form/pageTabForm.cjs +1 -1
- package/dist/cjs/components/form/settingForm.cjs +1 -1
- package/dist/cjs/components/formEditor/components/imageUpload.cjs +1 -1
- package/dist/cjs/components/formEditor/editor.cjs +1 -1
- package/dist/cjs/components/layout/table.cjs +1 -1
- package/dist/cjs/components/layout/tools.cjs +1 -1
- package/dist/cjs/components/mapCoord/mapCoord.cjs +1 -0
- package/dist/cjs/components/media/media.cjs +1 -1
- package/dist/cjs/components/modal/modalTab.cjs +1 -1
- package/dist/cjs/components/panel/setting.cjs +1 -1
- package/dist/cjs/components/posterEditor/posterEditor.cjs +1 -1
- package/dist/cjs/components/select/selectCard.cjs +1 -1
- package/dist/cjs/components/spec/spec.cjs +1 -1
- package/dist/cjs/components/stats/realTime.cjs +1 -1
- package/dist/cjs/components/table/table.cjs +1 -1
- package/dist/cjs/components/textImageEditor/textImageEditor.cjs +1 -0
- package/dist/cjs/components/textImageEditor/textModal.cjs +1 -0
- package/dist/cjs/components/upload/image.cjs +1 -1
- package/dist/cjs/components/upload/manage/item.cjs +1 -1
- package/dist/cjs/components/upload/manager.cjs +1 -1
- package/dist/cjs/components/upload/video.cjs +1 -0
- package/dist/cjs/components/widget/connect.cjs +1 -1
- package/dist/cjs/dvha-pro.css +1 -1
- package/dist/cjs/hooks/dialog.cjs +1 -1
- package/dist/cjs/hooks/drawer.cjs +1 -1
- package/dist/cjs/hooks/modal.cjs +1 -1
- package/dist/cjs/hooks/table/image.cjs +1 -1
- package/dist/cjs/hooks/table/media.cjs +1 -1
- package/dist/cjs/hooks/table/switch.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/langs/en-US.json.cjs +1 -1
- package/dist/cjs/langs/zh-CN.json.cjs +1 -1
- package/dist/cjs/pages/authLayout.cjs +1 -1
- package/dist/cjs/pages/login.cjs +1 -1
- package/dist/cjs/pages/menu/avatar.cjs +1 -1
- package/dist/cjs/pages/menu/button.cjs +1 -1
- package/dist/cjs/pages/menu/menuApp.cjs +1 -1
- package/dist/cjs/pages/menu/mobile.cjs +1 -1
- package/dist/cjs/pages/menu/notice.cjs +1 -1
- package/dist/cjs/pages/page404.cjs +1 -1
- package/dist/cjs/pages/pageStatus.cjs +1 -1
- package/dist/cjs/theme/uno.css.cjs +24 -2
- package/dist/esm/component.js +21 -20
- package/dist/esm/components/cascaderPanel/cascaderPanel.js +378 -0
- package/dist/esm/components/chart/echart.js +1 -1
- package/dist/esm/components/dashboard/helloBig.js +3 -2
- package/dist/esm/components/data/dynamicData.js +49 -40
- package/dist/esm/components/data/selectModal.js +3 -3
- package/dist/esm/components/designEditor/editor/setting.js +2 -2
- package/dist/esm/components/designEditor/editor.js +3 -2
- package/dist/esm/components/drawer/drawer.js +22 -19
- package/dist/esm/components/flowEditor/components/setting.js +1 -1
- package/dist/esm/components/form/drawerForm.js +1 -1
- package/dist/esm/components/form/formItem.js +1 -1
- package/dist/esm/components/form/modalForm.js +1 -1
- package/dist/esm/components/form/pageForm.js +1 -1
- package/dist/esm/components/form/pageTabForm.js +1 -1
- package/dist/esm/components/form/settingForm.js +1 -1
- package/dist/esm/components/formEditor/components/imageUpload.js +1 -1
- package/dist/esm/components/formEditor/editor.js +1 -1
- package/dist/esm/components/layout/table.js +74 -56
- package/dist/esm/components/layout/tools.js +8 -8
- package/dist/esm/components/mapCoord/mapCoord.js +218 -0
- package/dist/esm/components/media/media.js +57 -32
- package/dist/esm/components/modal/modalTab.js +20 -14
- package/dist/esm/components/panel/setting.js +3 -2
- package/dist/esm/components/posterEditor/posterEditor.js +1 -1
- package/dist/esm/components/select/selectCard.js +3 -3
- package/dist/esm/components/spec/spec.js +142 -103
- package/dist/esm/components/stats/realTime.js +5 -4
- package/dist/esm/components/table/table.js +19 -19
- package/dist/esm/components/textImageEditor/textImageEditor.js +405 -0
- package/dist/esm/components/textImageEditor/textModal.js +77 -0
- package/dist/esm/components/upload/image.js +35 -34
- package/dist/esm/components/upload/manage/item.js +1 -1
- package/dist/esm/components/upload/manager.js +155 -138
- package/dist/esm/components/upload/video.js +340 -0
- package/dist/esm/components/widget/connect.js +3 -2
- package/dist/esm/dvha-pro.css +1 -1
- package/dist/esm/hooks/dialog.js +2 -2
- package/dist/esm/hooks/drawer.js +2 -2
- package/dist/esm/hooks/modal.js +2 -2
- package/dist/esm/hooks/table/image.js +2 -2
- package/dist/esm/hooks/table/media.js +2 -2
- package/dist/esm/hooks/table/switch.js +58 -26
- package/dist/esm/index.js +308 -296
- package/dist/esm/langs/en-US.json.js +1 -1
- package/dist/esm/langs/zh-CN.json.js +1 -1
- package/dist/esm/pages/authLayout.js +1 -1
- package/dist/esm/pages/login.js +1 -1
- package/dist/esm/pages/menu/avatar.js +1 -1
- package/dist/esm/pages/menu/button.js +1 -1
- package/dist/esm/pages/menu/menuApp.js +1 -1
- package/dist/esm/pages/menu/mobile.js +1 -1
- package/dist/esm/pages/menu/notice.js +1 -1
- package/dist/esm/pages/page404.js +1 -1
- package/dist/esm/pages/pageStatus.js +2 -2
- package/dist/esm/theme/uno.css.js +24 -2
- package/dist/types/components/cascaderPanel/cascaderPanel.d.ts +110 -0
- package/dist/types/components/cascaderPanel/index.d.ts +1 -0
- package/dist/types/components/data/dynamicData.d.ts +10 -0
- package/dist/types/components/data/index.d.ts +1 -1
- package/dist/types/components/data/selectModal.d.ts +2 -2
- package/dist/types/components/drawer/drawer.d.ts +1 -1
- package/dist/types/components/flowEditor/components/kvInput.d.ts +1 -1
- package/dist/types/components/flowEditor/components/nodeCard.d.ts +1 -1
- package/dist/types/components/form/drawerForm.d.ts +2 -2
- package/dist/types/components/form/formLayout.d.ts +2 -2
- package/dist/types/components/form/modalForm.d.ts +2 -2
- package/dist/types/components/index.d.ts +3 -0
- package/dist/types/components/level/level.d.ts +2 -2
- package/dist/types/components/mapCoord/index.d.ts +1 -0
- package/dist/types/components/mapCoord/mapCoord.d.ts +93 -0
- package/dist/types/components/media/media.d.ts +3 -32
- package/dist/types/components/modal/modalTab.d.ts +5 -5
- package/dist/types/components/select/checkboxTag.d.ts +2 -2
- package/dist/types/components/select/dateTag.d.ts +2 -2
- package/dist/types/components/select/radioTag.d.ts +2 -2
- package/dist/types/components/select/selectCard.d.ts +4 -4
- package/dist/types/components/spec/spec.d.ts +21 -0
- package/dist/types/components/table/table.d.ts +3 -3
- package/dist/types/components/textImageEditor/index.d.ts +2 -0
- package/dist/types/components/textImageEditor/textImageEditor.d.ts +56 -0
- package/dist/types/components/textImageEditor/textModal.d.ts +72 -0
- package/dist/types/components/textImageEditor/types.d.ts +19 -0
- package/dist/types/components/upload/index.d.ts +1 -0
- package/dist/types/components/upload/video.d.ts +126 -0
- package/dist/types/components/widget/index.d.ts +1 -0
- package/dist/types/hooks/table/column.d.ts +1 -1
- package/dist/types/hooks/table/switch.d.ts +1 -1
- package/dist/types/main.d.ts +5 -0
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { useVModel as
|
|
1
|
+
import { defineComponent as k, ref as M, computed as g, watch as N, createVNode as S, mergeProps as R } from "vue";
|
|
2
|
+
import { useI18n as z } from "@duxweb/dvha-core";
|
|
3
|
+
import { useVModel as F } from "@vueuse/core";
|
|
4
4
|
import { NSwitch as O } from "naive-ui";
|
|
5
|
-
import { DuxDynamicData as
|
|
5
|
+
import { DuxDynamicData as I } from "../data/dynamicData.js";
|
|
6
6
|
import "vue-router";
|
|
7
7
|
import "@overlastic/vue";
|
|
8
8
|
import "clsx";
|
|
@@ -61,46 +61,46 @@ import "../posterEditor/elements/index.js";
|
|
|
61
61
|
import "fabric";
|
|
62
62
|
import "../schemaEditor/schemaEditor.js";
|
|
63
63
|
import "dayjs";
|
|
64
|
-
import { DuxSpecEditor as
|
|
64
|
+
import { DuxSpecEditor as $, createSpecValue as C, createSpec as B } from "./specEditor.js";
|
|
65
65
|
import "@tanstack/vue-query";
|
|
66
66
|
import "pinia";
|
|
67
|
-
const
|
|
68
|
-
function
|
|
69
|
-
return (
|
|
70
|
-
const
|
|
71
|
-
...
|
|
72
|
-
id:
|
|
67
|
+
const L = "__dux_spec__", _ = (o) => `${L}${o}`;
|
|
68
|
+
function W(o = []) {
|
|
69
|
+
return (o || []).map((s) => {
|
|
70
|
+
const u = (s.values?.length ? s.values : [C()]).map((m) => ({
|
|
71
|
+
...m,
|
|
72
|
+
id: m.id || C().id
|
|
73
73
|
}));
|
|
74
74
|
return {
|
|
75
|
-
...
|
|
76
|
-
id:
|
|
77
|
-
values:
|
|
75
|
+
...s,
|
|
76
|
+
id: s.id || B().id,
|
|
77
|
+
values: u
|
|
78
78
|
};
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
if (!
|
|
81
|
+
function X(o) {
|
|
82
|
+
if (!o.length)
|
|
83
83
|
return [];
|
|
84
|
-
let
|
|
85
|
-
return
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
...
|
|
91
|
-
[
|
|
84
|
+
let s = [{}];
|
|
85
|
+
return o.forEach((u) => {
|
|
86
|
+
const m = [];
|
|
87
|
+
s.forEach((x) => {
|
|
88
|
+
u.values.forEach((t) => {
|
|
89
|
+
m.push({
|
|
90
|
+
...x,
|
|
91
|
+
[u.id]: t
|
|
92
92
|
});
|
|
93
93
|
});
|
|
94
|
-
}),
|
|
95
|
-
}),
|
|
96
|
-
key:
|
|
97
|
-
map:
|
|
94
|
+
}), s = m;
|
|
95
|
+
}), s.map((u) => ({
|
|
96
|
+
key: o.map((m) => u[m.id]?.id || "").join("__"),
|
|
97
|
+
map: u
|
|
98
98
|
}));
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
return
|
|
100
|
+
function q(o, s) {
|
|
101
|
+
return s.map((u) => o?.__specs?.[u.id]?.id || o?.[_(u.id)] || "").join("__");
|
|
102
102
|
}
|
|
103
|
-
const
|
|
103
|
+
const st = /* @__PURE__ */ k({
|
|
104
104
|
name: "DuxSpec",
|
|
105
105
|
props: {
|
|
106
106
|
columns: {
|
|
@@ -113,24 +113,34 @@ const it = /* @__PURE__ */ K({
|
|
|
113
113
|
imageUploadProps: {
|
|
114
114
|
type: Object,
|
|
115
115
|
default: () => ({})
|
|
116
|
+
},
|
|
117
|
+
/**
|
|
118
|
+
* When enabled, DuxSpec will keep `row.specs` in sync as a plain map:
|
|
119
|
+
* { [specName]: valueLabel }.
|
|
120
|
+
*
|
|
121
|
+
* This lets the backend store/query SKU specs without dealing with editor-only fields.
|
|
122
|
+
*/
|
|
123
|
+
syncRowSpecs: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: !1
|
|
116
126
|
}
|
|
117
127
|
},
|
|
118
128
|
emits: ["update:value", "change"],
|
|
119
|
-
setup(
|
|
120
|
-
emit:
|
|
121
|
-
expose:
|
|
122
|
-
slots:
|
|
129
|
+
setup(o, {
|
|
130
|
+
emit: s,
|
|
131
|
+
expose: u,
|
|
132
|
+
slots: m
|
|
123
133
|
}) {
|
|
124
134
|
const {
|
|
125
|
-
t:
|
|
126
|
-
} =
|
|
127
|
-
defaultValue:
|
|
135
|
+
t: x
|
|
136
|
+
} = z(), t = F(o, "value", s, {
|
|
137
|
+
defaultValue: o.defaultValue || {
|
|
128
138
|
specs: [],
|
|
129
139
|
rows: []
|
|
130
140
|
},
|
|
131
141
|
passive: !0,
|
|
132
142
|
deep: !0
|
|
133
|
-
}),
|
|
143
|
+
}), h = M(null), v = () => {
|
|
134
144
|
if (!t.value) {
|
|
135
145
|
t.value = {
|
|
136
146
|
specs: [],
|
|
@@ -142,117 +152,146 @@ const it = /* @__PURE__ */ K({
|
|
|
142
152
|
status: 1
|
|
143
153
|
});
|
|
144
154
|
};
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
},
|
|
149
|
-
const
|
|
150
|
-
id:
|
|
151
|
-
label: (
|
|
155
|
+
v();
|
|
156
|
+
const f = () => {
|
|
157
|
+
o.onUpdateValue?.(t.value), s("change", t.value);
|
|
158
|
+
}, b = g(() => (v(), (t.value?.specs || []).map((e) => {
|
|
159
|
+
const i = (e.name || "").trim(), a = (e.values || []).map((n) => ({
|
|
160
|
+
id: n.id,
|
|
161
|
+
label: (n.label || "").trim(),
|
|
152
162
|
specId: e.id,
|
|
153
|
-
specName:
|
|
154
|
-
})).filter((
|
|
163
|
+
specName: i
|
|
164
|
+
})).filter((n) => !!n.label);
|
|
155
165
|
return {
|
|
156
166
|
id: e.id,
|
|
157
|
-
name:
|
|
158
|
-
values:
|
|
167
|
+
name: i,
|
|
168
|
+
values: a
|
|
159
169
|
};
|
|
160
|
-
}).filter((e) => e.name && e.values.length))),
|
|
161
|
-
if (
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
170
|
+
}).filter((e) => e.name && e.values.length))), P = (e, i) => {
|
|
171
|
+
if (!o.syncRowSpecs)
|
|
172
|
+
return;
|
|
173
|
+
const a = {};
|
|
174
|
+
i.forEach((n) => {
|
|
175
|
+
const c = e?.__specs?.[n.id];
|
|
176
|
+
c?.label && (a[n.name] = c.label);
|
|
177
|
+
}), e.specs = a;
|
|
178
|
+
}, K = (e, i) => {
|
|
179
|
+
if (!e || typeof e != "object")
|
|
180
|
+
return;
|
|
181
|
+
if (e.__specKey && e.__specs) {
|
|
182
|
+
P(e, i);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const a = e.specs;
|
|
186
|
+
if (!a || typeof a != "object" || Array.isArray(a))
|
|
187
|
+
return;
|
|
188
|
+
const n = {}, c = [];
|
|
189
|
+
i.forEach((d) => {
|
|
190
|
+
const y = a[d.name];
|
|
191
|
+
if (!y)
|
|
192
|
+
return;
|
|
193
|
+
const r = d.values.find((l) => l.label === y);
|
|
194
|
+
r && (n[d.id] = r, c.push(r.id), e[_(d.id)] = r.label);
|
|
195
|
+
}), c.length === i.length && (e.__specKey = c.join("__"), e.__specs = n, P(e, i));
|
|
196
|
+
}, V = (e) => {
|
|
197
|
+
if (v(), !e.length) {
|
|
198
|
+
let r = !1;
|
|
199
|
+
const l = t.value.rows || [];
|
|
200
|
+
l.length ? (l.forEach((p) => {
|
|
201
|
+
typeof p.status > "u" && (p.status = 1, r = !0);
|
|
202
|
+
}), r && f()) : (t.value.rows = [{
|
|
167
203
|
status: 1
|
|
168
|
-
}],
|
|
204
|
+
}], f());
|
|
169
205
|
return;
|
|
170
206
|
}
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
207
|
+
const i = t.value.rows || [];
|
|
208
|
+
i.forEach((r) => K(r, e));
|
|
209
|
+
const a = X(e), n = i, c = /* @__PURE__ */ new Map();
|
|
210
|
+
n.forEach((r) => {
|
|
211
|
+
const l = r.__specKey || q(r, e);
|
|
212
|
+
c.set(l, r);
|
|
175
213
|
});
|
|
176
|
-
let
|
|
177
|
-
const
|
|
178
|
-
const
|
|
179
|
-
...
|
|
214
|
+
let d = a.length !== n.length;
|
|
215
|
+
const y = a.map((r) => {
|
|
216
|
+
const l = c.get(r.key), p = l ? {
|
|
217
|
+
...l
|
|
180
218
|
} : {
|
|
181
219
|
status: 1
|
|
182
220
|
};
|
|
183
|
-
return
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
}), !
|
|
187
|
-
const
|
|
188
|
-
return
|
|
189
|
-
}) && (
|
|
221
|
+
return p.__specKey = r.key, p.__specs = r.map, typeof p.status > "u" && (p.status = 1), e.forEach((E) => {
|
|
222
|
+
const w = _(E.id);
|
|
223
|
+
p[w] = r.map[E.id]?.label || "";
|
|
224
|
+
}), P(p, e), !d && l && e.some((w) => {
|
|
225
|
+
const A = _(w.id);
|
|
226
|
+
return l[A] !== p[A];
|
|
227
|
+
}) && (d = !0), l || (d = !0), p;
|
|
190
228
|
});
|
|
191
|
-
|
|
229
|
+
d && (t.value.rows = y, f());
|
|
192
230
|
};
|
|
193
|
-
|
|
194
|
-
|
|
231
|
+
N(b, (e) => {
|
|
232
|
+
V(e);
|
|
195
233
|
}, {
|
|
196
234
|
immediate: !0
|
|
197
235
|
});
|
|
198
|
-
const U =
|
|
199
|
-
const
|
|
236
|
+
const U = g(() => b.value.map((e) => {
|
|
237
|
+
const i = _(e.id);
|
|
200
238
|
return {
|
|
201
|
-
key:
|
|
239
|
+
key: i,
|
|
202
240
|
title: e.name,
|
|
203
241
|
width: 160,
|
|
204
|
-
render: (
|
|
242
|
+
render: (a) => a?.[i] || a?.__specs?.[e.id]?.label || ""
|
|
205
243
|
};
|
|
206
|
-
})),
|
|
244
|
+
})), j = g(() => ({
|
|
207
245
|
key: "__dux_spec_status",
|
|
208
|
-
title:
|
|
246
|
+
title: x("components.spec.status"),
|
|
209
247
|
width: 120,
|
|
210
248
|
fixed: "right",
|
|
211
249
|
align: "center",
|
|
212
|
-
render: (e) =>
|
|
250
|
+
render: (e) => S(O, R({
|
|
213
251
|
value: e.status !== 0 && e.status !== !1
|
|
214
252
|
}, {
|
|
215
|
-
"onUpdate:value": (
|
|
216
|
-
e.status =
|
|
253
|
+
"onUpdate:value": (i) => {
|
|
254
|
+
e.status = i ? 1 : 0, f();
|
|
217
255
|
}
|
|
218
256
|
}), null)
|
|
219
|
-
})), D =
|
|
220
|
-
return
|
|
257
|
+
})), D = g(() => [...U.value, ...o.columns || [], j.value]);
|
|
258
|
+
return u({
|
|
221
259
|
setPresetSpecs: (e = []) => {
|
|
222
|
-
if (
|
|
223
|
-
|
|
260
|
+
if (h.value && h.value.setPresetSpecs) {
|
|
261
|
+
h.value.setPresetSpecs(e);
|
|
224
262
|
return;
|
|
225
263
|
}
|
|
226
|
-
|
|
264
|
+
v(), t.value.specs = W(e), f(), V(b.value);
|
|
227
265
|
}
|
|
228
|
-
}), () =>
|
|
266
|
+
}), () => S("div", {
|
|
229
267
|
class: "flex flex-col gap-4"
|
|
230
|
-
}, [
|
|
231
|
-
ref:
|
|
268
|
+
}, [S($, R({
|
|
269
|
+
ref: h,
|
|
232
270
|
value: t.value?.specs,
|
|
233
|
-
defaultValue:
|
|
234
|
-
imageUploadProps:
|
|
271
|
+
defaultValue: o.defaultValue?.specs,
|
|
272
|
+
imageUploadProps: o.imageUploadProps
|
|
235
273
|
}, {
|
|
236
274
|
"onUpdate:value": (e) => {
|
|
237
|
-
|
|
275
|
+
v(), t.value.specs = e, f();
|
|
238
276
|
}
|
|
239
277
|
}), {
|
|
240
|
-
actions: () =>
|
|
241
|
-
namePrefix: (e) =>
|
|
242
|
-
valuePrefix: (e) =>
|
|
243
|
-
}),
|
|
278
|
+
actions: () => m?.actions?.(),
|
|
279
|
+
namePrefix: (e) => m?.namePrefix?.(e),
|
|
280
|
+
valuePrefix: (e) => m?.valuePrefix?.(e)
|
|
281
|
+
}), S(I, R({
|
|
244
282
|
value: t.value?.rows || [],
|
|
245
283
|
columns: D.value,
|
|
246
284
|
createAction: !1,
|
|
247
285
|
deleteAction: !1,
|
|
248
|
-
moveAction: !1
|
|
286
|
+
moveAction: !1,
|
|
287
|
+
size: "medium"
|
|
249
288
|
}, {
|
|
250
289
|
"onUpdate:value": (e) => {
|
|
251
|
-
|
|
290
|
+
v(), t.value.rows = e, f();
|
|
252
291
|
}
|
|
253
292
|
}), null)]);
|
|
254
293
|
}
|
|
255
294
|
});
|
|
256
295
|
export {
|
|
257
|
-
|
|
296
|
+
st as DuxSpec
|
|
258
297
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as m, computed as s, createVNode as e, Fragment as u } from "vue";
|
|
2
2
|
import { useI18n as d } from "@duxweb/dvha-core";
|
|
3
3
|
import { NScrollbar as c } from "naive-ui";
|
|
4
4
|
import { DuxCard as p } from "../card/card.js";
|
|
5
|
+
import "@vueuse/core";
|
|
5
6
|
import "clsx";
|
|
6
7
|
import { DuxChart as x } from "../chart/echart.js";
|
|
7
8
|
import { DuxStatsNumber as f } from "./number.js";
|
|
8
|
-
const
|
|
9
|
+
const w = /* @__PURE__ */ m({
|
|
9
10
|
name: "DuxStatsRealTime",
|
|
10
11
|
props: {
|
|
11
12
|
title: {
|
|
@@ -57,7 +58,7 @@ const T = /* @__PURE__ */ u({
|
|
|
57
58
|
headerExtra: () => e("div", {
|
|
58
59
|
class: "text-sm text-muted"
|
|
59
60
|
}, [a.subtitle]),
|
|
60
|
-
default: () => e(
|
|
61
|
+
default: () => e(u, null, [a.cards.length > 0 && e("div", {
|
|
61
62
|
class: "lg:h-26 bg-muted"
|
|
62
63
|
}, [e(c, {
|
|
63
64
|
xScrollable: !0
|
|
@@ -95,5 +96,5 @@ const T = /* @__PURE__ */ u({
|
|
|
95
96
|
}
|
|
96
97
|
});
|
|
97
98
|
export {
|
|
98
|
-
|
|
99
|
+
w as DuxStatsRealTime
|
|
99
100
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as f, computed as
|
|
1
|
+
import { defineComponent as f, computed as m, unref as c, createVNode as r, mergeProps as p } from "vue";
|
|
2
2
|
import { useI18n as b } from "@duxweb/dvha-core";
|
|
3
3
|
import { useWindowSize as g } from "@vueuse/core";
|
|
4
|
-
import { NDataTable as
|
|
4
|
+
import { NDataTable as e, NPagination as x } from "naive-ui";
|
|
5
5
|
import "vue-router";
|
|
6
6
|
import "@overlastic/vue";
|
|
7
7
|
import "clsx";
|
|
@@ -82,34 +82,34 @@ const Bt = /* @__PURE__ */ f({
|
|
|
82
82
|
default: !0
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
-
extends:
|
|
85
|
+
extends: e,
|
|
86
86
|
setup(o, {
|
|
87
|
-
expose:
|
|
87
|
+
expose: n
|
|
88
88
|
}) {
|
|
89
|
-
const
|
|
89
|
+
const a = m(() => {
|
|
90
90
|
const {
|
|
91
91
|
path: t,
|
|
92
92
|
filter: v,
|
|
93
93
|
columns: D,
|
|
94
94
|
pagination: P,
|
|
95
|
-
...
|
|
95
|
+
...d
|
|
96
96
|
} = o;
|
|
97
|
-
return
|
|
98
|
-
}), l = c(o.filter || {}),
|
|
97
|
+
return d;
|
|
98
|
+
}), l = m(() => c(o.filter) || {}), i = h({
|
|
99
99
|
path: o.path,
|
|
100
|
-
filters: l
|
|
100
|
+
filters: l,
|
|
101
101
|
columns: o.columns || [],
|
|
102
102
|
pagination: o.pagination
|
|
103
103
|
});
|
|
104
|
-
|
|
104
|
+
n(i);
|
|
105
105
|
const {
|
|
106
|
-
width:
|
|
106
|
+
width: u
|
|
107
107
|
} = g(), {
|
|
108
108
|
t: s
|
|
109
109
|
} = b();
|
|
110
|
-
return () =>
|
|
110
|
+
return () => r("div", {
|
|
111
111
|
class: "flex flex-col gap-2"
|
|
112
|
-
}, [
|
|
112
|
+
}, [r(e, p(a.value, i.table.value, {
|
|
113
113
|
class: "flex-1 min-h-0",
|
|
114
114
|
minHeight: 200,
|
|
115
115
|
tableLayout: "fixed",
|
|
@@ -118,16 +118,16 @@ const Bt = /* @__PURE__ */ f({
|
|
|
118
118
|
bordered: !1,
|
|
119
119
|
renderCell: (t) => t == null || t === "" ? "-" : t
|
|
120
120
|
}), {
|
|
121
|
-
empty: () =>
|
|
121
|
+
empty: () => r(y, {
|
|
122
122
|
bordered: !1
|
|
123
123
|
}, null)
|
|
124
|
-
}), o.pagination &&
|
|
124
|
+
}), o.pagination && r("div", {
|
|
125
125
|
class: "flex justify-end p-4 border-t border-muted"
|
|
126
|
-
}, [
|
|
127
|
-
simple:
|
|
126
|
+
}, [r(x, p(i.tablePagination.value, {
|
|
127
|
+
simple: u.value < 768
|
|
128
128
|
}), {
|
|
129
|
-
prefix: () =>
|
|
130
|
-
total:
|
|
129
|
+
prefix: () => r("div", null, [s("components.list.total", {
|
|
130
|
+
total: i.total.value || 0
|
|
131
131
|
})])
|
|
132
132
|
})])]);
|
|
133
133
|
}
|