n20-common-lib 1.3.187 → 1.3.188
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 +1 -1
- package/src/components/Empty/index.vue +7 -1
- package/src/components/Filters/index.vue +1 -1
- package/src/components/Upload/index.vue +12 -3
- package/src/components/Upload/uploadMsg.vue +9 -1
- package/src/components/WorkCard/index.vue +73 -0
- package/src/index.js +6 -0
- package/src/plugins/Sign/NetSM3/index.js +1 -1
- package/src/utils/repairElementUI.js +128 -129
- package/src/utils/xls2json.js +6 -1
package/package.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="n20-empty">
|
|
3
3
|
<img :src="src || imgSrc" :style="{ height: `${height}px`, width: `${width}px` }" />
|
|
4
|
-
<slot name="content"
|
|
4
|
+
<slot name="content">
|
|
5
|
+
<span style="color: #cacaca">{{ content }}</span>
|
|
6
|
+
</slot>
|
|
5
7
|
</div>
|
|
6
8
|
</template>
|
|
7
9
|
|
|
@@ -24,6 +26,10 @@ export default {
|
|
|
24
26
|
width: {
|
|
25
27
|
type: Number,
|
|
26
28
|
default: 351
|
|
29
|
+
},
|
|
30
|
+
content: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: ''
|
|
27
33
|
}
|
|
28
34
|
},
|
|
29
35
|
data() {
|
|
@@ -238,9 +238,18 @@ export default {
|
|
|
238
238
|
} else {
|
|
239
239
|
let FD = new FormData()
|
|
240
240
|
FD.append(opt.filename, opt.file)
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
|
|
242
|
+
let data
|
|
243
|
+
if (window._fileData) {
|
|
244
|
+
data = window._fileData
|
|
245
|
+
delete window._fileData
|
|
246
|
+
} else {
|
|
247
|
+
data = opt.data
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (data) {
|
|
251
|
+
for (let k in data) {
|
|
252
|
+
FD.append(k, data[k])
|
|
244
253
|
}
|
|
245
254
|
}
|
|
246
255
|
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-dialog
|
|
2
|
+
<el-dialog
|
|
3
|
+
v-drag
|
|
4
|
+
:visible.sync="progressV"
|
|
5
|
+
:title="title"
|
|
6
|
+
append-to-body
|
|
7
|
+
:close-on-click-modal="false"
|
|
8
|
+
:close-on-press-escape="false"
|
|
9
|
+
>
|
|
3
10
|
<template v-if="!hidePercent">
|
|
4
11
|
<p v-if="!percentType">系统处理中,请稍等......</p>
|
|
5
12
|
<div v-else>
|
|
@@ -78,6 +85,7 @@
|
|
|
78
85
|
<script>
|
|
79
86
|
import { $lc } from '../../utils/i18n/index'
|
|
80
87
|
export default {
|
|
88
|
+
name: 'UploadMsg',
|
|
81
89
|
props: {
|
|
82
90
|
title: {
|
|
83
91
|
type: String,
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="work-card flex-column p-a m-a-0">
|
|
3
|
+
<slot name="header">
|
|
4
|
+
<div v-if="header" class="m-b flex-box">
|
|
5
|
+
<el-badge :value="badgeNum" :hidden="!badgeNum">
|
|
6
|
+
<span class="f-s-m">{{ header }}</span>
|
|
7
|
+
</el-badge>
|
|
8
|
+
<el-link v-if="showMore" class="m-l-auto" :underline="false" @click="$emit('more')"
|
|
9
|
+
>更多<i class="el-icon-arrow-right"></i
|
|
10
|
+
></el-link>
|
|
11
|
+
</div>
|
|
12
|
+
</slot>
|
|
13
|
+
<div class="flex-item" style="height: 80%">
|
|
14
|
+
<clEmpty v-if="isEmpty" type="empty" :width="150" :height="150" style="height: 100%">
|
|
15
|
+
<span slot="content" class="event-card--empty-title">暂无数据</span>
|
|
16
|
+
</clEmpty>
|
|
17
|
+
<slot v-else></slot>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import clEmpty from '../Empty/index.vue'
|
|
24
|
+
export default {
|
|
25
|
+
name: 'WorkCard',
|
|
26
|
+
components: {
|
|
27
|
+
clEmpty
|
|
28
|
+
},
|
|
29
|
+
props: {
|
|
30
|
+
header: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: undefined
|
|
33
|
+
},
|
|
34
|
+
loading: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false
|
|
37
|
+
},
|
|
38
|
+
badgeNum: {
|
|
39
|
+
type: Number,
|
|
40
|
+
default: 0
|
|
41
|
+
},
|
|
42
|
+
isEmpty: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
data() {
|
|
48
|
+
return {
|
|
49
|
+
showMore: false
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
mounted() {
|
|
53
|
+
if (this.$listeners.more) {
|
|
54
|
+
this.showMore = true
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
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
|
+
|
|
68
|
+
.work-card--empty-title {
|
|
69
|
+
color: #cacaca;
|
|
70
|
+
padding-bottom: 80px;
|
|
71
|
+
margin-top: -16px;
|
|
72
|
+
}
|
|
73
|
+
</style>
|
package/src/index.js
CHANGED
|
@@ -60,6 +60,8 @@ import SelectDatePicker from './components/DateSelect/index.vue'
|
|
|
60
60
|
import QuarterDatePicker from './components/DateSelect/quarterDatePicker.vue'
|
|
61
61
|
import BusiDatePicker from './components/DateSelect/busiDate.vue'
|
|
62
62
|
import TableTransfer from './components/TableTransfer/index.vue'
|
|
63
|
+
import WorkCard from './components/WorkCard/index.vue'
|
|
64
|
+
import UploadMsg from './components/Upload/uploadMsg.vue'
|
|
63
65
|
|
|
64
66
|
// ECharts 不要打包进来
|
|
65
67
|
import Stamp from './components/Stamp/index.vue'
|
|
@@ -166,6 +168,8 @@ const components = [
|
|
|
166
168
|
QuarterDatePicker,
|
|
167
169
|
BusiDatePicker,
|
|
168
170
|
TableTransfer,
|
|
171
|
+
WorkCard,
|
|
172
|
+
UploadMsg,
|
|
169
173
|
/* old */
|
|
170
174
|
TableO,
|
|
171
175
|
FiltersO,
|
|
@@ -290,6 +294,8 @@ export {
|
|
|
290
294
|
QuarterDatePicker,
|
|
291
295
|
BusiDatePicker,
|
|
292
296
|
TableTransfer,
|
|
297
|
+
WorkCard,
|
|
298
|
+
UploadMsg,
|
|
293
299
|
/* 中建科 */
|
|
294
300
|
ApprovalCardZjk,
|
|
295
301
|
ApproveCardZjk,
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
/* 对ElementUI硬优化 */
|
|
2
|
-
import Popper from 'element-ui/lib/utils/popper.js'
|
|
3
|
-
|
|
4
1
|
import Vue from 'vue'
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
function hasClass(el, cls) {
|
|
8
|
-
if (!el || !cls) return false
|
|
9
|
-
if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.')
|
|
10
|
-
if (el.classList) {
|
|
11
|
-
return el.classList.contains(cls)
|
|
12
|
-
} else {
|
|
13
|
-
return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1
|
|
14
|
-
}
|
|
15
|
-
}
|
|
2
|
+
import ElementUI from 'element-ui'
|
|
16
3
|
|
|
17
4
|
function setPropsDefault(component, props) {
|
|
18
5
|
let c_props = component.props
|
|
@@ -27,127 +14,31 @@ function setMethodsDefault(component, methods) {
|
|
|
27
14
|
})
|
|
28
15
|
}
|
|
29
16
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {
|
|
36
|
-
const boundaries = __getBoundaries.call(this, data, padding, boundariesElement)
|
|
17
|
+
// setPropsDefault(ElementUI.Table, {
|
|
18
|
+
// tooltipEffect: {
|
|
19
|
+
// default: 'light'
|
|
20
|
+
// }
|
|
21
|
+
// })
|
|
37
22
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const html = root.document.documentElement
|
|
42
|
-
let width = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth)
|
|
43
|
-
let height = Math.max(
|
|
44
|
-
body.scrollHeight,
|
|
45
|
-
body.offsetHeight,
|
|
46
|
-
html.clientHeight,
|
|
47
|
-
html.scrollHeight,
|
|
48
|
-
html.offsetHeight
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
boundaries.right = boundaries.right - root.document.documentElement.clientWidth + width
|
|
52
|
-
boundaries.bottom = boundaries.bottom - root.document.documentElement.clientHeight + height
|
|
53
|
-
}
|
|
54
|
-
return boundaries
|
|
55
|
-
}
|
|
23
|
+
setPropsDefault(ElementUI.TableColumn, {
|
|
24
|
+
filterPlacement: {
|
|
25
|
+
default: 'bottom'
|
|
56
26
|
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export default function (ElementUI) {
|
|
60
|
-
repairPopper()
|
|
61
|
-
|
|
62
|
-
// setPropsDefault(ElementUI.Table, {
|
|
63
|
-
// tooltipEffect: {
|
|
64
|
-
// default: 'light'
|
|
65
|
-
// }
|
|
66
|
-
// })
|
|
67
|
-
|
|
68
|
-
setPropsDefault(ElementUI.TableColumn, {
|
|
69
|
-
filterPlacement: {
|
|
70
|
-
default: 'bottom'
|
|
71
|
-
}
|
|
72
|
-
})
|
|
27
|
+
})
|
|
73
28
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
setPropsDefault(ElementUI.Dialog, {
|
|
81
|
-
appendToBody: {
|
|
82
|
-
default: true
|
|
83
|
-
}
|
|
84
|
-
})
|
|
85
|
-
// 设置表头最小宽度,保证表头不换行
|
|
86
|
-
setMethodsDefault(ElementUI.TableColumn, {
|
|
87
|
-
setColumnWidth(column) {
|
|
88
|
-
if (this.realWidth) {
|
|
89
|
-
column.width = this.realWidth
|
|
90
|
-
}
|
|
91
|
-
if (this.realMinWidth) {
|
|
92
|
-
column.minWidth = this.realMinWidth
|
|
93
|
-
}
|
|
94
|
-
if (!column.minWidth) {
|
|
95
|
-
if (!column.width) {
|
|
96
|
-
let label = column.label || ''
|
|
97
|
-
let labels = label.match(/./gu) || []
|
|
98
|
-
let labelW = 0
|
|
99
|
-
labels.forEach((s) => (labelW += ASCII_W[s] || 14))
|
|
100
|
-
|
|
101
|
-
let sortable = column.sortable ? 24 : 0
|
|
102
|
-
let filters = column.filters ? 16 : 0
|
|
103
|
-
column.minWidth = Math.max(80, labelW + 22 + sortable + filters)
|
|
104
|
-
} else {
|
|
105
|
-
column.minWidth = 80
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
column.realWidth = column.width === undefined ? column.minWidth : column.width
|
|
109
|
-
return column
|
|
110
|
-
}
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
// 美化表头搜索
|
|
114
|
-
if (ElementUI.Table.components.TableHeader) {
|
|
115
|
-
setMethodsDefault(ElementUI.Table.components.TableHeader, {
|
|
116
|
-
handleFilterClick(event, column) {
|
|
117
|
-
event.stopPropagation()
|
|
118
|
-
const target = event.target
|
|
119
|
-
let cell = target.tagName === 'TH' ? target : target.parentNode
|
|
120
|
-
if (hasClass(cell, 'noclick')) return
|
|
121
|
-
cell = cell.querySelector('.el-table__column-filter-trigger') || cell
|
|
122
|
-
const table = this.$parent
|
|
123
|
-
|
|
124
|
-
let filterPanel = this.filterPanels[column.id]
|
|
125
|
-
|
|
126
|
-
if (filterPanel && column.filterOpened) {
|
|
127
|
-
filterPanel.showPopper = false
|
|
128
|
-
return
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (!filterPanel) {
|
|
132
|
-
filterPanel = new Vue(FilterPanel)
|
|
133
|
-
this.filterPanels[column.id] = filterPanel
|
|
134
|
-
if (column.filterPlacement) {
|
|
135
|
-
filterPanel.placement = column.filterPlacement
|
|
136
|
-
}
|
|
137
|
-
filterPanel.table = table
|
|
138
|
-
filterPanel.cell = cell
|
|
139
|
-
filterPanel.column = column
|
|
140
|
-
!this.$isServer && filterPanel.$mount(document.createElement('div'))
|
|
141
|
-
}
|
|
29
|
+
setPropsDefault(ElementUI.Dropdown, {
|
|
30
|
+
placement: {
|
|
31
|
+
default: 'bottom'
|
|
32
|
+
}
|
|
33
|
+
})
|
|
142
34
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
})
|
|
35
|
+
setPropsDefault(ElementUI.Dialog, {
|
|
36
|
+
appendToBody: {
|
|
37
|
+
default: true
|
|
148
38
|
}
|
|
149
|
-
}
|
|
39
|
+
})
|
|
150
40
|
|
|
41
|
+
// 设置表头最小宽度,保证表头不换行
|
|
151
42
|
const ASCII_W = {
|
|
152
43
|
' ': 4.125,
|
|
153
44
|
0: 8.21875,
|
|
@@ -245,3 +136,111 @@ const ASCII_W = {
|
|
|
245
136
|
'}': 4.6875,
|
|
246
137
|
'~': 10.390625
|
|
247
138
|
}
|
|
139
|
+
setMethodsDefault(ElementUI.TableColumn, {
|
|
140
|
+
setColumnWidth(column) {
|
|
141
|
+
if (this.realWidth) {
|
|
142
|
+
column.width = this.realWidth
|
|
143
|
+
}
|
|
144
|
+
if (this.realMinWidth) {
|
|
145
|
+
column.minWidth = this.realMinWidth
|
|
146
|
+
}
|
|
147
|
+
if (!column.minWidth) {
|
|
148
|
+
if (!column.width) {
|
|
149
|
+
let label = column.label || ''
|
|
150
|
+
let labels = label.match(/./gu) || []
|
|
151
|
+
let labelW = 0
|
|
152
|
+
labels.forEach((s) => (labelW += ASCII_W[s] || 14))
|
|
153
|
+
|
|
154
|
+
let sortable = column.sortable ? 24 : 0
|
|
155
|
+
let filters = column.filters ? 16 : 0
|
|
156
|
+
column.minWidth = Math.max(80, labelW + 22 + sortable + filters)
|
|
157
|
+
} else {
|
|
158
|
+
column.minWidth = 80
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
column.realWidth = column.width === undefined ? column.minWidth : column.width
|
|
162
|
+
return column
|
|
163
|
+
}
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
// 美化表头搜索
|
|
167
|
+
import FilterPanel from './tableheaderFilterpanel.vue'
|
|
168
|
+
function hasClass(el, cls) {
|
|
169
|
+
if (!el || !cls) return false
|
|
170
|
+
if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.')
|
|
171
|
+
if (el.classList) {
|
|
172
|
+
return el.classList.contains(cls)
|
|
173
|
+
} else {
|
|
174
|
+
return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (ElementUI.Table.components.TableHeader) {
|
|
178
|
+
setMethodsDefault(ElementUI.Table.components.TableHeader, {
|
|
179
|
+
handleFilterClick(event, column) {
|
|
180
|
+
event.stopPropagation()
|
|
181
|
+
const target = event.target
|
|
182
|
+
let cell = target.tagName === 'TH' ? target : target.parentNode
|
|
183
|
+
if (hasClass(cell, 'noclick')) return
|
|
184
|
+
cell = cell.querySelector('.el-table__column-filter-trigger') || cell
|
|
185
|
+
const table = this.$parent
|
|
186
|
+
|
|
187
|
+
let filterPanel = this.filterPanels[column.id]
|
|
188
|
+
|
|
189
|
+
if (filterPanel && column.filterOpened) {
|
|
190
|
+
filterPanel.showPopper = false
|
|
191
|
+
return
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (!filterPanel) {
|
|
195
|
+
filterPanel = new Vue(FilterPanel)
|
|
196
|
+
this.filterPanels[column.id] = filterPanel
|
|
197
|
+
if (column.filterPlacement) {
|
|
198
|
+
filterPanel.placement = column.filterPlacement
|
|
199
|
+
}
|
|
200
|
+
filterPanel.table = table
|
|
201
|
+
filterPanel.cell = cell
|
|
202
|
+
filterPanel.column = column
|
|
203
|
+
!this.$isServer && filterPanel.$mount(document.createElement('div'))
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
setTimeout(() => {
|
|
207
|
+
filterPanel.showPopper = true
|
|
208
|
+
}, 16)
|
|
209
|
+
}
|
|
210
|
+
})
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* 对ElementUI硬优化 */
|
|
214
|
+
import Popper from 'element-ui/lib/utils/popper.js'
|
|
215
|
+
function repairPopper() {
|
|
216
|
+
if (!Popper.prototype.repairR) {
|
|
217
|
+
Popper.prototype.repairR = true
|
|
218
|
+
|
|
219
|
+
let __getBoundaries = Popper.prototype._getBoundaries
|
|
220
|
+
Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {
|
|
221
|
+
const boundaries = __getBoundaries.call(this, data, padding, boundariesElement)
|
|
222
|
+
|
|
223
|
+
if (this._options.boundariesElement === 'viewport') {
|
|
224
|
+
const root = window
|
|
225
|
+
const body = root.document.body
|
|
226
|
+
const html = root.document.documentElement
|
|
227
|
+
let width = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth)
|
|
228
|
+
let height = Math.max(
|
|
229
|
+
body.scrollHeight,
|
|
230
|
+
body.offsetHeight,
|
|
231
|
+
html.clientHeight,
|
|
232
|
+
html.scrollHeight,
|
|
233
|
+
html.offsetHeight
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
boundaries.right = boundaries.right - root.document.documentElement.clientWidth + width
|
|
237
|
+
boundaries.bottom = boundaries.bottom - root.document.documentElement.clientHeight + height
|
|
238
|
+
}
|
|
239
|
+
return boundaries
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export default function () {
|
|
245
|
+
repairPopper()
|
|
246
|
+
}
|
package/src/utils/xls2json.js
CHANGED
|
@@ -34,7 +34,12 @@ export default async function toJson(file, name) {
|
|
|
34
34
|
rowsc.forEach((r) => {
|
|
35
35
|
let row = []
|
|
36
36
|
cols.forEach((c) => {
|
|
37
|
-
|
|
37
|
+
let d = r[c]
|
|
38
|
+
if (d instanceof Date && d.getHours() === 23 && d.getMinutes() === 59) {
|
|
39
|
+
d.setDate(d.getDate() + 1)
|
|
40
|
+
d.setHours(0, 0, 0)
|
|
41
|
+
}
|
|
42
|
+
row.push(d)
|
|
38
43
|
})
|
|
39
44
|
rows.push(row)
|
|
40
45
|
})
|