diff --git a/backend/pom.xml b/backend/pom.xml index 177a028f21..ddea2788d4 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -347,6 +347,10 @@ log4j log4j + + org.objenesis + objenesis + provided diff --git a/backend/src/main/java/io/dataease/base/domain/PanelShare.java b/backend/src/main/java/io/dataease/base/domain/PanelShare.java index 5d45eca63a..ddcd4e8e73 100644 --- a/backend/src/main/java/io/dataease/base/domain/PanelShare.java +++ b/backend/src/main/java/io/dataease/base/domain/PanelShare.java @@ -13,5 +13,7 @@ public class PanelShare implements Serializable { private Long createTime; + private Integer type; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/domain/PanelShareExample.java b/backend/src/main/java/io/dataease/base/domain/PanelShareExample.java index 887d2f1d8c..bafd89b447 100644 --- a/backend/src/main/java/io/dataease/base/domain/PanelShareExample.java +++ b/backend/src/main/java/io/dataease/base/domain/PanelShareExample.java @@ -353,6 +353,66 @@ public class PanelShareExample { addCriterion("create_time not between", value1, value2, "createTime"); 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 values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List 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 { diff --git a/backend/src/main/java/io/dataease/base/mapper/PanelShareMapper.xml b/backend/src/main/java/io/dataease/base/mapper/PanelShareMapper.xml index 7c4d62bdcc..8dd5204b5d 100644 --- a/backend/src/main/java/io/dataease/base/mapper/PanelShareMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/PanelShareMapper.xml @@ -6,6 +6,7 @@ + @@ -66,7 +67,7 @@ - share_id, panel_group_id, user_id, create_time + share_id, panel_group_id, user_id, create_time, `type` @@ -156,6 +163,9 @@ create_time = #{record.createTime,jdbcType=BIGINT}, + + `type` = #{record.type,jdbcType=INTEGER}, + @@ -166,7 +176,8 @@ set share_id = #{record.shareId,jdbcType=BIGINT}, panel_group_id = #{record.panelGroupId,jdbcType=VARCHAR}, user_id = #{record.userId,jdbcType=BIGINT}, - create_time = #{record.createTime,jdbcType=BIGINT} + create_time = #{record.createTime,jdbcType=BIGINT}, + `type` = #{record.type,jdbcType=INTEGER} @@ -183,6 +194,9 @@ create_time = #{createTime,jdbcType=BIGINT}, + + `type` = #{type,jdbcType=INTEGER}, + where share_id = #{shareId,jdbcType=BIGINT} @@ -190,7 +204,8 @@ update panel_share set panel_group_id = #{panelGroupId,jdbcType=VARCHAR}, 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} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.java b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.java index 784e6317f1..0c648ca388 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.java +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.java @@ -11,4 +11,6 @@ public interface ExtPanelShareMapper { int batchInsert(List shares); List query(GridExample example); + + List queryWithResource(GridExample example); } diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.xml index 6da4ef665b..960476a319 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.xml @@ -32,6 +32,18 @@ + + diff --git a/backend/src/main/java/io/dataease/controller/panel/api/ShareApi.java b/backend/src/main/java/io/dataease/controller/panel/api/ShareApi.java index f12e247fd6..14cc345578 100644 --- a/backend/src/main/java/io/dataease/controller/panel/api/ShareApi.java +++ b/backend/src/main/java/io/dataease/controller/panel/api/ShareApi.java @@ -1,5 +1,6 @@ package io.dataease.controller.panel.api; +import io.dataease.base.domain.PanelShare; import io.dataease.controller.request.panel.PanelShareRequest; import io.dataease.controller.sys.base.BaseGridRequest; import io.dataease.dto.panel.PanelShareDto; @@ -25,5 +26,10 @@ public interface ShareApi { @PostMapping("/treeList") List treeList(BaseGridRequest request); + + @ApiOperation("根据资源查询分享") + @PostMapping("/queryWithResourceId") + List queryWithResourceId(BaseGridRequest request); + } diff --git a/backend/src/main/java/io/dataease/controller/panel/server/ShareServer.java b/backend/src/main/java/io/dataease/controller/panel/server/ShareServer.java index 99fcad3163..82845e111b 100644 --- a/backend/src/main/java/io/dataease/controller/panel/server/ShareServer.java +++ b/backend/src/main/java/io/dataease/controller/panel/server/ShareServer.java @@ -1,15 +1,19 @@ package io.dataease.controller.panel.server; +import io.dataease.base.domain.PanelShare; import io.dataease.controller.panel.api.ShareApi; import io.dataease.controller.request.panel.PanelShareRequest; import io.dataease.controller.sys.base.BaseGridRequest; import io.dataease.dto.panel.PanelShareDto; 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.RestController; import javax.annotation.Resource; import java.util.List; +@RestController public class ShareServer implements ShareApi { @Resource @@ -23,4 +27,10 @@ public class ShareServer implements ShareApi { public List treeList(@RequestBody BaseGridRequest request) { return shareService.queryTree(request); } + + + @Override + public List queryWithResourceId(@RequestBody BaseGridRequest request) { + return shareService.queryWithResource(request); + } } diff --git a/backend/src/main/java/io/dataease/service/panel/ShareService.java b/backend/src/main/java/io/dataease/service/panel/ShareService.java index 0d90204ced..b6502eaf20 100644 --- a/backend/src/main/java/io/dataease/service/panel/ShareService.java +++ b/backend/src/main/java/io/dataease/service/panel/ShareService.java @@ -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()); } + public List queryWithResource(BaseGridRequest request){ + GridExample example = request.convertExample(); + return extPanelShareMapper.queryWithResource(example); + } + } diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 82cdf1f357..8b7d88331d 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -58,6 +58,8 @@ spring.cache.ehcache.config=classpath:/ehcache/ehcache.xml logging.level.org.springframework.web=trace logging.level.org.springframework.boot.web=trace spring.mvc.log-request-details=true +pagehelper.PageRowBounds=true + diff --git a/backend/src/main/resources/db/migration/V12__panel_table.sql b/backend/src/main/resources/db/migration/V12__panel_table.sql index 0a4fea5f3c..d724b5609e 100644 --- a/backend/src/main/resources/db/migration/V12__panel_table.sql +++ b/backend/src/main/resources/db/migration/V12__panel_table.sql @@ -88,9 +88,12 @@ CREATE TABLE `panel_share` ( `panel_group_id` varchar(50) DEFAULT NULL COMMENT '仪表板ID', `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID', `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', + `type` int(8) DEFAULT NULL COMMENT '类型', PRIMARY KEY (`share_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='仪表板分享'; diff --git a/frontend/src/components/vue-drag-resize-rotate/index.vue b/frontend/src/components/vue-drag-resize-rotate/index.vue index 16686fc84e..108e9acfd6 100644 --- a/frontend/src/components/vue-drag-resize-rotate/index.vue +++ b/frontend/src/components/vue-drag-resize-rotate/index.vue @@ -600,10 +600,10 @@ export default { }, methods: { - removeView(){ + removeView() { debugger - console.log(this.viewId); - this.$emit('removeView',this.viewId) + console.log(this.viewId) + this.$emit('removeView', this.viewId) }, // 重置边界和鼠标状态 resetBoundsAndMouseState() { diff --git a/frontend/src/main.js b/frontend/src/main.js index 7326ce4c68..22ce2e0eed 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -8,15 +8,13 @@ import i18n from './lang' // internationalization import App from './App' import store from './store' import router from './router' - +import message from './utils/message' import '@/icons' // icon import '@/permission' // permission control import api from '@/api/index.js' import filter from '@/filter/filter' import directives from './directive' -import './styles/vdrr/common-temp.scss' - import vdrr from './components/vue-drag-resize-rotate' Vue.component('vdrr', vdrr) @@ -27,7 +25,7 @@ import * as echarts from 'echarts' Vue.prototype.$echarts = echarts import UmyUi from 'umy-ui' -import 'umy-ui/lib/theme-chalk/index.css'// 引入样式 + Vue.use(UmyUi) /** @@ -55,6 +53,7 @@ Vue.use(Fit2CloudUI, { }) Vue.use(filter) Vue.use(directives) +Vue.use(message) Vue.config.productionTip = false new Vue({ diff --git a/frontend/src/store/modules/panel.js b/frontend/src/store/modules/panel.js index d90be32b5a..5f10d361a9 100644 --- a/frontend/src/store/modules/panel.js +++ b/frontend/src/store/modules/panel.js @@ -2,8 +2,8 @@ const getDefaultState = () => { return { panelName: '', - panelInfo:{ - name:'' + panelInfo: { + name: '' } } } diff --git a/frontend/src/styles/index.scss b/frontend/src/styles/index.scss index c8f6acbde9..eadcbd344f 100644 --- a/frontend/src/styles/index.scss +++ b/frontend/src/styles/index.scss @@ -6,6 +6,8 @@ @import './sidebar.scss'; @import './topbar.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'; @@ -69,3 +71,42 @@ div:focus { .app-container { 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; + } + +} diff --git a/frontend/src/utils/request.js b/frontend/src/utils/request.js index 7232afaea8..b48224cdc3 100644 --- a/frontend/src/utils/request.js +++ b/frontend/src/utils/request.js @@ -14,7 +14,7 @@ const RefreshTokenKey = Config.RefreshTokenKey const service = axios.create({ baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url // withCredentials: true, // send cookies when cross-domain requests - timeout: 5000 // request timeout + timeout: 10000 // request timeout }) // request interceptor diff --git a/frontend/src/views/panel/GrantAuth/dept/index.vue b/frontend/src/views/panel/GrantAuth/dept/index.vue new file mode 100644 index 0000000000..f2d652491c --- /dev/null +++ b/frontend/src/views/panel/GrantAuth/dept/index.vue @@ -0,0 +1,133 @@ + + + + + diff --git a/frontend/src/views/panel/GrantAuth/index.vue b/frontend/src/views/panel/GrantAuth/index.vue index 8fbbaade4c..3c6f310b6e 100644 --- a/frontend/src/views/panel/GrantAuth/index.vue +++ b/frontend/src/views/panel/GrantAuth/index.vue @@ -1,14 +1,28 @@ + + diff --git a/frontend/src/views/panel/GrantAuth/role/index.vue b/frontend/src/views/panel/GrantAuth/role/index.vue new file mode 100644 index 0000000000..8785b10702 --- /dev/null +++ b/frontend/src/views/panel/GrantAuth/role/index.vue @@ -0,0 +1,89 @@ + + + + + diff --git a/frontend/src/views/panel/GrantAuth/user/index.vue b/frontend/src/views/panel/GrantAuth/user/index.vue new file mode 100644 index 0000000000..f36929d659 --- /dev/null +++ b/frontend/src/views/panel/GrantAuth/user/index.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index 9c0a958ae5..f1770358c8 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -114,8 +114,7 @@ :title="authTitle" :visible.sync="authVisible" :show-close="false" - width="30%" - custom-class="authDialog" + custom-class="de-dialog" :before-close="handleClose" > @@ -484,10 +483,11 @@ export default { }, share(data) { this.authResourceId = data.id - this.authTitle = '把仪表板[' + data.label + ']分享给' + this.authTitle = '把[' + data.label + ']分享给' this.authVisible = true }, handleClose(done) { + this.authResourceId = null this.handleClose = false } } @@ -540,8 +540,4 @@ export default { line-height: 26px; } - /* .el-dialog authDialog >>> div { - padding: 5px !important; - padding-bottom:5px !important; - } */ diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index 8295a524de..f2eca67623 100644 --- a/frontend/src/views/panel/list/PanelViewShow.vue +++ b/frontend/src/views/panel/list/PanelViewShow.vue @@ -34,7 +34,7 @@ - 名称:{{panelInfo.name}} + 名称:{{ panelInfo.name }} 背景图