|
@@ -0,0 +1,152 @@
|
|
|
+<template>
|
|
|
+ <el-container>
|
|
|
+ <el-header>
|
|
|
+ <div class="left-panel">
|
|
|
+ <el-button type="primary" icon="el-icon-plus" @click="add"
|
|
|
+ >{{ $t("create") }}
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <el-form ref="form" class="right-panel">
|
|
|
+ <div class="right-panel-search">
|
|
|
+ <el-input
|
|
|
+ v-model="search.keyword"
|
|
|
+ clearable
|
|
|
+ style="width: 320px"
|
|
|
+ :placeholder="$t('pleaseInput')"
|
|
|
+ >
|
|
|
+ <template #prepend>
|
|
|
+ {{$t('admin.adminRoleName')}}
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
+ <el-button type="primary" icon="el-icon-search" @click="upsearch">{{
|
|
|
+ $t("query")
|
|
|
+ }}</el-button>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ </el-header>
|
|
|
+ <el-main class="nopadding">
|
|
|
+ <scTable
|
|
|
+ ref="table"
|
|
|
+ :apiObj="apiObj"
|
|
|
+ :pageSize="10"
|
|
|
+ row-key="RoleCode"
|
|
|
+ @selection-change="selectionChange"
|
|
|
+ stripe
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('admin.adminRoleName')"
|
|
|
+ prop="RoleName"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('response.description')"
|
|
|
+ prop="Description"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('admin.roleUserNum')"
|
|
|
+ prop="AdminNum"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('operate')"
|
|
|
+ fixed="right"
|
|
|
+ align="center"
|
|
|
+ width="120"
|
|
|
+ >
|
|
|
+ <template #default="scope">
|
|
|
+ <!-- 编辑 -->
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="table_edit(scope.row, scope.$index)"
|
|
|
+ >{{ $t("edit") }}</el-button
|
|
|
+ >
|
|
|
+ <!-- 删除 -->
|
|
|
+ <el-popconfirm
|
|
|
+ :title="confirmDel"
|
|
|
+ @confirm="table_del(scope.row, scope.$index)"
|
|
|
+ >
|
|
|
+ <template #reference>
|
|
|
+ <el-button type="text" size="small">{{
|
|
|
+ $t("delete")
|
|
|
+ }}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </scTable>
|
|
|
+ </el-main>
|
|
|
+ </el-container>
|
|
|
+
|
|
|
+ <save-dialog
|
|
|
+ v-if="dialog.show"
|
|
|
+ ref="saveDialog"
|
|
|
+ @success="refresh"
|
|
|
+ @closed="dialog.show = false"
|
|
|
+ ></save-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import saveDialog from "./saveAdmin";
|
|
|
+
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ saveDialog,
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ dialog: {
|
|
|
+ show: false,
|
|
|
+ },
|
|
|
+ apiObj: this.query,
|
|
|
+ search: {
|
|
|
+ keyword: null
|
|
|
+ },
|
|
|
+ confirmDel: this.$t("admin.adminConfirmDelete"),
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async query(params) {
|
|
|
+ return await this.$API.adminManage.adminRoleList.post(params);
|
|
|
+ },
|
|
|
+ //搜索
|
|
|
+ upsearch() {
|
|
|
+ this.$refs.table.upData(this.search);
|
|
|
+ },
|
|
|
+ //刷新当前页
|
|
|
+ refresh() {
|
|
|
+ this.$refs.table.refresh();
|
|
|
+ },
|
|
|
+ //增加
|
|
|
+ add() {
|
|
|
+ this.dialog.show = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.saveDialog.open();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //编辑
|
|
|
+ table_edit(row) {
|
|
|
+ this.dialog.show = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.saveDialog.open("edit").setData(row);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //删除
|
|
|
+ async table_del(row) {
|
|
|
+ await this.$API.wing.post(
|
|
|
+ "RemoveAdminAsync",
|
|
|
+ {
|
|
|
+ AdminCode: row.AdminCode,
|
|
|
+ },
|
|
|
+ this.refresh
|
|
|
+ );
|
|
|
+ },
|
|
|
+ //表格选择后回调事件
|
|
|
+ selectionChange(selection) {
|
|
|
+ this.selection = selection;
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+</style>
|