vue2-client 1.12.76 → 1.12.78
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/base-client/components/common/XReportGrid/XReport.vue +1014 -1014
- package/src/base-client/components/common/XReportGrid/XReportDemo.vue +44 -44
- package/src/base-client/components/common/XReportGrid/XReportDesign.vue +616 -616
- package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +3 -2
- package/src/base-client/components/common/XTimeline/XTimeline.vue +4 -33
- package/src/base-client/components/his/XList/XList.vue +90 -90
- package/src/base-client/components/his/XRadio/XRadio.vue +50 -0
- package/src/base-client/components/his/XSidebar/XSidebar.vue +1 -1
- package/src/base-client/plugins/AppData.js +126 -126
- package/src/pages/ReportGrid/index.vue +76 -76
- package/src/pages/userInfoDetailManage/PriceAdjustments/index.vue +7 -7
- package/src/pages/userInfoDetailManage/UserException/index.vue +7 -7
- package/src/router/async/router.map.js +119 -122
- package/src/base-client/components/common/XCollapse/XCollapseDemo.vue +0 -15
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</template>
|
|
26
26
|
<template v-else-if="cell.type === 'slot'">
|
|
27
27
|
<template
|
|
28
|
-
v-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list', 'x-cardSet', 'x-collapse','x-h-descriptions', 'x-sidebar', 'x-list','x-input','x-time-line'].includes(cell.slotType)">
|
|
28
|
+
v-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list', 'x-cardSet', 'x-collapse','x-h-descriptions', 'x-sidebar', 'x-list','x-input','x-time-line', 'x-radio'].includes(cell.slotType)">
|
|
29
29
|
<component
|
|
30
30
|
:is="getComponentName(cell.slotConfig, cell.serviceName, cell.slotType)"
|
|
31
31
|
:key="cellIndex"
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
</template>
|
|
61
61
|
<template v-else-if="cell.type === 'slot'">
|
|
62
62
|
<template
|
|
63
|
-
v-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list', 'x-cardSet', 'x-collapse', 'x-h-descriptions', 'x-sidebar', 'x-list','x-input','x-time-line'].includes(cell.slotType)">
|
|
63
|
+
v-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list', 'x-cardSet', 'x-collapse', 'x-h-descriptions', 'x-sidebar', 'x-list','x-input','x-time-line', 'x-radio'].includes(cell.slotType)">
|
|
64
64
|
<component
|
|
65
65
|
:is="getComponentName(cell.slotConfig, cell.serviceName, cell.slotType)"
|
|
66
66
|
:key="cellIndex"
|
|
@@ -111,6 +111,7 @@ export default {
|
|
|
111
111
|
XList: () => import('@vue2-client/base-client/components/his/XList/XList.vue'),
|
|
112
112
|
XInput: () => import('@vue2-client/base-client/components/common/XInput/XInput.vue'),
|
|
113
113
|
XTimeLine: () => import('@vue2-client/base-client/components/common/XTimeline/XTimeline.vue'),
|
|
114
|
+
XRadio: () => import('@vue2-client/base-client/components/his/XRadio/XRadio.vue')
|
|
114
115
|
},
|
|
115
116
|
props: {
|
|
116
117
|
// 每一行的配置
|
|
@@ -62,7 +62,7 @@ export default {
|
|
|
62
62
|
// 配置参数名称,用于获取时间轴配置
|
|
63
63
|
queryParamsName: {
|
|
64
64
|
type: String,
|
|
65
|
-
default: '
|
|
65
|
+
default: ''
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
|
|
@@ -121,49 +121,20 @@ export default {
|
|
|
121
121
|
// 获取时间轴配置数据
|
|
122
122
|
async getData (data) {
|
|
123
123
|
getConfigByName(data, 'af-his', res => {
|
|
124
|
-
// var res = {
|
|
125
|
-
// // 基础配置
|
|
126
|
-
// range: 7, // 显示的天数范围,默认7天
|
|
127
|
-
// defaultValue: '', // 默认选中日期,不设置则默认今天
|
|
128
|
-
// // 日期格式化
|
|
129
|
-
// dateFormat: 'MM/DD', // 日期显示格式,如 03/21
|
|
130
|
-
// weekFormat: '周dd', // 星期显示格式,如 周四
|
|
131
|
-
// // 按钮文字配置
|
|
132
|
-
// prevWeekText: '前一周', // 上一周按钮文字
|
|
133
|
-
// nextWeekText: '后一周', // 下一周按钮文字
|
|
134
|
-
// prevDayText: '前一天', // 前一天按钮文字
|
|
135
|
-
// nextDayText: '后一天', // 后一天按钮文字
|
|
136
|
-
// // 日期范围限制
|
|
137
|
-
// minDate: '2024-01-01', // 最小可选日期
|
|
138
|
-
// maxDate: '2025-12-31', // 最大可选日期
|
|
139
|
-
// // 周末高亮配置
|
|
140
|
-
// highlightWeekend: true, // 是否高亮周末
|
|
141
|
-
// // 业务逻辑配置
|
|
142
|
-
// logicName: 'getDisabledDates', // 获取禁用日期的逻辑名称
|
|
143
|
-
// parameter: {
|
|
144
|
-
// userId: 'xxx',
|
|
145
|
-
// type: 'workday'
|
|
146
|
-
// }
|
|
147
|
-
// }
|
|
148
124
|
this.config = res
|
|
149
125
|
if (res.defaultValue) {
|
|
150
126
|
// 如果有默认值,则设置当前选中日期和基准日期
|
|
151
127
|
this.currentDate = res.defaultValue
|
|
152
128
|
this.baseDate = res.defaultValue
|
|
153
129
|
this.$emit('update:modelValue', res.defaultValue)
|
|
130
|
+
} else {
|
|
131
|
+
// 如果没有默认值,则设置当前选中日期为今天
|
|
132
|
+
this.currentDate = dayjs().format('YYYY-MM-DD')
|
|
154
133
|
}
|
|
155
134
|
|
|
156
135
|
// 执行配置中指定的业务逻辑
|
|
157
136
|
if (res.logicName) {
|
|
158
137
|
runLogic(res.logicName, res.parameter, 'af-his').then(result => {
|
|
159
|
-
// var result = {
|
|
160
|
-
// disabledDates: [ // 禁用的日期列表
|
|
161
|
-
// '2025-03-23', // 周六
|
|
162
|
-
// '2025-03-24', // 周日
|
|
163
|
-
// '2025-03-25' // 其他需要禁用的日期
|
|
164
|
-
// ],
|
|
165
|
-
// currentDate: '' // 指定当前选中日期(可选)
|
|
166
|
-
// }
|
|
167
138
|
if (result) {
|
|
168
139
|
this.handleLogicResult(result)
|
|
169
140
|
}
|
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="list-wrapper" >
|
|
3
|
-
<a-list size="large" :data-source="data" itemLayout="horizontal" class="list-container">
|
|
4
|
-
<a-list-item slot="renderItem" slot-scope="item, index" class="list-item" @click="handleClick(index)">
|
|
5
|
-
{{ item.number }} {{ item.name }}
|
|
6
|
-
</a-list-item>
|
|
7
|
-
</a-list>
|
|
8
|
-
</div>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script>
|
|
12
|
-
|
|
13
|
-
import { runLogic } from '@vue2-client/services/api/common'
|
|
14
|
-
|
|
15
|
-
export default {
|
|
16
|
-
name: 'XList',
|
|
17
|
-
props: {
|
|
18
|
-
queryParamsName: {
|
|
19
|
-
type: Object,
|
|
20
|
-
default: 'outpatientWaitLogic'
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
inject: ['getComponentByName'],
|
|
24
|
-
data () {
|
|
25
|
-
return {
|
|
26
|
-
data: []
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
created () {
|
|
30
|
-
this.getData(this.queryParamsName)
|
|
31
|
-
},
|
|
32
|
-
methods: {
|
|
33
|
-
async getData (config) {
|
|
34
|
-
runLogic(config, {}, 'af-his').then(res => {
|
|
35
|
-
this.data = res
|
|
36
|
-
})
|
|
37
|
-
},
|
|
38
|
-
handleClick (index) {
|
|
39
|
-
this.$emit('listClick', this.data[index])
|
|
40
|
-
},
|
|
41
|
-
refreshList () {
|
|
42
|
-
this.getData(this.queryParamsName)
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
</script>
|
|
48
|
-
|
|
49
|
-
<style scoped>
|
|
50
|
-
.list-wrapper {
|
|
51
|
-
max-height: 240px;
|
|
52
|
-
overflow-y: auto;
|
|
53
|
-
cursor: pointer;
|
|
54
|
-
padding-right: 2px;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.list-container {
|
|
58
|
-
width: 100%;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.list-item {
|
|
62
|
-
height: 35px;
|
|
63
|
-
border-radius: 6px;
|
|
64
|
-
background-color: #F4F4F4;
|
|
65
|
-
padding: 8px 15px 7px 15px;
|
|
66
|
-
font-size: 16px;
|
|
67
|
-
display: flex;
|
|
68
|
-
align-items: center;
|
|
69
|
-
width: 100%;
|
|
70
|
-
border: 1px solid #D9D9D9;
|
|
71
|
-
box-sizing: border-box;
|
|
72
|
-
margin-bottom: 16px;
|
|
73
|
-
white-space: nowrap;
|
|
74
|
-
overflow: clip;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/* 自定义滚动条样式 */
|
|
78
|
-
.list-wrapper::-webkit-scrollbar {
|
|
79
|
-
width: 6px;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.list-wrapper::-webkit-scrollbar-thumb {
|
|
83
|
-
background-color: #d9d9d9;
|
|
84
|
-
border-radius: 3px;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.list-wrapper::-webkit-scrollbar-track {
|
|
88
|
-
background-color: #f0f0f0;
|
|
89
|
-
}
|
|
90
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="list-wrapper" >
|
|
3
|
+
<a-list size="large" :data-source="data" itemLayout="horizontal" class="list-container">
|
|
4
|
+
<a-list-item slot="renderItem" slot-scope="item, index" class="list-item" @click="handleClick(index)">
|
|
5
|
+
{{ item.number }} {{ item.name }}
|
|
6
|
+
</a-list-item>
|
|
7
|
+
</a-list>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
|
|
13
|
+
import { runLogic } from '@vue2-client/services/api/common'
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
name: 'XList',
|
|
17
|
+
props: {
|
|
18
|
+
queryParamsName: {
|
|
19
|
+
type: Object,
|
|
20
|
+
default: 'outpatientWaitLogic'
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
inject: ['getComponentByName'],
|
|
24
|
+
data () {
|
|
25
|
+
return {
|
|
26
|
+
data: []
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
created () {
|
|
30
|
+
this.getData(this.queryParamsName)
|
|
31
|
+
},
|
|
32
|
+
methods: {
|
|
33
|
+
async getData (config) {
|
|
34
|
+
runLogic(config, {}, 'af-his').then(res => {
|
|
35
|
+
this.data = res
|
|
36
|
+
})
|
|
37
|
+
},
|
|
38
|
+
handleClick (index) {
|
|
39
|
+
this.$emit('listClick', this.data[index])
|
|
40
|
+
},
|
|
41
|
+
refreshList () {
|
|
42
|
+
this.getData(this.queryParamsName)
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<style scoped>
|
|
50
|
+
.list-wrapper {
|
|
51
|
+
max-height: 240px;
|
|
52
|
+
overflow-y: auto;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
padding-right: 2px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.list-container {
|
|
58
|
+
width: 100%;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.list-item {
|
|
62
|
+
height: 35px;
|
|
63
|
+
border-radius: 6px;
|
|
64
|
+
background-color: #F4F4F4;
|
|
65
|
+
padding: 8px 15px 7px 15px;
|
|
66
|
+
font-size: 16px;
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
width: 100%;
|
|
70
|
+
border: 1px solid #D9D9D9;
|
|
71
|
+
box-sizing: border-box;
|
|
72
|
+
margin-bottom: 16px;
|
|
73
|
+
white-space: nowrap;
|
|
74
|
+
overflow: clip;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* 自定义滚动条样式 */
|
|
78
|
+
.list-wrapper::-webkit-scrollbar {
|
|
79
|
+
width: 6px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.list-wrapper::-webkit-scrollbar-thumb {
|
|
83
|
+
background-color: #d9d9d9;
|
|
84
|
+
border-radius: 3px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.list-wrapper::-webkit-scrollbar-track {
|
|
88
|
+
background-color: #f0f0f0;
|
|
89
|
+
}
|
|
90
|
+
</style>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<a-radio-group v-model="innerValue" @change="onChange">
|
|
4
|
+
<a-radio v-for="item in data" :key="item.value" :value="item.value">
|
|
5
|
+
{{ item.label }}
|
|
6
|
+
</a-radio>
|
|
7
|
+
</a-radio-group>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
import { getConfigByName } from '@vue2-client/services/api/common'
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name: 'XRadio',
|
|
16
|
+
inject: ['getComponentByName'],
|
|
17
|
+
props: {
|
|
18
|
+
queryParamsName: {
|
|
19
|
+
type: Object,
|
|
20
|
+
default: null
|
|
21
|
+
},
|
|
22
|
+
value: [String, Number]
|
|
23
|
+
},
|
|
24
|
+
data () {
|
|
25
|
+
return {
|
|
26
|
+
data: [],
|
|
27
|
+
innerValue: null
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
created () {
|
|
31
|
+
this.getData(this.queryParamsName)
|
|
32
|
+
},
|
|
33
|
+
watch: {
|
|
34
|
+
value (val) {
|
|
35
|
+
this.innerValue = val
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
methods: {
|
|
39
|
+
async getData (data) {
|
|
40
|
+
getConfigByName(data, 'af-his', res => {
|
|
41
|
+
console.warn(res.radio)
|
|
42
|
+
this.data = res.radio
|
|
43
|
+
})
|
|
44
|
+
},
|
|
45
|
+
onChange (e) {
|
|
46
|
+
this.$emit('radio', e.target.value)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
</script>
|
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
import { manageApi, post } from '@vue2-client/services/api'
|
|
2
|
-
import { handleTree } from '@vue2-client/utils/util'
|
|
3
|
-
import { indexedDB } from '@vue2-client/utils/indexedDB'
|
|
4
|
-
import { getConfigByName } from '@vue2-client/services/api/common'
|
|
5
|
-
|
|
6
|
-
const GetAppDataService = {
|
|
7
|
-
install (Vue) {
|
|
8
|
-
// 给vue增添对话框显示方法
|
|
9
|
-
Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
|
|
10
|
-
},
|
|
11
|
-
async load () {
|
|
12
|
-
const params = {}
|
|
13
|
-
await post(manageApi.getDictionaryValue, {}).then((res) => {
|
|
14
|
-
Object.assign(params, res)
|
|
15
|
-
const badgeItemArray = {}
|
|
16
|
-
for (const key of Object.keys(params)) {
|
|
17
|
-
badgeItemArray[key] = {}
|
|
18
|
-
for (const item of params[key]) {
|
|
19
|
-
let status
|
|
20
|
-
if (!item.status) {
|
|
21
|
-
status = 'none'
|
|
22
|
-
} else {
|
|
23
|
-
status = item.status
|
|
24
|
-
}
|
|
25
|
-
badgeItemArray[key][item.value] = {
|
|
26
|
-
status: status,
|
|
27
|
-
text: item.text
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
// 追加参数
|
|
32
|
-
localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
|
|
33
|
-
localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
|
|
34
|
-
})
|
|
35
|
-
},
|
|
36
|
-
// 返回树形省市区
|
|
37
|
-
async getDivisionsOhChinaForTree () {
|
|
38
|
-
// 获取省市区数据
|
|
39
|
-
return new Promise((resolve, reject) => {
|
|
40
|
-
try {
|
|
41
|
-
indexedDB.getByWeb('divisionsOhChina', manageApi.getDivisionsOhChina, {}, res => {
|
|
42
|
-
resolve(res)
|
|
43
|
-
}, processRes => {
|
|
44
|
-
return handleTree(processRes, 'code', 'parentcode')
|
|
45
|
-
})
|
|
46
|
-
} catch (e) {
|
|
47
|
-
reject(e)
|
|
48
|
-
}
|
|
49
|
-
})
|
|
50
|
-
},
|
|
51
|
-
// 旧版获取配置中心字典
|
|
52
|
-
getDictionaryList (key) {
|
|
53
|
-
const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
|
|
54
|
-
const object = JSON.parse(str)
|
|
55
|
-
return object[key]
|
|
56
|
-
},
|
|
57
|
-
async getDictValue (dictKey, value, func, isDev = false, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
|
|
58
|
-
const processResult = (result) => {
|
|
59
|
-
if (!result.value) {
|
|
60
|
-
return {
|
|
61
|
-
status: 'none',
|
|
62
|
-
text: value
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
const item = result.value.find(item => item.value == value)
|
|
66
|
-
if (item) {
|
|
67
|
-
return {
|
|
68
|
-
status: item.status || 'none',
|
|
69
|
-
text: item.label
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return {
|
|
73
|
-
status: 'none',
|
|
74
|
-
text: value
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
if (func) {
|
|
78
|
-
getConfigByName(dictKey, serviceName, result => {
|
|
79
|
-
func(processResult(result))
|
|
80
|
-
}, isDev)
|
|
81
|
-
} else {
|
|
82
|
-
const result = await new Promise((resolve) => {
|
|
83
|
-
getConfigByName(dictKey, serviceName, resolve, isDev)
|
|
84
|
-
})
|
|
85
|
-
return processResult(result)
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
// 新版获取配置中心字典推荐使用 服务名默认为当前服务
|
|
89
|
-
getDictByKey (dictKey, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback, isDev) {
|
|
90
|
-
getConfigByName(dictKey, undefined, result => {
|
|
91
|
-
callback(result.value)
|
|
92
|
-
}, isDev)
|
|
93
|
-
},
|
|
94
|
-
getParam (key, value, callback) {
|
|
95
|
-
const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
|
|
96
|
-
const object = JSON.parse(str)
|
|
97
|
-
if (object && object[key]) {
|
|
98
|
-
const result = object[key]
|
|
99
|
-
if (Object.prototype.hasOwnProperty.call(result, value)) {
|
|
100
|
-
return result[value]
|
|
101
|
-
} else {
|
|
102
|
-
return { status: 'none', text: value }
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return null
|
|
106
|
-
},
|
|
107
|
-
getParams () {
|
|
108
|
-
const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
|
|
109
|
-
return JSON.parse(str)
|
|
110
|
-
},
|
|
111
|
-
getSingleValues () {
|
|
112
|
-
const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
|
|
113
|
-
return JSON.parse(str)
|
|
114
|
-
},
|
|
115
|
-
getWebConfigByKey (key) {
|
|
116
|
-
const str = localStorage.getItem(process.env.VUE_APP_WEB_CONFIG_KEY)
|
|
117
|
-
const object = JSON.parse(str)
|
|
118
|
-
return object[key]
|
|
119
|
-
},
|
|
120
|
-
getStylesByKey (key) {
|
|
121
|
-
const str = localStorage.getItem(process.env.VUE_APP_WEB_STYLES_KEY)
|
|
122
|
-
const object = JSON.parse(str)
|
|
123
|
-
return object[key]
|
|
124
|
-
},
|
|
125
|
-
}
|
|
126
|
-
export default GetAppDataService
|
|
1
|
+
import { manageApi, post } from '@vue2-client/services/api'
|
|
2
|
+
import { handleTree } from '@vue2-client/utils/util'
|
|
3
|
+
import { indexedDB } from '@vue2-client/utils/indexedDB'
|
|
4
|
+
import { getConfigByName } from '@vue2-client/services/api/common'
|
|
5
|
+
|
|
6
|
+
const GetAppDataService = {
|
|
7
|
+
install (Vue) {
|
|
8
|
+
// 给vue增添对话框显示方法
|
|
9
|
+
Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
|
|
10
|
+
},
|
|
11
|
+
async load () {
|
|
12
|
+
const params = {}
|
|
13
|
+
await post(manageApi.getDictionaryValue, {}).then((res) => {
|
|
14
|
+
Object.assign(params, res)
|
|
15
|
+
const badgeItemArray = {}
|
|
16
|
+
for (const key of Object.keys(params)) {
|
|
17
|
+
badgeItemArray[key] = {}
|
|
18
|
+
for (const item of params[key]) {
|
|
19
|
+
let status
|
|
20
|
+
if (!item.status) {
|
|
21
|
+
status = 'none'
|
|
22
|
+
} else {
|
|
23
|
+
status = item.status
|
|
24
|
+
}
|
|
25
|
+
badgeItemArray[key][item.value] = {
|
|
26
|
+
status: status,
|
|
27
|
+
text: item.text
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// 追加参数
|
|
32
|
+
localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
|
|
33
|
+
localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
|
|
34
|
+
})
|
|
35
|
+
},
|
|
36
|
+
// 返回树形省市区
|
|
37
|
+
async getDivisionsOhChinaForTree () {
|
|
38
|
+
// 获取省市区数据
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
|
+
try {
|
|
41
|
+
indexedDB.getByWeb('divisionsOhChina', manageApi.getDivisionsOhChina, {}, res => {
|
|
42
|
+
resolve(res)
|
|
43
|
+
}, processRes => {
|
|
44
|
+
return handleTree(processRes, 'code', 'parentcode')
|
|
45
|
+
})
|
|
46
|
+
} catch (e) {
|
|
47
|
+
reject(e)
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
},
|
|
51
|
+
// 旧版获取配置中心字典
|
|
52
|
+
getDictionaryList (key) {
|
|
53
|
+
const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
|
|
54
|
+
const object = JSON.parse(str)
|
|
55
|
+
return object[key]
|
|
56
|
+
},
|
|
57
|
+
async getDictValue (dictKey, value, func, isDev = false, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
|
|
58
|
+
const processResult = (result) => {
|
|
59
|
+
if (!result.value) {
|
|
60
|
+
return {
|
|
61
|
+
status: 'none',
|
|
62
|
+
text: value
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const item = result.value.find(item => item.value == value)
|
|
66
|
+
if (item) {
|
|
67
|
+
return {
|
|
68
|
+
status: item.status || 'none',
|
|
69
|
+
text: item.label
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
status: 'none',
|
|
74
|
+
text: value
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (func) {
|
|
78
|
+
getConfigByName(dictKey, serviceName, result => {
|
|
79
|
+
func(processResult(result))
|
|
80
|
+
}, isDev)
|
|
81
|
+
} else {
|
|
82
|
+
const result = await new Promise((resolve) => {
|
|
83
|
+
getConfigByName(dictKey, serviceName, resolve, isDev)
|
|
84
|
+
})
|
|
85
|
+
return processResult(result)
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
// 新版获取配置中心字典推荐使用 服务名默认为当前服务
|
|
89
|
+
getDictByKey (dictKey, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback, isDev) {
|
|
90
|
+
getConfigByName(dictKey, undefined, result => {
|
|
91
|
+
callback(result.value)
|
|
92
|
+
}, isDev)
|
|
93
|
+
},
|
|
94
|
+
getParam (key, value, callback) {
|
|
95
|
+
const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
|
|
96
|
+
const object = JSON.parse(str)
|
|
97
|
+
if (object && object[key]) {
|
|
98
|
+
const result = object[key]
|
|
99
|
+
if (Object.prototype.hasOwnProperty.call(result, value)) {
|
|
100
|
+
return result[value]
|
|
101
|
+
} else {
|
|
102
|
+
return { status: 'none', text: value }
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return null
|
|
106
|
+
},
|
|
107
|
+
getParams () {
|
|
108
|
+
const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
|
|
109
|
+
return JSON.parse(str)
|
|
110
|
+
},
|
|
111
|
+
getSingleValues () {
|
|
112
|
+
const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
|
|
113
|
+
return JSON.parse(str)
|
|
114
|
+
},
|
|
115
|
+
getWebConfigByKey (key) {
|
|
116
|
+
const str = localStorage.getItem(process.env.VUE_APP_WEB_CONFIG_KEY)
|
|
117
|
+
const object = JSON.parse(str)
|
|
118
|
+
return object[key]
|
|
119
|
+
},
|
|
120
|
+
getStylesByKey (key) {
|
|
121
|
+
const str = localStorage.getItem(process.env.VUE_APP_WEB_STYLES_KEY)
|
|
122
|
+
const object = JSON.parse(str)
|
|
123
|
+
return object[key]
|
|
124
|
+
},
|
|
125
|
+
}
|
|
126
|
+
export default GetAppDataService
|