|
@@ -379,7 +379,17 @@ const pageUpdateEvent = () => {
|
|
let dataOld = response?.data?.data;
|
|
let dataOld = response?.data?.data;
|
|
let data = dataOld?.list;
|
|
let data = dataOld?.list;
|
|
state.value.total = dataOld.total;
|
|
state.value.total = dataOld.total;
|
|
- state.value.list = data;
|
|
|
|
|
|
+
|
|
|
|
+ let newList = [];
|
|
|
|
+ // 循环数组,一些特殊字段进行处理
|
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
|
+ let thisData = data[i];
|
|
|
|
+ let newType = thisData["userType"] == 0 ? "老师" : "学生";
|
|
|
|
+ thisData["newType"] = newType;
|
|
|
|
+ newList.push(thisData);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ state.value.list = newList;
|
|
|
|
|
|
// console.log(
|
|
// console.log(
|
|
// "userListEvent response", response, data
|
|
// "userListEvent response", response, data
|
|
@@ -1147,6 +1157,7 @@ onMounted(function() {
|
|
<el-table-column align="center" type="selection" width="110" />
|
|
<el-table-column align="center" type="selection" width="110" />
|
|
<el-table-column prop="userName" label="账号" />
|
|
<el-table-column prop="userName" label="账号" />
|
|
<el-table-column prop="nickName" label="姓名" />
|
|
<el-table-column prop="nickName" label="姓名" />
|
|
|
|
+ <el-table-column prop="newType" label="类型" />
|
|
<el-table-column label="操作">
|
|
<el-table-column label="操作">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<el-button link type="primary" @click="btnDetail(scope.row)">编辑</el-button>
|
|
<el-button link type="primary" @click="btnDetail(scope.row)">编辑</el-button>
|