Merge branch 'dev' into pr@dev_memory_component

This commit is contained in:
dataeaseShu 2022-12-28 18:43:05 +08:00
commit 6884d51ab5
13 changed files with 103 additions and 89 deletions

View File

@ -159,23 +159,25 @@
<select id="queryDatasetRelation" resultType="io.dataease.dto.RelationDTO" resultMap="io.dataease.ext.ExtDataSourceMapper.RelationResultMap">
select
dt.id,
dt.name,
dt_auth.auths,
'dataset' `type`,
pg.id panel_id,
pg.name panel_name,
pg_auth.auths panel_auths,
if(pg.id is not null,'panel',null) pg_type
ds.id,
ds.name,
ds_auth.auths,
'link' `type`,
pg.id sub_id,
pg.name sub_name,
pg_auth.auths sub_auths,
if(pg.id is not null,'panel',null) sub_type
from
dataset_table dt
left join
datasource ds on dt.data_source_id = ds.id
left join
(
select
t_dt.id,group_concat(distinct sad.privilege_type) auths
t_ds.id,group_concat(distinct sad.privilege_type) auths
from
dataset_table t_dt
left join sys_auth sa on sa.auth_source = t_dt.id
datasource t_ds
left join sys_auth sa on sa.auth_source = t_ds.id
left join sys_auth_detail sad on sa.id = sad.auth_id
where
sa.auth_source = #{datasetId,jdbcType=VARCHAR}
@ -199,7 +201,7 @@
)
)
group by sa.auth_source
) dt_auth on dt.id = dt_auth.id
) ds_auth on ds.id = ds_auth.id
left join chart_view cv on cv.table_id = dt.id
left join panel_group pg on cv.scene_id = pg.id
left join
@ -234,7 +236,7 @@
group by sa.auth_source
) pg_auth on pg_auth.id = pg.id
where dt.id=#{datasetId,jdbcType=VARCHAR}
group by id,panel_id
group by id,sub_id
order by id
</select>
</mapper>

View File

@ -11,10 +11,10 @@
<result column="name" property="name"/>
<result column="auths" property="auths"/>
<collection property="subRelation" ofType="io.dataease.dto.RelationDTO">
<id column="panel_id" property="id"/>
<result column="panel_name" property="name"/>
<result column="panel_auths" property="auths"/>
<result column="pg_type" property="type"/>
<id column="sub_id" property="id"/>
<result column="sub_name" property="name"/>
<result column="sub_auths" property="auths"/>
<result column="sub_type" property="type"/>
</collection>
</resultMap>
@ -167,10 +167,10 @@
dt.name,
dt_auth.auths,
'dataset' `type`,
pg.id panel_id,
pg.name panel_name,
pg_auth.auths panel_auths,
if(pg.id is not null,'panel',null) pg_type
pg.id sub_id,
pg.name sub_name,
pg_auth.auths sub_auths,
if(pg.id is not null,'panel',null) sub_type
from
datasource ds
join dataset_table dt on dt.data_source_id = ds.id
@ -239,7 +239,7 @@
group by sa.auth_source
) pg_auth on pg_auth.id = pg.id
where ds.id=#{datasourceId,jdbcType=VARCHAR}
group by id,panel_id
group by id,sub_id
order by id
</select>
</mapper>

View File

@ -14,18 +14,6 @@
<result column="is_default" property="isDefault"/>
</resultMap>
<resultMap id="RelationResultMap" type="io.dataease.dto.RelationDTO">
<id column="id" property="id"/>
<result column="name" property="name"/>
<result column="auths" property="auths"/>
<collection property="subRelation" ofType="io.dataease.dto.RelationDTO">
<id column="dt_id" property="id"/>
<result column="dt_name" property="name"/>
<result column="dt_auths" property="auths"/>
<result column="dt_type" property="type"/>
</collection>
</resultMap>
<select id="findOneWithPrivileges" resultMap="BaseResultMapDTO">
select panel_group.*,
panel_group.name as label,
@ -238,16 +226,16 @@
</delete>
<select id="queryPanelRelation" resultType="io.dataease.dto.RelationDTO" resultMap="RelationResultMap">
<select id="queryPanelRelation" resultType="io.dataease.dto.RelationDTO" resultMap="io.dataease.ext.ExtDataSourceMapper.RelationResultMap">
select
ds.id,
ds.name,
ds_auth.auths,
'link' `type`,
dt.id dt_id,
dt.name dt_name,
dt_auth.auths dt_auths,
if(dt.id is not null,'dataset',null) dt_type
dt.id sub_id,
dt.name sub_name,
dt_auth.auths sub_auths,
if(dt.id is not null,'dataset',null) sub_type
from
panel_group pg
join
@ -318,7 +306,7 @@
group by sa.auth_source
) ds_auth on ds_auth.id = ds.id
where pg.id=#{panelId,jdbcType=VARCHAR}
group by id,dt_id
group by id,sub_id
order by id
</select>

