vue2-client 0.1.0 → 1.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/.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 +54 -36
- package/babel.config.js +11 -2
- package/docs/index.md +29 -0
- package/jest.config.js +3 -0
- package/package.json +68 -22
- package/public/index.html +13 -3
- 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 +0 -0
- 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 +2 -2
- 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/index.js +28 -35
- 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/config.js +23 -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 +152 -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,42 @@
|
|
|
1
|
+
# CreateQuery 完整查询配置生成
|
|
2
|
+
|
|
3
|
+
提供完整查询配置生成的快捷组件
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## 何时使用
|
|
8
|
+
|
|
9
|
+
允许生成完整查询配置
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
引用方式:
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
import CreateQuery from '@/base-client/components/CreateQuery'
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
components: {
|
|
20
|
+
CreateQuery
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## 代码演示
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
<create-query
|
|
31
|
+
:toEditJson="toEditJson"
|
|
32
|
+
:visible.sync="createQueryVisible"
|
|
33
|
+
/>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## API
|
|
37
|
+
|
|
38
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
39
|
+
|------------------|------------------------------------------|---------|-----------|
|
|
40
|
+
| visible | 是否显示 | Boolean | false |
|
|
41
|
+
| toEditJson | 要编辑的json 当 visible 从false变成true时解析加载到页面上 | Object | undefined |
|
|
42
|
+
| @saveQueryParams | 查询配置点击保存后事件 | event | - |
|
|
@@ -0,0 +1,540 @@
|
|
|
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="group">
|
|
19
|
+
<a-input v-model="form.group" placeholder="设置表单项的组名,如:设置上报参数" />
|
|
20
|
+
</a-form-model-item>
|
|
21
|
+
<a-form-model-item label="参数组描述" prop="describe">
|
|
22
|
+
<a-input v-model="form.describe" placeholder="简单描述参数组,如:用于配置物联网设备的上报参数" />
|
|
23
|
+
</a-form-model-item>
|
|
24
|
+
<a-form-model-item label="数据字段" prop="column">
|
|
25
|
+
<a-button type="primary" @click="addColumnItem()">增加</a-button>
|
|
26
|
+
<div v-for="(columnItem, index) in form.column" :key="index">
|
|
27
|
+
<a-row :gutter="16">
|
|
28
|
+
<a-col :span="16">
|
|
29
|
+
<span style="font-weight: bold">{{ columnItem.title }}({{ columnItem.key }})</span>
|
|
30
|
+
</a-col>
|
|
31
|
+
<a-col v-if="index > 0 && form.column.length > 1" :span="2">
|
|
32
|
+
<a-icon type="up-square" @click="upColumnItem(columnItem.key,index)"/>
|
|
33
|
+
</a-col>
|
|
34
|
+
<a-col v-if="(index !== form.column.length - 1) && form.column.length > 1" :span="2">
|
|
35
|
+
<a-icon type="down-square" @click="downColumnItem(columnItem.key,index)"/>
|
|
36
|
+
</a-col>
|
|
37
|
+
<a-col :span="2">
|
|
38
|
+
<a-icon type="edit" @click="editColumnItem(columnItem.key,index)"/>
|
|
39
|
+
</a-col>
|
|
40
|
+
<a-col :span="2">
|
|
41
|
+
<a-icon type="close" @click="removeColumnItem(columnItem.key,index)"/>
|
|
42
|
+
</a-col>
|
|
43
|
+
</a-row>
|
|
44
|
+
</div>
|
|
45
|
+
</a-form-model-item>
|
|
46
|
+
</a-form-model>
|
|
47
|
+
<a-modal
|
|
48
|
+
title="数据字段配置"
|
|
49
|
+
:visible="dataColumnVisible"
|
|
50
|
+
:width="1000"
|
|
51
|
+
:zIndex="1001"
|
|
52
|
+
@cancel="modelCancel"
|
|
53
|
+
@ok="submitItem">
|
|
54
|
+
<a-form-model
|
|
55
|
+
ref="itemForm"
|
|
56
|
+
:rules="itemRules"
|
|
57
|
+
:model="item">
|
|
58
|
+
<a-row :gutter="16">
|
|
59
|
+
<a-col :span="8">
|
|
60
|
+
<a-form-model-item label="表单项名" prop="key">
|
|
61
|
+
<a-input v-model="item.key" placeholder="请输入表单项名" ref="key">
|
|
62
|
+
<a-popover slot="suffix" title="关于表单项名" placement="bottom">
|
|
63
|
+
<template slot="content">
|
|
64
|
+
<p>设置表单项的名称</p>
|
|
65
|
+
</template>
|
|
66
|
+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
|
67
|
+
</a-popover>
|
|
68
|
+
</a-input>
|
|
69
|
+
</a-form-model-item>
|
|
70
|
+
</a-col>
|
|
71
|
+
<a-col :span="8">
|
|
72
|
+
<a-form-model-item label="表单项中文名" prop="title">
|
|
73
|
+
<a-input v-model="item.title" placeholder="请输入表单项中文名,如:姓名" />
|
|
74
|
+
</a-form-model-item>
|
|
75
|
+
</a-col>
|
|
76
|
+
</a-row>
|
|
77
|
+
<template>
|
|
78
|
+
<a-row :gutter="16">
|
|
79
|
+
<a-col :span="8">
|
|
80
|
+
<a-form-model-item label="表单类型" prop="formType">
|
|
81
|
+
<a-select v-model="item.formType" placeholder="表单类型,可选">
|
|
82
|
+
<a-select-option key="input">输入框</a-select-option>
|
|
83
|
+
<a-select-option key="select">选择框</a-select-option>
|
|
84
|
+
<a-select-option key="rangePicker">日期范围选择框</a-select-option>
|
|
85
|
+
<a-select-option key="monthPicker">月份选择框</a-select-option>
|
|
86
|
+
<a-select-option key="datePicker">单日选择框</a-select-option>
|
|
87
|
+
<a-select-option key="cascader">级联选择框</a-select-option>
|
|
88
|
+
<a-select-option key="textarea">文本域</a-select-option>
|
|
89
|
+
<a-popover slot="suffixIcon" title="关于表单类型" placement="bottom">
|
|
90
|
+
<template slot="content">
|
|
91
|
+
<p>预览设置的表单类型</p>
|
|
92
|
+
<a-input-group compact style="width: 400px;">
|
|
93
|
+
<a-input value="输入框" style="width: 20%" readOnly/>
|
|
94
|
+
<a-input style="width: 80%" placeholder="请输入"/>
|
|
95
|
+
</a-input-group>
|
|
96
|
+
<br/>
|
|
97
|
+
<a-input-group compact style="width: 400px;">
|
|
98
|
+
<a-input value="选择框" style="width: 20%" readOnly/>
|
|
99
|
+
<a-select style="width: 80%" placeholder="请选择"/>
|
|
100
|
+
</a-input-group>
|
|
101
|
+
<br/>
|
|
102
|
+
<a-input-group compact style="width: 400px;">
|
|
103
|
+
<a-input value="日期范围选择框" style="width: 20%" readOnly/>
|
|
104
|
+
<a-range-picker style="width: 80%" :show-time="true" format="YYYY-MM-DD HH:mm:ss" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
|
105
|
+
</a-input-group>
|
|
106
|
+
<br/>
|
|
107
|
+
<a-input-group compact style="width: 400px;">
|
|
108
|
+
<a-input value="月份选择框" style="width: 20%" readOnly/>
|
|
109
|
+
<a-month-picker style="width: 80%"/>
|
|
110
|
+
</a-input-group>
|
|
111
|
+
<br/>
|
|
112
|
+
<a-input-group compact style="width: 400px;">
|
|
113
|
+
<a-input value="单日选择框" style="width: 20%" readOnly/>
|
|
114
|
+
<a-date-picker style="width: 80%"/>
|
|
115
|
+
</a-input-group>
|
|
116
|
+
<br/>
|
|
117
|
+
<a-input-group compact style="width: 400px;">
|
|
118
|
+
<a-input value="级联选择框" style="width: 20%" readOnly/>
|
|
119
|
+
<a-cascader style="width: 80%" placeholder="请选择"/>
|
|
120
|
+
</a-input-group>
|
|
121
|
+
<a-input-group compact style="width: 400px;">
|
|
122
|
+
<a-input value="文本域" style="width: 20%" readOnly/>
|
|
123
|
+
<a-textarea style="width: 80%" placeholder="请输入" :rows="4"/>
|
|
124
|
+
</a-input-group>
|
|
125
|
+
</template>
|
|
126
|
+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
|
127
|
+
</a-popover>
|
|
128
|
+
</a-select>
|
|
129
|
+
</a-form-model-item>
|
|
130
|
+
</a-col>
|
|
131
|
+
<a-col :span="8">
|
|
132
|
+
<a-form-model-item label="表单水印" prop="placeholder">
|
|
133
|
+
<a-input v-model="item.placeholder" placeholder="表单水印(placeholder),可选" />
|
|
134
|
+
</a-form-model-item>
|
|
135
|
+
</a-col>
|
|
136
|
+
</a-row>
|
|
137
|
+
<a-row :gutter="16">
|
|
138
|
+
<a-col :span="8">
|
|
139
|
+
<a-form-model-item label="数据源类型" prop="selectType" v-if="item.formType === 'select' || item.formType === 'cascader'">
|
|
140
|
+
<a-select v-model="item.selectType" placeholder="请选择数据源类型" @change="changeSelectKey(item)">
|
|
141
|
+
<a-select-option key="key">字典键</a-select-option>
|
|
142
|
+
<a-select-option key="fixArray">固定集合</a-select-option>
|
|
143
|
+
<a-select-option key="logic">业务逻辑</a-select-option>
|
|
144
|
+
<a-popover
|
|
145
|
+
slot="suffixIcon"
|
|
146
|
+
title="关于下拉框或级联框数据源类型"
|
|
147
|
+
placement="bottom">
|
|
148
|
+
<template slot="content">
|
|
149
|
+
<p>设置下拉框或级联框的数据源</p>
|
|
150
|
+
<p>数据源类型分为三种,你可以根据需要选择</p>
|
|
151
|
+
<p>字典键:选项从字典表(t_dictionary)获取,你只需要选择字典键的名称即可</p>
|
|
152
|
+
<p>业务逻辑名称:选项通过发起http请求调用指定的Logic接口获取</p>
|
|
153
|
+
<p>固定集合:选项为静态值,JSONArray格式</p>
|
|
154
|
+
</template>
|
|
155
|
+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
|
156
|
+
</a-popover>
|
|
157
|
+
</a-select>
|
|
158
|
+
</a-form-model-item>
|
|
159
|
+
</a-col>
|
|
160
|
+
<a-col :span="8">
|
|
161
|
+
<a-form-model-item label="数据源" prop="selectKey" v-if="(item.formType === 'select' || item.formType === 'cascader') && item.selectType">
|
|
162
|
+
<a-select
|
|
163
|
+
show-search
|
|
164
|
+
v-model="item.selectKey"
|
|
165
|
+
v-if="item.selectType === 'key'"
|
|
166
|
+
placeholder="请选择字典键"
|
|
167
|
+
:filter-option="filterOption"
|
|
168
|
+
@change="changeSelectKey(item)"
|
|
169
|
+
>
|
|
170
|
+
<template>
|
|
171
|
+
<a-select-option
|
|
172
|
+
v-for="(optionItem,index) in option"
|
|
173
|
+
:key="index"
|
|
174
|
+
:value="Object.keys(optionItem)[0]">{{ optionItem[Object.keys(optionItem)[0]] }}
|
|
175
|
+
</a-select-option>
|
|
176
|
+
</template>
|
|
177
|
+
</a-select>
|
|
178
|
+
<a-input v-model="item.selectKey" v-if="item.selectType === 'logic'" placeholder="请输入业务逻辑名称"/>
|
|
179
|
+
<a-textarea v-model="item.selectKey" v-if="item.selectType === 'fixArray'" placeholder="请录入数据源" />
|
|
180
|
+
</a-form-model-item>
|
|
181
|
+
</a-col>
|
|
182
|
+
</a-row>
|
|
183
|
+
<a-form-model-item label="表单校验类型" prop="rule">
|
|
184
|
+
<a-row :gutter="16">
|
|
185
|
+
<a-col :span="8">
|
|
186
|
+
<a-select v-model="item.rule.type" placeholder="校验类型,可选">
|
|
187
|
+
<a-select-option key="string">字符串</a-select-option>
|
|
188
|
+
<a-select-option key="number">数字</a-select-option>
|
|
189
|
+
<a-select-option key="boolean">布尔值</a-select-option>
|
|
190
|
+
<a-select-option key="regexp">正则表达式</a-select-option>
|
|
191
|
+
<a-select-option key="integer">整数</a-select-option>
|
|
192
|
+
<a-select-option key="float">小数</a-select-option>
|
|
193
|
+
<a-select-option key="array">数组或集合</a-select-option>
|
|
194
|
+
<a-select-option key="date">日期</a-select-option>
|
|
195
|
+
<a-select-option key="email">邮箱</a-select-option>
|
|
196
|
+
<a-popover slot="suffixIcon" title="关于表单校验类型" placement="bottom">
|
|
197
|
+
<template slot="content">
|
|
198
|
+
<p>设置表单项的校验类型,默认字符串类型</p>
|
|
199
|
+
<p>你也可以设置该表单项是否必填</p>
|
|
200
|
+
</template>
|
|
201
|
+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
|
202
|
+
</a-popover>
|
|
203
|
+
</a-select>
|
|
204
|
+
</a-col>
|
|
205
|
+
<a-col :span="8">
|
|
206
|
+
<a-radio-group v-model="item.rule.required" v-if="item.rule.type" default-value="true" button-style="solid">
|
|
207
|
+
<a-radio-button value="true">
|
|
208
|
+
必选项
|
|
209
|
+
</a-radio-button>
|
|
210
|
+
<a-radio-button value="false">
|
|
211
|
+
非必选项
|
|
212
|
+
</a-radio-button>
|
|
213
|
+
</a-radio-group>
|
|
214
|
+
</a-col>
|
|
215
|
+
</a-row>
|
|
216
|
+
</a-form-model-item>
|
|
217
|
+
</template>
|
|
218
|
+
</a-form-model>
|
|
219
|
+
</a-modal>
|
|
220
|
+
<a-button type="primary" @click="view">操作</a-button>
|
|
221
|
+
</a-col>
|
|
222
|
+
<a-col :xl="10" :lg="12" :md="12" :sm="24" :xs="24">
|
|
223
|
+
<a-card :bordered="false" title="预览" size="small" style="overflow: auto">
|
|
224
|
+
<json-viewer :copyable="{copyText: '复制', copiedText: '已复制'}" :value="result" :expand-depth="parseInt('100')" style="overflow: auto;max-height: 440px"></json-viewer>
|
|
225
|
+
</a-card>
|
|
226
|
+
</a-col>
|
|
227
|
+
</a-row>
|
|
228
|
+
<x-add-form
|
|
229
|
+
business-title="效果预览"
|
|
230
|
+
business-type="新增"
|
|
231
|
+
:visible.sync="modelVisible"
|
|
232
|
+
:json-data="formItems"
|
|
233
|
+
@onSubmit="submit"/>
|
|
234
|
+
</a-drawer>
|
|
235
|
+
</template>
|
|
236
|
+
|
|
237
|
+
<script>
|
|
238
|
+
import XAddForm from '@/base-client/components/common/XAddForm/XAddForm'
|
|
239
|
+
import JsonViewer from 'vue-json-viewer'
|
|
240
|
+
import FileSaver from 'file-saver'
|
|
241
|
+
import { mapState } from 'vuex'
|
|
242
|
+
import { post } from '@/services/api/restTools'
|
|
243
|
+
import { commonApi } from '@/services/api/common'
|
|
244
|
+
|
|
245
|
+
export default {
|
|
246
|
+
name: 'CreateSimpleFormQuery',
|
|
247
|
+
components: {
|
|
248
|
+
JsonViewer,
|
|
249
|
+
XAddForm
|
|
250
|
+
},
|
|
251
|
+
data () {
|
|
252
|
+
return {
|
|
253
|
+
// 页面宽度
|
|
254
|
+
screenWidth: document.documentElement.clientWidth,
|
|
255
|
+
// 效果预览模态框是否展示
|
|
256
|
+
modelVisible: false,
|
|
257
|
+
// 数据列配置模态框是否展示
|
|
258
|
+
dataColumnVisible: false,
|
|
259
|
+
// 数据列操作类型:新增,修改
|
|
260
|
+
type: '新增',
|
|
261
|
+
labelCol: { span: 4 },
|
|
262
|
+
wrapperCol: { span: 14 },
|
|
263
|
+
form: {
|
|
264
|
+
group: '',
|
|
265
|
+
describe: '',
|
|
266
|
+
column: []
|
|
267
|
+
},
|
|
268
|
+
result: {},
|
|
269
|
+
item: {
|
|
270
|
+
key: '',
|
|
271
|
+
title: '',
|
|
272
|
+
rule: {}
|
|
273
|
+
},
|
|
274
|
+
itemMap: {},
|
|
275
|
+
selectIndex: null,
|
|
276
|
+
selectType: undefined,
|
|
277
|
+
rules: {
|
|
278
|
+
group: [{ required: true, message: '请输入参数组名称', trigger: 'blur' }],
|
|
279
|
+
describe: [{ required: true, message: '请输入参数组描述', trigger: 'blur' }]
|
|
280
|
+
},
|
|
281
|
+
itemRules: {
|
|
282
|
+
key: [{ required: true, message: '请输入表单项名', trigger: 'blur' }],
|
|
283
|
+
title: [{ required: true, message: '请输入中文名称', trigger: 'blur' }],
|
|
284
|
+
selectType: [{ required: true, message: '请选择数据源类型', trigger: 'change' }],
|
|
285
|
+
selectKey: [{ required: true, message: '请输入数据源内容', trigger: 'blur' }]
|
|
286
|
+
},
|
|
287
|
+
formItems: [],
|
|
288
|
+
// 字典键集合
|
|
289
|
+
option: []
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
mounted () {
|
|
293
|
+
this.initView()
|
|
294
|
+
},
|
|
295
|
+
computed: {
|
|
296
|
+
...mapState('setting', ['isMobile'])
|
|
297
|
+
},
|
|
298
|
+
props: {
|
|
299
|
+
visible: {
|
|
300
|
+
type: Boolean,
|
|
301
|
+
default: false
|
|
302
|
+
},
|
|
303
|
+
toEditJson: {
|
|
304
|
+
type: Object,
|
|
305
|
+
default: () => {}
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
watch: {
|
|
309
|
+
visible (rel) {
|
|
310
|
+
if (rel) {
|
|
311
|
+
this.initView()
|
|
312
|
+
}
|
|
313
|
+
if (rel && this.toEditJson) {
|
|
314
|
+
this.form = Object.assign(
|
|
315
|
+
{
|
|
316
|
+
group: '',
|
|
317
|
+
describe: '',
|
|
318
|
+
column: []
|
|
319
|
+
}, this.toEditJson
|
|
320
|
+
)
|
|
321
|
+
for (const columnItem of this.form.column) {
|
|
322
|
+
// 必选项兼容处理
|
|
323
|
+
if (columnItem.rule && !isNaN(columnItem.rule.required)) {
|
|
324
|
+
columnItem.rule.required = columnItem.rule.required.toString()
|
|
325
|
+
}
|
|
326
|
+
// 下拉框数据源兼容处理
|
|
327
|
+
if ((columnItem.formType === 'select' || columnItem.formType === 'cascader') && columnItem.selectKey) {
|
|
328
|
+
// 数据源为logic
|
|
329
|
+
if (columnItem.selectKey instanceof String && columnItem.selectKey.startsWith('logic@')) {
|
|
330
|
+
columnItem.selectType = 'logic'
|
|
331
|
+
} else if (columnItem.selectKey instanceof Array || this.isJSON(columnItem.selectKey)) {
|
|
332
|
+
// 数据源为固定json集合
|
|
333
|
+
if (columnItem.selectKey instanceof Array) {
|
|
334
|
+
columnItem.selectKey = JSON.stringify(columnItem.selectKey)
|
|
335
|
+
}
|
|
336
|
+
columnItem.selectType = 'fixArray'
|
|
337
|
+
} else {
|
|
338
|
+
columnItem.selectType = 'key'
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
this.itemMap[columnItem.key] = Object.assign({
|
|
342
|
+
key: '',
|
|
343
|
+
title: '',
|
|
344
|
+
rule: {}
|
|
345
|
+
}, columnItem)
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
methods: {
|
|
351
|
+
// 初始化组件
|
|
352
|
+
initView () {
|
|
353
|
+
this.result = {}
|
|
354
|
+
post(commonApi.getDictionaryParam, {}).then(res => {
|
|
355
|
+
this.option = res
|
|
356
|
+
})
|
|
357
|
+
},
|
|
358
|
+
onClose () {
|
|
359
|
+
this.$emit('update:visible', false)
|
|
360
|
+
},
|
|
361
|
+
filterOption (input, option) {
|
|
362
|
+
return (
|
|
363
|
+
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
364
|
+
)
|
|
365
|
+
},
|
|
366
|
+
onModelClose () {
|
|
367
|
+
this.modelVisible = false
|
|
368
|
+
},
|
|
369
|
+
addColumnItem () {
|
|
370
|
+
this.type = '新增'
|
|
371
|
+
this.dataColumnVisible = true
|
|
372
|
+
},
|
|
373
|
+
editColumnItem (key, index) {
|
|
374
|
+
if (this.itemMap[key]) {
|
|
375
|
+
this.type = '修改'
|
|
376
|
+
this.item = this.itemMap[key]
|
|
377
|
+
this.selectIndex = index
|
|
378
|
+
this.dataColumnVisible = true
|
|
379
|
+
} else {
|
|
380
|
+
this.$message.warn('编辑失败')
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
removeColumnItem (key, index) {
|
|
384
|
+
const _this = this
|
|
385
|
+
this.$confirm({
|
|
386
|
+
title: '您确定要删除该数据项?',
|
|
387
|
+
content: '删除的数据项无法恢复',
|
|
388
|
+
okText: '确定',
|
|
389
|
+
okType: 'danger',
|
|
390
|
+
cancelText: '取消',
|
|
391
|
+
onOk () {
|
|
392
|
+
delete _this.itemMap[key]
|
|
393
|
+
_this.form.column.splice(index, 1)
|
|
394
|
+
}
|
|
395
|
+
})
|
|
396
|
+
},
|
|
397
|
+
upColumnItem (key, index) {
|
|
398
|
+
const newIndex = index - 1
|
|
399
|
+
const itemA = this.form.column[newIndex]
|
|
400
|
+
const itemB = this.form.column[index]
|
|
401
|
+
this.form.column.splice(index, 1, itemA)
|
|
402
|
+
this.form.column.splice(newIndex, 1, itemB)
|
|
403
|
+
},
|
|
404
|
+
downColumnItem (key, index) {
|
|
405
|
+
const newIndex = index + 1
|
|
406
|
+
const itemA = this.form.column[newIndex]
|
|
407
|
+
const itemB = this.form.column[index]
|
|
408
|
+
this.form.column.splice(index, 1, itemA)
|
|
409
|
+
this.form.column.splice(newIndex, 1, itemB)
|
|
410
|
+
},
|
|
411
|
+
submitItem () {
|
|
412
|
+
this.$refs.itemForm.validate(valid => {
|
|
413
|
+
if (valid) {
|
|
414
|
+
this.itemHandle()
|
|
415
|
+
}
|
|
416
|
+
})
|
|
417
|
+
},
|
|
418
|
+
itemHandle () {
|
|
419
|
+
const str = JSON.stringify(this.item)
|
|
420
|
+
const item = JSON.parse(str)
|
|
421
|
+
this.itemMap[item.key] = JSON.parse(str)
|
|
422
|
+
// 表单类型为输入框
|
|
423
|
+
if (item.formType && item.formType === 'input') {
|
|
424
|
+
delete item.formType
|
|
425
|
+
}
|
|
426
|
+
// 校验类型
|
|
427
|
+
if (!item.rule.type) {
|
|
428
|
+
delete item.rule
|
|
429
|
+
} else {
|
|
430
|
+
if (item.rule.required) {
|
|
431
|
+
item.rule.required = item.rule.required.toString() === 'true'
|
|
432
|
+
} else {
|
|
433
|
+
item.rule.required = true
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
// 下拉框
|
|
437
|
+
if ((item.formType === 'select' || item.formType === 'cascader') && item.selectKey) {
|
|
438
|
+
// 数据源为logic
|
|
439
|
+
if (item.selectType === 'logic') {
|
|
440
|
+
item.selectKey = 'logic@' + item.selectKey
|
|
441
|
+
} else if (item.selectType === 'fixArray') {
|
|
442
|
+
// 数据源为固定json集合
|
|
443
|
+
if (!this.isJSON(item.selectKey)) {
|
|
444
|
+
this.$message.warning('下拉框数据源不是JSON集合')
|
|
445
|
+
return
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
delete item.selectType
|
|
449
|
+
} else {
|
|
450
|
+
delete item.selectType
|
|
451
|
+
delete item.selectKey
|
|
452
|
+
}
|
|
453
|
+
if (this.type === '新增') {
|
|
454
|
+
this.form.column.push(item)
|
|
455
|
+
} else {
|
|
456
|
+
this.form.column[this.selectIndex] = item
|
|
457
|
+
}
|
|
458
|
+
this.item = {
|
|
459
|
+
key: '',
|
|
460
|
+
title: '',
|
|
461
|
+
rule: {}
|
|
462
|
+
}
|
|
463
|
+
this.$message.success('增加成功')
|
|
464
|
+
this.dataColumnVisible = false
|
|
465
|
+
},
|
|
466
|
+
// 判断是否为json字符串
|
|
467
|
+
isJSON (str) {
|
|
468
|
+
if (typeof str == 'string') {
|
|
469
|
+
try {
|
|
470
|
+
const obj = JSON.parse(str)
|
|
471
|
+
return !!(typeof obj == 'object' && obj)
|
|
472
|
+
} catch (e) {
|
|
473
|
+
return false
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
exportJson () {
|
|
478
|
+
const data = JSON.stringify(this.form, null, 2)
|
|
479
|
+
const blob = new Blob([data], { type: 'application/json' })
|
|
480
|
+
FileSaver.saveAs(blob, `SimpleFormQuery.json`)
|
|
481
|
+
this.$message.success('导出成功!')
|
|
482
|
+
},
|
|
483
|
+
viewHandle (then) {
|
|
484
|
+
if (this.form.column.length === 0) {
|
|
485
|
+
this.$message.error('你没有增加任何数据字段')
|
|
486
|
+
return
|
|
487
|
+
}
|
|
488
|
+
this.result = JSON.parse(JSON.stringify(this.form))
|
|
489
|
+
for (const item of this.result.column) {
|
|
490
|
+
if (item.selectType === 'fixArray') {
|
|
491
|
+
item.selectKey = JSON.parse(item.selectKey)
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
then()
|
|
495
|
+
},
|
|
496
|
+
view () {
|
|
497
|
+
this.$refs.businessCreateForm.validate(valid => {
|
|
498
|
+
if (valid) {
|
|
499
|
+
this.viewHandle(() => {
|
|
500
|
+
post(commonApi.getColumnsJson, { queryObject: this.result }).then(res => {
|
|
501
|
+
this.formItems = res.formJson
|
|
502
|
+
this.modelVisible = true
|
|
503
|
+
})
|
|
504
|
+
})
|
|
505
|
+
}
|
|
506
|
+
})
|
|
507
|
+
},
|
|
508
|
+
submit () {
|
|
509
|
+
this.onModelClose()
|
|
510
|
+
this.$refs.businessCreateForm.validate(valid => {
|
|
511
|
+
if (valid) {
|
|
512
|
+
this.viewHandle(() => {
|
|
513
|
+
// saveQueryParams
|
|
514
|
+
this.$emit('saveSimpleFormQueryParams', this.result)
|
|
515
|
+
})
|
|
516
|
+
}
|
|
517
|
+
})
|
|
518
|
+
},
|
|
519
|
+
modelCancel () {
|
|
520
|
+
this.dataColumnVisible = false
|
|
521
|
+
// 延迟是为了避免编辑数据窗口关闭时重置表单导致的闪烁
|
|
522
|
+
setTimeout(() => {
|
|
523
|
+
this.item = {
|
|
524
|
+
key: '',
|
|
525
|
+
title: '',
|
|
526
|
+
rule: {}
|
|
527
|
+
}
|
|
528
|
+
}, 100)
|
|
529
|
+
},
|
|
530
|
+
changeSelectKey (item) {
|
|
531
|
+
if (item.selectType === 'key' && item.selectKey) {
|
|
532
|
+
item.slot.type = 'badge'
|
|
533
|
+
item.slotKeyMap = item.selectKey
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
</script>
|
|
539
|
+
<style lang="less" scoped>
|
|
540
|
+
</style>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# CreateSimpleFormQuery 基础表单配置生成(仅新增场景)
|
|
2
|
+
|
|
3
|
+
提供基础表单配置生成(仅新增场景)的快捷组件
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## 何时使用
|
|
8
|
+
|
|
9
|
+
允许生成基础表单的配置
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
引用方式:
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
import CreateSimpleFormQuery from '@/base-client/components/CreateSimpleFormQuery'
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
components: {
|
|
20
|
+
CreateSimpleFormQuery
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## 代码演示
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
<create-simple-form-query
|
|
31
|
+
:toEditJson="toEditJson"
|
|
32
|
+
:visible.sync="createSimpleFormVisible"
|
|
33
|
+
/>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## API
|
|
37
|
+
|
|
38
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
39
|
+
|----------------------------|------------------------------------------|---------|-----------|
|
|
40
|
+
| visible | 是否显示 | Boolean | false |
|
|
41
|
+
| toEditJson | 要编辑的json 当 visible 从false变成true时解析加载到页面上 | Object | undefined |
|
|
42
|
+
| @saveSimpleFormQueryParams | 基础表单配置点击保存后事件 | event | - |
|
package/src/{components → base-client/components/common}/CustomColumnsDrawer/CustomColumnsDrawer.vue
RENAMED
|
@@ -45,6 +45,27 @@ export default {
|
|
|
45
45
|
checkAll: true
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
+
mounted () {
|
|
49
|
+
let index = 0
|
|
50
|
+
this.columnsMeta.forEach((item) => {
|
|
51
|
+
// 组织表格列选择项
|
|
52
|
+
const rowData = {
|
|
53
|
+
label: item.title,
|
|
54
|
+
value: item.dataIndex
|
|
55
|
+
}
|
|
56
|
+
if (index === 0) {
|
|
57
|
+
rowData.disabled = true
|
|
58
|
+
index++
|
|
59
|
+
} else {
|
|
60
|
+
// 如果存在固定列,则设置为不可选择项
|
|
61
|
+
rowData.disabled = item.fixed !== undefined
|
|
62
|
+
}
|
|
63
|
+
// 放入表格列选择项集合中
|
|
64
|
+
this.columnsList.push(rowData)
|
|
65
|
+
// 放入默认选择项
|
|
66
|
+
this.selectColumnsList.push(rowData.value)
|
|
67
|
+
})
|
|
68
|
+
},
|
|
48
69
|
methods: {
|
|
49
70
|
onChange (checkedValues) {
|
|
50
71
|
// 控制全选样式
|
|
@@ -73,21 +94,6 @@ export default {
|
|
|
73
94
|
}
|
|
74
95
|
},
|
|
75
96
|
watch: {
|
|
76
|
-
'columnsMeta' (val) {
|
|
77
|
-
val.forEach((item) => {
|
|
78
|
-
// 组织表格列选择项
|
|
79
|
-
const rowData = {
|
|
80
|
-
label: item.title,
|
|
81
|
-
value: item.dataIndex
|
|
82
|
-
}
|
|
83
|
-
// 如果存在固定列,则设置为不可选择项
|
|
84
|
-
rowData.disabled = item.fixed !== undefined
|
|
85
|
-
// 放入表格列选择项集合中
|
|
86
|
-
this.columnsList.push(rowData)
|
|
87
|
-
// 放入默认选择项
|
|
88
|
-
this.selectColumnsList.push(rowData.value)
|
|
89
|
-
})
|
|
90
|
-
},
|
|
91
97
|
'selectColumnsList' (val) {
|
|
92
98
|
const selectColumns = []
|
|
93
99
|
// 遍历选中项,放入表格列中
|
|
File without changes
|