vue2-client 1.12.26 → 1.12.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.12.26",
3
+ "version": "1.12.28",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -43,42 +43,44 @@
43
43
  <span class="text-ellipsis">{{ card[config.text] }}</span>
44
44
  </a-tooltip>
45
45
  </div>
46
- <template v-for="(item, bodyIndex) in config.content" v-if="bodyIndex < 6">
47
- <div :key="'body' + bodyIndex" class="body-item">
48
- <span class="body-item-label">{{ item.label }}:</span>
49
- <template v-if="item.type === 'progress'">
50
- <div class="progress">
51
- <div class="progress-bar">
52
- <div class="progress-done" :style="'width:' + card[item.key] * 100 + '%;backgroundColor: ' + determineRatioColor(card[item.key] * 100)"></div>
46
+ <template v-if="config.content && config.content.length > 0">
47
+ <template v-for="(item, bodyIndex) in config.content" v-if="bodyIndex < 6">
48
+ <div :key="'body' + bodyIndex" class="body-item">
49
+ <span class="body-item-label">{{ item.label }}:</span>
50
+ <template v-if="item.type === 'progress'">
51
+ <div class="progress">
52
+ <div class="progress-bar">
53
+ <div class="progress-done" :style="'width:' + card[item.key] * 100 + '%;backgroundColor: ' + determineRatioColor(card[item.key] * 100)"></div>
54
+ </div>
53
55
  </div>
54
- </div>
55
- <div class="progress-num">{{ card[item.key] * 100 }}%</div>
56
- </template>
57
- <template v-else-if="item.type === 'custom' && tableColumns">
58
- <!-- 根据 tableColumns 显示自定义内容 -->
59
- <span v-for="column in tableColumns" v-if="column.dataIndex === item.key" :key="column.dataIndex">
60
- <template v-if="column.slotType === 'badge'">
61
- <x-badge
62
- :service-name="serviceName"
63
- :env="env"
64
- :dataCard="true"
65
- :badge-key="column.slotKeyMap"
66
- :value="card[item.key]" />
67
- </template>
68
- <template v-else>
69
- <slot :name="column.slots.customRender">{{ card[item.key] }}</slot>
70
- </template>
71
- </span>
72
- </template>
73
- <template v-else>
74
- <span class="body-item-value">{{ card[item.key] }}</span>
75
- </template>
76
- </div>
77
- <a-divider
78
- v-if="bodyIndex !== config.content.length - 1"
79
- dashed
80
- :key="'body' + bodyIndex + 'after'"
81
- class="body-split" />
56
+ <div class="progress-num">{{ card[item.key] * 100 }}%</div>
57
+ </template>
58
+ <template v-else-if="item.type === 'custom' && tableColumns">
59
+ <!-- 根据 tableColumns 显示自定义内容 -->
60
+ <span v-for="column in tableColumns" v-if="column.dataIndex === item.key" :key="column.dataIndex">
61
+ <template v-if="column.slotType === 'badge'">
62
+ <x-badge
63
+ :service-name="serviceName"
64
+ :env="env"
65
+ :dataCard="true"
66
+ :badge-key="column.slotKeyMap"
67
+ :value="card[item.key]" />
68
+ </template>
69
+ <template v-else>
70
+ <slot :name="column.slots.customRender">{{ card[item.key] }}</slot>
71
+ </template>
72
+ </span>
73
+ </template>
74
+ <template v-else>
75
+ <span class="body-item-value">{{ card[item.key] }}</span>
76
+ </template>
77
+ </div>
78
+ <a-divider
79
+ v-if="bodyIndex !== config.content.length - 1"
80
+ dashed
81
+ :key="'body' + bodyIndex + 'after'"
82
+ class="body-split" />
83
+ </template>
82
84
  </template>
83
85
  </div>
84
86
  <!-- 下方按钮 -->
@@ -17,7 +17,7 @@ export default {
17
17
  console.log('打印成功')
18
18
  },
19
19
  test1 () {
20
- this.$printB('DiagnosisCertificate', { title: '测试浏览器打印' })
20
+ this.$printB('iot_bill_template', { condition: '21971601' })
21
21
  },
