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> </template>
<script setup> <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([ const columns = ref([
{ {
colKey: 'username',
colKey: 'operatorName',
title: '操作员', title: '操作员',
}, },
{ {
colKey: 'coord',
colKey: 'serialNumber',
title: '核查坐标', title: '核查坐标',
}, },
{ {
colKey: 'detectionResult',
colKey: 'firstSign',
title: '坐标信息', title: '坐标信息',
}, },
{ {
colKey: 'result',
colKey: 'resultSerial',
title: '核对结果', title: '核对结果',
}, },
{ {
colKey: 'updateTime',
colKey: 'id',
title: '核对时间', title: '核对时间',
}, },
{ {
colKey: 'statioName',
colKey: 'nuclearStationName',
title: '核电站名称', title: '核电站名称',
}, },
{ {
colKey: 'coreName',
colKey: 'nuclearCoreName',
title: '核反应堆名称', title: '核反应堆名称',
}, },
]) ])

21
src/components/Task.vue

@ -330,7 +330,13 @@ export default {
theme="primary" theme="primary"
disabled={row.canUpload} disabled={row.canUpload}
onClick={() => 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.id,
row.nuclearCoreName, row.nuclearCoreName,
1, 1,
row.nuclearStationName,
row.operatorName,
row.canUpload, row.canUpload,
) )
} }
@ -438,10 +446,19 @@ export default {
taskStore.updateCurrentTaskId(taskId) taskStore.updateCurrentTaskId(taskId)
taskStore.updateCurrentDetailTaskId(null) taskStore.updateCurrentDetailTaskId(null)
}, },
viewDetail(taskId, nuclearCoreName, flag, canUpload) {
viewDetail(
taskId,
nuclearCoreName,
flag,
nuclearStationName,
operatorName,
canUpload,
) {
if (flag == 1 && canUpload) { if (flag == 1 && canUpload) {
return return
} }
imageStore.updateNuclearStationName(nuclearStationName)
imageStore.updateOperatorName(operatorName)
imageStore.updateNuclearCoreName(nuclearCoreName) imageStore.updateNuclearCoreName(nuclearCoreName)
taskStore.updateCurrentDetailTaskId(taskId) taskStore.updateCurrentDetailTaskId(taskId)
imageStore.updateShowImage(false) imageStore.updateShowImage(false)

2
src/pages/index.vue

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

8
src/store/modules/image.js

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

Loading…
Cancel
Save