n20-common-lib 1.3.43 → 1.3.46
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/nstc-g6/components/NstcElectronicFile/NstcElectronicFile.vue +168 -48
- package/nstc-g6/components/NstcUploadCustomExcel/NstcUploadCustomExcel.vue +153 -155
- package/{src → nstc-g6}/utils/mapper_aims.js +0 -0
- package/package.json +3 -2
- package/src/components/ApprovalRecord/approvalImgPro.vue +120 -15
- package/src/components/DragList/index.vue +5 -1
- package/src/components/ECharts/index.vue +5 -2
- package/src/components/InputNumber/index.vue +1 -1
- package/src/components/LoginTemporary/form.vue +8 -2
- package/src/components/LoginTemporary/index.vue +16 -17
- package/src/components/LoginTemporary/qrcode.vue +5 -3
- package/src/components/Statis/index.vue +2 -0
- package/src/components/Statis/statisItem.vue +7 -2
- package/src/components/Table/index.vue +2 -49
- package/src/components/TableOperateColumn/OperateBtns.vue +13 -0
- package/src/index.js +1 -0
- package/src/utils/importGlobal.js +16 -0
- package/src/utils/toExcel.js +10 -2
- package/src/utils/xls2json.js +6 -2
- package/src/utils/xlsx2json.js +6 -2
- package/style/index.css +1 -1
- package/style/index.css.map +1 -1
- package/theme/blue.css +1 -1
- package/theme/green.css +1 -1
- package/theme/lightBlue.css +1 -1
- package/theme/orange.css +1 -1
- package/theme/purple.css +1 -1
- package/theme/red.css +1 -1
- package/theme/yellow.css +1 -1
- package/src/assets/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/Empty/.DS_Store +0 -0
- package/src/components/Empty/img/.DS_Store +0 -0
- package/src/components/Layout/.DS_Store +0 -0
- package/src/components/Table/ThSelectHeader.vue +0 -128
- package/src/plugins/.DS_Store +0 -0
- package/src/plugins/Sign/.DS_Store +0 -0
|
@@ -2,21 +2,56 @@
|
|
|
2
2
|
<div class="n20-approval-img-por">
|
|
3
3
|
<svg v-pre style="display: none">
|
|
4
4
|
<symbol id="symbol_node_User">
|
|
5
|
-
<g transform="translate(
|
|
5
|
+
<g transform="translate(8, 6)">
|
|
6
6
|
<path
|
|
7
|
-
d="
|
|
7
|
+
d="M8.62859063,8.46867126 L8.63329414,8.24055098 C9.71745339,7.48328573 10.2442466,6.14748866 10.2442466,4.16966236 C10.2442466,2.26238871 9.05190661,1.12413909 7.0529145,1.12413909 L6.94473376,1.12413909 C4.9480934,1.12413909 3.75340165,2.26238871 3.75340165,4.16966236 C3.75340165,6.13808165 4.28489838,7.47387871 5.37846464,8.23584747 L5.37846464,8.4663195 C3.55820594,8.71090206 1.73324375,9.43524274 1.73324375,10.5429195 C1.73324375,12.0927264 3.50411558,12.8782127 6.99882412,12.8782127 C10.4935327,12.8782127 12.2644045,12.0927264 12.2644045,10.5429195 C12.2644045,9.4375945 10.4441458,8.71325383 8.62859063,8.46867126 Z"
|
|
8
8
|
/>
|
|
9
9
|
</g>
|
|
10
10
|
</symbol>
|
|
11
11
|
<symbol id="symbol_node_Department">
|
|
12
|
-
<g transform="translate(8,
|
|
12
|
+
<g transform="translate(8,6)">
|
|
13
13
|
<path
|
|
14
|
-
d="
|
|
14
|
+
d="M7.04500001,8.5975 C7.04341917,8.43233903 7.11928944,8.27597225 7.25,8.175 C8.13981911,7.5076991 8.659503,6.45719523 8.65,5.34499999 L8.65,3.7075 C8.65,1.93500001 7.2825,0.500000006 5.59250001,0.500000006 L5.0925,0.500000006 C3.40500001,0.500000006 2.03749999,1.93500001 2.03749999,3.7075 L2.03749999,5.34499999 C2.02858505,6.45763799 2.54923878,7.50822626 3.44000001,8.175 C3.56977164,8.27648552 3.64467827,8.43277221 3.6425,8.5975 C3.64849065,8.83992543 3.4853373,9.05399926 3.25,9.1125 C1.335,9.50000001 0,10.4025 0,11.4525 C0,12.86 2.3925,14 5.3425,14 C8.29249999,14 10.6875,12.86 10.6875,11.4525 C10.6875,10.4025 9.35250001,9.5025 7.4375,9.1125 C7.20216271,9.05399926 7.03900935,8.83992543 7.04500001,8.5975 Z M11.84,5.75000001 C11.7079451,5.71733762 11.6061675,5.61208512 11.5779553,5.47900848 C11.549743,5.34593185 11.6000579,5.20843574 11.7075,5.125 C12.3007336,4.67960715 12.6476383,3.97930492 12.6425,3.2375 L12.6425,2.1375 C12.6690444,0.984062183 11.7559203,0.0272961173 10.6025,0 L10.2725,0 C9.40687566,0.0115235348 8.64254102,0.567494343 8.365,1.3875 C8.87621704,2.05264244 9.15230637,2.86860072 9.15,3.7075 L9.15,5.10250001 L9.1675,5.11749999 C9.26100971,5.18903404 9.3126331,5.30253015 9.30510153,5.42002253 C9.29756997,5.53751492 9.23187787,5.6434908 9.13,5.7025 C9.04235466,6.75161502 8.54690721,7.72455893 7.75,8.4125 C8.58510108,8.82290154 9.50732647,9.0245043 10.4375,9 C12.405,9 14,8.24999999 14,7.3025 C14,6.6025 13.11,6 11.84,5.75000001 Z"
|
|
15
15
|
/>
|
|
16
16
|
</g>
|
|
17
17
|
</symbol>
|
|
18
18
|
</svg>
|
|
19
19
|
<div ref="activiti-svg-wrap" class="activiti-svg-wrap"></div>
|
|
20
|
+
<div class="flex-box activiti-svg-zoom">
|
|
21
|
+
<el-button
|
|
22
|
+
type="text"
|
|
23
|
+
icon="el-icon-zoom-out"
|
|
24
|
+
style="font-size: 18px"
|
|
25
|
+
@click="scaleMinus"
|
|
26
|
+
/>
|
|
27
|
+
<el-slider
|
|
28
|
+
v-model="zoomValue"
|
|
29
|
+
class="m-l m-r"
|
|
30
|
+
:min="min"
|
|
31
|
+
:max="max"
|
|
32
|
+
:step="step"
|
|
33
|
+
:format-tooltip="$options.filters.zoomFormat"
|
|
34
|
+
style="width: 200px"
|
|
35
|
+
/>
|
|
36
|
+
<el-button
|
|
37
|
+
type="text"
|
|
38
|
+
icon="el-icon-zoom-in"
|
|
39
|
+
style="font-size: 18px"
|
|
40
|
+
@click="scaleAdd"
|
|
41
|
+
/>
|
|
42
|
+
<span
|
|
43
|
+
class="m-l-s m-r-s"
|
|
44
|
+
style="display: inline-block; width: 38px; line-height: 38px"
|
|
45
|
+
>{{ zoomValue | zoomFormat }}</span
|
|
46
|
+
>
|
|
47
|
+
<el-button
|
|
48
|
+
type="text"
|
|
49
|
+
icon="el-icon-full-screen"
|
|
50
|
+
style="font-size: 16px"
|
|
51
|
+
@click="scaleReset"
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
20
55
|
<div ref="msgEl" class="activiti-msg">
|
|
21
56
|
<div>
|
|
22
57
|
<span class="color-primary">待审批: </span>{{ daishengpi.toString() }}
|
|
@@ -29,15 +64,29 @@
|
|
|
29
64
|
</template>
|
|
30
65
|
|
|
31
66
|
<script>
|
|
67
|
+
import importG from '../../utils/importGlobal.js'
|
|
32
68
|
import { tipShow, tipHide } from '../../directives/VTitle/index.js'
|
|
33
|
-
|
|
34
69
|
export default {
|
|
70
|
+
filters: {
|
|
71
|
+
zoomFormat(val) {
|
|
72
|
+
return parseInt(val * 10) + '0%'
|
|
73
|
+
}
|
|
74
|
+
},
|
|
35
75
|
data() {
|
|
36
76
|
this.svgW = undefined
|
|
37
77
|
this.svgC = undefined
|
|
38
78
|
return {
|
|
39
79
|
daishengpi: [],
|
|
40
|
-
yishengpi: []
|
|
80
|
+
yishengpi: [],
|
|
81
|
+
min: 0.4,
|
|
82
|
+
max: 2,
|
|
83
|
+
step: 0.1,
|
|
84
|
+
zoomValue: 1
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
watch: {
|
|
88
|
+
zoomValue() {
|
|
89
|
+
this.scaleSvg()
|
|
41
90
|
}
|
|
42
91
|
},
|
|
43
92
|
async mounted() {
|
|
@@ -53,14 +102,28 @@ export default {
|
|
|
53
102
|
taskDefIdMap.forEach((obj) => {
|
|
54
103
|
this.addEvent(obj)
|
|
55
104
|
})
|
|
105
|
+
let { default: panzoom } = await importG('panzoom', () =>
|
|
106
|
+
import(/*webpackChunkName: "panzoom"*/ 'panzoom')
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
this.svgPanzoom = panzoom(this.svgC, {
|
|
110
|
+
maxZoom: this.max,
|
|
111
|
+
minZoom: this.min,
|
|
112
|
+
bounds: true,
|
|
113
|
+
boundsPadding: 0.1,
|
|
114
|
+
beforeWheel: function (e) {
|
|
115
|
+
return !e.ctrlKey
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
this.svgPanzoom.on('zoom', (e) => {
|
|
119
|
+
let { scale } = e.getTransform()
|
|
120
|
+
this.zoomValue = scale
|
|
121
|
+
})
|
|
122
|
+
},
|
|
123
|
+
beforeDestroy() {
|
|
124
|
+
this.svgPanzoom && this.svgPanzoom.dispose()
|
|
56
125
|
},
|
|
57
126
|
methods: {
|
|
58
|
-
Fn() {
|
|
59
|
-
tipShow(
|
|
60
|
-
document.getElementById('xxx-yyy'),
|
|
61
|
-
document.getElementById('popper-x')
|
|
62
|
-
)
|
|
63
|
-
},
|
|
64
127
|
setSvgAttrs(str) {
|
|
65
128
|
this.svgW.innerHTML = str
|
|
66
129
|
this.svgC = this.svgW.querySelector('svg')
|
|
@@ -184,9 +247,32 @@ export default {
|
|
|
184
247
|
task.addEventListener('mouseleave', () => {
|
|
185
248
|
tipHide(task)
|
|
186
249
|
})
|
|
250
|
+
},
|
|
251
|
+
scaleMinus() {
|
|
252
|
+
let newVal = this.zoomValue - this.step
|
|
253
|
+
if (this.min <= newVal) {
|
|
254
|
+
this.zoomValue = newVal
|
|
255
|
+
} else {
|
|
256
|
+
this.zoomValue = this.min
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
scaleAdd() {
|
|
260
|
+
let newVal = this.zoomValue + this.step
|
|
261
|
+
if (newVal < this.max) {
|
|
262
|
+
this.zoomValue = newVal
|
|
263
|
+
} else {
|
|
264
|
+
this.zoomValue = this.max
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
scaleReset() {
|
|
268
|
+
this.zoomValue = 1
|
|
269
|
+
},
|
|
270
|
+
scaleSvg() {
|
|
271
|
+
this.svgPanzoom && this.svgPanzoom.zoomAbs(0, 0, this.zoomValue)
|
|
187
272
|
}
|
|
188
273
|
}
|
|
189
274
|
}
|
|
275
|
+
|
|
190
276
|
/*
|
|
191
277
|
setRejectLink(from, to) {
|
|
192
278
|
console.log(this.getElRect(from), 444)
|
|
@@ -282,14 +368,33 @@ setRejectLink(from, to) {
|
|
|
282
368
|
</script>
|
|
283
369
|
|
|
284
370
|
<style>
|
|
285
|
-
.n20-approval-img-por
|
|
286
|
-
|
|
287
|
-
|
|
371
|
+
.n20-approval-img-por {
|
|
372
|
+
width: 100%;
|
|
373
|
+
height: 100%;
|
|
374
|
+
position: relative;
|
|
375
|
+
}
|
|
376
|
+
.activiti-svg-wrap {
|
|
377
|
+
width: 100%;
|
|
378
|
+
height: 100%;
|
|
379
|
+
overflow: auto;
|
|
288
380
|
}
|
|
289
381
|
.n20-approval-img-por .activiti-msg {
|
|
290
382
|
display: none;
|
|
291
383
|
}
|
|
384
|
+
.activiti-svg-zoom {
|
|
385
|
+
position: absolute;
|
|
386
|
+
z-index: 9;
|
|
387
|
+
right: 0;
|
|
388
|
+
bottom: 0;
|
|
389
|
+
}
|
|
292
390
|
|
|
391
|
+
.n20-approval-img-por .djs-hit-all,
|
|
392
|
+
.n20-approval-img-por .djs-outline {
|
|
393
|
+
display: none !important;
|
|
394
|
+
}
|
|
395
|
+
.n20-approval-img-por use {
|
|
396
|
+
fill: #b2b2b2 !important;
|
|
397
|
+
}
|
|
293
398
|
.activiti-node-achieve circle,
|
|
294
399
|
.activiti-node-achieve rect,
|
|
295
400
|
.activiti-line-achieve path {
|
|
@@ -24,10 +24,14 @@
|
|
|
24
24
|
</template>
|
|
25
25
|
|
|
26
26
|
<script>
|
|
27
|
+
import importG from '../../utils/importGlobal.js'
|
|
27
28
|
export default {
|
|
28
29
|
name: 'DragList',
|
|
29
30
|
components: {
|
|
30
|
-
vueDraggable: () =>
|
|
31
|
+
vueDraggable: () =>
|
|
32
|
+
importG('vuedraggable', () =>
|
|
33
|
+
import(/*webpackChunkName: "vuedraggable"*/ 'vuedraggable')
|
|
34
|
+
)
|
|
31
35
|
},
|
|
32
36
|
props: {
|
|
33
37
|
list: {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
6
|
-
import * as echarts from 'echarts'
|
|
7
6
|
import resize from './mixins/resize'
|
|
8
7
|
import merge from 'lodash/merge'
|
|
8
|
+
import importG from '../../utils/importGlobal.js'
|
|
9
9
|
|
|
10
10
|
import { color, axisConfig, pieConfig } from './define'
|
|
11
11
|
|
|
@@ -57,7 +57,10 @@ export default {
|
|
|
57
57
|
},
|
|
58
58
|
|
|
59
59
|
methods: {
|
|
60
|
-
initChart() {
|
|
60
|
+
async initChart() {
|
|
61
|
+
let echarts = await importG('echarts', () =>
|
|
62
|
+
import(/*webpackChunkName "echarts"*/ 'echarts')
|
|
63
|
+
)
|
|
61
64
|
this.chart = echarts.init(this.$refs['chart'])
|
|
62
65
|
this.setOption()
|
|
63
66
|
},
|
|
@@ -98,7 +98,7 @@ export default {
|
|
|
98
98
|
if (val && typeof val === 'string' && val.includes(',')) {
|
|
99
99
|
return this.$emit('input', Number(val.replace(/,/g, '')))
|
|
100
100
|
}
|
|
101
|
-
this.preValue = val
|
|
101
|
+
this.preValue = val || (val === 0 ? 0 : '')
|
|
102
102
|
this.valueStr = this.num2str(val)
|
|
103
103
|
},
|
|
104
104
|
immediate: true
|
|
@@ -173,11 +173,11 @@
|
|
|
173
173
|
</template>
|
|
174
174
|
|
|
175
175
|
<script>
|
|
176
|
-
import decode from 'jsonwebtoken/decode'
|
|
177
176
|
import axios from '../../utils/axios'
|
|
178
177
|
import auth from '../../utils/auth'
|
|
179
178
|
import qrCode from './qrcode.vue'
|
|
180
179
|
import { siteTree2menus, siteTree2RelaNos } from './utils'
|
|
180
|
+
import importG from '../../utils/importGlobal.js'
|
|
181
181
|
|
|
182
182
|
function encode(pwd = '', key = 0) {
|
|
183
183
|
if (pwd === '') return ''
|
|
@@ -492,9 +492,15 @@ export default {
|
|
|
492
492
|
})
|
|
493
493
|
},
|
|
494
494
|
// 登录成功后
|
|
495
|
-
loginAfter(data) {
|
|
495
|
+
async loginAfter(data) {
|
|
496
496
|
auth.setToken(data.accessToken)
|
|
497
497
|
try {
|
|
498
|
+
let { default: decode } = await importG('jsonwebtoken/decode', () =>
|
|
499
|
+
import(
|
|
500
|
+
/*webpackChunkName: "jsonwebtoken_decode"*/ 'jsonwebtoken/decode'
|
|
501
|
+
)
|
|
502
|
+
)
|
|
503
|
+
|
|
498
504
|
let tokenObj = decode(data.accessToken)
|
|
499
505
|
let userInfo = JSON.parse(tokenObj.user_name)
|
|
500
506
|
this.userNo = userInfo.userNo
|
|
@@ -92,24 +92,23 @@ export default {
|
|
|
92
92
|
methods: {
|
|
93
93
|
async init() {
|
|
94
94
|
const { _layoutData } = await getJsonc('/server-config.jsonc')
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
this.setConfig()
|
|
98
|
-
} else {
|
|
99
|
-
axios
|
|
100
|
-
.get(`/bems/1.0/sysSetting/list`, null, {
|
|
101
|
-
loading: false,
|
|
102
|
-
noMsg: true
|
|
103
|
-
})
|
|
104
|
-
.then(({ data }) => {
|
|
105
|
-
this.getdata(data)
|
|
106
|
-
})
|
|
107
|
-
.finally(() => {
|
|
108
|
-
this.setConfig()
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
this.getLogoImag()
|
|
95
|
+
if (_layoutData && _layoutData.loginSetting === 'JSON') {
|
|
96
|
+
return this.setConfig()
|
|
112
97
|
}
|
|
98
|
+
|
|
99
|
+
axios
|
|
100
|
+
.get(`/bems/1.0/sysSetting/list`, null, {
|
|
101
|
+
loading: false,
|
|
102
|
+
noMsg: true
|
|
103
|
+
})
|
|
104
|
+
.then(({ data }) => {
|
|
105
|
+
this.getdata(data)
|
|
106
|
+
})
|
|
107
|
+
.finally(() => {
|
|
108
|
+
this.setConfig()
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
this.getLogoImag()
|
|
113
112
|
},
|
|
114
113
|
async getLogoImag() {
|
|
115
114
|
axios
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
</div>
|
|
21
21
|
</template>
|
|
22
22
|
<script>
|
|
23
|
-
import QRCode from 'qrcode'
|
|
24
23
|
import axios from '../../utils/axios'
|
|
24
|
+
import importG from '../../utils/importGlobal.js'
|
|
25
25
|
|
|
26
26
|
export default {
|
|
27
27
|
data() {
|
|
@@ -48,12 +48,14 @@ export default {
|
|
|
48
48
|
|
|
49
49
|
axios
|
|
50
50
|
.get('/bems/prod_1.0/uas/api/qrCode', null, { loading })
|
|
51
|
-
.then(({ data }) => {
|
|
51
|
+
.then(async ({ data }) => {
|
|
52
52
|
this.qrCode = data.qrCode
|
|
53
53
|
|
|
54
54
|
let qrCanvas = this.$refs['qr-canvas']
|
|
55
55
|
let width = qrCanvas.clientWidth
|
|
56
|
-
|
|
56
|
+
let { default: QRCode } = await importG('qrcode', () =>
|
|
57
|
+
import(/*webpackChunkName: "qrcode"*/ 'qrcode')
|
|
58
|
+
)
|
|
57
59
|
QRCode.toCanvas(this.$refs['qr-canvas'], this.qrCode, {
|
|
58
60
|
width: width,
|
|
59
61
|
height: width,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
class="n20-primary"
|
|
10
10
|
>{{ item.value }}</span
|
|
11
11
|
><span v-else class="n20-primary">{{
|
|
12
|
-
item | numerify('0,0.00', showW)
|
|
12
|
+
item | numerify('0,0.00', showW, showU)
|
|
13
13
|
}}</span></span
|
|
14
14
|
>
|
|
15
15
|
</div>
|
|
@@ -22,7 +22,8 @@ const n = 10000
|
|
|
22
22
|
export default {
|
|
23
23
|
name: 'StatisItem',
|
|
24
24
|
filters: {
|
|
25
|
-
numerify({ label, value, unit = ''
|
|
25
|
+
numerify({ label, value }, f, w, unit = '') {
|
|
26
|
+
unit = unit ? (unit === true ? '元' : unit) : ''
|
|
26
27
|
if (!w) {
|
|
27
28
|
return numerify(value, f) + unit
|
|
28
29
|
} else {
|
|
@@ -51,6 +52,10 @@ export default {
|
|
|
51
52
|
type: Boolean,
|
|
52
53
|
default: false
|
|
53
54
|
},
|
|
55
|
+
showU: {
|
|
56
|
+
type: [Boolean, String],
|
|
57
|
+
default: false
|
|
58
|
+
},
|
|
54
59
|
countLabel: {
|
|
55
60
|
type: Array,
|
|
56
61
|
default: () => ['笔数']
|
|
@@ -23,23 +23,12 @@
|
|
|
23
23
|
:formatter="item.formatter | colfF(item.formatterMap)"
|
|
24
24
|
:filters="item.filters | colftF(filtersMap)"
|
|
25
25
|
v-bind="item"
|
|
26
|
-
|
|
27
|
-
<template v-if="item.filterPre" slot="header">
|
|
28
|
-
{{ item.label }}
|
|
29
|
-
<th-select-header
|
|
30
|
-
:property="item.prop"
|
|
31
|
-
:data-list="dataList"
|
|
32
|
-
:check-list="checkList"
|
|
33
|
-
@selectChange="selectChange"
|
|
34
|
-
/>
|
|
35
|
-
</template>
|
|
36
|
-
</el-table-column>
|
|
26
|
+
/>
|
|
37
27
|
</template>
|
|
38
28
|
</el-table>
|
|
39
29
|
</template>
|
|
40
30
|
|
|
41
31
|
<script>
|
|
42
|
-
import thSelectHeader from './ThSelectHeader.vue'
|
|
43
32
|
import { colfF, colftF } from './filters'
|
|
44
33
|
|
|
45
34
|
const columnRender = {
|
|
@@ -59,8 +48,7 @@ const columnRender = {
|
|
|
59
48
|
export default {
|
|
60
49
|
name: 'Table',
|
|
61
50
|
components: {
|
|
62
|
-
columnRender
|
|
63
|
-
thSelectHeader
|
|
51
|
+
columnRender
|
|
64
52
|
},
|
|
65
53
|
filters: {
|
|
66
54
|
colfF,
|
|
@@ -96,41 +84,6 @@ export default {
|
|
|
96
84
|
type: [String, Number],
|
|
97
85
|
default: undefined
|
|
98
86
|
}
|
|
99
|
-
},
|
|
100
|
-
data() {
|
|
101
|
-
return {
|
|
102
|
-
checkList: {},
|
|
103
|
-
rules: [],
|
|
104
|
-
dataList: []
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
created() {
|
|
108
|
-
this.dataList = JSON.parse(JSON.stringify(this.data))
|
|
109
|
-
for (let k in this.dataList[0]) {
|
|
110
|
-
this.checkList[k] = []
|
|
111
|
-
}
|
|
112
|
-
for (let i in this.dataList) {
|
|
113
|
-
for (let k in this.dataList[i]) {
|
|
114
|
-
if (!this.checkList[k].some((item) => item === this.dataList[i][k])) {
|
|
115
|
-
this.checkList[k].push(this.dataList[i][k])
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
methods: {
|
|
121
|
-
selectChange(val) {
|
|
122
|
-
console.log(val)
|
|
123
|
-
let property = val['property']
|
|
124
|
-
let value = val['value']
|
|
125
|
-
// 遍历过滤条件
|
|
126
|
-
if (!value.length) {
|
|
127
|
-
this.data = this.dataList
|
|
128
|
-
} else {
|
|
129
|
-
this.data = this.dataList.filter((item) =>
|
|
130
|
-
value.some((c) => item[property] === c)
|
|
131
|
-
)
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
87
|
}
|
|
135
88
|
}
|
|
136
89
|
</script>
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
:key="item.label"
|
|
6
6
|
type="text"
|
|
7
7
|
size="mini"
|
|
8
|
+
:disabled="item.disabled | dbdBtn(row)"
|
|
8
9
|
@click="$emit('command', item.command)"
|
|
9
10
|
>{{ item.label }}</el-button
|
|
10
11
|
>
|
|
@@ -15,6 +16,7 @@
|
|
|
15
16
|
v-for="item in moreBtns"
|
|
16
17
|
:key="item.label"
|
|
17
18
|
:command="item.command"
|
|
19
|
+
:disabled="item.disabled | dbdBtn(row)"
|
|
18
20
|
>{{ item.label }}</el-dropdown-item
|
|
19
21
|
>
|
|
20
22
|
</el-dropdown-menu>
|
|
@@ -24,6 +26,17 @@
|
|
|
24
26
|
|
|
25
27
|
<script>
|
|
26
28
|
export default {
|
|
29
|
+
filters: {
|
|
30
|
+
dbdBtn(dbd, row) {
|
|
31
|
+
if (dbd === undefined || dbd === null) {
|
|
32
|
+
return false
|
|
33
|
+
} else if (typeof dbd === 'boolean') {
|
|
34
|
+
return dbd
|
|
35
|
+
} else if (typeof dbd === 'function') {
|
|
36
|
+
return dbd(row)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
27
40
|
props: {
|
|
28
41
|
btnList: {
|
|
29
42
|
type: Array,
|
package/src/index.js
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
window._g_import_g_ || (window._g_import_g_ = {})
|
|
2
|
+
|
|
3
|
+
function importG(name, ipt) {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
if (window._g_import_g_[name]) {
|
|
6
|
+
resolve(window._g_import_g_[name])
|
|
7
|
+
} else {
|
|
8
|
+
ipt().then((_module) => {
|
|
9
|
+
window._g_import_g_[name] = _module
|
|
10
|
+
resolve(_module)
|
|
11
|
+
})
|
|
12
|
+
}
|
|
13
|
+
})
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default importG
|
package/src/utils/toExcel.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import importG from './importGlobal.js'
|
|
2
|
+
|
|
3
|
+
export default async function toExcel({
|
|
4
|
+
columns = [],
|
|
5
|
+
rows = [],
|
|
6
|
+
name = 'sheet01'
|
|
7
|
+
}) {
|
|
8
|
+
let { default: ExcelJS } = await importG('exceljs', () =>
|
|
9
|
+
import(/*webpackChunkName: "exceljs"*/ 'exceljs')
|
|
10
|
+
)
|
|
2
11
|
|
|
3
|
-
export default function toExcel({ columns = [], rows = [], name = 'sheet01' }) {
|
|
4
12
|
// 创建工作簿
|
|
5
13
|
const workbook = new ExcelJS.Workbook()
|
|
6
14
|
// 创建工作表
|
package/src/utils/xls2json.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import importG from './importGlobal.js'
|
|
2
|
+
|
|
3
|
+
export default async function toJson(file, name) {
|
|
4
|
+
const { read, utils } = await importG('xlsx', () =>
|
|
5
|
+
import(/*webpackChunkName: "xlsx"*/ 'xlsx')
|
|
6
|
+
)
|
|
2
7
|
|
|
3
|
-
export default function toJson(file, name) {
|
|
4
8
|
let pro = new Promise((resolve, reject) => {
|
|
5
9
|
if (file instanceof Blob) {
|
|
6
10
|
file.arrayBuffer().then((array) => {
|
package/src/utils/xlsx2json.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import importG from './importGlobal.js'
|
|
2
|
+
|
|
3
|
+
export default async function toJson(file, name) {
|
|
4
|
+
let { default: ExcelJS } = await importG('exceljs', () =>
|
|
5
|
+
import(/*webpackChunkName: "exceljs"*/ 'exceljs')
|
|
6
|
+
)
|
|
2
7
|
|
|
3
|
-
export default function toJson(file, name) {
|
|
4
8
|
const workbook = new ExcelJS.Workbook()
|
|
5
9
|
return new Promise((resolve, reject) => {
|
|
6
10
|
workbook.xlsx
|