22
22
  test2 () {
23
23
  this.$printC('DiagnosisCertificate', { title: 'DiagnosisCertificate' })
@@ -4,83 +4,38 @@
4
4
  <a-card v-if="showSkeleton">
5
5
  <a-skeleton active/>
6
6
  </a-card>
7
- <template v-if="noPadding">
8
- <!-- 主体表格 -->
9
- <XReportDesign
10
- @updateImg="updateImg"
11
- @selectRow="selectRow"
12
- @slotRendered="slotRendered"
13
- v-if="scanFinish"
14
- :show-img-in-cell="showImgInCell"
15
- :img-prefix="imgPrefix"
16
- :use-oss-for-img="useOssForImg"
17
- :display-only="displayOnly"
18
- :config="type === 'display' ? originalConfig : activeConfig"
19
- :slot-config-name="type === 'display' ? undefined : activatedSlotName"
20
- :for-display="type === 'display'"
21
- ref="XReportDesign"
22
- :server-name="serverName"
23
- :env="env"
24
- :show-title="showTitle"
25
- :no-padding="noPadding"
26
- :no-top-border="noTopBorder"
27
- :show-images="hasImages"
28
- :image-list="imageList">
29
- </XReportDesign>
30
-
31
- <a-row type="flex" justify="end" v-if="showSaveButton">
32
- <a-space>
33
- <a-button @click="saveConfig">
34
- 提交
35
- </a-button>
36
- <a-button @click="cancelConfig">
37
- 取消
38
- </a-button>
39
- </a-space>
40
- </a-row>
41
-
42
- </template>
43
- <template v-else>
44
- <!-- 用以包裹整个页面 -->
45
- <div v-if="!showSkeleton">
46
- <!-- 切换菜单 -->
47
- <a-radio-group
48
- v-model="type"
49
- default-value="a"
50
- button-style="solid"
51
- @change="tabChanged"
52
- v-show="!onlyDisplay && editMode">
53
- <a-radio-button value="design" v-if="!onlyDisplay">
54
- 设计
55
- </a-radio-button>
56
- <a-radio-button value="display" style="border-radius: 0">
57
- 预览
58
- </a-radio-button>
59
- </a-radio-group>
60
- <!-- 主体表格 -->
61
- <XReportDesign
62
- v-if="scanFinish"
63
- @updateImg="updateImg"
64
- @selectRow="selectRow"
65
- @slotRendered="slotRendered"
66
- :show-img-in-cell="showImgInCell"
67
- :img-prefix="imgPrefix"
68
- :use-oss-for-img="useOssForImg"
69
- :display-only="displayOnly"
70
- :config="type === 'display' ? originalConfig : activeConfig"
71
- :slot-config-name="type === 'display' ? undefined : activatedSlotName"
72
- :for-display="type === 'display'"
73
- :no-padding="noPadding"
74
- :no-top-border="noTopBorder"
75
- :show-title="showTitle"
76
- ref="XReportDesign"
77
- :server-name="serverName"
78
- :env="env"
79
- :show-images="hasImages"
80
- :image-list="imageList">
81
- </XReportDesign>
82
- </div>
83
- </template>
7
+ <!-- 主体表格 -->
8
+ <XReportDesign
9
+ @updateImg="updateImg"
10
+ @selectRow="selectRow"
11
+ @slotRendered="slotRendered"
12
+ v-if="scanFinish"
13
+ :show-img-in-cell="showImgInCell"
14
+ :img-prefix="imgPrefix"
15
+ :use-oss-for-img="useOssForImg"
16
+ :display-only="displayOnly"
17
+ :config="type === 'display' ? originalConfig : activeConfig"
18
+ :slot-config-name="type === 'display' ? undefined : activatedSlotName"
19
+ :for-display="type === 'display'"
20
+ ref="XReportDesign"
21
+ :server-name="serverName"
22
+ :env="env"
23
+ :show-title="showTitle"
24
+ :no-padding="noPadding"
25
+ :no-top-border="noTopBorder"
26
+ :show-images="hasImages"
27
+ :image-list="imageList">
28
+ </XReportDesign>
29
+ <a-row type="flex" justify="end" v-if="showSaveButton">
30
+ <a-space>
31
+ <a-button @click="saveConfig">
32
+ 提交
33
+ </a-button>
34
+ <a-button @click="cancelConfig">
35
+ 取消
36
+ </a-button>
37
+ </a-space>
38
+ </a-row>
84
39
  <!-- 弹出框 -->
85
40
  <x-add-report
86
41
  :env="env"
@@ -96,11 +51,9 @@
96
51
 
97
52
  <script>
98
53
  // 转PDF用
99
- import HtmlToPdf from '@vue2-client/utils/htmlToPDF'
100
54
  import { mapState } from 'vuex'
101
55
  import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
102
56
  import XReportDesign from './XReportDesign.vue'
103
- import { printElement } from './print'
104
57
  import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
105
58
 
106
59
  // import XAddReport from '@vue2-client/base-client/components/common/XAddReport'
@@ -277,6 +230,7 @@ export default {
277
230
  return {
278
231
  runLogic: runLogic,
279
232
  openDialog: this.openDialog,
233
+ openDrawer: this.openDrawer,
280
234
  registerComponent: this.registerComponent,
281
235
  getComponentByName: this.getComponentByName,
282
236
  getParentComponentByName: this.getComponentByName,
@@ -532,60 +486,6 @@ export default {
532
486
 
533
487
  return count === total
534
488
  },
535
- // 切换了标签页
536
- tabChanged (key) {
537
- this.scanFinish = false
538
- this.originalConfig.data = { ...this.originalConfig.data, ...this.config.data }
539
- this.config.data = this.originalConfig.data
540
- if (this.type === 'display') {
541
- const tempDataKeys = Object.keys(this.activeConfig.tempData)
542
- tempDataKeys.forEach(key => {
543
- this.changeDeepObject(this.activeConfig.data, key, this.activeConfig.tempData[key])
544
- })
545
- let count = 0
546
- this.imageList = []
547
- const keys = Object.keys(this.config.data.images)
548
- keys.forEach(key => {
549
- if (this.config.data.images[key].length > 0) {
550
- this.imageList = [...this.imageList, ...this.config.data.images[key]]
551
- count++
552
- }
553
- })
554
- this.hasImages = count > 0
555
- } else {
556
- this.hasImages = false
557
- }
558
- this.$nextTick(() => {
559
- this.scanFinish = true
560
- })
561
- },
562
- // 获取当前日期,为保存文件命名用
563
- getDate () {
564
- const currentDate = new Date()
565
-
566
- const year = currentDate.getFullYear()
567
- const month = String(currentDate.getMonth() + 1).padStart(2, '0')
568
- const day = String(currentDate.getDate()).padStart(2, '0')
569
-
570
- const formattedDate = `${year}_${month}_${day}`
571
-
572
- return formattedDate
573
- },
574
- // 打印
575
- printDocument () {
576
- // x-report
577
- const printContent = window.rawDocument.getElementById('printReady')
578
- printElement(printContent)
579
- this.$message.success('操作成功!')
580
- },
581
- // 导出PDF
582
- exportPDF () {
583
- const date = this.getDate()
584
- let title = this.config.title
585
- title = title.replace(/<[^>]+>/g, '')
586
- const fileName = date + '' + title
587
- HtmlToPdf.getPdf(fileName, '#printReady')
588
- },
589
489
  // 用于分割配置中的colums,将需要处理的数组提取出来
590
490
  formatConfigRow () {
591
491
  for (let i = 0; i < this.config.columns.length; i++) {
@@ -992,10 +892,6 @@ export default {
992
892
  })
993
893
  }
994
894
  },
995
- onSubmit () {
996
- console.log('this.table_selectedRowKeys', this.table_selectedRowKeys)
997
- console.log('this.table_selectedRows', this.table_selectedRows)
998
- },
999
895
  },
1000
896
  beforeMount () {
1001
897
  // 如果只是展示
@@ -1005,16 +901,19 @@ export default {
1005
901
  }
1006
902
  // 如果有本地配置,优先使用本地配置
1007
903
  if (this.localConfig) {
1008
- // 如果配置是json渲染器
1009
- if (this.localConfig.designMode === 'json') {
1010
- this.config = this.localConfig
1011
- if (this.configData !== undefined) {
1012
- this.config.data = this.configData
1013
- }
1014
- this.jsonConfigInit()
1015
- } else {
1016
- // 如果配置是普通渲染器
1017
- this.config = this.localConfig
904
+ // 如果配置是普通渲染器
905
+ this.config = this.localConfig
906
+ if (this.configData !== undefined) {
907
+ this.config.data = this.configData
908
+ }
909
+ if (this.config.data.images === undefined) {
910
+ this.config.data.images = {}
911
+ }
912
+ this.configInit()
913
+ } else {
914
+ // 如果本地配置没有值,则从琉璃中获取
915
+ getConfigByName(this.configName, this.serverName, res => {
916
+ this.config = JSON.parse(JSON.stringify(res))
1018
917
  if (this.configData !== undefined) {
1019
918
  this.config.data = this.configData
1020
919
  }
@@ -1022,25 +921,6 @@ export default {
1022
921
  this.config.data.images = {}
1023
922
  }
1024
923
  this.configInit()
1025
- }
1026
- } else {
1027
- // 如果本地配置没有值,则从琉璃中获取
1028
- getConfigByName(this.configName, this.serverName, res => {
1029
- this.config = JSON.parse(JSON.stringify(res))
1030
- if (this.config.designMode === 'json') {
1031
- if (this.configData !== undefined) {
1032
- this.config.data = this.configData
1033
- }
1034
- this.jsonConfigInit()
1035
- } else {
1036
- if (this.configData !== undefined) {
1037
- this.config.data = this.configData
1038
- }
1039
- if (this.config.data.images === undefined) {
1040
- this.config.data.images = {}
1041
- }
1042
- this.configInit()
1043
- }
1044
924
  }, this.env === 'dev')
1045
925
  }
1046
926
  },
@@ -9,8 +9,6 @@
9
9
  :show-img-in-cell="true"
10
10
  :display-only="true"
11
11
  :edit-mode="false"
12
- :show-save-button="false"
13
- :no-padding="true"
14
12
  :dont-format="true"/>
15
13
  </a-card>
16
14
  </div>