cnhis-design-vue 0.2.15-beta → 0.2.19-beta

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 (131) hide show
  1. package/es/affix/index.js +8 -8
  2. package/es/age/index.js +10 -10
  3. package/es/alert/index.js +8 -8
  4. package/es/anchor/index.js +8 -8
  5. package/es/auto-complete/index.js +8 -8
  6. package/es/avatar/index.js +8 -8
  7. package/es/back-top/index.js +8 -8
  8. package/es/badge/index.js +8 -8
  9. package/es/base/index.js +8 -8
  10. package/es/big-table/index.js +434 -211
  11. package/es/big-table/style.css +1 -1
  12. package/es/breadcrumb/index.js +8 -8
  13. package/es/button/index.js +2309 -1527
  14. package/es/button/style.css +1 -1
  15. package/es/calendar/index.js +8 -8
  16. package/es/captcha/index.js +3 -3
  17. package/es/card/index.js +8 -8
  18. package/es/carousel/index.js +8 -8
  19. package/es/cascader/index.js +8 -8
  20. package/es/checkbox/index.js +9 -9
  21. package/es/col/index.js +8 -8
  22. package/es/collapse/index.js +8 -8
  23. package/es/color-picker/index.js +1 -1
  24. package/es/comment/index.js +8 -8
  25. package/es/config-provider/index.js +8 -8
  26. package/es/date-picker/index.js +8 -8
  27. package/es/descriptions/index.js +8 -8
  28. package/es/divider/index.js +8 -8
  29. package/es/drag-layout/index.js +3 -3
  30. package/es/drawer/index.js +8 -8
  31. package/es/dropdown/index.js +8 -8
  32. package/es/editor/index.js +24 -24
  33. package/es/editor/style.css +1 -1
  34. package/es/empty/index.js +8 -8
  35. package/es/fabric-chart/index.js +9 -9
  36. package/es/form/index.js +8 -8
  37. package/es/form-model/index.js +8 -8
  38. package/es/index/index.js +3939 -2516
  39. package/es/index/style.css +1 -1
  40. package/es/input/index.js +9 -9
  41. package/es/input-number/index.js +8 -8
  42. package/es/layout/index.js +8 -8
  43. package/es/list/index.js +8 -8
  44. package/es/locale-provider/index.js +8 -8
  45. package/es/map/index.js +9 -9
  46. package/es/mentions/index.js +8 -8
  47. package/es/menu/index.js +8 -8
  48. package/es/message/index.js +8 -8
  49. package/es/multi-chat/index.js +650 -247
  50. package/es/multi-chat/style.css +1 -1
  51. package/es/multi-chat-client/index.js +570 -195
  52. package/es/multi-chat-client/style.css +1 -1
  53. package/es/multi-chat-history/index.js +4 -4
  54. package/es/multi-chat-record/index.js +14 -14
  55. package/es/multi-chat-setting/index.js +330 -79
  56. package/es/multi-chat-setting/style.css +1 -1
  57. package/es/multi-chat-sip/index.js +1 -1
  58. package/es/notification/index.js +8 -8
  59. package/es/page-header/index.js +8 -8
  60. package/es/pagination/index.js +8 -8
  61. package/es/popconfirm/index.js +8 -8
  62. package/es/popover/index.js +8 -8
  63. package/es/progress/index.js +8 -8
  64. package/es/radio/index.js +9 -9
  65. package/es/rate/index.js +8 -8
  66. package/es/result/index.js +8 -8
  67. package/es/row/index.js +8 -8
  68. package/es/scale-view/index.js +189 -131
  69. package/es/scale-view/style.css +1 -1
  70. package/es/select/index.js +11 -11
  71. package/es/select-label/index.js +73 -66
  72. package/es/select-label/style.css +1 -1
  73. package/es/select-person/index.js +2 -2
  74. package/es/skeleton/index.js +8 -8
  75. package/es/slider/index.js +8 -8
  76. package/es/space/index.js +8 -8
  77. package/es/spin/index.js +8 -8
  78. package/es/statistic/index.js +8 -8
  79. package/es/steps/index.js +8 -8
  80. package/es/switch/index.js +8 -8
  81. package/es/table-filter/index.js +2559 -1714
  82. package/es/table-filter/style.css +1 -1
  83. package/es/tabs/index.js +8 -8
  84. package/es/tag/index.js +9 -9
  85. package/es/time-picker/index.js +8 -8
  86. package/es/timeline/index.js +8 -8
  87. package/es/tooltip/index.js +8 -8
  88. package/es/transfer/index.js +8 -8
  89. package/es/tree/index.js +8 -8
  90. package/es/tree-select/index.js +8 -8
  91. package/es/upload/index.js +8 -8
  92. package/es/utils/UniRTCv2.js +586 -0
  93. package/es/verification-code/index.js +2 -2
  94. package/lib/cui.common.js +5928 -3409
  95. package/lib/cui.umd.js +5928 -3409
  96. package/lib/cui.umd.min.js +81 -81
  97. package/package.json +3 -3
  98. package/packages/big-table/src/BigTable.vue +71 -16
  99. package/packages/big-table/src/assets/style/table-base.less +5 -0
  100. package/packages/big-table/src/components/TextOverTooltip.vue +23 -10
  101. package/packages/big-table/src/utils/batchEditing.js +1 -1
  102. package/packages/big-table/src/utils/bigTableProps.js +2 -1
  103. package/packages/button/src/ButtonPrint/index.vue +65 -21
  104. package/packages/button/src/ButtonPrint/js/print.es.min.js +1 -2
  105. package/packages/editor/src/Editor.vue +1 -1
  106. package/packages/multi-chat/chat/audio.vue +22 -0
  107. package/packages/multi-chat/chat/calling.vue +6 -0
  108. package/packages/multi-chat/chat/chatFooter.vue +43 -3
  109. package/packages/multi-chat/chat/client/clientChat.vue +13 -1
  110. package/packages/multi-chat/chat/index.vue +16 -3
  111. package/packages/multi-chat/chat/mixins/uniRTCAPI.js +77 -0
  112. package/packages/multi-chat/chat/multiVideo.vue +14 -0
  113. package/packages/multi-chat/chat/scrollList.vue +7 -1
  114. package/packages/multi-chat/chat/video.vue +4 -0
  115. package/packages/multi-chat/components/user-status.vue +50 -45
  116. package/packages/multi-chat/setting/baseInfo/index.vue +3 -3
  117. package/packages/multi-chat/setting/configuration/index.vue +38 -1
  118. package/packages/multi-chat/store/actions.js +76 -0
  119. package/packages/multi-chat/store/getters.js +9 -0
  120. package/packages/multi-chat/store/mutation.js +9 -0
  121. package/packages/multi-chat/store/state.js +4 -1
  122. package/packages/scale-view/answerParse.vue +27 -14
  123. package/packages/scale-view/scaleView.vue +51 -10
  124. package/packages/select-label/labelFormContent.vue +7 -4
  125. package/packages/select-label/select-label.vue +3 -2
  126. package/packages/table-filter/src/base-search-com/BaseSearch.vue +95 -16
  127. package/packages/table-filter/src/classification/Classification-com.vue +49 -59
  128. package/packages/table-filter/src/components/search-modal/set-classification.vue +4 -1
  129. package/packages/table-filter/src/components/table-modal/TableModal.vue +10 -0
  130. package/packages/table-filter/src/quick-search/QuickSearch.vue +31 -18
  131. package/src/utils/UniRTCv2.js +561 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "0.2.15-beta",
