浏览代码

系统管理接口相关

zhangjie 1 年之前
父节点
当前提交
c0f74ac518

+ 160 - 1
src/api/system.js

@@ -4,6 +4,165 @@ import { request } from '@/utils/request.js';
 export const customerListApi = (data) =>
   request({
     url: '/api/system/customer/list',
-    method: 'post',
     data,
   });
+export const customerEditApi = (data) => {
+  if (data.id) {
+    request({
+      url: '/api/system/customer/edit',
+      data,
+    });
+  } else {
+    request({
+      url: '/api/system/customer/add',
+      data,
+    });
+  }
+};
+export const customerDeleteApi = (id) =>
+  request({
+    url: '/api/system/customer/delete',
+    data: { id },
+  });
+
+// supplier-manage
+export const supplierListApi = (data) =>
+  request({
+    url: '/api/system/supplier/list',
+    data,
+  });
+export const supplierEditApi = (data) => {
+  if (data.id) {
+    request({
+      url: '/api/system/supplier/edit',
+      data,
+    });
+  } else {
+    request({
+      url: '/api/system/supplier/add',
+      data,
+    });
+  }
+};
+export const supplierEnableApi = ({ id, enable }) =>
+  request({
+    url: '/api/system/supplier/enable',
+    data: { id, enable },
+  });
+
+// device-manage
+export const deviceListApi = (data) =>
+  request({
+    url: '/api/system/device/list',
+    data,
+  });
+export const deviceEditApi = (data) => {
+  if (data.id) {
+    request({
+      url: '/api/system/device/edit',
+      data,
+    });
+  } else {
+    request({
+      url: '/api/system/device/add',
+      data,
+    });
+  }
+};
+export const deviceDestroyApi = (id) =>
+  request({
+    url: '/api/system/device/distroy',
+    data: { id },
+  });
+
+// service-level-manage
+export const serviceLevelListApi = (data) =>
+  request({
+    url: '/api/system/service-level/list',
+    data,
+  });
+export const serviceLevelEditApi = (data) => {
+  if (data.id) {
+    request({
+      url: '/api/system/service-level/edit',
+      data,
+    });
+  } else {
+    request({
+      url: '/api/system/service-level/add',
+      data,
+    });
+  }
+};
+export const serviceLevelDeleteApi = (id) =>
+  request({
+    url: '/api/system/service-level/delete',
+    data: { id },
+  });
+
+// checkin-manage
+export const checkinListApi = (data) =>
+  request({
+    url: '/api/system/checkin/list',
+    data,
+  });
+export const checkinEditApi = (data) => {
+  if (data.id) {
+    request({
+      url: '/api/system/checkin/edit',
+      data,
+    });
+  } else {
+    request({
+      url: '/api/system/checkin/add',
+      data,
+    });
+  }
+};
+export const checkinDeleteApi = (id) =>
+  request({
+    url: '/api/system/checkin/delete',
+    data: { id },
+  });
+
+// log-manage
+export const logListApi = (data) =>
+  request({
+    url: '/api/system/log/list',
+    data,
+  });
+
+// notice-manage
+export const noticeListApi = (data) =>
+  request({
+    url: '/api/system/notice/list',
+    data,
+  });
+export const noticeEditApi = (data) => {
+  if (data.id) {
+    request({
+      url: '/api/system/notice/edit',
+      data,
+    });
+  } else {
+    request({
+      url: '/api/system/notice/add',
+      data,
+    });
+  }
+};
+export const noticePublishApi = (id) =>
+  request({
+    url: '/api/system/notice/publish',
+    data: { id },
+  });
+export const noticeCancelPublishApi = (id) =>
+  request({
+    url: '/api/system/notice/cancel-publish',
+    data: { id },
+  });
+export const noticeDestroyApi = (id) =>
+  request({
+    url: '/api/system/notice/distroy',
+    data: { id },
+  });

+ 149 - 0
src/mock/system.js

@@ -28,3 +28,152 @@ export const customerListApi = Mock.mock(
     };
   }
 );
