+
@@ -40,6 +43,14 @@ export default {
type: String,
required: false,
default: 'NotProvided'
+ },
+ panelId: {
+ type: String,
+ default: null
+ },
+ chartTitle: {
+ type: String,
+ default: null
}
},
data() {
@@ -51,7 +62,8 @@ export default {
'view',
'custom'
],
- timer: null
+ timer: null,
+ isTaskChecked: false
}
},
computed: {
@@ -67,14 +79,29 @@ export default {
'linkageSettingStatus',
'componentData',
'canvasStyleData',
- 'componentGap'
- ])
+ 'componentGap',
+ 'panelViews'
+ ]),
+
+ taskChecked() {
+ const panelId = this.panelId
+ return !!this.panelViews && !!this.panelViews[panelId] && !!this.panelViews[panelId].some(view => view.viewId === this.viewId)
+ }
+ },
+ watch: {
+ taskChecked(val) {
+ this.isTaskChecked = val
+ }
},
mounted() {
if (this.showPosition === 'multiplexing-view') {
this.multiplexingCheckModel = true
this.multiplexingCheck(this.multiplexingCheckModel)
}
+ if (this.showPosition === 'email-task') {
+ this.isTaskChecked = !!this.taskChecked
+ // this.emailTaskCheck(this.isTaskChecked)
+ }
},
beforeDestroy() {
},
@@ -104,6 +131,13 @@ export default {
// remove
this.$store.commit('removeCurMultiplexingComponentWithId', this.viewId)
}
+ },
+ emailTaskCheck(val) {
+ if (val) {
+ this.$store.dispatch('task/addView', { 'panelId': this.panelId, 'viewId': this.viewId, 'title': this.chartTitle })
+ } else {
+ this.$store.dispatch('task/delView', { 'panelId': this.panelId, 'viewId': this.viewId })
+ }
}
}
diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue
index 524ac8c8f4..c1afd1191f 100644
--- a/frontend/src/components/canvas/custom-component/UserView.vue
+++ b/frontend/src/components/canvas/custom-component/UserView.vue
@@ -12,6 +12,8 @@
v-if="editBarViewShowFlag"
:element="element"
:show-position="showPosition"
+ :panel-id="panelInfo.id"
+ :chart-title="chart.title || chart.name"
:is-edit="isEdit"
:view-id="element.propValue.viewId"
@showViewDetails="openChartDetailsDialog"
@@ -234,7 +236,7 @@ export default {
}
},
editBarViewShowFlag() {
- return (this.active && this.inTab && !this.mobileLayoutStatus) || this.showPosition.includes('multiplexing')
+ return (this.active && this.inTab && !this.mobileLayoutStatus) || this.showPosition.includes('multiplexing') || this.showPosition.includes('email-task')
},
charViewShowFlag() {
return this.httpRequest.status && this.chart.type && !this.chart.type.includes('table') && !this.chart.type.includes('text') && this.chart.type !== 'label' && this.renderComponent() === 'echarts'
diff --git a/frontend/src/store/getters.js b/frontend/src/store/getters.js
index f336da0de7..d686989826 100644
--- a/frontend/src/store/getters.js
+++ b/frontend/src/store/getters.js
@@ -30,6 +30,7 @@ const getters = {
uiInfo: state => state.user.uiInfo,
conditions: state => state.conditions.conditions,
msgTypes: state => state.msg.msgTypes,
- geoMap: state => state.map.geoMap
+ geoMap: state => state.map.geoMap,
+ panelViews: state => state.task.panelViews
}
export default getters
diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js
index fad58ca06b..2f1c155c04 100644
--- a/frontend/src/store/index.js
+++ b/frontend/src/store/index.js
@@ -21,6 +21,7 @@ import event from '@/components/canvas/store/event'
import layer from '@/components/canvas/store/layer'
import snapshot from '@/components/canvas/store/snapshot'
import lock from '@/components/canvas/store/lock'
+import task from './modules/task'
import { valueValid, formatCondition } from '@/utils/conditionUtil'
import { Condition } from '@/components/widget/bean/Condition'
@@ -44,6 +45,7 @@ const data = {
...layer.state,
...snapshot.state,
...lock.state,
+ ...task.state,
// 编辑器模式 edit preview
editMode: 'edit',
// 当前页面全局数据 包括扩展公共样式 公共的仪表板样式,用来实时响应样式的变化
@@ -696,7 +698,8 @@ const data = {
application,
lic,
msg,
- map
+ map,
+ task
},
getters
}
diff --git a/frontend/src/store/modules/task.js b/frontend/src/store/modules/task.js
new file mode 100644
index 0000000000..ec22d7276c
--- /dev/null
+++ b/frontend/src/store/modules/task.js
@@ -0,0 +1,49 @@
+import Vue from 'vue'
+const state = {
+ panelViews: {}
+}
+
+const mutations = {
+
+ ADD_VIEW: (state, { panelId, viewId, title }) => {
+ if (!state.panelViews[panelId]) {
+ Vue.set(state.panelViews, panelId, [])
+ }
+ const views = state.panelViews[panelId]
+ if (views.some(item => item.viewId === viewId)) {
+ return
+ }
+ views.push({ viewId, title })
+ state.panelViews[panelId] = views
+ },
+
+ DEL_VIEW: (state, { panelId, viewId }) => {
+ const views = state.panelViews[panelId]
+ if (!views || !views.length) return
+ let len = views.length
+ while (len--) {
+ const item = views[len]
+ if (viewId === item.viewId) {
+ views.splice(len, 1)
+ }
+ }
+ state.panelViews[panelId] = views
+ }
+}
+
+const actions = {
+ addView({ commit }, data) {
+ commit('ADD_VIEW', data)
+ },
+ delView({ commit }, data) {
+ commit('DEL_VIEW', data)
+ }
+}
+
+export default {
+ namespaced: true,
+ state,
+ mutations,
+ actions
+}
+
diff --git a/frontend/src/styles/index.scss b/frontend/src/styles/index.scss
index 6faf1b578d..45f0623dee 100644
--- a/frontend/src/styles/index.scss
+++ b/frontend/src/styles/index.scss
@@ -833,3 +833,6 @@ div:focus {
.fu-operator-component__label {
width: 100px !important;
}
+.view-select-option {
+ display: none !important;
+}