Browse Source

feat(live): change list item

gemercheung 3 years ago
parent
commit
23b243ec4c
2 changed files with 41 additions and 41 deletions
  1. 1 1
      src/views/scenes/bindModal.vue
  2. 40 40
      src/views/scenes/live.vue

+ 1 - 1
src/views/scenes/bindModal.vue

@@ -102,7 +102,7 @@
         showIndexColumn: false,
         immediate: false,
         rowKey: 'id',
-        pagination: { pageSize: 20 },
+        pagination: { pageSize: 1000 },
         bordered: true,
       });
 

+ 40 - 40
src/views/scenes/live.vue

@@ -54,17 +54,17 @@ updateUserId: null -->
               onClick: handleBindAnchor.bind(null, record),
             },
 
-            {
-              icon: 'ant-design:delete-outlined',
-              color: 'error',
-              label: '删除',
-              popConfirm: {
-                title: '是否确认删除',
-                confirm: () => {
-                  createMessage.info(`暂未接入`);
-                },
-              },
-            },
+            // {
+            //   icon: 'ant-design:delete-outlined',
+            //   color: 'error',
+            //   label: '删除',
+            //   popConfirm: {
+            //     title: '是否确认删除',
+            //     confirm: () => {
+            //       createMessage.info(`暂未接入`);
+            //     },
+            //   },
+            // },
           ]"
         />
       </template>
@@ -85,7 +85,7 @@ updateUserId: null -->
   } from '/@/components/Table';
   import { useMessage } from '/@/hooks/web/useMessage';
   // import { uploadApi } from '/@/api/sys/upload';
-  import { Switch } from 'ant-design-vue';
+  import { Tag } from 'ant-design-vue';
   import { h } from 'vue';
   import { ListApi, brandTypeListApi } from '/@/api/scene/live';
   import { useI18n } from '/@/hooks/web/useI18n';
@@ -137,43 +137,43 @@ updateUserId: null -->
         },
         {
           title: '是否开播',
-          dataIndex: 'isSteam',
+          dataIndex: 'livestreamStatus',
           width: 180,
           customRender: ({ record }) => {
-            if (!Reflect.has(record, 'pendingStatus')) {
-              record.pendingStatus = false;
-            }
-            return h(Switch, {
-              checked: record.isSteam,
-              checkedChildren: t('common.yes'),
-              unCheckedChildren: t('common.no'),
-              loading: false,
-              onChange(checked: boolean) {
-                record.pendingStatus = true;
-                const newStatus = checked ? '1' : '0';
-                const { createMessage } = useMessage();
-                createMessage.info(`暂未接入` + newStatus);
-                // setRoleStatus(record.id, newStatus)
-                //   .then(() => {
-                //     record.status = newStatus;
-                //     createMessage.success(`已成功修改角色状态`);
-                //   })
-                //   .catch(() => {
-                //     createMessage.error('修改角色状态失败');
-                //   })
-                //   .finally(() => {
-                //     record.pendingStatus = false;
-                //   });
-              },
-            });
+            const enable = record.livestreamStatus === 0;
+            const color = enable ? 'green' : 'red';
+            const text = enable ? '是' : '否';
+            return h(Tag, { color: color }, () => text);
           },
         },
+        // {
+        //   title: '是否开播',
+        //   dataIndex: 'isSteam',
+        //   width: 180,
+        //   customRender: ({ record }) => {
+        //     if (!Reflect.has(record, 'pendingStatus')) {
+        //       record.pendingStatus = false;
+        //     }
+        //     return h(Switch, {
+        //       checked: record.isSteam,
+        //       checkedChildren: t('common.yes'),
+        //       unCheckedChildren: t('common.no'),
+        //       loading: false,
+        //       onChange(checked: boolean) {
+        //         record.pendingStatus = true;
+        //         const newStatus = checked ? '1' : '0';
+        //         const { createMessage } = useMessage();
+        //         createMessage.info(`暂未接入` + newStatus);
+        //       },
+        //     });
+        //   },
+        // },
 
         {
           title: '操作',
           dataIndex: '',
           slots: { customRender: 'action' },
-          width: 200,
+          width: 120,
           fixed: 'right',
         },
       ];