|
@@ -0,0 +1,250 @@
|
|
1
|
+<template>
|
|
2
|
+ <el-form ref="form" :model="form" label-width="140px" style="margin-top:40px;">
|
|
3
|
+ <el-form-item label="同步模式">
|
|
4
|
+ <el-select v-model="form.pattern" placeholder="请选择同步模式" style="width :600px;">
|
|
5
|
+ <el-option v-for="item in patterns" :key="item.value" :label="item.label" :value="item.value"> </el-option>
|
|
6
|
+ </el-select>
|
|
7
|
+ </el-form-item>
|
|
8
|
+ <el-form-item label="数据库地址" v-if="form.pattern == 1 || form.pattern == 0" >
|
|
9
|
+ <el-input v-model.trim="form.dbhost" maxlength="200" style="width :600px;"></el-input>
|
|
10
|
+ </el-form-item>
|
|
11
|
+ <el-form-item label="用户名" v-if="form.pattern == 1 || form.pattern == 0" >
|
|
12
|
+ <el-input v-model.trim="form.dbuser" maxlength="200" style="width :600px;"></el-input>
|
|
13
|
+ </el-form-item>
|
|
14
|
+ <el-form-item label="密码" v-if="form.pattern == 1 || form.pattern == 0" >
|
|
15
|
+ <el-input v-model.trim="form.dbpassword" maxlength="200" style="width :600px;"></el-input>
|
|
16
|
+ </el-form-item>
|
|
17
|
+ <el-form-item label="数据库名" v-if="form.pattern == 1 || form.pattern == 0" >
|
|
18
|
+ <el-input v-model.trim="form.dbname" maxlength="200" style="width :600px;"></el-input>
|
|
19
|
+ </el-form-item>
|
|
20
|
+ <el-form-item label="接口地址" v-if="form.pattern == 2" >
|
|
21
|
+ <el-input v-model.trim="form.interface_url" maxlength="200" style="width :600px;"></el-input>
|
|
22
|
+ </el-form-item>
|
|
23
|
+ <el-form-item label="密钥" v-if="form.pattern == 2" >
|
|
24
|
+ <el-input v-model.trim="form.interface_token" maxlength="200" style="width :600px;"></el-input>
|
|
25
|
+ </el-form-item>
|
|
26
|
+ <el-form-item label="可访问IP" v-if="form.pattern == 3" >
|
|
27
|
+ <el-input v-model.trim="form.allow_ip" maxlength="200" style="width :600px;"></el-input>
|
|
28
|
+ </el-form-item>
|
|
29
|
+ <el-form-item label="密钥" v-if="form.pattern == 3" >
|
|
30
|
+ <el-input v-model.trim="form.allow_token" maxlength="200" style="width :600px;"></el-input>
|
|
31
|
+ </el-form-item>
|
|
32
|
+ <el-form-item label="同步频率">
|
|
33
|
+ <el-select v-model="form.sync_frequency" placeholder="请选择同步频率" style="width :600px;">
|
|
34
|
+ <el-option v-for="item in sync_frequencys" :key="item.value" :label="item.label" :value="item.value"> </el-option>
|
|
35
|
+ </el-select>
|
|
36
|
+ </el-form-item>
|
|
37
|
+
|
|
38
|
+ <el-form-item label="Tips" v-if="form.pattern == 3" >
|
|
39
|
+ <div style="width :600px;">本接口方位地址为:https://api.kuyicloud.com/api/sync?org_id=xx?str=xxx?timestamp=xxx?titck=xxx
|
|
40
|
+需要传递的参数有,org_id(机构id),str(随机字符串),timestamp(当前时间戳),和titck(签名)
|
|
41
|
+签名生成规则:org_id+str+timestamp,以md5加密钥的方式生成字符串</div>
|
|
42
|
+ </el-form-item>
|
|
43
|
+
|
|
44
|
+ <el-form-item>
|
|
45
|
+ <el-button type="primary" @click="onSubmit">保存</el-button>
|
|
46
|
+ <el-button>重置</el-button>
|
|
47
|
+ </el-form-item>
|
|
48
|
+ </el-form>
|
|
49
|
+</template>
|
|
50
|
+
|
|
51
|
+<script>
|
|
52
|
+import { getInterface, saveInterface } from '@/api/integration'
|
|
53
|
+export default {
|
|
54
|
+ name: 'interfaceConfig',
|
|
55
|
+
|
|
56
|
+ created() {
|
|
57
|
+ this.getInterface()
|
|
58
|
+ },
|
|
59
|
+ data() {
|
|
60
|
+ return {
|
|
61
|
+ sync_frequencys: [{
|
|
62
|
+ value: 1,
|
|
63
|
+ label: '1分钟/次'
|
|
64
|
+ }, {
|
|
65
|
+ value: 2,
|
|
66
|
+ label: '10分钟/次'
|
|
67
|
+ }, {
|
|
68
|
+ value: 3,
|
|
69
|
+ label: '30分钟/次'
|
|
70
|
+ }, {
|
|
71
|
+ value: 4,
|
|
72
|
+ label: '1小时/次'
|
|
73
|
+ }, {
|
|
74
|
+ value: 5,
|
|
75
|
+ label: '6小时/次'
|
|
76
|
+ }, {
|
|
77
|
+ value: 6,
|
|
78
|
+ label: '12小时/次'
|
|
79
|
+ }, {
|
|
80
|
+ value: 7,
|
|
81
|
+ label: '1天/次'
|
|
82
|
+ }],
|
|
83
|
+ patterns: [{
|
|
84
|
+ value: 1,
|
|
85
|
+ label: '访问数据库模式'
|
|
86
|
+ }, {
|
|
87
|
+ value: 2,
|
|
88
|
+ label: '调用接口模式'
|
|
89
|
+ }, {
|
|
90
|
+ value: 3,
|
|
91
|
+ label: '数据接收模式'
|
|
92
|
+ }],
|
|
93
|
+ form: {
|
|
94
|
+ id: 0,
|
|
95
|
+ pattern: '',
|
|
96
|
+ dbhost: '',
|
|
97
|
+ dbuser: '',
|
|
98
|
+ dbpassword: '',
|
|
99
|
+ dbname: '',
|
|
100
|
+ interface_url: '',
|
|
101
|
+ interface_token: '',
|
|
102
|
+ allow_ip: '',
|
|
103
|
+ allow_token: '',
|
|
104
|
+ sync_frequency: ''
|
|
105
|
+ }
|
|
106
|
+ }
|
|
107
|
+ },
|
|
108
|
+ methods: {
|
|
109
|
+ getInterface: function() {
|
|
110
|
+ getInterface().then(response => {
|
|
111
|
+ if (response.data.state == 0) {
|
|
112
|
+ this.$message.error(response.data.msg)
|
|
113
|
+ return false
|
|
114
|
+ } else {
|
|
115
|
+ var interfaceinfo = response.data.data.interfaceinfo
|
|
116
|
+ if (interfaceinfo != null) {
|
|
117
|
+ this.form.id = interfaceinfo.id
|
|
118
|
+ this.form.pattern = interfaceinfo.pattern
|
|
119
|
+ this.form.dbhost = interfaceinfo.dbhost
|
|
120
|
+ this.form.dbuser = interfaceinfo.dbuser
|
|
121
|
+ this.form.dbpassword = interfaceinfo.dbpassword
|
|
122
|
+ this.form.dbname = interfaceinfo.dbname
|
|
123
|
+ this.form.interface_url = interfaceinfo.interface_url
|
|
124
|
+ this.form.interface_token = interfaceinfo.interface_token
|
|
125
|
+ this.form.allow_ip = interfaceinfo.allow_ip
|
|
126
|
+ this.form.allow_token = interfaceinfo.allow_token
|
|
127
|
+ this.form.sync_frequency = interfaceinfo.sync_frequency
|
|
128
|
+ }
|
|
129
|
+ }
|
|
130
|
+ })
|
|
131
|
+ },
|
|
132
|
+ onSubmit() {
|
|
133
|
+ if (this.form.pattern === '') {
|
|
134
|
+ this.$message.error('请选择同步模式')
|
|
135
|
+ return false
|
|
136
|
+ }
|
|
137
|
+ if (this.form.pattern == 1) {
|
|
138
|
+ if (this.form.dbhost.length <= 0) {
|
|
139
|
+ this.$message.error('请输入数据库地址')
|
|
140
|
+ return false
|
|
141
|
+ }
|
|
142
|
+ if (this.form.dbuser.length <= 0) {
|
|
143
|
+ this.$message.error('请输入数据库用户名')
|
|
144
|
+ return false
|
|
145
|
+ }
|
|
146
|
+ if (this.form.dbpassword.length <= 0) {
|
|
147
|
+ this.$message.error('请输入数据库密码')
|
|
148
|
+ return false
|
|
149
|
+ }
|
|
150
|
+ if (this.form.dbname.length <= 0) {
|
|
151
|
+ this.$message.error('请输入数据库名')
|
|
152
|
+ return false
|
|
153
|
+ }
|
|
154
|
+ }
|
|
155
|
+ if (this.form.pattern == 2) {
|
|
156
|
+ if (this.form.interface_url.length <= 0) {
|
|
157
|
+ this.$message.error('请输入接口地址')
|
|
158
|
+ return false
|
|
159
|
+ }
|
|
160
|
+ if (this.form.interface_token.length <= 0) {
|
|
161
|
+ this.$message.error('请输入密钥')
|
|
162
|
+ return false
|
|
163
|
+ }
|
|
164
|
+ }
|
|
165
|
+ if (this.form.pattern == 3) {
|
|
166
|
+ if (this.form.allow_ip.length <= 0) {
|
|
167
|
+ this.$message.error('请输入可访问IP地址')
|
|
168
|
+ return false
|
|
169
|
+ }
|
|
170
|
+ if (this.form.allow_token.length <= 0) {
|
|
171
|
+ this.$message.error('请输入密钥')
|
|
172
|
+ return false
|
|
173
|
+ }
|
|
174
|
+ }
|
|
175
|
+ if (this.form.sync_frequency === '') {
|
|
176
|
+ this.$message.error('请选择同步频率')
|
|
177
|
+ return false
|
|
178
|
+ }
|
|
179
|
+
|
|
180
|
+ saveInterface(this.form).then(response => {
|
|
181
|
+ if (response.data.state == 0) {
|
|
182
|
+ this.$message.error(response.data.msg)
|
|
183
|
+ return false
|
|
184
|
+ } else {
|
|
185
|
+ var interfaceinfo = response.data.data.interfaceinfo
|
|
186
|
+ if (interfaceinfo != null && interfaceinfo.length > 0) {
|
|
187
|
+ this.form.id = interfaceinfo.id
|
|
188
|
+ this.form.pattern = interfaceinfo.pattern
|
|
189
|
+ this.form.dbhost = interfaceinfo.dbhost
|
|
190
|
+ this.form.dbuser = interfaceinfo.dbuser
|
|
191
|
+ this.form.dbpassword = interfaceinfo.dbpassword
|
|
192
|
+ this.form.dbname = interfaceinfo.dbname
|
|
193
|
+ this.form.interface_url = interfaceinfo.interface_url
|
|
194
|
+ this.form.interface_token = interfaceinfo.interface_token
|
|
195
|
+ this.form.allow_ip = interfaceinfo.allow_ip
|
|
196
|
+ this.form.allow_token = interfaceinfo.allow_token
|
|
197
|
+ this.form.sync_frequency = interfaceinfo.sync_frequency
|
|
198
|
+ }
|
|
199
|
+ this.$message({ message: '提交成功', type: 'success' })
|
|
200
|
+ }
|
|
201
|
+ })
|
|
202
|
+ }
|
|
203
|
+ }
|
|
204
|
+}
|
|
205
|
+</script>
|
|
206
|
+
|
|
207
|
+<style rel="stylesheet/css" lang="scss" scoped>
|
|
208
|
+.information {
|
|
209
|
+ border: 1px #dcdfe6 solid;
|
|
210
|
+ padding: 30px 20px 30px 20px;
|
|
211
|
+
|
|
212
|
+ .border {
|
|
213
|
+ border-bottom: 1px #dcdfe6 solid;
|
|
214
|
+ margin: 0px 0 20px 0;
|
|
215
|
+ }
|
|
216
|
+}
|
|
217
|
+
|
|
218
|
+.edit_separater {
|
|
219
|
+ border-top: 1px solid rgb(233, 233, 233);
|
|
220
|
+ margin-top: 15px;
|
|
221
|
+ margin-bottom: 15px;
|
|
222
|
+}
|
|
223
|
+</style>
|
|
224
|
+
|
|
225
|
+<style>
|
|
226
|
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
|
|
227
|
+ font-size: 12px;
|
|
228
|
+}
|
|
229
|
+
|
|
230
|
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
|
|
231
|
+ background: #6fb5fa;
|
|
232
|
+}
|
|
233
|
+
|
|
234
|
+.count {
|
|
235
|
+ color: #bd2c00;
|
|
236
|
+}
|
|
237
|
+
|
|
238
|
+.el-table td,
|
|
239
|
+.el-table th.is-leaf,
|
|
240
|
+.el-table--border,
|
|
241
|
+.el-table--group {
|
|
242
|
+ border-color: #d0d3da;
|
|
243
|
+}
|
|
244
|
+
|
|
245
|
+.el-table--border::after,
|
|
246
|
+.el-table--group::after,
|
|
247
|
+.el-table::before {
|
|
248
|
+ background-color: #d0d3da;
|
|
249
|
+}
|
|
250
|
+</style>
|