cnhis-design-vue 2.1.23 → 2.1.24

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": "cnhis-design-vue",
3
- "version": "2.1.23",
3
+ "version": "2.1.24",
4
4
  "description": "前端业务UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -136,7 +136,12 @@ export default create({
136
136
  default: () => ({})
137
137
  },
138
138
  // 1 为his老版,2 为新版 3为his更老版本
139
- versionType: { type: [Number, String], default: '2' }
139
+ versionType: { type: [Number, String], default: '2' },
140
+ // 用于获取用户信息的token
141
+ token: {
142
+ type: String,
143
+ default: ''
144
+ }
140
145
  },
141
146
  computed: {
142
147
  currentFormatItem() {
@@ -166,14 +171,17 @@ export default create({
166
171
  };
167
172
  },
168
173
  beforeCreate() {
169
- Vue.use(Button).use(Dropdown).use(Menu).use(Icon);
174
+ Vue.use(Button)
175
+ .use(Dropdown)
176
+ .use(Menu)
177
+ .use(Icon);
170
178
  },
171
179
  mounted() {
172
180
  this.isInited = false;
173
181
  },
174
182
  beforeDestroy() {
175
183
  // 创建Print实例的时候会在webview中注册一个事件, 需要调用printInstance.destroy()手动清除
176
- printInstance?.destroy?.()
184
+ printInstance?.destroy?.();
177
185
  },
178
186
  watch: {
179
187
  // 监听变化, 重新格式化printParams
@@ -409,7 +417,10 @@ export default create({
409
417
  /* */
410
418
  getPrintParams(index = 0) {
411
419
  const params = this.printParams[index];
412
- return JSON.stringify(params);
420
+ return JSON.stringify({
421
+ ...(params || {}),
422
+ ...(this.token ? { token: this.token } : {})
423
+ });
413
424
  },
414
425
  getTemplateIdByFormatId(id) {
415
426
  let find = this.formatList.find(item => item.id === id);
@@ -460,7 +471,7 @@ export default create({
460
471
  })
461
472
  .then(() => {
462
473
  if (this.versionType == 1 || this.versionType == 3) {
463
- const printFn = this.versionType == 1 ? 'handleHisPrint' : 'handleOldHisPrint'
474
+ const printFn = this.versionType == 1 ? 'handleHisPrint' : 'handleOldHisPrint';
464
475
  if (this.strategy === 'MULTI') {
465
476
  for (let i = 0; i < this.params.length; i++) {
466
477
  const params = this.getHisParams(i);
@@ -529,7 +540,7 @@ export default create({
529
540
  const { templateParams, hisParams, params } = this;
530
541
  const { reportid = '280' } = hisParams;
531
542
  const { id, name } = templateParams;
532
- const obj = {}
543
+ const obj = {};
533
544
  Object.keys(params[0]).forEach(v => {
534
545
  obj[v] = [];
535
546
  params.forEach(k => {
@@ -555,7 +566,7 @@ export default create({
555
566
  .then(() => {
556
567
  if (this.versionType == 1 || this.versionType == 3) {
557
568
  const params = this.strategy === 'MULTI' ? this.getHisParams() : this.getOnceHisParams();
558
- const printFn = this.versionType == 1 ? 'handleHisPrint' : 'handleOldHisPrint'
569
+ const printFn = this.versionType == 1 ? 'handleHisPrint' : 'handleOldHisPrint';
559
570
  printInstance[printFn](8, params)
560
571
  .then(res => {
561
572
  console.log(res, 88888888);
@@ -565,7 +576,7 @@ export default create({
565
576
  });
566
577
  } else {
567
578
  const IS_MULTI = this.strategy === 'MULTI';
568
- if(IS_MULTI){
579
+ if (IS_MULTI) {
569
580
  // 循环多条
570
581
  for (let i = 0; i < this.printParams.length; i++) {
571
582
  const queryParams = {
@@ -574,26 +585,26 @@ export default create({
574
585
  params: this.getPrintParams(i)
575
586
  };
576
587
  printInstance.preview(
577
- queryParams,
578
- res => {
579
- this.callLocalServicesSuccessCb(res, 'preview');
580
- },
581
- this.callLocalServicesErrorCb
582
- );
588
+ queryParams,
589
+ res => {
590
+ this.callLocalServicesSuccessCb(res, 'preview');
591
+ },
592
+ this.callLocalServicesErrorCb
593
+ );
583
594
  }
584
595
  } else {
585
- const queryParams = {
586
- formatId: this.currentFormatId,
587
- templateId: this.getTemplateIdByFormatId(this.currentFormatId),
588
- params: this.getOnceParams()
589
- };
590
- printInstance.preview(
591
- queryParams,
592
- res => {
593
- this.callLocalServicesSuccessCb(res, 'preview');
594
- },
595
- this.callLocalServicesErrorCb
596
- );
596
+ const queryParams = {
597
+ formatId: this.currentFormatId,
598
+ templateId: this.getTemplateIdByFormatId(this.currentFormatId),
599
+ params: this.getOnceParams()
600
+ };
601
+ printInstance.preview(
602
+ queryParams,
603
+ res => {
604
+ this.callLocalServicesSuccessCb(res, 'preview');
605
+ },
606
+ this.callLocalServicesErrorCb
607
+ );
597
608
  }
598
609
  }
599
610
  })
@@ -612,7 +623,7 @@ export default create({
612
623
  .then(() => {
613
624
  if (this.versionType == 1 || this.versionType == 3) {
614
625
  const params = this.strategy === 'MULTI' ? this.getHisParams() : this.getOnceHisParams();
615
- const printFn = this.versionType == 1 ? 'handleHisPrint' : 'handleOldHisPrint'
626
+ const printFn = this.versionType == 1 ? 'handleHisPrint' : 'handleOldHisPrint';
616
627
  printInstance[printFn](9, params)
617
628
  .then(res => {
618
629
  console.log(res, 999999);
@@ -669,12 +680,12 @@ export default create({
669
680
  /**
670
681
  * 获取 axios 自定义配置
671
682
  */
672
- getCustomCofing(customCofing){
673
- let cCofing = {}
683
+ getCustomCofing(customCofing) {
684
+ let cCofing = {};
674
685
  let type = typeof customCofing;
675
- if(type === 'function'){
686
+ if (type === 'function') {
676
687
  cCofing = customCofing();
677
- } else if(type === 'object'){
688
+ } else if (type === 'object') {
678
689
  cCofing = customCofing;
679
690
  }
680
691
  return cCofing;
@@ -5,10 +5,23 @@
5
5
  <!-- 行内编辑对应生成的(保存、取消)按钮 -->
6
6
  <template v-if="visibleInlineOperateBtn">
7
7
  <div class="btn-custom-wrap">
8
- <a-button v-preventReClick="preventReTime" :style="{ display: isInlineOperating ? 'inline-block' : 'none' }" @click="inlineEditClick" class="btn-custom-class" style="margin: 8px 8px 8px 0" type="primary">
8
+ <a-button
9
+ v-preventReClick="preventReTime"
10
+ :style="{ display: isInlineOperating ? 'inline-block' : 'none' }"
11
+ @click="inlineEditClick"
12
+ class="btn-custom-class"
13
+ style="margin: 8px 8px 8px 0"
14
+ type="primary"
15
+ >
9
16
  保存
10
17
  </a-button>
11
- <a-button v-preventReClick="preventReTime" :style="{ display: isInlineOperating ? 'inline-block' : 'none' }" @click="inlineEditCancel" class="btn-custom-class" style="margin: 8px 8px 8px 0">
18
+ <a-button
19
+ v-preventReClick="preventReTime"
20
+ :style="{ display: isInlineOperating ? 'inline-block' : 'none' }"
21
+ @click="inlineEditCancel"
22
+ class="btn-custom-class"
23
+ style="margin: 8px 8px 8px 0"
24
+ >
12
25
  取消
13
26
  </a-button>
14
27
  </div>
@@ -63,14 +76,11 @@
63
76
  @pressEnter="outFilterChange"
64
77
  class="input-search-com"
65
78
  >
66
- <template slot="prefix" v-if="showPlaceholderPrefix">
67
- <a-tooltip
68
- :title="searchPlaceHolder"
69
- overlayClassName="basesearch-placeholder-tooltip"
70
- >
71
- <a-icon type="info-circle" class="search-placeholder-icon" />
72
- </a-tooltip>
73
- </template>
79
+ <template slot="prefix" v-if="showPlaceholderPrefix">
80
+ <a-tooltip :title="searchPlaceHolder" overlayClassName="basesearch-placeholder-tooltip">
81
+ <a-icon type="info-circle" class="search-placeholder-icon" />
82
+ </a-tooltip>
83
+ </template>
74
84
  </a-input>
75
85
  </template>
76
86
  <a-input-search
@@ -83,11 +93,8 @@
83
93
  :value="currentValue"
84
94
  @input="$emit('input', $event.target.value)"
85
95
  >
86
- <template slot="prefix" v-if="showPlaceholderPrefix">
87
- <a-tooltip
88
- :title="searchPlaceHolder"
89
- overlayClassName="basesearch-placeholder-tooltip"
90
- >
96
+ <template slot="prefix" v-if="showPlaceholderPrefix">
97
+ <a-tooltip :title="searchPlaceHolder" overlayClassName="basesearch-placeholder-tooltip">
91
98
  <a-icon type="info-circle" class="search-placeholder-icon" />
92
99
  </a-tooltip>
93
100
  </template>
@@ -201,7 +208,7 @@
201
208
  <li ref="rowTileBtnItem" class="rowTileBtn-item 123" :key="item.sid" v-if="showLi(item)" :data-key="item.sid" data-source="rowTile">
202
209
  <template v-if="item.type == 'ADD' || item.type == 'BATCH'">
203
210
  <a-button
204
- v-preventReClick="preventReTime"
211
+ v-preventReClick="preventReTime"
205
212
  v-show="visibleBtn(item) && !item.isHide"
206
213
  @click.prevent.stop="showDrawer(item, j)"
207
214
  class="btn-custom-class"
@@ -233,7 +240,7 @@
233
240
  </template>
234
241
  <template v-else-if="isShowRowTileBtnItem(item)">
235
242
  <a-button
236
- v-preventReClick="preventReTime"
243
+ v-preventReClick="preventReTime"
237
244
  v-show="visibleBtn(item) && !item.isHide"
238
245
  @click.prevent.stop="clickBtn(clickRowData, item, clickRowData.my_index, undefined, j)"
239
246
  class="btn-custom-class"
@@ -255,6 +262,7 @@
255
262
  <li ref="rowTileBtnItem" class="rowTileBtn-item rowPrintBtn-btn" :key="item.sid" v-if="showLi(item)" :data-key="item.sid" data-source="rowTile">
256
263
  <template v-if="item.isVisible && !item.isHide">
257
264
  <PrintBtn
265
+ v-bind="$attrs"
258
266
  :printConfig="printConfig"
259
267
  :baseUrl="printConfig.printBaseUrl"
260
268
  :strategy="item.strategy"
@@ -418,14 +426,15 @@ const BTNOBJ = {
418
426
  export default create({
419
427
  name: 'base-search',
420
428
  mixins: [durationMixin, $utils, filterApiFn, tableSearchCon, outQuickSearchFn],
421
- directives: { resize,preventReClick },
429
+ directives: { resize, preventReClick },
422
430
  props: {
423
431
  width: {
424
432
  default: '400px'
425
433
  },
426
- searchInputWidth:{ // 设置检索框的宽度
434
+ searchInputWidth: {
435
+ // 设置检索框的宽度
427
436
  type: Number,
428
- default:0
437
+ default: 0
429
438
  },
430
439
  onSearch: Function,
431
440
  rowBtnList: {
@@ -568,7 +577,7 @@ export default create({
568
577
  useFieldList: Array,
569
578
  editTableUid: [String, Number],
570
579
 
571
- preventReTime:{
580
+ preventReTime: {
572
581
  type: Number,
573
582
  default: 1000
574
583
  }
@@ -742,41 +751,41 @@ export default create({
742
751
  showOutSearch() {
743
752
  return this.outSearchFieldList?.length || this.outRelationQuickSearch?.length;
744
753
  },
745
- showViewList(){
746
- if (this.editTableSource === "relatedComponent") {
747
- return this.relatedBaseInfo.showType != "TREE";
754
+ showViewList() {
755
+ if (this.editTableSource === 'relatedComponent') {
756
+ return this.relatedBaseInfo.showType != 'TREE';
748
757
  }
749
758
  return !this.optionsValue('hideViewList');
750
759
  },
751
760
  optionsValue() {
752
761
  return function(key) {
753
762
  return this.$attrs.tableOptions?.[key];
754
- }
763
+ };
755
764
  },
756
765
  searchPlaceHolder() {
757
- if (!this.useFieldList?.length || this.showRelatedTreeBtn) return "请输入关键字搜索";
758
- let str = "";
766
+ if (!this.useFieldList?.length || this.showRelatedTreeBtn) return '请输入关键字搜索';
767
+ let str = '';
759
768
  let strList = this.useFieldList
760
769
  ?.map(item => {
761
- if (item.isSearch != 1) return "";
770
+ if (item.isSearch != 1) return '';
762
771
  return item.formTitle || item.alias || item.title;
763
772
  })
764
773
  .filter(Boolean);
765
- if(!strList?.length) return ''
766
- str = "输入" + strList.join("/");
767
- return str || "请输入关键字搜索";
774
+ if (!strList?.length) return '';
775
+ str = '输入' + strList.join('/');
776
+ return str || '请输入关键字搜索';
768
777
  },
769
778
  showRelatedSearch() {
770
- return this.showRelatedTreeBtn && this.isShowSetting('hideSearch')
779
+ return this.showRelatedTreeBtn && this.isShowSetting('hideSearch');
771
780
  },
772
781
  showQuickSearch() {
773
- let showQuick = this.isShowSetting('hideQuickSearch')
782
+ let showQuick = this.isShowSetting('hideQuickSearch');
774
783
  // 平铺列表, 左侧不为tree, 而是table
775
- if(this.editTableSource == 'relatedComponent' && this.relatedBaseInfo?.showType != "TREE") return showQuick
776
- return showQuick && this.isRelatedSearchFold
784
+ if (this.editTableSource == 'relatedComponent' && this.relatedBaseInfo?.showType != 'TREE') return showQuick;
785
+ return showQuick && this.isRelatedSearchFold;
777
786
  },
778
787
  showBaseTabs() {
779
- return this.conditionType === 'keyword' && this.tabConditionList?.length && !this.visibleInlineOperateBtn && !this.isRowEditing
788
+ return this.conditionType === 'keyword' && this.tabConditionList?.length && !this.visibleInlineOperateBtn && !this.isRowEditing;
780
789
  }
781
790
  },
782
791
  data() {
@@ -1061,17 +1070,17 @@ export default create({
1061
1070
  'div',
1062
1071
  {
1063
1072
  directives: [
1064
- {
1065
- name: 'drag-move',
1066
- value: {
1067
- target: 'ant-modal-confirm-body'
1068
- }
1073
+ {
1074
+ name: 'drag-move',
1075
+ value: {
1076
+ target: 'ant-modal-confirm-body'
1069
1077
  }
1070
- ],
1071
- domProps: {
1072
- innerHTML: settingObj.tipsMsg || `是否确认${btn.name}`
1078
+ }
1079
+ ],
1080
+ domProps: {
1081
+ innerHTML: settingObj.tipsMsg || `是否确认${btn.name}`
1082
+ }
1073
1083
  }
1074
- },
1075
1084
  // settingObj.tipsMsg || `是否确认${btn.name}`
1076
1085
  ),
1077
1086
  okText: '确定',
@@ -1155,7 +1164,7 @@ export default create({
1155
1164
  let paramsData = utils.setParamsValue(params, this.paramsData);
1156
1165
  Object.assign(btn, {
1157
1166
  _index_: j
1158
- })
1167
+ });
1159
1168
  let btnData = {
1160
1169
  btnData: Object.assign(setData, {
1161
1170
  paramsData: paramsData,
@@ -1217,8 +1226,8 @@ export default create({
1217
1226
  return;
1218
1227
  }
1219
1228
  Object.assign(item, {
1220
- _index_: j,
1221
- })
1229
+ _index_: j
1230
+ });
1222
1231
  this.$emit('clickBtn', data, item, index);
1223
1232
  },
1224
1233
  clickGroupBtn(btn, j) {
@@ -1584,7 +1593,7 @@ export default create({
1584
1593
  this.$emit('pubResetCheckStatus');
1585
1594
  },
1586
1595
  handleReset() {
1587
- this.$emit('handleReset',{targetType: "outQuickSearchReset" });
1596
+ this.$emit('handleReset', { targetType: 'outQuickSearchReset' });
1588
1597
  },
1589
1598
  handleUploadChange(info) {
1590
1599
  const { file, fileList } = info;
@@ -1672,7 +1681,7 @@ export default create({
1672
1681
  initOutSearchFieldList(config = {}) {
1673
1682
  this.outSearchFieldList = [];
1674
1683
  this.outRelationQuickSearch = [];
1675
- let mySearchFieldList = JSON.parse(JSON.stringify(this.searchFieldList)).filter(i => (i.random_key = this.getFiledRandom_key(i), i.isShowSearch == 1 && i.filterExplicit == 1));
1684
+ let mySearchFieldList = JSON.parse(JSON.stringify(this.searchFieldList)).filter(i => ((i.random_key = this.getFiledRandom_key(i)), i.isShowSearch == 1 && i.filterExplicit == 1));
1676
1685
  this.outSearchFieldList = mySearchFieldList;
1677
1686
  // 跨表
1678
1687
  let outRelationQuickSearch = this.relationTableList.map(item => {
@@ -1704,10 +1713,10 @@ export default create({
1704
1713
  }
1705
1714
 
1706
1715
  // 如有配置默认值
1707
- if(this.outSearchFieldList.some(v => !!v.explicitDefaultVal)){
1716
+ if (this.outSearchFieldList.some(v => !!v.explicitDefaultVal)) {
1708
1717
  this.$emit('outSearchInit');
1709
- if('reset' != config?.type){
1710
- this.outFilterChange({type:'outSearchInit'});
1718
+ if ('reset' != config?.type) {
1719
+ this.outFilterChange({ type: 'outSearchInit' });
1711
1720
  }
1712
1721
  }
1713
1722
  },
@@ -1745,7 +1754,7 @@ export default create({
1745
1754
  this.rowFoldHideBtnList = hideBtn;
1746
1755
  }
1747
1756
  },
1748
- outFilterChange(config= {}) {
1757
+ outFilterChange(config = {}) {
1749
1758
  let conObj = this.getConObjParams() || [];
1750
1759
  this.onSave(conObj, true, config);
1751
1760
  },
@@ -1856,7 +1865,7 @@ export default create({
1856
1865
  };
1857
1866
  });
1858
1867
  let len = list?.length || 0;
1859
- if(len > 0){
1868
+ if (len > 0) {
1860
1869
  this.setPrintNumberCache({
1861
1870
  ids,
1862
1871
  list
@@ -1957,35 +1966,32 @@ export default create({
1957
1966
  onOk: () => {
1958
1967
  _this.setBatchSaveRowStatus(true);
1959
1968
  },
1960
- onCancel() {
1961
- }
1969
+ onCancel() {}
1962
1970
  });
1963
1971
  },
1964
1972
 
1965
1973
  /**
1966
1974
  * 获取外显检索的默认值设置
1967
1975
  */
1968
- handleGetOutSearchInitValue(){
1969
-
1970
- if(this.outSearchFieldList.some(v => !!v.explicitDefaultVal)){
1976
+ handleGetOutSearchInitValue() {
1977
+ if (this.outSearchFieldList.some(v => !!v.explicitDefaultVal)) {
1971
1978
  let conObj = this.getConObjParams() || [];
1972
- return conObj
1973
- }
1979
+ return conObj;
1980
+ }
1974
1981
 
1975
- return []
1982
+ return [];
1976
1983
  },
1977
1984
 
1978
- getFiledRandom_key(el){
1985
+ getFiledRandom_key(el) {
1979
1986
  // 初始化
1980
- const showSetting = el?.settingObj?.showSetting || [];
1981
- let f = !this.$utils.isEmpty(el?.settingObj?.wordbook);
1982
- if(!showSetting?.length && f){
1983
- return Math.random().toString()
1984
- }
1985
- return '11'
1987
+ const showSetting = el?.settingObj?.showSetting || [];
1988
+ let f = !this.$utils.isEmpty(el?.settingObj?.wordbook);
1989
+ if (!showSetting?.length && f) {
1990
+ return Math.random().toString();
1991
+ }
1992
+ return '11';
1986
1993
  },
1987
1994
 
1988
-
1989
1995
  inlineEditCancel() {
1990
1996
  this.setBatchCancelRowStatus(true);
1991
1997
  },
@@ -2039,10 +2045,10 @@ export default create({
2039
2045
  this.currentTempId = curItem || '0';
2040
2046
 
2041
2047
  // 按钮打卡视图列表
2042
- let tableViewId= this.optionsValue('tableViewId')
2043
- let onlyOpenView = this.optionsValue('hideViewList') && tableViewId
2044
- if(onlyOpenView) {
2045
- this.currentTempId = tableViewId
2048
+ let tableViewId = this.optionsValue('tableViewId');
2049
+ let onlyOpenView = this.optionsValue('hideViewList') && tableViewId;
2050
+ if (onlyOpenView) {
2051
+ this.currentTempId = tableViewId;
2046
2052
  }
2047
2053
  // this.handlerSelectTemp(this.currentTempId);
2048
2054
  this.$emit('handlerChangeView', this.currentTempId);
@@ -2117,12 +2123,12 @@ export default create({
2117
2123
  this.$nextTick(() => {
2118
2124
  this.showPlaceholderPrefix = false;
2119
2125
  let dom = this.$refs.baseSearchPlaceholderSpan;
2120
- if(!dom) return;
2126
+ if (!dom) return;
2121
2127
  // input 框有padding 32px ...显示需要多预留一些宽度12px
2122
2128
  let w = dom.offsetWidth + 45;
2123
2129
  // 非筛选外显input 有enterButton 预留宽度
2124
- if(!this.showOutSearch) {
2125
- w += 45
2130
+ if (!this.showOutSearch) {
2131
+ w += 45;
2126
2132
  }
2127
2133
  let maxW = 300;
2128
2134
  this.inputSearchW = w > maxW ? maxW : w < 200 ? 200 : w;