From 6ecc44a8ce5678bca77d08b8dd7029b73ce8aee6 Mon Sep 17 00:00:00 2001
From: Hiram <>
Date: Mon, 11 Nov 2024 00:02:26 +0800
Subject: [PATCH] [bug] fix table change data isActive fail
---
.../src/pages/setting/components/analyze/index.vue | 7 ++++++-
src/renderer/src/pages/setting/components/drive/index.vue | 7 ++++++-
src/renderer/src/pages/setting/components/iptv/index.vue | 7 ++++++-
src/renderer/src/pages/setting/components/site/index.vue | 7 ++++++-
4 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/src/renderer/src/pages/setting/components/analyze/index.vue b/src/renderer/src/pages/setting/components/analyze/index.vue
index 59ab6ee6e..cc95bd0cb 100644
--- a/src/renderer/src/pages/setting/components/analyze/index.vue
+++ b/src/renderer/src/pages/setting/components/analyze/index.vue
@@ -25,7 +25,7 @@
-
+
{{ item }}
@@ -239,6 +239,11 @@ const reqDel = async (index) => {
}
};
+const handleOpDefault = async (id) => {
+ const item: any = tableConfig.value.data.find((item: any) => item.id === id);
+ handleOpChange(item.isActive ? 'enable' : 'disable', [id]);
+};
+
const handleOpChange = async (type, doc) => {
if (doc.length === 0 && ['enable', 'disable', 'delete'].includes(type)) {
MessagePlugin.warning(t('pages.setting.message.noSelectData'));
diff --git a/src/renderer/src/pages/setting/components/drive/index.vue b/src/renderer/src/pages/setting/components/drive/index.vue
index 39ce72188..e91d75e3d 100644
--- a/src/renderer/src/pages/setting/components/drive/index.vue
+++ b/src/renderer/src/pages/setting/components/drive/index.vue
@@ -17,7 +17,7 @@
{{ row.name }}
-
+
@@ -203,6 +203,11 @@ const reqDel = async (index) => {
}
};
+const handleOpDefault = async (id) => {
+ const item: any = tableConfig.value.data.find((item: any) => item.id === id);
+ handleOpChange(item.isActive ? 'enable' : 'disable', [id]);
+};
+
const handleOpChange = async (type, doc) => {
if (doc.length === 0 && ['enable', 'disable', 'delete'].includes(type)) {
MessagePlugin.warning(t('pages.setting.message.noSelectData'));
diff --git a/src/renderer/src/pages/setting/components/iptv/index.vue b/src/renderer/src/pages/setting/components/iptv/index.vue
index a0e01a16d..fb777e2c4 100644
--- a/src/renderer/src/pages/setting/components/iptv/index.vue
+++ b/src/renderer/src/pages/setting/components/iptv/index.vue
@@ -28,7 +28,7 @@
-
+
@@ -214,6 +214,11 @@ const reqDel = async (index) => {
}
};
+const handleOpDefault = async (id) => {
+ const item: any = tableConfig.value.data.find((item: any) => item.id === id);
+ handleOpChange(item.isActive ? 'enable' : 'disable', [id]);
+};
+
const handleOpChange = async (type, doc) => {
if (doc.length === 0 && ['enable', 'disable', 'delete'].includes(type)) {
MessagePlugin.warning(t('pages.setting.message.noSelectData'));
diff --git a/src/renderer/src/pages/setting/components/site/index.vue b/src/renderer/src/pages/setting/components/site/index.vue
index 99d392ad0..869553cb5 100644
--- a/src/renderer/src/pages/setting/components/site/index.vue
+++ b/src/renderer/src/pages/setting/components/site/index.vue
@@ -17,7 +17,7 @@
{{ row.name }}
-
+
T0[xml]
@@ -221,6 +221,11 @@ const reqDel = async (index) => {
}
};
+const handleOpDefault = async (id) => {
+ const item: any = tableConfig.value.data.find((item: any) => item.id === id);
+ handleOpChange(item.isActive ? 'enable' : 'disable', [id]);
+};
+
const handleOpChange = async (type, doc) => {
if (doc.length === 0 && ['enable', 'disable', 'delete'].includes(type)) {
MessagePlugin.warning(t('pages.setting.message.noSelectData'));