vue2-client 1.11.4 → 1.11.6
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/CitySelect/CitySelect.vue +366 -342
- package/src/base-client/components/common/Upload/Upload.vue +322 -322
- package/src/base-client/components/common/XDescriptions/XDescriptionsGroup.vue +61 -51
- package/src/base-client/components/common/XDescriptions/demo.vue +10 -9
- package/src/base-client/components/common/XFormGroup/demo.vue +3 -10
- package/src/base-client/components/common/XFormTable/demo.vue +60 -60
- package/src/components/STable/index.js +426 -426
- package/src/expression/ExpressionRunner.ts +28 -0
- package/src/expression/TestExpression.ts +509 -0
- package/src/expression/core/Delegate.ts +114 -0
- package/src/expression/core/Expression.ts +1295 -0
- package/src/expression/core/Program.ts +950 -0
- package/src/expression/core/Token.ts +29 -0
- package/src/expression/enums/ExpressionType.ts +81 -0
- package/src/expression/enums/TokenType.ts +13 -0
- package/src/expression/exception/BreakWayException.ts +2 -0
- package/src/expression/exception/ContinueWayException.ts +2 -0
- package/src/expression/exception/ExpressionException.ts +28 -0
- package/src/expression/exception/ReturnWayException.ts +14 -0
- package/src/expression/exception/ServiceException.ts +22 -0
- package/src/expression/instances/JSONArray.ts +48 -0
- package/src/expression/instances/JSONObject.ts +109 -0
- package/src/expression/instances/LogicConsole.ts +32 -0
- package/src/router/async/router.map.js +3 -2
- package/src/utils/indexedDB.js +234 -234
|
@@ -98,6 +98,21 @@ export default {
|
|
|
98
98
|
// }
|
|
99
99
|
// }
|
|
100
100
|
// }
|
|
101
|
+
// 数据模式结构
|
|
102
|
+
// "groups": [{
|
|
103
|
+
// "name": "客户信息",
|
|
104
|
+
// "fields": [
|
|
105
|
+
// {
|
|
106
|
+
// "name": "备注",
|
|
107
|
+
// "key": "f_comments",
|
|
108
|
+
// "span": 3
|
|
109
|
+
// },
|
|
110
|
+
// {
|
|
111
|
+
// "name": "地址",
|
|
112
|
+
// "key": "f_address",
|
|
113
|
+
// "span": 3
|
|
114
|
+
// }]
|
|
115
|
+
// }]
|
|
101
116
|
configName: {
|
|
102
117
|
type: String,
|
|
103
118
|
required: true,
|
|
@@ -174,61 +189,56 @@ export default {
|
|
|
174
189
|
getConfig () {
|
|
175
190
|
getConfigByName(this.configName, this.serviceName, (res) => {
|
|
176
191
|
if (res.groups) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
column: Object.keys(hObj.value).map((key) => {
|
|
190
|
-
return {
|
|
191
|
-
key: hObj.value[key],
|
|
192
|
-
value: item[key]
|
|
193
|
-
}
|
|
194
|
-
})
|
|
192
|
+
const groups = Array.isArray(res.groups)
|
|
193
|
+
? res.groups
|
|
194
|
+
: Object.entries(res.groups).map(([groupName, groupConfig]) => {
|
|
195
|
+
if (groupConfig.type === 'array') {
|
|
196
|
+
return {
|
|
197
|
+
name: groupName,
|
|
198
|
+
type: 'array',
|
|
199
|
+
key: groupConfig.key,
|
|
200
|
+
fields: Object.entries(groupConfig.value || {}).map(([k, v]) => ({
|
|
201
|
+
key: k,
|
|
202
|
+
name: v
|
|
203
|
+
}))
|
|
195
204
|
}
|
|
196
|
-
// 如果所有 value 都是空的 return null todo 后期可能做成配置
|
|
197
|
-
const isAllNull = arrayItem.column.every((item) => {
|
|
198
|
-
return item.value === null || item.value === ''
|
|
199
|
-
})
|
|
200
|
-
return isAllNull ? null : arrayItem
|
|
201
|
-
}).filter((item) => item)
|
|
202
|
-
if (arrayDataItem.length) {
|
|
203
|
-
dataItem.column = arrayDataItem
|
|
204
|
-
return dataItem
|
|
205
|
-
} else {
|
|
206
|
-
return null
|
|
207
205
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
// 如果所有 value 都是空的 return null todo 后期可能做成配置
|
|
218
|
-
const isAllNull = tempData.every((item) => {
|
|
219
|
-
return item.value === null || item.value === ''
|
|
220
|
-
})
|
|
221
|
-
if (isAllNull) {
|
|
222
|
-
return null
|
|
223
|
-
} else {
|
|
224
|
-
dataItem.column = tempData
|
|
225
|
-
return dataItem
|
|
206
|
+
|
|
207
|
+
// 处理普通旧格式配置
|
|
208
|
+
return {
|
|
209
|
+
name: groupName,
|
|
210
|
+
fields: Object.entries(groupConfig).map(([fieldKey, fieldValue]) => ({
|
|
211
|
+
key: fieldKey,
|
|
212
|
+
name: typeof fieldValue === 'string' ? fieldValue : fieldValue.name,
|
|
213
|
+
...(typeof fieldValue === 'object' ? fieldValue : {})
|
|
214
|
+
}))
|
|
226
215
|
}
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
this.groups = groups
|
|
219
|
+
this.realData = groups.map(group => {
|
|
220
|
+
const dataItem = { title: group.name }
|
|
221
|
+
|
|
222
|
+
if (group.type === 'array') {
|
|
223
|
+
// 处理数组类型数据
|
|
224
|
+
const arrayData = this.data[group.key] || []
|
|
225
|
+
dataItem.column = arrayData.map((item, index) => ({
|
|
226
|
+
title: `${group.name} ${index + 1}`,
|
|
227
|
+
column: group.fields.map(field => ({
|
|
228
|
+
key: field.name,
|
|
229
|
+
value: item[field.key]
|
|
230
|
+
}))
|
|
231
|
+
})).filter(Boolean)
|
|
232
|
+
} else {
|
|
233
|
+
dataItem.column = group.fields.map(field => ({
|
|
234
|
+
key: field.name,
|
|
235
|
+
value: this.getRealKeyData(this.data, field.key),
|
|
236
|
+
span: field.span
|
|
237
|
+
}))
|
|
227
238
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
this.loadError = true
|
|
239
|
+
|
|
240
|
+
return dataItem.column.length > 0 ? dataItem : null
|
|
241
|
+
}).filter(Boolean)
|
|
232
242
|
}
|
|
233
243
|
})
|
|
234
244
|
},
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import XDescriptionsGroup from '@vue2-client/base-client/components/common/XDescriptions/XDescriptionsGroup.vue'
|
|
3
|
-
import { runLogic } from '@vue2-client/services/api/common'
|
|
4
3
|
|
|
5
4
|
export default {
|
|
6
5
|
name: 'Demo',
|
|
@@ -10,18 +9,20 @@ export default {
|
|
|
10
9
|
visible: false,
|
|
11
10
|
userinfo: {
|
|
12
11
|
f_userinfo_code: '143400000003',
|
|
13
|
-
f_gasbrand: '测试表品牌'
|
|
12
|
+
f_gasbrand: '测试表品牌',
|
|
13
|
+
f_address: '11'
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
methods: {
|
|
18
18
|
open () {
|
|
19
|
-
runLogic('querySingleUserDetail', {
|
|
20
|
-
|
|
21
|
-
}, 'af-revenue').then(res => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})
|
|
19
|
+
// runLogic('querySingleUserDetail', {
|
|
20
|
+
// f_userinfo_code: '143400000003'
|
|
21
|
+
// }, 'af-revenue').then(res => {
|
|
22
|
+
// this.userinfo = res
|
|
23
|
+
// this.visible = true
|
|
24
|
+
// })
|
|
25
|
+
this.visible = true
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
}
|
|
@@ -40,7 +41,7 @@ export default {
|
|
|
40
41
|
:visible="visible"
|
|
41
42
|
@close="()=>{visible = false}"
|
|
42
43
|
>
|
|
43
|
-
<x-descriptions-group config-name="
|
|
44
|
+
<x-descriptions-group config-name="测试Config" :showLeftTab="true" :data="userinfo" service-name="af-system"/>
|
|
44
45
|
</a-drawer>
|
|
45
46
|
</div>
|
|
46
47
|
</template>
|
|
@@ -11,7 +11,7 @@ export default {
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
created () {
|
|
14
|
-
getConfigByNameAsync('
|
|
14
|
+
getConfigByNameAsync('testFormGroup', 'af-revenue').then(res => {
|
|
15
15
|
this.$refs.xFormGroupDemo.init({
|
|
16
16
|
...res,
|
|
17
17
|
serviceName: 'af-revenue',
|
|
@@ -30,15 +30,8 @@ export default {
|
|
|
30
30
|
</script>
|
|
31
31
|
|
|
32
32
|
<template>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
:bodyStyle="{height:'70vh'}"
|
|
36
|
-
:dialog-style="{ top: '30px' }"
|
|
37
|
-
title="测试表单组"
|
|
38
|
-
@ok="submitForm"
|
|
39
|
-
width="85vw">
|
|
40
|
-
<x-form-group ref="xFormGroupDemo"></x-form-group>
|
|
41
|
-
</a-modal>
|
|
33
|
+
|
|
34
|
+
<x-form-group ref="xFormGroupDemo"></x-form-group>
|
|
42
35
|
</template>
|
|
43
36
|
|
|
44
37
|
<style scoped lang="less">
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-card :bordered="false">
|
|
3
|
-
<!-- <a-button @click="()=>{queryParamsName = 'MeterBookUnallocatedUserCRUD'}">测试1</a-button>-->
|
|
4
|
-
<!-- <a-button @click="()=>{queryParamsName = 'MeterBookUnallocatedAreaCRUD'}">测试2</a-button>-->
|
|
5
|
-
<x-form-table
|
|
6
|
-
title="示例表单"
|
|
7
|
-
:queryParamsName="queryParamsName"
|
|
8
|
-
:fixedAddForm="fixedAddForm"
|
|
9
|
-
service-name="af-system"
|
|
10
|
-
@action="action"
|
|
11
|
-
@columnClick="columnClick"
|
|
12
|
-
ref="xFormTable">
|
|
13
|
-
</x-form-table>
|
|
14
|
-
</a-card>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'
|
|
19
|
-
import { microDispatch } from '@vue2-client/utils/microAppUtils'
|
|
20
|
-
export default {
|
|
21
|
-
name: 'Demo',
|
|
22
|
-
components: {
|
|
23
|
-
XFormTable
|
|
24
|
-
},
|
|
25
|
-
data () {
|
|
26
|
-
return {
|
|
27
|
-
// 查询配置文件名
|
|
28
|
-
queryParamsName: 'ceshiCRUD',
|
|
29
|
-
// 查询配置左侧tree
|
|
30
|
-
// xTreeConfigName: 'addressType',
|
|
31
|
-
// 新增表单固定值
|
|
32
|
-
fixedAddForm: {},
|
|
33
|
-
// 是否显示详情抽屉
|
|
34
|
-
detailVisible: false,
|
|
35
|
-
// 当前记录
|
|
36
|
-
record: {}
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
methods: {
|
|
40
|
-
columnClick (key, value, record) {
|
|
41
|
-
microDispatch({ type: 'v3route', path: '/bingliguanli/dianzibingliluru', props: { selected: arguments[0].his_f_admission_id } })
|
|
42
|
-
},
|
|
43
|
-
action (record, id, actionType) {
|
|
44
|
-
this.detailVisible = true
|
|
45
|
-
console.log('触发了详情操作', record, id, actionType)
|
|
46
|
-
},
|
|
47
|
-
onClose () {
|
|
48
|
-
this.detailVisible = false
|
|
49
|
-
// 关闭详情之后重新查询表单
|
|
50
|
-
this.$refs.xFormTable.refreshTable(true)
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
computed: {
|
|
54
|
-
},
|
|
55
|
-
}
|
|
56
|
-
</script>
|
|
57
|
-
|
|
58
|
-
<style scoped>
|
|
59
|
-
|
|
60
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<a-card :bordered="false">
|
|
3
|
+
<!-- <a-button @click="()=>{queryParamsName = 'MeterBookUnallocatedUserCRUD'}">测试1</a-button>-->
|
|
4
|
+
<!-- <a-button @click="()=>{queryParamsName = 'MeterBookUnallocatedAreaCRUD'}">测试2</a-button>-->
|
|
5
|
+
<x-form-table
|
|
6
|
+
title="示例表单"
|
|
7
|
+
:queryParamsName="queryParamsName"
|
|
8
|
+
:fixedAddForm="fixedAddForm"
|
|
9
|
+
service-name="af-system"
|
|
10
|
+
@action="action"
|
|
11
|
+
@columnClick="columnClick"
|
|
12
|
+
ref="xFormTable">
|
|
13
|
+
</x-form-table>
|
|
14
|
+
</a-card>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'
|
|
19
|
+
import { microDispatch } from '@vue2-client/utils/microAppUtils'
|
|
20
|
+
export default {
|
|
21
|
+
name: 'Demo',
|
|
22
|
+
components: {
|
|
23
|
+
XFormTable
|
|
24
|
+
},
|
|
25
|
+
data () {
|
|
26
|
+
return {
|
|
27
|
+
// 查询配置文件名
|
|
28
|
+
queryParamsName: 'ceshiCRUD',
|
|
29
|
+
// 查询配置左侧tree
|
|
30
|
+
// xTreeConfigName: 'addressType',
|
|
31
|
+
// 新增表单固定值
|
|
32
|
+
fixedAddForm: {},
|
|
33
|
+
// 是否显示详情抽屉
|
|
34
|
+
detailVisible: false,
|
|
35
|
+
// 当前记录
|
|
36
|
+
record: {}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
methods: {
|
|
40
|
+
columnClick (key, value, record) {
|
|
41
|
+
microDispatch({ type: 'v3route', path: '/bingliguanli/dianzibingliluru', props: { selected: arguments[0].his_f_admission_id } })
|
|
42
|
+
},
|
|
43
|
+
action (record, id, actionType) {
|
|
44
|
+
this.detailVisible = true
|
|
45
|
+
console.log('触发了详情操作', record, id, actionType)
|
|
46
|
+
},
|
|
47
|
+
onClose () {
|
|
48
|
+
this.detailVisible = false
|
|
49
|
+
// 关闭详情之后重新查询表单
|
|
50
|
+
this.$refs.xFormTable.refreshTable(true)
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
computed: {
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<style scoped>
|
|
59
|
+
|
|
60
|
+
</style>
|