feat: 准备合并main
This commit is contained in:
parent
26d075953e
commit
fbac2ef72b
|
|
@ -0,0 +1,23 @@
|
||||||
|
import { http } from "@/utils/http";
|
||||||
|
import type { Res } from "@/utils/http/types";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 获取学校枚举下拉
|
||||||
|
* @param {string} type 枚举类型 type=StatusEnum
|
||||||
|
* @return {object}
|
||||||
|
*/
|
||||||
|
export function getenum(data) {
|
||||||
|
return http.request<Res<any>>("post", `/back/schools/QueryCombo`, {
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @description 获取学校枚举下拉
|
||||||
|
* @param {string} type 枚举类型 type=StatusEnum
|
||||||
|
* @return {object}
|
||||||
|
*/
|
||||||
|
export function getPageList(data) {
|
||||||
|
return http.request<Res<any>>("post", `/SchoolBusiness/PageList`, {
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -69,7 +69,12 @@
|
||||||
<el-button @click="handleReset">重置</el-button>
|
<el-button @click="handleReset">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
<!-- 操作按钮区域 -->
|
||||||
|
<div style="margin-bottom: 10px">
|
||||||
|
<el-button type="primary" @click="handleAdd">新建</el-button>
|
||||||
|
<el-button type="success" @click="handleImport">批量导入</el-button>
|
||||||
|
<el-button type="info" @click="handleExport">导出</el-button>
|
||||||
|
</div>
|
||||||
<!-- 表格区域 -->
|
<!-- 表格区域 -->
|
||||||
<el-table :data="pagedData" border style="width: 100%">
|
<el-table :data="pagedData" border style="width: 100%">
|
||||||
<el-table-column prop="school" label="学校" min-width="140" />
|
<el-table-column prop="school" label="学校" min-width="140" />
|
||||||
|
|
@ -126,7 +131,8 @@
|
||||||
</template>
|
</template>
|
||||||
<!-- 赴校信息管理菜单 -->
|
<!-- 赴校信息管理菜单 -->
|
||||||
<script setup lang="ts" name="Toschoolinfomanage">
|
<script setup lang="ts" name="Toschoolinfomanage">
|
||||||
import { ref, reactive, computed } from "vue";
|
import { getenum, getPageList } from "@/api/toschoolinfomanage";
|
||||||
|
import { ref, reactive, computed, onMounted } from "vue";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
|
|
||||||
|
|
@ -142,12 +148,29 @@ interface TableItem {
|
||||||
lastTime: string; // YYYY-MM-DD
|
lastTime: string; // YYYY-MM-DD
|
||||||
}
|
}
|
||||||
|
|
||||||
const schoolOptions = [
|
const schoolOptions = ref([
|
||||||
{ label: "第一中学", value: "第一中学" },
|
{ label: "第一中学", value: "第一中学" },
|
||||||
{ label: "第二中学", value: "第二中学" },
|
{ label: "第二中学", value: "第二中学" },
|
||||||
{ label: "实验中学", value: "实验中学" },
|
{ label: "实验中学", value: "实验中学" },
|
||||||
{ label: "外国语学校", value: "外国语学校" }
|
{ label: "外国语学校", value: "外国语学校" }
|
||||||
];
|
]);
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getenum({ TextName: "Name", ValueName: "Id" }).then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
schoolOptions.value = res.data.map(i => ({
|
||||||
|
label: i.text,
|
||||||
|
value: i.value
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getPageList({
|
||||||
|
orderBy: "string",
|
||||||
|
// orderByType: 0,
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
const gradeOptions = [
|
const gradeOptions = [
|
||||||
{ label: "高一", value: "高一" },
|
{ label: "高一", value: "高一" },
|
||||||
|
|
@ -185,7 +208,8 @@ function createMockList(len = 87): TableItem[] {
|
||||||
const peoplePool = ["张三", "李四", "王五", "赵六", "陈七", "刘八", "黄九"];
|
const peoplePool = ["张三", "李四", "王五", "赵六", "陈七", "刘八", "黄九"];
|
||||||
const list: TableItem[] = [];
|
const list: TableItem[] = [];
|
||||||
for (let i = 1; i <= len; i++) {
|
for (let i = 1; i <= len; i++) {
|
||||||
const school = schoolOptions[rand(0, schoolOptions.length - 1)].value;
|
const school =
|
||||||
|
schoolOptions.value[rand(0, schoolOptions.value.length - 1)].value;
|
||||||
const grade = gradeOptions[rand(0, gradeOptions.length - 1)].value;
|
const grade = gradeOptions[rand(0, gradeOptions.length - 1)].value;
|
||||||
const times = randomDate("2024-01-01", "2025-12-31");
|
const times = randomDate("2024-01-01", "2025-12-31");
|
||||||
const lastTime = dayjs(times).add(rand(0, 120), "day").format("YYYY-MM-DD");
|
const lastTime = dayjs(times).add(rand(0, 120), "day").format("YYYY-MM-DD");
|
||||||
|
|
@ -260,18 +284,25 @@ function handleSizeChange(s: number) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDelete(row: TableItem) {
|
function onDelete(row: TableItem) {
|
||||||
console.log(`删除:${row.school} - ${row.people}`);
|
console.log(`删除`);
|
||||||
ElMessage.success(`已删除:${row.school} - ${row.people}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDetail(row: TableItem) {
|
function onDetail(row: TableItem) {
|
||||||
console.log(`详情:${row.school} - ${row.people}`);
|
console.log(`详情`);
|
||||||
ElMessage.info(`详情:${row.school} - ${row.people}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onFollow(row: TableItem) {
|
function onFollow(row: TableItem) {
|
||||||
console.log(`跟进:${row.school} - ${row.people}`);
|
console.log(`跟进`);
|
||||||
ElMessage.success(`跟进:${row.school} - ${row.people}`);
|
}
|
||||||
|
|
||||||
|
function handleAdd() {
|
||||||
|
console.log("新建");
|
||||||
|
}
|
||||||
|
function handleImport() {
|
||||||
|
console.log("批量导入");
|
||||||
|
}
|
||||||
|
function handleExport() {
|
||||||
|
console.log("导出");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue