n20-common-lib 1.3.65 → 1.3.68-0.1

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": "1.3.65",
3
+ "version": "1.3.680.1",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -13,7 +13,8 @@
13
13
  "build:gzip": "vue-cli-service build --gzip",
14
14
  "build:report": "vue-cli-service build --analy",
15
15
  "build:css": "node build_css",
16
- "build:js": "vue-cli-service build --formats umd-min --target lib src/index.js --name index --dest lib --analy"
16
+ "build:js": "vue-cli-service build --formats umd-min --target lib src/index.js --name index --dest lib --analy",
17
+ "getI18n": "node ./node_modules/nstc-get-i18n"
17
18
  },
18
19
  "files": [
19
20
  "src/_qiankun",
@@ -74,6 +75,7 @@
74
75
  "md2vue-loader": "git+https://gitee.com/bable2000/md2vue-loader.git",
75
76
  "mockjs": "^1.1.0",
76
77
  "node-sass": "6.0.0",
78
+ "nstc-get-i18n": "^0.0.3",
77
79
  "qiankun": "^2.5.1",
78
80
  "sass-loader": "^10.2.0",
79
81
  "screenfull": "^5.1.0",
@@ -63,6 +63,5 @@
63
63
  font-weight: initial;
64
64
  font-size: $--font-size-base;
65
65
  color: $--color-text-regular;
66
- padding: 12px;
67
66
  }
68
67
  }
@@ -2,6 +2,7 @@
2
2
  background-color: #303133;
3
3
  border: none;
4
4
  min-width: auto;
5
+ max-width: 80vw;
5
6
  color: $--color-white;
6
7
  padding: 5px 8px;
7
8
  }
@@ -1,7 +1,24 @@
1
1
  /* 审批按钮组 */
2
2
  <template>
3
3
  <div>
4
- <el-form label-position="left" label-width="5em">
4
+ <el-form label-position="right" label-width="5em">
5
+ <div class="flex-box">
6
+ <div v-if="authList.includes('isCarboncopy')" class="flex-1">
7
+ <el-form-item label="抄送">
8
+ <el-input
9
+ :value="carbonCopyList.map((c) => c.uname).join(', ')"
10
+ type="textarea"
11
+ :autosize="{ minRows: 1 }"
12
+ @focus="setCarboncopyV = true"
13
+ />
14
+ </el-form-item>
15
+ </div>
16
+ <div v-if="authList.includes('加签')" class="flex-1">
17
+ <el-form-item label="加签">
18
+ <el-input type="textarea" :autosize="{ minRows: 1 }" />
19
+ </el-form-item>
20
+ </div>
21
+ </div>
5
22
  <el-form-item label="审批意见" :error="errMsg">
6
23
  <el-input
7
24
  ref="msg-input"
@@ -22,6 +39,9 @@
22
39
  <el-button v-if="authList.includes('discard')" type="danger" plain @click="discardFn">作 废</el-button>
23
40
  <el-button plain @click="goFrom">返 回</el-button>
24
41
  </div>
42
+ <cl-dialog v-drag :visible.sync="setCarboncopyV" title="设置抄送用户" width="900px" append-to-body top="7.5vh">
43
+ <carboncopy-prop :carbon-copy-list="carbonCopyList" @close="setCarboncopyV = false" @confirm="setCarboncopyOk" />
44
+ </cl-dialog>
25
45
  </div>
26
46
  </template>
27
47
 
@@ -29,9 +49,15 @@
29
49
  import axios from '../../utils/axios'
30
50
  import { linkGo } from '../../utils/urlToGo'
31
51
  import { closeTagsForBackPage } from '../../plugins/CompatibleOld'
52
+ import ClDialog from '../Dialog'
53
+ import CarboncopyProp from './setCarboncopyProp.vue'
32
54
 
