|
@@ -125,6 +125,21 @@
|
|
|
label="备注"
|
|
|
width="160"
|
|
|
></el-table-column>
|
|
|
+ <!-- 自定义字段 -->
|
|
|
+ <template v-if="extendFields.length">
|
|
|
+ <el-table-column
|
|
|
+ v-for="field in extendFields"
|
|
|
+ :key="field.code"
|
|
|
+ :prop="field.code"
|
|
|
+ :label="field.name"
|
|
|
+ width="140"
|
|
|
+ >
|
|
|
+ <span slot-scope="scope">{{
|
|
|
+ scope.row.extendFieldDict[field.code]
|
|
|
+ }}</span>
|
|
|
+ </el-table-column>
|
|
|
+ </template>
|
|
|
+
|
|
|
<el-table-column prop="createTime" label="创建时间" width="170">
|
|
|
<span slot-scope="scope">{{
|
|
|
scope.row.createTime | timestampFilter
|
|
@@ -169,6 +184,7 @@
|
|
|
|
|
|
<modify-student
|
|
|
:instance="curRow"
|
|
|
+ :extendFields="extendFields"
|
|
|
@modified="getList"
|
|
|
ref="ModifyStudent"
|
|
|
></modify-student>
|
|
@@ -198,7 +214,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { studentListQuery, deleteStudent, exportStudentTemplate } from "../api";
|
|
|
+import {
|
|
|
+ studentListQuery,
|
|
|
+ deleteStudent,
|
|
|
+ exportStudentTemplate,
|
|
|
+ fieldListQuery,
|
|
|
+} from "../api";
|
|
|
import ModifyStudent from "../components/ModifyStudent.vue";
|
|
|
import ImportFile from "../../../components/ImportFile.vue";
|
|
|
import DataTaskDialog from "../components/DataTaskDialog.vue";
|
|
@@ -222,13 +243,25 @@ export default {
|
|
|
curRow: {},
|
|
|
multipleSelection: [],
|
|
|
taskType: "",
|
|
|
+ extendFields: [],
|
|
|
// import
|
|
|
tempDownloading: false,
|
|
|
uploadUrl: "/api/admin/exam/student/import",
|
|
|
dfilename: "考生导入模板.xlsx",
|
|
|
};
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.getExtendFields();
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ async getExtendFields() {
|
|
|
+ const res = await fieldListQuery();
|
|
|
+ const fields = res || [];
|
|
|
+
|
|
|
+ this.extendFields = fields.filter(
|
|
|
+ (item) => !item.basicField && item.enable
|
|
|
+ );
|
|
|
+ },
|
|
|
async getList() {
|
|
|
if (!this.checkPrivilege("list", "list")) return;
|
|
|
|
|
@@ -238,7 +271,17 @@ export default {
|
|
|
pageSize: this.size,
|
|
|
};
|
|
|
const data = await studentListQuery(datas);
|
|
|
- this.dataList = data.records;
|
|
|
+ this.dataList = data.records.map((item) => {
|
|
|
+ const eInfo = item.extendFields ? JSON.parse(item.extendFields) : [];
|
|
|
+ const extendFieldDict = {};
|
|
|
+ eInfo.forEach((field) => {
|
|
|
+ extendFieldDict[field.code] = field.value;
|
|
|
+ });
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ extendFieldDict,
|
|
|
+ };
|
|
|
+ });
|
|
|
this.total = data.total;
|
|
|
},
|
|
|
toPage(page) {
|