|
@@ -23,18 +23,17 @@
|
|
|
value-name="code"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="应用代码" prop="appCode">
|
|
|
+ <!--<el-form-item label="应用代码" prop="appId">
|
|
|
<el-input
|
|
|
- clearable
|
|
|
- disabled
|
|
|
+ readonly
|
|
|
maxlength="50"
|
|
|
- placeholder=""
|
|
|
- v-model.trim="sizeForm.appCode"
|
|
|
+ placeholder="在此显示应用代码,不可修改"
|
|
|
+ v-model.trim="sizeForm.appId"
|
|
|
:data="appData"
|
|
|
- label-name="appCode"
|
|
|
- value-name="appCode"
|
|
|
+ label-name="appId"
|
|
|
+ value-name="code"
|
|
|
/>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item>-->
|
|
|
<el-form-item label="服务名称" prop="serviceName">
|
|
|
<dg-select
|
|
|
clearable
|
|
@@ -52,10 +51,9 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="服务代码" prop="serviceCode">
|
|
|
<el-input
|
|
|
- clearable
|
|
|
- disabled
|
|
|
+ placeholder="在此显示服务代码,不可修改"
|
|
|
maxlength="50"
|
|
|
- placeholder=""
|
|
|
+ readonly
|
|
|
:data="serviceData"
|
|
|
label-name="serviceCode"
|
|
|
v-model.trim="sizeForm.serviceCode"
|
|
@@ -73,11 +71,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {dropMenu, getAppName, save} from "@/api/service-delegate";
|
|
|
+import {dropMenu, getAppName, patch, save} from "@/api/service-delegate";
|
|
|
|
|
|
export default {
|
|
|
name: "delegate-dialog",
|
|
|
props: {
|
|
|
+ id: String,
|
|
|
type: {
|
|
|
type: String,
|
|
|
default: "create"
|
|
@@ -90,9 +89,9 @@ export default {
|
|
|
list: [],
|
|
|
loading: false,
|
|
|
sizeForm: {
|
|
|
- appName: "",
|
|
|
- appCode: "",
|
|
|
serviceName: "",
|
|
|
+ appName: "",
|
|
|
+ appId: "",
|
|
|
serviceCode: "",
|
|
|
},
|
|
|
appData: [],
|
|
@@ -120,16 +119,22 @@ export default {
|
|
|
handleSave() {
|
|
|
const that = this;
|
|
|
const sizeForm = {...this.sizeForm};
|
|
|
- // const api = that.type === "create" ? "save" : "update";
|
|
|
+ // const api = that.type === "create" ? "save" : "patch";
|
|
|
this.$refs.ruleForm.validate(valid => {
|
|
|
if (!valid) {
|
|
|
return;
|
|
|
}
|
|
|
- save(sizeForm).then(() => {
|
|
|
- that.handleClose(true);
|
|
|
- that.$message.success("保存成功");
|
|
|
- })
|
|
|
- .catch(error => that.$message.error({message: error}));
|
|
|
+ if (that.type === "create") {
|
|
|
+ save(sizeForm).then(() => {
|
|
|
+ that.handleClose(true);
|
|
|
+ that.$message.success("保存成功");
|
|
|
+ }).catch(error => that.$message.error({message: error}));
|
|
|
+ } else {
|
|
|
+ patch(that.id, sizeForm).then(() => {
|
|
|
+ that.handleClose(true);
|
|
|
+ that.$message.success("修改成功");
|
|
|
+ }).catch(error => that.$message.error({message: error}));
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
remoteSvcNameMethod(query) {
|
|
@@ -160,7 +165,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
changeAppName(val) {
|
|
|
- this.sizeForm.appCode = val
|
|
|
+ this.sizeForm.appId = val
|
|
|
console.log(val, this.sizeForm)
|
|
|
},
|
|
|
changeSvcName(val) {
|