瀏覽代碼

feat: merge

xieyonghong 3 年之前
父節點
當前提交
31acd15334
共有 2 個文件被更改,包括 4 次插入3 次删除
  1. 2 1
      src/pages/device/Firmware/Task/Save/index1.tsx
  2. 2 2
      src/pages/device/Firmware/Task/index.tsx

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

@@ -32,8 +32,9 @@ const Save = (props: Props) => {
 
 
   const save = async () => {
   const save = async () => {
     const values = await form.validateFields();
     const values = await form.validateFields();
+    console.log(values);
     if (values?.releaseType !== 'all') {
     if (values?.releaseType !== 'all') {
-      values.deviceId = devices.current.map((item) => item.id);
+      values.deviceId = (values?.deviceId || []).map((item: any) => item.id);
     } else {
     } else {
       values.deviceId = undefined;
       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 UpgradeBtn = (props: { data: any; actions: any }) => {
   const { data, actions } = props;
   const { data, actions } = props;
-  if (data.waiting && data?.state?.value === 'processing') {
+  if (data.waiting > 0 && data?.state?.value === 'processing') {
     return (
     return (
       <a>
       <a>
         <Tooltip title={'停止'}>
         <Tooltip title={'停止'}>
@@ -147,7 +147,7 @@ const Task = observer(() => {
         <a key="delete">
         <a key="delete">
           <Popconfirm
           <Popconfirm
             title={
             title={
-              record.waiting
+              record.waiting > 0 || record.processing > 0
                 ? '删除将导致正在进行的任务终止,确定要删除吗?'
                 ? '删除将导致正在进行的任务终止,确定要删除吗?'
                 : intl.formatMessage({
                 : intl.formatMessage({
                     id: 'pages.data.option.remove.tips',
                     id: 'pages.data.option.remove.tips',