Browse Source

学生账号管理模块

liqk 5 years ago
parent
commit
62eef49eb4

+ 4 - 0
TEAMModelOS/ClientApp/locale/lang/en-US/stuAccount.js

@@ -0,0 +1,4 @@
+export default {
+  menuAuth: "Authorization management",
+  importStu: "Import list"
+}

+ 4 - 0
TEAMModelOS/ClientApp/locale/lang/zh-CN/stuAccount.js

@@ -0,0 +1,4 @@
+export default {
+  menuAuth: "授权管理",
+  importStu: "汇入名单"
+}

+ 4 - 0
TEAMModelOS/ClientApp/locale/lang/zh-TW/stuAccount.js

@@ -0,0 +1,4 @@
+export default {
+  menuAuth: "授權管理",
+  importStu:"匯入名單"
+}

+ 4 - 0
TEAMModelOS/ClientApp/view/student-account/Index.less

@@ -80,3 +80,7 @@
 .item-tools{
 .item-tools{
     display:none;
     display:none;
 }
 }
+.sc-disable-cursor{
+    cursor:not-allowed !important;
+    color:#606060 !important;
+}

+ 33 - 19
TEAMModelOS/ClientApp/view/student-account/Index.vue

@@ -24,25 +24,28 @@
       </div>
       </div>
       <div class="sc-menu-right sc-text-no-select">
       <div class="sc-menu-right sc-text-no-select">
         <ul>
         <ul>
-          <li @click="importStudent()">
-            <Icon type="md-arrow-round-up" color="white" size="18" />
-            <span>汇入名单</span>
-          </li>
-          <li @click="delStudent(-1)">
-            <Icon type="md-trash" color="white" size="18" />
+
+          <li @click="delStudent(-1)" :class=" selections.length > 0 ? '':'sc-disable-cursor' ">
+            <Icon type="md-trash" :color="selections.length > 0 ? 'white':'#606060'" size="18" />
             <span>删除学生</span>
             <span>删除学生</span>
           </li>
           </li>
-          <li @click="editStudent()">
-            <Icon type="md-create" color="white" size="18" />
+          <li @click="editStudent()" :class=" selections.length > 0 ? '':'sc-disable-cursor' ">
+            <Icon type="md-create" :color="selections.length > 0 ? 'white':'#606060'" size="18" />
             <span>编辑资讯</span>
             <span>编辑资讯</span>
-          </li> 
+          </li>
           <li @click="addStudent()">
           <li @click="addStudent()">
             <Icon type="md-person-add" color="white" size="18" />
             <Icon type="md-person-add" color="white" size="18" />
             <span>新增学生</span>
             <span>新增学生</span>
           </li>
           </li>
+          <li @click="importStudent()">
+            <Icon type="md-arrow-round-up" color="white" size="18" />
+            <span>汇入名单</span>
+            <!--<span>{{ $t('stuAccount.importStu') }}</span>-->
+          </li>
           <li @click="showAuthorization()">
           <li @click="showAuthorization()">
             <Icon type="ios-cog-outline" color="white" size="18" />
             <Icon type="ios-cog-outline" color="white" size="18" />
             <span>授权管理</span>
             <span>授权管理</span>
+            <!--<span>{{ $t('stuAccount.menuAuth') }}</span>-->
           </li>
           </li>
         </ul>
         </ul>
       </div>
       </div>
@@ -50,8 +53,9 @@
     <div class="sc-content" style="position:relative">
     <div class="sc-content" style="position:relative">
       <Table ref="selection" :columns="tableColumns" :data="tablePageData" height="750" :loading="tableLoading" @on-select="getSelectInfo" @on-select-cancel="getSelectInfo" @on-select-all="getSelectInfo" @on-select-all-cancel="cancelAll">
       <Table ref="selection" :columns="tableColumns" :data="tablePageData" height="750" :loading="tableLoading" @on-select="getSelectInfo" @on-select-cancel="getSelectInfo" @on-select-all="getSelectInfo" @on-select-all-cancel="cancelAll">
         <template slot-scope="{ row,index }" slot="status">
         <template slot-scope="{ row,index }" slot="status">
