@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,48 @@
|
|
|
1
|
+
import { defineStore } from 'pinia';
|
|
2
|
+
import { ref, getCurrentInstance } from 'vue';
|
|
3
|
+
import api from '@/http/api';
|
|
4
|
+
|
|
5
|
+
export const useVisualCompStore = defineStore('visualComp', () => {
|
|
6
|
+
const loading = ref(false);
|
|
7
|
+
const visualCompList = ref([]);
|
|
8
|
+
visualCompList.value['vc-page'] = { name: '页面', styleList: [] };
|
|
9
|
+
|
|
10
|
+
const setVisualComp = (compName, comp) => {
|
|
11
|
+
visualCompList.value[compName] = comp;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const getVisualComp = async(type) => {
|
|
15
|
+
const compName = 'vc-' + type;
|
|
16
|
+
if (visualCompList.value && visualCompList.value[compName]) {
|
|
17
|
+
return visualCompList.value[compName];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (loading.value) {
|
|
21
|
+
await sleep(100);
|
|
22
|
+
return await getVisualComp(type);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
loading.value = true;
|
|
26
|
+
const res = await api.post('/visual-comp/queryBy', { id: type });
|
|
27
|
+
|
|
28
|
+
if (res.code === '1') {
|
|
29
|
+
const data = res.data || {};
|
|
30
|
+
getCurrentInstance().component(compName, data.compTpl);
|
|
31
|
+
setVisualComp(compName, { name: compName, styleList: data.styleList || [] });
|
|
32
|
+
loading.value = false;
|
|
33
|
+
return data;
|
|
34
|
+
} else {
|
|
35
|
+
loading.value = false;
|
|
36
|
+
return {};
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const sleep = async (d) => {
|
|
41
|
+
return new Promise((resolve) => setTimeout(resolve, d))
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
getVisualComp,
|
|
46
|
+
setVisualComp
|
|
47
|
+
};
|
|
48
|
+
});
|
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
import tool from '@/utils/tool';
|
|
2
|
+
import api from '@/http/api';
|
|
3
|
+
import date from '@/utils/date';
|
|
4
|
+
import { store as pinia } from '@/pinia';
|
|
5
|
+
import { useUserStore } from '@/pinia/modules/user';
|
|
6
|
+
|
|
7
|
+
const userStore = useUserStore(pinia);
|
|
8
|
+
|
|
9
|
+
export const initStyle = (node, styleId) => {
|
|
10
|
+
node.currStyle = {};
|
|
11
|
+
node.currCompStyle = {};
|
|
12
|
+
|
|
13
|
+
let style;
|
|
14
|
+
if (!node.styleList || node.styleList.length === 0) {
|
|
15
|
+
style = {};
|
|
16
|
+
} else if (!styleId) {
|
|
17
|
+
style = node.styleList[0];
|
|
18
|
+
} else {
|
|
19
|
+
for (const item of node.styleList) {
|
|
20
|
+
if (item.id === styleId) {
|
|
21
|
+
style = item;
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (!style) {
|
|
28
|
+
style = node.styleList[0];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
node.currStyle = style.style || {};
|
|
32
|
+
node.currCompStyle = style.compStyle || {};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const parseFontStyle = (styleJson, defaultValue, prefix) => {
|
|
36
|
+
if (!styleJson) return defaultValue || '';
|
|
37
|
+
|
|
38
|
+
const json = Object.assign(tool.deepClone(styleJson), defaultValue || {});
|
|
39
|
+
let result = '';
|
|
40
|
+
|
|
41
|
+
result += parseTplNs('font-size: {value};', json[(prefix || '') + 'fontSize'], 'px');
|
|
42
|
+
result += parseTpl('letter-spacing: {value};', json[(prefix || '') + 'letterSpacing']);
|
|
43
|
+
if (json[(prefix || '') + 'lineHeight']) {
|
|
44
|
+
result += parseTpl('line-height: {value};', json[(prefix || '') + 'lineHeight']);
|
|
45
|
+
}
|
|
46
|
+
result += parseTpl('font-family: {value};', json[(prefix || '') + 'fontFamily']);
|
|
47
|
+
result += parseTpl('font-weight: {value};', json[(prefix || '') + 'fontWeight']);
|
|
48
|
+
result += parseTpl('color: {value};', json[(prefix || '') + 'fontColor']);
|
|
49
|
+
result += parseTpl('cursor: {value};', json[(prefix || '') + 'cursor']);
|
|
50
|
+
|
|
51
|
+
return result;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 将json格式样式转换成字符串格式
|
|
56
|
+
* @param styleJson
|
|
57
|
+
* @param defaultValue
|
|
58
|
+
*/
|
|
59
|
+
export const parseStyle = (styleJson, defaultValue) => {
|
|
60
|
+
if (!styleJson) return defaultValue || '';
|
|
61
|
+
|
|
62
|
+
const json = Object.assign(tool.deepClone(styleJson), defaultValue || {});
|
|
63
|
+
|
|
64
|
+
let result = parseFontStyle(styleJson, defaultValue);
|
|
65
|
+
|
|
66
|
+
if (json['bgMode'] === '图片' && json['imageId']) {
|
|
67
|
+
const url = window.location.origin + import.meta.env.VITE_IMAGE_PATH + json['imageId'];
|
|
68
|
+
result += parseTpl('background-image: url({value});', url);
|
|
69
|
+
result += parseTpl('background-repeat: {value};', json['background-repeat']);
|
|
70
|
+
result += parseTpl('background-size: {value};', json['background-size']);
|
|
71
|
+
result += parseTpl('background-position: {value};', json['background-position']);
|
|
72
|
+
result += parseTpl('background-color: {value};', json['background-color']);
|
|
73
|
+
} else if (json['bgMode'] === '线性') {
|
|
74
|
+
if (json['start-color'] && json['end-color'] && json['gradient-direction']) {
|
|
75
|
+
result += 'background-image: linear-gradient(' +
|
|
76
|
+
json['gradient-direction'] + ', ' +
|
|
77
|
+
json['start-color'] + ', ' +
|
|
78
|
+
json['end-color'] + ');';
|
|
79
|
+
}
|
|
80
|
+
} else if (json['bgMode'] === '径向') {
|
|
81
|
+
if (json['start-color'] && json['end-color'] && json['gradient-shape']) {
|
|
82
|
+
result += 'background-image: radial-gradient(' +
|
|
83
|
+
json['gradient-shape'] + ', ' +
|
|
84
|
+
json['start-color'] + ', ' +
|
|
85
|
+
json['end-color'] + ');';
|
|
86
|
+
}
|
|
87
|
+
} else if (json['bgMode'] === '颜色') {
|
|
88
|
+
result += parseTpl('background-color: {value};', json['background-color']);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
result += parseTplNs('filter: blur({value});', json['filter'], 'px');
|
|
92
|
+
result += parseTpl('display: {value};', json['display']);
|
|
93
|
+
|
|
94
|
+
if (json['display'] === 'flex') {
|
|
95
|
+
result += parseTpl('flex-direction: {value};', json['flex-direction']);
|
|
96
|
+
result += parseTpl('justify-content: {value};', json['justify-content']);
|
|
97
|
+
result += parseTpl('align-items: {value};', json['align-items']);
|
|
98
|
+
result += parseTpl('flex-wrap: {value};', json['flex-wrap']);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
result += parseTpl('flex-grow: {value};', json['flex-grow']);
|
|
102
|
+
result += parseTpl('flex-shrink: {value};', json['flex-shrink']);
|
|
103
|
+
result += parseTpl('position: {value};', json['position']);
|
|
104
|
+
|
|
105
|
+
if (json['position'] && json['position'] !== 'static') {
|
|
106
|
+
const positionMargin = (json['position-margin'] || '0,0,0,0').split(',');
|
|
107
|
+
if (positionMargin.length >= 4) {
|
|
108
|
+
result += parseTplNs('top: {value};', positionMargin[0], 'px');
|
|
109
|
+
result += parseTplNs('right: {value};', positionMargin[1], 'px');
|
|
110
|
+
result += parseTplNs('bottom: {value};', positionMargin[2], 'px');
|
|
111
|
+
result += parseTplNs('left: {value};', positionMargin[3], 'px');
|
|
112
|
+
}
|
|
113
|
+
result += parseTpl('z-index: {value};', json['z-index']);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (json['margin'] && json['margin'] !== '0,0,0,0') {
|
|
117
|
+
const margin = (json['margin'] || '0,0,0,0').split(',');
|
|
118
|
+
result += parseTplNs('margin-top: {value};', margin[0], 'px');
|
|
119
|
+
result += parseTplNs('margin-right: {value};', margin[1], 'px');
|
|
120
|
+
result += parseTplNs('margin-bottom: {value};', margin[2], 'px');
|
|
121
|
+
result += parseTplNs('margin-left: {value};', margin[3], 'px');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (json['padding'] && json['padding'] !== '0,0,0,0') {
|
|
125
|
+
const padding = (json['padding'] || '0,0,0,0').split(',');
|
|
126
|
+
result += parseTplNs('padding-top: {value};', padding[0], 'px');
|
|
127
|
+
result += parseTplNs('padding-right: {value};', padding[1], 'px');
|
|
128
|
+
result += parseTplNs('padding-bottom: {value};', padding[2], 'px');
|
|
129
|
+
result += parseTplNs('padding-left: {value};', padding[3], 'px');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
result += parseTpl('width: {value};', json['width']);
|
|
133
|
+
result += parseTpl('height: {value};', json['height']);
|
|
134
|
+
result += parseTpl('overflow: {value};', json['overflow']);
|
|
135
|
+
|
|
136
|
+
if (json['radius-type'] === 'simple') {
|
|
137
|
+
result += parseTplNs('border-radius: {value};', json['border-radius'], 'px');
|
|
138
|
+
} else if (json['radius-type'] === 'complex') {
|
|
139
|
+
result += parseTplNs('border-top-left-radius: {value};', json['border-top-left-radius'], 'px');
|
|
140
|
+
result += parseTplNs('border-top-right-radius: {value};', json['border-top-right-radius'], 'px');
|
|
141
|
+
result += parseTplNs('border-bottom-right-radius: {value};', json['border-bottom-right-radius'], 'px');
|
|
142
|
+
result += parseTplNs('border-bottom-left-radius: {value};', json['border-bottom-left-radius'], 'px');
|
|
143
|
+
}
|
|
144
|
+
if (json['border-type'] === 'simple') {
|
|
145
|
+
result += parseTpl('border-style: {value};', json['border-style']);
|
|
146
|
+
result += parseTplNs('border-width: {value};', json['border-width'], 'px');
|
|
147
|
+
result += parseTpl('border-color: {value};', json['border-color']);
|
|
148
|
+
} else if (json['border-type'] === 'top') {
|
|
149
|
+
result += parseTpl('border-top-style: {value};', json['border-top-style']);
|
|
150
|
+
result += parseTplNs('border-top-width: {value};', json['border-top-width'], 'px');
|
|
151
|
+
result += parseTpl('border-top-color: {value};', json['border-top-color']);
|
|
152
|
+
} else if (json['border-type'] === 'right') {
|
|
153
|
+
result += parseTpl('border-right-style: {value};', json['border-right-style']);
|
|
154
|
+
result += parseTplNs('border-right-width: {value};', json['border-right-width'], 'px');
|
|
155
|
+
result += parseTpl('border-right-color: {value};', json['border-right-color']);
|
|
156
|
+
} else if (json['border-type'] === 'bottom') {
|
|
157
|
+
result += parseTpl('border-bottom-style: {value};', json['border-bottom-style']);
|
|
158
|
+
result += parseTplNs('border-bottom-width: {value};', json['border-bottom-width'], 'px');
|
|
159
|
+
result += parseTpl('border-bottom-color: {value};', json['border-bottom-color']);
|
|
160
|
+
} else if (json['border-type'] === 'left') {
|
|
161
|
+
result += parseTpl('border-left-style: {value};', json['border-left-style']);
|
|
162
|
+
result += parseTplNs('border-left-width: {value};', json['border-left-width'], 'px');
|
|
163
|
+
result += parseTpl('border-left-color: {value};', json['border-left-color']);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (json['opacity'] !== 1) {
|
|
167
|
+
result += parseTpl('opacity: {value};', json['opacity']);
|
|
168
|
+
}
|
|
169
|
+
if (json['cursor'] !== 'default') {
|
|
170
|
+
result += parseTpl('cursor: {value};', json['cursor']);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (json['box-shadow-style'] !== 'none') {
|
|
174
|
+
if (json['box-shadow-horizontal'] ||
|
|
175
|
+
json['box-shadow-vertical'] ||
|
|
176
|
+
json['box-shadow-blur'] ||
|
|
177
|
+
json['box-shadow-spread']) {
|
|
178
|
+
let boxShadow = 'box-shadow: ';
|
|
179
|
+
if (json['box-shadow-style']) {
|
|
180
|
+
boxShadow += json['box-shadow-style'] + ' ';
|
|
181
|
+
}
|
|
182
|
+
boxShadow += (json['box-shadow-horizontal'] + 'px ') || '0 ';
|
|
183
|
+
boxShadow += (json['box-shadow-vertical'] + 'px ') || '0 ';
|
|
184
|
+
boxShadow += (json['box-shadow-blur'] + 'px ') || '0 ';
|
|
185
|
+
boxShadow += (json['box-shadow-spread'] + 'px ') || '0 ';
|
|
186
|
+
boxShadow += (json['box-shadow-color'] || '#ffffff ') + ' ';
|
|
187
|
+
result += boxShadow + ';';
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (json['gap']) {
|
|
191
|
+
result += parseTpl('gap: {value};', json['gap']);
|
|
192
|
+
}
|
|
193
|
+
result += json['extendCss'] ? json['extendCss'] : '';
|
|
194
|
+
return result;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export const parseTpl = (template, value) => {
|
|
198
|
+
if (!value) return '';
|
|
199
|
+
|
|
200
|
+
return template.replace('{value}', value + '');
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export const parseTplNs = (template, value, suffix) => {
|
|
204
|
+
if (typeof value === 'undefined' || value == null || value === '') return '';
|
|
205
|
+
|
|
206
|
+
value += '';
|
|
207
|
+
if (suffix && /^[-+]?\d+$/.test(value)) {
|
|
208
|
+
value += suffix;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return template.replace('{value}', value);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export const addIfNotNull = (targetData, sourceData, sourceField) => {
|
|
215
|
+
addIfNotNull2(targetData, sourceField, sourceData, sourceField);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
export const addIfNotNull2 = (targetData, targetField, sourceData, sourceField) => {
|
|
219
|
+
if (sourceData &&
|
|
220
|
+
(sourceData[sourceField] ||
|
|
221
|
+
sourceData[sourceField] === false ||
|
|
222
|
+
sourceData[sourceField] === 0)) {
|
|
223
|
+
targetData[targetField] = sourceData[sourceField];
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const getConditionStyle = (styleList, data) => {
|
|
228
|
+
for (const style of styleList) {
|
|
229
|
+
let result = false;
|
|
230
|
+
if (!style.conditionList || style.conditionList.length === 0) {
|
|
231
|
+
result = true;
|
|
232
|
+
} else {
|
|
233
|
+
(tool.groupBy(style.conditionList || [], (item) => [item.grouping || 999]) || []).forEach(conditionList => {
|
|
234
|
+
result = result || checkConditionList(conditionList, data);
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
if (result) {
|
|
238
|
+
return style;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return null;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
const checkConditionList = (conditionList, data) => {
|
|
245
|
+
let result = true;
|
|
246
|
+
(conditionList || []).forEach(condition => {
|
|
247
|
+
const testValue = data[condition.condition];
|
|
248
|
+
switch (condition.type) {
|
|
249
|
+
case '包含':
|
|
250
|
+
result = result && (testValue || '').indexOf(condition.value || '') >= 0;
|
|
251
|
+
break;
|
|
252
|
+
case '不包含':
|
|
253
|
+
result = result && (testValue || '').indexOf(condition.value || '') === -1;
|
|
254
|
+
break;
|
|
255
|
+
case '等于':
|
|
256
|
+
result = result && (testValue || '') === (condition.value || '');
|
|
257
|
+
break;
|
|
258
|
+
case '不等于':
|
|
259
|
+
result = result && (testValue || '') !== (condition.value || '');
|
|
260
|
+
break;
|
|
261
|
+
case '大于':
|
|
262
|
+
result = result && parseFloat(testValue || '0') > parseFloat(condition.value || '0');
|
|
263
|
+
break;
|
|
264
|
+
case '大于等于':
|
|
265
|
+
result = result && parseFloat(testValue || '0') >= parseFloat(condition.value || '0');
|
|
266
|
+
break;
|
|
267
|
+
case '小于':
|
|
268
|
+
result = result && parseFloat(testValue || '0') < parseFloat(condition.value || '0');
|
|
269
|
+
break;
|
|
270
|
+
case '小于等于':
|
|
271
|
+
result = result && parseFloat(testValue || '0') <= parseFloat(condition.value || '0');
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
return result;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
export const createNode = (name, comp) => {
|
|
279
|
+
return {
|
|
280
|
+
id: tool.uuids(),
|
|
281
|
+
type: comp.type || '',
|
|
282
|
+
name: name || '',
|
|
283
|
+
formItem: comp.formItem || '0',
|
|
284
|
+
styleList: [{
|
|
285
|
+
id: tool.uuids(),
|
|
286
|
+
name: '原始状态',
|
|
287
|
+
style: {
|
|
288
|
+
'background-color': comp.type === 'page' ? '#F0F2F5' : null,
|
|
289
|
+
'margin-top': comp.type === 'form' ? '15' : null,
|
|
290
|
+
'padding-right': comp.type === 'form' ? '60' : null,
|
|
291
|
+
},
|
|
292
|
+
compStyle: {},
|
|
293
|
+
}],
|
|
294
|
+
default: comp.defaultObject || false,
|
|
295
|
+
inputParamList: [],
|
|
296
|
+
compData: {
|
|
297
|
+
dataSourceType: ''
|
|
298
|
+
},
|
|
299
|
+
compEventList: [],
|
|
300
|
+
children: []
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
export const loadValue = async(node, event) => {
|
|
305
|
+
if (!node || !event) return '';
|
|
306
|
+
|
|
307
|
+
let result = '';
|
|
308
|
+
if (node.currCompStyle) {
|
|
309
|
+
if (node.currCompStyle.defaultType === 'input') {
|
|
310
|
+
result = node.currCompStyle.defaultValue || '';
|
|
311
|
+
} else if (node.currCompStyle.defaultType === 'param') {
|
|
312
|
+
const param = event.getGlobalParam && event.getGlobalParam() || {};
|
|
313
|
+
result = param ? (param[node.currCompStyle.defaultValue] || '') : ''
|
|
314
|
+
} else if (node.currCompStyle.defaultType === 'script') {
|
|
315
|
+
if (node.currCompStyle.defaultValue) {
|
|
316
|
+
const res = await api.runScript(node.currCompStyle.defaultValue);
|
|
317
|
+
result = res && res.data || '';
|
|
318
|
+
} else {
|
|
319
|
+
result = '';
|
|
320
|
+
}
|
|
321
|
+
} else if (node.currCompStyle.defaultValue) {
|
|
322
|
+
result = node.currCompStyle.defaultValue;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
if (!result &&
|
|
327
|
+
node.currCompStyle &&
|
|
328
|
+
(node.currCompStyle['default'] === 0 || node.currCompStyle['default'])) {
|
|
329
|
+
result = node.currCompStyle['default'];
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
if (!result && node.defaultObject) {
|
|
333
|
+
result = node.defaultObject.input ? node.defaultObject.value : '';
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
return await parseSymbol(result);
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
export const loadData = async(compData, event, nodeData, node) => {
|
|
340
|
+
if (compData.dataSourceType === '静态数据') {
|
|
341
|
+
if (!compData.dataJson) return [];
|
|
342
|
+
return { data: convertData(compData, JSON.parse(compData.dataJson)) };
|
|
343
|
+
} else if (compData.dataSourceType === '输入参数') {
|
|
344
|
+
if (!compData.inputParamList || compData.inputParamList.length === 0) return [];
|
|
345
|
+
const param = Object.assign(
|
|
346
|
+
{},
|
|
347
|
+
event.getGlobalParam && event.getGlobalParam(),
|
|
348
|
+
nodeData,
|
|
349
|
+
nodeData.inputParam || {});
|
|
350
|
+
const paramData = compData.inputParamList[0];
|
|
351
|
+
const value = (paramData.input ? paramData.value : param[paramData.id]) || '';
|
|
352
|
+
const data = Object.assign({ 内容: value }, filterData(compData, event, nodeData));
|
|
353
|
+
return { data: convertData(compData, data) };
|
|
354
|
+
} else if (compData.dataSourceType === '数据模型' || compData.dataSourceType === '视图') {
|
|
355
|
+
if (!compData.dataModelId) return [];
|
|
356
|
+
const url = '/codeless/data-model/' + compData.dataModelId + '/page';
|
|
357
|
+
const res = await api.post(url, {
|
|
358
|
+
pageNumber: nodeData.pageNumber || 1,
|
|
359
|
+
pageSize: nodeData.pageSize || 10,
|
|
360
|
+
...filterData(compData, event, nodeData),
|
|
361
|
+
filterList: filterFilter(tool.deepClone(compData.filterList)),
|
|
362
|
+
ordinalList: compData.ordinalList
|
|
363
|
+
});
|
|
364
|
+
const fieldRes = await api.post('/business/data-field/list/' + compData.dataModelId);
|
|
365
|
+
const result = Object.assign({}, res, { data: [] });
|
|
366
|
+
result.data = convertData(compData, res.data, fieldRes.data || []);
|
|
367
|
+
result.totalPage = res.totalPage || 0;
|
|
368
|
+
result.totalRecord = res.totalRecord || 0;
|
|
369
|
+
return result;
|
|
370
|
+
} else if (compData.dataSourceType === '脚本') {
|
|
371
|
+
if (!compData.scriptId) return { data: [] };
|
|
372
|
+
const res = await api.runScript(compData.scriptId, filterData(compData, event, nodeData));
|
|
373
|
+
if (!res || !res.data || res.data.length === 0) return;
|
|
374
|
+
const result = Object.assign({}, res, { data: [] });
|
|
375
|
+
result.data = convertData(compData, res.data);
|
|
376
|
+
result.totalPage = res.totalPage || 0;
|
|
377
|
+
result.totalRecord = res.totalRecord || 0;
|
|
378
|
+
return result;
|
|
379
|
+
} else {
|
|
380
|
+
return { data: [{ 内容: await loadValue(node, event) }] };
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
const convertData = (compData, data, fieldList) => {
|
|
385
|
+
if (!data ||
|
|
386
|
+
(Array.isArray(data) && data.length === 0) ||
|
|
387
|
+
(!Array.isArray(data) && Object.keys(data).length === 0)) return [];
|
|
388
|
+
const dataList = Array.isArray(data) ? data : [data || {}];
|
|
389
|
+
if (!compData.fieldList || compData.fieldList.length === 0) return dataList;
|
|
390
|
+
|
|
391
|
+
const resultList = [];
|
|
392
|
+
dataList.forEach(data => {
|
|
393
|
+
const result = {};
|
|
394
|
+
compData.fieldList.forEach(mapping => {
|
|
395
|
+
const field = fieldList && fieldList.length > 0 ? fieldList.find(field => field.fieldName === mapping['value']) : null;
|
|
396
|
+
if (field) {
|
|
397
|
+
if (field.fieldType === '联动' && !field.relevanceType.startsWith('字典')) {
|
|
398
|
+
result[mapping['name']] = getValue(data[field.fieldName + '_name']);
|
|
399
|
+
} else if (field.fieldType === '时间') {
|
|
400
|
+
result[mapping['name']] = date.formatLongDate(data[field.fieldName]);
|
|
401
|
+
} else {
|
|
402
|
+
result[mapping['name']] = getValue(data[field.fieldName]);
|
|
403
|
+
}
|
|
404
|
+
} else {
|
|
405
|
+
if (mapping['value'] && mapping['type'] === '日期') {
|
|
406
|
+
result[mapping['name']] = date.formatLongDate(data[mapping['value']] || '', 'yyyy-MM-dd');
|
|
407
|
+
} else if (mapping['value'] && mapping['type'] === '时间') {
|
|
408
|
+
result[mapping['name']] = date.formatLongDate(data[mapping['value']] || '', 'yyyy-MM-dd HH:mm:ss');
|
|
409
|
+
} else {
|
|
410
|
+
result[mapping['name']] = getValue(data[mapping['value']]);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
resultList.push(result);
|
|
415
|
+
});
|
|
416
|
+
return resultList;
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
const getValue = (value) => {
|
|
420
|
+
return typeof value === 'undefined' || value == null ? '' : value;
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
const filterData = (compData, event, nodeData) => {
|
|
424
|
+
if (compData && compData.filterList) {
|
|
425
|
+
const result = {};
|
|
426
|
+
compData.filterList.forEach(filter => {
|
|
427
|
+
if (!filter.fieldId || !filter.compareValue) return;
|
|
428
|
+
|
|
429
|
+
if (filter.manually) {
|
|
430
|
+
result[filter.fieldId] = filter.compareValue || '';
|
|
431
|
+
} else if (event && (event.getNodeData || nodeData)) {
|
|
432
|
+
const paths = filter.compareValue.split('.');
|
|
433
|
+
if (paths.length === 0) return;
|
|
434
|
+
const data = event.getNodeData ? event.getNodeData(paths[0]) : nodeData;
|
|
435
|
+
if (paths.length === 2 && paths[1] === 'value') {
|
|
436
|
+
result[filter.fieldId] = data[paths[1]] || '';
|
|
437
|
+
} else if (paths.length === 2 && paths[0] === 'inputParam') {
|
|
438
|
+
result[filter.fieldId] = nodeData[paths[0]]?.[paths[1]] || '';
|
|
439
|
+
} else if (paths.length === 3 && paths[1] === 'inputParam') {
|
|
440
|
+
result[filter.fieldId] = data[paths[1]] ? data[paths[1]][paths[2]] : '';
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
return result;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
return {};
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
const filterFilter = (filterList) => {
|
|
451
|
+
const resultList = [];
|
|
452
|
+
(filterList || []).forEach(filter => {
|
|
453
|
+
if (!filter.manually && filter.compareValue && filter.compareValue.indexOf('.')) {
|
|
454
|
+
const paths = filter.compareValue.split('.');
|
|
455
|
+
filter.compareValue = paths[paths.length - 1];
|
|
456
|
+
}
|
|
457
|
+
resultList.push(filter);
|
|
458
|
+
});
|
|
459
|
+
return resultList;
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
const getInputParam = (node, data) => {
|
|
463
|
+
if (!node || !data) return {};
|
|
464
|
+
|
|
465
|
+
if (node?.compData?.inputParamList?.length > 0) {
|
|
466
|
+
const inputParam = {};
|
|
467
|
+
node.compData.inputParamList.forEach(param => {
|
|
468
|
+
if (!param.value) return;
|
|
469
|
+
|
|
470
|
+
if (param.input) {
|
|
471
|
+
inputParam[param.id] = param.value || '';
|
|
472
|
+
} else if (param.value.indexOf('.') >= 0) {
|
|
473
|
+
if (param.value.endsWith('.row') && !param.value.endsWith('.row.row')) {
|
|
474
|
+
inputParam[param.id] = JSON.stringify(data[param.value] || {});
|
|
475
|
+
} else {
|
|
476
|
+
const key = param.value.substring(0, param.value.lastIndexOf('.'));
|
|
477
|
+
const valueKey = param.value.substring(param.value.lastIndexOf('.') + 1);
|
|
478
|
+
inputParam[param.id] = data[key]?.[valueKey] || '';
|
|
479
|
+
}
|
|
480
|
+
} else {
|
|
481
|
+
inputParam[param.id] = data[param.value] || '';
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
return inputParam;
|
|
485
|
+
} else {
|
|
486
|
+
return data;
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
const parseSymbol = async(val) => {
|
|
491
|
+
return await userStore.parseSymbol(val);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export default {
|
|
495
|
+
initStyle,
|
|
496
|
+
parseStyle,
|
|
497
|
+
parseFontStyle,
|
|
498
|
+
parseTpl,
|
|
499
|
+
parseTplNs,
|
|
500
|
+
addIfNotNull,
|
|
501
|
+
addIfNotNull2,
|
|
502
|
+
getConditionStyle,
|
|
503
|
+
createNode,
|
|
504
|
+
loadValue,
|
|
505
|
+
loadData,
|
|
506
|
+
getInputParam,
|
|
507
|
+
parseSymbol
|
|
508
|
+
};
|