@fewangsit/wangsvue-fats 1.0.1-alpha.44 → 1.0.1-alpha.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/assetinfo/index.es.js +14 -13
- package/calendar/index.es.js +47 -42
- package/columnlist/index.es.js +141 -116
- package/customcolumn/index.d.ts +5 -1
- package/dialoglinkedasset/index.es.js +3 -2
- package/disposalreporttable/index.es.js +3 -2
- package/disposalreporttablefilter/index.es.js +3 -2
- package/package.json +1 -1
- package/stats.html +1 -1
- package/utils/index.es.js +1 -0
- package/utils/role.util.es.js +44 -46
- package/wangsvue-fats.esm.browser.js +9325 -9297
- package/wangsvue-fats.system.js +71 -71
package/assetinfo/index.es.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { shallowRef as J, ref as X, defineComponent as Y, onMounted as Z, computed as f, watch as ee, createElementBlock as c, openBlock as p, createVNode as m, createElementVNode as l, createCommentVNode as v, toDisplayString as k, Fragment as se, unref as W, normalizeClass as b } from "vue";
|
|
2
2
|
import { AssetServices as ae } from "@tagsamurai/fats-api-services";
|
|
3
|
+
import "../utils/role.util.es.js";
|
|
3
4
|
import { g as te } from "../utils/getStatusSeverity.util.es.js";
|
|
4
5
|
import { u as le } from "../utils/toast.util.es.js";
|
|
5
6
|
import { _ as h } from "../badge/index.es.js";
|
|
@@ -11,7 +12,7 @@ const q = J(!1), z = X(), ie = () => ({
|
|
|
11
12
|
setLoading: (y, t) => {
|
|
12
13
|
q.value = y, z.value = t, document.body.classList[y ? "add" : "remove"]("loading");
|
|
13
14
|
}
|
|
14
|
-
}),
|
|
15
|
+
}), re = { class: "flex justify-between gap-[18px] dark:text-general-100" }, ue = { class: "w-full flex flex-col gap-[6px]" }, de = { class: "flex justify-between" }, ce = { class: "" }, pe = { class: "text-[16px] font-bold leading-[19.12px]" }, fe = { class: "flex items-center gap-[6px]" }, me = { class: "text-general-400 leading-[16.39px]" }, ve = ["href"], ge = { class: "flex flex-col gap-1" }, _e = {
|
|
15
16
|
key: 0,
|
|
16
17
|
class: "flex gap-3"
|
|
17
18
|
}, ye = {
|
|
@@ -23,7 +24,7 @@ const q = J(!1), z = X(), ie = () => ({
|
|
|
23
24
|
}, be = {
|
|
24
25
|
key: 3,
|
|
25
26
|
class: "flex gap-3"
|
|
26
|
-
},
|
|
27
|
+
}, Se = /* @__PURE__ */ Y({
|
|
27
28
|
__name: "AssetInfo",
|
|
28
29
|
props: {
|
|
29
30
|
id: {},
|
|
@@ -47,13 +48,13 @@ const q = J(!1), z = X(), ie = () => ({
|
|
|
47
48
|
secondImageBig: n,
|
|
48
49
|
assetImageBig: o,
|
|
49
50
|
assetImage: i,
|
|
50
|
-
firstImage:
|
|
51
|
-
secondImage:
|
|
51
|
+
firstImage: r,
|
|
52
|
+
secondImage: u
|
|
52
53
|
} = e.value ?? {}, d = s === "firstImage";
|
|
53
|
-
return t.transactionDetail ? i ?? o : d ?
|
|
54
|
+
return t.transactionDetail ? i ?? o : d ? r ?? a : u ?? n;
|
|
54
55
|
}), K = f(() => {
|
|
55
|
-
var s, a, n, o, i,
|
|
56
|
-
return t.transactionDetail ? (n = (a = (s = e.value) == null ? void 0 : s.assetName) == null ? void 0 : a.aliasCode) != null && n.length ? `(${(i = (o = e.value) == null ? void 0 : o.assetName) == null ? void 0 : i.aliasCode})` : "" : (d = (
|
|
56
|
+
var s, a, n, o, i, r, u, d, g, _;
|
|
57
|
+
return t.transactionDetail ? (n = (a = (s = e.value) == null ? void 0 : s.assetName) == null ? void 0 : a.aliasCode) != null && n.length ? `(${(i = (o = e.value) == null ? void 0 : o.assetName) == null ? void 0 : i.aliasCode})` : "" : (d = (u = (r = e.value) == null ? void 0 : r.name) == null ? void 0 : u.aliasCode) != null && d.length ? `(${(_ = (g = e.value) == null ? void 0 : g.name) == null ? void 0 : _.aliasCode})` : "";
|
|
57
58
|
}), P = f(() => {
|
|
58
59
|
var s, a;
|
|
59
60
|
return ((s = e.value) == null ? void 0 : s.assetTagType) ?? ((a = e.value) == null ? void 0 : a.tagType);
|
|
@@ -83,10 +84,10 @@ const q = J(!1), z = X(), ie = () => ({
|
|
|
83
84
|
},
|
|
84
85
|
{ deep: !0 }
|
|
85
86
|
), y({ asset: e }), (s, a) => {
|
|
86
|
-
var n, o, i,
|
|
87
|
-
return p(), c("div",
|
|
87
|
+
var n, o, i, r, u, d, g, _, D, B, N, S, C, A, $, L, E, F, M, V, j, G;
|
|
88
|
+
return p(), c("div", re, [
|
|
88
89
|
m(ne, { src: H.value }, null, 8, ["src"]),
|
|
89
|
-
l("div",
|
|
90
|
+
l("div", ue, [
|
|
90
91
|
l("div", de, [
|
|
91
92
|
l("div", ce, [
|
|
92
93
|
l("div", pe, k(((n = Q.value) == null ? void 0 : n.nameWithSequence) ?? "-"), 1),
|
|
@@ -103,13 +104,13 @@ const q = J(!1), z = X(), ie = () => ({
|
|
|
103
104
|
]),
|
|
104
105
|
W(R).userType !== "Basic" ? (p(), c("a", {
|
|
105
106
|
key: 0,
|
|
106
|
-
href: `/assets/detail/${((i = e.value) == null ? void 0 : i.asset) ?? ((
|
|
107
|
+
href: `/assets/detail/${((i = e.value) == null ? void 0 : i.asset) ?? ((r = e.value) == null ? void 0 : r._id)}`,
|
|
107
108
|
class: "text-primary-500",
|
|
108
109
|
target: "_blank"
|
|
109
110
|
}, " Asset Detail > ", 8, ve)) : v("", !0)
|
|
110
111
|
]),
|
|
111
112
|
l("div", ge, [
|
|
112
|
-
!t.fields || (
|
|
113
|
+
!t.fields || (u = t.fields) != null && u.includes("brand") ? (p(), c("div", _e, [
|
|
113
114
|
l("span", {
|
|
114
115
|
class: b(x.value)
|
|
115
116
|
}, " Brand ", 2),
|
|
@@ -156,6 +157,6 @@ const q = J(!1), z = X(), ie = () => ({
|
|
|
156
157
|
}
|
|
157
158
|
});
|
|
158
159
|
export {
|
|
159
|
-
|
|
160
|
+
Se as _,
|
|
160
161
|
ie as u
|
|
161
162
|
};
|
package/calendar/index.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as
|
|
3
|
-
import { u as
|
|
4
|
-
import { a as
|
|
5
|
-
import { _ as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as C, onMounted as F, ref as f, computed as d, watch as s, watchEffect as S, createBlock as x, openBlock as D, mergeProps as b, unref as I, withCtx as c, renderSlot as y, nextTick as k } from "vue";
|
|
2
|
+
import { u as L } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
|
|
3
|
+
import { u as O } from "../plugins/WangsVue.es.js";
|
|
4
|
+
import { a as N } from "../utils/textFormatter.util.es.js";
|
|
5
|
+
import { _ as U } from "../basecalendar/index.es.js";
|
|
6
|
+
const Y = /* @__PURE__ */ C({
|
|
7
7
|
__name: "Calendar",
|
|
8
8
|
props: {
|
|
9
9
|
modelValue: {},
|
|
@@ -33,7 +33,7 @@ const N = /* @__PURE__ */ T({
|
|
|
33
33
|
validatorMessage: {},
|
|
34
34
|
customValidation: {},
|
|
35
35
|
dateFormat: { default: "dd/mm/yy" },
|
|
36
|
-
hourFormat: {
|
|
36
|
+
hourFormat: {},
|
|
37
37
|
showTime: { type: Boolean },
|
|
38
38
|
timeSeparator: { default: ":" },
|
|
39
39
|
stepHour: { default: 1 },
|
|
@@ -48,70 +48,75 @@ const N = /* @__PURE__ */ T({
|
|
|
48
48
|
exactSelection: { type: Boolean }
|
|
49
49
|
},
|
|
50
50
|
emits: ["update:modelValue", "update:epochTimeMillis", "monthChange", "yearChange", "dateSelect"],
|
|
51
|
-
setup(
|
|
52
|
-
const e =
|
|
53
|
-
|
|
54
|
-
e.dateValue != null && (t.value =
|
|
51
|
+
setup(V, { emit: g }) {
|
|
52
|
+
const e = V, n = g;
|
|
53
|
+
F(() => {
|
|
54
|
+
e.dateValue != null && (t.value = u(e.dateValue), o.value = t.value, i.value++), e.epochTimeMillis != null && (t.value = u(e.epochTimeMillis), o.value = t.value, i.value++);
|
|
55
55
|
});
|
|
56
|
-
const { locale:
|
|
57
|
-
value:
|
|
56
|
+
const { locale: h } = O("Calendar"), t = f(), i = f(0), { value: o, errorMessage: M } = e.useValidator ? L(e.fieldName ?? "date", (a) => w(a)) : {
|
|
57
|
+
value: d({
|
|
58
58
|
get: () => e.modelValue,
|
|
59
59
|
set: (a) => {
|
|
60
|
-
|
|
60
|
+
n("update:modelValue", a);
|
|
61
61
|
}
|
|
62
62
|
})
|
|
63
|
-
},
|
|
63
|
+
}, B = d(
|
|
64
64
|
() => e.invalid || "errorMessage" in o && !!o.errorMessage
|
|
65
|
-
),
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
), T = d(() => {
|
|
66
|
+
var r, v;
|
|
67
|
+
const a = JSON.parse(localStorage.getItem("user") || "{}"), l = (r = a == null ? void 0 : a.generalSetting) == null ? void 0 : r.timeFormat;
|
|
68
|
+
return e.hourFormat ? e.hourFormat : (v = l == null ? void 0 : l.toLowerCase()) != null && v.includes("pm") ? "12" : "24";
|
|
69
|
+
}), w = async (a) => {
|
|
70
|
+
var l, r;
|
|
71
|
+
return await k(), typeof e.validatorMessage == "string" && e.invalid ? e.validatorMessage : typeof e.validatorMessage != "string" && !a && e.mandatory ? ((l = e.validatorMessage) == null ? void 0 : l.empty) ?? m() : !a && e.mandatory ? ((r = e.customValidation) == null ? void 0 : r.empty) ?? m() : !0;
|
|
72
|
+
}, m = () => {
|
|
69
73
|
var a;
|
|
70
|
-
return
|
|
74
|
+
return h.emptyInvalidText.replace("{label}", e.label).replace(
|
|
71
75
|
"{formattedLabel}",
|
|
72
|
-
(a =
|
|
76
|
+
(a = N(e.label)) == null ? void 0 : a.toLowerCase()
|
|
73
77
|
);
|
|
74
|
-
},
|
|
75
|
-
(a === e.valueFormat && e.useValidator || !e.useValidator && a === "date") && (o.value = l), a === "date" && e.useValidator &&
|
|
76
|
-
},
|
|
77
|
-
return
|
|
78
|
+
}, p = (a, l) => {
|
|
79
|
+
(a === e.valueFormat && e.useValidator || !e.useValidator && a === "date") && (o.value = l), a === "date" && e.useValidator && n("update:modelValue", l), a === "millis" && n("update:epochTimeMillis", l);
|
|
80
|
+
}, u = (a) => Array.isArray(a) ? a.map((l) => l == null ? null : new Date(l)) : new Date(a);
|
|
81
|
+
return s(
|
|
78
82
|
() => e.dateValue,
|
|
79
83
|
() => {
|
|
80
|
-
t.value =
|
|
84
|
+
t.value = u(e.dateValue), e.useValidator && (o.value = t.value), i.value++;
|
|
81
85
|
},
|
|
82
86
|
{
|
|
83
87
|
once: !0
|
|
84
88
|
}
|
|
85
|
-
),
|
|
89
|
+
), s(
|
|
86
90
|
() => e.epochTimeMillis,
|
|
87
91
|
() => {
|
|
88
|
-
t.value =
|
|
92
|
+
t.value = u(e.epochTimeMillis), e.useValidator && (o.value = t.value), i.value++;
|
|
89
93
|
}
|
|
90
|
-
),
|
|
94
|
+
), s(
|
|
91
95
|
() => e.modelValue,
|
|
92
96
|
() => {
|
|
93
97
|
t.value = e.modelValue, e.useValidator && (o.value = t.value);
|
|
94
98
|
}
|
|
95
|
-
),
|
|
96
|
-
t.value = e.valueFormat === "date" ? o.value : o.value ?
|
|
97
|
-
}), (a, l) => (D(), x(
|
|
98
|
-
"error-message":
|
|
99
|
-
|
|
99
|
+
), S(() => {
|
|
100
|
+
t.value = e.valueFormat === "date" ? o.value : o.value ? u(o.value) : o.value;
|
|
101
|
+
}), (a, l) => (D(), x(U, b({ key: i.value }, e, {
|
|
102
|
+
"error-message": I(M),
|
|
103
|
+
"hour-format": T.value,
|
|
104
|
+
invalid: B.value,
|
|
100
105
|
"model-value": t.value,
|
|
101
106
|
"selection-mode": a.selectionMode || a.mode,
|
|
102
|
-
"onUpdate:epochTimeMillis": l[0] || (l[0] = (
|
|
103
|
-
"onUpdate:modelValue": l[1] || (l[1] = (
|
|
107
|
+
"onUpdate:epochTimeMillis": l[0] || (l[0] = (r) => p("millis", r)),
|
|
108
|
+
"onUpdate:modelValue": l[1] || (l[1] = (r) => p("date", r))
|
|
104
109
|
}), {
|
|
105
|
-
default:
|
|
106
|
-
|
|
110
|
+
default: c(({ onClick: r }) => [
|
|
111
|
+
y(a.$slots, "default", { onClick: r })
|
|
107
112
|
]),
|
|
108
|
-
"addon-overlay":
|
|
109
|
-
|
|
113
|
+
"addon-overlay": c(() => [
|
|
114
|
+
y(a.$slots, "addon-overlay")
|
|
110
115
|
]),
|
|
111
116
|
_: 3
|
|
112
|
-
}, 16, ["error-message", "invalid", "model-value", "selection-mode"]));
|
|
117
|
+
}, 16, ["error-message", "hour-format", "invalid", "model-value", "selection-mode"]));
|
|
113
118
|
}
|
|
114
119
|
});
|
|
115
120
|
export {
|
|
116
|
-
|
|
121
|
+
Y as _
|
|
117
122
|
};
|
package/columnlist/index.es.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { _ as
|
|
4
|
-
import { c as
|
|
5
|
-
const
|
|
6
|
-
if (
|
|
1
|
+
import { reactive as $, defineComponent as _, mergeModels as q, useModel as U, ref as J, shallowRef as K, computed as B, watch as T, createElementBlock as w, openBlock as k, Fragment as E, renderList as z, createCommentVNode as G, mergeProps as I, withModifiers as C, createVNode as A } from "vue";
|
|
2
|
+
import { _ as Q } from "../checkbox/index.es.js";
|
|
3
|
+
import { _ as W } from "../icon/index.es.js";
|
|
4
|
+
import { c as X } from "../vendor/lodash-es/cloneDeep.es.js";
|
|
5
|
+
const Y = (o, d, l) => {
|
|
6
|
+
if (d && l > d) {
|
|
7
7
|
let r = 0;
|
|
8
8
|
return o.map((n) => {
|
|
9
|
-
const
|
|
10
|
-
return
|
|
9
|
+
const m = d !== void 0 && r < d, c = n.checkedByDefault !== !1 && d === void 0 || n.checkedByDefault !== !1 && m;
|
|
10
|
+
return c && r++, {
|
|
11
11
|
...n,
|
|
12
|
-
visible:
|
|
12
|
+
visible: c
|
|
13
13
|
};
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
return o;
|
|
17
|
-
},
|
|
17
|
+
}, x = "tableConfigs", Z = () => "user-" + (JSON.parse(localStorage.getItem("user") ?? "{}")._id ?? "unknown"), N = async () => {
|
|
18
18
|
let o = null;
|
|
19
|
-
return new Promise((
|
|
20
|
-
const l = indexedDB.open(
|
|
19
|
+
return new Promise((d) => {
|
|
20
|
+
const l = indexedDB.open(Z(), 1);
|
|
21
21
|
l.onupgradeneeded = (r) => {
|
|
22
|
-
o = r.target.result, o.createObjectStore(
|
|
22
|
+
o = r.target.result, o.createObjectStore(x);
|
|
23
23
|
}, l.onsuccess = (r) => {
|
|
24
|
-
o = r.target.result,
|
|
24
|
+
o = r.target.result, d(o);
|
|
25
25
|
};
|
|
26
26
|
});
|
|
27
|
-
},
|
|
28
|
-
const l = (await
|
|
27
|
+
}, ee = async () => {
|
|
28
|
+
const l = (await N()).transaction(x, "readonly").objectStore(x);
|
|
29
29
|
return new Promise((r) => {
|
|
30
|
-
let n,
|
|
31
|
-
l.getAllKeys().onsuccess = (
|
|
32
|
-
n =
|
|
33
|
-
}, l.getAll().onsuccess = (
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
n.forEach((
|
|
37
|
-
|
|
38
|
-
}), r(
|
|
30
|
+
let n, m;
|
|
31
|
+
l.getAllKeys().onsuccess = (c) => {
|
|
32
|
+
n = c.target.result;
|
|
33
|
+
}, l.getAll().onsuccess = (c) => {
|
|
34
|
+
m = c.target.result;
|
|
35
|
+
const b = {};
|
|
36
|
+
n.forEach((g, y) => {
|
|
37
|
+
b[g] = m[y];
|
|
38
|
+
}), r(b);
|
|
39
39
|
};
|
|
40
40
|
});
|
|
41
|
-
},
|
|
42
|
-
const o = async (
|
|
43
|
-
|
|
41
|
+
}, S = $({}), te = async () => {
|
|
42
|
+
const o = async (d, l) => {
|
|
43
|
+
S[d] = l, (await N()).transaction(x, "readwrite").objectStore(x).put(l, d);
|
|
44
44
|
};
|
|
45
|
-
return Object.assign(
|
|
46
|
-
config:
|
|
45
|
+
return Object.assign(S, await ee()), {
|
|
46
|
+
config: S,
|
|
47
47
|
setConfig: o
|
|
48
48
|
};
|
|
49
|
-
},
|
|
49
|
+
}, ae = ["id", "data-item-dragable", "draggable", "onDragenter", "onDragstart"], re = /* @__PURE__ */ _({
|
|
50
50
|
__name: "ColumnList",
|
|
51
51
|
props: /* @__PURE__ */ q({
|
|
52
52
|
tableId: {},
|
|
@@ -60,88 +60,110 @@ const W = (o, u, l) => {
|
|
|
60
60
|
modelModifiers: {}
|
|
61
61
|
}),
|
|
62
62
|
emits: ["update:modelValue"],
|
|
63
|
-
setup(o, { expose:
|
|
64
|
-
const l = o, r = U(o, "modelValue"), n =
|
|
65
|
-
if (!
|
|
63
|
+
setup(o, { expose: d }) {
|
|
64
|
+
const l = o, r = U(o, "modelValue"), n = J([]), m = K(), c = B(() => [...n.value].filter((a) => a.visible !== !1)), b = B(() => l.maxColumn ? c.value.length >= l.maxColumn : !1), g = (a) => a.dragable !== !1 && y(a), y = (a) => {
|
|
65
|
+
if (!b.value) return !0;
|
|
66
66
|
const t = r.value.findIndex((e) => e.field === a.field) > 0;
|
|
67
|
-
return
|
|
68
|
-
},
|
|
69
|
-
|
|
67
|
+
return b.value && t;
|
|
68
|
+
}, H = (a) => {
|
|
69
|
+
const t = [];
|
|
70
|
+
for (const e of a)
|
|
71
|
+
if (e.parentHeader) {
|
|
72
|
+
const s = t.find(
|
|
73
|
+
(f) => f.parentHeaderField === e.parentHeader.field
|
|
74
|
+
);
|
|
75
|
+
s ? s.siblingHeaders.push(e) : t.push({
|
|
76
|
+
...e,
|
|
77
|
+
parentHeaderField: e.parentHeader.field,
|
|
78
|
+
siblingHeaders: []
|
|
79
|
+
});
|
|
80
|
+
} else
|
|
81
|
+
t.push(e);
|
|
82
|
+
return t;
|
|
83
|
+
}, D = (a) => {
|
|
84
|
+
const t = [];
|
|
85
|
+
for (const e of a)
|
|
86
|
+
e.parentHeaderField ? t.push(e, ...e.siblingHeaders) : t.push(e);
|
|
87
|
+
return t;
|
|
88
|
+
}, V = () => {
|
|
89
|
+
n.value = Y(
|
|
70
90
|
n.value,
|
|
71
91
|
l.maxColumn,
|
|
72
|
-
|
|
73
|
-
), r.value = [...
|
|
74
|
-
},
|
|
75
|
-
const a =
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
), { setConfig: t } = await
|
|
92
|
+
c.value.length
|
|
93
|
+
), r.value = D([...c.value]);
|
|
94
|
+
}, h = async () => {
|
|
95
|
+
const a = D(
|
|
96
|
+
n.value
|
|
97
|
+
).map((e) => ({
|
|
98
|
+
field: e.field,
|
|
99
|
+
width: e.width ?? "max-content",
|
|
100
|
+
visible: e.visible !== !1,
|
|
101
|
+
fixed: !!e.fixed
|
|
102
|
+
})), { setConfig: t } = await te();
|
|
83
103
|
await t(l.tableId, a);
|
|
84
|
-
},
|
|
85
|
-
r.value = [...n.value];
|
|
86
|
-
},
|
|
87
|
-
const { dataTransfer:
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
var e,
|
|
93
|
-
if (a.preventDefault(),
|
|
94
|
-
const f = a.target,
|
|
95
|
-
if (
|
|
96
|
-
const
|
|
97
|
-
(
|
|
98
|
-
var
|
|
99
|
-
return
|
|
104
|
+
}, R = () => {
|
|
105
|
+
r.value = D([...n.value]);
|
|
106
|
+
}, L = (a, t, e) => {
|
|
107
|
+
const { dataTransfer: s } = a;
|
|
108
|
+
m.value = t, s && (s.dropEffect = "move", s.effectAllowed = "move", s.setData("field", t.field), s.setData("index", e.toString()));
|
|
109
|
+
}, j = async () => {
|
|
110
|
+
m.value = void 0, R(), await h();
|
|
111
|
+
}, F = (a, t) => {
|
|
112
|
+
var e, s;
|
|
113
|
+
if (a.preventDefault(), g(t)) {
|
|
114
|
+
const f = a.target, u = f.tagName === "LI" ? f : f.closest("li");
|
|
115
|
+
if (u == null || u.classList.add("bg-primary-50"), (e = u == null ? void 0 : u.nextElementSibling) == null || e.classList.remove("bg-primary-50"), (s = u == null ? void 0 : u.previousElementSibling) == null || s.classList.remove("bg-primary-50"), !u || !m.value) return;
|
|
116
|
+
const i = n.value.findIndex(
|
|
117
|
+
(p) => {
|
|
118
|
+
var M;
|
|
119
|
+
return p.field === ((M = m.value) == null ? void 0 : M.field);
|
|
100
120
|
}
|
|
101
|
-
),
|
|
102
|
-
(
|
|
121
|
+
), v = n.value.findIndex(
|
|
122
|
+
(p) => p.field === u.id
|
|
103
123
|
);
|
|
104
|
-
|
|
105
|
-
n.value[
|
|
106
|
-
n.value[
|
|
124
|
+
i !== -1 && v !== -1 && ([
|
|
125
|
+
n.value[i],
|
|
126
|
+
n.value[v]
|
|
107
127
|
] = [
|
|
108
|
-
n.value[
|
|
109
|
-
n.value[
|
|
128
|
+
n.value[v],
|
|
129
|
+
n.value[i]
|
|
110
130
|
]);
|
|
111
131
|
}
|
|
112
132
|
}, O = (a) => {
|
|
113
133
|
const t = a.target.querySelector("label");
|
|
114
134
|
t && t.click();
|
|
115
|
-
},
|
|
116
|
-
const a =
|
|
135
|
+
}, P = () => {
|
|
136
|
+
const a = X(l.defaultColumns);
|
|
117
137
|
if (l.maxColumn && a.length > l.maxColumn) {
|
|
118
138
|
let t = 0;
|
|
119
|
-
n.value =
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
139
|
+
n.value = H(
|
|
140
|
+
a.map((e) => {
|
|
141
|
+
const s = l.maxColumn !== void 0 && t < l.maxColumn, f = e.checkedByDefault !== !1 && l.maxColumn === void 0 || e.checkedByDefault !== !1 && s;
|
|
142
|
+
return f && t++, {
|
|
143
|
+
...e,
|
|
144
|
+
visible: f
|
|
145
|
+
};
|
|
146
|
+
})
|
|
147
|
+
);
|
|
126
148
|
} else
|
|
127
|
-
n.value = a;
|
|
128
|
-
r.value = [...
|
|
149
|
+
n.value = H(a);
|
|
150
|
+
r.value = D([...c.value]), h();
|
|
129
151
|
};
|
|
130
|
-
return
|
|
152
|
+
return T(
|
|
131
153
|
() => l.savedColumns,
|
|
132
154
|
(a) => {
|
|
133
|
-
n.value = a ?? [];
|
|
155
|
+
n.value = H(a) ?? [];
|
|
134
156
|
},
|
|
135
157
|
{ immediate: !0 }
|
|
136
|
-
),
|
|
137
|
-
setColumnVisibilityConfig:
|
|
138
|
-
resetToDefault:
|
|
139
|
-
updateVisibleColumnsModel:
|
|
140
|
-
}), (a, t) => (
|
|
141
|
-
(
|
|
142
|
-
var f;
|
|
143
|
-
return
|
|
144
|
-
e.reorderable !== !1 ? (
|
|
158
|
+
), d({
|
|
159
|
+
setColumnVisibilityConfig: h,
|
|
160
|
+
resetToDefault: P,
|
|
161
|
+
updateVisibleColumnsModel: V
|
|
162
|
+
}), (a, t) => (k(), w("ul", null, [
|
|
163
|
+
(k(!0), w(E, null, z(n.value, (e, s) => {
|
|
164
|
+
var f, u;
|
|
165
|
+
return k(), w(E, null, [
|
|
166
|
+
e.reorderable !== !1 ? (k(), w("li", I(
|
|
145
167
|
{
|
|
146
168
|
id: e.field,
|
|
147
169
|
key: e.field,
|
|
@@ -149,56 +171,59 @@ const W = (o, u, l) => {
|
|
|
149
171
|
},
|
|
150
172
|
a.$preset.customcolumn.menuitem({
|
|
151
173
|
props: l,
|
|
152
|
-
context: { dragable:
|
|
174
|
+
context: { dragable: g(e) }
|
|
153
175
|
}),
|
|
154
176
|
{
|
|
155
|
-
"data-item-dragable":
|
|
156
|
-
draggable:
|
|
177
|
+
"data-item-dragable": g(e),
|
|
178
|
+
draggable: g(e),
|
|
157
179
|
onClick: O,
|
|
158
|
-
onDragend:
|
|
159
|
-
onDragenter:
|
|
160
|
-
onDragleave: t[2] || (t[2] =
|
|
180
|
+
onDragend: j,
|
|
181
|
+
onDragenter: C((i) => F(i, e), ["prevent"]),
|
|
182
|
+
onDragleave: t[2] || (t[2] = C(() => {
|
|
161
183
|
}, ["prevent"])),
|
|
162
|
-
onDragover: t[3] || (t[3] =
|
|
184
|
+
onDragover: t[3] || (t[3] = C(() => {
|
|
163
185
|
}, ["prevent"])),
|
|
164
|
-
onDragstart: (
|
|
165
|
-
onMouseenter: t[4] || (t[4] = (
|
|
166
|
-
onMouseleave: t[5] || (t[5] = (
|
|
186
|
+
onDragstart: (i) => L(i, e, s),
|
|
187
|
+
onMouseenter: t[4] || (t[4] = (i) => i.target.classList.add("bg-primary-50")),
|
|
188
|
+
onMouseleave: t[5] || (t[5] = (i) => i.target.classList.remove("bg-primary-50")),
|
|
167
189
|
"data-wv-section": "custom-column-menu-item"
|
|
168
190
|
}
|
|
169
191
|
), [
|
|
170
|
-
|
|
192
|
+
A(W, I(
|
|
171
193
|
{
|
|
172
|
-
onClick: t[0] || (t[0] =
|
|
194
|
+
onClick: t[0] || (t[0] = C(() => {
|
|
173
195
|
}, ["stop"])),
|
|
174
196
|
ref_for: !0
|
|
175
197
|
},
|
|
176
198
|
(f = a.$preset.customcolumn) == null ? void 0 : f.dragicon({
|
|
177
|
-
context: { dragable:
|
|
199
|
+
context: { dragable: g(e) }
|
|
178
200
|
}),
|
|
179
201
|
{ icon: "dragable-menu" }
|
|
180
202
|
), null, 16),
|
|
181
|
-
|
|
203
|
+
A(Q, {
|
|
182
204
|
"aria-label": e.header,
|
|
183
205
|
disabled: e.fixed,
|
|
184
|
-
label: e.header,
|
|
206
|
+
label: ((u = e.parentHeader) == null ? void 0 : u.header) ?? e.header,
|
|
185
207
|
"model-value": e.visible !== !1,
|
|
186
|
-
selectable:
|
|
187
|
-
onClick: t[1] || (t[1] =
|
|
208
|
+
selectable: y(e),
|
|
209
|
+
onClick: t[1] || (t[1] = C(() => {
|
|
188
210
|
}, ["stop"])),
|
|
189
|
-
"onUpdate:modelValue": (
|
|
190
|
-
|
|
211
|
+
"onUpdate:modelValue": (i) => {
|
|
212
|
+
var v;
|
|
213
|
+
e.visible = !!i, (v = e.siblingHeaders) == null || v.forEach((p) => {
|
|
214
|
+
p.visible = !!i;
|
|
215
|
+
}), V(), h();
|
|
191
216
|
},
|
|
192
217
|
class: "!w-full"
|
|
193
218
|
}, null, 8, ["aria-label", "disabled", "label", "model-value", "selectable", "onUpdate:modelValue"])
|
|
194
|
-
], 16,
|
|
219
|
+
], 16, ae)) : G("", !0)
|
|
195
220
|
], 64);
|
|
196
221
|
}), 256))
|
|
197
222
|
]));
|
|
198
223
|
}
|
|
199
224
|
});
|
|
200
225
|
export {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
226
|
+
re as _,
|
|
227
|
+
Y as s,
|
|
228
|
+
te as u
|
|
204
229
|
};
|
package/customcolumn/index.d.ts
CHANGED
|
@@ -5,7 +5,11 @@ export interface CustomColumnLocaleConfig {
|
|
|
5
5
|
resetDefaultText: string;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export type DragableColumn = TableColumn & {
|
|
8
|
+
export type DragableColumn = TableColumn & {
|
|
9
|
+
order?: number;
|
|
10
|
+
parentHeaderField?: string;
|
|
11
|
+
siblingHeaders?: TableColumn[];
|
|
12
|
+
};
|
|
9
13
|
|
|
10
14
|
export interface CustomColumnProps {
|
|
11
15
|
tableId: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineComponent as W, computed as b, ref as k, watch as T, createBlock as L, openBlock as n, mergeProps as j, createSlots as G, withCtx as C, createElementVNode as m, createVNode as S, createElementBlock as i, createCommentVNode as $, Fragment as u, renderList as w, toDisplayString as p } from "vue";
|
|
2
2
|
import { AssetServices as J } from "@tagsamurai/fats-api-services";
|
|
3
|
+
import "../utils/role.util.es.js";
|
|
3
4
|
import { u as O } from "../utils/toast.util.es.js";
|
|
4
5
|
import { _ as P } from "../button/index.es.js";
|
|
5
6
|
import { _ as R } from "../dialogconfirm/index.es.js";
|
|
@@ -15,7 +16,7 @@ const D = { class: "flex flex-col gap-3 justify-between" }, H = { class: "flex f
|
|
|
15
16
|
key: 3,
|
|
16
17
|
class: "text-general-800 font-medium",
|
|
17
18
|
"data-ts-section": "confirmbody"
|
|
18
|
-
},
|
|
19
|
+
}, ae = /* @__PURE__ */ W({
|
|
19
20
|
__name: "DialogLinkedAsset",
|
|
20
21
|
props: {
|
|
21
22
|
header: {},
|
|
@@ -153,5 +154,5 @@ const D = { class: "flex flex-col gap-3 justify-between" }, H = { class: "flex f
|
|
|
153
154
|
}
|
|
154
155
|
});
|
|
155
156
|
export {
|
|
156
|
-
|
|
157
|
+
ae as _
|
|
157
158
|
};
|
|
@@ -2,6 +2,7 @@ import { defineComponent as E, onMounted as I, shallowRef as i, ref as M, create
|
|
|
2
2
|
import { AssetServices as V, DisposalServices as q } from "@tagsamurai/fats-api-services";
|
|
3
3
|
import { u as z } from "../assetinfo/index.es.js";
|
|
4
4
|
import { u as O } from "../plugins/basei18n.es.js";
|
|
5
|
+
import "../utils/role.util.es.js";
|
|
5
6
|
import { u as W } from "../utils/toast.util.es.js";
|
|
6
7
|
import { _ as g } from "../badge/index.es.js";
|
|
7
8
|
import { _ as w } from "../button/index.es.js";
|
|
@@ -16,7 +17,7 @@ import { _ as X } from "../disposalreporttablefilter/index.es.js";
|
|
|
16
17
|
const Y = {
|
|
17
18
|
class: "flex flex-col gap-2",
|
|
18
19
|
"data-ts-section": "disposalreporttablewrapper"
|
|
19
|
-
}, Z = { class: "flex gap-1 justify-end" }, ee = { class: "flex gap-1 justify-end" },
|
|
20
|
+
}, Z = { class: "flex gap-1 justify-end" }, ee = { class: "flex gap-1 justify-end" }, ge = /* @__PURE__ */ E({
|
|
20
21
|
__name: "DisposalReportTable",
|
|
21
22
|
props: {
|
|
22
23
|
treeTable: { type: Boolean },
|
|
@@ -314,5 +315,5 @@ const Y = {
|
|
|
314
315
|
}
|
|
315
316
|
});
|
|
316
317
|
export {
|
|
317
|
-
|
|
318
|
+
ge as _
|
|
318
319
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { defineComponent as y, shallowRef as r, ref as g, createBlock as b, openBlock as h } from "vue";
|
|
2
2
|
import { AssetServices as _ } from "@tagsamurai/fats-api-services";
|
|
3
3
|
import { u as O } from "../plugins/basei18n.es.js";
|
|
4
|
+
import "../utils/role.util.es.js";
|
|
4
5
|
import { u as k } from "../utils/toast.util.es.js";
|
|
5
6
|
import { _ as v } from "../filtercontainer/index.es.js";
|
|
6
|
-
const
|
|
7
|
+
const x = /* @__PURE__ */ y({
|
|
7
8
|
__name: "DisposalReportTableFilter",
|
|
8
9
|
props: {
|
|
9
10
|
assets: {},
|
|
@@ -69,5 +70,5 @@ const w = /* @__PURE__ */ y({
|
|
|
69
70
|
}
|
|
70
71
|
});
|
|
71
72
|
export {
|
|
72
|
-
|
|
73
|
+
x as _
|
|
73
74
|
};
|