|
@@ -0,0 +1,137 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <div class="tw-bg-white tw-p-5 tw-rounded-xl tw-mb-5">
|
|
|
+ <a-button class="query-btn" @click="clickSearch">查询</a-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="tw-bg-white tw-p-5 tw-rounded-xl">
|
|
|
+ <a-table
|
|
|
+ rowKey="id"
|
|
|
+ :columns="columns"
|
|
|
+ :scroll="{ x: 1200 }"
|
|
|
+ :data-source="data"
|
|
|
+ :pagination="{
|
|
|
+ pageSize: pageSize,
|
|
|
+ current: pageNo,
|
|
|
+ total: totalElements,
|
|
|
+ showTotal: () => ``,
|
|
|
+ onChange: (pageNoChanged, pageSizeChanged) => {
|
|
|
+ pageNo = pageNoChanged;
|
|
|
+ pageSize = pageSizeChanged;
|
|
|
+ },
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <template #action="{ record }">
|
|
|
+ <span>
|
|
|
+ <a-button @click="toDelete(record)">编辑</a-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import { getTaskList } from "@/api/taskManagement";
|
|
|
+import { useMainStore } from "@/store";
|
|
|
+import { TaskItem } from "@/types";
|
|
|
+// import { downloadFileURL } from "@/utils/utils";
|
|
|
+// import { message } from "ant-design-vue";
|
|
|
+import { watch, onMounted } from "vue";
|
|
|
+
|
|
|
+const store = useMainStore();
|
|
|
+store.currentLocation = "基础管理 / 用户管理";
|
|
|
+
|
|
|
+let data = $ref<TaskItem[]>([]);
|
|
|
+let pageSize = $ref(10);
|
|
|
+let pageNo = $ref(1);
|
|
|
+let totalElements = $ref(0);
|
|
|
+async function search() {
|
|
|
+ await fetchData();
|
|
|
+}
|
|
|
+
|
|
|
+async function clickSearch() {
|
|
|
+ pageNo = 1;
|
|
|
+ await fetchData();
|
|
|
+}
|
|
|
+
|
|
|
+watch(() => [pageNo, pageSize], fetchData);
|
|
|
+
|
|
|
+async function fetchData() {
|
|
|
+ const res = await getTaskList({
|
|
|
+ pageSize,
|
|
|
+ pageNo,
|
|
|
+ });
|
|
|
+ // console.log(res);
|
|
|
+ data = res.data.content;
|
|
|
+ pageNo = res.data.pageNo;
|
|
|
+ pageSize = res.data.pageSize;
|
|
|
+ totalElements = res.data.totalElements;
|
|
|
+}
|
|
|
+
|
|
|
+const columns = [
|
|
|
+ {
|
|
|
+ title: "学校",
|
|
|
+ dataIndex: "rootOrgName",
|
|
|
+ width: 200,
|
|
|
+ slots: { customRender: "rootOrgName" },
|
|
|
+ ellipses: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "姓名",
|
|
|
+ dataIndex: "name",
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "登录名",
|
|
|
+ dataIndex: "loginName",
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "角色",
|
|
|
+ dataIndex: "roleName",
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "状态",
|
|
|
+ dataIndex: "enable",
|
|
|
+ slots: { customRender: "enable" },
|
|
|
+ width: 60,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "创建时间",
|
|
|
+ dataIndex: "createTime",
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "创建人",
|
|
|
+ dataIndex: "creator",
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "更新时间",
|
|
|
+ dataIndex: "updateTime",
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "更新人",
|
|
|
+ dataIndex: "updater",
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "操作",
|
|
|
+ key: "action",
|
|
|
+ slots: { customRender: "action" },
|
|
|
+ fixed: "right",
|
|
|
+ width: 270,
|
|
|
+ },
|
|
|
+];
|
|
|
+
|
|
|
+onMounted(async () => {
|
|
|
+ await search();
|
|
|
+});
|
|
|
+
|
|
|
+function toDelete(row: TaskItem) {
|
|
|
+ console.log(row);
|
|
|
+}
|
|
|
+</script>
|