+// supplier customer manage
+export const supplierListApi = Mock.mock(
+  '/api/system/supplier/list',
+  'post',
+  (data) => {
+    return {
+      // list: [],
+      list: [
+        {
+          id: '1',
+          code: '22',
+          name: '33',
+          type: '44',
+          remark: '55',
+          enable: true,
+        },
+      ],
+      total: 70,
+    };
+  }
+);
+// device customer manage
+export const deviceListApi = Mock.mock(
+  '/api/system/device/list',
+  'post',
+  (data) => {
+    return {
+      // list: [],
+      list: [
+        {
+          id: '1',
+          code: '22',
+          serialNo: '33',
+          brand: '44',
+          buyTime: '55',
+          supllier: '66',
+          status: '77',
+          location: '88',
+          scanCount: '99',
+        },
+      ],
+      total: 70,
+    };
+  }
+);
+// service-level manage
+export const serviceLevelListApi = Mock.mock(
+  '/api/system/service-level/list',
+  'post',
+  (data) => {
+    return {
+      list: [
+        {
+          id: '1',
+          name: '11',
+          businessType: '22',
+          roles: [],
+          creator: '44',
+          createdTime: '',
+        },
+      ],
+      total: 70,
+    };
+  }
+);
+// checkin customer manage
+export const checkinListApi = Mock.mock(
+  '/api/system/checkin/list',
+  'post',
+  (data) => {
+    return {
+      list: [
+        {
+          id: '1',
+          unit: '11',
+          status: '22',
+          name: '33',
+          to: [],
+          supplier: '44',
+          checkinTime: [55],
+          checkoutTime: [66],
+          auditRoles: [77],
+          openFace: false,
+          backupCount: 2,
+        },
+      ],
+      total: 70,
+    };
+  }
+);
+
+// log customer manage
+export const logListApi = Mock.mock('/api/system/log/list', 'post', (data) => {
+  return {
+    // list: [],
+    list: [
+      {
+        id: '1',
+        a: '1122',
+        b: '333',
+        c: '4',
+      },
+      {
+        id: '2',
+        a: '1122',
+        b: '333',
+        c: '4',
+      },
+      {
+        id: '3',
+        a: '1122',
+        b: '333',
+        c: '4',
+      },
+    ],
+    total: 70,
+  };
+});
+// notice customer manage
+export const noticeListApi = Mock.mock(
+  '/api/system/notice/list',
+  'post',
+  (data) => {
+    return {
+      // list: [],
+      list: [
+        {
+          id: '1',
+          a: '1122',
+          b: '333',
+          c: '4',
+        },
+        {
+          id: '2',
+          a: '1122',
+          b: '333',
+          c: '4',
+        },
+        {
+          id: '3',
+          a: '1122',
+          b: '333',
+          c: '4',
+        },
+      ],
+      total: 70,
+    };
+  }
+);

+ 1 - 1
src/utils/request.js

@@ -107,7 +107,7 @@ function createRequest(service) {
           'application/json;charset=UTF-8'
         ),
       },
-
+      method: 'post',
       timeout: 60000,
       baseURL:
         env.VITE_HTTP_PROXY === 'Y'

+ 8 - 1
src/views/system/config-manage/checkin-manage/edit-checkin-dialog.vue

@@ -104,8 +104,10 @@
 </template>
 <script setup name="EditCheckinDialog">
 import { ref, computed } from 'vue';
+import { MessagePlugin } from 'tdesign-vue-next';
 import useClearDialog from '@/hooks/useClearDialog';
 import { CUSTOMER_TYPE } from '@/config/constants';
+import { checkinEditApi } from '@/api/system';
 const emit = defineEmits(['update:visible', 'success']);
 const formRef = ref(null);
 
