diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 526b1fb..56c513a 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -163,13 +163,13 @@ --> -
+
{{ userStore.name }} - +
- +
- + 退出登录 diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 526b1fb..56c513a 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -163,13 +163,13 @@ -->
-
+
{{ userStore.name }} - +
- +
- + 退出登录 diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts index 608bb98..debd0b0 100644 --- a/src/utils/useCheckList.ts +++ b/src/utils/useCheckList.ts @@ -11,7 +11,7 @@ const item = list[index] for (const prop of columns) { // 检查必填 - if (prop.required && !item[prop.value]) { + if (prop.required && (`${item[prop.value]}` === '' || `${item[prop.value]}` === 'undefined' || `${item[prop.value]}` === 'null')) { // ElMessage.warning(`请先完善${tableTitle}第${index + 1}行中${prop.text}`) ElMessage.warning(`请先完善${tableTitle}中【${item.typeName || item.recognitionTypeName}】的${prop.text}`) return false diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 526b1fb..56c513a 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -163,13 +163,13 @@ -->
-
+
{{ userStore.name }} - +
- +
- + 退出登录 diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts index 608bb98..debd0b0 100644 --- a/src/utils/useCheckList.ts +++ b/src/utils/useCheckList.ts @@ -11,7 +11,7 @@ const item = list[index] for (const prop of columns) { // 检查必填 - if (prop.required && !item[prop.value]) { + if (prop.required && (`${item[prop.value]}` === '' || `${item[prop.value]}` === 'undefined' || `${item[prop.value]}` === 'null')) { // ElMessage.warning(`请先完善${tableTitle}第${index + 1}行中${prop.text}`) ElMessage.warning(`请先完善${tableTitle}中【${item.typeName || item.recognitionTypeName}】的${prop.text}`) return false diff --git a/src/views/alarm/policyConfig/monitorPoint/drawArea.vue b/src/views/alarm/policyConfig/monitorPoint/drawArea.vue index 9346cbc..fdf9ea0 100644 --- a/src/views/alarm/policyConfig/monitorPoint/drawArea.vue +++ b/src/views/alarm/policyConfig/monitorPoint/drawArea.vue @@ -7,6 +7,14 @@ type: Array, default: () => [], }, + width: { + type: Number, + default: 600, + }, + height: { + type: Number, + default: 450, + }, }) const emits = defineEmits(['givepointsInfo']) const baseurl = ref(window.location.href.split('/#')[0]) @@ -33,16 +41,16 @@ ctx.lineTo(e.boundary[3].x, e.boundary[3].y) } // ctx.strokeStyle = e.pointColor - ctx.strokeStyle = '#ff0000' + ctx.strokeStyle = e.pointColor || '#3d7eff' ctx.closePath() ctx.font = '13px Arial' // ctx.fillStyle = e.pointColor - ctx.fillStyle = '#ff0000' + ctx.fillStyle = e.pointColor || '#3d7eff' // const minY = Math.min(e.boundary[0].y, e.boundary[1].y, e.boundary[2].y, e.boundary[3].y) // const minX = Math.min(e.boundary[0].x, e.boundary[1].x, e.boundary[2].x, e.boundary[3].x) - const textX = e.boundary[0].x === 0 ? 0 : e.boundary[0].x + 3 > 540 ? 540 : e.boundary[0].x + 3 - const textY = e.boundary[0].y < 12 ? 12 : e.boundary[0].y > 438 ? 438 : e.boundary[0].y - 5 - ctx.fillText(e.recognitionTypeName, textX, textY) + const textX = e.boundary[0].x === 0 ? 0 : e.boundary[0].x + 3 > props.width - 60 ? props.width - 60 : e.boundary[0].x + 3 + const textY = e.boundary[0].y < 12 ? 12 : e.boundary[0].y > props.height - 12 ? props.height - 12 : e.boundary[0].y - 5 + ctx.fillText(e.remark, textX, textY) }) } ctx.lineWidth = 1 @@ -60,14 +68,14 @@ if (mousePos.x < 0) { mousePos.x = 0 } - else if (mousePos.x > 600) { - mousePos.x = 600 + else if (mousePos.x > props.width) { + mousePos.x = props.width } if (mousePos.y < 0) { mousePos.y = 0 } - else if (mousePos.y > 450) { - mousePos.y = 450 + else if (mousePos.y > props.height) { + mousePos.y = props.height } const { quotient, remainder } = divideAndModulo(pointIndex, 4) console.log(`移动的是第${quotient + 1}条数据,第${remainder + 1}个点`) @@ -161,8 +169,8 @@