权限控制

This commit is contained in:
季圣华
2021-05-18 20:18:30 +08:00
parent ba4819f3a8
commit a3a1d64c26
52 changed files with 424 additions and 206 deletions

View File

@@ -31,10 +31,10 @@
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
批量操作 <a-icon type="down" />
@@ -55,13 +55,13 @@
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a-popconfirm title="确定设为默认吗?" @confirm="() => handleSetDefault(record.id)">
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定设为默认吗?" @confirm="() => handleSetDefault(record.id)">
<a>设为默认</a>
</a-popconfirm>
<a-divider type="vertical" />
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
@@ -145,6 +145,14 @@
that.$message.warning(res.data.message);
}
});
},
handleEdit: function (record) {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
if(this.btnEnableList.indexOf(1)===-1) {
this.$refs.modalForm.isReadOnly = true
}
}
}
}