<el-form :model="ThreeParams" ref="threeAddFun" :rules="rules3" class="demo-form-inline">
<el-form-item label="功能名称" prop="functionName" class="funcName">
<el-input v-model="ThreeParams.functionName" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="所属应用id" prop="ownerApplicationId">
<el-select v-model="ThreeParams.ownerApplicationId" placeholder="Select" @change="appChange">
<el-option v-for="item in appOption" :label="item.name" :key="item.guid" :value="item.guid"></el-option>
</el-select>
</el-form-item>
rules3: {
functionName: [
{ required: true, message: "功能名称不能为空", trigger: "blur" },
],
ownerApplicationId: [
{ required: true, message: "所属应用id不能为空", trigger: "blur" },
],
ownerFunctionId: [
{ required: true, message: "所属功能id不能为空", trigger: "blur" },
],
configHardware: [
{ required: true, message: "是否配备硬件不能为空", trigger: "blur" },
],
functionDesc: [
{ required: true, message: "功能介绍不能为空", trigger: "blur" },
],
},
addSureFun() {
this.$refs["threeAddFun"].validate((valid) => {
if (valid) {
this.ThreeParams.productId = this.guid;
let params = {
functionName: this.ThreeParams.functionName,
productId: this.guid,
ownerApplicationId: this.ThreeParams.ownerApplicationId,
ownerFunctionId: this.ThreeParams.ownerFunctionId,
defaultOptional: parseInt(this.ThreeParams.defaultOptional),
businessStatement: '说明',
functionDesc: this.ThreeParams.functionDesc,
configHardware: parseInt(this.ThreeParams.configHardware),
configVirtualSpace: 1,
configRedPacket: 1,
}
if (this.threeFunName == '新增功能') {
addFunc(params).then(res => {
if (res.code == 200) {
this.funParams.productId = this.guid;
funList(this.funParams).then((res) => {
this.functionData = res.rows
this.msgSuccess("新增成功");
this.addThreeFun = false
});
}
})
} else {
params.guid = this.FuncGuid
updateFunc(params).then(res => {
if (res.code == 200) {
this.funParams.productId = this.guid;
funList(this.funParams).then((res) => {
this.functionData = res.rows
this.msgSuccess("编辑成功");
this.addThreeFun = false
});
}
})
}
} else {
}
});
},