ソースを参照

fix: change labourManager

DESKTOP-USV654P\pc 1 週間 前
コミット
b057627eb3

+ 78 - 0
src/views/course/teacher/index.vue

@@ -0,0 +1,78 @@
+<template>
+  <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
+    <BasicTable @register="registerTable">
+      <template #toolbar> </template>
+      <template #action="{ record }">
+        <TableAction
+          :actions="[
+            {
+              label: '查看',
+              disabled: record.status === 0,
+              onClick: handleView.bind(null, record),
+            },
+          ]"
+        />
+      </template>
+    </BasicTable>
+    <FormEdit @register="registerModal" @success="handleSuccess" />
+  </PageWrapper>
+</template>
+
+<script setup lang="ts">
+  import { onMounted } from 'vue';
+  import { PageWrapper } from '/@/components/Page';
+  import { BasicTable, useTable, TableAction } from '/@/components/Table';
+  import { tableColumns, searchFormSchema } from '../statistics/data.config';
+
+  import { useModal } from '/@/components/Modal';
+  import { getClassTimeStatisticsPage } from '/@/services/apis/ClassTimeStatisticsController';
+  import { formatToDate } from '/@/utils/dateUtil';
+  import FormEdit from '../statistics/components/edit.vue';
+  const [registerModal, { openModal }] = useModal();
+
+  const [registerTable, { reload }] = useTable({
+    api: getClassTimeStatisticsPage,
+    title: '课时统计记录',
+    rowKey: 'id',
+    columns: tableColumns,
+    formConfig: {
+      labelWidth: 120,
+      schemas: searchFormSchema,
+    },
+    useSearchForm: true,
+    showTableSetting: true,
+    bordered: true,
+    immediate: true,
+    canResize: true,
+    actionColumn: {
+      width: 120,
+      title: '操作',
+      dataIndex: 'action',
+      slots: { customRender: 'action' },
+      fixed: 'right',
+    },
+    beforeFetch: async (params) => {
+      if (params['date']) {
+        params['year'] = formatToDate(params['date'], 'YYYY');
+        params['month'] = formatToDate(params['date'], 'MM');
+        delete params['date'];
+      }
+      return params;
+    },
+  });
+
+  const handleView = (record: any) => {
+    openModal(true, {
+      isUpdate: true,
+      baseData: { ...record },
+    });
+  };
+
+  const handleSuccess = () => {
+    reload();
+  };
+
+  onMounted(async () => {});
+</script>
+
+<style scoped lang="less"></style>

+ 12 - 0
src/views/educational/classLessons/components/data.config.ts

@@ -29,6 +29,18 @@ export const tableColumns: BasicColumn[] = [
     dataIndex: 'courseName',
     align: 'left',
   },
+  {
+    title: '总定价',
+    dataIndex: 'amount',
+    align: 'left',
+    width: 80,
+  },
+  {
+    title: '总小计',
+    dataIndex: 'count',
+    align: 'left',
+    width: 80,
+  },
   {
     title: '操作',
     dataIndex: 'action',

+ 3 - 3
src/views/educational/labourManager/components/viewModal.vue

@@ -60,10 +60,10 @@
 <template>
   <BasicModal default-fullscreen @register="modalReg" title="查看详情" :footer="null">
     <BasicTable @register="tableReg">
-      <template #headerCell="{column}">
+      <template #headerCell="{ column }">
         <Tooltip>
-          <template #title>{{ column.customTitle }}</template>
-          {{ column.customTitle }}
+          <template #title>{{ column.title }}{{ column.customTitle }}</template>
+          {{ column.title }} {{ column.customTitle }}
         </Tooltip>
       </template>
     </BasicTable>