diff --git a/frontend/src/api/authModel/authModel.js b/frontend/src/api/authModel/authModel.js
index 33ba79f0a2..9f72a1b128 100644
--- a/frontend/src/api/authModel/authModel.js
+++ b/frontend/src/api/authModel/authModel.js
@@ -1,11 +1,11 @@
import request from '@/utils/request'
-export function queryAuthModel(data) {
+export function queryAuthModel(data, loading = true, timeout = 30000) {
return request({
url: 'authModel/queryAuthModel',
method: 'post',
- loading: true,
- timeout: 30000,
+ loading: loading,
+ timeout: timeout,
data
})
}
diff --git a/frontend/src/api/chart/chart.js b/frontend/src/api/chart/chart.js
index f966b426d1..8bb9a0c4df 100644
--- a/frontend/src/api/chart/chart.js
+++ b/frontend/src/api/chart/chart.js
@@ -40,7 +40,7 @@ export function chartGroupTree(data) {
return request({
url: '/chart/group/tree',
method: 'post',
- loading: true,
+ loading: false,
data
})
}
diff --git a/frontend/src/api/panel/panel.js b/frontend/src/api/panel/panel.js
index c745ced6e9..702302a4c5 100644
--- a/frontend/src/api/panel/panel.js
+++ b/frontend/src/api/panel/panel.js
@@ -36,20 +36,22 @@ export function querySubjectWithGroup(data) {
})
}
-export function defaultTree(data) {
+export function defaultTree(data, loading = true, timeout = 30000) {
return request({
url: '/panel/group/defaultTree',
method: 'post',
- loading: true,
+ loading: loading,
+ timeout: timeout,
data
})
}
-export function groupTree(data) {
+export function groupTree(data, loading = true, timeout = 30000) {
return request({
url: '/panel/group/tree',
method: 'post',
- loading: true,
+ loading: loading,
+ timeout: timeout,
data
})
}
diff --git a/frontend/src/components/widget/DeWidget/TimeSimple.vue b/frontend/src/components/widget/DeWidget/TimeSimple.vue
index 260d6a25bc..badb0ecd83 100644
--- a/frontend/src/components/widget/DeWidget/TimeSimple.vue
+++ b/frontend/src/components/widget/DeWidget/TimeSimple.vue
@@ -7,10 +7,9 @@
:width="canvas_width"
:height="canvas_height"
/>
-
@@ -119,7 +118,7 @@ export default {
}
const nowWeek = this.week[time.getDay()]
var fullTime = showWeek ? (nowDate + ' ' + nowWeek) : nowDate
- var fullDoc = document.getElementById('fulltime')
+ var fullDoc = document.getElementById(this.element.id + '_fulltime')
fullDoc.innerHTML = fullTime
const draw = draws
@@ -140,8 +139,6 @@ export default {
draw.beginPath()
draw.moveTo(0, side_length / 2 - 0)
- /* draw.moveTo(0, side_length / 2 - 70)
- draw.lineTo(0, side_length / 2 - 50) */
draw.lineTo(0, side_length / 2 - 20)
draw.closePath()
draw.stroke()
@@ -157,8 +154,6 @@ export default {
draw.beginPath()
draw.moveTo(0, side_length / 2 - 0)
- // draw.lineTo(0, side_length / 2 - 50)
- // draw.lineTo(0, side_length / 2 - 60)
draw.lineTo(0, side_length / 2 - 10)
draw.closePath()
draw.stroke()
@@ -169,21 +164,18 @@ export default {
// 画时阵
draw.save()
draw.strokeStyle = this.element.style.color
- // draw.translate(250, 250)
draw.translate(canvas_w / 2, canvas_h / 2)
const hourzs = h + min / 60// 获取浮点类型的小时
draw.rotate(hourzs * 30 * Math.PI / 180)
draw.lineWidth = 6
draw.beginPath()
draw.moveTo(0, 0)
- /* draw.lineTo(0, -(side_length / 2 - 60) / 3) */
draw.lineTo(0, -(side_length / 2) * 0.5)
draw.closePath()
draw.stroke()
draw.restore()
// 画分针
draw.save()
- // draw.translate(250, 250)
draw.translate(canvas_w / 2, canvas_h / 2)
draw.rotate(min * 6 * Math.PI / 180)
@@ -192,13 +184,11 @@ export default {
draw.beginPath()
draw.moveTo(0, 0)
draw.lineTo(0, -(side_length / 2) * 0.7)
- /* draw.lineTo(0, -(side_length / 2 - 60) * 3 / 5) */
draw.closePath()
draw.stroke()
draw.restore()
// 画秒针
draw.save()
- // draw.translate(250, 250)
draw.translate(canvas_w / 2, canvas_h / 2)
draw.rotate(s * 6 * Math.PI / 180)
draw.strokeStyle = this.element.style.color
@@ -206,16 +196,13 @@ export default {
draw.beginPath()
draw.moveTo(0, 15)
draw.lineTo(0, -(side_length / 2) * 0.9)
- /* draw.lineTo(0, -(side_length / 2 - 60)) */
draw.closePath()
draw.stroke()
draw.restore()
// 画中心原点
- // draw.fillStyle = 'rgba(255,255,255,1)'
draw.lineWidth = 2
draw.beginPath()
- // draw.arc(250, 250, 4, 0, 360, false)
draw.arc(canvas_w / 2, canvas_h / 2, 4, 0, 360, false)
draw.closePath()
draw.fill()
diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js
index d8716d7c7d..1287b31817 100644
--- a/frontend/src/lang/en.js
+++ b/frontend/src/lang/en.js
@@ -1157,7 +1157,11 @@ export default {
union_data: 'Union Dataset',
add_union_table: 'Add Union Dataset',
edit_union: 'Edit Union Dataset',
- union: 'Union'
+ union: 'Union',
+ edit_union_relation: 'Edit Union Relation',
+ add_union_relation: 'Add Union Relation',
+ field_select: 'Select Field',
+ add_union_field: 'Add Union Field'
},
datasource: {
datasource: 'Data Source',
diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js
index a504aec63c..88c26ca89b 100644
--- a/frontend/src/lang/tw.js
+++ b/frontend/src/lang/tw.js
@@ -1158,7 +1158,11 @@ export default {
union_data: '關聯數據集',
add_union_table: '添加關聯數據集',
edit_union: '編輯關聯數據集',
- union: '關聯'
+ union: '關聯',
+ edit_union_relation: '編輯關聯關系',
+ add_union_relation: '新建關聯關系',
+ field_select: '字段選擇',
+ add_union_field: '添加關聯字段'
},
datasource: {
datasource: '數據源',
diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js
index 50219af647..5ac145263c 100644
--- a/frontend/src/lang/zh.js
+++ b/frontend/src/lang/zh.js
@@ -1160,7 +1160,11 @@ export default {
union_data: '关联数据集',
add_union_table: '添加关联数据集',
edit_union: '编辑关联数据集',
- union: '关联'
+ union: '关联',
+ edit_union_relation: '编辑关联关系',
+ add_union_relation: '新建关联关系',
+ field_select: '字段选择',
+ add_union_field: '添加关联字段'
},
datasource: {
datasource: '数据源',
diff --git a/frontend/src/styles/index.scss b/frontend/src/styles/index.scss
index 6bb7d1124f..d6393f38a5 100644
--- a/frontend/src/styles/index.scss
+++ b/frontend/src/styles/index.scss
@@ -693,39 +693,38 @@ div:focus {
.rate-date-class > .el-picker-panel__footer > .el-button--text:first-child{
+ display: none;
+}
+.rate-date-class > .el-picker-panel__body-wrapper > .el-picker-panel__body {
+ >.el-date-picker__header {
display: none;
}
- .rate-date-class > .el-picker-panel__body-wrapper > .el-picker-panel__body {
- >.el-date-picker__header {
- display: none;
- }
- >.el-picker-panel__content{
- >table > tbody {
- >tr:first-child {
- display: none;
- }
- >tr >td.prev-month,td.next-month {
- display: none;
- }
- }
- }
- }
- .rate-day-class > .el-picker-panel__footer > .el-button--text:first-child{
- display: none;
- }
- .rate-day-class > .el-picker-panel__body-wrapper > .el-picker-panel__body {
- >.el-date-picker__header {
+ >.el-picker-panel__content{
+ >table > tbody {
+ >tr:first-child {
display: none;
- }
- >.el-picker-panel__content{
- >table > tbody {
- >tr:not(:nth-child(3)) {
- display: none;
- }
-
- }
+ }
+ >tr >td.prev-month,td.next-month {
+ display: none;
+ }
}
}
+}
+.rate-day-class > .el-picker-panel__footer > .el-button--text:first-child{
+ display: none;
+}
+.rate-day-class > .el-picker-panel__body-wrapper > .el-picker-panel__body {
+ >.el-date-picker__header {
+ display: none;
+ }
+ >.el-picker-panel__content{
+ >table > tbody {
+ >tr:not(:nth-child(3)) {
+ display: none;
+ }
+ }
+ }
+}
.chart-type .el-radio__input{
display: none!important;
@@ -735,10 +734,22 @@ div:focus {
padding-left: 0!important;
}
+.chart-type .radio-row .radio-style{
+ width: 80px;
+ height: 60px;
+ padding: 0;
+}
+
.el-color-predefine__color-selector{
border: 1px solid #999999!important;
margin: 0 0 6px 6px!important;
}
-
+.de-checkbox {
+ width: 100%;
+ margin-left: 0px !important;
+ .el-checkbox__input {
+ padding: 0 0 8px 0 !important;
+ }
+}
diff --git a/frontend/src/views/chart/group/Group.vue b/frontend/src/views/chart/group/Group.vue
index 9b77490991..68a651f93f 100644
--- a/frontend/src/views/chart/group/Group.vue
+++ b/frontend/src/views/chart/group/Group.vue
@@ -337,6 +337,11 @@ export default {
type: String,
required: false,
default: null
+ },
+ mountedInit: {
+ type: Boolean,
+ required: false,
+ default: true
}
},
data() {
@@ -440,10 +445,11 @@ export default {
},
mounted() {
- this.treeNode(this.groupForm)
- this.refresh()
- // this.chartTree()
- this.getChartGroupTree()
+ if (this.mountedInit) {
+ this.treeNode(true)
+ this.refresh()
+ this.getChartGroupTree()
+ }
},
methods: {
clickAdd(param) {
@@ -620,9 +626,17 @@ export default {
})
},
- treeNode(group) {
- queryAuthModel({ modelType: 'chart' }).then(res => {
- this.tData = res.data
+ treeNode(cache = false) {
+ const modelInfo = localStorage.getItem('chart-tree')
+ const userCache = (modelInfo && cache)
+ if (userCache) {
+ this.tData = JSON.parse(modelInfo)
+ }
+ queryAuthModel({ modelType: 'chart' }, !userCache).then(res => {
+ localStorage.setItem('chart-tree', JSON.stringify(res.data))
+ if (!userCache) {
+ this.tData = res.data
+ }
})
},
diff --git a/frontend/src/views/chart/view/ChartType.vue b/frontend/src/views/chart/view/ChartType.vue
index c37ef0346a..546ea41fe5 100644
--- a/frontend/src/views/chart/view/ChartType.vue
+++ b/frontend/src/views/chart/view/ChartType.vue
@@ -487,10 +487,4 @@ export default {
white-space: pre;
font-size: 12px;
}
-
-.radio-style{
- width: 80px;
- height: 60px;
- padding: 0;
-}
diff --git a/frontend/src/views/dataset/add/AddUnion.vue b/frontend/src/views/dataset/add/AddUnion.vue
index 48148cb84a..07c09f10df 100644
--- a/frontend/src/views/dataset/add/AddUnion.vue
+++ b/frontend/src/views/dataset/add/AddUnion.vue
@@ -28,22 +28,44 @@
-
+
+
+
+
+
+
@@ -51,9 +73,10 @@
import UnionNode from '@/views/dataset/add/union/UnionNode'
import NodeItem from '@/views/dataset/add/union/NodeItem'
import DatasetGroupSelectorTree from '@/views/dataset/common/DatasetGroupSelectorTree'
+import UnionEdit from '@/views/dataset/add/union/UnionEdit'
export default {
name: 'AddUnion',
- components: { DatasetGroupSelectorTree, NodeItem, UnionNode },
+ components: { UnionEdit, DatasetGroupSelectorTree, NodeItem, UnionNode },
props: {
param: {
type: Object,
@@ -72,7 +95,7 @@ export default {
currentDsField: [],
childrenDs: [],
unionToParent: {
- unionType: '', // left join,right join,inner join
+ unionType: 'left', // left join,right join,inner join
unionFields: [
{
parentField: {},
@@ -94,7 +117,7 @@ export default {
currentDsField: [],
childrenDs: [],
unionToParent: {
- unionType: '',
+ unionType: 'left',
unionFields: []
},
allChildCount: 0
@@ -103,7 +126,9 @@ export default {
customType: ['db', 'sql', 'excel'],
selectDsDialog: false,
// 弹框临时选中的数据集
- tempDs: {}
+ tempDs: {},
+ editUnion: false,
+ unionParam: {}
}
},
mounted() {
@@ -154,6 +179,22 @@ export default {
}
}
}
+ },
+
+ unionConfig(param) {
+ this.unionParam = param
+ this.editUnion = true
+ },
+ closeEditUnion() {
+ this.editUnion = false
+ // 添加关联的时候,如果关闭关联关系设置的界面,则删除子节点,同时向父级传递消息
+ if (this.unionParam.type === 'add') {
+ this.dataset[0].childrenDs.pop()
+ this.calc({ type: 'delete', grandParentAdd: true, grandParentSub: true, subCount: 0 })
+ }
+ },
+ confirmEditUnion() {
+ this.editUnion = false
}
}
}
diff --git a/frontend/src/views/dataset/add/union/NodeItem.vue b/frontend/src/views/dataset/add/union/NodeItem.vue
index ecc4d80ba4..5dc218cfc5 100644
--- a/frontend/src/views/dataset/add/union/NodeItem.vue
+++ b/frontend/src/views/dataset/add/union/NodeItem.vue
@@ -1,9 +1,9 @@
-
-
-
+
+
+
{{ currentNode.currentDs.name }}
@@ -28,11 +28,20 @@
-
+
+
+
+
+
+
+
@@ -40,9 +49,10 @@
+
+
diff --git a/frontend/src/views/dataset/add/union/UnionFieldEdit.vue b/frontend/src/views/dataset/add/union/UnionFieldEdit.vue
new file mode 100644
index 0000000000..afb2ee9131
--- /dev/null
+++ b/frontend/src/views/dataset/add/union/UnionFieldEdit.vue
@@ -0,0 +1,44 @@
+
+
+
{{ node.currentDs.name }}
+
+
+
+
+
+
+
diff --git a/frontend/src/views/dataset/add/union/UnionFieldList.vue b/frontend/src/views/dataset/add/union/UnionFieldList.vue
new file mode 100644
index 0000000000..5d8e2ccf73
--- /dev/null
+++ b/frontend/src/views/dataset/add/union/UnionFieldList.vue
@@ -0,0 +1,176 @@
+
+
+
+
+ {{ $t('dataset.field_select') }}({{ checkedFields.length }}/{{ fieldList.length }})
+
+
+
+
+
+ {{ $t('dataset.field_origin_name') }}
+ {{ $t('dataset.field_name') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ field.originName }}
+
+
+ {{ field.name }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/views/dataset/add/union/UnionItemEdit.vue b/frontend/src/views/dataset/add/union/UnionItemEdit.vue
new file mode 100644
index 0000000000..ad0d23fae4
--- /dev/null
+++ b/frontend/src/views/dataset/add/union/UnionItemEdit.vue
@@ -0,0 +1,223 @@
+
+
+
+
+
+ {{ unionParam.parent.currentDs.name }}
+ {{ unionParam.node.currentDs.name }}
+ {{ $t('dataset.operator') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/views/dataset/add/union/UnionNode.vue b/frontend/src/views/dataset/add/union/UnionNode.vue
index 9458e759d8..2eb950caf0 100644
--- a/frontend/src/views/dataset/add/union/UnionNode.vue
+++ b/frontend/src/views/dataset/add/union/UnionNode.vue
@@ -1,29 +1,54 @@
diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue
index 2fa0a01e5b..9e229ba15e 100644
--- a/frontend/src/views/panel/list/PanelList.vue
+++ b/frontend/src/views/panel/list/PanelList.vue
@@ -233,6 +233,7 @@ import {
DEFAULT_COMMON_CANVAS_STYLE_STRING
} from '@/views/panel/panel'
import TreeSelector from '@/components/TreeSelector'
+import { queryAuthModel } from '@/api/authModel/authModel'
export default {
name: 'PanelList',
@@ -334,7 +335,11 @@ export default {
searchMap: {
all: this.$t('commons.all'),
folder: this.$t('commons.folder')
- }
+ },
+ initLocalStorage: [
+ 'chart',
+ 'dataset'
+ ]
}
},
computed: {
@@ -367,9 +372,20 @@ export default {
this.$store.commit('setComponentData', [])
this.$store.commit('setCanvasStyle', DEFAULT_COMMON_CANVAS_STYLE_STRING)
this.defaultTree()
- this.tree(this.groupForm)
+ this.tree(true)
+ this.initCache()
},
methods: {
+ initCache() {
+ // 初始化时提前加载视图和数据集的缓存
+ this.initLocalStorage.forEach(item => {
+ if (!localStorage.getItem(item + '-tree')) {
+ queryAuthModel({ modelType: item }, false).then(res => {
+ localStorage.setItem(item + '-tree', JSON.stringify(res.data))
+ })
+ }
+ })
+ },
closeEditPanelDialog(panelInfo) {
this.editPanel.visible = false
if (panelInfo) {
@@ -392,7 +408,7 @@ export default {
}
this.activeNodeAndClick(panelInfo)
} else {
- this.tree(this.groupForm)
+ this.tree()
}
}
},
@@ -535,7 +551,7 @@ export default {
type: 'success',
showClose: true
})
- this.tree(this.groupForm)
+ this.tree()
this.defaultTree()
})
} else {
@@ -562,7 +578,7 @@ export default {
showClose: true
})
this.clearCanvas()
- this.tree(this.groupForm)
+ this.tree()
this.defaultTree()
})
}).catch(() => {
@@ -591,17 +607,32 @@ export default {
sort: 'node_type desc,name asc'
}
},
- tree(group) {
- groupTree(group).then(res => {
- this.tData = res.data
+ tree(cache = false) {
+ const modelInfo = localStorage.getItem('panel-main-tree')
+ const userCache = (modelInfo && cache)
+ if (userCache) {
+ this.tData = JSON.parse(modelInfo)
+ }
+ groupTree(this.groupForm, !userCache).then(res => {
+ localStorage.setItem('panel-main-tree', JSON.stringify(res.data))
+ if (!userCache) {
+ this.tData = res.data
+ }
})
},
defaultTree() {
const requestInfo = {
panelType: 'system'
}
- defaultTree(requestInfo).then(res => {
- this.defaultData = res.data
+ const modelInfo = localStorage.getItem('panel-default-tree')
+ if (modelInfo) {
+ this.defaultData = JSON.parse(modelInfo)
+ }
+ defaultTree(requestInfo, false).then(res => {
+ localStorage.setItem('panel-default-tree', JSON.stringify(res.data))
+ if (!modelInfo) {
+ this.defaultData = res.data
+ }
})
},
@@ -768,7 +799,7 @@ export default {
this.moveInfo.pid = this.tGroup.id
this.moveInfo['optType'] = 'move'
panelSave(this.moveInfo).then(response => {
- this.tree(this.groupForm)
+ this.tree()
this.closeMoveGroup()
})
},
diff --git a/frontend/src/views/panel/list/PanelMain.vue b/frontend/src/views/panel/list/PanelMain.vue
index 5c16329626..82b416cfd8 100644
--- a/frontend/src/views/panel/list/PanelMain.vue
+++ b/frontend/src/views/panel/list/PanelMain.vue
@@ -4,7 +4,7 @@
{{ $t('panel.panel_list') }}
-
+
{{ $t('panel.store') }}
@@ -17,7 +17,7 @@
-
+