Browse Source

详情渲染

master
maochaoying 2 years ago
parent
commit
8e6c55ae85
  1. 26
      src/components/DetailTable.vue
  2. 21
      src/components/Task.vue
  3. 2
      src/pages/index.vue
  4. 8
      src/store/modules/image.js

26
src/components/DetailTable.vue

@ -3,35 +3,43 @@
</template>
<script setup>
import { ref } from 'vue'
const data = ref([])
import { computed, ref } from 'vue'
import { useImageStore } from '@/store'
const imageStore = useImageStore()
const data = computed(() => {
const res = { ...imageStore.coreInfo }
res.nuclearCoreName = imageStore.nuclearCoreName
res.operatorName = imageStore.operatorName
res.nuclearStationName = imageStore.nuclearStationName
return [res]
})
const columns = ref([
{
colKey: 'username',
colKey: 'operatorName',
title: '操作员',
},
{
colKey: 'coord',
colKey: 'serialNumber',
title: '核查坐标',
},
{
colKey: 'detectionResult',
colKey: 'firstSign',
title: '坐标信息',
},
{
colKey: 'result',
colKey: 'resultSerial',
title: '核对结果',
},
{
colKey: 'updateTime',
colKey: 'id',
title: '核对时间',
},
{
colKey: 'statioName',
colKey: 'nuclearStationName',
title: '核电站名称',
},
{
colKey: 'coreName',
colKey: 'nuclearCoreName',
title: '核反应堆名称',
},
])

21
src/components/Task.vue

@ -330,7 +330,13 @@ export default {
theme="primary"
disabled={row.canUpload}
onClick={() =>
this.viewDetail(row.id, row.nuclearCoreName, 2)
this.viewDetail(
row.id,
row.nuclearCoreName,
2,
row.nuclearStationName,
row.operatorName,
)
}
>
详情
@ -345,6 +351,8 @@ export default {
row.id,
row.nuclearCoreName,
1,
row.nuclearStationName,
row.operatorName,
row.canUpload,
)
}
@ -438,10 +446,19 @@ export default {
taskStore.updateCurrentTaskId(taskId)
taskStore.updateCurrentDetailTaskId(null)
},
viewDetail(taskId, nuclearCoreName, flag, canUpload) {
viewDetail(
taskId,
nuclearCoreName,
flag,
nuclearStationName,
operatorName,
canUpload,
) {
if (flag == 1 && canUpload) {
return
}
imageStore.updateNuclearStationName(nuclearStationName)
imageStore.updateOperatorName(operatorName)
imageStore.updateNuclearCoreName(nuclearCoreName)
taskStore.updateCurrentDetailTaskId(taskId)
imageStore.updateShowImage(false)

2
src/pages/index.vue

@ -421,11 +421,11 @@ const getSocketdata = res => {
console.log(res)
if (res == 'update') {
//
taskStore.getExcelList(taskStore.currentTaskId)
}
}
onMounted(async () => {
// taskStore.getExcelList(1)
websocket.value = new socket()
websocket.value.WebSocketSet(getSocketdata)
})

8
src/store/modules/image.js

@ -6,10 +6,18 @@ export const useImageStore = defineStore({
nuclearCoreName: '',
coreInfo: {},
showImage: false,
operatorName: '',
nuclearStationName: '',
}
},
// actions
actions: {
updateNuclearStationName(nuclearStationName) {
this.nuclearStationName = nuclearStationName
},
updateOperatorName(operatorName) {
this.operatorName = operatorName
},
updateShowImage(showImage) {
this.showImage = showImage
},

Loading…
Cancel
Save