33
55
  export default {
34
56
  name: 'ApprovalButtons',
57
+ components: {
58
+ ClDialog,
59
+ CarboncopyProp
60
+ },
35
61
  props: {
36
62
  message: {
37
63
  type: String,
@@ -59,7 +85,9 @@ export default {
59
85
  errMsg: undefined,
60
86
  taskId: '',
61
87
  taskDefKey: '',
62
- authList: []
88
+ authList: [],
89
+ setCarboncopyV: false,
90
+ carbonCopyList: []
63
91
  }
64
92
  },
65
93
  computed: {
@@ -125,7 +153,8 @@ export default {
125
153
  message: this.messageC,
126
154
  formData: JSON.stringify(this.formData),
127
155
  signText: this.signText,
128
- isAgentcy: isAgentcy
156
+ isAgentcy: isAgentcy,
157
+ carbonCopyUserDtoList: this.carbonCopyList.map((c) => ({ userNo: c.uno, userName: c.uname }))
129
158
  }
130
159
  ]
131
160
  },
@@ -208,6 +237,11 @@ export default {
208
237
  this.thenMsg(data, '作废')
209
238
  })
210
239
  })
240
+ },
241
+ setCarboncopyOk(list) {
242
+ this.carbonCopyList = list
243
+
244
+ this.setCarboncopyV = false
211
245
  }
212
246
  }
213
247
  }
@@ -0,0 +1,117 @@
1
+ <template>
2
+ <cl-page style="height: 75vh">
3
+ <div slot="header" class="flex-box flex-v m-b">
4
+ <span class="m-r-ss">单位名称</span>
5
+ <span>
6
+ <el-input v-model="searchObj.cltName" size="mini" />
7
+ </span>
8
+ <span class="m-l m-r-ss">姓名</span>
9
+ <span>
10
+ <el-input v-model="searchObj.uname" size="mini" />
11
+ </span>
12
+ <span class="m-l m-r-ss">用户编号</span>
13
+ <span>
14
+ <el-input v-model="searchObj.uno" size="mini" />
15
+ </span>
16
+ <el-button class="m-l-auto" plain size="mini" @click="searchFn">查询</el-button>
17
+ </div>
18
+
19
+ <el-table
20
+ ref="elTable"
21
+ :key="elTableKey"
22
+ :data="nodeTable"
23
+ row-key="uno"
24
+ border
25
+ height="100%"
26
+ @select="sltChange"
27
+ @select-all="sltChange"
28
+ >
29
+ <el-table-column :reserve-selection="true" type="selection" width="46" header-align="center" align="center" />
30
+ <el-table-column prop="uno" label="编号" header-align="center" align="center" />
31
+ <el-table-column prop="uname" label="姓名" header-align="center" align="center" />
32
+ <el-table-column prop="cltName" label="单位" header-align="center" align="center" />
33
+ </el-table>
34
+ <template slot="footer">
35
+ <div class="flex-box flex-r m-t m-b">
36
+ <cl-pagination
37
+ :page-obj="pageObj"
38
+ :page-key="{ no: 'pageNum', size: 'pageSize', total: 'totalSize' }"
39
+ @change="getList"
40
+ />
41
+ </div>
42
+ <div class="text-c">
43
+ <el-button type="primary" @click="confirmFn">确 定</el-button>
44
+ <el-button @click="$emit('close')">取 消</el-button>
45
+ </div>
46
+ </template>
47
+ </cl-page>
48
+ </template>
49
+
50
+ <script>
51
+ import ClPage from '../PageLayout/page.vue'
52
+ import ClPagination from '../Pagination/index.vue'
53
+ export default {
54
+ components: {
55
+ ClPage,
56
+ ClPagination
57
+ },
58
+ props: {
59
+ carbonCopyList: {
60
+ type: Array,
61
+ default: () => []
62
+ }
63
+ },
64
+ data() {
65
+ return {
66
+ nodeTable: [],
67
+ searchObj: {
68
+ uno: undefined,
69
+ uname: undefined,
70
+ cltName: undefined,
71
+ roleName: undefined
72
+ },
73
+ pageObj: {
74
+ pageNum: 1,
75
+ pageSize: 10,
76
+ totalSize: 0
77
+ },
78
+ selectArr: [],
79
+ elTableKey: 0
80
+ }
81
+ },
82
+ mounted() {
83
+ this.$refs.elTable.clearSelection()
84
+ this.carbonCopyList.forEach((item) => {
85
+ this.$refs.elTable.toggleRowSelection(item, true)
86
+ })
87
+
88
+ this.pageObj = { pageNum: 1, pageSize: 10, totalSize: 0 }
89
+ this.getList()
90
+ },
91
+ methods: {
92
+ getList() {
93
+ this.$axios
94
+ .post('/bems/activiti/online/chdUserInfo', {
95
+ data: this.searchObj,
96
+ ...this.pageObj
97
+ })
98
+ .then(({ data }) => {
99
+ this.nodeTable = data.list
100
+ this.pageObj.totalSize = data.totalSize
101
+ })
102
+ },
103
+ searchFn() {
104
+ this.pageObj.pageNum = 1
105
+ this.getList()
106
+ },
107
+ sltChange(list) {
108
+ this.selectArr = list || []
109
+ },
110
+ confirmFn() {
111
+ this.$emit('confirm', this.selectArr)
112
+ }
113
+ }
114
+ }
115
+ </script>
116
+
117
+ <style></style>
@@ -9,7 +9,7 @@
9
9
  </div>
