vue2-client 1.14.26 → 1.14.27
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/jest.config.js +22 -22
- package/package.json +1 -1
- package/src/base-client/components/common/Upload/Upload.vue +1 -0
- package/src/base-client/components/common/XForm/demo.vue +105 -105
- package/src/base-client/components/common/XRate/demo.vue +102 -102
- package/src/base-client/components/common/XReport/print.js +186 -186
- package/src/router/index.js +27 -27
- package/src/utils/map-utils.js +47 -47
- package/test/request.test.js +17 -17
- package/.cursor/rules/myrule.mdc +0 -9
package/jest.config.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
require('dotenv').config({ path: path.resolve(__dirname, '.env') })
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
setupFiles: ['<rootDir>/jest.setup.js'],
|
|
6
|
-
moduleNameMapper: {
|
|
7
|
-
'^@vue2-client/(.*)$': '<rootDir>/src/$1',
|
|
8
|
-
'^@/(.*)$': '<rootDir>/src/$1',
|
|
9
|
-
'\\.(css|less)$': 'identity-obj-proxy',
|
|
10
|
-
},
|
|
11
|
-
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node', 'vue'],
|
|
12
|
-
testEnvironment: 'jsdom',
|
|
13
|
-
transform: {
|
|
14
|
-
'^.+\\.js$': 'babel-jest',
|
|
15
|
-
'^.+\\.vue$': 'vue-jest',
|
|
16
|
-
'^.+\\.less$': 'jest-transform-stub',
|
|
17
|
-
},
|
|
18
|
-
transformIgnorePatterns: [
|
|
19
|
-
'/node_modules/(?!ant-design-vue)',
|
|
20
|
-
]
|
|
21
|
-
// 其他 Jest 配置项...
|
|
22
|
-
}
|
|
1
|
+
const path = require('path')
|
|
2
|
+
require('dotenv').config({ path: path.resolve(__dirname, '.env') })
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
setupFiles: ['<rootDir>/jest.setup.js'],
|
|
6
|
+
moduleNameMapper: {
|
|
7
|
+
'^@vue2-client/(.*)$': '<rootDir>/src/$1',
|
|
8
|
+
'^@/(.*)$': '<rootDir>/src/$1',
|
|
9
|
+
'\\.(css|less)$': 'identity-obj-proxy',
|
|
10
|
+
},
|
|
11
|
+
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node', 'vue'],
|
|
12
|
+
testEnvironment: 'jsdom',
|
|
13
|
+
transform: {
|
|
14
|
+
'^.+\\.js$': 'babel-jest',
|
|
15
|
+
'^.+\\.vue$': 'vue-jest',
|
|
16
|
+
'^.+\\.less$': 'jest-transform-stub',
|
|
17
|
+
},
|
|
18
|
+
transformIgnorePatterns: [
|
|
19
|
+
'/node_modules/(?!ant-design-vue)',
|
|
20
|
+
]
|
|
21
|
+
// 其他 Jest 配置项...
|
|
22
|
+
}
|
package/package.json
CHANGED
|
@@ -232,6 +232,7 @@ export default {
|
|
|
232
232
|
this.$emit('setFiles', this.uploadedFileList.filter(item => item.status === 'done'), this.outerContainerIndex)
|
|
233
233
|
} else {
|
|
234
234
|
this.$emit('setFiles', this.uploadedFileList.filter(item => item.status === 'done').map(item => item.id))
|
|
235
|
+
this.$emit('setFilesAllInfo', this.uploadedFileList.filter(item => item.status === 'done').map(item => item))
|
|
235
236
|
}
|
|
236
237
|
this.$message.success('上传成功!')
|
|
237
238
|
} else {
|
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="demo-container">
|
|
3
|
-
<h2>XFormItem Demo</h2>
|
|
4
|
-
|
|
5
|
-
<!-- 查询模式演示 -->
|
|
6
|
-
<div class="demo-section">
|
|
7
|
-
<h3>查询模式</h3>
|
|
8
|
-
<x-form-item
|
|
9
|
-
:attr="queryAttr"
|
|
10
|
-
:form="queryForm"
|
|
11
|
-
mode="查询"
|
|
12
|
-
:showLabel="true"
|
|
13
|
-
/>
|
|
14
|
-
<div class="value-display">
|
|
15
|
-
当前值: {{ queryForm.rate || '未选择' }}
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
<!-- 新增模式演示 -->
|
|
20
|
-
<div class="demo-section">
|
|
21
|
-
<h3>新增模式</h3>
|
|
22
|
-
<x-form-item
|
|
23
|
-
:attr="addAttr"
|
|
24
|
-
:form="addForm"
|
|
25
|
-
mode="新增/修改"
|
|
26
|
-
:showLabel="true"
|
|
27
|
-
/>
|
|
28
|
-
<div class="value-display">
|
|
29
|
-
当前值: {{ addForm.rate || '未评分' }}
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
</template>
|
|
34
|
-
|
|
35
|
-
<script>
|
|
36
|
-
import XFormItem from './XFormItem.vue'
|
|
37
|
-
|
|
38
|
-
export default {
|
|
39
|
-
name: 'XFormItemDemo',
|
|
40
|
-
components: {
|
|
41
|
-
XFormItem
|
|
42
|
-
},
|
|
43
|
-
data () {
|
|
44
|
-
return {
|
|
45
|
-
// 查询表单配置
|
|
46
|
-
queryAttr: {
|
|
47
|
-
type: 'rate',
|
|
48
|
-
name: '评分查询',
|
|
49
|
-
queryType: 'IN',
|
|
50
|
-
model: 'rate',
|
|
51
|
-
placeholder: '请选择评分',
|
|
52
|
-
allowHalf: true,
|
|
53
|
-
maxCount: 5
|
|
54
|
-
},
|
|
55
|
-
queryForm: {
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
// 新增表单配置
|
|
59
|
-
addAttr: {
|
|
60
|
-
type: 'rate',
|
|
61
|
-
name: '评分',
|
|
62
|
-
model: 'rate',
|
|
63
|
-
allowHalf: true,
|
|
64
|
-
maxCount: 10
|
|
65
|
-
},
|
|
66
|
-
addForm: {
|
|
67
|
-
rate: 3
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
</script>
|
|
73
|
-
|
|
74
|
-
<style lang="less" scoped>
|
|
75
|
-
.demo-container {
|
|
76
|
-
padding: 20px;
|
|
77
|
-
max-width: 800px;
|
|
78
|
-
margin: 0 auto;
|
|
79
|
-
background-color: #f5f5f5;
|
|
80
|
-
|
|
81
|
-
h2 {
|
|
82
|
-
margin-bottom: 20px;
|
|
83
|
-
color: #1890ff;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.demo-section {
|
|
87
|
-
margin-bottom: 30px;
|
|
88
|
-
padding: 20px;
|
|
89
|
-
border: 1px solid #e8e8e8;
|
|
90
|
-
border-radius: 4px;
|
|
91
|
-
|
|
92
|
-
h3 {
|
|
93
|
-
margin-bottom: 16px;
|
|
94
|
-
color: #333;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.value-display {
|
|
98
|
-
margin-top: 16px;
|
|
99
|
-
padding: 8px;
|
|
100
|
-
background-color: #f5f5f5;
|
|
101
|
-
border-radius: 4px;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="demo-container">
|
|
3
|
+
<h2>XFormItem Demo</h2>
|
|
4
|
+
|
|
5
|
+
<!-- 查询模式演示 -->
|
|
6
|
+
<div class="demo-section">
|
|
7
|
+
<h3>查询模式</h3>
|
|
8
|
+
<x-form-item
|
|
9
|
+
:attr="queryAttr"
|
|
10
|
+
:form="queryForm"
|
|
11
|
+
mode="查询"
|
|
12
|
+
:showLabel="true"
|
|
13
|
+
/>
|
|
14
|
+
<div class="value-display">
|
|
15
|
+
当前值: {{ queryForm.rate || '未选择' }}
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<!-- 新增模式演示 -->
|
|
20
|
+
<div class="demo-section">
|
|
21
|
+
<h3>新增模式</h3>
|
|
22
|
+
<x-form-item
|
|
23
|
+
:attr="addAttr"
|
|
24
|
+
:form="addForm"
|
|
25
|
+
mode="新增/修改"
|
|
26
|
+
:showLabel="true"
|
|
27
|
+
/>
|
|
28
|
+
<div class="value-display">
|
|
29
|
+
当前值: {{ addForm.rate || '未评分' }}
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script>
|
|
36
|
+
import XFormItem from './XFormItem.vue'
|
|
37
|
+
|
|
38
|
+
export default {
|
|
39
|
+
name: 'XFormItemDemo',
|
|
40
|
+
components: {
|
|
41
|
+
XFormItem
|
|
42
|
+
},
|
|
43
|
+
data () {
|
|
44
|
+
return {
|
|
45
|
+
// 查询表单配置
|
|
46
|
+
queryAttr: {
|
|
47
|
+
type: 'rate',
|
|
48
|
+
name: '评分查询',
|
|
49
|
+
queryType: 'IN',
|
|
50
|
+
model: 'rate',
|
|
51
|
+
placeholder: '请选择评分',
|
|
52
|
+
allowHalf: true,
|
|
53
|
+
maxCount: 5
|
|
54
|
+
},
|
|
55
|
+
queryForm: {
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
// 新增表单配置
|
|
59
|
+
addAttr: {
|
|
60
|
+
type: 'rate',
|
|
61
|
+
name: '评分',
|
|
62
|
+
model: 'rate',
|
|
63
|
+
allowHalf: true,
|
|
64
|
+
maxCount: 10
|
|
65
|
+
},
|
|
66
|
+
addForm: {
|
|
67
|
+
rate: 3
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<style lang="less" scoped>
|
|
75
|
+
.demo-container {
|
|
76
|
+
padding: 20px;
|
|
77
|
+
max-width: 800px;
|
|
78
|
+
margin: 0 auto;
|
|
79
|
+
background-color: #f5f5f5;
|
|
80
|
+
|
|
81
|
+
h2 {
|
|
82
|
+
margin-bottom: 20px;
|
|
83
|
+
color: #1890ff;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.demo-section {
|
|
87
|
+
margin-bottom: 30px;
|
|
88
|
+
padding: 20px;
|
|
89
|
+
border: 1px solid #e8e8e8;
|
|
90
|
+
border-radius: 4px;
|
|
91
|
+
|
|
92
|
+
h3 {
|
|
93
|
+
margin-bottom: 16px;
|
|
94
|
+
color: #333;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.value-display {
|
|
98
|
+
margin-top: 16px;
|
|
99
|
+
padding: 8px;
|
|
100
|
+
background-color: #f5f5f5;
|
|
101
|
+
border-radius: 4px;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
</style>
|
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="demo-container">
|
|
3
|
-
<h2>XRate 评分组件示例</h2>
|
|
4
|
-
|
|
5
|
-
<div class="demo-section">
|
|
6
|
-
<h3>基础用法</h3>
|
|
7
|
-
<x-rate v-model="basicRate" />
|
|
8
|
-
<div>当前值: {{ basicRate }}</div>
|
|
9
|
-
<a-button @click="resetBasicRate">重置</a-button>
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
<div class="demo-section">
|
|
13
|
-
<h3>允许半星</h3>
|
|
14
|
-
<x-rate v-model="halfRate" :allow-half="true" />
|
|
15
|
-
<div>当前值: {{ halfRate }}</div>
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<div class="demo-section">
|
|
19
|
-
<h3>自定义最大分值</h3>
|
|
20
|
-
<x-rate v-model="customRate" :max-count="10" />
|
|
21
|
-
<div>当前值: {{ customRate }}</div>
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
<div class="demo-section">
|
|
25
|
-
<h3>查询模式</h3>
|
|
26
|
-
<x-rate v-model="queryRate" mode="查询" />
|
|
27
|
-
<div>当前值: {{ queryRate }}</div>
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
<div class="demo-section">
|
|
31
|
-
<h3>查询模式(多选)</h3>
|
|
32
|
-
<x-rate v-model="queryMultiRate" mode="查询" query-type="IN" />
|
|
33
|
-
<div>当前值: {{ queryMultiRate }}</div>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<div class="demo-section">
|
|
37
|
-
<h3>禁用状态</h3>
|
|
38
|
-
<x-rate v-model="disabledRate" :disabled="true" />
|
|
39
|
-
<div>当前值: {{ disabledRate }}</div>
|
|
40
|
-
</div>
|
|
41
|
-
|
|
42
|
-
<div class="demo-section">
|
|
43
|
-
<h3>空值处理</h3>
|
|
44
|
-
<x-rate v-model="emptyRate" />
|
|
45
|
-
<div>当前值: {{ emptyRate }}</div>
|
|
46
|
-
<a-button @click="clearRate">清除</a-button>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</template>
|
|
50
|
-
|
|
51
|
-
<script>
|
|
52
|
-
import XRate from './index.vue'
|
|
53
|
-
|
|
54
|
-
export default {
|
|
55
|
-
name: 'XRateDemo',
|
|
56
|
-
components: {
|
|
57
|
-
XRate
|
|
58
|
-
},
|
|
59
|
-
data () {
|
|
60
|
-
return {
|
|
61
|
-
basicRate: 3,
|
|
62
|
-
halfRate: 3.5,
|
|
63
|
-
customRate: 7,
|
|
64
|
-
queryRate: 4,
|
|
65
|
-
queryMultiRate: [3, 4],
|
|
66
|
-
disabledRate: 2,
|
|
67
|
-
emptyRate: undefined
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
methods: {
|
|
71
|
-
resetBasicRate () {
|
|
72
|
-
this.basicRate = 3
|
|
73
|
-
},
|
|
74
|
-
clearRate () {
|
|
75
|
-
this.emptyRate = undefined
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
</script>
|
|
80
|
-
|
|
81
|
-
<style lang="less" scoped>
|
|
82
|
-
.demo-container {
|
|
83
|
-
padding: 20px;
|
|
84
|
-
|
|
85
|
-
.demo-section {
|
|
86
|
-
margin-bottom: 30px;
|
|
87
|
-
padding: 20px;
|
|
88
|
-
border: 1px solid #eee;
|
|
89
|
-
border-radius: 4px;
|
|
90
|
-
|
|
91
|
-
h3 {
|
|
92
|
-
margin-top: 0;
|
|
93
|
-
margin-bottom: 16px;
|
|
94
|
-
color: #333;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.ant-btn {
|
|
98
|
-
margin-top: 8px;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="demo-container">
|
|
3
|
+
<h2>XRate 评分组件示例</h2>
|
|
4
|
+
|
|
5
|
+
<div class="demo-section">
|
|
6
|
+
<h3>基础用法</h3>
|
|
7
|
+
<x-rate v-model="basicRate" />
|
|
8
|
+
<div>当前值: {{ basicRate }}</div>
|
|
9
|
+
<a-button @click="resetBasicRate">重置</a-button>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<div class="demo-section">
|
|
13
|
+
<h3>允许半星</h3>
|
|
14
|
+
<x-rate v-model="halfRate" :allow-half="true" />
|
|
15
|
+
<div>当前值: {{ halfRate }}</div>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div class="demo-section">
|
|
19
|
+
<h3>自定义最大分值</h3>
|
|
20
|
+
<x-rate v-model="customRate" :max-count="10" />
|
|
21
|
+
<div>当前值: {{ customRate }}</div>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="demo-section">
|
|
25
|
+
<h3>查询模式</h3>
|
|
26
|
+
<x-rate v-model="queryRate" mode="查询" />
|
|
27
|
+
<div>当前值: {{ queryRate }}</div>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div class="demo-section">
|
|
31
|
+
<h3>查询模式(多选)</h3>
|
|
32
|
+
<x-rate v-model="queryMultiRate" mode="查询" query-type="IN" />
|
|
33
|
+
<div>当前值: {{ queryMultiRate }}</div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div class="demo-section">
|
|
37
|
+
<h3>禁用状态</h3>
|
|
38
|
+
<x-rate v-model="disabledRate" :disabled="true" />
|
|
39
|
+
<div>当前值: {{ disabledRate }}</div>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div class="demo-section">
|
|
43
|
+
<h3>空值处理</h3>
|
|
44
|
+
<x-rate v-model="emptyRate" />
|
|
45
|
+
<div>当前值: {{ emptyRate }}</div>
|
|
46
|
+
<a-button @click="clearRate">清除</a-button>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script>
|
|
52
|
+
import XRate from './index.vue'
|
|
53
|
+
|
|
54
|
+
export default {
|
|
55
|
+
name: 'XRateDemo',
|
|
56
|
+
components: {
|
|
57
|
+
XRate
|
|
58
|
+
},
|
|
59
|
+
data () {
|
|
60
|
+
return {
|
|
61
|
+
basicRate: 3,
|
|
62
|
+
halfRate: 3.5,
|
|
63
|
+
customRate: 7,
|
|
64
|
+
queryRate: 4,
|
|
65
|
+
queryMultiRate: [3, 4],
|
|
66
|
+
disabledRate: 2,
|
|
67
|
+
emptyRate: undefined
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
methods: {
|
|
71
|
+
resetBasicRate () {
|
|
72
|
+
this.basicRate = 3
|
|
73
|
+
},
|
|
74
|
+
clearRate () {
|
|
75
|
+
this.emptyRate = undefined
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<style lang="less" scoped>
|
|
82
|
+
.demo-container {
|
|
83
|
+
padding: 20px;
|
|
84
|
+
|
|
85
|
+
.demo-section {
|
|
86
|
+
margin-bottom: 30px;
|
|
87
|
+
padding: 20px;
|
|
88
|
+
border: 1px solid #eee;
|
|
89
|
+
border-radius: 4px;
|
|
90
|
+
|
|
91
|
+
h3 {
|
|
92
|
+
margin-top: 0;
|
|
93
|
+
margin-bottom: 16px;
|
|
94
|
+
color: #333;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.ant-btn {
|
|
98
|
+
margin-top: 8px;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
</style>
|
|
@@ -1,186 +1,186 @@
|
|
|
1
|
-
// print.js
|
|
2
|
-
|
|
3
|
-
export function printElement (elementToPrint) {
|
|
4
|
-
// 创建一个新的浏览器窗口
|
|
5
|
-
const printWindow = window.open('', '_blank', 'height=1024,width=768')
|
|
6
|
-
// 设置新窗口的文档内容
|
|
7
|
-
printWindow.document.write(`
|
|
8
|
-
<html>
|
|
9
|
-
<head>
|
|
10
|
-
<title>Print</title>
|
|
11
|
-
<style>
|
|
12
|
-
@page {
|
|
13
|
-
size: auto;
|
|
14
|
-
margin: 0mm;
|
|
15
|
-
}
|
|
16
|
-
html, body {
|
|
17
|
-
margin: 0;
|
|
18
|
-
padding: 0;
|
|
19
|
-
width: 100%;
|
|
20
|
-
height: 100%;
|
|
21
|
-
}
|
|
22
|
-
#print-container {
|
|
23
|
-
display: none
|
|
24
|
-
}
|
|
25
|
-
.img{
|
|
26
|
-
width: 95%;
|
|
27
|
-
height: 180px;
|
|
28
|
-
object-fit: cover;
|
|
29
|
-
}
|
|
30
|
-
.reportMain {
|
|
31
|
-
text-align: center;
|
|
32
|
-
margin: 0 auto;
|
|
33
|
-
font-size: 16px;
|
|
34
|
-
color: #000;
|
|
35
|
-
background-color: #fff;
|
|
36
|
-
padding: 15px;
|
|
37
|
-
border-radius: 8px;
|
|
38
|
-
|
|
39
|
-
.reportTitle {
|
|
40
|
-
font-weight: bold;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.subTitle {
|
|
44
|
-
display: flex;
|
|
45
|
-
justify-content: space-between;
|
|
46
|
-
margin-bottom: 1%;
|
|
47
|
-
|
|
48
|
-
.subTitleItems {
|
|
49
|
-
max-width: 30%;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.inputsDiv {
|
|
54
|
-
display: flex;
|
|
55
|
-
justify-content: space-between;
|
|
56
|
-
.inputsDivItem {
|
|
57
|
-
display: flex;
|
|
58
|
-
align-items: center;
|
|
59
|
-
padding: 0 4px;
|
|
60
|
-
white-space: nowrap;
|
|
61
|
-
.inputsDivItemLabel {
|
|
62
|
-
padding: 0 4px;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.reportTable {
|
|
68
|
-
width: 100%;
|
|
69
|
-
border-collapse: collapse;
|
|
70
|
-
table-layout:fixed;
|
|
71
|
-
word-break:break-all;
|
|
72
|
-
text-align: center;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
.reportMainForDisplay {
|
|
76
|
-
text-align: center;
|
|
77
|
-
margin: 10% auto;
|
|
78
|
-
font-size: 16px;
|
|
79
|
-
color: #000;
|
|
80
|
-
background-color: #fff;
|
|
81
|
-
padding: 15px;
|
|
82
|
-
border-radius: 8px;
|
|
83
|
-
|
|
84
|
-
.reportTitle {
|
|
85
|
-
font-weight: bold;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.subTitle {
|
|
89
|
-
display: flex;
|
|
90
|
-
justify-content: space-between;
|
|
91
|
-
|
|
92
|
-
.subTitleItems {
|
|
93
|
-
max-width: 30%;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.inputsDiv {
|
|
98
|
-
display: flex;
|
|
99
|
-
justify-content: space-around;
|
|
100
|
-
.inputsDivItem {
|
|
101
|
-
display: flex;
|
|
102
|
-
align-items: center;
|
|
103
|
-
padding: 0 4px;
|
|
104
|
-
white-space: nowrap;
|
|
105
|
-
.inputsDivItemLabel {
|
|
106
|
-
padding: 0 4px;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.reportTable {
|
|
112
|
-
width: 100%;
|
|
113
|
-
border-collapse: collapse;
|
|
114
|
-
table-layout:fixed;
|
|
115
|
-
word-break:break-all;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
.reportMainNoPadding {
|
|
119
|
-
text-align: center;
|
|
120
|
-
margin: 0 auto;
|
|
121
|
-
font-size: 16px;
|
|
122
|
-
color: #000;
|
|
123
|
-
background-color: #fff;
|
|
124
|
-
border-radius: 8px;
|
|
125
|
-
|
|
126
|
-
.reportTitle {
|
|
127
|
-
font-weight: bold;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.subTitle {
|
|
131
|
-
display: flex;
|
|
132
|
-
justify-content: space-between;
|
|
133
|
-
|
|
134
|
-
.subTitleItems {
|
|
135
|
-
max-width: 30%;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.inputsDiv {
|
|
140
|
-
display: flex;
|
|
141
|
-
justify-content: space-between;
|
|
142
|
-
.inputsDivItem {
|
|
143
|
-
display: flex;
|
|
144
|
-
align-items: center;
|
|
145
|
-
padding: 0 4px;
|
|
146
|
-
white-space: nowrap;
|
|
147
|
-
.inputsDivItemLabel {
|
|
148
|
-
padding: 0 4px;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.reportTable {
|
|
154
|
-
width: 100%;
|
|
155
|
-
border-collapse: collapse;
|
|
156
|
-
table-layout:fixed;
|
|
157
|
-
word-break:break-all;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
.tools{
|
|
161
|
-
position: fixed;
|
|
162
|
-
right: 2%;
|
|
163
|
-
text-align: right;
|
|
164
|
-
width: 60%;
|
|
165
|
-
cursor: pointer;
|
|
166
|
-
.toolsItem{
|
|
167
|
-
width: 15%;
|
|
168
|
-
margin-right: 3%;
|
|
169
|
-
display: inline-block;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
</style>
|
|
173
|
-
</head>
|
|
174
|
-
<body>
|
|
175
|
-
<!-- 将需要打印的元素内容复制到新窗口中 -->
|
|
176
|
-
${elementToPrint.innerHTML}
|
|
177
|
-
</body>
|
|
178
|
-
</html>
|
|
179
|
-
`)
|
|
180
|
-
// 延迟执行打印,以确保新窗口的内容已加载完成
|
|
181
|
-
printWindow.document.close() // 关闭文档流,确保内容完全加载
|
|
182
|
-
setTimeout(() => {
|
|
183
|
-
printWindow.print() // 调用打印方法
|
|
184
|
-
printWindow.close()
|
|
185
|
-
}, 500) // 延迟500毫秒后执行打印
|
|
186
|
-
}
|
|
1
|
+
// print.js
|
|
2
|
+
|
|
3
|
+
export function printElement (elementToPrint) {
|
|
4
|
+
// 创建一个新的浏览器窗口
|
|
5
|
+
const printWindow = window.open('', '_blank', 'height=1024,width=768')
|
|
6
|
+
// 设置新窗口的文档内容
|
|
7
|
+
printWindow.document.write(`
|
|
8
|
+
<html>
|
|
9
|
+
<head>
|
|
10
|
+
<title>Print</title>
|
|
11
|
+
<style>
|
|
12
|
+
@page {
|
|
13
|
+
size: auto;
|
|
14
|
+
margin: 0mm;
|
|
15
|
+
}
|
|
16
|
+
html, body {
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: 0;
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
}
|
|
22
|
+
#print-container {
|
|
23
|
+
display: none
|
|
24
|
+
}
|
|
25
|
+
.img{
|
|
26
|
+
width: 95%;
|
|
27
|
+
height: 180px;
|
|
28
|
+
object-fit: cover;
|
|
29
|
+
}
|
|
30
|
+
.reportMain {
|
|
31
|
+
text-align: center;
|
|
32
|
+
margin: 0 auto;
|
|
33
|
+
font-size: 16px;
|
|
34
|
+
color: #000;
|
|
35
|
+
background-color: #fff;
|
|
36
|
+
padding: 15px;
|
|
37
|
+
border-radius: 8px;
|
|
38
|
+
|
|
39
|
+
.reportTitle {
|
|
40
|
+
font-weight: bold;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.subTitle {
|
|
44
|
+
display: flex;
|
|
45
|
+
justify-content: space-between;
|
|
46
|
+
margin-bottom: 1%;
|
|
47
|
+
|
|
48
|
+
.subTitleItems {
|
|
49
|
+
max-width: 30%;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.inputsDiv {
|
|
54
|
+
display: flex;
|
|
55
|
+
justify-content: space-between;
|
|
56
|
+
.inputsDivItem {
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
padding: 0 4px;
|
|
60
|
+
white-space: nowrap;
|
|
61
|
+
.inputsDivItemLabel {
|
|
62
|
+
padding: 0 4px;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.reportTable {
|
|
68
|
+
width: 100%;
|
|
69
|
+
border-collapse: collapse;
|
|
70
|
+
table-layout:fixed;
|
|
71
|
+
word-break:break-all;
|
|
72
|
+
text-align: center;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
.reportMainForDisplay {
|
|
76
|
+
text-align: center;
|
|
77
|
+
margin: 10% auto;
|
|
78
|
+
font-size: 16px;
|
|
79
|
+
color: #000;
|
|
80
|
+
background-color: #fff;
|
|
81
|
+
padding: 15px;
|
|
82
|
+
border-radius: 8px;
|
|
83
|
+
|
|
84
|
+
.reportTitle {
|
|
85
|
+
font-weight: bold;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.subTitle {
|
|
89
|
+
display: flex;
|
|
90
|
+
justify-content: space-between;
|
|
91
|
+
|
|
92
|
+
.subTitleItems {
|
|
93
|
+
max-width: 30%;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.inputsDiv {
|
|
98
|
+
display: flex;
|
|
99
|
+
justify-content: space-around;
|
|
100
|
+
.inputsDivItem {
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
padding: 0 4px;
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
.inputsDivItemLabel {
|
|
106
|
+
padding: 0 4px;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.reportTable {
|
|
112
|
+
width: 100%;
|
|
113
|
+
border-collapse: collapse;
|
|
114
|
+
table-layout:fixed;
|
|
115
|
+
word-break:break-all;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
.reportMainNoPadding {
|
|
119
|
+
text-align: center;
|
|
120
|
+
margin: 0 auto;
|
|
121
|
+
font-size: 16px;
|
|
122
|
+
color: #000;
|
|
123
|
+
background-color: #fff;
|
|
124
|
+
border-radius: 8px;
|
|
125
|
+
|
|
126
|
+
.reportTitle {
|
|
127
|
+
font-weight: bold;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.subTitle {
|
|
131
|
+
display: flex;
|
|
132
|
+
justify-content: space-between;
|
|
133
|
+
|
|
134
|
+
.subTitleItems {
|
|
135
|
+
max-width: 30%;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.inputsDiv {
|
|
140
|
+
display: flex;
|
|
141
|
+
justify-content: space-between;
|
|
142
|
+
.inputsDivItem {
|
|
143
|
+
display: flex;
|
|
144
|
+
align-items: center;
|
|
145
|
+
padding: 0 4px;
|
|
146
|
+
white-space: nowrap;
|
|
147
|
+
.inputsDivItemLabel {
|
|
148
|
+
padding: 0 4px;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.reportTable {
|
|
154
|
+
width: 100%;
|
|
155
|
+
border-collapse: collapse;
|
|
156
|
+
table-layout:fixed;
|
|
157
|
+
word-break:break-all;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
.tools{
|
|
161
|
+
position: fixed;
|
|
162
|
+
right: 2%;
|
|
163
|
+
text-align: right;
|
|
164
|
+
width: 60%;
|
|
165
|
+
cursor: pointer;
|
|
166
|
+
.toolsItem{
|
|
167
|
+
width: 15%;
|
|
168
|
+
margin-right: 3%;
|
|
169
|
+
display: inline-block;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
</style>
|
|
173
|
+
</head>
|
|
174
|
+
<body>
|
|
175
|
+
<!-- 将需要打印的元素内容复制到新窗口中 -->
|
|
176
|
+
${elementToPrint.innerHTML}
|
|
177
|
+
</body>
|
|
178
|
+
</html>
|
|
179
|
+
`)
|
|
180
|
+
// 延迟执行打印,以确保新窗口的内容已加载完成
|
|
181
|
+
printWindow.document.close() // 关闭文档流,确保内容完全加载
|
|
182
|
+
setTimeout(() => {
|
|
183
|
+
printWindow.print() // 调用打印方法
|
|
184
|
+
printWindow.close()
|
|
185
|
+
}, 500) // 延迟500毫秒后执行打印
|
|
186
|
+
}
|
package/src/router/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { formatRoutes } from '@vue2-client/utils/routerUtil'
|
|
2
|
-
|
|
3
|
-
// 不需要登录拦截的路由配置
|
|
4
|
-
const loginIgnore = {
|
|
5
|
-
names: ['404', '403'], // 根据路由名称匹配
|
|
6
|
-
paths: ['/login', '/example', '/system/example', '/system/example/default', '/system/example/sub-example', '/submitTicket', '/submitTicket/', '/ServiceReview', '/DynamicStatistics', '/NewDynamicStatistics'], // 根据路由fullPath匹配
|
|
7
|
-
/**
|
|
8
|
-
* 判断路由是否包含在该配置中
|
|
9
|
-
* @param route vue-router 的 route 对象
|
|
10
|
-
* @returns {boolean}
|
|
11
|
-
*/
|
|
12
|
-
includes (route) {
|
|
13
|
-
return this.names.includes(route.name) || this.paths.includes(route.path)
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* 初始化路由实例
|
|
19
|
-
* @param isAsync 是否异步路由模式
|
|
20
|
-
* @returns {RouterOptions}
|
|
21
|
-
*/
|
|
22
|
-
function initRouter (isAsync) {
|
|
23
|
-
const options = require('./async/config.async').default
|
|
24
|
-
formatRoutes(options.routes)
|
|
25
|
-
return options
|
|
26
|
-
}
|
|
27
|
-
export { loginIgnore, initRouter }
|
|
1
|
+
import { formatRoutes } from '@vue2-client/utils/routerUtil'
|
|
2
|
+
|
|
3
|
+
// 不需要登录拦截的路由配置
|
|
4
|
+
const loginIgnore = {
|
|
5
|
+
names: ['404', '403'], // 根据路由名称匹配
|
|
6
|
+
paths: ['/login', '/example', '/system/example', '/system/example/default', '/system/example/sub-example', '/submitTicket', '/submitTicket/', '/ServiceReview', '/DynamicStatistics', '/NewDynamicStatistics'], // 根据路由fullPath匹配
|
|
7
|
+
/**
|
|
8
|
+
* 判断路由是否包含在该配置中
|
|
9
|
+
* @param route vue-router 的 route 对象
|
|
10
|
+
* @returns {boolean}
|
|
11
|
+
*/
|
|
12
|
+
includes (route) {
|
|
13
|
+
return this.names.includes(route.name) || this.paths.includes(route.path)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 初始化路由实例
|
|
19
|
+
* @param isAsync 是否异步路由模式
|
|
20
|
+
* @returns {RouterOptions}
|
|
21
|
+
*/
|
|
22
|
+
function initRouter (isAsync) {
|
|
23
|
+
const options = require('./async/config.async').default
|
|
24
|
+
formatRoutes(options.routes)
|
|
25
|
+
return options
|
|
26
|
+
}
|
|
27
|
+
export { loginIgnore, initRouter }
|
package/src/utils/map-utils.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import AMapLoader from '@amap/amap-jsapi-loader'
|
|
2
|
-
let Amap
|
|
3
|
-
async function GetGDMap (secretKey, key) {
|
|
4
|
-
if (!Amap) {
|
|
5
|
-
window._AMapSecurityConfig = {
|
|
6
|
-
securityJsCode: secretKey
|
|
7
|
-
}
|
|
8
|
-
// 解决高德地图加载报错 ---> 禁止多种API加载方式混用
|
|
9
|
-
AMapLoader.reset()
|
|
10
|
-
Amap = await AMapLoader.load({
|
|
11
|
-
key: key, // 申请好的Web端开发者Key,首次调用 load 时必填
|
|
12
|
-
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
|
13
|
-
plugins: ['AMap.IndexCluster', 'AMP.MarkerCluster', 'AMap.InfoWindow', 'AMap.HeatMap', 'AMap.HawkEye', 'AMap.DistrictSearch',
|
|
14
|
-
'AMap.ToolBar', 'AMap.Geolocation', 'AMap.MouseTool',
|
|
15
|
-
'AMap.Geocoder', 'AMap.MarkerClusterer', 'AMap.AutoComplete', 'AMap.Scale'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
|
16
|
-
AMapUI: {
|
|
17
|
-
version: '1.1', // AMapUI 缺省 1.1
|
|
18
|
-
plugins: ['misc/PositionPicker'] // 需要加载的 AMapUI ui插件
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
return Amap
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async function getGDMap (address) {
|
|
26
|
-
new (await GetGDMap()).Geocoder({
|
|
27
|
-
radius: 500 // 范围,默认:500
|
|
28
|
-
}).getLocation(address, function (status, result) {
|
|
29
|
-
if (status === 'complete' && result.geocodes.length) {
|
|
30
|
-
return ({ lng: result.geocodes[0].location.lng, lat: result.geocodes[0].location.lat })
|
|
31
|
-
} else {
|
|
32
|
-
// eslint-disable-next-line prefer-promise-reject-errors
|
|
33
|
-
throw new Error('根据经纬度查询地址失败')
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
async function GetLocation (address) {
|
|
39
|
-
return new Promise((resolve, reject) => {
|
|
40
|
-
try {
|
|
41
|
-
resolve(getGDMap(address))
|
|
42
|
-
} catch (e) {
|
|
43
|
-
reject(e)
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
export { GetGDMap, GetLocation }
|
|
1
|
+
import AMapLoader from '@amap/amap-jsapi-loader'
|
|
2
|
+
let Amap
|
|
3
|
+
async function GetGDMap (secretKey, key) {
|
|
4
|
+
if (!Amap) {
|
|
5
|
+
window._AMapSecurityConfig = {
|
|
6
|
+
securityJsCode: secretKey
|
|
7
|
+
}
|
|
8
|
+
// 解决高德地图加载报错 ---> 禁止多种API加载方式混用
|
|
9
|
+
AMapLoader.reset()
|
|
10
|
+
Amap = await AMapLoader.load({
|
|
11
|
+
key: key, // 申请好的Web端开发者Key,首次调用 load 时必填
|
|
12
|
+
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
|
13
|
+
plugins: ['AMap.IndexCluster', 'AMP.MarkerCluster', 'AMap.InfoWindow', 'AMap.HeatMap', 'AMap.HawkEye', 'AMap.DistrictSearch',
|
|
14
|
+
'AMap.ToolBar', 'AMap.Geolocation', 'AMap.MouseTool',
|
|
15
|
+
'AMap.Geocoder', 'AMap.MarkerClusterer', 'AMap.AutoComplete', 'AMap.Scale'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
|
16
|
+
AMapUI: {
|
|
17
|
+
version: '1.1', // AMapUI 缺省 1.1
|
|
18
|
+
plugins: ['misc/PositionPicker'] // 需要加载的 AMapUI ui插件
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
return Amap
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async function getGDMap (address) {
|
|
26
|
+
new (await GetGDMap()).Geocoder({
|
|
27
|
+
radius: 500 // 范围,默认:500
|
|
28
|
+
}).getLocation(address, function (status, result) {
|
|
29
|
+
if (status === 'complete' && result.geocodes.length) {
|
|
30
|
+
return ({ lng: result.geocodes[0].location.lng, lat: result.geocodes[0].location.lat })
|
|
31
|
+
} else {
|
|
32
|
+
// eslint-disable-next-line prefer-promise-reject-errors
|
|
33
|
+
throw new Error('根据经纬度查询地址失败')
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function GetLocation (address) {
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
|
+
try {
|
|
41
|
+
resolve(getGDMap(address))
|
|
42
|
+
} catch (e) {
|
|
43
|
+
reject(e)
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
export { GetGDMap, GetLocation }
|
package/test/request.test.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import EncryptUtil from '@vue2-client/utils/EncryptUtil'
|
|
2
|
-
import { test, describe } from '@jest/globals'
|
|
3
|
-
|
|
4
|
-
describe('请求加密模块', () => {
|
|
5
|
-
const VALID_KEY = 'a964287a2cef8781ed76bd63dcadd578'
|
|
6
|
-
const TEST_PAYLOAD = {
|
|
7
|
-
username: 'admin',
|
|
8
|
-
password: 'P@ssw0rd_测试',
|
|
9
|
-
timestamp: Date.now()
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// CBC加密测试
|
|
13
|
-
test('应生成有效的加密字符串', () => {
|
|
14
|
-
const encrypted = EncryptUtil.AESEncryptCBC(TEST_PAYLOAD, VALID_KEY)
|
|
15
|
-
console.log(encrypted)
|
|
16
|
-
})
|
|
17
|
-
})
|
|
1
|
+
import EncryptUtil from '@vue2-client/utils/EncryptUtil'
|
|
2
|
+
import { test, describe } from '@jest/globals'
|
|
3
|
+
|
|
4
|
+
describe('请求加密模块', () => {
|
|
5
|
+
const VALID_KEY = 'a964287a2cef8781ed76bd63dcadd578'
|
|
6
|
+
const TEST_PAYLOAD = {
|
|
7
|
+
username: 'admin',
|
|
8
|
+
password: 'P@ssw0rd_测试',
|
|
9
|
+
timestamp: Date.now()
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// CBC加密测试
|
|
13
|
+
test('应生成有效的加密字符串', () => {
|
|
14
|
+
const encrypted = EncryptUtil.AESEncryptCBC(TEST_PAYLOAD, VALID_KEY)
|
|
15
|
+
console.log(encrypted)
|
|
16
|
+
})
|
|
17
|
+
})
|