|
|
|
@@ -23,7 +23,7 @@ |
|
|
|
<div class="cluster-type-btn" v-if="type != 1 || type == 1 && state.type === 0" |
|
|
|
:class="state.type === 0 ? 'focused' : ''" |
|
|
|
:style="type != 1 ? 'border-top-right-radius:unset;border-bottom-right-radius:unset;' : ''" |
|
|
|
@click="state.type = 0;state.engine='0'"> |
|
|
|
@click="state.type = 0; state.engine = '0'"> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" |
|
|
|
class="icon styles__StyledSVGIconPathComponent-sc-16fsqc8-0 cSaWDI svg-icon-path-icon fill" |
|
|
|
viewBox="0 0 32 32" width="16" height="16"> |
|
|
|
@@ -39,7 +39,7 @@ |
|
|
|
<div class="cluster-type-btn" v-if="type != 1 || type == 1 && state.type === 1" |
|
|
|
:class="state.type === 1 ? 'focused' : ''" |
|
|
|
:style="type != 1 ? 'border-top-left-radius:unset;border-bottom-left-radius:unset;' : ''" |
|
|
|
@click="state.type = 1;state.engine='2'"> |
|
|
|
@click="state.type = 1; state.engine = '2'"> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" |
|
|
|
class="icon styles__StyledSVGIconPathComponent-sc-16fsqc8-0 iKfgJk svg-icon-path-icon fill" |
|
|
|
viewBox="0 0 32 32" width="16" height="16"> |
|
|
|
@@ -54,10 +54,11 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="row"> |
|
|
|
<div class="row" :class="nameErr ? 'error' : ''"> |
|
|
|
<div class="r-title"><label class="required">{{ $t('modelManage.modelName') }}</label></div> |
|
|
|
<div class="r-content"> |
|
|
|
<el-input size="medium" :maxLength="25" v-model="state.name" :placeholder="$t('modelManage.pleaseInputModelName')"> |
|
|
|
<el-input size="medium" :maxLength="25" v-model="state.name" @blur="checkName" |
|
|
|
:placeholder="$t('modelManage.pleaseInputModelName')"> |
|
|
|
</el-input> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@@ -80,8 +81,8 @@ |
|
|
|
<div class="row"> |
|
|
|
<div class="r-title"><label>{{ $t('modelManage.modelLabel') }}</label></div> |
|
|
|
<div class="r-content"> |
|
|
|
<el-input size="medium" :maxLength="255" v-model="state.label" :placeholder="$t('modelManage.modelLabelInputTips')" |
|
|
|
@input="labelInput"></el-input> |
|
|
|
<el-input size="medium" :maxLength="255" v-model="state.label" |
|
|
|
:placeholder="$t('modelManage.modelLabelInputTips')" @input="labelInput"></el-input> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="row" style="align-items:flex-start;"> |
|
|
|
@@ -95,7 +96,9 @@ |
|
|
|
<div class="row" style="margin-top:20px"> |
|
|
|
<div class="r-title"><label></label></div> |
|
|
|
<div class="r-content"> |
|
|
|
<el-button size="medium" class="green" @click="submit">{{ type == '1' ? $t('modelManage.confirm') : $t('modelManage.createModel') }} |
|
|
|
<el-button size="medium" class="green" @click="submit">{{ type == '1' ? $t('modelManage.confirm') : |
|
|
|
$t('modelManage.createModel') |
|
|
|
}} |
|
|
|
</el-button> |
|
|
|
<el-button size="medium" @click="cancel">{{ $t('modelManage.cancel') }}</el-button> |
|
|
|
</div> |
|
|
|
@@ -127,23 +130,28 @@ export default { |
|
|
|
label: '', |
|
|
|
description: '', |
|
|
|
}, |
|
|
|
nameErr: false, |
|
|
|
isShowVersion: false, |
|
|
|
engineList: MODEL_ENGINES, |
|
|
|
}; |
|
|
|
}, |
|
|
|
components: {}, |
|
|
|
methods: { |
|
|
|
checkName() { |
|
|
|
this.nameErr = !this.state.name; |
|
|
|
return !this.nameErr; |
|
|
|
}, |
|
|
|
labelInput() { |
|
|
|
const hasEndSpace = this.state.label[this.state.label.length - 1] == ' '; |
|
|
|
const list = this.state.label.trim().split(' ').filter(label => label != ''); |
|
|
|
this.state.label = list.slice(0, MAX_LABEL_COUNT).join(' ') + (hasEndSpace && list.length < MAX_LABEL_COUNT ? ' ' : ''); |
|
|
|
}, |
|
|
|
submit() { |
|
|
|
if (!this.state.name) { |
|
|
|
this.$message({ |
|
|
|
type: 'info', |
|
|
|
message: this.$t('modelManage.pleaseInputModelName'), |
|
|
|
}); |
|
|
|
if (!this.checkName()) { |
|
|
|
// this.$message({ |
|
|
|
// type: 'info', |
|
|
|
// message: this.$t('modelManage.pleaseInputModelName'), |
|
|
|
// }); |
|
|
|
return; |
|
|
|
} |
|
|
|
const submintApi = this.type == '1' ? modifyModel : saveLocalModel; |
|
|
|
@@ -161,6 +169,11 @@ export default { |
|
|
|
list.pop(); |
|
|
|
list.push('create_local_model_2'); |
|
|
|
window.location.href = list.join('/') + '?type=0&name=' + this.state.name + '&id=' + res.id; |
|
|
|
} if (res && res.code == '-1') { |
|
|
|
this.$message({ |
|
|
|
type: 'error', |
|
|
|
message: res.msg, |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.$message({ |
|
|
|
type: 'error', |
|
|
|
@@ -325,6 +338,24 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
&.error { |
|
|
|
.r-title { |
|
|
|
color: #9f3a38; |
|
|
|
} |
|
|
|
|
|
|
|
.r-content { |
|
|
|
/deep/.el-input__inner { |
|
|
|
color: #9f3a38; |
|
|
|
background: #fff6f6; |
|
|
|
border-color: #e0b4b4; |
|
|
|
|
|
|
|
&::placeholder { |
|
|
|
color: #e0b4b4; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.r-content { |
|
|
|
flex: 1; |
|
|
|
|
|
|
|
|