main
黄海 9 months ago
parent 5f4e528fb5
commit 14499bf08c

@ -1,6 +1,6 @@
<template> <template>
<div class="footer flx-center"> <div class="footer flx-center">
<a href="https://github.com/HalseySpicy" target="_blank"> 2022 © Geeker-Admin By Geeker Technology. </a> <a javascript="void(0)" target="_blank"> 2024 © 东北师大理想软件股份有限公司 </a>
</div> </div>
</template> </template>

@ -56,8 +56,10 @@ const getStageSelect = async () => {
const stageSelectChange = async e => { const stageSelectChange = async e => {
proTable.value!.searchParam.subject_id = ""; proTable.value!.searchParam.subject_id = "";
subjectEnum.value.splice(0, subjectEnum.value.length); subjectEnum.value.splice(0, subjectEnum.value.length);
if (e) {
const res = await getSubjectList({ stage_id: e, pageNum: 1, pageSize: 100 }); const res = await getSubjectList({ stage_id: e, pageNum: 1, pageSize: 100 });
subjectEnum.value.push(...res.data.list); subjectEnum.value.push(...res.data.list);
}
initParam.stage_id = e; initParam.stage_id = e;
initParam.subject_id = ""; initParam.subject_id = "";
}; };

@ -1,6 +1,13 @@
<template> <template>
<div class="table-box"> <div class="table-box">
<ProTable ref="proTable" :columns="columns" :request-api="getTableList" :toolButton="_toolButton" :border="true"> <ProTable
ref="proTable"
:columns="columns"
:request-api="getTableList"
:initParam="initParam"
:toolButton="_toolButton"
:border="true"
>
<!-- 表格 header 按钮 --> <!-- 表格 header 按钮 -->
<template #tableHeader=""> <template #tableHeader="">
<el-button type="primary" :icon="CirclePlus" @click="openDrawer('新增')"></el-button> <el-button type="primary" :icon="CirclePlus" @click="openDrawer('新增')"></el-button>
@ -29,6 +36,7 @@ import { CirclePlus, Delete, EditPen } from "@element-plus/icons-vue";
// ProTable // ProTable
const proTable = ref<ProTableInstance>(); const proTable = ref<ProTableInstance>();
const initParam = reactive({ stage_id: "" });
const _toolButton = ["refresh"]; const _toolButton = ["refresh"];
@ -36,6 +44,11 @@ const getTableList = (params: any) => {
return getSubjectList(params); return getSubjectList(params);
}; };
const stageSelectChange = async e => {
console.log(e);
initParam.stage_id = e;
};
// //
const columns = reactive<ColumnProps<Subject.ResSubjectList>[]>([ const columns = reactive<ColumnProps<Subject.ResSubjectList>[]>([
{ type: "index", width: 70, label: "序号" }, { type: "index", width: 70, label: "序号" },
@ -52,7 +65,7 @@ const columns = reactive<ColumnProps<Subject.ResSubjectList>[]>([
{ stage_id: 6, stage_name: "高中" }, { stage_id: 6, stage_name: "高中" },
{ stage_id: 7, stage_name: "职业" } { stage_id: 7, stage_name: "职业" }
], ],
search: { el: "select", props: { filterable: true } }, search: { el: "select", props: { onChange: stageSelectChange } },
fieldNames: { label: "stage_name", value: "stage_id" } fieldNames: { label: "stage_name", value: "stage_id" }
}, },
{ prop: "sort_id", label: "排序号" }, { prop: "sort_id", label: "排序号" },

Loading…
Cancel
Save