Compare commits

..

1 Commits

Author SHA1 Message Date
b1eca82a88 feat: 增加弹窗拖动功能 2024-03-13 16:02:44 +08:00
29 changed files with 340 additions and 631 deletions

View File

@ -30,10 +30,9 @@ export default {
this._chart.setOption(this.option, this.opts)
this.initEventListener()
},
beforeDestroy() {
destroyed() {
if (this._chart) {
this._chart.dispose()
this._chart = null
}
},
methods: {

View File

@ -1,9 +1,10 @@
<template>
<a-modal
:class="'custom-modal' + (innerFullscreen ? ' fullscreen' : '')"
:class="['custom-modal', innerFullscreen ? ' fullscreen' : '', moveable ? 'moveable' : '']"
v-bind="_attrs"
v-model="visible"
:maskClosable="false"
v-drag-modal="moveable"
@cancel="handleCancel"
>
<img slot="closeIcon" src="@/assets/images/global/close.png" />
@ -46,6 +47,10 @@ export default {
type: Boolean,
default: false,
},
moveable: {
type: Boolean,
default: true,
},
},
data() {
return {
@ -157,4 +162,21 @@ export default {
}
}
}
.moveable {
::v-deep {
.ant-modal-mask,
.ant-modal-wrap {
pointer-events: none;
}
.ant-modal-mask {
background-color: transparent;
}
.ant-modal-wrap {
overflow: hidden;
}
}
}
</style>

View File

@ -2,7 +2,6 @@
<a-table
ref="tableRef"
class="custom-table"
:class="['custom-table', canSelect && multiple && mouseMoveSelect ? 'mouse-move-select' : '']"
v-bind="$attrs"
:data-source="list"
:columns="columns"
@ -10,7 +9,7 @@
:row-key="rowKey"
:loading="loading"
:pagination="pagination"
:customRow="multiple && mouseMoveSelect ? customMouseMoveSelectRow : customRow"
:customRow="customRow"
:rowClassName="() => (canSelect ? 'custom-table-row' : '')"
@change="handleTableChange"
>
@ -59,16 +58,10 @@ export default {
type: Boolean,
default: true,
},
//
multiple: {
type: Boolean,
default: false,
},
//
mouseMoveSelect: {
type: Boolean,
default: true,
},
},
data() {
return {
@ -76,14 +69,6 @@ export default {
innerSelectedRows: [],
}
},
mounted() {
if (this.canSelect && this.multiple && this.mouseMoveSelect) {
const tbody = this.$el.querySelector('.ant-table-tbody')
tbody.addEventListener('mouseleave', () => {
this.mouseMoveStartIndex = undefined
})
}
},
methods: {
// /
customRow(record, index) {
@ -120,34 +105,6 @@ export default {
},
}
},
//
customMouseMoveSelectRow(record, index) {
const key = record[this.rowKey]
return {
class: this.innerSelectedRowKeys.includes(key) ? 'ant-table-row-selected' : '',
on: {
mousedown: () => {
this.innerSelectedRowKeys = []
this.mouseMoveStartIndex = index
},
mouseenter: () => {
if (this.mouseMoveStartIndex !== undefined) {
const indexes = [this.mouseMoveStartIndex, index].sort((a, b) => a - b)
this.innerSelectedRowKeys = this.list.slice(indexes[0], indexes[1] + 1).map((item) => item[this.rowKey])
}
},
mouseup: () => {
// click
if (this.mouseMoveStartIndex == index) {
this.innerSelectedRowKeys = [key]
}
this.mouseMoveStartIndex = undefined
},
},
}
},
handleTableChange(pagination, filters, sorter) {
this.$emit('change', pagination, filters, sorter)
},
@ -179,20 +136,8 @@ export default {
},
}
</script>
<style lang="less" scoped>
::v-deep {
.custom-table-row {
<style lang="less">
.custom-table-row {
cursor: pointer;
}
}
.mouse-move-select {
user-select: none;
::v-deep {
td {
transition: none !important;
}
}
}
</style>

View File

@ -0,0 +1,57 @@
import Vue from 'vue'
// 注册自定义拖拽指令,弥补 modal 组件不能拖动的缺陷
Vue.directive('drag-modal', (el, bindings, vnode) => {
if (!bindings.value) {
return
}
Vue.nextTick(() => {
const { visible, destroyOnClose } = vnode.componentInstance
// 防止未定义 destroyOnClose 关闭弹窗时dom未被销毁指令被重复调用
if (!visible) return
const modal = el.getElementsByClassName('ant-modal')[0]
const header = el.getElementsByClassName('ant-modal-header')[0]
let left = 0
let top = 0
// 设置遮罩层可滚动
setTimeout(() => {
document.body.style.width = '100%'
document.body.style.overflowY = 'inherit'
}, 0)
// 鼠标变成可移动的指示
header.style.cursor = 'move'
// 未定义 destroyOnClose 时dom未被销毁关闭弹窗再次打开弹窗会停留在上一次拖动的位置
if (!destroyOnClose) {
left = modal.left || 0
top = modal.top || 0
}
// top 初始值为 offsetTop
top = top || modal.offsetTop
header.onmousedown = e => {
const startX = e.clientX
const startY = e.clientY
header.left = header.offsetLeft
header.top = header.offsetTop
el.onmousemove = event => {
const endX = event.clientX
const endY = event.clientY
modal.left = header.left + (endX - startX) + left
modal.top = header.top + (endY - startY) + top
modal.style.left = modal.left + 'px'
modal.style.top = modal.top + 'px'
}
el.onmouseup = event => {
left = modal.left
top = modal.top
el.onmousemove = null
el.onmouseup = null
header.releaseCapture && header.releaseCapture()
}
header.setCapture && header.setCapture()
}
})
})

View File

@ -68,6 +68,8 @@ import 'vue-resize/dist/vue-resize.css'
import VueResize from 'vue-resize'
Vue.use(VueResize)
import './directives/dragModal'
Vue.prototype.rules = rules
Vue.config.productionTip = false
Vue.use(Storage, config.storageOptions)

View File

@ -6,6 +6,7 @@ import user from './modules/user'
import permission from './modules/permission'
import enhance from './modules/enhance'
import online from './modules/online'
import sample from './modules/sample'
import getters from './getters'
Vue.use(Vuex)
@ -17,6 +18,7 @@ export default new Vuex.Store({
permission,
enhance,
online,
sample
},
state: {

View File

@ -0,0 +1,50 @@
const sample = {
state: {
sampleList: [] // [{ inputFileName: String; data: Object; }]
},
mutations: {
SET_SAMPLE_LIST: (state, sampleList) => {
state.sampleList = sampleList
},
ADD_SAMPLE_DATA: (state, sampleData) => {
const find = state.sampleList.find(item => item.inputFileName == sampleData.inputFileName)
if (find) {
find.data = sampleData.data
} else {
state.sampleList.push(sampleData)
}
},
UPDATE_SAMPLE_DATA: (state, { inputFileName, key, data }) => {
const find = state.sampleList.find(item => item.inputFileName == inputFileName)
if (find) {
find.data[key] = data
}
},
UPDATE_SAMPLE_DATA_ANALY: (state, { inputFileName, data }) => {
const find = state.sampleList.find(item => item.inputFileName == inputFileName)
if (find) {
data.DetailedInformation = find.data.DetailedInformation
find.data = data
}
},
REMOVE_SAMPLE_DATA: (state, inputFileName) => {
const findIndex = state.sampleList.findIndex(item => item.inputFileName == inputFileName)
state.sampleList.splice(findIndex, 1)
},
CLEAR_SAMPLE_DATA: (state) => {
state.sampleList = []
}
},
actions: {
GET_SAMPLE_DATA: ({ state }, inputFileName) => {
const find = state.sampleList.find(item => item.inputFileName == inputFileName)
return find ? find : null
}
}
}
export default sample

View File

@ -1,84 +0,0 @@
// 所有缓存的谱
let sampleList = []
/**
* 重新设置缓存的谱
* @param {Array} list
*/
const setSampleList = list => {
sampleList = list
}
/**
* 缓存一条谱数据
* @param {*} sampleData
*/
const addSampleData = sampleData => {
const find = sampleList.find(item => item.inputFileName == sampleData.inputFileName)
if (find) {
find.data = sampleData.data
} else {
sampleList.push(sampleData)
}
}
/**
* 更新谱数据
* @param {{ inputFileName: string; key: string; data: any; }} param0
*/
const updateSampleData = ({ inputFileName, key, data }) => {
const find = sampleList.find(item => item.inputFileName == inputFileName)
if (find) {
find.data[key] = data
}
}
/**
* 移除谱数据
* @param {string} inputFileName
*/
const removeSampleData = inputFileName => {
const findIndex = sampleList.findIndex(item => item.inputFileName == inputFileName)
if (-1 !== findIndex) {
sampleList.splice(findIndex, 1)
}
}
/**
* 更新分析数据
* @param {{ inputFileName: string; data: any; }} param0
*/
const updateSampleDataAnaly = ({ inputFileName, data }) => {
const find = sampleList.find(item => item.inputFileName == inputFileName)
if (find) {
data.DetailedInformation = find.data.DetailedInformation
find.data = data
}
}
/**
* 清理缓存列表
*/
const clearSampleData = () => {
sampleList = []
}
/**
* 根据文件名获取谱
* @param {string} inputFileName
*/
const getSampleData = inputFileName => {
const find = sampleList.find(item => item.inputFileName == inputFileName)
return find ? find : null
}
export {
sampleList,
setSampleList,
addSampleData,
updateSampleData,
removeSampleData,
updateSampleDataAnaly,
clearSampleData,
getSampleData
}

View File

@ -13,15 +13,13 @@
:list="dataSource"
:loading="loading"
:canSelect="false"
:scroll="{ y: 390 }"
>
<template slot="info" slot-scope="{ record }">
<a-popover>
<template slot="content">
{{ JSON.parse(record.alarmInfo) }}{{ JSON.parse(record.operator).units }}
</template>
{{ JSON.parse(record.alarmInfo) }}{{ JSON.parse(record.operator).units }}
</a-popover>
<div class="info-alarm">{{ record.alarmValue }}{{ JSON.parse(record.operator).units }}</div>
<div>
{{ JSON.parse(record.operator).name }} {{ JSON.parse(record.operator).operator }}
{{ JSON.parse(record.operator).threshold }}{{ JSON.parse(record.operator).units }}
</div>
</template>
</custom-table>
</div>
@ -93,7 +91,6 @@ const columns = [
{
title: 'ALARM INFO',
align: 'left',
ellipsis: true,
dataIndex: 'alarmInfo',
scopedSlots: {
customRender: 'info',

View File

@ -41,7 +41,6 @@ export default {
pieData: [],
pieColors: ['#00bcd4', '#14b2a3', '#97b94b', '#47b55d'],
pieTotal: 0,
sourceChart: null,
}
},
mounted() {
@ -114,8 +113,6 @@ export default {
this.pieData = res.result.pieData
this.pieTotal = res.result.pieTotal
this.drawRightChart()
} else {
this.sourceChart.clear()
}
} else {
this.$message.warning('This operation fails. Contact your system administrator')
@ -250,7 +247,7 @@ export default {
})
},
drawRightChart() {
this.sourceChart = echarts.init(document.getElementById('chartRight'))
let myChart = echarts.init(document.getElementById('chartRight'))
let options = {
tooltip: {
trigger: 'item',
@ -311,9 +308,9 @@ export default {
},
],
}
this.sourceChart.setOption(options)
myChart.setOption(options)
window.addEventListener('resize', function () {
this.sourceChart.resize()
myChart.resize()
})
},
},

View File

@ -10,7 +10,6 @@
:list="dataSource"
:loading="loading"
:pagination="false"
:scroll="{ y: 655 }"
@rowDbclick="rowClick"
>
<!-- <template slot="stationList" slot-scope="{ text }">

View File

@ -53,7 +53,6 @@
:loading="loading"
:pagination="false"
:canSelect="false"
:scroll="{ y: 655 }"
>
</TableList>
<a-pagination

View File

@ -10,15 +10,13 @@
:loading="loading"
:pagination="false"
:canSelect="false"
:scroll="{ y: 655 }"
>
<template slot="info" slot-scope="{ record }">
<a-popover>
<template slot="content">
{{ JSON.parse(record.alarmInfo) }}{{ JSON.parse(record.operator).units }}
</template>
{{ JSON.parse(record.alarmInfo) }}{{ JSON.parse(record.operator).units }}
</a-popover>
<div class="info-alarm">{{ record.alarmValue }}{{ JSON.parse(record.operator).units }}</div>
<div>
{{ JSON.parse(record.operator).name }} {{ JSON.parse(record.operator).operator }}
{{ JSON.parse(record.operator).threshold }}{{ JSON.parse(record.operator).units }}
</div>
</template>
</TableList>
<a-pagination
@ -62,7 +60,6 @@ const columns = [
{
title: 'ALARM INFO',
align: 'left',
ellipsis: true,
dataIndex: 'alarmInfo',
scopedSlots: {
customRender: 'info',
@ -165,7 +162,7 @@ export default {
<style lang="less" scoped>
.server-main {
// width: 100%;
width: 100%;
height: calc(100% - 50px);
overflow: hidden;
padding-top: 15px;
@ -180,7 +177,7 @@ export default {
}
.info-alarm {
font-family: ArialMT;
font-size: 16px;
// color: #f62424;
font-size: 18px;
color: #f62424;
}
</style>

View File

@ -10,15 +10,13 @@
:loading="loading"
:pagination="false"
:canSelect="false"
:scroll="{ y: 655 }"
>
<template slot="info" slot-scope="{ record }">
<a-popover>
<template slot="content">
{{ JSON.parse(record.alarmInfo) }}{{ JSON.parse(record.operator).units }}
</template>
{{ JSON.parse(record.alarmInfo) }}{{ JSON.parse(record.operator).units }}
</a-popover>
<div class="info-alarm">{{ record.alarmValue }}{{ JSON.parse(record.operator).units }}</div>
<div>
{{ JSON.parse(record.operator).name }} {{ JSON.parse(record.operator).operator }}
{{ JSON.parse(record.operator).threshold }}{{ JSON.parse(record.operator).units }}
</div>
</template>
</TableList>
<a-pagination
@ -62,7 +60,6 @@ const columns = [
{
title: 'ALARM INFO',
align: 'left',
ellipsis: true,
dataIndex: 'alarmInfo',
scopedSlots: {
customRender: 'info',
@ -165,7 +162,7 @@ export default {
<style lang="less" scoped>
.server-main {
// width: 100%;
width: 100%;
height: calc(100% - 50px);
overflow: hidden;
padding-top: 15px;

View File

@ -10,15 +10,13 @@
:loading="loading"
:pagination="false"
:canSelect="false"
:scroll="{ y: 655 }"
>
<template slot="info" slot-scope="{ record }">
<a-popover>
<template slot="content">
{{ JSON.parse(record.alarmInfo) }}{{ JSON.parse(record.operator).units }}
</template>
{{ JSON.parse(record.alarmInfo) }}{{ JSON.parse(record.operator).units }}
</a-popover>
<div class="info-alarm">{{ record.alarmValue }}{{ JSON.parse(record.operator).units }}</div>
<div>
{{ JSON.parse(record.operator).name }} {{ JSON.parse(record.operator).operator }}
{{ JSON.parse(record.operator).threshold }}{{ JSON.parse(record.operator).units }}
</div>
</template>
</TableList>
<a-pagination
@ -62,7 +60,6 @@ const columns = [
{
title: 'ALARM INFO',
align: 'left',
ellipsis: true,
dataIndex: 'alarmInfo',
scopedSlots: {
customRender: 'info',
@ -165,7 +162,7 @@ export default {
<style lang="less" scoped>
.server-main {
// width: 100%;
width: 100%;
height: calc(100% - 50px);
overflow: hidden;
padding-top: 15px;

View File

@ -30,21 +30,6 @@
</a-card>
<!-- 日志列表 -->
<div class="log-list">
<div class="search-bar">
<a-row type="flex">
<a-col flex="290px">
<a-form-model-item label="Name">
<a-input v-model="nameStr" placeholder="Please Input..." />
</a-form-model-item>
</a-col>
<a-col flex="108px">
<a-button class="search-btn" type="primary" @click="onSearch">
<img src="@/assets/images/global/search.png" alt="" />
Search
</a-button>
</a-col>
</a-row>
</div>
<custom-table
size="middle"
rowKey="id"
@ -54,7 +39,7 @@
:loading="isGettingTreeData || loading"
:can-select="false"
@change="handleTableChange"
:scroll="{ y: 'calc(100vh - 275px)' }"
:scroll="{ y: 'calc(100vh - 175px)' }"
>
<template slot="operate" slot-scope="{ record }">
<a-space :size="20">
@ -68,22 +53,6 @@
</a-space>
</template>
</custom-table>
<a-pagination
size="small"
v-model="ipagination.current"
:pageSize="ipagination.pageSize"
:page-size-options="ipagination.pageSizeOptions"
show-size-changer
show-quick-jumper
:total="ipagination.total"
:show-total="
(total, range) =>
`Total ${total} items Page ${ipagination.current} / ${Math.ceil(total / ipagination.pageSize)}`
"
show-less-items
@change="handlePageChange"
@showSizeChange="handleSizeChange"
/>
</div>
<!-- 日志列表结束 -->
<custom-modal title="Log" :width="950" v-model="visible" :footer="null">
@ -139,7 +108,6 @@ export default {
data() {
this.columns = columns
return {
nameStr: '',
disableMixinCreated: true,
url: {
list: '/logManage/findFiles',
@ -153,37 +121,12 @@ export default {
visible: false,
isGettingDetail: false,
logInfo: [],
ipagination: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
const { current, pageSize } = this.ipagination
return `Total ${total} items Page ${current} / ${Math.ceil(total / pageSize)}`
},
showQuickJumper: true,
showSizeChanger: true,
total: 0,
},
}
},
created() {
this.getTreeData()
},
methods: {
onSearch() {
this.loadData()
},
handlePageChange(page, pageSize) {
this.ipagination.current = page
this.ipagination.pageSize = pageSize
this.loadData()
},
handleSizeChange(current, size) {
this.ipagination.current = current
this.ipagination.pageSize = size
this.loadData()
},
async getTreeData() {
try {
this.isGettingTreeData = true
@ -221,8 +164,6 @@ export default {
},
onSelect() {
this.queryParam.path = this.selectedKeys[0]
this.ipagination.current = 1
this.ipagination.pageSize = 10
this.loadData()
},
@ -238,14 +179,10 @@ export default {
this.onClearSelected()
var params = this.getQueryParams() //
params.name = this.nameStr
params.pageNo = this.ipagination.current
params.pageSize = this.ipagination.pageSize
this.loading = true
getAction(this.url.list, params)
.then(({ result: { records, total } }) => {
this.dataSource = records
this.ipagination.total = total
.then((res) => {
this.dataSource = res
})
.finally(() => {
this.loading = false
@ -365,10 +302,6 @@ export default {
}
}
}
&-list {
position: relative;
overflow: hidden;
}
}
.log-detail {
@ -381,59 +314,4 @@ export default {
}
}
}
.search-bar {
height: 50px;
border-top: 1px solid rgba(13, 235, 201, 0.3);
border-bottom: 1px solid rgba(13, 235, 201, 0.3);
margin-bottom: 15px;
padding: 8px 10px;
background: rgba(12, 235, 201, 0.05);
}
.ant-input {
width: 266px;
}
::v-deep {
.ant-form-item {
display: flex;
margin-bottom: 0;
.ant-form-item-label,
.ant-form-item-control {
line-height: 32px;
height: 32px;
}
.ant-form-item-label {
flex-shrink: 0;
margin-right: 10px;
label {
font-size: 16px;
font-family: ArialMT;
color: #ade6ee;
&::after {
display: none;
}
}
}
.ant-calendar-range-picker-separator {
color: white;
}
.ant-form-item-control-wrapper {
width: 100%;
// overflow: hidden;
}
}
}
.search-btn {
margin-bottom: 10px;
img {
width: 16px;
height: 17px;
margin-right: 9px;
}
}
.ant-pagination {
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
}
</style>

View File

@ -14,7 +14,7 @@
style="width: 154px"
class="sample-select"
></custom-select>
<pop-over-with-icon placement="right" v-model="qcFlagsVisible" :auto-adjust-overflow="false">
<pop-over-with-icon placement="right" v-model="qcFlagsVisible">
QC Flags
<beta-gamma-qc-flags slot="content" :data="qcFlags" @click="handleQcFlagClick" />
</pop-over-with-icon>
@ -121,7 +121,6 @@
</template>
<script>
import { addSampleData, getSampleData, sampleList, setSampleList, updateSampleData } from '@/utils/SampleStore'
import { getAction, postAction } from '../../api/manage'
import BetaGammaChartContainer from './components/BetaGammaChartContainer.vue'
import BetaGammaSpectrumChart from './components/BetaGammaSpectrumChart.vue'
@ -135,7 +134,6 @@ import PopOverWithIcon from './components/SubOperators/PopOverWithIcon.vue'
import Spectra from './components/SubOperators/Spectra.vue'
import CustomSelect from '@/components/CustomSelect/index.vue'
import axios from 'axios'
import { cloneDeep } from 'lodash'
const StatisticsType = {
'Collection Time': 'Colloc_Time',
@ -190,19 +188,17 @@ export default {
analyseCurrentSpectrum: {
type: Object,
},
sampleList: {
type: Array,
required: true,
},
},
data() {
this.SampleType = SampleType
this.sampleDetail = {}
return {
currSpectrum: '',
// analyseCurrentSpectrum: {},
qcFlags: {},
sampleDetail: {},
spectraVisible: false,
spectraType: 'sample',
@ -231,6 +227,7 @@ export default {
statisticModalVisible: false, // Qc Flags
statisticsType: StatisticsType['Collection Time'],
currSample: {},
copyXeData: null,
qcFlagsVisible: false,
}
},
@ -242,7 +239,7 @@ export default {
this.qcFlagsVisible = true
}, 100)
},
beforeDestroy() {
destroyed() {
this.cancelLastRequest()
this.$bus.$off('ReAnalyses', this.handleReAnalyse)
@ -294,7 +291,7 @@ export default {
}
}
this.changeChartByType(this.spectraType, result.XeData)
this.changeChartByType(this.spectraType)
},
handleGetFlag(val, obj) {
@ -310,8 +307,8 @@ export default {
const { dbName, sampleId, inputFileName, analyst } = this.sample
try {
this.cancelLastRequest()
this.isLoading = true
this.cancelLastRequest()
const cancelToken = this.createCancelToken()
const { success, result, message } = await getAction(
'/spectrumAnalysis/getDBSpectrumChart',
@ -323,12 +320,11 @@ export default {
cancelToken
)
if (success) {
this.isLoading = false
this.sampleDetail = result
this.changeChartByType('sample')
this.emitGetFiles(result)
addSampleData({
this.$store.commit('ADD_SAMPLE_DATA', {
inputFileName,
data: result,
from: 'db',
@ -338,11 +334,9 @@ export default {
}
} catch (error) {
console.error(error)
const isCancel = axios.isCancel(error)
if (!isCancel) {
} finally {
this.isLoading = false
}
}
},
emitGetFiles(result) {
@ -362,8 +356,8 @@ export default {
qcFileName: this.sample.qcFileStatus ? this.sample.qcFileName : '',
}
try {
this.cancelLastRequest()
this.isLoading = true
this.cancelLastRequest()
const cancelToken = this.createCancelToken()
const { success, result, message } = await getAction(
'/spectrumAnalysis/getFileSpectrumChart',
@ -374,29 +368,23 @@ export default {
this.sampleDetail = result
this.changeChartByType('sample')
addSampleData({
this.$store.commit('ADD_SAMPLE_DATA', {
inputFileName: this.sample.sampleFileName,
data: result,
from: 'file',
})
this.isLoading = false
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
const isCancel = axios.isCancel(error)
if (!isCancel) {
this.isLoading = false
}
}
},
cancelLastRequest() {
if (this._cancelToken && typeof this._cancelToken == 'function') {
this._cancelToken()
this._cancelToken = undefined
}
},
@ -407,7 +395,7 @@ export default {
return cancelToken
},
changeChartByType(val, data) {
changeChartByType(val) {
if (val === 'qc' && !this.sampleDetail.qc) {
this.$message.warning('No qc spectrum file!')
} else {
@ -458,7 +446,12 @@ export default {
console.log('this.resultDisplaythis.resultDisplay', this.resultDisplay)
this.resultDisplay = data ? data : XeData
this.resultDisplay = this.copyXeData
? this.copyXeData
: this.resultDisplay.length > 0
? this.resultDisplay
: XeData
this.sortResultDisplay()
this.$emit('sendInfo', this.resultDisplay, this.spectrumData.stationCode, savedAnalysisResult)
@ -554,108 +547,48 @@ export default {
// this.isReAnalyed_beta = true
// this.analyseCurrentSpectrum = res.result
this.$emit('sendXeData', res.result.XeData)
// if (res.result.XeData && res.result.XeData.length > 0) {
if (res.result.XeData && res.result.XeData.length > 0) {
res.result.XeData.forEach((item) => {
item.conc = parseFloat(item.conc.toPrecision(6))
item.concErr = parseFloat(item.concErr.toPrecision(6))
item.lc = parseFloat(item.lc.toPrecision(6))
item.mdc = parseFloat(item.mdc.toPrecision(6))
})
this.$emit('reAnalyCurr', res.result.savedAnalysisResult, res.result.XeData)
this.$emit('reAnalyCurr', true, res.result.XeData)
this.copyXeData = res.result.XeData
this.handleReAnalyse(res.result)
updateSampleData({
inputFileName: this.sample.inputFileName,
key: 'XeData',
data: res.result.XeData,
})
updateSampleData({
inputFileName: this.sample.inputFileName,
key: 'savedAnalysisResult',
data: res.result.savedAnalysisResult,
})
if (res.result.bProcessed) {
this.$message.success(res.result.message)
} else {
this.$message.warning(res.result.message)
}
// }
} else {
this.$message.warning(res.message)
}
})
},
//
async getAnalyzeAllSpectrum() {
const regExp = /^([A-Z]{1,}\d{1,})_/
const regMatched = this.sample.inputFileName.match(regExp)
const currStationName = regMatched[1]
const dbNames = [],
sampleIds = [],
sampleFileNames = [],
gasFileNames = [],
detFileNames = [],
qcFileNames = []
const matchedSampleList = this.sampleList.filter((item) => item.inputFileName.includes(currStationName))
matchedSampleList.forEach(
({ dbName, sampleId, inputFileName, sampleFileName, gasFileName, detFileName, qcFileName, qcFileStatus }) => {
dbNames.push(dbName || '')
sampleIds.push(sampleId || '')
sampleFileNames.push(sampleFileName || inputFileName || '')
gasFileNames.push(gasFileName || '')
detFileNames.push(detFileName || '')
qcFileNames.push(qcFileStatus ? qcFileName : '')
}
)
const params = {
dbNames,
sampleIds,
sampleFileNames,
gasFileNames,
detFileNames,
qcFileNames,
getAnalyzeAllSpectrum() {
let params = {
dbNames: [this.sample.dbName],
sampleIds: [this.sample.sampleId ? this.sample.sampleId : ''],
sampleFileNames: [this.sample.inputFileName],
gasFileNames: [this.sample.gasFileName],
detFileNames: [this.sample.detFileName],
qcFileNames: [this.sample.qcFileName],
currentFileName: this.sample.inputFileName,
}
const { success, result, message } = await postAction('/spectrumAnalysis/analyseAllSpectrum', params)
if (success) {
//
Object.entries(result).forEach(([inputFileName, sampleInfo]) => {
const { XeData, savedAnalysisResult, bProcessed, message } = sampleInfo
XeData.forEach((item) => {
postAction('/spectrumAnalysis/analyseAllSpectrum', params).then((res) => {
if (res.success) {
// this.analyseCurrentSpectrum = res.result
this.$emit('sendXeData', res.result.XeData)
res.result.XeData.forEach((item) => {
item.conc = parseFloat(item.conc.toPrecision(6))
item.concErr = parseFloat(item.concErr.toPrecision(6))
item.lc = parseFloat(item.lc.toPrecision(6))
item.mdc = parseFloat(item.mdc.toPrecision(6))
})
if (inputFileName == this.sample.inputFileName) {
this.$emit('sendXeData', XeData)
this.$emit('reAnalyAll', savedAnalysisResult, XeData)
this.handleReAnalyse(sampleInfo)
if (bProcessed) {
this.$message.success(message)
this.$emit('reAnalyAll', true, res.result.XeData)
} else {
this.$message.warning(message)
this.$message.warning(res.message)
}
}
updateSampleData({
inputFileName,
key: 'XeData',
data: XeData,
})
updateSampleData({
inputFileName,
key: 'savedAnalysisResult',
data: savedAnalysisResult,
})
})
} else {
this.$message.warning(message)
}
},
//
@ -718,10 +651,8 @@ export default {
sample: {
async handler(newVal, oldVal) {
this.resultDisplay = []
const sampleData = getSampleData(newVal.inputFileName)
const sampleData = await this.$store.dispatch('GET_SAMPLE_DATA', newVal.inputFileName)
if (sampleData) {
this.cancelLastRequest()
this.isLoading = false
const { data, from } = sampleData
this.sampleDetail = data
this.changeChartByType('sample')
@ -736,7 +667,6 @@ export default {
this.getSampleDetail_file()
}
}
await this.$nextTick()
this.$refs.betaGammaChartRef.handleUnzoom()
},
immediate: true,
@ -745,8 +675,13 @@ export default {
analyseCurrentSpectrum: {
handler(newVal, oldVal) {
// this.currResultDisplay = newVal.XeData
this.resultDisplay = cloneDeep(newVal.XeData) || []
this.resultDisplay = newVal.XeData || []
this.sortResultDisplay()
this.$store.commit('UPDATE_SAMPLE_DATA', {
inputFileName: this.sample.inputFileName,
key: 'XeData',
data: newVal.XeData,
})
},
// immediate: true,
deep: true,
@ -790,7 +725,6 @@ export default {
.pop-over-with-icon {
height: 32px;
flex-shrink: 0;
&:nth-child(1) {
width: 224px;

View File

@ -1,5 +1,5 @@
import { deleteAction } from '@/api/manage'
import { removeSampleData } from '@/utils/SampleStore'
import store from '@/store'
import Vue from 'vue'
/**
@ -16,7 +16,7 @@ export const clearSampleCache = sampleList => {
params = { sampleFileName: fileName }
}
deleteAction(url, params)
removeSampleData(fileName)
store.commit('REMOVE_SAMPLE_DATA', fileName)
Vue.ls.remove(`CALIBRATION_GAMMA_${fileName}`)
Vue.ls.remove(`CALIBRATION_BETA_${fileName}`)
})

View File

@ -327,6 +327,7 @@ export default {
},
}
},
mounted() {
this.opts.notMerge = true
this.$nextTick(() => {
@ -564,20 +565,13 @@ export default {
// 3D
histogramDataDList: {
handler(newVal) {
let maxCount = 0
const data = []
for (const item of newVal) {
const { b, g, c } = item //
if (c > maxCount) maxCount = c
data.push([b, g, c])
}
const maxCount = Math.max(...newVal.map((item) => item.c))
this.threeDSurfaceOption.zAxis3D.max = Math.ceil(maxCount * 1.2)
this.threeDSurfaceOption.series.data = data // 设置3D surface数据 // 第一次设置耗时较多
this.threeDSurfaceOption.series.data = newVal.map((item) => [item.b, item.g, item.c]) // 3D surface
this.threeDSurfaceOption.visualMap.max = maxCount
this.threeDScatterOption.zAxis3D.max = Math.ceil(maxCount * 1.2)
this.threeDScatterOption.series.data = data // 3D scatter
this.threeDScatterOption.series.data = newVal.map((item) => [item.b, item.g, item.c]) // 3D scatter
this.threeDScatterOption.visualMap.max = maxCount
},
immediate: true,

View File

@ -223,12 +223,11 @@ import { buildLineSeries, findSeriesByName, getXAxisAndYAxisByPosition, rangeNum
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
import GeneralCommentModal from './components/GeneralCommentModal.vue'
import EditSlopeModal from './components/EditSlopeModal.vue'
// import Response from './Response.json'
import Response from './Response.json'
import { updateBaseLine } from '@/utils/WasmHelper'
import RectList from './components/RectList.vue'
import { isNullOrUndefined } from '@/utils/util'
import { findNearPeak, getLineData, transformPointListData } from '@/utils/sampleHelper'
import { getSampleData } from '@/utils/SampleStore'
//
const initialOption = {
@ -515,7 +514,7 @@ export default {
}
},
methods: {
getInfo() {
async getInfo() {
this.option.series = []
this.thumbnailOption.series = []
this.list = []
@ -523,7 +522,7 @@ export default {
const { inputFileName } = this.sampleData
const currSampleDetailInfo = getSampleData(inputFileName)
const currSampleDetailInfo = await this.$store.dispatch('GET_SAMPLE_DATA', inputFileName)
const {
data: { allData, shadowChannelChart, shapeChannelData, peak, BaseCtrls, barChart },
} = currSampleDetailInfo
@ -584,8 +583,8 @@ export default {
this.handleResetChart()
},
beforeModalOpen() {
this.getInfo()
async beforeModalOpen() {
await this.getInfo()
this.reset()
},
@ -1563,16 +1562,14 @@ export default {
try {
this.$set(this.selectedTableItem, '_deleting', true)
const { inputFileName: fileName } = this.sampleData
const { success, result, message } = await postAction('/gamma/deleteNuclide', {
const { success, message } = await postAction('/gamma/deleteNuclide', {
curRow: this.curRow,
nuclideName: this.model.identifiedNuclide,
fileName,
list_identify: nuclides,
})
if (success) {
const { identify, table } = result
this.selectedTableItem.nuclides = identify
this.list = table
nuclides.splice(findIndex, 1)
} else {
this.$message.error(message)
}

View File

@ -629,7 +629,7 @@ export default {
this.$bus.$on('betaRefresh', this.getData)
this.getData()
},
beforeDestroy() {
destroyed() {
this.$bus.$off('betaRefresh', this.handleReset)
this.$bus.$off('betaRefresh', this.getData)
},

View File

@ -50,7 +50,6 @@ import { postAction } from '@/api/manage'
import BetaDetectorCalibration from './components/BetaDetectorCalibration.vue'
import GammaDetectorCalibration from './components/GammaDetectorCalibration.vue'
import TitleOverBorder from '@/views/spectrumAnalysis/components/TitleOverBorder.vue'
import { removeSampleData } from '@/utils/SampleStore'
export default {
components: { BetaDetectorCalibration, GammaDetectorCalibration, TitleOverBorder },
mixins: [ModalMixin, SampleDataMixin],
@ -154,15 +153,11 @@ export default {
item.mdc = parseFloat(item.mdc.toPrecision(6))
})
this.$emit('sendXeData', res.result.XeData)
this.$emit('reAnalyCurr', res.result.savedAnalysisResult, res.result.XeData)
this.$emit('reAnalyCurr', true, res.result.XeData)
this.$message.success('Analyse Success!')
this.isReanlyze = true
this.handleExit()
this.$bus.$emit('ReAnalyses', res.result)
if (res.result.bProcessed) {
this.$message.success(res.result.message)
} else {
this.$message.warning(res.result.message)
}
if (this.newCalibrationIsAppliedTo == 'AllSpectrum') {
let sameStation = matchedSampleList.filter(
@ -180,7 +175,8 @@ export default {
//
clearSameStationCache(sampleList) {
sampleList.forEach(({ inputFileName }) => {
removeSampleData(inputFileName)
console.log('inputFileName>>' + inputFileName)
this.$store.commit('REMOVE_SAMPLE_DATA', inputFileName)
})
},
// Calibration 20231115xiao

View File

@ -221,6 +221,7 @@ export default {
//
handleSourceChange() {
console.log('%c [ ]-226', 'font-size:13px; background:pink; color:#bf2c9f;', this.queryParam.dbName)
this.searchQuery()
},

View File

@ -26,7 +26,7 @@
<div class="peak-info">
<button-with-switch-icon @change="handlePeakInfoChange" @click="handleTogglePeak"></button-with-switch-icon>
</div>
<pop-over-with-icon placement="right" v-model="subOperatorsState.qcFlagsVisible" :auto-adjust-overflow="false">
<pop-over-with-icon placement="right" v-model="subOperatorsState.qcFlagsVisible">
QC Flags
<qc-flags slot="content" :data="qcFlags" />
</pop-over-with-icon>
@ -111,7 +111,7 @@ import GraphAssistance from './components/SubOperators/GraphAssistance/GraphAssi
import NuclideLibrary from './components/SubOperators/NuclideLibrary.vue'
import ButtonWithSwitchIcon from './components/SubOperators/ButtonWithSwitchIcon.vue'
import { getAction, postAction } from '@/api/manage'
// import Response from './response.json'
import Response from './response.json'
import {
buildLineSeries,
findSeriesByName,
@ -136,7 +136,6 @@ import { readFile, zipFile } from '@/utils/file'
import { findNearPeak } from '@/utils/sampleHelper'
import { add, subtract } from 'xe-utils/methods'
import { PHDParser, isSample, getSampleTypeIdentify } from '@/utils/phdHelper'
import { addSampleData, getSampleData } from '@/utils/SampleStore'
export default {
props: {
@ -164,36 +163,6 @@ export default {
StripModal,
},
data() {
this.channelData = {
peakGroup: [],
spectrumLine: null,
baseLine: null,
lcLine: null,
scacLine: null,
all: null,
baseLineCP: [],
compareLine: null,
stripSumOrCutLine: null,
stripReferenceLine: null,
}
this.energyData = {
peakGroup: [],
spectrumLine: null,
baseLine: null,
lcLine: null,
scacLine: null,
all: null,
baseLineCP: [],
compareLine: null,
stripSumOrCutLine: null,
stripReferenceLine: null,
}
this.peakList = [] // Peak
this.baseCtrls = {} // BaseCtrls
return {
abc: false,
isLoading: false,
@ -214,6 +183,35 @@ export default {
qcFlagsVisible: false,
},
channelData: {
peakGroup: [],
spectrumLine: null,
baseLine: null,
lcLine: null,
scacLine: null,
all: null,
baseLineCP: [],
compareLine: null,
stripSumOrCutLine: null,
stripReferenceLine: null,
},
energyData: {
peakGroup: [],
spectrumLine: null,
baseLine: null,
lcLine: null,
scacLine: null,
all: null,
baseLineCP: [],
compareLine: null,
stripSumOrCutLine: null,
stripReferenceLine: null,
},
peakList: [], // Peak
baseCtrls: {}, // BaseCtrls
nuclideLibraryList: [], // channel
peakInfomationTooltip: {
// Peak Infomation
@ -254,7 +252,7 @@ export default {
window.addEventListener('keydown', this.handleKeyboardEvent)
window.addEventListener('click', this.closePeakInfomationTooltip)
},
beforeDestroy() {
destroyed() {
this.cancelLastRequest()
this.$bus.$off('gammaRefresh', this.handleRefresh)
@ -264,16 +262,8 @@ export default {
window.removeEventListener('click', this.closePeakInfomationTooltip)
if (this.qcFlagsTimer) {
window.clearTimeout(this.qcFlagsTimer)
clearTimeout(this.qcFlagsTimer)
}
this.closeWebSocket()
if (this.websocketTimer) {
window.clearTimeout(this.websocketTimer)
}
this.websock = null
},
deactivated() {
// Object.keys(this.subOperatorsState).forEach(k => {
@ -473,10 +463,10 @@ export default {
let token = Vue.ls.get(ACCESS_TOKEN)
this.websock = new WebSocket(url, [token])
//update-end-author:taoyan date:2022-4-22 for: v2.4.6 websocket #3278
this.websock.addEventListener('open', this.websocketOnopen)
this.websock.addEventListener('error', this.websocketOnerror)
this.websock.addEventListener('message', this.websocketOnmessage)
this.websock.addEventListener('close', this.websocketOnclose)
this.websock.onopen = this.websocketOnopen
this.websock.onerror = this.websocketOnerror
this.websock.onmessage = this.websocketOnmessage
this.websock.onclose = this.websocketOnclose
},
websocketOnopen: function () {
// console.log('WebSocket1231')
@ -502,32 +492,19 @@ export default {
if (that.lockReconnect) return
that.lockReconnect = true
//
this.websocketTimer = setTimeout(function () {
setTimeout(function () {
console.info('尝试重连...')
that.initWebSocket()
that.lockReconnect = false
}, 20000)
},
// websocket
closeWebSocket() {
if (this.websock) {
this.websock.removeEventListener('open', this.websocketOnopen)
this.websock.removeEventListener('error', this.websocketOnerror)
this.websock.removeEventListener('message', this.websocketOnmessage)
this.websock.removeEventListener('close', this.websocketOnclose)
this.websock.close()
this.websock = null
}
},
//
async getSampleDetail() {
const { dbName, sampleId, analyst } = this.sample
try {
this.isLoading = true
// const { success, result, message } = Response
this.cancelLastRequest()
this.isLoading = true
const cancelToken = this.createCancelToken()
const { success, result, message } = await getAction(
@ -539,6 +516,7 @@ export default {
},
cancelToken
)
console.log('%c [ result ]-243', 'font-size:13px; background:pink; color:#bf2c9f;', result)
if (success) {
this.dataProcess(result, 'db')
} else {
@ -547,19 +525,17 @@ export default {
}
} catch (error) {
console.error(error)
const isCancel = axios.isCancel(error)
if (!isCancel) {
this.isLoading = false
}
}
},
async getSampleDetail_file() {
const { inputFileName: fileName } = this.sample
try {
// const { success, result, message } = Response
this.cancelLastRequest()
this.isLoading = true
// const { success, result, message } = Response
this.cancelLastRequest()
const cancelToken = this.createCancelToken()
const { success, result, message } = await getAction(
@ -569,6 +545,7 @@ export default {
},
cancelToken
)
console.log('%c [ result ]-243', 'font-size:13px; background:pink; color:#bf2c9f;', result)
if (success) {
this.dataProcess(result, 'file')
} else {
@ -577,17 +554,13 @@ export default {
}
} catch (error) {
console.error(error)
const isCancel = axios.isCancel(error)
if (!isCancel) {
this.isLoading = false
}
}
},
cancelLastRequest() {
if (this._cancelToken && typeof this._cancelToken == 'function') {
this._cancelToken()
this._cancelToken = undefined
}
},
@ -601,7 +574,7 @@ export default {
dataProcess(result, flag) {
const { inputFileName } = this.sample
addSampleData({
this.$store.commit('ADD_SAMPLE_DATA', {
inputFileName,
data: result,
from: flag,
@ -2079,14 +2052,12 @@ export default {
immediate: true,
},
sample: {
handler(newVal, oldVal) {
async handler(newVal, oldVal) {
console.log('newValnewVal', newVal)
this.graphAssistance.axisType = 'Channel'
this.handleResetState()
const sampleData = getSampleData(newVal.inputFileName)
const sampleData = await this.$store.dispatch('GET_SAMPLE_DATA', newVal.inputFileName)
if (sampleData) {
this.cancelLastRequest()
this.isLoading = false
this.dataProcess(sampleData.data, sampleData.from)
} else {
if (newVal.sampleId) {
@ -2148,7 +2119,6 @@ export default {
overflow: auto;
height: 46px;
align-items: center;
flex-shrink: 0;
.pop-over-with-icon {
height: 32px;
@ -2170,7 +2140,7 @@ export default {
.peak-info {
width: 226px;
height: 32px;
flex-shrink: 0;
display: inline-block;
}
}
//
@ -2214,6 +2184,5 @@ export default {
pointer-events: none;
background-color: #55a9fe;
border-color: #55a9fe;
user-select: none;
}
</style>

View File

@ -63,7 +63,6 @@
:sampleInfo="sampleInfo"
:sample="sampleData"
:analyseCurrentSpectrum="analyseCurrentSpectrumData"
:sampleList="sampleList"
/>
<!-- Beta-Gamma 分析 -->
<div v-else class="empty">Please Select a Sample</div>
@ -282,7 +281,6 @@ import BGLogViewer from './components/Modals/BetaGammaModals/BGLogViewer.vue'
import { saveAs } from 'file-saver'
import CompareFromDbModal from './components/Modals/CompareFromDBModal.vue'
import { clearSampleData, getSampleData, updateSampleDataAnaly } from '@/utils/SampleStore'
//
const ANALYZE_TYPE = {
@ -467,9 +465,9 @@ export default {
window.addEventListener('beforeunload', this.handleCleanAll)
},
beforeDestroy() {
destroyed() {
this.$bus.$off('reanalyse', this.handleReanalyse)
clearSampleData()
this.$store.commit('CLEAR_SAMPLE_DATA')
this.handleCleanAll()
window.removeEventListener('beforeunload', this.handleCleanAll)
},
@ -477,13 +475,11 @@ export default {
methods: {
getReAnalyCurr(flag, val) {
this.isReAnalyed_beta = flag
this.params_toDB.savedAnalysisResult = flag
this.params_toDB.savedAnalysisResult = true
this.resultDisplayFlag = val
},
getReAnalyAll(flag, val) {
this.isReAnalyed_beta = flag
getReAnalyAll(val) {
this.resultDisplayFlag = val
this.params_toDB.savedAnalysisResult = flag
},
handleReAnalyed(val) {
this.isReAnalyed_gamma = val
@ -505,7 +501,6 @@ export default {
}
this.resultDisplayFlag = arg
this.params_toDB.stationName = val
this.params_toDB.savedAnalysisResult = flag
this.isReAnalyed_beta = this.isReAnalyed_beta ? this.isReAnalyed_beta : flag
},
getCheckFlag(val) {
@ -514,10 +509,10 @@ export default {
this.params_toDB.checkDet = val.checkDet
},
getXeData(val) {
// if (val && val.length) {
if (val && val.length) {
this.$set(this.analyseCurrentSpectrumData, 'XeData', val)
this.resultDisplayFlag = val
// }
}
},
// formDB sampleData
getFiles(val) {
@ -607,16 +602,16 @@ export default {
//
async loadSelectedSample(sample) {
console.log('%c [ sample ]-381', 'font-size:13px; background:pink; color:red;', sample)
// Bbeta-gamma P Ggamma
if (sample.sampleType == 'B') {
this.analysisType = ANALYZE_TYPE.BETA_GAMMA
const sampleData = getSampleData(sample.inputFileName)
this.params_toDB.savedAnalysisResult = sampleData ? sampleData.data.savedAnalysisResult : false
} else {
this.analysisType = ANALYZE_TYPE.GAMMA
}
this.sampleData = this.newSampleData = sample
this.currSampleDet = this.allSampleDet[sample.inputFileName]
this.params_toDB.savedAnalysisResult = sample.sampleId ? true : false
this.params_toDB.comment = ''
},
@ -847,6 +842,7 @@ export default {
* @param { 'all' | 'current' } type
*/
handleSavePHDToFile(type) {
console.log('%c [ savePHDToFile ]-162', 'font-size:13px; background:pink; color:#bf2c9f;', type)
if (this.isGamma) {
if (type == 'current') {
let params = {
@ -906,7 +902,7 @@ export default {
try {
const { success, result, message } = await postAction(`/gamma/Reprocessing?fileName=${fileNames[0]}`)
if (success) {
updateSampleDataAnaly({
this.$store.commit('UPDATE_SAMPLE_DATA_ANALY', {
inputFileName: fileNames[0],
data: result,
})
@ -1764,8 +1760,6 @@ export default {
<style lang="less">
.spectrum-analysis-operators-dropdown-overlay {
background-color: #03353f;
z-index: 999;
.ant-menu {
background: transparent;
padding: 0;

View File

@ -169,16 +169,18 @@
<div class="route-form-item">
<div class="label">Start Date</div>
<custom-date-picker
format="YYYY-MM-DD"
valueFormat="YYYY-MM-DD"
show-time
format="YYYY/MM/DD HH:mm:ss"
valueFormat="YYYY/MM/DD HH:mm:ss"
v-model="routeParams.startDate"
></custom-date-picker>
</div>
<div class="route-form-item">
<div class="label">End Date</div>
<custom-date-picker
format="YYYY-MM-DD"
valueFormat="YYYY-MM-DD"
show-time
format="YYYY/MM/DD HH:mm:ss"
valueFormat="YYYY/MM/DD HH:mm:ss"
v-model="routeParams.endDate"
></custom-date-picker>
</div>

View File

@ -80,8 +80,8 @@ const initialOption = {
// `
return `
<div>${params.marker}${params.name}</div>
<div>START${dayjs(params.value[4]).format('YYYY-MM-DD HH:mm:ss')}</div>
<div style="white-space: pre"> END${dayjs(params.value[2]).format('YYYY-MM-DD HH:mm:ss')}</div>
<div>START${dayjs.utc(params.value[4]).format('YYYY-MM-DD HH:mm:ss')}</div>
<div style="white-space: pre"> END${dayjs.utc(params.value[2]).format('YYYY-MM-DD HH:mm:ss')}</div>
`
},
},
@ -190,7 +190,7 @@ export default {
let now = dayjs(new Date())
now = now.add(1, 'hour').set('minute', 0).set('second', 0).set('millisecond', 0)
const max = dayjs(dayjs.utc(now.valueOf()).format('YYYY-MM-DD HH:mm:ss')).valueOf()
const max = now.valueOf()
const min = max - this.scaleSettings.cacheTime * 24 * 60 * 60 * 1000
const option = cloneDeep(initialOption)
const { grid, xAxis, yAxis, series, dataZoom } = option
@ -212,7 +212,7 @@ export default {
formatter: (val) => {
// let dateTime = new Date(val)
// return dayjs.utc(dateTime).format('HH:mm\nMM/DD')
return dayjs(val).format('HH:mm\nMM/DD')
return dayjs.utc(val).format('HH:mm\nMM/DD')
},
color: '#ade6ee',
},

View File

@ -183,6 +183,19 @@ export default {
ScrollContainer,
DataListItem,
},
watch: {
$route: {
handler: function (val, oldVal) {
console.log('fasdfasde12312', val)
console.log('8765432', oldVal)
if (val.name === 'station-operation') {
this.getDataProvisionEfficiency(this.markerList_clone)
}
},
deep: true,
// immediate: true,
},
},
deactivated() {
//
console.log('切换出发了3')
@ -192,8 +205,6 @@ export default {
},
activated() {
this.getFollowedStationList()
this.getStationList()
this.getStationTree()
},
data() {
return {
@ -235,7 +246,9 @@ export default {
}
},
created() {
this.getStationList()
this.getStationTypeList()
this.getStationTree()
},
beforeDestroy() {
clearInterval(this.timer)
@ -257,7 +270,7 @@ export default {
this.markerList = cloneDeep(res).filter((stationInfo) => stationInfo.stationType !== MarkerType.NuclearFacility) //
this.markerList_clone = cloneDeep(res)
this.getDataProvisionEfficiency(this.markerList_clone)
this.getDataProvisionEfficiency(this.markerList_clone, 'one')
// this.timer = setInterval(() => {
// setTimeout(() => {
// this.getDataProvisionEfficiency(this.markerList_clone)
@ -274,18 +287,17 @@ export default {
},
//
async getDataProvisionEfficiency(arr) {
async getDataProvisionEfficiency(arr, str) {
this.httpNum++
if (!this.loaded && this.$route.path == '/station-operation') {
if (str && this.$route.path == '/station-operation') {
this.$message.loading({ content: 'Loading station data, please wait...', key, duration: 0 })
}
getAction('/stationOperation/getDataProvisionEfficiency')
.then((res) => {
if (res.success) {
this.$message.destroy()
if (!this.loaded && this.$route.path == '/station-operation') {
if (str && this.$route.path == '/station-operation') {
this.$message.success({ content: 'Loaded!', key, duration: 2 })
this.loaded = true
}
res.result.forEach((item) => {
if (Object.prototype.toString.call(item) == '[object Object]') {

View File

@ -195,13 +195,6 @@
</a-spin>
</custom-modal>
<!-- 增加/编辑排班弹窗结束 -->
<custom-modal title="Failure record" v-model="visibleRes" :footer="null">
<a-table size="middle" :columns="columns" :dataSource="dataSource" :pagination="false" :scroll="{ y: 600 }">
<template slot="index" slot-scope="{ index }">
{{ index + 1 }}
</template>
</a-table>
</custom-modal>
</div>
</template>
<script>
@ -257,41 +250,6 @@ export default {
dragItem: null,
fromUserId: '',
stationName: '',
visibleRes: false,
columns: [
{
title: 'NO',
align: 'left',
scopedSlots: {
customRender: 'index',
},
customHeaderCell: () => {
return {
style: {
'padding-left': '60px !important',
},
}
},
customCell: () => {
return {
style: {
'padding-left': '60px !important',
},
}
},
},
{
title: 'LINE',
align: 'left',
dataIndex: 'line',
},
{
title: 'RESULT',
align: 'left',
dataIndex: 'result',
},
],
dataSource: [],
}
},
created() {
@ -463,10 +421,8 @@ export default {
try {
const formData = new FormData()
formData.append('file', file)
const { success, failure, detailList } = await postAction('/sysTask/importExcel', formData)
const { success, failure } = await postAction('/sysTask/importExcel', formData)
this.$message.success(`${success} Success, ${failure} Fail`)
this.dataSource = detailList
this.visibleRes = true
this.isImport = false
this.getList()
} catch (error) {