n20-common-lib 3.0.20 → 3.0.21

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": "n20-common-lib",
3
- "version": "3.0.20",
3
+ "version": "3.0.21",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -368,7 +368,9 @@ export default {
368
368
  ruleErrorHide: item.ruleErrorHide,
369
369
  rules: item.rules,
370
370
  readonly: item.type === 'search',
371
- placeholder: item.props && item.props.placeholder ? item.props.placeholder : $lc('请输入')
371
+ placeholder: item.props && item.props.placeholder ? item.props.placeholder : $lc('请输入'),
372
+ maxlength: item.props && item.props.maxlength,
373
+ minlength: item.props && item.props.minlength
372
374
  },
373
375
 
374
376
  directives: [
@@ -792,7 +794,9 @@ export default {
792
794
  'rule-form': 'ruleValidate',
793
795
  rules: item.rules,
794
796
  ruleErrorHide: item.ruleErrorHide,
795
- placeholder: item.props && item.props.placeholder ? item.props.placeholder : $lc('请输入')
797
+ placeholder: item.props && item.props.placeholder ? item.props.placeholder : $lc('请输入'),
798
+ maxlength: item.props && item.props.maxlength,
799
+ minlength: item.props && item.props.minlength
796
800
  },
797
801
  on: {
798
802
  blur: this.handleBlur,
@@ -4,6 +4,7 @@
4
4
  v-if="position !== 'right'"
5
5
  :nav-list="navList"
6
6
  :activit="value"
7
+ :use-slot-in-nav="useSlotInNav"
7
8
  :style="{ width: navWidth }"
8
9
  class="left-side"
9
10
  :class="{ 'top-css': position === 'top' }"
@@ -16,6 +17,7 @@
16
17
  v-if="position === 'right'"
17
18
  :nav-list="navList"
18
19
  :activit="value"
20
+ :use-slot-in-nav="useSlotInNav"
19
21
  :style="{ width: navWidth, marginLeft: '10px' }"
20
22
  @click="activitFn"
21
23
  />
@@ -49,6 +51,10 @@ export default {
49
51
  navWidth: {
50
52
  type: String,
51
53
  default: '110px'
54
+ },
55
+ useSlotInNav: {
56
+ type: Boolean,
57
+ default: true
52
58
  }
53
59
  },
54
60
  data() {
@@ -8,11 +8,15 @@ export default {
8
8
  activit: {
9
9
  type: [String, Number],
10
10
  default: undefined
11
+ },
12
+ useSlotInNav: {
13
+ type: Boolean,
14
+ default: false
11
15
  }
12
16
  },
13
17
  render() {
14
18
  let _vm = this
15
- let { navList, activit, _c, _l, _v, _s } = _vm
19
+ let { navList, activit, useSlotInNav, _c, _l, _v, _s } = _vm
16
20
 
17
21
  return _c(
18
22
  'div',
@@ -30,7 +34,7 @@ export default {
30
34
  }
31
35
  }
32
36
  },
33
- item.slotT ? item.slotT : [_v(_s(item.title))]
37
+ useSlotInNav && item.slotT ? item.slotT : [_v(_s(item.title))]
34
38
  )
35
39
  }),
36
40
  0
@@ -184,7 +184,7 @@
184
184
  <el-button v-if="authList.includes('approval') && nextApproval && nextBtn" type="primary" @click="approvalNext">
185
185
  {{ btnsNames['approval'] }}{{ '并审批下一条' | $lc }}</el-button
186
186
  >
187
- <el-button v-if="showApprovalTo" type="primary" @click="approvalToV = true"
187
+ <el-button v-if="showApprovalTo && showApproveTo" type="primary" @click="approvalToV = true"
188
188
  >{{ btnsNames['approval'] }}{{ '至' | $lc }}</el-button
189
189
  >
190
190
  <el-button v-if="authList.includes('rejectTo')" plain @click="rejectToB">{{ btnsNames['rejectTo'] }}</el-button>
