vue2-client 1.16.20 → 1.16.22
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/.cursorrules +19 -19
- package/.env.apply +19 -19
- package/.env.gaslink +19 -19
- package/.env.his +19 -19
- package/.env.liuli +20 -20
- package/.env.scada +19 -19
- package/.eslintrc.js +90 -90
- package/CHANGELOG.md +824 -824
- package/Components.md +60 -60
- package/docs/LowCode/lowcode.md +155 -155
- package/docs/LowCode/lowcodeForDeveloper.md +230 -230
- package/docs/index.md +30 -30
- package/index.js +31 -31
- package/jest-transform-stub.js +8 -8
- package/jest.setup.js +7 -7
- package/jsconfig.json +19 -19
- package/package.json +1 -1
- package/public/his/editor/editor.html +51 -51
- package/public/his/editor/mock/bind_data.html +779 -779
- package/public/his/editor/mock/data_table.html +40 -40
- package/public/his/editor/mock/sign.html +75 -75
- package/public/his/editor/vender/JsBarcode.all.js +3669 -3669
- package/public/his/editor/vender/date97/My97DatePicker.htm +65 -65
- package/public/his/editor/vender/date97/WdatePicker.js +677 -677
- package/public/his/editor/vender/date97/calendar.js +4 -4
- package/public/his/editor/vender/date97/lang/en.js +13 -13
- package/public/his/editor/vender/date97/lang/zh-cn.js +13 -13
- package/public/his/editor/vender/date97/lang/zh-tw.js +13 -13
- package/public/his/editor/vender/date97/skin/WdatePicker.css +10 -10
- package/public/his/editor/vender/date97/skin/default/datepicker.css +328 -328
- package/public/his/editor/vender/date97/skin/ext/datepicker.css +308 -308
- package/public/his/editor/vender/date97/skin/whyGreen/datepicker.css +255 -255
- package/public/his/editor/vender/diff.js +1627 -1627
- package/public/his/editor/vender/editor.js +1 -1
- package/public/his/editor/vender/fabric.js +31187 -31187
- package/public/his/editor/vender/jquery/jquery.base64.js +190 -190
- package/public/his/editor/vender/jquery/jquery.js +10872 -10872
- package/public/his/editor/vender/jquery/jquery.print.js +255 -255
- package/public/his/editor/vender/jquery/zTreeStyle/zTreeStyle.css +96 -96
- package/public/his/editor/vender/mui/mui.min.css +4 -4
- package/public/his/editor/vender/mui/mui.min.js +5 -5
- package/public/his/editor/vender/mui/mui.picker.min.css +6 -6
- package/public/his/editor/vender/mui/mui.picker.min.js +6 -6
- package/public/his/editor/vender/qrcode.js +7 -7
- package/public/his/editor/vender/requirejs/require.js +2145 -2145
- package/public/his/editor/vender/signature/jSignature.CompressorSVG.js +518 -518
- package/public/his/editor/vender/signature/jSignature.UndoButton.js +164 -164
- package/public/his/editor/vender/signature/jSignature.js +1486 -1486
- package/public/his/editor/vender/validator.js +5094 -5094
- package/public/his/editor/vender/weui/weui.css +5659 -5659
- package/public/his/editor/vender/weui/weui.min.css +4 -4
- package/public/his/editor/vender/weui/weui.min.js +11 -11
- package/src/assets/img/paymentMethod/icon1.png +0 -0
- package/src/assets/img/paymentMethod/icon2.png +0 -0
- package/src/assets/img/paymentMethod/icon3.png +0 -0
- package/src/assets/img/paymentMethod/icon4.png +0 -0
- package/src/assets/img/paymentMethod/icon5.png +0 -0
- package/src/assets/img/paymentMethod/icon6.png +0 -0
- package/src/assets/img/querySlotDemo.svg +15 -15
- package/src/assets/svg/badtwo.svg +1 -1
- package/src/assets/svg/goodtwo.svg +1 -1
- package/src/base-client/components/AI/AskAiBtn.vue +136 -136
- package/src/base-client/components/AI/demo.vue +31 -31
- package/src/base-client/components/common/AddressSearchCombobox/IcMapIcon.vue +16 -16
- package/src/base-client/components/common/AddressSearchCombobox/demo.vue +36 -36
- package/src/base-client/components/common/AddressSearchCombobox/ic_map.svg +6 -6
- package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +120 -120
- package/src/base-client/components/common/CitySelect/index.js +3 -3
- package/src/base-client/components/common/CitySelect/index.md +109 -109
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +669 -669
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +1014 -1014
- package/src/base-client/components/common/CreateQuery/index.js +3 -3
- package/src/base-client/components/common/CreateQuery/index.md +42 -42
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +452 -452
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +511 -511
- package/src/base-client/components/common/CreateSimpleFormQuery/index.js +3 -3
- package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -42
- package/src/base-client/components/common/FormGroupEdit/index.js +3 -3
- package/src/base-client/components/common/FormGroupEdit/index.md +43 -43
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +166 -166
- package/src/base-client/components/common/FormGroupQuery/index.js +3 -3
- package/src/base-client/components/common/FormGroupQuery/index.md +43 -43
- package/src/base-client/components/common/HIS/HAddNativeForm/HAddNativeForm.vue +17 -5
- package/src/base-client/components/common/JSONToTree/jsontotree.vue +271 -271
- package/src/base-client/components/common/LowCodeComponent/LowCodeEditorModal.vue +108 -108
- package/src/base-client/components/common/LowCodeComponent/LowCodeEditorPanel.vue +413 -413
- package/src/base-client/components/common/LowCodeComponent/LowCodePageOrganization.vue +502 -502
- package/src/base-client/components/common/LowCodeComponent/LowCodeRender.vue +728 -728
- package/src/base-client/components/common/LowCodeComponent/LowCodeRenderEnter.vue +29 -29
- package/src/base-client/components/common/LowCodeComponent/LowCodeUIStore.vue +219 -219
- package/src/base-client/components/common/LowCodeComponent/modal/lowCodeAddPageModal.vue +117 -117
- package/src/base-client/components/common/LowCodeComponent/modal/lowCodeCustomJSModal.vue +80 -80
- package/src/base-client/components/common/LowCodeComponent/modal/lowCodeEventEditorModal.vue +398 -398
- package/src/base-client/components/common/LowCodeComponent/modal/lowCodeLifeCycleModal.vue +65 -65
- package/src/base-client/components/common/LowCodeComponent/modal/lowCodeLogicCallbackModal.vue +64 -64
- package/src/base-client/components/common/LowCodeComponent/modal/lowCodeLogicParamModal.vue +73 -73
- package/src/base-client/components/common/LowCodeComponent/modal/lowCodeRunFunctionParamModal.vue +76 -76
- package/src/base-client/components/common/PersonSetting/PersonSetting.vue +208 -208
- package/src/base-client/components/common/PersonSetting/index.js +3 -3
- package/src/base-client/components/common/Recording/Recording.vue +243 -243
- package/src/base-client/components/common/Recording/index.js +3 -3
- package/src/base-client/components/common/Tree/Tree.vue +149 -149
- package/src/base-client/components/common/Tree/index.js +2 -2
- package/src/base-client/components/common/Upload/index.js +3 -3
- package/src/base-client/components/common/XAddForm/XAddForm.vue +113 -113
- package/src/base-client/components/common/XAddNativeForm/index.md +146 -146
- package/src/base-client/components/common/XAddNativeFormOA/XAddNativeFormOA.vue +303 -303
- package/src/base-client/components/common/XAddNativeFormOA/index.js +3 -3
- package/src/base-client/components/common/XAddNativeFormOA/index.md +146 -146
- package/src/base-client/components/common/XAddReport/index.js +3 -3
- package/src/base-client/components/common/XAddReport/index.md +56 -56
- package/src/base-client/components/common/XBadge/XBadge.vue +94 -94
- package/src/base-client/components/common/XButtons/XButtonDemo.vue +28 -28
- package/src/base-client/components/common/XButtons/index.js +3 -3
- package/src/base-client/components/common/XButtons/index.md +61 -61
- package/src/base-client/components/common/XCard/XCard.vue +64 -64
- package/src/base-client/components/common/XCheckList/XCheckList.vue +106 -106
- package/src/base-client/components/common/XCheckList/XCheckListDemo.vue +41 -41
- package/src/base-client/components/common/XDataCard/index.js +3 -3
- package/src/base-client/components/common/XDataCard/index.md +1 -1
- package/src/base-client/components/common/XDataDrawer/XDataDrawer.vue +180 -180
- package/src/base-client/components/common/XDataDrawer/index.js +3 -3
- package/src/base-client/components/common/XDataDrawer/index.md +41 -41
- package/src/base-client/components/common/XDatePicker/demo.vue +153 -153
- package/src/base-client/components/common/XDescriptions/index.js +3 -3
- package/src/base-client/components/common/XDescriptions/index.md +83 -83
- package/src/base-client/components/common/XDetailsView/XDetailsView.vue +238 -238
- package/src/base-client/components/common/XDetailsView/index.js +3 -3
- package/src/base-client/components/common/XForm/XStatusButton.vue +54 -54
- package/src/base-client/components/common/XForm/index.md +178 -178
- package/src/base-client/components/common/XForm/itemComponent/XClickChangeBtn/index.vue +49 -49
- package/src/base-client/components/common/XFormGroup/index.js +3 -3
- package/src/base-client/components/common/XFormGroup/index.md +38 -38
- package/src/base-client/components/common/XFormGroupDetails/XFormGroupDetails.vue +72 -72
- package/src/base-client/components/common/XFormGroupDetails/index.js +3 -3
- package/src/base-client/components/common/XFormTable/index.md +92 -92
- package/src/base-client/components/common/XLabelSelect/XLabelSelect.vue +110 -110
- package/src/base-client/components/common/XLabelSelect/XLabelSelectDemo.vue +35 -35
- package/src/base-client/components/common/XLicensePlate/XLicensePlate.vue +193 -193
- package/src/base-client/components/common/XLicensePlate/XLicensePlateDemo.vue +48 -48
- package/src/base-client/components/common/XPrint/OpenInvoice.vue +21 -21
- package/src/base-client/components/common/XPrint/PrintHtml.js +98 -98
- package/src/base-client/components/common/XPrint/css/hiPrintCss.js +359 -359
- package/src/base-client/components/common/XPrint/css/lodopCss.js +26 -26
- package/src/base-client/components/common/XPrint/css/print-lock.css +351 -351
- package/src/base-client/components/common/XPrint/index.vue +97 -97
- package/src/base-client/components/common/XReport/XReportDesign.vue +463 -463
- package/src/base-client/components/common/XReport/XReportJsonRender.vue +381 -381
- package/src/base-client/components/common/XReport/index.js +3 -3
- package/src/base-client/components/common/XReport/print.js +186 -186
- package/src/base-client/components/common/XReportDrawer/index.js +3 -3
- package/src/base-client/components/common/XReportGrid/index.js +3 -3
- package/src/base-client/components/common/XReportGrid/index.md +44 -44
- package/src/base-client/components/common/XReportSlot/XReportSlot.vue +110 -110
- package/src/base-client/components/common/XReportSlot/index.js +3 -3
- package/src/base-client/components/common/XReportSlot/index.md +48 -48
- package/src/base-client/components/common/XSimpleDescriptions/XSimpleDescriptions.vue +166 -166
- package/src/base-client/components/common/XSimpleDescriptions/index.js +3 -3
- package/src/base-client/components/common/XSimpleDescriptions/index.md +7 -7
- package/src/base-client/components/common/XStepView/XStepView.vue +252 -252
- package/src/base-client/components/common/XStepView/index.js +3 -3
- package/src/base-client/components/common/XStepView/index.md +31 -31
- package/src/base-client/components/common/XTab/XTabDemo.vue +22 -22
- package/src/base-client/components/common/XTab/index.js +3 -3
- package/src/base-client/components/common/XTable/CustomFuncCel.vue +51 -51
- package/src/base-client/components/common/XTable/TableCellRenderer.vue +161 -161
- package/src/base-client/components/common/XTable/index.md +255 -255
- package/src/base-client/components/common/XTagGroup/index.vue +52 -52
- package/src/base-client/components/common/XTree/XTree.vue +424 -424
- package/src/base-client/components/common/XTree/index.js +3 -3
- package/src/base-client/components/common/XTree/index.md +36 -36
- package/src/base-client/components/common/XTreeOne/XTreeOne.vue +113 -113
- package/src/base-client/components/common/XTreeOne/XTreeOnePro.vue +128 -128
- package/src/base-client/components/common/richTextModal/index.vue +56 -56
- package/src/base-client/components/common/richTextModal/richDemo.vue +48 -48
- package/src/base-client/components/his/XCharge/testConfig.js +149 -0
- package/src/base-client/components/his/XHisEditor/index.js +3 -3
- package/src/base-client/components/his/XTimeSelect/XTimeSelect.vue +0 -11
- package/src/base-client/components/index.js +51 -51
- package/src/base-client/components/layout/XTreeView/XTreeView.vue +130 -130
- package/src/base-client/components/layout/XTreeView/index.js +3 -3
- package/src/base-client/components/layout/XTreeView/index.md +46 -46
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
- package/src/base-client/plugins/Config.js +19 -19
- package/src/base-client/plugins/GetLoginInfoService.js +183 -183
- package/src/base-client/plugins/Recording.js +258 -258
- package/src/base-client/plugins/index.js +23 -23
- package/src/base-client/plugins/tabs-page-plugin.js +39 -39
- package/src/components/Charts/Bar.vue +62 -62
- package/src/components/Charts/ChartCard.vue +134 -134
- package/src/components/Charts/Liquid.vue +67 -67
- package/src/components/Charts/MiniArea.vue +39 -39
- package/src/components/Charts/MiniBar.vue +39 -39
- package/src/components/Charts/MiniProgress.vue +75 -75
- package/src/components/Charts/MiniSmoothArea.vue +40 -40
- package/src/components/Charts/Radar.vue +68 -68
- package/src/components/Charts/RankList.vue +77 -77
- package/src/components/Charts/TagCloud.vue +113 -113
- package/src/components/Charts/TransferBar.vue +64 -64
- package/src/components/Charts/Trend.vue +82 -82
- package/src/components/Charts/chart.less +12 -12
- package/src/components/Charts/smooth.area.less +13 -13
- package/src/components/CodeMirror/inedx.vue +118 -118
- package/src/components/CodeMirror/setting.js +40 -40
- package/src/components/NumberInfo/NumberInfo.vue +54 -54
- package/src/components/NumberInfo/index.js +3 -3
- package/src/components/NumberInfo/index.less +54 -54
- package/src/components/NumberInfo/index.md +43 -43
- package/src/components/card/ChartCard.vue +79 -79
- package/src/components/chart/Bar.vue +60 -60
- package/src/components/chart/MiniArea.vue +67 -67
- package/src/components/chart/MiniBar.vue +59 -59
- package/src/components/chart/MiniProgress.vue +57 -57
- package/src/components/chart/Radar.vue +80 -80
- package/src/components/chart/RankingList.vue +60 -60
- package/src/components/chart/Trend.vue +79 -79
- package/src/components/chart/index.less +9 -9
- package/src/components/checkbox/ColorCheckbox.vue +157 -157
- package/src/components/checkbox/ImgCheckbox.vue +117 -117
- package/src/components/checkbox/ImgCheckboxGroup.vue +76 -76
- package/src/components/checkbox/index.js +9 -9
- package/src/components/exception/ExceptionPage.vue +70 -70
- package/src/components/g2Charts/constants.js +202 -202
- package/src/components/g2Charts/demo.vue +808 -808
- package/src/components/g2Charts/designer.vue +228 -228
- package/src/components/g2Charts/designerBaseConfig.vue +61 -61
- package/src/components/g2Charts/designerDataConfig.vue +259 -259
- package/src/components/g2Charts/designerStyleConfig.vue +16 -16
- package/src/components/g2Charts/index.vue +397 -397
- package/src/components/index.js +36 -36
- package/src/components/input/IInput.vue +66 -66
- package/src/components/menu/SideMenu.vue +75 -75
- package/src/components/menu/menu.js +273 -273
- package/src/components/setting/Setting.vue +234 -234
- package/src/components/tool/AStepItem.vue +60 -60
- package/src/config/CreateQueryConfig.js +325 -325
- package/src/config/default/antd.config.js +89 -89
- package/src/config/default/setting.config.js +55 -55
- package/src/font-style/font.css +60 -60
- package/src/layouts/CommonLayout.vue +56 -56
- package/src/layouts/PageLayout.vue +151 -151
- package/src/layouts/SinglePageView.vue +136 -136
- package/src/layouts/header/AdminHeader.vue +132 -132
- package/src/layouts/header/HeaderNotice.vue +177 -177
- package/src/layouts/header/InstitutionDetail.vue +181 -181
- package/src/layouts/tabs/TabsHead.vue +189 -189
- package/src/lib.js +1 -1
- package/src/mock/extend/index.js +84 -84
- package/src/mock/goods/index.js +108 -108
- package/src/pages/DefaultExample/index.vue +77 -77
- package/src/pages/DynamicStatistics/ChartSelector.vue +331 -331
- package/src/pages/DynamicStatistics/DataTabs.vue +83 -83
- package/src/pages/DynamicStatistics/DynamicTable.vue +128 -128
- package/src/pages/DynamicStatistics/EvaluationArea.vue +69 -69
- package/src/pages/DynamicStatistics/FavoriteList.vue +50 -50
- package/src/pages/DynamicStatistics/QuestionHistoryAndFavorites.vue +591 -591
- package/src/pages/DynamicStatistics/SearchBar.vue +192 -192
- package/src/pages/DynamicStatistics/index.vue +282 -282
- package/src/pages/Example/childIndex.vue +15 -15
- package/src/pages/Example/index.vue +30 -30
- package/src/pages/NewDynamicStatistics/ChartSelector.vue +331 -331
- package/src/pages/NewDynamicStatistics/DataTabs.vue +122 -122
- package/src/pages/NewDynamicStatistics/DynamicTable.vue +128 -128
- package/src/pages/NewDynamicStatistics/EvaluationArea.vue +69 -69
- package/src/pages/NewDynamicStatistics/FavoriteList.vue +50 -50
- package/src/pages/NewDynamicStatistics/QuestionHistoryAndFavorites.vue +289 -289
- package/src/pages/NewDynamicStatistics/SearchBar.vue +193 -193
- package/src/pages/NewDynamicStatistics/index.vue +258 -258
- package/src/pages/Recording/index.vue +77 -77
- package/src/pages/ServiceReview/index.vue +284 -284
- package/src/pages/SubExample/index.vue +26 -26
- package/src/pages/WorkflowDetail/WorkflowPageDetail/TrimTextTail.vue +23 -23
- package/src/pages/XReportView/index.vue +64 -64
- package/src/pages/XTreeOneProExample/index.vue +67 -67
- package/src/pages/dashboard/workplace/WorkPlace.vue +141 -141
- package/src/pages/login/Login.vue +379 -379
- package/src/pages/login/LoginV3.vue +389 -389
- package/src/pages/lowCode/lowCodeEditor.vue +1219 -1219
- package/src/pages/lowCode/lowCodeRenderPage.vue +43 -43
- package/src/pages/report/ReportTable.js +124 -124
- package/src/pages/resourceManage/orgListManage.vue +98 -98
- package/src/pages/system/dictionary/index.vue +44 -44
- package/src/pages/system/monitor/loginInfor/index.vue +37 -37
- package/src/pages/system/monitor/operLog/index.vue +37 -37
- package/src/pages/system/settings/modifyPassword.vue +117 -117
- package/src/pages/system/ticket/index.vue +480 -480
- package/src/pages/system/ticket/submitTicketSuccess.vue +484 -484
- package/src/pages/userInfoDetailManage/ChangeMeterRecordQuery/index.vue +64 -64
- package/src/pages/userInfoDetailManage/InfoChangeRecordQuery/index.vue +64 -64
- package/src/pages/userInfoDetailManage/InstructRecordQuery/index.vue +64 -64
- package/src/pages/userInfoDetailManage/MeterParamRecordQuery/index.vue +64 -64
- package/src/pages/userInfoDetailManage/TransferRecordQuery/index.vue +66 -66
- package/src/pages/userInfoDetailManage/WatchCollectionRecordQuery/index.vue +64 -64
- package/src/plugins/EventLogPlugin.js +33 -33
- package/src/plugins/FindParentsData.js +17 -17
- package/src/router/async/config.async.js +35 -35
- package/src/router/async/router.map.js +2 -1
- package/src/router/index.js +27 -27
- package/src/services/DataModel.js +30 -30
- package/src/services/LodopFuncs.js +137 -137
- package/src/services/api/TicketDetailsViewApi.js +46 -46
- package/src/services/api/cas.js +79 -79
- package/src/services/api/common.js +347 -346
- package/src/services/api/entity.js +18 -18
- package/src/services/api/index.js +17 -17
- package/src/store/modules/account.js +115 -115
- package/src/store/modules/index.js +5 -5
- package/src/store/modules/lowCode.js +33 -33
- package/src/store/modules/setting.js +119 -119
- package/src/theme/default/style.less +58 -58
- package/src/utils/authority-utils.js +85 -85
- package/src/utils/errorCode.js +6 -6
- package/src/utils/formatter.js +74 -74
- package/src/utils/htmlToPDF.js +108 -108
- package/src/utils/htmlToPDFApi.js +5 -5
- package/src/utils/login.js +188 -188
- package/src/utils/lowcode/lowcodeComponentMixin.js +120 -120
- package/src/utils/lowcode/lowcodeLog.js +29 -29
- package/src/utils/lowcode/lowcodeUtils.js +373 -373
- package/src/utils/lowcode/registerComponentForEditor.js +1 -1
- package/src/utils/lowcode/registerComponentForRender.js +11 -11
- package/src/utils/map-utils.js +47 -47
- package/src/utils/reg.js +95 -95
- package/src/utils/runEvalFunction.js +14 -14
- package/src/utils/theme-color-replacer-extend.js +92 -92
- package/src/utils/util.js +329 -329
- package/src/utils/waterMark.js +31 -31
- package//350/277/201/347/247/273/346/227/245/345/277/227.md +15 -15
@@ -1,1014 +1,1014 @@
|
|
1
|
-
<template>
|
2
|
-
<a-modal
|
3
|
-
:destroyOnClose="true"
|
4
|
-
:visible="visible"
|
5
|
-
:width="1250"
|
6
|
-
:zIndex="1001"
|
7
|
-
title="数据字段配置"
|
8
|
-
@cancel="modelCancel"
|
9
|
-
@ok="submitItem">
|
10
|
-
<a-form-model
|
11
|
-
ref="itemForm"
|
12
|
-
:model="item"
|
13
|
-
:rules="itemRules"
|
14
|
-
layout="vertical">
|
15
|
-
<a-row :gutter="16">
|
16
|
-
<a-col :span="6">
|
17
|
-
<a-card :bodyStyle="bodyStyle" title="基本属性">
|
18
|
-
<a-divider style="font-size: 14px;margin-top: 0">字段信息</a-divider>
|
19
|
-
<a-form-model-item label="标签名称" prop="title">
|
20
|
-
<a-input v-model="item.title" placeholder="请输入标签名称"/>
|
21
|
-
</a-form-model-item>
|
22
|
-
<a-form-model-item
|
23
|
-
label="字段名称"
|
24
|
-
prop="key">
|
25
|
-
<a-input ref="key" v-model="item.key" :disabled="keyDisabled" placeholder="请输入字段名">
|
26
|
-
<a-popover slot="suffix" placement="bottom" title="关于字段名称">
|
27
|
-
<template slot="content">
|
28
|
-
<p>设置数据字段的名称</p>
|
29
|
-
<p>用作SQL查询时为<span style="font-weight: bold">表别名.数据列名</span>的格式,如:i.id</p>
|
30
|
-
<p style="font-weight: bold">注意事项:</p>
|
31
|
-
<p>由于v2和v3版本产品中一些数据字段有差异,为了增强查询配置在不同版本产品中的通用性,
|
32
|
-
现在查询配置中的数据字段现在可以通过`$`前缀指定通用兼容名了</p>
|
33
|
-
<p>通过指定数据字段为通用兼容名,查询配置将会在解析生成SQL时根据配置的产品版本自动适配实际的字段名。</p>
|
34
|
-
<p>目前支持的兼容性字段见下表:</p>
|
35
|
-
<table>
|
36
|
-
<thead>
|
37
|
-
<tr><th>数据表</th><th>字段含义</th><th>v2产品</th><th>v3产品</th><th>通用兼容名</th></tr>
|
38
|
-
</thead>
|
39
|
-
<tbody>
|
40
|
-
<tr><td>t_userfiles</td><td>表档案主键</td><td>f_user_id</td><td>f_userfiles_id</td><td>$userid</td></tr>
|
41
|
-
</tbody>
|
42
|
-
</table>
|
43
|
-
</template>
|
44
|
-
<a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
|
45
|
-
</a-popover>
|
46
|
-
</a-input>
|
47
|
-
</a-form-model-item>
|
48
|
-
<a-form-model-item
|
49
|
-
v-if="item.formType ==='addressSearch'"
|
50
|
-
label="坐标字段名">
|
51
|
-
<a-input :disabled="true" :value="`${item.key}_lng_lat`">
|
52
|
-
<a-popover slot="suffix" placement="bottom" title="坐标字段名">
|
53
|
-
<template slot="content">
|
54
|
-
<p>表单类型为地点搜索框时:</p>
|
55
|
-
<p>新增/修改表单时,字段名称会存放地址名称,坐标字段名会存放坐标信息</p>
|
56
|
-
</template>
|
57
|
-
<a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
|
58
|
-
</a-popover>
|
59
|
-
</a-input>
|
60
|
-
</a-form-model-item>
|
61
|
-
<a-divider style="font-size: 14px;margin-top: 0">数据模式</a-divider>
|
62
|
-
<a-form-model-item
|
63
|
-
prop="dataMode"
|
64
|
-
style="margin-top: 10px;">
|
65
|
-
<a-checkbox-group v-model="dataModeArrayData" :disabled="dataModeDisabled" @change="dataModeArrayDataChange" :options="dataModeTypeV"/>
|
66
|
-
</a-form-model-item>
|
67
|
-
</a-card>
|
68
|
-
</a-col>
|
69
|
-
<a-col v-show="!dataMode.group && (dataMode.queryForm || dataMode.addOrEditForm || dataMode.table || dataMode.sqlQueryCondition)" :span="9">
|
70
|
-
<a-card v-if="dataMode.queryForm || dataMode.addOrEditForm || dataMode.table || dataMode.sqlQueryCondition" :bodyStyle="bodyStyle" title="核心配置">
|
71
|
-
<template v-if="dataMode.queryForm || dataMode.addOrEditForm || dataMode.sqlQueryCondition">
|
72
|
-
<a-divider style="font-size: 14px;margin-top: 0">表单配置</a-divider>
|
73
|
-
<a-form-model-item label="表单类型" prop="formType">
|
74
|
-
<a-select v-model="item.formType" placeholder="请选择表单类型" @change="changeFormType(item)">
|
75
|
-
<a-select-option v-for="formTypeItem in formType" :key="formTypeItem.key">{{ formTypeItem.label }}</a-select-option>
|
76
|
-
</a-select>
|
77
|
-
</a-form-model-item>
|
78
|
-
<a-form-model-item v-if="dataMode.sqlQueryCondition && item.formType !=='file' && item.formType !=='image' " label="表单查询方式" prop="queryType">
|
79
|
-
<a-select
|
80
|
-
v-model="item.queryType"
|
81
|
-
:disabled="formQueryTypeDisabled"
|
82
|
-
:getPopupContainer=" triggerNode => { return triggerNode.parentNode } "
|
83
|
-
placeholder="表单查询方式">
|
84
|
-
<a-select-option v-for="queryTypeItem in queryTypeV" :key="queryTypeItem.key">{{ queryTypeItem.label }}</a-select-option>
|
85
|
-
</a-select>
|
86
|
-
</a-form-model-item>
|
87
|
-
<template v-if="item.formType">
|
88
|
-
<a-form-model-item v-if="dataMode.addOrEditForm || dataMode.queryForm" label="表单校验" prop="rule">
|
89
|
-
<a-row :gutter="16">
|
90
|
-
<a-col v-if="(item.formType === 'input' || item.formType === 'textarea' ) && item.formType !=='file' && item.formType !=='image' " :span="12" >
|
91
|
-
<a-select v-model="item.rule.type" :getPopupContainer=" triggerNode => { return triggerNode.parentNode } " placeholder="校验类型">
|
92
|
-
<a-select-option v-for="ruleTypeItem in formRuleType" :key="ruleTypeItem.key">{{ ruleTypeItem.label }}</a-select-option>
|
93
|
-
<a-popover slot="suffixIcon" placement="bottom" title="关于表单校验类型">
|
94
|
-
<template slot="content">
|
95
|
-
<p>设置表单项的校验类型</p>
|
96
|
-
</template>
|
97
|
-
<a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
|
98
|
-
</a-popover>
|
99
|
-
</a-select>
|
100
|
-
</a-col>
|
101
|
-
<a-col :span="12">
|
102
|
-
<a-radio-group v-model="item.rule.required" button-style="solid" default-value="false">
|
103
|
-
<a-radio-button value="true">
|
104
|
-
必选项
|
105
|
-
</a-radio-button>
|
106
|
-
<a-radio-button value="false">
|
107
|
-
非必选项
|
108
|
-
</a-radio-button>
|
109
|
-
</a-radio-group>
|
110
|
-
</a-col>
|
111
|
-
</a-row>
|
112
|
-
</a-form-model-item>
|
113
|
-
<a-form-model-item v-if="dataMode.addOrEditForm" label="新增/修改场景选择" prop="addOrEdit">
|
114
|
-
<a-select v-model="item.addOrEdit" placeholder="请选择场景">
|
115
|
-
<a-select-option v-for="addOrEditItem in addOrEditTypeV" :key="addOrEditItem.key">{{ addOrEditItem.label }}</a-select-option>
|
116
|
-
<a-popover
|
117
|
-
slot="suffixIcon"
|
118
|
-
placement="bottom"
|
119
|
-
title="关于新增/修改场景选择">
|
120
|
-
<template slot="content">
|
121
|
-
<p>设置表单项的新增/修改场景</p>
|
122
|
-
<p>静默新增类型用于非人为新增的数据,不会生成表单项,且必须设置字段用途</p>
|
123
|
-
</template>
|
124
|
-
<a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
|
125
|
-
</a-popover>
|
126
|
-
</a-select>
|
127
|
-
</a-form-model-item>
|
128
|
-
<a-form-model-item v-if="item.addOrEdit === 'silenceAdd'" label="字段用途" prop="silencePurpose">
|
129
|
-
<a-select v-model="item.silencePurpose" :getPopupContainer=" triggerNode => { return triggerNode.parentNode } " placeholder="请选择字段用途">
|
130
|
-
<a-select-option v-for="silencePurposeTypeItem in silencePurposeType" :key="silencePurposeTypeItem.key">{{ silencePurposeTypeItem.label }}</a-select-option>
|
131
|
-
<a-popover
|
132
|
-
slot="suffixIcon"
|
133
|
-
placement="bottom"
|
134
|
-
title="关于字段用途">
|
135
|
-
<template slot="content">
|
136
|
-
<p>用于静默新增时设置字段用途</p>
|
137
|
-
<p>在新增数据的表单提交时,页面会根据设置的字段用途自动获取相关数据并追加到表单中</p>
|
138
|
-
<p>当字段用途选择为<span style="font-weight: bold">自定义</span>时,必须指定一个业务逻辑(Logic)名称,表单提交前会将表单内容作为参数调用该Logic接口,并将Logic返回值作为表单值
|
139
|
-
</p>
|
140
|
-
</template>
|
141
|
-
<a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
|
142
|
-
</a-popover>
|
143
|
-
</a-select>
|
144
|
-
</a-form-model-item>
|
145
|
-
<a-form-model-item v-if="item.silencePurpose === 'customize'" label="字段用途对应Logic" prop="silenceSource">
|
146
|
-
<a-input v-model="item.silenceSource" placeholder="请输入业务逻辑名称"/>
|
147
|
-
</a-form-model-item>
|
148
|
-
</template>
|
149
|
-
</template>
|
150
|
-
<template v-if="dataMode.table">
|
151
|
-
<a-divider style="font-size: 14px;margin-top: 0">表格列配置</a-divider>
|
152
|
-
<a-form-model-item v-if="item.formType" label="作用域插槽" prop="slot">
|
153
|
-
<a-select v-model="item.slot.type" :disabled="slotTypeDisabled" :getPopupContainer=" triggerNode => { return triggerNode.parentNode } " placeholder="插槽类型">
|
154
|
-
<a-select-option v-for="slotTypeItem in slotTypeV" :key="slotTypeItem.key">{{ slotTypeItem.label }}</a-select-option>
|
155
|
-
<a-popover slot="suffixIcon" placement="bottom" title="关于作用域插槽">
|
156
|
-
<template slot="content">
|
157
|
-
<p>你可以通过设置表格列的作用域插槽实现一些效果</p>
|
158
|
-
<p>如果没有指定,默认会设置为文本溢出省略(长度:16)</p>
|
159
|
-
<p>如果你选择文本溢出省略,需要设置文本溢出上限长度,建议ID主键等类型设置为8</p>
|
160
|
-
<p>如果你选择多彩徽标,需要设置徽标对应的数据样式字典键</p>
|
161
|
-
<a-divider style="font-size: 14px;margin-top: 0">关于表格列宽度</a-divider>
|
162
|
-
<p>V1.1之后不再支持自定义表格列宽度,表格列宽度将通过作用域插槽类型自适应</p>
|
163
|
-
<p>设置为文本溢出省略时,表格列宽度 = 文本溢出上限长度 * 7 + 42</p>
|
164
|
-
<p>设置为多彩徽标时,表格列宽度为130</p>
|
165
|
-
<p>设置为日期时间格式化时,表格列宽度为160</p>
|
166
|
-
</template>
|
167
|
-
<a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
|
168
|
-
</a-popover>
|
169
|
-
</a-select>
|
170
|
-
</a-form-model-item>
|
171
|
-
<a-form-model-item v-if="item.slot.type === 'badge'" label="徽标字典键" prop="slot.keyMap">
|
172
|
-
<a-input v-model="item.slot.keyMap" :disabled="slotTypeDisabled" placeholder="请输入徽标字典键">
|
173
|
-
<a-popover
|
174
|
-
slot="suffix"
|
175
|
-
placement="bottom"
|
176
|
-
title="关于徽标字典键">
|
177
|
-
<template slot="content">
|
178
|
-
<p>如果你设置了表单类型为选择框,且数据源是字典键,该值会自动带出</p>
|
179
|
-
</template>
|
180
|
-
<a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
|
181
|
-
</a-popover>
|
182
|
-
</a-input>
|
183
|
-
</a-form-model-item>
|
184
|
-
<a-form-model-item v-if="item.slot.type === 'ellipsis'" label="文本溢出上限长度" prop="slot.value">
|
185
|
-
<a-input-number v-model="item.slot.value" placeholder="请输入文本溢出上限长度" style="width: 100%"/>
|
186
|
-
</a-form-model-item>
|
187
|
-
<a-form-model-item v-if="item.slot.type === 'action'" label="操作列文本" prop="slot.actionText">
|
188
|
-
<a-input v-model="item.slot.actionText" placeholder="请输入操作列显示文本,默认为详情"/>
|
189
|
-
</a-form-model-item>
|
190
|
-
<a-form-model-item v-if="dataMode.sqlQueryItem || dataMode.sqlQueryCondition" label="字段默认值" prop="default">
|
191
|
-
<a-input v-model="item.default" placeholder="当查询结果为null时,指定默认值"/>
|
192
|
-
</a-form-model-item>
|
193
|
-
</template>
|
194
|
-
</a-card>
|
195
|
-
</a-col>
|
196
|
-
<a-col v-if="!dataMode.group && item.formType && (((dataMode.addOrEditForm || dataMode.queryForm ) && (item.formType === 'input' || item.formType === 'select')) || (dataMode.table && item.formType !== 'file' && item.formType !== 'image') || selectDataShow)" :span="9">
|
197
|
-
<a-card :bodyStyle="bodyStyle" title="扩展属性">
|
198
|
-
<template v-if="(dataMode.addOrEditForm || dataMode.queryForm ) && (item.formType === 'input' || item.formType === 'select')">
|
199
|
-
<a-divider style="font-size: 14px;margin-top: 0">提示相关</a-divider>
|
200
|
-
<a-form-model-item label="表单水印" prop="placeholder">
|
201
|
-
<a-input v-model="item.placeholder" placeholder="表单水印(placeholder)" />
|
202
|
-
</a-form-model-item>
|
203
|
-
</template>
|
204
|
-
<template v-if="selectDataShow">
|
205
|
-
<a-divider style="font-size: 14px;margin-top: 0">数据源相关</a-divider>
|
206
|
-
<a-form-model-item label="数据源类型" prop="selectType">
|
207
|
-
<a-select v-model="item.selectType" placeholder="请选择数据源类型" @change="changeSelectKType">
|
208
|
-
<a-select-option v-for="selectDataTypeItem in selectDataType.filter(h=>!h.noMatch.includes(item.formType))" :key="selectDataTypeItem.key">{{ selectDataTypeItem.label }}</a-select-option>
|
209
|
-
<a-popover
|
210
|
-
slot="suffixIcon"
|
211
|
-
placement="bottom"
|
212
|
-
title="关于数据源类型">
|
213
|
-
<template slot="content">
|
214
|
-
<p>设置数据源</p>
|
215
|
-
<p>数据源类型分为三种,你可以根据需要选择</p>
|
216
|
-
<p>字典键:选项从字典表(t_dictionary)获取,你只需要选择字典键的名称即可</p>
|
217
|
-
<p>业务逻辑名称:选项通过发起http请求调用指定的业务逻辑(Logic)接口获取</p>
|
218
|
-
<p>固定集合:选项为静态值,JSONArray格式</p>
|
219
|
-
<p>当表单为树形选择框类型时,返回的数据需按照以下形式:</p>
|
220
|
-
<json-viewer
|
221
|
-
:expand-depth="parseInt('100')"
|
222
|
-
:value="DemoJson"
|
223
|
-
style="overflow: auto;max-height: 440px"></json-viewer>
|
224
|
-
</template>
|
225
|
-
<a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
|
226
|
-
</a-popover>
|
227
|
-
</a-select>
|
228
|
-
</a-form-model-item>
|
229
|
-
<a-form-model-item v-if="item.selectType" label="数据源" prop="selectKey">
|
230
|
-
<a-select
|
231
|
-
v-if="item.selectType === 'key'"
|
232
|
-
v-model="item.selectKey"
|
233
|
-
:filter-option="filterOption"
|
234
|
-
placeholder="请选择字典键"
|
235
|
-
show-search
|
236
|
-
@change="changeSelectKey(item)">
|
237
|
-
<template>
|
238
|
-
<a-select-option
|
239
|
-
v-for="(optionItem,index) in option"
|
240
|
-
:key="index"
|
241
|
-
:value="Object.keys(optionItem)[0]">{{ optionItem[Object.keys(optionItem)[0]] }}
|
242
|
-
</a-select-option>
|
243
|
-
</template>
|
244
|
-
</a-select>
|
245
|
-
<a-input v-if="item.selectType === 'logic'" v-model="item.selectKey" placeholder="请输入业务逻辑名称"/>
|
246
|
-
<a-textarea v-if="item.selectType === 'fixArray'" v-model="item.selectKey" placeholder="请录入数据源"/>
|
247
|
-
</a-form-model-item>
|
248
|
-
<a-form-model-item v-if="item.selectType === 'logic'" label="数据源加载方式" prop="selectLoadType">
|
249
|
-
<a-radio-group v-model="item.lazyLoad" button-style="solid" default-value="false">
|
250
|
-
<a-radio-button value="true">
|
251
|
-
{{ item.formType === 'treeSelect' ? '异步加载节点' : '懒加载搜索' }}
|
252
|
-
</a-radio-button>
|
253
|
-
<a-radio-button value="false">
|
254
|
-
一次性加载
|
255
|
-
</a-radio-button>
|
256
|
-
</a-radio-group>
|
257
|
-
</a-form-model-item>
|
258
|
-
<a-form-model-item label="关联外键字段" prop="selectKeyName">
|
259
|
-
<a-input v-model="item.selectKeyName" placeholder="该列关联的外键字段">
|
260
|
-
<a-popover slot="suffix" placement="bottom" title="关于关联外键字段">
|
261
|
-
<template slot="content">
|
262
|
-
<p><span style="font-weight: bold;"><span style="color: #FF0036">非必需的实验性功能:</span>设置该参数需开发岗指导</span></p>
|
263
|
-
<p>当字段与主子表外键有关系时,你可以指定<span style="font-weight: bold">该列所关联的外键字段名</span>
|
264
|
-
</p>
|
265
|
-
<p>设置该参数是为了该字段用作表单查询时,系统可以通过设置的关联外键字段,而非字面值作为查询条件</p>
|
266
|
-
<p>示例:</p>
|
267
|
-
<p>主表为t_userfiles(表档案)表,别名为u,与t_gasbrand(气表品牌表)有关联关系,别名为g,为了显示表档案对应的气表品牌数据,我们将数据字段名设置为g.f_gasbrand</p>
|
268
|
-
<p>这样我们就可以在table中看到气表品牌了,但是用户如果通过气表品牌下拉框进行筛选,我们指定的g.f_gasbrand只是气表品牌的值,而实际关联字段是u.f_gasbrand_id</p>
|
269
|
-
<p>所以如果我们指定了关联外键字段u.f_gasbrand_id,系统则会使用u.f_gasbrand_id筛选数据,而不是g.f_gasbrand,从而优化了查询效率
|
270
|
-
</p>
|
271
|
-
</template>
|
272
|
-
<a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
|
273
|
-
</a-popover>
|
274
|
-
</a-input>
|
275
|
-
</a-form-model-item>
|
276
|
-
</template>
|
277
|
-
<template v-if="item.formType === 'file' || item.formType === 'image'">
|
278
|
-
<a-divider style="font-size: 14px;margin-top: 0">文件上传相关</a-divider>
|
279
|
-
<a-form-model-item label="允许上传文件数量" prop="accept" style="margin-bottom: 5px;">
|
280
|
-
<a-slider
|
281
|
-
v-model="item.acceptCount"
|
282
|
-
:marks="{ 1: '1', 3: '3', 5: '5', 10: '10', 15: '15', 20: '20'}"
|
283
|
-
:max="20"
|
284
|
-
:min="1"
|
285
|
-
/>
|
286
|
-
</a-form-model-item>
|
287
|
-
<a-form-model-item label="附件用途" prop="useType">
|
288
|
-
<a-select v-model="item.useType" placeholder="指定文件用途,同表单不同用途">
|
289
|
-
<a-select-option v-for="userTypeItem in $appdata.getDictionaryList('useType')" :key="userTypeItem.value">{{ userTypeItem.value }}</a-select-option>
|
290
|
-
</a-select>
|
291
|
-
</a-form-model-item>
|
292
|
-
<a-form-model-item label="上传的仓库" prop="resUploadStock">
|
293
|
-
<a-select v-model="item.resUploadStock" placeholder="选择文件上传到的仓库" @change="changeStock">
|
294
|
-
<a-select-option v-for="stock in stockList" :key="stock.id">{{ stock.f_name }}</a-select-option>
|
295
|
-
</a-select>
|
296
|
-
</a-form-model-item>
|
297
|
-
<a-form-model-item v-if="item.resUploadStock" label="具体路径" prop="pathKey">
|
298
|
-
<a-select v-model="item.pathKey" placeholder="仓库扩展路径">
|
299
|
-
<a-select-option v-for="pathKey in lowerPath" :key="pathKey.label">{{ pathKey.label }}</a-select-option>
|
300
|
-
</a-select>
|
301
|
-
</a-form-model-item>
|
302
|
-
<a-form-model-item v-if="item.formType === 'file'" label="允许上传文件类型" prop="accept">
|
303
|
-
<a-select v-model="item.accept" mode="tags" placeholder="指定文件类型,默认不限制" @change="itemAcceptChange">
|
304
|
-
<a-select-option v-for="type_item in fileType" :key="type_item.accept">{{ type_item.label }}</a-select-option>
|
305
|
-
</a-select>
|
306
|
-
</a-form-model-item>
|
307
|
-
</template>
|
308
|
-
</a-card>
|
309
|
-
</a-col>
|
310
|
-
<a-col :span="18" v-if="dataMode.group">
|
311
|
-
<a-card :bodyStyle="bodyStyle" title="数据字段">
|
312
|
-
<a-button type="primary" slot="extra" @click="addColumnItem()">增加</a-button>
|
313
|
-
<a-row :gutter="24">
|
314
|
-
<a-col :span="7">
|
315
|
-
<span style="font-weight: bold">
|
316
|
-
标签名
|
317
|
-
</span>
|
318
|
-
</a-col>
|
319
|
-
<a-col :span="7">
|
320
|
-
<span style="font-weight: bold">
|
321
|
-
字段名
|
322
|
-
</span>
|
323
|
-
</a-col>
|
324
|
-
<a-col :span="8">
|
325
|
-
<span style="font-weight: bold">
|
326
|
-
数据模式
|
327
|
-
</span>
|
328
|
-
</a-col>
|
329
|
-
<a-col :span="2">
|
330
|
-
<span style="font-weight: bold">
|
331
|
-
操作
|
332
|
-
</span>
|
333
|
-
</a-col>
|
334
|
-
</a-row>
|
335
|
-
<a-divider style="margin: 6px 0" />
|
336
|
-
<div
|
337
|
-
v-for="(columnItem, index) in item.column"
|
338
|
-
:key="index"
|
339
|
-
draggable="true"
|
340
|
-
@dragend="handleDragEnd($event, columnItem)"
|
341
|
-
@dragenter="handleDragEnter($event, columnItem)"
|
342
|
-
@dragstart="handleDragStart($event, columnItem)"
|
343
|
-
@dragover.prevent="handleDragOver($event, columnItem)">
|
344
|
-
<a-row v-if="ending && dragging && columnItem.key === ending.key && dragging.key !== ending.key" class="dragTipsWarp">
|
345
|
-
<span class="dragTips">拖到此处放置</span>
|
346
|
-
</a-row>
|
347
|
-
<a-row :gutter="24" class="column_item dragTipsWarp">
|
348
|
-
<a-col :span="7">
|
349
|
-
<span style="font-weight: bold">
|
350
|
-
{{ columnItem.title }}
|
351
|
-
</span>
|
352
|
-
</a-col>
|
353
|
-
<a-col :span="7">
|
354
|
-
<span style="font-weight: bold">
|
355
|
-
{{ columnItem.key }}
|
356
|
-
</span>
|
357
|
-
</a-col>
|
358
|
-
<a-col :span="8">
|
359
|
-
<a-tooltip>
|
360
|
-
<template slot="title">
|
361
|
-
查询表单项
|
362
|
-
</template>
|
363
|
-
<a-tag :color="columnItem.dataModeArray && columnItem.dataModeArray.includes('queryForm') ? 'blue' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="file-search" /></a-tag>
|
364
|
-
</a-tooltip>
|
365
|
-
<a-tooltip>
|
366
|
-
<template slot="title">
|
367
|
-
表格列
|
368
|
-
</template>
|
369
|
-
<a-tag :color="columnItem.dataModeArray && columnItem.dataModeArray.includes('table') ? 'orange' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="table" /></a-tag>
|
370
|
-
</a-tooltip>
|
371
|
-
<a-tooltip>
|
372
|
-
<template slot="title">
|
373
|
-
新增/修改表单项
|
374
|
-
</template>
|
375
|
-
<a-tag :color="columnItem.dataModeArray && columnItem.dataModeArray.includes('addOrEditForm') ? 'green' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="form" /></a-tag>
|
376
|
-
</a-tooltip>
|
377
|
-
<a-tooltip>
|
378
|
-
<template slot="title">
|
379
|
-
SQL查询项
|
380
|
-
</template>
|
381
|
-
<a-tag :color="columnItem.dataModeArray && columnItem.dataModeArray.includes('sqlQueryItem') ? 'cyan' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="bars" /></a-tag>
|
382
|
-
</a-tooltip>
|
383
|
-
<a-tooltip>
|
384
|
-
<template slot="title">
|
385
|
-
SQL查询表达式
|
386
|
-
</template>
|
387
|
-
<a-tag :color="columnItem.dataModeArray && columnItem.dataModeArray.includes('sqlQueryCondition') ? 'purple' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="search" /></a-tag>
|
388
|
-
</a-tooltip>
|
389
|
-
<a-tooltip>
|
390
|
-
<template slot="title">
|
391
|
-
Excel导入项
|
392
|
-
</template>
|
393
|
-
<a-tag :color="columnItem.dataModeArray && columnItem.dataModeArray.includes('excelImportItem') ? '#107C41' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="file-excel" /></a-tag>
|
394
|
-
</a-tooltip>
|
395
|
-
<a-tooltip>
|
396
|
-
<template slot="title">
|
397
|
-
数据组
|
398
|
-
</template>
|
399
|
-
<a-tag :color="columnItem.dataModeArray && columnItem.dataModeArray.includes('group') ? '#82A0D8' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="crown" /></a-tag>
|
400
|
-
</a-tooltip>
|
401
|
-
</a-col>
|
402
|
-
<a-col :span="1">
|
403
|
-
<a-icon type="edit" @click="editColumnItem(columnItem.key,index)"/>
|
404
|
-
</a-col>
|
405
|
-
<a-col :span="1">
|
406
|
-
<a-icon type="close" @click="removeColumnItem(columnItem.key,index)"/>
|
407
|
-
</a-col>
|
408
|
-
</a-row>
|
409
|
-
</div>
|
410
|
-
</a-card>
|
411
|
-
</a-col>
|
412
|
-
</a-row>
|
413
|
-
<a-alert
|
414
|
-
v-if="dataModeArrayData.length === 0"
|
415
|
-
message="错误:请至少选择一种数据模式"
|
416
|
-
show-icon
|
417
|
-
style="margin-top: 5px"
|
418
|
-
type="error"/>
|
419
|
-
<a-alert
|
420
|
-
v-if="dataMode.addOrEditForm && !dataMode.sqlQueryItem && item.formType !== 'file' && item.formType !== 'image'"
|
421
|
-
message="错误:如果要生成新增/修改表单项,必须勾选生成SQL查询项"
|
422
|
-
show-icon
|
423
|
-
style="margin-top: 5px"
|
424
|
-
type="error"/>
|
425
|
-
<a-alert
|
426
|
-
v-if="dataMode.queryForm && !dataMode.sqlQueryCondition"
|
427
|
-
message="提示:您没有勾选生成SQL查询表达式,渲染的表单项不会生成SQL查询条件"
|
428
|
-
show-icon
|
429
|
-
style="margin-top: 5px"
|
430
|
-
type="info"/>
|
431
|
-
<a-alert
|
432
|
-
v-if="dataMode.table && !dataMode.sqlQueryItem"
|
433
|
-
message="提示:您没有勾选生成SQL查询项,渲染的表格列不会绑定SQL结果集数据"
|
434
|
-
show-icon
|
435
|
-
style="margin-top: 5px"
|
436
|
-
type="info"/>
|
437
|
-
<a-alert
|
438
|
-
v-if="item.title.length > 8"
|
439
|
-
message="提示:标签名称过长可能会影响表格列展示效果,建议不超过8个字符"
|
440
|
-
show-icon
|
441
|
-
style="margin-top: 5px"
|
442
|
-
type="warning"/>
|
443
|
-
</a-form-model>
|
444
|
-
<create-query-item ref="queryItem" @getColumn="getColumnItem" @itemHandle="itemHandleItem"/>
|
445
|
-
</a-modal>
|
446
|
-
</template>
|
447
|
-
|
448
|
-
<script>
|
449
|
-
import {
|
450
|
-
dataModeType,
|
451
|
-
fileType,
|
452
|
-
formRuleType,
|
453
|
-
formType,
|
454
|
-
queryType,
|
455
|
-
slotType,
|
456
|
-
silencePurposeType,
|
457
|
-
addOrEditType,
|
458
|
-
selectDataType
|
459
|
-
} from '@vue2-client/config/CreateQueryConfig'
|
460
|
-
import { post } from '@vue2-client/services/api'
|
461
|
-
import JsonViewer from 'vue-json-viewer'
|
462
|
-
import { getDictionaryParam } from '@vue2-client/services/api/common'
|
463
|
-
|
464
|
-
const DemoJson = [{
|
465
|
-
value: 'zhejiang',
|
466
|
-
label: 'Zhejiang',
|
467
|
-
children: [{ value: 'hangzhou', label: 'Hangzhou', children: [{ value: 'xihu', label: 'West Lake' }] }]
|
468
|
-
}]
|
469
|
-
|
470
|
-
export default {
|
471
|
-
name: 'CreateQueryItem',
|
472
|
-
components: {
|
473
|
-
JsonViewer
|
474
|
-
},
|
475
|
-
computed: {
|
476
|
-
// 是否展示数据源相关字段
|
477
|
-
selectDataShow () {
|
478
|
-
return this.item.formType === 'select' || this.item.formType === 'checkbox' || this.item.formType === 'radio' || this.item.formType === 'treeSelect'
|
479
|
-
},
|
480
|
-
// 作用域插槽是否禁用
|
481
|
-
slotTypeDisabled () {
|
482
|
-
return this.item.selectKey && this.item.selectType === 'key'
|
483
|
-
},
|
484
|
-
// 字段名称是否禁用
|
485
|
-
keyDisabled () {
|
486
|
-
return this.item.formType === 'file' || this.item.formType === 'image' || this.dataMode.mixinTableName
|
487
|
-
},
|
488
|
-
// 数据模式是否禁用
|
489
|
-
dataModeDisabled () {
|
490
|
-
return this.item.formType === 'file' || this.item.formType === 'image' || this.item.formType === 'addressSearch'
|
491
|
-
},
|
492
|
-
dataMode: function () {
|
493
|
-
const result = {
|
494
|
-
queryForm: false,
|
495
|
-
table: false,
|
496
|
-
addOrEditForm: false,
|
497
|
-
sqlQueryItem: false,
|
498
|
-
sqlQueryCondition: false,
|
499
|
-
excelImportItem: false,
|
500
|
-
group: false,
|
501
|
-
mixinTableName: false
|
502
|
-
}
|
503
|
-
for (const item of this.dataModeArrayData) {
|
504
|
-
result[item] = true
|
505
|
-
}
|
506
|
-
return result
|
507
|
-
},
|
508
|
-
queryTypeV () {
|
509
|
-
return queryType.filter(item => {
|
510
|
-
return item.match.findIndex(type => type === this.item.formType || type === 'all') > -1
|
511
|
-
})
|
512
|
-
},
|
513
|
-
dataModeTypeV () {
|
514
|
-
if (this.dataModeArrayData.includes('group')) {
|
515
|
-
return [{
|
516
|
-
label: 'SQL生成查询项',
|
517
|
-
value: 'sqlQueryItem',
|
518
|
-
noMatch: ['file', 'personSetting']
|
519
|
-
}, {
|
520
|
-
label: '字段组存储',
|
521
|
-
value: 'group',
|
522
|
-
noMatch: []
|
523
|
-
}]
|
524
|
-
}
|
525
|
-
if (this.dataModeArrayData.includes('mixinTableName')) {
|
526
|
-
return [
|
527
|
-
{
|
528
|
-
label: '渲染查询表单项',
|
529
|
-
value: 'queryForm',
|
530
|
-
noMatch: ['file', 'image', 'textarea', 'personSetting']
|
531
|
-
},
|
532
|
-
{
|
533
|
-
label: '动态表名参数',
|
534
|
-
value: 'mixinTableName',
|
535
|
-
noMatch: []
|
536
|
-
}
|
537
|
-
]
|
538
|
-
}
|
539
|
-
if (this.item.formType) {
|
540
|
-
return dataModeType.filter(item => {
|
541
|
-
return item.noMatch.findIndex(type => type === this.item.formType) === -1
|
542
|
-
})
|
543
|
-
} else {
|
544
|
-
return dataModeType
|
545
|
-
}
|
546
|
-
},
|
547
|
-
slotTypeV () {
|
548
|
-
return slotType.filter(item => {
|
549
|
-
return item.match.findIndex(type => type === this.item.formType || type === 'all') > -1
|
550
|
-
})
|
551
|
-
},
|
552
|
-
addOrEditTypeV () {
|
553
|
-
return addOrEditType.filter(item => {
|
554
|
-
return item.match.findIndex(type => type === this.item.formType || type === 'all') > -1
|
555
|
-
})
|
556
|
-
}
|
557
|
-
},
|
558
|
-
data () {
|
559
|
-
return {
|
560
|
-
DemoJson,
|
561
|
-
dataModeType,
|
562
|
-
queryType,
|
563
|
-
formType,
|
564
|
-
formRuleType,
|
565
|
-
slotType,
|
566
|
-
fileType,
|
567
|
-
silencePurposeType,
|
568
|
-
addOrEditType,
|
569
|
-
selectDataType,
|
570
|
-
// 控制modal框
|
571
|
-
visible: false,
|
572
|
-
type: '',
|
573
|
-
bodyStyle: {
|
574
|
-
height: '500px',
|
575
|
-
overflowY: 'auto'
|
576
|
-
},
|
577
|
-
// 表单查询方式是否禁用
|
578
|
-
formQueryTypeDisabled: false,
|
579
|
-
// 数据模式类型集合值
|
580
|
-
dataModeArrayData: [],
|
581
|
-
// 表单项
|
582
|
-
item: {
|
583
|
-
key: '',
|
584
|
-
title: '',
|
585
|
-
slot: {
|
586
|
-
type: 'default'
|
587
|
-
},
|
588
|
-
rule: {
|
589
|
-
required: 'false'
|
590
|
-
},
|
591
|
-
column: [],
|
592
|
-
queryType: '=',
|
593
|
-
formType: 'input',
|
594
|
-
accept: undefined,
|
595
|
-
acceptCount: 3,
|
596
|
-
pathKey: undefined,
|
597
|
-
selectType: undefined,
|
598
|
-
selectKey: undefined,
|
599
|
-
addOrEdit: 'all',
|
600
|
-
fileRootPath: undefined,
|
601
|
-
selectKeyName: undefined,
|
602
|
-
resUploadStock: undefined,
|
603
|
-
dataModeArray: []
|
604
|
-
},
|
605
|
-
// 数据仓库列表
|
606
|
-
stockList: [],
|
607
|
-
// 扩展目录
|
608
|
-
lowerPath: [],
|
609
|
-
parent_node: [],
|
610
|
-
// 必填控制
|
611
|
-
itemRules: {
|
612
|
-
formType: [{ required: true, message: '请输入表单类型', trigger: 'change' }],
|
613
|
-
key: [{
|
614
|
-
required: true,
|
615
|
-
validator: (rule, value, callback) => {
|
616
|
-
// 判断必填
|
617
|
-
if (!value) {
|
618
|
-
callback(new Error('请输入字段名称'))
|
619
|
-
} else {
|
620
|
-
// 判断必须全部小写 并且不能包含空格
|
621
|
-
if (value !== value.toLowerCase() || value.indexOf(' ') !== -1 && !value === '_mixinTableName_') {
|
622
|
-
callback(new Error('字段名称必须全部小写,且不能包含空格'))
|
623
|
-
} else {
|
624
|
-
callback()
|
625
|
-
}
|
626
|
-
}
|
627
|
-
},
|
628
|
-
trigger: 'blur'
|
629
|
-
}],
|
630
|
-
title: [{
|
631
|
-
required: true,
|
632
|
-
validator: (rule, value, callback) => {
|
633
|
-
// 判断必填
|
634
|
-
if (!value) {
|
635
|
-
callback(new Error('请输入标签名称'))
|
636
|
-
} else {
|
637
|
-
// // 大于8个字符给提示
|
638
|
-
// if (value.length > 8) {
|
639
|
-
// callback(new Error('标签名称过长,建议不超过8个字符,可能会影响展示效果'))
|
640
|
-
// } else {
|
641
|
-
callback()
|
642
|
-
// }
|
643
|
-
}
|
644
|
-
},
|
645
|
-
trigger: 'blur'
|
646
|
-
}],
|
647
|
-
selectType: [{ required: true, message: '请选择数据源类型', trigger: 'change' }],
|
648
|
-
selectKey: [{ required: true, message: '请输入数据源内容', trigger: 'blur' }],
|
649
|
-
'slot.value': [{ required: true, message: '请输入文本溢出上限长度', trigger: 'blur' }],
|
650
|
-
'slot.keyMap': [{ required: true, message: '请输入徽标字典键', trigger: 'blur' }],
|
651
|
-
silencePurpose: [{ required: true, message: '请选择字段用途', trigger: 'change' }],
|
652
|
-
silenceSource: [{ required: true, message: '请输入业务逻辑名称', trigger: 'blur' }],
|
653
|
-
resUploadStock: [{ required: true, message: '请选择上传到的仓库', trigger: 'blur' }],
|
654
|
-
pathKey: [{ required: true, message: '请选择上传到的扩展目录', trigger: 'blur' }]
|
655
|
-
},
|
656
|
-
// 字典键集合
|
657
|
-
option: [],
|
658
|
-
selectIndex: null,
|
659
|
-
ending: null,
|
660
|
-
dragging: null,
|
661
|
-
itemMap: {}
|
662
|
-
}
|
663
|
-
},
|
664
|
-
mounted () {
|
665
|
-
this.resetDataMode()
|
666
|
-
},
|
667
|
-
props: { },
|
668
|
-
methods: {
|
669
|
-
initItem (lysis = {}) {
|
670
|
-
this.item = Object.assign({
|
671
|
-
key: '',
|
672
|
-
title: '',
|
673
|
-
slot: {
|
674
|
-
type: 'default'
|
675
|
-
},
|
676
|
-
rule: {
|
677
|
-
required: 'false'
|
678
|
-
},
|
679
|
-
column: [],
|
680
|
-
selectKey: undefined,
|
681
|
-
queryType: '=',
|
682
|
-
formType: 'input',
|
683
|
-
acceptCount: 3,
|
684
|
-
fileRootPath: undefined,
|
685
|
-
pathKey: undefined,
|
686
|
-
accept: undefined,
|
687
|
-
selectType: undefined,
|
688
|
-
addOrEdit: 'all',
|
689
|
-
selectKeyName: undefined,
|
690
|
-
resUploadStock: undefined,
|
691
|
-
dataModeArray: []
|
692
|
-
}, lysis)
|
693
|
-
},
|
694
|
-
// 控制 展示
|
695
|
-
flashModal (show = 'None') {
|
696
|
-
const bool = show === 'None' ? !this.visible : !!show
|
697
|
-
if (bool && this.option.length === 0) {
|
698
|
-
getDictionaryParam(true).then(res => {
|
699
|
-
this.option = res
|
700
|
-
})
|
701
|
-
}
|
702
|
-
this.visible = bool
|
703
|
-
},
|
704
|
-
// 编辑数据字段前准备数据
|
705
|
-
editColumnItemExecute (_item) {
|
706
|
-
this.type = '修改'
|
707
|
-
const defaultValue = { formType: 'input', type: 'string', addOrEdit: 'all', slot: { type: 'default' }, rule: {}, selectKey: {}, column: [] }
|
708
|
-
if (!_item.queryType) {
|
709
|
-
defaultValue.queryType = '='
|
710
|
-
}
|
711
|
-
_item = Object.assign({}, defaultValue, _item)
|
712
|
-
if (_item.formType === 'file' || _item.formType === 'image') {
|
713
|
-
this.getStocks()
|
714
|
-
// 如果有仓库 则获取该仓库的扩展路径
|
715
|
-
if (_item.resUploadStock) {
|
716
|
-
this.lowerPath = this.stockList.filter(item => item.id === _item.resUploadStock)[0]?.f_lower_path_json ?? []
|
717
|
-
}
|
718
|
-
}
|
719
|
-
if (_item.selectKey && _item.selectKey.length >= 6 && _item.selectType === 'logic' && _item.selectKey.substring(0, 6) === 'logic@') {
|
720
|
-
_item.selectKey = _item.selectKey.substring(6)
|
721
|
-
} else if (_item.selectKey && _item.selectKey instanceof Array) {
|
722
|
-
_item.selectKey = JSON.stringify(_item.selectKey)
|
723
|
-
}
|
724
|
-
// 兼容旧作用域插槽属性
|
725
|
-
this.compatibleTheSlot(_item)
|
726
|
-
this.item = _item
|
727
|
-
this.dataModeArrayData = this.item.dataModeArray
|
728
|
-
this.flashModal()
|
729
|
-
|
730
|
-
for (const columnItem of this.item.column) {
|
731
|
-
this.itemMap[columnItem.key] = Object.assign({
|
732
|
-
key: '',
|
733
|
-
title: '',
|
734
|
-
slot: {},
|
735
|
-
rule: {
|
736
|
-
required: 'false'
|
737
|
-
},
|
738
|
-
dataModeArray: []
|
739
|
-
}, columnItem)
|
740
|
-
}
|
741
|
-
},
|
742
|
-
// 增加数据字段前数据处理
|
743
|
-
addColumnItemExecute () {
|
744
|
-
this.type = '新增'
|
745
|
-
this.dataModeArrayData = ['queryForm', 'table', 'addOrEditForm', 'sqlQueryItem', 'sqlQueryCondition']
|
746
|
-
this.initItem()
|
747
|
-
this.flashModal()
|
748
|
-
},
|
749
|
-
modelCancel () {
|
750
|
-
this.flashModal()
|
751
|
-
},
|
752
|
-
submitItem () {
|
753
|
-
this.$refs.itemForm.validate(valid => {
|
754
|
-
if (valid) {
|
755
|
-
const fileBool = this.item.formType === 'file' || this.item.formType === 'image'
|
756
|
-
if (this.dataModeArrayData.length === 0) {
|
757
|
-
this.$message.error('请至少选择一种数据模式')
|
758
|
-
return
|
759
|
-
}
|
760
|
-
if (!fileBool && (this.dataMode.addOrEditForm && !this.dataMode.sqlQueryItem)) {
|
761
|
-
this.$message.error('如果要生成新增/修改表单项,必须勾选生成SQL查询项')
|
762
|
-
return
|
763
|
-
}
|
764
|
-
if (fileBool && !(!this.dataMode.table && !this.dataMode.sqlQueryCondition && !this.dataMode.queryForm)) {
|
765
|
-
this.$message.error(`上传类表单项只能选择 "渲染新增/修改表单项"`)
|
766
|
-
return
|
767
|
-
}
|
768
|
-
this.itemHandle()
|
769
|
-
}
|
770
|
-
})
|
771
|
-
},
|
772
|
-
visitAcceptFile () {
|
773
|
-
window.open('https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/input/file#attr-accept')
|
774
|
-
},
|
775
|
-
// 修改上传到哪个仓库
|
776
|
-
changeStock (stock) {
|
777
|
-
if (stock) {
|
778
|
-
const stockValue = this.stockList.filter(item => item.id === stock)[0]
|
779
|
-
this.lowerPath = stockValue.f_lower_path_json ?? []
|
780
|
-
this.item.resUploadMode = stockValue.f_stock_type
|
781
|
-
this.item.fileRootPath = stockValue.f_root_path
|
782
|
-
this.item.stockAlias = stockValue.f_alias
|
783
|
-
this.item.pathKey = undefined
|
784
|
-
}
|
785
|
-
},
|
786
|
-
// 文件上传限制类型修改
|
787
|
-
itemAcceptChange (newVal) {
|
788
|
-
if (newVal.includes('*')) {
|
789
|
-
this.item.accept = ['*']
|
790
|
-
}
|
791
|
-
},
|
792
|
-
getColumn () {
|
793
|
-
let result = {}
|
794
|
-
this.$emit('getColumn', val => { result = val })
|
795
|
-
return result
|
796
|
-
},
|
797
|
-
changeFormType (item) {
|
798
|
-
this.initItem({ key: item.key, title: item.title, formType: item.formType })
|
799
|
-
if (item.formType === 'file' || item.formType === 'image') {
|
800
|
-
this.item.acceptCount = 3
|
801
|
-
this.getStocks()
|
802
|
-
this.item.accept = item.formType === 'file' ? ['*'] : ['.jpg,.jpeg,.ico,.gif,svg,.webp,.png,.bmp,.pjpeg,']
|
803
|
-
this.item.resUploadMode = 'server'
|
804
|
-
this.item.key = item.formType === 'file' ? 'FilesId' : 'Images'
|
805
|
-
this.dataModeArrayData = ['addOrEditForm']
|
806
|
-
} else if (item.formType === 'addressSearch') {
|
807
|
-
this.dataModeArrayData = ['addOrEditForm', 'sqlQueryItem', 'table']
|
808
|
-
} else {
|
809
|
-
if (['FilesId', 'Images'].includes(this.item.key)) { this.item.key = '' }
|
810
|
-
this.resetDataMode()
|
811
|
-
// 表单查询方式有预选项时
|
812
|
-
if (this.queryTypeV.length) {
|
813
|
-
this.item.queryType = this.queryTypeV[0].key
|
814
|
-
}
|
815
|
-
}
|
816
|
-
},
|
817
|
-
// 获取所有仓库
|
818
|
-
getStocks () {
|
819
|
-
if (this.stockList.length === 0) {
|
820
|
-
post('/api/af-system/logic/getFilesStock', {}).then(res => {
|
821
|
-
this.stockList = res.sort((a, b) => b.progress - a.progress)
|
822
|
-
}).catch(e => {})
|
823
|
-
}
|
824
|
-
},
|
825
|
-
// 重置数据模式
|
826
|
-
resetDataMode () {
|
827
|
-
this.dataModeArrayData = this.dataModeTypeV.map(item => item.value).filter(h => h !== 'group')
|
828
|
-
},
|
829
|
-
// 数据模式改变
|
830
|
-
dataModeArrayDataChange (newVal) {
|
831
|
-
if (newVal.includes('mixinTableName')) {
|
832
|
-
this.item.key = '_mixinTableName_'
|
833
|
-
this.dataModeArrayData = ['queryForm', 'mixinTableName']
|
834
|
-
} else if (this.item.key === '_mixinTableName_') {
|
835
|
-
this.item.key = ''
|
836
|
-
}
|
837
|
-
if (newVal.includes('group')) {
|
838
|
-
this.dataModeArrayData = ['sqlQueryItem', 'group']
|
839
|
-
}
|
840
|
-
},
|
841
|
-
itemHandle () {
|
842
|
-
// 查询表单项或者新增/修改表单项
|
843
|
-
if (this.dataMode.queryForm || this.dataMode.addOrEditForm || this.dataMode.sqlQueryCondition) {
|
844
|
-
if (!this.dataMode.sqlQueryItem || !this.dataMode.addOrEditForm) {
|
845
|
-
this.delKey(this.item, 'addOrEdit', 'silencePurpose', 'silenceSource')
|
846
|
-
}
|
847
|
-
if (this.item.selectType && this.item.selectType === 'logic' && this.item.selectKey.substring(0, 6) !== 'logic@') {
|
848
|
-
// 数据源为logic
|
849
|
-
this.item.selectKey = 'logic@' + this.item.selectKey
|
850
|
-
} else if (this.item.selectType && this.item.selectType === 'fixArray' && !this.isJSON(this.item.selectKey)) {
|
851
|
-
// 数据源为固定json集合
|
852
|
-
this.$message.warning('下拉框数据源不是JSON集合')
|
853
|
-
return
|
854
|
-
}
|
855
|
-
} else {
|
856
|
-
this.delKey(this.item, 'queryType', 'formType', 'addOrEdit', 'silencePurpose', 'silenceSource', 'placeholder', 'rule', 'selectKey', 'selectKeyName', 'lazyLoad')
|
857
|
-
}
|
858
|
-
// 如果和数据源字段无关
|
859
|
-
if (!this.selectDataShow) {
|
860
|
-
this.delKey(this.item, 'selectType', 'selectKey', 'lazyLoad', 'selectKeyName')
|
861
|
-
}
|
862
|
-
// 删除空的关联外键字段
|
863
|
-
if (!this.item.selectKeyName) {
|
864
|
-
delete this.item.selectKeyName
|
865
|
-
}
|
866
|
-
// 默认插槽就先删除
|
867
|
-
if (this.item.slot && (this.item.slot.type === 'default' || !this.item.slot.type)) { delete this.item.slot }
|
868
|
-
// 根据数据模式处理数据
|
869
|
-
if (!this.dataMode.sqlQueryCondition) {
|
870
|
-
delete this.item.queryType
|
871
|
-
}
|
872
|
-
if (!this.dataMode.sqlQueryItem) { this.delKey(this.item, 'default') }
|
873
|
-
this.item.dataModeArray = this.dataModeArrayData
|
874
|
-
this.$emit('itemHandle', this.item, this.type)
|
875
|
-
this.initItem()
|
876
|
-
this.resetDataMode()
|
877
|
-
},
|
878
|
-
changeSelectKType () {
|
879
|
-
this.item.selectKey = undefined
|
880
|
-
},
|
881
|
-
changeSelectKey (item) {
|
882
|
-
if (item.selectType === 'key' && item.selectKey) {
|
883
|
-
this.item.slot = Object.assign({}, this.item.slot, { keyMap: item.selectKey, type: 'badge' })
|
884
|
-
}
|
885
|
-
},
|
886
|
-
filterOption (input, option) {
|
887
|
-
return (
|
888
|
-
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
889
|
-
)
|
890
|
-
},
|
891
|
-
delKey (obj, ...args) {
|
892
|
-
args.forEach(v => {
|
893
|
-
delete obj[v]
|
894
|
-
})
|
895
|
-
return obj
|
896
|
-
},
|
897
|
-
// 判断是否为json字符串
|
898
|
-
isJSON (str) {
|
899
|
-
if (typeof str == 'string') {
|
900
|
-
try {
|
901
|
-
const obj = JSON.parse(str)
|
902
|
-
return !!(typeof obj == 'object' && obj)
|
903
|
-
} catch (e) {
|
904
|
-
return false
|
905
|
-
}
|
906
|
-
}
|
907
|
-
},
|
908
|
-
// 兼容旧插槽函数
|
909
|
-
compatibleTheSlot (_item) {
|
910
|
-
if (_item.slotKeyMap) {
|
911
|
-
_item.slot.keyMap = _item.slotKeyMap
|
912
|
-
delete _item.slotKeyMap
|
913
|
-
}
|
914
|
-
if (_item.slotValue) {
|
915
|
-
_item.slot.value = _item.slotValue
|
916
|
-
delete _item.slotValue
|
917
|
-
}
|
918
|
-
if (_item.actionText) {
|
919
|
-
_item.slot.actionText = _item.actionText
|
920
|
-
delete _item.actionText
|
921
|
-
}
|
922
|
-
},
|
923
|
-
// 拖拽事件
|
924
|
-
handleDragStart (e, item) {
|
925
|
-
this.dragging = item
|
926
|
-
},
|
927
|
-
handleDragEnd (e, item) {
|
928
|
-
if (this.ending.key === this.dragging.key) {
|
929
|
-
return
|
930
|
-
}
|
931
|
-
const newItems = [...this.item.column]
|
932
|
-
const src = newItems.indexOf(this.dragging)
|
933
|
-
const dst = newItems.indexOf(this.ending)
|
934
|
-
// newItems.splice(src, 1, ...newItems.splice(dst, 1, newItems[src])) 替换位置
|
935
|
-
// 挪移位置
|
936
|
-
newItems.splice(src, 1)
|
937
|
-
newItems.splice(dst, 0, this.dragging)
|
938
|
-
this.item.column = newItems
|
939
|
-
this.$nextTick(() => {
|
940
|
-
this.dragging = null
|
941
|
-
this.ending = null
|
942
|
-
})
|
943
|
-
},
|
944
|
-
handleDragOver (e) {
|
945
|
-
// 首先把div变成可以放置的元素,即重写dragenter/dragover
|
946
|
-
// e.dataTransfer.dropEffect="move";//在dragenter中针对放置目标来设置!
|
947
|
-
e.dataTransfer.dropEffect = 'move'
|
948
|
-
},
|
949
|
-
handleDragEnter (e, item) {
|
950
|
-
// 为需要移动的元素设置dragstart事件
|
951
|
-
e.dataTransfer.effectAllowed = 'move'
|
952
|
-
this.ending = item
|
953
|
-
},
|
954
|
-
editColumnItem (key, index) {
|
955
|
-
if (this.itemMap[key]) {
|
956
|
-
this.selectIndex = index
|
957
|
-
this.$refs.queryItem.editColumnItemExecute(this.itemMap[key])
|
958
|
-
} else {
|
959
|
-
this.$message.warn('编辑失败')
|
960
|
-
}
|
961
|
-
},
|
962
|
-
removeColumnItem (key, index) {
|
963
|
-
const _this = this
|
964
|
-
this.$confirm({
|
965
|
-
title: '您确定要删除该数据项?',
|
966
|
-
content: '删除的数据项无法恢复',
|
967
|
-
okText: '确定',
|
968
|
-
okType: 'danger',
|
969
|
-
cancelText: '取消',
|
970
|
-
zIndex: 9999,
|
971
|
-
onOk () {
|
972
|
-
delete _this.itemMap[key]
|
973
|
-
_this.item.column.splice(index, 1)
|
974
|
-
}
|
975
|
-
})
|
976
|
-
},
|
977
|
-
addColumnItem () {
|
978
|
-
this.type = '新增'
|
979
|
-
this.$refs.queryItem.addColumnItemExecute()
|
980
|
-
},
|
981
|
-
getColumnItem (callback) {
|
982
|
-
callback(JSON.parse(JSON.stringify(this.item.column)))
|
983
|
-
},
|
984
|
-
itemHandleItem (item, type) {
|
985
|
-
this.itemMap[item.key] = item
|
986
|
-
if (this.type === '新增') {
|
987
|
-
this.item.column.push(item)
|
988
|
-
} else {
|
989
|
-
this.$set(this.item.column, this.selectIndex, item)
|
990
|
-
}
|
991
|
-
this.$message.success(`${type}成功`)
|
992
|
-
this.$refs.queryItem.flashModal(false)
|
993
|
-
},
|
994
|
-
}
|
995
|
-
}
|
996
|
-
</script>
|
997
|
-
<style scoped>
|
998
|
-
table th, table td {
|
999
|
-
border: 1px rgba(0, 0, 0, 0.65) solid;
|
1000
|
-
text-align: center;
|
1001
|
-
padding: 0 10px;
|
1002
|
-
}
|
1003
|
-
.column_item:hover {
|
1004
|
-
background-color:rgba(64, 169, 255,0.25);
|
1005
|
-
}
|
1006
|
-
.dragTips{
|
1007
|
-
display:block;
|
1008
|
-
text-align: center;
|
1009
|
-
border:1px dashed rgba(64, 169, 255,0.55);
|
1010
|
-
}
|
1011
|
-
.dragTipsWarp{
|
1012
|
-
padding: .5rem 2rem;
|
1013
|
-
}
|
1014
|
-
</style>
|
1
|
+
<template>
|
2
|
+
<a-modal
|
3
|
+
:destroyOnClose="true"
|
4
|
+
:visible="visible"
|
5
|
+
:width="1250"
|
6
|
+
:zIndex="1001"
|
7
|
+
title="数据字段配置"
|
8
|
+
@cancel="modelCancel"
|
9
|
+
@ok="submitItem">
|
10
|
+
<a-form-model
|
11
|
+
ref="itemForm"
|
12
|
+
:model="item"
|
13
|
+
:rules="itemRules"
|
14
|
+
layout="vertical">
|
15
|
+
<a-row :gutter="16">
|
16
|
+
<a-col :span="6">
|
17
|
+
<a-card :bodyStyle="bodyStyle" title="基本属性">
|
18
|
+
<a-divider style="font-size: 14px;margin-top: 0">字段信息</a-divider>
|
19
|
+
<a-form-model-item label="标签名称" prop="title">
|
20
|
+
<a-input v-model="item.title" placeholder="请输入标签名称"/>
|
21
|
+
</a-form-model-item>
|
22
|
+
<a-form-model-item
|
23
|
+
label="字段名称"
|
24
|
+
prop="key">
|
25
|
+
<a-input ref="key" v-model="item.key" :disabled="keyDisabled" placeholder="请输入字段名">
|
26
|
+
<a-popover slot="suffix" placement="bottom" title="关于字段名称">
|
27
|
+
<template slot="content">
|
28
|
+
<p>设置数据字段的名称</p>
|
29
|
+
<p>用作SQL查询时为<span style="font-weight: bold">表别名.数据列名</span>的格式,如:i.id</p>
|
30
|
+
<p style="font-weight: bold">注意事项:</p>
|
31
|
+
<p>由于v2和v3版本产品中一些数据字段有差异,为了增强查询配置在不同版本产品中的通用性,
|
32
|
+
现在查询配置中的数据字段现在可以通过`$`前缀指定通用兼容名了</p>
|
33
|
+
<p>通过指定数据字段为通用兼容名,查询配置将会在解析生成SQL时根据配置的产品版本自动适配实际的字段名。</p>
|
34
|
+
<p>目前支持的兼容性字段见下表:</p>
|
35
|
+
<table>
|
36
|
+
<thead>
|
37
|
+
<tr><th>数据表</th><th>字段含义</th><th>v2产品</th><th>v3产品</th><th>通用兼容名</th></tr>
|
38
|
+
</thead>
|
39
|
+
<tbody>
|
40
|
+
<tr><td>t_userfiles</td><td>表档案主键</td><td>f_user_id</td><td>f_userfiles_id</td><td>$userid</td></tr>
|
41
|
+
</tbody>
|
42
|
+
</table>
|
43
|
+
</template>
|
44
|
+
<a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
|
45
|
+
</a-popover>
|
46
|
+
</a-input>
|
47
|
+
</a-form-model-item>
|
48
|
+
<a-form-model-item
|
49
|
+
v-if="item.formType ==='addressSearch'"
|
50
|
+
label="坐标字段名">
|
51
|
+
<a-input :disabled="true" :value="`${item.key}_lng_lat`">
|
52
|
+
<a-popover slot="suffix" placement="bottom" title="坐标字段名">
|
53
|
+
<template slot="content">
|
54
|
+
<p>表单类型为地点搜索框时:</p>
|
55
|
+
<p>新增/修改表单时,字段名称会存放地址名称,坐标字段名会存放坐标信息</p>
|
56
|
+
</template>
|
57
|
+
<a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
|
58
|
+
</a-popover>
|
59
|
+
</a-input>
|
60
|
+
</a-form-model-item>
|
61
|
+
<a-divider style="font-size: 14px;margin-top: 0">数据模式</a-divider>
|
62
|
+
<a-form-model-item
|
63
|
+
prop="dataMode"
|
64
|
+
style="margin-top: 10px;">
|
65
|
+
<a-checkbox-group v-model="dataModeArrayData" :disabled="dataModeDisabled" @change="dataModeArrayDataChange" :options="dataModeTypeV"/>
|
66
|
+
</a-form-model-item>
|
67
|
+
</a-card>
|
68
|
+
</a-col>
|
69
|
+
<a-col v-show="!dataMode.group && (dataMode.queryForm || dataMode.addOrEditForm || dataMode.table || dataMode.sqlQueryCondition)" :span="9">
|
70
|
+
<a-card v-if="dataMode.queryForm || dataMode.addOrEditForm || dataMode.table || dataMode.sqlQueryCondition" :bodyStyle="bodyStyle" title="核心配置">
|
71
|
+
<template v-if="dataMode.queryForm || dataMode.addOrEditForm || dataMode.sqlQueryCondition">
|
72
|
+
<a-divider style="font-size: 14px;margin-top: 0">表单配置</a-divider>
|
73
|
+
<a-form-model-item label="表单类型" prop="formType">
|
74
|
+
<a-select v-model="item.formType" placeholder="请选择表单类型" @change="changeFormType(item)">
|
75
|
+
<a-select-option v-for="formTypeItem in formType" :key="formTypeItem.key">{{ formTypeItem.label }}</a-select-option>
|
76
|
+
</a-select>
|
77
|
+
</a-form-model-item>
|
78
|
+
<a-form-model-item v-if="dataMode.sqlQueryCondition && item.formType !=='file' && item.formType !=='image' " label="表单查询方式" prop="queryType">
|
79
|
+
<a-select
|
80
|
+
v-model="item.queryType"
|
81
|
+
:disabled="formQueryTypeDisabled"
|
82
|
+
:getPopupContainer=" triggerNode => { return triggerNode.parentNode } "
|
83
|
+
placeholder="表单查询方式">
|
84
|
+
<a-select-option v-for="queryTypeItem in queryTypeV" :key="queryTypeItem.key">{{ queryTypeItem.label }}</a-select-option>
|
85
|
+
</a-select>
|
86
|
+
</a-form-model-item>
|
87
|
+
<template v-if="item.formType">
|
88
|
+
<a-form-model-item v-if="dataMode.addOrEditForm || dataMode.queryForm" label="表单校验" prop="rule">
|
89
|
+
<a-row :gutter="16">
|
90
|
+
<a-col v-if="(item.formType === 'input' || item.formType === 'textarea' ) && item.formType !=='file' && item.formType !=='image' " :span="12" >
|
91
|
+
<a-select v-model="item.rule.type" :getPopupContainer=" triggerNode => { return triggerNode.parentNode } " placeholder="校验类型">
|
92
|
+
<a-select-option v-for="ruleTypeItem in formRuleType" :key="ruleTypeItem.key">{{ ruleTypeItem.label }}</a-select-option>
|
93
|
+
<a-popover slot="suffixIcon" placement="bottom" title="关于表单校验类型">
|
94
|
+
<template slot="content">
|
95
|
+
<p>设置表单项的校验类型</p>
|
96
|
+
</template>
|
97
|
+
<a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
|
98
|
+
</a-popover>
|
99
|
+
</a-select>
|
100
|
+
</a-col>
|
101
|
+
<a-col :span="12">
|
102
|
+
<a-radio-group v-model="item.rule.required" button-style="solid" default-value="false">
|
103
|
+
<a-radio-button value="true">
|
104
|
+
必选项
|
105
|
+
</a-radio-button>
|
106
|
+
<a-radio-button value="false">
|
107
|
+
非必选项
|
108
|
+
</a-radio-button>
|
109
|
+
</a-radio-group>
|
110
|
+
</a-col>
|
111
|
+
</a-row>
|
112
|
+
</a-form-model-item>
|
113
|
+
<a-form-model-item v-if="dataMode.addOrEditForm" label="新增/修改场景选择" prop="addOrEdit">
|
114
|
+
<a-select v-model="item.addOrEdit" placeholder="请选择场景">
|
115
|
+
<a-select-option v-for="addOrEditItem in addOrEditTypeV" :key="addOrEditItem.key">{{ addOrEditItem.label }}</a-select-option>
|
116
|
+
<a-popover
|
117
|
+
slot="suffixIcon"
|
118
|
+
placement="bottom"
|
119
|
+
title="关于新增/修改场景选择">
|
120
|
+
<template slot="content">
|
121
|
+
<p>设置表单项的新增/修改场景</p>
|
122
|
+
<p>静默新增类型用于非人为新增的数据,不会生成表单项,且必须设置字段用途</p>
|
123
|
+
</template>
|
124
|
+
<a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
|
125
|
+
</a-popover>
|
126
|
+
</a-select>
|
127
|
+
</a-form-model-item>
|
128
|
+
<a-form-model-item v-if="item.addOrEdit === 'silenceAdd'" label="字段用途" prop="silencePurpose">
|
129
|
+
<a-select v-model="item.silencePurpose" :getPopupContainer=" triggerNode => { return triggerNode.parentNode } " placeholder="请选择字段用途">
|
130
|
+
<a-select-option v-for="silencePurposeTypeItem in silencePurposeType" :key="silencePurposeTypeItem.key">{{ silencePurposeTypeItem.label }}</a-select-option>
|
131
|
+
<a-popover
|
132
|
+
slot="suffixIcon"
|
133
|
+
placement="bottom"
|
134
|
+
title="关于字段用途">
|
135
|
+
<template slot="content">
|
136
|
+
<p>用于静默新增时设置字段用途</p>
|
137
|
+
<p>在新增数据的表单提交时,页面会根据设置的字段用途自动获取相关数据并追加到表单中</p>
|
138
|
+
<p>当字段用途选择为<span style="font-weight: bold">自定义</span>时,必须指定一个业务逻辑(Logic)名称,表单提交前会将表单内容作为参数调用该Logic接口,并将Logic返回值作为表单值
|
139
|
+
</p>
|
140
|
+
</template>
|
141
|
+
<a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
|
142
|
+
</a-popover>
|
143
|
+
</a-select>
|
144
|
+
</a-form-model-item>
|
145
|
+
<a-form-model-item v-if="item.silencePurpose === 'customize'" label="字段用途对应Logic" prop="silenceSource">
|
146
|
+
<a-input v-model="item.silenceSource" placeholder="请输入业务逻辑名称"/>
|
147
|
+
</a-form-model-item>
|
148
|
+
</template>
|
149
|
+
</template>
|
150
|
+
<template v-if="dataMode.table">
|
151
|
+
<a-divider style="font-size: 14px;margin-top: 0">表格列配置</a-divider>
|
152
|
+
<a-form-model-item v-if="item.formType" label="作用域插槽" prop="slot">
|
153
|
+
<a-select v-model="item.slot.type" :disabled="slotTypeDisabled" :getPopupContainer=" triggerNode => { return triggerNode.parentNode } " placeholder="插槽类型">
|
154
|
+
<a-select-option v-for="slotTypeItem in slotTypeV" :key="slotTypeItem.key">{{ slotTypeItem.label }}</a-select-option>
|
155
|
+
<a-popover slot="suffixIcon" placement="bottom" title="关于作用域插槽">
|
156
|
+
<template slot="content">
|
157
|
+
<p>你可以通过设置表格列的作用域插槽实现一些效果</p>
|
158
|
+
<p>如果没有指定,默认会设置为文本溢出省略(长度:16)</p>
|
159
|
+
<p>如果你选择文本溢出省略,需要设置文本溢出上限长度,建议ID主键等类型设置为8</p>
|
160
|
+
<p>如果你选择多彩徽标,需要设置徽标对应的数据样式字典键</p>
|
161
|
+
<a-divider style="font-size: 14px;margin-top: 0">关于表格列宽度</a-divider>
|
162
|
+
<p>V1.1之后不再支持自定义表格列宽度,表格列宽度将通过作用域插槽类型自适应</p>
|
163
|
+
<p>设置为文本溢出省略时,表格列宽度 = 文本溢出上限长度 * 7 + 42</p>
|
164
|
+
<p>设置为多彩徽标时,表格列宽度为130</p>
|
165
|
+
<p>设置为日期时间格式化时,表格列宽度为160</p>
|
166
|
+
</template>
|
167
|
+
<a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
|
168
|
+
</a-popover>
|
169
|
+
</a-select>
|
170
|
+
</a-form-model-item>
|
171
|
+
<a-form-model-item v-if="item.slot.type === 'badge'" label="徽标字典键" prop="slot.keyMap">
|
172
|
+
<a-input v-model="item.slot.keyMap" :disabled="slotTypeDisabled" placeholder="请输入徽标字典键">
|
173
|
+
<a-popover
|
174
|
+
slot="suffix"
|
175
|
+
placement="bottom"
|
176
|
+
title="关于徽标字典键">
|
177
|
+
<template slot="content">
|
178
|
+
<p>如果你设置了表单类型为选择框,且数据源是字典键,该值会自动带出</p>
|
179
|
+
</template>
|
180
|
+
<a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
|
181
|
+
</a-popover>
|
182
|
+
</a-input>
|
183
|
+
</a-form-model-item>
|
184
|
+
<a-form-model-item v-if="item.slot.type === 'ellipsis'" label="文本溢出上限长度" prop="slot.value">
|
185
|
+
<a-input-number v-model="item.slot.value" placeholder="请输入文本溢出上限长度" style="width: 100%"/>
|
186
|
+
</a-form-model-item>
|
187
|
+
<a-form-model-item v-if="item.slot.type === 'action'" label="操作列文本" prop="slot.actionText">
|
188
|
+
<a-input v-model="item.slot.actionText" placeholder="请输入操作列显示文本,默认为详情"/>
|
189
|
+
</a-form-model-item>
|
190
|
+
<a-form-model-item v-if="dataMode.sqlQueryItem || dataMode.sqlQueryCondition" label="字段默认值" prop="default">
|
191
|
+
<a-input v-model="item.default" placeholder="当查询结果为null时,指定默认值"/>
|
192
|
+
</a-form-model-item>
|
193
|
+
</template>
|
194
|
+
</a-card>
|
195
|
+
</a-col>
|
196
|
+
<a-col v-if="!dataMode.group && item.formType && (((dataMode.addOrEditForm || dataMode.queryForm ) && (item.formType === 'input' || item.formType === 'select')) || (dataMode.table && item.formType !== 'file' && item.formType !== 'image') || selectDataShow)" :span="9">
|
197
|
+
<a-card :bodyStyle="bodyStyle" title="扩展属性">
|
198
|
+
<template v-if="(dataMode.addOrEditForm || dataMode.queryForm ) && (item.formType === 'input' || item.formType === 'select')">
|
199
|
+
<a-divider style="font-size: 14px;margin-top: 0">提示相关</a-divider>
|
200
|
+
<a-form-model-item label="表单水印" prop="placeholder">
|
201
|
+
<a-input v-model="item.placeholder" placeholder="表单水印(placeholder)" />
|
202
|
+
</a-form-model-item>
|
203
|
+
</template>
|
204
|
+
<template v-if="selectDataShow">
|
205
|
+
<a-divider style="font-size: 14px;margin-top: 0">数据源相关</a-divider>
|
206
|
+
<a-form-model-item label="数据源类型" prop="selectType">
|
207
|
+
<a-select v-model="item.selectType" placeholder="请选择数据源类型" @change="changeSelectKType">
|
208
|
+
<a-select-option v-for="selectDataTypeItem in selectDataType.filter(h=>!h.noMatch.includes(item.formType))" :key="selectDataTypeItem.key">{{ selectDataTypeItem.label }}</a-select-option>
|
209
|
+
<a-popover
|
210
|
+
slot="suffixIcon"
|
211
|
+
placement="bottom"
|
212
|
+
title="关于数据源类型">
|
213
|
+
<template slot="content">
|
214
|
+
<p>设置数据源</p>
|
215
|
+
<p>数据源类型分为三种,你可以根据需要选择</p>
|
216
|
+
<p>字典键:选项从字典表(t_dictionary)获取,你只需要选择字典键的名称即可</p>
|
217
|
+
<p>业务逻辑名称:选项通过发起http请求调用指定的业务逻辑(Logic)接口获取</p>
|
218
|
+
<p>固定集合:选项为静态值,JSONArray格式</p>
|
219
|
+
<p>当表单为树形选择框类型时,返回的数据需按照以下形式:</p>
|
220
|
+
<json-viewer
|
221
|
+
:expand-depth="parseInt('100')"
|
222
|
+
:value="DemoJson"
|
223
|
+
style="overflow: auto;max-height: 440px"></json-viewer>
|
224
|
+
</template>
|
225
|
+
<a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
|
226
|
+
</a-popover>
|
227
|
+
</a-select>
|
228
|
+
</a-form-model-item>
|
229
|
+
<a-form-model-item v-if="item.selectType" label="数据源" prop="selectKey">
|
230
|
+
<a-select
|
231
|
+
v-if="item.selectType === 'key'"
|
232
|
+
v-model="item.selectKey"
|
233
|
+
:filter-option="filterOption"
|
234
|
+
placeholder="请选择字典键"
|
235
|
+
show-search
|
236
|
+
@change="changeSelectKey(item)">
|
237
|
+
<template>
|
238
|
+
<a-select-option
|
239
|
+
v-for="(optionItem,index) in option"
|
240
|
+
:key="index"
|
241
|
+
:value="Object.keys(optionItem)[0]">{{ optionItem[Object.keys(optionItem)[0]] }}
|
242
|
+
</a-select-option>
|
243
|
+
</template>
|
244
|
+
</a-select>
|
245
|
+
<a-input v-if="item.selectType === 'logic'" v-model="item.selectKey" placeholder="请输入业务逻辑名称"/>
|
246
|
+
<a-textarea v-if="item.selectType === 'fixArray'" v-model="item.selectKey" placeholder="请录入数据源"/>
|
247
|
+
</a-form-model-item>
|
248
|
+
<a-form-model-item v-if="item.selectType === 'logic'" label="数据源加载方式" prop="selectLoadType">
|
249
|
+
<a-radio-group v-model="item.lazyLoad" button-style="solid" default-value="false">
|
250
|
+
<a-radio-button value="true">
|
251
|
+
{{ item.formType === 'treeSelect' ? '异步加载节点' : '懒加载搜索' }}
|
252
|
+
</a-radio-button>
|
253
|
+
<a-radio-button value="false">
|
254
|
+
一次性加载
|
255
|
+
</a-radio-button>
|
256
|
+
</a-radio-group>
|
257
|
+
</a-form-model-item>
|
258
|
+
<a-form-model-item label="关联外键字段" prop="selectKeyName">
|
259
|
+
<a-input v-model="item.selectKeyName" placeholder="该列关联的外键字段">
|
260
|
+
<a-popover slot="suffix" placement="bottom" title="关于关联外键字段">
|
261
|
+
<template slot="content">
|
262
|
+
<p><span style="font-weight: bold;"><span style="color: #FF0036">非必需的实验性功能:</span>设置该参数需开发岗指导</span></p>
|
263
|
+
<p>当字段与主子表外键有关系时,你可以指定<span style="font-weight: bold">该列所关联的外键字段名</span>
|
264
|
+
</p>
|
265
|
+
<p>设置该参数是为了该字段用作表单查询时,系统可以通过设置的关联外键字段,而非字面值作为查询条件</p>
|
266
|
+
<p>示例:</p>
|
267
|
+
<p>主表为t_userfiles(表档案)表,别名为u,与t_gasbrand(气表品牌表)有关联关系,别名为g,为了显示表档案对应的气表品牌数据,我们将数据字段名设置为g.f_gasbrand</p>
|
268
|
+
<p>这样我们就可以在table中看到气表品牌了,但是用户如果通过气表品牌下拉框进行筛选,我们指定的g.f_gasbrand只是气表品牌的值,而实际关联字段是u.f_gasbrand_id</p>
|
269
|
+
<p>所以如果我们指定了关联外键字段u.f_gasbrand_id,系统则会使用u.f_gasbrand_id筛选数据,而不是g.f_gasbrand,从而优化了查询效率
|
270
|
+
</p>
|
271
|
+
</template>
|
272
|
+
<a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
|
273
|
+
</a-popover>
|
274
|
+
</a-input>
|
275
|
+
</a-form-model-item>
|
276
|
+
</template>
|
277
|
+
<template v-if="item.formType === 'file' || item.formType === 'image'">
|
278
|
+
<a-divider style="font-size: 14px;margin-top: 0">文件上传相关</a-divider>
|
279
|
+
<a-form-model-item label="允许上传文件数量" prop="accept" style="margin-bottom: 5px;">
|
280
|
+
<a-slider
|
281
|
+
v-model="item.acceptCount"
|
282
|
+
:marks="{ 1: '1', 3: '3', 5: '5', 10: '10', 15: '15', 20: '20'}"
|
283
|
+
:max="20"
|
284
|
+
:min="1"
|
285
|
+
/>
|
286
|
+
</a-form-model-item>
|
287
|
+
<a-form-model-item label="附件用途" prop="useType">
|
288
|
+
<a-select v-model="item.useType" placeholder="指定文件用途,同表单不同用途">
|
289
|
+
<a-select-option v-for="userTypeItem in $appdata.getDictionaryList('useType')" :key="userTypeItem.value">{{ userTypeItem.value }}</a-select-option>
|
290
|
+
</a-select>
|
291
|
+
</a-form-model-item>
|
292
|
+
<a-form-model-item label="上传的仓库" prop="resUploadStock">
|
293
|
+
<a-select v-model="item.resUploadStock" placeholder="选择文件上传到的仓库" @change="changeStock">
|
294
|
+
<a-select-option v-for="stock in stockList" :key="stock.id">{{ stock.f_name }}</a-select-option>
|
295
|
+
</a-select>
|
296
|
+
</a-form-model-item>
|
297
|
+
<a-form-model-item v-if="item.resUploadStock" label="具体路径" prop="pathKey">
|
298
|
+
<a-select v-model="item.pathKey" placeholder="仓库扩展路径">
|
299
|
+
<a-select-option v-for="pathKey in lowerPath" :key="pathKey.label">{{ pathKey.label }}</a-select-option>
|
300
|
+
</a-select>
|
301
|
+
</a-form-model-item>
|
302
|
+
<a-form-model-item v-if="item.formType === 'file'" label="允许上传文件类型" prop="accept">
|
303
|
+
<a-select v-model="item.accept" mode="tags" placeholder="指定文件类型,默认不限制" @change="itemAcceptChange">
|
304
|
+
<a-select-option v-for="type_item in fileType" :key="type_item.accept">{{ type_item.label }}</a-select-option>
|
305
|
+
</a-select>
|
306
|
+
</a-form-model-item>
|
307
|
+
</template>
|
308
|
+
</a-card>
|
309
|
+
</a-col>
|
310
|
+
<a-col :span="18" v-if="dataMode.group">
|
311
|
+
<a-card :bodyStyle="bodyStyle" title="数据字段">
|
312
|
+
<a-button type="primary" slot="extra" @click="addColumnItem()">增加</a-button>
|
313
|
+
<a-row :gutter="24">
|
314
|
+
<a-col :span="7">
|
315
|
+
<span style="font-weight: bold">
|
316
|
+
标签名
|
317
|
+
</span>
|
318
|
+
</a-col>
|
319
|
+
<a-col :span="7">
|
320
|
+
<span style="font-weight: bold">
|
321
|
+
字段名
|
322
|
+
</span>
|
323
|
+
</a-col>
|
324
|
+
<a-col :span="8">
|
325
|
+
<span style="font-weight: bold">
|
326
|
+
数据模式
|
327
|
+
</span>
|
328
|
+
</a-col>
|
329
|
+
<a-col :span="2">
|
330
|
+
<span style="font-weight: bold">
|
331
|
+
操作
|
332
|
+
</span>
|
333
|
+
</a-col>
|
334
|
+
</a-row>
|
335
|
+
<a-divider style="margin: 6px 0" />
|
336
|
+
<div
|
337
|
+
v-for="(columnItem, index) in item.column"
|
338
|
+
:key="index"
|
339
|
+
draggable="true"
|
340
|
+
@dragend="handleDragEnd($event, columnItem)"
|
341
|
+
@dragenter="handleDragEnter($event, columnItem)"
|
342
|
+
@dragstart="handleDragStart($event, columnItem)"
|
343
|
+
@dragover.prevent="handleDragOver($event, columnItem)">
|
344
|
+
<a-row v-if="ending && dragging && columnItem.key === ending.key && dragging.key !== ending.key" class="dragTipsWarp">
|
345
|
+
<span class="dragTips">拖到此处放置</span>
|
346
|
+
</a-row>
|
347
|
+
<a-row :gutter="24" class="column_item dragTipsWarp">
|
348
|
+
<a-col :span="7">
|
349
|
+
<span style="font-weight: bold">
|
350
|
+
{{ columnItem.title }}
|
351
|
+
</span>
|
352
|
+
</a-col>
|
353
|
+
<a-col :span="7">
|
354
|
+
<span style="font-weight: bold">
|
355
|
+
{{ columnItem.key }}
|
356
|
+
</span>
|
357
|
+
</a-col>
|
358
|
+
<a-col :span="8">
|
359
|
+
<a-tooltip>
|
360
|
+
<template slot="title">
|
361
|
+
查询表单项
|
362
|
+
</template>
|
363
|
+
<a-tag :color="columnItem.dataModeArray && columnItem.dataModeArray.includes('queryForm') ? 'blue' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="file-search" /></a-tag>
|
364
|
+
</a-tooltip>
|
365
|
+
<a-tooltip>
|
366
|
+
<template slot="title">
|
367
|
+
表格列
|
368
|
+
</template>
|
369
|
+
<a-tag :color="columnItem.dataModeArray && columnItem.dataModeArray.includes('table') ? 'orange' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="table" /></a-tag>
|
370
|
+
</a-tooltip>
|
371
|
+
<a-tooltip>
|
372
|
+
<template slot="title">
|
373
|
+
新增/修改表单项
|
374
|
+
</template>
|
375
|
+
<a-tag :color="columnItem.dataModeArray && columnItem.dataModeArray.includes('addOrEditForm') ? 'green' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="form" /></a-tag>
|
376
|
+
</a-tooltip>
|
377
|
+
<a-tooltip>
|
378
|
+
<template slot="title">
|
379
|
+
SQL查询项
|
380
|
+
</template>
|
381
|
+
<a-tag :color="columnItem.dataModeArray && columnItem.dataModeArray.includes('sqlQueryItem') ? 'cyan' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="bars" /></a-tag>
|
382
|
+
</a-tooltip>
|
383
|
+
<a-tooltip>
|
384
|
+
<template slot="title">
|
385
|
+
SQL查询表达式
|
386
|
+
</template>
|
387
|
+
<a-tag :color="columnItem.dataModeArray && columnItem.dataModeArray.includes('sqlQueryCondition') ? 'purple' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="search" /></a-tag>
|
388
|
+
</a-tooltip>
|
389
|
+
<a-tooltip>
|
390
|
+
<template slot="title">
|
391
|
+
Excel导入项
|
392
|
+
</template>
|
393
|
+
<a-tag :color="columnItem.dataModeArray && columnItem.dataModeArray.includes('excelImportItem') ? '#107C41' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="file-excel" /></a-tag>
|
394
|
+
</a-tooltip>
|
395
|
+
<a-tooltip>
|
396
|
+
<template slot="title">
|
397
|
+
数据组
|
398
|
+
</template>
|
399
|
+
<a-tag :color="columnItem.dataModeArray && columnItem.dataModeArray.includes('group') ? '#82A0D8' : 'rgba(0, 0, 0, 0.25)'"><a-icon type="crown" /></a-tag>
|
400
|
+
</a-tooltip>
|
401
|
+
</a-col>
|
402
|
+
<a-col :span="1">
|
403
|
+
<a-icon type="edit" @click="editColumnItem(columnItem.key,index)"/>
|
404
|
+
</a-col>
|
405
|
+
<a-col :span="1">
|
406
|
+
<a-icon type="close" @click="removeColumnItem(columnItem.key,index)"/>
|
407
|
+
</a-col>
|
408
|
+
</a-row>
|
409
|
+
</div>
|
410
|
+
</a-card>
|
411
|
+
</a-col>
|
412
|
+
</a-row>
|
413
|
+
<a-alert
|
414
|
+
v-if="dataModeArrayData.length === 0"
|
415
|
+
message="错误:请至少选择一种数据模式"
|
416
|
+
show-icon
|
417
|
+
style="margin-top: 5px"
|
418
|
+
type="error"/>
|
419
|
+
<a-alert
|
420
|
+
v-if="dataMode.addOrEditForm && !dataMode.sqlQueryItem && item.formType !== 'file' && item.formType !== 'image'"
|
421
|
+
message="错误:如果要生成新增/修改表单项,必须勾选生成SQL查询项"
|
422
|
+
show-icon
|
423
|
+
style="margin-top: 5px"
|
424
|
+
type="error"/>
|
425
|
+
<a-alert
|
426
|
+
v-if="dataMode.queryForm && !dataMode.sqlQueryCondition"
|
427
|
+
message="提示:您没有勾选生成SQL查询表达式,渲染的表单项不会生成SQL查询条件"
|
428
|
+
show-icon
|
429
|
+
style="margin-top: 5px"
|
430
|
+
type="info"/>
|
431
|
+
<a-alert
|
432
|
+
v-if="dataMode.table && !dataMode.sqlQueryItem"
|
433
|
+
message="提示:您没有勾选生成SQL查询项,渲染的表格列不会绑定SQL结果集数据"
|
434
|
+
show-icon
|
435
|
+
style="margin-top: 5px"
|
436
|
+
type="info"/>
|
437
|
+
<a-alert
|
438
|
+
v-if="item.title.length > 8"
|
439
|
+
message="提示:标签名称过长可能会影响表格列展示效果,建议不超过8个字符"
|
440
|
+
show-icon
|
441
|
+
style="margin-top: 5px"
|
442
|
+
type="warning"/>
|
443
|
+
</a-form-model>
|
444
|
+
<create-query-item ref="queryItem" @getColumn="getColumnItem" @itemHandle="itemHandleItem"/>
|
445
|
+
</a-modal>
|
446
|
+
</template>
|
447
|
+
|
448
|
+
<script>
|
449
|
+
import {
|
450
|
+
dataModeType,
|
451
|
+
fileType,
|
452
|
+
formRuleType,
|
453
|
+
formType,
|
454
|
+
queryType,
|
455
|
+
slotType,
|
456
|
+
silencePurposeType,
|
457
|
+
addOrEditType,
|
458
|
+
selectDataType
|
459
|
+
} from '@vue2-client/config/CreateQueryConfig'
|
460
|
+
import { post } from '@vue2-client/services/api'
|
461
|
+
import JsonViewer from 'vue-json-viewer'
|
462
|
+
import { getDictionaryParam } from '@vue2-client/services/api/common'
|
463
|
+
|
464
|
+
const DemoJson = [{
|
465
|
+
value: 'zhejiang',
|
466
|
+
label: 'Zhejiang',
|
467
|
+
children: [{ value: 'hangzhou', label: 'Hangzhou', children: [{ value: 'xihu', label: 'West Lake' }] }]
|
468
|
+
}]
|
469
|
+
|
470
|
+
export default {
|
471
|
+
name: 'CreateQueryItem',
|
472
|
+
components: {
|
473
|
+
JsonViewer
|
474
|
+
},
|
475
|
+
computed: {
|
476
|
+
// 是否展示数据源相关字段
|
477
|
+
selectDataShow () {
|
478
|
+
return this.item.formType === 'select' || this.item.formType === 'checkbox' || this.item.formType === 'radio' || this.item.formType === 'treeSelect'
|
479
|
+
},
|
480
|
+
// 作用域插槽是否禁用
|
481
|
+
slotTypeDisabled () {
|
482
|
+
return this.item.selectKey && this.item.selectType === 'key'
|
483
|
+
},
|
484
|
+
// 字段名称是否禁用
|
485
|
+
keyDisabled () {
|
486
|
+
return this.item.formType === 'file' || this.item.formType === 'image' || this.dataMode.mixinTableName
|
487
|
+
},
|
488
|
+
// 数据模式是否禁用
|
489
|
+
dataModeDisabled () {
|
490
|
+
return this.item.formType === 'file' || this.item.formType === 'image' || this.item.formType === 'addressSearch'
|
491
|
+
},
|
492
|
+
dataMode: function () {
|
493
|
+
const result = {
|
494
|
+
queryForm: false,
|
495
|
+
table: false,
|
496
|
+
addOrEditForm: false,
|
497
|
+
sqlQueryItem: false,
|
498
|
+
sqlQueryCondition: false,
|
499
|
+
excelImportItem: false,
|
500
|
+
group: false,
|
501
|
+
mixinTableName: false
|
502
|
+
}
|
503
|
+
for (const item of this.dataModeArrayData) {
|
504
|
+
result[item] = true
|
505
|
+
}
|
506
|
+
return result
|
507
|
+
},
|
508
|
+
queryTypeV () {
|
509
|
+
return queryType.filter(item => {
|
510
|
+
return item.match.findIndex(type => type === this.item.formType || type === 'all') > -1
|
511
|
+
})
|
512
|
+
},
|
513
|
+
dataModeTypeV () {
|
514
|
+
if (this.dataModeArrayData.includes('group')) {
|
515
|
+
return [{
|
516
|
+
label: 'SQL生成查询项',
|
517
|
+
value: 'sqlQueryItem',
|
518
|
+
noMatch: ['file', 'personSetting']
|
519
|
+
}, {
|
520
|
+
label: '字段组存储',
|
521
|
+
value: 'group',
|
522
|
+
noMatch: []
|
523
|
+
}]
|
524
|
+
}
|
525
|
+
if (this.dataModeArrayData.includes('mixinTableName')) {
|
526
|
+
return [
|
527
|
+
{
|
528
|
+
label: '渲染查询表单项',
|
529
|
+
value: 'queryForm',
|
530
|
+
noMatch: ['file', 'image', 'textarea', 'personSetting']
|
531
|
+
},
|
532
|
+
{
|
533
|
+
label: '动态表名参数',
|
534
|
+
value: 'mixinTableName',
|
535
|
+
noMatch: []
|
536
|
+
}
|
537
|
+
]
|
538
|
+
}
|
539
|
+
if (this.item.formType) {
|
540
|
+
return dataModeType.filter(item => {
|
541
|
+
return item.noMatch.findIndex(type => type === this.item.formType) === -1
|
542
|
+
})
|
543
|
+
} else {
|
544
|
+
return dataModeType
|
545
|
+
}
|
546
|
+
},
|
547
|
+
slotTypeV () {
|
548
|
+
return slotType.filter(item => {
|
549
|
+
return item.match.findIndex(type => type === this.item.formType || type === 'all') > -1
|
550
|
+
})
|
551
|
+
},
|
552
|
+
addOrEditTypeV () {
|
553
|
+
return addOrEditType.filter(item => {
|
554
|
+
return item.match.findIndex(type => type === this.item.formType || type === 'all') > -1
|
555
|
+
})
|
556
|
+
}
|
557
|
+
},
|
558
|
+
data () {
|
559
|
+
return {
|
560
|
+
DemoJson,
|
561
|
+
dataModeType,
|
562
|
+
queryType,
|
563
|
+
formType,
|
564
|
+
formRuleType,
|
565
|
+
slotType,
|
566
|
+
fileType,
|
567
|
+
silencePurposeType,
|
568
|
+
addOrEditType,
|
569
|
+
selectDataType,
|
570
|
+
// 控制modal框
|
571
|
+
visible: false,
|
572
|
+
type: '',
|
573
|
+
bodyStyle: {
|
574
|
+
height: '500px',
|
575
|
+
overflowY: 'auto'
|
576
|
+
},
|
577
|
+
// 表单查询方式是否禁用
|
578
|
+
formQueryTypeDisabled: false,
|
579
|
+
// 数据模式类型集合值
|
580
|
+
dataModeArrayData: [],
|
581
|
+
// 表单项
|
582
|
+
item: {
|
583
|
+
key: '',
|
584
|
+
title: '',
|
585
|
+
slot: {
|
586
|
+
type: 'default'
|
587
|
+
},
|
588
|
+
rule: {
|
589
|
+
required: 'false'
|
590
|
+
},
|
591
|
+
column: [],
|
592
|
+
queryType: '=',
|
593
|
+
formType: 'input',
|
594
|
+
accept: undefined,
|
595
|
+
acceptCount: 3,
|
596
|
+
pathKey: undefined,
|
597
|
+
selectType: undefined,
|
598
|
+
selectKey: undefined,
|
599
|
+
addOrEdit: 'all',
|
600
|
+
fileRootPath: undefined,
|
601
|
+
selectKeyName: undefined,
|
602
|
+
resUploadStock: undefined,
|
603
|
+
dataModeArray: []
|
604
|
+
},
|
605
|
+
// 数据仓库列表
|
606
|
+
stockList: [],
|
607
|
+
// 扩展目录
|
608
|
+
lowerPath: [],
|
609
|
+
parent_node: [],
|
610
|
+
// 必填控制
|
611
|
+
itemRules: {
|
612
|
+
formType: [{ required: true, message: '请输入表单类型', trigger: 'change' }],
|
613
|
+
key: [{
|
614
|
+
required: true,
|
615
|
+
validator: (rule, value, callback) => {
|
616
|
+
// 判断必填
|
617
|
+
if (!value) {
|
618
|
+
callback(new Error('请输入字段名称'))
|
619
|
+
} else {
|
620
|
+
// 判断必须全部小写 并且不能包含空格
|
621
|
+
if (value !== value.toLowerCase() || value.indexOf(' ') !== -1 && !value === '_mixinTableName_') {
|
622
|
+
callback(new Error('字段名称必须全部小写,且不能包含空格'))
|
623
|
+
} else {
|
624
|
+
callback()
|
625
|
+
}
|
626
|
+
}
|
627
|
+
},
|
628
|
+
trigger: 'blur'
|
629
|
+
}],
|
630
|
+
title: [{
|
631
|
+
required: true,
|
632
|
+
validator: (rule, value, callback) => {
|
633
|
+
// 判断必填
|
634
|
+
if (!value) {
|
635
|
+
callback(new Error('请输入标签名称'))
|
636
|
+
} else {
|
637
|
+
// // 大于8个字符给提示
|
638
|
+
// if (value.length > 8) {
|
639
|
+
// callback(new Error('标签名称过长,建议不超过8个字符,可能会影响展示效果'))
|
640
|
+
// } else {
|
641
|
+
callback()
|
642
|
+
// }
|
643
|
+
}
|
644
|
+
},
|
645
|
+
trigger: 'blur'
|
646
|
+
}],
|
647
|
+
selectType: [{ required: true, message: '请选择数据源类型', trigger: 'change' }],
|
648
|
+
selectKey: [{ required: true, message: '请输入数据源内容', trigger: 'blur' }],
|
649
|
+
'slot.value': [{ required: true, message: '请输入文本溢出上限长度', trigger: 'blur' }],
|
650
|
+
'slot.keyMap': [{ required: true, message: '请输入徽标字典键', trigger: 'blur' }],
|
651
|
+
silencePurpose: [{ required: true, message: '请选择字段用途', trigger: 'change' }],
|
652
|
+
silenceSource: [{ required: true, message: '请输入业务逻辑名称', trigger: 'blur' }],
|
653
|
+
resUploadStock: [{ required: true, message: '请选择上传到的仓库', trigger: 'blur' }],
|
654
|
+
pathKey: [{ required: true, message: '请选择上传到的扩展目录', trigger: 'blur' }]
|
655
|
+
},
|
656
|
+
// 字典键集合
|
657
|
+
option: [],
|
658
|
+
selectIndex: null,
|
659
|
+
ending: null,
|
660
|
+
dragging: null,
|
661
|
+
itemMap: {}
|
662
|
+
}
|
663
|
+
},
|
664
|
+
mounted () {
|
665
|
+
this.resetDataMode()
|
666
|
+
},
|
667
|
+
props: { },
|
668
|
+
methods: {
|
669
|
+
initItem (lysis = {}) {
|
670
|
+
this.item = Object.assign({
|
671
|
+
key: '',
|
672
|
+
title: '',
|
673
|
+
slot: {
|
674
|
+
type: 'default'
|
675
|
+
},
|
676
|
+
rule: {
|
677
|
+
required: 'false'
|
678
|
+
},
|
679
|
+
column: [],
|
680
|
+
selectKey: undefined,
|
681
|
+
queryType: '=',
|
682
|
+
formType: 'input',
|
683
|
+
acceptCount: 3,
|
684
|
+
fileRootPath: undefined,
|
685
|
+
pathKey: undefined,
|
686
|
+
accept: undefined,
|
687
|
+
selectType: undefined,
|
688
|
+
addOrEdit: 'all',
|
689
|
+
selectKeyName: undefined,
|
690
|
+
resUploadStock: undefined,
|
691
|
+
dataModeArray: []
|
692
|
+
}, lysis)
|
693
|
+
},
|
694
|
+
// 控制 展示
|
695
|
+
flashModal (show = 'None') {
|
696
|
+
const bool = show === 'None' ? !this.visible : !!show
|
697
|
+
if (bool && this.option.length === 0) {
|
698
|
+
getDictionaryParam(true).then(res => {
|
699
|
+
this.option = res
|
700
|
+
})
|
701
|
+
}
|
702
|
+
this.visible = bool
|
703
|
+
},
|
704
|
+
// 编辑数据字段前准备数据
|
705
|
+
editColumnItemExecute (_item) {
|
706
|
+
this.type = '修改'
|
707
|
+
const defaultValue = { formType: 'input', type: 'string', addOrEdit: 'all', slot: { type: 'default' }, rule: {}, selectKey: {}, column: [] }
|
708
|
+
if (!_item.queryType) {
|
709
|
+
defaultValue.queryType = '='
|
710
|
+
}
|
711
|
+
_item = Object.assign({}, defaultValue, _item)
|
712
|
+
if (_item.formType === 'file' || _item.formType === 'image') {
|
713
|
+
this.getStocks()
|
714
|
+
// 如果有仓库 则获取该仓库的扩展路径
|
715
|
+
if (_item.resUploadStock) {
|
716
|
+
this.lowerPath = this.stockList.filter(item => item.id === _item.resUploadStock)[0]?.f_lower_path_json ?? []
|
717
|
+
}
|
718
|
+
}
|
719
|
+
if (_item.selectKey && _item.selectKey.length >= 6 && _item.selectType === 'logic' && _item.selectKey.substring(0, 6) === 'logic@') {
|
720
|
+
_item.selectKey = _item.selectKey.substring(6)
|
721
|
+
} else if (_item.selectKey && _item.selectKey instanceof Array) {
|
722
|
+
_item.selectKey = JSON.stringify(_item.selectKey)
|
723
|
+
}
|
724
|
+
// 兼容旧作用域插槽属性
|
725
|
+
this.compatibleTheSlot(_item)
|
726
|
+
this.item = _item
|
727
|
+
this.dataModeArrayData = this.item.dataModeArray
|
728
|
+
this.flashModal()
|
729
|
+
|
730
|
+
for (const columnItem of this.item.column) {
|
731
|
+
this.itemMap[columnItem.key] = Object.assign({
|
732
|
+
key: '',
|
733
|
+
title: '',
|
734
|
+
slot: {},
|
735
|
+
rule: {
|
736
|
+
required: 'false'
|
737
|
+
},
|
738
|
+
dataModeArray: []
|
739
|
+
}, columnItem)
|
740
|
+
}
|
741
|
+
},
|
742
|
+
// 增加数据字段前数据处理
|
743
|
+
addColumnItemExecute () {
|
744
|
+
this.type = '新增'
|
745
|
+
this.dataModeArrayData = ['queryForm', 'table', 'addOrEditForm', 'sqlQueryItem', 'sqlQueryCondition']
|
746
|
+
this.initItem()
|
747
|
+
this.flashModal()
|
748
|
+
},
|
749
|
+
modelCancel () {
|
750
|
+
this.flashModal()
|
751
|
+
},
|
752
|
+
submitItem () {
|
753
|
+
this.$refs.itemForm.validate(valid => {
|
754
|
+
if (valid) {
|
755
|
+
const fileBool = this.item.formType === 'file' || this.item.formType === 'image'
|
756
|
+
if (this.dataModeArrayData.length === 0) {
|
757
|
+
this.$message.error('请至少选择一种数据模式')
|
758
|
+
return
|
759
|
+
}
|
760
|
+
if (!fileBool && (this.dataMode.addOrEditForm && !this.dataMode.sqlQueryItem)) {
|
761
|
+
this.$message.error('如果要生成新增/修改表单项,必须勾选生成SQL查询项')
|
762
|
+
return
|
763
|
+
}
|
764
|
+
if (fileBool && !(!this.dataMode.table && !this.dataMode.sqlQueryCondition && !this.dataMode.queryForm)) {
|
765
|
+
this.$message.error(`上传类表单项只能选择 "渲染新增/修改表单项"`)
|
766
|
+
return
|
767
|
+
}
|
768
|
+
this.itemHandle()
|
769
|
+
}
|
770
|
+
})
|
771
|
+
},
|
772
|
+
visitAcceptFile () {
|
773
|
+
window.open('https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/input/file#attr-accept')
|
774
|
+
},
|
775
|
+
// 修改上传到哪个仓库
|
776
|
+
changeStock (stock) {
|
777
|
+
if (stock) {
|
778
|
+
const stockValue = this.stockList.filter(item => item.id === stock)[0]
|
779
|
+
this.lowerPath = stockValue.f_lower_path_json ?? []
|
780
|
+
this.item.resUploadMode = stockValue.f_stock_type
|
781
|
+
this.item.fileRootPath = stockValue.f_root_path
|
782
|
+
this.item.stockAlias = stockValue.f_alias
|
783
|
+
this.item.pathKey = undefined
|
784
|
+
}
|
785
|
+
},
|
786
|
+
// 文件上传限制类型修改
|
787
|
+
itemAcceptChange (newVal) {
|
788
|
+
if (newVal.includes('*')) {
|
789
|
+
this.item.accept = ['*']
|
790
|
+
}
|
791
|
+
},
|
792
|
+
getColumn () {
|
793
|
+
let result = {}
|
794
|
+
this.$emit('getColumn', val => { result = val })
|
795
|
+
return result
|
796
|
+
},
|
797
|
+
changeFormType (item) {
|
798
|
+
this.initItem({ key: item.key, title: item.title, formType: item.formType })
|
799
|
+
if (item.formType === 'file' || item.formType === 'image') {
|
800
|
+
this.item.acceptCount = 3
|
801
|
+
this.getStocks()
|
802
|
+
this.item.accept = item.formType === 'file' ? ['*'] : ['.jpg,.jpeg,.ico,.gif,svg,.webp,.png,.bmp,.pjpeg,']
|
803
|
+
this.item.resUploadMode = 'server'
|
804
|
+
this.item.key = item.formType === 'file' ? 'FilesId' : 'Images'
|
805
|
+
this.dataModeArrayData = ['addOrEditForm']
|
806
|
+
} else if (item.formType === 'addressSearch') {
|
807
|
+
this.dataModeArrayData = ['addOrEditForm', 'sqlQueryItem', 'table']
|
808
|
+
} else {
|
809
|
+
if (['FilesId', 'Images'].includes(this.item.key)) { this.item.key = '' }
|
810
|
+
this.resetDataMode()
|
811
|
+
// 表单查询方式有预选项时
|
812
|
+
if (this.queryTypeV.length) {
|
813
|
+
this.item.queryType = this.queryTypeV[0].key
|
814
|
+
}
|
815
|
+
}
|
816
|
+
},
|
817
|
+
// 获取所有仓库
|
818
|
+
getStocks () {
|
819
|
+
if (this.stockList.length === 0) {
|
820
|
+
post('/api/af-system/logic/getFilesStock', {}).then(res => {
|
821
|
+
this.stockList = res.sort((a, b) => b.progress - a.progress)
|
822
|
+
}).catch(e => {})
|
823
|
+
}
|
824
|
+
},
|
825
|
+
// 重置数据模式
|
826
|
+
resetDataMode () {
|
827
|
+
this.dataModeArrayData = this.dataModeTypeV.map(item => item.value).filter(h => h !== 'group')
|
828
|
+
},
|
829
|
+
// 数据模式改变
|
830
|
+
dataModeArrayDataChange (newVal) {
|
831
|
+
if (newVal.includes('mixinTableName')) {
|
832
|
+
this.item.key = '_mixinTableName_'
|
833
|
+
this.dataModeArrayData = ['queryForm', 'mixinTableName']
|
834
|
+
} else if (this.item.key === '_mixinTableName_') {
|
835
|
+
this.item.key = ''
|
836
|
+
}
|
837
|
+
if (newVal.includes('group')) {
|
838
|
+
this.dataModeArrayData = ['sqlQueryItem', 'group']
|
839
|
+
}
|
840
|
+
},
|
841
|
+
itemHandle () {
|
842
|
+
// 查询表单项或者新增/修改表单项
|
843
|
+
if (this.dataMode.queryForm || this.dataMode.addOrEditForm || this.dataMode.sqlQueryCondition) {
|
844
|
+
if (!this.dataMode.sqlQueryItem || !this.dataMode.addOrEditForm) {
|
845
|
+
this.delKey(this.item, 'addOrEdit', 'silencePurpose', 'silenceSource')
|
846
|
+
}
|
847
|
+
if (this.item.selectType && this.item.selectType === 'logic' && this.item.selectKey.substring(0, 6) !== 'logic@') {
|
848
|
+
// 数据源为logic
|
849
|
+
this.item.selectKey = 'logic@' + this.item.selectKey
|
850
|
+
} else if (this.item.selectType && this.item.selectType === 'fixArray' && !this.isJSON(this.item.selectKey)) {
|
851
|
+
// 数据源为固定json集合
|
852
|
+
this.$message.warning('下拉框数据源不是JSON集合')
|
853
|
+
return
|
854
|
+
}
|
855
|
+
} else {
|
856
|
+
this.delKey(this.item, 'queryType', 'formType', 'addOrEdit', 'silencePurpose', 'silenceSource', 'placeholder', 'rule', 'selectKey', 'selectKeyName', 'lazyLoad')
|
857
|
+
}
|
858
|
+
// 如果和数据源字段无关
|
859
|
+
if (!this.selectDataShow) {
|
860
|
+
this.delKey(this.item, 'selectType', 'selectKey', 'lazyLoad', 'selectKeyName')
|
861
|
+
}
|
862
|
+
// 删除空的关联外键字段
|
863
|
+
if (!this.item.selectKeyName) {
|
864
|
+
delete this.item.selectKeyName
|
865
|
+
}
|
866
|
+
// 默认插槽就先删除
|
867
|
+
if (this.item.slot && (this.item.slot.type === 'default' || !this.item.slot.type)) { delete this.item.slot }
|
868
|
+
// 根据数据模式处理数据
|
869
|
+
if (!this.dataMode.sqlQueryCondition) {
|
870
|
+
delete this.item.queryType
|
871
|
+
}
|
872
|
+
if (!this.dataMode.sqlQueryItem) { this.delKey(this.item, 'default') }
|
873
|
+
this.item.dataModeArray = this.dataModeArrayData
|
874
|
+
this.$emit('itemHandle', this.item, this.type)
|
875
|
+
this.initItem()
|
876
|
+
this.resetDataMode()
|
877
|
+
},
|
878
|
+
changeSelectKType () {
|
879
|
+
this.item.selectKey = undefined
|
880
|
+
},
|
881
|
+
changeSelectKey (item) {
|
882
|
+
if (item.selectType === 'key' && item.selectKey) {
|
883
|
+
this.item.slot = Object.assign({}, this.item.slot, { keyMap: item.selectKey, type: 'badge' })
|
884
|
+
}
|
885
|
+
},
|
886
|
+
filterOption (input, option) {
|
887
|
+
return (
|
888
|
+
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
889
|
+
)
|
890
|
+
},
|
891
|
+
delKey (obj, ...args) {
|
892
|
+
args.forEach(v => {
|
893
|
+
delete obj[v]
|
894
|
+
})
|
895
|
+
return obj
|
896
|
+
},
|
897
|
+
// 判断是否为json字符串
|
898
|
+
isJSON (str) {
|
899
|
+
if (typeof str == 'string') {
|
900
|
+
try {
|
901
|
+
const obj = JSON.parse(str)
|
902
|
+
return !!(typeof obj == 'object' && obj)
|
903
|
+
} catch (e) {
|
904
|
+
return false
|
905
|
+
}
|
906
|
+
}
|
907
|
+
},
|
908
|
+
// 兼容旧插槽函数
|
909
|
+
compatibleTheSlot (_item) {
|
910
|
+
if (_item.slotKeyMap) {
|
911
|
+
_item.slot.keyMap = _item.slotKeyMap
|
912
|
+
delete _item.slotKeyMap
|
913
|
+
}
|
914
|
+
if (_item.slotValue) {
|
915
|
+
_item.slot.value = _item.slotValue
|
916
|
+
delete _item.slotValue
|
917
|
+
}
|
918
|
+
if (_item.actionText) {
|
919
|
+
_item.slot.actionText = _item.actionText
|
920
|
+
delete _item.actionText
|
921
|
+
}
|
922
|
+
},
|
923
|
+
// 拖拽事件
|
924
|
+
handleDragStart (e, item) {
|
925
|
+
this.dragging = item
|
926
|
+
},
|
927
|
+
handleDragEnd (e, item) {
|
928
|
+
if (this.ending.key === this.dragging.key) {
|
929
|
+
return
|
930
|
+
}
|
931
|
+
const newItems = [...this.item.column]
|
932
|
+
const src = newItems.indexOf(this.dragging)
|
933
|
+
const dst = newItems.indexOf(this.ending)
|
934
|
+
// newItems.splice(src, 1, ...newItems.splice(dst, 1, newItems[src])) 替换位置
|
935
|
+
// 挪移位置
|
936
|
+
newItems.splice(src, 1)
|
937
|
+
newItems.splice(dst, 0, this.dragging)
|
938
|
+
this.item.column = newItems
|
939
|
+
this.$nextTick(() => {
|
940
|
+
this.dragging = null
|
941
|
+
this.ending = null
|
942
|
+
})
|
943
|
+
},
|
944
|
+
handleDragOver (e) {
|
945
|
+
// 首先把div变成可以放置的元素,即重写dragenter/dragover
|
946
|
+
// e.dataTransfer.dropEffect="move";//在dragenter中针对放置目标来设置!
|
947
|
+
e.dataTransfer.dropEffect = 'move'
|
948
|
+
},
|
949
|
+
handleDragEnter (e, item) {
|
950
|
+
// 为需要移动的元素设置dragstart事件
|
951
|
+
e.dataTransfer.effectAllowed = 'move'
|
952
|
+
this.ending = item
|
953
|
+
},
|
954
|
+
editColumnItem (key, index) {
|
955
|
+
if (this.itemMap[key]) {
|
956
|
+
this.selectIndex = index
|
957
|
+
this.$refs.queryItem.editColumnItemExecute(this.itemMap[key])
|
958
|
+
} else {
|
959
|
+
this.$message.warn('编辑失败')
|
960
|
+
}
|
961
|
+
},
|
962
|
+
removeColumnItem (key, index) {
|
963
|
+
const _this = this
|
964
|
+
this.$confirm({
|
965
|
+
title: '您确定要删除该数据项?',
|
966
|
+
content: '删除的数据项无法恢复',
|
967
|
+
okText: '确定',
|
968
|
+
okType: 'danger',
|
969
|
+
cancelText: '取消',
|
970
|
+
zIndex: 9999,
|
971
|
+
onOk () {
|
972
|
+
delete _this.itemMap[key]
|
973
|
+
_this.item.column.splice(index, 1)
|
974
|
+
}
|
975
|
+
})
|
976
|
+
},
|
977
|
+
addColumnItem () {
|
978
|
+
this.type = '新增'
|
979
|
+
this.$refs.queryItem.addColumnItemExecute()
|
980
|
+
},
|
981
|
+
getColumnItem (callback) {
|
982
|
+
callback(JSON.parse(JSON.stringify(this.item.column)))
|
983
|
+
},
|
984
|
+
itemHandleItem (item, type) {
|
985
|
+
this.itemMap[item.key] = item
|
986
|
+
if (this.type === '新增') {
|
987
|
+
this.item.column.push(item)
|
988
|
+
} else {
|
989
|
+
this.$set(this.item.column, this.selectIndex, item)
|
990
|
+
}
|
991
|
+
this.$message.success(`${type}成功`)
|
992
|
+
this.$refs.queryItem.flashModal(false)
|
993
|
+
},
|
994
|
+
}
|
995
|
+
}
|
996
|
+
</script>
|
997
|
+
<style scoped>
|
998
|
+
table th, table td {
|
999
|
+
border: 1px rgba(0, 0, 0, 0.65) solid;
|
1000
|
+
text-align: center;
|
1001
|
+
padding: 0 10px;
|
1002
|
+
}
|
1003
|
+
.column_item:hover {
|
1004
|
+
background-color:rgba(64, 169, 255,0.25);
|
1005
|
+
}
|
1006
|
+
.dragTips{
|
1007
|
+
display:block;
|
1008
|
+
text-align: center;
|
1009
|
+
border:1px dashed rgba(64, 169, 255,0.55);
|
1010
|
+
}
|
1011
|
+
.dragTipsWarp{
|
1012
|
+
padding: .5rem 2rem;
|
1013
|
+
}
|
1014
|
+
</style>
|