vue2-client 1.9.136 → 1.9.137
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 +102 -102
- package/src/base-client/components/common/XDataCard/XDataCard.vue +3 -2
- package/src/base-client/components/common/XSimpleDescriptions/XSimpleDescriptions.vue +166 -166
- package/src/base-client/components/layout/XPageView/XPageView.vue +155 -155
- package/src/config/CreateQueryConfig.js +325 -325
- package/src/pages/WorkflowDetail/WorkflowDetail.vue +230 -230
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandle.vue +864 -864
- package/src/pages/XTreeOneProExample/index.vue +67 -67
- package/src/services/api/workFlow.js +63 -63
package/package.json
CHANGED
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "vue2-client",
|
|
3
|
-
"version": "1.9.
|
|
4
|
-
"private": false,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
|
|
7
|
-
"serve:gaslink": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode gaslink",
|
|
8
|
-
"serve:revenue": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode revenue",
|
|
9
|
-
"serve:his": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode his",
|
|
10
|
-
"mac-serve": "vue-cli-service serve --no-eslint --mode his",
|
|
11
|
-
"build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
|
|
12
|
-
"test:unit": "vue-cli-service test:unit",
|
|
13
|
-
"lint": "vue-cli-service lint",
|
|
14
|
-
"build:preview": "vue-cli-service build --mode preview",
|
|
15
|
-
"lint:nofix": "vue-cli-service lint --no-fix",
|
|
16
|
-
"test": "jest"
|
|
17
|
-
},
|
|
18
|
-
"dependencies": {
|
|
19
|
-
"@amap/amap-jsapi-loader": "^1.0.1",
|
|
20
|
-
"@antv/data-set": "^0.11.8",
|
|
21
|
-
"@antv/g2plot": "^2.4.31",
|
|
22
|
-
"@hufe921/canvas-editor": "^0.9.49",
|
|
23
|
-
"@vue/babel-preset-jsx": "^1.4.0",
|
|
24
|
-
"@afwenming123/vue-easy-tree": "^1.0.1",
|
|
25
|
-
"animate.css": "^4.1.1",
|
|
26
|
-
"ant-design-vue": "^1.7.8",
|
|
27
|
-
"axios": "^0.27.2",
|
|
28
|
-
"clipboard": "^2.0.11",
|
|
29
|
-
"core-js": "^3.33.0",
|
|
30
|
-
"crypto-js": "^4.1.1",
|
|
31
|
-
"date-fns": "^2.29.3",
|
|
32
|
-
"default-passive-events": "^2.0.0",
|
|
33
|
-
"dotenv": "^16.3.1",
|
|
34
|
-
"echarts": "^5.5.0",
|
|
35
|
-
"enquire.js": "^2.1.6",
|
|
36
|
-
"file-saver": "^2.0.5",
|
|
37
|
-
"highlight.js": "^11.7.0",
|
|
38
|
-
"html2canvas": "^1.4.1",
|
|
39
|
-
"js-base64": "^3.7.5",
|
|
40
|
-
"js-cookie": "^2.2.1",
|
|
41
|
-
"jsencrypt": "^3.3.2",
|
|
42
|
-
"jspdf": "^2.5.1",
|
|
43
|
-
"lodash.clonedeep": "^4.5.0",
|
|
44
|
-
"lodash.debounce": "^4",
|
|
45
|
-
"lodash.get": "^4.4.2",
|
|
46
|
-
"mockjs": "^1.1.0",
|
|
47
|
-
"nprogress": "^0.2.0",
|
|
48
|
-
"qs": "^6.11.2",
|
|
49
|
-
"regenerator-runtime": "^0.14.0",
|
|
50
|
-
"videojs-contrib-hls": "^5.15.0",
|
|
51
|
-
"viser-vue": "^2.4.8",
|
|
52
|
-
"vue": "^2.7.14",
|
|
53
|
-
"vue-codemirror": "4.0.6",
|
|
54
|
-
"vue-draggable-resizable": "^2",
|
|
55
|
-
"vue-i18n": "^8.28.2",
|
|
56
|
-
"vue-json-viewer": "^2.2.22",
|
|
57
|
-
"vue-router": "^3.6.5",
|
|
58
|
-
"vue-video-player": "^5.0.2",
|
|
59
|
-
"vue-virtual-scroller": "^1.1.2",
|
|
60
|
-
"vuedraggable": "^2.24.3",
|
|
61
|
-
"vuex": "^3.6.2",
|
|
62
|
-
"xlsx": "0.18.5"
|
|
63
|
-
},
|
|
64
|
-
"devDependencies": {
|
|
65
|
-
"@ant-design/colors": "^7.0.0",
|
|
66
|
-
"@babel/core": "^7.22.20",
|
|
67
|
-
"@babel/eslint-parser": "^7.22.15",
|
|
68
|
-
"@babel/preset-env": "^7.22.20",
|
|
69
|
-
"@vue/cli-plugin-babel": "^5.0.8",
|
|
70
|
-
"@vue/cli-plugin-eslint": "^5.0.8",
|
|
71
|
-
"@vue/cli-service": "^5.0.8",
|
|
72
|
-
"@vue/eslint-config-standard": "^8.0.1",
|
|
73
|
-
"@vue/test-utils": "^1.3.6",
|
|
74
|
-
"babel-jest": "^26.6.3",
|
|
75
|
-
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
76
|
-
"compression-webpack-plugin": "^10.0.0",
|
|
77
|
-
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
78
|
-
"deepmerge": "^4.3.1",
|
|
79
|
-
"eslint": "^8.51.0",
|
|
80
|
-
"eslint-plugin-vue": "^9.17.0",
|
|
81
|
-
"fast-deep-equal": "^3.1.3",
|
|
82
|
-
"ignore-loader": "^0.1.2",
|
|
83
|
-
"jest": "^26.6.3",
|
|
84
|
-
"jest-environment-jsdom": "^26.6.2",
|
|
85
|
-
"jest-transform-stub": "^2.0.0",
|
|
86
|
-
"less-loader": "^6.2.0",
|
|
87
|
-
"script-loader": "^0.7.2",
|
|
88
|
-
"style-resources-loader": "^1.5.0",
|
|
89
|
-
"vue-cli-plugin-style-resources-loader": "^0.1.5",
|
|
90
|
-
"vue-jest": "^4.0.1",
|
|
91
|
-
"vue-template-compiler": "^2.7.14",
|
|
92
|
-
"webpack": "^5.88.2",
|
|
93
|
-
"webpack-theme-color-replacer": "^1.4.7",
|
|
94
|
-
"whatwg-fetch": "^3.6.19"
|
|
95
|
-
},
|
|
96
|
-
"browserslist": [
|
|
97
|
-
"> 1%",
|
|
98
|
-
"last 2 versions",
|
|
99
|
-
"not dead",
|
|
100
|
-
"not ie 11"
|
|
101
|
-
]
|
|
102
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "vue2-client",
|
|
3
|
+
"version": "1.9.137",
|
|
4
|
+
"private": false,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
|
|
7
|
+
"serve:gaslink": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode gaslink",
|
|
8
|
+
"serve:revenue": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode revenue",
|
|
9
|
+
"serve:his": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode his",
|
|
10
|
+
"mac-serve": "vue-cli-service serve --no-eslint --mode his",
|
|
11
|
+
"build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
|
|
12
|
+
"test:unit": "vue-cli-service test:unit",
|
|
13
|
+
"lint": "vue-cli-service lint",
|
|
14
|
+
"build:preview": "vue-cli-service build --mode preview",
|
|
15
|
+
"lint:nofix": "vue-cli-service lint --no-fix",
|
|
16
|
+
"test": "jest"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@amap/amap-jsapi-loader": "^1.0.1",
|
|
20
|
+
"@antv/data-set": "^0.11.8",
|
|
21
|
+
"@antv/g2plot": "^2.4.31",
|
|
22
|
+
"@hufe921/canvas-editor": "^0.9.49",
|
|
23
|
+
"@vue/babel-preset-jsx": "^1.4.0",
|
|
24
|
+
"@afwenming123/vue-easy-tree": "^1.0.1",
|
|
25
|
+
"animate.css": "^4.1.1",
|
|
26
|
+
"ant-design-vue": "^1.7.8",
|
|
27
|
+
"axios": "^0.27.2",
|
|
28
|
+
"clipboard": "^2.0.11",
|
|
29
|
+
"core-js": "^3.33.0",
|
|
30
|
+
"crypto-js": "^4.1.1",
|
|
31
|
+
"date-fns": "^2.29.3",
|
|
32
|
+
"default-passive-events": "^2.0.0",
|
|
33
|
+
"dotenv": "^16.3.1",
|
|
34
|
+
"echarts": "^5.5.0",
|
|
35
|
+
"enquire.js": "^2.1.6",
|
|
36
|
+
"file-saver": "^2.0.5",
|
|
37
|
+
"highlight.js": "^11.7.0",
|
|
38
|
+
"html2canvas": "^1.4.1",
|
|
39
|
+
"js-base64": "^3.7.5",
|
|
40
|
+
"js-cookie": "^2.2.1",
|
|
41
|
+
"jsencrypt": "^3.3.2",
|
|
42
|
+
"jspdf": "^2.5.1",
|
|
43
|
+
"lodash.clonedeep": "^4.5.0",
|
|
44
|
+
"lodash.debounce": "^4",
|
|
45
|
+
"lodash.get": "^4.4.2",
|
|
46
|
+
"mockjs": "^1.1.0",
|
|
47
|
+
"nprogress": "^0.2.0",
|
|
48
|
+
"qs": "^6.11.2",
|
|
49
|
+
"regenerator-runtime": "^0.14.0",
|
|
50
|
+
"videojs-contrib-hls": "^5.15.0",
|
|
51
|
+
"viser-vue": "^2.4.8",
|
|
52
|
+
"vue": "^2.7.14",
|
|
53
|
+
"vue-codemirror": "4.0.6",
|
|
54
|
+
"vue-draggable-resizable": "^2",
|
|
55
|
+
"vue-i18n": "^8.28.2",
|
|
56
|
+
"vue-json-viewer": "^2.2.22",
|
|
57
|
+
"vue-router": "^3.6.5",
|
|
58
|
+
"vue-video-player": "^5.0.2",
|
|
59
|
+
"vue-virtual-scroller": "^1.1.2",
|
|
60
|
+
"vuedraggable": "^2.24.3",
|
|
61
|
+
"vuex": "^3.6.2",
|
|
62
|
+
"xlsx": "0.18.5"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@ant-design/colors": "^7.0.0",
|
|
66
|
+
"@babel/core": "^7.22.20",
|
|
67
|
+
"@babel/eslint-parser": "^7.22.15",
|
|
68
|
+
"@babel/preset-env": "^7.22.20",
|
|
69
|
+
"@vue/cli-plugin-babel": "^5.0.8",
|
|
70
|
+
"@vue/cli-plugin-eslint": "^5.0.8",
|
|
71
|
+
"@vue/cli-service": "^5.0.8",
|
|
72
|
+
"@vue/eslint-config-standard": "^8.0.1",
|
|
73
|
+
"@vue/test-utils": "^1.3.6",
|
|
74
|
+
"babel-jest": "^26.6.3",
|
|
75
|
+
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
76
|
+
"compression-webpack-plugin": "^10.0.0",
|
|
77
|
+
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
78
|
+
"deepmerge": "^4.3.1",
|
|
79
|
+
"eslint": "^8.51.0",
|
|
80
|
+
"eslint-plugin-vue": "^9.17.0",
|
|
81
|
+
"fast-deep-equal": "^3.1.3",
|
|
82
|
+
"ignore-loader": "^0.1.2",
|
|
83
|
+
"jest": "^26.6.3",
|
|
84
|
+
"jest-environment-jsdom": "^26.6.2",
|
|
85
|
+
"jest-transform-stub": "^2.0.0",
|
|
86
|
+
"less-loader": "^6.2.0",
|
|
87
|
+
"script-loader": "^0.7.2",
|
|
88
|
+
"style-resources-loader": "^1.5.0",
|
|
89
|
+
"vue-cli-plugin-style-resources-loader": "^0.1.5",
|
|
90
|
+
"vue-jest": "^4.0.1",
|
|
91
|
+
"vue-template-compiler": "^2.7.14",
|
|
92
|
+
"webpack": "^5.88.2",
|
|
93
|
+
"webpack-theme-color-replacer": "^1.4.7",
|
|
94
|
+
"whatwg-fetch": "^3.6.19"
|
|
95
|
+
},
|
|
96
|
+
"browserslist": [
|
|
97
|
+
"> 1%",
|
|
98
|
+
"last 2 versions",
|
|
99
|
+
"not dead",
|
|
100
|
+
"not ie 11"
|
|
101
|
+
]
|
|
102
|
+
}
|
|
@@ -312,16 +312,17 @@ export default {
|
|
|
312
312
|
.XCard {
|
|
313
313
|
display: flex;
|
|
314
314
|
flex-wrap: wrap;
|
|
315
|
-
justify-content:
|
|
315
|
+
justify-content: flex-start;
|
|
316
316
|
overflow-y: auto;
|
|
317
317
|
overflow-x: hidden;
|
|
318
318
|
max-height: 85vh;
|
|
319
319
|
|
|
320
320
|
.data-card {
|
|
321
321
|
width: 100%;
|
|
322
|
+
max-width: 300px;
|
|
322
323
|
border: 2px solid rgb(244,244,244);
|
|
323
324
|
border-radius: 5px;
|
|
324
|
-
margin
|
|
325
|
+
margin: 5px;
|
|
325
326
|
|
|
326
327
|
.header {
|
|
327
328
|
width: 100%;
|
|
@@ -1,166 +1,166 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<a-row type="flex" justfy="space-around">
|
|
4
|
-
<template v-for="(item, index) in config">
|
|
5
|
-
<!-- 展示项 -->
|
|
6
|
-
<a-col :key="'col' + index" :span="Math.floor(24 / config.length)">
|
|
7
|
-
<div class="item">
|
|
8
|
-
<!-- 标题 -->
|
|
9
|
-
<p class="label">{{ item.label }}</p>
|
|
10
|
-
<!-- 内容 - 进度条 -->
|
|
11
|
-
<template v-if="item.type === 'percent'">
|
|
12
|
-
<p class="value" :style="'color: ' + determineColor(data[item.key])">{{ data[item.key] }}%</p>
|
|
13
|
-
</template>
|
|
14
|
-
<!-- 内容 - 非进度条 -->
|
|
15
|
-
<template v-else>
|
|
16
|
-
<p class="value" :style="item.style ? item.style : ''">{{ data[item.key] }}</p>
|
|
17
|
-
</template>
|
|
18
|
-
</div>
|
|
19
|
-
</a-col>
|
|
20
|
-
<!-- 分割线 -->
|
|
21
|
-
<a-col :key="'col' + index + 'after'" :span="1" v-if="index !== config.length - 1" class="divider-col">
|
|
22
|
-
<a-divider type="vertical" class="divider"/>
|
|
23
|
-
</a-col>
|
|
24
|
-
</template>
|
|
25
|
-
</a-row>
|
|
26
|
-
</div>
|
|
27
|
-
</template>
|
|
28
|
-
|
|
29
|
-
<script>
|
|
30
|
-
|
|
31
|
-
import { getConfigByName } from '@vue2-client/services/api/common'
|
|
32
|
-
|
|
33
|
-
export default {
|
|
34
|
-
name: 'XSimpleDescriptions',
|
|
35
|
-
props: {
|
|
36
|
-
// 配置
|
|
37
|
-
dataConfig: {
|
|
38
|
-
type: Array,
|
|
39
|
-
default: undefined
|
|
40
|
-
},
|
|
41
|
-
// 数据
|
|
42
|
-
dataContent: {
|
|
43
|
-
type: Object,
|
|
44
|
-
default: undefined
|
|
45
|
-
},
|
|
46
|
-
// 配置名
|
|
47
|
-
dataConfigName: {
|
|
48
|
-
type: String,
|
|
49
|
-
default: undefined
|
|
50
|
-
},
|
|
51
|
-
// 服务名
|
|
52
|
-
serviceName: {
|
|
53
|
-
type: String,
|
|
54
|
-
default: process.env.VUE_APP_SYSTEM_NAME
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
data () {
|
|
58
|
-
return {
|
|
59
|
-
// 配置
|
|
60
|
-
config: [],
|
|
61
|
-
// 数据
|
|
62
|
-
data: {},
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
mounted () {
|
|
66
|
-
// 初始化配置
|
|
67
|
-
if (this.dataConfig) {
|
|
68
|
-
this.config = this.dataConfig
|
|
69
|
-
} else if (this.dataConfigName) {
|
|
70
|
-
getConfigByName(this.dataConfigName, this.serviceName, (res) => {
|
|
71
|
-
this.config = res.config
|
|
72
|
-
})
|
|
73
|
-
} else {
|
|
74
|
-
this.config = [
|
|
75
|
-
{
|
|
76
|
-
label: '未能正确获取配置',
|
|
77
|
-
key: 'totalUser'
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
label: '未能正确获取配置',
|
|
81
|
-
key: 'totalResidentArea'
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
label: '未能正确获取配置',
|
|
85
|
-
key: 'doneNum'
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
label: '未能正确获取配置',
|
|
89
|
-
key: 'todoNum'
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
label: '未能正确获取配置',
|
|
93
|
-
key: 'ratio',
|
|
94
|
-
type: 'percent'
|
|
95
|
-
}
|
|
96
|
-
]
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// 初始化数据
|
|
100
|
-
if (this.dataContent) {
|
|
101
|
-
this.data = this.dataContent
|
|
102
|
-
} else {
|
|
103
|
-
this.data = {
|
|
104
|
-
totalUser: 0,
|
|
105
|
-
totalResidentArea: 0,
|
|
106
|
-
doneNum: 0,
|
|
107
|
-
todoNum: 0,
|
|
108
|
-
ratio: 20
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
methods: {
|
|
113
|
-
// 根据完成率决定颜色
|
|
114
|
-
determineColor (ratio) {
|
|
115
|
-
let result
|
|
116
|
-
if (ratio >= 90) {
|
|
117
|
-
result = 'rgb( 1,245, 38 )'
|
|
118
|
-
} else if (ratio >= 75) {
|
|
119
|
-
result = 'rgb( 139,245, 0)'
|
|
120
|
-
} else if (ratio >= 40) {
|
|
121
|
-
result = 'rgb(245,163, 0)'
|
|
122
|
-
} else if (ratio >= 20) {
|
|
123
|
-
result = 'rgb(244, 96, 0)'
|
|
124
|
-
} else {
|
|
125
|
-
result = 'rgb(255, 0, 0)'
|
|
126
|
-
}
|
|
127
|
-
return result
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
watch: {
|
|
131
|
-
dataContent: {
|
|
132
|
-
handler (newValue) {
|
|
133
|
-
this.data = newValue
|
|
134
|
-
},
|
|
135
|
-
deep: true
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
</script>
|
|
140
|
-
|
|
141
|
-
<style lang="less" scoped>
|
|
142
|
-
.item {
|
|
143
|
-
padding: 5%;
|
|
144
|
-
|
|
145
|
-
.label {
|
|
146
|
-
color: rgba(117, 117, 117, 0.8);
|
|
147
|
-
text-align: center;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.value {
|
|
151
|
-
color: rgb( 51,157,255 );
|
|
152
|
-
font-size: 1.6em;
|
|
153
|
-
text-align: center;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.divider-col {
|
|
158
|
-
display: flex;
|
|
159
|
-
justify-content: center;
|
|
160
|
-
|
|
161
|
-
.divider {
|
|
162
|
-
margin-top: 35%;
|
|
163
|
-
height: 40px;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<a-row type="flex" justfy="space-around">
|
|
4
|
+
<template v-for="(item, index) in config">
|
|
5
|
+
<!-- 展示项 -->
|
|
6
|
+
<a-col :key="'col' + index" :span="Math.floor(24 / config.length)">
|
|
7
|
+
<div class="item">
|
|
8
|
+
<!-- 标题 -->
|
|
9
|
+
<p class="label">{{ item.label }}</p>
|
|
10
|
+
<!-- 内容 - 进度条 -->
|
|
11
|
+
<template v-if="item.type === 'percent'">
|
|
12
|
+
<p class="value" :style="'color: ' + determineColor(data[item.key])">{{ data[item.key] }}%</p>
|
|
13
|
+
</template>
|
|
14
|
+
<!-- 内容 - 非进度条 -->
|
|
15
|
+
<template v-else>
|
|
16
|
+
<p class="value" :style="item.style ? item.style : ''">{{ data[item.key] }}</p>
|
|
17
|
+
</template>
|
|
18
|
+
</div>
|
|
19
|
+
</a-col>
|
|
20
|
+
<!-- 分割线 -->
|
|
21
|
+
<a-col :key="'col' + index + 'after'" :span="1" v-if="index !== config.length - 1" class="divider-col">
|
|
22
|
+
<a-divider type="vertical" class="divider"/>
|
|
23
|
+
</a-col>
|
|
24
|
+
</template>
|
|
25
|
+
</a-row>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
|
|
31
|
+
import { getConfigByName } from '@vue2-client/services/api/common'
|
|
32
|
+
|
|
33
|
+
export default {
|
|
34
|
+
name: 'XSimpleDescriptions',
|
|
35
|
+
props: {
|
|
36
|
+
// 配置
|
|
37
|
+
dataConfig: {
|
|
38
|
+
type: Array,
|
|
39
|
+
default: undefined
|
|
40
|
+
},
|
|
41
|
+
// 数据
|
|
42
|
+
dataContent: {
|
|
43
|
+
type: Object,
|
|
44
|
+
default: undefined
|
|
45
|
+
},
|
|
46
|
+
// 配置名
|
|
47
|
+
dataConfigName: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: undefined
|
|
50
|
+
},
|
|
51
|
+
// 服务名
|
|
52
|
+
serviceName: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: process.env.VUE_APP_SYSTEM_NAME
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
data () {
|
|
58
|
+
return {
|
|
59
|
+
// 配置
|
|
60
|
+
config: [],
|
|
61
|
+
// 数据
|
|
62
|
+
data: {},
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
mounted () {
|
|
66
|
+
// 初始化配置
|
|
67
|
+
if (this.dataConfig) {
|
|
68
|
+
this.config = this.dataConfig
|
|
69
|
+
} else if (this.dataConfigName) {
|
|
70
|
+
getConfigByName(this.dataConfigName, this.serviceName, (res) => {
|
|
71
|
+
this.config = res.config
|
|
72
|
+
})
|
|
73
|
+
} else {
|
|
74
|
+
this.config = [
|
|
75
|
+
{
|
|
76
|
+
label: '未能正确获取配置',
|
|
77
|
+
key: 'totalUser'
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
label: '未能正确获取配置',
|
|
81
|
+
key: 'totalResidentArea'
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
label: '未能正确获取配置',
|
|
85
|
+
key: 'doneNum'
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
label: '未能正确获取配置',
|
|
89
|
+
key: 'todoNum'
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
label: '未能正确获取配置',
|
|
93
|
+
key: 'ratio',
|
|
94
|
+
type: 'percent'
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// 初始化数据
|
|
100
|
+
if (this.dataContent) {
|
|
101
|
+
this.data = this.dataContent
|
|
102
|
+
} else {
|
|
103
|
+
this.data = {
|
|
104
|
+
totalUser: 0,
|
|
105
|
+
totalResidentArea: 0,
|
|
106
|
+
doneNum: 0,
|
|
107
|
+
todoNum: 0,
|
|
108
|
+
ratio: 20
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
methods: {
|
|
113
|
+
// 根据完成率决定颜色
|
|
114
|
+
determineColor (ratio) {
|
|
115
|
+
let result
|
|
116
|
+
if (ratio >= 90) {
|
|
117
|
+
result = 'rgb( 1,245, 38 )'
|
|
118
|
+
} else if (ratio >= 75) {
|
|
119
|
+
result = 'rgb( 139,245, 0)'
|
|
120
|
+
} else if (ratio >= 40) {
|
|
121
|
+
result = 'rgb(245,163, 0)'
|
|
122
|
+
} else if (ratio >= 20) {
|
|
123
|
+
result = 'rgb(244, 96, 0)'
|
|
124
|
+
} else {
|
|
125
|
+
result = 'rgb(255, 0, 0)'
|
|
126
|
+
}
|
|
127
|
+
return result
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
watch: {
|
|
131
|
+
dataContent: {
|
|
132
|
+
handler (newValue) {
|
|
133
|
+
this.data = newValue
|
|
134
|
+
},
|
|
135
|
+
deep: true
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
</script>
|
|
140
|
+
|
|
141
|
+
<style lang="less" scoped>
|
|
142
|
+
.item {
|
|
143
|
+
padding: 5%;
|
|
144
|
+
|
|
145
|
+
.label {
|
|
146
|
+
color: rgba(117, 117, 117, 0.8);
|
|
147
|
+
text-align: center;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.value {
|
|
151
|
+
color: rgb( 51,157,255 );
|
|
152
|
+
font-size: 1.6em;
|
|
153
|
+
text-align: center;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.divider-col {
|
|
158
|
+
display: flex;
|
|
159
|
+
justify-content: center;
|
|
160
|
+
|
|
161
|
+
.divider {
|
|
162
|
+
margin-top: 35%;
|
|
163
|
+
height: 40px;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
</style>
|