View File

@ -1116,7 +1116,7 @@ public class DataSetTableService {
if (dsType.equals(DatasourceTypes.oracle.getType())) {
subSelect.setAlias(new Alias(fromItem.getAlias().toString(), false));
} else {
if(fromItem.getAlias() == null){
if (fromItem.getAlias() == null) {
throw new Exception("Failed to parse sql, Every derived table must have its own alias");
}
subSelect.setAlias(new Alias(fromItem.getAlias().toString()));
@ -2426,7 +2426,7 @@ public class DataSetTableService {
jsonArray = data.stream().map(ele -> {
Map<String, Object> map = new HashMap<>();
for (int i = 0; i < fieldArray.length; i++) {
map.put(fieldArray[i], ele.get(i));
map.put(fieldArray[i], i < ele.size() ? ele.get(i) : "");
}
return map;
}).collect(Collectors.toList());

View File

@ -36,6 +36,7 @@ import 'tinymce/plugins/directionality'
import 'tinymce/plugins/nonbreaking'
import 'tinymce/plugins/pagebreak'
import { mapState } from 'vuex'
import Vue from 'vue'
export default {
name: 'DeRichText',
@ -155,7 +156,7 @@ export default {
setEdit() {
if (this.editStatus) {
this.canEdit = true
this.element.editing = true
Vue.set(this.element, 'editing', true)
this.reShow()
}
},

View File

@ -54,8 +54,6 @@ export function listenGlobalKeyDown() {
if (!store.state.isInEditor) return
const { keyCode } = e
if (keyCode === ctrlKey || keyCode === commandKey) {
e.preventDefault()
e.stopPropagation()
isCtrlOrCommandDown = true
} else if (isCtrlOrCommandDown) {
if (keyCode === zKey || keyCode === yKey || keyCode === dKey || keyCode === sKey || keyCode === enlargeKey) {
@ -73,12 +71,15 @@ export function listenGlobalKeyDown() {
}
}
export function removeKeyListen() {
// window.onkeydown = null
// window.onkeyup = null
}
export function listenGlobalKeyDownPreview() {
window.onkeydown = (e) => {
const { keyCode } = e
if (keyCode === ctrlKey || keyCode === commandKey) {
e.preventDefault()
e.stopPropagation()
isCtrlOrCommandDown = true
} else if (isCtrlOrCommandDown) {
if (keyCode === enlargeKey) {

View File

@ -74,18 +74,22 @@
class="main-background"
>
<div
v-show="!this.element.editing"
class="de-drag-area de-drag-top"
@mousedown="elementMouseDown"
/>
<div
v-show="!this.element.editing"
class="de-drag-area de-drag-right"
@mousedown="elementMouseDown"
/>
<div
v-show="!this.element.editing"
class="de-drag-area de-drag-bottom"
@mousedown="elementMouseDown"
/>
<div
v-show="!this.element.editing"
class="de-drag-area de-drag-left"
@mousedown="elementMouseDown"
/>

View File

@ -198,6 +198,9 @@ const data = {
},
setCurComponent(state, { component, index }) {
if (!component && state.curComponent) {
Vue.set(state.curComponent, 'editing', false)
}
// 当前视图操作状态置空
if (component) {
component['optStatus'] = {
@ -206,9 +209,9 @@ const data = {
}
// Is the current component in editing status
if (!state.curComponent) {
component['editing'] = false
Vue.set(component, 'editing', false)
} else if (component.id !== state.curComponent.id) {
component['editing'] = false
Vue.set(component, 'editing', false)
}
}
state.styleChangeTimes = 0

View File

@ -67,8 +67,8 @@
>
{{ $t('chart.total') }}
<span>{{
(chart.datasetMode === 0 && !not_support_page_dataset.includes(chart.datasourceType)) ? chart.totalItems : ((chart.data && chart.data.tableRow) ? chart.data.tableRow.length : 0)
}}</span>
(chart.datasetMode === 0 && !not_support_page_dataset.includes(chart.datasourceType)) ? chart.totalItems : ((chart.data && chart.data.tableRow) ? chart.data.tableRow.length : 0)
}}</span>
{{ $t('chart.items') }}
</span>
<de-pagination
@ -351,9 +351,9 @@ export default {
dimensionList.push({ id: nameIdMap[key], value: rowData[key] })
}
}
this.antVActionPost(dimensionList, nameIdMap[meta.valueField] || 'null')
this.antVActionPost(dimensionList, nameIdMap[meta.valueField] || 'null', param)
},
antVActionPost(dimensionList, name) {
antVActionPost(dimensionList, name, param) {
this.pointParam = {
data: {
dimensionList: dimensionList,
@ -385,7 +385,7 @@ export default {
dimensionList.push({ id: nameIdMap[key], value: rowData[key] })
}
}
this.antVActionPost(dimensionList, nameIdMap[meta.field] || 'null')
this.antVActionPost(dimensionList, nameIdMap[meta.field] || 'null', param)
},
setBackGroundBorder() {
if (this.chart.customStyle) {

View File

@ -222,6 +222,7 @@ export default {
},
mounted() {
bus.$on('reset-change-table', this.getItemTagType)
this.getDateExtStatus()
},
beforeDestroy() {
bus.$off('reset-change-table', this.getItemTagType)

View File

@ -241,6 +241,7 @@ export default {
mounted() {
bus.$on('reset-change-table', this.getItemTagType)
this.init()
this.getDateExtStatus()
},
beforeDestroy() {
bus.$off('reset-change-table', this.getItemTagType)

View File

@ -174,7 +174,7 @@
/>
</span>
<span v-if="data.nodeType === 'folder'">
<svg-icon icon-class="scene" />
<svg-icon icon-class="scene"/>
</span>
<span
:class="data.status"
@ -211,7 +211,7 @@
<el-dropdown-item
:command="beforeClickEdit('folder', 'new', data, node)"
>
<svg-icon icon-class="scene" />
<svg-icon icon-class="scene"/>
<span style="margin-left: 5px">{{ $t('panel.groupAdd') }}</span>
</el-dropdown-item>
<el-dropdown-item
@ -334,7 +334,7 @@
:label="$t('commons.name')"
prop="name"
>
<el-input v-model="groupForm.name" />
<el-input v-model="groupForm.name"/>
</el-form-item>
</el-form>
<div
@ -345,8 +345,8 @@
size="mini"
@click="close()"
>{{
$t('panel.cancel')
}}
$t('panel.cancel')
}}
</el-button>
<el-button
type="primary"
@ -422,8 +422,8 @@
size="mini"
@click="closeMoveGroup()"
>{{
$t('dataset.cancel')
}}
$t('dataset.cancel')
}}
</el-button>
<el-button
:disabled="groupMoveConfirmDisabled"
@ -635,6 +635,11 @@ export default {
}
},
methods: {
activeLastNode() {
this.$nextTick(() => {
document.querySelector('.is-current').firstChild.click()
})
},
toTop(data, node) {
panelToTop(data.id).then(() => {
this.defaultTree()

View File

@ -8,7 +8,7 @@
@tab-click="handleClick"
>
<el-tab-pane name="PanelList">
<span slot="label"><i class="el-icon-document tablepanel-i" />{{ $t('panel.panel_list') }}</span>
<span slot="label"><i class="el-icon-document tablepanel-i"/>{{ $t('panel.panel_list') }}</span>
<panel-list
v-show="activeName==='PanelList'"
ref="panelList"
@ -18,14 +18,14 @@
name="panels_star"
:lazy="true"
>
<span slot="label"><i class="el-icon-star-off tablepanel-i" />{{ $t('panel.store') }}</span>
<enshrine v-if="activeName==='panels_star'" />
<span slot="label"><i class="el-icon-star-off tablepanel-i"/>{{ $t('panel.store') }}</span>
<enshrine v-if="activeName==='panels_star'"/>
</el-tab-pane>
<el-tab-pane
name="panels_share"
:lazy="true"
>
<span slot="label"><i class="el-icon-share tablepanel-i" />{{ $t('panel.share') }}</span>
<span slot="label"><i class="el-icon-share tablepanel-i"/>{{ $t('panel.share') }}</span>
<share-tree
v-if="showShare"
ref="share_tree"
@ -104,6 +104,9 @@ export default {
if (tab.name === 'panels_star') {
this.refreshEnshrine()
}
if (tab.name === 'PanelList') {
this.$refs.panelList.activeLastNode()
}
},
refreshShare() {
this.showShare = false
@ -148,28 +151,33 @@ export default {
</script>
<style scoped>
.ms-aside-container {
height: calc(100vh - 56px);
padding: 0px;
min-width: 260px;
max-width: 460px;
}
.ms-main-container {
height: calc(100vh - 56px);
padding: 0px;
}
.tab-panel{
height: 100%;
overflow-y: auto;
}
.tab-panel ::v-deep .el-tabs__nav-wrap{
padding: 0 10px;
}
.tab-panel ::v-deep .el-tabs__nav-wrap::after {
height: 1px;
}
.tab-panel ::v-deep .el-tabs__item{
/* width: 10px; */
padding: 0 10px;
}
.ms-aside-container {
height: calc(100vh - 56px);
padding: 0px;
min-width: 260px;
max-width: 460px;
}
.ms-main-container {
height: calc(100vh - 56px);
padding: 0px;
}
.tab-panel {
height: 100%;
overflow-y: auto;
}
.tab-panel ::v-deep .el-tabs__nav-wrap {
padding: 0 10px;
}
.tab-panel ::v-deep .el-tabs__nav-wrap::after {
height: 1px;
}
.tab-panel ::v-deep .el-tabs__item {
/* width: 10px; */
padding: 0 10px;
}
</style>