10
10
  <div>
11
11
  <div class="flex-box">
12
- <div class="n20-worker flex-item m-r-s">
12
+ <div v-title="item.assignee" class="n20-worker flex-item m-r-s text-ellipsis" :show-overflow-tooltip="true">
13
13
  <span class="worker-icon cl-icon-user"></span>
14
14
  <span>{{ item.assignee }}</span>
15
15
  </div>
@@ -27,9 +27,10 @@
27
27
  >
28
28
  </div>
29
29
  </div>
30
- <div v-if="item.suggestion" class="n20-description-c">
30
+ <div v-if="item.suggestion" class="n20-description-c m-t">
31
31
  {{ item.suggestion }}
32
32
  </div>
33
+ <div v-if="item.ccUserName" class="n20-description-c m-t">抄送人:{{ item.ccUserName }}</div>
33
34
  </div>
34
35
  </el-timeline-item>
35
36
  </el-timeline>
@@ -102,7 +103,8 @@ export default {
102
103
  let _item = {
103
104
  endTime: item.endTime || '',
104
105
  assignee: item.assignee,
105
- suggestion: item.suggestion
106
+ suggestion: item.suggestion,
107
+ ccUserName: item.ccUserName // 抄送人
106
108
  }
107
109
 
108
110
  if (item.taskName === '开始') {
@@ -34,16 +34,32 @@
34
34
  }}</span>
35
35
  <el-button type="text" icon="el-icon-full-screen" style="font-size: 16px" @click="scaleReset" />
36
36
  </div>
37
- <span v-title></span>
38
- <div ref="msgEl" class="activiti-msg">
39
- <div>{{ assignee }}</div>
40
- </div>
37
+ <el-popover ref="title-pop" v-model="msgV" trigger="manual" placement="top">
38
+ <div class="activiti-msg">
39
+ <div v-if="assigneeEnd" class="m-t-ss m-b-ss">
40
+ <table cellspacing="0" style="border-collapse: collapse; min-width: 460px">
41
+ <tr>
42
+ <td class="text-c">已审批人</td>
43
+ <td class="text-c">审批类型</td>
44
+ <td class="text-c">审批意见</td>
45
+ <td class="text-c">审批时间</td>
46
+ </tr>
47
+ <tr v-for="(item, i) in assigneeEnd" :key="i">
48
+ <td>{{ item.assignee }}</td>
49
+ <td class="text-c">{{ item.optResult }}</td>
50
+ <td>{{ item.suggestion }}</td>
51
+ <td>{{ item.endTime }}</td>
52
+ </tr>
53
+ </table>
54
+ </div>
55
+ <div v-if="assignee" :class="{ 'm-t-s': assigneeEnd }">{{ assignee }}</div>
56
+ </div>
57
+ </el-popover>
41
58
  </div>
