Commit f8c03a71 by qinjianhui

Merge branch 'dev' into 'master'

fix: 问题修改

See merge request !17
parents 4522add0 a306dcd1
...@@ -303,37 +303,6 @@ ...@@ -303,37 +303,6 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item
label="二级域名"
prop="customDomain"
:rules="[
{ required: true, message: '请输入二级域名' },
]"
>
<el-input
style="width: 200px"
v-model.trim="editForm.customDomain"
placeholder="请输入二级域名"
size="small"
clearable
></el-input>
</el-form-item> -->
<!-- <el-form-item
label="Api Name"
prop="apiName"
:rules="[
{ required: true, message: '请输入Api Name' },
]"
>
<el-input
style="width: 200px"
v-model="editForm.apiName"
placeholder="请输入Api Name"
size="small"
disabled
clearable
></el-input>
</el-form-item> -->
<el-form-item <el-form-item
label="数据库类型" label="数据库类型"
prop="databaseType" prop="databaseType"
...@@ -379,7 +348,7 @@ ...@@ -379,7 +348,7 @@
clearable clearable
/> />
</el-form-item> </el-form-item>
<el-form-item label="数据库名称"> <el-form-item label="数据库名称" v-if="!editId">
<el-input <el-input
style="width: 200px" style="width: 200px"
:value="`saas_${editForm.databaseName || ''}`" :value="`saas_${editForm.databaseName || ''}`"
...@@ -389,6 +358,16 @@ ...@@ -389,6 +358,16 @@
> >
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="数据库名称" v-else>
<el-input
style="width: 200px"
:value="editForm.databaseName || ''"
size="small"
disabled
placeholder="请输入数据库名称"
>
</el-input>
</el-form-item>
<el-form-item <el-form-item
label="数据库用户名" label="数据库用户名"
prop="databaseUserName" prop="databaseUserName"
...@@ -594,6 +573,7 @@ export default { ...@@ -594,6 +573,7 @@ export default {
this.editForm = JSON.parse( this.editForm = JSON.parse(
JSON.stringify(this.cloneEditForm), JSON.stringify(this.cloneEditForm),
) )
this.baseDomain = '.jomalls.com'
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.form.clearValidate() this.$refs.form.clearValidate()
}) })
...@@ -605,11 +585,15 @@ export default { ...@@ -605,11 +585,15 @@ export default {
}) })
try { try {
const res = await getDataById(row.id) const res = await getDataById(row.id)
res.data.domain = const parts = /^(.*)(\.(([^.]+)\.([^.]+)))$/.exec(
res.data.domain && res.data.domain.split('.')[0] res.data.domain,
res.data.databaseName = )
res.data.databaseName && if (parts) {
res.data.databaseName.substring(5) const name = parts[1]
const tld = '.' + parts[3]
res.data.domain = name
this.baseDomain = tld
}
this.editForm = res.data this.editForm = res.data
} catch (e) { } catch (e) {
this.$message.error(e) this.$message.error(e)
...@@ -627,8 +611,10 @@ export default { ...@@ -627,8 +611,10 @@ export default {
const l = this.$loading({ const l = this.$loading({
background: 'rgba(0, 0, 0, 0.3)', background: 'rgba(0, 0, 0, 0.3)',
}) })
this.editForm.databaseName = if (!this.editId) {
'saas_' + this.editForm.databaseName this.editForm.databaseName =
'saas_' + this.editForm.databaseName
}
this.editForm.domain = this.editForm.domain =
this.editForm.domain + this.baseDomain this.editForm.domain + this.baseDomain
try { try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment