|
@@ -1,34 +1,68 @@
|
|
|
<template>
|
|
|
<div class="dataShare pagePadding">
|
|
|
- <ex-table
|
|
|
- v-loading="loading"
|
|
|
- v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
|
|
|
- :table="table"
|
|
|
- :data="tableData"
|
|
|
- :columns="columns"
|
|
|
- :page="pageInfo"
|
|
|
- :size="size"
|
|
|
- @page-curr-change="handlePageChange"
|
|
|
- @page-size-change="handleSizeChange"
|
|
|
- @screen-reset="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- searchList();
|
|
|
- "
|
|
|
- @screen-submit="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- searchList();
|
|
|
- "
|
|
|
- >
|
|
|
- <template #table-header="{}">
|
|
|
- <div style="width: 100%">
|
|
|
- <el-row :gutter="10">
|
|
|
- <el-col :span="24">
|
|
|
- <el-col
|
|
|
- :span="3"
|
|
|
- style="width: 66px; float: right"
|
|
|
- >
|
|
|
+ <div v-if="powers && powers.length > 0 && powers.some((item) => item == '001')">
|
|
|
+ <ex-table
|
|
|
+ v-loading="loading"
|
|
|
+ :table="table"
|
|
|
+ :data="tableData"
|
|
|
+ :columns="columns"
|
|
|
+ :page="pageInfo"
|
|
|
+ :size="size"
|
|
|
+ @page-curr-change="handlePageChange"
|
|
|
+ @page-size-change="handleSizeChange"
|
|
|
+ @screen-reset="
|
|
|
+ pageInfo.curr = 1;
|
|
|
+ parmValue.page = 1;
|
|
|
+ searchList();
|
|
|
+ "
|
|
|
+ @screen-submit="
|
|
|
+ pageInfo.curr = 1;
|
|
|
+ parmValue.page = 1;
|
|
|
+ searchList();
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <template #table-header="{}">
|
|
|
+ <div style="width: 100%; padding: 0 0 0 80px">
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-input
|
|
|
+ placeholder="关键字"
|
|
|
+ v-model="input"
|
|
|
+ :size="'mini'"
|
|
|
+ @blur="
|
|
|
+ pageInfo.curr = 1;
|
|
|
+ parmValue.page = 1;
|
|
|
+ searchList();
|
|
|
+ "
|
|
|
+ class="input-with-select"
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ v-model="select"
|
|
|
+ :size="'mini'"
|
|
|
+ style="width: 130px"
|
|
|
+ slot="prepend"
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="
|
|
|
+ pageInfo.curr = 1;
|
|
|
+ parmValue.page = 1;
|
|
|
+ searchList();
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-option label="数据源用户名" value="1"></el-option>
|
|
|
+ <el-option label="共享用户名" value="2"></el-option>
|
|
|
+ <el-option label="共享用户组名" value="3"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-button
|
|
|
+ slot="append"
|
|
|
+ icon="el-icon-search"
|
|
|
+ @click="
|
|
|
+ pageInfo.curr = 1;
|
|
|
+ parmValue.page = 1;
|
|
|
+ searchList();
|
|
|
+ "
|
|
|
+ ></el-button> </el-input
|
|
|
+ ></el-col>
|
|
|
+ <el-col :span="3" style="width: 66px; float: right">
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
:size="searchSize"
|
|
@@ -52,72 +86,62 @@
|
|
|
添加
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template #status="{ scope }">
|
|
|
- <el-tag
|
|
|
- :size="tablebtnSize"
|
|
|
- :type="scope.row.status == '0' ? 'warning' : ''"
|
|
|
- v-text="
|
|
|
- (statusOptions.find((item) => item.id == scope.row.status) || {})
|
|
|
- .label || '--'
|
|
|
- "
|
|
|
- ></el-tag>
|
|
|
- </template>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #status="{ scope }">
|
|
|
+ <el-tag
|
|
|
+ :size="tablebtnSize"
|
|
|
+ :type="scope.row.status == '0' ? 'warning' : ''"
|
|
|
+ v-text="
|
|
|
+ (statusOptions.find((item) => item.id == scope.row.status) || {}).label ||
|
|
|
+ '--'
|
|
|
+ "
|
|
|
+ ></el-tag>
|
|
|
+ </template>
|
|
|
|
|
|
- <template #operation="{ scope }">
|
|
|
- <el-tooltip
|
|
|
- v-if="powers.some((item) => item == '007')"
|
|
|
- effect="dark"
|
|
|
- content="详情"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-view tb-icon"
|
|
|
- @click="openModal(scope.row.id, true)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- <el-tooltip
|
|
|
- v-if="powers.some((item) => item == '005')"
|
|
|
- effect="dark"
|
|
|
- content="修改"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-edit tb-icon"
|
|
|
- @click="openModal(scope.row.id, false)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- <el-tooltip
|
|
|
- v-if="
|
|
|
- powers.some((item) => item == '004') && scope.row.status === '1'
|
|
|
- "
|
|
|
- effect="dark"
|
|
|
- content="禁用"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-video-pause tb-icon"
|
|
|
- @click="changeStatus(scope.row.id, scope.row.status)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- <el-tooltip
|
|
|
- v-if="
|
|
|
- powers.some((item) => item == '004') && scope.row.status === '0'
|
|
|
- "
|
|
|
- effect="dark"
|
|
|
- content="启用"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-video-play tb-icon"
|
|
|
- @click="changeStatus(scope.row.id, scope.row.status)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- </template>
|
|
|
- </ex-table>
|
|
|
+ <template #operation="{ scope }">
|
|
|
+ <el-tooltip
|
|
|
+ v-if="powers.some((item) => item == '007')"
|
|
|
+ effect="dark"
|
|
|
+ content="详情"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <i class="el-icon-view tb-icon" @click="openModal(scope.row.id, true)"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip
|
|
|
+ v-if="powers.some((item) => item == '005')"
|
|
|
+ effect="dark"
|
|
|
+ content="修改"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <i class="el-icon-edit tb-icon" @click="openModal(scope.row.id, false)"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip
|
|
|
+ v-if="powers.some((item) => item == '004') && scope.row.status === '1'"
|
|
|
+ effect="dark"
|
|
|
+ content="禁用"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ class="el-icon-video-pause tb-icon"
|
|
|
+ @click="changeStatus(scope.row.id, scope.row.status)"
|
|
|
+ ></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip
|
|
|
+ v-if="powers.some((item) => item == '004') && scope.row.status === '0'"
|
|
|
+ effect="dark"
|
|
|
+ content="启用"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ class="el-icon-video-play tb-icon"
|
|
|
+ @click="changeStatus(scope.row.id, scope.row.status)"
|
|
|
+ ></i>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ </ex-table>
|
|
|
+ </div>
|
|
|
<no-auth v-else></no-auth>
|
|
|
<!-- 弹窗 新增/修改 -->
|
|
|
<add-edit
|
|
@@ -132,7 +156,7 @@
|
|
|
<script>
|
|
|
import addEdit from "./addEdit";
|
|
|
import asyncRequest from "@/apis/service/interest/dataShare";
|
|
|
-import {statusList} from "@/assets/js/statusList";
|
|
|
+import { statusList } from "@/assets/js/statusList";
|
|
|
import roleLevel from "@/assets/js/roleLevel";
|
|
|
import mixinPage from "@/mixins/elPaginationHandle";
|
|
|
import { mapGetters } from "vuex";
|
|
@@ -148,9 +172,7 @@ export default {
|
|
|
...mapGetters(["tablebtnSize", "searchSize", "size"]),
|
|
|
powers() {
|
|
|
let tran =
|
|
|
- this.$store.getters.btnList.find(
|
|
|
- (item) => item.menu_route == "dataShare"
|
|
|
- ) || {};
|
|
|
+ this.$store.getters.btnList.find((item) => item.menu_route == "dataShare") || {};
|
|
|
if (tran && tran.action && tran.action.length > 0) {
|
|
|
return tran.action;
|
|
|
} else {
|
|
@@ -160,15 +182,20 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ select: "1",
|
|
|
+ input: "",
|
|
|
statusList: statusList,
|
|
|
roleLevel: roleLevel,
|
|
|
- loading: true,
|
|
|
+ loading: false,
|
|
|
showModel: false,
|
|
|
isDetail: false,
|
|
|
modelId: 0,
|
|
|
parmValue: {
|
|
|
page: 1, // 页码
|
|
|
size: 15, // 每页显示条数
|
|
|
+ source_uname: "", //数据源用户名
|
|
|
+ to_uname: "", //共享用户名
|
|
|
+ group_name: "",
|
|
|
},
|
|
|
// 状态
|
|
|
statusOptions: [
|
|
@@ -196,39 +223,42 @@ export default {
|
|
|
},
|
|
|
// 表格 - 列参数
|
|
|
columns: [
|
|
|
- {
|
|
|
- prop: "actionlist",
|
|
|
- label: "菜单数据",
|
|
|
- },
|
|
|
{
|
|
|
prop: "share_user",
|
|
|
label: "数据源用户",
|
|
|
+ width: "90px",
|
|
|
},
|
|
|
|
|
|
{
|
|
|
prop: "to_user",
|
|
|
label: "数据共享用户",
|
|
|
+ width: "100px",
|
|
|
},
|
|
|
{
|
|
|
prop: "to_group",
|
|
|
label: "数据共享用户组",
|
|
|
+ width: "110px",
|
|
|
},
|
|
|
{
|
|
|
prop: "status",
|
|
|
label: "状态",
|
|
|
- sortable: true,
|
|
|
+ width: "60px",
|
|
|
_slot_: "status",
|
|
|
},
|
|
|
+ {
|
|
|
+ prop: "actionlist",
|
|
|
+ label: "菜单数据",
|
|
|
+ },
|
|
|
{
|
|
|
prop: "addtime",
|
|
|
+ width: "145px",
|
|
|
label: "创建时间",
|
|
|
- sortable: true,
|
|
|
},
|
|
|
{
|
|
|
prop: "",
|
|
|
label: "操作",
|
|
|
fixed: "right",
|
|
|
- _noset_: true,
|
|
|
+ width: "120px",
|
|
|
_slot_: "operation",
|
|
|
},
|
|
|
],
|
|
@@ -239,6 +269,8 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
restSearch() {
|
|
|
+ this.select = "1";
|
|
|
+ this.input = "";
|
|
|
// 表格 - 分页
|
|
|
this.pageInfo = {
|
|
|
size: 15,
|
|
@@ -248,6 +280,9 @@ export default {
|
|
|
this.parmValue = {
|
|
|
page: 1, // 页码
|
|
|
size: 15, // 每页显示条数
|
|
|
+ source_uname: "", //数据源用户名
|
|
|
+ to_uname: "", //共享用户名
|
|
|
+ group_name: "",
|
|
|
};
|
|
|
this.searchList();
|
|
|
},
|
|
@@ -296,7 +331,11 @@ export default {
|
|
|
|
|
|
// 刷新表格
|
|
|
async searchList() {
|
|
|
+ if (this.loading) return;
|
|
|
this.loading = true;
|
|
|
+ this.parmValue.source_uname = this.select === "1" ? this.input : ""; //数据源用户名
|
|
|
+ this.parmValue.to_uname = this.select === "2" ? this.input : ""; //共享用户名
|
|
|
+ this.parmValue.group_name = this.select === "3" ? this.input : ""; // 共享用户组名
|
|
|
const res = await asyncRequest.list(this.parmValue);
|
|
|
if (res && res.code === 0 && res.data) {
|
|
|
this.tableData = res.data.list;
|
|
@@ -313,5 +352,4 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
-</style>
|
|
|
+<style lang="scss" scoped></style>
|