소스 검색

Merge branch 'develop' of http://163.228.141.122:3000/TEAMMODEL/TEAMModelOS into develop

jeff 3 달 전
부모
커밋
09580ec657

+ 3 - 0
TEAMModelOS/ClientApp/public/lang/en-US.js

@@ -4556,6 +4556,8 @@ const LANG_EN_US = {
         editInfo: 'Edit Information',
         editInfo: 'Edit Information',
         delStu: 'Delete Student',
         delStu: 'Delete Student',
         searchHolder: 'Search',
         searchHolder: 'Search',
+        uploadFilter: 'Import table to screen students',
+        notFoundStu: 'Student not found',
         periodHolder: 'Select School System',
         periodHolder: 'Select School System',
         gradeHolder: 'Select Grade',
         gradeHolder: 'Select Grade',
         classroomHolder: 'Select Class',
         classroomHolder: 'Select Class',
@@ -6507,6 +6509,7 @@ const LANG_EN_US = {
             info19: "Can't find this teacher's information",
             info19: "Can't find this teacher's information",
             info20: 'This user has already been invited!',
             info20: 'This user has already been invited!',
             info21: 'The user has already joined the school!',
             info21: 'The user has already joined the school!',
+            info22: 'Successfully invited  ',
             noIdCol: 'There is no id column in the imported form, please check the form data! ',
             noIdCol: 'There is no id column in the imported form, please check the form data! ',
             spaceTips1: 'Please set the size of space allocated per person',
             spaceTips1: 'Please set the size of space allocated per person',
             spaceTips2: 'Please select the teacher title for which space is to be allocated',
             spaceTips2: 'Please select the teacher title for which space is to be allocated',

+ 3 - 0
TEAMModelOS/ClientApp/public/lang/zh-CN.js

@@ -4555,6 +4555,8 @@ const LANG_ZH_CN = {
         editInfo: '编辑资讯',
         editInfo: '编辑资讯',
         delStu: '删除学生',
         delStu: '删除学生',
         searchHolder: '输入关键字或账号资讯搜索',
         searchHolder: '输入关键字或账号资讯搜索',
+        uploadFilter: '导入表格筛选学生',
+        notFoundStu: '未找到学生',
         periodHolder: '选择学段',
         periodHolder: '选择学段',
         gradeHolder: '选择年级',
         gradeHolder: '选择年级',
         classroomHolder: '选择班级',
         classroomHolder: '选择班级',
@@ -6505,6 +6507,7 @@ const LANG_ZH_CN = {
             info19: '找不到此教师的资料',
             info19: '找不到此教师的资料',
             info20: '用户已被邀请,请勿重复邀请!',
             info20: '用户已被邀请,请勿重复邀请!',
             info21: '邀请对象已加入学校!无法再次邀请!',
             info21: '邀请对象已加入学校!无法再次邀请!',
+            info22: '已成功邀请',
             noIdCol: '导入表格没有id栏位,请检查表格数据!',
             noIdCol: '导入表格没有id栏位,请检查表格数据!',
             spaceTips1: '请设置每人分配的空间大小',
             spaceTips1: '请设置每人分配的空间大小',
             spaceTips2: '请选择需要分配空间的教师职称',
             spaceTips2: '请选择需要分配空间的教师职称',

+ 3 - 0
TEAMModelOS/ClientApp/public/lang/zh-TW.js

@@ -4557,6 +4557,8 @@ const LANG_ZH_TW = {
         editInfo: '編輯資訊',
         editInfo: '編輯資訊',
         delStu: '刪除學生',
         delStu: '刪除學生',
         searchHolder: '輸入關鍵字或帳號資訊搜尋',
         searchHolder: '輸入關鍵字或帳號資訊搜尋',
+        uploadFilter: '匯入表格篩選學生',
+        notFoundStu: '未找到學生',
         periodHolder: '選擇學制',
         periodHolder: '選擇學制',
         gradeHolder: '選擇年級',
         gradeHolder: '選擇年級',
         classroomHolder: '選擇班級',
         classroomHolder: '選擇班級',
@@ -6507,6 +6509,7 @@ const LANG_ZH_TW = {
             info19: '找不到此教師的資料',
             info19: '找不到此教師的資料',
             info20: '對象已加入學校!無法再次加入!',
             info20: '對象已加入學校!無法再次加入!',
             info21: '對象已加入學校!無法再次加入!',
             info21: '對象已加入學校!無法再次加入!',
+            info22: '已成功邀請',
             noIdCol: '匯入表格沒有id欄位,請檢查表格數據! ',
             noIdCol: '匯入表格沒有id欄位,請檢查表格數據! ',
             spaceTips1: '請設定每人分配的空間大小',
             spaceTips1: '請設定每人分配的空間大小',
             spaceTips2: '請選擇需要分配空間的教師職稱',
             spaceTips2: '請選擇需要分配空間的教師職稱',

+ 95 - 1
TEAMModelOS/ClientApp/src/components/coursemgt/StudentList.vue

@@ -17,8 +17,30 @@
             </Select>
             </Select>
             <!-- 字串模糊搜尋 -->
             <!-- 字串模糊搜尋 -->
             <Input v-special-char v-model="searchText" clearable :placeholder="$t('stuAccount.searchHolder')" style="width: 220px;margin-left:20px;" search @on-search="filterData" @on-clear="filterData"></Input>
             <Input v-special-char v-model="searchText" clearable :placeholder="$t('stuAccount.searchHolder')" style="width: 220px;margin-left:20px;" search @on-search="filterData" @on-clear="filterData"></Input>
+            <Upload :before-upload="handleBeforeUpload" accept=".xls, .xlsx" action="" v-if="isNeedTable">
+                <Button style="margin-left: 20px;">
+                    <Icon type="ios-cloud-upload" />
+                    {{ $t('stuAccount.uploadFilter') }}
+                </Button>
+            </Upload>
+            <Button style="margin-left: 20px;" @click="refreshData()">
+                <Icon type="md-refresh" />
+                {{ $t('lessonRecord.reset') }}
+            </Button>
+            <Dropdown @on-click="onTemplateSelect" style="margin-top:6px; margin-left: 20px; cursor: pointer;">
+                <span>{{ $t('evaluation.importFile.templateDownload') }}</span>
+                <DropdownMenu slot="list">
+                    <DropdownItem :name="0">中文简体(zh-CN)</DropdownItem>
+                    <DropdownItem :name="1">中文繁體(zh-TW)</DropdownItem>
+                    <DropdownItem :name="2">English(en-US)</DropdownItem>
+                </DropdownMenu>
+            </Dropdown>
         </div>
         </div>
         <div style="position:relative">
         <div style="position:relative">
+            <p v-if="notFoundlist.length">
+                {{ $t('stuAccount.notFoundStu') }}:
+                <span v-for="(item, index) in notFoundlist" :key="index" style="margin-right: 5px; color: #cd2b2b;">{{ item.id }}-{{ item.name }}</span>
+            </p>
             <Scroll :on-reach-bottom="scrollLoad" height="600" :distance-to-edge="[15,15]">
             <Scroll :on-reach-bottom="scrollLoad" height="600" :distance-to-edge="[15,15]">
                 <Table ref="stuSelection" :columns="tableColumns" :data="tableShowData" @on-selection-change="getSelectInfo">
                 <Table ref="stuSelection" :columns="tableColumns" :data="tableShowData" @on-selection-change="getSelectInfo">
                     <template slot-scope="{ row,index }" slot="status">
                     <template slot-scope="{ row,index }" slot="status">
@@ -52,10 +74,17 @@
 <script>
 <script>
 import PersonalPhoto from '@/components/public/personalPhoto/Index.vue'
 import PersonalPhoto from '@/components/public/personalPhoto/Index.vue'
 import { mapGetters } from 'vuex'
 import { mapGetters } from 'vuex'
+import excel from '@/utils/excel.js'
 export default {
 export default {
     components: {
     components: {
         PersonalPhoto
         PersonalPhoto
     },
     },
+    props: {
+        isNeedTable: {
+            type: Boolean,
+            default: false
+        },
+    },
     data() {
     data() {
         return {
         return {
             bgColor: ['#4ECDC4', '#F99406', '#075CD0', '#F7CA17', '#F2774B', '#67809F', '#BF55ED', '#00B169', '#F72459', '#F15A22', '#03C9A8', '#9A1294'],
             bgColor: ['#4ECDC4', '#F99406', '#075CD0', '#F7CA17', '#F2774B', '#67809F', '#BF55ED', '#00B169', '#F72459', '#F15A22', '#03C9A8', '#9A1294'],
@@ -74,7 +103,20 @@ export default {
             basicCount: 99,
             basicCount: 99,
             schoolBase: {
             schoolBase: {
                 period: []
                 period: []
-            }
+            },
+            notFoundlist: [],
+            downloadUrls: [
+                {
+                    url: '/download/Screen student template-cn.xlsx',
+                    fileName: '筛选学生模板.xlsx'
+                },{
+                    url: '/download/Screen student template-tw.xlsx',
+                    fileName: '篩選學生範本.xlsx'
+                },{
+                    url: '/download/Screen student template-en.xlsx',
+                    fileName: 'Screen student template.xlsx'
+                },
+            ]
         }
         }
     },
     },
     methods: {
     methods: {
@@ -238,6 +280,58 @@ export default {
                 return '-'
                 return '-'
             }
             }
         },
         },
+        //获取上传的文件
+        handleBeforeUpload(file) {
+            let stuData = this._.cloneDeep(this.students)
+            let excelResult = []
+            this.readExcel(file, data => {
+                if (data.results.length) {
+                    excelResult = this._.cloneDeep(data.results)
+                    this.tableShowData = stuData.filter(item => {
+                        let eIndex = excelResult.findIndex(results => results.id.toString() === item.id && results.name === item.name)
+                        if(eIndex != -1) {
+                            excelResult.splice(eIndex, 1)
+                            return true
+                        }
+                    })
+                    this.notFoundlist = excelResult
+                }
+            })
+            return false
+        },
+        /* 解析excel表格 */
+        readExcel(file, callback) {
+            var reader = new FileReader();
+            reader.onload = function (e) {
+                var data = e.target.result;
+                var workbook = excel.read(data, 'binary');
+                if (callback) callback(workbook);
+            };
+            reader.readAsBinaryString(file);
+        },
+        refreshData() {
+            this.searchGrade = ''
+            this.searchClass = ''
+            this.searchText = ''
+            this.notFoundlist = []
+            this.filterData()
+        },
+        /* 下载模板 */
+        async onTemplateSelect(val) {
+            let curFile = this.downloadUrls[val]
+            let hostName = this.$evTools.getBlobHost()
+            const downloadRes = async () => {
+                let response = await fetch(hostName + curFile.url); // 内容转变成blob地址
+                let blob = await response.blob(); // 创建隐藏的可下载链接
+                let objectUrl = window.URL.createObjectURL(blob);
+                let a = document.createElement('a');
+                a.href = objectUrl;
+                a.download = curFile.fileName;
+                a.click()
+                a.remove();
+            }
+            downloadRes();
+        },
     },
     },
     created() {
     created() {
         this.initData()
         this.initData()

+ 1 - 1
TEAMModelOS/ClientApp/src/view/student-account/stulist/MgtStuList.vue

@@ -87,7 +87,7 @@
         </Split>
         </Split>
         <!-- 添加学生 -->
         <!-- 添加学生 -->
         <Modal v-model="addStuStatus" :title="$t('cusMgt.addStu')" width="1200" @on-ok="confirmAddStu" :loading="modalLoading">
         <Modal v-model="addStuStatus" :title="$t('cusMgt.addStu')" width="1200" @on-ok="confirmAddStu" :loading="modalLoading">
-            <StudentList ref="studentList" @getSelectInfo="(selction)=>{selections = selction}"></StudentList>
+            <StudentList ref="studentList" isNeedTable @getSelectInfo="(selction)=>{selections = selction}"></StudentList>
         </Modal>
         </Modal>
         <!-- 创建名单 -->
         <!-- 创建名单 -->
         <Modal v-model="addListStatus" className="ed-name-modal" footer-hide @on-ok="confirmAddList">
         <Modal v-model="addListStatus" className="ed-name-modal" footer-hide @on-ok="confirmAddList">