@utogether/udp-core 1.0.2 → 1.0.4
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/{403-B1rIjAAu.js → 403-DASI6Pwz.js} +1 -1
- package/dist/{404-mBqc2y4t.js → 404-YhBA92cb.js} +1 -1
- package/dist/{500-BoI45Zdh.js → 500-ywbFF5MX.js} +1 -1
- package/dist/{AuthorityInfo-B08NBIIn.js → AuthorityInfo-tCSX2Fh7.js} +1 -1
- package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-BLP1SaiH.js → AuthorityInfo.vue_vue_type_style_index_0_lang-Cwd6UT2i.js} +1 -1
- package/dist/{Company-JGGyWEWH.js → Company-l23MEzdM.js} +3 -3
- package/dist/{CompanyPanel-BQ_cCmDx.js → CompanyPanel-D_s0rh6h.js} +1 -1
- package/dist/{Department-z2iO6hwM.js → Department-DSEvORLg.js} +3 -3
- package/dist/{DepartmentPanel-BtQe7zwU.js → DepartmentPanel-WN8nOgCV.js} +1 -1
- package/dist/{DesignPanel-7mhtVWas.js → DesignPanel-DirEGh9M.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-4EsHemj_.js → DesignPanel.vue_vue_type_style_index_0_lang-D02hXSrN.js} +2 -2
- package/dist/{DictView-CjchV2Yk.js → DictView-DiIQdiek.js} +10 -9
- package/dist/{InvOrganization-Pn1O_XP0.js → InvOrganization-b7v3g9EJ.js} +1 -1
- package/dist/{Org-BqytV_vi.js → Org-BORfx1PL.js} +1 -1
- package/dist/{Preview-CLpUUMay.js → Preview-DkRn_TSc.js} +1 -1
- package/dist/{ReportDefine-Cz1KtEUF.js → ReportDefine-Cd0QeaWA.js} +1 -1
- package/dist/{ReportDesign-BaORYud4.js → ReportDesign-4qNqyeEW.js} +2 -2
- package/dist/{ReportQuery-CPCPXiXz.js → ReportQuery-BJfTFpec.js} +1 -1
- package/dist/{ReportQueryFrom-C_AcrfkJ.js → ReportQueryFrom-CB7sExZx.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-Bm67ejay.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-CqO_2Ier.js} +1 -1
- package/dist/{ReportTemplate-CFiNMz79.js → ReportTemplate-B69muSgT.js} +1 -1
- package/dist/{Role-B-XDoJd5.js → Role-Bo4YrNDC.js} +3 -3
- package/dist/{RoleAssign-BolW8YVs.js → RoleAssign-kOMYJ4s3.js} +3 -3
- package/dist/{RolePanel-HilSuYns.js → RolePanel-B1d4e6uk.js} +1 -1
- package/dist/{RolePanel-2kfs5tw9.js → RolePanel-BSJmjyqc.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-CE4gApUY.js → RolePanel.vue_vue_type_script_setup_true_lang-DCzX-ZP_.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-DPzgfAyV.js → RolePanel.vue_vue_type_script_setup_true_lang-DgQpfjaU.js} +3 -3
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-CCTH4RkH.js → ScrollPanel.vue_vue_type_style_index_0_lang-WNOYFxJ1.js} +1 -1
- package/dist/{Staff-BTk3whFC.js → Staff-BFp3zNNR.js} +3 -3
- package/dist/{StaffInfo-d3AuSzlA.js → StaffInfo-DcU9_40C.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-eOL4VlfE.js → StaffInfo.vue_vue_type_script_setup_true_lang-CtfN2CAr.js} +1 -1
- package/dist/{StaffPanel-DV-D4jjz.js → StaffPanel-7exWkZd9.js} +1 -1
- package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-4sFq3CEo.js → StaffPanel.vue_vue_type_script_setup_true_lang-v5xOXKRS.js} +47 -39
- package/dist/{SysUser-BnjYytws.js → SysUser-B3uB_cp2.js} +2 -2
- package/dist/{SysUserPanel-CBoyD-Qi.js → SysUserPanel-B0CLp5AO.js} +1 -1
- package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-PrTlTZR-.js → SysUserPanel.vue_vue_type_script_setup_true_lang-Cwea_4dY.js} +1 -1
- package/dist/{SystemMenu-kYB_ZaUt.js → SystemMenu-a59l4hTk.js} +28 -28
- package/dist/{UserInfo-4dx97VBL.js → UserInfo-D1IA2oLt.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-BpbC_ZDm.js → UserInfo.vue_vue_type_style_index_0_lang-DDVgYRD5.js} +1 -1
- package/dist/{childView-CHPNfTEb.js → childView-6rCeLcsx.js} +1 -1
- package/dist/{childView-CKA_JgVZ.js → childView-JdrkroL5.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-Bym2fQRd.js → childView.vue_vue_type_style_index_0_lang-B8x99f1B.js} +19 -20
- package/dist/{childView.vue_vue_type_style_index_0_lang-W7bCtXeu.js → childView.vue_vue_type_style_index_0_lang-BfcnWnx9.js} +31 -31
- package/dist/{code-rule-CbxuZg0-.js → code-rule-2lkPF547.js} +1 -1
- package/dist/core.es.js +1 -1
- package/dist/{cron-task-nTOpqQYf.js → cron-task-DV1pGO1m.js} +1 -1
- package/dist/{frameView-Z1tPUyCh.js → frameView-C0bzSB8c.js} +1 -1
- package/dist/{index-C3q8HoJM.js → index-BbtbEMCH.js} +64 -65
- package/dist/{layoutView--MGA9zUB.js → layoutView-CTV-E4Cj.js} +1 -1
- package/dist/{log-in-CSYJDA6m.js → log-in-CoBP2x6u.js} +1 -1
- package/dist/{log-out-DiwGCg7p.js → log-out-KX8FiRVf.js} +1 -1
- package/dist/{login-C6Y0ajDp.js → login-CtCoGWzD.js} +1 -1
- package/dist/{login-log-C0V-_l3F.js → login-log-DJBGJVV0.js} +4 -4
- package/dist/{lov-view-Cmv7wZZ9.js → lov-view-Bm0JEzzg.js} +2 -2
- package/dist/{menuInfo-UeutJpOa.js → menuInfo-D2qPoRwz.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-CWX4Mu67.js → menuInfo.vue_vue_type_style_index_0_lang-DoQjX9Ly.js} +1 -1
- package/dist/{pda-app-B6w99SJo.js → pda-app-SbcIclbH.js} +1 -1
- package/dist/{resource-BybJvUv0.js → resource-Cdq1UKGI.js} +1 -1
- package/dist/{su-welcome-C1bmxHoY.js → su-welcome-BHDsjqqV.js} +20 -20
- package/dist/{sys-config-BnmIDnCj.js → sys-config-CCOf4xbj.js} +1 -1
- package/package.json +1 -1
- package/src/plugins/vxe-table/index.ts +116 -116
- package/src/plugins/vxe-table/render.tsx +950 -945
- package/src/utils/dataFormat/index.ts +17 -18
- package/src/views/organization/staff/StaffPanel.vue +12 -3
- package/src/views/system/menu/SystemMenu.vue +185 -185
- package/src/views/udev/dict/DictView.vue +2 -2
- package/src/views/udev/dict/childView.vue +6 -6
- package/src/views/udev/lov/childView.vue +174 -174
- package/src/views/uhome/components/menu-favorite.vue +3 -2
- package/src/views/upms/user/login-log.vue +5 -5
|
@@ -2,7 +2,7 @@ import { defineComponent as J, ref as y, onMounted as K, resolveComponent as p,
|
|
|
2
2
|
import { useRouter as oe } from "vue-router";
|
|
3
3
|
import ne from "dayjs";
|
|
4
4
|
import { dbstorage as le, delay as ae, warnMessage as ie, successMessage as ce, lunarCalendar as re, cookies as de } from "@utogether/utils";
|
|
5
|
-
import { y as W, i as ue, p as me, _ as fe } from "./index-
|
|
5
|
+
import { y as W, i as ue, p as me, _ as fe } from "./index-BbtbEMCH.js";
|
|
6
6
|
import { clone as pe, max as _e } from "xe-utils";
|
|
7
7
|
import ve from "vuedraggable";
|
|
8
8
|
const ge = { class: "" }, he = { class: "w-full h-24" }, xe = { class: "" }, ye = { class: "h-24 w-24 flex justify-center items-center flex-col relative drag-item ut-menu-top-item" }, be = { class: "w-[90%] text-xs mt-2 text-ellipsis overflow-hidden whitespace-nowrap text-center" }, we = ["onClick"], ke = {
|
|
@@ -19,7 +19,7 @@ const ge = { class: "" }, he = { class: "w-full h-24" }, xe = { class: "" }, ye
|
|
|
19
19
|
setup(G, { emit: h }) {
|
|
20
20
|
const j = G, d = y([]), $ = y([]), b = y(!1), I = y(!1), r = y({}), L = async () => {
|
|
21
21
|
$.value = await le.getItem(`U-${j.userName}-ROUTES`), $.value = $.value.filter((o) => o.menuCode !== "SysHome"), await ae(64), A();
|
|
22
|
-
},
|
|
22
|
+
}, q = (o, s) => {
|
|
23
23
|
var n;
|
|
24
24
|
d.value.splice(s, 1);
|
|
25
25
|
const t = (n = r.value[o.parentId]) == null ? void 0 : n.findIndex((_) => _ === o.menuId);
|
|
@@ -53,19 +53,19 @@ const ge = { class: "" }, he = { class: "w-full h-24" }, xe = { class: "" }, ye
|
|
|
53
53
|
var o;
|
|
54
54
|
return ((o = _e(d.value, (s) => s.seqNo)) == null ? void 0 : o.seqNo) || 0;
|
|
55
55
|
}, T = () => {
|
|
56
|
-
const o = d.value.map((s) => ({
|
|
56
|
+
const o = d.value.map((s, t) => ({
|
|
57
57
|
userName: j.userName,
|
|
58
58
|
menuId: s.menuId,
|
|
59
|
-
seqNo:
|
|
59
|
+
seqNo: 10 * (t + 1)
|
|
60
60
|
}));
|
|
61
61
|
I.value = !0, W().post(Ee, o).then(() => {
|
|
62
|
-
ce(), E(),
|
|
62
|
+
ce(), E(), R("success");
|
|
63
63
|
}).finally(() => {
|
|
64
64
|
I.value = !1;
|
|
65
65
|
});
|
|
66
66
|
}, E = () => {
|
|
67
|
-
b.value = !1,
|
|
68
|
-
},
|
|
67
|
+
b.value = !1, R("close");
|
|
68
|
+
}, z = (o) => ["#409eff", "#67c23a", "#13c2c2", "#e85f33", "orange"][o % 5], R = h;
|
|
69
69
|
return K(() => {
|
|
70
70
|
d.value = pe(j.dataSource, !0), b.value = !0, L();
|
|
71
71
|
}), (o, s) => {
|
|
@@ -108,7 +108,7 @@ const ge = { class: "" }, he = { class: "w-full h-24" }, xe = { class: "" }, ye
|
|
|
108
108
|
e("div", ye, [
|
|
109
109
|
e("div", {
|
|
110
110
|
class: "rounded-full w-10 h-10 flex items-center justify-center",
|
|
111
|
-
style: Q({ backgroundColor:
|
|
111
|
+
style: Q({ backgroundColor: z(l) })
|
|
112
112
|
}, [
|
|
113
113
|
c(n, {
|
|
114
114
|
icon: m.icon || `ri:${o.icons[l]}-line`,
|
|
@@ -118,7 +118,7 @@ const ge = { class: "" }, he = { class: "w-full h-24" }, xe = { class: "" }, ye
|
|
|
118
118
|
e("span", be, f(m.menuName), 1),
|
|
119
119
|
e("i", {
|
|
120
120
|
class: "ri-indeterminate-circle-line right-3 top-2 text-base hidden ut-menu-del",
|
|
121
|
-
onClick: (u) =>
|
|
121
|
+
onClick: (u) => q(m, l)
|
|
122
122
|
}, null, 8, we)
|
|
123
123
|
])
|
|
124
124
|
])
|
|
@@ -230,7 +230,7 @@ const ge = { class: "" }, he = { class: "w-full h-24" }, xe = { class: "" }, ye
|
|
|
230
230
|
}, 8, ["modelValue", "loading"]);
|
|
231
231
|
};
|
|
232
232
|
}
|
|
233
|
-
}),
|
|
233
|
+
}), ze = { class: "ut-home m-3" }, Re = { class: "h-32 mb-4 p-4 flex justify-between items-center bg-white home-page" }, qe = { class: "flex flex-row items-center flex-[2]" }, Ae = { class: "ml-4 text-xs flex-[2]" }, Fe = { class: "flex justify-center items-center" }, He = { class: "py-2 text-gray-500 flex" }, Te = { class: "w-2/3" }, Oe = { class: "text-gray-500 flex" }, Be = { class: "w-2/3" }, We = { class: "flex flex-col" }, Ge = { class: "text-4xl" }, Pe = { class: "mt-1 ml-3" }, Ye = { class: "default:bg-white dark:bg-black" }, Je = ["onClick"], Ke = { class: "h-20 flex justify-center items-center flex-col" }, Qe = { class: "text-xs mt-2" }, Xe = { class: "p-3" }, Ze = { class: "p-0 w-full h-full" }, et = { class: "flex" }, tt = { class: "ml-3" }, st = { class: "text-blue-600 mr-3" }, ot = { class: "text-gray-400 text-sm" }, nt = { class: "p-1" }, lt = /* @__PURE__ */ J({
|
|
234
234
|
name: "UdpWelcome",
|
|
235
235
|
__name: "su-welcome",
|
|
236
236
|
setup(G) {
|
|
@@ -240,7 +240,7 @@ const ge = { class: "" }, he = { class: "w-full h-24" }, xe = { class: "" }, ye
|
|
|
240
240
|
}), L = () => {
|
|
241
241
|
var t, n;
|
|
242
242
|
return h.isAdminRole ? "系统管理员" : (n = (t = h.getUserInfo) == null ? void 0 : t.sysRoles) == null ? void 0 : n.map((_) => _.roleName).join(",");
|
|
243
|
-
},
|
|
243
|
+
}, q = () => {
|
|
244
244
|
var t;
|
|
245
245
|
return h.isAdminRole ? "【系统管理员】拥有所有组织" : L() === "项目组管理员" ? "【项目组管理员】拥有所有组织" : (t = h.getOrglist) == null ? void 0 : t.map((n) => n.orgName).join(",");
|
|
246
246
|
}, V = () => {
|
|
@@ -272,7 +272,7 @@ const ge = { class: "" }, he = { class: "w-full h-24" }, xe = { class: "" }, ye
|
|
|
272
272
|
K(() => {
|
|
273
273
|
D(), H();
|
|
274
274
|
});
|
|
275
|
-
const E = (s) => ["#409eff", "#67c23a", "#13c2c2", "#e85f33", "orange"][s % 5],
|
|
275
|
+
const E = (s) => ["#409eff", "#67c23a", "#13c2c2", "#e85f33", "orange"][s % 5], z = [
|
|
276
276
|
"community",
|
|
277
277
|
"shield-star",
|
|
278
278
|
"group",
|
|
@@ -289,7 +289,7 @@ const ge = { class: "" }, he = { class: "w-full h-24" }, xe = { class: "" }, ye
|
|
|
289
289
|
"tv",
|
|
290
290
|
"database-2",
|
|
291
291
|
"calendar"
|
|
292
|
-
],
|
|
292
|
+
], R = [
|
|
293
293
|
{
|
|
294
294
|
2023: { 12: { 30: "班", 31: "班" } }
|
|
295
295
|
},
|
|
@@ -327,9 +327,9 @@ const ge = { class: "" }, he = { class: "w-full h-24" }, xe = { class: "" }, ye
|
|
|
327
327
|
return (s, t) => {
|
|
328
328
|
var x;
|
|
329
329
|
const n = p("el-avatar"), _ = p("ut-flip-down"), M = p("el-empty"), S = p("iconify-icon-offline"), w = p("el-card"), U = p("el-col"), m = p("ut-calendar"), l = p("el-row"), u = ee("spinning");
|
|
330
|
-
return a(), v("div",
|
|
331
|
-
e("div",
|
|
332
|
-
e("div",
|
|
330
|
+
return a(), v("div", ze, [
|
|
331
|
+
e("div", Re, [
|
|
332
|
+
e("div", qe, [
|
|
333
333
|
e("div", null, [
|
|
334
334
|
c(n, {
|
|
335
335
|
size: "large",
|
|
@@ -355,7 +355,7 @@ const ge = { class: "" }, he = { class: "w-full h-24" }, xe = { class: "" }, ye
|
|
|
355
355
|
]),
|
|
356
356
|
e("div", Oe, [
|
|
357
357
|
t[3] || (t[3] = e("span", { class: "inline-block" }, " 所属组织: ", -1)),
|
|
358
|
-
e("div", Be, f(
|
|
358
|
+
e("div", Be, f(q()), 1)
|
|
359
359
|
])
|
|
360
360
|
])
|
|
361
361
|
]),
|
|
@@ -415,7 +415,7 @@ const ge = { class: "" }, he = { class: "w-full h-24" }, xe = { class: "" }, ye
|
|
|
415
415
|
style: Q({ backgroundColor: E(P) })
|
|
416
416
|
}, [
|
|
417
417
|
c(S, {
|
|
418
|
-
icon: g.icon || `ri:${
|
|
418
|
+
icon: g.icon || `ri:${z[P]}-line`,
|
|
419
419
|
class: "text-2xl text-white"
|
|
420
420
|
}, null, 8, ["icon"])
|
|
421
421
|
], 4),
|
|
@@ -494,7 +494,7 @@ const ge = { class: "" }, he = { class: "w-full h-24" }, xe = { class: "" }, ye
|
|
|
494
494
|
default: i(() => [
|
|
495
495
|
e("div", nt, [
|
|
496
496
|
c(m, {
|
|
497
|
-
holidays:
|
|
497
|
+
holidays: R,
|
|
498
498
|
"statutory-holiday": o
|
|
499
499
|
})
|
|
500
500
|
])
|
|
@@ -511,7 +511,7 @@ const ge = { class: "" }, he = { class: "w-full h-24" }, xe = { class: "" }, ye
|
|
|
511
511
|
key: 0,
|
|
512
512
|
"data-source": d.value,
|
|
513
513
|
"user-name": B(h).getUserInfo.userName,
|
|
514
|
-
icons:
|
|
514
|
+
icons: z,
|
|
515
515
|
onClose: t[0] || (t[0] = (g) => b.value = !1),
|
|
516
516
|
onSuccess: D
|
|
517
517
|
}, null, 8, ["data-source", "user-name"])) : O("", !0)
|
|
@@ -3,7 +3,7 @@ import { useI18n as Q } from "vue-i18n";
|
|
|
3
3
|
import { t as S } from "./await-to-js.es5-BtRbN2QH.js";
|
|
4
4
|
import { cookies as E, successMessage as W, warnMessage as X } from "@utogether/utils";
|
|
5
5
|
import { isArray as Z } from "xe-utils";
|
|
6
|
-
import { G as ee, o as te, p as z, y as le } from "./index-
|
|
6
|
+
import { G as ee, o as te, p as z, y as le } from "./index-BbtbEMCH.js";
|
|
7
7
|
const ae = { class: "flex flex-col items-center pt-20 bg-white u-system-config" }, oe = { class: "flex w-1/2 p-3 overflow-y-auto border border-gray-300 rounded-md" }, se = { class: "flex items-center" }, ne = { class: "pl-2 text-xs" }, ie = { class: "pl-2" }, ue = { class: "pl-2" }, re = { class: "flex items-center" }, pe = { class: "pl-2 text-xs" }, de = { class: "pl-2" }, me = { class: "flex items-center" }, ce = { class: "pl-2 text-xs" }, ge = { class: "flex justify-end w-1/2 p-2" }, j = "/upfm/v1/sysConfig", Ce = /* @__PURE__ */ q({
|
|
8
8
|
__name: "sys-config",
|
|
9
9
|
setup(fe) {
|
package/package.json
CHANGED
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: levi7754 levi7754@163.com
|
|
3
|
-
* @Date: 2024-06-05 14:32:03
|
|
4
|
-
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2025-
|
|
6
|
-
* @FilePath: /udp-front/packages/udp-core/src/plugins/vxe-table/index.ts
|
|
7
|
-
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
8
|
-
*/
|
|
9
|
-
import 'xe-utils';
|
|
10
|
-
import { merge, toDateString, getWhatDay } from 'xe-utils';
|
|
11
|
-
import { geti18n, transformI18n } from '../i18n/index';
|
|
12
|
-
// import { storageLocal } from '@utogether/utils';
|
|
13
|
-
import { VxetableRender } from '@utogether/utils';
|
|
14
|
-
// import { VxetableRender } from './render';
|
|
15
|
-
import { getServiceApi } from '../../api';
|
|
16
|
-
|
|
17
|
-
import VXETable, { VxeUI } from 'vxe-table';
|
|
18
|
-
// import './render.tsx';
|
|
19
|
-
|
|
20
|
-
// const dict = storageLocal.getItem('kLov');
|
|
21
|
-
VxetableRender(VXETable, { serviceApi: getServiceApi(), i18n: transformI18n });
|
|
22
|
-
setCommands();
|
|
23
|
-
|
|
24
|
-
// 全局默认参数
|
|
25
|
-
const defaultConfig = {
|
|
26
|
-
// 对组件内置的提示语进行国际化翻译
|
|
27
|
-
// @ts-ignore
|
|
28
|
-
i18n: (key, args) => geti18n().global.t(key, args),
|
|
29
|
-
// 可选,对参数中的列头、校验提示..等进行自动翻译(只对支持国际化的有效)
|
|
30
|
-
translate(key) {
|
|
31
|
-
// 例如,只翻译 "message." 开头的键值
|
|
32
|
-
const NAMESPACED = ['message.', 'el.'];
|
|
33
|
-
if (key && NAMESPACED.findIndex(v => key.includes(v)) !== -1) {
|
|
34
|
-
return geti18n().global.t.call(geti18n().global.locale, key);
|
|
35
|
-
}
|
|
36
|
-
return key;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export function setTableConfig(config = {}) {
|
|
41
|
-
VXETable.setConfig(merge(defaultConfig, config));
|
|
42
|
-
|
|
43
|
-
VxeUI.interceptor.add('event.clearEdit', {
|
|
44
|
-
tableInterceptorMethod(params) {
|
|
45
|
-
const { $event } = params;
|
|
46
|
-
if ($event.target.className.indexOf('vxe-table--ignore-clear') > -1) return false;
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function setTheme(theme) {
|
|
52
|
-
// 切换为暗黑主题
|
|
53
|
-
VxeUI.setTheme(theme);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function setCommands() {
|
|
57
|
-
// 定义选中日期今天指令
|
|
58
|
-
VxeUI.commands.add('utTodyay', {
|
|
59
|
-
dateRangePickerCommandMethod({ $dateRangePicker }) {
|
|
60
|
-
const startDate = toDateString(new Date(), 'yyyy-MM-dd 00:00:00');
|
|
61
|
-
const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
|
|
62
|
-
$dateRangePicker.setModelValue(startDate, endDate);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
// 定义选中日期昨天指令
|
|
66
|
-
VxeUI.commands.add('utYesterDay', {
|
|
67
|
-
dateRangePickerCommandMethod({ $dateRangePicker }) {
|
|
68
|
-
const startDate = toDateString(getWhatDay(new Date(), -1), 'yyyy-MM-dd 00:00:00');
|
|
69
|
-
const endDate = toDateString(getWhatDay(new Date(), -1), 'yyyy-MM-dd 23:59:59');
|
|
70
|
-
$dateRangePicker.setModelValue(startDate, endDate);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
// 定义选中日期最近一周指令
|
|
74
|
-
VxeUI.commands.add('utRecentWeek', {
|
|
75
|
-
dateRangePickerCommandMethod({ $dateRangePicker }) {
|
|
76
|
-
const startDate = toDateString(getWhatDay(new Date(), -7), 'yyyy-MM-dd 00:00:00');
|
|
77
|
-
const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
|
|
78
|
-
$dateRangePicker.setModelValue(startDate, endDate);
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
// 定义选中日期最近一个月指令
|
|
83
|
-
VxeUI.commands.add('utRecentMonth', {
|
|
84
|
-
dateRangePickerCommandMethod({ $dateRangePicker }) {
|
|
85
|
-
const startDate = toDateString(getWhatDay(new Date(), -30), 'yyyy-MM-dd 00:00:00');
|
|
86
|
-
const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
|
|
87
|
-
$dateRangePicker.setModelValue(startDate, endDate);
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
// 定义选中日期最近三个月指令
|
|
92
|
-
VxeUI.commands.add('utRecentThreeMonth', {
|
|
93
|
-
dateRangePickerCommandMethod({ $dateRangePicker }) {
|
|
94
|
-
const startDate = toDateString(getWhatDay(new Date(), -90), 'yyyy-MM-dd 00:00:00');
|
|
95
|
-
const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
|
|
96
|
-
$dateRangePicker.setModelValue(startDate, endDate);
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
// 定义选中日期最近半年指令
|
|
101
|
-
VxeUI.commands.add('utRecentHalfYear', {
|
|
102
|
-
dateRangePickerCommandMethod({ $dateRangePicker }) {
|
|
103
|
-
const startDate = toDateString(getWhatDay(new Date(), -180), 'yyyy-MM-dd 00:00:00');
|
|
104
|
-
const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
|
|
105
|
-
$dateRangePicker.setModelValue(startDate, endDate);
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
// 定义选中日期最近半年指令
|
|
109
|
-
VxeUI.commands.add('utRecentYear', {
|
|
110
|
-
dateRangePickerCommandMethod({ $dateRangePicker }) {
|
|
111
|
-
const startDate = toDateString(getWhatDay(new Date(), -365), 'yyyy-MM-dd 00:00:00');
|
|
112
|
-
const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
|
|
113
|
-
$dateRangePicker.setModelValue(startDate, endDate);
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* @Author: levi7754 levi7754@163.com
|
|
3
|
+
* @Date: 2024-06-05 14:32:03
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2025-12-09 08:57:02
|
|
6
|
+
* @FilePath: /udp-front/packages/udp-core/src/plugins/vxe-table/index.ts
|
|
7
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
8
|
+
*/
|
|
9
|
+
import 'xe-utils';
|
|
10
|
+
import { merge, toDateString, getWhatDay } from 'xe-utils';
|
|
11
|
+
import { geti18n, transformI18n } from '../i18n/index';
|
|
12
|
+
// import { storageLocal } from '@utogether/utils';
|
|
13
|
+
import { VxetableRender } from '@utogether/utils';
|
|
14
|
+
// import { VxetableRender } from './render';
|
|
15
|
+
import { getServiceApi } from '../../api';
|
|
16
|
+
|
|
17
|
+
import VXETable, { VxeUI } from 'vxe-table';
|
|
18
|
+
// import './render.tsx';
|
|
19
|
+
|
|
20
|
+
// const dict = storageLocal.getItem('kLov');
|
|
21
|
+
VxetableRender(VXETable, { serviceApi: getServiceApi(), i18n: transformI18n });
|
|
22
|
+
setCommands();
|
|
23
|
+
|
|
24
|
+
// 全局默认参数
|
|
25
|
+
const defaultConfig = {
|
|
26
|
+
// 对组件内置的提示语进行国际化翻译
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
i18n: (key, args) => geti18n().global.t(key, args),
|
|
29
|
+
// 可选,对参数中的列头、校验提示..等进行自动翻译(只对支持国际化的有效)
|
|
30
|
+
translate(key) {
|
|
31
|
+
// 例如,只翻译 "message." 开头的键值
|
|
32
|
+
const NAMESPACED = ['message.', 'el.'];
|
|
33
|
+
if (key && NAMESPACED.findIndex(v => key.includes(v)) !== -1) {
|
|
34
|
+
return geti18n().global.t.call(geti18n().global.locale, key);
|
|
35
|
+
}
|
|
36
|
+
return key;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export function setTableConfig(config = {}) {
|
|
41
|
+
VXETable.setConfig(merge(defaultConfig, config));
|
|
42
|
+
|
|
43
|
+
VxeUI.interceptor.add('event.clearEdit', {
|
|
44
|
+
tableInterceptorMethod(params) {
|
|
45
|
+
const { $event } = params;
|
|
46
|
+
if ($event.target.className.indexOf('vxe-table--ignore-clear') > -1) return false;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function setTheme(theme) {
|
|
52
|
+
// 切换为暗黑主题
|
|
53
|
+
VxeUI.setTheme(theme);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function setCommands() {
|
|
57
|
+
// 定义选中日期今天指令
|
|
58
|
+
VxeUI.commands.add('utTodyay', {
|
|
59
|
+
dateRangePickerCommandMethod({ $dateRangePicker }) {
|
|
60
|
+
const startDate = toDateString(new Date(), 'yyyy-MM-dd 00:00:00');
|
|
61
|
+
const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
|
|
62
|
+
$dateRangePicker.setModelValue(startDate, endDate);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
// 定义选中日期昨天指令
|
|
66
|
+
VxeUI.commands.add('utYesterDay', {
|
|
67
|
+
dateRangePickerCommandMethod({ $dateRangePicker }) {
|
|
68
|
+
const startDate = toDateString(getWhatDay(new Date(), -1), 'yyyy-MM-dd 00:00:00');
|
|
69
|
+
const endDate = toDateString(getWhatDay(new Date(), -1), 'yyyy-MM-dd 23:59:59');
|
|
70
|
+
$dateRangePicker.setModelValue(startDate, endDate);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
// 定义选中日期最近一周指令
|
|
74
|
+
VxeUI.commands.add('utRecentWeek', {
|
|
75
|
+
dateRangePickerCommandMethod({ $dateRangePicker }) {
|
|
76
|
+
const startDate = toDateString(getWhatDay(new Date(), -7), 'yyyy-MM-dd 00:00:00');
|
|
77
|
+
const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
|
|
78
|
+
$dateRangePicker.setModelValue(startDate, endDate);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// 定义选中日期最近一个月指令
|
|
83
|
+
VxeUI.commands.add('utRecentMonth', {
|
|
84
|
+
dateRangePickerCommandMethod({ $dateRangePicker }) {
|
|
85
|
+
const startDate = toDateString(getWhatDay(new Date(), -30), 'yyyy-MM-dd 00:00:00');
|
|
86
|
+
const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
|
|
87
|
+
$dateRangePicker.setModelValue(startDate, endDate);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// 定义选中日期最近三个月指令
|
|
92
|
+
VxeUI.commands.add('utRecentThreeMonth', {
|
|
93
|
+
dateRangePickerCommandMethod({ $dateRangePicker }) {
|
|
94
|
+
const startDate = toDateString(getWhatDay(new Date(), -90), 'yyyy-MM-dd 00:00:00');
|
|
95
|
+
const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
|
|
96
|
+
$dateRangePicker.setModelValue(startDate, endDate);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// 定义选中日期最近半年指令
|
|
101
|
+
VxeUI.commands.add('utRecentHalfYear', {
|
|
102
|
+
dateRangePickerCommandMethod({ $dateRangePicker }) {
|
|
103
|
+
const startDate = toDateString(getWhatDay(new Date(), -180), 'yyyy-MM-dd 00:00:00');
|
|
104
|
+
const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
|
|
105
|
+
$dateRangePicker.setModelValue(startDate, endDate);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
// 定义选中日期最近半年指令
|
|
109
|
+
VxeUI.commands.add('utRecentYear', {
|
|
110
|
+
dateRangePickerCommandMethod({ $dateRangePicker }) {
|
|
111
|
+
const startDate = toDateString(getWhatDay(new Date(), -365), 'yyyy-MM-dd 00:00:00');
|
|
112
|
+
const endDate = toDateString(new Date(), 'yyyy-MM-dd 23:59:59');
|
|
113
|
+
$dateRangePicker.setModelValue(startDate, endDate);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|