|
|
|
@ -1,6 +1,13 @@
|
|
|
|
|
<template>
|
|
|
|
|
<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 按钮 -->
|
|
|
|
|
<template #tableHeader="">
|
|
|
|
|
<el-button type="primary" :icon="CirclePlus" @click="openDrawer('新增')">新增科目</el-button>
|
|
|
|
@ -29,6 +36,7 @@ import { CirclePlus, Delete, EditPen } from "@element-plus/icons-vue";
|
|
|
|
|
|
|
|
|
|
// ProTable 实例
|
|
|
|
|
const proTable = ref<ProTableInstance>();
|
|
|
|
|
const initParam = reactive({ stage_id: "" });
|
|
|
|
|
|
|
|
|
|
const _toolButton = ["refresh"];
|
|
|
|
|
|
|
|
|
@ -36,6 +44,11 @@ const getTableList = (params: any) => {
|
|
|
|
|
return getSubjectList(params);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const stageSelectChange = async e => {
|
|
|
|
|
console.log(e);
|
|
|
|
|
initParam.stage_id = e;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 表格配置项
|
|
|
|
|
const columns = reactive<ColumnProps<Subject.ResSubjectList>[]>([
|
|
|
|
|
{ type: "index", width: 70, label: "序号" },
|
|
|
|
@ -52,7 +65,7 @@ const columns = reactive<ColumnProps<Subject.ResSubjectList>[]>([
|
|
|
|
|
{ stage_id: 6, 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" }
|
|
|
|
|
},
|
|
|
|
|
{ prop: "sort_id", label: "排序号" },
|
|
|
|
|