@fewangsit/wangsvue-fats 1.0.1-alpha.56 → 1.0.1-alpha.57
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/disposalreport/index.d.ts +18 -26
- package/disposalreportdialogselectasset/index.es.js +95 -95
- package/disposalreporttable/index.es.js +151 -133
- package/package.json +1 -1
- package/stats.html +1 -1
- package/steps/index.es.js +12 -11
- package/wangsvue-fats.esm.browser.js +7147 -7128
- package/wangsvue-fats.system.js +51 -51
|
@@ -8,10 +8,16 @@ type Option = {
|
|
|
8
8
|
value?: string;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
type AssetProperty = {
|
|
12
|
+
_id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
key: number;
|
|
15
|
+
};
|
|
16
|
+
|
|
11
17
|
export interface DisposalReportProps {
|
|
12
18
|
router: Router;
|
|
13
19
|
reason: DisposalReason;
|
|
14
|
-
from: 'damage' | 'missing';
|
|
20
|
+
from: 'damage' | 'missing' | 'all';
|
|
15
21
|
}
|
|
16
22
|
|
|
17
23
|
/**
|
|
@@ -34,31 +40,13 @@ export interface Asset {
|
|
|
34
40
|
};
|
|
35
41
|
tagType?: string;
|
|
36
42
|
status?: string;
|
|
37
|
-
category?:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
name?: string;
|
|
45
|
-
key?: number;
|
|
46
|
-
};
|
|
47
|
-
assetGroup?: {
|
|
48
|
-
_id?: string;
|
|
49
|
-
name?: string;
|
|
50
|
-
key?: number;
|
|
51
|
-
};
|
|
52
|
-
assetBrand?: {
|
|
53
|
-
_id: string;
|
|
54
|
-
name: string;
|
|
55
|
-
key: number;
|
|
56
|
-
};
|
|
57
|
-
assetModel?: {
|
|
58
|
-
_id: string;
|
|
59
|
-
name: string;
|
|
60
|
-
key: number;
|
|
61
|
-
};
|
|
43
|
+
category?: AssetProperty;
|
|
44
|
+
group?: AssetProperty;
|
|
45
|
+
assetGroup?: AssetProperty;
|
|
46
|
+
assetBrand?: AssetProperty;
|
|
47
|
+
assetModel?: AssetProperty;
|
|
48
|
+
brand?: AssetProperty;
|
|
49
|
+
model?: AssetProperty;
|
|
62
50
|
assetImage?: string;
|
|
63
51
|
damageImage?: string;
|
|
64
52
|
}
|
|
@@ -68,6 +56,10 @@ export type FilterOptions = {
|
|
|
68
56
|
assetBrandOptions?: Option[];
|
|
69
57
|
assetModelOptions?: Option[];
|
|
70
58
|
assetGroupOptions?: Option[];
|
|
59
|
+
nameOptions?: Option[];
|
|
60
|
+
brandOptions?: Option[];
|
|
61
|
+
modelOptions?: Option[];
|
|
62
|
+
groupOptions?: Option[];
|
|
71
63
|
};
|
|
72
64
|
|
|
73
65
|
export default class DisposalReport extends ClassComponent<
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AssetServices as
|
|
3
|
-
import { e as
|
|
1
|
+
import { defineComponent as z, mergeModels as h, useModel as M, shallowRef as y, ref as T, computed as m, createBlock as J, openBlock as U, withCtx as g, createElementVNode as l, createVNode as n, withDirectives as j, vShow as R } from "vue";
|
|
2
|
+
import { AssetServices as _ } from "@tagsamurai/fats-api-services";
|
|
3
|
+
import { e as V } from "../event-bus/index.es.js";
|
|
4
4
|
import "../utils/role.util.es.js";
|
|
5
|
-
import { u as
|
|
6
|
-
import { _ as
|
|
7
|
-
import { _ as
|
|
8
|
-
import { _ as
|
|
5
|
+
import { u as E } from "../utils/toast.util.es.js";
|
|
6
|
+
import { _ as f } from "../badge/index.es.js";
|
|
7
|
+
import { _ as O } from "../button/index.es.js";
|
|
8
|
+
import { _ as G } from "../buttonfilter/index.es.js";
|
|
9
9
|
import { _ as P } from "../buttonsearch/index.es.js";
|
|
10
|
-
import { D as
|
|
11
|
-
import { _ as
|
|
12
|
-
import { _ as
|
|
13
|
-
import { _ as
|
|
14
|
-
const
|
|
10
|
+
import { D as q } from "../datatable/index.es.js";
|
|
11
|
+
import { _ as H } from "../dialog/index.es.js";
|
|
12
|
+
import { _ as K } from "../image/index.es.js";
|
|
13
|
+
import { _ as L } from "../filtercontainer/index.es.js";
|
|
14
|
+
const W = { class: "flex justify-between items-center" }, Y = {
|
|
15
15
|
class: "flex gap-1 items-center justify-end",
|
|
16
16
|
"data-ts-section": "button-group"
|
|
17
|
-
},
|
|
17
|
+
}, Q = { class: "flex flex-col gap-1" }, X = {
|
|
18
18
|
class: "text-xs text-red-600",
|
|
19
19
|
"data-ts-section": "message-validator"
|
|
20
|
-
},
|
|
20
|
+
}, Z = { class: "flex items-center justify-end gap-1" }, pe = /* @__PURE__ */ z({
|
|
21
21
|
__name: "DisposalReportDialogSelectAsset",
|
|
22
|
-
props: /* @__PURE__ */
|
|
22
|
+
props: /* @__PURE__ */ h({
|
|
23
|
+
from: {},
|
|
23
24
|
selectedAssets: {},
|
|
24
25
|
excludedKey: {},
|
|
25
26
|
header: {},
|
|
@@ -31,23 +32,23 @@ const L = { class: "flex justify-between items-center" }, W = {
|
|
|
31
32
|
visible: { type: Boolean, default: !1 },
|
|
32
33
|
visibleModifiers: {}
|
|
33
34
|
}),
|
|
34
|
-
emits: /* @__PURE__ */
|
|
35
|
-
setup(
|
|
36
|
-
const
|
|
35
|
+
emits: /* @__PURE__ */ h(["select"], ["update:visible"]),
|
|
36
|
+
setup(b, { emit: x }) {
|
|
37
|
+
const s = b, S = x, c = M(b, "visible"), $ = E(), i = y("select-asset-table"), d = y(!1), r = T([]), F = m(() => [
|
|
37
38
|
{
|
|
38
39
|
field: "assetImage",
|
|
39
40
|
header: "Photo",
|
|
40
41
|
style: "min-width: 72px",
|
|
41
|
-
bodyComponent: (
|
|
42
|
-
component:
|
|
42
|
+
bodyComponent: (t) => ({
|
|
43
|
+
component: K,
|
|
43
44
|
props: {
|
|
44
|
-
src:
|
|
45
|
+
src: t.assetImage ?? t.damageImage,
|
|
45
46
|
size: "small"
|
|
46
47
|
}
|
|
47
48
|
})
|
|
48
49
|
},
|
|
49
50
|
{
|
|
50
|
-
field: "
|
|
51
|
+
field: `${o("name")}.nameWithSequence`,
|
|
51
52
|
header: "Name",
|
|
52
53
|
sortable: !0
|
|
53
54
|
},
|
|
@@ -57,78 +58,78 @@ const L = { class: "flex justify-between items-center" }, W = {
|
|
|
57
58
|
sortable: !0
|
|
58
59
|
},
|
|
59
60
|
{
|
|
60
|
-
field: "
|
|
61
|
+
field: `${o("brand")}.name`,
|
|
61
62
|
header: "Brand",
|
|
62
63
|
sortable: !0,
|
|
63
|
-
bodyComponent: (
|
|
64
|
+
bodyComponent: (t) => {
|
|
64
65
|
var e;
|
|
65
66
|
return {
|
|
66
|
-
component:
|
|
67
|
+
component: f,
|
|
67
68
|
props: {
|
|
68
|
-
label: (e =
|
|
69
|
+
label: (e = t[o("brand")]) == null ? void 0 : e.name,
|
|
69
70
|
severity: "dark"
|
|
70
71
|
}
|
|
71
72
|
};
|
|
72
73
|
}
|
|
73
74
|
},
|
|
74
75
|
{
|
|
75
|
-
field: "
|
|
76
|
+
field: `${o("model")}.name`,
|
|
76
77
|
header: "Model/Type",
|
|
77
78
|
sortable: !0,
|
|
78
|
-
bodyComponent: (
|
|
79
|
+
bodyComponent: (t) => {
|
|
79
80
|
var e;
|
|
80
81
|
return {
|
|
81
|
-
component:
|
|
82
|
+
component: f,
|
|
82
83
|
props: {
|
|
83
|
-
label: (e =
|
|
84
|
+
label: (e = t[o("model")]) == null ? void 0 : e.name,
|
|
84
85
|
severity: "dark"
|
|
85
86
|
}
|
|
86
87
|
};
|
|
87
88
|
}
|
|
88
89
|
},
|
|
89
90
|
{
|
|
90
|
-
field: "
|
|
91
|
+
field: `${o("group")}.name`,
|
|
91
92
|
header: "Group",
|
|
92
93
|
sortable: !0,
|
|
93
|
-
bodyComponent: (
|
|
94
|
+
bodyComponent: (t) => {
|
|
94
95
|
var e;
|
|
95
96
|
return {
|
|
96
|
-
component:
|
|
97
|
+
component: f,
|
|
97
98
|
props: {
|
|
98
|
-
label: (e =
|
|
99
|
+
label: (e = t[o("group")]) == null ? void 0 : e.name
|
|
99
100
|
}
|
|
100
101
|
};
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
|
-
]), A =
|
|
104
|
+
]), A = m(() => [
|
|
104
105
|
{
|
|
105
106
|
label: "Name",
|
|
106
|
-
field: "
|
|
107
|
+
field: o("name"),
|
|
107
108
|
placeholder: "Select name",
|
|
108
109
|
type: "multiselect",
|
|
109
|
-
fetchOptionFn: () =>
|
|
110
|
+
fetchOptionFn: () => s.fetchOptionFunction ? s.fetchOptionFunction(u("name")) : p("nameOptions")
|
|
110
111
|
},
|
|
111
112
|
{
|
|
112
113
|
label: "Brand",
|
|
113
|
-
field: "
|
|
114
|
+
field: o("brand"),
|
|
114
115
|
placeholder: "Select brand",
|
|
115
116
|
type: "multiselect",
|
|
116
|
-
fetchOptionFn: () =>
|
|
117
|
+
fetchOptionFn: () => s.fetchOptionFunction ? s.fetchOptionFunction(u("brand")) : p("brandOptions")
|
|
117
118
|
},
|
|
118
119
|
{
|
|
119
120
|
label: "Model/Type",
|
|
120
|
-
field: "
|
|
121
|
+
field: o("model"),
|
|
121
122
|
placeholder: "Select model/type",
|
|
122
123
|
type: "multiselect",
|
|
123
|
-
fetchOptionFn: () =>
|
|
124
|
+
fetchOptionFn: () => s.fetchOptionFunction ? s.fetchOptionFunction(u("model")) : p("modelOptions")
|
|
124
125
|
},
|
|
125
126
|
{
|
|
126
127
|
label: "Group",
|
|
127
|
-
field: "
|
|
128
|
+
field: o("group"),
|
|
128
129
|
type: "group"
|
|
129
130
|
}
|
|
130
|
-
]),
|
|
131
|
-
switch (
|
|
131
|
+
]), w = m(() => {
|
|
132
|
+
switch (s.size) {
|
|
132
133
|
case "large":
|
|
133
134
|
return "1000px";
|
|
134
135
|
case "small":
|
|
@@ -136,63 +137,63 @@ const L = { class: "flex justify-between items-center" }, W = {
|
|
|
136
137
|
default:
|
|
137
138
|
return "800px";
|
|
138
139
|
}
|
|
139
|
-
}),
|
|
140
|
-
var
|
|
141
|
-
const e = JSON.stringify(
|
|
142
|
-
[
|
|
140
|
+
}), C = m(() => s.header ?? "Select Asset"), o = (t) => s.from === "all" ? t : `asset${t.charAt(0).toUpperCase()}${t.slice(1)}`, u = (t) => s.from === "all" ? `${t}Options` : `asset${t.charAt(0).toUpperCase()}${t.slice(1)}Options`, p = async (t) => {
|
|
141
|
+
var v;
|
|
142
|
+
const e = JSON.stringify(s.selectedAssets ?? []), a = {
|
|
143
|
+
[t]: !0,
|
|
143
144
|
excludeId: e,
|
|
144
|
-
status: JSON.stringify(
|
|
145
|
-
}, { data:
|
|
146
|
-
return ((
|
|
147
|
-
},
|
|
148
|
-
const e = JSON.stringify(
|
|
145
|
+
status: JSON.stringify(s.assetStatus ?? ["Available"])
|
|
146
|
+
}, { data: B } = await _.getAllAssetsOptions(a);
|
|
147
|
+
return ((v = B.data) == null ? void 0 : v[t]) ?? [];
|
|
148
|
+
}, D = async (t) => {
|
|
149
|
+
const e = JSON.stringify(s.selectedAssets ?? []);
|
|
149
150
|
try {
|
|
150
|
-
const { data: a } = await
|
|
151
|
+
const { data: a } = await _.getAllAssets({
|
|
151
152
|
excludeId: e,
|
|
152
|
-
status: JSON.stringify(
|
|
153
|
-
...
|
|
153
|
+
status: JSON.stringify(s.assetStatus ?? ["Available"]),
|
|
154
|
+
...t
|
|
154
155
|
});
|
|
155
156
|
return a;
|
|
156
157
|
} catch (a) {
|
|
157
|
-
console.error(a),
|
|
158
|
+
console.error(a), $.add({
|
|
158
159
|
error: a,
|
|
159
160
|
message: "Error, failed to get asset list."
|
|
160
161
|
});
|
|
161
162
|
}
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
}, B = () => {
|
|
165
|
-
O("select", i.value), c.value = !1, r.value = !1;
|
|
163
|
+
}, N = () => {
|
|
164
|
+
r.value.length === 0 ? d.value = !0 : k();
|
|
166
165
|
}, k = () => {
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
S("select", r.value), d.value = !1, c.value = !1;
|
|
167
|
+
}, I = () => {
|
|
168
|
+
r.value = [], V.emit("data-table:clear-selected-data", {
|
|
169
|
+
tableName: i.value
|
|
169
170
|
});
|
|
170
171
|
};
|
|
171
|
-
return (
|
|
172
|
-
visible:
|
|
173
|
-
"onUpdate:visible": e[3] || (e[3] = (a) =>
|
|
174
|
-
header:
|
|
175
|
-
pt: { root: { style: { width:
|
|
176
|
-
onHide:
|
|
172
|
+
return (t, e) => (U(), J(H, {
|
|
173
|
+
visible: c.value,
|
|
174
|
+
"onUpdate:visible": e[3] || (e[3] = (a) => c.value = a),
|
|
175
|
+
header: C.value,
|
|
176
|
+
pt: { root: { style: { width: w.value } } },
|
|
177
|
+
onHide: I,
|
|
177
178
|
closable: "",
|
|
178
179
|
"data-ts-section": "dialogselectasset",
|
|
179
180
|
modal: ""
|
|
180
181
|
}, {
|
|
181
|
-
footer:
|
|
182
|
-
l("div",
|
|
183
|
-
|
|
184
|
-
[
|
|
182
|
+
footer: g(() => [
|
|
183
|
+
l("div", Q, [
|
|
184
|
+
j(l("small", X, " You must pick an asset ", 512), [
|
|
185
|
+
[R, d.value]
|
|
185
186
|
]),
|
|
186
|
-
l("div",
|
|
187
|
-
|
|
188
|
-
onClick: e[2] || (e[2] = (a) =>
|
|
187
|
+
l("div", Z, [
|
|
188
|
+
n(O, {
|
|
189
|
+
onClick: e[2] || (e[2] = (a) => c.value = !1),
|
|
189
190
|
"data-ts-section": "button-cancel",
|
|
190
191
|
label: "Cancel",
|
|
191
192
|
severity: "secondary",
|
|
192
193
|
text: ""
|
|
193
194
|
}),
|
|
194
|
-
|
|
195
|
-
onClick:
|
|
195
|
+
n(O, {
|
|
196
|
+
onClick: N,
|
|
196
197
|
"data-ts-section": "button-select",
|
|
197
198
|
label: "Select",
|
|
198
199
|
severity: "success"
|
|
@@ -200,39 +201,38 @@ const L = { class: "flex justify-between items-center" }, W = {
|
|
|
200
201
|
])
|
|
201
202
|
])
|
|
202
203
|
]),
|
|
203
|
-
default:
|
|
204
|
-
l("div",
|
|
204
|
+
default: g(() => [
|
|
205
|
+
l("div", W, [
|
|
205
206
|
e[4] || (e[4] = l("span", null, "Select asset(s) to be disposed.", -1)),
|
|
206
|
-
l("div",
|
|
207
|
-
|
|
208
|
-
|
|
207
|
+
l("div", Y, [
|
|
208
|
+
n(P, { "table-name": i.value }, null, 8, ["table-name"]),
|
|
209
|
+
n(G, { "table-name": i.value }, null, 8, ["table-name"])
|
|
209
210
|
])
|
|
210
211
|
]),
|
|
211
|
-
|
|
212
|
+
n(L, {
|
|
212
213
|
fields: A.value,
|
|
213
|
-
"table-name":
|
|
214
|
+
"table-name": i.value
|
|
214
215
|
}, null, 8, ["fields", "table-name"]),
|
|
215
|
-
|
|
216
|
-
"selected-data":
|
|
217
|
-
"onUpdate:selectedData": e[0] || (e[0] = (a) =>
|
|
218
|
-
columns:
|
|
219
|
-
"fetch-function":
|
|
216
|
+
n(q, {
|
|
217
|
+
"selected-data": r.value,
|
|
218
|
+
"onUpdate:selectedData": e[0] || (e[0] = (a) => r.value = a),
|
|
219
|
+
columns: F.value,
|
|
220
|
+
"fetch-function": s.fetchFunction ?? D,
|
|
220
221
|
rows: 10,
|
|
221
|
-
"table-name":
|
|
222
|
+
"table-name": i.value,
|
|
222
223
|
"use-option": !1,
|
|
223
|
-
onRowSelect: e[1] || (e[1] = (a) =>
|
|
224
|
+
onRowSelect: e[1] || (e[1] = (a) => d.value = !1),
|
|
224
225
|
"data-key": "_id",
|
|
225
226
|
"data-ts-section": "dialog-select-asset-table",
|
|
226
227
|
lazy: "",
|
|
227
228
|
"selection-type": "checkbox",
|
|
228
229
|
"use-paginator": ""
|
|
229
|
-
}, null, 8, ["selected-data", "columns", "fetch-function", "table-name"])
|
|
230
|
-
l("pre", null, T(t.selectedAssets), 1)
|
|
230
|
+
}, null, 8, ["selected-data", "columns", "fetch-function", "table-name"])
|
|
231
231
|
]),
|
|
232
232
|
_: 1
|
|
233
233
|
}, 8, ["visible", "header", "pt"]));
|
|
234
234
|
}
|
|
235
235
|
});
|
|
236
236
|
export {
|
|
237
|
-
|
|
237
|
+
pe as _
|
|
238
238
|
};
|