Browse Source

feat: merge

xieyonghong 3 năm trước cách đây
mục cha
commit
31acd15334

+ 2 - 1
src/pages/device/Firmware/Task/Save/index1.tsx

@@ -32,8 +32,9 @@ const Save = (props: Props) => {
 
   const save = async () => {
     const values = await form.validateFields();
+    console.log(values);
     if (values?.releaseType !== 'all') {
-      values.deviceId = devices.current.map((item) => item.id);
+      values.deviceId = (values?.deviceId || []).map((item: any) => item.id);
     } else {
       values.deviceId = undefined;
     }

+ 2 - 2
src/pages/device/Firmware/Task/index.tsx

@@ -26,7 +26,7 @@ import { service } from '@/pages/device/Firmware';
 
 const UpgradeBtn = (props: { data: any; actions: any }) => {
   const { data, actions } = props;
-  if (data.waiting && data?.state?.value === 'processing') {
+  if (data.waiting > 0 && data?.state?.value === 'processing') {
     return (
       <a>
         <Tooltip title={'停止'}>
@@ -147,7 +147,7 @@ const Task = observer(() => {
         <a key="delete">
           <Popconfirm
             title={
-              record.waiting
+              record.waiting > 0 || record.processing > 0
                 ? '删除将导致正在进行的任务终止,确定要删除吗?'
                 : intl.formatMessage({
                     id: 'pages.data.option.remove.tips',