n20-common-lib 2.5.4 → 2.5.5-beta.0

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 (34) hide show
  1. package/package.json +1 -1
  2. package/src/assets/css/filter.scss +7 -0
  3. package/src/components/AdvancedFilter/form-item-input.vue +2 -10
  4. package/src/components/AdvancedFilter/index.vue +1 -1
  5. package/src/components/ApprovalButtons/index.vue +13 -13
  6. package/src/components/ApprovalButtons/showAppOpi.vue +4 -3
  7. package/src/components/ApprovalRecord/index.vue +9 -7
  8. package/src/components/DatePicker/por.vue +2 -58
  9. package/src/components/ShowColumn/index.vue +36 -0
  10. package/src/components/Upload/index.vue +34 -8
  11. package/src/directives/VTitle/index.js +0 -1
  12. package/src/i18n.json +10 -1
  13. package/style/index.css +1 -1
  14. package/style/index.css.map +1 -1
  15. package/theme/blue.css +3 -0
  16. package/theme/cctcRed.css +3 -0
  17. package/theme/fonts/element-icons.535877f5.woff +0 -0
  18. package/theme/fonts/element-icons.732389de.ttf +0 -0
  19. package/theme/fonts/iconfont.47f5da25.woff2 +0 -0
  20. package/theme/fonts/iconfont.6ad948fe.woff +0 -0
  21. package/theme/fonts/iconfont.76d19005.woff2 +0 -0
  22. package/theme/fonts/iconfont.85c70ef9.ttf +0 -0
  23. package/theme/fonts/iconfont.ab8c366d.ttf +0 -0
  24. package/theme/fonts/iconfont.b7ea4726.woff +0 -0
  25. package/theme/fonts/iconfont.e6bdbf43.woff2 +0 -0
  26. package/theme/fonts/iconfont.f1777a50.woff +0 -0
  27. package/theme/fonts/iconfont.f4c32765.ttf +0 -0
  28. package/theme/fonts/iconfont.fbdd69b3.ttf +0 -0
  29. package/theme/green.css +3 -0
  30. package/theme/lightBlue.css +3 -0
  31. package/theme/orange.css +3 -0
  32. package/theme/purple.css +3 -0
  33. package/theme/red.css +3 -0
  34. package/theme/yellow.css +3 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n20-common-lib",
3
- "version": "2.5.4",
3
+ "version": "2.5.5-beta.0",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -104,6 +104,13 @@
104
104
  display: inline-block;
105
105
  white-space: nowrap;
106
106
  text-overflow: ellipsis;
107
+ .el-select.el-select--small {
108
+ .el-select__tags {
109
+ max-width: 88px !important;
110
+ display: flex;
111
+ flex-wrap: nowrap;
112
+ }
113
+ }
107
114
  }
108
115
  :hover {
109
116
  border-color: $--color-primary;
@@ -46,19 +46,11 @@
46
46
  v-model="form[item.value]"
47
47
  :clearable="(item.props && item.props.clearable) || false"
48
48
  :multiple="item.multiple"
49
+ collapse-tags
49
50
  :style="{
50
51
  width:
51
52
  form[item.value] && form[item.value].length > 0
52
- ? context.measureText(
53
- item.options.find(
54
- (r) =>
55
- r.value === form[item.value] ||
56
- (item.props && item.props.valueKey && r[item.props.valueKey] === form[item.value])
57
- ).label
58
- ).width *
59
- 1.4 +
60
- 48 +
61
- 'px'
53
+ ? 156 + 'px'
62
54
  : 120 - 18 - context.measureText(item.label).width * 1.4 + 'px'
63
55
  }"
64
56
  v-bind="item.props"
@@ -25,7 +25,7 @@
25
25
  >
26
26
  <slot name="prefix"></slot>
27
27
  </div>
28
- <template v-for="item in GroupData">
28
+ <template v-for="(item, i) in GroupData">
29
29
  <template v-if="item && item.slotName" :slot="item.slotName">
30
30
  <slot :name="item.slotName"></slot>
31
31
  </template>
@@ -66,19 +66,6 @@
66
66
  </el-form-item>
67
67
  </div>
68
68
  <div class="flex-box">
