@arkxos/arkos-system 0.1.0
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/README.md +36 -0
- package/ark_dist/664d11f069eab128.css +2 -0
- package/ark_dist/ArkOsConfig.js +136 -0
- package/ark_dist/ark-meta.json +92 -0
- package/ark_dist/ark_userChunk_1.js +3 -0
- package/ark_dist/ark_userChunk_2.js +5 -0
- package/ark_dist/ark_userChunk_3.js +49 -0
- package/ark_dist/config.js +75 -0
- package/ark_dist/css/views/views-flow-flow.ca26b106.css +5784 -0
- package/ark_dist/favicon.ico +0 -0
- package/ark_dist/fonts/bpmn.5d33bee4.eot +0 -0
- package/ark_dist/fonts/bpmn.67058807.woff2 +0 -0
- package/ark_dist/fonts/bpmn.b5c9250d.ttf +0 -0
- package/ark_dist/fonts/bpmn.e9e7d076.woff +0 -0
- package/ark_dist/img/404.png +0 -0
- package/ark_dist/img/auth_banner.jpg +0 -0
- package/ark_dist/img/avatar.jpg +0 -0
- package/ark_dist/img/avatar2.gif +0 -0
- package/ark_dist/img/avatar3.gif +0 -0
- package/ark_dist/img/bpmn.74eea12b.svg +224 -0
- package/ark_dist/img/loginbg.svg +1 -0
- package/ark_dist/img/logo-r.png +0 -0
- package/ark_dist/img/logo.png +0 -0
- package/ark_dist/img/mobile-bg.d055fadc.png +0 -0
- package/ark_dist/img/no-widgets.svg +57 -0
- package/ark_dist/img/tasks-example.png +0 -0
- package/ark_dist/img/ver.svg +236 -0
- package/ark_dist/index.html +118 -0
- package/ark_dist/js/app.e39a548a.js +1 -0
- package/ark_dist/js/views/views-flow-flow.84dc5300.js +3 -0
- package/ark_dist/js/views/views-flow-flow.84dc5300.js.LICENSE.txt +182 -0
- package/ark_dist/js/views/views-flow-flow.84dc5300.js.map +1 -0
- package/ark_proxy/entry.js +28 -0
- package/ark_proxy_es/entry.js +16 -0
- package/package.json +173 -0
- package/scripts/check.js +13 -0
- package/scripts/meta.js +21 -0
- package/scripts/prepublishOnly.js +28 -0
- package/src/admin/App.vue +13 -0
- package/src/admin/bpmn/custom/context-pad.js +405 -0
- package/src/admin/bpmn/custom/index.js +8 -0
- package/src/admin/bpmn/custom/palette.js +159 -0
- package/src/admin/bpmn/properties-panel/PropertiesView.vue +620 -0
- package/src/admin/bpmn/translate.js +23 -0
- package/src/admin/bpmn/translations.js +211 -0
- package/src/admin/components/affix/index.vue +385 -0
- package/src/admin/components/area-select/index.vue +52 -0
- package/src/admin/components/buttons/index.vue +47 -0
- package/src/admin/components/checkbox/index.vue +83 -0
- package/src/admin/components/code/code.js +149 -0
- package/src/admin/components/code/index.vue +450 -0
- package/src/admin/components/color/index.vue +30 -0
- package/src/admin/components/color-picker/index.vue +57 -0
- package/src/admin/components/color-scheme/index.vue +234 -0
- package/src/admin/components/condition-list/index.vue +170 -0
- package/src/admin/components/date/index.vue +29 -0
- package/src/admin/components/datetime/index.vue +45 -0
- package/src/admin/components/default-value-tips/index.vue +44 -0
- package/src/admin/components/dict-buttons/index.vue +53 -0
- package/src/admin/components/dict-checkbox/index.vue +45 -0
- package/src/admin/components/dict-radio/index.vue +68 -0
- package/src/admin/components/dict-select/index.vue +93 -0
- package/src/admin/components/dict-selects/index.vue +105 -0
- package/src/admin/components/dict-switch/index.vue +64 -0
- package/src/admin/components/dict-tree/index.vue +17 -0
- package/src/admin/components/dm-tree/index.vue +224 -0
- package/src/admin/components/edit-table/index.vue +171 -0
- package/src/admin/components/employee-tree/index.vue +247 -0
- package/src/admin/components/employees-tree/index.vue +80 -0
- package/src/admin/components/entp-tree/index.vue +266 -0
- package/src/admin/components/file/index.vue +310 -0
- package/src/admin/components/form/index.vue +141 -0
- package/src/admin/components/icon/index.vue +77 -0
- package/src/admin/components/icon-buttons/index.vue +52 -0
- package/src/admin/components/icon-select/index.vue +140 -0
- package/src/admin/components/image/index.vue +207 -0
- package/src/admin/components/index.js +16 -0
- package/src/admin/components/input/index.vue +41 -0
- package/src/admin/components/local-img/index.vue +49 -0
- package/src/admin/components/multiple-input/index.vue +64 -0
- package/src/admin/components/multiple-number/index.vue +70 -0
- package/src/admin/components/number/index.vue +134 -0
- package/src/admin/components/organization/index.vue +303 -0
- package/src/admin/components/organization-tree/index.vue +269 -0
- package/src/admin/components/page/index.vue +149 -0
- package/src/admin/components/password/index.vue +21 -0
- package/src/admin/components/radio/index.vue +46 -0
- package/src/admin/components/region-tree/index.vue +269 -0
- package/src/admin/components/remote-select/index.vue +315 -0
- package/src/admin/components/rich-editor/index.vue +152 -0
- package/src/admin/components/role-select/index.vue +58 -0
- package/src/admin/components/script-input/index.vue +97 -0
- package/src/admin/components/select/index.vue +105 -0
- package/src/admin/components/selects/index.vue +100 -0
- package/src/admin/components/style-list/index.vue +500 -0
- package/src/admin/components/switch/index.vue +54 -0
- package/src/admin/components/table/index.vue +920 -0
- package/src/admin/components/textarea/index.vue +28 -0
- package/src/admin/components/tree/index.vue +247 -0
- package/src/admin/components/tree-selects/index.vue +66 -0
- package/src/admin/components/unit-tree/index.vue +269 -0
- package/src/admin/console/index.vue +122 -0
- package/src/admin/layout/console/index.vue +15 -0
- package/src/admin/layout/fullscreen/index.vue +32 -0
- package/src/admin/layout/home/index.vue +11 -0
- package/src/admin/layout/index.vue +139 -0
- package/src/admin/layout/menu/index.vue +102 -0
- package/src/admin/layout/personnel/index.vue +166 -0
- package/src/admin/layout/search/index.vue +78 -0
- package/src/admin/main.js +30 -0
- package/src/admin/pinia/router.js +179 -0
- package/src/admin/router.js +91 -0
- package/src/admin/visual/comp-data.vue +1107 -0
- package/src/admin/visual/comp-event.vue +1677 -0
- package/src/admin/visual/components/app/list/goods/double.vue +184 -0
- package/src/admin/visual/components/app/list/nav/image.vue +114 -0
- package/src/admin/visual/components/app/list/nav/text.vue +130 -0
- package/src/admin/visual/components/button/index.vue +58 -0
- package/src/admin/visual/components/container/index.vue +37 -0
- package/src/admin/visual/components/custom-list/index.vue +127 -0
- package/src/admin/visual/components/data/index.vue +46 -0
- package/src/admin/visual/components/data-table/index.vue +203 -0
- package/src/admin/visual/components/echarts/annular.vue +140 -0
- package/src/admin/visual/components/echarts/bar.vue +115 -0
- package/src/admin/visual/components/echarts/funnel.vue +115 -0
- package/src/admin/visual/components/echarts/gauge.vue +158 -0
- package/src/admin/visual/components/echarts/line.vue +110 -0
- package/src/admin/visual/components/echarts/map.vue +150 -0
- package/src/admin/visual/components/echarts/pie.vue +114 -0
- package/src/admin/visual/components/echarts/radar.vue +145 -0
- package/src/admin/visual/components/echarts/scatter.vue +106 -0
- package/src/admin/visual/components/edit-table/index.vue +71 -0
- package/src/admin/visual/components/form/affix.vue +107 -0
- package/src/admin/visual/components/form/area.vue +76 -0
- package/src/admin/visual/components/form/buttons.vue +90 -0
- package/src/admin/visual/components/form/checkbox.vue +85 -0
- package/src/admin/visual/components/form/date-range.vue +61 -0
- package/src/admin/visual/components/form/date.vue +59 -0
- package/src/admin/visual/components/form/datetime.vue +59 -0
- package/src/admin/visual/components/form/employee-tree.vue +88 -0
- package/src/admin/visual/components/form/employees-tree.vue +6 -0
- package/src/admin/visual/components/form/image.vue +103 -0
- package/src/admin/visual/components/form/index.vue +59 -0
- package/src/admin/visual/components/form/input.vue +84 -0
- package/src/admin/visual/components/form/item.vue +68 -0
- package/src/admin/visual/components/form/number.vue +130 -0
- package/src/admin/visual/components/form/organization-tree.vue +88 -0
- package/src/admin/visual/components/form/password.vue +74 -0
- package/src/admin/visual/components/form/radio.vue +87 -0
- package/src/admin/visual/components/form/rate.vue +66 -0
- package/src/admin/visual/components/form/region-tree.vue +88 -0
- package/src/admin/visual/components/form/rich-editor.vue +94 -0
- package/src/admin/visual/components/form/select.vue +156 -0
- package/src/admin/visual/components/form/switch.vue +85 -0
- package/src/admin/visual/components/form/textarea.vue +62 -0
- package/src/admin/visual/components/form/unit-tree.vue +88 -0
- package/src/admin/visual/components/icon/index.vue +65 -0
- package/src/admin/visual/components/image/index.vue +170 -0
- package/src/admin/visual/components/index.js +44 -0
- package/src/admin/visual/components/list/block.vue +160 -0
- package/src/admin/visual/components/list/button.vue +80 -0
- package/src/admin/visual/components/list/card.vue +101 -0
- package/src/admin/visual/components/list/custom.vue +150 -0
- package/src/admin/visual/components/list/image.vue +116 -0
- package/src/admin/visual/components/list/news.vue +138 -0
- package/src/admin/visual/components/page/index.vue +88 -0
- package/src/admin/visual/components/page-comp/index.vue +110 -0
- package/src/admin/visual/components/portal-menu/index.vue +92 -0
- package/src/admin/visual/components/qrcode/index.vue +77 -0
- package/src/admin/visual/components/router-view/index.vue +12 -0
- package/src/admin/visual/components/row/index.vue +139 -0
- package/src/admin/visual/components/search/index.vue +40 -0
- package/src/admin/visual/components/tabs/index.vue +125 -0
- package/src/admin/visual/components/text/index.vue +64 -0
- package/src/admin/visual/components/video/index.vue +41 -0
- package/src/admin/visual/draggable.vue +49 -0
- package/src/admin/visual/editor.vue +602 -0
- package/src/admin/visual/js/app-form.config.js +1301 -0
- package/src/admin/visual/js/app.config.js +86 -0
- package/src/admin/visual/js/common.config.js +687 -0
- package/src/admin/visual/js/component.config.js +741 -0
- package/src/admin/visual/js/echarts.config.js +2440 -0
- package/src/admin/visual/js/form.config.js +2837 -0
- package/src/admin/visual/js/list.config.js +578 -0
- package/src/admin/visual/js/menu.config.js +62 -0
- package/src/admin/visual/js/visual-comp.js +48 -0
- package/src/admin/visual/tool.vue +1223 -0
- package/src/assets/images/background.jpg +0 -0
- package/src/assets/images/login-bg.jpg +0 -0
- package/src/assets/images/mobile-bg.png +0 -0
- package/src/assets/images/no-data.png +0 -0
- package/src/assets/style/base.css +48 -0
- package/src/assets/style/business.css +5 -0
- package/src/assets/style/code.css +36 -0
- package/src/assets/style/codeless.css +195 -0
- package/src/assets/style/flow.css +12 -0
- package/src/assets/style/global/blue.css +83 -0
- package/src/assets/style/global/default.css +71 -0
- package/src/assets/style/global/green.css +83 -0
- package/src/assets/style/global/purple.css +83 -0
- package/src/assets/style/global/red.css +83 -0
- package/src/assets/style/main.css +608 -0
- package/src/assets/style/menu/black.css +9 -0
- package/src/assets/style/menu/default.css +9 -0
- package/src/assets/style/menu/grey.css +9 -0
- package/src/assets/style/visual.css +204 -0
- package/src/auto-imports.d.ts +307 -0
- package/src/business/App.vue +131 -0
- package/src/business/components/dict-select/index.vue +88 -0
- package/src/business/components/index.js +13 -0
- package/src/business/components/input/index.vue +38 -0
- package/src/business/components/table/index.vue +928 -0
- package/src/business/home/index.vue +45 -0
- package/src/business/iframe/index.vue +63 -0
- package/src/business/layout/aside/history/history.vue +518 -0
- package/src/business/layout/aside/index.vue +116 -0
- package/src/business/layout/aside/menu/index.vue +47 -0
- package/src/business/layout/aside/menu/menuItem.vue +83 -0
- package/src/business/layout/aside/menu/submenu.vue +88 -0
- package/src/business/layout/fullscreen/index.vue +41 -0
- package/src/business/layout/header/index.vue +81 -0
- package/src/business/layout/header/menu/index.vue +47 -0
- package/src/business/layout/header/menu/menuItem.vue +43 -0
- package/src/business/layout/header/menu/submenu.vue +34 -0
- package/src/business/layout/home/index.vue +20 -0
- package/src/business/layout/index.vue +330 -0
- package/src/business/layout/message/index.vue +250 -0
- package/src/business/layout/personnel/index.vue +549 -0
- package/src/business/layout/search/index.vue +75 -0
- package/src/business/layout/subsystem/index.vue +124 -0
- package/src/business/main.js +36 -0
- package/src/business/pinia/menuBadge.js +58 -0
- package/src/business/pinia/router.js +190 -0
- package/src/business/router.js +98 -0
- package/src/choose/App.vue +203 -0
- package/src/choose/main.js +22 -0
- package/src/choose/router.js +33 -0
- package/src/codeless/components/affix/index.vue +393 -0
- package/src/codeless/components/affix-view/index.vue +244 -0
- package/src/codeless/components/buttons/index.vue +59 -0
- package/src/codeless/components/checkbox/index.vue +107 -0
- package/src/codeless/components/date/index.vue +105 -0
- package/src/codeless/components/datetime/index.vue +65 -0
- package/src/codeless/components/dialog-select/index.vue +170 -0
- package/src/codeless/components/dict-buttons/index.vue +97 -0
- package/src/codeless/components/dict-radio/index.vue +94 -0
- package/src/codeless/components/dict-select/index.vue +181 -0
- package/src/codeless/components/dict-selects/index.vue +145 -0
- package/src/codeless/components/dict-switch/index.vue +94 -0
- package/src/codeless/components/dict-tree/index.vue +116 -0
- package/src/codeless/components/edit-table/index.vue +160 -0
- package/src/codeless/components/employee-tree/index.vue +254 -0
- package/src/codeless/components/employees-tree/index.vue +87 -0
- package/src/codeless/components/entp-tree/index.vue +261 -0
- package/src/codeless/components/entps-tree/index.vue +93 -0
- package/src/codeless/components/icon/index.vue +65 -0
- package/src/codeless/components/image/index.vue +298 -0
- package/src/codeless/components/index.js +16 -0
- package/src/codeless/components/input/index.vue +63 -0
- package/src/codeless/components/number/index.vue +150 -0
- package/src/codeless/components/organization-tree/index.vue +262 -0
- package/src/codeless/components/organizations-tree/index.vue +79 -0
- package/src/codeless/components/password/index.vue +42 -0
- package/src/codeless/components/radio/index.vue +57 -0
- package/src/codeless/components/region-tree/index.vue +262 -0
- package/src/codeless/components/remote-distinct/index.vue +354 -0
- package/src/codeless/components/remote-select/index.vue +363 -0
- package/src/codeless/components/rich-editor/index.vue +159 -0
- package/src/codeless/components/roles/index.vue +68 -0
- package/src/codeless/components/select/index.vue +95 -0
- package/src/codeless/components/selects/index.vue +116 -0
- package/src/codeless/components/show-dict/index.vue +52 -0
- package/src/codeless/components/show-employees/index.vue +29 -0
- package/src/codeless/components/show-organizations/index.vue +29 -0
- package/src/codeless/components/show-roles/index.vue +45 -0
- package/src/codeless/components/signature-pad/index.vue +224 -0
- package/src/codeless/components/switch/index.vue +56 -0
- package/src/codeless/components/textarea/index.vue +37 -0
- package/src/codeless/components/tree/index.vue +244 -0
- package/src/codeless/components/unit-tree/index.vue +262 -0
- package/src/codeless/components/units-tree/index.vue +93 -0
- package/src/codeless/components/video/index.vue +255 -0
- package/src/codeless/components/video-view/index.vue +130 -0
- package/src/codeless/js/codeless.js +47 -0
- package/src/codeless/view/form-auto.vue +192 -0
- package/src/codeless/view/form-custom.vue +10 -0
- package/src/codeless/view/form-model.vue +421 -0
- package/src/codeless/view/form-query.vue +171 -0
- package/src/codeless/view/form.vue +575 -0
- package/src/codeless/view/page-comp.vue +1318 -0
- package/src/codeless/view/page.vue +280 -0
- package/src/codeless/view/table-edit-item.vue +184 -0
- package/src/codeless/view/table-edit.vue +490 -0
- package/src/codeless/view/table.vue +1606 -0
- package/src/codeless/view/tree.vue +431 -0
- package/src/configs/subApp.ts +9 -0
- package/src/directives/collapse/index.js +123 -0
- package/src/directives/drag/index.js +43 -0
- package/src/directives/index.js +9 -0
- package/src/directives/resize/index.js +23 -0
- package/src/entrance/libProperties.ts +24 -0
- package/src/entrance/libTypes.ts +26 -0
- package/src/error/404.vue +23 -0
- package/src/flow/chart.vue +130 -0
- package/src/flow/deal.vue +776 -0
- package/src/flow/signature.vue +216 -0
- package/src/flow/start.vue +18 -0
- package/src/http/api.js +192 -0
- package/src/http/request.js +81 -0
- package/src/login/App.vue +421 -0
- package/src/login/main.js +30 -0
- package/src/login/router.js +33 -0
- package/src/main.ts +20 -0
- package/src/mobile/App.vue +51 -0
- package/src/mobile/home/index.vue +34 -0
- package/src/mobile/main.js +26 -0
- package/src/mobile/router.js +101 -0
- package/src/mobile/view/page.vue +99 -0
- package/src/pinia/index.js +5 -0
- package/src/pinia/modules/dataField.js +77 -0
- package/src/pinia/modules/dataForm.js +46 -0
- package/src/pinia/modules/dataTable.js +46 -0
- package/src/pinia/modules/dictionary.js +66 -0
- package/src/pinia/modules/employee.js +46 -0
- package/src/pinia/modules/icon.js +46 -0
- package/src/pinia/modules/keepAlive.js +35 -0
- package/src/pinia/modules/organization.js +189 -0
- package/src/pinia/modules/page.js +46 -0
- package/src/pinia/modules/pageButton.js +44 -0
- package/src/pinia/modules/pageComp.js +46 -0
- package/src/pinia/modules/role.js +46 -0
- package/src/pinia/modules/setting.js +56 -0
- package/src/pinia/modules/subsystem.js +64 -0
- package/src/pinia/modules/user.js +177 -0
- package/src/plugins/index.ts +24 -0
- package/src/portal/App.vue +27 -0
- package/src/portal/home/index.vue +52 -0
- package/src/portal/main.js +31 -0
- package/src/portal/page/index.vue +39 -0
- package/src/portal/pinia/router.js +176 -0
- package/src/portal/router.js +86 -0
- package/src/router/constantRoutes.ts +13 -0
- package/src/router/loadComponent.ts +29 -0
- package/src/router/readme.txt +21 -0
- package/src/sso/sso.js +19 -0
- package/src/sso/sso.vue +138 -0
- package/src/types/axios.d.ts +13 -0
- package/src/types/func.ts +14 -0
- package/src/types/global.d.ts +108 -0
- package/src/types/layout.d.ts +59 -0
- package/src/types/mitt.d.ts +40 -0
- package/src/types/pinia.d.ts +93 -0
- package/src/types/views.d.ts +27 -0
- package/src/types/window.d.ts +8 -0
- package/src/utils/aes.js +75 -0
- package/src/utils/browser.js +13 -0
- package/src/utils/bus.js +4 -0
- package/src/utils/cache.js +6 -0
- package/src/utils/codeless.js +92 -0
- package/src/utils/color.js +274 -0
- package/src/utils/date.js +180 -0
- package/src/utils/loading.js +22 -0
- package/src/utils/page.js +36 -0
- package/src/utils/progress.js +19 -0
- package/src/utils/system.js +92 -0
- package/src/utils/theme.js +79 -0
- package/src/utils/tool.js +431 -0
- package/src/utils/websocket.js +124 -0
- package/src/views/codeless/appVersion.vue +593 -0
- package/src/views/codeless/dataFormEdit.vue +1463 -0
- package/src/views/codeless/dataModel.vue +2584 -0
- package/src/views/codeless/dataModelPage.vue +535 -0
- package/src/views/codeless/dataTableEdit.vue +1678 -0
- package/src/views/codeless/datasource.vue +308 -0
- package/src/views/codeless/interface.vue +833 -0
- package/src/views/codeless/interfaceToken.vue +255 -0
- package/src/views/codeless/page.vue +752 -0
- package/src/views/codeless/pageButton.vue +255 -0
- package/src/views/codeless/pageCompEdit.vue +2330 -0
- package/src/views/codeless/pageEdit.vue +661 -0
- package/src/views/codeless/relationPage.vue +349 -0
- package/src/views/codeless/scriptGroovy.vue +736 -0
- package/src/views/codeless/scriptGroovyEdit.vue +248 -0
- package/src/views/codeless/scriptGroovyExecute.vue +212 -0
- package/src/views/codeless/scriptGroovySimple.vue +1057 -0
- package/src/views/codeless/scriptTool.vue +563 -0
- package/src/views/codeless/subsystem.vue +309 -0
- package/src/views/codeless/template.vue +739 -0
- package/src/views/codeless/variable.vue +727 -0
- package/src/views/codeless/view.vue +738 -0
- package/src/views/codeless/viewEdit.vue +244 -0
- package/src/views/codeless/viewSimple.vue +1034 -0
- package/src/views/collect/task.vue +898 -0
- package/src/views/collect/taskLog.vue +238 -0
- package/src/views/dictionary/dictionary.vue +866 -0
- package/src/views/employee/employee.vue +355 -0
- package/src/views/flow/flow.vue +369 -0
- package/src/views/flow/flowInst.vue +73 -0
- package/src/views/flow/flowLineBranch.vue +406 -0
- package/src/views/flow/flowNodeMan.vue +426 -0
- package/src/views/flow/flowOpinion.vue +188 -0
- package/src/views/icon/icon.vue +242 -0
- package/src/views/log/loginLog.vue +41 -0
- package/src/views/log/operatorLog.vue +176 -0
- package/src/views/menu/menu.vue +883 -0
- package/src/views/menu/menuList.vue +858 -0
- package/src/views/message/message.vue +299 -0
- package/src/views/mobile/editor.vue +1100 -0
- package/src/views/mobile/mobile.vue +568 -0
- package/src/views/mobile/tool.vue +1258 -0
- package/src/views/monitor/database.vue +11 -0
- package/src/views/monitor/details-diskspace.vue +56 -0
- package/src/views/monitor/details-gc.vue +93 -0
- package/src/views/monitor/details-memory.vue +143 -0
- package/src/views/monitor/details-process.vue +132 -0
- package/src/views/monitor/details-threads.vue +106 -0
- package/src/views/monitor/line-chart.vue +93 -0
- package/src/views/monitor/mem-chart.vue +22 -0
- package/src/views/monitor/panel.vue +90 -0
- package/src/views/monitor/performance.vue +36 -0
- package/src/views/monitor/threads-chart.vue +16 -0
- package/src/views/operation/backup.vue +593 -0
- package/src/views/operation/center.vue +420 -0
- package/src/views/operation/restore.vue +94 -0
- package/src/views/organization/organization.vue +366 -0
- package/src/views/role/role.vue +502 -0
- package/src/views/schedule/schedule.vue +338 -0
- package/src/views/schedule/scheduleLog.vue +40 -0
- package/src/views/sequence/sequence.vue +283 -0
- package/src/views/setting/setting.vue +371 -0
- package/src/visual/components/app/list/goods/double.vue +241 -0
- package/src/visual/components/app/list/nav/image.vue +135 -0
- package/src/visual/components/app/list/nav/text.vue +159 -0
- package/src/visual/components/button/index.vue +95 -0
- package/src/visual/components/container/index.vue +128 -0
- package/src/visual/components/data/index.vue +60 -0
- package/src/visual/components/data-table/index.vue +260 -0
- package/src/visual/components/echarts/annular.vue +173 -0
- package/src/visual/components/echarts/bar.vue +172 -0
- package/src/visual/components/echarts/funnel.vue +167 -0
- package/src/visual/components/echarts/gauge.vue +186 -0
- package/src/visual/components/echarts/line.vue +172 -0
- package/src/visual/components/echarts/map.vue +206 -0
- package/src/visual/components/echarts/pie.vue +158 -0
- package/src/visual/components/echarts/radar.vue +196 -0
- package/src/visual/components/echarts/scatter.vue +153 -0
- package/src/visual/components/edit-table/index.vue +71 -0
- package/src/visual/components/form/affix.vue +440 -0
- package/src/visual/components/form/area.vue +134 -0
- package/src/visual/components/form/buttons.vue +120 -0
- package/src/visual/components/form/checkbox.vue +126 -0
- package/src/visual/components/form/date-range.vue +97 -0
- package/src/visual/components/form/date.vue +88 -0
- package/src/visual/components/form/datetime.vue +87 -0
- package/src/visual/components/form/employee-tree.vue +300 -0
- package/src/visual/components/form/employees-tree.vue +91 -0
- package/src/visual/components/form/image.vue +440 -0
- package/src/visual/components/form/index.vue +85 -0
- package/src/visual/components/form/input.vue +116 -0
- package/src/visual/components/form/item.vue +68 -0
- package/src/visual/components/form/number.vue +157 -0
- package/src/visual/components/form/organization-tree.vue +300 -0
- package/src/visual/components/form/password.vue +103 -0
- package/src/visual/components/form/radio.vue +122 -0
- package/src/visual/components/form/rate.vue +93 -0
- package/src/visual/components/form/region-tree.vue +300 -0
- package/src/visual/components/form/rich-editor.vue +114 -0
- package/src/visual/components/form/select.vue +172 -0
- package/src/visual/components/form/switch.vue +105 -0
- package/src/visual/components/form/textarea.vue +91 -0
- package/src/visual/components/form/unit-tree.vue +300 -0
- package/src/visual/components/icon/index.vue +73 -0
- package/src/visual/components/image/index.vue +445 -0
- package/src/visual/components/index.js +26 -0
- package/src/visual/components/list/block.vue +234 -0
- package/src/visual/components/list/button.vue +123 -0
- package/src/visual/components/list/card.vue +129 -0
- package/src/visual/components/list/custom.vue +214 -0
- package/src/visual/components/list/image.vue +182 -0
- package/src/visual/components/list/news.vue +174 -0
- package/src/visual/components/page-comp/index.vue +67 -0
- package/src/visual/components/portal-menu/index.vue +191 -0
- package/src/visual/components/qrcode/index.vue +98 -0
- package/src/visual/components/router-view/index.vue +51 -0
- package/src/visual/components/row/index.vue +175 -0
- package/src/visual/components/search/index.vue +96 -0
- package/src/visual/components/tabs/index.vue +103 -0
- package/src/visual/components/text/index.vue +111 -0
- package/src/visual/components/video/index.vue +93 -0
- package/src/visual/js/echarts.js +220 -0
- package/src/visual/js/event.js +476 -0
- package/src/visual/js/visual-comp.js +48 -0
- package/src/visual/js/visual.js +508 -0
- package/src/visual/view/page.vue +357 -0
|
@@ -0,0 +1,1606 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="!initializing"
|
|
4
|
+
ref="tableBox"
|
|
5
|
+
:class="[
|
|
6
|
+
'cc-table cc-flex-column',
|
|
7
|
+
tableFullscreen ? 'padding-10' : '',
|
|
8
|
+
props.autoHeight === '1' ? 'cc-grow-height' : ''
|
|
9
|
+
]"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
v-if="tipsTopHtml"
|
|
13
|
+
class="cc-table-tips-top"
|
|
14
|
+
v-html="tipsTopHtml"
|
|
15
|
+
></div>
|
|
16
|
+
<div
|
|
17
|
+
v-if="tableInfo.showFull === '1' || tableInfo.showHeaderSetting === '1'"
|
|
18
|
+
class="show-table-fullscreen"
|
|
19
|
+
>
|
|
20
|
+
<cc-icon
|
|
21
|
+
v-if="tableInfo.showHeaderSetting === '1'"
|
|
22
|
+
iconId="018ece4f712124866f78"
|
|
23
|
+
title="显示字段设置"
|
|
24
|
+
style="color: var(--table-setting-icon-color);"
|
|
25
|
+
@click="showHeaderSetting"
|
|
26
|
+
/>
|
|
27
|
+
<cc-icon
|
|
28
|
+
v-if="tableInfo.showFull === '1'"
|
|
29
|
+
style="margin-left: 8px;color: var(--table-fullscreen-icon-color);"
|
|
30
|
+
iconId="018dca8cad1b28075ecd"
|
|
31
|
+
title="最大化显示"
|
|
32
|
+
@click="showFullscreen"
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
<el-table
|
|
36
|
+
ref="dataTable"
|
|
37
|
+
v-loading="querying"
|
|
38
|
+
element-loading-text="数据加载中..."
|
|
39
|
+
width="100%"
|
|
40
|
+
:style="{'user-select': isDragger ? 'none' : ''}"
|
|
41
|
+
highlight-current-row
|
|
42
|
+
:show-header="tableInfo.showHeader === '1'"
|
|
43
|
+
:data="dataList"
|
|
44
|
+
:border="tableInfo.showBorder === '1'"
|
|
45
|
+
:stripe="true"
|
|
46
|
+
:show-overflow-tooltip="true"
|
|
47
|
+
:row-class-name="rowClassName"
|
|
48
|
+
:class="['cc-table', props.autoHeight === '1' ? 'cc-grow-height' : '']"
|
|
49
|
+
:row-key="pkFieldName"
|
|
50
|
+
:span-method="colspan ? colspanMethod : null"
|
|
51
|
+
:show-summary="showSummary"
|
|
52
|
+
:summary-method="getSummaries"
|
|
53
|
+
@sort-change="sortChange"
|
|
54
|
+
@row-click="rowClick"
|
|
55
|
+
@row-dblclick="rowDbClick"
|
|
56
|
+
@selection-change="selectionChange"
|
|
57
|
+
@keydown="handleKeyDown"
|
|
58
|
+
@mousedown="handleMouseDown"
|
|
59
|
+
@mousemove="handleMouseMove"
|
|
60
|
+
@mouseup="handleMouseUp"
|
|
61
|
+
>
|
|
62
|
+
<template #empty>
|
|
63
|
+
<div class="el-table__empty-block">
|
|
64
|
+
<img v-if="!querying" src="@/assets/images/no-data.png" style="width: 100px" alt />
|
|
65
|
+
<span v-if="!querying" style="min-width: 100px">暂无数据</span>
|
|
66
|
+
</div>
|
|
67
|
+
</template>
|
|
68
|
+
<el-table-column
|
|
69
|
+
v-if="tableInfo.showCheckbox === '1'"
|
|
70
|
+
header-align="center"
|
|
71
|
+
align="center"
|
|
72
|
+
type="selection"
|
|
73
|
+
:reserve-selection="pageSelected === '1'"
|
|
74
|
+
width="40"
|
|
75
|
+
:show-overflow-tooltip="false"
|
|
76
|
+
></el-table-column>
|
|
77
|
+
<el-table-column
|
|
78
|
+
v-if="tableInfo.showOrdinal === '1'"
|
|
79
|
+
header-align="center"
|
|
80
|
+
align="center"
|
|
81
|
+
type="index"
|
|
82
|
+
width="50"
|
|
83
|
+
label="序号"
|
|
84
|
+
:show-overflow-tooltip="false"
|
|
85
|
+
></el-table-column>
|
|
86
|
+
<el-table-column
|
|
87
|
+
v-for="column in columnList"
|
|
88
|
+
:key="column.id"
|
|
89
|
+
:header-align="align[column.headerAlign] || 'center'"
|
|
90
|
+
:align="align[column.contentAlign] || 'center'"
|
|
91
|
+
:prop="column.fieldName"
|
|
92
|
+
:label="column.aliasName"
|
|
93
|
+
:width="column.width && column.width < 0 ? null : column.width"
|
|
94
|
+
:min-width="column.width && column.width < 0 ? column.width * -1 : null"
|
|
95
|
+
:class-name="column.wrap === '1' ? 'wrap' : 'nowrap'"
|
|
96
|
+
:sortable="column.sortable == null ? 'custom' : column.sortable"
|
|
97
|
+
:fixed="column.fixed === '1' ? true : null"
|
|
98
|
+
:show-overflow-tooltip="(column.canEdit === '1'
|
|
99
|
+
&& (column.fieldType === '字符'
|
|
100
|
+
|| column.fieldType === '整数'
|
|
101
|
+
|| column.fieldType === '小数'
|
|
102
|
+
|| column.fieldType === '日期'
|
|
103
|
+
|| column.fieldType === '联动')) ? false :
|
|
104
|
+
{
|
|
105
|
+
'effect': 'light',
|
|
106
|
+
'raw-content': false,
|
|
107
|
+
'placement': 'bottom',
|
|
108
|
+
'popper-class': 'padding-10-15'
|
|
109
|
+
}"
|
|
110
|
+
>
|
|
111
|
+
<template
|
|
112
|
+
v-if="column.canEdit === '1'
|
|
113
|
+
&& (column.fieldType === '字符'
|
|
114
|
+
|| column.fieldType === '整数'
|
|
115
|
+
|| column.fieldType === '小数'
|
|
116
|
+
|| column.fieldType === '日期'
|
|
117
|
+
|| column.fieldType === '联动')"
|
|
118
|
+
v-slot="scope"
|
|
119
|
+
>
|
|
120
|
+
<table-edit-item
|
|
121
|
+
:column="column"
|
|
122
|
+
:single="true"
|
|
123
|
+
:data="scope.row"
|
|
124
|
+
@change="() => changeValue(column.fieldName, scope.row)"
|
|
125
|
+
/>
|
|
126
|
+
</template>
|
|
127
|
+
<template v-else v-slot="scope">
|
|
128
|
+
<!-- 字符、整数、小数、日期、时间、图片、视频、附件 -->
|
|
129
|
+
<cc-icon
|
|
130
|
+
v-if="column.showRelevanceIcon === '1'
|
|
131
|
+
&& (scope.row[column.fieldName] || scope.row[column.fieldName + '_name'])"
|
|
132
|
+
style="margin-right: 5px;font-size: 14px;flex-shrink: 0;"
|
|
133
|
+
iconId="018ece4f6f023fdc6614"
|
|
134
|
+
class="relevance"
|
|
135
|
+
/>
|
|
136
|
+
<div
|
|
137
|
+
v-if="column.fieldType === '图片' && scope.row[column.fieldName]"
|
|
138
|
+
style="display: flex;max-width: 30px;max-height: 30px;"
|
|
139
|
+
>
|
|
140
|
+
<el-image
|
|
141
|
+
style="max-width: 100%;max-height: 100%"
|
|
142
|
+
preview-teleported
|
|
143
|
+
hide-on-click-modal
|
|
144
|
+
:src="imageUrl + scope.row[column.fieldName]"
|
|
145
|
+
:preview-src-list="[imageUrl + scope.row[column.fieldName]]"
|
|
146
|
+
fit="scale-down"
|
|
147
|
+
/>
|
|
148
|
+
</div>
|
|
149
|
+
<cc-video-view
|
|
150
|
+
v-else-if="column.fieldType === '视频' && scope.row[column.fieldName]"
|
|
151
|
+
:videoId="scope.row[column.fieldName]"
|
|
152
|
+
/>
|
|
153
|
+
<cc-affix-view
|
|
154
|
+
v-else-if="column.fieldType === '附件' && scope.row[column.fieldName]"
|
|
155
|
+
:affixId="scope.row[column.fieldName]"
|
|
156
|
+
:reload="changePage"
|
|
157
|
+
/>
|
|
158
|
+
<span
|
|
159
|
+
v-else-if="column.fieldType === '小数'"
|
|
160
|
+
>
|
|
161
|
+
{{
|
|
162
|
+
scope.row[column.fieldName] === 0 || scope.row[column.fieldName]
|
|
163
|
+
? tool.formatMoney(parseFloat(scope.row[column.fieldName] || '0'), column.dataField.fieldPrecision) : ''
|
|
164
|
+
}}
|
|
165
|
+
</span>
|
|
166
|
+
<span
|
|
167
|
+
v-else-if="column.fieldType === '时间'"
|
|
168
|
+
:class="['overflow-ellipsis', column.pageId ? 'relevance' : '']"
|
|
169
|
+
@click="() => relevanceClick(column, scope.row)"
|
|
170
|
+
>{{date.formatLongDate(scope.row[column.fieldName])}}</span>
|
|
171
|
+
<span
|
|
172
|
+
v-else-if="column.fieldType === '字符'
|
|
173
|
+
&& (column.dataField.enumerateType === '单位多选'
|
|
174
|
+
|| column.dataField.enumerateType === '企业多选'
|
|
175
|
+
|| column.dataField.enumerateType === '部门多选')"
|
|
176
|
+
class="overflow-ellipsis"
|
|
177
|
+
><cc-show-organizations :ids="scope.row[column.fieldName]" /></span>
|
|
178
|
+
<span
|
|
179
|
+
v-else-if="column.fieldType === '字符' && column.dataField.enumerateType === '人员多选'"
|
|
180
|
+
class="overflow-ellipsis"
|
|
181
|
+
><cc-show-employees :ids="scope.row[column.fieldName]" /></span>
|
|
182
|
+
<span
|
|
183
|
+
v-else-if="column.fieldType === '字符' && column.dataField.enumerateType === '角色多选'"
|
|
184
|
+
class="overflow-ellipsis"
|
|
185
|
+
><cc-show-roles :ids="scope.row[column.fieldName]" /></span>
|
|
186
|
+
<span
|
|
187
|
+
v-else-if="column.fieldType === '联动' && column.dataField.relevanceType.startsWith('字典')"
|
|
188
|
+
class="overflow-ellipsis"
|
|
189
|
+
><cc-show-dict :dictCode="column.dataField.relevanceDict" :dictValue="scope.row[column.fieldName]" /></span>
|
|
190
|
+
<span
|
|
191
|
+
v-else-if="column.styleList && column.styleList.length > 0"
|
|
192
|
+
:class="['overflow-ellipsis custom-style', column.pageId ? 'relevance' : '']"
|
|
193
|
+
@click="() => relevanceClick(column, scope.row)"
|
|
194
|
+
v-html="parseFieldStyle(
|
|
195
|
+
column.styleList,
|
|
196
|
+
scope.row[column.fieldType === '联动' ? (column.fieldName + '_name') : column.fieldName],
|
|
197
|
+
scope.row
|
|
198
|
+
)"
|
|
199
|
+
></span>
|
|
200
|
+
<span
|
|
201
|
+
v-else
|
|
202
|
+
:class="['overflow-ellipsis', column.pageId ? 'relevance' : '']"
|
|
203
|
+
@click="() => relevanceClick(column, scope.row)"
|
|
204
|
+
:style="column.contentColor ? ('color: ' + column.contentColor) : ''"
|
|
205
|
+
>{{scope.row[column.fieldType === '联动' ? (column.fieldName + '_name') : column.fieldName]}}</span>
|
|
206
|
+
</template>
|
|
207
|
+
</el-table-column>
|
|
208
|
+
<el-table-column
|
|
209
|
+
v-if="tableInfo.showOperate === '1' && buttonList.length > 0"
|
|
210
|
+
header-align="center"
|
|
211
|
+
align="center"
|
|
212
|
+
label="操作"
|
|
213
|
+
fixed="right"
|
|
214
|
+
:width="buttonList.length * 38 + 30"
|
|
215
|
+
:show-overflow-tooltip="false"
|
|
216
|
+
>
|
|
217
|
+
<template v-slot="scope">
|
|
218
|
+
<div class="cc-button">
|
|
219
|
+
<div
|
|
220
|
+
class="cc-button-item"
|
|
221
|
+
v-for="(button, index) in buttonList.filter(item => checkButtonShow(item, scope.row, dataFieldList))"
|
|
222
|
+
:key="index"
|
|
223
|
+
>
|
|
224
|
+
<el-tooltip
|
|
225
|
+
placement="bottom"
|
|
226
|
+
:enterable="false"
|
|
227
|
+
:show-after="0"
|
|
228
|
+
:hide-after="0"
|
|
229
|
+
:content="button.name"
|
|
230
|
+
popper-class="padding-10-15"
|
|
231
|
+
effect="light"
|
|
232
|
+
>
|
|
233
|
+
<el-button
|
|
234
|
+
circle
|
|
235
|
+
:style="{
|
|
236
|
+
'color': button.fontColor,
|
|
237
|
+
'background-color': button.backgroundColor,
|
|
238
|
+
'border': '1px solid ' + button.borderColor
|
|
239
|
+
}"
|
|
240
|
+
@click.stop="buttonClick(button, scope.row)"
|
|
241
|
+
>
|
|
242
|
+
<cc-icon
|
|
243
|
+
:iconId="button.iconId"
|
|
244
|
+
:color="button.fontColor"
|
|
245
|
+
/>
|
|
246
|
+
</el-button>
|
|
247
|
+
</el-tooltip>
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
</template>
|
|
251
|
+
</el-table-column>
|
|
252
|
+
<template v-if="$slots.append" #append>
|
|
253
|
+
<slot name="append"></slot>
|
|
254
|
+
</template>
|
|
255
|
+
</el-table>
|
|
256
|
+
<div class="cc-table-footer">
|
|
257
|
+
<div class="cc-table-refresh">
|
|
258
|
+
<el-checkbox
|
|
259
|
+
v-if="!dialogMode && showRefresh === '1'"
|
|
260
|
+
v-model="autoRefresh"
|
|
261
|
+
@change="changeAutoRefresh"
|
|
262
|
+
style="margin-right: 10px;"
|
|
263
|
+
>
|
|
264
|
+
<el-tooltip
|
|
265
|
+
effect="light"
|
|
266
|
+
popper-class="padding-10-15"
|
|
267
|
+
content="勾选自动刷新时,如有数据更新时自动刷新表格数据"
|
|
268
|
+
:enterable="false"
|
|
269
|
+
>自动刷新</el-tooltip>
|
|
270
|
+
</el-checkbox>
|
|
271
|
+
<el-checkbox
|
|
272
|
+
v-model="isDragger"
|
|
273
|
+
style="margin-right: 10px;"
|
|
274
|
+
>
|
|
275
|
+
<el-tooltip
|
|
276
|
+
effect="light"
|
|
277
|
+
popper-class="padding-10-15"
|
|
278
|
+
content="拖动模式下,在表格中按住鼠标左键,可左右拖动表格,拖动模型下无法选中内容。"
|
|
279
|
+
:enterable="false"
|
|
280
|
+
>拖动模式</el-tooltip>
|
|
281
|
+
</el-checkbox>
|
|
282
|
+
<span v-if="pageSelected === '1'">已选数据:
|
|
283
|
+
<span style="cursor: pointer" @click="showSelected">{{selectedCnt}}</span> 条
|
|
284
|
+
</span>
|
|
285
|
+
</div>
|
|
286
|
+
<div v-if="tableInfo.showPagination === '1'" class="cc-pagination">
|
|
287
|
+
<el-pagination
|
|
288
|
+
layout="total, prev, pager, next, jumper, sizes"
|
|
289
|
+
:current-page="queryInfo.pageNumber"
|
|
290
|
+
:page-sizes="[10, 20, 50, 100, 500]"
|
|
291
|
+
:page-size="queryInfo.pageSize"
|
|
292
|
+
:total="dataTotal"
|
|
293
|
+
@current-change="(pageNumber) => queryTableData(true, pageNumber)"
|
|
294
|
+
@size-change="handleSizeChange"
|
|
295
|
+
/>
|
|
296
|
+
</div>
|
|
297
|
+
</div>
|
|
298
|
+
<div
|
|
299
|
+
v-if="tipsBottomHtml"
|
|
300
|
+
class="cc-table-tips-bottom"
|
|
301
|
+
v-html="tipsBottomHtml"
|
|
302
|
+
></div>
|
|
303
|
+
|
|
304
|
+
<el-dialog
|
|
305
|
+
v-model="dialogVisible"
|
|
306
|
+
:width="dialogWidth"
|
|
307
|
+
:close-on-click-modal="false"
|
|
308
|
+
:fullscreen="dialogFullscreen"
|
|
309
|
+
:before-close="closeDialog"
|
|
310
|
+
@close="dialogClose"
|
|
311
|
+
class="cc-page-comp-dialog no-padding"
|
|
312
|
+
append-to-body
|
|
313
|
+
destroy-on-close
|
|
314
|
+
draggable
|
|
315
|
+
>
|
|
316
|
+
<template #header>
|
|
317
|
+
<div class="header" @dblclick="dialogFullscreen=!dialogFullscreen">
|
|
318
|
+
<div class="title">{{dialogTitle}}</div>
|
|
319
|
+
<div class="button">
|
|
320
|
+
<cc-icon
|
|
321
|
+
v-if="!dialogFullscreen"
|
|
322
|
+
iconId="018dca8cad1b28075ecd"
|
|
323
|
+
@click="dialogFullscreen=true"
|
|
324
|
+
title="最大化"
|
|
325
|
+
/>
|
|
326
|
+
<cc-icon
|
|
327
|
+
v-if="dialogFullscreen"
|
|
328
|
+
iconId="018dca8cad1b9b03c47f"
|
|
329
|
+
@click="dialogFullscreen=false"
|
|
330
|
+
title="缩小"
|
|
331
|
+
/>
|
|
332
|
+
</div>
|
|
333
|
+
</div>
|
|
334
|
+
</template>
|
|
335
|
+
<Page
|
|
336
|
+
:dataPageId="dialogPageId"
|
|
337
|
+
:inputParam="dialogInputParam"
|
|
338
|
+
:disabled="true"
|
|
339
|
+
:dialogMode="true"
|
|
340
|
+
@updatePageName="name => dialogTitle = (name || '页面展示').split('_')[0]"
|
|
341
|
+
@showDialogButton="showDialogButton"
|
|
342
|
+
/>
|
|
343
|
+
<template #footer v-if="dialogFooter">
|
|
344
|
+
<el-button
|
|
345
|
+
size="default"
|
|
346
|
+
type="info"
|
|
347
|
+
@click="dialogVisible = false"
|
|
348
|
+
>关闭</el-button>
|
|
349
|
+
<el-button
|
|
350
|
+
v-for="(button, index) in dialogButtonList"
|
|
351
|
+
:key="index"
|
|
352
|
+
size="default"
|
|
353
|
+
class="base-button"
|
|
354
|
+
:type="button.type || 'primary'"
|
|
355
|
+
:style="button.color ? {
|
|
356
|
+
'color': 'white',
|
|
357
|
+
'background-color': button.color,
|
|
358
|
+
'border': '1px solid ' + button.color
|
|
359
|
+
} : {}"
|
|
360
|
+
:loading="button.loading"
|
|
361
|
+
@click="clickButton(button)"
|
|
362
|
+
>{{button.name}}</el-button>
|
|
363
|
+
</template>
|
|
364
|
+
</el-dialog>
|
|
365
|
+
|
|
366
|
+
<el-dialog
|
|
367
|
+
v-model="selectedVisible"
|
|
368
|
+
:close-on-click-modal="false"
|
|
369
|
+
:before-close="closeDialog"
|
|
370
|
+
class="cc-page-comp-dialog no-padding"
|
|
371
|
+
append-to-body
|
|
372
|
+
destroy-on-close
|
|
373
|
+
fullscreen
|
|
374
|
+
draggable
|
|
375
|
+
>
|
|
376
|
+
<template #header>
|
|
377
|
+
<div class="header">
|
|
378
|
+
<div class="title">已选数据</div>
|
|
379
|
+
</div>
|
|
380
|
+
</template>
|
|
381
|
+
<div class="cc-page">
|
|
382
|
+
<el-table
|
|
383
|
+
width="100%"
|
|
384
|
+
:data="selectedList"
|
|
385
|
+
:border="true"
|
|
386
|
+
:stripe="true"
|
|
387
|
+
:show-overflow-tooltip="true"
|
|
388
|
+
>
|
|
389
|
+
<template #empty>
|
|
390
|
+
<div class="el-table__empty-block">
|
|
391
|
+
<span style="min-width: 100px">未选数据</span>
|
|
392
|
+
</div>
|
|
393
|
+
</template>
|
|
394
|
+
<el-table-column
|
|
395
|
+
v-for="column in columnList"
|
|
396
|
+
:key="column.id"
|
|
397
|
+
:header-align="align[column.headerAlign] || 'center'"
|
|
398
|
+
:align="align[column.contentAlign] || 'center'"
|
|
399
|
+
:prop="column.fieldName"
|
|
400
|
+
:label="column.aliasName"
|
|
401
|
+
:width="column.width && column.width < 0 ? null : column.width"
|
|
402
|
+
:min-width="column.width && column.width < 0 ? column.width * -1 : null"
|
|
403
|
+
:sortable="false"
|
|
404
|
+
:fixed="column.fixed === '1' ? true : null"
|
|
405
|
+
:show-overflow-tooltip="(column.canEdit === '1'
|
|
406
|
+
&& (column.fieldType === '字符'
|
|
407
|
+
|| column.fieldType === '整数'
|
|
408
|
+
|| column.fieldType === '小数'
|
|
409
|
+
|| column.fieldType === '日期'
|
|
410
|
+
|| column.fieldType === '联动')) ? false :
|
|
411
|
+
{
|
|
412
|
+
'effect': 'light',
|
|
413
|
+
'raw-content': false,
|
|
414
|
+
'placement': 'bottom',
|
|
415
|
+
'popper-class': 'padding-10-15'
|
|
416
|
+
}"
|
|
417
|
+
>
|
|
418
|
+
<template v-slot="scope">
|
|
419
|
+
<!-- 字符、整数、小数、日期、时间、图片、视频、附件 -->
|
|
420
|
+
<el-image
|
|
421
|
+
v-if="column.fieldType === '图片' && scope.row[column.fieldName]"
|
|
422
|
+
style="display: inline-table"
|
|
423
|
+
preview-teleported
|
|
424
|
+
hide-on-click-modal
|
|
425
|
+
:src="imageUrl + scope.row[column.fieldName]"
|
|
426
|
+
:preview-src-list="[imageUrl + scope.row[column.fieldName]]"
|
|
427
|
+
fit="scale-down"
|
|
428
|
+
/>
|
|
429
|
+
<cc-video-view
|
|
430
|
+
v-else-if="column.fieldType === '视频' && scope.row[column.fieldName]"
|
|
431
|
+
:videoId="scope.row[column.fieldName]"
|
|
432
|
+
/>
|
|
433
|
+
<cc-affix-view
|
|
434
|
+
v-else-if="column.fieldType === '附件' && scope.row[column.fieldName]"
|
|
435
|
+
:affixId="scope.row[column.fieldName]"
|
|
436
|
+
:reload="changePage"
|
|
437
|
+
/>
|
|
438
|
+
<span
|
|
439
|
+
v-else-if="column.fieldType === '小数'"
|
|
440
|
+
>
|
|
441
|
+
{{
|
|
442
|
+
scope.row[column.fieldName] === 0 || scope.row[column.fieldName]
|
|
443
|
+
? tool.formatMoney(parseFloat(scope.row[column.fieldName] || '0'), column.dataField.fieldPrecision) : ''
|
|
444
|
+
}}
|
|
445
|
+
</span>
|
|
446
|
+
<span
|
|
447
|
+
v-else-if="column.fieldType === '时间'"
|
|
448
|
+
:class="['overflow-ellipsis', column.pageId ? 'relevance' : '']"
|
|
449
|
+
@click="() => relevanceClick(column, scope.row)"
|
|
450
|
+
>{{date.formatLongDate(scope.row[column.fieldName])}}</span>
|
|
451
|
+
<span
|
|
452
|
+
v-else-if="column.fieldType === '字符'
|
|
453
|
+
&& (column.dataField.enumerateType === '单位多选'
|
|
454
|
+
|| column.dataField.enumerateType === '企业多选'
|
|
455
|
+
|| column.dataField.enumerateType === '部门多选')"
|
|
456
|
+
class="overflow-ellipsis"
|
|
457
|
+
><cc-show-organizations :ids="scope.row[column.fieldName]" /></span>
|
|
458
|
+
<span
|
|
459
|
+
v-else-if="column.fieldType === '字符' && column.dataField.enumerateType === '人员多选'"
|
|
460
|
+
class="overflow-ellipsis"
|
|
461
|
+
><cc-show-employees :ids="scope.row[column.fieldName]" /></span>
|
|
462
|
+
<span
|
|
463
|
+
v-else-if="column.fieldType === '字符' && column.dataField.enumerateType === '角色多选'"
|
|
464
|
+
class="overflow-ellipsis"
|
|
465
|
+
><cc-show-roles :ids="scope.row[column.fieldName]" /></span>
|
|
466
|
+
<span
|
|
467
|
+
v-else-if="column.fieldType === '联动' && column.dataField.relevanceType.startsWith('字典')"
|
|
468
|
+
class="overflow-ellipsis"
|
|
469
|
+
><cc-show-dict :dictCode="column.dataField.relevanceDict" :dictValue="scope.row[column.fieldName]" /></span>
|
|
470
|
+
<span
|
|
471
|
+
v-else-if="column.styleList && column.styleList.length > 0"
|
|
472
|
+
:class="['overflow-ellipsis custom-style', column.pageId ? 'relevance' : '']"
|
|
473
|
+
@click="() => relevanceClick(column, scope.row)"
|
|
474
|
+
v-html="parseFieldStyle(
|
|
475
|
+
column.styleList,
|
|
476
|
+
scope.row[column.fieldType === '联动' ? (column.fieldName + '_name') : column.fieldName],
|
|
477
|
+
scope.row
|
|
478
|
+
)"
|
|
479
|
+
></span>
|
|
480
|
+
<span
|
|
481
|
+
v-else
|
|
482
|
+
:class="['overflow-ellipsis', column.pageId ? 'relevance' : '']"
|
|
483
|
+
@click="() => relevanceClick(column, scope.row)"
|
|
484
|
+
:style="column.contentColor ? ('color: ' + column.contentColor) : ''"
|
|
485
|
+
>{{scope.row[column.fieldType === '联动' ? (column.fieldName + '_name') : column.fieldName]}}</span>
|
|
486
|
+
</template>
|
|
487
|
+
</el-table-column>
|
|
488
|
+
</el-table>
|
|
489
|
+
</div>
|
|
490
|
+
<template #footer>
|
|
491
|
+
<el-button
|
|
492
|
+
size="default"
|
|
493
|
+
type="info"
|
|
494
|
+
@click="selectedVisible = false"
|
|
495
|
+
>关闭</el-button>
|
|
496
|
+
</template>
|
|
497
|
+
</el-dialog>
|
|
498
|
+
|
|
499
|
+
<el-dialog
|
|
500
|
+
v-model="showFieldVisible"
|
|
501
|
+
width="650px"
|
|
502
|
+
class="cc-page-comp-dialog no-padding"
|
|
503
|
+
append-to-body
|
|
504
|
+
destroy-on-close
|
|
505
|
+
draggable
|
|
506
|
+
>
|
|
507
|
+
<template #header>
|
|
508
|
+
<div class="header">
|
|
509
|
+
<div class="title">显示字段设置</div>
|
|
510
|
+
</div>
|
|
511
|
+
</template>
|
|
512
|
+
<div class="cc-page cc-flex-column cc-grow-height">
|
|
513
|
+
<el-row>
|
|
514
|
+
<el-col :span="24" style="text-align: right;align-content: center;margin-bottom: 8px">
|
|
515
|
+
<el-button
|
|
516
|
+
v-if="!sortFieldInst"
|
|
517
|
+
type="primary"
|
|
518
|
+
@click="sortDataField"
|
|
519
|
+
>开启排序</el-button>
|
|
520
|
+
<el-button
|
|
521
|
+
v-else
|
|
522
|
+
type="info"
|
|
523
|
+
@click="unSortDataField"
|
|
524
|
+
>关闭排序</el-button>
|
|
525
|
+
<el-button
|
|
526
|
+
type="warning"
|
|
527
|
+
@click="resetField"
|
|
528
|
+
>恢复默认</el-button>
|
|
529
|
+
</el-col>
|
|
530
|
+
</el-row>
|
|
531
|
+
<el-table
|
|
532
|
+
ref="sortFieldTable"
|
|
533
|
+
:show-overflow-tooltip="false"
|
|
534
|
+
tooltip-effect="light"
|
|
535
|
+
class="field-table edit-table"
|
|
536
|
+
width="100%"
|
|
537
|
+
:data="editColumns"
|
|
538
|
+
row-key="id"
|
|
539
|
+
:border="true"
|
|
540
|
+
:stripe="false"
|
|
541
|
+
@row-click="fieldRowClick"
|
|
542
|
+
>
|
|
543
|
+
<el-table-column
|
|
544
|
+
type="selection"
|
|
545
|
+
width="50"
|
|
546
|
+
header-align="center"
|
|
547
|
+
align="center"
|
|
548
|
+
></el-table-column>
|
|
549
|
+
<el-table-column
|
|
550
|
+
header-align="center"
|
|
551
|
+
align="center"
|
|
552
|
+
label="字段名称"
|
|
553
|
+
:min-width="120"
|
|
554
|
+
prop="aliasName"
|
|
555
|
+
/>
|
|
556
|
+
<el-table-column
|
|
557
|
+
header-align="center"
|
|
558
|
+
label="列宽"
|
|
559
|
+
:width="120"
|
|
560
|
+
prop="width"
|
|
561
|
+
>
|
|
562
|
+
<template #header>
|
|
563
|
+
<el-tooltip>
|
|
564
|
+
<template #content>
|
|
565
|
+
<div>0时为自动宽度,负数时为最小宽度</div>
|
|
566
|
+
</template>
|
|
567
|
+
<span style="display: inline-flex">
|
|
568
|
+
<span style="margin-right: 5px">列宽</span>
|
|
569
|
+
<cc-icon iconId="018dca8ec9890493be26" />
|
|
570
|
+
</span>
|
|
571
|
+
</el-tooltip>
|
|
572
|
+
</template>
|
|
573
|
+
<template #default="scope">
|
|
574
|
+
<el-input-number v-model="scope.row.width" controls-position="right" :min="-1000" style="width: 100%"/>
|
|
575
|
+
</template>
|
|
576
|
+
</el-table-column>
|
|
577
|
+
<el-table-column
|
|
578
|
+
header-align="center"
|
|
579
|
+
align="center"
|
|
580
|
+
label="表头对齐方式"
|
|
581
|
+
width="110"
|
|
582
|
+
prop="headerAlign"
|
|
583
|
+
>
|
|
584
|
+
<template #default="scope">
|
|
585
|
+
<el-select v-model="scope.row.headerAlign">
|
|
586
|
+
<el-option label="居左" value="居左"></el-option>
|
|
587
|
+
<el-option label="居中" value="居中"></el-option>
|
|
588
|
+
<el-option label="居右" value="居右"></el-option>
|
|
589
|
+
</el-select>
|
|
590
|
+
</template>
|
|
591
|
+
</el-table-column>
|
|
592
|
+
<el-table-column
|
|
593
|
+
header-align="center"
|
|
594
|
+
align="center"
|
|
595
|
+
label="内容对齐方式"
|
|
596
|
+
width="110"
|
|
597
|
+
prop="contentAlign"
|
|
598
|
+
>
|
|
599
|
+
<template #default="scope">
|
|
600
|
+
<el-select v-model="scope.row.contentAlign">
|
|
601
|
+
<el-option label="居左" value="居左"></el-option>
|
|
602
|
+
<el-option label="居中" value="居中"></el-option>
|
|
603
|
+
<el-option label="居右" value="居右"></el-option>
|
|
604
|
+
</el-select>
|
|
605
|
+
</template>
|
|
606
|
+
</el-table-column>
|
|
607
|
+
</el-table>
|
|
608
|
+
</div>
|
|
609
|
+
<template #footer>
|
|
610
|
+
<el-button
|
|
611
|
+
size="default"
|
|
612
|
+
type="info"
|
|
613
|
+
@click="showFieldVisible = false"
|
|
614
|
+
>取消</el-button>
|
|
615
|
+
<el-button
|
|
616
|
+
size="default"
|
|
617
|
+
type="primary"
|
|
618
|
+
@click="saveShowField"
|
|
619
|
+
>确定</el-button>
|
|
620
|
+
</template>
|
|
621
|
+
</el-dialog>
|
|
622
|
+
</div>
|
|
623
|
+
</template>
|
|
624
|
+
|
|
625
|
+
<script setup>
|
|
626
|
+
import { h, ref, onMounted, nextTick, onUnmounted, markRaw, inject, computed } from 'vue';
|
|
627
|
+
import loading from '@/utils/loading';
|
|
628
|
+
import api from '@/http/api';
|
|
629
|
+
import tool from '@/utils/tool';
|
|
630
|
+
import Page from '@/codeless/view/page.vue';
|
|
631
|
+
import { ElMessage } from 'element-plus';
|
|
632
|
+
import TableEditItem from '@/codeless/view/table-edit-item.vue';
|
|
633
|
+
import { checkButtonShow } from '@/codeless/js/codeless';
|
|
634
|
+
import date from '@/utils/date';
|
|
635
|
+
import { useCache } from '@/utils/cache';
|
|
636
|
+
import emitter from '@/utils/bus';
|
|
637
|
+
import { useUserStore } from '@/pinia/modules/user';
|
|
638
|
+
import { getDataTable, getDataFieldList } from '@/utils/codeless';
|
|
639
|
+
import screenFull from 'screenfull';
|
|
640
|
+
import Sortable from 'sortablejs';
|
|
641
|
+
|
|
642
|
+
const emit = defineEmits(['buttonClick', 'editChange', 'showDetail', 'selectionChange']);
|
|
643
|
+
const props = defineProps({
|
|
644
|
+
pageCompId: String,
|
|
645
|
+
dataTableId: String,
|
|
646
|
+
dataFormId: String,
|
|
647
|
+
buttonList: Array,
|
|
648
|
+
pkFieldName: {
|
|
649
|
+
type: String,
|
|
650
|
+
default: 'id'
|
|
651
|
+
},
|
|
652
|
+
dataFieldList: Array,
|
|
653
|
+
autoHeight: String,
|
|
654
|
+
showRefresh: String,
|
|
655
|
+
pageSelected: {
|
|
656
|
+
type: String,
|
|
657
|
+
default: '0'
|
|
658
|
+
},
|
|
659
|
+
defaultQuery: Object,
|
|
660
|
+
inputParam: {
|
|
661
|
+
type: Object,
|
|
662
|
+
default: () => {}
|
|
663
|
+
},
|
|
664
|
+
inputParamList: {
|
|
665
|
+
type: Object,
|
|
666
|
+
default: () => {}
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
|
|
670
|
+
const initializing = ref(true);
|
|
671
|
+
const userStore = useUserStore();
|
|
672
|
+
const imageUrl = ref(import.meta.env.VITE_IMAGE_PATH);
|
|
673
|
+
const queryInfo = ref({
|
|
674
|
+
inputParamList: props.inputParamList || {},
|
|
675
|
+
pageNumber: 1,
|
|
676
|
+
pageSize: 20
|
|
677
|
+
});
|
|
678
|
+
const queryData = ref({});
|
|
679
|
+
const querying = ref(false);
|
|
680
|
+
const changePage = ref(false);
|
|
681
|
+
const tableBox = ref();
|
|
682
|
+
const dataTable = ref();
|
|
683
|
+
const dataTotal = ref(0);
|
|
684
|
+
const dataList = ref([]);
|
|
685
|
+
const colspan = ref(false);
|
|
686
|
+
const colspanField = ref([]);
|
|
687
|
+
const colspanList = ref([]);
|
|
688
|
+
const showSummary = ref(false);
|
|
689
|
+
const summaryFieldId = ref('');
|
|
690
|
+
const summaryName = ref('合计');
|
|
691
|
+
const summaryFieldIds = ref([]);
|
|
692
|
+
const dataFieldList = ref([]);
|
|
693
|
+
|
|
694
|
+
const tableInfo = ref({});
|
|
695
|
+
const allColumnList = ref({});
|
|
696
|
+
const columnList = ref({});
|
|
697
|
+
const showColumns = ref([]);
|
|
698
|
+
const buttonList = ref({});
|
|
699
|
+
const tipsTopHtml = ref('');
|
|
700
|
+
const tipsBottomHtml = ref('');
|
|
701
|
+
const align = ref({ 居左: 'left', 居中: 'center', 居右: 'right' });
|
|
702
|
+
|
|
703
|
+
const dialogTitle = ref('');
|
|
704
|
+
const dialogWidth = ref('');
|
|
705
|
+
const dialogFullscreen = ref(false);
|
|
706
|
+
const dialogFooter = ref(false);
|
|
707
|
+
const dialogField = ref({});
|
|
708
|
+
const dialogVisible = ref(false);
|
|
709
|
+
const dialogPageId = ref('');
|
|
710
|
+
const dialogInputParam = ref({});
|
|
711
|
+
const dialogMode = inject('dialogMode', props.dialogMode || false);
|
|
712
|
+
const dialogButtonList = ref([]);
|
|
713
|
+
const autoRefresh = ref(false);
|
|
714
|
+
const selectedVisible = ref(false);
|
|
715
|
+
const selectedList = ref([]);
|
|
716
|
+
const selectedRows = ref([]);
|
|
717
|
+
const showFieldVisible = ref(false);
|
|
718
|
+
const editColumns = ref([]);
|
|
719
|
+
|
|
720
|
+
const sortFieldTable = ref();
|
|
721
|
+
const sortFieldInst = ref();
|
|
722
|
+
const { wsCache } = useCache();
|
|
723
|
+
|
|
724
|
+
const buttonClick = (button, data) => {
|
|
725
|
+
emit('buttonClick', button, data)
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
const sortChange = (sort) => {
|
|
729
|
+
const field = columnList.value.find(item => item.id === sort.column.rawColumnKey);
|
|
730
|
+
const fieldName = field.fieldType === '联动' ? (field.fieldName + '_name') : field.fieldName;
|
|
731
|
+
if (sort.order === 'ascending') {
|
|
732
|
+
queryInfo.value.sortField = fieldName;
|
|
733
|
+
queryInfo.value.sortType = 'asc';
|
|
734
|
+
} else if (sort.order === 'descending') {
|
|
735
|
+
queryInfo.value.sortField = fieldName;
|
|
736
|
+
queryInfo.value.sortType = 'desc';
|
|
737
|
+
} else {
|
|
738
|
+
queryInfo.value.sortField = null;
|
|
739
|
+
queryInfo.value.sortType = null;
|
|
740
|
+
}
|
|
741
|
+
queryTableData(true, 1);
|
|
742
|
+
};
|
|
743
|
+
|
|
744
|
+
const relevanceClick = async(column, row) => {
|
|
745
|
+
const field = columnList.value.find(item => item.id === column.id);
|
|
746
|
+
if (!field ||
|
|
747
|
+
!field.pageId ||
|
|
748
|
+
typeof row[field.fieldName] === 'undefined' ||
|
|
749
|
+
row[field.fieldName] == null ||
|
|
750
|
+
row[field.fieldName] === '') return;
|
|
751
|
+
await showFieldPage(field, row);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
const showFieldPage = async(field, data) => {
|
|
755
|
+
const inputParam = {};
|
|
756
|
+
JSON.parse(field.pageFieldJson || '[]').forEach(param => {
|
|
757
|
+
if (param.fieldName && data[param.fieldName]) {
|
|
758
|
+
inputParam[param.pageParamId] = data[param.fieldName];
|
|
759
|
+
} else if (!param.fieldName && param.fieldId) {
|
|
760
|
+
inputParam[param.pageParamId] = param.fieldId;
|
|
761
|
+
inputParam[param.pageParamName] = param.fieldId;
|
|
762
|
+
}
|
|
763
|
+
});
|
|
764
|
+
if (field.openScriptId) {
|
|
765
|
+
loading.showLoading();
|
|
766
|
+
const param = { dataTableField: field, inputParam: inputParam };
|
|
767
|
+
const res = await api.runScript(field.openScriptId, param);
|
|
768
|
+
if (field.showExecuteResult === '1' && res.message) {
|
|
769
|
+
ElMessage.info(res.message);
|
|
770
|
+
}
|
|
771
|
+
loading.hideLoading();
|
|
772
|
+
}
|
|
773
|
+
dialogField.value = field;
|
|
774
|
+
dialogTitle.value = (field.pageName || '页面展示').split('_')[0];
|
|
775
|
+
dialogWidth.value = field.dialogWidth ? field.dialogWidth : '800px';
|
|
776
|
+
dialogFullscreen.value = field.fullscreenDialog === '1';
|
|
777
|
+
dialogPageId.value = field.pageId;
|
|
778
|
+
dialogFooter.value = field.showCloseButton === '1';
|
|
779
|
+
dialogInputParam.value = inputParam;
|
|
780
|
+
dialogVisible.value = true;
|
|
781
|
+
};
|
|
782
|
+
|
|
783
|
+
const showDialogButton = (buttonList) => {
|
|
784
|
+
dialogButtonList.value = buttonList;
|
|
785
|
+
};
|
|
786
|
+
|
|
787
|
+
const clickButton = (button) => {
|
|
788
|
+
button.loading = true;
|
|
789
|
+
try {
|
|
790
|
+
button.click();
|
|
791
|
+
} catch (e) {
|
|
792
|
+
console.log(e);
|
|
793
|
+
} finally {
|
|
794
|
+
button.loading = false;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
const showFullscreen = () => {
|
|
799
|
+
if (screenFull.isEnabled) {
|
|
800
|
+
screenFull.toggle(tableBox.value);
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
|
|
804
|
+
const tableFullscreen = ref(false);
|
|
805
|
+
const toggleTableFullscreen = () => {
|
|
806
|
+
if (screenFull.isFullscreen) {
|
|
807
|
+
if (document.fullscreenElement && document.fullscreenElement.id && document.fullscreenElement.id === tableBox.value.id) {
|
|
808
|
+
tableFullscreen.value = screenFull.isFullscreen;
|
|
809
|
+
}
|
|
810
|
+
} else {
|
|
811
|
+
tableFullscreen.value = false;
|
|
812
|
+
}
|
|
813
|
+
};
|
|
814
|
+
|
|
815
|
+
const showHeaderSetting = () => {
|
|
816
|
+
unSortDataField();
|
|
817
|
+
const list = tool.deepClone(allColumnList.value);
|
|
818
|
+
showFieldVisible.value = true;
|
|
819
|
+
editColumns.value = [];
|
|
820
|
+
if (!showColumns.value || showColumns.value.length === 0) {
|
|
821
|
+
editColumns.value = list;
|
|
822
|
+
editColumns.value.forEach(item => item.checked = true);
|
|
823
|
+
nextTick(() => {
|
|
824
|
+
sortFieldTable.value.toggleAllSelection();
|
|
825
|
+
});
|
|
826
|
+
} else {
|
|
827
|
+
showColumns.value.forEach(item => {
|
|
828
|
+
const column = list.find(field => field.id === item.id);
|
|
829
|
+
if (column) {
|
|
830
|
+
column.width = item.width;
|
|
831
|
+
column.headerAlign = item.headerAlign;
|
|
832
|
+
column.contentAlign = item.contentAlign;
|
|
833
|
+
column.checked = true;
|
|
834
|
+
editColumns.value.push(column);
|
|
835
|
+
}
|
|
836
|
+
});
|
|
837
|
+
list.forEach(field => {
|
|
838
|
+
if (!showColumns.value.find(column => column.id === field.id)) {
|
|
839
|
+
field.checked = false;
|
|
840
|
+
editColumns.value.push(field);
|
|
841
|
+
}
|
|
842
|
+
});
|
|
843
|
+
|
|
844
|
+
nextTick(() => {
|
|
845
|
+
editColumns.value.forEach(item => {
|
|
846
|
+
sortFieldTable.value.toggleRowSelection(item, item.checked === true);
|
|
847
|
+
});
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
};
|
|
851
|
+
|
|
852
|
+
const saveShowField = () => {
|
|
853
|
+
const key = getStoreKey();
|
|
854
|
+
const showFields = sortFieldTable.value.getSelectionRows();
|
|
855
|
+
if (showFields && showFields.length > 0) {
|
|
856
|
+
showColumns.value = showFields;
|
|
857
|
+
wsCache.set(key, JSON.stringify(showColumns.value));
|
|
858
|
+
} else {
|
|
859
|
+
showColumns.value = [];
|
|
860
|
+
wsCache.delete(key);
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
resolveShowColumn();
|
|
864
|
+
showFieldVisible.value = false;
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
const fieldRowClick = (row) => {
|
|
868
|
+
sortFieldTable.value.toggleRowSelection(row);
|
|
869
|
+
};
|
|
870
|
+
|
|
871
|
+
const getStoreKey = () => {
|
|
872
|
+
return (props.pageCompId || 'pcId') + '_' + (props.dataTableId || 'dtId');
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
const resolveShowColumn = () => {
|
|
876
|
+
if (!showColumns.value || showColumns.value.length === 0) {
|
|
877
|
+
columnList.value = allColumnList.value;
|
|
878
|
+
} else {
|
|
879
|
+
const list = [];
|
|
880
|
+
showColumns.value.forEach(item => {
|
|
881
|
+
const field = allColumnList.value.find(column => column.id === item.id);
|
|
882
|
+
field.width = item.width;
|
|
883
|
+
field.headerAlign = item.headerAlign;
|
|
884
|
+
field.contentAlign = item.contentAlign;
|
|
885
|
+
list.push(item);
|
|
886
|
+
});
|
|
887
|
+
columnList.value = list.length > 0 ? list : allColumnList.value;
|
|
888
|
+
}
|
|
889
|
+
};
|
|
890
|
+
|
|
891
|
+
const resetField = () => {
|
|
892
|
+
showColumns.value = [];
|
|
893
|
+
wsCache.delete(getStoreKey());
|
|
894
|
+
resolveShowColumn();
|
|
895
|
+
showFieldVisible.value = false;
|
|
896
|
+
};
|
|
897
|
+
|
|
898
|
+
const sortDataField = () => {
|
|
899
|
+
if (sortFieldInst.value) {
|
|
900
|
+
sortFieldInst.value.destroy();
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
if (sortFieldTable.value) {
|
|
904
|
+
const el = sortFieldTable.value.$el.querySelector('.el-table__body-wrapper tbody');
|
|
905
|
+
sortFieldInst.value = Sortable.create(el, {
|
|
906
|
+
handle: '.el-table__row',
|
|
907
|
+
onEnd: ({ newIndex, oldIndex }) => {
|
|
908
|
+
const list = tool.deepClone(editColumns.value);
|
|
909
|
+
const currRow = list.splice(oldIndex, 1)[0];
|
|
910
|
+
list.splice(newIndex, 0, currRow);
|
|
911
|
+
nextTick(() => {
|
|
912
|
+
editColumns.value = list;
|
|
913
|
+
|
|
914
|
+
nextTick(() => {
|
|
915
|
+
editColumns.value.forEach(item => {
|
|
916
|
+
sortFieldTable.value.toggleRowSelection(item, item.checked === true);
|
|
917
|
+
});
|
|
918
|
+
});
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
};
|
|
924
|
+
|
|
925
|
+
const unSortDataField = () => {
|
|
926
|
+
if (sortFieldInst.value) {
|
|
927
|
+
sortFieldInst.value.destroy();
|
|
928
|
+
}
|
|
929
|
+
sortFieldInst.value = null;
|
|
930
|
+
};
|
|
931
|
+
|
|
932
|
+
const closeDialog = (done) => {
|
|
933
|
+
const viewer = document.getElementsByClassName('el-image-viewer__wrapper')[0];
|
|
934
|
+
if (!viewer) {
|
|
935
|
+
done();
|
|
936
|
+
}
|
|
937
|
+
};
|
|
938
|
+
|
|
939
|
+
const dialogClose = () => {
|
|
940
|
+
if (dialogField.value) {
|
|
941
|
+
if (dialogField.value.closeRefresh === '1') {
|
|
942
|
+
refreshData();
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
if (dialogField.value.closeScriptId) {
|
|
946
|
+
const data = { dataTableField: dialogField.value, inputParam: dialogInputParam.value }
|
|
947
|
+
api.runScript(dialogField.value.closeScriptId, data).then(res => {
|
|
948
|
+
if (dialogField.value.showExecuteResult === '1' && res.message) {
|
|
949
|
+
ElMessage.info(res.message);
|
|
950
|
+
}
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
};
|
|
955
|
+
|
|
956
|
+
const rowClassName = ({ row }) => {
|
|
957
|
+
return selectedRows.value.find(item => item[props.pkFieldName] === row[props.pkFieldName]) ? 'is-selected' : '';
|
|
958
|
+
};
|
|
959
|
+
|
|
960
|
+
const rowClick = (row, column, event) => {
|
|
961
|
+
if (!(event.ctrlKey || event.metaKey)) {
|
|
962
|
+
dataTable.value.clearSelection();
|
|
963
|
+
}
|
|
964
|
+
dataTable.value.toggleRowSelection(row);
|
|
965
|
+
};
|
|
966
|
+
|
|
967
|
+
const rowDbClick = (row) => {
|
|
968
|
+
if (props.dataFormId) {
|
|
969
|
+
emit('showDetail', row);
|
|
970
|
+
} else {
|
|
971
|
+
const field = columnList.value.find(field => field.pageId && row[field.fieldName]);
|
|
972
|
+
if (field) showFieldPage(field, row);
|
|
973
|
+
}
|
|
974
|
+
};
|
|
975
|
+
|
|
976
|
+
const selectionChange = (selectionList) => {
|
|
977
|
+
selectedRows.value = selectionList;
|
|
978
|
+
emit('selectionChange', selectionList);
|
|
979
|
+
};
|
|
980
|
+
|
|
981
|
+
const handleSizeChange = (pageSize) => {
|
|
982
|
+
queryInfo.value.pageSize = pageSize
|
|
983
|
+
queryTableData(true, 1)
|
|
984
|
+
};
|
|
985
|
+
|
|
986
|
+
const queryTableData = (showLoading, pageNumber) => {
|
|
987
|
+
let url;
|
|
988
|
+
if (props.pageCompId) {
|
|
989
|
+
url = '/codeless/page-comp/' + props.pageCompId + '/page';
|
|
990
|
+
} else {
|
|
991
|
+
url = '/codeless/' + props.dataTableId + '/page';
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
if (typeof pageNumber !== 'undefined') {
|
|
995
|
+
queryInfo.value.pageNumber = pageNumber
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
querying.value = typeof showLoading === 'undefined' ? true : showLoading || false;
|
|
999
|
+
const data = Object.assign({}, queryData.value, queryInfo.value);
|
|
1000
|
+
api.post(url, data).then((res) => {
|
|
1001
|
+
dataTotal.value = res.totalRecord || 0;
|
|
1002
|
+
dataList.value = markRaw(res.data);
|
|
1003
|
+
queryInfo.value.pageSize = res.pageSize || queryInfo.value.pageSize;
|
|
1004
|
+
calcColspan(dataList.value);
|
|
1005
|
+
querying.value = false;
|
|
1006
|
+
changePage.value = !changePage.value;
|
|
1007
|
+
selectionChange([]);
|
|
1008
|
+
cleanRefreshData();
|
|
1009
|
+
}).catch(() => {
|
|
1010
|
+
querying.value = false
|
|
1011
|
+
});
|
|
1012
|
+
};
|
|
1013
|
+
|
|
1014
|
+
const loadData = async(tableId) => {
|
|
1015
|
+
loading.showLoading();
|
|
1016
|
+
try {
|
|
1017
|
+
await loadTableInfo(tableId);
|
|
1018
|
+
await loadDataField(tableInfo.value.modelId);
|
|
1019
|
+
await initTableData();
|
|
1020
|
+
await initQueryInfo();
|
|
1021
|
+
await initColumnList();
|
|
1022
|
+
await initButtonList();
|
|
1023
|
+
await initTips();
|
|
1024
|
+
loading.hideLoading();
|
|
1025
|
+
} finally {
|
|
1026
|
+
loading.hideLoading();
|
|
1027
|
+
}
|
|
1028
|
+
};
|
|
1029
|
+
|
|
1030
|
+
const initTips = async() => {
|
|
1031
|
+
if (tableInfo.value.tipsOrigin === '输入') {
|
|
1032
|
+
if (tableInfo.value.tipsPosition === '顶部') {
|
|
1033
|
+
tipsTopHtml.value = tableInfo.value.tipsHtml || {};
|
|
1034
|
+
} else {
|
|
1035
|
+
tipsBottomHtml.value = tableInfo.value.tipsHtml || {};
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
if (tableInfo.value.tipsOrigin === '脚本' && tableInfo.value.tipsScriptId) {
|
|
1040
|
+
const res = await api.runScript(tableInfo.value.tipsScriptId);
|
|
1041
|
+
if (tableInfo.value.tipsPosition === '顶部') {
|
|
1042
|
+
tipsTopHtml.value = res.data || '';
|
|
1043
|
+
} else {
|
|
1044
|
+
tipsBottomHtml.value = res.data || '';
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
};
|
|
1048
|
+
|
|
1049
|
+
const loadTableInfo = async(tableId) => {
|
|
1050
|
+
tableInfo.value = await getDataTable(tableId);
|
|
1051
|
+
|
|
1052
|
+
colspanList.value = [];
|
|
1053
|
+
colspanField.value = [];
|
|
1054
|
+
tableInfo.value.fieldList.forEach(field => {
|
|
1055
|
+
if (field.ifMerge === '1') {
|
|
1056
|
+
colspanField.value.push(field.fieldName);
|
|
1057
|
+
}
|
|
1058
|
+
});
|
|
1059
|
+
colspan.value = colspanField.value.length > 0;
|
|
1060
|
+
|
|
1061
|
+
if (tableInfo.value.totalJson && tableInfo.value.totalJson.startsWith('{')) {
|
|
1062
|
+
const json = JSON.parse(tableInfo.value.totalJson);
|
|
1063
|
+
summaryFieldId.value = json.summaryFieldId || '';
|
|
1064
|
+
summaryName.value = json.summaryName || '合计';
|
|
1065
|
+
summaryFieldIds.value = json.summaryFieldIds || [];
|
|
1066
|
+
showSummary.value = json.showSummary === '1' && summaryFieldIds.value.length > 0;
|
|
1067
|
+
} else {
|
|
1068
|
+
showSummary.value = false;
|
|
1069
|
+
summaryFieldIds.value = [];
|
|
1070
|
+
}
|
|
1071
|
+
};
|
|
1072
|
+
|
|
1073
|
+
const loadDataField = async(modelId) => {
|
|
1074
|
+
if (props.dataFieldList && props.dataFieldList.length > 0) {
|
|
1075
|
+
dataFieldList.value = props.dataFieldList;
|
|
1076
|
+
} else {
|
|
1077
|
+
dataFieldList.value = await getDataFieldList(modelId);
|
|
1078
|
+
}
|
|
1079
|
+
};
|
|
1080
|
+
|
|
1081
|
+
const colspanMethod = (data) => {
|
|
1082
|
+
const columnSpan = colspanList.value[data.column.property];
|
|
1083
|
+
return columnSpan && columnSpan[data.rowIndex] || [1, 1];
|
|
1084
|
+
};
|
|
1085
|
+
|
|
1086
|
+
const calcColspan = (dataList) => {
|
|
1087
|
+
if (!colspan.value || colspanField.value.length <= 0 || !dataList || dataList.length <= 0) return;
|
|
1088
|
+
|
|
1089
|
+
colspanList.value = [];
|
|
1090
|
+
colspanField.value.forEach((field, fieldIndex) => {
|
|
1091
|
+
let preValue = '';
|
|
1092
|
+
let sameIndex = 0;
|
|
1093
|
+
colspanList.value[field] = [];
|
|
1094
|
+
colspanList.value[field].push(new Array(dataList.length).fill([1, 1]));
|
|
1095
|
+
|
|
1096
|
+
dataList.forEach((data, rowIndex) => {
|
|
1097
|
+
const currValue = data[field] || '';
|
|
1098
|
+
if (currValue !== preValue) {
|
|
1099
|
+
sameIndex = 0;
|
|
1100
|
+
preValue = currValue;
|
|
1101
|
+
}
|
|
1102
|
+
sameIndex++;
|
|
1103
|
+
|
|
1104
|
+
let endIndex = -1;
|
|
1105
|
+
const preField = fieldIndex > 0 ? colspanField.value[fieldIndex - 1] : null;
|
|
1106
|
+
if (preField) {
|
|
1107
|
+
endIndex = getEndIndex(colspanList.value, preField, rowIndex);
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
if (sameIndex === 1 && (endIndex === -1 || endIndex > rowIndex)) {
|
|
1111
|
+
let rowCount = countRows(dataList, rowIndex, field, currValue);
|
|
1112
|
+
|
|
1113
|
+
if (endIndex > 0 && rowIndex + rowCount > endIndex) {
|
|
1114
|
+
preValue = undefined;
|
|
1115
|
+
rowCount = endIndex - rowIndex - 1;
|
|
1116
|
+
}
|
|
1117
|
+
colspanList.value[field][rowIndex] = [rowCount > 1 ? rowCount : 1, 1];
|
|
1118
|
+
} else {
|
|
1119
|
+
colspanList.value[field][rowIndex] = [0, 0];
|
|
1120
|
+
}
|
|
1121
|
+
});
|
|
1122
|
+
});
|
|
1123
|
+
};
|
|
1124
|
+
|
|
1125
|
+
const countRows = (dataList, startIndex, field, value) => {
|
|
1126
|
+
let count = 0;
|
|
1127
|
+
for (let i = startIndex; i < dataList.length; i++) {
|
|
1128
|
+
if ((dataList[i][field] || '') === value) {
|
|
1129
|
+
count++;
|
|
1130
|
+
} else {
|
|
1131
|
+
break;
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
return count;
|
|
1135
|
+
};
|
|
1136
|
+
|
|
1137
|
+
const getEndIndex = (colspanList, field, rowIndex) => {
|
|
1138
|
+
for (let i = rowIndex; i >= 0; i--) {
|
|
1139
|
+
const [rowCount] = colspanList[field][i] || [0, 0];
|
|
1140
|
+
if (rowCount > 0) {
|
|
1141
|
+
return i + rowCount;
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
return 0;
|
|
1145
|
+
};
|
|
1146
|
+
|
|
1147
|
+
const getSummaries = (param) => {
|
|
1148
|
+
if (summaryFieldIds.value.length === 0) return [];
|
|
1149
|
+
|
|
1150
|
+
const { columns, data } = param;
|
|
1151
|
+
const sums = [];
|
|
1152
|
+
columns.forEach((column, index) => {
|
|
1153
|
+
if (!column.property) {
|
|
1154
|
+
sums[index] = '';
|
|
1155
|
+
return;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
const field = allColumnList.value.find(item => item.fieldName === column.property);
|
|
1159
|
+
if (!field || !field.dataField) {
|
|
1160
|
+
sums[index] = '';
|
|
1161
|
+
return;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
if (field.dataField.id === summaryFieldId.value) {
|
|
1165
|
+
sums[index] = h('div',
|
|
1166
|
+
{
|
|
1167
|
+
style: {
|
|
1168
|
+
width: '100%',
|
|
1169
|
+
textAlign: 'right',
|
|
1170
|
+
fontWeight: 'bold'
|
|
1171
|
+
}
|
|
1172
|
+
},
|
|
1173
|
+
[summaryName.value]
|
|
1174
|
+
);
|
|
1175
|
+
return;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
if (summaryFieldIds.value.indexOf(field.dataField.id) < 0) {
|
|
1179
|
+
sums[index] = '';
|
|
1180
|
+
return;
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
const values = data.map((item) => Number(item[field.dataField.fieldName]))
|
|
1184
|
+
if (!values.every((value) => Number.isNaN(value))) {
|
|
1185
|
+
const result = `${values.reduce((prev, curr) => {
|
|
1186
|
+
const value = Number(curr)
|
|
1187
|
+
if (!Number.isNaN(value)) {
|
|
1188
|
+
return prev + curr
|
|
1189
|
+
} else {
|
|
1190
|
+
return prev
|
|
1191
|
+
}
|
|
1192
|
+
}, 0)}`;
|
|
1193
|
+
|
|
1194
|
+
if (field.styleList && field.styleList.length > 0) {
|
|
1195
|
+
sums[index] = h('div', { innerHTML: parseFieldStyle(field.styleList, result, data) });
|
|
1196
|
+
} else {
|
|
1197
|
+
if (field && field.dataField.fieldType === '小数') {
|
|
1198
|
+
sums[index] = tool.formatMoney(parseFloat(result || '0'), field.dataField.fieldPrecision || 0);
|
|
1199
|
+
} else {
|
|
1200
|
+
sums[index] = result;
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
} else {
|
|
1204
|
+
sums[index] = '';
|
|
1205
|
+
}
|
|
1206
|
+
});
|
|
1207
|
+
|
|
1208
|
+
return sums;
|
|
1209
|
+
};
|
|
1210
|
+
|
|
1211
|
+
const initTableData = async() => {
|
|
1212
|
+
queryInfo.value.pageNumber = 1;
|
|
1213
|
+
queryInfo.value.pageSize = tableInfo.value.defaultPageSize || queryInfo.value.pageSize;
|
|
1214
|
+
queryData.value = {};
|
|
1215
|
+
dataList.value = [];
|
|
1216
|
+
};
|
|
1217
|
+
|
|
1218
|
+
const initQueryInfo = async() => {
|
|
1219
|
+
const inputParamList = [];
|
|
1220
|
+
(props.inputParamList || []).forEach(inputParam => {
|
|
1221
|
+
if (inputParam.length < 2) return;
|
|
1222
|
+
|
|
1223
|
+
const field = dataFieldList.value.find(item => item.id === inputParam[0]);
|
|
1224
|
+
if (field) {
|
|
1225
|
+
inputParamList.push([field.fieldName, inputParam[1], inputParam.length >= 3 ? inputParam[2] : ''])
|
|
1226
|
+
}
|
|
1227
|
+
});
|
|
1228
|
+
|
|
1229
|
+
queryInfo.value.inputParamList = inputParamList;
|
|
1230
|
+
queryData.value = Object.assign(queryData.value, props.defaultQuery || {});
|
|
1231
|
+
};
|
|
1232
|
+
|
|
1233
|
+
const initButtonList = async() => {
|
|
1234
|
+
buttonList.value = (props.buttonList || [])
|
|
1235
|
+
.filter(item => item.showPosition && item.showPosition.indexOf('行内') >= 0);
|
|
1236
|
+
};
|
|
1237
|
+
|
|
1238
|
+
const initColumnList = async() => {
|
|
1239
|
+
const fieldList = tool.deepClone(tableInfo.value.fieldList) || [];
|
|
1240
|
+
|
|
1241
|
+
for (const item of fieldList) {
|
|
1242
|
+
const find = dataFieldList.value.find(field => field.id === item.fieldId);
|
|
1243
|
+
if (find) {
|
|
1244
|
+
item.fieldType = find.fieldType;
|
|
1245
|
+
item.fieldName = find.fieldName;
|
|
1246
|
+
item.inputType = find.inputType;
|
|
1247
|
+
item.fieldSize = find.fieldSize;
|
|
1248
|
+
item.enumerate = find.enumerate;
|
|
1249
|
+
item.enumerateType = find.enumerateType;
|
|
1250
|
+
item.relevanceType = find.relevanceType;
|
|
1251
|
+
item.relevanceDict = find.relevanceDict;
|
|
1252
|
+
item.enumerateValue = find.enumerateValue;
|
|
1253
|
+
item.dataField = find;
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
allColumnList.value = fieldList;
|
|
1258
|
+
try {
|
|
1259
|
+
const json = wsCache.get(getStoreKey()) || '';
|
|
1260
|
+
if (json && json.startsWith('[')) {
|
|
1261
|
+
showColumns.value = JSON.parse(json);
|
|
1262
|
+
}
|
|
1263
|
+
} catch (ignore) {
|
|
1264
|
+
showColumns.value = [];
|
|
1265
|
+
}
|
|
1266
|
+
resolveShowColumn();
|
|
1267
|
+
};
|
|
1268
|
+
|
|
1269
|
+
const parseFieldStyle = (styleList, value, data) => {
|
|
1270
|
+
if (!styleList || styleList.length === 0) return value || '';
|
|
1271
|
+
value = value || '';
|
|
1272
|
+
|
|
1273
|
+
let resultHtml = '';
|
|
1274
|
+
for (const style of styleList) {
|
|
1275
|
+
if (style.originValue !== value && style.originValue !== '{all}') continue;
|
|
1276
|
+
if (!value && style.originValue !== '{all}') continue;
|
|
1277
|
+
|
|
1278
|
+
if (style.showType === '文字') {
|
|
1279
|
+
const targetValue = style.targetValue ? style.targetValue.replace('{currValue}', value || '') : (value || '');
|
|
1280
|
+
resultHtml = `<span
|
|
1281
|
+
class="${style.flash === '1' ? 'blinking' : ''}"
|
|
1282
|
+
style="color: ${style.showColor || 'inherit'}"
|
|
1283
|
+
>${targetValue}</span>`;
|
|
1284
|
+
} else if (style.showType === '标签') {
|
|
1285
|
+
const targetValue = style.targetValue ? style.targetValue.replace('{currValue}', value || '') : (value || '');
|
|
1286
|
+
resultHtml = `<span
|
|
1287
|
+
class="label ${style.flash === '1' ? 'blinking' : ''}"
|
|
1288
|
+
style="background-color: ${style.showColor || 'inherit'}"
|
|
1289
|
+
>${targetValue}</span>`;
|
|
1290
|
+
} else if (style.showType === '图形') {
|
|
1291
|
+
resultHtml = `<span
|
|
1292
|
+
class="
|
|
1293
|
+
shape
|
|
1294
|
+
${style.targetValue === '圆形' ? 'circle' : style.targetValue === '正方形' ? 'square' : 'oval'}
|
|
1295
|
+
${style.flash === '1' ? 'blinking' : ''}"
|
|
1296
|
+
style="background-color: ${style.showColor || 'inherit'}"
|
|
1297
|
+
></span>`;
|
|
1298
|
+
} else if (style.showType === '时间') {
|
|
1299
|
+
const code = style.targetValue ? style.targetValue.replace('{currValue}', value || '0') : (value || '0');
|
|
1300
|
+
let targetValue = new Function(code)();
|
|
1301
|
+
if (!isNaN(targetValue)) {
|
|
1302
|
+
targetValue = date.formatLongDate(parseInt(targetValue));
|
|
1303
|
+
}
|
|
1304
|
+
resultHtml = `<span
|
|
1305
|
+
class="${style.flash === '1' ? 'blinking' : ''}"
|
|
1306
|
+
style="color: ${style.showColor || 'inherit'}"
|
|
1307
|
+
>${targetValue}</span>`;
|
|
1308
|
+
} else if (style.showType === '时长') {
|
|
1309
|
+
const code = style.targetValue ? style.targetValue.replace('{currValue}', value || '0') : (value || '0');
|
|
1310
|
+
let targetValue = new Function(code)();
|
|
1311
|
+
if (!isNaN(targetValue)) {
|
|
1312
|
+
targetValue = tool.formatTime(parseInt(targetValue));
|
|
1313
|
+
}
|
|
1314
|
+
resultHtml = `<span
|
|
1315
|
+
class="${style.flash === '1' ? 'blinking' : ''}"
|
|
1316
|
+
style="color: ${style.showColor || 'inherit'}"
|
|
1317
|
+
>${targetValue}</span>`;
|
|
1318
|
+
} else if (style.showType === '进度条') {
|
|
1319
|
+
let progress = '0';
|
|
1320
|
+
try {
|
|
1321
|
+
const code = style.targetValue ? style.targetValue.replace('{currValue}', value || '0') : (value || '0');
|
|
1322
|
+
const targetValue = new Function(code)();
|
|
1323
|
+
if (!isNaN(targetValue)) {
|
|
1324
|
+
progress = parseFloat(targetValue).toFixed(2);
|
|
1325
|
+
}
|
|
1326
|
+
} catch (e) {
|
|
1327
|
+
console.log('样式设置解释出错!', e)
|
|
1328
|
+
}
|
|
1329
|
+
resultHtml = `<span class="progress-box">
|
|
1330
|
+
<span
|
|
1331
|
+
class="progress-line"
|
|
1332
|
+
style="background: linear-gradient(90deg, ${style.showColor || 'inherit'}, ${style.showColor || 'inherit'} ${progress}%, transparent 0);"
|
|
1333
|
+
><span class="progress-text">${progress}%</span></span>
|
|
1334
|
+
</span>`;
|
|
1335
|
+
} else if (style.showType === 'js脚本' && style.targetValue) {
|
|
1336
|
+
const args = {
|
|
1337
|
+
data: data,
|
|
1338
|
+
user: userStore.getUserData(),
|
|
1339
|
+
org: userStore.getOrgData()
|
|
1340
|
+
};
|
|
1341
|
+
try {
|
|
1342
|
+
const value = new Function('args', style.targetValue)(args);
|
|
1343
|
+
resultHtml = `<span
|
|
1344
|
+
class="${style.flash === '1' ? 'blinking' : ''}"
|
|
1345
|
+
style="color: ${style.showColor}"
|
|
1346
|
+
>${value || ''}</span>`;
|
|
1347
|
+
} catch (e) {
|
|
1348
|
+
console.log('样式设置解释出错!', e)
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
return resultHtml;
|
|
1353
|
+
};
|
|
1354
|
+
|
|
1355
|
+
const changeValue = (prop, row) => {
|
|
1356
|
+
const data = {};
|
|
1357
|
+
data[props.pkFieldName] = row[props.pkFieldName];
|
|
1358
|
+
data[prop] = row[prop];
|
|
1359
|
+
emit('editChange', data);
|
|
1360
|
+
};
|
|
1361
|
+
|
|
1362
|
+
const refreshData = (showLoading) => {
|
|
1363
|
+
cleanRefreshData();
|
|
1364
|
+
queryTableData(showLoading);
|
|
1365
|
+
};
|
|
1366
|
+
|
|
1367
|
+
const reloadData = (data) => {
|
|
1368
|
+
queryData.value = Object.assign(queryData.value, data || {});
|
|
1369
|
+
queryTableData(true, 1);
|
|
1370
|
+
};
|
|
1371
|
+
|
|
1372
|
+
const getSelectedData = () => {
|
|
1373
|
+
return dataTable.value.getSelectionRows();
|
|
1374
|
+
};
|
|
1375
|
+
|
|
1376
|
+
const getData = () => {
|
|
1377
|
+
return dataTable.value.getSelectionRows();
|
|
1378
|
+
};
|
|
1379
|
+
|
|
1380
|
+
const selectedCnt = computed(() => {
|
|
1381
|
+
return dataTable.value?.getSelectionRows().length;
|
|
1382
|
+
});
|
|
1383
|
+
|
|
1384
|
+
const showSelected = () => {
|
|
1385
|
+
selectedList.value = dataTable.value?.getSelectionRows();
|
|
1386
|
+
selectedVisible.value = true;
|
|
1387
|
+
};
|
|
1388
|
+
|
|
1389
|
+
const getQueryData = () => {
|
|
1390
|
+
return Object.assign(queryData.value, queryInfo.value);
|
|
1391
|
+
};
|
|
1392
|
+
|
|
1393
|
+
const init = async() => {
|
|
1394
|
+
if (!props.dataTableId) {
|
|
1395
|
+
return;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
initializing.value = true;
|
|
1399
|
+
await loadData(props.dataTableId);
|
|
1400
|
+
await nextTick(() => initializing.value = false);
|
|
1401
|
+
queryTableData(true, 1);
|
|
1402
|
+
};
|
|
1403
|
+
|
|
1404
|
+
const autoRefreshKey = 'auto_refresh_' + props.pageCompId + '_' + props.dataTableId;
|
|
1405
|
+
const initAutoRefresh = () => {
|
|
1406
|
+
const cacheValue = wsCache.get(autoRefreshKey) || '0';
|
|
1407
|
+
autoRefresh.value = cacheValue === '1';
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
const changeAutoRefresh = () => {
|
|
1411
|
+
wsCache.set(autoRefreshKey, autoRefresh.value ? '1' : '0');
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
const refreshDataTimeout = ref();
|
|
1415
|
+
const checkAndRefreshData = () => {
|
|
1416
|
+
if (!dialogMode && autoRefresh.value) {
|
|
1417
|
+
cleanRefreshData();
|
|
1418
|
+
refreshDataTimeout.value = setTimeout(() => refreshData(false), 500);
|
|
1419
|
+
}
|
|
1420
|
+
};
|
|
1421
|
+
|
|
1422
|
+
const cleanRefreshData = () => {
|
|
1423
|
+
if (refreshDataTimeout.value) {
|
|
1424
|
+
clearTimeout(refreshDataTimeout.value);
|
|
1425
|
+
}
|
|
1426
|
+
};
|
|
1427
|
+
|
|
1428
|
+
const validate = (callback) => {
|
|
1429
|
+
callback(true);
|
|
1430
|
+
};
|
|
1431
|
+
|
|
1432
|
+
const isDragger = ref(false);
|
|
1433
|
+
const isMouseDown = ref(false);
|
|
1434
|
+
const initialMouseX = ref();
|
|
1435
|
+
const initialScrollLeft = ref();
|
|
1436
|
+
|
|
1437
|
+
const handleKeyDown = (event) => {
|
|
1438
|
+
if (event.key === ' ') {
|
|
1439
|
+
event.preventDefault();
|
|
1440
|
+
isDragger.value = !isDragger.value;
|
|
1441
|
+
}
|
|
1442
|
+
};
|
|
1443
|
+
|
|
1444
|
+
const handleMouseDown = (event) => {
|
|
1445
|
+
if (!isDragger.value) return;
|
|
1446
|
+
initialMouseX.value = event.clientX || 0;
|
|
1447
|
+
const body = dataTable.value.$el.querySelector('.el-table__body-wrapper .el-scrollbar__wrap');
|
|
1448
|
+
initialScrollLeft.value = body.scrollLeft;
|
|
1449
|
+
isMouseDown.value = true;
|
|
1450
|
+
};
|
|
1451
|
+
|
|
1452
|
+
const handleMouseUp = () => {
|
|
1453
|
+
if (!isDragger.value) return;
|
|
1454
|
+
isMouseDown.value = false;
|
|
1455
|
+
};
|
|
1456
|
+
|
|
1457
|
+
const handleMouseMove = (event) => {
|
|
1458
|
+
if (!isDragger.value) return;
|
|
1459
|
+
event.preventDefault();
|
|
1460
|
+
if (isDragger.value && isMouseDown.value) {
|
|
1461
|
+
const deltaX = event.clientX - initialMouseX.value;
|
|
1462
|
+
const body = dataTable.value.$el.querySelector('.el-table__body-wrapper .el-scrollbar__wrap');
|
|
1463
|
+
body.scrollLeft = initialScrollLeft.value - deltaX;
|
|
1464
|
+
}
|
|
1465
|
+
};
|
|
1466
|
+
|
|
1467
|
+
onMounted(async() => {
|
|
1468
|
+
await init();
|
|
1469
|
+
initAutoRefresh();
|
|
1470
|
+
emitter.on('model.data.change.' + tableInfo.value.modelId, checkAndRefreshData);
|
|
1471
|
+
|
|
1472
|
+
if (tableInfo.value.showFull === '1') {
|
|
1473
|
+
if (screenFull.isEnabled) {
|
|
1474
|
+
screenFull.on('change', toggleTableFullscreen);
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
});
|
|
1478
|
+
|
|
1479
|
+
onUnmounted(() => {
|
|
1480
|
+
emitter.off('model.data.change.' + tableInfo.value.modelId, checkAndRefreshData);
|
|
1481
|
+
|
|
1482
|
+
if (tableInfo.value.showFull === '1') {
|
|
1483
|
+
screenFull.off('change', toggleTableFullscreen);
|
|
1484
|
+
}
|
|
1485
|
+
});
|
|
1486
|
+
|
|
1487
|
+
defineExpose({ reloadData, validate, refreshData, getQueryData, getData, getSelectedData })
|
|
1488
|
+
</script>
|
|
1489
|
+
|
|
1490
|
+
<style scoped lang="scss">
|
|
1491
|
+
.cc-table :deep(.el-table__body-wrapper .cell .relevance) {
|
|
1492
|
+
cursor: pointer;
|
|
1493
|
+
color: #2989da;
|
|
1494
|
+
}
|
|
1495
|
+
.cc-button {
|
|
1496
|
+
flex-grow: 1;
|
|
1497
|
+
display: flex;
|
|
1498
|
+
flex-direction: row;
|
|
1499
|
+
justify-content: space-around;
|
|
1500
|
+
align-items: center;
|
|
1501
|
+
}
|
|
1502
|
+
.cc-button :deep(.el-button:focus-visible) {
|
|
1503
|
+
outline: unset;
|
|
1504
|
+
}
|
|
1505
|
+
.cc-table-footer {
|
|
1506
|
+
display: flex;
|
|
1507
|
+
flex-direction: row;
|
|
1508
|
+
margin-top: 5px;
|
|
1509
|
+
.cc-table-refresh {
|
|
1510
|
+
display: flex;
|
|
1511
|
+
flex-direction: row;
|
|
1512
|
+
align-items: center;
|
|
1513
|
+
}
|
|
1514
|
+
.cc-pagination {
|
|
1515
|
+
flex-grow: 1;
|
|
1516
|
+
display: flex;
|
|
1517
|
+
flex-direction: row;
|
|
1518
|
+
justify-content: flex-end;
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
@keyframes blink {
|
|
1523
|
+
0% {
|
|
1524
|
+
opacity: 1;
|
|
1525
|
+
}
|
|
1526
|
+
50% {
|
|
1527
|
+
opacity: 0.4;
|
|
1528
|
+
}
|
|
1529
|
+
100% {
|
|
1530
|
+
opacity: 1
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
.cc-table .wrap .overflow-ellipsis {
|
|
1534
|
+
height: unset;
|
|
1535
|
+
white-space: pre-wrap;
|
|
1536
|
+
}
|
|
1537
|
+
.cc-table :deep(.blinking) {
|
|
1538
|
+
animation: blink 1.5s infinite;
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
.cc-table :deep(.label) {
|
|
1542
|
+
display: block;
|
|
1543
|
+
padding: 8px 16px;
|
|
1544
|
+
border-radius: 5px;
|
|
1545
|
+
line-height: 1;
|
|
1546
|
+
color: white;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
.cc-table :deep(.shape.circle) {
|
|
1550
|
+
display: block;
|
|
1551
|
+
padding: 9px;
|
|
1552
|
+
border-radius: 9px;
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
.cc-table :deep(.shape.square) {
|
|
1556
|
+
display: block;
|
|
1557
|
+
padding: 8px;
|
|
1558
|
+
border-radius: 2px;
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
.cc-table :deep(.shape.oval) {
|
|
1562
|
+
display: block;
|
|
1563
|
+
width: 18px;
|
|
1564
|
+
height: 12px;
|
|
1565
|
+
border-radius: 50% / 50%;
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
.cc-table .custom-style:has(.progress-box) {
|
|
1569
|
+
width: 100%;
|
|
1570
|
+
}
|
|
1571
|
+
.cc-table .custom-style :deep(.progress-box) {
|
|
1572
|
+
display: flex;
|
|
1573
|
+
background-color: #e2e2e2;
|
|
1574
|
+
border-radius: 30px;
|
|
1575
|
+
height: 32px;
|
|
1576
|
+
text-align: center;
|
|
1577
|
+
}
|
|
1578
|
+
.cc-table .custom-style :deep(.progress-line) {
|
|
1579
|
+
width: 100%;
|
|
1580
|
+
border-radius: 30px;
|
|
1581
|
+
height: 32px;
|
|
1582
|
+
}
|
|
1583
|
+
.cc-table .custom-style :deep(.progress-text) {
|
|
1584
|
+
padding: 0 15px;
|
|
1585
|
+
}
|
|
1586
|
+
.cc-table {
|
|
1587
|
+
position: relative;
|
|
1588
|
+
background-color: #ffffff;
|
|
1589
|
+
.show-table-fullscreen {
|
|
1590
|
+
position: absolute;
|
|
1591
|
+
cursor: pointer;
|
|
1592
|
+
top: 5px;
|
|
1593
|
+
right: 5px;
|
|
1594
|
+
z-index: 1000;
|
|
1595
|
+
font-size: 18px;
|
|
1596
|
+
color: #000000;
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
.padding-10 {
|
|
1600
|
+
padding: 10px;
|
|
1601
|
+
.show-table-fullscreen {
|
|
1602
|
+
top: 15px;
|
|
1603
|
+
right: 15px;
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
</style>
|