1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-12 14:24:34 +08:00
elsiosanchez b9cc5ff276 Support record Log of container info (#266)
* creating structure for the service

* structure container info

* waiting for service

* service test

* Support record Log of container info

* style of the option Change Detail

* Text formats

* add color to event type

* Add Disable of textLong

* change style text long
2020-01-27 11:00:34 -04:00

166 lines
4.4 KiB
JavaScript

const utils = {
state: {
width: 0,
height: 0,
splitHeight: 50,
splitHeightTop: 0,
widthLayout: 0,
tempShareLink: '',
oldAction: undefined,
reportType: '',
isShowedTable: false,
recordUuidTable: 0,
isShowedTabChildren: false,
recordTable: 0,
selectionProcess: [],
isContainerInfo: false
},
mutations: {
setWidth(state, width) {
state.width = width
},
setWidthLayout(state, width) {
state.widthLayout = width
},
setHeigth(state, height) {
state.height = height
},
setSplitHeight(state, splitHeight) {
state.splitHeight = splitHeight
},
showMenuTable(state, isShowedTable) {
state.isShowedTable = isShowedTable
},
showContainerInfo(state, isContainerInfo) {
state.isContainerInfo = isContainerInfo
},
showMenuTabChildren(state, isShowedTabChildren) {
state.isShowedTabChildren = isShowedTabChildren
},
setSplitHeightTop(state, splitHeightTop) {
state.splitHeightTop = splitHeightTop
},
setProcessTable(state, recordTable) {
state.recordTable = recordTable
},
setProcessSelecetion(state, selectionProcess) {
state.selectionProcess = selectionProcess
},
setTempShareLink(state, payload) {
state.tempShareLink = payload
},
setOldAction(state, payload) {
state.oldAction = payload
},
setReportTypeToShareLink(state, payload) {
state.reportType = payload
}
},
actions: {
setWidth({ commit }, width) {
commit('setWidth', width)
},
setWidthLayout({ commit }, width) {
commit('setWidthLayout', width)
},
setHeight({ commit }, height) {
commit('setHeigth', height)
},
showMenuTable({ commit }, isShowedTable) {
commit('showMenuTable', isShowedTable)
},
showContainerInfo({ commit, state }, isContainerInfo) {
commit('showContainerInfo', isContainerInfo)
},
showMenuTabChildren({ commit }, isShowedTabChildren) {
commit('showMenuTabChildren', isShowedTabChildren)
},
setSplitHeight({ commit }, splitHeight) {
commit('setSplitHeight', splitHeight)
},
setSplitHeightTop({ commit }, splitHeightTop) {
commit('setSplitHeightTop', splitHeightTop)
},
setProcessTable({ commit }, recordTable) {
commit('setProcessTable', recordTable)
},
setProcessSelect({ commit }, params) {
commit('setProcessSelecetion', params)
},
changeShowedDetail({ dispatch }, params) {
if (params.panelType === 'window') {
dispatch('changeShowedDetailWindow', params)
} else if (params.panelType === 'browser') {
dispatch('changeShowedCriteriaBrowser', params)
}
},
setTempShareLink({ commit }, parameters) {
if (!parameters.href.includes(String(parameters.processId))) {
commit('setTempShareLink', parameters.href)
}
},
setOldAction({ commit }, value) {
commit('setOldAction', value)
},
setReportTypeToShareLink({ commit }, value) {
commit('setReportTypeToShareLink', value)
}
},
getters: {
getWidth: (state) => {
return state.width
},
getProcessSelect: (state) => {
return state.selectionProcess
},
getWidthLayout: (state, rootGetters) => {
if (rootGetters.toggleSideBar) {
return state.width - 250
}
return state.width - 54
},
getHeigth: (state) => {
return state.height
},
getSplitHeightTop: (state) => {
return state.getSplitHeightTop
},
getRecordUuidMenu: (state) => {
return state.recordTable
},
getShowContextMenuTable: (state) => {
const menu = state.isShowedTable.isShowedTable
return menu
},
getShowContainerInfo: (state) => {
const showInfo = state.isContainerInfo
return showInfo
},
getShowContextMenuTabChildren: (state) => {
const menu = state.isShowedTabChildren.isShowedTabChildren
return menu
},
getSplitHeight: (state) => {
const split = state.splitHeight
var panelHeight = 0
if (split !== 50) {
panelHeight = split.splitHeight
} else {
panelHeight = 50
}
return panelHeight
},
getTempShareLink: (state) => {
return state.tempShareLink
},
getOldAction: (state) => {
return state.oldAction
},
getReportType: (state) => {
return state.reportType
}
}
}
export default utils