42
59
  </template>
43
60
 
44
61
  <script>
45
62
  import importG from '../../../utils/importGlobal.js'
46
- import { tipShow, tipHide } from '../../../directives/VTitle/index.js'
47
63
  export default {
48
64
  filters: {
49
65
  zoomFormat(val) {
@@ -59,12 +75,15 @@ export default {
59
75
  data() {
60
76
  this.svgW = undefined
61
77
  this.svgC = undefined
78
+ this.markerId = ''
62
79
  return {
63
- assignee: '',
80
+ assignee: undefined,
81
+ assigneeEnd: undefined,
64
82
  min: 0.4,
65
83
  max: 2,
66
84
  step: 0.1,
67
- zoomValue: 1
85
+ zoomValue: 1,
86
+ msgV: false
68
87
  }
69
88
  },
70
89
  watch: {
@@ -75,7 +94,7 @@ export default {
75
94
  async mounted() {
76
95
  this.svgW = this.$refs['activiti-svg-wrap']
77
96
 
78
- let { flowString, seqRecords, taskDefIdMap, currentActivityId, currentAssigneeName } = this.dataPro
97
+ let { flowString, seqRecords, taskDefIdMap = {}, currAssMap = {}, currentActivityIdList = [] } = this.dataPro
79
98
  let flowSvg = flowString
80
99
  if (flowString.includes('bpmn2:definitions')) {
81
100
  let { default: bpmn2svg } = await importG('bpmn2svg', () =>
@@ -88,12 +107,17 @@ export default {
88
107
  seqRecords.forEach((obj) => {
89
108
  this.setTaskRecord(obj)
90
109
  })
91
- for (let k in taskDefIdMap) {
92
- this.addEvent(k, taskDefIdMap[k])
93
- }
94
- if (currentActivityId) {
95
- this.addEvent(currentActivityId, currentAssigneeName, 'pending')
110
+ currentActivityIdList.forEach((currentActivityId) => {
111
+ let assignee = currAssMap[currentActivityId]
112
+ let assigneeEnd = taskDefIdMap[currentActivityId]
113
+ taskDefIdMap[currentActivityId] = undefined
114
+
115
+ this.addEvent(currentActivityId, { assignee, assigneeEnd }, 'pending')
116
+
96
117
  this.svgW.querySelector(`[data-element-id="${currentActivityId}"]`).classList.add('activiti-node-at')
118
+ })
119
+ for (let k in taskDefIdMap) {
120
+ taskDefIdMap[k] && this.addEvent(k, taskDefIdMap[k])
97
121
  }
98
122
  } catch (error) {
99
123
  console.log('setTaskErr:', error)
@@ -115,7 +139,11 @@ export default {
115
139
  this.zoomValue = scale
116
140
  })
117
141
  },
142
+ deactivated() {
143
+ this.msgV = false
144
+ },
118
145
  beforeDestroy() {
146
+ this.msgV = false
119
147
  this.svgPanzoom && this.svgPanzoom.dispose()
120
148
  },
121
149
  methods: {
@@ -131,6 +159,9 @@ export default {
131
159
  this.svgC.setAttribute('width', Number(width) + 10)
132
160
  this.svgC.setAttribute('height', Number(height) + 10)
133
161
  this.svgC.setAttribute('viewBox', viewBox)
162
+
163
+ let marker = this.svgC.querySelector('defs marker')
164
+ marker && (this.markerId = marker.getAttribute('id'))
134
165
  },
135
166
  setTaskRecord(obj) {
136
167
  let { resouceTaskDefId: from, targetTaskDefId: to, seqDefid: line, type: type } = obj
@@ -159,6 +190,7 @@ export default {
159
190
  let path = document.createElementNS('http://www.w3.org/2000/svg', 'path')
160
191
  path.setAttribute('class', 'activiti-line-reject')
161
192
  path.setAttribute('d', d)
193
+ path.style.markerEnd = `url('#${this.markerId}')`
162
194
  this.svgC.appendChild(path)
163
195
 
164
196
  if (msg) {
@@ -201,20 +233,24 @@ export default {
201
233
  }
202
234
  return rect
203
235
  },
204
- addEvent(id, list = [], type) {
236
+ addEvent(id, list, type) {
205
237
  let task = this.svgW.querySelector(`[data-element-id="${id}"]`)
206
238
  task.addEventListener('mouseenter', () => {
207
239
  if (type === 'pending') {
208
- this.assignee = list
240
+ this.assignee = list.assignee
241
+ this.assigneeEnd = list.assigneeEnd
209
242
  } else {
210
- this.assignee = '已审批人:' + list.map((c) => c.assignee).join(',')
243
+ this.assignee = undefined
244
+ this.assigneeEnd = list
211
245
  }
212
246
  this.$nextTick(() => {
213
- tipShow(task, this.$refs['msgEl'])
247
+ this.$refs['title-pop'].doDestroy()
248
+ this.$refs['title-pop'].referenceElm = task
249
+ this.msgV = true
214
250
  })
215
251
  })
216
252
  task.addEventListener('mouseleave', () => {
217
- tipHide(task)
253
+ this.msgV = false
218
254
  })
219
255
  },
220
256
  scaleMinus() {
@@ -347,9 +383,13 @@ setRejectLink(from, to) {
347
383
  height: 100%;
348
384
  overflow: auto;
349
385
  }
350
- .n20-approval-img-por .activiti-msg {
351
- display: none;
386
+
387
+ .activiti-msg th,
388
+ .activiti-msg td {
389
+ padding: 6px 8px;
390
+ border: 1px solid var(--border-color-base);
352
391
  }
392
+
353
393
  .activiti-svg-zoom {
354
394
  position: absolute;
355
395
  z-index: 9;
@@ -0,0 +1,68 @@
1
+ <template>
2
+ <div v-if="isEqual">
3
+ {{ value }}
4
+ </div>
5
+ <div v-else class="n20-descriptions">
6
+ <div class="m-b-ss">
7
+ <span class="after-color">{{ value }}</span>
8
+ </div>
9
+ <div>
10
+ <span class="before-color">{{ oldValue }}</span>
11
+ <el-tooltip v-if="tooltip" :content="tooltipContent" placement="top">
12
+ <i class="n20-icon-xinxitishi m-l-ss color-placeholder"></i>
13
+ </el-tooltip>
14
+ </div>
15
+ </div>
16
+ </template>
17
+
18
+ <script>
19
+ export default {
20
+ name: 'Diff',
21
+ props: {
22
+ value: {
23
+ type: [String, Boolean, Array],
24
+ default: undefined
25
+ },
26
+ oldValue: {
27
+ type: [String, Boolean, Array],
28
+ default: undefined
29
+ },
30
+ tooltip: {
31
+ type: [String, Boolean],
32
+ default: undefined
33
+ }
34
+ },
35
+ computed: {
36
+ isEqual() {
37
+ if (this.value === this.oldValue) {
38
+ return true
39
+ }
40
+ if ((this.value === 0 || this.value === '0') && (this.oldValue === 0 || this.oldValue === '0')) {
41
+ return true
42
+ } else if (!this.value && !this.oldValue) {
43
+ return true
44
+ }
45
+ if (
46
+ Array.isArray(this.value) &&
47
+ Array.isArray(this.oldValue) &&
48
+ this.value.toString() === this.oldValue.toString()
49
+ ) {
50
+ return true
51
+ }
52
+
53
+ return false
54
+ },
55
+ tooltipContent() {
56
+ if (!this.tooltip) {
57
+ return undefined
58
+ } else {
59
+ if (this.tooltip === true) {
60
+ return '修改前数据内容'
61
+ } else {
62
+ return this.tooltip
63
+ }
64
+ }
65
+ }
66
+ }
67
+ }
68
+ </script>