|
@@ -43,9 +43,10 @@
|
|
icon-class="el-icon-folder-opened"
|
|
icon-class="el-icon-folder-opened"
|
|
icon-leaf="el-icon-document"
|
|
icon-leaf="el-icon-document"
|
|
v-model="form.parentId"
|
|
v-model="form.parentId"
|
|
- placeholder="请选择"
|
|
|
|
:props="parentTreeProps"
|
|
:props="parentTreeProps"
|
|
:data="treeData"
|
|
:data="treeData"
|
|
|
|
+ :placeholder="form.isRoot?'':'请选择'"
|
|
|
|
+ :disabled="form.isRoot"
|
|
clearable
|
|
clearable
|
|
filterable
|
|
filterable
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
@@ -167,6 +168,7 @@ export default {
|
|
this.isShowForm = true;
|
|
this.isShowForm = true;
|
|
this.changeRuleTrigger("blur");
|
|
this.changeRuleTrigger("blur");
|
|
this.form = {
|
|
this.form = {
|
|
|
|
+ isRoot: true,
|
|
appId: this.app.id,
|
|
appId: this.app.id,
|
|
appName: this.app.applyName,
|
|
appName: this.app.applyName,
|
|
code: "",
|
|
code: "",
|
|
@@ -208,12 +210,15 @@ export default {
|
|
if (valid) {
|
|
if (valid) {
|
|
const { code, parentId } = this.form;
|
|
const { code, parentId } = this.form;
|
|
if (code == parentId) {
|
|
if (code == parentId) {
|
|
- that.$message.error("上级资源不能是自己!");
|
|
|
|
|
|
+ this.$message.error("上级资源不能是自己!");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ const data= {...this.form} ;
|
|
|
|
+ delete data.isRoot;
|
|
|
|
+
|
|
const api = this.form.id ? "update" : "save";
|
|
const api = this.form.id ? "update" : "save";
|
|
- Api[api](this.form)
|
|
|
|
|
|
+ Api[api](data)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
this.$message.success("保存成功!");
|
|
this.$message.success("保存成功!");
|
|
this.timer = new Date().getTime(); // 刷新树组件
|
|
this.timer = new Date().getTime(); // 刷新树组件
|