vue2-client 1.18.47 → 1.18.51
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/.claude/settings.local.json +28 -21
- package/.eslintrc.js +84 -84
- package/Components.md +60 -60
- package/docs/image.png +0 -0
- package/docs/index.md +30 -30
- package/index.js +31 -31
- package/jest-transform-stub.js +8 -8
- package/jest.setup.js +7 -7
- package/package.json +1 -1
- package/src/assets/img/querySlotDemo.svg +15 -15
- package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +120 -120
- package/src/base-client/components/common/CitySelect/index.js +3 -3
- package/src/base-client/components/common/CitySelect/index.md +109 -109
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +669 -669
- package/src/base-client/components/common/CreateQuery/index.js +3 -3
- package/src/base-client/components/common/CreateQuery/index.md +42 -42
- package/src/base-client/components/common/CreateSimpleFormQuery/index.js +3 -3
- package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -42
- package/src/base-client/components/common/FormGroupEdit/index.js +3 -3
- package/src/base-client/components/common/FormGroupEdit/index.md +43 -43
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +166 -166
- package/src/base-client/components/common/FormGroupQuery/index.js +3 -3
- package/src/base-client/components/common/FormGroupQuery/index.md +43 -43
- package/src/base-client/components/common/JSONToTree/jsontotree.vue +271 -271
- package/src/base-client/components/common/PersonSetting/PersonSetting.vue +208 -208
- package/src/base-client/components/common/PersonSetting/index.js +3 -3
- package/src/base-client/components/common/Tree/Tree.vue +149 -149
- package/src/base-client/components/common/Tree/index.js +2 -2
- package/src/base-client/components/common/Upload/index.js +3 -3
- package/src/base-client/components/common/XAddNativeForm/demo.vue +20 -24
- package/src/base-client/components/common/XAddNativeForm/index.md +146 -146
- package/src/base-client/components/common/XCard/XCard.vue +64 -64
- package/src/base-client/components/common/XDataDrawer/XDataDrawer.vue +180 -180
- package/src/base-client/components/common/XDataDrawer/index.js +3 -3
- package/src/base-client/components/common/XDataDrawer/index.md +41 -41
- package/src/base-client/components/common/XDescriptions/index.js +3 -3
- package/src/base-client/components/common/XDescriptions/index.md +322 -322
- package/src/base-client/components/common/XForm/XForm.vue +121 -64
- package/src/base-client/components/common/XForm/XFormItem.vue +464 -407
- package/src/base-client/components/common/XForm/index.md +178 -178
- package/src/base-client/components/common/XFormCol/XFormCol.vue +43 -36
- package/src/base-client/components/common/XFormTable/XFormTable.vue +4 -1
- package/src/base-client/components/common/XFormTable/demo.vue +24 -35
- package/src/base-client/components/common/XStepView/XStepView.vue +252 -252
- package/src/base-client/components/common/XStepView/index.js +3 -3
- package/src/base-client/components/common/XStepView/index.md +31 -31
- package/src/base-client/components/common/XTable/XTable.vue +1715 -1715
- package/src/base-client/components/common/XTable/XTableWrapper.vue +786 -786
- package/src/base-client/components/common/XTable/index.md +255 -255
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
- package/src/base-client/plugins/Config.js +19 -19
- package/src/base-client/plugins/tabs-page-plugin.js +39 -39
- package/src/components/Charts/Bar.vue +62 -62
- package/src/components/Charts/ChartCard.vue +134 -134
- package/src/components/Charts/Liquid.vue +67 -67
- package/src/components/Charts/MiniArea.vue +39 -39
- package/src/components/Charts/MiniBar.vue +39 -39
- package/src/components/Charts/MiniProgress.vue +75 -75
- package/src/components/Charts/MiniSmoothArea.vue +40 -40
- package/src/components/Charts/Radar.vue +68 -68
- package/src/components/Charts/RankList.vue +77 -77
- package/src/components/Charts/TagCloud.vue +113 -113
- package/src/components/Charts/TransferBar.vue +64 -64
- package/src/components/Charts/Trend.vue +82 -82
- package/src/components/Charts/chart.less +12 -12
- package/src/components/Charts/smooth.area.less +13 -13
- package/src/components/NumberInfo/NumberInfo.vue +54 -54
- package/src/components/NumberInfo/index.js +3 -3
- package/src/components/NumberInfo/index.less +54 -54
- package/src/components/NumberInfo/index.md +43 -43
- package/src/components/card/ChartCard.vue +79 -79
- package/src/components/chart/Bar.vue +60 -60
- package/src/components/chart/MiniArea.vue +67 -67
- package/src/components/chart/MiniBar.vue +59 -59
- package/src/components/chart/MiniProgress.vue +57 -57
- package/src/components/chart/Radar.vue +80 -80
- package/src/components/chart/RankingList.vue +60 -60
- package/src/components/chart/Trend.vue +79 -79
- package/src/components/chart/index.less +9 -9
- package/src/components/checkbox/ColorCheckbox.vue +157 -157
- package/src/components/input/IInput.vue +66 -66
- package/src/components/menu/SideMenu.vue +75 -75
- package/src/components/menu/menu.js +273 -273
- package/src/components/tool/AStepItem.vue +60 -60
- package/src/layouts/CommonLayout.vue +56 -56
- package/src/layouts/header/HeaderNotice.vue +177 -177
- package/src/lib.js +1 -1
- package/src/mock/extend/index.js +84 -84
- package/src/mock/goods/index.js +108 -108
- package/src/pages/dashboard/workplace/WorkPlace.vue +141 -141
- package/src/pages/system/dictionary/index.vue +44 -44
- package/src/pages/system/monitor/loginInfor/index.vue +37 -37
- package/src/pages/system/monitor/operLog/index.vue +37 -37
- package/src/router/async/router.map.js +10 -15
- package/src/services/api/cas.js +79 -79
- package/src/services/api/common.js +10 -2
- package/src/services/api/restTools.js +11 -0
- package/src/services/v3Api.js +25 -17
- package/src/store/modules/setting.js +119 -119
- package/src/utils/authority-utils.js +85 -85
- package/src/utils/errorCode.js +6 -6
- package/src/utils/request.js +68 -80
- package/src/utils/requestDedupe.js +245 -0
- package/vue.config.js +40 -42
- package//350/277/201/347/247/273/346/227/245/345/277/227.md +15 -15
- package/assets/c__Users_QXLL_AppData_Roaming_Cursor_User_workspaceStorage_4fb3d7e3441d32bc6f2c7358b4188b48_images_e8c132e6dde513250d7f9721712df1f8-f1522a08-1aa0-4866-b4e5-b34cf2e21109.png +0 -0
- package/docs/HChart/351/205/215/347/275/256/346/226/207/346/241/243.md +0 -960
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
# XAddNativeForm
|
|
2
|
-
|
|
3
|
-
动态新增/修改表单控件,根据JSON配置生成一个完整的可供新增/修改数据的动态表单
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
## 何时使用
|
|
7
|
-
|
|
8
|
-
当需要一个可供新增/修改数据的动态生成的表单时
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
引用方式:
|
|
12
|
-
|
|
13
|
-
```javascript
|
|
14
|
-
import XAddNativeForm from '@vue2-client/base-client/components/XAddNativeForm/XAddNativeForm'
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
components: {
|
|
18
|
-
XAddNativeForm
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
## 代码演示
|
|
26
|
-
|
|
27
|
-
```html
|
|
28
|
-
<x-add-native-form
|
|
29
|
-
ref="nativeForm"
|
|
30
|
-
@onSubmit="submit"/>
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## 构造参数,通过init方法构造
|
|
34
|
-
|
|
35
|
-
| 参数 | 说明 | 类型 | 默认值 |
|
|
36
|
-
|-----------------|----------------------|-------|--------|
|
|
37
|
-
| formItems | 表单项集合 | array | [] |
|
|
38
|
-
| viewMode | 是否为预览模式 | bool | false |
|
|
39
|
-
| isHandleFormKey | 是否对提交表单的key进行处理 | bool | true |
|
|
40
|
-
| serviceName | 所属服务模块名 | string | system |
|
|
41
|
-
| businessType | 业务类型(新增/修改) | string | - |
|
|
42
|
-
| title | 业务标题 | string | - |
|
|
43
|
-
| getDataParams | 调用logic获取下拉框数据源的追加参数 | {} | - |
|
|
44
|
-
| simpleFormJsonData | 动态简易表单集合 | {} | - |
|
|
45
|
-
|
|
46
|
-
## 事件
|
|
47
|
-
| 事件 | 说明 | 类型 | 默认值 |
|
|
48
|
-
|-----------|----------------------|-------|-----------|
|
|
49
|
-
| @onSubmit | 表单的提交事件 | event | - |
|
|
50
|
-
|
|
51
|
-
## 例子1
|
|
52
|
-
----
|
|
53
|
-
```vue
|
|
54
|
-
<template>
|
|
55
|
-
<x-add-native-form
|
|
56
|
-
ref="nativeForm"
|
|
57
|
-
@onSubmit="submit"/>
|
|
58
|
-
</template>
|
|
59
|
-
<script>
|
|
60
|
-
import { getConfigUrl } from '@vue2-client/services/api/common'
|
|
61
|
-
export default {
|
|
62
|
-
created () {
|
|
63
|
-
this.initComponents()
|
|
64
|
-
},
|
|
65
|
-
methods: {
|
|
66
|
-
initComponents() {
|
|
67
|
-
// 获取请求配置中心的地址
|
|
68
|
-
const url = getConfigUrl('yourConfigModuleName')
|
|
69
|
-
post(url, { configName: 'yourConfigName' }).then(res => {
|
|
70
|
-
if (this.$refs.nativeForm) {
|
|
71
|
-
this.$refs.nativeForm.init({
|
|
72
|
-
formItems: res,
|
|
73
|
-
serviceName: 'af-iot',
|
|
74
|
-
businessType: '新增',
|
|
75
|
-
title: '新增告警记录'
|
|
76
|
-
})
|
|
77
|
-
}
|
|
78
|
-
})
|
|
79
|
-
},
|
|
80
|
-
submit (res) {
|
|
81
|
-
post(api.addData, res.realForm).then(data => {
|
|
82
|
-
this.$message.success(res.businessType + '成功!')
|
|
83
|
-
}).catch(e => {
|
|
84
|
-
this.$message.error(res.businessType + '失败:' + e)
|
|
85
|
-
})
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
</script>
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
## JSON配置示例
|
|
93
|
-
----
|
|
94
|
-
`这是一个表单配置示例,通过以下配置,你会得到一个有选项的单选框,一个带校验的输入框,以及一个文本域`
|
|
95
|
-
```json
|
|
96
|
-
[
|
|
97
|
-
{
|
|
98
|
-
"name": "是否通气",
|
|
99
|
-
"model": "is_ventilate",
|
|
100
|
-
"keys": [
|
|
101
|
-
{ "label": "是", "value": "1" },
|
|
102
|
-
{ "label": "否", "value": "0" }
|
|
103
|
-
],
|
|
104
|
-
"type": "radio",
|
|
105
|
-
"addOrEdit": "all",
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
"name": "处理人",
|
|
109
|
-
"model": "f_processor",
|
|
110
|
-
"rule": {
|
|
111
|
-
"required": true
|
|
112
|
-
},
|
|
113
|
-
"type": "input",
|
|
114
|
-
"addOrEdit": "all",
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"name": "处理内容",
|
|
118
|
-
"model": "f_handle_content",
|
|
119
|
-
"type": "textarea",
|
|
120
|
-
"addOrEdit": "all",
|
|
121
|
-
}
|
|
122
|
-
]
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## JSON配置规范
|
|
126
|
-
----
|
|
127
|
-
| 参数 | 说明 | 类型 | 默认值 |
|
|
128
|
-
|-----------------|----------------------|-------|-----------|
|
|
129
|
-
| name | 表单项名称 | string | '' |
|
|
130
|
-
| model | 表单项key | string | '' |
|
|
131
|
-
| rule | 表单校验 | json | {} |
|
|
132
|
-
| -> required | 是否必填 | bool | false |
|
|
133
|
-
| type | 表单类型 | string | input |
|
|
134
|
-
| keys | 当表单类型是select,radio时的选项值 | Array | [] |
|
|
135
|
-
| -> label | 选项的字面值 | string | '' |
|
|
136
|
-
| -> value | 选项的实际值 | string | '' |
|
|
137
|
-
| addOrEdit | 新增/修改场景 | string | all |
|
|
138
|
-
| -> add | 仅新增 | string | - |
|
|
139
|
-
| -> edit | 仅修改 | string | - |
|
|
140
|
-
| -> all | 全部支持 | string | - |
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
注意事项
|
|
144
|
-
----
|
|
145
|
-
|
|
146
|
-
> 本组件已经实现了自适应布局,在不同分辨率下的设备均可得到基本理想的展示效果
|
|
1
|
+
# XAddNativeForm
|
|
2
|
+
|
|
3
|
+
动态新增/修改表单控件,根据JSON配置生成一个完整的可供新增/修改数据的动态表单
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## 何时使用
|
|
7
|
+
|
|
8
|
+
当需要一个可供新增/修改数据的动态生成的表单时
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
引用方式:
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
import XAddNativeForm from '@vue2-client/base-client/components/XAddNativeForm/XAddNativeForm'
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
components: {
|
|
18
|
+
XAddNativeForm
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## 代码演示
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<x-add-native-form
|
|
29
|
+
ref="nativeForm"
|
|
30
|
+
@onSubmit="submit"/>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 构造参数,通过init方法构造
|
|
34
|
+
|
|
35
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
36
|
+
|-----------------|----------------------|-------|--------|
|
|
37
|
+
| formItems | 表单项集合 | array | [] |
|
|
38
|
+
| viewMode | 是否为预览模式 | bool | false |
|
|
39
|
+
| isHandleFormKey | 是否对提交表单的key进行处理 | bool | true |
|
|
40
|
+
| serviceName | 所属服务模块名 | string | system |
|
|
41
|
+
| businessType | 业务类型(新增/修改) | string | - |
|
|
42
|
+
| title | 业务标题 | string | - |
|
|
43
|
+
| getDataParams | 调用logic获取下拉框数据源的追加参数 | {} | - |
|
|
44
|
+
| simpleFormJsonData | 动态简易表单集合 | {} | - |
|
|
45
|
+
|
|
46
|
+
## 事件
|
|
47
|
+
| 事件 | 说明 | 类型 | 默认值 |
|
|
48
|
+
|-----------|----------------------|-------|-----------|
|
|
49
|
+
| @onSubmit | 表单的提交事件 | event | - |
|
|
50
|
+
|
|
51
|
+
## 例子1
|
|
52
|
+
----
|
|
53
|
+
```vue
|
|
54
|
+
<template>
|
|
55
|
+
<x-add-native-form
|
|
56
|
+
ref="nativeForm"
|
|
57
|
+
@onSubmit="submit"/>
|
|
58
|
+
</template>
|
|
59
|
+
<script>
|
|
60
|
+
import { getConfigUrl } from '@vue2-client/services/api/common'
|
|
61
|
+
export default {
|
|
62
|
+
created () {
|
|
63
|
+
this.initComponents()
|
|
64
|
+
},
|
|
65
|
+
methods: {
|
|
66
|
+
initComponents() {
|
|
67
|
+
// 获取请求配置中心的地址
|
|
68
|
+
const url = getConfigUrl('yourConfigModuleName')
|
|
69
|
+
post(url, { configName: 'yourConfigName' }).then(res => {
|
|
70
|
+
if (this.$refs.nativeForm) {
|
|
71
|
+
this.$refs.nativeForm.init({
|
|
72
|
+
formItems: res,
|
|
73
|
+
serviceName: 'af-iot',
|
|
74
|
+
businessType: '新增',
|
|
75
|
+
title: '新增告警记录'
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
},
|
|
80
|
+
submit (res) {
|
|
81
|
+
post(api.addData, res.realForm).then(data => {
|
|
82
|
+
this.$message.success(res.businessType + '成功!')
|
|
83
|
+
}).catch(e => {
|
|
84
|
+
this.$message.error(res.businessType + '失败:' + e)
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
</script>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## JSON配置示例
|
|
93
|
+
----
|
|
94
|
+
`这是一个表单配置示例,通过以下配置,你会得到一个有选项的单选框,一个带校验的输入框,以及一个文本域`
|
|
95
|
+
```json
|
|
96
|
+
[
|
|
97
|
+
{
|
|
98
|
+
"name": "是否通气",
|
|
99
|
+
"model": "is_ventilate",
|
|
100
|
+
"keys": [
|
|
101
|
+
{ "label": "是", "value": "1" },
|
|
102
|
+
{ "label": "否", "value": "0" }
|
|
103
|
+
],
|
|
104
|
+
"type": "radio",
|
|
105
|
+
"addOrEdit": "all",
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "处理人",
|
|
109
|
+
"model": "f_processor",
|
|
110
|
+
"rule": {
|
|
111
|
+
"required": true
|
|
112
|
+
},
|
|
113
|
+
"type": "input",
|
|
114
|
+
"addOrEdit": "all",
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "处理内容",
|
|
118
|
+
"model": "f_handle_content",
|
|
119
|
+
"type": "textarea",
|
|
120
|
+
"addOrEdit": "all",
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## JSON配置规范
|
|
126
|
+
----
|
|
127
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
128
|
+
|-----------------|----------------------|-------|-----------|
|
|
129
|
+
| name | 表单项名称 | string | '' |
|
|
130
|
+
| model | 表单项key | string | '' |
|
|
131
|
+
| rule | 表单校验 | json | {} |
|
|
132
|
+
| -> required | 是否必填 | bool | false |
|
|
133
|
+
| type | 表单类型 | string | input |
|
|
134
|
+
| keys | 当表单类型是select,radio时的选项值 | Array | [] |
|
|
135
|
+
| -> label | 选项的字面值 | string | '' |
|
|
136
|
+
| -> value | 选项的实际值 | string | '' |
|
|
137
|
+
| addOrEdit | 新增/修改场景 | string | all |
|
|
138
|
+
| -> add | 仅新增 | string | - |
|
|
139
|
+
| -> edit | 仅修改 | string | - |
|
|
140
|
+
| -> all | 全部支持 | string | - |
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
注意事项
|
|
144
|
+
----
|
|
145
|
+
|
|
146
|
+
> 本组件已经实现了自适应布局,在不同分辨率下的设备均可得到基本理想的展示效果
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<a-card :body-style="{ margin: 0, padding: 0 }" :bordered="false">
|
|
4
|
-
<a-skeleton v-show="loadState === 'loading'" active style="padding: 16px"/>
|
|
5
|
-
<a-empty v-show="loadState === 'empty'">
|
|
6
|
-
<a-button type="dashed" @click="retry">
|
|
7
|
-
重新加载
|
|
8
|
-
</a-button>
|
|
9
|
-
</a-empty>
|
|
10
|
-
<a-card
|
|
11
|
-
v-show="loadState === 'error'"
|
|
12
|
-
:body-style="{ margin: '0 auto' }"
|
|
13
|
-
:bordered="false"
|
|
14
|
-
:hoverable="true"
|
|
15
|
-
class="retryCard"
|
|
16
|
-
@click="retry" >
|
|
17
|
-
<a-icon :style="{ fontSize: '28px' }" type="global"/>
|
|
18
|
-
<p class="noSelect" style="margin-top: 20px">网络好像开小差了,点击重新加载...</p>
|
|
19
|
-
</a-card>
|
|
20
|
-
<div v-show="loadState === 'success'">
|
|
21
|
-
<slot></slot>
|
|
22
|
-
</div>
|
|
23
|
-
</a-card>
|
|
24
|
-
</div>
|
|
25
|
-
</template>
|
|
26
|
-
|
|
27
|
-
<script>
|
|
28
|
-
|
|
29
|
-
export default {
|
|
30
|
-
name: 'XCard',
|
|
31
|
-
props: {
|
|
32
|
-
loadState: {
|
|
33
|
-
type: String,
|
|
34
|
-
default: 'success'
|
|
35
|
-
},
|
|
36
|
-
retry: {
|
|
37
|
-
type: Function,
|
|
38
|
-
default: () => {
|
|
39
|
-
console.error('未实现重新加载')
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
data () {
|
|
44
|
-
return {
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
</script>
|
|
50
|
-
|
|
51
|
-
<style scoped>
|
|
52
|
-
.retryCard {
|
|
53
|
-
text-align: center;
|
|
54
|
-
}
|
|
55
|
-
.noSelect {
|
|
56
|
-
-webkit-touch-callout: none; /* iOS Safari */
|
|
57
|
-
-webkit-user-select: none; /* Chrome/Safari/Opera */
|
|
58
|
-
-khtml-user-select: none; /* Konqueror */
|
|
59
|
-
-moz-user-select: none; /* Firefox */
|
|
60
|
-
-ms-user-select: none; /* Internet Explorer/Edge */
|
|
61
|
-
user-select: none; /* Non-prefixed version, currently
|
|
62
|
-
not supported by any browser */
|
|
63
|
-
}
|
|
64
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<a-card :body-style="{ margin: 0, padding: 0 }" :bordered="false">
|
|
4
|
+
<a-skeleton v-show="loadState === 'loading'" active style="padding: 16px"/>
|
|
5
|
+
<a-empty v-show="loadState === 'empty'">
|
|
6
|
+
<a-button type="dashed" @click="retry">
|
|
7
|
+
重新加载
|
|
8
|
+
</a-button>
|
|
9
|
+
</a-empty>
|
|
10
|
+
<a-card
|
|
11
|
+
v-show="loadState === 'error'"
|
|
12
|
+
:body-style="{ margin: '0 auto' }"
|
|
13
|
+
:bordered="false"
|
|
14
|
+
:hoverable="true"
|
|
15
|
+
class="retryCard"
|
|
16
|
+
@click="retry" >
|
|
17
|
+
<a-icon :style="{ fontSize: '28px' }" type="global"/>
|
|
18
|
+
<p class="noSelect" style="margin-top: 20px">网络好像开小差了,点击重新加载...</p>
|
|
19
|
+
</a-card>
|
|
20
|
+
<div v-show="loadState === 'success'">
|
|
21
|
+
<slot></slot>
|
|
22
|
+
</div>
|
|
23
|
+
</a-card>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
|
|
29
|
+
export default {
|
|
30
|
+
name: 'XCard',
|
|
31
|
+
props: {
|
|
32
|
+
loadState: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: 'success'
|
|
35
|
+
},
|
|
36
|
+
retry: {
|
|
37
|
+
type: Function,
|
|
38
|
+
default: () => {
|
|
39
|
+
console.error('未实现重新加载')
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
data () {
|
|
44
|
+
return {
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<style scoped>
|
|
52
|
+
.retryCard {
|
|
53
|
+
text-align: center;
|
|
54
|
+
}
|
|
55
|
+
.noSelect {
|
|
56
|
+
-webkit-touch-callout: none; /* iOS Safari */
|
|
57
|
+
-webkit-user-select: none; /* Chrome/Safari/Opera */
|
|
58
|
+
-khtml-user-select: none; /* Konqueror */
|
|
59
|
+
-moz-user-select: none; /* Firefox */
|
|
60
|
+
-ms-user-select: none; /* Internet Explorer/Edge */
|
|
61
|
+
user-select: none; /* Non-prefixed version, currently
|
|
62
|
+
not supported by any browser */
|
|
63
|
+
}
|
|
64
|
+
</style>
|