Merge branch 'main' of https://gitea.frp.extimaging.com/XCKJ/irc_web into main
continuous-integration/drone/push Build is running Details

main
caiyiling 2026-04-02 17:33:03 +08:00
commit 34ce5142f2
5 changed files with 75 additions and 12 deletions

View File

@ -0,0 +1,16 @@
import resize from './resize'
const install = function (Vue) {
// 绑定v-adaptive指令
Vue.directive('resize', resize)
}
// if (window.Vue) {
// window['adaptive'] = adaptive
// // eslint-disable-next-line no-undef
// Vue.use(install)
// }
resize.install = install
export default resize

View File

@ -0,0 +1,19 @@
const map = new WeakMap()
const ob = new ResizeObserver(entries => {
for (const entry of entries) {
const handler = map.get(entry.target)
if (handler) {
const { inlineSize, blockSize } = entry.contentBoxSize[0]
handler({ width: inlineSize, height: blockSize })
}
}
})
export default {
bind(el, binding) {
map.set(el, binding.value)
ob.observe(el)
},
unbind(el) {
ob.unobserve(el)
}
}

View File

@ -70,6 +70,9 @@ import FB from '@/components/feedBack/index'
Vue.use(FB)
import FBT from '@/components/feedBackTable/index'
Vue.use(FBT)
import resize from '@/directive/resize/index'
// 表格自适应指令
Vue.use(resize)
import adaptive from '@/directive/adaptive/index'
// 表格自适应指令
Vue.use(adaptive)

View File

@ -309,7 +309,8 @@
<VolumeViewport :ref="`viewport-${index}`" :data-viewport-uid="`viewport-${index}`"
:rendering-engine-id="renderingEngineId" :viewport-id="`viewport-${index}`" :viewport-index="index"
@activeViewport="activeViewport" @toggleTaskByViewport="toggleTaskByViewport" @previewCD="previewCD"
@renderAnnotations="renderAnnotations" @contentMouseup="contentMouseup" v-if="readingTool === 3" />
@renderAnnotations="renderAnnotations" @contentMouseup="contentMouseup" v-if="readingTool === 3"
v-resize="(e) => handleSizeChange(e, `viewport-${index}`)" />
<Viewport :ref="`viewport-${index}`" :data-viewport-uid="`viewport-${index}`"
:rendering-engine-id="renderingEngineId" :viewport-id="`viewport-${index}`" :viewport-index="index"
@activeViewport="activeViewport" @toggleTaskByViewport="toggleTaskByViewport" @previewCD="previewCD"
@ -327,7 +328,8 @@
:rendering-engine-id="renderingEngineId" :viewport-id="`viewport-MPR-${index}`"
:viewport-index="index" :MPRInfo="MPRInfo" @activeViewport="activeViewport" @setMPRInfo="setMPRInfo"
@toggleTaskByViewport="toggleTaskByViewport" @previewCD="previewCD"
@renderAnnotations="renderAnnotations" @contentMouseup="contentMouseup" />
@renderAnnotations="renderAnnotations" @contentMouseup="contentMouseup"
v-resize="(e) => handleSizeChange(e, `viewport-MPR-${index}`)" />
</div>
</div>
<div v-if="readingTool === 2"
@ -904,6 +906,10 @@ export default {
this.getSystemInfoReading();
},
methods: {
handleSizeChange(e, viewportId) {
// console.log('handleSizeChange', e)
this.resetRenderingEngine(viewportId)
},
resetQuestion() {
this.$refs[`ecrf_${this.lastViewportTaskId}`][0].getQuestions(false)
this.$refs[`ecrf_${this.lastViewportTaskId}`][0].initSegmentBinding()
@ -1570,6 +1576,10 @@ export default {
setNetWorkSpeedSizeAll(percentComplete, detail.total, imageId)
}
}
if (this.readingTool === 3) {
getNetWorkSpeed()
setNetWorkSpeedSizeAll(percentComplete, detail.total, imageId)
}
if (percentComplete === 100) {
workSpeedclose()
}
@ -2821,20 +2831,26 @@ export default {
this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].resize(forceFitToWindow)
},
//
resetRenderingEngine() {
resetRenderingEngine(viewportId = null) {
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
const renderingEngine = getRenderingEngine(renderingEngineId)
const viewport = renderingEngine.getViewport(viewportId)
if (!viewport) return false
if (viewport.volumeIds.size <= 0) return false
let index = null
this.timer = setTimeout(() => {
index = index || index === 0 ? index : this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].series.SliceIndex
const renderingEngine = getRenderingEngine(renderingEngineId)
index = index || index === 0 ? index : this.$refs[viewportId ? viewportId : `${this.viewportKey}-${this.activeViewportIndex}`][0].series.SliceIndex
renderingEngine.resize(true, false)
renderingEngine.render()
this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].setFullScreen(index)
this.$refs[viewportId ? viewportId : `${this.viewportKey}-${this.activeViewportIndex}`][0].setFullScreen(index)
clearTimeout(this.timer)
this.timer = null
if (this.readingTool === 3) {
DicomEvent.$emit('isloaded', { isChange: false })
}
}, 100)
},
setDelay(time) {
@ -2857,9 +2873,9 @@ export default {
this.resetRenderingEngine()
this.isDelay = true
this.setDelay(2000)
if (this.readingTool === 3) {
DicomEvent.$emit('isloaded', { isChange: false })
}
// if (this.readingTool === 3) {
// DicomEvent.$emit('isloaded', { isChange: false })
// }
})
}

View File

@ -26,7 +26,8 @@
</div>
<div :class="['tool-item', activeTool === 'CircularEraser' && segmentList.length > 0 ? 'tool-item-active' : '']"
:style="{ cursor: segmentList.length <= 0 || (curSegment && curSegment.lock) ? 'not-allowed' : 'pointer' }"
:title="$t('trials:Segmentations:tools:Eraser')" @click.prevent="setToolActive('CircularEraser')">
:title="$t('trials:Segmentations:tools:Eraser')"
@click.prevent="setToolActive('CircularEraser')">
<svg-icon icon-class="clear" class="svg-icon" />
</div>
<!-- <div :class="['tool-item']">
@ -870,7 +871,14 @@ export default {
if (passive) this.$emit('setToolsPassive')
},
async rename(key, item) {
let name = await this.customPrompt()
let value = null
if (key === 'segmentGroup') {
let group = this.segmentList.find(i => i.segmentationId === this.segmentationId)
value = group.name
} else {
value = item.SegmentLabel
}
let name = await this.customPrompt(value)
if (!name) return false
if (key === 'segmentGroup') {
let group = this.segmentList.find(i => i.segmentationId === this.segmentationId)
@ -881,7 +889,7 @@ export default {
this.addOrUpdateSegment({ name: item.SegmentLabel, color: item.color, segmentIndex: item.segmentIndex, segmentationId: item.segmentationId, segmentJson: JSON.stringify({ stats: item.stats, bidirectional: item.bidirectional }), id: item.id })
}
},
async customPrompt() {
async customPrompt(name) {
try {
const that = this
//
@ -893,6 +901,7 @@ export default {
showCancelButton: true,
closeOnClickModal: false,
closeOnPressEscape: false,
inputValue: name,
beforeClose: (action, instance, done) => {
if (action === 'confirm') {
// const value = instance.inputValue