提交 6440804d authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

feat: 仪表盘分享页面

上级 cdbc7ea9
...@@ -347,6 +347,10 @@ ...@@ -347,6 +347,10 @@
<groupId>log4j</groupId> <groupId>log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j</artifactId>
</exclusion> </exclusion>
<exclusion>
<groupId>org.objenesis</groupId>
<artifactId>objenesis</artifactId>
</exclusion>
</exclusions> </exclusions>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
......
...@@ -13,5 +13,7 @@ public class PanelShare implements Serializable { ...@@ -13,5 +13,7 @@ public class PanelShare implements Serializable {
private Long createTime; private Long createTime;
private Integer type;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -353,6 +353,66 @@ public class PanelShareExample { ...@@ -353,6 +353,66 @@ public class PanelShareExample {
addCriterion("create_time not between", value1, value2, "createTime"); addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTypeIsNull() {
addCriterion("`type` is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("`type` is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(Integer value) {
addCriterion("`type` =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Integer value) {
addCriterion("`type` <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Integer value) {
addCriterion("`type` >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("`type` >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(Integer value) {
addCriterion("`type` <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Integer value) {
addCriterion("`type` <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<Integer> values) {
addCriterion("`type` in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> values) {
addCriterion("`type` not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Integer value1, Integer value2) {
addCriterion("`type` between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Integer value1, Integer value2) {
addCriterion("`type` not between", value1, value2, "type");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<result column="panel_group_id" jdbcType="VARCHAR" property="panelGroupId" /> <result column="panel_group_id" jdbcType="VARCHAR" property="panelGroupId" />
<result column="user_id" jdbcType="BIGINT" property="userId" /> <result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" /> <result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="type" jdbcType="INTEGER" property="type" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
...@@ -66,7 +67,7 @@ ...@@ -66,7 +67,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
share_id, panel_group_id, user_id, create_time share_id, panel_group_id, user_id, create_time, `type`
</sql> </sql>
<select id="selectByExample" parameterType="io.dataease.base.domain.PanelShareExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="io.dataease.base.domain.PanelShareExample" resultMap="BaseResultMap">
select select
...@@ -100,9 +101,9 @@ ...@@ -100,9 +101,9 @@
</delete> </delete>
<insert id="insert" parameterType="io.dataease.base.domain.PanelShare"> <insert id="insert" parameterType="io.dataease.base.domain.PanelShare">
insert into panel_share (share_id, panel_group_id, user_id, insert into panel_share (share_id, panel_group_id, user_id,
create_time) create_time, `type`)
values (#{shareId,jdbcType=BIGINT}, #{panelGroupId,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, values (#{shareId,jdbcType=BIGINT}, #{panelGroupId,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT},
#{createTime,jdbcType=BIGINT}) #{createTime,jdbcType=BIGINT}, #{type,jdbcType=INTEGER})
</insert> </insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.PanelShare"> <insert id="insertSelective" parameterType="io.dataease.base.domain.PanelShare">
insert into panel_share insert into panel_share
...@@ -119,6 +120,9 @@ ...@@ -119,6 +120,9 @@
<if test="createTime != null"> <if test="createTime != null">
create_time, create_time,
</if> </if>
<if test="type != null">
`type`,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="shareId != null"> <if test="shareId != null">
...@@ -133,6 +137,9 @@ ...@@ -133,6 +137,9 @@
<if test="createTime != null"> <if test="createTime != null">
#{createTime,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT},
</if> </if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="io.dataease.base.domain.PanelShareExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="io.dataease.base.domain.PanelShareExample" resultType="java.lang.Long">
...@@ -156,6 +163,9 @@ ...@@ -156,6 +163,9 @@
<if test="record.createTime != null"> <if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
</if> </if>
<if test="record.type != null">
`type` = #{record.type,jdbcType=INTEGER},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -166,7 +176,8 @@ ...@@ -166,7 +176,8 @@
set share_id = #{record.shareId,jdbcType=BIGINT}, set share_id = #{record.shareId,jdbcType=BIGINT},
panel_group_id = #{record.panelGroupId,jdbcType=VARCHAR}, panel_group_id = #{record.panelGroupId,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=BIGINT}, user_id = #{record.userId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=BIGINT} create_time = #{record.createTime,jdbcType=BIGINT},
`type` = #{record.type,jdbcType=INTEGER}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -183,6 +194,9 @@ ...@@ -183,6 +194,9 @@
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
</if> </if>
<if test="type != null">
`type` = #{type,jdbcType=INTEGER},
</if>
</set> </set>
where share_id = #{shareId,jdbcType=BIGINT} where share_id = #{shareId,jdbcType=BIGINT}
</update> </update>
...@@ -190,7 +204,8 @@ ...@@ -190,7 +204,8 @@
update panel_share update panel_share
set panel_group_id = #{panelGroupId,jdbcType=VARCHAR}, set panel_group_id = #{panelGroupId,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=BIGINT}, user_id = #{userId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=BIGINT} create_time = #{createTime,jdbcType=BIGINT},
`type` = #{type,jdbcType=INTEGER}
where share_id = #{shareId,jdbcType=BIGINT} where share_id = #{shareId,jdbcType=BIGINT}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
...@@ -11,4 +11,6 @@ public interface ExtPanelShareMapper { ...@@ -11,4 +11,6 @@ public interface ExtPanelShareMapper {
int batchInsert(List<PanelShare> shares); int batchInsert(List<PanelShare> shares);
List<PanelShareDto> query(GridExample example); List<PanelShareDto> query(GridExample example);
List<PanelShare> queryWithResource(GridExample example);
} }
...@@ -32,6 +32,18 @@ ...@@ -32,6 +32,18 @@
</select> </select>
<select id="queryWithResource" parameterType="io.dataease.base.mapper.ext.query.GridExample" resultMap="io.dataease.base.mapper.PanelShareMapper.BaseResultMap">
select from panel_share
<if test="_parameter != null">
<include refid="io.dataease.base.mapper.ext.query.GridSql.gridCondition" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
......
package io.dataease.controller.panel.api; package io.dataease.controller.panel.api;
import io.dataease.base.domain.PanelShare;
import io.dataease.controller.request.panel.PanelShareRequest; import io.dataease.controller.request.panel.PanelShareRequest;
import io.dataease.controller.sys.base.BaseGridRequest; import io.dataease.controller.sys.base.BaseGridRequest;
import io.dataease.dto.panel.PanelShareDto; import io.dataease.dto.panel.PanelShareDto;
...@@ -25,5 +26,10 @@ public interface ShareApi { ...@@ -25,5 +26,10 @@ public interface ShareApi {
@PostMapping("/treeList") @PostMapping("/treeList")
List<PanelShareDto> treeList(BaseGridRequest request); List<PanelShareDto> treeList(BaseGridRequest request);
@ApiOperation("根据资源查询分享")
@PostMapping("/queryWithResourceId")
List<PanelShare> queryWithResourceId(BaseGridRequest request);
} }
package io.dataease.controller.panel.server; package io.dataease.controller.panel.server;
import io.dataease.base.domain.PanelShare;
import io.dataease.controller.panel.api.ShareApi; import io.dataease.controller.panel.api.ShareApi;
import io.dataease.controller.request.panel.PanelShareRequest; import io.dataease.controller.request.panel.PanelShareRequest;
import io.dataease.controller.sys.base.BaseGridRequest; import io.dataease.controller.sys.base.BaseGridRequest;
import io.dataease.dto.panel.PanelShareDto; import io.dataease.dto.panel.PanelShareDto;
import io.dataease.service.panel.ShareService; import io.dataease.service.panel.ShareService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
@RestController
public class ShareServer implements ShareApi { public class ShareServer implements ShareApi {
@Resource @Resource
...@@ -23,4 +27,10 @@ public class ShareServer implements ShareApi { ...@@ -23,4 +27,10 @@ public class ShareServer implements ShareApi {
public List<PanelShareDto> treeList(@RequestBody BaseGridRequest request) { public List<PanelShareDto> treeList(@RequestBody BaseGridRequest request) {
return shareService.queryTree(request); return shareService.queryTree(request);
} }
@Override
public List<PanelShare> queryWithResourceId(@RequestBody BaseGridRequest request) {
return shareService.queryWithResource(request);
}
} }
...@@ -90,5 +90,10 @@ public class ShareService { ...@@ -90,5 +90,10 @@ public class ShareService {
return map.entrySet().stream().map(entry -> PanelShareDto.builder().name(entry.getKey()).children(entry.getValue()).build()).collect(Collectors.toList()); return map.entrySet().stream().map(entry -> PanelShareDto.builder().name(entry.getKey()).children(entry.getValue()).build()).collect(Collectors.toList());
} }
public List<PanelShare> queryWithResource(BaseGridRequest request){
GridExample example = request.convertExample();
return extPanelShareMapper.queryWithResource(example);
}
} }
...@@ -58,6 +58,8 @@ spring.cache.ehcache.config=classpath:/ehcache/ehcache.xml ...@@ -58,6 +58,8 @@ spring.cache.ehcache.config=classpath:/ehcache/ehcache.xml
logging.level.org.springframework.web=trace logging.level.org.springframework.web=trace
logging.level.org.springframework.boot.web=trace logging.level.org.springframework.boot.web=trace
spring.mvc.log-request-details=true spring.mvc.log-request-details=true
pagehelper.PageRowBounds=true
...@@ -88,9 +88,12 @@ CREATE TABLE `panel_share` ( ...@@ -88,9 +88,12 @@ CREATE TABLE `panel_share` (
`panel_group_id` varchar(50) DEFAULT NULL COMMENT '仪表板ID', `panel_group_id` varchar(50) DEFAULT NULL COMMENT '仪表板ID',
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID', `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
`create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期',
`type` int(8) DEFAULT NULL COMMENT '类型',
PRIMARY KEY (`share_id`) USING BTREE, PRIMARY KEY (`share_id`) USING BTREE,
UNIQUE KEY `UK_share_user_id` (`user_id`) USING BTREE, UNIQUE KEY `UK_share_user_id` (`user_id`) USING BTREE,
UNIQUE KEY `UK_share_panel_group_id` (`panel_group_id`) USING BTREE UNIQUE KEY `UK_share_panel_group_id` (`panel_group_id`) USING BTREE,
UNIQUE KEY `UK_share_type` (`type`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='仪表板分享'; ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='仪表板分享';
......
...@@ -600,10 +600,10 @@ export default { ...@@ -600,10 +600,10 @@ export default {
}, },
methods: { methods: {
removeView(){ removeView() {
debugger debugger
console.log(this.viewId); console.log(this.viewId)
this.$emit('removeView',this.viewId) this.$emit('removeView', this.viewId)
}, },
// 重置边界和鼠标状态 // 重置边界和鼠标状态
resetBoundsAndMouseState() { resetBoundsAndMouseState() {
......
...@@ -8,15 +8,13 @@ import i18n from './lang' // internationalization ...@@ -8,15 +8,13 @@ import i18n from './lang' // internationalization
import App from './App' import App from './App'
import store from './store' import store from './store'
import router from './router' import router from './router'
import message from './utils/message'
import '@/icons' // icon import '@/icons' // icon
import '@/permission' // permission control import '@/permission' // permission control
import api from '@/api/index.js' import api from '@/api/index.js'
import filter from '@/filter/filter' import filter from '@/filter/filter'
import directives from './directive' import directives from './directive'
import './styles/vdrr/common-temp.scss'
import vdrr from './components/vue-drag-resize-rotate' import vdrr from './components/vue-drag-resize-rotate'
Vue.component('vdrr', vdrr) Vue.component('vdrr', vdrr)
...@@ -27,7 +25,7 @@ import * as echarts from 'echarts' ...@@ -27,7 +25,7 @@ import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts Vue.prototype.$echarts = echarts
import UmyUi from 'umy-ui' import UmyUi from 'umy-ui'
import 'umy-ui/lib/theme-chalk/index.css'// 引入样式
Vue.use(UmyUi) Vue.use(UmyUi)
/** /**
...@@ -55,6 +53,7 @@ Vue.use(Fit2CloudUI, { ...@@ -55,6 +53,7 @@ Vue.use(Fit2CloudUI, {
}) })
Vue.use(filter) Vue.use(filter)
Vue.use(directives) Vue.use(directives)
Vue.use(message)
Vue.config.productionTip = false Vue.config.productionTip = false
new Vue({ new Vue({
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
const getDefaultState = () => { const getDefaultState = () => {
return { return {
panelName: '', panelName: '',
panelInfo:{ panelInfo: {
name:'' name: ''
} }
} }
} }
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
@import './sidebar.scss'; @import './sidebar.scss';
@import './topbar.scss'; @import './topbar.scss';
@import "~fit2cloud-ui/src/styles/index.scss"; @import "~fit2cloud-ui/src/styles/index.scss";
@import './vdrr/common-temp.scss';
@import '~umy-ui/lib/theme-chalk/index.css';// 引入样式
// @import '../metersphere/common/css/index.css'; // @import '../metersphere/common/css/index.css';
...@@ -69,3 +71,42 @@ div:focus { ...@@ -69,3 +71,42 @@ div:focus {
.app-container { .app-container {
padding: 20px; padding: 20px;
} }
.de-dialog {
width: 30% !important;
.el-dialog__header{
background-color: #f4f4f5;
padding: 10px 20px !important;
}
.el-dialog__body{
padding: 1px 20px !important;
}
}
.de-search-header {
.el-tabs__header{
display: none !important;;
}
}
.de-input{
margin-bottom: 14px;
margin-top: 10px;
.el-input{
.el-input__inner {
line-height: 30px !important;
height: 30px !important;
border-right: none;
}
}
.el-input__inner:focus{
border-color: #E6E6E6 !important;
}
.el-input-group__append {
background-color: #ffffff;
}
}
...@@ -14,7 +14,7 @@ const RefreshTokenKey = Config.RefreshTokenKey ...@@ -14,7 +14,7 @@ const RefreshTokenKey = Config.RefreshTokenKey
const service = axios.create({ const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests // withCredentials: true, // send cookies when cross-domain requests
timeout: 5000 // request timeout timeout: 10000 // request timeout
}) })
// request interceptor // request interceptor
......
<template>
<div class="my_table">
<el-table
ref="table"
:data="data"
lazy
:show-header="true"
:load="loadExpandDatas"
style="width: 100%"
:row-style="{height: '35px'}"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
row-key="deptId"
>
<el-table-column label="所有组织" prop="name" />
<el-table-column type="selection" fixd />
<!-- <el-table-column label="分享给" prop="deptId" width="80" fixed="right">
<template slot-scope="scope">
<el-checkbox :v-model="scope.row.deptId===0" />
</template>
</el-table-column> -->
</el-table>
</div>
</template>
<script>
import { getDeptTree, loadTable } from '@/api/system/dept'
import { formatCondition } from '@/utils/index'
export default {
name: 'GrantDept',
props: {
resourceId: {
type: String,
default: null
}
},
data() {
return {
data: [],
defaultCondition: {
field: 'pid',
operator: 'eq',
value: 0
}
// maps: new Map()
}
},
created() {
this.search()
},
methods: {
// 加载下一级子节点数据
loadExpandDatas(row, treeNode, resolve) {
getDeptTree(row.deptId).then(res => {
let data = res.data
data = data.map(obj => {
if (obj.subCount > 0) {
obj.hasChildren = true
}
return obj
})
// this.maps.set(row.deptId, { row, treeNode, resolve })
resolve && resolve(data)
})
},
// 加载表格数据
search(condition) {
// this.setTableAttr()
this.data = []
let param = {}
if (condition && condition.quick) {
const con = this.quick_condition(condition)
param = formatCondition(con)
} else {
param = { conditions: [this.defaultCondition] }
}
// param.conditions.push(this.defaultCondition)
loadTable(param).then(res => {
let data = res.data
data = data.map(obj => {
if (obj.subCount > 0) {
obj.hasChildren = true
}
return obj
})
if (condition && condition.quick) {
data = this.buildTree(data)
// this.setTableAttr(true)
}
this.data = data
})
},
buildTree(arrs) {
const idMapping = arrs.reduce((acc, el, i) => {
acc[el.deptId] = i
return acc
}, {})
const roots = []
arrs.forEach(el => {
// 判断根节点
if (el.pid === null || el.pid === 0) {
roots.push(el)
return
}
// 用映射表找到父元素
const parentEl = arrs[idMapping[el.pid]]
// 把当前元素添加到父元素的`children`数组中
parentEl.children = [...(parentEl.children || []), el]
})
return roots
}
}
}
</script>
<style scoped>
.my_table >>> .el-table__row>td{
/* 去除表格线 */
border: none;
padding: 0 0;
}
.my_table >>> .el-table th.is-leaf {
/* 去除上边框 */
border: none;
}
.my_table >>> .el-table::before{
/* 去除下边框 */
height: 0;
}
</style>
<template> <template>
<el-tabs v-model="activeName" @tab-click="handleClick"> <div>
<el-tab-pane label="部门" name="first">部门</el-tab-pane> <el-button v-show="!showSearchInput" class="de-icon" icon="el-icon-search" circle size="mini" @click="showSearchWidget" />
<el-tab-pane label="角色" name="second">角色</el-tab-pane> <div v-show="showSearchInput" class="de-input">
<el-tab-pane label="用户" name="third">用户</el-tab-pane> <el-input v-model="key">
</el-tabs> <el-button slot="append" icon="el-icon-close" @click="closeSearchWidget" />
</el-input>
</div>
<el-tabs v-model="activeName" :class="{'de-search-header': showSearchInput}" @tab-click="handleClick">
<el-tab-pane :lazy="true" class="de-tab" label="部门" name="1"><grant-dept :resource-id="resourceId" /></el-tab-pane>
<el-tab-pane :lazy="true" class="de-tab" label="角色" name="2"><grant-role :resource-id="resourceId" /></el-tab-pane>
<el-tab-pane :lazy="true" class="de-tab" label="用户" name="3"><grant-user :resource-id="resourceId" /></el-tab-pane>
</el-tabs>
</div>
</template> </template>
<script> <script>
import GrantDept from './dept'
import GrantRole from './role'
import GrantUser from './user'
export default { export default {
name: 'GrantAuth', name: 'GrantAuth',
components: { GrantDept, GrantRole, GrantUser },
props: { props: {
resourceId: { resourceId: {
type: String, type: String,
...@@ -17,14 +31,47 @@ export default { ...@@ -17,14 +31,47 @@ export default {
}, },
data() { data() {
return { return {
activeName: 'second' activeName: '1',
showSearchInput: false,
key: null
} }
}, },
methods: { methods: {
handleClick(tab, event) { handleClick(tab, event) {
console.log(tab, event) console.log(tab, event)
},
showSearchWidget() {
this.showSearchInput = true
},
closeSearchWidget() {
this.showSearchInput = false
} }
} }
} }
</script> </script>
<style lang="scss" scoped>
.de-tab {
border:1px solid #E6E6E6;
min-height:200px !important;
max-height:300px !important;
overflow:auto;
}
.de-icon {
position: absolute;
right: 20px;
top: 50px;
z-index: 99;
}
.el-input-group__append{
background-color: #ffffff;
}
.el-input__inner{
border-right: none;
}
// ::-webkit-scrollbar {
// }
</style>
<template>
<div class="my_table">
<el-table
ref="table"
:data="data"
:show-header="true"
style="width: 100%"
:row-style="{height: '35px'}"
@filter-change="filterChange"
>
<el-table-column :column-key="fieldName" :label="columnLabel" :prop="fieldName" filter-placement="right-start" :filters="filter_options" :filter-multiple="false" :filter-method="filterHandler" />
<el-table-column type="selection" fixd />
</el-table>
</div>
</template>
<script>
import { roleGrid } from '@/api/system/role'
import { formatCondition } from '@/utils/index'
export default {
name: 'GrantRole',
props: {
resourceId: {
type: String,
default: null
}
},
data() {
return {
data: [],
defaultHeadName: '全部',
columnLabel: null,
filter_options: [{ text: '未分享角色', value: 0 }, { text: '已分享角色', value: 1 }],
fieldName: 'name'
}
},
created() {
this.initColumnLabel()
this.search()
},
methods: {
initColumnLabel() {
this.columnLabel = this.defaultHeadName
},
search(condition) {
const temp = formatCondition(condition)
const param = temp || {}
roleGrid(1, 0, param).then(response => {
const data = response.data
// this.total = data.itemCount
this.data = data.listObject
})
},
filterHandler(value, row, column) {
// const property = column['property']
// return row[property] === value
return row['code'] === 'admin'
},
filterChange(obj) {
const arr = obj[this.fieldName]
if (arr.length === 0) {
this.initColumnLabel()
return
}
this.columnLabel = this.filter_options[arr[0]].text
}
}
}
</script>
<style scoped>
.my_table >>> .el-table__row>td{
/* 去除表格线 */
border: none;
padding: 0 0;
}
.my_table >>> .el-table th.is-leaf {
/* 去除上边框 */
border: none;
}
.my_table >>> .el-table::before{
/* 去除下边框 */
height: 0;
}
</style>
<template>
<div class="my_table">
<el-table
ref="table"
:data="data"
:show-header="true"
style="width: 100%"
:row-style="{height: '35px'}"
@filter-change="filterChange"
>
<el-table-column :column-key="fieldName" :label="columnLabel" :prop="fieldName" filter-placement="right-start" :filters="filter_options" :filter-multiple="false" :filter-method="filterHandler" />
<el-table-column type="selection" fixd />
</el-table>
</div>
</template>
<script>
import { userLists } from '@/api/system/user'
import { formatCondition } from '@/utils/index'
export default {
name: 'GrantUser',
props: {
resourceId: {
type: String,
default: null
}
},
data() {
return {
data: [],
defaultHeadName: '全部',
columnLabel: null,
filter_options: [{ text: '未分享人员', value: 0 }, { text: '已分享人员', value: 1 }],
fieldName: 'nickName'
}
},
created() {
this.initColumnLabel()
this.search()
},
methods: {
initColumnLabel() {
this.columnLabel = this.defaultHeadName
},
search(condition) {
const temp = formatCondition(condition)
const param = temp || {}
userLists(1, 0, param).then(response => {
const data = response.data
// this.total = data.itemCount
this.data = data.listObject
})
},
filterHandler(value, row, column) {
// const property = column['property']
// return row[property] === value
return row['code'] === 'admin'
},
filterChange(obj) {
const arr = obj[this.fieldName]
if (arr.length === 0) {
this.initColumnLabel()
return
}
this.columnLabel = this.filter_options[arr[0]].text
}
}
}
</script>
<style scoped>
.my_table >>> .el-table__row>td{
/* 去除表格线 */
border: none;
padding: 0 0;
}
.my_table >>> .el-table th.is-leaf {
/* 去除上边框 */
border: none;
}
.my_table >>> .el-table::before{
/* 去除下边框 */
height: 0;
}
</style>
...@@ -114,8 +114,7 @@ ...@@ -114,8 +114,7 @@
:title="authTitle" :title="authTitle"
:visible.sync="authVisible" :visible.sync="authVisible"
:show-close="false" :show-close="false"
width="30%" custom-class="de-dialog"
custom-class="authDialog"
:before-close="handleClose" :before-close="handleClose"
> >
<grant-auth :resource-id="authResourceId" /> <grant-auth :resource-id="authResourceId" />
...@@ -484,10 +483,11 @@ export default { ...@@ -484,10 +483,11 @@ export default {
}, },
share(data) { share(data) {
this.authResourceId = data.id this.authResourceId = data.id
this.authTitle = '把仪表板[' + data.label + ']分享给' this.authTitle = '把[' + data.label + ']分享给'
this.authVisible = true this.authVisible = true
}, },
handleClose(done) { handleClose(done) {
this.authResourceId = null
this.handleClose = false this.handleClose = false
} }
} }
...@@ -540,8 +540,4 @@ export default { ...@@ -540,8 +540,4 @@ export default {
line-height: 26px; line-height: 26px;
} }
/* .el-dialog authDialog >>> div {
padding: 5px !important;
padding-bottom:5px !important;
} */
</style> </style>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<el-col class="panel-design"> <el-col class="panel-design">
<!--TODO 仪表盘设计公共设置区域--> <!--TODO 仪表盘设计公共设置区域-->
<el-row class="panel-design-head"> <el-row class="panel-design-head">
<span style="float: left;line-height: 40px; color: gray">名称:{{panelInfo.name}}</span> <span style="float: left;line-height: 40px; color: gray">名称:{{ panelInfo.name }}</span>
<span style="float: right;line-height: 40px;"> <span style="float: right;line-height: 40px;">
<el-button size="mini"> <el-button size="mini">
背景图 背景图
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论