1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

feat: 修改前端校验

This commit is contained in:
zhengkunwang223 2022-11-21 11:38:01 +08:00 committed by zhengkunwang223
parent ae4662cf26
commit 61d7e68262

View File

@ -7,7 +7,7 @@
<el-option :label="$t('website.static')" value="static"></el-option> <el-option :label="$t('website.static')" value="static"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('website.group')" prop="webSiteGroupID"> <el-form-item :label="$t('website.group')" prop="webSiteGroupId">
<el-select v-model="website.webSiteGroupId"> <el-select v-model="website.webSiteGroupId">
<el-option <el-option
v-for="(group, index) in groups" v-for="(group, index) in groups"
@ -31,7 +31,7 @@
<el-form-item <el-form-item
v-if="website.appType == 'installed'" v-if="website.appType == 'installed'"
:label="$t('website.appInstalled')" :label="$t('website.appInstalled')"
prop="appInstallID" prop="appInstallId"
> >
<el-select v-model="website.appInstallId"> <el-select v-model="website.appInstallId">
<el-option <el-option
@ -43,10 +43,10 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<div v-if="website.appType == 'new'"> <div v-if="website.appType == 'new'">
<el-form-item :label="$t('app.app')" prop="appinstall.appID"> <el-form-item :label="$t('app.app')" prop="appinstall.appId">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-select v-model="website.appinstall.appID" @change="getApp()"> <el-select v-model="website.appinstall.appId" @change="getApp()">
<el-option <el-option
v-for="(app, index) in apps" v-for="(app, index) in apps"
:key="index" :key="index"
@ -133,9 +133,9 @@ const website = ref({
webSiteGroupId: 1, webSiteGroupId: 1,
otherDomains: '', otherDomains: '',
appinstall: { appinstall: {
appID: 0, appId: 0,
name: '', name: '',
appDetailID: 0, appDetailId: 0,
params: {}, params: {},
version: '', version: '',
}, },
@ -144,12 +144,12 @@ let rules = ref({
primaryDomain: [Rules.requiredInput], primaryDomain: [Rules.requiredInput],
alias: [Rules.requiredInput], alias: [Rules.requiredInput],
type: [Rules.requiredInput], type: [Rules.requiredInput],
webSiteGroupID: [Rules.requiredSelectBusiness], webSiteGroupId: [Rules.requiredSelectBusiness],
appInstallID: [Rules.requiredSelectBusiness], appInstallId: [Rules.requiredSelectBusiness],
appType: [Rules.requiredInput], appType: [Rules.requiredInput],
appinstall: { appinstall: {
name: [Rules.requiredInput], name: [Rules.requiredInput],
appID: [Rules.requiredSelectBusiness], appId: [Rules.requiredSelectBusiness],
params: {}, params: {},
}, },
}); });
@ -189,14 +189,14 @@ const searchApp = () => {
SearchApp(appReq).then((res) => { SearchApp(appReq).then((res) => {
apps.value = res.data.items; apps.value = res.data.items;
if (res.data.items.length > 0) { if (res.data.items.length > 0) {
website.value.appinstall.appID = res.data.items[0].id; website.value.appinstall.appId = res.data.items[0].id;
getApp(); getApp();
} }
}); });
}; };
const getApp = () => { const getApp = () => {
GetApp(website.value.appinstall.appID).then((res) => { GetApp(website.value.appinstall.appId).then((res) => {
appVersions.value = res.data.versions; appVersions.value = res.data.versions;
if (res.data.versions.length > 0) { if (res.data.versions.length > 0) {
website.value.appinstall.version = res.data.versions[0]; website.value.appinstall.version = res.data.versions[0];
@ -206,8 +206,8 @@ const getApp = () => {
}; };
const getAppDetail = (version: string) => { const getAppDetail = (version: string) => {
GetAppDetail(website.value.appinstall.appID, version).then((res) => { GetAppDetail(website.value.appinstall.appId, version).then((res) => {
website.value.appinstall.appDetailID = res.data.id; website.value.appinstall.appDetailId = res.data.id;
appDetail.value = res.data; appDetail.value = res.data;
appParams.value = res.data.params; appParams.value = res.data.params;
paramKey.value++; paramKey.value++;