@@ -459,6 +459,8 @@ export default {
459
459
  data() {
460
460
  this.msgisSync = !!this.$listeners['update:message']
461
461
  return {
462
+ // 是否显示批准至(读取门户配置)
463
+ showApproveTo: true,
462
464
  attributes: undefined,
463
465
  isWyfk: false,
464
466
  nextEgwOutgoingNodeId: undefined,
@@ -512,7 +514,7 @@ export default {
512
514
  pass: this.$l('通过'),
513
515
  refuse: this.$l('拒绝'),
514
516
  takeOff: this.$l('请假'),
515
- reject: this.$l('驳回至发起人'),
517
+ reject: this.$l('驳回至申请人'),
516
518
  rejectPre: this.$l('驳回至上一节点'),
517
519
  approval: this.$l('批 准'),
518
520
  discard: this.$l('作 废'),
@@ -646,8 +648,9 @@ export default {
646
648
  // 意见是否必填
647
649
  getConfiguration() {
648
650
  getJsonc('portal/server-config.jsonc', null, true)
649
- .then(({ opinionRequired }) => {
651
+ .then(({ opinionRequired, showApproveTo }) => {
650
652
  this.requiredC = opinionRequired ?? this.required
653
+ this.showApproveTo = showApproveTo ?? true
651
654
  // 读取该工作流是否意见必填
652
655
  if (this.$route.query.remarkIsMust !== undefined) {
653
656
  this.requiredC = this.$route.query.remarkIsMust === '1'
@@ -738,9 +741,10 @@ export default {
738
741
  }
739
742
  })
740
743
  },
741
- // 获取是否显示驳回至按钮
744
+ // 获取是否显示驳回至批准按钮
742
745
  getShowApprovalTo() {
743
746
  if (this.showBtn && this.$route.query.state === '2') {
747
+ // 再读一个开关 false false
744
748
  axios
745
749
  .get(`/bems/activiti/sample/getTaskMoveVos/${this.$route.query.taskId}/1`, null, {
746
750
  noMsg: true
@@ -904,7 +908,7 @@ export default {
904
908
  if (!this.showFlowDialog) {
905
909
  this.beforeFn(this.beforeReject, () => {
906
910
  axios.post('/bems/activiti/admin/todo/reject', this.getParam()).then(({ data }) => {
907
- this.thenMsg(data, this.authList.includes('refuse') ? $lc('拒绝') : $lc('驳回至发起人'))
911
+ this.thenMsg(data, this.authList.includes('refuse') ? $lc('拒绝') : $lc('驳回至申请人'))
908
912
  })
909
913
  })
910
914
  }
@@ -913,7 +917,7 @@ export default {
913
917
  this.showFlowDialog = false
914
918
  this.beforeFn(this.beforeReject, () => {
915
919
  axios.post('/bems/activiti/admin/todo/reject', this.getParam()).then(({ data }) => {
916
- this.thenMsg(data, $lc('驳回至发起人'))
920
+ this.thenMsg(data, $lc('驳回至申请人'))
917
921
  })
918
922
  })
919
923
  },
@@ -13,7 +13,7 @@
13
13
  <div v-for="(item, i) in otherAttData" :key="i" class="flex-box flex-v" style="width: 100%; padding: 0 20px">
14
14
  <el-form-item
15
15
  class="m-r-ss m-b-s"
16
- label-width="210px"
16
+ :label-width="labelWidth"
17
17
  :class="item.cfgHasRemark === '1' ? 'flex-auto' : 'flex-1'"
18
18
  :label="item.cfgName"
19
19
  >
@@ -110,6 +110,10 @@
110
110
  import axios from '../../utils/axios'
111
111
  export default {
112
112
  props: {
113
+ labelWidth: {
114
+ type: String,
115
+ default: '12em'
116
+ },
113
117
  taskId: {
114
118
  type: [String, Number],
115
119
  default: ''
@@ -300,7 +300,7 @@ export default {
300
300
  this.svgW.querySelector(`[data-element-id="${from}"]`).classList.add('activiti-node-reject')
301
301
  if (type === '1') {
302
302
  this.svgW.querySelector(`[data-element-id="${to}"]`).classList.add('activiti-node-reject')
303
- this.setRejectLink(from, to, $lc('驳回至发起人'))
303
+ this.setRejectLink(from, to, $lc('驳回至申请人'))
304
304
  } else if (type === '2') {
305
305
  this.setRejectLink(from, to, $lc('驳回至上一步'))
306
306
  } else if (type === '3') {
@@ -346,7 +346,7 @@ export default {
346
346
  this.svgW.querySelector(`[data-element-id="${from}"]`).classList.add('activiti-node-reject')
347
347
  if (type === '1') {
348
348
  this.svgW.querySelector(`[data-element-id="${to}"]`).classList.add('activiti-node-reject')
349
- this.setRejectLink(from, to, $lc('驳回至发起人'))
349
+ this.setRejectLink(from, to, $lc('驳回至申请人'))
350
350
  } else if (type === '2') {
351
351
  this.setRejectLink(from, to, $lc('驳回至上一步'))
352
352
  } else if (type === '3') {
@@ -16,8 +16,9 @@
16
16
  <el-button size="mini" plain @click="batchPrint">{{ '批量打印' | $lc }}</el-button>
17
17
  </slot>
18
18
  <slot name="down-btn">
19
- <el-button size="mini" plain @click="downRows">{{ '下载' | $lc }}</el-button>
19
+ <el-button v-if="showDownLoadBtn" size="mini" plain @click="downRows">{{ '下载' | $lc }}</el-button>
20
20
  </slot>
21
+ <slot name="other-btn"></slot>
21
22
  <slot v-if="!readonly" name="delete-btn">
22
23
  <el-button type="danger" plain size="mini" @click="deleteRows">{{ '删除' | $lc }}</el-button>
23
24
  </slot>
@@ -209,7 +210,7 @@
209
210
  @click="AiFn(row)"
210
211
  />
211
212
  <el-button
212
- v-if="readonly"
213
+ v-if="readonly && showDownLoadBtn"
213
214
  type="text"
214
215
  icon="el-icon-download"
215
216
  :disabled="!row[keys.url]"
@@ -377,10 +378,8 @@ export default {
377
378
  }
378
379
  },
379
380
  props: {
380
- AICheck: {
381
- type: Boolean,
382
- default: false
383
- },
381
+ showDownLoadBtn: { type: Boolean, default: true },
382
+ AICheck: {},
384
383
  AIOptions: {
385
384
  type: Object,
386
385
  default: () => ({})
@@ -1,6 +1,6 @@
1
- <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="design-iconfont">
2
- <path d="M8.24182 3.58716L11.2487 8.99438V6.31665H13.3151V12.9797L11.3785 13.4827L7.3219 6.18677L4.3512 11.3323H8.37366V13.3997H2.56018L1.66565 11.8499L6.44397 3.57349L8.24182 3.58716Z" fill="#007AFF"/>
3
- <path d="M12.2593 1.66284L12.7877 3.21041L14.3353 3.73888L12.7877 4.26736L12.2593 5.81492L11.7308 4.26736L10.1832 3.73888L11.7308 3.21041L12.2593 1.66284Z" fill="#007AFF"/>
4
- <path d="M2.32765 3.57349L2.68419 4.61759L3.72829 4.97413L2.68419 5.33068L2.32765 6.37478L1.9711 5.33068L0.927002 4.97413L1.9711 4.61759L2.32765 3.57349Z" fill="#007AFF"/>
5
- <path d="M9.83558 13.011L10.0044 13.5053L10.4987 13.6741L10.0044 13.8429L9.83558 14.3372L9.66679 13.8429L9.17249 13.6741L9.66679 13.5053L9.83558 13.011Z" fill="#007AFF"/>
6
- </svg>
1
+ <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="design-iconfont">
2
+ <path d="M8.24182 3.58716L11.2487 8.99438V6.31665H13.3151V12.9797L11.3785 13.4827L7.3219 6.18677L4.3512 11.3323H8.37366V13.3997H2.56018L1.66565 11.8499L6.44397 3.57349L8.24182 3.58716Z" fill="#007AFF"/>
3
+ <path d="M12.2593 1.66284L12.7877 3.21041L14.3353 3.73888L12.7877 4.26736L12.2593 5.81492L11.7308 4.26736L10.1832 3.73888L11.7308 3.21041L12.2593 1.66284Z" fill="#007AFF"/>
4
+ <path d="M2.32765 3.57349L2.68419 4.61759L3.72829 4.97413L2.68419 5.33068L2.32765 6.37478L1.9711 5.33068L0.927002 4.97413L1.9711 4.61759L2.32765 3.57349Z" fill="#007AFF"/>
5
+ <path d="M9.83558 13.011L10.0044 13.5053L10.4987 13.6741L10.0044 13.8429L9.83558 14.3372L9.66679 13.8429L9.17249 13.6741L9.66679 13.5053L9.83558 13.011Z" fill="#007AFF"/>
6
+ </svg>
@@ -1,3 +1,3 @@
1
- <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="design-iconfont">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M1.33334 7.99998C1.33334 4.31808 4.31811 1.33331 8.00001 1.33331C11.6819 1.33331 14.6667 4.31808 14.6667 7.99998C14.6667 11.6819 11.6819 14.6666 8.00001 14.6666C4.31811 14.6666 1.33334 11.6819 1.33334 7.99998ZM7.33335 10.6095L11.6381 6.30473L10.6953 5.36192L7.33335 8.72385L5.47142 6.86192L4.52862 7.80473L7.33335 10.6095Z" fill="#CCC"/>
3
- </svg>
1
+ <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="design-iconfont">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M1.33334 7.99998C1.33334 4.31808 4.31811 1.33331 8.00001 1.33331C11.6819 1.33331 14.6667 4.31808 14.6667 7.99998C14.6667 11.6819 11.6819 14.6666 8.00001 14.6666C4.31811 14.6666 1.33334 11.6819 1.33334 7.99998ZM7.33335 10.6095L11.6381 6.30473L10.6953 5.36192L7.33335 8.72385L5.47142 6.86192L4.52862 7.80473L7.33335 10.6095Z" fill="#CCC"/>
3
+ </svg>
@@ -1,3 +1,3 @@
1
- <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="design-iconfont">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M1.33334 8.00004C1.33334 4.31814 4.31811 1.33337 8.00001 1.33337C11.6819 1.33337 14.6667 4.31814 14.6667 8.00004C14.6667 11.6819 11.6819 14.6667 8.00001 14.6667C4.31811 14.6667 1.33334 11.6819 1.33334 8.00004ZM7.33335 10.6095L11.6381 6.30479L10.6953 5.36198L7.33335 8.72391L5.47142 6.86198L4.52862 7.80479L7.33335 10.6095Z" fill="#48D2A0"/>
3
- </svg>
1
+ <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="design-iconfont">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M1.33334 8.00004C1.33334 4.31814 4.31811 1.33337 8.00001 1.33337C11.6819 1.33337 14.6667 4.31814 14.6667 8.00004C14.6667 11.6819 11.6819 14.6667 8.00001 14.6667C4.31811 14.6667 1.33334 11.6819 1.33334 8.00004ZM7.33335 10.6095L11.6381 6.30479L10.6953 5.36198L7.33335 8.72391L5.47142 6.86198L4.52862 7.80479L7.33335 10.6095Z" fill="#48D2A0"/>
3
+ </svg>
@@ -2,7 +2,7 @@
2
2
  <div>
3
3
  <el-dialog
4
4
  :visible.sync="visible"
5
- width="85%"
5
+ :width="width"
6
6
  :title="'提交意见' | $lc"
7
7
  @close="$emit('close')"
8
8
  @closed="$emit('closed')"
@@ -32,7 +32,7 @@
32
32
  </el-form-item>
33
33
  </el-form>
34
34
  <ExpandablePane v-if="otherAttDataA.length > 0" title="自定义项" :default-expand="true">
35
- <el-form ref="approveBtnGroup" label-position="right" :label-width="_lang === 'zh' ? '12em' : '12em'">
35
+ <el-form ref="approveBtnGroup" label-position="right" :label-width="labelWidth">
36
36
  <div
37
37
  class="p-b-lg p-t-lg p-r-lg"
38
38
  style="max-height: 350px; overflow-y: auto; border: 1px dashed var(--border-color-base); border-radius: 5px"
@@ -43,6 +43,7 @@
43
43
  :other-att-data-a="otherAttDataA"
44
44
  :proc-inst-id="procInstId || this.$route.query.processInstanceId"
45
45
  :required="true"
46
+ :label-width="labelWidth"
46
47
  />
47
48
  </div>
48
49
  </el-form>
@@ -64,6 +65,14 @@ export default {
64
65
  name: 'HandlingAdvice',
65
66
  components: { ShowOtherAttNew, ExpandablePane },
66
67
  props: {
68
+ width: {
69
+ type: String,
70
+ default: '85%'
71
+ },
72
+ labelWidth: {
73
+ type: String,
74
+ default: '12em'
75
+ },
67
76
  afterGetConf: {
68
77
  type: Function,
69
78
  default: undefined
@@ -115,14 +115,15 @@ export default {
115
115
  }
116
116
  },
117
117
  changeFn(val) {
118
+ // 只同步 input 事件,change 事件由 $listeners 处理
118
119
  this.$emit('input', val)
119
- this.$emit('change', val)
120
120
  },
121
121
  searchFn() {
122
122
  this.$emit('search', this.value)
123
123
  },
124
124
  closeFn() {
125
125
  this.$emit('input', undefined)
126
+ // 清空时也触发 change
126
127
  this.$emit('change', undefined)
127
128
  }
128
129
  }
@@ -48,7 +48,7 @@
48
48
  <!-- 字段选择 -->
49
49
  <el-select v-model="condition.field" class="field-select" placeholder="请选择字段" size="small">
50
50
  <el-option
51
- v-for="field in filterList"
51
+ v-for="field in canSetFilter"
52
52
  :key="field.value"
53
53
  :label="field.label"
54
54
  :value="field.value"
@@ -457,12 +457,18 @@ export default {
457
457
  }
458
458
  },
459
459
  mounted() {
460
+ // 先基于 filterList 初始化 canSetFilter,避免闪烁
461
+ this.canSetFilter = this.filterList
462
+ // 立即过滤一次无效条件
463
+ this.filterInvalidConditions()
464
+ // 然后再发起异步请求获取更精确的字段配置
460
465
  this.getAdvancedQueryFields()
461
466
  },
462
467
  methods: {
463
468
  // 查询支持可配置高级查询的字段
464
469
  getAdvancedQueryFields() {
465
470
  axios.get('/bems/query/viewColumn/getColumnInfo', { bussId: this.bussId }, { loading: false }).then((res) => {
471
+ //res.data=[]
466
472
  // 过滤可筛选的字段,保留完整对象信息
467
473
  const searchableFields = res.data.filter((item) => {
468
474
  return item.searchable === '1'
@@ -486,9 +492,30 @@ export default {
486
492
  }
487
493
  return item
488
494
  })
489
- console.log(this.canSetFilter, 'canSetFilter')
495
+ // 再次过滤,确保数据正确
496
+ this.filterInvalidConditions()
490
497
  })
491
498
  },
499
+ // 过滤掉无效的条件(字段不在可筛选列表中)
500
+ filterInvalidConditions() {
501
+ const validFieldValues = this.canSetFilter.map((item) => item.value)
502
+ this.value.forEach((group) => {
503
+ // 从后往前遍历,避免索引问题
504
+ for (let i = group.conditions.length - 1; i >= 0; i--) {
505
+ const condition = group.conditions[i]
506
+ if (condition.field && !validFieldValues.includes(condition.field)) {
507
+ group.conditions.splice(i, 1)
508
+ }
509
+ }
510
+ })
511
+ // 移除 conditions 为空数组的条件组
512
+ for (let i = this.value.length - 1; i >= 0; i--) {
513
+ if (this.value[i].conditions.length === 0) {
514
+ this.value.splice(i, 1)
515
+ }
516
+ }
517
+ this.$emit('update:value', this.value)
518
+ },
492
519
  // 修改字段
493
520
  updatefield(field, row) {
494
521
  this.$set(row, 'advancedQueryType', field.advancedQueryType)
@@ -138,6 +138,7 @@
138
138
  </cl-advanced-filter>
139
139
  <advancedQuery
140
140
  v-else
141
+ :key="visible"
141
142
  v-model="conditionGroups"
142
143
  :filter-list="filterList"
143
144
  :filter-id="filterId"
@@ -206,6 +206,10 @@ export default {
206
206
  isFiliterSingle: {
207
207
  type: Boolean,
208
208
  default: false
209
+ },
210
+ isAutoWidth: {
211
+ type: Boolean,
212
+ default: true
209
213
  }
210
214
  },
211
215
  data() {
@@ -219,7 +223,11 @@ export default {
219
223
  },
220
224
  computed: {
221
225
  _columns() {
222
- return this.calcColumnWidth(this.columns)
226
+ if (this.isAutoWidth) {
227
+ return this.calcColumnWidth(this.columns)
228
+ } else {
229
+ return this.columns
230
+ }
223
231
  }
224
232
  },
225
233
  watch: {
@@ -409,23 +417,22 @@ export default {
409
417
  function calc(columns) {
410
418
  // 计算所有列的基础宽度总和
411
419
  let totalBaseWidth = 0
412
-
413
420
  columns.forEach((column) => {
414
421
  if (column.static && column.label === $lc('操作') && !column.width && !column.minWidth) {
415
- column.width = 80
422
+ column.width = 180
416
423
  }
417
424
  if (column.type === 'checkbox') {
418
- column.width = 80
425
+ column.width = 50
419
426
  }
420
427
 
421
428
  // 如果没有设置宽度,根据字符数计算最小宽度
422
- if (!column.width && !column.minWidth) {
429
+ if (!column.width && !column.minWidth && !column['min-width']) {
423
430
  const textLength = (column.label && column.label.length) || 10
424
431
  column.minWidth = Math.ceil(textLength * CHAR_WIDTH + PADDING)
425
432
  }
426
433
 
427
434
  // 计算基础宽度:有width的用width,没有的用minWidth
428
- const widthValue = column.width || column.minWidth || 0
435
+ const widthValue = column.width || column.minWidth || column['min-width'] || 0
429
436
  // 处理不同格式的宽度:数字、"100"、"100px"
430
437
  let baseWidth = 0
431
438
  if (typeof widthValue === 'number') {
@@ -437,25 +444,17 @@ export default {
437
444
  column['_baseWidth_'] = baseWidth
438
445
  totalBaseWidth += baseWidth
439
446
  })
440
-
441
447
  // 如果所有列的基础宽度总和 >= 容器宽度,不做处理
442
448
  if (totalBaseWidth >= windowWidth) {
443
449
  return columns
444
- }
445
-
446
- // 否则,所有列都按比例扩展以撑满容器
447
- const scaleRate = windowWidth / totalBaseWidth
448
-
449
- columns.forEach((column) => {
450
- if (!column.type && !column.isResize) {
451
- // 按比例扩展列宽
452
- column.width = column['_baseWidth_'] * scaleRate
450
+ } else {
451
+ const seqColumns = columns.filter((item) => item.type !== 'seq' && item.type !== 'checkbox')
452
+ if (seqColumns.length > 0) {
453
+ seqColumns[0].width = ''
453
454
  }
454
- })
455
-
456
- return columns
455
+ return columns
456
+ }
457
457
  }
458
-
459
458
  return calc(columns)
460
459
  }
461
460
  }