n20-common-lib 1.3.6 → 1.3.9
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/ApprovalRecord/flowDialog.vue +5 -0
- package/src/components/ChildRange/index.vue +28 -29
- package/src/components/FileImport/_index.vue +201 -0
- package/src/components/FileImport/index.vue +2 -196
- package/src/components/PageHeader/index.vue +8 -10
- package/src/components/Search/index.vue +1 -1
- package/src/components/Table/ThSelectHeader.vue +28 -24
- package/src/directives/VTitle/index.js +30 -11
- package/src/utils/axios.js +1 -1
- package/src/directives/VTitle/tooltip.vue +0 -21
package/package.json
CHANGED
|
@@ -4,30 +4,30 @@
|
|
|
4
4
|
<div class="flex">
|
|
5
5
|
<div class="from">
|
|
6
6
|
<el-input
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
ref="input_left"
|
|
8
|
+
v-model="value1"
|
|
9
|
+
:disabled="disabled"
|
|
10
|
+
placeholder="子票区间起"
|
|
11
|
+
@blur="handleBlurleft"
|
|
12
|
+
@focus="handleFocusLeft"
|
|
13
|
+
@input="handleInputleft"
|
|
14
|
+
@change="handleInputChangeLeft"
|
|
15
|
+
/>
|
|
16
16
|
</div>
|
|
17
17
|
<div class="center">
|
|
18
18
|
<span> - </span>
|
|
19
19
|
</div>
|
|
20
20
|
<div class="to">
|
|
21
21
|
<el-input
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
ref="input_right"
|
|
23
|
+
v-model="value2"
|
|
24
|
+
:disabled="disabled"
|
|
25
|
+
placeholder="子票区间止"
|
|
26
|
+
@blur="handleBlurRight"
|
|
27
|
+
@focus="handleFocusRight"
|
|
28
|
+
@input="handleInputRight"
|
|
29
|
+
@change="handleInputChangeRight"
|
|
30
|
+
/>
|
|
31
31
|
</div>
|
|
32
32
|
</div>
|
|
33
33
|
</div>
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
<script>
|
|
38
38
|
export default {
|
|
39
|
-
name:
|
|
39
|
+
name: 'ChildRange',
|
|
40
40
|
props: {
|
|
41
41
|
// 初始化范围
|
|
42
42
|
value: { required: true },
|
|
@@ -79,7 +79,7 @@ export default {
|
|
|
79
79
|
toPrecision(num, precision) {
|
|
80
80
|
if (precision === undefined) precision = 0
|
|
81
81
|
return parseFloat(
|
|
82
|
-
|
|
82
|
+
Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision)
|
|
83
83
|
)
|
|
84
84
|
},
|
|
85
85
|
|
|
@@ -122,9 +122,9 @@ export default {
|
|
|
122
122
|
// 如果from > to 将from值替换成to
|
|
123
123
|
if (typeof this.value2 === 'number') {
|
|
124
124
|
this.value1 =
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
parseFloat(this.value1) <= parseFloat(this.value2)
|
|
126
|
+
? this.value1
|
|
127
|
+
: this.value2
|
|
128
128
|
}
|
|
129
129
|
this.$emit('input', [this.value1, this.value2])
|
|
130
130
|
this.$emit('changefrom', this.value1)
|
|
@@ -145,9 +145,9 @@ export default {
|
|
|
145
145
|
// 如果to < tfrom 将to值替换成from
|
|
146
146
|
if (typeof this.value1 === 'number') {
|
|
147
147
|
this.value2 =
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
parseFloat(this.value2) >= parseFloat(this.value1)
|
|
149
|
+
? this.value2
|
|
150
|
+
: this.value1
|
|
151
151
|
}
|
|
152
152
|
this.$emit('input', [this.value1, this.value2])
|
|
153
153
|
this.$emit('changeright', this.value2)
|
|
@@ -165,8 +165,7 @@ export default {
|
|
|
165
165
|
}
|
|
166
166
|
</script>
|
|
167
167
|
|
|
168
|
-
<style lang="
|
|
169
|
-
|
|
168
|
+
<style lang="less" scoped>
|
|
170
169
|
.input-child-range {
|
|
171
170
|
background-color: #fff;
|
|
172
171
|
border: 1px solid #dcdfe6;
|
|
@@ -199,4 +198,4 @@ export default {
|
|
|
199
198
|
color: #c0c4cc;
|
|
200
199
|
cursor: not-allowed;
|
|
201
200
|
}
|
|
202
|
-
</style>
|
|
201
|
+
</style>
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dropdown
|
|
3
|
+
trigger="click"
|
|
4
|
+
placement="bottom-start"
|
|
5
|
+
@command="handleCommand"
|
|
6
|
+
>
|
|
7
|
+
<el-button size="mini" type="primary"> 导入 </el-button>
|
|
8
|
+
<el-dropdown-menu slot="dropdown">
|
|
9
|
+
<el-dropdown-item command="a">导入数据</el-dropdown-item>
|
|
10
|
+
<el-dropdown-item command="b">模板下载</el-dropdown-item>
|
|
11
|
+
</el-dropdown-menu>
|
|
12
|
+
</el-dropdown>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import XLSX from 'xlsx'
|
|
17
|
+
import axios from '../../utils/axios'
|
|
18
|
+
export default {
|
|
19
|
+
name: 'FileImport',
|
|
20
|
+
props: {
|
|
21
|
+
title: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: function () {
|
|
24
|
+
return '文件导入'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
tips: {
|
|
28
|
+
type: Array,
|
|
29
|
+
default: () => {
|
|
30
|
+
return []
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
templateUrl: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: ''
|
|
36
|
+
},
|
|
37
|
+
downConfig: {
|
|
38
|
+
type: Object,
|
|
39
|
+
default() {
|
|
40
|
+
return {
|
|
41
|
+
isFrontDown: true,
|
|
42
|
+
fileName: '下载.xlsx'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
footerHandlers: {
|
|
47
|
+
type: Object,
|
|
48
|
+
default: function () {
|
|
49
|
+
return {
|
|
50
|
+
// cancel: {
|
|
51
|
+
// text: '取消'
|
|
52
|
+
// },
|
|
53
|
+
// confirm: {
|
|
54
|
+
// text: '导入'
|
|
55
|
+
// }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
beforeUpload: Function, // eslint-disable-line
|
|
60
|
+
callback: {
|
|
61
|
+
type: Function,
|
|
62
|
+
default: () => {}
|
|
63
|
+
},
|
|
64
|
+
handleConfirm: {
|
|
65
|
+
type: Function,
|
|
66
|
+
default: () => {}
|
|
67
|
+
},
|
|
68
|
+
reset: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: false
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
data() {
|
|
74
|
+
return {
|
|
75
|
+
excelData: {
|
|
76
|
+
tableHeader: [],
|
|
77
|
+
tableData: []
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
analysisText: 'analysis',
|
|
81
|
+
fileName: '',
|
|
82
|
+
statisticsFlag: false,
|
|
83
|
+
columnsListTemp: [],
|
|
84
|
+
errorListTemp: [],
|
|
85
|
+
successFlag: false,
|
|
86
|
+
confirmDisabledFlag: true
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
methods: {
|
|
90
|
+
handleCommand(val) {
|
|
91
|
+
if (val == 'a') {
|
|
92
|
+
this.seletFile()
|
|
93
|
+
} else if (val == 'b') {
|
|
94
|
+
this.downloadTemplate()
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
seletFile() {
|
|
98
|
+
let input = document.createElement('input')
|
|
99
|
+
let self = this
|
|
100
|
+
input.type = 'file'
|
|
101
|
+
input.accept = '.xlsx, .xls, .csv'
|
|
102
|
+
input.addEventListener('change', function (event) {
|
|
103
|
+
const files = event.target.files
|
|
104
|
+
const rawFile = files[0] // only use files[0]
|
|
105
|
+
console.log('导入的文件:', rawFile)
|
|
106
|
+
self.fileName = rawFile.name
|
|
107
|
+
if (!rawFile) return
|
|
108
|
+
self.upload(rawFile)
|
|
109
|
+
this.value = null // fix can't select the same excel
|
|
110
|
+
})
|
|
111
|
+
input.click()
|
|
112
|
+
},
|
|
113
|
+
/* 上传文件 */
|
|
114
|
+
upload(rawFile) {
|
|
115
|
+
if (!this.beforeUpload) {
|
|
116
|
+
this.readerData(rawFile)
|
|
117
|
+
return
|
|
118
|
+
}
|
|
119
|
+
const before = this.beforeUpload(rawFile)
|
|
120
|
+
if (before) {
|
|
121
|
+
this.readerData(rawFile)
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
/*解析传入的表格 */
|
|
125
|
+
readerData(rawFile) {
|
|
126
|
+
return new Promise((resolve) => {
|
|
127
|
+
const reader = new FileReader()
|
|
128
|
+
reader.onload = (e) => {
|
|
129
|
+
const data = e.target.result
|
|
130
|
+
const workbook = XLSX.read(data, {
|
|
131
|
+
type: 'array',
|
|
132
|
+
cellDates: true
|
|
133
|
+
})
|
|
134
|
+
const firstSheetName = workbook.SheetNames[0]
|
|
135
|
+
const worksheet = workbook.Sheets[firstSheetName]
|
|
136
|
+
const header = this.getHeaderRow(worksheet)
|
|
137
|
+
const results = XLSX.utils.sheet_to_json(worksheet)
|
|
138
|
+
|
|
139
|
+
this.generateData({ header, results })
|
|
140
|
+
resolve()
|
|
141
|
+
}
|
|
142
|
+
reader.readAsArrayBuffer(rawFile)
|
|
143
|
+
})
|
|
144
|
+
},
|
|
145
|
+
generateData({ header, results }) {
|
|
146
|
+
this.excelData.tableHeader = header
|
|
147
|
+
this.excelData.tableData = results
|
|
148
|
+
this.callback && this.callback(this.excelData)
|
|
149
|
+
},
|
|
150
|
+
getHeaderRow(sheet) {
|
|
151
|
+
console.log(sheet)
|
|
152
|
+
const headers = []
|
|
153
|
+
const range = XLSX.utils.decode_range(sheet['!ref'])
|
|
154
|
+
let C
|
|
155
|
+
const R = range.s.r
|
|
156
|
+
/* start in the first row */
|
|
157
|
+
for (C = range.s.c; C <= range.e.c; ++C) {
|
|
158
|
+
/* walk every column in the range */
|
|
159
|
+
const cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })]
|
|
160
|
+
/* find the cell in the first row */
|
|
161
|
+
let hdr = 'UNKNOWN ' + C // <-- replace with your desired default
|
|
162
|
+
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
|
|
163
|
+
headers.push(hdr)
|
|
164
|
+
}
|
|
165
|
+
return headers
|
|
166
|
+
},
|
|
167
|
+
// 下载文件
|
|
168
|
+
downloadTemplate() {
|
|
169
|
+
// 前端下载
|
|
170
|
+
if (this.downConfig.isFrontDown) {
|
|
171
|
+
const aEl = document.createElement('a')
|
|
172
|
+
aEl.setAttribute('href', this.templateUrl)
|
|
173
|
+
aEl.target = '_blank'
|
|
174
|
+
// aEl.download = this.templateUrl
|
|
175
|
+
aEl.click()
|
|
176
|
+
} else {
|
|
177
|
+
axios({
|
|
178
|
+
url: this.templateUrl,
|
|
179
|
+
method: 'get',
|
|
180
|
+
responseType: 'blob'
|
|
181
|
+
}).then((res) => {
|
|
182
|
+
const content = res
|
|
183
|
+
const blob = new Blob([content])
|
|
184
|
+
if ('download' in document.createElement('a')) {
|
|
185
|
+
const link = document.createElement('a')
|
|
186
|
+
link.download = this.downConfig.fileName
|
|
187
|
+
link.style.display = 'none'
|
|
188
|
+
link.href = URL.createObjectURL(blob)
|
|
189
|
+
document.body.appendChild(link)
|
|
190
|
+
link.click()
|
|
191
|
+
URL.revokeObjectURL(link.href)
|
|
192
|
+
document.body.removeChild(link)
|
|
193
|
+
} else {
|
|
194
|
+
navigator.msSaveBlob(blob, this.downConfig.fileName)
|
|
195
|
+
}
|
|
196
|
+
})
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
</script>
|
|
@@ -1,201 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
trigger="click"
|
|
4
|
-
placement="bottom-start"
|
|
5
|
-
@command="handleCommand"
|
|
6
|
-
>
|
|
7
|
-
<el-button size="mini" type="primary"> 导入 </el-button>
|
|
8
|
-
<el-dropdown-menu slot="dropdown">
|
|
9
|
-
<el-dropdown-item command="a">导入数据</el-dropdown-item>
|
|
10
|
-
<el-dropdown-item command="b">模板下载</el-dropdown-item>
|
|
11
|
-
</el-dropdown-menu>
|
|
12
|
-
</el-dropdown>
|
|
2
|
+
<div>待完善</div>
|
|
13
3
|
</template>
|
|
14
4
|
|
|
15
5
|
<script>
|
|
16
|
-
|
|
17
|
-
import axios from '../../utils/axios'
|
|
18
|
-
export default {
|
|
19
|
-
name: 'FileImport',
|
|
20
|
-
props: {
|
|
21
|
-
title: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: function () {
|
|
24
|
-
return '文件导入'
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
tips: {
|
|
28
|
-
type: Array,
|
|
29
|
-
default: () => {
|
|
30
|
-
return []
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
templateUrl: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: ''
|
|
36
|
-
},
|
|
37
|
-
downConfig: {
|
|
38
|
-
type: Object,
|
|
39
|
-
default() {
|
|
40
|
-
return {
|
|
41
|
-
isFrontDown: true,
|
|
42
|
-
fileName: '下载.xlsx'
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
footerHandlers: {
|
|
47
|
-
type: Object,
|
|
48
|
-
default: function () {
|
|
49
|
-
return {
|
|
50
|
-
// cancel: {
|
|
51
|
-
// text: '取消'
|
|
52
|
-
// },
|
|
53
|
-
// confirm: {
|
|
54
|
-
// text: '导入'
|
|
55
|
-
// }
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
beforeUpload: Function, // eslint-disable-line
|
|
60
|
-
callback: {
|
|
61
|
-
type: Function,
|
|
62
|
-
default: () => {}
|
|
63
|
-
},
|
|
64
|
-
handleConfirm: {
|
|
65
|
-
type: Function,
|
|
66
|
-
default: () => {}
|
|
67
|
-
},
|
|
68
|
-
reset: {
|
|
69
|
-
type: Boolean,
|
|
70
|
-
default: false
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
data() {
|
|
74
|
-
return {
|
|
75
|
-
excelData: {
|
|
76
|
-
tableHeader: [],
|
|
77
|
-
tableData: []
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
analysisText: 'analysis',
|
|
81
|
-
fileName: '',
|
|
82
|
-
statisticsFlag: false,
|
|
83
|
-
columnsListTemp: [],
|
|
84
|
-
errorListTemp: [],
|
|
85
|
-
successFlag: false,
|
|
86
|
-
confirmDisabledFlag: true
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
methods: {
|
|
90
|
-
handleCommand(val) {
|
|
91
|
-
if (val == 'a') {
|
|
92
|
-
this.seletFile()
|
|
93
|
-
} else if (val == 'b') {
|
|
94
|
-
this.downloadTemplate()
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
seletFile() {
|
|
98
|
-
let input = document.createElement('input')
|
|
99
|
-
let self = this
|
|
100
|
-
input.type = 'file'
|
|
101
|
-
input.accept = '.xlsx, .xls, .csv'
|
|
102
|
-
input.addEventListener('change', function (event) {
|
|
103
|
-
const files = event.target.files
|
|
104
|
-
const rawFile = files[0] // only use files[0]
|
|
105
|
-
console.log('导入的文件:', rawFile)
|
|
106
|
-
self.fileName = rawFile.name
|
|
107
|
-
if (!rawFile) return
|
|
108
|
-
self.upload(rawFile)
|
|
109
|
-
this.value = null // fix can't select the same excel
|
|
110
|
-
})
|
|
111
|
-
input.click()
|
|
112
|
-
},
|
|
113
|
-
/* 上传文件 */
|
|
114
|
-
upload(rawFile) {
|
|
115
|
-
if (!this.beforeUpload) {
|
|
116
|
-
this.readerData(rawFile)
|
|
117
|
-
return
|
|
118
|
-
}
|
|
119
|
-
const before = this.beforeUpload(rawFile)
|
|
120
|
-
if (before) {
|
|
121
|
-
this.readerData(rawFile)
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
/*解析传入的表格 */
|
|
125
|
-
readerData(rawFile) {
|
|
126
|
-
return new Promise((resolve) => {
|
|
127
|
-
const reader = new FileReader()
|
|
128
|
-
reader.onload = (e) => {
|
|
129
|
-
const data = e.target.result
|
|
130
|
-
const workbook = XLSX.read(data, {
|
|
131
|
-
type: 'array',
|
|
132
|
-
cellDates: true
|
|
133
|
-
})
|
|
134
|
-
const firstSheetName = workbook.SheetNames[0]
|
|
135
|
-
const worksheet = workbook.Sheets[firstSheetName]
|
|
136
|
-
const header = this.getHeaderRow(worksheet)
|
|
137
|
-
const results = XLSX.utils.sheet_to_json(worksheet)
|
|
138
|
-
|
|
139
|
-
this.generateData({ header, results })
|
|
140
|
-
resolve()
|
|
141
|
-
}
|
|
142
|
-
reader.readAsArrayBuffer(rawFile)
|
|
143
|
-
})
|
|
144
|
-
},
|
|
145
|
-
generateData({ header, results }) {
|
|
146
|
-
this.excelData.tableHeader = header
|
|
147
|
-
this.excelData.tableData = results
|
|
148
|
-
this.callback && this.callback(this.excelData)
|
|
149
|
-
},
|
|
150
|
-
getHeaderRow(sheet) {
|
|
151
|
-
console.log(sheet)
|
|
152
|
-
const headers = []
|
|
153
|
-
const range = XLSX.utils.decode_range(sheet['!ref'])
|
|
154
|
-
let C
|
|
155
|
-
const R = range.s.r
|
|
156
|
-
/* start in the first row */
|
|
157
|
-
for (C = range.s.c; C <= range.e.c; ++C) {
|
|
158
|
-
/* walk every column in the range */
|
|
159
|
-
const cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })]
|
|
160
|
-
/* find the cell in the first row */
|
|
161
|
-
let hdr = 'UNKNOWN ' + C // <-- replace with your desired default
|
|
162
|
-
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
|
|
163
|
-
headers.push(hdr)
|
|
164
|
-
}
|
|
165
|
-
return headers
|
|
166
|
-
},
|
|
167
|
-
// 下载文件
|
|
168
|
-
downloadTemplate() {
|
|
169
|
-
// 前端下载
|
|
170
|
-
if (this.downConfig.isFrontDown) {
|
|
171
|
-
const aEl = document.createElement('a')
|
|
172
|
-
aEl.setAttribute('href', this.templateUrl)
|
|
173
|
-
aEl.target = '_blank'
|
|
174
|
-
// aEl.download = this.templateUrl
|
|
175
|
-
aEl.click()
|
|
176
|
-
} else {
|
|
177
|
-
axios({
|
|
178
|
-
url: this.templateUrl,
|
|
179
|
-
method: 'get',
|
|
180
|
-
responseType: 'blob'
|
|
181
|
-
}).then((res) => {
|
|
182
|
-
const content = res
|
|
183
|
-
const blob = new Blob([content])
|
|
184
|
-
if ('download' in document.createElement('a')) {
|
|
185
|
-
const link = document.createElement('a')
|
|
186
|
-
link.download = this.downConfig.fileName
|
|
187
|
-
link.style.display = 'none'
|
|
188
|
-
link.href = URL.createObjectURL(blob)
|
|
189
|
-
document.body.appendChild(link)
|
|
190
|
-
link.click()
|
|
191
|
-
URL.revokeObjectURL(link.href)
|
|
192
|
-
document.body.removeChild(link)
|
|
193
|
-
} else {
|
|
194
|
-
navigator.msSaveBlob(blob, this.downConfig.fileName)
|
|
195
|
-
}
|
|
196
|
-
})
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
6
|
+
export default {}
|
|
201
7
|
</script>
|
|
@@ -24,7 +24,7 @@ export default {
|
|
|
24
24
|
},
|
|
25
25
|
content: String,
|
|
26
26
|
disable: {
|
|
27
|
-
type:Boolean,
|
|
27
|
+
type: Boolean,
|
|
28
28
|
default: false
|
|
29
29
|
},
|
|
30
30
|
icon: {
|
|
@@ -32,23 +32,21 @@ export default {
|
|
|
32
32
|
default: 'n20-icon-yuefenqiehuan-zuoce'
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
}
|
|
35
|
+
}
|
|
36
36
|
</script>
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
<style lang="scss" scoped>
|
|
38
|
+
<style lang="less" scoped>
|
|
40
39
|
.page-header {
|
|
41
40
|
display: flex;
|
|
42
41
|
line-height: 20px;
|
|
43
42
|
padding-bottom: 2px;
|
|
44
|
-
border-bottom: 1px solid rgba(0,0,0,0.
|
|
43
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
45
44
|
.page-header__left {
|
|
46
45
|
display: flex;
|
|
47
46
|
align-items: center;
|
|
48
47
|
cursor: pointer;
|
|
49
48
|
margin-right: 16px;
|
|
50
49
|
position: relative;
|
|
51
|
-
|
|
52
50
|
}
|
|
53
51
|
.page-header__left:hover {
|
|
54
52
|
color: var(--color-primary);
|
|
@@ -57,7 +55,7 @@ export default {
|
|
|
57
55
|
}
|
|
58
56
|
}
|
|
59
57
|
.page-header__left:after {
|
|
60
|
-
content:
|
|
58
|
+
content: '';
|
|
61
59
|
position: absolute;
|
|
62
60
|
width: 1px;
|
|
63
61
|
height: 16px;
|
|
@@ -69,12 +67,12 @@ export default {
|
|
|
69
67
|
.page-header__title {
|
|
70
68
|
font-size: 14px;
|
|
71
69
|
line-height: 20px;
|
|
72
|
-
color: #
|
|
70
|
+
color: #3d4a57;
|
|
73
71
|
}
|
|
74
72
|
.page-header__content {
|
|
75
73
|
font-size: 14px;
|
|
76
74
|
line-height: 20px;
|
|
77
|
-
color: #
|
|
75
|
+
color: #3d4a57;
|
|
78
76
|
}
|
|
79
77
|
}
|
|
80
|
-
</style>
|
|
78
|
+
</style>
|
|
@@ -11,33 +11,38 @@
|
|
|
11
11
|
class="input-w"
|
|
12
12
|
@keyup.enter.native="handleSearch"
|
|
13
13
|
>
|
|
14
|
-
<i
|
|
14
|
+
<i
|
|
15
|
+
slot="suffix"
|
|
16
|
+
class="el-input__icon el-icon-search"
|
|
17
|
+
@click="handleSearch"
|
|
18
|
+
></i>
|
|
15
19
|
</el-input>
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
<div class="flex-column m-t-14">
|
|
22
|
+
<el-checkbox
|
|
19
23
|
v-model="checkbox"
|
|
20
24
|
:indeterminate="isIndeterminate"
|
|
21
25
|
@change="checkboxChange"
|
|
22
26
|
>{{ '全部' + '(' + this.thIndex.length + ')' }}</el-checkbox
|
|
23
27
|
>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
<el-checkbox-group
|
|
29
|
+
v-model="checkLists"
|
|
30
|
+
class="flex-column"
|
|
31
|
+
@change="handleCheckedCitiesChange"
|
|
32
|
+
>
|
|
33
|
+
<el-checkbox
|
|
34
|
+
v-for="item in checkList[property]"
|
|
35
|
+
:key="item"
|
|
36
|
+
class="m-t-s"
|
|
37
|
+
:label="item"
|
|
38
|
+
>{{ item + '(' + countNum(item) + ')' }}</el-checkbox
|
|
39
|
+
>
|
|
40
|
+
</el-checkbox-group>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="flex-box flex-c m-t-m">
|
|
43
|
+
<el-button type="primary" @click="confirm">确认</el-button>
|
|
44
|
+
<el-button plain @click="reset">清空</el-button>
|
|
45
|
+
</div>
|
|
41
46
|
<i slot="reference" class="el-icon-arrow-down"></i>
|
|
42
47
|
</el-popover>
|
|
43
48
|
</template>
|
|
@@ -69,7 +74,7 @@ export default {
|
|
|
69
74
|
return {
|
|
70
75
|
value: '',
|
|
71
76
|
checkLists: [],
|
|
72
|
-
list:[],
|
|
77
|
+
list: [],
|
|
73
78
|
checkbox: false,
|
|
74
79
|
isIndeterminate: true
|
|
75
80
|
}
|
|
@@ -88,12 +93,11 @@ export default {
|
|
|
88
93
|
if (!this.value) {
|
|
89
94
|
this.checkList[this.property] = this.list
|
|
90
95
|
} else {
|
|
91
|
-
this.checkList[this.property] = this.list.filter(v => {
|
|
96
|
+
this.checkList[this.property] = this.list.filter((v) => {
|
|
92
97
|
return v.indexOf(this.value) !== -1
|
|
93
98
|
})
|
|
94
99
|
}
|
|
95
100
|
this.$forceUpdate()
|
|
96
|
-
|
|
97
101
|
},
|
|
98
102
|
reset() {
|
|
99
103
|
this.value = ''
|
|
@@ -123,7 +127,7 @@ export default {
|
|
|
123
127
|
}
|
|
124
128
|
</script>
|
|
125
129
|
|
|
126
|
-
<style lang="
|
|
130
|
+
<style lang="less">
|
|
127
131
|
.table-header-popover.el-popover {
|
|
128
132
|
padding: 16px;
|
|
129
133
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import Tooltip from './tooltip.vue'
|
|
2
|
-
|
|
3
1
|
let timer = undefined
|
|
4
2
|
|
|
5
3
|
function tipShow(el, tip) {
|
|
@@ -9,15 +7,14 @@ function tipShow(el, tip) {
|
|
|
9
7
|
let _el = _input || el
|
|
10
8
|
if (!el.$tooltipTitleOverflow || _el.clientWidth < _el.scrollWidth) {
|
|
11
9
|
tip.title = el.$tooltipTitle
|
|
10
|
+
|
|
12
11
|
tip.$refs['title-pop'].referenceElm = el
|
|
13
12
|
tip.$refs['title-pop'].doDestroy()
|
|
13
|
+
|
|
14
14
|
tip.$nextTick(() => {
|
|
15
15
|
tip.visible = true
|
|
16
16
|
timer = setInterval(() => {
|
|
17
|
-
if (tip.visible && !el.scrollWidth)
|
|
18
|
-
tipHide(el, tip)
|
|
19
|
-
clearInterval(timer)
|
|
20
|
-
}
|
|
17
|
+
if (tip.visible && !el.scrollWidth) tipHide(el, tip)
|
|
21
18
|
}, 1000)
|
|
22
19
|
})
|
|
23
20
|
}
|
|
@@ -31,12 +28,34 @@ function tipHide(el, tip) {
|
|
|
31
28
|
const TitleDirective = {}
|
|
32
29
|
TitleDirective.install = (Vue) => {
|
|
33
30
|
if (Vue.prototype.$isServer) return
|
|
34
|
-
|
|
35
|
-
const tooltip = new (Vue.extend(Tooltip))({
|
|
31
|
+
const tooltip = new Vue({
|
|
36
32
|
el: document.createElement('div'),
|
|
37
|
-
data
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
data() {
|
|
34
|
+
return {
|
|
35
|
+
title: '',
|
|
36
|
+
visible: false
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
render(_h) {
|
|
40
|
+
var _vm = this
|
|
41
|
+
return _h(
|
|
42
|
+
'el-popover',
|
|
43
|
+
{
|
|
44
|
+
ref: 'title-pop',
|
|
45
|
+
attrs: {
|
|
46
|
+
value: _vm.visible,
|
|
47
|
+
trigger: 'manual',
|
|
48
|
+
'popper-class': 'n20-title-pop',
|
|
49
|
+
placement: 'top'
|
|
50
|
+
},
|
|
51
|
+
on: {
|
|
52
|
+
input(v) {
|
|
53
|
+
_vm.visible = v
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
[_vm.title]
|
|
58
|
+
)
|
|
40
59
|
}
|
|
41
60
|
})
|
|
42
61
|
document.querySelector('body').appendChild(tooltip.$el)
|
package/src/utils/axios.js
CHANGED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-popover
|
|
3
|
-
ref="title-pop"
|
|
4
|
-
v-model="visible"
|
|
5
|
-
trigger="manual"
|
|
6
|
-
popper-class="n20-title-pop"
|
|
7
|
-
placement="top"
|
|
8
|
-
>{{ title }}</el-popover
|
|
9
|
-
>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script>
|
|
13
|
-
export default {
|
|
14
|
-
data() {
|
|
15
|
-
return {
|
|
16
|
-
title: '',
|
|
17
|
-
visible: false
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
</script>
|