vue2-client 1.14.26 → 1.14.28
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 +108 -108
- package/src/base-client/components/common/AmapMarker/index.js +3 -3
- package/src/base-client/components/common/Upload/Upload.vue +1 -0
- package/src/base-client/components/common/XDetailsView/index.js +3 -3
- package/src/base-client/components/common/XForm/demo.vue +105 -105
- package/src/base-client/components/common/XFormGroupDetails/index.js +3 -3
- package/src/base-client/components/common/XRate/demo.vue +102 -102
- package/src/router/index.js +27 -27
- package/src/utils/request.js +378 -377
- package/test/request.test.js +17 -17
- package/.cursor/rules/myrule.mdc +0 -9
|
@@ -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>
|
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 }
|