vue2-client 1.7.4 → 1.7.5
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/pages/CreateQueryPage.vue +78 -11
- package/src/services/api/common.js +13 -3
package/package.json
CHANGED
|
@@ -16,22 +16,50 @@
|
|
|
16
16
|
>
|
|
17
17
|
<a-textarea v-model="importEditJson" placeholder="输入现有的JSON配置"/>
|
|
18
18
|
</a-modal>
|
|
19
|
-
<a-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
<a-modal
|
|
20
|
+
:visible="liuliModalVisible"
|
|
21
|
+
title="从琉璃中心获取配置"
|
|
22
|
+
@cancel="liuliModalVisible = false"
|
|
23
|
+
@ok="getLiuLiConfigHandleOk"
|
|
24
|
+
>
|
|
25
|
+
<a-form-model :model="form" :rules="rules" ref="liuliModel">
|
|
26
|
+
<a-form-model-item label="命名空间" prop="namespaceName">
|
|
27
|
+
<a-input v-model="form.namespaceName" :placeholder="'默认值:' + this.defaultServiceName"/>
|
|
28
|
+
</a-form-model-item>
|
|
29
|
+
<a-form-model-item label="配置名称" prop="configName">
|
|
30
|
+
<a-input v-model="form.configName"/>
|
|
31
|
+
</a-form-model-item>
|
|
32
|
+
</a-form-model>
|
|
33
|
+
</a-modal>
|
|
34
|
+
<a-card title="查询配置管理">
|
|
35
|
+
<a-space>
|
|
36
|
+
<a-button type="primary" @click="showDrawer">创建新的配置
|
|
37
|
+
</a-button>
|
|
38
|
+
<a-button type="primary" @click="openImportView(1)">从JSON文本导入
|
|
39
|
+
</a-button>
|
|
40
|
+
<a-button type="primary" @click="openLiuLiConfigModalView(1)">从琉璃中心导入
|
|
41
|
+
</a-button>
|
|
42
|
+
</a-space>
|
|
43
|
+
</a-card>
|
|
44
|
+
<a-card title="简易表单配置管理" style="margin-top: 20px">
|
|
45
|
+
<a-space>
|
|
46
|
+
<a-button type="primary" @click="showSimpleFormQueryParamsDrawer">
|
|
47
|
+
创建新的配置
|
|
48
|
+
</a-button>
|
|
49
|
+
<a-button type="primary" @click="openImportView(2)">从JSON文本导入
|
|
50
|
+
</a-button>
|
|
51
|
+
<a-button type="primary" @click="openLiuLiConfigModalView(2)">从琉璃中心导入
|
|
52
|
+
</a-button>
|
|
53
|
+
</a-space>
|
|
54
|
+
</a-card>
|
|
29
55
|
</div>
|
|
30
56
|
</template>
|
|
31
57
|
|
|
32
58
|
<script>
|
|
33
59
|
import CreateQuery from '@vue2-client/base-client/components/common/CreateQuery'
|
|
34
60
|
import CreateSimpleFormQuery from '@vue2-client/base-client/components/common/CreateSimpleFormQuery'
|
|
61
|
+
import { mapState } from 'vuex'
|
|
62
|
+
import { getNativeConfig } from 'vue2-client/src/services/api/common'
|
|
35
63
|
|
|
36
64
|
export default {
|
|
37
65
|
name: 'CreateQueryPage',
|
|
@@ -46,10 +74,21 @@ export default {
|
|
|
46
74
|
toEditJson: undefined,
|
|
47
75
|
toEditSimpleFormJson: undefined,
|
|
48
76
|
importJsonVisible: false,
|
|
77
|
+
liuliModalVisible: false,
|
|
49
78
|
type: undefined,
|
|
50
|
-
importEditJson: ''
|
|
79
|
+
importEditJson: '',
|
|
80
|
+
form: {
|
|
81
|
+
namespaceName: undefined,
|
|
82
|
+
configName: undefined
|
|
83
|
+
},
|
|
84
|
+
rules: {
|
|
85
|
+
configName: [{ required: true, message: '请输入配置名称', trigger: 'blur' }]
|
|
86
|
+
}
|
|
51
87
|
}
|
|
52
88
|
},
|
|
89
|
+
computed: {
|
|
90
|
+
...mapState('setting', ['defaultServiceName'])
|
|
91
|
+
},
|
|
53
92
|
methods: {
|
|
54
93
|
showDrawer () {
|
|
55
94
|
this.visible = true
|
|
@@ -57,6 +96,10 @@ export default {
|
|
|
57
96
|
showSimpleFormQueryParamsDrawer () {
|
|
58
97
|
this.createSimpleFormVisible = true
|
|
59
98
|
},
|
|
99
|
+
openLiuLiConfigModalView (type) {
|
|
100
|
+
this.type = type
|
|
101
|
+
this.liuliModalVisible = true
|
|
102
|
+
},
|
|
60
103
|
openImportView (type) {
|
|
61
104
|
this.type = type
|
|
62
105
|
this.importJsonVisible = true
|
|
@@ -75,6 +118,30 @@ export default {
|
|
|
75
118
|
}
|
|
76
119
|
this.importJsonVisible = false
|
|
77
120
|
},
|
|
121
|
+
getLiuLiConfigHandleOk () {
|
|
122
|
+
try {
|
|
123
|
+
this.$refs.liuliModel.validate(valid => {
|
|
124
|
+
if (valid) {
|
|
125
|
+
getNativeConfig(this.form.configName, this.form.namespaceName).then(res => {
|
|
126
|
+
console.warn(res)
|
|
127
|
+
if (this.type === 1) {
|
|
128
|
+
this.toEditJson = res
|
|
129
|
+
this.showDrawer()
|
|
130
|
+
} else {
|
|
131
|
+
this.toEditSimpleFormJson = res
|
|
132
|
+
this.showSimpleFormQueryParamsDrawer()
|
|
133
|
+
}
|
|
134
|
+
})
|
|
135
|
+
} else {
|
|
136
|
+
return false
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
} catch (e) {
|
|
140
|
+
this.$message.error('操作失败:' + e)
|
|
141
|
+
throw e
|
|
142
|
+
}
|
|
143
|
+
this.liuliModalVisible = false
|
|
144
|
+
},
|
|
78
145
|
}
|
|
79
146
|
}
|
|
80
147
|
</script>
|
|
@@ -8,8 +8,10 @@ import { post } from '@vue2-client/services/api/restTools'
|
|
|
8
8
|
import setting from '@vue2-client/store/modules/setting'
|
|
9
9
|
|
|
10
10
|
const commonApi = {
|
|
11
|
-
//
|
|
11
|
+
// 获取配置
|
|
12
12
|
getConfig: 'logic/getLiuliConfiguration',
|
|
13
|
+
// 获取原生配置
|
|
14
|
+
getNativeConfig: 'logic/getLiuliNativeConfiguration',
|
|
13
15
|
// 配置解析
|
|
14
16
|
parseConfig: 'logic/parseConfig',
|
|
15
17
|
// 通用查询
|
|
@@ -34,11 +36,15 @@ const commonApi = {
|
|
|
34
36
|
getEmpTree: '/api/af-system/logic/getEmpTree',
|
|
35
37
|
}
|
|
36
38
|
|
|
37
|
-
export function getConfigUrl (serviceName = setting.state.
|
|
39
|
+
export function getConfigUrl (serviceName = setting.state.defaultServiceName) {
|
|
38
40
|
return '/api/' + serviceName + '/' + commonApi.getConfig
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
export function
|
|
43
|
+
export function getNativeConfigUrl (serviceName = setting.state.defaultServiceName) {
|
|
44
|
+
return '/api/' + serviceName + '/' + commonApi.getNativeConfig
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function parseConfigUrl (serviceName = setting.state.defaultServiceName) {
|
|
42
48
|
return '/api/' + serviceName + '/' + commonApi.parseConfig
|
|
43
49
|
}
|
|
44
50
|
|
|
@@ -59,6 +65,10 @@ export function getConfig (configName, serviceName = setting.state.defaultServic
|
|
|
59
65
|
indexedDB.getByWeb(configName, getConfigUrl(serviceName), { configName: configName }, callback)
|
|
60
66
|
}
|
|
61
67
|
|
|
68
|
+
export function getNativeConfig (configName, serviceName = setting.state.defaultServiceName) {
|
|
69
|
+
return post(getNativeConfigUrl(serviceName), { configName: configName })
|
|
70
|
+
}
|
|
71
|
+
|
|
62
72
|
/**
|
|
63
73
|
* 调用Logic获取配置内容
|
|
64
74
|
* @param logicName Logic名称
|