vue2-client 1.8.259 → 1.8.261

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.
Files changed (210) hide show
  1. package/.env +19 -19
  2. package/.eslintrc.js +90 -90
  3. package/CHANGELOG.md +824 -824
  4. package/Components.md +60 -60
  5. package/babel.config.js +21 -21
  6. package/docs/index.md +30 -30
  7. package/docs/lowcode.md +188 -188
  8. package/docs/lowcodeForDeveloper.md +200 -192
  9. package/index.js +31 -31
  10. package/jest-transform-stub.js +8 -8
  11. package/jest.config.js +21 -21
  12. package/jest.setup.js +7 -7
  13. package/package.json +95 -95
  14. package/public/index.html +27 -27
  15. package/src/App.vue +188 -188
  16. package/src/ReportView.js +19 -19
  17. package/src/assets/img/querySlotDemo.svg +15 -15
  18. package/src/assets/svg/badtwo.svg +1 -1
  19. package/src/assets/svg/goodtwo.svg +1 -1
  20. package/src/base-client/components/common/AMisRender/index.js +3 -3
  21. package/src/base-client/components/common/AMisRender/index.vue +263 -263
  22. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +413 -413
  23. package/src/base-client/components/common/AddressSearchCombobox/demo.vue +36 -36
  24. package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +120 -120
  25. package/src/base-client/components/common/CitySelect/CitySelect.vue +348 -348
  26. package/src/base-client/components/common/CitySelect/index.js +3 -3
  27. package/src/base-client/components/common/CitySelect/index.md +109 -109
  28. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +669 -669
  29. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +1014 -1014
  30. package/src/base-client/components/common/CreateQuery/index.js +3 -3
  31. package/src/base-client/components/common/CreateQuery/index.md +42 -42
  32. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +452 -452
  33. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +511 -511
  34. package/src/base-client/components/common/CreateSimpleFormQuery/index.js +3 -3
  35. package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -42
  36. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +149 -149
  37. package/src/base-client/components/common/FormGroupEdit/index.js +3 -3
  38. package/src/base-client/components/common/FormGroupEdit/index.md +43 -43
  39. package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +166 -166
  40. package/src/base-client/components/common/FormGroupQuery/index.js +3 -3
  41. package/src/base-client/components/common/FormGroupQuery/index.md +43 -43
  42. package/src/base-client/components/common/JSONToTree/jsontotree.vue +271 -271
  43. package/src/base-client/components/common/LowCodeComponent/LowCodePageOrganization.vue +394 -355
  44. package/src/base-client/components/common/LowCodePageRender/LowCodePageRender.vue +29 -29
  45. package/src/base-client/components/common/LowCodePageRender/editorPageRender.vue +533 -467
  46. package/src/base-client/components/common/LowCodePageRender/index.js +3 -3
  47. package/src/base-client/components/common/PersonSetting/PersonSetting.vue +208 -208
  48. package/src/base-client/components/common/PersonSetting/index.js +3 -3
  49. package/src/base-client/components/common/Tree/Tree.vue +149 -149
  50. package/src/base-client/components/common/Tree/index.js +2 -2
  51. package/src/base-client/components/common/Upload/Upload.vue +197 -197
  52. package/src/base-client/components/common/Upload/index.js +3 -3
  53. package/src/base-client/components/common/XAddForm/XAddForm.vue +98 -98
  54. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +732 -732
  55. package/src/base-client/components/common/XAddNativeForm/index.md +146 -146
  56. package/src/base-client/components/common/XAddNativeForm/lowcodeEditorRegister.js +16 -12
  57. package/src/base-client/components/common/XAddNativeFormOA/XAddNativeFormOA.vue +303 -303
  58. package/src/base-client/components/common/XAddNativeFormOA/index.js +3 -3
  59. package/src/base-client/components/common/XAddNativeFormOA/index.md +146 -146
  60. package/src/base-client/components/common/XBadge/XBadge.vue +78 -78
  61. package/src/base-client/components/common/XCard/XCard.vue +64 -64
  62. package/src/base-client/components/common/XDataDrawer/XDataDrawer.vue +180 -180
  63. package/src/base-client/components/common/XDataDrawer/index.js +3 -3
  64. package/src/base-client/components/common/XDataDrawer/index.md +41 -41
  65. package/src/base-client/components/common/XDescriptions/XDescriptions.vue +167 -167
  66. package/src/base-client/components/common/XDescriptions/XDescriptionsGroup.vue +299 -299
  67. package/src/base-client/components/common/XDescriptions/demo.vue +50 -50
  68. package/src/base-client/components/common/XDescriptions/index.js +3 -3
  69. package/src/base-client/components/common/XDescriptions/index.md +83 -83
  70. package/src/base-client/components/common/XDescriptions/lowcodeEditorRegister.js +15 -5
  71. package/src/base-client/components/common/XDetailsView/XDetailsView.vue +214 -214
  72. package/src/base-client/components/common/XDetailsView/index.js +3 -3
  73. package/src/base-client/components/common/XForm/XForm.vue +281 -281
  74. package/src/base-client/components/common/XForm/XFormItem.vue +807 -807
  75. package/src/base-client/components/common/XForm/XTreeSelect.vue +206 -206
  76. package/src/base-client/components/common/XForm/index.md +178 -178
  77. package/src/base-client/components/common/XFormCol/XFormCol.vue +36 -36
  78. package/src/base-client/components/common/XFormGroup/XFormGroup.vue +241 -241
  79. package/src/base-client/components/common/XFormGroup/demo.vue +40 -40
  80. package/src/base-client/components/common/XFormGroup/index.js +3 -3
  81. package/src/base-client/components/common/XFormGroup/index.md +38 -38
  82. package/src/base-client/components/common/XFormGroupDetails/XFormGroupDetails.vue +72 -72
  83. package/src/base-client/components/common/XFormGroupDetails/index.js +3 -3
  84. package/src/base-client/components/common/XFormTable/XFormTable.vue +519 -519
  85. package/src/base-client/components/common/XFormTable/index.md +98 -98
  86. package/src/base-client/components/common/XFormTable/lowcodeEditorRegister.js +16 -12
  87. package/src/base-client/components/common/XImportExcel/XImportExcel.vue +147 -147
  88. package/src/base-client/components/common/XReport/XReport.vue +843 -843
  89. package/src/base-client/components/common/XReport/XReportDemo.vue +2233 -2233
  90. package/src/base-client/components/common/XReport/XReportDesign.vue +470 -470
  91. package/src/base-client/components/common/XReport/XReportJsonRender.vue +267 -267
  92. package/src/base-client/components/common/XReport/XReportTrGroup.vue +745 -742
  93. package/src/base-client/components/common/XReport/index.js +3 -3
  94. package/src/base-client/components/common/XReport/index.md +44 -44
  95. package/src/base-client/components/common/XReportSlot/XReportSlot.vue +110 -110
  96. package/src/base-client/components/common/XReportSlot/index.js +3 -3
  97. package/src/base-client/components/common/XStepView/XStepView.vue +252 -252
  98. package/src/base-client/components/common/XStepView/index.js +3 -3
  99. package/src/base-client/components/common/XStepView/index.md +31 -31
  100. package/src/base-client/components/common/XTable/XTable.vue +636 -636
  101. package/src/base-client/components/common/XTable/index.md +255 -255
  102. package/src/base-client/components/common/XTree/XTree.vue +318 -318
  103. package/src/base-client/components/common/XTree/index.js +3 -3
  104. package/src/base-client/components/common/XTree/index.md +36 -36
  105. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +114 -114
  106. package/src/base-client/components/common/XTreeOne/lowcodeEditorRegister.js +11 -9
  107. package/src/base-client/components/index.js +51 -51
  108. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
  109. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
  110. package/src/base-client/plugins/AppData.js +115 -115
  111. package/src/base-client/plugins/Config.js +19 -19
  112. package/src/base-client/plugins/GetLoginInfoService.js +183 -183
  113. package/src/base-client/plugins/tabs-page-plugin.js +39 -39
  114. package/src/bootstrap.js +39 -39
  115. package/src/components/CodeMirror/inedx.vue +118 -118
  116. package/src/components/CodeMirror/setting.js +40 -40
  117. package/src/components/FilePreview/FilePreview.vue +166 -166
  118. package/src/components/NumberInfo/NumberInfo.vue +54 -54
  119. package/src/components/STable/index.js +323 -323
  120. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  121. package/src/components/checkbox/ImgCheckbox.vue +163 -163
  122. package/src/components/menu/SideMenu.vue +75 -75
  123. package/src/components/menu/menu.js +273 -273
  124. package/src/components/tool/AStepItem.vue +60 -60
  125. package/src/config/CreateQueryConfig.js +322 -322
  126. package/src/config/default/antd.config.js +89 -89
  127. package/src/config/default/setting.config.js +55 -55
  128. package/src/font-style/font.css +4 -4
  129. package/src/layouts/CommonLayout.vue +56 -56
  130. package/src/layouts/PageLayout.vue +151 -151
  131. package/src/layouts/SinglePageView.vue +138 -138
  132. package/src/layouts/header/AdminHeader.vue +132 -132
  133. package/src/layouts/header/HeaderNotice.vue +177 -177
  134. package/src/layouts/tabs/TabsHead.vue +189 -189
  135. package/src/layouts/tabs/TabsView.vue +387 -387
  136. package/src/lib.js +1 -1
  137. package/src/main.js +26 -26
  138. package/src/mock/extend/index.js +84 -84
  139. package/src/mock/goods/index.js +108 -108
  140. package/src/pages/AMisDemo/AMisDemo.vue +325 -325
  141. package/src/pages/AMisDemo/AMisDemo2.vue +74 -74
  142. package/src/pages/DynamicStatistics/ChartSelector.vue +331 -331
  143. package/src/pages/DynamicStatistics/DataTabs.vue +83 -83
  144. package/src/pages/DynamicStatistics/DynamicTable.vue +128 -128
  145. package/src/pages/DynamicStatistics/EvaluationArea.vue +69 -69
  146. package/src/pages/DynamicStatistics/FavoriteList.vue +51 -51
  147. package/src/pages/DynamicStatistics/QuestionHistoryAndFavorites.vue +591 -591
  148. package/src/pages/DynamicStatistics/SearchBar.vue +192 -192
  149. package/src/pages/DynamicStatistics/index.vue +282 -282
  150. package/src/pages/Example/index.vue +32 -32
  151. package/src/pages/NewDynamicStatistics/ChartSelector.vue +331 -331
  152. package/src/pages/NewDynamicStatistics/DataTabs.vue +122 -122
  153. package/src/pages/NewDynamicStatistics/DynamicTable.vue +128 -128
  154. package/src/pages/NewDynamicStatistics/EvaluationArea.vue +69 -69
  155. package/src/pages/NewDynamicStatistics/FavoriteList.vue +51 -51
  156. package/src/pages/NewDynamicStatistics/QuestionHistoryAndFavorites.vue +289 -289
  157. package/src/pages/NewDynamicStatistics/SearchBar.vue +193 -193
  158. package/src/pages/NewDynamicStatistics/index.vue +258 -258
  159. package/src/pages/ServiceReview/index.vue +284 -284
  160. package/src/pages/XReportView/index.vue +62 -62
  161. package/src/pages/login/Login.vue +378 -378
  162. package/src/pages/login/LoginV3.vue +389 -389
  163. package/src/pages/lowCode/lowCodeEditor.vue +1501 -1285
  164. package/src/pages/lowCode/lowCodeRender.vue +39 -39
  165. package/src/pages/resourceManage/orgListManage.vue +98 -98
  166. package/src/pages/system/dictionary/index.vue +44 -44
  167. package/src/pages/system/monitor/loginInfor/index.vue +37 -37
  168. package/src/pages/system/monitor/operLog/index.vue +37 -37
  169. package/src/pages/system/settings/modifyPassword.vue +117 -117
  170. package/src/pages/system/ticket/index.vue +480 -480
  171. package/src/pages/system/ticket/submitTicketSuccess.vue +484 -484
  172. package/src/router/async/config.async.js +33 -33
  173. package/src/router/async/router.map.js +107 -107
  174. package/src/router/guards.js +220 -220
  175. package/src/router/index.js +27 -27
  176. package/src/router.js +19 -19
  177. package/src/services/api/TicketDetailsViewApi.js +46 -46
  178. package/src/services/api/cas.js +79 -79
  179. package/src/services/api/common.js +284 -284
  180. package/src/services/api/entity.js +18 -18
  181. package/src/services/api/index.js +17 -17
  182. package/src/services/api/restTools.js +46 -46
  183. package/src/services/apiService.js +14 -14
  184. package/src/services/user.js +71 -71
  185. package/src/store/modules/setting.js +119 -119
  186. package/src/theme/default/style.less +57 -57
  187. package/src/theme/global.less +130 -130
  188. package/src/utils/authority-utils.js +85 -85
  189. package/src/utils/errorCode.js +6 -6
  190. package/src/utils/htmlToPDF.js +108 -108
  191. package/src/utils/htmlToPDFApi.js +5 -5
  192. package/src/utils/indexedDB.js +201 -201
  193. package/src/utils/login.js +144 -144
  194. package/src/utils/lowcode/lowcodeComponentMixin.js +112 -78
  195. package/src/utils/lowcode/lowcodeLog.js +29 -29
  196. package/src/utils/lowcode/lowcodeUtils.js +276 -129
  197. package/src/utils/lowcode/registerComponentForEditor.js +11 -11
  198. package/src/utils/lowcode/registerComponentForRender.js +11 -11
  199. package/src/utils/map-utils.js +47 -47
  200. package/src/utils/reg.js +19 -19
  201. package/src/utils/request.js +343 -343
  202. package/src/utils/routerUtil.js +435 -435
  203. package/src/utils/runEvalFunction.js +6 -6
  204. package/src/utils/util.js +241 -241
  205. package/src/utils/waterMark.js +31 -31
  206. package/test/Amis.spec.js +163 -163
  207. package/test/Tree.spec.js +167 -167
  208. package/test/myDialog.spec.js +46 -46
  209. package/vue.config.js +177 -177
  210. package//350/277/201/347/247/273/346/227/245/345/277/227.md +15 -15