69
- <el-form-item class="flex-1" :label="'审批意见' | $lc" :error="errMsg" :required="required" style="width: 70%">
70
- <el-input
71
- ref="msg-input"
72
- v-model="messageC"
73
- type="textarea"
74
- :placeholder="
75
- ('请输入操作意见(' + messageMax + '字以内),批准该意见为非必填,驳回/作废该意见为必填!') | $lc
76
- "
77
- :maxlength="messageMax"
78
- show-word-limit
79
- :autosize="{ rows: 1 }"
80
- />
81
- </el-form-item>
82
69
  <template v-if="taskId && showBtn">
83
70
  <show-app-opi
84
71
  v-if="opiAndUser || authList.includes('showAppOpi')"
@@ -96,6 +83,19 @@
96
83
  style="width: 18%"
97
84
  />
98
85
  </template>
86
+ <el-form-item class="flex-1" :label="'审批意见' | $lc" :error="errMsg" :required="required" style="width: 70%">
87
+ <el-input
88
+ ref="msg-input"
89
+ v-model="messageC"
90
+ type="textarea"
91
+ :placeholder="
92
+ ('请输入操作意见(' + messageMax + '字以内),批准该意见为非必填,驳回/作废该意见为必填!') | $lc
93
+ "
94
+ :maxlength="messageMax"
95
+ show-word-limit
96
+ :autosize="{ rows: 1 }"
97
+ />
98
+ </el-form-item>
99
99
  </div>
100
100
  <el-form-item v-if="fileKit || fileKitT" label="附加上传">
101
101
  <cl-upload
@@ -62,9 +62,10 @@ export default {
62
62
  }
63
63
  },
64
64
  changeFn() {
65
- // if (this.approveMsgSlt?.length) {
66
- this.$emit('update:message', this.approveMsgSlt.join('\n'))
67
- // }
65
+ this.$emit(
66
+ 'update:message',
67
+ Array.isArray(this.approveMsgSlt) ? this.approveMsgSlt.join('\n') : this.approveMsgSlt
68
+ )
68
69
  }
69
70
  }
70
71
  }
@@ -1,6 +1,6 @@
1
1
  /* 审批记录 */
2
2
  <template>
3
- <div v-if="buttonMode">
3
+ <div v-if="approvalMode === 'dialog' || !approvalMode">
4
4
  <expandableWrap :title="'审批记录' | $lc" :show-expand="false" :icon="false">
5
5
  <template slot="tips">
6
6
  <el-button plain size="mini" :disabled="false" @click="cardV = true">{{ '审批进度查看' | $lc }}</el-button>
@@ -47,7 +47,7 @@
47
47
  import expandableWrap from '../Expandable/main.vue'
48
48
  import approvalCard from '../ApprovalCard/index.vue'
49
49
  import approvalImg from './approvalImg.vue'
