vue2-client 0.1.1 → 1.2.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/.editorconfig +9 -0
- package/.env +14 -0
- package/.env.development +1 -0
- package/.eslintrc.js +81 -0
- package/.eslintrc.json +5 -0
- package/README.md +56 -36
- package/babel.config.js +14 -5
- package/docs/index.md +29 -0
- package/index.js +28 -35
- package/jest.config.js +3 -0
- package/package.json +68 -22
- package/public/index.html +27 -17
- package/src/App.vue +93 -0
- package/src/assets/img/alipay.png +0 -0
- package/src/assets/img/defect.png +0 -0
- package/src/assets/img/error.png +0 -0
- package/src/assets/img/logo.png +0 -0
- package/src/assets/img/preview-nine.png +0 -0
- package/src/assets/img/preview.png +0 -0
- package/src/assets/img/success.png +0 -0
- package/src/assets/img/success1.png +0 -0
- package/src/assets/img/wechatpay.png +0 -0
- package/src/base-client/all.js +57 -0
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +1159 -0
- package/src/base-client/components/common/CreateQuery/index.js +3 -0
- package/src/base-client/components/common/CreateQuery/index.md +42 -0
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +540 -0
- package/src/base-client/components/common/CreateSimpleFormQuery/index.js +3 -0
- package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -0
- package/src/{components → base-client/components/common}/CustomColumnsDrawer/CustomColumnsDrawer.vue +21 -15
- package/src/{components → base-client/components/common}/CustomColumnsDrawer/index.js +0 -0
- package/src/{components → base-client/components/common}/CustomColumnsDrawer/index.md +46 -46
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +150 -0
- package/src/base-client/components/common/FormGroupEdit/index.js +3 -0
- package/src/base-client/components/common/FormGroupEdit/index.md +43 -0
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +163 -0
- package/src/base-client/components/common/FormGroupQuery/index.js +3 -0
- package/src/base-client/components/common/FormGroupQuery/index.md +43 -0
- package/src/base-client/components/common/JSONToTree/index.js +3 -0
- package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -0
- package/src/base-client/components/common/XAddForm/XAddForm.vue +323 -0
- package/src/base-client/components/common/XAddForm/index.js +3 -0
- package/src/base-client/components/common/XAddForm/index.md +60 -0
- package/src/base-client/components/common/XBadge/XBadge.vue +61 -0
- package/src/base-client/components/common/XBadge/index.js +3 -0
- package/src/base-client/components/common/XBadge/index.md +39 -0
- package/src/base-client/components/common/XCard/XCard.vue +59 -0
- package/src/base-client/components/common/XCard/index.js +3 -0
- package/src/base-client/components/common/XCard/index.md +43 -0
- package/src/base-client/components/common/XForm/XForm.vue +275 -0
- package/src/base-client/components/common/XForm/XFormItem.vue +217 -0
- package/src/base-client/components/common/XForm/index.js +3 -0
- package/src/base-client/components/common/XForm/index.md +196 -0
- package/src/{components/FormItem/FormItem.vue → base-client/components/common/XFormCol/XFormCol.vue} +16 -14
- package/src/base-client/components/common/XFormCol/index.js +3 -0
- package/src/{components/FormItem → base-client/components/common/XFormCol}/index.md +35 -35
- package/src/base-client/components/common/XFormTable/XFormTable.vue +405 -0
- package/src/base-client/components/common/XFormTable/index.js +3 -0
- package/src/base-client/components/common/XFormTable/index.md +89 -0
- package/src/base-client/components/common/XTable/XTable.vue +262 -0
- package/src/base-client/components/common/XTable/index.js +3 -0
- package/src/base-client/components/common/XTable/index.md +255 -0
- package/src/base-client/components/common/XTreeOne/XTreeOne.vue +105 -0
- package/src/base-client/components/common/XTreeOne/index.js +3 -0
- package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +226 -0
- package/src/base-client/components/iot/CustomerDetailsView/index.js +3 -0
- package/src/base-client/components/iot/CustomerDetailsView/index.md +41 -0
- package/src/base-client/components/iot/DataAnalysisUser/DataAnalysisUser.vue +127 -0
- package/src/base-client/components/iot/DataAnalysisUser/index.js +3 -0
- package/src/base-client/components/iot/DataAnalysisView/DataAnalysisView.vue +250 -0
- package/src/base-client/components/iot/DataAnalysisView/index.js +3 -0
- package/src/base-client/components/iot/DataAnalysisViewGD/DataAnalysisViewGD.vue +548 -0
- package/src/base-client/components/iot/DataAnalysisViewGD/WindowTemplate/WindowInfotemp.vue +99 -0
- package/src/base-client/components/iot/DataAnalysisViewGD/WindowTemplate/index.js +3 -0
- package/src/base-client/components/iot/DataAnalysisViewGD/index.js +3 -0
- package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +453 -0
- package/src/base-client/components/iot/DeviceBrandDetailsView/index.js +3 -0
- package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +231 -0
- package/src/base-client/components/iot/DeviceDetailsView/index.js +3 -0
- package/src/base-client/components/iot/DeviceDetailsView/index.md +43 -0
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +330 -0
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -0
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstruct.vue +122 -0
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstructOperate.vue +122 -0
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsMain.vue +225 -0
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +135 -0
- package/src/base-client/components/iot/DeviceDetailsView/part/index.js +8 -0
- package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +277 -0
- package/src/base-client/components/iot/DeviceTypeDetailsView/index.js +3 -0
- package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +472 -0
- package/src/{components → base-client/components/iot}/InstructDetailsView/index.js +0 -0
- package/src/base-client/components/iot/InstructDetailsView/index.md +45 -0
- package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +380 -0
- package/src/base-client/components/iot/LogDetailsView/index.js +3 -0
- package/src/base-client/components/iot/LogDetailsView/index.md +43 -0
- package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +360 -0
- package/src/{components → base-client/components/iot}/MeterDetailsView/index.js +0 -0
- package/src/base-client/components/iot/MeterDetailsView/index.md +43 -0
- package/src/{components → base-client/components/iot}/MeterDetailsView/part/MeterDetailsCount.vue +335 -381
- package/src/{components → base-client/components/iot}/MeterDetailsView/part/MeterDetailsException.vue +185 -204
- package/src/{components → base-client/components/iot}/MeterDetailsView/part/MeterDetailsHandPlan.vue +292 -320
- package/src/{components → base-client/components/iot}/MeterDetailsView/part/MeterDetailsInstruct.vue +237 -278
- package/src/{components → base-client/components/iot}/MeterDetailsView/part/MeterDetailsMain.vue +257 -247
- package/src/{components → base-client/components/iot}/MeterDetailsView/part/MeterDetailsSellGas.vue +190 -211
- package/src/base-client/components/iot/MeterDetailsView/part/index.js +9 -0
- package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +723 -0
- package/src/base-client/components/iot/WebmeterAnalysisView/index.js +3 -0
- package/src/base-client/components/iot/WebmeterAnalysisView/index.md +48 -0
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -0
- package/src/base-client/components/system/DictionaryDetailsView/index.js +3 -0
- package/src/base-client/components/system/DictionaryDetailsView/index.md +41 -0
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +248 -0
- package/src/base-client/components/system/QueryParamsDetailsView/index.js +3 -0
- package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +406 -0
- package/src/base-client/components/ticket/EmployeeDetailsView/index.js +3 -0
- package/src/base-client/components/ticket/EmployeeDetailsView/index.md +28 -0
- package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +486 -0
- package/src/base-client/components/ticket/TicketDetailsView/index.js +3 -0
- package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -0
- package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +184 -0
- package/src/base-client/components/ticket/TicketDetailsView/part/index.js +3 -0
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +303 -0
- package/src/base-client/components/ticket/TicketSubmitSuccessView/index.js +3 -0
- package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -0
- package/src/base-client/plugins/AppData.js +69 -0
- package/src/{plugins → base-client/plugins}/Config.js +1 -1
- package/src/base-client/plugins/GetLoginInfoService.js +221 -0
- package/src/{plugins → base-client/plugins}/PagedList.js +0 -0
- package/src/base-client/plugins/authority-plugin.js +167 -0
- package/src/base-client/plugins/i18n-extend.js +32 -0
- package/src/base-client/plugins/index.js +21 -0
- package/src/{plugins → base-client/plugins}/moment.js +8 -8
- package/src/base-client/plugins/tabs-page-plugin.js +38 -0
- package/src/bootstrap.js +27 -0
- package/src/components/Charts/Bar.vue +62 -0
- package/src/components/Charts/ChartCard.vue +120 -0
- package/src/components/Charts/DataUserOrderSituation.vue +77 -0
- package/src/components/Charts/DataUserReporting.vue +74 -0
- package/src/components/Charts/DataUserSituation.vue +107 -0
- package/src/components/Charts/Liquid.vue +67 -0
- package/src/components/Charts/MiniArea.vue +39 -0
- package/src/components/Charts/MiniBar.vue +39 -0
- package/src/components/Charts/MiniProgress.vue +75 -0
- package/src/components/Charts/MiniSmoothArea.vue +40 -0
- package/src/components/Charts/Radar.vue +68 -0
- package/src/components/Charts/RankList.vue +77 -0
- package/src/components/Charts/TagCloud.vue +113 -0
- package/src/components/Charts/TransferBar.vue +64 -0
- package/src/components/Charts/Trend.vue +82 -0
- package/src/components/Charts/chart.less +13 -0
- package/src/components/Charts/smooth.area.less +14 -0
- package/src/components/Ellipsis/Ellipsis.vue +64 -0
- package/src/components/Ellipsis/index.js +3 -0
- package/src/components/Ellipsis/index.md +38 -0
- package/src/components/NumberInfo/NumberInfo.vue +54 -0
- package/src/components/NumberInfo/index.js +3 -0
- package/src/components/NumberInfo/index.less +55 -0
- package/src/components/NumberInfo/index.md +43 -0
- package/src/components/STable/README.md +341 -0
- package/src/components/STable/index.js +316 -0
- package/src/components/Trend/Trend.vue +41 -0
- package/src/components/Trend/index.js +3 -0
- package/src/components/Trend/index.less +42 -0
- package/src/components/Trend/index.md +45 -0
- package/src/components/_util/util.js +46 -0
- package/src/components/cache/AKeepAlive.js +172 -0
- package/src/components/card/ChartCard.vue +79 -0
- package/src/components/chart/Bar.vue +60 -0
- package/src/components/chart/MiniArea.vue +67 -0
- package/src/components/chart/MiniBar.vue +59 -0
- package/src/components/chart/MiniProgress.vue +57 -0
- package/src/components/chart/Radar.vue +80 -0
- package/src/components/chart/RankingList.vue +60 -0
- package/src/components/chart/Trend.vue +79 -0
- package/src/components/chart/index.less +9 -0
- package/src/components/checkbox/ColorCheckbox.vue +157 -0
- package/src/components/checkbox/ImgCheckbox.vue +163 -0
- package/src/components/checkbox/index.js +7 -0
- package/src/components/dataAnalysisView/UserData.vue +61 -0
- package/src/components/exception/ExceptionPage.vue +70 -0
- package/src/components/exception/typeConfig.js +19 -0
- package/src/components/form/FormRow.vue +52 -0
- package/src/components/index.js +36 -0
- package/src/components/index.less +6 -0
- package/src/components/input/IInput.vue +66 -0
- package/src/components/menu/Contextmenu.vue +84 -0
- package/src/components/menu/SideMenu.vue +62 -0
- package/src/components/menu/index.less +38 -0
- package/src/components/menu/menu.js +273 -0
- package/src/components/page/header/PageHeader.vue +64 -0
- package/src/components/page/header/index.less +40 -0
- package/src/components/result/Result.vue +77 -0
- package/src/components/setting/Setting.vue +237 -0
- package/src/components/setting/SettingItem.vue +26 -0
- package/src/components/setting/i18n.js +117 -0
- package/src/components/table/StandardTable.vue +142 -0
- package/src/components/table/advance/ActionColumns.vue +158 -0
- package/src/components/table/advance/ActionSize.vue +45 -0
- package/src/components/table/advance/AdvanceTable.vue +275 -0
- package/src/components/table/advance/SearchArea.vue +355 -0
- package/src/components/table/advance/index.js +2 -0
- package/src/components/table/api/ApiTable.vue +50 -0
- package/src/components/task/TaskGroup.vue +80 -0
- package/src/components/task/TaskItem.vue +26 -0
- package/src/components/tool/AStepItem.vue +60 -0
- package/src/components/tool/AvatarList.vue +69 -0
- package/src/components/tool/DetailList.vue +157 -0
- package/src/components/tool/Drawer.vue +142 -0
- package/src/components/tool/FooterToolBar.vue +30 -0
- package/src/components/tool/HeadInfo.vue +35 -0
- package/src/components/tool/TagSelect.vue +83 -0
- package/src/components/tool/TagSelectOption.vue +33 -0
- package/src/components/transition/PageToggleTransition.vue +97 -0
- package/src/config/config.js +13 -0
- package/src/config/default/admin.config.js +18 -0
- package/src/config/default/animate.config.js +21 -0
- package/src/config/default/antd.config.js +84 -0
- package/src/config/default/index.js +6 -0
- package/src/config/default/setting.config.js +33 -0
- package/src/config/index.js +6 -0
- package/src/config/replacer/index.js +10 -0
- package/src/config/replacer/resolve.config.js +67 -0
- package/src/layouts/AdminLayout.vue +174 -0
- package/src/layouts/BlankView.vue +22 -0
- package/src/layouts/CommonLayout.vue +42 -0
- package/src/layouts/ComponentLayoutOne.vue +47 -0
- package/src/layouts/PageLayout.vue +151 -0
- package/src/layouts/PageView.vue +55 -0
- package/src/layouts/SinglePageView.vue +74 -0
- package/src/layouts/footer/PageFooter.vue +46 -0
- package/src/layouts/header/AdminHeader.vue +109 -0
- package/src/layouts/header/HeaderAvatar.vue +60 -0
- package/src/layouts/header/HeaderNotice.vue +97 -0
- package/src/layouts/header/HeaderSearch.vue +67 -0
- package/src/layouts/header/index.less +92 -0
- package/src/layouts/tabs/TabsHead.vue +190 -0
- package/src/layouts/tabs/TabsView.vue +355 -0
- package/src/layouts/tabs/i18n.js +25 -0
- package/src/layouts/tabs/index.js +2 -0
- package/src/main.js +15 -7
- package/src/mock/common/activityData.js +32 -0
- package/src/mock/common/index.js +89 -0
- package/src/mock/common/reportData.js +20 -0
- package/src/mock/common/tableData.js +118 -0
- package/src/mock/extend/index.js +83 -0
- package/src/mock/goods/index.js +108 -0
- package/src/mock/index.js +12 -0
- package/src/mock/project/index.js +17 -0
- package/src/mock/user/current.js +13 -0
- package/src/mock/user/login.js +39 -0
- package/src/mock/user/routes.js +61 -0
- package/src/mock/workplace/index.js +15 -0
- package/src/pages/exception/403.vue +25 -0
- package/src/pages/exception/404.vue +25 -0
- package/src/pages/exception/500.vue +25 -0
- package/src/pages/login/Login.vue +194 -0
- package/src/pages/login/index.js +2 -0
- package/src/pages/report/ReportTable.js +125 -0
- package/src/pages/report/ReportTableHome.vue +28 -0
- package/src/pages/resourceManage/resourceManageMain.vue +55 -0
- package/src/pages/system/applyInstallView/Core.vue +570 -0
- package/src/pages/system/applyInstallView/LFComponents/AddPanel.vue +52 -0
- package/src/pages/system/applyInstallView/LFComponents/Control.vue +78 -0
- package/src/pages/system/applyInstallView/LFComponents/DataDialog.vue +24 -0
- package/src/pages/system/applyInstallView/LFComponents/NodePanel.vue +103 -0
- package/src/pages/system/applyInstallView/PropertySetting/Base.vue +124 -0
- package/src/pages/system/applyInstallView/PropertySetting/CommonProperty.vue +104 -0
- package/src/pages/system/applyInstallView/PropertySetting/PropertyDialog.vue +43 -0
- package/src/pages/system/applyInstallView/background/base.png +0 -0
- package/src/pages/system/applyInstallView/background/click.png +0 -0
- package/src/pages/system/applyInstallView/background/download.png +0 -0
- package/src/pages/system/applyInstallView/background/end.png +0 -0
- package/src/pages/system/applyInstallView/background/push.png +0 -0
- package/src/pages/system/applyInstallView/background/start.png +0 -0
- package/src/pages/system/applyInstallView/background/step.png +0 -0
- package/src/pages/system/applyInstallView/background/time.png +0 -0
- package/src/pages/system/applyInstallView/config.js +22 -0
- package/src/pages/system/applyInstallView/data.json +1284 -0
- package/src/pages/system/applyInstallView/index.vue +34 -0
- package/src/pages/system/applyInstallView/registerNode/Connect.vue +43 -0
- package/src/pages/system/applyInstallView/registerNode/index.js +16 -0
- package/src/pages/system/applyInstallView/registerNode/registerBackEdge.js +44 -0
- package/src/pages/system/applyInstallView/registerNode/registerBase.js +139 -0
- package/src/pages/system/applyInstallView/registerNode/registerConnect.js +60 -0
- package/src/pages/system/applyInstallView/registerNode/registerDownload.js +92 -0
- package/src/pages/system/applyInstallView/registerNode/registerEnd.js +110 -0
- package/src/pages/system/applyInstallView/registerNode/registerPolyline.js +14 -0
- package/src/pages/system/applyInstallView/registerNode/registerPush.js +127 -0
- package/src/pages/system/applyInstallView/registerNode/registerStart.js +105 -0
- package/src/pages/system/applyInstallView/registerNode/registerStep.js +209 -0
- package/src/pages/system/applyInstallView/registerNode/registerTask.js +29 -0
- package/src/pages/system/dictionary/index.vue +41 -0
- package/src/pages/system/queryParams/index.vue +41 -0
- package/src/router/async/config.async.js +25 -0
- package/src/router/async/router.map.js +59 -0
- package/src/router/guards.js +104 -0
- package/src/router/i18n.js +57 -0
- package/src/router/index.js +27 -0
- package/src/services/api/CustomerDetailsViewApi.js +6 -0
- package/src/services/api/DeviceBrandDetailsViewApi.js +14 -0
- package/src/services/api/DeviceDetailsViewApi.js +10 -0
- package/src/services/api/DeviceTypeDetailsViewApi.js +6 -0
- package/src/services/api/DictionaryDetailsViewApi.js +6 -0
- package/src/services/api/EmployeeDetailsViewApi.js +16 -0
- package/src/services/api/FormGroupEditApi.js +6 -0
- package/src/services/api/InstructDetailsViewApi.js +12 -0
- package/src/services/api/LogDetailsViewApi.js +10 -0
- package/src/services/api/MeterDetailsViewApi.js +24 -0
- package/src/services/api/QueryParamsDetailsViewApi.js +6 -0
- package/src/services/api/TicketDetailsViewApi.js +30 -0
- package/src/services/api/WebmeterAnalysisViewApi.js +30 -0
- package/src/services/api/common.js +39 -0
- package/src/services/api/iot.js +7 -0
- package/src/services/api/manage.js +12 -0
- package/src/services/api/restTools.js +23 -0
- package/src/services/api/service.js +12 -0
- package/src/services/api.js +11 -0
- package/src/services/dataSource.js +12 -0
- package/src/services/index.js +7 -0
- package/src/services/user.js +34 -0
- package/src/store/index.js +5 -0
- package/src/store/modules/account.js +103 -0
- package/src/store/modules/index.js +4 -0
- package/src/store/modules/setting.js +114 -0
- package/src/store/mutation-types.js +1 -0
- package/src/theme/antd/ant-menu.less +3 -0
- package/src/theme/antd/ant-message.less +3 -0
- package/src/theme/antd/ant-table.less +22 -0
- package/src/theme/antd/ant-time-picker.less +3 -0
- package/src/theme/antd/index.less +4 -0
- package/src/theme/default/color.less +43 -0
- package/src/theme/default/index.less +3 -0
- package/src/theme/default/nprogress.less +76 -0
- package/src/theme/default/style.less +33 -0
- package/src/theme/global.less +130 -0
- package/src/theme/index.less +5 -0
- package/src/theme/reportTable.less +58 -0
- package/src/theme/theme.less +1 -0
- package/src/utils/Objects.js +25 -0
- package/src/utils/authority-utils.js +85 -0
- package/src/utils/axios-interceptors.js +82 -0
- package/src/utils/colors.js +103 -0
- package/src/utils/excel/Blob.js +181 -0
- package/src/utils/excel/Export2Excel.js +142 -0
- package/src/utils/filter.js +21 -0
- package/src/utils/formatter.js +68 -0
- package/src/utils/i18n.js +80 -0
- package/src/utils/indexedDB.js +146 -0
- package/src/utils/request.js +197 -0
- package/src/utils/routerUtil.js +353 -0
- package/src/utils/theme-color-replacer-extend.js +92 -0
- package/src/utils/themeUtil.js +102 -0
- package/src/utils/util.js +134 -0
- package/tests/unit/ReportTable.spec.js +15 -0
- package/vue.config.js +153 -0
- package/webpack.config.js +12 -0
- package/src/api/business.js +0 -30
- package/src/api/common.js +0 -6
- package/src/assets/logo.png +0 -0
- package/src/components/Criteria/Criteria.vue +0 -191
- package/src/components/Criteria/CriteriaPaged.vue +0 -50
- package/src/components/Criteria/index.js +0 -7
- package/src/components/Criteria/index.md +0 -120
- package/src/components/DataGrid/DataGrid.vue +0 -206
- package/src/components/DataGrid/index.js +0 -3
- package/src/components/DataGrid/index.md +0 -195
- package/src/components/ExportExcel/ExportExcel.vue +0 -246
- package/src/components/ExportExcel/index.js +0 -3
- package/src/components/ExportExcel/index.md +0 -76
- package/src/components/FormItem/index.js +0 -3
- package/src/components/InstructDetailsView/InstructDetailsView.vue +0 -518
- package/src/components/InstructDetailsView/index.md +0 -40
- package/src/components/MetaAnalysis/MetaAnalysis.vue +0 -183
- package/src/components/MetaAnalysis/demo/A.vue +0 -31
- package/src/components/MetaAnalysis/demo/B.vue +0 -31
- package/src/components/MetaAnalysis/demo/C.vue +0 -31
- package/src/components/MetaAnalysis/demo/MetaTest.vue +0 -44
- package/src/components/MetaAnalysis/index.js +0 -3
- package/src/components/MetaAnalysis/index.md +0 -255
- package/src/components/MeterDetailsView/MeterDetailsView.vue +0 -317
- package/src/components/MeterDetailsView/index.md +0 -40
- package/src/components/MeterDetailsView/part/index.js +0 -9
- package/src/components/ModalView/Modal.vue +0 -100
- package/src/components/ModalView/index.js +0 -3
- package/src/components/WCriteria/WCriteria.vue +0 -191
- package/src/components/WCriteria/WCriteriaPaged.vue +0 -95
- package/src/components/WCriteria/index.js +0 -7
- package/src/components/WCriteria/index.md +0 -120
- package/src/components/WTable/WTable.vue +0 -216
- package/src/components/WTable/index.js +0 -3
- package/src/components/WTable/index.md +0 -195
- package/src/plugins/AppData.js +0 -39
- package/src/plugins/GetLoginInfoService.js +0 -475
- package/src/plugins/MessageBox.js +0 -15
|
@@ -0,0 +1,1159 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a-drawer
|
|
3
|
+
title="查询配置生成"
|
|
4
|
+
placement="right"
|
|
5
|
+
:width="isMobile ? screenWidth : screenWidth * 0.85"
|
|
6
|
+
:visible="visible"
|
|
7
|
+
@close="onClose"
|
|
8
|
+
>
|
|
9
|
+
<a-row :gutter="24">
|
|
10
|
+
<a-col :xl="14" :lg="12" :md="12" :sm="24" :xs="24">
|
|
11
|
+
<a-form-model
|
|
12
|
+
ref="businessCreateForm"
|
|
13
|
+
:rules="rules"
|
|
14
|
+
:model="form"
|
|
15
|
+
:label-col="labelCol"
|
|
16
|
+
:wrapper-col="wrapperCol"
|
|
17
|
+
>
|
|
18
|
+
<a-form-model-item label="查询主表名" prop="tableName">
|
|
19
|
+
<a-input v-model="form.tableName" placeholder="查询用的主表+别名,用空格隔开,如:t_userfiles u" />
|
|
20
|
+
</a-form-model-item>
|
|
21
|
+
<a-form-model-item label="预设关联表" prop="joinArray">
|
|
22
|
+
<a-popover title="说明" placement="right">
|
|
23
|
+
<template slot="content">
|
|
24
|
+
<p>配置你的查询中可能涉及到的所有关联表</p>
|
|
25
|
+
<p>比如你的查询中涉及到了t_userinfo表,就需要加入t_userinfo表的关联,和你写SQL的关联一样</p>
|
|
26
|
+
<p>请注意,你关联的<span style="color: #ff0000">除主表外的任何表</span>都需要配置</p>
|
|
27
|
+
<a-input-group compact style="width: 400px;">
|
|
28
|
+
<a-input style="width: 20%" placeholder="表别名" readOnly/>
|
|
29
|
+
<a-input style="width: 80%" placeholder="关联条件" readOnly/>
|
|
30
|
+
</a-input-group>
|
|
31
|
+
<a-input-group compact style="width: 400px;">
|
|
32
|
+
<a-input value="ui" style="width: 20%" placeholder="表别名" readOnly/>
|
|
33
|
+
<a-input value="t_userinfo ui on i.f_userinfo_id = ui.f_userinfo_id" style="width: 80%" placeholder="关联条件" readOnly/>
|
|
34
|
+
</a-input-group>
|
|
35
|
+
</template>
|
|
36
|
+
<a-button type="primary" @click="addJoinItem()">增加</a-button>
|
|
37
|
+
</a-popover>
|
|
38
|
+
<div v-for="(itemObj, index) in joinArray" :key="index">
|
|
39
|
+
<a-input-group compact>
|
|
40
|
+
<a-input @change="changeJoinArray()" v-model="itemObj.key" style="width: 20%;position: relative;bottom: 1px;" placeholder="表别名" />
|
|
41
|
+
<a-input @change="changeJoinArray()" v-model="itemObj.value" style="width: 80%" placeholder="关联条件">
|
|
42
|
+
<a-icon slot="addonAfter" type="close" @click="removeJoinItem(index)"/>
|
|
43
|
+
</a-input>
|
|
44
|
+
</a-input-group>
|
|
45
|
+
</div>
|
|
46
|
+
</a-form-model-item>
|
|
47
|
+
<a-form-model-item label="SQL查询表达式" prop="condition">
|
|
48
|
+
<a-input v-model="form.condition.value" placeholder="用作SQL查询的固定条件表达式,如:gb.f_meter_type='物联网表',可选" />
|
|
49
|
+
<template v-if="form.condition.value && Object.keys(form.joinArray).length > 0">
|
|
50
|
+
<a-alert message="提示:如果SQL查询表达式中用到了关联表,需要勾选用到的关联表别名" type="success" />
|
|
51
|
+
<a-checkbox-group v-model="form.condition.join" :options="conditionJoinArray"/>
|
|
52
|
+
</template>
|
|
53
|
+
</a-form-model-item>
|
|
54
|
+
<a-form-model-item label="排序方式" prop="orderBy">
|
|
55
|
+
<a-input v-model="form.orderBy" placeholder="排序字段,用别名+字段名+排序方式(可选)表示,如:u.id desc" />
|
|
56
|
+
</a-form-model-item>
|
|
57
|
+
<a-form-model-item label="数据字段" prop="column">
|
|
58
|
+
<a-button type="primary" @click="addColumnItem()">增加</a-button>
|
|
59
|
+
<div v-for="(columnItem, index) in form.column" :key="index">
|
|
60
|
+
<a-row :gutter="16">
|
|
61
|
+
<a-col :span="16">
|
|
62
|
+
<span style="font-weight: bold">{{ columnItem.title }}({{ columnItem.key }})</span>
|
|
63
|
+
</a-col>
|
|
64
|
+
<a-col v-if="index > 0 && form.column.length > 1" :span="2">
|
|
65
|
+
<a-icon type="up-square" @click="upColumnItem(columnItem.key,index)"/>
|
|
66
|
+
</a-col>
|
|
67
|
+
<a-col v-if="(index !== form.column.length - 1) && form.column.length > 1" :span="2">
|
|
68
|
+
<a-icon type="down-square" @click="downColumnItem(columnItem.key,index)"/>
|
|
69
|
+
</a-col>
|
|
70
|
+
<a-col :span="2">
|
|
71
|
+
<a-icon type="edit" @click="editColumnItem(columnItem.key,index)"/>
|
|
72
|
+
</a-col>
|
|
73
|
+
<a-col :span="2">
|
|
74
|
+
<a-icon type="close" @click="removeColumnItem(columnItem.key,index)"/>
|
|
75
|
+
</a-col>
|
|
76
|
+
</a-row>
|
|
77
|
+
</div>
|
|
78
|
+
</a-form-model-item>
|
|
79
|
+
<a-form-model-item label="操作按钮配置" prop="buttonState">
|
|
80
|
+
<a-checkbox-group v-model="buttonStateData" :options="buttonStateArray" />
|
|
81
|
+
</a-form-model-item>
|
|
82
|
+
</a-form-model>
|
|
83
|
+
<a-modal
|
|
84
|
+
title="数据字段配置"
|
|
85
|
+
:visible="dataColumnVisible"
|
|
86
|
+
:width="1000"
|
|
87
|
+
:zIndex="1001"
|
|
88
|
+
@cancel="modelCancel"
|
|
89
|
+
@ok="submitItem">
|
|
90
|
+
<a-form-model
|
|
91
|
+
ref="itemForm"
|
|
92
|
+
:rules="itemRules"
|
|
93
|
+
:model="item">
|
|
94
|
+
<a-row :gutter="16">
|
|
95
|
+
<a-col :span="8">
|
|
96
|
+
<a-form-model-item label="数据字段名" prop="key">
|
|
97
|
+
<a-input v-model="item.key" placeholder="请输入数据字段名" ref="key">
|
|
98
|
+
<a-popover slot="suffix" title="关于数据字段名" placement="bottom">
|
|
99
|
+
<template slot="content">
|
|
100
|
+
<p>设置数据字段的名称</p>
|
|
101
|
+
<p>用作SQL查询时必须遵守<span style="font-weight: bold">表别名.列名</span>的格式,如:i.id</p>
|
|
102
|
+
<p>其他情况下不限制</p>
|
|
103
|
+
</template>
|
|
104
|
+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
|
105
|
+
</a-popover>
|
|
106
|
+
</a-input>
|
|
107
|
+
</a-form-model-item>
|
|
108
|
+
</a-col>
|
|
109
|
+
<a-col :span="8">
|
|
110
|
+
<a-form-model-item label="数据字段中文名" prop="title">
|
|
111
|
+
<a-input v-model="item.title" placeholder="请输入数据字段中文名,如:编号" />
|
|
112
|
+
</a-form-model-item>
|
|
113
|
+
</a-col>
|
|
114
|
+
</a-row>
|
|
115
|
+
<a-row :gutter="16">
|
|
116
|
+
<a-col :span="24">
|
|
117
|
+
<a-form-model-item label="数据模式" prop="dataMode">
|
|
118
|
+
<a-checkbox-group v-model="dataModeArrayData" :options="dataModeArray" />
|
|
119
|
+
</a-form-model-item>
|
|
120
|
+
</a-col>
|
|
121
|
+
</a-row>
|
|
122
|
+
<template v-if="dataMode.queryForm || dataMode.addOrEditForm">
|
|
123
|
+
<a-row :gutter="16">
|
|
124
|
+
<a-col :span="8">
|
|
125
|
+
<a-form-model-item label="表单类型" prop="formType">
|
|
126
|
+
<a-select v-model="item.formType" placeholder="表单类型,可选" @change="changeFormType(item)">
|
|
127
|
+
<a-select-option key="input">输入框</a-select-option>
|
|
128
|
+
<a-select-option key="select">选择框</a-select-option>
|
|
129
|
+
<a-select-option key="checkbox">多选框</a-select-option>
|
|
130
|
+
<a-select-option key="radio">单选框</a-select-option>
|
|
131
|
+
<a-select-option key="rangePicker">日期范围选择框</a-select-option>
|
|
132
|
+
<a-select-option key="monthPicker">月份选择框</a-select-option>
|
|
133
|
+
<a-select-option key="datePicker">单日选择框</a-select-option>
|
|
134
|
+
<a-select-option key="cascader">级联选择框(单个下拉)</a-select-option>
|
|
135
|
+
<a-select-option key="selects">级联选择框(多个下拉)</a-select-option>
|
|
136
|
+
<a-select-option key="textarea">文本域</a-select-option>
|
|
137
|
+
<a-select-option key="file">文件上传</a-select-option>
|
|
138
|
+
<a-select-option key="image">图片上传</a-select-option>
|
|
139
|
+
<a-popover slot="suffixIcon" title="关于表单类型" placement="right">
|
|
140
|
+
<template slot="content">
|
|
141
|
+
<p>预览设置的表单类型</p>
|
|
142
|
+
<a-input-group compact style="width: 400px;">
|
|
143
|
+
<a-input value="输入框" style="width: 20%" readOnly/>
|
|
144
|
+
<a-input style="width: 80%" placeholder="请输入"/>
|
|
145
|
+
</a-input-group>
|
|
146
|
+
<br/>
|
|
147
|
+
<a-input-group compact style="width: 400px;">
|
|
148
|
+
<a-input value="选择框" style="width: 20%" readOnly/>
|
|
149
|
+
<a-select style="width: 80%" placeholder="请选择"/>
|
|
150
|
+
</a-input-group>
|
|
151
|
+
<br/>
|
|
152
|
+
<a-input-group compact style="width: 400px;">
|
|
153
|
+
<a-input value="多选框" style="width: 20%" readOnly/>
|
|
154
|
+
<a-checkbox-group style="margin-left: 10px;margin-top: 5px; width: 70%" :options="['数据1','数据2']"/>
|
|
155
|
+
</a-input-group>
|
|
156
|
+
<br/>
|
|
157
|
+
<a-input-group compact style="width: 400px;">
|
|
158
|
+
<a-input value="单选框" style="width: 20%" readOnly/>
|
|
159
|
+
<a-radio-group style="margin-left: 10px;margin-top: 5px; width: 70%" :options="[{label: '数据1', value: 'a'},{label: '数据2', value: 'b'}]" name="radioGroup" />
|
|
160
|
+
</a-input-group>
|
|
161
|
+
<br/>
|
|
162
|
+
<a-input-group compact style="width: 400px;">
|
|
163
|
+
<a-input value="日期范围选择框" style="width: 20%" readOnly/>
|
|
164
|
+
<a-range-picker style="width: 80%" :show-time="true" format="YYYY-MM-DD HH:mm:ss" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
|
165
|
+
</a-input-group>
|
|
166
|
+
<br/>
|
|
167
|
+
<a-input-group compact style="width: 400px;">
|
|
168
|
+
<a-input value="月份选择框" style="width: 20%" readOnly/>
|
|
169
|
+
<a-month-picker style="width: 80%"/>
|
|
170
|
+
</a-input-group>
|
|
171
|
+
<br/>
|
|
172
|
+
<a-input-group compact style="width: 400px;">
|
|
173
|
+
<a-input value="单日选择框" style="width: 20%" readOnly/>
|
|
174
|
+
<a-date-picker style="width: 80%"/>
|
|
175
|
+
</a-input-group>
|
|
176
|
+
<br/>
|
|
177
|
+
<a-input-group compact style="width: 400px;">
|
|
178
|
+
<a-input value="级联选择框" style="width: 20%" readOnly/>
|
|
179
|
+
<a-cascader style="width: 80%" placeholder="请选择"/>
|
|
180
|
+
</a-input-group>
|
|
181
|
+
<br/>
|
|
182
|
+
<a-input-group compact style="width: 400px;">
|
|
183
|
+
<a-input value="文本域" style="width: 20%" readOnly/>
|
|
184
|
+
<a-textarea style="width: 80%" placeholder="请输入" :rows="1"/>
|
|
185
|
+
</a-input-group>
|
|
186
|
+
<br/>
|
|
187
|
+
<a-input-group compact style="width: 400px;">
|
|
188
|
+
<a-input value="文件上传" style="width: 20%" readOnly/>
|
|
189
|
+
<a-upload-dragger
|
|
190
|
+
name="file"
|
|
191
|
+
:multiple="true"
|
|
192
|
+
style="margin-left: 5px; width: 75%"
|
|
193
|
+
action="https://www.mocky.io/v2/5cc8019d300000980a055e76">
|
|
194
|
+
<p class="ant-upload-drag-icon">
|
|
195
|
+
<a-icon type="inbox" />
|
|
196
|
+
</p>
|
|
197
|
+
<p class="ant-upload-text">
|
|
198
|
+
点击或拖动文件到该区域上传
|
|
199
|
+
</p>
|
|
200
|
+
<p class="ant-upload-hint">
|
|
201
|
+
支持单个或多个文件
|
|
202
|
+
</p>
|
|
203
|
+
</a-upload-dragger>
|
|
204
|
+
</a-input-group>
|
|
205
|
+
<br/>
|
|
206
|
+
<a-input-group compact style="width: 400px;">
|
|
207
|
+
<a-input value="图片上传" style="width: 20%" readOnly/>
|
|
208
|
+
<a-upload style="margin-left: 5px; width: 75%" list-type="picture-card" :file-list="[]">
|
|
209
|
+
<a-icon type="plus" />
|
|
210
|
+
<div class="ant-upload-text">
|
|
211
|
+
Upload
|
|
212
|
+
</div>
|
|
213
|
+
</a-upload>
|
|
214
|
+
</a-input-group>
|
|
215
|
+
</template>
|
|
216
|
+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
|
217
|
+
</a-popover>
|
|
218
|
+
</a-select>
|
|
219
|
+
</a-form-model-item>
|
|
220
|
+
</a-col>
|
|
221
|
+
<a-col :span="8">
|
|
222
|
+
<a-form-model-item
|
|
223
|
+
label="表单水印"
|
|
224
|
+
prop="placeholder"
|
|
225
|
+
v-if="item.formType !== 'checkbox' && item.formType !== 'radio' && item.formType !== 'file' && item.formType !== 'image'">
|
|
226
|
+
<a-input v-model="item.placeholder" placeholder="表单水印(placeholder),可选" />
|
|
227
|
+
</a-form-model-item>
|
|
228
|
+
</a-col>
|
|
229
|
+
<a-col :span="8">
|
|
230
|
+
<a-form-model-item label="表单查询方式" prop="queryType" v-if="dataMode.queryForm && dataMode.sqlQueryCondition">
|
|
231
|
+
<a-select v-model="item.queryType" placeholder="表单查询方式,可选">
|
|
232
|
+
<a-select-option key="=">相等(=)</a-select-option>
|
|
233
|
+
<a-select-option key="!=">不相等(!=)</a-select-option>
|
|
234
|
+
<a-select-option key="LIKE">全模糊(like)</a-select-option>
|
|
235
|
+
<a-select-option key="LEFT_LIKE">左模糊(left like)</a-select-option>
|
|
236
|
+
<a-select-option key="RIGHT_LIKE">右模糊(right like)</a-select-option>
|
|
237
|
+
<a-select-option key=">">大于(>)</a-select-option>
|
|
238
|
+
<a-select-option key=">=">大于等于(>=)</a-select-option>
|
|
239
|
+
<a-select-option key="<">小于(<)</a-select-option>
|
|
240
|
+
<a-select-option key="<=">小于等于(<=)</a-select-option>
|
|
241
|
+
<a-select-option key="IN">包含(in)</a-select-option>
|
|
242
|
+
<a-select-option key="NOT_IN">不包含(not in)</a-select-option>
|
|
243
|
+
<a-select-option key="BETWEEN">之间(between)</a-select-option>
|
|
244
|
+
</a-select>
|
|
245
|
+
</a-form-model-item>
|
|
246
|
+
</a-col>
|
|
247
|
+
</a-row>
|
|
248
|
+
<a-row :gutter="16" v-if="item.formType === 'file' || item.formType === 'image'">
|
|
249
|
+
<a-col :span="8">
|
|
250
|
+
<a-form-model-item
|
|
251
|
+
label="允许上传文件数量"
|
|
252
|
+
prop="accept"
|
|
253
|
+
v-if="item.formType === 'file' || item.formType === 'image'">
|
|
254
|
+
<a-slider
|
|
255
|
+
v-model="item.acceptCount"
|
|
256
|
+
:min="1"
|
|
257
|
+
:max="20"
|
|
258
|
+
:marks="{ 1: '1', 3: '3', 5: '5', 10: '10', 15: '15', 20: '20'}"
|
|
259
|
+
:default-value="3"
|
|
260
|
+
/>
|
|
261
|
+
</a-form-model-item>
|
|
262
|
+
</a-col>
|
|
263
|
+
<a-col :span="8">
|
|
264
|
+
<a-form-model-item
|
|
265
|
+
label="文件上传模式"
|
|
266
|
+
prop="resUploadMode"
|
|
267
|
+
v-if="item.formType === 'file' || item.formType === 'image'">
|
|
268
|
+
<a-select v-model="item.resUploadMode" placeholder="文件上传模式,默认为服务器" @change="changeFormType(item)">
|
|
269
|
+
<a-select-option key="server">服务器</a-select-option>
|
|
270
|
+
<a-select-option key="oss">腾讯云对象存储</a-select-option>
|
|
271
|
+
<a-select-option key="base64" :disabled="item.formType === 'file'">Base64</a-select-option>
|
|
272
|
+
<a-popover slot="suffixIcon" title="关于资源上传模式" placement="right">
|
|
273
|
+
<template slot="content">
|
|
274
|
+
<p>指定文件上传到服务器,对象存储还是以base64方式存储</p>
|
|
275
|
+
<br/>
|
|
276
|
+
<p><span style="font-weight: bold">服务器:</span>文件上传到服务器,数据库需存储文件于服务器的路径</p>
|
|
277
|
+
<p><span style="font-weight: bold">对象存储:</span>文件上传到云对象存储,数据库需存储文件于对象存储的路径</p>
|
|
278
|
+
<p><span style="font-weight: bold">base64:</span>文件以base64字符串方式存入数据库中(仅图片上传表单支持)</p>
|
|
279
|
+
</template>
|
|
280
|
+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
|
281
|
+
</a-popover>
|
|
282
|
+
</a-select>
|
|
283
|
+
</a-form-model-item>
|
|
284
|
+
</a-col>
|
|
285
|
+
<a-col :span="8">
|
|
286
|
+
<a-form-model-item
|
|
287
|
+
label="允许上传文件类型"
|
|
288
|
+
prop="accept"
|
|
289
|
+
v-if="item.formType === 'file'">
|
|
290
|
+
<a-input v-model="item.accept" placeholder="指定文件类型,默认不限制,可选">
|
|
291
|
+
<a-popover slot="suffix" title="关于允许上传文件类型" placement="bottom">
|
|
292
|
+
<template slot="content">
|
|
293
|
+
<p>指定允许上传的文件类型扩展名,如:.doc,.docx等,详情请参考<a target="_blank" @click="visitAcceptFile">允许上传文件类型</a></p>
|
|
294
|
+
</template>
|
|
295
|
+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
|
296
|
+
</a-popover>
|
|
297
|
+
</a-input>
|
|
298
|
+
</a-form-model-item>
|
|
299
|
+
</a-col>
|
|
300
|
+
<!-- TODO 配置文件上传表单-所属模块 -->
|
|
301
|
+
<!-- TODO 配置文件上传表单-上传扩展目录Key -->
|
|
302
|
+
</a-row>
|
|
303
|
+
<a-row :gutter="16" v-if="item.formType === 'selects'">
|
|
304
|
+
<a-col :span="8">
|
|
305
|
+
<a-form-model-item label="数据所属组别" prop="group">
|
|
306
|
+
<a-select v-model="item.group" placeholder="请输入数据字段名" ref="group">
|
|
307
|
+
<a-select-option v-for="i in groupArray" :key="i">{{ i }}</a-select-option>
|
|
308
|
+
<a-popover slot="suffixIcon" title="关于所属组别" placement="bottom">
|
|
309
|
+
<template slot="content">
|
|
310
|
+
<p>多个下拉框时按照次组别归为一组</p>
|
|
311
|
+
</template>
|
|
312
|
+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
|
313
|
+
</a-popover>
|
|
314
|
+
</a-select>
|
|
315
|
+
</a-form-model-item>
|
|
316
|
+
</a-col>
|
|
317
|
+
<a-col :span="8">
|
|
318
|
+
<a-form-model-item label="组别内顺序" prop="groupIndex">
|
|
319
|
+
<a-select v-model="item.groupIndex" placeholder="表单类型,可选">
|
|
320
|
+
<template v-for="i in 5">
|
|
321
|
+
<a-select-option :key="i">{{ i }}</a-select-option>
|
|
322
|
+
</template>
|
|
323
|
+
<a-popover slot="suffix" title="关于组别内顺序" placement="bottom">
|
|
324
|
+
<template slot="content">
|
|
325
|
+
<p>多个下拉框为一组时,按照此顺序判断页面如何展示以及下拉框得父子顺序</p>
|
|
326
|
+
<p>只有顺序为1得数据字段才可以选择数据源类型</p>
|
|
327
|
+
</template>
|
|
328
|
+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
|
329
|
+
</a-popover>
|
|
330
|
+
</a-select>
|
|
331
|
+
</a-form-model-item>
|
|
332
|
+
</a-col>
|
|
333
|
+
<a-col :span="8">
|
|
334
|
+
<a-form-model-item label="增加组" prop="groupName">
|
|
335
|
+
<a-input-search v-model="item.groupName" @search="addGroupName" placeholder="请输入数据字段名" ref="key">
|
|
336
|
+
<a-button slot="enterButton">
|
|
337
|
+
新增
|
|
338
|
+
</a-button>
|
|
339
|
+
</a-input-search>
|
|
340
|
+
</a-form-model-item>
|
|
341
|
+
</a-col>
|
|
342
|
+
</a-row>
|
|
343
|
+
<a-row :gutter="16">
|
|
344
|
+
<a-col :span="8">
|
|
345
|
+
<a-form-model-item label="数据源类型" prop="selectType" v-if="item.formType === 'select' || (item.formType === 'selects' && item.groupIndex == 1) || item.formType === 'cascader'">
|
|
346
|
+
<a-select v-model="item.selectType" placeholder="请选择数据源类型" @change="changeSelectKey(item)">
|
|
347
|
+
<a-select-option key="key">字典键</a-select-option>
|
|
348
|
+
<a-select-option key="fixArray">固定集合</a-select-option>
|
|
349
|
+
<a-select-option key="logic">业务逻辑</a-select-option>
|
|
350
|
+
<a-popover
|
|
351
|
+
slot="suffixIcon"
|
|
352
|
+
title="关于下拉框或级联框数据源类型"
|
|
353
|
+
placement="bottom">
|
|
354
|
+
<template slot="content">
|
|
355
|
+
<p>设置下拉框或级联框的数据源</p>
|
|
356
|
+
<p>数据源类型分为三种,你可以根据需要选择</p>
|
|
357
|
+
<p>字典键:选项从字典表(t_dictionary)获取,你只需要选择字典键的名称即可</p>
|
|
358
|
+
<p>业务逻辑名称:选项通过发起http请求调用指定的业务逻辑(Logic)接口获取</p>
|
|
359
|
+
<p>固定集合:选项为静态值,JSONArray格式</p>
|
|
360
|
+
<p>当表单类型为 " 级联选择框(多个下拉) " 是数据模式为 [{lable,value,children[{lable,value,children[]},{lable,value,children[]}]}] 形式</p>
|
|
361
|
+
<p>如:</p>
|
|
362
|
+
<json-viewer :value="DemoJson" :expand-depth="parseInt('100')" style="overflow: auto;max-height: 440px"></json-viewer>
|
|
363
|
+
</template>
|
|
364
|
+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
|
365
|
+
</a-popover>
|
|
366
|
+
</a-select>
|
|
367
|
+
</a-form-model-item>
|
|
368
|
+
</a-col>
|
|
369
|
+
<a-col :span="8">
|
|
370
|
+
<a-form-model-item label="数据源" prop="selectKey" v-if="(item.formType === 'select' || (item.formType === 'selects' && item.groupIndex == 1) || item.formType === 'cascader') && item.selectType">
|
|
371
|
+
<a-select
|
|
372
|
+
show-search
|
|
373
|
+
v-model="item.selectKey"
|
|
374
|
+
v-if="item.selectType === 'key'"
|
|
375
|
+
placeholder="请选择字典键"
|
|
376
|
+
:filter-option="filterOption"
|
|
377
|
+
@change="changeSelectKey(item)"
|
|
378
|
+
>
|
|
379
|
+
<template>
|
|
380
|
+
<a-select-option
|
|
381
|
+
v-for="(optionItem,index) in option"
|
|
382
|
+
:key="index"
|
|
383
|
+
:value="Object.keys(optionItem)[0]">{{ optionItem[Object.keys(optionItem)[0]] }}
|
|
384
|
+
</a-select-option>
|
|
385
|
+
</template>
|
|
386
|
+
</a-select>
|
|
387
|
+
<a-input v-model="item.selectKey" v-if="item.selectType === 'logic'" placeholder="请输入业务逻辑名称"/>
|
|
388
|
+
<a-textarea v-model="item.selectKey" v-if="item.selectType === 'fixArray'" placeholder="请录入数据源" />
|
|
389
|
+
</a-form-model-item>
|
|
390
|
+
</a-col>
|
|
391
|
+
<a-col :span="8">
|
|
392
|
+
<a-form-model-item label="数据外键字段名" prop="selectKeyName" v-if="item.formType === 'select'">
|
|
393
|
+
<a-input v-model="item.selectKeyName" placeholder="该列所在表在主表的外键名,可选">
|
|
394
|
+
<a-popover slot="suffix" title="关于数据外键字段名" placement="bottom">
|
|
395
|
+
<template slot="content">
|
|
396
|
+
<p>当该列所属表为主表的关联表,且存在主外键关联关系,你可以指定<span style="font-weight: bold">该列所在表在主表的外键名</span>,如:i.f_type_id</p>
|
|
397
|
+
<p>如果你的<a @click="$refs['key'].focus()">数据字段名</a>所属表为主表,或字段名已经是主表外键名时,不用设置该值</p>
|
|
398
|
+
<p>设置该参数是为了表单查询时可以通过外键id列而非具体值筛选数据</p>
|
|
399
|
+
<p>示例:</p>
|
|
400
|
+
<p>主表为t_userfiles表,别名为u,与t_gasbrand(气表品牌表)有关联关系,别名为g,数据字段名设置为g.f_gasbrand</p>
|
|
401
|
+
<p>如果指定了数据外键字段名,例如u.f_gasbrand_id,则使用数据外键字段名筛选数据,如果不指定该值,则使用<a @click="$refs['key'].focus()">数据字段名</a>筛选</p>
|
|
402
|
+
</template>
|
|
403
|
+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
|
404
|
+
</a-popover>
|
|
405
|
+
</a-input>
|
|
406
|
+
</a-form-model-item>
|
|
407
|
+
</a-col>
|
|
408
|
+
</a-row>
|
|
409
|
+
<a-form-model-item label="表单校验类型" prop="rule">
|
|
410
|
+
<a-row :gutter="16">
|
|
411
|
+
<a-col :span="8" v-if="item.formType === 'input' || item.formType === 'textarea'">
|
|
412
|
+
<a-select v-model="item.rule.type" placeholder="校验类型,可选">
|
|
413
|
+
<a-select-option key="string">字符串</a-select-option>
|
|
414
|
+
<a-select-option key="number">数字</a-select-option>
|
|
415
|
+
<a-select-option key="boolean">布尔值</a-select-option>
|
|
416
|
+
<a-select-option key="regexp">正则表达式</a-select-option>
|
|
417
|
+
<a-select-option key="integer">整数</a-select-option>
|
|
418
|
+
<a-select-option key="float">小数</a-select-option>
|
|
419
|
+
<a-select-option key="array">数组或集合</a-select-option>
|
|
420
|
+
<a-select-option key="date">日期</a-select-option>
|
|
421
|
+
<a-select-option key="email">邮箱</a-select-option>
|
|
422
|
+
<a-popover slot="suffixIcon" title="关于表单校验类型" placement="bottom">
|
|
423
|
+
<template slot="content">
|
|
424
|
+
<p>设置表单项的校验类型,默认字符串类型</p>
|
|
425
|
+
<p>你也可以设置该表单项是否必填</p>
|
|
426
|
+
</template>
|
|
427
|
+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
|
428
|
+
</a-popover>
|
|
429
|
+
</a-select>
|
|
430
|
+
</a-col>
|
|
431
|
+
<a-col :span="8">
|
|
432
|
+
<a-radio-group v-model="item.rule.required" default-value="true" button-style="solid">
|
|
433
|
+
<a-radio-button value="true">
|
|
434
|
+
必选项
|
|
435
|
+
</a-radio-button>
|
|
436
|
+
<a-radio-button value="false">
|
|
437
|
+
非必选项
|
|
438
|
+
</a-radio-button>
|
|
439
|
+
</a-radio-group>
|
|
440
|
+
</a-col>
|
|
441
|
+
</a-row>
|
|
442
|
+
</a-form-model-item>
|
|
443
|
+
<a-row :gutter="16" v-if="dataMode.addOrEditForm && dataMode.sqlQueryItem">
|
|
444
|
+
<a-col :span="8">
|
|
445
|
+
<a-form-model-item ref="addOrEdit" label="新增/修改场景选择" prop="addOrEdit">
|
|
446
|
+
<a-select v-model="item.addOrEdit" placeholder="请选择场景">
|
|
447
|
+
<a-select-option key="all">新增和修改</a-select-option>
|
|
448
|
+
<a-select-option key="add">仅支持新增</a-select-option>
|
|
449
|
+
<a-select-option key="edit">仅支持修改</a-select-option>
|
|
450
|
+
<a-select-option key="silenceAdd">静默新增(不生成表单)</a-select-option>
|
|
451
|
+
<a-popover
|
|
452
|
+
slot="suffixIcon"
|
|
453
|
+
title="关于新增/修改场景选择"
|
|
454
|
+
placement="bottom">
|
|
455
|
+
<template slot="content">
|
|
456
|
+
<p>设置表单项的新增/修改场景</p>
|
|
457
|
+
<p>静默新增类型用于非人为新增的数据,不会生成表单项,且必须设置字段用途</p>
|
|
458
|
+
</template>
|
|
459
|
+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
|
460
|
+
</a-popover>
|
|
461
|
+
</a-select>
|
|
462
|
+
</a-form-model-item>
|
|
463
|
+
</a-col>
|
|
464
|
+
<a-col :span="8">
|
|
465
|
+
<a-form-model-item v-if="item.addOrEdit === 'silenceAdd'" ref="silencePurpose" label="字段用途" prop="silencePurpose">
|
|
466
|
+
<a-select v-model="item.silencePurpose" placeholder="请选择字段用途">
|
|
467
|
+
<a-select-option key="createTime">创建时间</a-select-option>
|
|
468
|
+
<a-select-option key="operator">创建/操作人</a-select-option>
|
|
469
|
+
<a-select-option key="orgId">组织机构ID</a-select-option>
|
|
470
|
+
<a-select-option key="customize">自定义</a-select-option>
|
|
471
|
+
<a-popover
|
|
472
|
+
slot="suffixIcon"
|
|
473
|
+
title="关于字段用途"
|
|
474
|
+
placement="bottom">
|
|
475
|
+
<template slot="content">
|
|
476
|
+
<p>用于静默新增时设置字段用途</p>
|
|
477
|
+
<p>在新增数据的表单提交时,页面会根据设置的字段用途获取相关数据并追加到表单中</p>
|
|
478
|
+
<p>当字段用途选择为<span style="font-weight: bold">自定义</span>时,必须指定一个业务逻辑(Logic)名称,表单提交前会将表单内容作为参数调用该Logic接口,并将Logic返回值作为表单值</p>
|
|
479
|
+
</template>
|
|
480
|
+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
|
481
|
+
</a-popover>
|
|
482
|
+
</a-select>
|
|
483
|
+
</a-form-model-item>
|
|
484
|
+
</a-col>
|
|
485
|
+
<a-col :span="8">
|
|
486
|
+
<a-form-model-item v-if="item.silencePurpose === 'customize'" label="业务逻辑" prop="silenceSource">
|
|
487
|
+
<a-input v-model="item.silenceSource" placeholder="请输入业务逻辑名称"/>
|
|
488
|
+
</a-form-model-item>
|
|
489
|
+
</a-col>
|
|
490
|
+
</a-row>
|
|
491
|
+
</template>
|
|
492
|
+
<template v-if="dataMode.table">
|
|
493
|
+
<a-row :gutter="16">
|
|
494
|
+
<a-col :span="8">
|
|
495
|
+
<a-form-model-item label="作用域插槽" prop="slot">
|
|
496
|
+
<a-select v-model="item.slot.type" placeholder="插槽类型,可选">
|
|
497
|
+
<a-select-option key="default">不设置</a-select-option>
|
|
498
|
+
<a-select-option key="ellipsis">文本溢出省略</a-select-option>
|
|
499
|
+
<a-select-option key="badge">多彩徽标</a-select-option>
|
|
500
|
+
<a-select-option key="date">日期格式化</a-select-option>
|
|
501
|
+
<a-select-option key="dateTime">日期时间格式化</a-select-option>
|
|
502
|
+
<a-select-option key="action">操作列</a-select-option>
|
|
503
|
+
<a-popover slot="suffixIcon" title="关于作用域插槽" placement="bottom">
|
|
504
|
+
<template slot="content">
|
|
505
|
+
<p>你可以通过设置表格列的作用域插槽实现一些效果</p>
|
|
506
|
+
<p>如果没有指定,默认会设置为文本溢出省略(长度:16)</p>
|
|
507
|
+
<p>如果你选择文本溢出省略,需要设置文本溢出上限长度</p>
|
|
508
|
+
<p>如果你选择多彩徽标,需要设置徽标对应的数据样式字典键</p>
|
|
509
|
+
</template>
|
|
510
|
+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
|
511
|
+
</a-popover>
|
|
512
|
+
</a-select>
|
|
513
|
+
</a-form-model-item>
|
|
514
|
+
</a-col>
|
|
515
|
+
<a-col :span="8">
|
|
516
|
+
<a-form-model-item label="表格列宽度" prop="width">
|
|
517
|
+
<a-popover
|
|
518
|
+
title="关于表格列宽度"
|
|
519
|
+
placement="bottom">
|
|
520
|
+
<template slot="content">
|
|
521
|
+
<p>当作用域插槽设置为文本溢出省略时,表格列宽度将自适应,计算方式为文本溢出上限长度 * 7 + 42</p>
|
|
522
|
+
<p>当作用域插槽设置为多彩徽标时,表格列宽度为固定为130</p>
|
|
523
|
+
<p>当作用域插槽设置为日期时间格式化时,表格列宽度为固定为160</p>
|
|
524
|
+
<p>当该列数据过长导致换行时,建议设置作用域插槽为文本溢出省略,或将表格列设置为固定宽度值</p>
|
|
525
|
+
</template>
|
|
526
|
+
<a-input-number style="width: 100%" v-model="item.width" placeholder="表格列宽度,可选"/>
|
|
527
|
+
</a-popover>
|
|
528
|
+
</a-form-model-item>
|
|
529
|
+
</a-col>
|
|
530
|
+
<a-col :span="8">
|
|
531
|
+
<a-form-model-item label="字段默认值" prop="default" v-if="dataMode.sqlQueryItem">
|
|
532
|
+
<a-input v-model="item.default" placeholder="当查询结果为null时,指定默认值,可选" />
|
|
533
|
+
</a-form-model-item>
|
|
534
|
+
</a-col>
|
|
535
|
+
</a-row>
|
|
536
|
+
<a-row :gutter="16">
|
|
537
|
+
<a-col :span="8">
|
|
538
|
+
<a-form-model-item label="文本溢出上限长度" prop="slotValue" v-if="item.slot.type === 'ellipsis'">
|
|
539
|
+
<a-input-number style="width: 100%" v-model="item.slotValue" placeholder="请输入文本溢出上限长度"/>
|
|
540
|
+
</a-form-model-item>
|
|
541
|
+
<a-form-model-item label="徽标字典键" prop="slotKeyMap" v-if="item.slot.type === 'badge'">
|
|
542
|
+
<a-input v-model="item.slotKeyMap" placeholder="请输入徽标字典键">
|
|
543
|
+
<a-popover
|
|
544
|
+
title="关于徽标字典键"
|
|
545
|
+
placement="bottom"
|
|
546
|
+
slot="suffix">
|
|
547
|
+
<template slot="content">
|
|
548
|
+
<p>如果你设置了表单类型为选择框,且数据源是字典键,该值会自动带出</p>
|
|
549
|
+
</template>
|
|
550
|
+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
|
551
|
+
</a-popover>
|
|
552
|
+
</a-input>
|
|
553
|
+
</a-form-model-item>
|
|
554
|
+
<a-form-model-item label="操作列文本" prop="actionText" v-if="item.slot.type === 'action'">
|
|
555
|
+
<a-input v-model="item.actionText" placeholder="请输入操作列显示文本,默认为详情"/>
|
|
556
|
+
</a-form-model-item>
|
|
557
|
+
</a-col>
|
|
558
|
+
</a-row>
|
|
559
|
+
</template>
|
|
560
|
+
<a-alert style="margin-top: 5px" v-if="dataModeArrayData.length === 0" show-icon message="错误:请至少选择一种数据模式" type="error" />
|
|
561
|
+
<a-alert style="margin-top: 5px" v-if="dataMode.addOrEditForm && !dataMode.sqlQueryItem" show-icon message="错误:如果要生成新增/修改表单项,必须勾选生成SQL查询项" type="error" />
|
|
562
|
+
<a-alert style="margin-top: 5px" v-if="(item.formType === 'file' || item.formType === 'image') && !(!dataMode.table && !dataMode.sqlQueryCondition && !dataMode.queryForm)" show-icon message="错误:上传类表单的数据模式只能选择 生成新增/修改表单项 和 生成SQL查询项 " type="error" />
|
|
563
|
+
<a-alert style="margin-top: 5px" v-if="dataMode.queryForm && !dataMode.sqlQueryCondition" show-icon message="提示:您没有勾选生成SQL查询表达式,渲染的表单项不会生成SQL查询条件" type="info" />
|
|
564
|
+
<a-alert style="margin-top: 5px" v-if="dataMode.table && !dataMode.sqlQueryItem" show-icon message="提示:您没有勾选生成SQL查询项,渲染的表格列不会绑定SQL结果集数据" type="info" />
|
|
565
|
+
</a-form-model>
|
|
566
|
+
</a-modal>
|
|
567
|
+
<a-button type="primary" @click="view">操作</a-button>
|
|
568
|
+
</a-col>
|
|
569
|
+
<a-col :xl="10" :lg="12" :md="12" :sm="24" :xs="24">
|
|
570
|
+
<a-card :bordered="false" title="预览" size="small" style="overflow: auto">
|
|
571
|
+
<json-viewer :copyable="{copyText: '复制', copiedText: '已复制'}" :value="result" :expand-depth="parseInt('100')" style="overflow: auto;max-height: 440px"></json-viewer>
|
|
572
|
+
</a-card>
|
|
573
|
+
</a-col>
|
|
574
|
+
</a-row>
|
|
575
|
+
<a-modal
|
|
576
|
+
title="效果预览"
|
|
577
|
+
:width="isMobile ? screenWidth : screenWidth * 0.8"
|
|
578
|
+
:centered="true"
|
|
579
|
+
:visible="modelVisible"
|
|
580
|
+
:zIndex="1001"
|
|
581
|
+
@cancel="onModelClose"
|
|
582
|
+
:destroyOnClose="true">
|
|
583
|
+
<template slot="footer">
|
|
584
|
+
<a-button key="close" @click="onModelClose">
|
|
585
|
+
返回
|
|
586
|
+
</a-button>
|
|
587
|
+
<a-button key="submit" type="primary" @click="submit">
|
|
588
|
+
保存
|
|
589
|
+
</a-button>
|
|
590
|
+
</template>
|
|
591
|
+
<x-form-table
|
|
592
|
+
:view-mode="true"
|
|
593
|
+
:queryParamsJson="result">
|
|
594
|
+
</x-form-table>
|
|
595
|
+
</a-modal>
|
|
596
|
+
</a-drawer>
|
|
597
|
+
</template>
|
|
598
|
+
|
|
599
|
+
<script>
|
|
600
|
+
import XFormItem from '@vue2-client/base-client/components/common/XForm/XFormItem'
|
|
601
|
+
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
|
|
602
|
+
import JsonViewer from 'vue-json-viewer'
|
|
603
|
+
import FileSaver from 'file-saver'
|
|
604
|
+
import { mapState } from 'vuex'
|
|
605
|
+
import { post } from '@vue2-client/services/api/restTools'
|
|
606
|
+
import { commonApi } from '@vue2-client/services/api/common'
|
|
607
|
+
const DemoJson = [{ value: 'zhejiang', label: 'Zhejiang', children: [{ value: 'hangzhou', label: 'Hangzhou', children: [{ value: 'xihu', label: 'West Lake' }] }] }]
|
|
608
|
+
export default {
|
|
609
|
+
name: 'CreateQuery',
|
|
610
|
+
components: {
|
|
611
|
+
JsonViewer,
|
|
612
|
+
XFormTable,
|
|
613
|
+
XFormItem
|
|
614
|
+
},
|
|
615
|
+
data () {
|
|
616
|
+
return {
|
|
617
|
+
DemoJson,
|
|
618
|
+
// 页面宽度
|
|
619
|
+
screenWidth: document.documentElement.clientWidth,
|
|
620
|
+
// 效果预览模态框是否展示
|
|
621
|
+
modelVisible: false,
|
|
622
|
+
// 数据列配置模态框是否展示
|
|
623
|
+
dataColumnVisible: false,
|
|
624
|
+
// 数据列操作类型:新增,修改
|
|
625
|
+
type: '新增',
|
|
626
|
+
// 数据模式类型集合
|
|
627
|
+
dataModeArray: [
|
|
628
|
+
{ label: '生成查询表单项', value: 'queryForm' },
|
|
629
|
+
{ label: '生成表格列', value: 'table' },
|
|
630
|
+
{ label: '生成新增/修改表单项', value: 'addOrEditForm' },
|
|
631
|
+
{ label: '生成SQL查询项', value: 'sqlQueryItem' },
|
|
632
|
+
{ label: '生成SQL查询表达式', value: 'sqlQueryCondition' }
|
|
633
|
+
],
|
|
634
|
+
// 操作按钮状态集合
|
|
635
|
+
buttonStateArray: [
|
|
636
|
+
{ label: '新增', value: 'add' },
|
|
637
|
+
{ label: '修改', value: 'edit' },
|
|
638
|
+
{ label: '删除', value: 'delete' },
|
|
639
|
+
{ label: '导出', value: 'export' }
|
|
640
|
+
],
|
|
641
|
+
// 数据模式类型集合值
|
|
642
|
+
dataModeArrayData: ['queryForm', 'table', 'addOrEditForm', 'sqlQueryItem', 'sqlQueryCondition'],
|
|
643
|
+
// 操作按钮状态集合值
|
|
644
|
+
buttonStateData: ['add', 'edit', 'delete', 'export'],
|
|
645
|
+
labelCol: { span: 4 },
|
|
646
|
+
wrapperCol: { span: 14 },
|
|
647
|
+
form: {
|
|
648
|
+
tableName: '',
|
|
649
|
+
joinArray: {},
|
|
650
|
+
condition: {},
|
|
651
|
+
orderBy: '',
|
|
652
|
+
column: []
|
|
653
|
+
},
|
|
654
|
+
result: {},
|
|
655
|
+
item: {
|
|
656
|
+
key: '',
|
|
657
|
+
title: '',
|
|
658
|
+
slot: {},
|
|
659
|
+
rule: {},
|
|
660
|
+
dataModeArray: []
|
|
661
|
+
},
|
|
662
|
+
itemMap: {},
|
|
663
|
+
selectIndex: null,
|
|
664
|
+
selectType: undefined,
|
|
665
|
+
joinArray: [],
|
|
666
|
+
groupArray: ['默认组别'],
|
|
667
|
+
rules: {
|
|
668
|
+
tableName: [{ required: true, message: '请输入查询表名', trigger: 'blur' }],
|
|
669
|
+
orderBy: [{ required: true, message: '请输入排序方式', trigger: 'blur' }]
|
|
670
|
+
},
|
|
671
|
+
itemRules: {
|
|
672
|
+
key: [{ required: true, message: '请输入数据列名', trigger: 'blur' }],
|
|
673
|
+
title: [{ required: true, message: '请输入中文名称', trigger: 'blur' }],
|
|
674
|
+
selectType: [{ required: true, message: '请选择数据源类型', trigger: 'change' }],
|
|
675
|
+
selectKey: [{ required: true, message: '请输入数据源内容', trigger: 'blur' }],
|
|
676
|
+
slotValue: [{ required: true, message: '请输入文本溢出上限长度', trigger: 'blur' }],
|
|
677
|
+
slotKeyMap: [{ required: true, message: '请输入徽标字典键', trigger: 'blur' }],
|
|
678
|
+
silencePurpose: [{ required: true, message: '请选择字段用途', trigger: 'change' }],
|
|
679
|
+
silenceSource: [{ required: true, message: '请输入业务逻辑名称', trigger: 'blur' }],
|
|
680
|
+
group: [{ required: true, message: '请选择所属组别', trigger: 'blur' }],
|
|
681
|
+
groupIndex: [{ required: true, message: '请选择组内顺序', trigger: 'blur' }]
|
|
682
|
+
|
|
683
|
+
},
|
|
684
|
+
// 字典键集合
|
|
685
|
+
option: []
|
|
686
|
+
}
|
|
687
|
+
},
|
|
688
|
+
mounted () {
|
|
689
|
+
this.initView()
|
|
690
|
+
},
|
|
691
|
+
computed: {
|
|
692
|
+
...mapState('setting', ['isMobile']),
|
|
693
|
+
conditionJoinArray: function () {
|
|
694
|
+
const result = []
|
|
695
|
+
for (const item in this.form.joinArray) {
|
|
696
|
+
if (item !== '') {
|
|
697
|
+
result.push({
|
|
698
|
+
label: item,
|
|
699
|
+
value: item
|
|
700
|
+
})
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
if (result.length === 0) {
|
|
704
|
+
result.push({
|
|
705
|
+
label: '-',
|
|
706
|
+
value: '-'
|
|
707
|
+
})
|
|
708
|
+
}
|
|
709
|
+
return result
|
|
710
|
+
},
|
|
711
|
+
dataMode: function () {
|
|
712
|
+
const result = {
|
|
713
|
+
queryForm: false,
|
|
714
|
+
table: false,
|
|
715
|
+
addOrEditForm: false,
|
|
716
|
+
sqlQueryItem: false,
|
|
717
|
+
sqlQueryCondition: false
|
|
718
|
+
}
|
|
719
|
+
for (const item of this.dataModeArrayData) {
|
|
720
|
+
result[item] = true
|
|
721
|
+
}
|
|
722
|
+
return result
|
|
723
|
+
},
|
|
724
|
+
buttonState: function () {
|
|
725
|
+
const result = {
|
|
726
|
+
add: false,
|
|
727
|
+
edit: false,
|
|
728
|
+
delete: false,
|
|
729
|
+
export: false
|
|
730
|
+
}
|
|
731
|
+
for (const item of this.buttonStateData) {
|
|
732
|
+
result[item] = true
|
|
733
|
+
}
|
|
734
|
+
return result
|
|
735
|
+
}
|
|
736
|
+
},
|
|
737
|
+
props: {
|
|
738
|
+
visible: {
|
|
739
|
+
type: Boolean,
|
|
740
|
+
default: false
|
|
741
|
+
},
|
|
742
|
+
toEditJson: {
|
|
743
|
+
type: Object,
|
|
744
|
+
default: () => {}
|
|
745
|
+
}
|
|
746
|
+
},
|
|
747
|
+
watch: {
|
|
748
|
+
visible (rel) {
|
|
749
|
+
if (rel) {
|
|
750
|
+
this.initView()
|
|
751
|
+
}
|
|
752
|
+
if (rel && this.toEditJson) {
|
|
753
|
+
// 处理预设关联表
|
|
754
|
+
if (this.joinArray.length === 0) {
|
|
755
|
+
for (const key in this.toEditJson.joinArray) {
|
|
756
|
+
this.joinArray.push({
|
|
757
|
+
key: key,
|
|
758
|
+
value: this.toEditJson.joinArray[key]
|
|
759
|
+
})
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
// 处理具体表单项
|
|
763
|
+
this.form = Object.assign(
|
|
764
|
+
{
|
|
765
|
+
tableName: '',
|
|
766
|
+
joinArray: {},
|
|
767
|
+
condition: {},
|
|
768
|
+
orderBy: '',
|
|
769
|
+
column: []
|
|
770
|
+
}, this.toEditJson
|
|
771
|
+
)
|
|
772
|
+
for (const columnItem of this.form.column) {
|
|
773
|
+
// 数据模式兼容性处理
|
|
774
|
+
if (!(columnItem.dataMode || columnItem.dataModeArray)) {
|
|
775
|
+
columnItem.dataModeArray = ['queryForm', 'table', 'addOrEditForm', 'sqlQueryItem', 'sqlQueryCondition']
|
|
776
|
+
} else if (columnItem.dataMode) {
|
|
777
|
+
if (columnItem.dataMode === 'all') {
|
|
778
|
+
columnItem.dataModeArray = ['queryForm', 'table', 'addOrEditForm', 'sqlQueryItem', 'sqlQueryCondition']
|
|
779
|
+
} else if (columnItem.dataMode === 'form') {
|
|
780
|
+
columnItem.dataModeArray = ['queryForm', 'addOrEditForm', 'sqlQueryCondition']
|
|
781
|
+
} else if (columnItem.dataMode === 'table') {
|
|
782
|
+
columnItem.dataModeArray = ['table', 'sqlQueryItem']
|
|
783
|
+
} else if (columnItem.dataMode === 'table_form') {
|
|
784
|
+
columnItem.dataModeArray = ['table', 'sqlQueryItem', 'sqlQueryCondition']
|
|
785
|
+
} else if (columnItem.dataMode === 'only_form') {
|
|
786
|
+
columnItem.dataModeArray = ['queryForm']
|
|
787
|
+
} else if (columnItem.dataMode === 'only_table') {
|
|
788
|
+
columnItem.dataModeArray = ['table']
|
|
789
|
+
} else if (columnItem.dataMode === 'clear') {
|
|
790
|
+
columnItem.dataModeArray = ['sqlQueryItem', 'sqlQueryCondition']
|
|
791
|
+
} else if (columnItem.dataMode === 'only_add_modify') {
|
|
792
|
+
columnItem.dataModeArray = ['addOrEditForm', 'sqlQueryItem']
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
delete columnItem.dataMode
|
|
796
|
+
// 插槽兼容处理
|
|
797
|
+
if (columnItem.slot) {
|
|
798
|
+
if (columnItem.slot.value && columnItem.slot.type === 'ellipsis') {
|
|
799
|
+
columnItem.slotValue = columnItem.slot.value
|
|
800
|
+
} else if (columnItem.slot.keyMap && columnItem.slot.type === 'badge') {
|
|
801
|
+
columnItem.slotKeyMap = columnItem.slot.keyMap
|
|
802
|
+
} else if (columnItem.slot.actionText && columnItem.slot.type === 'action') {
|
|
803
|
+
columnItem.actionText = columnItem.slot.actionText
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
// 必选项兼容处理
|
|
807
|
+
if (columnItem.rule && !isNaN(columnItem.rule.required)) {
|
|
808
|
+
columnItem.rule.required = columnItem.rule.required.toString()
|
|
809
|
+
}
|
|
810
|
+
// 下拉框数据源兼容处理
|
|
811
|
+
if ((columnItem.formType === 'select' || columnItem.formType === 'cascader') && columnItem.selectKey) {
|
|
812
|
+
// 数据源为logic
|
|
813
|
+
if (columnItem.selectKey instanceof String && columnItem.selectKey.startsWith('logic@')) {
|
|
814
|
+
columnItem.selectType = 'logic'
|
|
815
|
+
} else if (columnItem.selectKey instanceof Array || this.isJSON(columnItem.selectKey)) {
|
|
816
|
+
// 数据源为固定json集合
|
|
817
|
+
if (columnItem.selectKey instanceof Array) {
|
|
818
|
+
columnItem.selectKey = JSON.stringify(columnItem.selectKey)
|
|
819
|
+
}
|
|
820
|
+
columnItem.selectType = 'fixArray'
|
|
821
|
+
} else {
|
|
822
|
+
columnItem.selectType = 'key'
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
this.itemMap[columnItem.key] = Object.assign({
|
|
826
|
+
key: '',
|
|
827
|
+
title: '',
|
|
828
|
+
slot: {},
|
|
829
|
+
rule: {},
|
|
830
|
+
dataModeArray: []
|
|
831
|
+
}, columnItem)
|
|
832
|
+
}
|
|
833
|
+
// 处理操作按钮配置
|
|
834
|
+
if (this.toEditJson.buttonState) {
|
|
835
|
+
this.buttonStateData = []
|
|
836
|
+
for (const buttonStateKey of Object.keys(this.toEditJson.buttonState)) {
|
|
837
|
+
if (this.toEditJson.buttonState[buttonStateKey]) {
|
|
838
|
+
this.buttonStateData.push(buttonStateKey)
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
},
|
|
845
|
+
methods: {
|
|
846
|
+
// 添加多个下拉框分组标识符
|
|
847
|
+
addGroupName (val) {
|
|
848
|
+
this.item.groupName = undefined
|
|
849
|
+
if (!this.groupArray.find(item => item === val)) {
|
|
850
|
+
this.groupArray.push(val)
|
|
851
|
+
}
|
|
852
|
+
},
|
|
853
|
+
// 初始化组件
|
|
854
|
+
initView () {
|
|
855
|
+
this.joinArray = []
|
|
856
|
+
this.result = {}
|
|
857
|
+
post(commonApi.getDictionaryParam, {}).then(res => {
|
|
858
|
+
this.option = res
|
|
859
|
+
})
|
|
860
|
+
},
|
|
861
|
+
onClose () {
|
|
862
|
+
this.$emit('update:visible', false)
|
|
863
|
+
},
|
|
864
|
+
filterOption (input, option) {
|
|
865
|
+
return (
|
|
866
|
+
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
867
|
+
)
|
|
868
|
+
},
|
|
869
|
+
onModelClose () {
|
|
870
|
+
this.modelVisible = false
|
|
871
|
+
},
|
|
872
|
+
addJoinItem () {
|
|
873
|
+
this.joinArray.push({
|
|
874
|
+
key: '',
|
|
875
|
+
value: ''
|
|
876
|
+
})
|
|
877
|
+
this.changeJoinArray()
|
|
878
|
+
},
|
|
879
|
+
removeJoinItem (index) {
|
|
880
|
+
this.joinArray.splice(index, 1)
|
|
881
|
+
this.changeJoinArray()
|
|
882
|
+
},
|
|
883
|
+
addColumnItem () {
|
|
884
|
+
this.type = '新增'
|
|
885
|
+
this.dataColumnVisible = true
|
|
886
|
+
},
|
|
887
|
+
editColumnItem (key, index) {
|
|
888
|
+
if (this.itemMap[key]) {
|
|
889
|
+
this.type = '修改'
|
|
890
|
+
this.item = this.itemMap[key]
|
|
891
|
+
this.dataModeArrayData = this.item.dataModeArray
|
|
892
|
+
this.selectIndex = index
|
|
893
|
+
this.dataColumnVisible = true
|
|
894
|
+
} else {
|
|
895
|
+
this.$message.warn('编辑失败')
|
|
896
|
+
}
|
|
897
|
+
},
|
|
898
|
+
removeColumnItem (key, index) {
|
|
899
|
+
const _this = this
|
|
900
|
+
this.$confirm({
|
|
901
|
+
title: '您确定要删除该数据项?',
|
|
902
|
+
content: '删除的数据项无法恢复',
|
|
903
|
+
okText: '确定',
|
|
904
|
+
okType: 'danger',
|
|
905
|
+
cancelText: '取消',
|
|
906
|
+
onOk () {
|
|
907
|
+
delete _this.itemMap[key]
|
|
908
|
+
_this.form.column.splice(index, 1)
|
|
909
|
+
}
|
|
910
|
+
})
|
|
911
|
+
},
|
|
912
|
+
upColumnItem (key, index) {
|
|
913
|
+
const newIndex = index - 1
|
|
914
|
+
const itemA = this.form.column[newIndex]
|
|
915
|
+
const itemB = this.form.column[index]
|
|
916
|
+
this.form.column.splice(index, 1, itemA)
|
|
917
|
+
this.form.column.splice(newIndex, 1, itemB)
|
|
918
|
+
},
|
|
919
|
+
downColumnItem (key, index) {
|
|
920
|
+
const newIndex = index + 1
|
|
921
|
+
const itemA = this.form.column[newIndex]
|
|
922
|
+
const itemB = this.form.column[index]
|
|
923
|
+
this.form.column.splice(index, 1, itemA)
|
|
924
|
+
this.form.column.splice(newIndex, 1, itemB)
|
|
925
|
+
},
|
|
926
|
+
changeJoinArray () {
|
|
927
|
+
const joinArrayObject = {}
|
|
928
|
+
for (const item of this.joinArray) {
|
|
929
|
+
joinArrayObject[item.key] = item.value
|
|
930
|
+
}
|
|
931
|
+
this.form.joinArray = joinArrayObject
|
|
932
|
+
},
|
|
933
|
+
submitItem () {
|
|
934
|
+
this.$refs.itemForm.validate(valid => {
|
|
935
|
+
if (valid) {
|
|
936
|
+
if (this.dataModeArrayData.length === 0) {
|
|
937
|
+
this.$message.error('请至少选择一种数据模式')
|
|
938
|
+
return
|
|
939
|
+
}
|
|
940
|
+
if (this.dataMode.addOrEditForm && !this.dataMode.sqlQueryItem) {
|
|
941
|
+
this.$message.error('如果要生成新增/修改表单项,必须勾选生成SQL查询项')
|
|
942
|
+
return
|
|
943
|
+
}
|
|
944
|
+
if ((this.item.formType === 'file' || this.item.formType === 'image') && !(!this.dataMode.table && !this.dataMode.sqlQueryCondition && !this.dataMode.queryForm)) {
|
|
945
|
+
this.$message.error('上传类表单的数据模式只能选择 生成新增/修改表单项 和 生成SQL查询项')
|
|
946
|
+
return
|
|
947
|
+
}
|
|
948
|
+
this.itemHandle()
|
|
949
|
+
}
|
|
950
|
+
})
|
|
951
|
+
},
|
|
952
|
+
itemHandle () {
|
|
953
|
+
const str = JSON.stringify(this.item)
|
|
954
|
+
const item = JSON.parse(str)
|
|
955
|
+
this.itemMap[item.key] = JSON.parse(str)
|
|
956
|
+
this.itemMap[item.key].dataModeArray = this.dataModeArrayData
|
|
957
|
+
// 查询表单项或者新增/修改表单项
|
|
958
|
+
if (this.dataMode.queryForm || this.dataMode.addOrEditForm) {
|
|
959
|
+
if (!this.dataMode.sqlQueryItem || !this.dataMode.addOrEditForm) {
|
|
960
|
+
delete item.addOrEdit
|
|
961
|
+
delete item.silencePurpose
|
|
962
|
+
delete item.silenceSource
|
|
963
|
+
}
|
|
964
|
+
// 不生成SQL查询表达式,或者表单查询类型为=
|
|
965
|
+
if (!this.dataMode.sqlQueryCondition || (item.queryType && item.queryType === '=')) {
|
|
966
|
+
delete item.queryType
|
|
967
|
+
}
|
|
968
|
+
// 表单类型为输入框
|
|
969
|
+
if (item.formType && item.formType === 'input') {
|
|
970
|
+
delete item.formType
|
|
971
|
+
}
|
|
972
|
+
// 校验类型
|
|
973
|
+
if (!item.rule.type) {
|
|
974
|
+
delete item.rule
|
|
975
|
+
} else {
|
|
976
|
+
if (item.rule.required) {
|
|
977
|
+
item.rule.required = item.rule.required.toString() === 'true'
|
|
978
|
+
} else {
|
|
979
|
+
item.rule.required = true
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
// 下拉框
|
|
983
|
+
if ((item.formType === 'select' || (item.formType === 'selects' && item.groupIndex == '1') || item.formType === 'cascader') && item.selectKey) {
|
|
984
|
+
// 数据源为logic
|
|
985
|
+
if (item.selectType === 'logic') {
|
|
986
|
+
// 如果已经有了 logic@ 将不再拼接
|
|
987
|
+
if (item.selectKey.substring(0, 6) !== 'logic@') {
|
|
988
|
+
item.selectKey = 'logic@' + item.selectKey
|
|
989
|
+
}
|
|
990
|
+
} else if (item.selectType === 'fixArray') {
|
|
991
|
+
// 数据源为固定json集合
|
|
992
|
+
if (!this.isJSON(item.selectKey)) {
|
|
993
|
+
this.$message.warning('下拉框数据源不是JSON集合')
|
|
994
|
+
return
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
if (item.formType !== 'selects') {
|
|
998
|
+
delete item.selectType
|
|
999
|
+
}
|
|
1000
|
+
} else {
|
|
1001
|
+
if (item.formType !== 'selects') {
|
|
1002
|
+
delete item.group
|
|
1003
|
+
delete item.groupIndex
|
|
1004
|
+
}
|
|
1005
|
+
delete item.selectType
|
|
1006
|
+
delete item.selectKey
|
|
1007
|
+
delete item.selectKeyName
|
|
1008
|
+
}
|
|
1009
|
+
} else {
|
|
1010
|
+
delete item.queryType
|
|
1011
|
+
delete item.formType
|
|
1012
|
+
delete item.addOrEdit
|
|
1013
|
+
delete item.silencePurpose
|
|
1014
|
+
delete item.silenceSource
|
|
1015
|
+
delete item.placeholder
|
|
1016
|
+
delete item.rule
|
|
1017
|
+
delete item.selectType
|
|
1018
|
+
delete item.selectKey
|
|
1019
|
+
delete item.selectKeyName
|
|
1020
|
+
}
|
|
1021
|
+
// 表格列
|
|
1022
|
+
if (this.dataMode.table) {
|
|
1023
|
+
if (item.slot.type && item.slot.type !== 'default') {
|
|
1024
|
+
if (item.slotValue && item.slot.type === 'ellipsis') {
|
|
1025
|
+
item.slot.value = item.slotValue
|
|
1026
|
+
} else if (item.slotKeyMap && item.slot.type === 'badge') {
|
|
1027
|
+
item.slot.keyMap = item.slotKeyMap
|
|
1028
|
+
} else if (item.actionText && item.slot.type === 'action') {
|
|
1029
|
+
item.slot.actionText = item.actionText
|
|
1030
|
+
}
|
|
1031
|
+
} else {
|
|
1032
|
+
delete item.slot
|
|
1033
|
+
}
|
|
1034
|
+
if (!item.width) {
|
|
1035
|
+
delete item.width
|
|
1036
|
+
}
|
|
1037
|
+
delete item.slotValue
|
|
1038
|
+
delete item.slotKeyMap
|
|
1039
|
+
delete item.actionText
|
|
1040
|
+
} else {
|
|
1041
|
+
delete item.slot
|
|
1042
|
+
delete item.slotValue
|
|
1043
|
+
delete item.slotKeyMap
|
|
1044
|
+
delete item.actionText
|
|
1045
|
+
delete item.width
|
|
1046
|
+
}
|
|
1047
|
+
// SQL查询项
|
|
1048
|
+
if (!this.dataMode.sqlQueryItem) {
|
|
1049
|
+
delete item.default
|
|
1050
|
+
}
|
|
1051
|
+
item.dataModeArray = this.dataModeArrayData
|
|
1052
|
+
if (this.type === '新增') {
|
|
1053
|
+
this.form.column.push(item)
|
|
1054
|
+
} else {
|
|
1055
|
+
this.form.column[this.selectIndex] = item
|
|
1056
|
+
}
|
|
1057
|
+
this.item = {
|
|
1058
|
+
key: '',
|
|
1059
|
+
title: '',
|
|
1060
|
+
slot: {},
|
|
1061
|
+
rule: {},
|
|
1062
|
+
dataModeArray: []
|
|
1063
|
+
}
|
|
1064
|
+
this.$message.success('增加成功')
|
|
1065
|
+
this.dataModeArrayData = ['queryForm', 'table', 'addOrEditForm', 'sqlQueryItem', 'sqlQueryCondition']
|
|
1066
|
+
this.dataColumnVisible = false
|
|
1067
|
+
},
|
|
1068
|
+
// 判断是否为json字符串
|
|
1069
|
+
isJSON (str) {
|
|
1070
|
+
if (typeof str == 'string') {
|
|
1071
|
+
try {
|
|
1072
|
+
const obj = JSON.parse(str)
|
|
1073
|
+
return !!(typeof obj == 'object' && obj)
|
|
1074
|
+
} catch (e) {
|
|
1075
|
+
return false
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
},
|
|
1079
|
+
exportJson () {
|
|
1080
|
+
const data = JSON.stringify(this.form, null, 2)
|
|
1081
|
+
const blob = new Blob([data], { type: 'application/json' })
|
|
1082
|
+
FileSaver.saveAs(blob, `Query.json`)
|
|
1083
|
+
this.$message.success('导出成功!')
|
|
1084
|
+
},
|
|
1085
|
+
viewHandle (then) {
|
|
1086
|
+
if (this.form.column.length === 0) {
|
|
1087
|
+
this.$message.error('你没有增加任何数据字段')
|
|
1088
|
+
return
|
|
1089
|
+
}
|
|
1090
|
+
this.result = JSON.parse(JSON.stringify(this.form))
|
|
1091
|
+
if (this.result.condition && (!this.result.condition.value || this.result.condition.value === '')) {
|
|
1092
|
+
delete this.result.condition
|
|
1093
|
+
}
|
|
1094
|
+
for (const item of this.result.column) {
|
|
1095
|
+
if (item.selectType === 'fixArray') {
|
|
1096
|
+
item.selectKey = JSON.parse(item.selectKey)
|
|
1097
|
+
}
|
|
1098
|
+
if (item.dataModeArray.length === 5) {
|
|
1099
|
+
delete item.dataModeArray
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
if (this.buttonStateData.length !== 4) {
|
|
1103
|
+
this.result.buttonState = this.buttonState
|
|
1104
|
+
}
|
|
1105
|
+
then()
|
|
1106
|
+
},
|
|
1107
|
+
view () {
|
|
1108
|
+
this.$refs.businessCreateForm.validate(valid => {
|
|
1109
|
+
if (valid) {
|
|
1110
|
+
this.viewHandle(() => {
|
|
1111
|
+
this.modelVisible = true
|
|
1112
|
+
})
|
|
1113
|
+
}
|
|
1114
|
+
})
|
|
1115
|
+
},
|
|
1116
|
+
submit () {
|
|
1117
|
+
this.onModelClose()
|
|
1118
|
+
this.$refs.businessCreateForm.validate(valid => {
|
|
1119
|
+
if (valid) {
|
|
1120
|
+
this.viewHandle(() => {
|
|
1121
|
+
// saveQueryParams
|
|
1122
|
+
this.$emit('saveQueryParams', this.result)
|
|
1123
|
+
})
|
|
1124
|
+
}
|
|
1125
|
+
})
|
|
1126
|
+
},
|
|
1127
|
+
modelCancel () {
|
|
1128
|
+
this.dataColumnVisible = false
|
|
1129
|
+
// 延迟是为了避免编辑数据窗口关闭时重置表单导致的闪烁
|
|
1130
|
+
setTimeout(() => {
|
|
1131
|
+
this.item = {
|
|
1132
|
+
key: '',
|
|
1133
|
+
title: '',
|
|
1134
|
+
slot: {},
|
|
1135
|
+
rule: {},
|
|
1136
|
+
dataModeArray: []
|
|
1137
|
+
}
|
|
1138
|
+
this.dataModeArrayData = ['queryForm', 'table', 'addOrEditForm', 'sqlQueryItem', 'sqlQueryCondition']
|
|
1139
|
+
}, 100)
|
|
1140
|
+
},
|
|
1141
|
+
changeFormType (item) {
|
|
1142
|
+
if (item.formType === 'file' || item.formType === 'image') {
|
|
1143
|
+
this.dataModeArrayData = ['addOrEditForm', 'sqlQueryItem']
|
|
1144
|
+
}
|
|
1145
|
+
},
|
|
1146
|
+
changeSelectKey (item) {
|
|
1147
|
+
if (item.selectType === 'key' && item.selectKey) {
|
|
1148
|
+
item.slot.type = 'badge'
|
|
1149
|
+
item.slotKeyMap = item.selectKey
|
|
1150
|
+
}
|
|
1151
|
+
},
|
|
1152
|
+
visitAcceptFile () {
|
|
1153
|
+
window.open('https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/input/file#attr-accept')
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
</script>
|
|
1158
|
+
<style lang="less" scoped>
|
|
1159
|
+
</style>
|