()
const updatePlanTableMaxHeight = async () => {
await nextTick()
const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0
- const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72
+ const paginationHeight = planPaginationRef.value?.$el?.getBoundingClientRect().height ?? 72
const pageBottomGap = 56
const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap
planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight)))
diff --git a/src/views/iot/deviceattributetype/index.vue b/src/views/iot/deviceattributetype/index.vue
index 1a8dbb9c..184ce013 100644
--- a/src/views/iot/deviceattributetype/index.vue
+++ b/src/views/iot/deviceattributetype/index.vue
@@ -166,7 +166,7 @@ const planPaginationRef = ref
()
const updatePlanTableMaxHeight = async () => {
await nextTick()
const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0
- const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72
+ const paginationHeight = planPaginationRef.value?.$el?.getBoundingClientRect().height ?? 72
const pageBottomGap = 56
const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap
planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight)))
diff --git a/src/views/iot/historyData/index.vue b/src/views/iot/historyData/index.vue
index 65728f9a..091cb1c2 100644
--- a/src/views/iot/historyData/index.vue
+++ b/src/views/iot/historyData/index.vue
@@ -196,7 +196,7 @@ const planPaginationRef = ref()
const updatePlanTableMaxHeight = async () => {
await nextTick()
const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0
- const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72
+ const paginationHeight = planPaginationRef.value?.$el?.getBoundingClientRect().height ?? 72
const pageBottomGap = 56
const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap
planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight)))
diff --git a/src/views/mold/taskConfiguration/TaskConfigurationForm.vue b/src/views/mold/taskConfiguration/TaskConfigurationForm.vue
index a2bd89d0..2fefde5f 100644
--- a/src/views/mold/taskConfiguration/TaskConfigurationForm.vue
+++ b/src/views/mold/taskConfiguration/TaskConfigurationForm.vue
@@ -11,28 +11,38 @@
-
-
-
+
+
+
+ {{ t('common.select') }}
+
+
+
-
-
-
+
+
+
+ {{ t('common.select') }}
+
+
+
{{ t('common.cancel') }}
+
+
+
+
+
+
diff --git a/src/views/mold/taskConfiguration/index.vue b/src/views/mold/taskConfiguration/index.vue
index cc5029d7..fbbb0779 100644
--- a/src/views/mold/taskConfiguration/index.vue
+++ b/src/views/mold/taskConfiguration/index.vue
@@ -107,7 +107,8 @@
{{ t('EquipmentManagement.TaskManagement.createWorkOrder') }}
@@ -164,7 +165,7 @@ const planPaginationRef = ref()
const updatePlanTableMaxHeight = async () => {
await nextTick()
const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0
- const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72
+ const paginationHeight = planPaginationRef.value?.$el?.getBoundingClientRect().height ?? 72
const pageBottomGap = 56
const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap
planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight)))
@@ -253,6 +254,8 @@ const openForm = (type: string, row?: TaskManagementVO) => {
formRef.value.open(type, row)
}
+const isTaskEnabled = (row: TaskManagementVO) => row.enabled === true || (row.enabled as any) === 'true'
+
const handleDelete = async (id?: number) => {
if (!id) return
try {
@@ -264,11 +267,25 @@ const handleDelete = async (id?: number) => {
}
const ticketLoadingId = ref(undefined)
-const handleCreateTicket = async (id?: number) => {
- if (!id) return
- ticketLoadingId.value = id
+const handleCreateTicket = async (row?: TaskManagementVO) => {
+ if (!row?.id) return
+ if (!isTaskEnabled(row)) {
+ message.warning(t('EquipmentManagement.TaskManagement.createTicketDisabledTip'))
+ return
+ }
+
+ try {
+ await message.confirm(
+ t('EquipmentManagement.TaskManagement.createTicketConfirm'),
+ t('common.reminder')
+ )
+ } catch {
+ return
+ }
+
+ ticketLoadingId.value = row.id
try {
- await TaskManagementApi.createTaskManagementTicket(id)
+ await TaskManagementApi.createTaskManagementTicket(row.id)
message.success(t('EquipmentManagement.TaskManagement.createTicketSuccess'))
} catch {
message.error(t('EquipmentManagement.TaskManagement.createTicketFail'))