50
-
50
+ import getJsonc from '../../assets/getJsonc'
51
51
  export default {
52
52
  name: 'ApprovalRecord',
53
53
  components: {
@@ -59,22 +59,24 @@ export default {
59
59
  procInstId: {
60
60
  type: String,
61
61
  default: undefined
62
- },
63
- buttonMode: {
64
- type: Boolean,
65
- default: true
66
62
  }
67
63
  },
68
64
  data() {
69
65
  return {
70
66
  cardV: false,
71
- imgV: false
67
+ imgV: false,
68
+ approvalMode: undefined
72
69
  }
73
70
  },
74
71
  computed: {
75
72
  procInstIdC() {
76
73
  return this.procInstId || this.$route.query.processInstanceId
77
74
  }
75
+ },
76
+ mounted() {
77
+ getJsonc('/server-config.jsonc').then(({ approvalMode }) => {
78
+ this.approvalMode = approvalMode
79
+ })
78
80
  }
79
81
  }
80
82
  </script>
@@ -51,53 +51,6 @@ let disabledDate_2 = (t) => {
51
51
  return t > now
52
52
  }
53
53
 
54
- let shortcuts_1 = [
55
- {
56
- text: $lc('最近一月'),
57
- onClick(picker) {
58
- const start = new Date()
59
- const end = new Date()
60
- start.setMonth(start.getMonth() - 1)
61
- start.setHours(0, 0, 0)
62
- end.setHours(23, 59, 59)
63
- picker.$emit('pick', [start, end])
64
- }
65
- },
66
- {
67
- text: $lc('最近三月'),
68
- onClick(picker) {
69
- const start = new Date()
70
- const end = new Date()
71
- start.setMonth(start.getMonth() - 3)
72
- start.setHours(0, 0, 0)
73
- end.setHours(23, 59, 59)
74
- picker.$emit('pick', [start, end])
75
- }
76
- },
77
- {
78
- text: $lc('最近六月'),
79
- onClick(picker) {
80
- const start = new Date()
81
- const end = new Date()
82
- start.setMonth(start.getMonth() - 6)
83
- start.setHours(0, 0, 0)
84
- end.setHours(23, 59, 59)
85
- picker.$emit('pick', [start, end])
86
- }
87
- },
88
- {
89
- text: $lc('最近一年'),
90
- onClick(picker) {
91
- const start = new Date()
92
- const end = new Date()
93
- start.setFullYear(start.getFullYear() - 1)
94
- start.setHours(0, 0, 0)
95
- end.setHours(23, 59, 59)
96
- picker.$emit('pick', [start, end])
97
- }
98
- }
99
- ]
100
-
101
54
  let shortcuts_2 = [
102
55
  {
103
56
  text: $lc('最近一月'),
@@ -196,10 +149,6 @@ export default {
196
149
  type: Boolean,
197
150
  default: true
198
151
  },
199
- startStop: {
200
- type: Boolean,
201
- default: false
202
- },
203
152
  clearable: {
204
153
  type: Boolean,
205
154
  default: true
@@ -211,8 +160,7 @@ export default {
211
160
  },
212
161
  data() {
213
162
  let shortcuts = undefined
214
- if (this.shortcuts && ['daterange', 'datetimerange'].includes(this.type))
215
- shortcuts = this.startStop ? shortcuts_2 : shortcuts_1
163
+ if (this.shortcuts && ['daterange', 'datetimerange'].includes(this.type)) shortcuts = shortcuts_2
216
164
 
217
165
  this.pickerOptionsAs = Object.assign(
218
166
  {
@@ -223,11 +171,7 @@ export default {
223
171
  this.pickerOptions
224
172
  )
225
173
 
226
- this.listeners = Object.assign({}, this.$listeners, {
227
- input: () => {},
228
- change: () => {},
229
- blur: this.HandleBlur
230
- })
174
+ this.listeners = Object.assign({}, this.$listeners, { input: () => {}, change: () => {}, blur: this.HandleBlur })
231
175
  return {}
232
176
  },
233
177
  computed: {
@@ -10,6 +10,11 @@
10
10
  :close-on-click-modal="false"
11
11
  @open="popOpen"
12
12
  >
13
+ <div class="flex-box flex-lr p-r-lg" slot="title">
14
+ <div>{{ title }}</div>
15
+
16
+ <div v-has="isHas" class="pointer color-primary" @click="handleInitialize">{{ '初始化' | $lc }}</div>
17
+ </div>
13
18
  <div class="dialog-view">
14
19
  <div class="flex-box">
15
20
  <div class="left-c flex-column p-t-m bd-r">
@@ -78,6 +83,7 @@
78
83
  <script>
79
84
  import { $lc } from '../../utils/i18n/index'
80
85
  import axios from '../../utils/axios'
86
+
81
87
  import dialogWrap from '../Dialog/index.vue'
82
88
  import dragList from '../DragList/index.vue'
83
89
  export default {
@@ -124,6 +130,10 @@ export default {
124
130
  width: {
125
131
  type: String,
126
132
  default: '800px'
133
+ },
134
+ isHas: {
135
+ type: String,
136
+ default: undefined
127
137
  }
128
138
  },
129
139
  data() {
@@ -167,6 +177,31 @@ export default {
167
177
  }
168
178
  },
169
179
  methods: {
180
+ async handleInitialize() {
181
+ if (this.dragList.length < 1) {
182
+ this.$message.error(
183
+ `${$lc(`至少设置`)}${
184
+ this.isExport ? $lc('一列导出数据') : this.isFilter ? $lc('一个筛选条件') : $lc('一列显示列')
185
+ }!`
186
+ )
187
+ return
188
+ }
189
+ await this.$msgboxPor({
190
+ title: $lc('确认初始化吗?'),
191
+ message: $lc('初始化后将全局生效!'),
192
+ type: 'info',
193
+ confirmButtonText: $lc('确定'),
194
+ cancelButtonText: $lc('取消')
195
+ })
196
+
197
+ let list = []
198
+ let preCols = this.columns.filter((col) => col.static === 'pre')
199
+ let nextCols = this.columns.filter((col) => col.static === 'next')
200
+ list.push(...preCols, ...this.dragList, ...nextCols)
201
+ this.userNo = '_global_'
202
+ this.saveColumns(list)
203
+ this.visible = false
204
+ },
170
205
  popOpen() {
171
206
  this.dragList = this.checkColumns.filter((col) => !col.static)
172
207
  },
@@ -205,6 +240,7 @@ export default {
205
240
  list.push(...preCols, ...this.dragList, ...nextCols)
206
241
 
207
242
  // 自动保存设置的显示列
243
+ this.userNo = sessionStorage.getItem('userNo')
208
244
  !this.isExport && this.autoSave && this.saveColumns(list)
209
245
 
210
246
  this.$emit('setColumns', list)
@@ -131,6 +131,10 @@ export default {
131
131
  type: Function,
132
132
  default: undefined
133
133
  },
134
+ beforeRemove: {
135
+ type: Function,
136
+ default: undefined
137
+ },
134
138
  beforeUpload: {
135
139
  type: Function,
136
140
  default: undefined
@@ -188,13 +192,24 @@ export default {
188
192
  this.$emit('importError')
189
193
  },
190
194
  clearFile() {
191
- if (this.onRemove) {
192
- this.onRemove(this.fileList[0], this.fileList)
195
+ if (!this.beforeRemove) {
196
+ if (this.onRemove) {
197
+ this.onRemove(this.fileList[0], this.fileList)
198
+ } else {
199
+ this.fileNameC = ''
200
+ this.fileUrlC = ''
201
+ this.fileList.pop()
202
+ console.log('删除上传')
203
+ }
193
204
  } else {
194
- this.fileNameC = ''
195
- this.fileUrlC = ''
196
- this.fileList.pop()
197
- console.log('删除上传')
205
+ const before = this.beforeRemove(this.fileList)
206
+ if (before && before.then) {
207
+ before.then(() => {
208
+ this.onRemove(this.fileList[0], this.fileList)
209
+ })
210
+ } else if (before !== false) {
211
+ this.onRemove(this.fileList[0], this.fileList)
212
+ }
198
213
  }
199
214
  },
200
215
  beforeUploadFn(file) {
@@ -333,8 +348,19 @@ export default {
333
348
  }
334
349
  },
335
350
  removeFn(file, fileList) {
336
- if (this.onRemove) {
337
- this.onRemove(file, fileList)
351
+ if (!this.beforeRemove) {
352
+ if (this.onRemove) {
353
+ this.onRemove(file, fileList)
354
+ }
355
+ } else {
356
+ const before = this.beforeRemove(file, fileList)
357
+ if (before && before.then) {
358
+ before.then(() => {
359
+ this.onRemove(file, fileList)
360
+ })
361
+ } else if (before !== false) {
362
+ this.onRemove(file, fileList)
363
+ }
338
364
  }
339
365
  },
340
366
  submit() {
@@ -117,7 +117,6 @@ HoverTooltip.install = (Vue) => {
117
117
  el.$tipShow = () => tipShow(el, binding.arg)
118
118
  el.$tipHide = () => tipHide(el)
119
119
  el.addEventListener('mouseenter', () => {
120
- console.log(getWidth(binding.value))
121
120
  if (getWidth(binding.value) > (binding.arg || 98)) {
122
121
  return el.$tipShow()
123
122
  }
package/src/i18n.json CHANGED
@@ -2,6 +2,15 @@
2
2
  "筛选": {
3
3
  "en": "Filter"
4
4
  },
5
+ "初始化": {
6
+ "en": "Initialization"
7
+ },
8
+ "确认初始化吗?": {
9
+ "en": "Are you sure to initialize?"
10
+ },
11
+ "初始化后将全局生效!": {
12
+ "en": "After initialization, it will be global!"
13
+ },
5
14
  "数据请求": {
6
15
  "en": "Data request"
7
16
  },
@@ -1880,4 +1889,4 @@
1880
1889
  "请先勾选要删除的数据!": {
1881
1890
  "en": "Please select the data to be deleted first!"
1882
1891
  }
1883
- }
1892
+ }