vue2-client 1.8.166 → 1.8.167

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