3
+ "version": "0.2.19-beta",
4
4
  "description": "基于 Ant Desgin Vue 的UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -40,7 +40,7 @@
40
40
  "spark-md5": "^3.0.1",
41
41
  "stompjs": "^2.3.3",
42
42
  "text-security": "^3.2.1",
43
- "trtc-js-sdk": "^4.11.7",
43
+ "trtc-js-sdk": "^4.11.4",
44
44
  "v-viewer": "1.5.1",
45
45
  "video.js": "^7.8.4",
46
46
  "vue-dom-portal": "^0.1.6",
@@ -93,4 +93,4 @@
93
93
  "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
94
94
  }
95
95
  }
96
- }
96
+ }
@@ -3,7 +3,7 @@
3
3
  class="big-table"
4
4
  :class="{
5
5
  mt: visibleCheckAllWrap || visibleTreeCheck || hasRefresh,
6
- 'expand-padding': isExpandTable
6
+ 'expand-padding': !isNestTable
7
7
  }"
8
8
  :style="{ height: tableHeight }"
9
9
  >
@@ -147,7 +147,7 @@
147
147
  <script>
148
148
  import Vue from 'vue';
149
149
  import TextOverTooltip from './components/TextOverTooltip.vue';
150
- import { Icon, Tooltip, Progress, Switch, Popover, Button, Dropdown, Menu, Checkbox, Input } from 'ant-design-vue';
150
+ import { Icon, Tooltip, Progress, Switch, Popover, Button, Dropdown, Menu, Checkbox, Input, Popconfirm } from 'ant-design-vue';
151
151
  import format from './utils/format';
