|
|
|
@ -81,8 +81,8 @@
|
|
|
|
|
label="是否有效"
|
|
|
|
|
width="80">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-tag size="mini" type="success" v-if="scope.row.valid">有效</el-tag>
|
|
|
|
|
<el-tag size="mini" type="danger" v-if="!scope.row.valid">无效</el-tag>
|
|
|
|
|
<el-tag size="mini" effect="dark" type="success" v-if="scope.row.valid">有效</el-tag>
|
|
|
|
|
<el-tag size="mini" effect="dark" type="danger" v-if="!scope.row.valid">无效</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
@ -119,15 +119,10 @@
|
|
|
|
|
width="120"
|
|
|
|
|
label="操作">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-dropdown size="mini" split-button type="primary"
|
|
|
|
|
@click="onCommand(['edit',scope.row])"
|
|
|
|
|
@command="onCommand">
|
|
|
|
|
<i class="el-icon-edit"></i>编辑
|
|
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
|
|
<el-dropdown-item :command="['delete',scope.row]" icon="el-icon-delete">删除
|
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
</el-dropdown-menu>
|
|
|
|
|
</el-dropdown>
|
|
|
|
|
<wb-dropdown>
|
|
|
|
|
<wb-dropdown-item value="编辑" icon="el-icon-edit" @click="onEdit(scope.row)"></wb-dropdown-item>
|
|
|
|
|
<wb-dropdown-item value="删除" icon="el-icon-delete" @click="onDelete(scope.row)"></wb-dropdown-item>
|
|
|
|
|
</wb-dropdown>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
@ -306,6 +301,39 @@
|
|
|
|
|
this.form.resValue = "";
|
|
|
|
|
this.form.valid = true;
|
|
|
|
|
},
|
|
|
|
|
onEdit: function (item) {
|
|
|
|
|
this.form.title = "资源编辑";
|
|
|
|
|
this.form.dialog = true;
|
|
|
|
|
this.form.id = item.id;
|
|
|
|
|
this.form.resCode = item.resCode;
|
|
|
|
|
this.form.resName = item.resName;
|
|
|
|
|
this.form.resType = item.resType;
|
|
|
|
|
this.form.resValue = item.resValue;
|
|
|
|
|
this.form.valid = item.valid;
|
|
|
|
|
this.form.rowVersion = item.rowVersion;
|
|
|
|
|
},
|
|
|
|
|
onDelete: function (item) {
|
|
|
|
|
this.$confirm('将删除该项, 是否继续?', '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(function () {
|
|
|
|
|
new Ajax()
|
|
|
|
|
.module(this.module)
|
|
|
|
|
.target(this.target)
|
|
|
|
|
.data({id: item.id})
|
|
|
|
|
.delete(function (response) {
|
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
|
} else {
|
|
|
|
|
nav.s("删除成功");
|
|
|
|
|
this.onFind();
|
|
|
|
|
}
|
|
|
|
|
}.bind(this))
|
|
|
|
|
}.bind(this)).catch(function (action) {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
onTreeCreate: function (pItem) {
|
|
|
|
|
this.form.title = "资源新增";
|
|
|
|
|
this.form.dialog = true;
|
|
|
|
@ -334,29 +362,6 @@
|
|
|
|
|
if (!value) return true;
|
|
|
|
|
return data.comment.indexOf(value) !== -1;
|
|
|
|
|
},
|
|
|
|
|
onCommand: function (arg) {
|
|
|
|
|
const cmd = arg[0];
|
|
|
|
|
const item = arg[1];
|
|
|
|
|
switch (cmd) {
|
|
|
|
|
case "edit":
|
|
|
|
|
this.form.title = "资源编辑";
|
|
|
|
|
this.form.dialog = true;
|
|
|
|
|
this.form.id = item.id;
|
|
|
|
|
this.form.resCode = item.resCode;
|
|
|
|
|
this.form.resName = item.resName;
|
|
|
|
|
this.form.resType = item.resType;
|
|
|
|
|
this.form.resValue = item.resValue;
|
|
|
|
|
this.form.valid = item.valid;
|
|
|
|
|
this.form.rowVersion = item.rowVersion;
|
|
|
|
|
break;
|
|
|
|
|
case "delete":
|
|
|
|
|
this.onDelete(item);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
nav.w("未找到对应的命令");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onLoadTree: function () {
|
|
|
|
|
new Ajax()
|
|
|
|
|
.module("system")
|
|
|
|
|