From c85505c7b0ea6d9a6c7bf829688c6b8e85358d26 Mon Sep 17 00:00:00 2001
From: wangxiaoshuang <825034831@qq.com>
Date: Thu, 13 Aug 2026 15:45:40 +0800
Subject: [PATCH 1/6] =?UTF-8?q?=E4=B8=AD=E5=BF=83=E8=AE=BE=E5=A4=87?=
=?UTF-8?q?=E3=80=81=E4=B8=AD=E5=BF=83=E5=9F=BA=E6=9C=AC=E4=BF=A1=E6=81=AF?=
=?UTF-8?q?=E5=AF=BC=E5=87=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/export.js | 18 ++
.../site-research/components/Equipments.vue | 285 ++++++++----------
.../site-research/components/Questions.vue | 183 +++++------
3 files changed, 239 insertions(+), 247 deletions(-)
diff --git a/src/api/export.js b/src/api/export.js
index 777ae1ab..12ccf939 100644
--- a/src/api/export.js
+++ b/src/api/export.js
@@ -325,3 +325,21 @@ export function getTrialSiteSurveyList_Export(data) {
data
})
}
+// 导出中心设备
+export function getSiteSurveyEquipmentList_Export(data) {
+ return requestDownload({
+ url: `/ExcelExport/getSiteSurveyEquipmentList_Export`,
+ responseType: 'blob',
+ method: 'post',
+ data
+ })
+}
+// 导出中心调研基本信息
+export function getSiteSurveyInfoList_Export(data) {
+ return requestDownload({
+ url: `/ExcelExport/getSiteSurveyInfoList_Export`,
+ responseType: 'blob',
+ method: 'post',
+ data
+ })
+}
diff --git a/src/views/trials/trials-panel/attachments/site-research/components/Equipments.vue b/src/views/trials/trials-panel/attachments/site-research/components/Equipments.vue
index c0006718..eecef642 100644
--- a/src/views/trials/trials-panel/attachments/site-research/components/Equipments.vue
+++ b/src/views/trials/trials-panel/attachments/site-research/components/Equipments.vue
@@ -6,12 +6,8 @@
-
+
@@ -32,11 +28,7 @@
-
+
{{ $t('common:button:export') }}
@@ -44,150 +36,132 @@
-
+
-
+
-
+
-
-
-
- {{ scope.row.OtherEquipmentType ? scope.row.OtherEquipmentType :
- $fd('SiteSurvey_ScanEquipmentType', scope.row.EquipmentTypeEnum) }}
-
-
-
-
-
-
-
- {{ scope.row.ManufacturerName ? scope.row.ManufacturerName : $fd('ManufacturerType',
- scope.row.ManufacturerType) }}
-
-
-
-
-
-
-
- {{ $fd('MagneticFieldStrengthType', scope.row.MagneticFieldStrengthType) }}
-
-
-
-
-
- {{ $fd('BodyCoilChannelCount', scope.row.BodyCoilChannelCount) }}
-
-
-
-
-
- {{ $fd('YesOrNo', scope.row.HasDedicatedPdfFatQuantificationSequence) }}
-
-
-
-
-
- {{ scope.row.OtherSequenceSpecification ? scope.row.OtherSequenceSpecification :
- $fd('PdfFatQuantificationSequenceType', scope.row.PdfFatQuantificationSequenceType) }}
-
-
-
-
-
- {{ $fd('YesOrNo', scope.row.HasT2R2Correction) }}
-
-
-
-
-
- {{ $fd('YesOrNo', scope.row.CanFullyExportPdfParameterMapsAndRawDicom) }}
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.OtherEquipmentType ? scope.row.OtherEquipmentType :
+ $fd('SiteSurvey_ScanEquipmentType', scope.row.EquipmentTypeEnum) }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.ManufacturerName ? scope.row.ManufacturerName : $fd('ManufacturerType',
+ scope.row.ManufacturerType) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $fd('MagneticFieldStrengthType', scope.row.MagneticFieldStrengthType) }}
+
+
+
+
+
+
+
+
+ {{ $fd('BodyCoilChannelCount', scope.row.BodyCoilChannelCount) }}
+
+
+
+
+
+
+
+
+ {{ $fd('YesOrNo', scope.row.HasDedicatedPdfFatQuantificationSequence) }}
+
+
+
+
+
+
+
+
+ {{ scope.row.OtherSequenceSpecification ? scope.row.OtherSequenceSpecification :
+ $fd('PdfFatQuantificationSequenceType', scope.row.PdfFatQuantificationSequenceType) }}
+
+
+
+
+
+
+
+
+ {{ $fd('YesOrNo', scope.row.HasT2R2Correction) }}
+
+
+
+
+
+
+
+
+ {{ $fd('YesOrNo', scope.row.CanFullyExportPdfParameterMapsAndRawDicom) }}
+
+
+
+
+
+
+
+
+
-
+
@@ -196,6 +170,7 @@ import { getTrialSiteSelect } from '@/api/trials'
import { getSiteSurveyEquipmentList } from '@/api/research'
import BaseContainer from '@/components/BaseContainer'
import Pagination from '@/components/Pagination'
+import { getSiteSurveyEquipmentList_Export } from '@/api/export'
const searchDataDefault = () => {
return {
SortField: '',
@@ -228,6 +203,9 @@ export default {
this.getSite()
},
methods: {
+ async handleExport() {
+ await getSiteSurveyEquipmentList_Export(this.searchData)
+ },
async getList() {
try {
this.loading = true
@@ -243,19 +221,6 @@ export default {
this.equipmentControlFieldList.push(item.FiledName)
})
}
- } catch(e) {
- console.log(e)
- } finally {
- this.loading = false
- }
- },
- // 导出
- async handleExport() {
- try {
- this.searchData.TrialId = this.trialId
- this.loading = true
- const { SortField, Asc, PageIndex, PageSize, ...param } = { ...this.searchData }
- await trialSiteUserSummaryListExport({ ...param })
} catch (e) {
console.log(e)
} finally {
diff --git a/src/views/trials/trials-panel/attachments/site-research/components/Questions.vue b/src/views/trials/trials-panel/attachments/site-research/components/Questions.vue
index 742a23ee..eaabdf6f 100644
--- a/src/views/trials/trials-panel/attachments/site-research/components/Questions.vue
+++ b/src/views/trials/trials-panel/attachments/site-research/components/Questions.vue
@@ -28,7 +28,7 @@
-
+
{{ $t('common:button:export') }}
@@ -97,7 +97,7 @@
+ :label="$t('trials:researchForm:form:SiteSurveyFile')" show-overflow-tooltip min-width="100">
@@ -105,78 +105,96 @@
-
-
-
-
-
-
- {{ $fd('YesOrNo', scope.row.IsRoutineMRIPDEE) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ $t('trials:researchForm:form:IsAuthorizeRadiologistsParticipate') }}
-
-
- {{ $t('trials:researchForm:form:AssignFixedTechnologists') }}
-
-
-
-
-
-
- {{ $fd('YesOrNo', scope.row.IsConfirmImagingTechnologist) }}
-
-
-
-
-
-
-
-
-
- {{ $fd('YesOrNo', scope.row.IsFollowStudyParameters) }}
-
-
-
-
-
-
-
- {{ $fd('YesOrNo', scope.row.ISStrictManualBurnFlag) }}
-
-
-
-
+
+
+
+
+
+
+
+
+ {{ $fd('YesOrNo', scope.row.IsRoutineMRIPDEE) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('trials:researchForm:form:IsAuthorizeRadiologistsParticipate') }}
+
+
+ {{ $t('trials:researchForm:form:AssignFixedTechnologists') }}
+
+
+
+
+
+
+
+
+ {{ $fd('YesOrNo', scope.row.IsConfirmImagingTechnologist) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $fd('YesOrNo', scope.row.IsFollowStudyParameters) }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ $fd('YesOrNo', scope.row.ISStrictManualBurnFlag) }}
+
+
+
+
+
+
+
@@ -190,6 +208,7 @@ import { getTrialSiteSelect } from '@/api/trials'
import { getSiteSurveyInfoList } from '@/api/research'
import BaseContainer from '@/components/BaseContainer'
import Pagination from '@/components/Pagination'
+import { getSiteSurveyInfoList_Export } from '@/api/export'
const searchDataDefault = () => {
return {
SortField: '',
@@ -222,6 +241,9 @@ export default {
this.getSite()
},
methods: {
+ async handleExport() {
+ await getSiteSurveyInfoList_Export(this.searchData)
+ },
async getList() {
try {
this.loading = true
@@ -239,19 +261,6 @@ export default {
this.loading = false
}
},
- // 导出
- async handleExport() {
- try {
- this.searchData.TrialId = this.trialId
- this.loading = true
- const { SortField, Asc, PageIndex, PageSize, ...param } = { ...this.searchData }
- await trialSiteUserSummaryListExport({ ...param })
- } catch (e) {
- console.log(e)
- } finally {
- this.loading = false
- }
- },
// 获取site下拉框数据
async getSite() {
try {
From ca5663d00a06f6ad328b0d975d128440e2541a84 Mon Sep 17 00:00:00 2001
From: wangxiaoshuang <825034831@qq.com>
Date: Thu, 13 Aug 2026 16:36:55 +0800
Subject: [PATCH 2/6] =?UTF-8?q?=E4=B8=AD=E5=BF=83=E8=AE=BE=E5=A4=87?=
=?UTF-8?q?=E8=A1=A8=E6=A0=BC=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../attachments/site-research/components/Equipments.vue | 7 +++++--
.../attachments/site-research/components/Questions.vue | 5 ++++-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/views/trials/trials-panel/attachments/site-research/components/Equipments.vue b/src/views/trials/trials-panel/attachments/site-research/components/Equipments.vue
index eecef642..07a80189 100644
--- a/src/views/trials/trials-panel/attachments/site-research/components/Equipments.vue
+++ b/src/views/trials/trials-panel/attachments/site-research/components/Equipments.vue
@@ -36,8 +36,8 @@
-
+
{
this.equipmentControlFieldList.push(item.FiledName)
})
+ this.$nextTick(() => {
+ this.$refs.equipmentsList.doLayout()
+ })
}
} catch (e) {
console.log(e)
diff --git a/src/views/trials/trials-panel/attachments/site-research/components/Questions.vue b/src/views/trials/trials-panel/attachments/site-research/components/Questions.vue
index eaabdf6f..39352ea6 100644
--- a/src/views/trials/trials-panel/attachments/site-research/components/Questions.vue
+++ b/src/views/trials/trials-panel/attachments/site-research/components/Questions.vue
@@ -36,7 +36,7 @@
-
@@ -254,6 +254,9 @@ export default {
this.total = res.Result.TotalCount
this.otherInfo = res.OtherInfo
this.notShowFieldList = res.OtherInfo.NotShowFieldList
+ this.$nextTick(() => {
+ this.$refs.questionsList.doLayout()
+ })
}
} catch (e) {
console.log(e)
From 3b69f5de32e6afe159b9bc5fe1be82bd7e0b4b22 Mon Sep 17 00:00:00 2001
From: wangxiaoshuang <825034831@qq.com>
Date: Thu, 13 Aug 2026 17:00:12 +0800
Subject: [PATCH 3/6] =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../attachments/site-research/components/Equipments.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/views/trials/trials-panel/attachments/site-research/components/Equipments.vue b/src/views/trials/trials-panel/attachments/site-research/components/Equipments.vue
index 07a80189..644904e9 100644
--- a/src/views/trials/trials-panel/attachments/site-research/components/Equipments.vue
+++ b/src/views/trials/trials-panel/attachments/site-research/components/Equipments.vue
@@ -153,7 +153,7 @@
-
From 31c268450aa638187578cdc73e476ad2a289d7f9 Mon Sep 17 00:00:00 2001
From: wangxiaoshuang <825034831@qq.com>
Date: Thu, 13 Aug 2026 17:09:45 +0800
Subject: [PATCH 4/6] 1
---
.../trials/trials-panel/attachments/site-research/index.vue | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/views/trials/trials-panel/attachments/site-research/index.vue b/src/views/trials/trials-panel/attachments/site-research/index.vue
index eec6635c..7bf7c1b6 100644
--- a/src/views/trials/trials-panel/attachments/site-research/index.vue
+++ b/src/views/trials/trials-panel/attachments/site-research/index.vue
@@ -57,7 +57,11 @@ export default {
},
computed: {
isAudit() {
- return (this.hasPermi(['role:spm', 'role:cpm', 'role:apm']) && this.activeStatus === 1) || (this.hasPermi(['role:pm']) && this.activeStatus === 2)
+ if (this.isSPMJoin) {
+ return (this.hasPermi(['role:spm', 'role:cpm', 'role:apm']) && this.activeStatus === 1) || (this.hasPermi(['role:pm']) && this.activeStatus === 2)
+ } else {
+ return this.hasPermi(['role:pm']) && this.activeStatus === 1
+ }
}
},
mounted() {
From e497a3160878d272797121c386c3ee946430ab91 Mon Sep 17 00:00:00 2001
From: wangxiaoshuang <825034831@qq.com>
Date: Fri, 14 Aug 2026 13:24:36 +0800
Subject: [PATCH 5/6] =?UTF-8?q?=E4=B8=AD=E5=BF=83=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E4=B8=AD=E4=B8=89=E4=B8=AA=E8=A1=A8=E6=A0=BC=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E8=B0=83=E7=A0=94=E7=8A=B6=E6=80=81=E5=AD=97=E6=AE=B5=E5=92=8C?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../site-research/components/Equipments.vue | 45 ++++
.../site-research/components/Questions.vue | 55 ++++-
.../site-research/components/users.vue | 230 +++++++-----------
3 files changed, 181 insertions(+), 149 deletions(-)
diff --git a/src/views/trials/trials-panel/attachments/site-research/components/Equipments.vue b/src/views/trials/trials-panel/attachments/site-research/components/Equipments.vue
index 644904e9..3300eb19 100644
--- a/src/views/trials/trials-panel/attachments/site-research/components/Equipments.vue
+++ b/src/views/trials/trials-panel/attachments/site-research/components/Equipments.vue
@@ -14,6 +14,20 @@
+
+
+
+
+
+
+
+
@@ -47,6 +61,36 @@
+
+
+
+ {{
+ $fd('ResearchRecord', scope.row.State)
+ }}
+ {{
+ $fd('ResearchRecord', scope.row.State)
+ }}
+ {{
+ $fd('ResearchRecord', scope.row.State)
+ }}
+ {{
+ $fd('ResearchRecord', scope.row.State)
+ }}
+
+
+
+
@@ -174,6 +218,7 @@ import { getSiteSurveyEquipmentList_Export } from '@/api/export'
const searchDataDefault = () => {
return {
SortField: '',
+ State: "",
Asc: true,
PageIndex: 1,
PageSize: 20,
diff --git a/src/views/trials/trials-panel/attachments/site-research/components/Questions.vue b/src/views/trials/trials-panel/attachments/site-research/components/Questions.vue
index 39352ea6..35db4ecd 100644
--- a/src/views/trials/trials-panel/attachments/site-research/components/Questions.vue
+++ b/src/views/trials/trials-panel/attachments/site-research/components/Questions.vue
@@ -14,6 +14,20 @@
+
+
+
+
+
+
+
+
@@ -36,8 +50,8 @@
-
+
@@ -87,6 +101,36 @@
+
+
+
+ {{
+ $fd('ResearchRecord', scope.row.State)
+ }}
+ {{
+ $fd('ResearchRecord', scope.row.State)
+ }}
+ {{
+ $fd('ResearchRecord', scope.row.State)
+ }}
+ {{
+ $fd('ResearchRecord', scope.row.State)
+ }}
+
+
+
+
@@ -165,7 +209,11 @@
+ show-overflow-tooltip>
+
+ {{ $fd('EfficacyEvaluatorType', scope.row.EfficacyEvaluatorType) }}
+
+
@@ -213,6 +261,7 @@ const searchDataDefault = () => {
return {
SortField: '',
Asc: true,
+ State: "",
PageIndex: 1,
PageSize: 20,
TrialId: '',
diff --git a/src/views/trials/trials-panel/attachments/site-research/components/users.vue b/src/views/trials/trials-panel/attachments/site-research/components/users.vue
index 4a5f130c..0b837a38 100644
--- a/src/views/trials/trials-panel/attachments/site-research/components/users.vue
+++ b/src/views/trials/trials-panel/attachments/site-research/components/users.vue
@@ -6,31 +6,33 @@
-
+
+
+
+
+
+
+
+
+
-
-
+
+
@@ -39,42 +41,19 @@
-
-
+
+
-
-
+
+
{{ item.UserType }}
-
-
@@ -89,25 +68,15 @@
-
+
{{ $t('trials:researchRecord:dialogButton:sendEmail') }}
-
+
{{ $t('common:button:export') }}
@@ -116,96 +85,74 @@
-
-
+
+
-
+
{{ `${scope.row.TrialSiteSurvey.TrialSiteCode}` }}
-
+
{{ `${scope.row.TrialSiteSurvey.SiteName}` }}
+
+
+
+ {{
+ $fd('ResearchRecord', scope.row.State)
+ }}
+ {{
+ $fd('ResearchRecord', scope.row.State)
+ }}
+ {{
+ $fd('ResearchRecord', scope.row.State)
+ }}
+ {{
+ $fd('ResearchRecord', scope.row.State)
+ }}
+
+
+
+
-
+
{{ `${scope.row.LastName} / ${scope.row.FirstName}` }}
-
+
- {{ $fd('SiteSurvey_UserRoles',scope.row.TrialRoleCode) }}
+ {{ $fd('SiteSurvey_UserRoles', scope.row.TrialRoleCode) }}
-
+
-
+
-
+
-
+
{{ $fd('YesOrNo', scope.row.IsGenerateAccount) }}
@@ -223,21 +170,11 @@
-
+
-
+
{{ $fd('IsJoin', scope.row.IsJoin) }}
{{ $fd('IsJoin', scope.row.IsJoin) }}
@@ -246,7 +183,8 @@
-
+
From ee58ae4a222598436549949f3486929ddac0854d Mon Sep 17 00:00:00 2001
From: wangxiaoshuang <825034831@qq.com>
Date: Fri, 14 Aug 2026 15:47:44 +0800
Subject: [PATCH 6/6] =?UTF-8?q?=E9=9D=9Edicom=E5=BD=B1=E5=83=8F=E9=98=85?=
=?UTF-8?q?=E7=89=87=E5=A4=A7=E5=B0=8F=E4=B8=8D=E5=AF=B9=E3=80=81=E6=97=A0?=
=?UTF-8?q?=E6=B3=95=E7=A7=BB=E5=8A=A8=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../dicoms/components/NoneDicomsCanvas.vue | 89 ++++++++++++++-----
1 file changed, 68 insertions(+), 21 deletions(-)
diff --git a/src/views/trials/trials-panel/reading/dicoms/components/NoneDicomsCanvas.vue b/src/views/trials/trials-panel/reading/dicoms/components/NoneDicomsCanvas.vue
index 01508b8f..88baa296 100644
--- a/src/views/trials/trials-panel/reading/dicoms/components/NoneDicomsCanvas.vue
+++ b/src/views/trials/trials-panel/reading/dicoms/components/NoneDicomsCanvas.vue
@@ -137,6 +137,7 @@ export default {
currentDrawData: {},
canvasData: [],
imgZoom: 1,
+ isDragging: false,
isToolDisabled: false,
lesionName: '',
visitTaskId: '',
@@ -209,6 +210,10 @@ export default {
}
this.deviceSupportInstall()
},
+ beforeDestroy() {
+ window.removeEventListener('message', this.receiveMsg)
+ this.stopDragging()
+ },
methods: {
getCanvasData() {
return new Promise(async resolve => {
@@ -337,25 +342,55 @@ export default {
// 初始化画布
initCanvas(img) {
this.loading = true
- this.canvasSize.height = img.height
- this.canvasSize.width = img.width
-
this.imgSize.height = img.height
this.imgSize.width = img.width
const canvasDiv = document.getElementsByClassName('image-viewer__canvas')[0]
+ const widthRatio = canvasDiv && canvasDiv.offsetWidth ? canvasDiv.offsetWidth / img.width : 1
+ const heightRatio = canvasDiv && canvasDiv.offsetHeight ? canvasDiv.offsetHeight / img.height : 1
+ this.imgZoom = Math.min(widthRatio, heightRatio, 1)
+ this.canvasSize.height = Math.round(img.height * this.imgZoom)
+ this.canvasSize.width = Math.round(img.width * this.imgZoom)
this.canvasPosition = {
- x: canvasDiv.offsetWidth / 2 - img.width / 2,
- y: canvasDiv.offsetHeight / 2 - img.height / 2 - 25
+ x: canvasDiv.offsetWidth / 2 - this.canvasSize.width / 2,
+ y: canvasDiv.offsetHeight / 2 - this.canvasSize.height / 2 - 25
} // 背景居中
this.$nextTick(async () => {
ctx = document.getElementById('canvas').getContext('2d') // 获取上下文
- await ctx.drawImage(img, 0, 0, img.width, img.height) // 在canvas中绘制图片(图片、起始位置、绘图尺寸)
+ await ctx.drawImage(img, 0, 0, this.canvasSize.width, this.canvasSize.height) // 在canvas中绘制图片(图片、起始位置、绘图尺寸)
this.drawToArr()
this.loading = false
})
},
+ scalePoint(point) {
+ return {
+ x: point.x * this.imgZoom,
+ y: point.y * this.imgZoom
+ }
+ },
+ startDragging(e) {
+ const { offsetX, offsetY } = this.transform
+ const startX = e.pageX
+ const startY = e.pageY
+ this.isDragging = true
+ this._dragHandler = rafThrottle((ev) => {
+ this.transform.offsetX = offsetX + ev.pageX - startX
+ this.transform.offsetY = offsetY + ev.pageY - startY
+ })
+ this._dragEndHandler = () => {
+ this.stopDragging()
+ }
+ on(document, 'mousemove', this._dragHandler)
+ on(document, 'mouseup', this._dragEndHandler)
+ },
+ stopDragging() {
+ off(document, 'mousemove', this._dragHandler)
+ off(document, 'mouseup', this._dragEndHandler)
+ this._dragHandler = null
+ this._dragEndHandler = null
+ this.isDragging = false
+ },
// 清空画布
clearCanvas() {
@@ -381,6 +416,11 @@ export default {
if (e.button !== 0) {
return
}
+ if (!this.model) {
+ this.startDragging(e)
+ e.preventDefault()
+ return
+ }
this.isMouseDown = true // 打开鼠标状态
// 获取画布中鼠标开始点击位置
this.canvasMouseStart = {
@@ -391,6 +431,9 @@ export default {
// 鼠标移动事件
async handleMouseMove(e) {
+ if (!this.model || this.isDragging) {
+ return
+ }
// 获取屏幕中鼠标位置(显示实时坐标)
this.mousePosition = {
x: e.pageX,
@@ -437,10 +480,12 @@ export default {
var headlen = 10// 自定义箭头线的长度
var theta = 45// 自定义箭头线与直线的夹角
var arrowX, arrowY// 箭头线终点坐标
- var fromX = e.data.handles.start.x
- var fromY = e.data.handles.start.y
- var toX = e.data.handles.end.x
- var toY = e.data.handles.end.y
+ var start = this.scalePoint(e.data.handles.start)
+ var end = this.scalePoint(e.data.handles.end)
+ var fromX = start.x
+ var fromY = start.y
+ var toX = end.x
+ var toY = end.y
// 计算各角度和对应的箭头终点坐标
var angle = Math.atan2(fromY - toY, fromX - toX) * 180 / Math.PI
var angle1 = (angle + theta) * Math.PI / 180
@@ -453,8 +498,8 @@ export default {
// 画直线
ctx.lineWidth = this.lineWidth
ctx.beginPath()
- ctx.moveTo(fromX * this.imgZoom, fromY * this.imgZoom)
- ctx.lineTo(toX * this.imgZoom, toY * this.imgZoom)
+ ctx.moveTo(fromX, fromY)
+ ctx.lineTo(toX, toY)
arrowX = toX + topX
arrowY = toY + topY
@@ -473,18 +518,16 @@ export default {
ctx.lineWidth = this.lineWidth
ctx.beginPath()
ctx.strokeStyle = this.color
+ const start = this.scalePoint(e.data.handles.start)
+ const end = this.scalePoint(e.data.handles.end)
// 绘制矩形边框
ctx.strokeRect(
- // this.canvasMouseStart.x,
- // this.canvasMouseStart.y,
- // e.offsetX - this.canvasMouseStart.x,
- // e.offsetY - this.canvasMouseStart.y
- e.data.handles.start.x,
- e.data.handles.start.y,
- e.data.handles.end.x - e.data.handles.start.x,
- e.data.handles.end.y - e.data.handles.start.y
+ start.x,
+ start.y,
+ end.x - start.x,
+ end.y - start.y
)
- this.drawText(ctx, { x: e.data.handles.start.x, y: e.data.handles.start.y }, { x: e.data.handles.end.x, y: e.data.handles.end.y }, e.data.remark, this.color)
+ this.drawText(ctx, start, end, e.data.remark, this.color)
}
}
})
@@ -495,6 +538,10 @@ export default {
if (e.button !== 0) {
return // 非左键松开
}
+ if (this.isDragging) {
+ this.stopDragging()
+ return
+ }
// 左键松开
if (this.model === 'ArrowAnnotate' || this.model === 'RectangleRoi') {