@utogether/udp-core 1.0.1 → 1.0.2
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/plugins.ts +13 -2
- package/dist/{403-JWjatlxJ.js → 403-B1rIjAAu.js} +7 -6
- package/dist/{404-BcdMJfPb.js → 404-mBqc2y4t.js} +14 -13
- package/dist/{500-bsa3F_cc.js → 500-BoI45Zdh.js} +10 -9
- package/dist/{AuthorityInfo-CqItgNs5.js → AuthorityInfo-B08NBIIn.js} +1 -1
- package/dist/AuthorityInfo.vue_vue_type_style_index_0_lang-BLP1SaiH.js +100 -0
- package/dist/{AuthorityPanel-BaLMwMgW.js → AuthorityPanel-BeBNiwqc.js} +1 -1
- package/dist/{AuthorityPanel.vue_vue_type_style_index_0_lang-C_bkqLD9.js → AuthorityPanel.vue_vue_type_style_index_0_lang-CIYmnP9-.js} +6 -6
- package/dist/{Company-DVff9IA7.js → Company-JGGyWEWH.js} +3 -3
- package/dist/{CompanyPanel-CNrdq4XE.js → CompanyPanel-BQ_cCmDx.js} +16 -16
- package/dist/{Department-CqcpfL4i.js → Department-z2iO6hwM.js} +10 -10
- package/dist/{DepartmentPanel-Bvti4LGu.js → DepartmentPanel-BtQe7zwU.js} +108 -78
- package/dist/{DesignPanel-CjykspE1.js → DesignPanel-7mhtVWas.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-BK9EERdd.js → DesignPanel.vue_vue_type_style_index_0_lang-4EsHemj_.js} +24 -26
- package/dist/DictView-CjchV2Yk.js +109 -0
- package/dist/InvOrganization-Pn1O_XP0.js +74 -0
- package/dist/Org-BqytV_vi.js +39 -0
- package/dist/{Preview-Cm_7RhYU.js → Preview-CLpUUMay.js} +2 -2
- package/dist/{ReportDefine-CJVlQ--7.js → ReportDefine-Cz1KtEUF.js} +1 -1
- package/dist/{ReportDesign-B0unlrkt.js → ReportDesign-BaORYud4.js} +46 -46
- package/dist/{ReportQuery-BKuMCEvF.js → ReportQuery-CPCPXiXz.js} +5 -5
- package/dist/{ReportQueryFrom-DAngMJLU.js → ReportQueryFrom-C_AcrfkJ.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-CPpwmztJ.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-Bm67ejay.js} +6 -5
- package/dist/{ReportTemplate-8YH3L8Pv.js → ReportTemplate-CFiNMz79.js} +26 -26
- package/dist/{Role-MxI30-0W.js → Role-B-XDoJd5.js} +6 -6
- package/dist/{RoleAssign-BzUY_y_y.js → RoleAssign-BolW8YVs.js} +9 -9
- package/dist/{RolePanel-DS_TErTn.js → RolePanel-2kfs5tw9.js} +1 -1
- package/dist/{RolePanel-CXdcvsR5.js → RolePanel-HilSuYns.js} +1 -1
- package/dist/RolePanel.vue_vue_type_script_setup_true_lang-CE4gApUY.js +132 -0
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-Ddl-A7Zh.js → RolePanel.vue_vue_type_script_setup_true_lang-DPzgfAyV.js} +42 -36
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-DnchUgIF.js → ScrollPanel.vue_vue_type_style_index_0_lang-CCTH4RkH.js} +20 -20
- package/dist/{Staff-D7tXo_Gn.js → Staff-BTk3whFC.js} +3 -3
- package/dist/{StaffInfo-Bk8BY8PO.js → StaffInfo-d3AuSzlA.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-DqKwZi5f.js → StaffInfo.vue_vue_type_script_setup_true_lang-eOL4VlfE.js} +13 -13
- package/dist/{StaffPanel-VtpGCTIq.js → StaffPanel-DV-D4jjz.js} +1 -1
- package/dist/StaffPanel.vue_vue_type_script_setup_true_lang-4sFq3CEo.js +135 -0
- package/dist/{SysUser-D0Q6OvD7.js → SysUser-BnjYytws.js} +2 -2
- package/dist/{SysUserPanel-1_vrsANQ.js → SysUserPanel-CBoyD-Qi.js} +1 -1
- package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-PrTlTZR-.js +341 -0
- package/dist/{SystemMenu-9PG3vESE.js → SystemMenu-kYB_ZaUt.js} +49 -47
- package/dist/{UserInfo-qgXUEGwi.js → UserInfo-4dx97VBL.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-CN0C5rVk.js → UserInfo.vue_vue_type_style_index_0_lang-BpbC_ZDm.js} +35 -33
- package/dist/{childView-C7ZSA5fR.js → childView-CHPNfTEb.js} +1 -1
- package/dist/{childView-yV2QLwfA.js → childView-CKA_JgVZ.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-DdKxPGdh.js → childView.vue_vue_type_style_index_0_lang-Bym2fQRd.js} +7 -7
- package/dist/childView.vue_vue_type_style_index_0_lang-W7bCtXeu.js +177 -0
- package/dist/{code-rule-95K1jr-u.js → code-rule-CbxuZg0-.js} +42 -41
- package/dist/core.es.js +19 -10
- package/dist/{cron-task-DGrQwOHs.js → cron-task-nTOpqQYf.js} +5 -5
- package/dist/flow-task-B07st2aD.js +10 -0
- package/dist/{frameView-7SmME93D.js → frameView-Z1tPUyCh.js} +15 -14
- package/dist/img/l_img.svg +1 -1
- package/dist/img/minicolors.png +0 -0
- package/dist/img/v_img.svg +1 -1
- package/dist/index-C3q8HoJM.js +4650 -0
- package/dist/{layoutView-C6WIVWGZ.js → layoutView--MGA9zUB.js} +1776 -1764
- package/dist/{log-in-e7D5Ss1P.js → log-in-CSYJDA6m.js} +36 -29
- package/dist/log-out-DiwGCg7p.js +130 -0
- package/dist/login-C6Y0ajDp.js +251 -0
- package/dist/{login-log-CvVnyGi3.js → login-log-C0V-_l3F.js} +6 -4
- package/dist/{lov-view-DoF5LqFQ.js → lov-view-Cmv7wZZ9.js} +9 -9
- package/dist/{menuInfo-CNzGQwOD.js → menuInfo-UeutJpOa.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-51SYxVc_.js → menuInfo.vue_vue_type_style_index_0_lang-CWX4Mu67.js} +144 -121
- package/dist/pda-app-B6w99SJo.js +710 -0
- package/dist/redirect-BqegffKC.js +15 -0
- package/dist/{resource-gVFFMO9l.js → resource-BybJvUv0.js} +17 -17
- package/dist/{su-welcome-BN_s_RX_.js → su-welcome-C1bmxHoY.js} +124 -126
- package/dist/sys-config-BnmIDnCj.js +370 -0
- package/dist/udp-core.css +1 -9
- package/dist/utogether-MlnyYtNS.js +4 -0
- package/index.ts +19 -6
- package/package.json +18 -17
- package/src/App.vue +2 -7
- package/src/api/http.ts +1 -4
- package/src/api/index.ts +5 -3
- package/src/api/user.ts +2 -2
- package/src/components/SuCharts/src/UserInfo.vue +3 -3
- package/src/components/SuScrollTree/ScrollPanel.vue +4 -9
- package/src/components/udp/content/index.vue +88 -0
- package/src/components/udp/form/form.vue +109 -0
- package/src/components/udp/grid/index.vue +524 -0
- package/src/components/udp/index.ts +5 -4
- package/src/components/udp/ut-stamp-badge/index.vue +271 -0
- package/src/components/udp/utils.ts +408 -40
- package/src/directives/permission/index.ts +1 -1
- package/src/layout/components/lay-navbar/index.vue +9 -7
- package/src/layout/components/lay-panel/index.vue +3 -3
- package/src/layout/components/lay-search/index.vue +1 -1
- package/src/layout/components/lay-select-org/index.vue +4 -9
- package/src/layout/components/lay-setting/index.vue +503 -510
- package/src/layout/components/lay-sidebar/breadCrumb.vue +1 -1
- package/src/layout/components/lay-sidebar/horizontal.vue +8 -6
- package/src/layout/components/lay-sidebar/mixNav.vue +260 -258
- package/src/layout/components/lay-sidebar/sidebar-logo.vue +101 -98
- package/src/layout/components/lay-tag/index.vue +598 -625
- package/src/layout/hooks/useDataThemeChange.ts +1 -1
- package/src/layout/hooks/useNav.ts +176 -173
- package/src/layout/hooks/useTag.ts +227 -233
- package/src/layout/layoutView.vue +215 -215
- package/src/layout/types.ts +93 -92
- package/src/main.ts +115 -109
- package/src/plugins/i18n/en.ts +26 -13
- package/src/plugins/i18n/module/u-workflow.ts +1 -1
- package/src/plugins/i18n/zh.ts +363 -337
- package/src/plugins/vxe-table/index.ts +74 -4
- package/src/plugins/vxe-table/render.tsx +186 -58
- package/src/router/index.ts +187 -183
- package/src/router/modules/flow.ts +35 -0
- package/src/router/modules/home.ts +32 -32
- package/src/router/modules/remaining.ts +1 -26
- package/src/router/utils.ts +420 -377
- package/src/store/modules/app.ts +2 -4
- package/src/store/modules/epTheme.ts +48 -49
- package/src/store/modules/multiTags.ts +15 -14
- package/src/store/modules/permission.ts +25 -15
- package/src/store/modules/system.ts +1 -3
- package/src/style/button.scss +11 -4
- package/src/style/login.css +1 -1
- package/src/style/tailwind.css +1 -68
- package/src/style/vxetable.scss +103 -11
- package/src/utils/authority/index.ts +1 -1
- package/src/utils/dataFormat/index.ts +223 -223
- package/src/utils/index.ts +3 -1
- package/src/utils/lifecycle.ts +39 -20
- package/src/utils/propTypes.ts +1 -6
- package/src/utils/storage/index.ts +2 -2
- package/src/utils/{http → udp/http}/index.ts +27 -30
- package/src/utils/{http → udp/http}/types.d.ts +2 -6
- package/src/views/login/login-view.vue +6 -20
- package/src/views/organization/company/CompanyPanel.vue +2 -2
- package/src/views/organization/department/Department.vue +58 -58
- package/src/views/organization/department/DepartmentPanel.vue +303 -283
- package/src/views/organization/inv-org/InvOrganization.vue +23 -9
- package/src/views/organization/org/Org.vue +9 -5
- package/src/views/organization/staff/StaffInfo.vue +127 -133
- package/src/views/organization/staff/StaffPanel.vue +162 -145
- package/src/views/system/cron/cron-task.vue +2 -12
- package/src/views/system/menu/AuthorityPanel.vue +2 -2
- package/src/views/system/menu/SystemMenu.vue +14 -20
- package/src/views/system/menu/menuInfo.vue +39 -23
- package/src/views/system/role/AuthorityInfo.vue +19 -15
- package/src/views/system/role/Role.vue +1 -5
- package/src/views/system/role/RolePanel.vue +11 -2
- package/src/views/system/role/UserInfo.vue +11 -9
- package/src/views/system/role-assign/RoleAssign.vue +2 -2
- package/src/views/system/role-assign/RolePanel.vue +12 -9
- package/src/views/system/sys/sys-config.vue +70 -21
- package/src/views/system/sysUser/SysUserPanel.vue +347 -278
- package/src/views/uapp/pda/pda-app.vue +48 -16
- package/src/views/udev/coderule/code-rule.vue +132 -121
- package/src/views/udev/dict/DictView.vue +118 -106
- package/src/views/udev/dict/childView.vue +183 -222
- package/src/views/udev/lov/childView.vue +1 -7
- package/src/views/ufile/aggregation/File.vue +5 -5
- package/src/views/ufile/file/water-mark.vue +14 -14
- package/src/views/uhome/components/menu-favorite.vue +314 -331
- package/src/views/uhome/su-welcome.vue +319 -339
- package/src/views/ulogin/login.vue +325 -316
- package/src/views/upms/interface/log-in.vue +100 -106
- package/src/views/upms/interface/log-out.vue +104 -107
- package/src/views/upms/user/login-log.vue +54 -60
- package/src/views/urpt/design/DesignPanel.vue +16 -35
- package/src/views/urpt/design/Preview.vue +1 -0
- package/src/views/urpt/design/ReportDesign.vue +17 -23
- package/src/views/urpt/static-resource/resource.vue +3 -3
- package/src/views/urpt/template/ReportTemplate.vue +7 -7
- package/src/views/utask/flow-task.vue +18 -0
- package/types/global.d.ts +231 -236
- package/vite.config.ts +13 -2
- package/dist/AuthorityInfo.vue_vue_type_style_index_0_lang-32L40GY2.js +0 -102
- package/dist/DictView-q7kR9K--.js +0 -95
- package/dist/InvOrganization-DI45LqZV.js +0 -260
- package/dist/Org-CZju_ZiR.js +0 -35
- package/dist/RolePanel.vue_vue_type_script_setup_true_lang-DJKu6PXz.js +0 -126
- package/dist/StaffPanel.vue_vue_type_script_setup_true_lang-C3Ixs12y.js +0 -111
- package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-C5XEmxsV.js +0 -288
- package/dist/childView.vue_vue_type_style_index_0_lang-bkmucBUL.js +0 -187
- package/dist/core.umd.js +0 -173
- package/dist/index-OswH7SsT.js +0 -9937
- package/dist/log-out--RRncZhN.js +0 -120
- package/dist/login-BhCMeCLS.js +0 -251
- package/dist/pda-app-nn3llDUx.js +0 -2209
- package/dist/redirect-CmMplDV4.js +0 -15
- package/dist/sys-config-DGutV-VX.js +0 -277
- package/dist/utogether-wFDCI28t.js +0 -182
- package/src/assets/images/empty.png +0 -0
- package/src/assets/images/logo.png +0 -0
- package/src/components/ReCountTo/README.md +0 -2
- package/src/components/ReCountTo/index.ts +0 -18
- package/src/components/ReCountTo/src/normal/index.tsx +0 -165
- package/src/components/ReCountTo/src/normal/props.ts +0 -37
- package/src/components/ReCountTo/src/rebound/index.tsx +0 -67
- package/src/components/ReCountTo/src/rebound/props.ts +0 -14
- package/src/components/ReCountTo/src/rebound/rebound.css +0 -77
- package/src/components/ReCropper/index.ts +0 -14
- package/src/components/ReCropper/src/index.tsx +0 -141
- package/src/components/ReFlicker/index.css +0 -39
- package/src/components/ReFlicker/index.ts +0 -50
- package/src/components/ReFlop/index.ts +0 -14
- package/src/components/ReFlop/src/Filpper.tsx +0 -99
- package/src/components/ReFlop/src/filpper.css +0 -184
- package/src/components/ReFlop/src/index.vue +0 -126
- package/src/components/ReFlowChart/index.ts +0 -24
- package/src/components/ReFlowChart/src/Control.vue +0 -139
- package/src/components/ReFlowChart/src/DataDialog.vue +0 -12
- package/src/components/ReFlowChart/src/NodePanel.vue +0 -151
- package/src/components/ReFlowChart/src/adpterForTurbo.ts +0 -160
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.css +0 -49
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.eot +0 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.js +0 -61
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.json +0 -58
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.svg +0 -47
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.ttf +0 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff +0 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff2 +0 -0
- package/src/components/ReFlowChart/src/config.ts +0 -62
- package/src/components/ReSplitPane/index.css +0 -49
- package/src/components/ReSplitPane/index.tsx +0 -119
- package/src/components/ReSplitPane/resizer.css +0 -45
- package/src/components/ReSplitPane/resizer.tsx +0 -30
- package/src/components/SuCommon/card/components/Card.vue +0 -148
- package/src/components/SuCommon/card/components/DialogForm.vue +0 -127
- package/src/components/SuCommon/card/index.vue +0 -142
- package/src/components/SuCommon/icon-select/index.vue +0 -241
- package/src/components/SuCommon/table/index.vue +0 -208
- package/src/components/SuCommon/utils/index.ts +0 -103
- package/src/components/SuCommon/utils/slot.tsx +0 -50
- package/src/components/udp/form-upload.vue +0 -132
- package/src/components/udp/modal-form.vue +0 -180
- package/src/utils/udp/useRender.ts +0 -420
- package/src/views/components/contextmenu/basic.vue +0 -74
- package/src/views/components/contextmenu/context-menu.vue +0 -40
- package/src/views/components/contextmenu/menuDynamic.vue +0 -99
- package/src/views/components/contextmenu/menuGroup.vue +0 -71
- package/src/views/components/count-to/index.vue +0 -43
- package/src/views/components/cropping/index.vue +0 -59
- package/src/views/components/cropping/picture.jpeg +0 -0
- package/src/views/components/split-pane/index.vue +0 -82
- package/src/views/components/video/index.vue +0 -57
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="first-ring"
|
|
4
|
+
v-bind="getBindValue"
|
|
5
|
+
:class="getStampBadgeClass"
|
|
6
|
+
style="position: absolute"
|
|
7
|
+
:style="{ transform: `rotate(${rotate}deg)`, top: `${top}px`, right: `${right}px` }"
|
|
8
|
+
>
|
|
9
|
+
<div class="second-ring" :class="getStampBadgeClass">
|
|
10
|
+
<div class="third-ring" :class="getStampBadgeClass">
|
|
11
|
+
<div class="forth-ring" :class="getStampBadgeClass">
|
|
12
|
+
<div class="content-rectangle ellipsis" :class="getStampBadgeClass">
|
|
13
|
+
<span class="">{{ getContent(content) }}</span>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
import { storageLocal } from '@utogether/utils';
|
|
23
|
+
export default {
|
|
24
|
+
name: 'UTStampBadge',
|
|
25
|
+
props: {
|
|
26
|
+
color: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: 'primary',
|
|
29
|
+
validator: v => ['primary', 'error', 'warning', 'success', 'info'].includes(v)
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* stamp badge size.
|
|
33
|
+
* @default: middle
|
|
34
|
+
*/
|
|
35
|
+
size: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'large',
|
|
38
|
+
validator: v => ['large', 'middle', 'small'].includes(v)
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* stamp badge rotate deg.
|
|
42
|
+
* @default: 0
|
|
43
|
+
*/
|
|
44
|
+
rotate: { type: Number, default: 45 },
|
|
45
|
+
top: { type: Number, default: 60 },
|
|
46
|
+
right: { type: Number, default: 40 },
|
|
47
|
+
content: { type: String, default: 'Unknown' },
|
|
48
|
+
code: { type: String, default: '' }
|
|
49
|
+
},
|
|
50
|
+
computed: {
|
|
51
|
+
getStampBadgeClass() {
|
|
52
|
+
const { color, size } = this.$props;
|
|
53
|
+
return [
|
|
54
|
+
{
|
|
55
|
+
[`stamp-badge-${color}`]: !!color,
|
|
56
|
+
[`stamp-badge-${size}`]: !!size
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
},
|
|
60
|
+
getBindValue() {
|
|
61
|
+
return { ...this.$attrs, ...this.$props };
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
methods: {
|
|
65
|
+
getContent(content) {
|
|
66
|
+
if (!content) return content;
|
|
67
|
+
if (this.code) {
|
|
68
|
+
const dict = storageLocal.getItem('kLov')[this.code];
|
|
69
|
+
const data = dict.children.find(f => f.dictCode === this.content);
|
|
70
|
+
return data ? data.dictName : content;
|
|
71
|
+
}
|
|
72
|
+
return content;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<style lang="scss" scoped>
|
|
79
|
+
.first-ring {
|
|
80
|
+
z-index: 999;
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
justify-content: center;
|
|
84
|
+
border-radius: 100px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.second-ring {
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
background: #fff;
|
|
92
|
+
border-radius: 100px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.third-ring {
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
border-radius: 100px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.forth-ring {
|
|
103
|
+
position: relative;
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
background: #fff;
|
|
108
|
+
border-radius: 100px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.content-rectangle {
|
|
112
|
+
position: absolute;
|
|
113
|
+
font-weight: bold;
|
|
114
|
+
text-align: center;
|
|
115
|
+
background: #fff;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.ellipsis {
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
text-overflow: ellipsis;
|
|
121
|
+
white-space: nowrap;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// primary
|
|
125
|
+
.stamp-badge-primary.first-ring {
|
|
126
|
+
background: #1890ff;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.stamp-badge-primary.third-ring {
|
|
130
|
+
background: #1890ff;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.stamp-badge-primary.content-rectangle {
|
|
134
|
+
color: #1890ff;
|
|
135
|
+
border: 1px solid #1890ff;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// success
|
|
139
|
+
.stamp-badge-success.first-ring {
|
|
140
|
+
background: #52c41a;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.stamp-badge-success.third-ring {
|
|
144
|
+
background: #52c41a;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.stamp-badge-success.content-rectangle {
|
|
148
|
+
color: #52c41a;
|
|
149
|
+
border: 1px solid #52c41a;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// error
|
|
153
|
+
.stamp-badge-error.first-ring {
|
|
154
|
+
background: #ff4d4f;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.stamp-badge-error.third-ring {
|
|
158
|
+
background: #ff4d4f;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.stamp-badge-error.content-rectangle {
|
|
162
|
+
color: #ff4d4f;
|
|
163
|
+
border: 1px solid #ff4d4f;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// warning
|
|
167
|
+
.stamp-badge-warning.first-ring {
|
|
168
|
+
background: #faad14;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.stamp-badge-warning.third-ring {
|
|
172
|
+
background: #faad14;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.stamp-badge-warning.content-rectangle {
|
|
176
|
+
color: #faad14;
|
|
177
|
+
border: 1px solid #faad14;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// info
|
|
181
|
+
.stamp-badge-info.first-ring {
|
|
182
|
+
background: #ccc;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.stamp-badge-info.third-ring {
|
|
186
|
+
background: #ccc;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.stamp-badge-info.content-rectangle {
|
|
190
|
+
color: #ccc;
|
|
191
|
+
border: 1px solid #ccc;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// large
|
|
195
|
+
.stamp-badge-large.first-ring {
|
|
196
|
+
width: 84px;
|
|
197
|
+
height: 84px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.stamp-badge-large.second-ring {
|
|
201
|
+
width: 80px;
|
|
202
|
+
height: 80px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.stamp-badge-large.third-ring {
|
|
206
|
+
width: 74px;
|
|
207
|
+
height: 74px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.stamp-badge-large.forth-ring {
|
|
211
|
+
width: 64px;
|
|
212
|
+
height: 64px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.stamp-badge-large.content-rectangle {
|
|
216
|
+
width: 90px;
|
|
217
|
+
font-size: 1.2rem;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// middle
|
|
221
|
+
.stamp-badge-middle.first-ring {
|
|
222
|
+
width: 64px;
|
|
223
|
+
height: 64px;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.stamp-badge-middle.second-ring {
|
|
227
|
+
width: 60px;
|
|
228
|
+
height: 60px;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.stamp-badge-middle.third-ring {
|
|
232
|
+
width: 56px;
|
|
233
|
+
height: 56px;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.stamp-badge-middle.forth-ring {
|
|
237
|
+
width: 48px;
|
|
238
|
+
height: 48px;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.stamp-badge-middle.content-rectangle {
|
|
242
|
+
width: 70px;
|
|
243
|
+
font-size: 1rem;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// small
|
|
247
|
+
.stamp-badge-small.first-ring {
|
|
248
|
+
width: 54px;
|
|
249
|
+
height: 54px;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.stamp-badge-small.second-ring {
|
|
253
|
+
width: 50px;
|
|
254
|
+
height: 50px;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.stamp-badge-small.third-ring {
|
|
258
|
+
width: 46px;
|
|
259
|
+
height: 46px;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.stamp-badge-small.forth-ring {
|
|
263
|
+
width: 38px;
|
|
264
|
+
height: 38px;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.stamp-badge-small.content-rectangle {
|
|
268
|
+
width: 60px;
|
|
269
|
+
font-size: 0.8rem;
|
|
270
|
+
}
|
|
271
|
+
</style>
|
|
@@ -1,40 +1,408 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
/*
|
|
2
|
+
* @Author: wei.li
|
|
3
|
+
* @Date: 2022-06-23 17:29:11
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2025-12-02 18:32:18
|
|
6
|
+
* @Description: file content
|
|
7
|
+
*/
|
|
8
|
+
// @ts-nocheck
|
|
9
|
+
|
|
10
|
+
import { clone, isString, orderBy, isEmpty, toDateString, isObject, isFunction } from 'xe-utils';
|
|
11
|
+
import { cookies, storageLocal } from '@utogether/utils';
|
|
12
|
+
/** 系统配置的key */
|
|
13
|
+
const kSYSCONFIG = 'kSysConfig';
|
|
14
|
+
const kCOOKIES = 'kCookies_param';
|
|
15
|
+
|
|
16
|
+
const sysConfig = storageLocal.getItem(kSYSCONFIG);
|
|
17
|
+
|
|
18
|
+
/** 工具栏按钮标准化 */
|
|
19
|
+
export const formatButton = (buttons, auth?) => {
|
|
20
|
+
buttons.forEach(btn => {
|
|
21
|
+
btn.auth = auth ? auth[btn.code] || btn.auth : btn.auth;
|
|
22
|
+
if (!btn.name) {
|
|
23
|
+
btn.name = `message.btn.${btn.code}`;
|
|
24
|
+
} else if (sysConfig?.i18nEnabled === 'Y' && !btn.name.startsWith('message.')) {
|
|
25
|
+
btn.name = `message.btn.${btn.name}`;
|
|
26
|
+
}
|
|
27
|
+
if (btn.dropdowns?.length) {
|
|
28
|
+
formatButton(btn.dropdowns, auth);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return buttons;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @description 查询10W数据,常用于Excel导出
|
|
36
|
+
* @param props 查询接口的路径
|
|
37
|
+
* @param http http实例
|
|
38
|
+
* @param form 查询条件
|
|
39
|
+
* @returns 查询返回的数据
|
|
40
|
+
*/
|
|
41
|
+
export const queryAll = (props, http, form) => {
|
|
42
|
+
const params = { pageNum: 1, pageSize: 100000 };
|
|
43
|
+
const commonParam = getCookieParam();
|
|
44
|
+
Object.assign(params, form, commonParam, props.defaultParams || {});
|
|
45
|
+
let query = formatMultipleParams(params, props.items);
|
|
46
|
+
query = formatDateRange(query, props.items);
|
|
47
|
+
|
|
48
|
+
const { url } = props;
|
|
49
|
+
if (!url) return null;
|
|
50
|
+
const requestURL = isString(url) ? url : url.fetch || url.restful;
|
|
51
|
+
if (!requestURL) return null;
|
|
52
|
+
const method = url.fetch ? 'post' : 'get';
|
|
53
|
+
return new Promise((resolve, reject) => {
|
|
54
|
+
http[method](requestURL, query)
|
|
55
|
+
.then((response: IResponseData) => {
|
|
56
|
+
resolve(response.list);
|
|
57
|
+
})
|
|
58
|
+
.catch((e: any) => {
|
|
59
|
+
reject(e);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @description 查询服务
|
|
66
|
+
* @param props 查询接口的路径
|
|
67
|
+
* @param form 查询条件
|
|
68
|
+
* @param page 分页参数
|
|
69
|
+
* @param http http实例
|
|
70
|
+
* @param isDoc doc文档
|
|
71
|
+
* @returns Promise
|
|
72
|
+
*/
|
|
73
|
+
export const query = (props, form, page, http, code, isDoc) => {
|
|
74
|
+
if (isDoc) return getDocData();
|
|
75
|
+
for (const key in form) {
|
|
76
|
+
if (form[key] && isString(form[key])) {
|
|
77
|
+
form[key] = form[key].trim();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const params = { pageNum: page.currentPage, pageSize: page.pageSize };
|
|
81
|
+
const commonParam = getCookieParam();
|
|
82
|
+
Object.assign(params, commonParam, props.defaultParams || {}, form);
|
|
83
|
+
|
|
84
|
+
let query = formatMultipleParams(params, props.items);
|
|
85
|
+
query = formatDateRange(query, props.items);
|
|
86
|
+
const { url } = props;
|
|
87
|
+
if (!url) return null;
|
|
88
|
+
const requestURL = isString(url) ? url : url.fetch || url.restful;
|
|
89
|
+
const method = url.fetch ? 'post' : 'get';
|
|
90
|
+
if (!requestURL) return null;
|
|
91
|
+
return http[method](requestURL, query);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @description 表格删除方法
|
|
96
|
+
* @param http http实例
|
|
97
|
+
* @param records 记录行
|
|
98
|
+
* @param props 删除接口的路径
|
|
99
|
+
* @returns Promise
|
|
100
|
+
*/
|
|
101
|
+
export const del = (http, records, props) => {
|
|
102
|
+
const { url } = props;
|
|
103
|
+
if (!url) return null;
|
|
104
|
+
const requestURL = isString(url) ? url : url.del || url.restful;
|
|
105
|
+
if (!requestURL) return null;
|
|
106
|
+
const method = url.del ? 'post' : 'delete';
|
|
107
|
+
return http[method](requestURL, records);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/** 更新服务 */
|
|
111
|
+
export const save = (http, body, props) => {
|
|
112
|
+
const allService = [];
|
|
113
|
+
const { url } = props;
|
|
114
|
+
if (!url) return null;
|
|
115
|
+
|
|
116
|
+
const { insertRecords, updateRecords } = body;
|
|
117
|
+
if (!isEmpty(insertRecords)) {
|
|
118
|
+
const commonParam = getCookieParam();
|
|
119
|
+
insertRecords.forEach(m => {
|
|
120
|
+
!isEmpty(props?.defaultValue) && Object.assign(m, props.defaultValue);
|
|
121
|
+
Object.keys(commonParam)?.forEach(key => {
|
|
122
|
+
m[key] = m[key] || commonParam[key];
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
const requestURL = isString(url) ? url : url.add || url.restful;
|
|
126
|
+
requestURL && allService.push(http.post(requestURL, insertRecords));
|
|
127
|
+
}
|
|
128
|
+
if (!isEmpty(updateRecords)) {
|
|
129
|
+
const requestURL = isString(url) ? url : url.save || url.restful;
|
|
130
|
+
const method = url.save ? 'post' : 'put';
|
|
131
|
+
requestURL && allService.push(http[method](requestURL, updateRecords));
|
|
132
|
+
}
|
|
133
|
+
return allService;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* 多选数据优化
|
|
138
|
+
* @param listQuery
|
|
139
|
+
* @param items
|
|
140
|
+
* @returns
|
|
141
|
+
*/
|
|
142
|
+
const formatMultipleParams = (listQuery: any, items) => {
|
|
143
|
+
const multipleItems = items.filter(f => f.itemRender?.props?.multiple || f.multiple);
|
|
144
|
+
if (isEmpty(multipleItems)) return listQuery;
|
|
145
|
+
const query = clone(listQuery, true);
|
|
146
|
+
multipleItems.forEach((element: any) => {
|
|
147
|
+
if (element.itemRender.name === '#select' && element.itemRender.props.multiple) {
|
|
148
|
+
if (query[`_${element.field}`]?.length === 0) {
|
|
149
|
+
// 重置后
|
|
150
|
+
query[`${element.field}`] = null;
|
|
151
|
+
}
|
|
152
|
+
delete listQuery[`_${element.field}`];
|
|
153
|
+
delete query[`_${element.field}`];
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
return query;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const startFormatter = 'yyyy-MM-dd 00:00:00';
|
|
160
|
+
const endFormatter = 'yyyy-MM-dd 23:59:59';
|
|
161
|
+
// 时间范围优化
|
|
162
|
+
const formatDateRange = (listQuery: any, items) => {
|
|
163
|
+
const dateRanges = items.filter(f => ['#SuDateRange', 'VxeDateRangePicker'].includes(f.itemRender?.name));
|
|
164
|
+
if (isEmpty(dateRanges)) return listQuery;
|
|
165
|
+
const query = clone(listQuery, true);
|
|
166
|
+
dateRanges.forEach((element: any) => {
|
|
167
|
+
const val = query[element.field];
|
|
168
|
+
if (val && element.itemRender.startField) {
|
|
169
|
+
query[element.itemRender.startField] = toDateString(query[element.itemRender.startField], startFormatter);
|
|
170
|
+
query[element.itemRender.endField] = toDateString(query[element.itemRender.endField], endFormatter);
|
|
171
|
+
} else if (val) {
|
|
172
|
+
query[`${element.field}From`] = toDateString(val[0], startFormatter);
|
|
173
|
+
query[`${element.field}To`] = toDateString(val[1], endFormatter);
|
|
174
|
+
}
|
|
175
|
+
delete query[element.field];
|
|
176
|
+
});
|
|
177
|
+
return query;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const getCookieParam = () => {
|
|
181
|
+
return cookies.get(kCOOKIES) ? JSON.parse(cookies.get(kCOOKIES)) : {};
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
/** 工具栏默认按钮组 */
|
|
185
|
+
export const inlineButtons = [
|
|
186
|
+
{
|
|
187
|
+
code: 'insert_actived',
|
|
188
|
+
name: 'add',
|
|
189
|
+
status: 'u-cyan',
|
|
190
|
+
icon: 'vxe-icon-add',
|
|
191
|
+
auth: 'add',
|
|
192
|
+
sort: 1
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
code: 'delete',
|
|
196
|
+
status: 'danger',
|
|
197
|
+
icon: 'vxe-icon-delete',
|
|
198
|
+
auth: 'del',
|
|
199
|
+
sort: 2
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
code: 'save',
|
|
203
|
+
status: 'primary',
|
|
204
|
+
icon: 'vxe-icon-save',
|
|
205
|
+
auth: 'edit',
|
|
206
|
+
sort: 3
|
|
207
|
+
}
|
|
208
|
+
];
|
|
209
|
+
// form 模式按钮
|
|
210
|
+
export const dialogButtons = [
|
|
211
|
+
{
|
|
212
|
+
code: 'add',
|
|
213
|
+
status: 'u-cyan',
|
|
214
|
+
icon: 'vxe-icon-add',
|
|
215
|
+
auth: 'add',
|
|
216
|
+
sort: 1
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
code: 'del',
|
|
220
|
+
status: 'danger',
|
|
221
|
+
icon: 'vxe-icon-delete',
|
|
222
|
+
auth: 'del',
|
|
223
|
+
sort: 2
|
|
224
|
+
}
|
|
225
|
+
];
|
|
226
|
+
|
|
227
|
+
export const defaultColums = [
|
|
228
|
+
{ field: 'createdByName', width: 90, visible: false },
|
|
229
|
+
{ field: 'creationDate', width: 140, visible: false },
|
|
230
|
+
{ field: 'lastUpdatedByName', width: 90, visible: false },
|
|
231
|
+
{ field: 'lastUpdateDate', width: 140, visible: false }
|
|
232
|
+
];
|
|
233
|
+
|
|
234
|
+
/** 导出配置 */
|
|
235
|
+
export const getExportConfig = attrs => {
|
|
236
|
+
if (isObject(attrs.exportConfig)) return attrs.exportConfig;
|
|
237
|
+
return {
|
|
238
|
+
filename: attrs.fileName || '导出明细',
|
|
239
|
+
type: 'xlsx',
|
|
240
|
+
types: ['xlsx', 'csv'],
|
|
241
|
+
modes: ['current', 'selected', 'all'],
|
|
242
|
+
useStyle: true,
|
|
243
|
+
sheetMethod: ({ worksheet }) => (attrs.onSheetMethod ? attrs.onSheetMethod(worksheet) : onSheetMethod(worksheet)),
|
|
244
|
+
columnFilterMethod: ({ column }) =>
|
|
245
|
+
attrs.columnFilter
|
|
246
|
+
? !!attrs.columnFilter(column)
|
|
247
|
+
: !['operate'].includes(column.field) && column.type !== 'checkbox'
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
export const getToolBarConfig = (data, props, attrs, hasAuthority) => {
|
|
252
|
+
const refreshOptions = {
|
|
253
|
+
icon: 'ri-refresh-line',
|
|
254
|
+
iconLoading: 'vxe-icon-spinner roll vxe-loading--default-icon'
|
|
255
|
+
};
|
|
256
|
+
// 不可编辑时
|
|
257
|
+
if (!props.editable) {
|
|
258
|
+
data.editConfig.editable = props.editable;
|
|
259
|
+
const hasExport = props.needExport && hasAuthority('export');
|
|
260
|
+
if (hasExport) {
|
|
261
|
+
data.exportConfig = getExportConfig(attrs);
|
|
262
|
+
}
|
|
263
|
+
data.toolbarConfig = {
|
|
264
|
+
buttons: [],
|
|
265
|
+
enabled: hasExport,
|
|
266
|
+
refreshOptions,
|
|
267
|
+
exportOptions: { icon: 'ri-download-2-line', code: 'export' },
|
|
268
|
+
export: hasExport,
|
|
269
|
+
custom: !!attrs.gridId,
|
|
270
|
+
refresh: true,
|
|
271
|
+
perfect: true
|
|
272
|
+
};
|
|
273
|
+
return data;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// 先设置传入的按钮
|
|
277
|
+
let buttons = clone(attrs.buttons || [], true);
|
|
278
|
+
|
|
279
|
+
buttons.forEach((button, idx) => {
|
|
280
|
+
button.sort = button.sort || idx + 10;
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
// 获取默认的按钮
|
|
284
|
+
const toolButtons = attrs.mode !== 'form' ? clone(inlineButtons, true) : clone(dialogButtons, true);
|
|
285
|
+
// 判断传入的按钮是否有默认按钮的auth,有就不加入按钮组中,相当于重写了默认的按钮
|
|
286
|
+
// reverse的原因是: 保持现有按钮顺序, 新增,保存,删除
|
|
287
|
+
toolButtons.reverse().forEach(btn => {
|
|
288
|
+
!buttons.some(s => s.code === btn.code) && buttons.unshift(btn);
|
|
289
|
+
if (attrs.authPrefix && !['printer', 'export'].includes(btn.auth)) {
|
|
290
|
+
btn.auth = attrs.authPrefix + btn.auth.slice(0, 1).toLocaleUpperCase() + btn.auth.slice(1).toLocaleLowerCase();
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
buttons = formatButton(buttons, props.auth).filter(button => {
|
|
295
|
+
const flag = button.auth ? hasAuthority(button.auth) : true;
|
|
296
|
+
if (button.dropdowns?.length) {
|
|
297
|
+
button.dropdowns = button.dropdowns.filter(btn => !btn.auth || (btn.auth && hasAuthority(btn.auth)));
|
|
298
|
+
}
|
|
299
|
+
return flag;
|
|
300
|
+
});
|
|
301
|
+
// inline 行内模式,单击行模式
|
|
302
|
+
const editConfig = { trigger: 'dblclick', mode: 'row', showStatus: true };
|
|
303
|
+
data.editConfig = attrs.mode !== 'form' ? editConfig : { enabled: false };
|
|
304
|
+
// 导出权限
|
|
305
|
+
const hasExport = props.needExport && hasAuthority('export');
|
|
306
|
+
let exportBtn = null;
|
|
307
|
+
if (hasExport) {
|
|
308
|
+
data.exportConfig = getExportConfig(attrs);
|
|
309
|
+
exportBtn = { icon: 'ri-download-2-line', code: 'export' };
|
|
310
|
+
}
|
|
311
|
+
data.toolbarConfig = {
|
|
312
|
+
buttons: orderBy(buttons, 'sort'),
|
|
313
|
+
enabled: true,
|
|
314
|
+
refreshOptions,
|
|
315
|
+
customOptions: attrs.gridId ? {} : null,
|
|
316
|
+
exportOptions: exportBtn,
|
|
317
|
+
custom: !!attrs.gridId,
|
|
318
|
+
export: hasExport,
|
|
319
|
+
refresh: true,
|
|
320
|
+
perfect: true
|
|
321
|
+
};
|
|
322
|
+
return data;
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* @description: 表格脚合并方法
|
|
327
|
+
* @param {*} columns 列数据
|
|
328
|
+
* @param {*} data 数据源
|
|
329
|
+
* @param {*} sum 合并属性
|
|
330
|
+
* @return {*} 合并脚方法
|
|
331
|
+
*/
|
|
332
|
+
export const footerSumMethod = ({ columns, data }, sum) => {
|
|
333
|
+
return [
|
|
334
|
+
columns.map((column, columnIdx) => {
|
|
335
|
+
if (columnIdx === (sum.index || 0)) {
|
|
336
|
+
return sum.label || '合计';
|
|
337
|
+
}
|
|
338
|
+
if (sum.fields?.includes(column.property)) {
|
|
339
|
+
const total = data.reduce((prev, cur) => {
|
|
340
|
+
return prev + Number(cur[column.property] || 0);
|
|
341
|
+
}, 0);
|
|
342
|
+
return total ? Number(total.toFixed(sum.decimal || 2)) : total;
|
|
343
|
+
}
|
|
344
|
+
return '';
|
|
345
|
+
})
|
|
346
|
+
];
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* @description: checkbox是否可选
|
|
351
|
+
*/
|
|
352
|
+
export const onCheckMethod = (row, props) => {
|
|
353
|
+
if (isFunction(props.checkMethod)) {
|
|
354
|
+
return props.checkMethod(row);
|
|
355
|
+
}
|
|
356
|
+
return true;
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
/*** excel样式重置 */
|
|
360
|
+
const onSheetMethod = ws => {
|
|
361
|
+
ws.eachRow((row, rowNumber) => {
|
|
362
|
+
row.font = { name: '微软雅黑', size: 9 };
|
|
363
|
+
row.border = {
|
|
364
|
+
top: { style: 'thin' },
|
|
365
|
+
left: { style: 'thin' },
|
|
366
|
+
bottom: { style: 'thin' },
|
|
367
|
+
right: { style: 'thin' }
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
if (rowNumber === 1) {
|
|
371
|
+
row.fill = {
|
|
372
|
+
type: 'pattern',
|
|
373
|
+
pattern: 'solid',
|
|
374
|
+
fgColor: { argb: '4F81BD' }
|
|
375
|
+
};
|
|
376
|
+
row.font = {
|
|
377
|
+
name: '微软雅黑',
|
|
378
|
+
size: 10,
|
|
379
|
+
bold: true,
|
|
380
|
+
color: { argb: 'FFFFFFFF' }
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
const getDocData = () => {
|
|
387
|
+
return new Promise(resolve => {
|
|
388
|
+
setTimeout(() => {
|
|
389
|
+
const list = [
|
|
390
|
+
{ id: 1, name: 'Test1', sex: 'Man', age: 28, address: 'Shenzhen' },
|
|
391
|
+
{ id: 2, name: 'Test2', sex: 'Women', age: 22, address: 'Guangzhou' },
|
|
392
|
+
{ id: 3, name: 'Test3', sex: 'Man', age: 32, address: 'Shanghai' },
|
|
393
|
+
{ id: 4, name: 'Test4', sex: 'Women', age: 23, address: 'test abc' },
|
|
394
|
+
{ id: 5, name: 'Test5', sex: 'Women', age: 30, address: 'Shanghai' }
|
|
395
|
+
];
|
|
396
|
+
resolve({ list, total: 5 });
|
|
397
|
+
}, 100);
|
|
398
|
+
});
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
export const getAttrs = attrs => {
|
|
402
|
+
const data = {};
|
|
403
|
+
Object.keys(attrs).forEach(key => {
|
|
404
|
+
const nKey = key.replace(/-(\w)/g, str => str.slice(1).toUpperCase());
|
|
405
|
+
data[nKey] = attrs[key];
|
|
406
|
+
});
|
|
407
|
+
return data;
|
|
408
|
+
};
|