@@ -202,7 +204,12 @@ const rules = {
 const save = async () => {
   const valid = await formRef.value.validate();
   if (valid !== true) return;
-  //ajax...
+
+  const res = await checkinEditApi(formData).catch(() => {});
+  if (!res) return;
+
+  MessagePlugin.success('保存成功');
+  emit('update:visible', false);
   emit('success');
 };
 </script>

+ 17 - 13
src/views/system/config-manage/checkin-manage/index.vue

@@ -31,9 +31,10 @@
 
 <script setup lang="jsx" name="CheckinManage">
 import { ref, reactive } from 'vue';
-import { getTableData } from '@/api/test';
+import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
 import useFetchTable from '@/hooks/useFetchTable';
 import EditCheckinDialog from './edit-checkin-dialog.vue';
+import { checkinListApi, checkinDeleteApi } from '@/api/system';
 const showEditCheckinDialog = ref(false);
 const curRow = ref(null);
 
@@ -84,15 +85,8 @@ const columns = [
     },
   },
 ];
-const {
-  loading: tableLoading,
-  pagination,
-  tableData,
-  fetchData,
-  onChange,
-} = useFetchTable(getTableData);
-
-const refresh = async () => {};
+const { pagination, tableData, fetchData, onChange } =
+  useFetchTable(checkinListApi);
 
 const fields = ref([
   {
@@ -130,8 +124,18 @@ const handleEdit = (row) => {
   showEditCheckinDialog.value = true;
 };
 const handleDelete = (row) => {
-  console.log(row);
+  const confirmDia = DialogPlugin({
+    header: '操作警告',
+    body: `确定要删除当前记录吗`,
+    confirmBtn: '确定',
+    cancelBtn: '取消',
+    onConfirm: async () => {
+      confirmDia.hide();
+      const res = await checkinDeleteApi(row.id).catch(() => {});
+      if (!res) return;
+      MessagePlugin.success('删除成功');
+      fetchData();
+    },
+  });
 };
 </script>
-
-<style></style>

+ 8 - 1
src/views/system/config-manage/customer-manage/edit-customer-dialog.vue

@@ -81,8 +81,10 @@
 </template>
 <script setup name="EditCustomerDialog">
 import { ref, computed } from 'vue';
+import { MessagePlugin } from 'tdesign-vue-next';
 import useClearDialog from '@/hooks/useClearDialog';
 import { CUSTOMER_TYPE } from '@/config/constants';
+import { customerEditApi } from '@/api/system';
 const emit = defineEmits(['update:visible', 'success']);
 const formRef = ref(null);
 
@@ -146,7 +148,12 @@ const rules = {
 const save = async () => {
   const valid = await formRef.value.validate();
   if (valid !== true) return;
-  //ajax...
+
+  const res = await customerEditApi(formData).catch(() => {});
+  if (!res) return;
+
+  MessagePlugin.success('保存成功');
+  emit('update:visible', false);
   emit('success');
 };
 </script>

+ 17 - 14
src/views/system/config-manage/customer-manage/index.vue

@@ -32,9 +32,10 @@
 
 <script setup lang="jsx" name="CustomerManage">
 import { ref, reactive } from 'vue';
+import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
 import useFetchTable from '@/hooks/useFetchTable';
 import EditCustomerDialog from './edit-customer-dialog.vue';
-import { customerListApi } from '@/api/system';
+import { customerListApi, customerDeleteApi } from '@/api/system';
 const showEditCustomerDialog = ref(false);
 const curRow = ref(null);
 
@@ -86,15 +87,8 @@ const columns = [
     },
   },
 ];
-const {
-  loading: tableLoading,
-  pagination,
-  tableData,
-  fetchData,
-  onChange,
-} = useFetchTable(customerListApi);
-
-const refresh = async () => {};
+const { pagination, tableData, fetchData, onChange } =
+  useFetchTable(customerListApi);
 
 const fields = ref([
   {
@@ -160,13 +154,22 @@ const handleImport = () => {
   console.log('import');
 };
 const handleDelete = (row) => {
-  console.log(row);
+  const confirmDia = DialogPlugin({
+    header: '操作警告',
+    body: `确定要删除当前记录吗`,
+    confirmBtn: '确定',
+    cancelBtn: '取消',
+    onConfirm: async () => {
+      confirmDia.hide();
+      const res = await customerDeleteApi(row.id).catch(() => {});
+      if (!res) return;
+      MessagePlugin.success('删除成功');
+      fetchData();
+    },
+  });
 };
 const handleEdit = (row) => {
-  console.log(row);
   curRow.value = row;
   showEditCustomerDialog.value = true;
 };
 </script>
-
-<style></style>

+ 8 - 1
src/views/system/config-manage/device-manage/edit-device-dialog.vue

@@ -79,8 +79,10 @@
 </template>
 <script setup name="EditDeviceDialog">
 import { ref, computed } from 'vue';
+import { MessagePlugin } from 'tdesign-vue-next';
 import useClearDialog from '@/hooks/useClearDialog';
 import { RUNNING_STATUS } from '@/config/constants';
+import { deviceEditApi } from '@/api/system';
 const emit = defineEmits(['update:visible', 'success']);
 const formRef = ref(null);
 
@@ -162,7 +164,12 @@ const rules = {
 const save = async () => {
   const valid = await formRef.value.validate();
   if (valid !== true) return;
-  //ajax...
+
+  const res = await deviceEditApi(formData).catch(() => {});
+  if (!res) return;
+
+  MessagePlugin.success('保存成功');
+  emit('update:visible', false);
   emit('success');
 };
 </script>

+ 29 - 16
src/views/system/config-manage/device-manage/index.vue

@@ -3,7 +3,6 @@
     <div class="flex-1 page-wrap">
       <div class="btn-group">
         <t-button theme="success" @click="handleAdd">新增</t-button>
-        <t-button theme="danger" @click="handleDelete">作废</t-button>
       </div>
       <t-table
         size="small"
@@ -31,9 +30,10 @@
 
 <script setup lang="jsx" name="DeviceManage">
 import { ref } from 'vue';
-import { getTableData } from '@/api/test';
+import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
 import useFetchTable from '@/hooks/useFetchTable';
 import EditDeviceDialog from './edit-device-dialog.vue';
+import { deviceListApi, deviceDestroyApi } from '@/api/system';
 const showEditDeviceDialog = ref(false);
 const curRow = ref(null);
 
@@ -50,7 +50,7 @@ const columns = [
     title: '操作',
     colKey: 'operate',
     fixed: 'right',
-    width: 80,
+    width: 120,
     align: 'center',
     cell: (h, { row }) => {
       return (
@@ -65,32 +65,45 @@ const columns = [
           >
             修改
           </t-link>
+          <t-link
+            theme="danger"
+            hover="color"
+            onClick={(e) => {
+              e.stopPropagation();
+              handleDistroy(row);
+            }}
+          >
+            作废
+          </t-link>
         </div>
       );
     },
   },
 ];
-const {
-  loading: tableLoading,
-  pagination,
-  tableData,
-  fetchData,
-  onChange,
-} = useFetchTable(getTableData);
-
-const refresh = async () => {};
+const { pagination, tableData, fetchData, onChange } =
+  useFetchTable(deviceListApi);
 
 const handleAdd = () => {
   curRow.value = null;
   showEditDeviceDialog.value = true;
 };
-const handleDelete = () => {
-  console.log('delete');
+const handleDistroy = (row) => {
+  const confirmDia = DialogPlugin({
+    header: '操作警告',
+    body: `确定要作废选中的记录吗`,
+    confirmBtn: '确定',
+    cancelBtn: '取消',
+    onConfirm: async () => {
+      confirmDia.hide();
+      const res = await deviceDestroyApi(row.id).catch(() => {});
+      if (!res) return;
+      MessagePlugin.success('删除成功');
+      fetchData();
+    },
+  });
 };
 const handleEdit = (row) => {
   curRow.value = row;
   showEditDeviceDialog.value = true;
 };
 </script>
-
-<style></style>

+ 9 - 2
src/views/system/config-manage/service-level-manage/edit-service-level-dialog.vue

@@ -7,7 +7,7 @@
     :closeOnOverlayClick="false"
     @close="emit('update:visible', false)"
   >
-    <t-form ref="formRef" :data="formData" :rules="rules" :labelWidth="100">
+    <t-form ref="formRef" :data="formData" :rules="rules" :labelWidth="120">
       <t-row :gutter="[0, 20]">
         <t-col :span="6">
           <t-form-item label="服务档位名称" name="name">
@@ -50,8 +50,10 @@
 </template>
 <script setup name="EditServiceLevelDialog">
 import { ref, computed } from 'vue';
+import { MessagePlugin } from 'tdesign-vue-next';
 import useClearDialog from '@/hooks/useClearDialog';
 import { CUSTOMER_TYPE } from '@/config/constants';
+import { serviceLevelEditApi } from '@/api/system';
 const emit = defineEmits(['update:visible', 'success']);
 const formRef = ref(null);
 
@@ -115,7 +117,12 @@ const rules = {
 const save = async () => {
   const valid = await formRef.value.validate();
   if (valid !== true) return;
-  //ajax...
+
+  const res = await serviceLevelEditApi(formData).catch(() => {});
+  if (!res) return;
+
+  MessagePlugin.success('保存成功');
+  emit('update:visible', false);
   emit('success');
 };
 </script>

+ 17 - 14
src/views/system/config-manage/service-level-manage/index.vue

@@ -30,9 +30,10 @@
 
 <script setup lang="jsx" name="ServiceLevelManage">
 import { ref } from 'vue';
-import { getTableData } from '@/api/test';
+import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
 import useFetchTable from '@/hooks/useFetchTable';
 import EditServiceLevelDialog from './edit-service-level-dialog.vue';
+import { serviceLevelListApi, serviceLevelDeleteApi } from '@/api/system';
 const showEditServiceLevelDialog = ref(false);
 const curRow = ref(null);
 
@@ -76,15 +77,8 @@ const columns = [
     },
   },
 ];
-const {
-  loading: tableLoading,
-  pagination,
-  tableData,
-  fetchData,
-  onChange,
-} = useFetchTable(getTableData);
-
-const refresh = async () => {};
+const { pagination, tableData, fetchData, onChange } =
+  useFetchTable(serviceLevelListApi);
 
 const handleAdd = () => {
   curRow.value = null;
@@ -95,9 +89,18 @@ const handleEdit = (row) => {
   showEditServiceLevelDialog.value = true;
 };
 const handleDelete = (row) => {
-  curRow.value = row;
-  showEditServiceLevelDialog.value = true;
+  const confirmDia = DialogPlugin({
+    header: '操作警告',
+    body: `确定要删除当前记录吗`,
+    confirmBtn: '确定',
+    cancelBtn: '取消',
+    onConfirm: async () => {
+      confirmDia.hide();
+      const res = await serviceLevelDeleteApi(row.id).catch(() => {});
+      if (!res) return;
+      MessagePlugin.success('删除成功');
+      fetchData();
+    },
+  });
 };
 </script>
-
-<style></style>

+ 9 - 1
src/views/system/config-manage/supplier-manage/edit-supplier-dialog.vue

@@ -48,8 +48,10 @@
 </template>
 <script setup name="EditSupplierDialog">
 import { ref, computed } from 'vue';
+import { MessagePlugin } from 'tdesign-vue-next';
 import useClearDialog from '@/hooks/useClearDialog';
 import { NOTICE_TYPE } from '@/config/constants';
+import { supplierEditApi } from '@/api/system';
 const emit = defineEmits(['update:visible', 'success']);
 const formRef = ref(null);
 
@@ -96,10 +98,16 @@ const rules = {
     },
   ],
 };
+
 const save = async () => {
   const valid = await formRef.value.validate();
   if (valid !== true) return;
-  //ajax...
+
+  const res = await supplierEditApi(formData).catch(() => {});
+  if (!res) return;
+
+  MessagePlugin.success('保存成功');
+  emit('update:visible', false);
   emit('success');
 };
 </script>

+ 13 - 15
src/views/system/config-manage/supplier-manage/index.vue

@@ -31,9 +31,10 @@
 
 <script setup lang="jsx" name="SupplierManage">
 import { ref } from 'vue';
-import { getTableData } from '@/api/test';
+import { MessagePlugin } from 'tdesign-vue-next';
 import useFetchTable from '@/hooks/useFetchTable';
 import EditSupplierDialog from './edit-supplier-dialog.vue';
+import { supplierListApi, supplierEnableApi } from '@/api/system';
 const showEditSupplierDialog = ref(false);
 const curRow = ref(null);
 
@@ -77,15 +78,8 @@ const columns = [
     },
   },
 ];
-const {
-  loading: tableLoading,
-  pagination,
-  tableData,
-  fetchData,
-  onChange,
-} = useFetchTable(getTableData);
-
-const refresh = async () => {};
+const { pagination, tableData, fetchData, onChange } =
+  useFetchTable(supplierListApi);
 
 const handleAdd = () => {
   curRow.value = null;
@@ -95,10 +89,14 @@ const handleEdit = (row) => {
   curRow.value = row;
   showEditSupplierDialog.value = true;
 };
-const handleDisable = (row) => {
-  curRow.value = row;
-  showEditSupplierDialog.value = true;
+const handleDisable = async (row) => {
+  const res = await supplierEnableApi({
+    id: row.id,
+    enable: !row.enable,
+  }).catch(() => {});
+
+  if (!res) return;
+  MessagePlugin.success('操作成功');
+  fetchData();
 };
 </script>
-
-<style></style>

+ 3 - 10
src/views/system/notice-log/log-manage/index.vue

@@ -24,22 +24,15 @@
 
 <script setup lang="jsx" name="LogManage">
 import { ref, reactive } from 'vue';
-import { getTableData } from '@/api/test';
+import { logListApi } from '@/api/system';
 import useFetchTable from '@/hooks/useFetchTable';
 
 const columns = [
   { colKey: 'a', title: '时间', width: 170 },
   { colKey: 'b', title: '内容' },
 ];
-const {
-  loading: tableLoading,
-  pagination,
-  tableData,
-  fetchData,
-  onChange,
-} = useFetchTable(getTableData);
-
-const refresh = async () => {};
+const { pagination, tableData, fetchData, onChange } =
+  useFetchTable(logListApi);
 
 const fields = ref([
   {

+ 8 - 1
src/views/system/notice-log/notice-manage/edit-notice-dialog.vue

@@ -59,8 +59,10 @@
 </template>
 <script setup name="EditNoticeDialog">
 import { ref, computed } from 'vue';
+import { MessagePlugin } from 'tdesign-vue-next';
 import useClearDialog from '@/hooks/useClearDialog';
 import { NOTICE_TYPE } from '@/config/constants';
+import { noticeEditApi } from '@/api/system';
 const emit = defineEmits(['update:visible', 'success']);
 const formRef = ref(null);
 
@@ -117,7 +119,12 @@ const rules = {
 const save = async () => {
   const valid = await formRef.value.validate();
   if (valid !== true) return;
-  //ajax...
+
+  const res = await noticeEditApi(formData).catch(() => {});
+  if (!res) return;
+
+  MessagePlugin.success('保存成功');
+  emit('update:visible', false);
   emit('success');
 };
 </script>

+ 68 - 23
src/views/system/notice-log/notice-manage/index.vue

@@ -4,7 +4,7 @@
     <div class="flex-1 page-wrap">
       <div class="btn-group">
         <t-button theme="success" @click="handleAdd">新增</t-button>
-        <t-button theme="danger" @click="handleDelete">作废</t-button>
+        <t-button theme="danger" @click="handleDestroy">作废</t-button>
       </div>
       <t-table
         size="small"
@@ -12,12 +12,14 @@
         :columns="columns"
         :data="tableData"
         bordered
+        :selected-row-keys="selectedRowKeys"
         :pagination="{
           defaultCurrent: 1,
           defaultPageSize: 10,
           onChange,
           total: pagination.total,
         }"
+        @select-change="selectChange"
       >
       </t-table>
     </div>
@@ -32,11 +34,18 @@
 
 <script setup lang="jsx" name="NoticeManage">
 import { ref, reactive } from 'vue';
-import { getTableData } from '@/api/test';
+import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
 import useFetchTable from '@/hooks/useFetchTable';
 import EditNoticeDialog from './edit-notice-dialog.vue';
+import {
+  noticeListApi,
+  noticeDestroyApi,
+  noticePublishApi,
+  noticeCancelPublishApi,
+} from '@/api/system';
 const showEditNoticeDialog = ref(false);
 const curRow = ref(null);
+const selectedRowKeys = ref([]);
 
 const columns = [
   { colKey: 'row-select', type: 'multiple', width: 50 },
@@ -67,45 +76,38 @@ const columns = [
             hover="color"
             onClick={(e) => {
               e.stopPropagation();
-              handleFeedbackView(row);
+              handlePublish(row);
             }}
           >
-            回执查询
+            发布
           </t-link>
           <t-link
             theme="primary"
             hover="color"
             onClick={(e) => {
               e.stopPropagation();
-              handleEdit(row);
+              handleFeedbackView(row);
             }}
           >
-            修改
+            回执查询
           </t-link>
           <t-link
             theme="primary"
             hover="color"
             onClick={(e) => {
               e.stopPropagation();
-              handlePublish(row);
+              handleEdit(row);
             }}
           >
-            发布
+            修改
           </t-link>
         </div>
       );
     },
   },
 ];
-const {
-  loading: tableLoading,
-  pagination,
-  tableData,
-  fetchData,
-  onChange,
-} = useFetchTable(getTableData);
-
-const refresh = async () => {};
+const { pagination, tableData, fetchData, onChange } =
+  useFetchTable(noticeListApi);
 
 const fields = ref([
   {
@@ -162,15 +164,48 @@ const params = reactive({
   d: '',
 });
 
+const selectChange = (value) => {
+  selectedRowKeys.value = value;
+};
+
 const handleAdd = () => {
   curRow.value = null;
   showEditNoticeDialog.value = true;
 };
-const handleDelete = () => {
-  console.log('delete');
+const handleDestroy = () => {
+  if (!selectedRowKeys.value.length) {
+    MessagePlugin.error('请选择要作废的记录');
+    return;
+  }
+
+  const confirmDia = DialogPlugin({
+    header: '操作警告',
+    body: `确定要作废当前选择的所有记录吗`,
+    confirmBtn: '确定',
+    cancelBtn: '取消',
+    onConfirm: async () => {
+      confirmDia.hide();
+      const res = await noticeDestroyApi(row.id).catch(() => {});
+      if (!res) return;
+      MessagePlugin.success('操作成功');
+      fetchData();
+    },
+  });
 };
 const handleCancelPublish = (row) => {
-  console.log(row);
+  const confirmDia = DialogPlugin({
+    header: '操作警告',
+    body: `确定要撤销发布当前信息吗`,
+    confirmBtn: '确定',
+    cancelBtn: '取消',
+    onConfirm: async () => {
+      confirmDia.hide();
+      const res = await noticeCancelPublishApi(row.id).catch(() => {});
+      if (!res) return;
+      MessagePlugin.success('操作成功');
+      fetchData();
+    },
+  });
 };
 const handleFeedbackView = (row) => {
   console.log(row);
@@ -180,8 +215,18 @@ const handleEdit = (row) => {
   showEditNoticeDialog.value = true;
 };
 const handlePublish = (row) => {
-  console.log(row);
+  const confirmDia = DialogPlugin({
+    header: '操作警告',
+    body: `确定要发布当前信息吗`,
+    confirmBtn: '确定',
+    cancelBtn: '取消',
+    onConfirm: async () => {
+      confirmDia.hide();
+      const res = await noticePublishApi(row.id).catch(() => {});
+      if (!res) return;
+      MessagePlugin.success('操作成功');
+      fetchData();
+    },
+  });
 };
 </script>
-
-<style></style>