152
152
  import { parseDurationValue, parseCombinationValue, formatFieldText, imgs2imgArr } from './utils/tableParse';
153
153
  import passwordCom from './components/password-com.vue';
@@ -167,6 +167,7 @@ import EditForm from './components/edit-form/EditForm.vue';
167
167
 
168
168
  import nestTable from './utils/nestTable';
169
169
  import bigTableProps from './utils/bigTableProps';
170
+ import SvgIcon from '@/component/svg/index.vue';
170
171
 
171
172
  let addInlineEditPrimaryKey = '';
172
173
  export default create({
@@ -182,9 +183,11 @@ export default create({
182
183
  [Switch.name]: Switch,
183
184
  [Popover.name]: Popover,
184
185
  [Dropdown.name]: Dropdown,
186
+ [Popconfirm.name]: Popconfirm,
185
187
  [Menu.name]: Menu,
186
188
  [Grid.name]: Grid,
187
- [VideoList.name]: VideoList
189
+ [VideoList.name]: VideoList,
190
+ SvgIcon
188
191
  },
189
192
  mixins: [format, batchEditing, nestTable],
190
193
  props: Object.assign({}, bigTableProps),
@@ -347,6 +350,9 @@ export default create({
347
350
  }
348
351
  let startIndex = (this.pageVO.pageIndex - 1) * this.pageVO.pageSize;
349
352
  return { startIndex: startIndex < 0 ? 0 : startIndex };
353
+ },
354
+ isScanMultiTable() {
355
+ return this.columnConfig?.isScanMultiTable
350
356
  }
351
357
  },
352
358
  watch: {
@@ -468,6 +474,10 @@ export default create({
468
474
  }
469
475
  },
470
476
  methods: {
477
+ customerInit(){
478
+ this.loadColumn(this.columnConfig);
479
+ this.loadData(this.data);
480
+ },
471
481
  setTalbeScrollTo() {
472
482
  let table = this.$refs.xGrid;
473
483
  if (!table) return;
@@ -1289,8 +1299,9 @@ export default create({
1289
1299
  * sortable: 是否允许列排序
1290
1300
  */
1291
1301
  // 配置列表
1292
- let { selectType, noSetting } = this.getOtherConfigInit() || {};
1293
- let { isBatchSelect, fieldList, showButtonTop } = map;
1302
+ let { selectType } = this.getOtherConfigInit() || {};
1303
+ let { tableNoSetting } = this;
1304
+ let { isBatchSelect, fieldList, showButtonTop, isScanMultiTable } = map;
1294
1305
  if (selectType) {
1295
1306
  // 有设置 selectType 强制可选。
1296
1307
  isBatchSelect = 1;
@@ -1313,7 +1324,20 @@ export default create({
1313
1324
  );
1314
1325
  }
1315
1326
  };
1316
- const columns = [
1327
+ let checkVisible = isBatchSelect == 1 && !this.isNestTable && !isScanMultiTable || false;
1328
+ let columns = [
1329
+ {
1330
+ fixed: 'left',
1331
+ align: 'center',
1332
+ visible: isScanMultiTable || false,
1333
+ width: '50',
1334
+ slots: {
1335
+ header: () => {
1336
+ return "操作";
1337
+ },
1338
+ default: this.scanMultiOperate
1339
+ }
1340
+ },
1317
1341
  {
1318
1342
  type: 'seq',
1319
1343
  fixed: this.isNestTable ? '' : 'left',
@@ -1323,7 +1347,7 @@ export default create({
1323
1347
  showOverflow: true,
1324
1348
  slots: {
1325
1349
  header: () => {
1326
- return [noSetting ? null : <a-icon class="setting" type="setting" onClick={() => this.showDrawer()} />];
1350
+ return [tableNoSetting ? null : <a-icon class="setting" type="setting" onClick={() => this.showDrawer()} />];
1327
1351
  }
1328
1352
  }
1329
1353
  },
@@ -1331,7 +1355,7 @@ export default create({
1331
1355
  type: selectType,
1332
1356
  fixed: this.isNestTable ? '' : 'left',
1333
1357
  align: 'center',
1334
- visible: isBatchSelect == 1 && !this.isNestTable,
1358
+ visible: checkVisible,
1335
1359
  resizable: false,
1336
1360
  width: checkMinWidth,
1337
1361
  // slots: selectType === 'checkbox' ? checkboxSlot : null,
@@ -1360,6 +1384,14 @@ export default create({
1360
1384
  let treeNode = this.isNestTable ? false : this.isTree != 0 ? index === 0 : false;
1361
1385
  let type = index === 0 && this.showNestTable ? 'expand' : '';
1362
1386
 
1387
+ // 扫码打开的table只展示
1388
+ if(isScanMultiTable) {
1389
+ fixed = "";
1390
+ sortable = false;
1391
+ treeNode = false;
1392
+ type = "";
1393
+ }
1394
+
1363
1395
  const col = Object.assign(item, {
1364
1396
  visible: item.columnName == 'operatorColumn' ? showButtonTop == 0 : item.isShow == 1,
1365
1397
  field: item.columnName,
@@ -1384,7 +1416,7 @@ export default create({
1384
1416
  editRender: this.generateEditRender(item)
1385
1417
  });
1386
1418
 
1387
- if (filterField && !this.isNestTable) {
1419
+ if (filterField && !this.isNestTable && !isScanMultiTable) {
1388
1420
  this.$set(
1389
1421
  this.filterFields,
1390
1422
  item.columnName,
@@ -1407,7 +1439,10 @@ export default create({
1407
1439
  col.slots.header = this.toolTipTitle(item);
1408
1440
  }
1409
1441
 
1410
- col.slots.footer = 'tooltip_footer';
1442
+
1443
+ if (!isScanMultiTable) {
1444
+ col.slots.footer = 'tooltip_footer';
1445
+ }
1411
1446
 
1412
1447
  // 主表设置expand
1413
1448
  if (this.showNestTable && this.isTree == 0 && this.curNestColumnConfig?.isTree == 0) {
@@ -1691,7 +1726,7 @@ export default create({
1691
1726
  if (this.tableOptions?.dataSourceType == 'guage') {
1692
1727
  tooltipTitle = item.alias || item.title;
1693
1728
  }
1694
- if (name && name !== tooltipTitle) {
1729
+ if (name&& tooltipTitle && name !== tooltipTitle) {
1695
1730
  isAlias = !!tooltipTitle;
1696
1731
  }
1697
1732
  if (type === 'format') return <text-over-tooltip refName={'item-' + item[this.handleRowId]} tooltipTitle={tooltipTitle} content={name} isAlias={isAlias} />;
@@ -1971,6 +2006,23 @@ export default create({
1971
2006
  field.indeterminate = !!len && len !== field.setting.showSetting.length;
1972
2007
  field.searchFilterText = '';
1973
2008
  },
2009
+ scanMultiOperate(params){
2010
+ return [
2011
+ <a-popconfirm ok-text={'确认'} cancel-text={'取消'} title={'是否确认删除?'} on-confirm={() =>this.confirmScanMulti(params)}>
2012
+ <svg-icon class="scan-multi-delete" iconClass="shanchu" />
2013
+ </a-popconfirm>
2014
+ ]
2015
+ },
2016
+ /**
2017
+ * 删除选中scan数据
2018
+ */
2019
+ confirmScanMulti(params){
2020
+ let{row, $rowIndex} = params || {}
2021
+ if(!row) return;
2022
+ this.$emit("scanMultiRemove", $rowIndex, params)
2023
+ let vxeTable = this.$refs.xGrid;
2024
+ vxeTable.remove(row);
2025
+ },
1974
2026
  // 表格渲染逻辑
1975
2027
  formatter(params, col) {
1976
2028
  let { row, column, $rowIndex } = params;
@@ -2065,7 +2117,7 @@ export default create({
2065
2117
  ];
2066
2118
  }
2067
2119
 
2068
- if (this.isLink(own, row)) {
2120
+ if (this.isLink(own, row) && !this.isScanMultiTable) {
2069
2121
  if (own.btnLinkSwitch) {
2070
2122
  let disabled = false;
2071
2123
  let curBtn = row.btnList?.find(v => v.name == own.columnName);
@@ -2225,14 +2277,14 @@ export default create({
2225
2277
  },
2226
2278
  // 行双击
2227
2279
  rowdblclick({ row, column }) {
2228
- if (this.isInlineOperating) return false;
2280
+ if (this.isScanMultiTable || this.isInlineOperating) return false;
2229
2281
  if (vexutils.has(row, GROUP_TITLE_KEY)) return false;
2230
2282
  this.$emit('setNestTableClick', this.isNestTable);
2231
2283
  this.$emit('rowdblclick', row, column, true, true);
2232
2284
  },
2233
2285
  // 行单击
2234
2286
  handlerClickRow(data) {
2235
- if (this.isInlineOperating) return false;
2287
+ if (this.isScanMultiTable || this.isInlineOperating) return false;
2236
2288
  if (vexutils.has(data?.row, GROUP_TITLE_KEY)) return false;
2237
2289
  if (this.isTriggerSelectionChange && this.isTree == 0) return false;
2238
2290
  let table = this.$refs.xGrid;
@@ -2242,7 +2294,7 @@ export default create({
2242
2294
  let { row, $event = {}, $rowIndex } = data;
2243
2295
  // 点击主表格展开行按钮 不需要触发选中行
2244
2296
  let { className } = $event.target || {};
2245
- if (className && className.includes('vxe-table--expand-btn')) return;
2297
+ if (className && vexutils.isString(className) && className.includes('vxe-table--expand-btn')) return;
2246
2298
 
2247
2299
  // 记录上次点击table信息 用于清除
2248
2300
  this.isAboutNestTable && this.$emit('setNestLastClickTable', table, this.isNestTable, row[this.handleRowId], row);
@@ -2812,7 +2864,10 @@ export default create({
2812
2864
  const config = tableOptions?.config || {};
2813
2865
  return config || undefined;
2814
2866
  },
2815
-
2867
+ tableNoSetting(){
2868
+ let { noSetting } = this.getOtherConfigInit() || {};
2869
+ return noSetting || this.showSettings?.hideSettingBtn == 1;
2870
+ },
2816
2871
  // 单选
2817
2872
  radioOnChange(rowData = {}) {
2818
2873
  let { data, row, $rowIndex } = rowData;
@@ -17,6 +17,7 @@ body {
17
17
  img {
18
18
  max-height: 100%;
19
19
  object-fit: contain;
20
+ cursor: pointer;
20
21
  }
21
22
  &.img-circle {
22
23
  img {
@@ -179,6 +180,10 @@ body {
179
180
  height: 100%;
180
181
  }
181
182
 
183
+ .scan-multi-delete {
184
+ color: #F06F64;
185
+ }
186
+
182
187
  .vxe-table--header {
183
188
  background-color: #f2f2f2;
184
189
  .vxe-header--column .vxe-cell--title {
@@ -1,7 +1,17 @@
1
1
  <template>
2
2
  <div class="text-over-tooltip-components">
3
- <a-tooltip :effect="effect" :disabled="isDisabledTooltip" :title="curContent" :placement="placement">
4
- <div class="ellipsis" :class="className" @mouseover="onMouseOver(refName)">
3
+ <a-tooltip
4
+ :effect="effect"
5
+ :visible="isDisabledTooltip"
6
+ :title="curContent"
7
+ :placement="placement"
8
+ >
9
+ <div
10
+ class="ellipsis"
11
+ :class="className"
12
+ @mouseover="onMouseOver(refName)"
13
+ @mouseout="onMouseOut"
14
+ >
5
15
  <i :ref="refName">
6
16
  <slot></slot>
7
17
  <i>{{ content }}</i>
@@ -12,10 +22,10 @@
12
22
  </template>
13
23
 
14
24
  <script>
15
- import { Tooltip } from 'ant-design-vue';
25
+ import { Tooltip } from "ant-design-vue";
16
26
  import vexutils from '@/utils/vexutils';
17
27
  export default {
18
- name: 'TextOverTooltip',
28
+ name: "TextOverTooltip",
19
29
  components: {
20
30
  [Tooltip.name]: Tooltip
21
31
  },
@@ -30,27 +40,27 @@ export default {
30
40
  effect: {
31
41
  type: String,
32
42
  default: () => {
33
- return 'dark';
43
+ return "dark";
34
44
  }
35
45
  },
36
46
  // Tooltip 的出现位置top/top-start/top-end/bottom/bottom-start/bottom-end/left/left-start/left-end/right/right-start/right-end
37
47
  placement: {
38
48
  type: String,
39
49
  default: () => {
40
- return 'top';
50
+ return "top";
41
51
  }
42
52
  },
43
- tooltipTitle: { type: [Number, String], default: '' },
53
+ tooltipTitle: { type: [Number, String], default: "" },
44
54
  isAlias: Boolean
45
55
  },
46
56
  data() {
47
57
  return {
48
- isDisabledTooltip: true // 是否需要禁止提示
58
+ isDisabledTooltip: false // 是否需要禁止提示
49
59
  };
50
60
  },
51
61
  computed: {
52
62
  curContent() {
53
- let res = this.tooltipTitle || this.content || '';
63
+ let res = this.tooltipTitle || this.content || "";
54
64
  if (vexutils.isNumber(res)) {
55
65
  return res.toString();
56
66
  }
@@ -67,7 +77,10 @@ export default {
67
77
  let parentWidth = this.$refs[str].parentNode.offsetWidth;
68
78
  let contentWidth = this.$refs[str].offsetWidth;
69
79
  // 判断是否禁用tooltip功能
70
- this.isDisabledTooltip = contentWidth <= parentWidth;
80
+ this.isDisabledTooltip = contentWidth > parentWidth;
81
+ },
82
+ onMouseOut() {
83
+ this.isDisabledTooltip = false;
71
84
  }
72
85
  }
73
86
  };
@@ -296,7 +296,7 @@ export default {
296
296
  * @returns
297
297
  */
298
298
  showEditForm(row, column, $rowIndex) {
299
- if (!this.isMatchComponent || this.isNestTable) return false;
299
+ if (!this.isMatchComponent || this.isNestTable || this.isScanMultiTable) return false;
300
300
  if (this.isBatchEditing || this.isInlineEditing || this.isInlineAdding) {
301
301
  let matchObj = this.editColumnMap[column.property];
302
302
  if (!matchObj || !matchObj.matchItem || !matchObj.fieldItem) return false;
@@ -76,7 +76,8 @@ const bigTableProps = {
76
76
  },
77
77
  submitForm: Function,
78
78
  isMatchComponent: Boolean,
79
- asyncCount: Boolean
79
+ asyncCount: Boolean,
80
+ showSettings: { type: Object, default: () => ({}) }
80
81
  };
81
82
 
82
83
  export default bigTableProps;
@@ -20,7 +20,7 @@
20
20
  </a-menu>
21
21
  <slot name="button" :handleClickPrintBtn="handleClickBtn" :printSpinning="spinning" :printbtnText="btnText" :printVisible="visible">
22
22
  <a-button class="dropdown-button" style="margin: 0 8px 8px 0" @click.stop="handleClickBtn">
23
- <a-icon v-if="spinning" type="loading" style="line-height: 10px;" />
23
+ <a-icon v-if="spinning" type="loading" style="line-height: 10px" />
24
24
  {{ btnText }}
25
25
  <a-icon type="down" />
26
26
  </a-button>
@@ -49,7 +49,6 @@ let httpFn = null;
49
49
  import Print from './js/print.es.min';
50
50
  import IdentityVerification from './components/IdentityVerification';
51
51
  import Clickoutside from '@/utils/clickoutside';
52
- import HisPrint from './mixin/his-print.js';
53
52
  import Vue from 'vue';
54
53
  import { Button, Dropdown, Menu, Icon } from 'ant-design-vue';
55
54
  import create from '@/core/create';
@@ -62,7 +61,6 @@ export default create({
62
61
  components: {
63
62
  IdentityVerification
64
63
  },
65
- mixins: [HisPrint],
66
64
  directives: { Clickoutside },
67
65
  props: {
68
66
  baseUrl: {
@@ -102,6 +100,9 @@ export default create({
102
100
  params: {
103
101
  type: Array
104
102
  },
103
+ hisParams: {
104
+ type: Object
105
+ },
105
106
  /* */
106
107
  prevFn: {
107
108
  type: Function,
@@ -164,10 +165,7 @@ export default create({
164
165
  };
165
166
  },
166
167
  beforeCreate() {
167
- Vue.use(Button)
168
- .use(Dropdown)
169
- .use(Menu)
170
- .use(Icon);
168
+ Vue.use(Button).use(Dropdown).use(Menu).use(Icon);
171
169
  },
172
170
  mounted() {
173
171
  this.isInited = false;
@@ -222,8 +220,7 @@ export default create({
222
220
  httpFn = axios.create({
223
221
  ...config
224
222
  });
225
-
226
- let formatListResult = await this.queryFormatList();
223
+ const formatListResult = await this.queryFormatList();
227
224
  if (this.versionType == 1) {
228
225
  this.initHIS(formatListResult);
229
226
  } else {
@@ -247,7 +244,6 @@ export default create({
247
244
  this.$message.error('获取打印格式失败,请联系管理员!');
248
245
  return this.requestError();
249
246
  }
250
-
251
247
  if (!this.currentFormatId) {
252
248
  this.requestError();
253
249
  return;
@@ -297,7 +293,6 @@ export default create({
297
293
  const { templateNumber, authorizationKey, baseUrl, getPrintFormatByNumberUrl, versionType } = this;
298
294
  const suffix = versionType == 1 ? `jsessionids=${vexutils.cookie.get('jsessionids') || '31e5fc0e-955f-4c89-9679-39c43d0171321636163291241'}` : `authorizationKey=${authorizationKey}`;
299
295
  const url = `${baseUrl}${getPrintFormatByNumberUrl}?number=${templateNumber}&${suffix}`;
300
-
301
296
  return httpFn
302
297
  .get(url)
303
298
  .then(async ({ data }) => {
@@ -439,7 +434,6 @@ export default create({
439
434
  },
440
435
  handleClickPrint(e) {
441
436
  e.domEvent.stopPropagation();
442
-
443
437
  let len = this.printParams.length;
444
438
  const callLocalServicesSuccessCb = async data => {
445
439
  try {
@@ -458,13 +452,29 @@ export default create({
458
452
  })
459
453
  .then(() => {
460
454
  if (this.versionType == 1) {
461
- this.handleHisPrint(7)
462
- .then(res => {
463
- console.log(res, '777777777777');
464
- })
465
- .catch(error => {
466
- console.log(error, 'error777');
467
- });
455
+ if (this.strategy === 'MULTI') {
456
+ for (let i = 0; i < this.params.length; i++) {
457
+ const params = this.getHisParams(i);
458
+ printInstance
459
+ .handleHisPrint(7, params)
460
+ .then(res => {
461
+ console.log(res, '777777777777');
462
+ })
463
+ .catch(error => {
464
+ console.log(error, 'error777');
465
+ });
466
+ }
467
+ } else {
468
+ const params = this.getOnceHisParams();
469
+ printInstance
470
+ .handleHisPrint(7, params)
471
+ .then(res => {
472
+ console.log(res, '777777777777');
473
+ })
474
+ .catch(error => {
475
+ console.log(error, 'error777');
476
+ });
477
+ }
468
478
  } else {
469
479
  if (this.strategy === 'MULTI') {
470
480
  // 循环多条
@@ -497,6 +507,36 @@ export default create({
497
507
  this.visible = false;
498
508
  });
499
509
  },
510
+ getHisParams(index = 0) {
511
+ const { templateParams, hisParams, params } = this;
512
+ const { reportid = '280' } = hisParams;
513
+ const { id, name } = templateParams;
514
+ return {
515
+ reportid,
516
+ formatid: id,
517
+ formatname: name,
518
+ param: params[index]
519
+ };
520
+ },
521
+ getOnceHisParams() {
522
+ const { templateParams, hisParams, params } = this;
523
+ const { reportid = '280' } = hisParams;
524
+ const { id, name } = templateParams;
525
+ const obj = {}
526
+ Object.keys(params[0]).forEach(v => {
527
+ obj[v] = [];
528
+ params.forEach(k => {
529
+ obj[v].push(k[v]);
530
+ });
531
+ obj[v] = obj[v].join(',');
532
+ });
533
+ return {
534
+ reportid,
535
+ formatid: id,
536
+ formatname: name,
537
+ param: obj
538
+ };
539
+ },
500
540
  async handleClickPreview(e) {
501
541
  e.domEvent.stopPropagation();
502
542
 
@@ -507,7 +547,9 @@ export default create({
507
547
  })
508
548
  .then(() => {
509
549
  if (this.versionType == 1) {
510
- this.handleHisPrint(8)
550
+ const params = this.strategy === 'MULTI' ? this.getHisParams() : this.getOnceHisParams();
551
+ printInstance
552
+ .handleHisPrint(8, params)
511
553
  .then(res => {
512
554
  console.log(res, 88888888);
513
555
  })
@@ -544,7 +586,9 @@ export default create({
544
586
  })
545
587
  .then(() => {
546
588
  if (this.versionType == 1) {
547
- this.handleHisPrint(9)
589
+ const params = this.strategy === 'MULTI' ? this.getHisParams() : this.getOnceHisParams();
590
+ printInstance
591
+ .handleHisPrint(9, params)
548
592
  .then(res => {
549
593
  console.log(res, 999999);
550
594
  })