-          <Icon v-if="row.status == 1" type="md-checkmark-circle-outline" size="18" color="#1CD0A1" />
-          <Icon v-else type="md-close" size="18" color="red" />
+          <Icon v-if="index%3 == 1" type="md-checkmark-circle-outline" size="18" color="#1CD0A1" />
+          <!--<Icon v-else type="md-close" size="18" color="red" />-->
+          <span v-else>—</span>
         </template>
         </template>
         <template slot-scope="{ row,index }" slot="action">
         <template slot-scope="{ row,index }" slot="action">
           <div class="item-tools">
           <div class="item-tools">
@@ -87,7 +91,7 @@
         pageSize:30,
         pageSize:30,
         bizType:0,
         bizType:0,
         editStudentInfo:[],
         editStudentInfo:[],
-        selctions: [],
+        selections: [],
         selectRow: {},
         selectRow: {},
         addStudentStatus:false,
         addStudentStatus:false,
         importStudentStatus: false,
         importStudentStatus: false,
@@ -167,7 +171,7 @@
         this.tableLoading = false;
         this.tableLoading = false;
       },
       },
       cancelAll() {
       cancelAll() {
-        this.selctions = [];
+        this.selections = [];
       },
       },
       getIndex(_arr, _obj) {
       getIndex(_arr, _obj) {
         var len = _arr.length;
         var len = _arr.length;
@@ -195,7 +199,7 @@
       },
       },
       getSelectInfo(selction, row) {
       getSelectInfo(selction, row) {
         console.log(this.tableData);
         console.log(this.tableData);
-        this.selctions = selction;
+        this.selections = selction;
         this.selectRow = row;
         this.selectRow = row;
       },
       },
       closeAddStudent(data) {
       closeAddStudent(data) {
@@ -243,10 +247,10 @@
           this.$forceUpdate();
           this.$forceUpdate();
           this.addStudentStatus = true;
           this.addStudentStatus = true;
         } else {
         } else {
-          if (this.selctions.length > 0) {
+          if (this.selections.length > 0) {
             
             
             this.editStudentInfo = [];
             this.editStudentInfo = [];
-            [...this.editStudentInfo] = this.selctions;
+            [...this.editStudentInfo] = this.selections;
             this.addStudentStatus = true;
             this.addStudentStatus = true;
           } else {
           } else {
             this.$Message.error('请选择需要修改的学生!');
             this.$Message.error('请选择需要修改的学生!');
@@ -258,9 +262,19 @@
         if (index >= 0) {
         if (index >= 0) {
           let showIndex = index + (this.currentPage - 1) * this.pageSize;
           let showIndex = index + (this.currentPage - 1) * this.pageSize;
           let originIndex = this.getIndex(this.tableData, this.tablePageData[index]);
           let originIndex = this.getIndex(this.tableData, this.tablePageData[index]);
-          this.tableData.splice(originIndex, 1);
-          this.tablePageData.splice(index, 1);
-          this.tableShowData.splice(showIndex, 1);
+          this.$Modal.confirm({
+            title: '删除学生',
+            content: '<p>确定删除' + this.tableShowData[showIndex].name + '账号信息!</p>',
+            onOk: () => {
+              this.tableData.splice(originIndex, 1);
+              this.tablePageData.splice(index, 1);
+              this.tableShowData.splice(showIndex, 1);
+            },
+            onCancel: () => {
+            }
+          });
+         
+          
         } else {
         } else {
           let i = this.getIndex(this.tableData, row);
           let i = this.getIndex(this.tableData, row);
           if (i >= 0) {
           if (i >= 0) {

+ 0 - 123
TEAMModelOS/ClientApp/view/student-account/add-student/ImportExcel.vue

@@ -1,123 +0,0 @@
-<template>
-    <div class="form-body">
-        <Row>
-            <div class="ivu-upload-list-file" v-if="file !== null">
-                <Icon type="ios-stats"></Icon>
-                {{ file.name }}
-                <Icon v-show="showRemoveFile" type="ios-close" class="ivu-upload-list-remove" @click.native="handleRemove()"></Icon>
-            </div>
-        </Row>
-        <Row>
-            <transition name="fade">
-                <Progress v-if="showProgress" :percent="progressPercent" :stroke-width="2">
-                    <div v-if="progressPercent == 100">
-                        <Icon type="ios-checkmark-circle"></Icon>
-                        <span>成功</span>
-                    </div>
-                </Progress>
-            </transition>
-        </Row>
-        <Row>
-            <Table :columns="tableTitle" :data="tableData" :loading="tableLoading" style="max-height:590px; overflow-y:scroll;"></Table>
-            <div style="background-color:white; width:100%; height:50px;">
-                <Upload action="" :before-upload="handleBeforeUpload" accept=".xls, .xlsx" style="display:block; float:right;">
-                    <Button :loading="uploadLoading" @click="openUploadFile" icon="ios-folder-open" class="btn">
-                        打开文件
-                    </Button>
-                    <Button :loading="uploadLoading" @click.stop="sendUploadFile" icon="md-cloud-upload" class="btn">
-                        上传文件
-                    </Button>
-                </Upload>
-            </div>
-        </Row>
-    </div>
-</template>
-<script>
-  import excel from '../../../utils/excel'
-    export default {
-        data() {
-            return {
-                uploadLoading: false,
-                progressPercent: 0,
-                showProgress: false,
-                showRemoveFile: false,
-                file: null,
-                tableData: [],
-                tableTitle: [],
-                tableLoading: false
-            }
-        },
-        methods: {
-            initUpload() {
-                this.file = null
-                this.showProgress = false
-                this.loadingProgress = 0
-                this.tableData = []
-                this.tableTitle = []
-            },
-            openUploadFile() {
-                this.initUpload()
-            },
-            handleRemove() {
-                this.initUpload()
-                this.$Message.info('打开的文件已删除!')
-            },
-            handleBeforeUpload(file) {
-                const fileExt = file.name.split('.').pop().toLocaleLowerCase()
-                if (fileExt === 'xlsx' || fileExt === 'xls') {
-                    this.readFile(file)
-                    this.file = file
-                } else {
-                    this.$Notice.warning({
-                        title: '文件类型错误',
-                        desc: '文件:' + file.name + '不是EXCEL文件,请选择后缀为.xlsx或者.xls的EXCEL文件。'
-                    })
-                }
-                return false
-            },
-            // 读取文件
-            readFile(file) {
-                const reader = new FileReader();
-                reader.readAsArrayBuffer(file);
-                reader.onloadstart = e => {
-                    this.uploadLoading = true
-                    this.tableLoading = true
-                    this.showProgress = true
-                }
-                reader.onprogress = e => {
-                    this.progressPercent = Math.round(e.loaded / e.total * 100)
-                }
-                reader.onerror = e => {
-                    this.$Message.error('文件读取出错')
-                }
-                reader.onload = e => {
-                    this.$Message.info('文件读取成功');
-                    const data = e.target.result;
-                    const { header, results } = excel.read(data, 'array');
-                    const tableTitle = header.map(item => { return { title: item, key: item } });
-                    this.tableData = results;
-                    this.tableTitle = tableTitle;
-                    this.uploadLoading = false;
-                    this.tableLoading = false;
-                    this.showRemoveFile = true;
-                    console.log(this.tableData);
-                }
-            },
-            sendUploadFile() {
-            }
-        },
-        mounted() {
-        }
-    }
-</script>
-<style scoped>
-    .btn {
-        background: white;
-        margin-top: 15px;
-        font-size: 15px;
-        padding: 5px 10px;
-        width: 120px;
-        padding: 4px 10px;
-        margin-left: 10px;
-    }
-</style>

+ 0 - 2
TEAMModelOS/ClientApp/view/student-account/add-student/ImportStudent.vue

@@ -71,7 +71,6 @@
   </Modal>
   </Modal>
 </template>
 </template>
 <script>
 <script>
-  import ImportExcel from "./ImportExcel.vue"
   import excel from '../../../utils/excel'
   import excel from '../../../utils/excel'
   export default {
   export default {
     props: {
     props: {
@@ -140,7 +139,6 @@
       }
       }
     },
     },
     components: {
     components: {
-      ImportExcel
     },
     },
     computed: {
     computed: {
       show: {
       show: {