|
|
@@ -14,6 +14,11 @@
|
|
|
<el-input type="textarea" autosize v-model="form.value" :placeholder="$t(`分类名称`)"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="20" v-if="issubvaluemag == 1">
|
|
|
+ <el-form-item :label="$t(`二级分类`)+':'" prop="value">
|
|
|
+ <el-input type="textarea" v-model="form.subvalues" :placeholder="$t(`二级分类名称`)" :rows="3"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="20">
|
|
|
<el-form-item :label="$t(`描述`)+':'" prop="remarks">
|
|
|
<el-input type="text" autosize v-model="form.remarks" :placeholder="$t(`描述`)"></el-input>
|
|
|
@@ -34,7 +39,7 @@
|
|
|
<script>
|
|
|
export default {
|
|
|
name: "edit",
|
|
|
- props:["data","classname"],
|
|
|
+ props:["data","classname","issubvaluemag"],
|
|
|
data(){
|
|
|
return {
|
|
|
drawer:false,
|
|
|
@@ -44,7 +49,8 @@ export default {
|
|
|
isused: "1",
|
|
|
value:'',
|
|
|
remarks:'',
|
|
|
- sequence:2
|
|
|
+ sequence:2,
|
|
|
+ subvalues:[]
|
|
|
},
|
|
|
rules:{
|
|
|
value:[
|
|
|
@@ -60,11 +66,15 @@ export default {
|
|
|
this.form.optiontypeid = this.data.optiontypeid
|
|
|
this.form.value = this.data.value
|
|
|
this.form.remarks = this.data.remarks
|
|
|
+ this.form.subvalues = this.data.subvalues
|
|
|
|
|
|
},
|
|
|
onSubmit(){
|
|
|
this.$refs['form'].validate(async (valid) => {
|
|
|
if (!valid) return false
|
|
|
+ if (typeof (this.form.subvalues) == 'string'){
|
|
|
+ this.form.subvalues = this.form.subvalues.split(',')
|
|
|
+ }
|
|
|
const res = await this.$api.requested({ "id": 20220901092601,content:this.form})
|
|
|
this.tool.showMessage(res,()=>{
|
|
|
this.drawer = false
|