vue2-client 1.15.26 → 1.15.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/docs/Logic/345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +0 -1
- package/docs//345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +2 -4
- package/package.json +1 -1
- package/src/base-client/components/common/XDescriptions/XDescriptions.vue +174 -174
- package/src/base-client/components/common/XDescriptions/XDescriptionsGroup.vue +314 -314
- package/src/base-client/components/common/XSimpleDescriptions/XSimpleDescriptions.vue +166 -166
- package/src/base-client/components/his/XTextCard/XTextCard.vue +207 -207
- package/src/base-client/components/his/XTreeRows/TreeNode.vue +100 -100
- package/src/base-client/components/his/XTreeRows/XTreeRows.vue +197 -197
- package/src/base-client/components/his/threeTestOrders/editor.vue +111 -111
- package/src/components/HeightScanner/index.vue +54 -10
- package/src/config/CreateQueryConfig.js +325 -325
- package/src/pages/XTreeOneProExample/index.vue +67 -67
- package/.history/public/his/editor/editor_20250606134713.html +0 -51
- package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527173925.vue +0 -509
- package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174316.vue +0 -524
- package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174419.vue +0 -524
- package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174422.vue +0 -524
- package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172825.vue +0 -207
- package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172945.vue +0 -211
- package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172949.vue +0 -212
- package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611173010.vue +0 -212
- package/.history/src/base-client/components/common/XForm/XFormItem_20250508134122.vue +0 -1320
- package/.history/src/base-client/components/common/XForm/XFormItem_20250527171604.vue +0 -1332
- package/.history/src/base-client/components/common/XForm/XFormItem_20250527171613.vue +0 -1331
- package/.history/src/base-client/components/common/XForm/XFormItem_20250527171703.vue +0 -1331
- package/.history/src/base-client/components/common/XForm/XFormItem_20250527171720.vue +0 -1331
- package/.history/src/base-client/components/common/XForm/XFormItem_20250527174327.vue +0 -1339
- package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612092804.vue +0 -731
- package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612112546.vue +0 -748
- package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612113808.vue +0 -748
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115237.vue +0 -1071
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115346.vue +0 -1078
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115350.vue +0 -1077
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115415.vue +0 -1077
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115429.vue +0 -1077
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611091619.vue +0 -442
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092547.vue +0 -442
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092552.vue +0 -442
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092744.vue +0 -475
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092955.vue +0 -475
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092957.vue +0 -475
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095652.vue +0 -477
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095701.vue +0 -477
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095704.vue +0 -477
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100005.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100011.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100014.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100833.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100853.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100940.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101011.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101013.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101014.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101159.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101238.vue +0 -474
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101240.vue +0 -474
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101242.vue +0 -474
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101404.vue +0 -472
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101410.vue +0 -472
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101459.vue +0 -472
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101500.vue +0 -472
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101502.vue +0 -472
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101504.vue +0 -472
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101610.vue +0 -501
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101700.vue +0 -501
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101702.vue +0 -501
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101741.vue +0 -504
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101749.vue +0 -504
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101759.vue +0 -504
- package/.history/src/base-client/components/his/XHisEditor/dome_20250611091349.vue +0 -131
- package/.history/src/base-client/components/his/XHisEditor/dome_20250611105854.vue +0 -160
- package/.history/src/base-client/components/his/XHisEditor/dome_20250611105902.vue +0 -160
- package/.history/src/base-client/components/his/XHisEditor/dome_20250611105924.vue +0 -160
- package/.history/src/base-client/components/his/XHisEditor/dome_20250611105932.vue +0 -158
- package/.history/src/base-client/components/his/XList/XList_20250609135848.vue +0 -173
- package/.history/src/base-client/components/his/XList/XList_20250609141026.vue +0 -222
- package/.history/src/base-client/components/his/XList/XList_20250609141035.vue +0 -229
- package/.history/src/base-client/components/his/XList/XList_20250609141103.vue +0 -229
- package/.history/src/base-client/components/his/XList/XList_20250609141105.vue +0 -229
- package/.history/src/base-client/components/his/XList/XList_20250609141334.vue +0 -241
- package/.history/src/base-client/components/his/XList/XList_20250609141404.vue +0 -241
- package/.history/src/base-client/components/his/XList/XList_20250609141406.vue +0 -241
- package/.history/src/base-client/components/his/XList/XList_20250609141801.vue +0 -245
- package/.history/src/base-client/components/his/XList/XList_20250609142033.vue +0 -245
- package/.history/src/base-client/components/his/XList/XList_20250609142038.vue +0 -245
- package/.history/src/base-client/components/his/XList/XList_20250609142435.vue +0 -255
- package/.history/src/base-client/components/his/XList/XList_20250609142503.vue +0 -255
- package/.history/src/base-client/components/his/XList/XList_20250609142504.vue +0 -255
- package/.history/src/base-client/components/his/XList/XList_20250609143012.vue +0 -270
- package/.history/src/base-client/components/his/XList/XList_20250609143044.vue +0 -270
- package/.history/src/base-client/components/his/XList/XList_20250609143046.vue +0 -270
- package/.history/src/base-client/components/his/XList/XList_20250609143210.vue +0 -270
- package/.history/src/base-client/components/his/XList/XList_20250609144339.vue +0 -294
- package/.history/src/base-client/components/his/XList/XList_20250609144410.vue +0 -294
- package/.history/src/base-client/components/his/XList/XList_20250609144412.vue +0 -294
- package/.history/src/base-client/components/his/XList/XList_20250609144647.vue +0 -303
- package/.history/src/base-client/components/his/XList/XList_20250609144716.vue +0 -303
- package/.history/src/base-client/components/his/XList/XList_20250609144729.vue +0 -303
- package/.history/src/base-client/components/his/XList/XList_20250609151232.vue +0 -288
- package/.history/src/base-client/components/his/XList/XList_20250609151247.vue +0 -288
- package/.history/src/base-client/components/his/XList/XList_20250609151252.vue +0 -288
- package/.history/src/base-client/components/his/XList/XList_20250609161220.vue +0 -317
- package/.history/src/base-client/components/his/XList/XList_20250609161258.vue +0 -306
- package/.history/src/base-client/components/his/XList/XList_20250609161319.vue +0 -306
- package/.history/src/base-client/components/his/XList/XList_20250609161320.vue +0 -306
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250609151519.vue +0 -222
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612155514.vue +0 -183
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612155556.vue +0 -183
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612155600.vue +0 -183
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612181609.vue +0 -206
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612181629.vue +0 -209
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613095553.vue +0 -242
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613095610.vue +0 -242
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613095612.vue +0 -242
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100041.vue +0 -251
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100047.vue +0 -251
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100054.vue +0 -250
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100105.vue +0 -250
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100107.vue +0 -250
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100114.vue +0 -250
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613140844.vue +0 -238
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613140910.vue +0 -238
- package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613140912.vue +0 -238
- package/Users/objecrt/af-vue2-client/src/base-client/components/his/XShiftSchedule/XShiftSchedule.vue +0 -36
- package/src/base-client/components/TreeList/TreeList.vue +0 -91
- package/src/base-client/components/TreeList/TreeNode.vue +0 -81
- package/src/base-client/components/common/XCardSet/XTiltle.vue +0 -191
package/docs/Logic/345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md
CHANGED
@@ -11,7 +11,6 @@
|
|
11
11
|
- ENV 对应 一个 org.json.JSONObject {tenantName:"租户名称",orgName:"分公司名称",applicationName:"应用名称",dbType:"数据库类型"}
|
12
12
|
- logic 对应 LogicService 类,其中有方法
|
13
13
|
* logic.run(logicName,param) 执行logic / logicName 执行的业务逻辑名称,param 参数 返回 org.json.JSONObject
|
14
|
-
* logic.remoteRun("服务名","logicName", "param")
|
15
14
|
- sql 对应 [SqlService]() 类,其中有方法
|
16
15
|
* sql.query(sql别名 string,sql参数 string) 执行已经注册的sql 返回 org.json.JSONArray
|
17
16
|
* sql.query(sql别名 string,sql参数 string,页数 int,每页行数 int) 执行已经注册的sql 返回 org.json.JSONArray
|
@@ -10,12 +10,11 @@
|
|
10
10
|
- openDialog(configName, selectedId, mixinData, outEnv, attr):打开一个对话框:
|
11
11
|
- setColSpanByName(slotRef, colSpan):设置栅格的宽度
|
12
12
|
- openDrawer(configName, selectedId, mixinData):打开一个对话框,例如:this.openDialog('xxx', 5, {})
|
13
|
-
- openDrawer(configName, selectedId, mixinData, outEnv, attr
|
13
|
+
- openDrawer(configName, selectedId, mixinData, outEnv, attr):打开一个对话框:
|
14
14
|
- selectId:id号,formtable选择时,用selectId过滤数据 可以传递 json {a_id: 1} 或者 传递 1 ,传递数值会默认拼接查询条件 {selected_id:1}
|
15
15
|
- mixinData: form表单需要的数据
|
16
16
|
- outEnv: 传递给打开的界面的数据,在打开界面的js中通过this.outEnv可以访问
|
17
17
|
- attr: 用于传递参数绑定到 modal 弹框上
|
18
|
-
- showButton: true/false 是否显示提交按钮 默认:true,当showButton为false时可通过 this.closeAddReport() 关闭当前表单
|
19
18
|
- getOutEnv 获取获取 outEnv
|
20
19
|
- this.getRealKeyData(obj) 获取真实的数据 传递 {a_a:"1"} 返回 {a:"1"}
|
21
20
|
- this.currUser.operaInfo 获取当前用户信息
|
@@ -61,8 +60,7 @@ this.openDialog('xxx', 5, {}, {}, {})
|
|
61
60
|
afterDelete( res (删除接口返回数据)) 删除后触发
|
62
61
|
action(record (当前记录), id (当前记录主键), actionType (操作类型)) 操作按钮触发
|
63
62
|
- expandedGrid:"栅格名"
|
64
|
-
|
65
|
-
- "pageMaxSize": (int) num 每页最大行数,
|
63
|
+
|
66
64
|
# x-report 插槽 使用说明
|
67
65
|
|
68
66
|
- init(configName,configData) 配置名称 / 报表数据
|
package/package.json
CHANGED
@@ -1,174 +1,174 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="row">
|
3
|
-
<div class="content">
|
4
|
-
<a-skeleton :loading="loading" :paragraph="{ rows: 4 }" />
|
5
|
-
<div v-show="!loading">
|
6
|
-
<template v-if="!loadError">
|
7
|
-
<a-descriptions v-if="realData" :column="isMobile ? 1 : column" size="small" :title="title">
|
8
|
-
<a-descriptions-item
|
9
|
-
v-for="(value, key) in realData"
|
10
|
-
:key="key"
|
11
|
-
:label="key">
|
12
|
-
{{ formatText(value) }}
|
13
|
-
</a-descriptions-item>
|
14
|
-
</a-descriptions>
|
15
|
-
</template>
|
16
|
-
<template v-else>
|
17
|
-
<a-empty>
|
18
|
-
<span slot="description"> 页面配置不存在,请联系系统管理员 </span>
|
19
|
-
</a-empty>
|
20
|
-
</template>
|
21
|
-
</div>
|
22
|
-
</div>
|
23
|
-
<div class="extra" v-if="extraShow">
|
24
|
-
<slot name="addonAfter"/>
|
25
|
-
</div>
|
26
|
-
</div>
|
27
|
-
</template>
|
28
|
-
<script>
|
29
|
-
|
30
|
-
import { mapState } from 'vuex'
|
31
|
-
import { getRealKeyData } from '@vue2-client/utils/formatter'
|
32
|
-
import { getConfigByName } from '@vue2-client/services/api/common'
|
33
|
-
|
34
|
-
export default {
|
35
|
-
name: 'XDescriptions',
|
36
|
-
components: {
|
37
|
-
},
|
38
|
-
props: {
|
39
|
-
// 标题
|
40
|
-
title: {
|
41
|
-
type: String,
|
42
|
-
required: true
|
43
|
-
},
|
44
|
-
// 内容
|
45
|
-
content: {
|
46
|
-
type: Object,
|
47
|
-
required: true
|
48
|
-
},
|
49
|
-
// 模型名
|
50
|
-
model: {
|
51
|
-
type: String,
|
52
|
-
required: false,
|
53
|
-
default: ''
|
54
|
-
},
|
55
|
-
// 配置名称
|
56
|
-
configName: {
|
57
|
-
type: String,
|
58
|
-
required: true
|
59
|
-
},
|
60
|
-
// 配置所属命名空间
|
61
|
-
serviceName: {
|
62
|
-
type: String,
|
63
|
-
default: undefined
|
64
|
-
},
|
65
|
-
env: {
|
66
|
-
type: String,
|
67
|
-
default: 'prod'
|
68
|
-
},
|
69
|
-
// 每列显示数量
|
70
|
-
column: {
|
71
|
-
type: Number,
|
72
|
-
default: 2
|
73
|
-
},
|
74
|
-
// 每列显示数量
|
75
|
-
getRealData: {
|
76
|
-
type: Boolean,
|
77
|
-
default: false
|
78
|
-
},
|
79
|
-
// 是否展示插槽
|
80
|
-
extraShow: {
|
81
|
-
type: Boolean,
|
82
|
-
default: true
|
83
|
-
}
|
84
|
-
},
|
85
|
-
created () {
|
86
|
-
this.initConfig()
|
87
|
-
},
|
88
|
-
data () {
|
89
|
-
return {
|
90
|
-
// 加载状态
|
91
|
-
loading: false,
|
92
|
-
loadError: false,
|
93
|
-
realData: undefined
|
94
|
-
}
|
95
|
-
},
|
96
|
-
computed: {
|
97
|
-
...mapState('setting', { isMobile: 'isMobile' })
|
98
|
-
},
|
99
|
-
methods: {
|
100
|
-
initConfig () {
|
101
|
-
this.loading = true
|
102
|
-
this.loadError = false
|
103
|
-
if (this.configName) {
|
104
|
-
this.getConfig()
|
105
|
-
} else {
|
106
|
-
this.loading = false
|
107
|
-
this.loadError = true
|
108
|
-
}
|
109
|
-
},
|
110
|
-
getConfig () {
|
111
|
-
getConfigByName(this.configName, this.serviceName, (res) => {
|
112
|
-
const mapIndex = {}
|
113
|
-
const result = {}
|
114
|
-
if (res.formJson) {
|
115
|
-
res.formJson.filter(item => {
|
116
|
-
const model = item.model
|
117
|
-
return model.indexOf(this.model) > 0
|
118
|
-
})[0].groupItems.forEach(item => {
|
119
|
-
mapIndex[item.model.substring(item.model.indexOf('_') + 1)] = item.name
|
120
|
-
})
|
121
|
-
for (const key of Object.keys(this.content)) {
|
122
|
-
const name = mapIndex[key]
|
123
|
-
if (name) {
|
124
|
-
result[name] = this.content[key]
|
125
|
-
} else {
|
126
|
-
result[key] = this.content[key]
|
127
|
-
}
|
128
|
-
}
|
129
|
-
} else if (res.column) {
|
130
|
-
// [{label:'标签1',filed:'字段1'}]
|
131
|
-
let content = {}
|
132
|
-
if (this.getRealData) {
|
133
|
-
content = getRealKeyData(this.content)
|
134
|
-
} else {
|
135
|
-
content = this.content
|
136
|
-
}
|
137
|
-
if (typeof content === 'string') {
|
138
|
-
content = JSON.parse(content)
|
139
|
-
}
|
140
|
-
res.column.forEach(item => {
|
141
|
-
result[item.label] = content[item.filed]
|
142
|
-
})
|
143
|
-
}
|
144
|
-
this.realData = result
|
145
|
-
this.loading = false
|
146
|
-
}, this.env === 'dev')
|
147
|
-
},
|
148
|
-
// 文字格式化
|
149
|
-
formatText (value) {
|
150
|
-
return value ?? '--'
|
151
|
-
}
|
152
|
-
}
|
153
|
-
}
|
154
|
-
</script>
|
155
|
-
<style>
|
156
|
-
.row {
|
157
|
-
display: flex;
|
158
|
-
|
159
|
-
.content {
|
160
|
-
-webkit-box-flex: 1;
|
161
|
-
flex: auto;
|
162
|
-
-ms-flex: auto;
|
163
|
-
}
|
164
|
-
|
165
|
-
.extra {
|
166
|
-
flex: 0 1 auto;
|
167
|
-
-webkit-box-flex: 0;
|
168
|
-
-ms-flex: 0 1 auto;
|
169
|
-
min-width: 242px;
|
170
|
-
margin-left: 88px;
|
171
|
-
text-align: right;
|
172
|
-
}
|
173
|
-
}
|
174
|
-
</style>
|
1
|
+
<template>
|
2
|
+
<div class="row">
|
3
|
+
<div class="content">
|
4
|
+
<a-skeleton :loading="loading" :paragraph="{ rows: 4 }" />
|
5
|
+
<div v-show="!loading">
|
6
|
+
<template v-if="!loadError">
|
7
|
+
<a-descriptions v-if="realData" :column="isMobile ? 1 : column" size="small" :title="title">
|
8
|
+
<a-descriptions-item
|
9
|
+
v-for="(value, key) in realData"
|
10
|
+
:key="key"
|
11
|
+
:label="key">
|
12
|
+
{{ formatText(value) }}
|
13
|
+
</a-descriptions-item>
|
14
|
+
</a-descriptions>
|
15
|
+
</template>
|
16
|
+
<template v-else>
|
17
|
+
<a-empty>
|
18
|
+
<span slot="description"> 页面配置不存在,请联系系统管理员 </span>
|
19
|
+
</a-empty>
|
20
|
+
</template>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
<div class="extra" v-if="extraShow">
|
24
|
+
<slot name="addonAfter"/>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
</template>
|
28
|
+
<script>
|
29
|
+
|
30
|
+
import { mapState } from 'vuex'
|
31
|
+
import { getRealKeyData } from '@vue2-client/utils/formatter'
|
32
|
+
import { getConfigByName } from '@vue2-client/services/api/common'
|
33
|
+
|
34
|
+
export default {
|
35
|
+
name: 'XDescriptions',
|
36
|
+
components: {
|
37
|
+
},
|
38
|
+
props: {
|
39
|
+
// 标题
|
40
|
+
title: {
|
41
|
+
type: String,
|
42
|
+
required: true
|
43
|
+
},
|
44
|
+
// 内容
|
45
|
+
content: {
|
46
|
+
type: Object,
|
47
|
+
required: true
|
48
|
+
},
|
49
|
+
// 模型名
|
50
|
+
model: {
|
51
|
+
type: String,
|
52
|
+
required: false,
|
53
|
+
default: ''
|
54
|
+
},
|
55
|
+
// 配置名称
|
56
|
+
configName: {
|
57
|
+
type: String,
|
58
|
+
required: true
|
59
|
+
},
|
60
|
+
// 配置所属命名空间
|
61
|
+
serviceName: {
|
62
|
+
type: String,
|
63
|
+
default: undefined
|
64
|
+
},
|
65
|
+
env: {
|
66
|
+
type: String,
|
67
|
+
default: 'prod'
|
68
|
+
},
|
69
|
+
// 每列显示数量
|
70
|
+
column: {
|
71
|
+
type: Number,
|
72
|
+
default: 2
|
73
|
+
},
|
74
|
+
// 每列显示数量
|
75
|
+
getRealData: {
|
76
|
+
type: Boolean,
|
77
|
+
default: false
|
78
|
+
},
|
79
|
+
// 是否展示插槽
|
80
|
+
extraShow: {
|
81
|
+
type: Boolean,
|
82
|
+
default: true
|
83
|
+
}
|
84
|
+
},
|
85
|
+
created () {
|
86
|
+
this.initConfig()
|
87
|
+
},
|
88
|
+
data () {
|
89
|
+
return {
|
90
|
+
// 加载状态
|
91
|
+
loading: false,
|
92
|
+
loadError: false,
|
93
|
+
realData: undefined
|
94
|
+
}
|
95
|
+
},
|
96
|
+
computed: {
|
97
|
+
...mapState('setting', { isMobile: 'isMobile' })
|
98
|
+
},
|
99
|
+
methods: {
|
100
|
+
initConfig () {
|
101
|
+
this.loading = true
|
102
|
+
this.loadError = false
|
103
|
+
if (this.configName) {
|
104
|
+
this.getConfig()
|
105
|
+
} else {
|
106
|
+
this.loading = false
|
107
|
+
this.loadError = true
|
108
|
+
}
|
109
|
+
},
|
110
|
+
getConfig () {
|
111
|
+
getConfigByName(this.configName, this.serviceName, (res) => {
|
112
|
+
const mapIndex = {}
|
113
|
+
const result = {}
|
114
|
+
if (res.formJson) {
|
115
|
+
res.formJson.filter(item => {
|
116
|
+
const model = item.model
|
117
|
+
return model.indexOf(this.model) > 0
|
118
|
+
})[0].groupItems.forEach(item => {
|
119
|
+
mapIndex[item.model.substring(item.model.indexOf('_') + 1)] = item.name
|
120
|
+
})
|
121
|
+
for (const key of Object.keys(this.content)) {
|
122
|
+
const name = mapIndex[key]
|
123
|
+
if (name) {
|
124
|
+
result[name] = this.content[key]
|
125
|
+
} else {
|
126
|
+
result[key] = this.content[key]
|
127
|
+
}
|
128
|
+
}
|
129
|
+
} else if (res.column) {
|
130
|
+
// [{label:'标签1',filed:'字段1'}]
|
131
|
+
let content = {}
|
132
|
+
if (this.getRealData) {
|
133
|
+
content = getRealKeyData(this.content)
|
134
|
+
} else {
|
135
|
+
content = this.content
|
136
|
+
}
|
137
|
+
if (typeof content === 'string') {
|
138
|
+
content = JSON.parse(content)
|
139
|
+
}
|
140
|
+
res.column.forEach(item => {
|
141
|
+
result[item.label] = content[item.filed]
|
142
|
+
})
|
143
|
+
}
|
144
|
+
this.realData = result
|
145
|
+
this.loading = false
|
146
|
+
}, this.env === 'dev')
|
147
|
+
},
|
148
|
+
// 文字格式化
|
149
|
+
formatText (value) {
|
150
|
+
return value ?? '--'
|
151
|
+
}
|
152
|
+
}
|
153
|
+
}
|
154
|
+
</script>
|
155
|
+
<style>
|
156
|
+
.row {
|
157
|
+
display: flex;
|
158
|
+
|
159
|
+
.content {
|
160
|
+
-webkit-box-flex: 1;
|
161
|
+
flex: auto;
|
162
|
+
-ms-flex: auto;
|
163
|
+
}
|
164
|
+
|
165
|
+
.extra {
|
166
|
+
flex: 0 1 auto;
|
167
|
+
-webkit-box-flex: 0;
|
168
|
+
-ms-flex: 0 1 auto;
|
169
|
+
min-width: 242px;
|
170
|
+
margin-left: 88px;
|
171
|
+
text-align: right;
|
172
|
+
}
|
173
|
+
}
|
174
|
+
</style>
|