Merge branch 'master-dev' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into master-dev
This commit is contained in:
commit
a330a34ee7
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="custom-top-menu">
|
||||
<a-menu mode="horizontal" v-model="selectedKeys" @click="onMenuSelect">
|
||||
<a-menu-item v-for="(menu, index) in menus" :key="menu.name" :class="{ 'is-last': index === menus.length - 1}">
|
||||
<a-menu-item v-for="(menu, index) in menus" :key="menu.name" :class="{ 'is-last': index === menus.length - 1 }">
|
||||
<img
|
||||
v-show="menu.name === selectedKeys[0]"
|
||||
class="menu-logo"
|
||||
|
@ -15,7 +15,7 @@
|
|||
alt=""
|
||||
/>
|
||||
<span v-html="menu.meta.title.split(' ').join('<br>')"></span>
|
||||
<img v-if="index !== menus.length - 1" class="split-line" src="@/assets/images/header/split-line.png" alt="">
|
||||
<img v-if="index !== menus.length - 1" class="split-line" src="@/assets/images/header/split-line.png" alt="" />
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</div>
|
||||
|
@ -26,12 +26,12 @@ export default {
|
|||
props: {
|
||||
menus: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
default: () => [],
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectedKeys: []
|
||||
selectedKeys: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -40,15 +40,15 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
onMenuSelect({ key }) {
|
||||
const childPath = this.getChildrenPath(this.menuItems.find(menu => menu.name === key))
|
||||
if (key == "abnormal-alarm" ) {
|
||||
const childPath = this.getChildrenPath(this.menuItems.find((menu) => menu.name === key))
|
||||
if (key == 'abnormal-alarm') {
|
||||
const selectedKeys = window.sessionStorage.getItem('currMenu_alarm')
|
||||
if (selectedKeys) {
|
||||
this.$router.push(selectedKeys)
|
||||
} else {
|
||||
this.$router.push(childPath)
|
||||
}
|
||||
} else if (key == "istatistics") {
|
||||
} else if (key == 'istatistics') {
|
||||
const selectedKeys = window.sessionStorage.getItem('currMenu_web')
|
||||
if (selectedKeys) {
|
||||
this.$router.push(selectedKeys)
|
||||
|
@ -82,19 +82,19 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
$route(route) {
|
||||
const currTopMenu = this.findTopMenuByRouteName(this.menuItems, route.name)
|
||||
this.selectedKeys = [currTopMenu.name]
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
menuItems() {
|
||||
return this.menus.filter(item => !item.hidden)
|
||||
}
|
||||
}
|
||||
return this.menus.filter((item) => !item.hidden)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -130,10 +130,12 @@ export default {
|
|||
watch: {
|
||||
$route: {
|
||||
handler: function (val, oldVal) {
|
||||
this.currSlecteKey = []
|
||||
console.log(val)
|
||||
this.currSlecteKey.push(val.path)
|
||||
window.sessionStorage.setItem('currMenu_alarm', val.path)
|
||||
if (val.name === 'abnormal-alarm') {
|
||||
this.currSlecteKey = []
|
||||
this.currSlecteKey.push(val.path)
|
||||
window.sessionStorage.setItem('currMenu_alarm', val.path)
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
|
|
|
@ -4,19 +4,19 @@ import Vue from 'vue'
|
|||
|
||||
/**
|
||||
* 发起请求清理后端对sample的缓存
|
||||
* @param {Array<any>} sampleList
|
||||
* @param {Array<any>} sampleList
|
||||
*/
|
||||
export const clearSampleCache = (sampleList) => {
|
||||
sampleList.forEach(sample => {
|
||||
const { inputFileName: fileName, sampleFileName, qcFileName } = sample
|
||||
let url = '/gamma/delPHDCache',
|
||||
params = { fileName }
|
||||
if (sample.sampleType == 'B') {
|
||||
url = '/spectrumAnalysis/deleteSpectrumCacheData'
|
||||
params = { sampleFileName , qcFileName }
|
||||
}
|
||||
deleteAction(url, params)
|
||||
store.commit('REMOVE_SAMPLE_DATA', fileName)
|
||||
Vue.ls.remove(`calibration-gamma:${fileName}`)
|
||||
})
|
||||
}
|
||||
export const clearSampleCache = sampleList => {
|
||||
sampleList.forEach(sample => {
|
||||
const { inputFileName: fileName } = sample
|
||||
let url = '/gamma/delPHDCache',
|
||||
params = { fileName }
|
||||
if (sample.sampleType == 'B') {
|
||||
url = '/spectrumAnalysis/deleteSpectrumCacheData'
|
||||
params = { sampleFileName: fileName }
|
||||
}
|
||||
deleteAction(url, params)
|
||||
store.commit('REMOVE_SAMPLE_DATA', fileName)
|
||||
Vue.ls.remove(`calibration-gamma:${fileName}`)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -696,7 +696,7 @@ export default {
|
|||
this.cancelLastRequest()
|
||||
const cancelToken = this.createCancelToken()
|
||||
this.isLoadingGammaGated = true
|
||||
const { sampleId, qcFileName } = this.newSampleData
|
||||
const { sampleId, qcFileName, inputFileName: sampleFileName } = this.newSampleData
|
||||
const {
|
||||
success,
|
||||
result: { data },
|
||||
|
@ -709,6 +709,7 @@ export default {
|
|||
chartHeight: this.gammaEnergy.length,
|
||||
channelWidth: this.gammaChannelWidth,
|
||||
qcFileName,
|
||||
sampleFileName
|
||||
},
|
||||
cancelToken
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user