n20-common-lib 2.5.2 → 2.5.3-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n20-common-lib",
3
- "version": "2.5.2",
3
+ "version": "2.5.3-beta",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -116,4 +116,4 @@
116
116
  "last 2 versions",
117
117
  "not dead"
118
118
  ]
119
- }
119
+ }
@@ -41,7 +41,7 @@
41
41
  @import './select.scss';
42
42
  @import './plain-text.scss';
43
43
  @import './cl-date-quarter.scss';
44
-
44
+ @import './work-card.scss';
45
45
  /* 临时引入 */
46
46
  @import '../../components/ChildRange/style.scss';
47
47
  @import '../../components/PageHeader/style.scss';
@@ -0,0 +1,49 @@
1
+ .work-card {
2
+ height: 100%;
3
+ &-title {
4
+ font-weight: 500;
5
+ }
6
+ &-more.el-link.el-link--default {
7
+ color: $--color-text-secondary;
8
+ }
9
+ .el-table td.el-table__cell,
10
+ .el-table th.el-table__cell.is-leaf {
11
+ border-bottom: none;
12
+ }
13
+ .el-table td.el-table__cell .cell {
14
+ .el-button--primary {
15
+ color: var(--color-primary);
16
+ background-color: var(--color-primary-light-9);
17
+ border-color: var(--color-primary-light-9);
18
+ }
19
+ .el-button--primary:active,
20
+ .el-button--primary:focus,
21
+ .el-button--primary:hover {
22
+ background-color: var(--color-primary-light-7);
23
+ border-color: var(--color-primary-light-7);
24
+ }
25
+ }
26
+ .el-table--border:after,
27
+ .el-table--group:after,
28
+ .el-table:before {
29
+ content: '';
30
+ position: absolute;
31
+ background-color: $--color-white;
32
+ z-index: 1;
33
+ }
34
+ }
35
+ .work-card ::v-deep .el-badge__content {
36
+ line-height: 14px;
37
+ }
38
+ .work-card .el-badge__content.is-fixed {
39
+ position: absolute;
40
+ top: 0;
41
+ right: -1px;
42
+ transform: scale(0.7) translateY(-50%) translateX(100%);
43
+ }
44
+
45
+ .work-card--empty-title {
46
+ color: #cacaca;
47
+ padding-bottom: 80px;
48
+ margin-top: -16px;
49
+ }
@@ -50,11 +50,8 @@
50
50
  width:
51
51
  form[item.value] && form[item.value].length > 0
52
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
53
+ item.options.find((r) => r.value === form[item.value] || r[item.props?.valueKey] === form[item.value])
54
+ .label
58
55
  ).width *
59
56
  1.4 +
60
57
  48 +
@@ -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>
@@ -1,6 +1,6 @@
1
1
  /* 审批记录 */
2
2
  <template>
3
- <div v-if="buttonMode">
3
+ <div>
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>
@@ -30,24 +30,12 @@
30
30
  <approvalImg class="text-c p-a" :proc-inst-id="procInstIdC" style="height: 70vh; overflow: auto" />
31
31
  </el-dialog>
32
32
  </div>
33
- <div v-else>
34
- <expandableWrap title="审批记录">
35
- <template slot="tips">
36
- <el-button size="mini" plain @click="imgV = true">流程图查看</el-button>
37
- </template>
38
- <approvalCard :procInstId="procInstIdC" />
39
- <el-dialog v-drag title="查看流程" :visible.sync="imgV" width="65%" class="p-a-0" append-to-body top="10vh">
40
- <approvalImg class="text-c p-a" style="height: 70vh; overflow: auto" />
41
- </el-dialog>
42
- </expandableWrap>
43
- </div>
44
33
  </template>
45
34
 
46
35
  <script>
47
36
  import expandableWrap from '../Expandable/main.vue'
48
37
  import approvalCard from '../ApprovalCard/index.vue'
49
38
  import approvalImg from './approvalImg.vue'
50
-
51
39
  export default {
52
40
  name: 'ApprovalRecord',
53
41
  components: {
@@ -59,10 +47,6 @@ export default {
59
47
  procInstId: {
60
48
  type: String,
61
49
  default: undefined
62
- },
63
- buttonMode: {
64
- type: Boolean,
65
- default: true
66
50
  }
67
51
  },
68
52
  data() {
@@ -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(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() {
@@ -3,9 +3,9 @@
3
3
  <slot name="header">
4
4
  <div v-if="header" class="m-b flex-box">
5
5
  <el-badge :value="badgeNum" :hidden="!badgeNum">
6
- <span class="f-s-m">{{ header }}</span>
6
+ <span class="f-s-m work-card-title">{{ header }}</span>
7
7
  </el-badge>
8
- <el-link v-if="showMore" class="m-l-auto" :underline="false" @click="$emit('more')"
8
+ <el-link v-if="showMore" class="m-l-auto work-card-more" :underline="false" @click="$emit('more')"
9
9
  >{{ '更多' | $lc }}<i class="el-icon-arrow-right"></i
10
10
  ></el-link>
11
11
  </div>
@@ -56,24 +56,3 @@ export default {
56
56
  }
57
57
  }
58
58
  </script>
59
-
60
- <style>
61
- .work-card {
62
- height: 100%;
63
- }
64
- .work-card ::v-deep .el-badge__content {
65
- line-height: 14px;
66
- }
67
- .work-card .el-badge__content.is-fixed {
68
- position: absolute;
69
- top: 0;
70
- right: -1px;
71
- transform: scale(0.7) translateY(-50%) translateX(100%);
72
- }
73
-
74
- .work-card--empty-title {
75
- color: #cacaca;
76
- padding-bottom: 80px;
77
- margin-top: -16px;
78
- }
79
- </style>