@@ -1,470 +1,470 @@
1
- <template>
2
- <div>
3
- <template v-if="this.activatedConfig.designMode === 'json'">
4
- <XReportJsonRender
5
- :display-only="displayOnly"
6
- :show-title="showTitle"
7
- :no-padding="noPadding"
8
- :no-top-border="noTopBorder"
9
- :config="activatedConfig"/>
10
- </template>
11
- <template v-else>
12
- <div :class=" noPadding ? 'reportMainNoPadding' : 'reportMain'" :style="activatedConfig.width > 0 ? ('width:' + activatedConfig.width + 'px') : undefined">
13
- <!-- 大标题 -->
14
- <h2 class="reportTitle" v-if="showTitle && activatedConfig.title" v-html="activatedConfig.title"></h2>
15
- <!-- 小标题 / 介乎于标题与表格之间的内容 -->
16
- <div class="subTitle" v-if="activatedConfig.subTitle">
17
- <div class="subTitleItems" v-for="(item, itemIndex) in activatedConfig.subTitle" :key="itemIndex">
18
- <template v-if="item.type === 'column'">
19
- <span>{{ item.text }}</span>
20
- </template>
21
- <template v-else-if="item.type === 'inputs'">
22
- <div class="inputsDiv">
23
- <div class="inputsDivItem" v-for="(num, index) of calcFormatInputNum(item.format)" :key="index">
24
- <span class="inputsDivItemLabel">{{ displayFormatStartText(item.format) }}</span>
25
- <template v-if="!forDisplay">
26
- <template v-if="item.inputReadOnly === true">
27
- <a-input v-model="data[item.dataIndex][index]" :style="'width:' + (item.inputWidth ? item.inputWidth : '100') + '%'" :disabled="true"/>
28
- </template>
29
- <template v-else>
30
- <a-input v-model="data[item.dataIndex][index]" :style="'width:' + (item.inputWidth ? item.inputWidth : '100') + '%'"/>
31
- </template>
32
- </template>
33
- <template v-else>
34
- {{ activatedConfig.data[item.dataIndex][index] }}
35
- </template>
36
- <span class="inputsDivItemLabel">{{ displayFormatText(item.format, index) }}</span>
37
- </div>
38
- </div>
39
- </template>
40
- </div>
41
- </div>
42
- <!-- 主体表格 -->
43
- <table class="reportTable" v-if="render" :style="activatedConfig.style ? activatedConfig.style : undefined">
44
- <tbody class="reportTable">
45
- <template v-for="(row, rowIndex) in activatedConfig.columns">
46
- <!-- 插槽展示 -->
47
- <!-- <template v-if="row[0].type === 'slot'">-->
48
- <!-- <XReportSlot :config="activatedConfig" v-if="render" :slot-config-name="row[0].slotConfig" :key="rowIndex" :for-display="forDisplay"></XReportSlot>-->
49
- <!-- </template>-->
50
- <!-- 普通行 -->
51
- <template v-if="row[0].type !== 'inputColumns' && row[0].type !== 'list'">
52
- <template v-if="!forDisplay">
53
- <x-report-tr-group
54
- @updateImg="updateImg"
55
- :use-oss-for-img="useOssForImg"
56
- :key="rowIndex"
57
- :columns="row"
58
- :no-top-border="noTopBorder"
59
- :config-data="activatedConfig.data"
60
- :config="activatedConfig">
61
- </x-report-tr-group>
62
- </template>
63
- <template v-else>
64
- <x-report-tr-group
65
- @updateImg="updateImg"
66
- :use-oss-for-img="useOssForImg"
67
- :config="activatedConfig"
68
- :key="rowIndex"
69
- :columns="row"
70
- :no-top-border="noTopBorder"
71
- :config-data="activatedConfig.data"
72
- :display="true">
73
- </x-report-tr-group>
74
- </template>
75
- </template>
76
- <!-- 列表 -->
77
- <template v-else-if="row[0].type === 'list'" >
78
- <template v-for="(num, listIndex) in row[0].listLength + 1">
79
- <template v-if="!forDisplay">
80
- <x-report-tr-group
81
- @updateImg="updateImg"
82
- :use-oss-for-img="useOssForImg"
83
- :config="activatedConfig"
84
- :key="rowIndex + listIndex"
85
- :columns="row"
86
- :no-top-border="noTopBorder"
87
- :config-data="activatedConfig.data"
88
- :list-index="listIndex">
89
- </x-report-tr-group>
90
- </template>
91
- <template v-else>
92
- <x-report-tr-group
93
- @updateImg="updateImg"
94
- :use-oss-for-img="useOssForImg"
95
- :config="activatedConfig"
96
- :key="rowIndex + listIndex"
97
- :columns="row"
98
- :no-top-border="noTopBorder"
99
- :config-data="activatedConfig.data"
100
- :list-index="listIndex"
101
- :display="true">
102
- </x-report-tr-group>
103
- </template>
104
- </template>
105
- </template>
106
- <!-- 动态行 -->
107
- <template v-else>
108
- <template v-if="forDisplay">
109
- <x-report-tr-group
110
- @updateImg="updateImg"
111
- :use-oss-for-img="useOssForImg"
112
- :config="activatedConfig"
113
- :columns="row[0].definition"
114
- :config-data="{arr: activatedConfig.data[row[0].dataIndex]}"
115
- :input-columns="true"
116
- :no-top-border="noTopBorder"
117
- v-for="(item, definitionIndex) in activatedConfig.data[row[0].dataIndex]"
118
- :input-columns-definition-index="definitionIndex"
119
- :display="true"
120
- :key="row[0].dataIndex + definitionIndex + rowIndex"></x-report-tr-group>
121
- </template>
122
- <template v-if="!forDisplay">
123
- <x-report-tr-group
124
- @updateImg="updateImg"
125
- :use-oss-for-img="useOssForImg"
126
- :config="activatedConfig"
127
- :columns="row[0].definition"
128
- :config-data="{arr: activatedConfig.data[row[0].dataIndex]}"
129
- :input-columns="true"
130
- :no-top-border="noTopBorder"
131
- v-for="(item, definitionIndex) in activatedConfig.data[row[0].dataIndex]"
132
- :input-columns-definition-index="definitionIndex"
133
- :key="row[0].dataIndex + definitionIndex + rowIndex"></x-report-tr-group>
134
- <!-- 动态行交互按钮 -->
135
- <x-report-tr-group
136
- @updateImg="updateImg"
137
- :use-oss-for-img="useOssForImg"
138
- :config="activatedConfig"
139
- :key="rowIndex"
140
- :columns="row"
141
- :no-top-border="noTopBorder"
142
- :config-data="activatedConfig.data"
143
- :input-columns-button="true"
144
- :input-columns="true">
145
- </x-report-tr-group>
146
- </template>
147
- </template>
148
- </template>
149
- </tbody>
150
- </table>
151
- <div v-if="showImages" style="margin-top: 5%; display: flex;margin-bottom: 5%">
152
- <p>图片:</p>
153
- <template v-for="(img,imgIndex) in imageList">
154
- <div :key="imgIndex" style="margin-left: 3%;width: 200px">
155
- <img :src="img.url" class="img" :alt="img.name"/>
156
- <p style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;width: 100%;">{{ img.name }}</p>
157
- </div>
158
- </template>
159
- </div>
160
- </div>
161
- </template>
162
- </div>
163
- </template>
164
-
165
- <script>
166
- import XReportTrGroup from '@vue2-client/base-client/components/common/XReport/XReportTrGroup.vue'
167
- import XReportJsonRender from '@vue2-client/base-client/components/common/XReport/XReportJsonRender.vue'
168
- import { getConfigByName } from '@vue2-client/services/api/common'
169
-
170
- export default {
171
- name: 'XReportDesign',
172
- props: {
173
- // 配置
174
- config: {
175
- type: Object,
176
- require: true,
177
- default: () => {}
178
- },
179
- // 是否是展示用
180
- forDisplay: {
181
- type: Boolean,
182
- default: false
183
- },
184
- // 是否只能展示不可编辑
185
- displayOnly: {
186
- type: Boolean,
187
- default: false
188
- },
189
- // 插槽名
190
- slotConfigName: {
191
- type: String,
192
- default: undefined
193
- },
194
- // 将图片全部展示在表格之后,挨个罗列
195
- showImages: {
196
- type: Boolean,
197
- default: false
198
- },
199
- // 图片罗列的数组
200
- imageList: {
201
- type: Array,
202
- default: undefined
203
- },
204
- // 表格没有边距
205
- noPadding: {
206
- type: Boolean,
207
- default: false
208
- },
209
- // 表格没有上边框,与noPadding搭配可以实现连续表格
210
- noTopBorder: {
211
- type: Boolean,
212
- default: false
213
- },
214
- // 是否展示标题
215
- showTitle: {
216
- type: Boolean,
217
- default: true
218
- },
219
- // 图片是否使用OSS来保存
220
- useOssForImg: {
221
- type: Boolean,
222
- default: true
223
- }
224
- },
225
- components: {
226
- XReportTrGroup,
227
- XReportJsonRender
228
- },
229
- data () {
230
- return {
231
- // 表单的数据
232
- data: this.config.data,
233
- // 插槽配置
234
- slotConfig: undefined,
235
- // 控制是否渲染
236
- render: false,
237
- // 用于展示的配置
238
- activatedConfig: {}
239
- }
240
- },
241
- methods: {
242
- updateImg (data) {
243
- this.$emit('updateImg', data)
244
- },
245
- // 根据format计算需要多少个输入框
246
- calcFormatInputNum (formatStr) {
247
- let count = 0
248
- for (let i = 0; i < formatStr.length; i++) {
249
- if (formatStr[i] == '{') {
250
- count++
251
- }
252
- }
253
- return count
254
- },
255
- // 根据format计算输入框之后的文字显示
256
- displayFormatText (formatStr, num) {
257
- let start = 0
258
- let count = 0
259
- num++
260
- for (let i = 0; i < formatStr.length; i++) {
261
- if (formatStr[i] === '}') {
262
- start = i
263
- count++
264
- }
265
- if (count === num) {
266
- for (let j = start + 1; j < formatStr.length; j++) {
267
- if (formatStr[j] === '{') {
268
- return formatStr.slice(start + 1, j)
269
- }
270
- if (j === formatStr.length - 1 && formatStr[j] !== '}') {
271
- return formatStr[j]
272
- }
273
- }
274
- }
275
- }
276
- },
277
- // 根据format计算输入框之前的文字显示
278
- displayFormatStartText (formatStr) {
279
- let count = 0
280
- for (let i = 0; i < formatStr.length; i++) {
281
- if (formatStr[i] === '{') {
282
- break
283
- } else {
284
- count++
285
- }
286
- }
287
- return formatStr.slice(0, count)
288
- },
289
- },
290
- created () {
291
- if (this.slotConfigName) {
292
- getConfigByName(this.slotConfigName, undefined, res => {
293
- this.slotConfig = res
294
- res.data = { ...res.data, ...this.data }
295
- this.config.data = res.data
296
- this.activatedConfig = res
297
- this.render = true
298
- })
299
- } else {
300
- this.activatedConfig = this.config
301
- this.render = true
302
- }
303
- this.activatedConfig.columns.forEach(row => {
304
- if (row[0].type === 'list' && row[0].listLength === 1) {
305
- row.forEach(cell => {
306
- cell.listLength = this.activatedConfig.data[cell.dataIndex].length
307
- })
308
- }
309
- })
310
- },
311
- mounted () {
312
- },
313
- watch: {
314
- config: {
315
- deep: true,
316
- handler (newVal) {
317
- }
318
- }
319
- }
320
- }
321
- </script>
322
-
323
- <style lang="less" scoped>
324
- .img{
325
- width: 95%;
326
- height: 180px;
327
- object-fit: cover;
328
- }
329
- .reportMain {
330
- text-align: center;
331
- margin: 0 auto;
332
- font-size: 16px;
333
- color: #000;
334
- background-color: #fff;
335
- padding: 15px;
336
- border-radius: 8px;
337
-
338
- .reportTitle {
339
- font-weight: bold;
340
- }
341
-
342
- .subTitle {
343
- display: flex;
344
- justify-content: space-between;
345
- margin-bottom: 1%;
346
-
347
- .subTitleItems {
348
- max-width: 30%;
349
- }
350
- }
351
-
352
- .inputsDiv {
353
- display: flex;
354
- justify-content: space-between;
355
- .inputsDivItem {
356
- display: flex;
357
- align-items: center;
358
- padding: 0 4px;
359
- white-space: nowrap;
360
- .inputsDivItemLabel {
361
- padding: 0 4px;
362
- }
363
- }
364
- }
365
-
366
- .reportTable {
367
- width: 100%;
368
- border-collapse: collapse;
369
- table-layout:fixed;
370
- word-break:break-all;
371
- }
372
- }
373
- .reportMainForDisplay {
374
- text-align: center;
375
- margin: 10% auto;
376
- font-size: 16px;
377
- color: #000;
378
- background-color: #fff;
379
- padding: 15px;
380
- border-radius: 8px;
381
-
382
- .reportTitle {
383
- font-weight: bold;
384
- }
385
-
386
- .subTitle {
387
- display: flex;
388
- justify-content: space-between;
389
-
390
- .subTitleItems {
391
- max-width: 30%;
392
- }
393
- }
394
-
395
- .inputsDiv {
396
- display: flex;
397
- justify-content: space-around;
398
- .inputsDivItem {
399
- display: flex;
400
- align-items: center;
401
- padding: 0 4px;
402
- white-space: nowrap;
403
- .inputsDivItemLabel {
404
- padding: 0 4px;
405
- }
406
- }
407
- }
408
-
409
- .reportTable {
410
- width: 100%;
411
- border-collapse: collapse;
412
- table-layout:fixed;
413
- word-break:break-all;
414
- }
415
- }
416
- .reportMainNoPadding {
417
- text-align: center;
418
- margin: 0 auto;
419
- font-size: 16px;
420
- color: #000;
421
- background-color: #fff;
422
- border-radius: 8px;
423
-
424
- .reportTitle {
425
- font-weight: bold;
426
- }
427
-
428
- .subTitle {
429
- display: flex;
430
- justify-content: space-between;
431
-
432
- .subTitleItems {
433
- max-width: 30%;
434
- }
435
- }
436
-
437
- .inputsDiv {
438
- display: flex;
439
- justify-content: space-between;
440
- .inputsDivItem {
441
- display: flex;
442
- align-items: center;
443
- padding: 0 4px;
444
- white-space: nowrap;
445
- .inputsDivItemLabel {
446
- padding: 0 4px;
447
- }
448
- }
449
- }
450
-
451
- .reportTable {
452
- width: 100%;
453
- border-collapse: collapse;
454
- table-layout:fixed;
455
- word-break:break-all;
456
- }
457
- }
458
- .tools{
459
- position: fixed;
460
- right: 2%;
461
- text-align: right;
462
- width: 60%;
463
- cursor: pointer;
464
- .toolsItem{
465
- width: 15%;
466
- margin-right: 3%;
467
- display: inline-block;
468
- }
469
- }
470
- </style>
1
+ <template>
2
+ <div>
3
+ <template v-if="this.activatedConfig.designMode === 'json'">
4
+ <XReportJsonRender
5
+ :display-only="displayOnly"
6
+ :show-title="showTitle"
7
+ :no-padding="noPadding"
8
+ :no-top-border="noTopBorder"
9
+ :config="activatedConfig"/>
10
+ </template>
11
+ <template v-else>
12
+ <div :class=" noPadding ? 'reportMainNoPadding' : 'reportMain'" :style="activatedConfig.width > 0 ? ('width:' + activatedConfig.width + 'px') : undefined">
13
+ <!-- 大标题 -->
14
+ <h2 class="reportTitle" v-if="showTitle && activatedConfig.title" v-html="activatedConfig.title"></h2>
15
+ <!-- 小标题 / 介乎于标题与表格之间的内容 -->
16
+ <div class="subTitle" v-if="activatedConfig.subTitle">
17
+ <div class="subTitleItems" v-for="(item, itemIndex) in activatedConfig.subTitle" :key="itemIndex">
18
+ <template v-if="item.type === 'column'">
19
+ <span>{{ item.text }}</span>
20
+ </template>
21
+ <template v-else-if="item.type === 'inputs'">
22
+ <div class="inputsDiv">
23
+ <div class="inputsDivItem" v-for="(num, index) of calcFormatInputNum(item.format)" :key="index">
24
+ <span class="inputsDivItemLabel">{{ displayFormatStartText(item.format) }}</span>
25
+ <template v-if="!forDisplay">
26
+ <template v-if="item.inputReadOnly === true">
27
+ <a-input v-model="data[item.dataIndex][index]" :style="'width:' + (item.inputWidth ? item.inputWidth : '100') + '%'" :disabled="true"/>
28
+ </template>
29
+ <template v-else>
30
+ <a-input v-model="data[item.dataIndex][index]" :style="'width:' + (item.inputWidth ? item.inputWidth : '100') + '%'"/>
31
+ </template>
32
+ </template>
33
+ <template v-else>
34
+ {{ activatedConfig.data[item.dataIndex][index] }}
35
+ </template>
36
+ <span class="inputsDivItemLabel">{{ displayFormatText(item.format, index) }}</span>
37
+ </div>
38
+ </div>
39
+ </template>
40
+ </div>
41
+ </div>
42
+ <!-- 主体表格 -->
43
+ <table class="reportTable" v-if="render" :style="activatedConfig.style ? activatedConfig.style : undefined">
44
+ <tbody class="reportTable">
45
+ <template v-for="(row, rowIndex) in activatedConfig.columns">
46
+ <!-- 插槽展示 -->
47
+ <!-- <template v-if="row[0].type === 'slot'">-->
48
+ <!-- <XReportSlot :config="activatedConfig" v-if="render" :slot-config-name="row[0].slotConfig" :key="rowIndex" :for-display="forDisplay"></XReportSlot>-->
49
+ <!-- </template>-->
50
+ <!-- 普通行 -->
51
+ <template v-if="row[0].type !== 'inputColumns' && row[0].type !== 'list'">
52
+ <template v-if="!forDisplay">
53
+ <x-report-tr-group
54
+ @updateImg="updateImg"
55
+ :use-oss-for-img="useOssForImg"
56
+ :key="rowIndex"
57
+ :columns="row"
58
+ :no-top-border="noTopBorder"
59
+ :config-data="activatedConfig.data"
60
+ :config="activatedConfig">
61
+ </x-report-tr-group>
62
+ </template>
63
+ <template v-else>
64
+ <x-report-tr-group
65
+ @updateImg="updateImg"
66
+ :use-oss-for-img="useOssForImg"
67
+ :config="activatedConfig"
68
+ :key="rowIndex"
69
+ :columns="row"
70
+ :no-top-border="noTopBorder"
71
+ :config-data="activatedConfig.data"
72
+ :display="true">
73
+ </x-report-tr-group>
74
+ </template>
75
+ </template>
76
+ <!-- 列表 -->
77
+ <template v-else-if="row[0].type === 'list'" >
78
+ <template v-for="(num, listIndex) in row[0].listLength + 1">
79
+ <template v-if="!forDisplay">
80
+ <x-report-tr-group
81
+ @updateImg="updateImg"
82
+ :use-oss-for-img="useOssForImg"
83
+ :config="activatedConfig"
84
+ :key="rowIndex + listIndex"
85
+ :columns="row"
86
+ :no-top-border="noTopBorder"
87
+ :config-data="activatedConfig.data"
88
+ :list-index="listIndex">
89
+ </x-report-tr-group>
90
+ </template>
91
+ <template v-else>
92
+ <x-report-tr-group
93
+ @updateImg="updateImg"
94
+ :use-oss-for-img="useOssForImg"
95
+ :config="activatedConfig"
96
+ :key="rowIndex + listIndex"
97
+ :columns="row"
98
+ :no-top-border="noTopBorder"
99
+ :config-data="activatedConfig.data"
100
+ :list-index="listIndex"
101
+ :display="true">
102
+ </x-report-tr-group>
103
+ </template>
104
+ </template>
105
+ </template>
106
+ <!-- 动态行 -->
107
+ <template v-else>
108
+ <template v-if="forDisplay">
109
+ <x-report-tr-group
110
+ @updateImg="updateImg"
111
+ :use-oss-for-img="useOssForImg"
112
+ :config="activatedConfig"
113
+ :columns="row[0].definition"
114
+ :config-data="{arr: activatedConfig.data[row[0].dataIndex]}"
115
+ :input-columns="true"
116
+ :no-top-border="noTopBorder"
117
+ v-for="(item, definitionIndex) in activatedConfig.data[row[0].dataIndex]"
118
+ :input-columns-definition-index="definitionIndex"
119
+ :display="true"
120
+ :key="row[0].dataIndex + definitionIndex + rowIndex"></x-report-tr-group>
121
+ </template>
122
+ <template v-if="!forDisplay">
123
+ <x-report-tr-group
124
+ @updateImg="updateImg"
125
+ :use-oss-for-img="useOssForImg"
126
+ :config="activatedConfig"
127
+ :columns="row[0].definition"
128
+ :config-data="{arr: activatedConfig.data[row[0].dataIndex]}"
129
+ :input-columns="true"
130
+ :no-top-border="noTopBorder"
131
+ v-for="(item, definitionIndex) in activatedConfig.data[row[0].dataIndex]"
132
+ :input-columns-definition-index="definitionIndex"
133
+ :key="row[0].dataIndex + definitionIndex + rowIndex"></x-report-tr-group>
134
+ <!-- 动态行交互按钮 -->
135
+ <x-report-tr-group
136
+ @updateImg="updateImg"
137
+ :use-oss-for-img="useOssForImg"
138
+ :config="activatedConfig"
139
+ :key="rowIndex"
140
+ :columns="row"
141
+ :no-top-border="noTopBorder"
142
+ :config-data="activatedConfig.data"
143
+ :input-columns-button="true"
144
+ :input-columns="true">
145
+ </x-report-tr-group>
146
+ </template>
147
+ </template>
148
+ </template>
149
+ </tbody>
150
+ </table>
151
+ <div v-if="showImages" style="margin-top: 5%; display: flex;margin-bottom: 5%">
152
+ <p>图片:</p>
153
+ <template v-for="(img,imgIndex) in imageList">
154
+ <div :key="imgIndex" style="margin-left: 3%;width: 200px">
155
+ <img :src="img.url" class="img" :alt="img.name"/>
156
+ <p style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;width: 100%;">{{ img.name }}</p>
157
+ </div>
158
+ </template>
159
+ </div>
160
+ </div>
161
+ </template>
162
+ </div>
163
+ </template>
164
+
165
+ <script>
166
+ import XReportTrGroup from '@vue2-client/base-client/components/common/XReport/XReportTrGroup.vue'
167
+ import XReportJsonRender from '@vue2-client/base-client/components/common/XReport/XReportJsonRender.vue'
168
+ import { getConfigByName } from '@vue2-client/services/api/common'
169
+
170
+ export default {
171
+ name: 'XReportDesign',
172
+ props: {
173
+ // 配置
174
+ config: {
175
+ type: Object,
176
+ require: true,
177
+ default: () => {}
178
+ },
179
+ // 是否是展示用
180
+ forDisplay: {
181
+ type: Boolean,
182
+ default: false
183
+ },
184
+ // 是否只能展示不可编辑
185
+ displayOnly: {
186
+ type: Boolean,
187
+ default: false
188
+ },
189
+ // 插槽名
190
+ slotConfigName: {
191
+ type: String,
192
+ default: undefined
193
+ },
194
+ // 将图片全部展示在表格之后,挨个罗列
195
+ showImages: {
196
+ type: Boolean,
197
+ default: false
198
+ },
199
+ // 图片罗列的数组
200
+ imageList: {
201
+ type: Array,
202
+ default: undefined
203
+ },
204
+ // 表格没有边距
205
+ noPadding: {
206
+ type: Boolean,
207
+ default: false
208
+ },
209
+ // 表格没有上边框,与noPadding搭配可以实现连续表格
210
+ noTopBorder: {
211
+ type: Boolean,
212
+ default: false
213
+ },
214
+ // 是否展示标题
215
+ showTitle: {
216
+ type: Boolean,
217
+ default: true
218
+ },
219
+ // 图片是否使用OSS来保存
220
+ useOssForImg: {
221
+ type: Boolean,
222
+ default: true
223
+ }
224
+ },
225
+ components: {
226
+ XReportTrGroup,
227
+ XReportJsonRender
228
+ },
229
+ data () {
230
+ return {
231
+ // 表单的数据
232
+ data: this.config.data,
233
+ // 插槽配置
234
+ slotConfig: undefined,
235
+ // 控制是否渲染
236
+ render: false,
237
+ // 用于展示的配置
238
+ activatedConfig: {}
239
+ }
240
+ },
241
+ methods: {
242
+ updateImg (data) {
243
+ this.$emit('updateImg', data)
244
+ },
245
+ // 根据format计算需要多少个输入框
246
+ calcFormatInputNum (formatStr) {
247
+ let count = 0
248
+ for (let i = 0; i < formatStr.length; i++) {
249
+ if (formatStr[i] == '{') {
250
+ count++
251
+ }
252
+ }
253
+ return count
254
+ },
255
+ // 根据format计算输入框之后的文字显示
256
+ displayFormatText (formatStr, num) {
257
+ let start = 0
258
+ let count = 0
259
+ num++
260
+ for (let i = 0; i < formatStr.length; i++) {
261
+ if (formatStr[i] === '}') {
262
+ start = i
263
+ count++
264
+ }
265
+ if (count === num) {
266
+ for (let j = start + 1; j < formatStr.length; j++) {
267
+ if (formatStr[j] === '{') {
268
+ return formatStr.slice(start + 1, j)
269
+ }
270
+ if (j === formatStr.length - 1 && formatStr[j] !== '}') {
271
+ return formatStr[j]
272
+ }
273
+ }
274
+ }
275
+ }
276
+ },
277
+ // 根据format计算输入框之前的文字显示
278
+ displayFormatStartText (formatStr) {
279
+ let count = 0
280
+ for (let i = 0; i < formatStr.length; i++) {
281
+ if (formatStr[i] === '{') {
282
+ break
283
+ } else {
284
+ count++
285
+ }
286
+ }
287
+ return formatStr.slice(0, count)
288
+ },
289
+ },
290
+ created () {
291
+ if (this.slotConfigName) {
292
+ getConfigByName(this.slotConfigName, undefined, res => {
293
+ this.slotConfig = res
294
+ res.data = { ...res.data, ...this.data }
295
+ this.config.data = res.data
296
+ this.activatedConfig = res
297
+ this.render = true
298
+ })
299
+ } else {
300
+ this.activatedConfig = this.config
301
+ this.render = true
302
+ }
303
+ this.activatedConfig.columns.forEach(row => {
304
+ if (row[0].type === 'list' && row[0].listLength === 1) {
305
+ row.forEach(cell => {
306
+ cell.listLength = this.activatedConfig.data[cell.dataIndex].length
307
+ })
308
+ }
309
+ })
310
+ },
311
+ mounted () {
312
+ },
313
+ watch: {
314
+ config: {
315
+ deep: true,
316
+ handler (newVal) {
317
+ }
318
+ }
319
+ }
320
+ }
321
+ </script>
322
+
323
+ <style lang="less" scoped>
324
+ .img{
325
+ width: 95%;
326
+ height: 180px;
327
+ object-fit: cover;
328
+ }
329
+ .reportMain {
330
+ text-align: center;
331
+ margin: 0 auto;
332
+ font-size: 16px;
333
+ color: #000;
334
+ background-color: #fff;
335
+ padding: 15px;
336
+ border-radius: 8px;
337
+
338
+ .reportTitle {
339
+ font-weight: bold;
340
+ }
341
+
342
+ .subTitle {
343
+ display: flex;
344
+ justify-content: space-between;
345
+ margin-bottom: 1%;
346
+
347
+ .subTitleItems {
348
+ max-width: 30%;
349
+ }
350
+ }
351
+
352
+ .inputsDiv {
353
+ display: flex;
354
+ justify-content: space-between;
355
+ .inputsDivItem {
356
+ display: flex;
357
+ align-items: center;
358
+ padding: 0 4px;
359
+ white-space: nowrap;
360
+ .inputsDivItemLabel {
361
+ padding: 0 4px;
362
+ }
363
+ }
364
+ }
365
+
366
+ .reportTable {
367
+ width: 100%;
368
+ border-collapse: collapse;
369
+ table-layout:fixed;
370
+ word-break:break-all;
371
+ }
372
+ }
373
+ .reportMainForDisplay {
374
+ text-align: center;
375
+ margin: 10% auto;
376
+ font-size: 16px;
377
+ color: #000;
378
+ background-color: #fff;
379
+ padding: 15px;
380
+ border-radius: 8px;
381
+
382
+ .reportTitle {
383
+ font-weight: bold;
384
+ }
385
+
386
+ .subTitle {
387
+ display: flex;
388
+ justify-content: space-between;
389
+
390
+ .subTitleItems {
391
+ max-width: 30%;
392
+ }
393
+ }
394
+
395
+ .inputsDiv {
396
+ display: flex;
397
+ justify-content: space-around;
398
+ .inputsDivItem {
399
+ display: flex;
400
+ align-items: center;
401
+ padding: 0 4px;
402
+ white-space: nowrap;
403
+ .inputsDivItemLabel {
404
+ padding: 0 4px;
405
+ }
406
+ }
407
+ }
408
+
409
+ .reportTable {
410
+ width: 100%;
411
+ border-collapse: collapse;
412
+ table-layout:fixed;
413
+ word-break:break-all;
414
+ }
415
+ }
416
+ .reportMainNoPadding {
417
+ text-align: center;
418
+ margin: 0 auto;
419
+ font-size: 16px;
420
+ color: #000;
421
+ background-color: #fff;
422
+ border-radius: 8px;
423
+
424
+ .reportTitle {
425
+ font-weight: bold;
426
+ }
427
+
428
+ .subTitle {
429
+ display: flex;
430
+ justify-content: space-between;
431
+
432
+ .subTitleItems {
433
+ max-width: 30%;
434
+ }
435
+ }
436
+
437
+ .inputsDiv {
438
+ display: flex;
439
+ justify-content: space-between;
440
+ .inputsDivItem {
441
+ display: flex;
442
+ align-items: center;
443
+ padding: 0 4px;
444
+ white-space: nowrap;
445
+ .inputsDivItemLabel {
446
+ padding: 0 4px;
447
+ }
448
+ }
449
+ }
450
+
451
+ .reportTable {
452
+ width: 100%;
453
+ border-collapse: collapse;
454
+ table-layout:fixed;
455
+ word-break:break-all;
456
+ }
457
+ }
458
+ .tools{
459
+ position: fixed;
460
+ right: 2%;
461
+ text-align: right;
462
+ width: 60%;
463
+ cursor: pointer;
464
+ .toolsItem{
465
+ width: 15%;
466
+ margin-right: 3%;
467
+ display: inline-block;
468
+ }
469
+ }
470
+ </style>