Merge branch 'v1.8' of github.com:dataease/dataease into v1.8

This commit is contained in:
taojinlong
2022-02-28 21:57:45 +08:00
11 changed files with 130 additions and 67 deletions

View File

@@ -66,3 +66,12 @@ export function pluginTypes() {
method: 'post'
})
}
export function deleteCircle(id) {
return request({
url: '/chart/group/deleteCircle/' + id,
method: 'post',
loading: true
})
}

View File

@@ -4,7 +4,7 @@
<span v-if="chart.type" v-show="title_show" ref="title" :style="title_class" style="cursor: default;display: block;">
<p style="padding:6px 10px 0 10px;margin: 0;overflow: hidden;white-space: pre;text-overflow: ellipsis;">{{ chart.title }}</p>
</span>
<div ref="tableContainer" style="width: 100%;overflow: hidden;padding: 8px;" :style="{background:container_bg_class.background}">
<div ref="tableContainer" style="width: 100%;overflow: hidden;" :style="{background:container_bg_class.background}">
<div v-if="chart.type === 'table-normal'" :id="chartId" style="width: 100%;overflow: hidden;" :class="chart.drill ? 'table-dom-normal-drill' : 'table-dom-normal'" />
<div v-if="chart.type === 'table-info'" :id="chartId" style="width: 100%;overflow: hidden;" :class="chart.drill ? 'table-dom-info-drill' : 'table-dom-info'" />
<div v-if="chart.type === 'table-pivot'" :id="chartId" style="width: 100%;overflow: hidden;" class="table-dom-normal" />

View File

@@ -1519,6 +1519,7 @@ export default {
this.closeChangeChart()
// 从仪表板入口关闭
if (this.$route.path.indexOf('panel') > -1) {
this.$store.commit('recordSnapshot')
bus.$emit('PanelSwitchComponent', { name: 'PanelEdit' })
}
this.$success(this.$t('commons.save_success'))

View File

@@ -1,7 +1,7 @@
<template>
<de-container>
<de-aside-container>
<dataset-group-selector-tree :privileges="privileges" :mode="mode" :clearEmptyDir="clearEmptyDir" :type="type" :custom-type="customType" :show-mode="showMode" @getTable="getTable" />
<dataset-group-selector-tree :privileges="privileges" :mode="mode" :clear-empty-dir="clearEmptyDir" :type="type" :custom-type="customType" :show-mode="showMode" @getTable="getTable" />
</de-aside-container>
<de-main-container>
<dataset-table-data :table="table" />
@@ -54,7 +54,7 @@ export default {
type: Boolean,
required: false,
default: false
},
}
},
data() {
return {
@@ -69,7 +69,7 @@ export default {
methods: {
getTable(table) {
// this.table = table
getTable(table.id).then(response => {
table && table.id && getTable(table.id).then(response => {
this.table = response.data
this.$emit('getTable', this.table)
}).catch(res => {

View File

@@ -34,8 +34,8 @@
@check="checkChanged"
@node-drag-end="dragEnd"
>
<span slot-scope="{ node, data }" class="custom-tree-node">
<span>
<span slot-scope="{ node, data }" class="custom-tree-node-list father">
<span style="display: flex; flex: 1 1 0%; width: 0px;">
<span v-if="data.modelInnerType==='history'">
<i class="el-icon-collection" />
</span>
@@ -48,7 +48,17 @@
<span v-else>
<svg-icon :icon-class="data.modelInnerType" style="width: 14px;height: 14px" />
</span>
<span style="margin-left: 6px;font-size: 14px">{{ data.name }}</span>
<span style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">{{ data.name }}</span>
</span>
<span v-if="data.mode===1" class="child">
<span @click.stop>
<el-button
icon="el-icon-delete"
type="text"
size="small"
@click="deleteHistory(data, node)"
/>
</span>
</span>
</span>
</el-tree>
@@ -63,6 +73,8 @@ import { deepCopy } from '@/components/canvas/utils/utils'
import eventBus from '@/components/canvas/utils/eventBus'
import { mapState } from 'vuex'
import { queryPanelViewTree } from '@/api/panel/panel'
import { deleteCircle } from '@/api/chart/chart'
import { delUser } from '@/api/system/user'
export default {
name: 'ViewSelect',
@@ -176,8 +188,20 @@ export default {
component.auxiliaryMatrix = this.canvasStyleData.auxiliaryMatrix
component.moveStatus = 'start'
return component
},
deleteHistory(data, node) {
deleteCircle(data.id).then(() => {
this.$success(this.$t('commons.delete_success'))
this.remove(node, data)
// this.loadData()
})
},
remove(node, data) {
const parent = node.parent
const children = parent.data.children || parent.data
const index = children.findIndex(d => d.id === data.id)
children.splice(index, 1)
}
}
}
</script>
@@ -198,4 +222,22 @@ export default {
width: 100%;
height: 100%;
}
.father .child {
/*display: none;*/
visibility: hidden;
}
.father:hover .child {
/*display: inline;*/
visibility: visible;
}
.custom-tree-node-list {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding:0 8px;
}
</style>