فهرست منبع

Merge branch 'feat/studentManage' into develop3.0

osbert 4 سال پیش
والد
کامیت
45a0f643b3

+ 18 - 15
TEAMModelOS/ClientApp/src/api/stuAccount.js

@@ -1,28 +1,31 @@
 import { fetch, post } from '@/api/http'
 
 export default {
-    saveStudent: function(data) {
-        // return post('/api/Student/upsert', data)
-        // let format = {
-        //     "grant_type": "create",
-        //     "schoolId": this.$store.state.user.schoolCode.toLowerCase()
-        // }
-        return post('/api/Student/student-manage', data)
+    saveStudent: function(schoolId, data) {
+        let format = {
+            "grant_type": "create",
+            "schoolId": schoolId.toLowerCase(),
+            "students": []
+        }
+        format.students.push(data)
+        return post('/api/Student/student-manage', format)
     },
     //��ѯѧ��
-    findStudent: function(schoolCode, params) {
-        // return post('/api/Student/Find', data)
+    findStudent: function(schoolId) {
         let format = {
             "grant_type": "read",
-            "schoolId": schoolCode.toLowerCase()
-        }
-        if(params){
-            console.log('有變數')
+            "schoolId": schoolId.toLowerCase()
         }
         return post('/api/Student/student-manage', format)
     },
-    saveAllStudent: function(data) {
-        return post('/api/Student/upsertAll', data)
+    saveAllStudent: function(schoolId, data) {
+        let format = {
+            "grant_type": "update",
+            "schoolId": schoolId.toLowerCase(),
+            "students": []
+        }
+        format.students.push(data)
+        return post('/api/Student/student-manage', format)
     },
     updateStudent: function(data) {
         return post('/api/Student/upsert', data)

+ 1 - 1
TEAMModelOS/ClientApp/src/common/BaseLayout.vue

@@ -201,7 +201,7 @@
                             {
                                 icon: 'iconfont icon-xueqing',
                                 name: '校园分析',
-                                router: '/404',
+                                router: '/home/scboard',
                                 tag: '(预览)',
                                 role: 'admin',
                                 permission: 'analysis'

+ 10 - 0
TEAMModelOS/ClientApp/src/store/module/schoolBaseInfo.js

@@ -27,6 +27,13 @@ export default {
         },
         setStudents(state, data) {
             state.students.push(...data)
+        },
+        uptStudents(state, data) {
+            data.forEach(function(uptItem){
+                state.students.forEach(function(orgItem){
+
+                })
+            })
         }
     },
     actions: {
@@ -145,6 +152,9 @@ export default {
         },
         setStudentsToState(context, data) {
             context.commit('setStudents', data)
+        },
+        uptStudentsToState(context, data) {            
+            context.commit('uptStudents', data)
         }
     }
 }

+ 81 - 85
TEAMModelOS/ClientApp/src/view/student-account/AddStudent.vue

@@ -71,14 +71,14 @@
         <!--新增学生表单-->
         <Form ref="studentInfoForm" :model="studentInfo" label-position="top" :rules="ruleValidate" :show-message="showError" v-if="bizType == 1">
             <!-- ID -->
-            <FormItem :label="$t('stuAccount.accountInfo')" prop="studentId">
-                <Input v-model="studentInfo.studentId" :placeholder="$t('stuAccount.accountHolder')" @on-change="setPassword(same)">
+            <FormItem :label="$t('stuAccount.accountInfo')" prop="id">
+                <Input v-model="studentInfo.id" :placeholder="$t('stuAccount.accountHolder')" @on-change="setPassword(same)">
                 <!-- <span slot="prepend">{{schoolCode}}#</span> 前方 -->
                 </Input>
             </FormItem>
             <!-- 密碼 -->
-            <FormItem :label="$t('stuAccount.passwordInfo')" prop="password.value">
-                <Input v-model="studentInfo.password.value" type="password" password :placeholder="$t('stuAccount.passwordHolder')"></Input>
+            <FormItem :label="$t('stuAccount.passwordInfo')" prop="pw">
+                <Input v-model="studentInfo.pw" type="password" password :placeholder="$t('stuAccount.passwordHolder')"></Input>
                 <Checkbox v-model="same" @on-change="setPassword">{{$t('stuAccount.isSame')}}</Checkbox>
             </FormItem>
             <!-- 姓名 -->
@@ -86,19 +86,16 @@
                 <Input v-model="studentInfo.name" :placeholder="$t('stuAccount.stuNameHolder')"></Input>
             </FormItem>
             <!-- 教室資訊 -->
-            <FormItem :label="$t('stuAccount.classroomInfo')" prop="classroomCode">
-                <Select filterable style="width:100%" :placeholder="$t('stuAccount.classroomInfoHolder')" v-model="studentInfo.classroomCode" clearable>
+            <FormItem :label="$t('stuAccount.classroomInfo')" prop="classId">
+                <Select filterable style="width:100%" :placeholder="$t('stuAccount.classroomInfoHolder')" v-model="studentInfo.classId" clearable>
                     <Option v-for="(item,index) in classes" :value="item.id" :key="index" @click.native="setCurrentClassDetail(item)">{{ item.name }}</Option>
                 </Select>
                 <span style="float:right;color:#6DE2C4;cursor:pointer;text-decoration:underline;font-size:12px;" @click="createClassroom">{{$t('stuAccount.newClassroom')}}</span>
             </FormItem>
-            <!--<FormItem :label="$t('stuAccount.periodInfo')" prop="periodCode">
-                <span style="color:white;margin-left:15px;">{{fn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo,studentInfo.periodCode).periodName}}</span>
-            </FormItem>-->
             <div style="display:flex;justify-content: space-between;">
                 <!-- 座位號 -->
-                <FormItem :label="$t('stuAccount.stuSeatNo')" prop="seatNo" style="width:45%">
-                    <InputNumber v-model="studentInfo.seatNo" :min="1" :placeholder="$t('stuAccount.stuSeatNoHolder')"></InputNumber>
+                <FormItem :label="$t('stuAccount.stuSeatNo')" prop="no" style="width:45%">
+                    <InputNumber v-model="studentInfo.no" :min="1" :placeholder="$t('stuAccount.stuSeatNoHolder')"></InputNumber>
                 </FormItem>
                 <!-- 學級 -->
                 <FormItem :label="$t('stuAccount.gradeInfo')" prop="gradeCode" style="width:45%">
@@ -107,8 +104,8 @@
             </div>
             <div style="display:flex;justify-content: space-between;">
                 <!-- 學年度 -->
-                <FormItem :label="$t('stuAccount.academicYear')" prop="academicYear" style="width:45%">
-                    <InputNumber v-model="studentInfo.academicYear" :editable="false"></InputNumber>
+                <FormItem :label="$t('stuAccount.academicYear')" prop="year" style="width:45%">
+                    <InputNumber v-model="studentInfo.year" :editable="false"></InputNumber>
                 </FormItem>
             </div>
         </Form>
@@ -116,38 +113,43 @@
         <!--修改信息表单-->
         <Form ref="updateForm" :model="editStudentInfo[0]" label-position="top" :rules="ruleValidate" :show-message="showError" v-if="bizType == 2">
             <FormItem :label="$t('stuAccount.chooseInfo')" v-if="editStudentInfo.length > 1">
-                <span class="account-item" :key="index" v-for="(item,index) in editStudentInfo">{{item.studentId}}{{index < editStudentInfo.length - 1 ? ", ":""}}</span>
+                <span class="account-item" :key="index" v-for="(item,index) in editStudentInfo">{{item.id}}{{index < editStudentInfo.length - 1 ? ", ":""}}</span>
             </FormItem>
             <FormItem :label="$t('stuAccount.chooseNum') + editStudentInfo.length + $t('stuAccount.numUnit')" v-if="editStudentInfo.length > 1">
             </FormItem>
-            <FormItem :label="$t('stuAccount.accountInfo')" prop="studentId" v-if="editStudentInfo.length == 1">
-                <Input v-model="editStudentInfo[0].studentId" disabled :placeholder="$t('stuAccount.accountHolder')" @on-change="setPassword(same)">
-                <span slot="prepend">{{schoolCode}}#</span>
-                </Input>
+            <FormItem :label="$t('stuAccount.accountInfo')" prop="id" v-if="editStudentInfo.length == 1">
+                <Input v-model="editStudentInfo[0].id" disabled :placeholder="$t('stuAccount.accountHolder')" @on-change="setPassword(same)"></Input>
             </FormItem>
-            <FormItem :label="$t('stuAccount.passwordInfo')" prop="password" v-if="editStudentInfo.length == 1">
-                <Input v-model="editStudentInfo[0].password.value" type="password" disabled :placeholder="$t('stuAccount.passwordHolder')">
-                <span slot="append" size="small" style="cursor:pointer;">重置密码</span>
+            <FormItem :label="$t('stuAccount.passwordInfo')" prop="pw" v-if="editStudentInfo.length == 1">
+                <Input v-model="editStudentInfo[0].pw" disabled type="text" :placeholder="$t('stuAccount.passwordHolder')">
+                    <span slot="append" size="small" style="cursor:pointer;" @click="setPassword(true)">重置密码</span>
                 </Input>
             </FormItem>
             <FormItem :label="$t('stuAccount.stuName')" prop="name" v-if="editStudentInfo.length == 1">
                 <Input v-model="editStudentInfo[0].name" :placeholder="$t('stuAccount.stuNameHolder')"></Input>
             </FormItem>
-            <FormItem :label="$t('stuAccount.classroomInfo')" prop="classroomCode">
-                <Select filterable style="width:100%" v-model="editStudentInfo[0].classroomCode" :placeholder="$t('stuAccount.classroomInfoHolder')" clearable>
-                    <Option v-for="(item,index) in classes" :value="item.id" :key="item.id" @click.native="getCurrentClassroom(index)">{{ item.name }}</Option>
+            <FormItem :label="$t('stuAccount.classroomInfo')" prop="classId">
+                <Select filterable style="width:100%" v-model="editStudentInfo[0].classId" :placeholder="$t('stuAccount.classroomInfoHolder')" clearable>
+                    <Option v-for="(item) in classes" :value="item.id" :key="item.id" @click.native="setCurrentClassDetail(item)">{{ item.name }}</Option>
                 </Select>
                 <span style="float:right;color:#6DE2C4;cursor:pointer;text-decoration:underline;" @click="createClassroom">{{$t('stuAccount.newClassroom')}}</span>
             </FormItem>
             <div style="display:flex;justify-content: space-between;" v-if="editStudentInfo.length == 1">
-                <FormItem :label="$t('stuAccount.stuSeatNo')" prop="seatNo" style="width:45%">
-                    <Input type="number" number v-model="editStudentInfo[0].seatNo" :min="1" :placeholder="$t('stuAccount.stuSeatNoHolder')"></Input>
+                <FormItem :label="$t('stuAccount.stuSeatNo')" prop="no" style="width:45%">
+                    <Input type="number" number v-model="editStudentInfo[0].no" :min="1" :placeholder="$t('stuAccount.stuSeatNoHolder')"></Input>
                 </FormItem>
                 <FormItem :label="$t('stuAccount.gradeInfo')" prop="gradeCode" style="width:45%">
-                    <span style="color:white;">{{editStudentInfo[0].gradeName}}</span>
+                    <span style="color:white;">{{ gradeName }}</span>
+                </FormItem>
+            </div>
+            <div style="display:flex;justify-content: space-between;">
+                <!-- 學年度 -->
+                <FormItem :label="$t('stuAccount.academicYear')" prop="year" style="width:45%">
+                    <InputNumber v-model="editStudentInfo[0].year" :editable="false"></InputNumber>
                 </FormItem>
             </div>
         </Form>
+
         <Button @click="confirm()" :loading="isLoading" type="success" :class="isFull?'confirm-btn confirm-btn-active':'confirm-btn'">{{isFull ? $t('stuAccount.submitActive'): bizType == 1 ? $t('stuAccount.submitAccount'):$t('stuAccount.submitActive')}}</Button>
     </div>
 </template>
@@ -170,7 +172,7 @@
                 default: () => {
                     return [
                         {
-                            classroomCode: ''
+                            classId: ''
                         }
                     ]
                 }
@@ -183,19 +185,26 @@
         data() {
             const validateSeatNo = (rule, value, callback) => {
                 let flag = (value == null || typeof value == 'undefined' || value === '')
-                if (flag && (this.studentInfo.classroomCode != null && typeof this.studentInfo.classroomCode != 'undefined' && this.studentInfo.classroomCode !=='')) {
+                if (flag && (this.studentInfo.classId != null && typeof this.studentInfo.classId != 'undefined' && this.studentInfo.classId !=='')) {
                     callback(new Error('学生座位号不能为空'));                    
                 } else {
                     callback();
                 }
             };
-            const validateClassroomCode = (rule, value, callback) => {
-                if (value === '' &&  (this.studentInfo.seatNo != null && typeof this.studentInfo.seatNo != 'undefined' && this.studentInfo.seatNo !=='')) {
+            const validateclassId = (rule, value, callback) => {
+                if (value === '' &&  (this.studentInfo.no != null && typeof this.studentInfo.no != 'undefined' && this.studentInfo.no !=='')) {
                     callback(new Error('班级资讯不能为空'));
                 } else {
                     callback()
                 }
             };
+            const validatePw = (rule, value, callback) => {
+                if(this.bizType == 1 && value === ''){
+                    callback(new Error('密码不能为空'));
+                } else {
+                    callback()
+                }
+            };            
             return {
                 fn,
                 isLoading: false,
@@ -207,33 +216,32 @@
                 list: [],
                 studentInfo: {
                     name: '',
-                    studentId: '',
-                    seatNo: null,
-                    classroomCode:'',
+                    id: '',
+                    no: null,
+                    classId:'',
                     className:'',
                     // periodCode:'',
                     // gradeCode:'',
-                    password: {
-                        value: ''
-                    },
-                    academicYear: new Date().getFullYear()
+                    pw: '',
+                    year: new Date().getFullYear()
                 },
                 gradeName:'',
                 ruleValidate: {
-                    studentId: [
+                    id: [
                         { required: true, message: '账号不能为空', trigger: 'blur' }
                     ],
-                    'password.value': [
-                        { required: true, message: '密码不能为空', trigger: 'blur' }
+                    pw: [
+                        // { required: true, message: '密码不能为空', trigger: 'blur' }
+                        { validator: validatePw, trigger: 'blur' }
                     ],
                     name: [
                         { required: true, message: '学生姓名不能为空', trigger: 'blur' }
                     ],
-                    seatNo: [
+                    no: [
                         { validator: validateSeatNo, type: 'number', trigger: 'blur' }
                     ],
-                    classroomCode: [
-                        { validator: validateClassroomCode, trigger: 'blur' },
+                    classId: [
+                        { validator: validateclassId, trigger: 'blur' },
                     ]
                 },
                 modal_loading: false
@@ -250,9 +258,9 @@
                 get() {
                     // if (this.bizType == 2 && this.isShow == true) {
                     //  if (this.editStudentInfo.length == 1) {
-                    //    let arr = this.editStudentInfo[0].studentId.split("#");
+                    //    let arr = this.editStudentInfo[0].id.split("#");
                     //    if (arr.length > 1) {
-                    //      this.editStudentInfo[0].studentId = arr[1];
+                    //      this.editStudentInfo[0].id = arr[1];
                     //    } else {
                     //      alert("学生账号格式错误!");
                     //    }
@@ -276,17 +284,9 @@
             setPassword(data) {
                 //bizType 编辑
                 if (this.bizType == 2) {
-                    if (data) {
-                        this.$set(this.editStudentInfo[0], 'password.value', this.editStudentInfo[0].studentId)
-                    } else {
-                        // this.$set(this.editStudentInfo[0], 'password', "");
-                    }
+                    this.$set(this.editStudentInfo[0], 'pw', data ? this.editStudentInfo[0].id : '')
                 } else {
-                    if (data) {
-                        this.studentInfo.password.value = this.studentInfo.studentId
-                    } else {
-                        // this.studentInfo.password = "";
-                    }
+                    this.studentInfo.pw = data ? this.studentInfo.id : ''
                 }
             },
             setCurrentClassDetail(item){
@@ -310,7 +310,7 @@
                     // this.studentInfo.classroomName = this.classroomList[index].classroomName
                     // this.studentInfo.periodCode = this.classroomList[index].periodCode;
                     // this.studentInfo.gradeCode = this.classroomList[index].gradeCode;
-                    // this.studentInfo.classroomCode = this.classroomList[index].classroomCode;
+                    // this.studentInfo.classId = this.classroomList[index].classId;
                     // let currentInfo = this.$JSONPath.query(this.$store.state.schoolBaseInfo.schoolBaseInfo, "$..period[?(@.periodCode=='" + this.classroomList[index].periodCode + "')]")
 
                     // if (currentInfo.length > 0) {
@@ -329,7 +329,7 @@
                     // for (let i = 0; i < this.editStudentInfo.length; i++) {
                     //     this.editStudentInfo[i].periodCode = this.classroomList[index].periodCode
                     //     this.editStudentInfo[i].gradeCode = this.classroomList[index].gradeCode
-                    //     this.editStudentInfo[i].classroomCode = this.classroomList[index].classroomCode
+                    //     this.editStudentInfo[i].classId = this.classroomList[index].classId
                     //     this.$set(this.editStudentInfo[i],'periodName',periodName)
                     //     this.$set(this.editStudentInfo[i],'gradeName',gradeName)
                     // }
@@ -355,11 +355,15 @@
                     this.same = false
                     if (this.bizType == 2) {
                         this.isLoading = true
-                        if (this.editStudentInfo.length == 1) {
-                            // this.editStudentInfo[0].studentId = this.schoolCode + '#' + this.editStudentInfo[0].studentId
-                            this.editStudentInfo[0].studentId = this.editStudentInfo[0].studentId
-                        }
-                        this.$api.stuAccount.saveAllStudent(this.editStudentInfo).then(
+                        let editInfo = this.editStudentInfo.map(function(item){
+                            let itemTemp = item
+                            if(itemTemp.pw == '******') {
+                                delete itemTemp.pw
+                            }
+                            return itemTemp
+                        })
+
+                        this.$api.stuAccount.saveAllStudent(this.schoolCode, this.editStudentInfo).then(
                             (res) => {
                                 if (res.error == null) {
                                     this.show = false
@@ -382,35 +386,27 @@
                         )
                     } else {
                         this.isLoading = true
-                        this.studentInfo.code = this.schoolCode
-                        this.studentInfo.studentId = this.studentInfo.studentId
 
                         let apiData = {
-                            "grant_type": "create",
-                            "schoolId": this.studentInfo.code.toLowerCase(),
-                            "students": [
-                                {
-                                    "id": this.studentInfo.studentId,
-                                    "no": this.studentInfo.seatNo ? this.studentInfo.seatNo.toString() : '',
-                                    "name": this.studentInfo.name,
-                                    "year": this.studentInfo.academicYear ? this.studentInfo.academicYear.toString() : '',
-                                    "pw": this.studentInfo.password.value,
-                                    "classId": this.studentInfo.classroomCode,
-                                    // Excel 匯入才需要給classname
-                                    // "className":this.studentInfo.classroomName ? this.studentInfo.classroomName : ''
-                                }
-                            ]
+                            "id": this.studentInfo.id,
+                            "no": this.studentInfo.no ? this.studentInfo.no.toString() : '',
+                            "name": this.studentInfo.name,
+                            "year": this.studentInfo.year ? this.studentInfo.year.toString() : '',
+                            "pw": this.studentInfo.pw,
+                            "classId": this.studentInfo.classId,
+                            // Excel 匯入才需要給classname
+                            // "className":this.studentInfo.classroomName ? this.studentInfo.classroomName : ''
                         }
 
-                        let checkData = apiData.students[0]
                         let isRepeat= this.students.some(function(item){                            
-                            return (item.id === checkData.id || (checkData.classId !='' && checkData.classId === item.classId && checkData.no === item.no))
+                            return (item.id === apiData.id || (apiData.classId !='' && apiData.classId === item.classId && apiData.no === item.no))
                         })
                         if(isRepeat){
                             this.$Message.error('請檢查 帳號資訊 或 座號重複 了。')
                             this.isLoading = false
                         } else {
-                            this.$api.stuAccount.saveStudent(apiData).then(
+
+                            this.$api.stuAccount.saveStudent(this.schoolCode, apiData).then(
                                 (res) => {
                                     if (res.error == null) {
                                         this.show = false
@@ -443,12 +439,12 @@
             // this.getClassroom()
         },
         mounted() {
-            console.log(this.editStudentInfo, 'this.editStudentInfo')
             if (this.bizType == 2 && this.isShow == true) {
                 if (this.editStudentInfo.length == 1) {
-                    // let arr = this.editStudentInfo[0].studentId.split('#')
+                    this.setCurrentClassDetail(this.editStudentInfo[0])
+                    // let arr = this.editStudentInfo[0].id.split('#')
                     // if (arr.length > 1) {
-                    //     this.editStudentInfo[0].studentId = arr[1]
+                    //     this.editStudentInfo[0].id = arr[1]
                     // } else {
                     //     alert('学生账号格式错误!')
                     // }

+ 2 - 2
TEAMModelOS/ClientApp/src/view/student-account/Index.less

@@ -30,14 +30,14 @@
             float: left;
             line-height: 45px;
             height: 45px;
-            width: 49%;
+            width: 57%;
         }
 
         &-right {
             float: right;
             line-height: 45px;
             height: 45px;
-            width: 50%;
+            width: 42%;
 
             ul {
                 list-style: none;

+ 28 - 62
TEAMModelOS/ClientApp/src/view/student-account/Index.vue

@@ -10,21 +10,20 @@
         <!--菜单栏-->
         <div class="sc-menu">
             <div class="sc-menu-left dark-iview-select">
-                <!-- 字串模糊搜尋 -->
-                <Input v-model="searchText" clearable :placeholder="$t('stuAccount.searchHolder')" style="width: 28%;margin-left:20px;" search @on-search="filterData"  @on-clear="filterData">
-                </Input>
                 <!-- 學制Select -->
-                <Select v-model="searchPeriod" style="width:20%;margin-left:5%;" :placeholder="$t('stuAccount.periodHolder')" clearable @on-change="filterData">
+                <Select v-model="searchPeriod" style="width:18%;" :placeholder="$t('stuAccount.periodHolder')" clearable @on-change="filterData">
                     <Option v-for="(item,index) in periods" :value="item.id" :key="index">{{ item.name }}</Option>
                 </Select>
                 <!-- 學級Select -->
-                <Select v-model="searchGrade" style="width:20%;margin-left:1%;" :placeholder="$t('stuAccount.gradeHolder')" clearable @on-change="filterData">
+                <Select v-model="searchGrade" style="width:18%;margin-left:1%;" :placeholder="$t('stuAccount.gradeHolder')" clearable @on-change="filterData">
                     <Option v-for="(item,index) in filterGrades" :value="item.id" :key="index">{{ item.name }}</Option>
                 </Select>
                 <!-- 教室Select -->
-                <Select v-model="searchClassroom" ref="classroom" style="width:20%;margin-left:1%;" :placeholder="$t('stuAccount.classroomHolder')" clearable @on-change="filterData">
+                <Select v-model="searchClassroom" ref="classroom" style="width:18%;margin-left:1%;" :placeholder="$t('stuAccount.classroomHolder')" clearable @on-change="filterData">
                     <Option v-for="(item,index) in filterClasses" :value="item.id" :key="index">{{ item.name }}</Option>
                 </Select>
+                <!-- 字串模糊搜尋 -->
+                <Input v-model="searchText" clearable :placeholder="$t('stuAccount.searchHolder')" style="width: 28%;margin-left:6%;" search @on-search="filterData"  @on-clear="filterData"></Input>
             </div>
             <div class="sc-menu-right sc-text-no-select">
                 <ul v-if="$access.can('admin.*|student-upd')">
@@ -136,6 +135,7 @@
                 pageSize: 20,
                 bizType: 0, // 0:新增 1:修改
                 editStudentInfo: [],
+                editOneStudtInfo: {},
                 selections: [],
                 selectRow: {},
                 addStudentStatus: false,
@@ -175,43 +175,6 @@ console.log(index, 'getGradeList')
                     this.$refs.classroom.clearSingleSelect()
                 }
             },
-            // getPageData() {
-            //     this.findStudentInfo()
-            // },
-            /**设置每页数量 */
-            // setPageSize(pageSize) {
-            //     this.pageSize = pageSize
-            //     this.findStudentInfo()
-            // },
-            /**
-             * 远程搜索 
-             * 暂时只支持一个条件模糊查询
-             * 需要回车触发
-             * */
-            searchData() {
-                this.tableLoading = true
-                this.currentPage = 1
-                
-                let findCountParams = {
-                    "collectionName": "Student",
-                    "queryDict": {
-                        'code': this.$store.state.user.schoolCode,
-                        //'$.name': this.searchText,
-                        '$.studentId': this.searchText,
-                    }
-                }
-                this.getResultCount(findCountParams)
-                let params = {
-                    '@CURRPAGE': this.currentPage,
-                    '@PAGESIZE': this.pageSize,
-                    'code': this.$store.state.user.schoolCode,
-                    //'$.name': this.searchText,
-                    '$.studentId': this.searchText,
-                }
-                // this.baseFindStudent(params)
-            },
-            
-            
             cancelAll() {
                 this.selections = []
             },
@@ -243,20 +206,14 @@ console.log(index, 'getGradeList')
                 this.selectRow = row
             },
             closeAddStudent(data) {
-                if (data.action == 1) {
-                    this.$store.dispatch('schoolBaseInfo/setStudentsToState', data.studentInfos)
-                    this.findStudentInfo()
-
-                    // let infoString = JSON.stringify(data.studentInfo)
-                    // let info = JSON.parse(infoString)
-                    // this.tableData.unshift(info);
-
-                    // [...this.tableShowData] = this.tableData
-                    // this.getPageData()
-                    // this.totalNum++
-                } else {
-                    this.findStudentInfo()
-                }
+                // 給一個 PW 讓AddStudent.vue 的Watch 可以動作
+                let newStudents = data.studentInfos.map(function(item){
+                    let temp = item
+                    temp.pw = '******'
+                    return temp
+                })
+                let storePath = (data.action == 1 ? 'schoolBaseInfo/setStudentsToState' : 'schoolBaseInfo/uptStudentsToState')
+                this.$store.dispatch(storePath, newStudents)
                 this.addStudentStatus = false
             },
             closeImportStudent(data) {
@@ -282,12 +239,14 @@ console.log(index, 'getGradeList')
                 this.bizType = 2
                 if (index != undefined) {
                     this.editStudentInfo = []
+                    index.year = parseInt(index.year)
                     this.editStudentInfo.push(index)
+                    
                     // this.tableShowData[index]._checked = true
                     // this.$forceUpdate()
                     this.addStudentStatus = true
                 } else {
-                    console.log(this.selections)
+                    console.log(this.selections, 'selections')
                     if (this.selections.length > 0) {
                         this.editStudentInfo.length = 0
                         this.editStudentInfo = [...this.selections]
@@ -434,8 +393,8 @@ console.log(index, 'getGradeList')
                         width: 120
                     },
                     //{
-                    //    slot: 'classroomCode',
-                    //    title: this.$t('stuAccount.classroomCode'),
+                    //    slot: 'classId',
+                    //    title: this.$t('stuAccount.classId'),
                     //    align: 'center'
                     //},
                     //{
@@ -473,13 +432,19 @@ console.log(index, 'getGradeList')
                 this.$api.stuAccount.findStudent(this.$store.state.user.schoolCode).then(
                     (res) => {
                         this.tableLoading = false
-                        this.$store.dispatch('schoolBaseInfo/setStudentsToState', res.students)
+                        // 給一個 PW 讓AddStudent.vue 的Watch 可以動作
+                        let newStudents = res.students.map(function(item){
+                            let temp = item
+                            temp.pw = '******'
+                            return temp
+                        })
+                        this.$store.dispatch('schoolBaseInfo/setStudentsToState', newStudents)
                         this.filterData()
 
                         // if (res.error == null) {
                         //     this.tableData = res.result.data
                         //     for (let index in this.tableData) {
-                        //         let currentClassroomlInfo = this.$JSONPath.query(this.$store.state.schoolBaseInfo.classroomList, "$..[?(@.classroomCode=='" + this.tableData[index].classroomCode + "')]")
+                        //         let currentClassroomlInfo = this.$JSONPath.query(this.$store.state.schoolBaseInfo.classroomList, "$..[?(@.classId=='" + this.tableData[index].classId + "')]")
                         //         if (currentClassroomlInfo.length > 0) {
                         //             let currentSchoolInfo = this.$JSONPath.query(this.$store.state.schoolBaseInfo.schoolBaseInfo, "$..period[?(@.periodCode=='" + currentClassroomlInfo[0].periodCode + "')]")
                         //             if (currentSchoolInfo.length > 0) {
@@ -529,6 +494,7 @@ console.log(index, 'getGradeList')
                     })
                     return classesData[0].name
                 }
+
             },
             scrollLoad: function(){
                 setTimeout(() => {