Browse Source

正在检测

master
maochaoying 2 years ago
parent
commit
ad4c187be6
  1. 8
      src/components/Excel.vue
  2. 35
      src/components/Task.vue
  3. 8
      src/store/modules/task.js

8
src/components/Excel.vue

@ -13,9 +13,10 @@
</template> </template>
<script setup> <script setup>
import { useImageStore } from '@/store'
import { useImageStore, useTaskStore } from '@/store'
const imageStore = useImageStore() const imageStore = useImageStore()
const taskStore = useTaskStore()
const props = defineProps({ const props = defineProps({
excelData: { excelData: {
type: Array, type: Array,
@ -47,7 +48,10 @@ const getClass = index => {
} else if (item.result == 2) { } else if (item.result == 2) {
// //
return 'box fail' return 'box fail'
} else if (item.result == 3) {
} else if (
taskStore.currentCoord == item.serialNumber &&
taskStore.taskStatus == 1
) {
// //
return 'box process' return 'box process'
} else { } else {

35
src/components/Task.vue

@ -198,12 +198,7 @@ export default {
: 'start_table_btn' : 'start_table_btn'
} }
onClick={() => onClick={() =>
this.startTask(
row.id,
row.nuclearCoreName,
1,
row.canUpload,
)
this.startTask(row, row.nuclearCoreName, 1, row.canUpload)
} }
> >
开始任务 开始任务
@ -219,14 +214,18 @@ export default {
</div> </div>
) )
} else if (row.status == 2) { } else if (row.status == 2) {
return (
<div
class="continue_table_btn"
onClick={() => this.startTask(row.id, row.nuclearCoreName)}
>
继续任务
</div>
)
if (this.role == 'ROLE_ADMIN') {
return <div class="process_table_btn">任务暂停</div>
} else {
return (
<div
class="continue_table_btn"
onClick={() => this.startTask(row, row.nuclearCoreName)}
>
继续任务
</div>
)
}
} else { } else {
return ( return (
<div class="finished_table_btn"> <div class="finished_table_btn">
@ -435,15 +434,17 @@ export default {
accountStore.changePage(0) accountStore.changePage(0)
taskStore.updateCurrentDetailTaskId(null) taskStore.updateCurrentDetailTaskId(null)
}, },
startTask(taskId, coreName, flag, canUpload) {
startTask(row, coreName, flag, canUpload) {
if (flag == 1 && canUpload) { if (flag == 1 && canUpload) {
return return
} }
taskStore.updateTaskStatus(row.status)
taskStore.updateCurrentCoord(row.currentCoord)
imageStore.updateNuclearCoreName(coreName) imageStore.updateNuclearCoreName(coreName)
imageStore.updateShowImage(false) imageStore.updateShowImage(false)
accountStore.changePage(0) accountStore.changePage(0)
taskStore.getExcelList(taskId)
taskStore.updateCurrentTaskId(taskId)
taskStore.getExcelList(row.id)
taskStore.updateCurrentTaskId(row.id)
taskStore.updateCurrentDetailTaskId(null) taskStore.updateCurrentDetailTaskId(null)
}, },
viewDetail( viewDetail(

8
src/store/modules/task.js

@ -7,13 +7,21 @@ export const useTaskStore = defineStore({
type: 0, // 0为实时数据 1为历史数据 type: 0, // 0为实时数据 1为历史数据
excelData: [], excelData: [],
currentTaskId: null, currentTaskId: null,
currentCoord: null,
// 核查按钮状态 // 核查按钮状态
checkStatus: false, checkStatus: false,
currentDetailTaskId: null, currentDetailTaskId: null,
taskStatus: 0,
} }
}, },
// actions // actions
actions: { actions: {
updateTaskStatus(taskStatus) {
this.taskStatus = taskStatus
},
updateCurrentCoord(currentCoord) {
this.currentCoord = currentCoord
},
updateCheckStatus(flag) { updateCheckStatus(flag) {
this.checkStatus = flag this.checkStatus = flag
}, },

Loading…
Cancel
Save