(function(){ Vue.components = Vue.components || {} function RegVueCom(name, com){ Vue.component(name, com); Vue.components[name] = com; } RegVueCom("xljk-agger-view", function(resolve, reject){ var template = "
\n \n
\n \n\n
\n \n 提 交\n \n
\n \n
\n
\n {{info.tyhmc}}\n
\n
\n\n
\n
\n
\n 点 击 签 字\n
\n
\n\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { dialogVisible: false, signaturePad:'', blob:'', file:'', dataURL:'', info:'' }; }, methods: { openSignatureDialog() { this.dialogVisible = true; this.$nextTick(() => { this.initSignaturePad(); }); }, initSignaturePad() { let canvas = document.getElementById('canvas'); // 创建 SignaturePad let options = { penColor: 'rgb(0,0,0)', minWidth: 5, maxWidth: 10, }; this.signaturePad = new SignaturePad(canvas, options); this.resizeCanvas(); }, back(){ this.$router.push('evaluation') }, getTyh(){ const that = this; $.post("/www/public/tyh/gettyh", {}, function(res){ if(res.code==200&&res.data!==null){ that.info = res.data if(res.data.isqs==1){ that.$router.push('beforeEvaluations') } }else{ that.$message({ type: "error", message: '服务错误' }) } }) }, resizeCanvas() { let canvas = document.getElementById('canvas') let ratio = Math.max(window.devicePixelRatio || 1, 1) canvas.width = canvas.offsetWidth * ratio canvas.height = canvas.offsetHeight * ratio let context = canvas.getContext('2d') context.scale(ratio, ratio) var signTitle = document.querySelector('.signTitle'); canvas.addEventListener('mouseenter', function() { signTitle.style.display = 'none'; }); canvas.addEventListener('mouseleave', function() { signTitle.style.display = 'block'; }); }, /**根据图片的 Base64 编码,把内容显示到签名板上*/ redisplay() { this.signaturePad && this.dataURL && this.signaturePad.fromDataURL(this.dataURL) }, /*清除签名板内容*/ clear() { this.signaturePad.clear() this.dataURL = null }, /*获取签名板内容(图片的 Base64 编码)*/ save() { this.dataURL = this.signaturePad.toDataURL() console.log( this.dataURL) let data = { tyhid:this.info.id, username:JSON.parse(localStorage.getItem('user')).Username, imgurl:this.dataURL, } console.log(data) const that =this $.post("/www/public/tyh/savetyh", data, function(res){ if(res.code==200){ that.$message.success('提交成功'); that.$router.push('evaluations') }else{ that.$message({ type: "error", message: res.message }) } }) }, base64ToBlob(dataURL) { console.log(dataURL) let arr = dataURL.split(',') let mimeType = arr[0].match(/:(.*?);/)[1] || 'image/png' let encodeStr = atob(arr[1]) let n = encodeStr.length let u8Arr = new Uint8Array(n) while (n--) { u8Arr[n] = encodeStr.charCodeAt(n) } return new Blob([u8Arr], { type: mimeType }) }, //转换成file blobToFile(blob, fileName) { // MIME Type const type = blob.type || 'text/plain' return new File([blob], fileName, { type }) }, //生成图片 scImg(){ let blob = this.base64ToBlob(this.dataURL) this.file = this.blobToFile(blob, '签名图片.png') console.log(this.file) }, }, created: function(){ this.getTyh() }, mounted: function(){ let canvas = document.getElementById('canvas') // 创建 SignaturePad let options = { penColor: "rgb(0,0,0)", minWidth: 5, maxWidth: 10, } this.signaturePad = new SignaturePad(canvas, options); this.resizeCanvas() }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-evaluation2-view", function(resolve, reject){ var template = "
\n
\n
\nPASMBTI®-新版MBTI测试介绍:\n
\n
\n
\nPASMBTI是依据MBTI理论模型,结PASMBTI是依据MBTI理论模型,结PASMBTI是依据MBTI理论模型\n
\n
\nPASMBTI是依据MBTI理论模型,结PASMBTI是依据MBTI理论模型,结PASMBTI是依据MBTI理论模型\n
\n
\nPASMBTI是依据MBTI理论模型,结PASMBTI是依据MBTI理论模型,结PASMBTI是依据MBTI理论模型\n
\n
\nPASMBTI是依据MBTI理论模型,结PASMBTI是依据MBTI理论模型,结PASMBTI是依据MBTI理论模型\n
\n
\n
\n我已阅读并同意《用户协议》与《隐私政策》\n
\n
\n进入测试系统\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), checked:'' }; }, methods: { goEvaluation3(){ this.$router.push('evaluation3') }, }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-evaluation3-view", function(resolve, reject){ var template = "
\n
\n
\n
\n
\n {{item.tm.split('&&')[0]}}\n \n \n {{item.tm.split('&&')[1]}}\n
\n
\n {handleChange(val,item)}\" v-model=\"item.answer\">\n \n {{ option.text }}\n \n \n handle(val,item)\" v-model=\"item.answer\">\n {{ xx.text }}\n \n \n \n
\n
\n
\n
\n {{itt.tm.split('&&')[0]}}\n \n \n {{itt.tm.split('&&')[1]}}\n
\n
\n {handleChange(val,item)}\" v-model=\"itt.answer\">\n \n {{ option.text }}\n \n \n handle(val,item)\" v-model=\"itt.answer\">\n {{ xx.text }}\n \n \n \n
\n
\n
\n
\n \n 下一题\n \n \n 提交\n \n\n
\n \n
\n
\n\n\n
\n
\n
\n
答题卡 \n / 共{{ questionList.length }}题\n
\n
\n
已答
\n
未答
\n
当前题目
\n
\n
\n
\n
    \n
  • \n {{ item.tmpx }}\n
  • \n
\n
\n \n
\n\n\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ const cityOptions = ['上海', '北京', '广州', '深圳']; return { id: Math.uuid(), checkedCities: ['上海', '北京'], cities: cityOptions, current: 1, innerCurrent:1, gaugeId:'', formData: [], questionList: [ ], aaa:[], ruleMap:{}, hiddenList:[], breadcrumbList: [ { name: "项目列表", path: "/evaluation" }, { name: "以及状态自查问卷", path: "/evaluation3" } ], rules: { username: [{ required: true, message: "请输入用户名", trigger: "blur" }], password: { required: true, message: "请输入密码", trigger: "blur" } } }; }, methods: { init() { }, handle(val,item){ console.log(val) }, handleCheckedCitiesChange(value) { let checkedCount = value.length; this.checkAll = checkedCount === this.cities.length; this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length; }, showQuestion(type, sort,tmxt) { var that = this switch (type) { case 'pre': this.current-- break case 'next': var item = that.questionList[that.current-1] if(tmxt){ var itt = item.tmxt[that.innerCurrent-1] if(itt.tmxt){ }else{ console.log(itt,'itt') if(!itt.answer){ return that.$message.warning('请先作答') } var tmgz = itt.tmgz if(itt.answer == tmgz.xx){ var len = tmgz.tg.split(',').length alert('我要跳题了') that.innerCurrent = that.innerCurrent+len+1 alert(that.innerCurrent) }else if(itt.tmgzm){ var tmgzm = itt.tmgzm if(itt.answer == tmgzm.xx){ that.ruleMap[tmgzm.id]? that.ruleMap[tmgzm.id]+=1:that.ruleMap[tmgzm.id] = 1 } if(that.ruleMap[tmgzm.id]==tmgzm.count){ var len = tmgzm.tg.split(',').length alert('我要跳题了') that.innerCurrent += len+1 }else{ that.innerCurrent++ } }else{ that.innerCurrent++ } //小题做完跳下一大题 if(that.innerCurrent>tmxt.length){ that.innerCurrent = 1 that.current++ } } }else{ if(!item.answer){ return that.$message.warning('请先作答') } that.current++ } break default: this.current = sort } }, handleChange(val,item,parentItem){ }, isExistAnswer(item) { let result = false switch (item.type) { case "checkbox": result = !!(item.answer && item.answer.length) break default: result = !!item.answer break } return result }, save() { const that =this /*const unAnswerList=this.questionList.filter(row=>!that.isExistAnswer(row)) if(unAnswerList.length){ that.$message.warning('以下题目未回答:'+unAnswerList.map(item=>item.questionNo).join(',')) return }*/ that.$confirm("确定要提交吗?提交后将无法修改", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", }).then(() => { that.formData=that.questionList.map(row=>{ return { questionId:row.questionId, answerList:[row.answer] } }) console.log(`提交的答案对象如下:`); console.log(that.formData) const data = { gaugeId:that.gaugeId, openId:JSON.parse(localStorage.getItem('userInfo')).openId, accessToken:localStorage.getItem('accessToken'), questionAnswers:JSON.stringify(that.formData), answerDuration:20125 } console.log(data) $.post("/www/public/liangbiao/cp_gaugesave", data, function(res){ if(res.code==200){ that.$message({ type: "success", message: "保存成功!" }) }else{ that.$message({ type: "error", message: res.message }) } }) }).catch(() => { that.$message({ type: "info", message: "已取消保存" }) }) }, gettmlist(){ var that = this const data = { id:that.gaugeId, } console.log(data) $.post("/www/public/st/gettmlist", data, function(res){ var aaa =function(list){ if(list.length){ list.forEach(item=>{ if(item.tmlx==2){ item.answer = [] }else if(item.tmxt){ aaa(item.tmxt) } }) } } aaa(res.data) that.questionList = res.data }) } }, created: function(){ if (this.$route.query && this.$route.query.gaugeId) { //this.questionList = JSON.parse(this.$route.query.questions); this.gaugeId=this.$route.query.gaugeId this.gettmlist() } }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-evaluationList-view", function(resolve, reject){ var template = "
\n
\n
\n
\n
\n
\n \n
\n
\n 暂无内容\n
\n
\n
\n
\n
\n \n
\n
\n
\n \n
\n
\n {{item.dtstatus==0?'● 进行中':'● 已完成'}}\n
\n
\n {{item.stmc}}\n
\n
\n
\n 1答题角色 : {{jsMap[item.js]}}\n
\n \n
\n
\n \n
\n 请认真答题再提交。请仔细阅读每条测试项目,务必把意思弄明白理解清楚然后根据最近一周的实际感觉,选择最符合自己的选项。本测验共30道题预计用时5分钟左右。\n
\n
\n 是否签署参与测评同意书\n\n
\n
\n 进入测试系统\n
\n
\n
\n
\n 立即测评\n
\n
\n
\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), dataList:[], Loading: false, visibleIntroduceDialog: false, checked:false, item:'', jsMap:{ '500':'学生', '720':'班主任(辅导员)', '710':'心理老师', '730':'校长', '700':'学科老师', '750':'信息员', } }; }, methods: { goTest(item){ this.$router.push({ path: 'beforeEvaluations', query: { gaugeId:item.sjid } }); }, dialog(item){ this.visibleIntroduceDialog = true this.item = item }, getImgsrc(val) { return "/content/image/xljkImg/"+val }, checkbox(){ this.$router.push('agger') }, getGaugelist(){ let that = this let data = { } $.post("/www/public/st/getstlist", data, function(res){ if(res.code==200){ that.dataList = res.data } }) }, }, created: function(){ let that = this that.getGaugelist() }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-interview-view", function(resolve, reject){ var template = "
\n
\n
\n
\n
\n
\n \n
\n
\n 暂无内容\n
\n
\n
\n
\n
\n \n
\n
\n
\n {{item.gaugeName}}\n
\n
\n
\n 预约时间 : 2023-06-07\n
\n
\n 预约方式 : 线上访谈\n
\n
\n 访谈地址 : 北师大心理学部1318A\n
\n
\n
\n \n
\n 访谈时间:2024年3月20日 10:00-12:00\n
\n
\n 请认真答题再提交。请仔细阅读每条测试项目,务必把意思弄明白理解清楚然后根据最近一周的实际感觉,选择最符合自己的选项。本测验共30道题预计用时5分钟左右。\n
\n \n
\n 确定\n
\n
\n
\n
\n 立即开始\n
\n
\n
\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), dataList:[], visibleIntroduceDialog: false, checked:false }; }, methods: { goTest(item){ console.log(item) this.$router.push({ path: 'evaluation3', query: { questions: JSON.stringify(item.questionAndOption),gaugeId:item.gaugeId } }); }, getImgsrc(val) { return "/content/image/xljkImg/"+val }, checkbox(){ this.$router.push('agger') }, getGaugelist(){ let that = this let data = { accessToken:localStorage.getItem('accessToken'), pageNo: 1, pageSize: 2, gaugeModuleCode:'01' } $.post("/www/public/liangbiao/cp_gaugelist", data, function(res){ if(res.code==200){ that.dataList = res.data.dataList } }) }, }, created: function(){ let that = this that.getGaugelist() }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-home1-view", function(resolve, reject){ var template = "
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n 也默默\n
\n
\n IP:210.73.91.250\n
\n
\n
\n
\n 小学\n
|\n
\n 三年级4班\n
\n
\n
\n 北京师范大学附属小学\n
\n
\n
\n
\n 立即测评\n
\n
\n 访谈任务\n
\n
\n 心理科普\n
\n 敬请期待\n
\n
\n
\n
\n
\n
\n
\n \n
\n 我的日程\n
\n
\n
\n
\n \n \n \n
\n
\n
\n \n
\n
\n \n \n \n
【课程】{{activity.event_title}}
\n
\n
节次:第{{activity.jc}}节
\n
地址:{{activity.event_place}}
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n 科普课程\n
\n
\n
\n 更多 >\n
\n
\n
\n\n
\n
\n \n
\n
\n
\n 如何调节负面情绪\n
\n
\n 3人已学\n
\n
\n
\n
\n
\n
\n\n
\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { butList:[], active:0, tzggList:[], value:'', reverse: false, crq:'', rqList:[], currentList:[] }; }, methods: { getImgsrc:function(val) { return "/content/image/xljkImg/"+val }, getIndex(index){ this.active = index }, onPanelChange(value, mode) { console.log(value, mode); }, getDay(val){ if(this.rqList.length>0){ if(val.type=='current-month'){ //this.currentList.push(val.day) } if(val.type=='current-month'&&this.rqList.indexOf(val.day)>=0){ return true }else{ return false } } }, getDate(val){ //console.log(this.currentList) this.crq = val this.getdb() }, //获取待办 getdb:function(){ let that = this //$.post("/www/py/fwpt/test", {crq:this.crq}, function(res){ $.post("/www/py/fwpt/user_event", {crq:this.crq}, function(res){ if(res.success==1){ if(res.data.data){ that.tzggList = res.data.data that.rqList = res.data.rq } } }) }, }, created: function(){ this.getdb() }, mounted: function(){ }, props: ['title', 'data', 'config','isHeight'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-menu-view", function(resolve, reject){ var template = "
\n
\n
\n \"Logo\"\n 全国心理健康监测系统\n
\n\n \n 首页\n 测评\n 访谈\n \n
\n login\n
\n
\n
\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), routerAcitve:'/' }; }, methods: { getImgsrc(val) { return "/content/image/xljkImg/"+val }, }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-loginDemo-view", function(resolve, reject){ var template = "
\n
\n
\n\n
\n 全国学生心理健康监测与服务平台\n
\n\n
\n
\n
\n
\n 欢迎登录\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n
\n
\n
\n
\n
\n
\n 登录\n
\n
\n
\n"; return (function(template, resolve, reject){ var store = new Vuex.Store({ state: { accessToken:'', userInfo:{}, user:{}, }, mutations: { accessToken(state, accessToken) { state.accessToken = accessToken; }, userInfo(state, userInfo) { state.userInfo = userInfo; }, user(state, user) { state.user = user; }, } }); seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), codesrc:'/owin/api/authcode?q=2069', ruleForm:{ name:'', paw:'', authcode:'' }, rules: { name: [ { required: true, message: '请输入姓名', trigger: 'blue' } ], paw: [ { required: true, message: '请输入密码', trigger: 'blue' } ], authcode: [ { required: true, message: '请输入验证码', trigger: 'blue' } ] }, }; }, methods: { rulesInput(formName){ this.$refs[formName].validate((valid) => { if (valid) { this.goHome() } else { return false; } }); }, rulesInputs(formName){ $.post("/www/public/mh/get_pgsxx", {}, function(res){ }) }, goHome(){ const that = this this.getCodeSrc() let data = { username:this.ruleForm.name, password:this.ruleForm.paw, authcode:this.ruleForm.authcode } $.post("/core/Login/DoLogin", data, function(res){ if(res.success==1){ $.post("/www/dd/ai/user", function(res){ if(res.ID){ that.$store.commit('user', res); localStorage.setItem('user', JSON.stringify(res)) that.$router.push('home') that.$message.success('登录成功'); $.post("/www/public/liangbiao/cp_getAccessToken", {}, function(res){ if(res.code==200){ that.$store.commit('accessToken', res.data.accessToken); localStorage.setItem('accessToken', res.data.accessToken) let data = { accessToken:that.$store.state.accessToken, } $.post("/www/public/liangbiao/cp_getOpenUserInfo", {...data}, function(res){ if(res.code==200){ that.$store.commit('userInfo', res.data); localStorage.setItem('userInfo', JSON.stringify(res.data)) } }) } }) } }) }else{ that.$message.warning(res.message); } }) }, getCodeSrc(){ this.codesrc = this.codesrc.replace(/\d+$/, parseInt(Math.random()*10000)) }, }, created: function(){ }, mounted: function(){ $.post("/owin/api/authcode", {}, function(res){ if(res.code==200){ } }) }, store: store, watch:{ //监听参数中的 props.markerLists 变化 $route:{ handler(newValue, oldValue){ if(newValue.query.otype == '0'){ this.routerAcitve = '/evaluation' }else if(newValue.query.otype == '1'){ this.routerAcitve = '/interview' }else{ this.routerAcitve = newValue.path } }, // 深度侦听需要遍历被侦听对象中的所有嵌套的属性,当用于大型数据结构时,开销很大。 // 因此请只在必要时才使用它,并且要留意性能。 deep: true, }, }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-menu", function(resolve, reject){ var template = "
\n
\n
\n \"Logo\"\n 全国学生心理健康监测与服务平台\n
\n\n \n
\n {{userName}}\n
\n
\n
\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), routerAcitve:'/home', userName:'' }; }, methods: { getImgsrc(val) { return "/content/image/xljkImg/"+val }, }, created: function(){ let user = JSON.parse(localStorage.getItem('user')) this.userName =user.Nickname }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-evaluations-view", function(resolve, reject){ var template = "
\n
\n
\n
\n {{toolname||'测评问卷'}}\n
\n
\n {{current-1}} / {{questionList.length-1}}\n
\n \n
\n
\n
\n
\n \n
\n
\n \n {{ calctmlx == 1 ? '单选' : calctmlx == 2 ? '填空' : calctmlx == 3 ? '多选' : calctmlx == 4||calctmlx == 5 ? '排序题' : calctmlx == 6?'滑块题':''}}\n \n \n \n {{currentList[0]?.questioncontent.split('%s')[indd]}}\n \n \n \n
\n
\t\n
\n \n
\n \n {{ calctmlx == 1 ? '单选' : calctmlx == 2 ? '填空' : calctmlx == 3 ? '多选' : calctmlx == 4||calctmlx == 5 ? '排序题' : ''}}\n \n\n\n \n \n {{currentList[1]?.questioncontent.split('%s')[indd2]}}\n \n \n\n \n
\n \n
\n
\n \n {{ calctmlx == 1 ? '单选' : calctmlx == 2 ? '填空' : calctmlx == 3 ? '多选' : calctmlx == 4||calctmlx == 5 ? '排序题' : ''}}\n \n \n \n {{currentList[2]?.questioncontent.split('%s')[indd3]}}\n \n \n \n
\n
\n \n \n \n \n
\n
\n

\n 已选择选项:\n

\n
\n {{index+1}}.{{item.answerText}}\n
\n
\n

\n 所有选项:\n

\n
\n {{item.optionName}}\n
\n
\n \n
\n
\n
\n {{index+1}}.\n \n
\n
\n
\n \n
\n \n
\n

\n {{currentListlast.marks['1']}}\n

\n

\n {{currentListlast.marks[currentListlast.segment]}}\n

\n
\n\n
\n \n
\n
\n
\n \n {{item.optionNameArr[ind]}}\n \n __\n \n
\n
\n
\n \n
\n
\n \n \n {{item.optionNameArr[ind]}}\t\n \n \n \n \n
\n
\n \n
\n
\n
\n \n {{item.optionNameArr[ind]}}\n \n __\n \n
\n
\n
\n\n \n
\n
\n
\n \n {{item.optionNameArr[ind]}}\n \n __\n \n
\n
\n \n
\n
\n
\n
\n \n {{current==questionList.length?'提 交':'下 一 题 '}}\n \n \n
\n
\n
\n
\n
\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), denominator: 16, activeIndex: -1, status:6, activeIndexs: [], input:'', textarea:'', questionList:[], current:0, currentList:[], ttMap:{}, newTtMap:{}, loading:false, evaId:'', answerNumber:0, test:'', startTime:'', toolname:'', colorMap:['','#067EFF','#FF8A0D','#3F23FF'], questionListbk:[], User:{}, value1:'', marks: { 1: '8°C', 2: '37°C', 5: '0°C', }, questionAnswers:[ ] }; }, methods: { handleClose(tag){ var index = this.currentListlast.answer.findIndex(it=>it.answerId==tag.answerId) console.log(index) console.log(this.currentListlast.answer,'this.currentListlast.answer') if(index!=-1){ this.currentListlast.answer.splice(index,1) } console.log(this.currentListlast.answer,'this.currentListlast.answer') }, gopaixu(item){ var min = this.currentListlast.minoptcnt var max = this.currentListlast.maxoptcnt if(this.currentListlast.answer.length==max){ return vant.Toast({ message:'最多选择'+max+'个', icon: 'warning-o', }) } console.log(item.answer,'item.answer') var index = this.currentListlast.answer.findIndex(it=>it.answerId==item.answerBusiId) if(index==-1){ this.currentListlast.answer.push({ answerId:item.answerBusiId,answerText:item.optionName }) }else{ return } }, handleChange(val){ }, innerClick(e){ console.log(e,'e') e.stopPropagation(); }, handleInput(v,rules,index){ if(rules[index]&&rules[index].type=='number'){ var rule=rules[index] if(v>rule.max){ v=rule.max console.log(v) } if(v { } }); }, previous(){ this.current = this.current-3 }, getredistm(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var sjid = localStorage.getItem('sjid') var tmlist = localStorage.getItem('saveredistm') if(tmlist){ tmlist = JSON.parse(tmlist) if(tmlist.userId==user.ID&&that.questionList[0].sjid==sjid){ that.questionAnswers = tmlist.answerList that.current = tmlist.current return } } $.post("/www/public/st/getredistm", {stid:that.questionList[0]?.sjid}, function(res){ if(res.code==200){ if(res.data){ /*that.questionListbk = res.data let len =that.questionListbk.length let lastAnswer = that.questionListbk[len-1] if(len&&len>1){ res.data.forEach(item=>{ }) that.evaId = that.questionListbk[0] that.questionList[len-2].answer = lastAnswer that.current = len-1 //that.current = 194 }else{ that.current = 1 }*/ that.newTtMap = res.data.newTtMap that.questionAnswers = res.data.answerList that.current = res.data.current console.log(that.questionAnswers,'that.questionAnswers') }else{ that.current = 1 } }else{ that.current = 1 } //that.current = 86 //that.current = 220 }) }, saveAll(){ if(this.current!=this.questionList.length) return this.endTime = new Date().getTime() const that = this that.loading = true var userInfo = localStorage.getItem('userInfo')?JSON.parse(localStorage.getItem('userInfo')):{} $.post("/www/public/st/saveda", that.answerData, function(res){ if(res.success==1){ //that.$message.success('答题完成') that.loading = false that.$router.replace({ path:'/evaluationsDone', query:{ time:that.calculateTimeDifference(that.startTime,that.endTime), answerNumber:that.questionAnswers.length, toolname:that.toolname } }) }else{ that.$message({ type: "error", message: '服务错误' }) that.loading = false } }).fail((err)=>{ that.loading = false that.$message({ type: "error", message: '服务错误' }) }) }, calculateTimeDifference(startTime, endTime) { let timeDiff = endTime - startTime; let hours = Math.floor(timeDiff / (1000 * 60 * 60)); let minutes = Math.floor((timeDiff % (1000 * 60 * 60)) / (1000 * 60)); let seconds = Math.floor((timeDiff % (1000 * 60)) / 1000); return timeDiff; }, submitSingle(){ var that = this if(that.loading) return that.loading = true var answer = that.currentListlast.answer console.log(answer,'answer') if(that.calctmlx==1){ if(!answer||!answer.answerId){ that.loading = false return vant.Toast({ message:'请先选择/填写答案', icon: 'warning-o', }) } if(answer.fillValues){ if(!answer.fillValues[0]){ return vant.Toast({ message:'选中选项有信息需未填写', icon: 'warning-o', }) } } }else if(that.calctmlx==2){ var inputContent = '' for(let iii = 0;iii{ if(item.fillValues){ console.log(item.fillValues,'item.fillValues') var keys = Object.keys(item.fillValues) keys.forEach(ii=>{ if(!item.fillValues[ii]){ mflag = true } }) } }) if(mflag){ return vant.Toast({ message:'选中选项有信息需未填写', icon: 'warning-o', }) } } }else if(that.calctmlx==4){ if(!answer.length){ that.loading = false return vant.Toast({ message:'请先选择/填写答案', icon: 'warning-o', }) } if(answer.length{ if(item.trim()!=''){ resultN+=1 } }) if(resultN{ var aaa if(that.currentListlast.answer.fillValues){ aaa= that.currentListlast.answer.fillValues[inn+'']?"####"+that.currentListlast.answer.fillValues[inn+'']+"####":'' }else{ aaa = '' } text+=iii+aaa }) data.answerList = [{answerId:that.currentListlast.answer.answerId,answerText:text}] } if(that.calctmlx==3){ console.log(that.currentListlast.answer,'that.currentListlast.answer') var list = [] that.currentListlast.answer.forEach(item=>{ var text = '' console.log(item.fillValues) item.optionNameArr.forEach((iii,inn)=>{ var aaa if(item.fillValues){ aaa= item.fillValues[inn+'']?"####"+item.fillValues[inn+'']+"####":'' }else{ aaa = '' } text+=iii+aaa }) list.push({ answerId:item.answerId, answerText:text, }) }) data.answerList = list } if(that.calctmlx==4){ var arr = [] that.currentListlast.answer.forEach((item,index)=>{ arr.push({ ...item, order:index+1 }) }) console.log() var list = arr data.answerList = list } if(that.calctmlx==5){ var arr = [] that.currentListlast.answer.forEach((item,index)=>{ if(item.trim()!=''){ arr.push({ answerId:'', answerText:item, order:index+1 }) } }) var list = arr data.answerList = list } if(that.calctmlx==6){ if(that.currentListlast.answer==''){ data.inputContent = 1 }else{ data.inputContent = that.currentListlast.answer } } let bbb = that.questionAnswers.findIndex(itemm=>itemm.questionId==data.questionId) if(bbb==-1){ that.questionAnswers.push(data) }else{ that.questionAnswers[bbb] = data that.questionAnswers = that.questionAnswers.slice(0,bbb+1) } /*let datas = { toolId:that.currentListlast.toolid, accessToken:localStorage.getItem('accessToken'), dadata:JSON.stringify(data) }*/ //var jsonData = answer //that.questionListbk[0] = that.evaId //that.questionListbk[that.current] = jsonData //$.post("/www/public/st/saveredistm", {jsonData:JSON.stringify(that.questionListbk)}, function(res){ //}) that.answerNumber++ if(that.calctmlx==3){ let checkboxRefs = that.$refs.checkboxRefs checkboxRefs.forEach(checkbox=>{ let inputbox = checkbox.querySelector('input[type="checkbox"]') inputbox.checked = false }) } that.next() /*$.post("/www/public/st/savexfda", datas, function(res){ if(res&&res.code==200&&res.data){ //that.loading = false if(res.data.code==200){ that.evaId = res.data.data that.answerNumber++ if(that.calctmlx==3){ let checkboxRefs = that.$refs.checkboxRefs checkboxRefs.forEach(checkbox=>{ let inputbox = checkbox.querySelector('input[type="checkbox"]') inputbox.checked = false }) } that.next() }else if(res.data.code==600){ that.$message({ type: "error", message: res.data.message }) setTimeout(()=>{ localStorage.removeItem('user') localStorage.removeItem('userInfo') that.$router.push('/login') },1000) }else{ that.$message({ type: "error", message: res.data.message }) that.loading = false } }else{ that.$message({ type: "error", message: '服务错误' }) that.loading = false } //that.loading = false })*/ }, next(){ var that = this console.log(1) var answer = this.currentListlast.answer console.log(answer,'answer') //if(!answer||Array.isArray(answer)&&!answer.length) return that.$message.warning('请先答题') if(that.currentListlast.quesjumpquesno!=0){ this.current=this.currentListlast.quesjumpquesno }else if(that.currentListlast.scorejumpquesno!=0){ console.log(1) var scorejumpquesnoArr = that.currentListlast.scorejumpquesno.split(',') var lenth = scorejumpquesnoArr.length var score = answer.score console.log(answer,'answer') if(that.currentListlast.scorejumpnos){ console.log(that.newTtMap,'that.newTtMap') if(that.newTtMap[that.currentListlast.scorejumpnos]){ console.log(that.newTtMap,'that.newTtMap') }else{ console.log(that.newTtMap,'that.newTtMap') that.newTtMap[that.currentListlast.scorejumpnos] = 0 } that.newTtMap[that.currentListlast.scorejumpnos]+=score var arr = that.currentListlast.scorejumpnos.split(",") var th = arr[arr.length-1] var minarr=that.currentListlast.scorejumpmin.split(",") var maxarr=that.currentListlast.scorejumpmax.split(",") if(Number(th)==that.currentListlast.questionno){ let jumped = false for(let j=0;j=Number(minarr[j])&&that.newTtMap[that.currentListlast.scorejumpnos]<=Number(maxarr[j])){ that.current = Number(scorejumpquesnoArr[j]) jumped = true } } if(!jumped){ that.current++ } }else{ that.current++ } /*if(that.newTtMap[that.currentListlast.scorejumpnos]>=Number(this.currentListlast.scorejumpmin)&&that.newTtMap[that.currentListlast.scorejumpnos]<=Number(that.currentListlast.scorejumpmax)&&Number(th)==that.currentListlast.questionno){ console.log(that.currentListlast.scorejumpmax,'that.currentListlast.scorejumpmax') that.current = Number(that.currentListlast.scorejumpquesno) }else{ that.current++ }*/ /*console.log(3) var arr = that.currentListlast.scorejumpnos.split(",") that.ttMap[that.currentListlast.scorejumpnos]?console.log(1): that.ttMap[that.currentListlast.scorejumpnos]= {len:arr.length} var aaa = that.ttMap[that.currentListlast.scorejumpnos] if(score>=Number(this.currentListlast.scorejumpmin)&&score<=Number(this.currentListlast.scorejumpmax)){ aaa.score?aaa.score++:aaa.score=1 } if(aaa.score==aaa.len){ console.log(3) that.current = Number(this.currentListlast.scorejumpquesno) }else{ console.log(4) that.current++ }*/ }else{ if(score>=this.currentListlast.scorejumpmin&&score<=this.currentListlast.scorejumpmax){ that.current = Number(this.currentListlast.scorejumpquesno) console.log(6) }else{ console.log(7) that.current++ } } }else if(this.currentListlast._ansJumpQuesNo){ console.log(8) this.current=this.currentListlast._ansJumpQuesNo }else{ this.current++ console.log(this.current,'this.current111') } var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const jsonD = { answerList:that.questionAnswers, current:this.current, newTtMap:this.newTtMap, userId:user.ID } if(this.current<=this.questionList.length){ var aaab = JSON.stringify(jsonD) if(this.current%10==0){ $.post("/www/public/st/saveredistm", {jsonData:aaab,stid:that.questionList[0]?.sjid}, function(res){ }) }else{ // localStorage.setItem('aa','34') localStorage.setItem('saveredistm',aaab) } } //this.activeIndexs = [] if(this.current>this.questionList.length){ this.current=this.questionList.length that.saveAll() }else{ that.loading = false } }, toggleActive(item,index) { if(item.mutexOptionNos){ if(item.mutexOptionNos){ var optionNos = item.mutexOptionNos.split(',') optionNos.forEach(itt=>{ let box = this.$refs.checkboxRefs[itt-1].querySelector('input[type="checkbox"]'); box.checked = false }) } } const checkbox = this.$refs.checkboxRefs[index].querySelector('input[type="checkbox"]'); checkbox.checked = !checkbox.checked; //this.updateCheckboxState(); }, updateCheckboxState() { this.$refs.checkboxRefs.forEach((checkboxRef, index) => { const checkbox = checkboxRef.querySelector('input[type="checkbox"]'); if (checkbox.checked) { this.activeIndexs.push(index); } }); }, gettmlist(){ var that = this const data = { sjid:this.sjid } console.log(data) $.post("/www/public/st/gettmlist", data, function(res){ if(res.success==1){ res.data.forEach(item=>{ let tmlx = that.gettmlx(item) if(tmlx==1){ item.answer = {} } //填空 if(tmlx==2){ //判断%s的数量 let _questioncontent = item.questioncontent.replace(/%s/g,'') var zhanweinumber = (item.questioncontent.length - _questioncontent.length)/2 //为0,说明是简答 console.log(zhanweinumber,'zhanweinumber',item.questionno) if(zhanweinumber==0){ item.isJianda = true }else if(zhanweinumber==1&&item.questioncontent.endsWith("%s")){ item.isJianda = true } console.log(item.isJianda,'item.isJianda') if(item.contenttype){ item.contenttype = item.contenttype.split('#') item.rules = item.contenttype.map((kk,ink)=>{ let rules={} if(kk=='0'){ rules.tag='el-input' }else if(kk=='1'){ rules.tag='el-input-number' }else if(kk=='2'){ rules.tag='el-input-number' } return rules }) console.log(item.rules,item.questionno) if(item.contentrule&&item.contentrule.length){ item.contentrule.map((kk,ink)=>{ var ins = Number(kk.number)-1 var arrr = kk.scope.split(',') var sco = [arrr[0].substring(1),arrr[1].substring(0,arrr[1].length-1)] console.log(sco,'sco') console.log(item.contenttype,'item.contenttype') if(item.contenttype&&item.contenttype[ins]=='0'){ item.rules[ins].minlength = sco[0] item.rules[ins].maxlength = sco[1] }else if(item.contenttype&&item.contenttype[ins]=='1'){ if(sco[0]!='--'){ item.rules[ins].min = Number(sco[0]) } if(sco[1]!='++'){ item.rules[ins].max = Number(sco[1]) } item.rules[ins].step = 1 }else if(item.contenttype&&item.contenttype[ins]=='2'){ item.rules[ins].precision = kk.decimal if(sco[0]!='--'){ item.rules[ins].min = Number(sco[0]) } if(sco[1]!='++'){ item.rules[ins].max = Number(sco[1]) } } return 11 }) }else{ } } var len1 = item.questioncontent.split("%s")?.length //构造答案个数,与输入框个数对应 if(item.isJianda&&zhanweinumber==0){ item.answer = new Array(1) }else{ item.answer = new Array(zhanweinumber) } } //多选 if(tmlx==3){ item.answer = [] item.activeIndex = [] } if(tmlx==4){ item.answer = [] } if(tmlx==5){ item.answer = new Array(item.maxoptcnt).fill('') } if(tmlx==6){ item.answer = 1 item.marks={ 1:item.startscope, [Number(item.segment)]:item.endscope } if(item.axisdesc){ var axisdescArr = item.axisdesc.split(';') item.marks[1] = axisdescArr[0] item.marks[Number(item.segment)] = axisdescArr[axisdescArr.length-1] } console.log(item.marks,'item.marks') } }) console.log(res.data,'that.questionList') that.questionList = res.data that.toolname = that.questionList[0]?.toolname that.getredistm() //that.current= that.current==0? 104:that.current } }) }, handleAct(item){ return this.currentListlast&&this.currentListlast.answer&&this.currentListlast.answer.answerBusiId==item.answerBusiId }, handleChoose(item,index,e){ /*if (e.target.tagName === 'INPUT') { e.target.focus(); // 聚焦输入框 } console.log(e,'eeeeeeeeeeee')*/ if(this.calctmlx==1){ console.log(index,'index') this.$set(this.currentListlast,'activeIndex',index) this.currentListlast.answer = {...item,answerId:item.answerBusiId,answerText:item.optionName} if(item.ansJumpQuesNo){ this.currentListlast._ansJumpQuesNo = item.ansJumpQuesNo }else{ this.currentListlast._ansJumpQuesNo = null } }else if(this.calctmlx==3){ var idex = this.currentListlast.activeIndex.indexOf(index) if(idex==-1){ if(item.ansJumpQuesNo){ this.currentListlast._ansJumpQuesNo = item.ansJumpQuesNo } if(this.currentListlast.maxoptcnt&&this.currentListlast.activeIndex.length>=this.currentListlast.maxoptcnt){ vant.Toast({ message:`最多选择${this.currentListlast.maxoptcnt}个选项`, icon: 'warning-o', }) }else{ if(item.mutexOptionNos){ var optionNos = item.mutexOptionNos.split(',') optionNos.forEach(itt=>{ var op = this.currentListlast.mpanswerdtolist[itt-1] console.log(op.answerBusiId,'op.answerBusiId') console.log(this.currentListlast.answer,'this.currentListlast.answer') if(op){ this.currentListlast.answer = this.currentListlast.answer.filter(an=>an.answerBusiId!=op.answerBusiId) this.currentListlast.activeIndex = this.currentListlast.activeIndex.filter(index1=>index1!=itt-1) } }) } this.currentListlast.activeIndex.push(index) console.log(item.answerBusiId,'item.answerBusiId') this.currentListlast.answer.push({...item,answerId:item.answerBusiId,answerText:item.optionName}) this.toggleActive(item,index) } }else{ this.currentListlast.activeIndex.splice(idex,1) this.currentListlast.answer.splice(idex,1) this.toggleActive(item,index) if(item.ansJumpQuesNo){ this.currentListlast._ansJumpQuesNo = null } } } console.log(this.currentListlast.activeIndex,'this.currentListlast.activeIndex') }, aaa(que){ var that = this var pcur = that.questionList[que.parentno-1] that.currentList.unshift(pcur) if(pcur.parentno!=0){ that.aaa(pcur) } }, gettmlx(item){ console.log(item,item.questiontype,item.questionno,'item') //单选 if(item.questiontype==2&&item.ismult==0){ return 1 } //填空 if(item.questiontype==1&&item.replytype==2){ return 2 } //多选 if(item.questiontype==2&&item.ismult==1){ return 3 } //排序题 if(item.questiontype=='7'&&item.replytype=='1'){ return 4 } //无选项排序题 if(item.questiontype=='7'&&item.replytype=='2'){ return 5 } //滑块题 if(item.questiontype=='8'&&item.replytype=='2'){ return 6 } } }, computed: { answerData(){ var that = this var userInfo = localStorage.getItem('userInfo')?JSON.parse(localStorage.getItem('userInfo')):{} return { xm:that.answererInfo.xm, xxid:that.answererInfo.schoolid||that.answererInfo.xxid||that.answererInfo.id, xxmc:that.answererInfo.xxmc, //zyid:that.answererInfo.zy,// zymc:that.answererInfo.zy,// nj:that.answererInfo.nj,// //bjid:that.answererInfo.bj,// bjmc:that.answererInfo.bj,// xd:that.answererInfo.xd||that.answererInfo.xxjd, account:that.User.Username, email:that.User.Email, ujs:that.User.Roles[0], //accessToken:localStorage.getItem('accessToken'), toolId:that.currentListlast.toolid, stid:that.questionList[0]?.sjid, dtcnt:that.questionAnswers.length, dttime:that.calculateTimeDifference(that.startTime,that.endTime), questionAnswers:JSON.stringify({ toolId:that.currentListlast.toolid, openQuestionAnswerVOS:that.questionAnswers, xb:that.answererInfo.xb }) } }, currentListlast(){ var len = this.currentList.length var cu = this.currentList[len-1] console.log(cu,'cu------') if(!cu) return if(this.gettmlx(cu)==1||this.gettmlx(cu)==3){ cu.mpanswerdtolist.forEach((item,inde)=>{ if(item.replyType==2){ item.optionNameArr = item.optionName.split('%s') if(item.contentType&&!Array.isArray(item.contentType)){ item.fillValues = {} console.log(item.contentType,'item.contentType') item.contentType = item.contentType.split('#') item.rules = item.contentType.map((kk,ink)=>{ let rules={} if(kk=='0'){ rules.tag='el-input' item.fillValues[ink+''] = '' }else if(kk=='1'){ rules.tag='el-input-number' item.fillValues[ink+''] = undefined }else if(kk=='2'){ rules.tag='el-input-number' item.fillValues[ink+''] =undefined } return rules }) console.log(item.contentType,'item.contentType') console.log(item.fillValues,'item.fillValues') console.log(item.rules,'item.rules') if(item.contentRule&&item.contentRule.length){ item.contentRule = JSON.parse(item.contentRule) item.contentRule.map((kk,ink)=>{ var ins = Number(kk.number)-1 var arrr = kk.scope.split(',') var sco = [arrr[0].substring(1),arrr[1].substring(0,arrr[1].length-1)] console.log(sco,'sco') console.log(item.contentType,'item.contentType') if(item.contentType[ins]=='0'){ item.rules[ins].minlength = sco[0] item.rules[ins].maxlength = sco[1] }else if(item.contentType[ins]=='1'){ if(sco[0]!='--'){ item.rules[ins].min = Number(sco[0]) } if(sco[1]!='++'){ item.rules[ins].max = Number(sco[1]) } item.rules[ins].step = 1 }else if(item.contentType[ins]=='2'){ item.rules[ins].precision = kk.decimal if(sco[0]!='--'){ item.rules[ins].min = Number(sco[0]) } if(sco[1]!='++'){ item.rules[ins].max = Number(sco[1]) } } return 11 }) } }else{ } console.log(item.optionNameArr,'item') }else{ item.optionNameArr = [item.optionName] } }) } console.log(cu,'cu') console.log(JSON.stringify(this.currentList),'this.currentList') return cu }, calculatedPercentage() { if (!this.questionList.length) { return 0; // 避免除零错误 } return (this.current / this.questionList.length) * 110; }, calctmlx(){ //单选 if(this.currentListlast&&this.currentListlast.questiontype==2&&this.currentListlast.ismult==0){ return 1 } //填空 if(this.currentListlast&&this.currentListlast.questiontype==1&&this.currentListlast.replytype==2){ return 2 } //多选 if(this.currentListlast&&this.currentListlast.questiontype==2&&this.currentListlast.ismult==1){ return 3 } //排序题 if(this.currentListlast&&this.currentListlast.questiontype=='7'&&this.currentListlast.replytype=='1'){ return 4 } //无选项排序题 if(this.currentListlast&&this.currentListlast.questiontype=='7'&&this.currentListlast.replytype=='2'){ return 5 } //滑块题 if(this.currentListlast&&this.currentListlast.questiontype=='8'&&this.currentListlast.replytype=='2'){ return 6 } } }, watch:{ current:{ handler(val){ console.log(11) if(!val) return var that = this var cur = that.questionList[val-1] if(cur.questiontype==1&&cur.replytype==0){ that.current++ return } if(cur.parentno!=0){ if(that.currentList[0]?.parentno!=0){ that.currentList.unshift(cur) }else{ that.currentList = [] that.currentList.unshift(cur) } that.aaa(cur) }else{ var length = that.currentList.length that.currentList = [] that.currentList.unshift(cur) } console.log(that.currentList,'that.currentList----------------') }, immediate: true }, }, created: function(){ /*if(window.___questionList){ this.questionList = window.___questionList this.current= this.current==0? 1:this.current console.log(this.questionList,'this.questionList') }else{ this.gettmlist() }*/ this.sjid = localStorage.getItem('sjid') this.User = JSON.parse(localStorage.getItem('user')) this.answererInfo = JSON.parse(localStorage.getItem('answererInfo')) this.gettmlist() this.startTime = new Date().getTime(); }, mounted: function(){ }, beforeDestroy(){ if(window.___questionList){ window.___questionList = null } }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-questionTree", function(resolve, reject){ var template = "
\n
\n 一、在过去的两周内,有多少时候您被以下问\n
\n
\n
\n \n 1、做事时提不起劲或没有兴趣。做事时提不起劲或没有兴趣。做事时提不起劲或没有兴趣。做事时提不起劲或没有兴趣。做事时提不起劲或没有兴趣。做事时提不起劲或没有兴趣。\n \n
\n
\n
\n 1、做事时提不起劲或没有兴趣。\n
\n
\n 单选\n
\n
\n
\n
\n 近半年你每天睡觉时间为小时\n
\n
\n 填空\n
\n
\n
\n
\n A、完全不会\n
\n\n
\n
\n
\n {{index+1}}\n
\n\n
\n
\n
\n A、完全不会\n
\n\n
\n
\n
\n\n \n
\n
\n
\n \n 上一题\n \n 下一题\n \n \n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), denominator: 16, activeIndex: -1, status:5, activeIndex: [] }; }, methods: { previous(){ this.status-- }, next(){ this.status++ }, toggleActive(index) { const that = this if (that.activeIndex.includes(index)) { that.activeIndex = that.activeIndex.filter(item => item !== index); } else { that.activeIndex.push(index); } } }, computed: { calculatedPercentage() { if (this.denominator === 0) { return 0; // 避免除零错误 } return (this.status / this.denominator) * 110; } }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-evaluation5-view", function(resolve, reject){ var template = "
\n
\n
\n
\n 北京市小学生第一次心理在线测评\n
\n
\n {{status+1}} / {{denominator}}\n
\n
\n \n
\n
\n \n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), denominator: 16, activeIndex: -1, status:5, activeIndex: [] }; }, methods: { previous(){ this.status-- }, next(){ this.status++ }, toggleActive(index) { const that = this if (that.activeIndex.includes(index)) { that.activeIndex = that.activeIndex.filter(item => item !== index); } else { that.activeIndex.push(index); } } }, computed: { calculatedPercentage() { if (this.denominator === 0) { return 0; // 避免除零错误 } return (this.status / this.denominator) * 110; } }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-test", function(resolve, reject){ var template = "
\n 1223232\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid() }; }, methods: { }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-aggers-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n \n 提交\n \n
\n \n
\n
\n {{info.tyhmc}}\n
\n
\n\n
\n
\n
\n 点 击 签 字\n
\n
\n\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { dialogVisible: false, signaturePad:'', blob:'', file:'', dataURL:'', info:'', tyhid:'', username:'', isWiderScreen: false }; }, methods: { checkScreenWidth() { if (document.documentElement.clientWidth < 600) { this.isWiderScreen = true; } else { this.isWiderScreen = false; } }, openSignatureDialog() { this.dialogVisible = true; this.$nextTick(() => { this.initSignaturePad(); }); }, initSignaturePad() { let canvas = document.getElementById('canvas'); // 创建 SignaturePad let options = { penColor: 'rgb(0,0,0)', minWidth: 5, maxWidth: 10, }; this.signaturePad = new SignaturePad(canvas, options); this.resizeCanvas(); }, back(){ this.$router.push('evaluation') }, getTyh(){ const that = this; let data = { tyhid:that.tyhid, username:that.username } $.post("/www/public/tyh/gettyhzj", data, function(res){ if(res.code==200&&res.data!==null){ that.info = res.data if(res.data.isqs==1){ that.$router.push('evaluations') } }else{ that.$message({ type: "error", message: '服务错误' }) } }) }, resizeCanvas() { let canvas = document.getElementById('canvas') let ratio = Math.max(window.devicePixelRatio || 1, 1) canvas.width = canvas.offsetWidth * ratio canvas.height = canvas.offsetHeight * ratio let context = canvas.getContext('2d') context.scale(ratio, ratio) var signTitle = document.querySelector('.signTitle'); canvas.addEventListener('mouseenter', function() { signTitle.style.display = 'none'; }); canvas.addEventListener('mouseleave', function() { signTitle.style.display = 'block'; }); }, /**根据图片的 Base64 编码,把内容显示到签名板上*/ redisplay() { this.signaturePad && this.dataURL && this.signaturePad.fromDataURL(this.dataURL) }, /*清除签名板内容*/ clear() { this.signaturePad.clear() this.dataURL = null }, /*获取签名板内容(图片的 Base64 编码)*/ save() { this.dataURL = this.signaturePad.toDataURL() console.log( this.dataURL) let data = { tyhid:this.info.id, imgurl:this.dataURL, username:this.username } console.log(data) const that =this $.post("/www/public/tyh/savetyhzj", data, function(res){ if(res.code==200){ that.$message.success('提交成功'); that.dialogVisible=false that.$router.push('success') }else{ that.$message({ type: "error", message: res.message }) } }) }, base64ToBlob(dataURL) { console.log(dataURL) let arr = dataURL.split(',') let mimeType = arr[0].match(/:(.*?);/)[1] || 'image/png' let encodeStr = atob(arr[1]) let n = encodeStr.length let u8Arr = new Uint8Array(n) while (n--) { u8Arr[n] = encodeStr.charCodeAt(n) } return new Blob([u8Arr], { type: mimeType }) }, //转换成file blobToFile(blob, fileName) { // MIME Type const type = blob.type || 'text/plain' return new File([blob], fileName, { type }) }, //生成图片 scImg(){ let blob = this.base64ToBlob(this.dataURL) this.file = this.blobToFile(blob, '签名图片.png') console.log(this.file) }, }, created: function(){ }, mounted: function(){ this.checkScreenWidth(); window.addEventListener('resize', this.checkScreenWidth); this.username = this.$route.query.username; this.tyhid = this.$route.query.tyhid; this.getTyh() let canvas = document.getElementById('canvas') // 创建 SignaturePad let options = { penColor: "rgb(66, 133, 244)", minWidth: 5, maxWidth: 10, } this.signaturePad = new SignaturePad(canvas, options); this.resizeCanvas() }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-logins-view", function(resolve, reject){ var template = "\n"; return (function(template, resolve, reject){ var store = new Vuex.Store({ state: { accessToken:'', userInfo:{}, user:{}, }, mutations: { accessToken(state, accessToken) { state.accessToken = accessToken; }, userInfo(state, userInfo) { state.userInfo = userInfo; }, user(state, user) { state.user = user; }, } }); seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), dialogVisibles:false, forms: { oldpassword: '', newpassword: '', confirmNewpassword: '' }, ruless: { oldpassword: [ { required: true, message: '请输入当前密码', trigger: 'blur' } ], newpassword: [ { required: true, message: '请输入新密码', trigger: 'blur' }, { pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[@$!%*?&=])[A-Za-z\d@$!%*?&=]{8,14}$/, message: '密码格式不符合要求,需包含字母、数字和特殊字符,长度8-14位', trigger: 'blur' } ], confirmNewpassword: [ { required: true, message: '请再次输入新密码', trigger: 'blur' }, { validator: this.validatePasswordMatch, trigger: 'blur' } ] }, codesrc:'/owin/api/authcode?q=2069', ruleForm:{ name:'', }, rules: { name: [ { required: true, message: '请输入姓名', trigger: 'blue' } ], }, tyhid:'', }; }, methods: { rulesInput(formName){ this.$refs[formName].validate((valid) => { if (valid) { this.goHome() } else { return false; } }); }, rulesInputs(formName){ $.post("/www/public/mh/get_pgsxx", {}, function(res){ }) }, goHome(){ const that = this this.getCodeSrc() let data = { username:this.ruleForm.name, tyhid:this.tyhid } $.post("/www/public/tyh/gettyhzj", data, function(res){ if(res.code==200&&res.data!==null){ that.$router.push({ path: "aggers", query: { username:that.ruleForm.name, tyhid:that.tyhid }, }); }else{ that.$message({ type: "error", message: res.message }) } }) }, getCodeSrc(){ this.codesrc = this.codesrc.replace(/\d+$/, parseInt(Math.random()*10000)) }, saves() { const that = this that.$refs.formRefs.validate((valid) => { if (valid) { const id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:'' let data = { ...that.forms } $.post("/www/public/shangbao/editPassword", data, function(res){ if(res.error==0){ that.$message.success('修改成功') that.dialogVisible =false }else{ that.$message.error(res.message) } }) } else { console.error('表单验证失败'); return false; } });}, }, created: function(){ }, mounted: function(){ let hash = window.location.hash; let queryString = hash.substring(hash.indexOf('?') + 1); let params = new URLSearchParams(queryString); this.tyhid = params.get('tyhid'); console.log(this.tyhid); $.post("/owin/api/authcode", {}, function(res){ if(res.code==200){ } }) }, store: store, watch:{ //监听参数中的 props.markerLists 变化 $route:{ handler(newValue, oldValue){ if(newValue.query.otype == '0'){ this.routerAcitve = '/evaluation' }else if(newValue.query.otype == '1'){ this.routerAcitve = '/interview' }else{ this.routerAcitve = newValue.path } }, // 深度侦听需要遍历被侦听对象中的所有嵌套的属性,当用于大型数据结构时,开销很大。 // 因此请只在必要时才使用它,并且要留意性能。 deep: true, }, }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-success-view", function(resolve, reject){ var template = "
\n
\n
\n 提交成功!\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid() }; }, methods: { }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-beforeEvaluations-view", function(resolve, reject){ var template = "
\n

\n 返回\n

\n
\n

\n 测评须知\n

\n \n \n \n \n \n \n \n
\n
学校:{{data.xxmc}}
\n
班级:{{data.rxnf}}/{{data.bj}}
\n
班级:{{data.zy}}/{{data.bj}}
\n
\n
4\">\n
学校:{{data.xxmc}}
\n
专业:{{data.zy}}
\n
班级:{{data.rxnf}}/{{data.bj}}
\n \n
\n
4\">\n
年级:{{data.rxnf}}
\n
班级:{{data.bj}}
\n\n \n
\n \n
答题人:{{data.xm||data.glyxm}}
学校:{{data.xxmc}}
\n
\n \n

\n 本问卷主要是了解学校的测试环境,以确保测评能够顺利进行,请如实填写学校测试环境。\n

\n \n

\n 如有问题,请联系赵工:15693266425\n

\n
\n \n \n
\n 开始答题\n \n 再答一遍\n \n
\n
\n \n
\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid() , data:{}, njMap:{ '1':'一年级', '2':'二年级', '3':'三年级', '4':'四年级', '5':'五年级', '6':'六年级', }, xdMap:{ '1':'小学', '2':'初中', '3':'高中', '4':'中职', '5':'高职', '6':'高教', '7':'本科', '8':'硕士', '9':'博士', }, questionList:[], dtStatus:'' } }, methods: { goback(){ this.$router.go(-1) }, goEaluation(){ this.$router.push({ path:'/evaluationsPages', query:{ status:'1', } }) }, clearUser(){ localStorage.removeItem('user') }, getInfo(){ var that = this $.post("/www/public/st/getcpuserinfo", {}, function(res){ if(res.success==1){ if(!res.data){ res.data = { "xm": "信息员", "xb": "2", "lxfs": "", "sfbzr": "", "sfxlls": "", "sfxxfzr": "", "xxjd": "", "glbj": "", "createtime": "", "xxid": "", "xxmc": "测试学校", "pc": "", "yx": "", "isdel": "", "sfrkjs": "", "userid": "", "cpzt": "", "roles": "", "dtcnt": null, "dttime": null, "jllx": null } } that.data = res.data localStorage.setItem('answererInfo', JSON.stringify(res.data)) if(res.data.jllx==1){ //that.$message.warning('您已经答过题了') // vant.Toast({ // message:'您已经答过题了', // icon: 'warning-o', // }) // setTimeout(()=>{ // that.$router.push('/evaluationsDone') // },1000) } }else{ that.$message({ type: "error", message: '服务错误' }) } }) }, gettmlist(item){ var that = this const params = { sjid:this.sjid } axios({ method: 'get', url:'/www/public/st/gettmlist', params: { ...params }, responseType: 'blob' }).then(response=>{ if(response.request.status==200){ let data = response.data const reader = new FileReader() reader.readAsArrayBuffer(response.data) reader.onload = () =>{ const compressedData = new Uint8Array(reader.result); const result = JSON.parse(pako.ungzip(compressedData, { to: 'string' })); let res = {data:result} that.questionList = res.data window.___questionList = res.data } }else{ this.$message.error('题目获取失败') } }).catch(err=>{ console.log(err) this.$message.error('题目获取失败') }) }, gettmlist1(){ var that = this const data = { sjid:this.sjid } console.log(data) $.post("/www/public/st/gettmlist", data, function(res){ if(res.code==200&&res.data){ that.questionList = res.data window.___questionList = res.data }else{ that.$message({ type: "error", message: res.message }) } }) }, getStatus(){ const that = this $.get("/www/public/bd/pd_sfzdcs", {}, function(res){ if(res.success==1){ that.dtStatus = res.data }else{ that.$message({ type: "error", message: res.message }) } }) }, }, created: function(){ if(this.$route.query.gaugeId){ this.sjid = this.$route.query.gaugeId localStorage.setItem('sjid',this.sjid) this.getStatus() this.getInfo() this.gettmlist() } }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-evaluationsDone-view", function(resolve, reject){ var template = "
\n

\n 返回\n

\n
\n
\n

\n {{toolname}}\n

\n
\n
\n \"\"\n

\n 完成测评\n

\n
\n\n \n\n \n \n \n \n \n \n \n\n
\n
学校:{{data.xxmc}}
\n
联系电话:{{data.lxfs||'--'}}
\n
\n
\n
所在年级:{{xdMap[data.xxjd]+njMap[data.nj]}}
\n
所在班级:{{data.bjmc}}
\n
\n \n
学校:{{data.xxmc}}
答题人:{{data.xm||data.glyxm}}
\n\n\n
\n\n
\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), data:{xm:'',xh:'',xxmc:'',bjmc:'',time:'',answerNumber:''}, time:'', njMap:{ '1':'一年级', '2':'二年级', '3':'三年级', '4':'四年级', '5':'五年级', '6':'六年级', }, xdMap:{ '1':'小学', '2':'初中', '3':'高中', '4':'中职', '5':'高职', '6':'高教', '7':'本科', '8':'硕士', '9':'博士', }, toolname:'' }; }, methods: { goback(){ this.$router.go(-2) }, getInfo(){ var that = this $.post("/www/public/st/getcpuserinfo", {}, function(res){ if(res.success==1){ if(!res.data){ res.data = { "xm": "信息员", "xb": "2", "lxfs": "", "sfbzr": "", "sfxlls": "", "sfxxfzr": "", "xd": "", "glbj": "", "createtime": "", "xxid": "", "xxmc": "测试学校", "pc": "", "yx": "", "isdel": "", "sfrkjs": "", "userid": "", "cpzt": "", "roles": "", "dtcnt": null, "dttime": null, "jllx": null } } that.data = res.data }else{ that.$message({ type: "error", message: '服务错误' }) } }) }, }, created: function(){ this.time = this.$route.query.time this.answerNumber = this.$route.query.answerNumber this.toolname = this.$route.query.toolname this.getInfo() }, mounted: function(){ setTimeout(()=>{ /* localStorage.removeItem('user') */ localStorage.removeItem('userInfo') localStorage.removeItem('answererInfo') localStorage.removeItem('sjid') localStorage.removeItem('saveredistm') },500) }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-aggerLink-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n \n 提交\n \n
\n \n
\n
\n {{info.tyhmc}}\n
\n
\n\n
\n
\n \n\n
\n
\n
\n 点 击 签 字\n
\n
\n\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { dialogVisible: false, signaturePad:'', blob:'', file:'', dataURL:'', info:'', tyhid:'', username:'', isWiderScreen: false, ftid:'', imgUrl:'' }; }, methods: { checkScreenWidth() { if (document.documentElement.clientWidth < 600) { this.isWiderScreen = true; } else { this.isWiderScreen = false; } }, openSignatureDialog() { this.dialogVisible = true; this.$nextTick(() => { this.initSignaturePad(); }); }, initSignaturePad() { let canvas = document.getElementById('canvas'); // 创建 SignaturePad let options = { penColor: 'rgb(0,0,0)', minWidth: 5, maxWidth: 10, }; this.signaturePad = new SignaturePad(canvas, options); this.resizeCanvas(); }, back(){ this.$router.push('evaluation') }, getTyh(){ const that = this; let data = { ftid:this.ftid, } $.post("/www/public/tyh/gettyh", data, function(res){ if(res.code==200&&res.data!==null){ res.data.map((item)=>{ if(item.qsjs==500){ that.info =item that.imgUrl=item.imgurl } }) }else{ that.$message({ type: "error", message: '服务错误' }) } }) }, resizeCanvas() { let canvas = document.getElementById('canvas') let ratio = Math.max(window.devicePixelRatio || 1, 1) canvas.width = canvas.offsetWidth * ratio canvas.height = canvas.offsetHeight * ratio let context = canvas.getContext('2d') context.scale(ratio, ratio) var signTitle = document.querySelector('.signTitle'); canvas.addEventListener('mouseenter', function() { signTitle.style.display = 'none'; }); canvas.addEventListener('mouseleave', function() { signTitle.style.display = 'block'; }); }, /**根据图片的 Base64 编码,把内容显示到签名板上*/ redisplay() { this.signaturePad && this.dataURL && this.signaturePad.fromDataURL(this.dataURL) }, /*清除签名板内容*/ clear() { this.signaturePad.clear() this.dataURL = null }, /*获取签名板内容(图片的 Base64 编码)*/ save() { this.dataURL = this.signaturePad.toDataURL() console.log( this.dataURL) let data = { tyhid:this.info.id, imgurl:this.dataURL, ftid:this.ftid, } console.log(data) const that =this $.post("/www/public/shouye/ft_savestutyh", data, function(res){ if(res.error==0){ that.$message.success('提交成功'); that.imgUrl = res.data that.dialogVisible=false that.getTyh }else{ that.$message({ type: "error", message: res.message }) } }) }, base64ToBlob(dataURL) { console.log(dataURL) let arr = dataURL.split(',') let mimeType = arr[0].match(/:(.*?);/)[1] || 'image/png' let encodeStr = atob(arr[1]) let n = encodeStr.length let u8Arr = new Uint8Array(n) while (n--) { u8Arr[n] = encodeStr.charCodeAt(n) } return new Blob([u8Arr], { type: mimeType }) }, //转换成file blobToFile(blob, fileName) { // MIME Type const type = blob.type || 'text/plain' return new File([blob], fileName, { type }) }, //生成图片 scImg(){ let blob = this.base64ToBlob(this.dataURL) this.file = this.blobToFile(blob, '签名图片.png') console.log(this.file) }, }, created: function(){ }, mounted: function(){ this.checkScreenWidth(); window.addEventListener('resize', this.checkScreenWidth); this.username = this.$route.query.username; this.tyhid = this.$route.query.tyhid; this.ftid = this.$route.query.id; this.getTyh() let canvas = document.getElementById('canvas') // 创建 SignaturePad let options = { penColor: "rgb(66, 133, 244)", minWidth: 5, maxWidth: 10, } this.signaturePad = new SignaturePad(canvas, options); this.resizeCanvas() }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-czsc-view", function(resolve, reject){ var template = "
\n 开始答题\n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid() }; }, methods: { goEaluation(){ window.open('/content/image/xljkImg/czsc.pdf','_blank') } }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-loginp-view", function(resolve, reject){ var template = "\n"; return (function(template, resolve, reject){ var store = new Vuex.Store({ state: { accessToken:'', userInfo:{}, user:{}, }, mutations: { accessToken(state, accessToken) { state.accessToken = accessToken; }, userInfo(state, userInfo) { state.userInfo = userInfo; }, user(state, user) { state.user = user; }, } }); seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), codesrc:'/owin/api/authcode?q=2069', ruleForm:{ name:'', phone:'' }, rules: { name: [ { required: true, message: '请输入姓名', trigger: 'blue' } ], phone: [ { required: true, message: '请输入电话号码', trigger: 'blue' } ], }, tyhid:'', }; }, methods: { rulesInput(formName){ this.$refs[formName].validate((valid) => { if (valid) { this.goHome() } else { return false; } }); }, rulesInputs(formName){ $.post("/www/public/mh/get_pgsxx", {}, function(res){ }) }, goHome(){ const that = this this.getCodeSrc() let data = { tyhid:this.tyhid, } $.post("/www/public/tyh/gettyhcp", data, function(res){ if(res.error==0){ that.$router.push({ path: "aggerp", query: { username:that.ruleForm.name, mobile:that.ruleForm.phone, tyhid:that.tyhid }, }); }else{ that.$message({ type: "error", message: res.message }) } }) }, getCodeSrc(){ this.codesrc = this.codesrc.replace(/\d+$/, parseInt(Math.random()*10000)) }, }, created: function(){ }, mounted: function(){ let hash = window.location.hash; let queryString = hash.substring(hash.indexOf('?') + 1); let params = new URLSearchParams(queryString); this.tyhid = params.get('tyhid'); console.log(this.tyhid); $.post("/owin/api/authcode", {}, function(res){ if(res.code==200){ } }) }, store: store, watch:{ //监听参数中的 props.markerLists 变化 $route:{ handler(newValue, oldValue){ if(newValue.query.otype == '0'){ this.routerAcitve = '/evaluation' }else if(newValue.query.otype == '1'){ this.routerAcitve = '/interview' }else{ this.routerAcitve = newValue.path } }, // 深度侦听需要遍历被侦听对象中的所有嵌套的属性,当用于大型数据结构时,开销很大。 // 因此请只在必要时才使用它,并且要留意性能。 deep: true, }, }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-aggerp-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n \n 提交\n \n
\n \n
\n
\n {{info.tyhmc}}\n
\n
\n\n
\n
\n
\n 点 击 签 字\n
\n
\n\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { dialogVisible: false, signaturePad:'', blob:'', file:'', dataURL:'', info:'', tyhid:'', name:'', mobile:'', isWiderScreen: false }; }, methods: { checkScreenWidth() { if (document.documentElement.clientWidth < 600) { this.isWiderScreen = true; } else { this.isWiderScreen = false; } }, openSignatureDialog() { this.dialogVisible = true; this.$nextTick(() => { this.initSignaturePad(); }); }, initSignaturePad() { let canvas = document.getElementById('canvas'); // 创建 SignaturePad let options = { penColor: 'rgb(0,0,0)', minWidth: 5, maxWidth: 10, }; this.signaturePad = new SignaturePad(canvas, options); this.resizeCanvas(); }, back(){ this.$router.push('evaluation') }, getTyh(){ const that = this; let data = { tyhid:that.tyhid, } $.post("/www/public/tyh/gettyhcp", data, function(res){ if(res.code==200&&res.data!==null){ that.info = res.data if(res.data.isqs==1){ that.$router.push('evaluations') } }else{ that.$message({ type: "error", message: '服务错误' }) } }) }, resizeCanvas() { let canvas = document.getElementById('canvas') let ratio = Math.max(window.devicePixelRatio || 1, 1) canvas.width = canvas.offsetWidth * ratio canvas.height = canvas.offsetHeight * ratio let context = canvas.getContext('2d') context.scale(ratio, ratio) var signTitle = document.querySelector('.signTitle'); canvas.addEventListener('mouseenter', function() { signTitle.style.display = 'none'; }); canvas.addEventListener('mouseleave', function() { signTitle.style.display = 'block'; }); }, /**根据图片的 Base64 编码,把内容显示到签名板上*/ redisplay() { this.signaturePad && this.dataURL && this.signaturePad.fromDataURL(this.dataURL) }, /*清除签名板内容*/ clear() { this.signaturePad.clear() this.dataURL = null }, /*获取签名板内容(图片的 Base64 编码)*/ save() { this.dataURL = this.signaturePad.toDataURL() console.log( this.dataURL) let data = { tyhid:this.info.id, imgurl:this.dataURL, name:this.username, mobile:this.mobile } console.log(data) const that =this $.post("/www/public/tyh/savetyhcp", data, function(res){ if(res.code==200){ that.$message.success('提交成功'); that.dialogVisible=false that.$router.push('success') }else{ that.$message({ type: "error", message: res.message }) } }) }, base64ToBlob(dataURL) { console.log(dataURL) let arr = dataURL.split(',') let mimeType = arr[0].match(/:(.*?);/)[1] || 'image/png' let encodeStr = atob(arr[1]) let n = encodeStr.length let u8Arr = new Uint8Array(n) while (n--) { u8Arr[n] = encodeStr.charCodeAt(n) } return new Blob([u8Arr], { type: mimeType }) }, //转换成file blobToFile(blob, fileName) { // MIME Type const type = blob.type || 'text/plain' return new File([blob], fileName, { type }) }, //生成图片 scImg(){ let blob = this.base64ToBlob(this.dataURL) this.file = this.blobToFile(blob, '签名图片.png') console.log(this.file) }, }, created: function(){ }, mounted: function(){ this.checkScreenWidth(); window.addEventListener('resize', this.checkScreenWidth); this.username = this.$route.query.username; this.mobile= this.$route.query.mobile; this.tyhid = this.$route.query.tyhid; this.getTyh() let canvas = document.getElementById('canvas') // 创建 SignaturePad let options = { penColor: "rgb(66, 133, 244)", minWidth: 5, maxWidth: 10, } this.signaturePad = new SignaturePad(canvas, options); this.resizeCanvas() }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-operatingManual-view", function(resolve, reject){ var template = "
\n \n
\n
\n
\n\n
\n
\n 获取麦克风权限流程\n
\n
\n\n

\n 1.进入测试页面获取麦克风权限\n

\n

\n 2.点击每次访问时都允许授权页面使用电脑麦克风\n

\n
\n \n
\n\n
\n
\n\n
\n
\n 如果不小心点了不允许或没有弹框页面禁用了麦克风需要手动获取权限\n
\n
\n

\n 1.点击网址右侧麦克风按钮\n

\n
\n \n
\n

\n 2.选择始终允许选项点击完成后刷新页面\n

\n
\n \n
\n
\n 下一步\n
\n\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid() }; }, methods: { next(){ this.$router.push('testRecording') } }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-aggerTest-view", function(resolve, reject){ var template = "
\n \n
\n
\n \n
\n \n \n
\n 扫码签署知情书\n
\n
\n
\n \n
\n\n
\n \n 关闭\n \n \n \n \n \n
\n
\n {{info.tyhmc}}\n
\n
\n\n
\n
\n \n\n
\n
\n
\n 暂 未 签 名\n
\n
\n
\n 重新获取二维码\n 再次发送短信\n 下一步\n
\n\n
\n \n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { dialogVisible: false, signaturePad:'', blob:'', file:'', dataURL:'', info:'', tyhid:'', username:'', isWiderScreen: false, ftid:'', imgUrl:'', item:'', status:'', qrcode:'', dialogVisible:false }; }, methods: { next(){ this.$router.push('InterviewGuidance') }, open(){ let data = { ftid:this.item.id } $.post("/www/public/shouye/ft_getstutyhewm", data, (res) => { if (res.error == 0) { this.qrcode = res.data.qrcode this.getQRcode() } }); this.dialogVisible =true }, getQRcode(){ document.getElementById("qrcode").innerHTML = ''; let that = this new QRCode(document.getElementById("qrcode"), { width: '200',//宽 height: '200',//高 text: that.qrcode,//二维码内容 colorDark : "#000000", colorLight : "#ffffff", correctLevel : QRCode.CorrectLevel.H, }); }, checkScreenWidth() { if (document.documentElement.clientWidth < 600) { this.isWiderScreen = true; } else { this.isWiderScreen = false; } }, openSignatureDialog() { this.dialogVisible = true; this.$nextTick(() => { this.initSignaturePad(); }); }, initSignaturePad() { let canvas = document.getElementById('canvas'); // 创建 SignaturePad let options = { penColor: 'rgb(0,0,0)', minWidth: 5, maxWidth: 10, }; this.signaturePad = new SignaturePad(canvas, options); this.resizeCanvas(); }, back(){ this.$router.push('evaluation') }, getTyh(){ const that = this; let data = { ftid:this.ftid, } $.post("/www/public/tyh/gettyh", data, function(res){ if(res.code==200&&res.data!==null){ res.data.map((item)=>{ if(item.qsjs==500){ that.info =item that.imgUrl=item.imgurl } }) }else{ that.$message({ type: "error", message: '服务错误' }) } }) }, resizeCanvas() { let canvas = document.getElementById('canvas') let ratio = Math.max(window.devicePixelRatio || 1, 1) canvas.width = canvas.offsetWidth * ratio canvas.height = canvas.offsetHeight * ratio let context = canvas.getContext('2d') context.scale(ratio, ratio) var signTitle = document.querySelector('.signTitle'); canvas.addEventListener('mouseenter', function() { signTitle.style.display = 'none'; }); canvas.addEventListener('mouseleave', function() { signTitle.style.display = 'block'; }); }, /**根据图片的 Base64 编码,把内容显示到签名板上*/ redisplay() { this.signaturePad && this.dataURL && this.signaturePad.fromDataURL(this.dataURL) }, /*清除签名板内容*/ clear() { this.signaturePad.clear() this.dataURL = null }, /*获取签名板内容(图片的 Base64 编码)*/ save() { this.dataURL = this.signaturePad.toDataURL() console.log( this.dataURL) let data = { imgurl:this.dataURL, ftid:this.ftid, } console.log(data) const that =this $.post("/www/public/shouye/ft_savestutyh", data, function(res){ if(res.error==0){ that.$message.success('提交成功'); that.imgUrl = res.data that.dialogVisible=false that.getTyh }else{ that.$message({ type: "error", message: res.message }) } }) }, base64ToBlob(dataURL) { console.log(dataURL) let arr = dataURL.split(',') let mimeType = arr[0].match(/:(.*?);/)[1] || 'image/png' let encodeStr = atob(arr[1]) let n = encodeStr.length let u8Arr = new Uint8Array(n) while (n--) { u8Arr[n] = encodeStr.charCodeAt(n) } return new Blob([u8Arr], { type: mimeType }) }, //转换成file blobToFile(blob, fileName) { // MIME Type const type = blob.type || 'text/plain' return new File([blob], fileName, { type }) }, //生成图片 scImg(){ let blob = this.base64ToBlob(this.dataURL) this.file = this.blobToFile(blob, '签名图片.png') console.log(this.file) }, }, created: function(){ }, mounted: function(){ this.checkScreenWidth(); window.addEventListener('resize', this.checkScreenWidth); this.item = JSON.parse(localStorage.getItem('stuItem')); this.status = JSON.parse(localStorage.getItem('stuStatus')); this.username = this.item.xsmc; this.ftid = this.item.id; this.getTyh() let canvas = document.getElementById('canvas') // 创建 SignaturePad let options = { penColor: "rgb(66, 133, 244)", minWidth: 5, maxWidth: 10, } this.signaturePad = new SignaturePad(canvas, options); this.resizeCanvas() }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-InterviewGuidance-view", function(resolve, reject){ var template = "
\n \n
\n
\n
\n\n
\n
\n 热身引导环节\n
\n
\n
\n\n
\n
\n 下一步\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), title:'', info:'', item:'', status:'' }; }, methods: { next(){ if(this.status==1){ if(this.item.xd<5){ this.$router.push({ path: '/interviewInfoLS', }); }else{ this.$router.push({ path: '/interviewInfoLSGj', }); } } if(this.status==2){ if(this.item.xd<5){ this.$router.push({ path: '/interviewInfoOnline', }); }else{ this.$router.push({ path: '/interviewInfoOnlineGj', }); } } }, }, created: function(){ this.item = JSON.parse(localStorage.getItem('stuItem')); this.status = JSON.parse(localStorage.getItem('stuStatus')); }, mounted: function(){ const that =this let data = { userid:JSON.parse(localStorage.getItem('stuStatus')).ID } $.post("/www/public/shouye/ft_getftzdy", data, function(res){ if(res.error==0){ that.title = res.data[0].tyhmc that.info = res.data[0].tyhnr console.log(that.info) }else{ that.$message({ type: "error", message: res.message }) } }) }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-ftInterviewHomepage-view", function(resolve, reject){ var template = "
\n
\n
\n
\n 您好,{{userInfo.Nickname}}访谈员~\n
\n
\n
\n {{gzdwmc}}\n
\n\n
\n
\n
\n
\n \n
\n
\n
\n\n
\n
\n
\n
\n \n
\n
\n
\n 学习要求\n
\n
\n 勤奋、专注、思考、实践\n
\n
\n
\n
\n
\n \n
\n
\n
\n 学习课程\n
\n
\n 应知应会,方能胜任\n
\n
\n
\n
\n
\n \n\n
\n
\n
\n 在线考试\n
\n
\n 冷静分析,沉着应对\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n 考试记录\n
\n
\n 即时记录,准确回顾 \n
\n
\n
\n
\n
\n \n
\n
\n
\n 考试证书\n
\n
\n 权威认证,实力见证\n
\n
\n
\n\n \n \n
\n
\n \n
\n
\n
\n 访谈练习\n
\n
\n 模拟实战,应对自如\n
\n
\n
\n
\n
\n \n
\n
\n
\n 开始访谈\n
\n
\n 倾听理解,建立信任\n
\n
\n
\n
\n
\n \n
\n
\n
\n 通知公告\n
\n
\n 重要通知,及时关注\n
\n
\n
\n
\n
\n \n
\n
\n
\n 操作手册\n
\n
\n 详尽指南,一目了然\n
\n
\n
\n
\n
\n\n
\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { butList:[], active:0, tzggList:[], value:'', reverse: false, crq:'', rqList:[], currentList:[], userInfo:{}, type:'', gzdwmc:'', ifqs:'' }; }, methods: { gointerviewLS(status) { this.$router.push({ path: '/interviewLS', query: { status: status } }); }, gg(){ window.open('https://xinlijc.bnu.edu.cn/www/dd/vue/spa/xljk#/FTnotice','_blank') }, czsc(){ window.open('https://xinlijc.bnu.edu.cn/content/image/xljkImg/ftsc.pdf','_blank') }, kszs(){ const that =this let data = { } $.post("/www/public/shouye/px_ftlssy_zscx", data, function(res){ if(res.error==0){ window.open(res.data.url) }else{ that.$message.error(res.message) } }) }, ksft(){ const that = this console.log(that.type) if(that.type==1){ if(that.ifqs==1){ this.$router.push({ path: '/interviewLS', }); }else{ that.$router.push('aggerTeacher') } } if(this.type==2){ that.$alert('该访谈员未完成培训无法开始访谈', '提示', { confirmButtonText: '确定', type: 'warning', callback: action => { } }); } }, routerPush(path){ this.$router.push(path) }, getImgsrc:function(val) { return "/content/image/xljkImg/"+val }, getIndex(index){ this.active = index }, onPanelChange(value, mode) { console.log(value, mode); }, getDay(val){ if(this.rqList.length>0){ if(val.type=='current-month'){ //this.currentList.push(val.day) } if(val.type=='current-month'&&this.rqList.indexOf(val.day)>=0){ return true }else{ return false } } }, getDate(val){ //console.log(this.currentList) this.crq = val this.getdb() }, //获取待办 getdb:function(){ let that = this //$.post("/www/py/fwpt/test", {crq:this.crq}, function(res){ $.post("/www/py/fwpt/user_event", {crq:this.crq}, function(res){ if(res.success==1){ if(res.data.data){ that.tzggList = res.data.data that.rqList = res.data.rq } } }) }, }, created: function(){ let that = this that.getdb() that.userInfo =localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} $.post("/www/public/shouye/px_fty_sfftls", {}, function(res){ that.gzdwmc = res.data.gzdwmc that.type=res.data.type that.ifqs=res.data.ifqs }) }, mounted: function(){ }, props: ['title', 'data', 'config','isHeight'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-ftexamination-view", function(resolve, reject){ var template = "
\n \n
\n\n
\n
\n
\n
\n
{{item.sjmc}}
\n
\n 总分:{{ item.sjzfs }}分\n 及格分:{{ item.sjjgx }}分\n
\n
\n
\n 剩余时间:\n \n {{ countdown.hours }} : {{ countdown.minutes }} : {{ countdown.seconds }}\n
\n
\n
\n
\n
\n {{ getTitle(type) }}(共{{ questionList[type].total_count }}题,共{{ questionList[type].total_score\n }}分)\n
\n
\n
\n {{ children.tmfs }}分\n
{{ subIndex + 1 }}. {{ children.tmwt }}
\n
\n
\n \n \n \n {{ option.key }}.\n {{ option.value }}\n \n \n \n \n \n \n {{ option.key }}.\n {{ option.value }}\n \n \n \n \n \n A.正确\n B.错误\n \n \n\n
\n\n
\n\n
\n
\n 下一步\n
\n
\n\n
\n
\n
\n
\n \n \n \n 答题卡\n
\n
已答
\n
未答
\n
当前题目
\n
\n
\n
\n
\n
\n {{ getTitle(type) }}(共{{ questionList[type].total_count }}题,共{{ questionList[type].total_score\n }}分)\n
\n
    \n
  • {{ subIndex + 1 }}\n
  • \n
\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
{{item.sjmc}}
\n
\n 总分:{{ item.sjzfs }}分\n 及格分:{{ item.sjjgx }}分\n
\n
\n
\n 剩余时间:\n \n {{ countdown.hours }} : {{ countdown.minutes }} : {{ countdown.seconds }}\n
\n
\n
\n
\n
\n {{ getTitle(type) }}(共{{ questionList[type].total_count }}题,共{{ questionList[type].total_score\n }}分)\n
\n
\n
\n 20分\n
{{ currentQuestionIndex + 1 }}.
\n
\n
\n
\n

{{item.tmwt}}

\n \n
\n
\n
\n\n
\n
\n 上一步\n 上一题\n 交卷\n 下一题\n\n\n
\n\n\n
\n\n
\n\n
\n
\n\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { timer: null, type:true, currentQuestionIndex: 0, countdown: { days: 0, hours: '00', minutes: '00', seconds: '00' }, current: 1, // 当前题目sort // 答案 id answer formData: [], // 问卷问题存 questionList: [], questionListBak: { radio: [], checkbox: [], trueFalse: [] }, // 面包屑list,一般缓存再vuex 和sessionStroge breadcrumbList: [ { name: '项目列表', path: '/question' }, { name: '以及状态自查问卷', path: '/survey' } ], rules: { username: [{ required: true, message: '请输入用户名', trigger: 'blur' }], password: { required: true, message: '请输入密码', trigger: 'blur' } } }; }, methods: { syb(){ this.type =true }, next(){ this.type =false }, nextQuestion() { if (this.currentQuestionIndex < this.questionList.row_4.data.length - 1) { this.currentQuestionIndex++; } }, previousQuestion() { if (this.currentQuestionIndex > 0) { this.currentQuestionIndex--; } }, goBack(){ this.$router.go(-1) }, // 模拟获取问卷list getList() { const that =this let data = { sjid:that.item.sjid } $.post("/www/public/shouye/px_ftlssy_ks_sj_tmxqxx", data, function(res){ if(res.error==0){ try { const target = res.data Object.keys(target).forEach(key => { console.log(key) target[key].data.forEach(child => { child.answer = key === 'row_2' ? [] : '' }) }) that.questionList =res.data console.log(that.questionList) } catch (e) { console.error(e) } } }) }, // 点击跳转问题 handleCurrent(item, type, index) { document.querySelector('#' + type + index).scrollIntoView(true) this.current = { ...item, type, index } }, // 判断是否存在值 isExistAnswer(item, type) { // checkbox时需要数组为空, 如果可能存在 值为数字0的话 ,需要自行细化非空选项 let result = false switch (type) { case 'row_2': result = !!(item.answer && item.answer.length) break default: result = !!item.answer || item.answer === 0 break } return result }, back() { this.$router.go(-1) }, transformData(data) { return data.map(item => { if( Array.isArray(item.answer)){ var answers = item.answer.join(',') return { tmid: item.tmid, answer: answers }; } return { tmid: item.tmid, answer: item.answer }; }); }, transformDatas(data){ let arr = [] data.forEach(item=>{ item.tmwt.forEach(v=>{ var obj = { tmid: v.tmid, answer: v.answer }; arr.push(obj) }) }) return arr }, // 保存 save() { /* let unAnswerList = '' Object.keys(this.questionList).forEach(key => { const unfinished = this.questionList[key].data.filter(row => !this.isExistAnswer(row)) if (unfinished.length) { unAnswerList = unAnswerList + '' + this.getTitle(key) + '
' + (unfinished.map((item, index) => index + 1).join(',')) + '

' console.log('unfinished', unfinished) } }) if (unAnswerList.length) { this.$confirm('以下题目未回答:
' + unAnswerList, { dangerouslyUseHTMLString: true }) return } */ this.$confirm('是否提交问卷?', '保存提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { if (this.timer) { clearInterval(this.timer) this.timer = null window.localStorage.removeItem('distance') } // 答案过滤 缺 this.formData = Object.values(this.questionList).map(row => { }) console.log(this.questionList.row_4.data,'asdasddsadasd') console.log(this.transformDatas(this.questionList.row_4.data),'dsazxczxczxczxxc') const questionArr = [ ...(this.questionList.row_1?.data ? this.transformData(this.questionList.row_1.data) : []), ...(this.questionList.row_2?.data ? this.transformData(this.questionList.row_2.data) : []), ...(this.questionList.row_3?.data ? this.transformData(this.questionList.row_3.data) : []), ...(this.questionList.row_4?.data ? this.transformDatas(this.questionList.row_4.data) : []) ]; // 保存的方法 do something const that =this let data = { questionAnswers:JSON.stringify(questionArr), ksrwid:that.item.id, ksmc:that.item.ksmc, kslx:that.item.kslx, sjid:that.item.sjid, sjmc:that.item.sjmc, sjjgx:that.item.sjjgx, sjzfs:that.item.sjzfs } $.post("/www/public/shouye/px_ftlssy_ks_save_exam_record", data, function(res){ if(res.error==0){ that.$message({ type: 'success', message: '保存成功!' }) that.$router.go(-2) }else{ that.$message({ type: 'error', message: res.message }) } }) }).catch((e) => { console.error(e) this.$message({ type: 'info', message: '已取消保存' }) }) }, // 计算当前题型总分 // calcTotal(type) { // return this.questionList[type].reduce((total, item) => { // return total + item.score // }, 0) // }, // 计算当前题型总分 getTitle(type) { const titleObj = { row_1: '单选题', row_2: '多选题', row_3: '判断题', row_4: '问答题', } return titleObj[type] }, /* 倒计时 * @params {string} endTime number 毫秒 * */ startCountdown(endTime) { clearInterval(this.timer) this.timer = setInterval(() => { const now = new Date().getTime() const distance = endTime - now if (distance <= 0) { clearInterval(this.timer) this.timer = null window.localStorage.removeItem('endTime') return } const _hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)) const _minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)) const _seconds = Math.floor((distance % (1000 * 60)) / 1000) this.$set(this.countdown, 'days', Math.floor(distance / (1000 * 60 * 60 * 24))) this.$set(this.countdown, 'hours', _hours < 10 ? '0' + _hours : _hours) this.$set(this.countdown, 'minutes', _minutes < 10 ? '0' + _minutes : _minutes) this.$set(this.countdown, 'seconds', _seconds < 10 ? '0' + _seconds : _seconds) }, 1000) } }, created: function(){ const that =this that.item = JSON.parse(this.$route.query.item || '{}'); console.log(that.item) }, computed: { totalScore() { return Object.values(this.questionList).reduce((total, row) => { return total + row.total_score }, 0) } }, watch: { questionList: { handler(newVal) { window.localStorage.setItem('questionList', JSON.stringify(newVal)) }, deep: true } }, mounted() { // 先获取缓存的list // const _questionList = window.localStorage.getItem('questionList') if (false) { this.questionList = JSON.parse(_questionList) } else { // 没有缓存,再请求接口 this.getList() } // 执行倒计时 let _endTime = window.localStorage.getItem('endTime') if (!_endTime) { _endTime = new Date().getTime() + 3600000 window.localStorage.setItem('endTime', _endTime + '') } this.startCountdown(+_endTime) }, beforeDestroy() { window.localStorage.removeItem('questionList') if (this.timer) { clearInterval(this.timer) window.localStorage.removeItem('endTime') } }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDzlxz2-view", function(resolve, reject){ var template = "
\n \n\t\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), loopData0: [ { lanhuimage0: 'https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPnge6cbfd075f5424b938564c64b59194e05f48858976d2e5263fef0f82df6c2540', lanhutext0: '国家义务教育质量监测宣传文档.word', lanhutext1: '9.8kb', lanhuimage1: 'https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPngba1ec869aeb2beacf55e54800ffda69d264fb1070ca06eba225647a0a1d108d3', lanhutext2: '下载', }, { lanhuimage0: 'https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng0ec5150422b89ae622764f7a8aae77a8e248413eeea4b20a0daad5e56763cc8c', lanhutext0: '国家义务教育质量监测宣传视频.pdf', lanhutext1: '9.8kb', lanhuimage1: 'https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPngba1ec869aeb2beacf55e54800ffda69d264fb1070ca06eba225647a0a1d108d3', lanhutext2: '下载', }, { lanhuimage0: 'https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng434f0af02fa2201275396e9b5a8ee88455ab3cb871811892ac329ddd61702909', lanhutext0: '国家义务教育质量监测宣传视频.mp4', lanhutext1: '9.8kb', lanhuimage1: 'https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPngba1ec869aeb2beacf55e54800ffda69d264fb1070ca06eba225647a0a1d108d3', lanhutext2: '下载', }, { lanhuimage0: 'https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPngaff21cfa97cd62fbed39b077eae2a3e776d53419f20e6973820aa2086aa19b32', lanhutext0: '国家义务教育质量监测宣传视频.zip', lanhutext1: '9.8kb', lanhuimage1: 'https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPngba1ec869aeb2beacf55e54800ffda69d264fb1070ca06eba225647a0a1d108d3', lanhutext2: '下载', }, { lanhuimage0: 'https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng3e19c7404fb0bd70b4b81ca0108e9ca8323ca3560b4ab6cc9d8d79902276b9de', lanhutext0: '国家义务教育质量监测宣传视频.excel', lanhutext1: '9.8kb', lanhuimage1: 'https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPngba1ec869aeb2beacf55e54800ffda69d264fb1070ca06eba225647a0a1d108d3', lanhutext2: '下载', }, { lanhuimage0: 'https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng4c5d398b3fd2558acd837119d3a788dca319feb92b6e991fb1caff53d712995e', lanhutext0: '国家义务教育质量监测宣传.jpg', lanhutext1: '9.8kb', lanhuimage1: 'https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPngba1ec869aeb2beacf55e54800ffda69d264fb1070ca06eba225647a0a1d108d3', lanhutext2: '下载', }, ], constants: {}, }; }, methods: { }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDnav", function(resolve, reject){ var template = "
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n 取 消\n 确 定\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
\n 取 消\n 确 定\n
\n
\n
\n
\n \"\"/\n

\n {{menuTitle || '学生学习生活与心理素养调查'}}\n

\n
\n
\n \n \"\"/\n \n

\n {{Nickname}}\n \n

\n \n 基本信息\n \n 修改密码\n 退出登录\n \n
\n\n
\n
\n
\n
\n 首页/{{currentPage}}\n
\n
\n \n 返回\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), searchValue:'', dialogVisible:false, dialogVisibles:false, menuTitle:'', formLabelWidth: '130px', Roles:'', form: { xm: '', sjhm: '', }, forms: { oldpassword: '', newpassword: '', confirmNewpassword: '' }, rules: { }, ruless: { oldpassword: [ { required: true, message: '请输入当前密码', trigger: 'blur' } ], newpassword: [ { required: true, message: '请输入新密码', trigger: 'blur' }, { pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[@$!%*?&=])[A-Za-z\d@$!%*?&=]{8,14}$/, message: '密码格式不符合要求,需包含字母、数字和特殊字符,长度8-14位', trigger: 'blur' } ], confirmNewpassword: [ { required: true, message: '请再次输入新密码', trigger: 'blur' }, { validator: this.validatePasswordMatch, trigger: 'blur' } ] } }; }, methods: { czsc(){ window.open('https://kdocs.cn/l/ctIwhZTg8RKd','_blank') }, grxx(){}, xgmm(){}, getLcidByUserztAndLoadTitle(){ var that = this $.get('/www/public/menuconfig/userzt', {}, function(resd){ if (resd && resd.success == 1) { var cdlist = resd.data || {} that.findMenuTitle(cdlist.lcid || '') } else { that.$message.error((resd && resd.message) || '获取用户状态失败') } }).fail(function(){ that.$message.error('获取用户状态请求失败') }) }, findMenuTitle(lcid){ var that = this if (!lcid) return $.get('/www/public/menuconfig/findmenutitle', { lcid: lcid }, function(res){ if(res && (res.error === 0 || res.success === 1)){ var title = (res.data && (res.data.title || res.data.name)) || res.title || '' if (title) that.menuTitle = title }else{ that.$message.error((res && res.message) || '获取标题失败') } }).fail(function(){ that.$message.error('获取标题请求失败') }) }, validatePasswordMatch(rule, value, callback) { if (value !== this.forms.newpassword) { callback(new Error('两次输入的新密码不一致')); } else { callback(); } }, formatDate(date) { const d = new Date(date); const year = d.getFullYear(); const month = ('0' + (d.getMonth() + 1)).slice(-2); const day = ('0' + d.getDate()).slice(-2); return `${year}-${month}-${day}`; }, save() { const that = this if (that.form.sr) { that.form.sr = that.formatDate(that.form.sr); } that.$refs.formRef.validate((valid) => { if (valid) { const id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:'' let data = { ...that.form, } $.post("/www/public/shangbao/edituserinfo ", data, function(res){ if(res.error==0){ that.$message.success('提交成功') that.dialogVisible =false }else{ that.$message.error(res.message) } }) } else { console.error('表单验证失败'); return false; } });}, saves() { const that = this that.$refs.formRefs.validate((valid) => { if (valid) { const id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:'' let data = { ...that.forms } $.post("/www/public/shangbao/editPassword", data, function(res){ if(res.error==0){ that.$message.success('修改成功') that.dialogVisible =false that.logout() }else{ that.$message.error(res.message) } }) } else { console.error('表单验证失败'); return false; } });}, jfjc(){ this.dialogVisible =true }, jfjcs(){ this.dialogVisibles =true }, goHome(){ this.$router.go('-1') }, logoutyuancheng(){ var that = this data = { } url = "/www/public/home/doout" $.post(url, data, function(res){ if(res.success==1){ that.$message.success('已退出登录') }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message('请求错误') }) }, logout(){ this.logoutyuancheng() localStorage.removeItem('user') localStorage.removeItem('xxjd') localStorage.removeItem('glyInfo') this.$store.commit('user',undefined) this.$router.replace('/login') } }, created: function(){ const that = this const id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:'' this.Roles=localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).Roles[0]:'' let data ={ xxyid : id } $.get("/www/public/shangbao/finduserinfo", data, function(res){ if(res.error==0){ that.form = res.data }else{ that.$message.error(res.message) } }) this.getLcidByUserztAndLoadTitle() }, mounted: function(){ }, computed:{ Nickname(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} return user.Nickname } }, props: ['title', 'data', 'config','currentPage','color','hideReturnBtn'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDzlxz3-view", function(resolve, reject){ var template = "
\n \n
\n
\n
\n \n 资料下载\n
\n
\n
\n
\n
\n \n
\n
\n

\n {{item.name}}\n

\n
\n
\n
\n\n
\n \n
\n \n

下载

\n
\n
\n
\n
\n \n
\n \n
\n
\n

\n {{item.filename}}\n \n \n

\n
\n

\n 上传文件名:{{item.originFilename}}\n

\n

\n 接受上传类型:{{getAccept(item.file)}},文件不超过50M。\n

\n
\n
\n
\n
\n
\n\n \n
\n \n

下载

\n
\n
\n\n customUpload(val,item)\"\n :on-error=\"onError\">\n
\n \n

上传

\n
\n\n
\n
\n \n
\n \n

删除

\n
\n
\n\n \n
\n \n

预览

\n
\n
\n\n
\n
\n \n
\n \n
\n
\n

\n {{item.filename}}\n \n \n

\n
\n

\n 上传文件名:{{item.originFilename}}\n

\n

\n 接受上传类型:{{getAccept(item.file)}},文件不超过50M。\n

\n
\n
\n
\n
\n
\n
\n \n
\n \n

等待更新

\n
\n
\n
\n\n\n customUpload(val,item)\"\n :on-error=\"onError\">\n
\n \n

上传

\n
\n\n
\n
\n \n
\n \n

删除

\n
\n
\n\n \n
\n \n

预览

\n
\n
\n\n
\n
\n
\n
\n
\n \n 资料上传\n
\n
\n
\n \n
\n \n
\n
\n

\n 模板名称:{{item.filename}}\n \n \n\n

\n
\n

\n 上传文件名:{{item.originFilename}}\n

\n

\n 接受上传类型:{{getAccept(item.file)}},文件不超过50M。\n

\n
\n
\n
\n
\n
\n \n
\n \n

下载

\n
\n
\n customUpload(val,item)\"\n :on-error=\"onError\">\n
\n \n

上传

\n
\n\n
\n
\n \n
\n \n

删除

\n
\n
\n\n \n
\n \n

预览

\n
\n
\n\n
\n
\n\n
\n
\n
\n
\n \n
\n \n\n
\n
\n

\n 待上传材料:{{item.filename}}\n\n \n \n

\n
\n

\n 上传文件名:{{item.originFilename}}\n

\n

\n 接受上传类型: .zip,文件不超过50M。\n

\n
\n
\n
\n
\n
\n \n
\n \n

下载

\n
\n
\n customUpload(val,item)\"\n :on-error=\"onError\">\n
\n \n

上传

\n
\n\n
\n
\n \n
\n \n

删除

\n
\n
\n\n\n
\n
\n\n
\n \n \n \n\n\n \n\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), uploading:false, percentage:0, showpercent:false, customColor: '#409eff', loading:false, pages:{ pageSize:10, pageNo:1 }, List:[], typeMap:["/jpglogo.png","/yasuologo.png","/mp4logo.png","/wordlogo.png","/excellogo.png","/pdflogo.png"], loopData0: [ ], loopData4: [ ], loopData1:[], loopData2:[], total:0, constants: {},}; }, methods: { /* // customUpload(params,item) { var that = this that.loading = true var xxjd = localStorage.getItem('xxjd') //1小学 2初中 3高中 4中职 5高职 7本科 8硕士 9博士 var importType if(['1','2','3'].indexOf(xxjd)!=-1){ importType = '1' }else{ importType = '2' } // params是一个对象,包含了file和fileList, // 但是这个params参数可能每个版本不一样值就不一样,到时候自己打印看看, // 反正file的值就是原始的File对象 const formData = new FormData() console.log(params.file,'params.file') formData.append('file', params.file) // 这是file入参,文件信息 // 如果extraParams是个对象,循环加入formData for (const key in this.extraParams) { formData.append(key, this.extraParams[key]) } // 如果extraParams是个单独的值,直接加入 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var roles=user.UserFilter.urole // 调接口 axios.post(`/www/public/shangbao/addfiletemprecord?filetempid=${item.id}`, formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ that.$message.success(data.message) that.loading = false that.getList() }else{ that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false that.$message.error('文件上传异常!') console.error(error); }); }, */ getMd5(file) { return new Promise((resolve) => { // 对文件对象的处理 const spark = new SparkMD5.ArrayBuffer()// md5的ArrayBuffer加密类 var fileReader = new FileReader(); fileReader.readAsArrayBuffer(file); // fileReader.onload为异步函数,要放到Promise对象中,等待状态的变更后再返回生成的md5值 fileReader.onload = function (e) { spark.append(e.target.result); resolve(spark.end()); }; }); }, async uploadFile(params,item){ var that = this that.loading = true var xxjd = localStorage.getItem('xxjd') //1小学 2初中 3高中 4中职 5高职 7本科 8硕士 9博士 var importType if(['1','2','3'].indexOf(xxjd)!=-1){ importType = '1' }else{ importType = '2' } var successhh = 0 that.uploading = true const file = params.file console.log(file,'file') const fileReader = new FileReader()// 文件读取 console.log(file) const chunkSize = 1024 * 1024 * 6 let fileChunkedList = [] // 文件分片完成之后的数组 const name=file.name let md5 = await that.getMd5(file) // 文件开始分片,push到fileChunkedList数组中, 并用第一个分片去计算文件的md5 for (let i = 0; i < file.size; i = i + chunkSize) { const tmp = file.slice(i, Math.min((i + chunkSize), file.size)) if (i === 0) { fileReader.readAsArrayBuffer(tmp) } fileChunkedList.push(tmp) } console.log(fileChunkedList,'数组') const chunks=fileChunkedList.length that.showpercent = true for (let i = 1; i <= fileChunkedList.length; i =i+1) { const formData = new FormData() formData.append('imgFile', fileChunkedList[i-1],file.name) formData.append('chunk', i) formData.append('old', that.old) formData.append('size', file.size) formData.append('name', name) formData.append('md5', md5) for (var value of formData.values()) { console.log(value); } const result = await that.uploads(formData,item.id) console.log(result,'result') if(result){ if(result.status==200){ if(result.data){ //console.log(result.data,'result.data') const data = result.data that.old = data.data if(data.success==1){ successhh += 1 that.percentage = ((successhh/fileChunkedList.length)*100).toFixed(0) console.log(that.percentage,' that.percentage') }else{ return that.$message.error(data.message) } } }else{ } } } if(successhh==fileChunkedList.length){ that.$message.success("上传成功!") }else{ that.$message.success("上传失败!") } that.uploading = false that.showpercent = false }, uploads(data,id){ //console.log(new Date()) var that = this return axios({ method:'post', data:data, url: `/www/public/test/test_bigupload?id=${id}`, headers:{'Content-Type': 'application/octet-stream'}, }) }, beforeAvatarUpload(file) { const isLt28M = file.size / 1024 / 1024 < 50; if (!isLt28M) { this.$message.error('上传文件大小不能超过50MB!'); } return isLt28M; }, YBXCYBJexportFn(activeName){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { username:user.Username } var url = '/www/public/shangbao/dcxxycybj' var name = '样本校抽样班级名单.xls' axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, XXexportFn(activeName){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { schoolid, } var url var name if(activeName=='first'){ url = "/www/public/shangbao/exportStudent" name = '学生账号.xls' }else if(activeName == 'second'){ url = "/www/public/shangbao/exportteather" name = '教师账号.xls' }else{ url = "/www/public/shouye/px_webftybm_dcbxftyzh" name = '访谈员账号.xls' } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, DexportFn(){ var that = this var name //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var username = user.Username var bm = username.substring(3) let type if(user.Roles.includes('220')){ type='1' name = '市级管理员账号信息.xls' if(['110000','120000','310000','500000'].includes(bm)){ type='1' name = '区县管理员账号信息.xls' } }else if(user.Roles.includes('310')){ type='2' name = '区县管理员账号信息.xls' } const params = { username:user.Username, type, state:'1' } axios({ method: 'get', url: '/www/public/shangbao/dcsqxzh', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, exportFn(){ var that = this //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let type if(user.Roles.includes('220')){ type='1' }else if(user.Roles.includes('310')){ type='2' } const params = { username:user.Username, type, state:'1', } axios({ method: 'get', url: '/www/public/shangbao/exportzgxxx', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', '直管校管理员账号.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, delfn(item){ var that = this const params = { id:item.recordId, tempid:item.filetempid } $.post("/www/public/shangbao/deletefilerecord", params, function(res){ if(res.error==0){ that.$message.success('删除成功') that.getList() }else{ that.$message.error(res.message) } }).fail((err)=>{ that.loading = false that.$message({ type: "error", message: '请求错误' }) }) }, yulan(item){ window.open('/core/UForm/fileviewer/r_temp_file_record?ff=id&fv='+item.recordId,'_blank') }, onError(){}, customUpload2(params) { var that = this that.loading = true var xxjd = localStorage.getItem('xxjd') //1小学 2初中 3高中 4中职 5高职 7本科 8硕士 9博士 var importType if(['1'].indexOf(xxjd)!=-1){ importType = '1' }else if(['2'].indexOf(xxjd)!=-1){ importType = '2' }else if(['3'].indexOf(xxjd)!=-1){ importType = '3' }else if(['4'].indexOf(xxjd)!=-1){ importType = '4' } const formData = new FormData() formData.append('file', params.file) // 这是file入参,文件信息 formData.append('type', importType) // 这是file入参,文件信息 // 调接口 axios.post(`/www/public/shangbao/import_bj_info_new`, formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ that.$message.success(data.message) that.loading = false }else{ that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false that.$message.error('文件上传异常!') console.error(error); }); }, // customUpload(params,item) { var that = this that.loading = true var xxjd = localStorage.getItem('xxjd') //1小学 2初中 3高中 4中职 5高职 7本科 8硕士 9博士 var importType if(['1','2','3'].indexOf(xxjd)!=-1){ importType = '1' }else{ importType = '2' } // params是一个对象,包含了file和fileList, // 但是这个params参数可能每个版本不一样值就不一样,到时候自己打印看看, // 反正file的值就是原始的File对象 const formData = new FormData() console.log(params.file,'params.file') formData.append('file', params.file) // 这是file入参,文件信息 // 如果extraParams是个对象,循环加入formData for (const key in this.extraParams) { formData.append(key, this.extraParams[key]) } // 如果extraParams是个单独的值,直接加入 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var roles=user.UserFilter.urole // 调接口 axios.post(`/www/public/shangbao/addfiletemprecord?filetempid=${item.id}`, formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ that.$message.success(data.message) that.loading = false that.getList() }else{ that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false that.$message.error('文件上传异常!') console.error(error); }); }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.getList() }, exportFn1(){ var that = this //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { username:user.Username, djsmc:that.djsmc } axios({ method: 'get', url: '/www/public/shangbao/exportxqnxxdc', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', '辖区内学校管理员账号.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, teshudownload(item){ if(item.id==3||item.id==4||item.id==8){ const that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let data = { xxid:user.ID } $.post("/www/public/chouyang/sb_findzhxfzt", data, function(res){ if(res.error==0){ if(item.id==3){ that.XXexportFn('first') }else if(item.id==4){ that.XXexportFn('second') }else if(item.id==8){ that.xljkfzrdown() } }else{ that.$message.error(res.message) } }) } if(item.id==7){ const that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let data = { xxid:user.ID } $.post("/www/public/chouyang/sb_findbjxfzt", data, function(res){ if(res.error==0){ if(item.id==7){ that.bjxxdown() } }else{ that.$message.error(res.message) } }) } if(item.id==2){ this.exportFn1() }else if(item.id==1){ this.DexportFn() }else if(item.id==5){ this.YBXCYBJexportFn() }else if(item.id==6){ this.ptljurl() }else if(item.id==9){ this.downcyzyls() }else if(item.id==10){ this.cqzbdown() }else if(item.id==11){ this.ybxllymddown() } }, ybxllymddown(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { } axios({ method: 'get', url: '/www/public/download/xxgzzlly_byqybm_dc', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '样本校联络员名单.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败失败') } }) }, cqzbdown(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { schoolid : user.ID } axios({ method: 'get', url: '/www/public/shangbao/dccqzbzhff', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '【20241206】测前准备及参测师生账号分发说明(基教).pdf'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败失败') } }) }, downcyzyls(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { schoolid : user.ID } axios({ method: 'get', url: '/www/public/chouyang/sb-dczy', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '抽样专业列表.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }) }, bjxxdown(activeName){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { } var url = '/www/public/shangbao/exportbj_new' var name = '班级信息.xls' axios({ method: 'get', url, params: { schoolid }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, xljkfzrdown(activeName){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { } var url = '/www/public/shangbao/exportxxfzr' var name = '学校负责人登录账号.xls' axios({ method: 'get', url, params: { schoolid }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, ptljurl(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var xxjd = localStorage.getItem('xxjd') var schoolid = user.ID var type = '' if(['1'].includes(xxjd)){ type='1' }else if(['2','3','4'].includes(xxjd)){ type='2' }else if(['5','6'].includes(xxjd)){ type='3' } const params = { type } var url = '/www/public/shangbao/downloadUrl' var name = '全国学生心理健康监测与服务平台链接.url' axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, download(item){ var that = this let params = {} var name if(item.isupload=='1'){ params = { id :item.recordId, type:'2' } name = item.originFilename }else if(item.isupload=='2'){ params = { id :item.filetempid, type:'1' } name = item.filename } // window.open(item.file) axios({ method: 'get', url: '/www/public/shangbao/downloadtempFile', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, getFileTypeUrl(name){ var url = '' if(name){ var houzhui = this.gettype(name) if(houzhui=='pdf'){ url = '/content/image/xljkImg/pdf.png' }else if(houzhui=='xls'||houzhui=='xlsx'){ url = '/content/image/xljkImg/exceltubiao.png' }else if(houzhui=='jpg'||houzhui=='jpeg'||houzhui=='png'){ url = '/content/image/xljkImg/jpg.png' }else if(houzhui=='doc'||houzhui=='docx'){ url = '/content/image/xljkImg/word.png' }else{ url = '/content/image/xljkImg/qtwjlx.png' } } return url }, gettype(name){ var houzhui if(name){ var arr = name.split('.') houzhui = arr[1] } return houzhui }, getAccept(name){ var accept var houzhui = this.gettype(name) if(houzhui=='xls'||houzhui=='xlsx'){ accept = '.xls,.xlsx' }else if(houzhui=='doc'||houzhui=='docx'||houzhui=='pdf'||houzhui=='zip'){ accept = '.doc,.docx,.pdf,.zip' }else{ accept = '.zip' } return accept }, getList(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var type if(user.Roles.includes('450')){ var xd = localStorage.getItem('xxjd') if(['1','2','3','4'].includes(xd)){ type='1' }else{ type='2' } } const params = { type, } $.get("/www/public/shangbao/findfiletyperecord", params, function(res){ if(res.success==1){ that.loopData0 = res.data.filter(item=>item.sfsc=='0') that.loopData1 = res.data.filter(item=>item.sfsc=='1') that.loopData2 = res.data.filter(item=>item.sfsc=='2') that.loopData4 = res.data.filter(item=>item.sfsc=='4') }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, }, created: function(){ this.getList() }, computed:{ yuzhishuju(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var arr = [] if(user.Roles.includes('220')){ arr = [ {name:'市、区、县管理员账号.xls',id:1,img:"/content/image/xljkImg/excellogo.png"}, {name:'样本校名单及账号.xls',id:2,img:"/content/image/xljkImg/excellogo.png"}, //{name:'样本校抽样班级.xls',id:5,img:"/content/image/xljkImg/excellogo.png"}, {name:'样本校联络员名单.xls',id:11,img:"/content/image/xljkImg/excellogo.png"}, ] }else if(user.Roles.includes('450')){ var xxjd = localStorage.getItem('xxjd') if(['1','2','3'].includes(xxjd)){ arr = [ {name:'【20241206】测前准备及参测师生账号分发说明(基教).pdf',id:10,img:"/content/image/xljkImg/pdf.png"}, {name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, {name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, {name:'参测教师登录账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, {name:'学校负责人登录账号.xls',id:8,img:"/content/image/xljkImg/excellogo.png"}, {name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"} ] }else if(['5','6'].includes(xxjd)){ arr = [ // {name:'测前准备及参测师生账号分发说明.docx',id:10,img:"/content/image/xljkImg/word.png"}, {name:'抽样专业下载.xls',id:9,img:"/content/image/xljkImg/excellogo.png"}, {name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, {name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, {name:'老师测评账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, {name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"}, ] }else if(['4'].includes(xxjd)){ arr = [ {name:'【20241206】测前准备及参测师生账号分发说明(基教).pdf',id:10,img:"/content/image/xljkImg/pdf.png"}, {name:'抽样专业下载.xls',id:9,img:"/content/image/xljkImg/excellogo.png"}, {name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, {name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, {name:'参测教师登录账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, {name:'学校负责人登录账号.xls',id:8,img:"/content/image/xljkImg/excellogo.png"}, {name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"}, ] }else{ arr = [ // {name:'测前准备及参测师生账号分发说明.docx',id:10,img:"/content/image/xljkImg/word.png"}, {name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, {name:'参测教师登录账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, {name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, {name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"} ] } }else{ arr = [ {name:'样本校抽样班级.xls',id:5,img:"/content/image/xljkImg/excellogo.png"}, ] } return arr } }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-ftlearningCatalog-view", function(resolve, reject){ var template = "
\n
\n | 学习课程\n
\n\n
\n
\n
\n \n
\n
\n
\n

\n 安全防范实训指导培训课程\n

\n

\n 提高政治素养:增强教师的政治思想素质和职提高政治素养:增强教师的政治思想素质和职提高政治素养:增强教师的政治思想素质和职\n

\n
\n
\n \n 讲师:李宏伟\n
\n
\n \n 讲师:李宏伟\n
\n\n
\n 在线学习\n
\n
\n
\n
\n 学习目录\n
\n
\n 第一课:安全知识防范指导\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid() }; }, methods: { goBack(){ }, }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDxxsb-view", function(resolve, reject){ var template = "
\n \n
\n
\n
\n \"\"/\n

\n 信息上报\n

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), centerDialogVisible:false, jindu:{}, dialogVisible: false, xiafajindu:{}, isCheckedsdx:{issmcy:-1,shzt:''}, ybxshzt:{}, gzzzt:0 } }, methods: { getgzzshzt(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var gzzid = user.ID const params = { gzzid } $.get("/www/public/shangbao/gzz-getgzzshzt", params, function(res){ if(res.success==1){ that.gzzzt = res.data.gzzzt that.xgzt = res.data.xgzt }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ console.log(xhr,status,error) that.$message.error(error||'未知错误') }) }, getybxshzt(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} $.get("/www/public/shangbao/sdjyt-ybxxxhdcx", {username:user.Username}, function(res){ if(res.success==1){ that.ybxshzt = res.data }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ console.log(xhr,status,error) that.$message.error(error||'未知错误') }) }, handleClose(){ return true }, goshenhe(){ this.$refs.baseDialogXDjddc.show() }, confirm(){ this.$router.push('/XDjibenzigeshenhe') }, getxiafajindu(){ var that = this const params = { } $.get("/www/public/shangbao/findsfxfstate", params, function(res){ if(res.success==1){ that.xiafajindu = res.data }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, getIsCheckedsdx(){ var that = this const params = { } $.get("/www/public/shangbao/findschloolshztandsfsdx", params, function(res){ if(res.success==1){ console.log(res.data,'res.data') that.isCheckedsdx = res.data }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, getjindu(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID //xxid,pageno,pagesize const params = { xxid:schoolid, } $.get("/www/public/shangbao/cnt_sb_jd", params, function(res){ if(res.success==1){ that.jindu = res.data }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, showDialog(type){ if(!type) return if(type==1){ this.getgzzshzt() this.$refs.XDgongzuozuShangbaoDialog.show() } //学生 if(type==2){ this.$refs.XDxsxiSahngbaoDialog.show() } //教师 if(type==3){ this.$refs.XDjsxxShangbaoDialog.show() } //进度督查 if(type==5){ this.$refs.XDjinduduchaDialog.show() } //学校信息 if(type==6){ //this.$refs.XDxuexiaoxxDialog.show() if(!this.jindu.gzzcnt){ this.$alert('请先上报工作组信息', '提示', { confirmButtonText: '确定', }); return } /* if(this.gzzzt==0){ this.$alert('工作组信息未审核,不能进行后续操作!', '提示', { confirmButtonText: '确定', }); return } if(this.gzzzt==2){ this.$alert('工作组信息审核不通过,不能进行后续操作!', '提示', { confirmButtonText: '确定', }); return }*/ this.$router.push({ path:'/XDxuexiaoxxDialog', query:{ done:this.jindu.xxcnt, shzt:this.isCheckedsdx.cyzt } }) } if(type==4){ window.open('https://xinlijc.bnu.edu.cn/www/dd/vue/spa/zxbm#/') } }, chakan(type){ if(!type) return if(type==1){ this.getgzzshzt() this.$refs.XDgongzuozuShangbaoDialog.show() } //学生 if(type==2){ this.$refs.XDxsxiSahngbaoDialog.show() } //教师 if(type==3){ this.$refs.XDjsxxShangbaoDialog.show() } //访谈员 if(type==4){ this.$router.push('/XDftList') } //进度督查 if(type==5){ this.$refs.XDjinduduchaDialog.show() } //学校信息 if(type==6){ if(!this.jindu.gzzcnt){ this.$alert('请先上报工作组信息', '提示', { confirmButtonText: '确定', }); return } /* if(this.gzzzt==0){ this.$alert('工作组信息未审核,不能进行后续操作!', '提示', { confirmButtonText: '确定', }); return } if(this.gzzzt==2){ this.$alert('工作组信息审核不通过,不能进行后续操作!', '提示', { confirmButtonText: '确定', }); return }*/ this.$router.push({ path:'/XDxuexiaoxxDialog', query:{ done:this.jindu.xxcnt, shzt:this.isCheckedsdx.cyzt } }) //this.$refs.XDxuexiaoxxDialog.show() } //市、区县教育局账号下发 if(type==7){ this.$refs.XDxiafaDialog.show() } //直辖校账号下发 if(type==8){ this.$refs.XDzxxxiafaDialog.show() } //直辖校账号下发 if(type==9){ this.$refs.XDzxxxiafaDialog.show() } }, }, computed:{ shangbaoData(){ let list = [] //let user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} //type 1工作组信息上报 2学生信息 3教师信息 4访谈员上报 6学校信息上报 7市、区县教育局信息下发 8直辖校账号信息下发 9辖区内学校下发 if(user.Roles.includes('220')){ list = [ { title:'工作组人员信息上报', img:"/content/image/xljkImg/共享API接口备份.png", children:[ { img:"/content/image/xljkImg/共享API接口.png", title:"工作组人员信息上报", description:"请上传工作组人员相关信息", type:1, jindu:this.jindu.gzzstujyt, gzzcnt:this.jindu.gzzcnt, } ] }, { title:'样本校信息核对及修正', img:"/content/image/xljkImg/shangbao5.png", children:[ /*{ img:"/content/image/xljkImg/shangbao2.png", title:"市、区管理员账号下载并通知下发", description:"请导出账号信息发送给对应单位", type:7, xiafajindu:this.xiafajindu.sfxfsj }, { img:"/content/image/xljkImg/shangbao1.png", title:"直辖校信息下发", description:"请导出数据后发送给对应学校", type:8, xiafajindu:this.xiafajindu.sfxfzgx },*/ { img:"/content/image/xljkImg/shangbao1.png", title:"样本校信息核对及修正", description:"样本校名称、学段信息审核修正,是否存在上报", type:9, //xiafajindu:this.xiafajindu.isxqxx, ybxshzt:this.ybxshzt } ] }, ] } else if(user.Roles.includes('310')){ list = [ { title:'工作组人员信息上报', img:"/content/image/xljkImg/共享API接口备份.png", children:[ { img:"/content/image/xljkImg/共享API接口.png", title:"工作组人员信息上报", description:"请上传工作组人员相关信息", type:1, jindu:this.jindu.gzzstujyt, gzzcnt:this.jindu.gzzcnt, xiafajindu:this.xiafajindu.sfxfzgx } ] }, /*{ title:'教育局账号信息下发', img:"/content/image/xljkImg/shangbao5.png", children:[ { img:"/content/image/xljkImg/shangbao2.png", title:"区县教育局信息", description:"请下发区县教育局信息", type:7, jindu:this.jindu.lscnt, xiafajindu:this.xiafajindu.sfxfxj }, ] }, { title:'直辖校账号信息下发', img:"/content/image/xljkImg/shangbao4.png", children:[ { img:"/content/image/xljkImg/shangbao1.png", title:"直辖校信息", description:"请导出数据后发送给对应学校", type:8, jindu:this.jindu.ftcnt, xiafajindu:this.xiafajindu.sfxfzgx } ] },*/ ] } else if(user.Roles.includes('410')){ list = [ { title:'工作组人员信息上报', img:"/content/image/xljkImg/共享API接口备份.png", children:[ { img:"/content/image/xljkImg/共享API接口.png", title:"工作组人员信息上报", description:"请上传工作组人员相关信息", type:1, jindu:this.jindu.gzzstujyt, gzzcnt:this.jindu.gzzcnt, } ] }, /*{ title:'直辖校账号信息下发', img:"/content/image/xljkImg/shangbao4.png", children:[ { img:"/content/image/xljkImg/shangbao1.png", title:"直辖校信息", description:"请导出数据后发送给对应学校", type:8, jindu:this.jindu.ftcnt, xiafajindu:this.xiafajindu.sfxfzgx } ] },*/ ] } else if(user.Roles.includes('450')){ list = [ { title:'工作组人员信息上报', img:"/content/image/xljkImg/共享API接口备份.png", children:[ { img:"/content/image/xljkImg/共享API接口.png", title:"工作组人员信息上报", description:"请上传工作组人员相关信息", type:1, jindu:this.jindu.gzzstuxx, gzzcnt:this.jindu.gzzcnt, } ] }, { title:'学校信息上报', img:"/content/image/xljkImg/共享API接口备份.png", children:[ { img:"/content/image/xljkImg/共享API接口.png", title:"学校信息上报", description:"请上传学校相关信息", type:6, jindu:this.jindu.xxzt, xxcnt:this.jindu.xxcnt } ] }, ] /* if(this.isCheckedsdx.issmcy==1&&this.isCheckedsdx.shzt=='2'&&this.isCheckedsdx.cyzt=='2'){ list.push({ title:'学生信息上报', img:"/content/image/xljkImg/shangbao5.png", children:[ { img:"/content/image/xljkImg/shangbao3.png", title:"学生信息", description:"请上传学生信息", type:2, jindu:this.jindu.xscnt } ] }) } if(this.isCheckedsdx.issmcy==1&&this.isCheckedsdx.shzt=='2'&&this.isCheckedsdx.cyzt=='2'){ list.push({ title:'访谈员上报', img:"/content/image/xljkImg/shangbao4.png", children:[ { img:"/content/image/xljkImg/shangbao1.png", title:"访谈员信息", description:"请复制访谈员报名链接进行分享", type:4, jindu:this.jindu.ftcnt } ] }) }*/ } return list } }, created: function(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.type = this.$route.query.type this.getjindu() //this.getxiafajindu() this.getIsCheckedsdx() this.getgzzshzt() if(user.Roles.includes('220')){ this.getybxshzt() } }, mounted: function(){ this.showDialog(this.type) }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDshangbaoItems", function(resolve, reject){ var template = "
\n \n
\n
\n \"\"/\n\n

\n {{item.title}}\n

\n
\n
\n
\n
\n
\n
\n
\n
\n \n \n
\n
\n
\n \"\"/\n

\n 0\">\n 已上报\n \n \n 未上报\n \n

\n

=0\" style=\"margin-top:0.5vh;\" class=\"zhuangtai\">\n 未上报\n 已通过\n 未通过\n 待审核\n

\n
\n
\n

\n {{it.title}}\n

\n

\n {{it.description}}\n 已上报\n {{it.gzzcnt}}\n 人信息\n

\n
\n\n
\n
\t\n
\n
\n
\n
\n \"\"/\n

去上传

\n
\n 0\">查看\n
\n
\n\n
\n\n\n\n\n
\n
\n
\n \"\"/\n

=0\" style=\"margin-top:0.5vh;\" class=\"zhuangtai\">\n {{it.jindu>0?'已上报':'未上报'}}\n

\n
\n
\n

\n {{it.title}}\n

\n

\n {{it.description}}\n 已上报\n\n {{it.jindu}}\n 条数据\n

\n
\n\n
\n
\t\n
\n
\n
\n
\n \"\"/\n

去上传

\n
\n 0\">查看\n
\n
\n\n
\n \n
\n
\n
\n \"\"/\n

=0\" style=\"margin-top:0.5vh;\" class=\"zhuangtai\">\n {{it.jindu>0?'已上报':'未上报'}}\n

\n
\n
\n

\n {{it.title}}\n

\n

\n {{it.description}}\n 已上报\n {{it.jindu}}条数据\n

\n
\n
\n
\t\n
\n 复制报名链接\n
\n 查看\n
\n
\n
\n
\n \n
\n
\n
\n \"\"/\n

\n {{it.jindu}}\n

\n
\n
\n

\n {{it.title}}\n

\n

\n {{it.description}}\n 已完成\n {{it.xxcnt}} \n\n 步,共{{xxx}}步\n

\n
\n
\n\n
\t\n \n
\n\n
\n \"\"/\n

去完善

\n
\n 0\">查看\n
\n
\n
\n
\n
\n
\n \n
\n
\n

\n {{it.title}}\n

\n

\n {{it.description}}\n

\n
\n
\n
\t\n\n
\n 查看\n
\n
\n
\n
\n
\n
\n \"\"/\n

未完成\n

\n

已完成\n

\n
\n
\n

\n {{it.title}}\n

\n

\n {{it.description}}\n 已审核\n {{it.ybxshzt.y_shzt_total}} \n 未审核\n {{it.ybxshzt.d_shzt_total}} \n\n \n

\n
\n
\n
\t\n
\n
\n 下载参测学校名单\n
\n
\n 去审核\n
\n \n
\n
\n
\n
\n
\n
\n \n
\n

\n 已复制链接,请分享给访谈员报名\n

\n 确定\n
\n
\n \n
\n
\n
\n

\n {{item.name}}\n

\n
\n

\n {{it.fileName}}\n

\n 下载\n
\n\n
\n 全部资料下载\n
\n \n
\n
\n
\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), xxx:0, listData:[] }; }, methods: { downloadALL(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var name = '全部资料.zip' const params = { } axios({ method: 'get', url: '/www/public/shangbao/filedownloadListZip', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, showDownload(){ this.$refs.shangbaozhunbeiziliao.show() this.getDownloadList() }, getDownloadList(){ var that = this const params = { } $.get("/www/public/shangbao/findfiledownloadList", params, function(res){ if(res.success==1){ that.listData = res.data }else{ that.$message.error('文件列表获取失败') } }).fail((xhr,status,error)=>{ that.$message.error('未知错误') }) }, exportFn(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var type var name = user.Nickname if(name&&name.length){ name = name.substring(0,name.length-3) } //type 1省 2市 3区县 if(user.Roles.includes('220')){ type='1' }else if(user.Roles.includes('310')){ type='2' }else if(user.Roles.includes('410')){ type='3' } const params = { username:user.Username, } /*const params = { //zgdwbm:user.ID, shzt:that.activeName=='first'?'0':this.activeName=='second'?'1':'-1', type, username:user.Username }*/ axios({ method: 'get', url:'/www/public/shangbao/dcdqrxx', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name+'样本校.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, download(item){ var that = this const params = { type:item.type } axios({ method: 'get', url:item.jk, params: { ...params }, responseType: 'blob' }).then(res=>{ console.log(res.data) if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', item.fileName); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败1') } }).catch(err=>{ this.$message.error('导出失败1') }) }, goshenhe(){ this.$emit("goshenhe") }, getImg(it){ var url = '/content/image/xljkImg/weikaishi.png' if(it.jindu){ var jindu = it.jindu if(jindu>0){ url = '/content/image/xljkImg/yikaishi.png' }else if(jindu<0){ url = '/content/image/xljkImg/共享API接口.png' } } return url }, getImg1(it){ var url = '' if(it.xiafajindu){ var jindu = it.xiafajindu if(jindu==1){ url = '/content/image/xljkImg/yikaishi.png' }else if(jindu==2){ url = '/content/image/xljkImg/weikaishi.png' } } if(it.type==9){ if(it.ybxshzt.zt==0){ url = '/content/image/xljkImg/weikaishi.png' }else{ url = '/content/image/xljkImg/yikaishi.png' } } return url }, goupload(type){ this.$emit("showUploadDialog",type) }, chakan(type){ this.$emit("chakan",type) }, fuzhi(){ var copyText = document.getElementById("textToCopy"); copyText.select(); document.execCommand("Copy"); this.$refs.tishifuzhichenggong.show() }, closetishi(){ this.$refs.tishifuzhichenggong.close() }, }, computed:{ }, created: function(){ this.user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var xxjd = localStorage.getItem('xxjd') if(['1','2','3','4'].includes(xxjd)){ this.xxx = 3 }else{ this.xxx = 3 } }, mounted: function(){ }, props: ['title', 'data', 'config',"Ddata","gzzzt"] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDxsxiSahngbaoDialog", function(resolve, reject){ var template = "
\n \n \n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), loading:false, dialogVisible: false, tableData: [], multipleSelection: [], currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4, innerVisible:false, classList:[], total:0, pages:{ pageNo:1, pageSize:5 }, reruleForm: { xm:'',xb:'',xjh:'',yx:'',rxnf:'',bj:'',zy:'',xxjd:'',xh:'',dh:'' }, ruleForm: { xm:'',xb:'',xjh:'',yx:'',rxnf:'',bj:'',zy:'',xxjd:'',xh:'',dh:'' }, rules: { xm: [ { required: true, message: '请输入学生姓名', trigger: 'blur' } ], xb: [ { required: true, message: '请选择学生性别', trigger: 'blur' } ], xjh: [ { required: true, message: '请输入学籍号', trigger: 'blur' } ], dh: [ { validator: publicUtilsOfCheck.isValidPhoneNumber, trigger: 'blur' } ], yx: [ { required: true, message: '请输入邮箱', trigger: 'blur' }, { validator: publicUtilsOfCheck.validateEmail, trigger: 'blur' } ], rxnf: [ { required: true, message: '请选择学生入学年份', trigger: 'blur' } ], bj: [ { required: true, message: '请输入班级', trigger: 'blur' } ], zy: [ { required: true, message: '请输入学生专业', trigger: 'blur' } ], xxjd: [ { required: true, message: '请选择学校阶段', trigger: 'blur' } ], xh: [ { required: true, message: '请输入学号', trigger: 'blur' } ], }, isEdit:false } }, methods:{ handlebeforeClose(){ this.$emit('closeDialog') }, exportFn(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { schoolid, } axios({ method: 'get', url: '/www/public/shangbao/exportStudent', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '学生数据.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, customUpload(params) { var that = this that.loading = true var xxjd = localStorage.getItem('xxjd') //1小学 2初中 3高中 4中职 5高职 7本科 8硕士 9博士 var importType if(['1','2','3'].indexOf(xxjd)!=-1){ importType = '1' }else if(xxjd=='4'){ importType = '2' }else{ importType = '3' } // params是一个对象,包含了file和fileList, // 但是这个params参数可能每个版本不一样值就不一样,到时候自己打印看看, // 反正file的值就是原始的File对象 const formData = new FormData() console.log(params.file,'params.file') formData.append('file', params.file) // 这是file入参,文件信息 // 如果extraParams是个对象,循环加入formData for (const key in this.extraParams) { formData.append(key, this.extraParams[key]) } // 如果extraParams是个单独的值,直接加入 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var roles=user.UserFilter.urole // 调接口 axios.post(`/www/public/shangbao/studentImport?importType=${importType}&roles=${roles}&uuuid=${schoolid}`, formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ that.$message.success(data.message) that.loading = false that.getStu() }else{ that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false console.error(error); }); }, handleImportExcel(val){ console.log(val,'val') }, onError(){}, download(){ var that = this var xxjd = localStorage.getItem('xxjd') //4小初高,5中高职本硕博 var type switch (xxjd) { case '1': type='01' break; case '2': type='02' break; case '3': type='03' break; case '4': type='04' break; case '5': type='05' break; case '6': type='06' break; default: // 如果 expression 不匹配任何 case 值,则执行 default 子句中的代码块 break; } const params = { type, } axios({ method: 'get', url: '/www/public/shangbao/dclsxsmb', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '学生导入模版.xlsx'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, del(row){ var that = this const params = { stuId:row.id, } $.get("/www/public/shangbao/deleteStudent", params, function(res){ if(res.success==1){ that.$message.success('删除成功') that.getStu() }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ that.$message.success('请求错误') }) }, handleEdit(row){ this.$refs.baseDialog1.show() this.$nextTick(()=>{ this.$refs.ruleForm.resetFields() this.ruleForm = {} this.ruleForm = {...row} this.isEdit = true }) }, submit(){ var that = this this.$refs['ruleForm'].validate((valid) => { if (valid) { var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var xxmc = user.Nickname const params = { schoolid,xxmc,...this.ruleForm } if(!this.ruleForm.id){ $.post("/www/public/shangbao/addStudent", params, function(res){ if(res.success==1){ that.$message.success(res.message) that.$refs.baseDialog1.close() that.getStu() }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ console.log(error,'error') this.$message.error('请求错误') }) }else{ $.post("/www/public/shangbao/editStudent", params, function(res){ if(res.success==1){ that.$message.success(res.message) that.$refs.baseDialog1.close() that.getStu() }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ console.log(error,'error') this.$message.error('请求错误') }) } } else { console.log('error submit!!'); return false; } }); }, handleAdd(){ this.$refs.baseDialog1.show() this.$nextTick(()=>{ this.$refs.ruleForm.resetFields() this.ruleForm = {...this.reruleForm} this.isEdit = false }) }, show(){ this.getClass() this.getStu() this.$refs.baseDialog.show() }, getStu(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { schoolid, ...this.pages } $.get("/www/public/shangbao/findStudent", params, function(res){ if(res.success==1){ that.tableData = res.data that.total = res.total }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{ this.$message.error('请求错误') }) }, handleConfirm(){ this.$refs.baseDialog.close() }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.getStu() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.getStu() }, handleClick(){}, handleClose(){ console.log(1) this.dialogVisible = false }, toggleSelection(rows) { if (rows) { rows.forEach(row => { this.$refs.multipleTable.toggleRowSelection(row); }); } else { this.$refs.multipleTable.clearSelection(); } }, handleSelectionChange(val) { this.multipleSelection = val; }, getClass(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { schoolid } $.get("/www/public/shangbao/findschoolbj", params, function(res){ if(res.success==1){ that.classList = res.data }else{ this.$message.error(res.message) } }).fail((xhr,status,error)=>{ this.$message.error('请求错误') }) }, }, computed:{ isXCG(){ if(['1','2','3'].indexOf(this.ruleForm.xxjd)!=-1){ return true } return false } }, watch:{ "ruleForm.xxjd"(val){ if(['1','2','3'].indexOf(val)!=-1){ this.ruleForm.xh = '' this.ruleForm.zy = '' }else{ this.ruleForm.xjh = '' } } }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDjsxxShangbaoDialog", function(resolve, reject){ var template = "
\n \n \n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), loading:false, dialogVisible: false, tableData: [], multipleSelection: [], currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4, innerVisible:false, classList:[], total:0, pages:{ pageNo:1, pageSize:5 }, reruleForm: { xm:'',xb:'',lxfs:'',sfbzr:'',sfxlls:'',sfxxfzr:'',sfxxfzr:'',yx:'',xd:'', }, ruleForm: { xm:'',xb:'',lxfs:'',sfbzr:'',sfxlls:'',sfrkjs:'',sfxxfzr:'',yx:'',xd:'', }, user:null, rules: { xm: [ { required: true, message: '请输入学生姓名', trigger: 'blur' } ], xb: [ { required: true, message: '请选择学生性别', trigger: 'change' } ], lxfs: [ { required: true, message: '请输入联系方式', trigger: 'blur' }, { validator: publicUtilsOfCheck.isValidPhoneNumber, trigger: 'blur' } ], sfbzr: [ { required: true, message: '请选择是否班主任', trigger: 'change' } ], sfxlls: [ { required: true, message: '请选择是否心理老师', trigger: 'change' } ], sfrkjs: [ { required: true, message: '请选择是否任课老师', trigger: 'blur' } ], sfxxfzr: [ { required: true, message: '请选择是否学校负责人', trigger: 'change' } ], yx: [ { required: true, message: '请输入邮箱', trigger: 'blur' }, { validator: publicUtilsOfCheck.validateEmail, trigger: 'blur' } ], xd: [ { required: true, message: '请选择授课阶段', trigger: 'change' } ], glbj: [ { required: true, message: '请输入管理班级', trigger: 'blur' } ], }, isEdit:false } }, methods:{ handlebeforeClose(){ this.$emit('closeDialog') }, exportFn(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { schoolid, } axios({ method: 'get', url: '/www/public/shangbao/exportteather', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '学生数据.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, customUpload(params) { var that = this that.loading = true var xxjd = localStorage.getItem('xxjd') //1小学 2初中 3高中 4中职 5高职 7本科 8硕士 9博士 var importType if(['1','2','3'].indexOf(xxjd)!=-1){ importType = '1' }else{ importType = '2' } // params是一个对象,包含了file和fileList, // 但是这个params参数可能每个版本不一样值就不一样,到时候自己打印看看, // 反正file的值就是原始的File对象 const formData = new FormData() console.log(params.file,'params.file') formData.append('file', params.file) // 这是file入参,文件信息 // 如果extraParams是个对象,循环加入formData for (const key in this.extraParams) { formData.append(key, this.extraParams[key]) } // 如果extraParams是个单独的值,直接加入 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var roles=user.UserFilter.urole // 调接口 axios.post(`/www/public/shangbao/teacherImport?importType=${importType}&roles=${roles}&uuuid=${schoolid}`, formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ that.$message.success(data.message) that.loading = false that.getList() }else{ that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false console.error(error); }); }, onError(){}, download(){ var that = this var xxjd = localStorage.getItem('xxjd') var importType //4小初高,5中高职本硕博 if(['1','2','3'].indexOf(xxjd)!=-1){ downloadtype = '4' }else{ downloadtype = '5' } const params = { type:downloadtype, } axios({ method: 'get', url: '/www/public/shangbao/dclsxsmb', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '老师导入模版.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, del(row){ var that = this const params = { teaId:row.id, } $.post("/www/public/shangbao/deleteteather", params, function(res){ if(res.success==1){ that.$message.success('删除成功') that.getList() }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{}) }, handleEdit(row){ this.$refs.baseDialog1js.show() this.$nextTick(()=>{ this.$refs.ruleForm.resetFields() this.ruleForm = {...row} this.isEdit = true }) }, submit(){ var that = this this.$refs['ruleForm'].validate((valid) => { if (valid) { var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var xxmc = user.Nickname const params = { xxid:schoolid,xxmc,...this.ruleForm } if(!this.ruleForm.id){ $.post("/www/public/shangbao/addteather", params, function(res){ if(res.success==1){ that.$message.success(res.message) that.$refs.baseDialog1js.close() that.getList() }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) }else{ $.post("/www/public/shangbao/editteather", params, function(res){ if(res.success==1){ that.$message.success(res.message) that.$refs.baseDialog1js.close() that.getList() }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) } } else { console.log('error submit!!'); return false; } }); }, handleAdd(){ this.$refs.baseDialog1js.show() this.$nextTick(()=>{ this.$refs.ruleForm.resetFields() console.log(this.reruleForm) this.ruleForm = {...this.reruleForm} this.isEdit = false }) }, show(){ this.getList() this.$refs.baseDialogjs.show() }, getList(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { schoolid, ...this.pages } $.get("/www/public/shangbao/findteather", params, function(res){ if(res.success==1){ that.tableData = res.data that.total = res.total }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, handleConfirm(){ this.$refs.baseDialogjs.close() }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.getList() }, handleClick(){}, handleClose(){ console.log(1) this.dialogVisible = false }, toggleSelection(rows) { if (rows) { rows.forEach(row => { this.$refs.multipleTable.toggleRowSelection(row); }); } else { this.$refs.multipleTable.clearSelection(); } }, handleSelectionChange(val) { this.multipleSelection = val; } }, computed:{ isXCG(){ if(['1','2','3'].indexOf(this.ruleForm.xxjd)!=-1){ return true } return false } }, watch:{ "ruleForm.xxjd"(val){ if(['1','2','3'].indexOf(val)!=-1){ this.ruleForm.xh = '' }else{ this.ruleForm.xjh = '' } } }, created: function(){ this.user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-ftschedule-view", function(resolve, reject){ var template = "
\n
\n | 返回首页\n
\n
\n

\n 安全防范实训指导培训课程进度表\n

\n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), reverse: true, dataList:[], }; }, methods: { getList(){ const that =this let data = { } $.post("/www/public/shouye/px_fty_cx_xxjd", data, function(res){ if(res.error==0){ that.dataList = res.data }else{ that.$message({ type: "error", message: res.message }) } }) }, goBack(){ this.$router.push('ftInterviewHomepage') }, }, created: function(){ }, mounted: function(){ const that =this that.getList() }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDHomePage-view", function(resolve, reject){ var template = "
\n \n
\n \n

\n 请务必在学生测试场地测试答题!\n

\n
\n \n \n \n \n \n \n \n \n \n \n
\n 确 定\n
\n
\n
\n \n
\n

\n 欢迎您! \n

\n

\n {{Nickname}}! \n

\n
\n \n
\n
\n
\n\n\n
\n 未 开 始\n
\n
\n 进 行 中\n
\n
\n 已 完 成\n
\n
\n 未 上 报\n
\n
\n 已 通 过\n
\n
\n 已 完 成\n
\n
\n 未 通 过\n
\n
\n 待 审 核\n
\n
\n 进 行 中 \n
\n
\n 未 读\n
\n
\n 已 读\n
\n
\n 未 读\n
\n
\n 已 读\n
\n
\n 未 上 传\n
\n
\n 已 上 传\n
\n
\n 未 上 传\n
\n
\n 已 上 传\n
\n
\n 未 生 成\n
\n
\n 可 下 载\n
\n
\n 已 下 载\n
\n
\n 未 测 试\n
\n
\n 已 测 试\n
\n \n

\n {{item.title}}\n

\n

\n {{item.description}}\n

\n
\n
\n
\n
\n
\n 未 开 始\n
\n
\n 进 行 中\n
\n
\n 已 完 成\n
\n
\n 未 上 报\n
\n
\n 已 通 过\n
\n
\n 已 完 成\n
\n
\n 未 通 过\n
\n
\n 待 审 核\n
\n
\n 进 行 中 \n
\n
\n 未 读\n
\n
\n 已 读\n
\n
\n 未 读\n
\n
\n 已 读\n
\n
\n 未 上 传\n
\n
\n 已 上 传\n
\n
\n 未 上 传\n
\n
\n 已 上 传\n
\n
\n 未 生 成\n
\n
\n 可 下 载\n
\n
\n 已 下 载\n
\n
\n 未 测 试\n
\n
\n 已 测 试\n
\n
\n \n
\n\n
\n
\n {{item.title}}\n
\n
\n {{item.description}}\n
\n
\n
\n
\n\n\n \n
\n
\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { jihuabiao:[], butList:[], active:0, tzggList:[], acitveName:1, value:'', reverse: false, crq:'', rqList:[], currentList:[], dialogVisible:false, formLabelWidth: '120px', xxsbjg:'0', sjrwjg:'0', skewedShow:'0', zlscjg:'0', zhxzjg:'0', zdcsjg:'0', glyxm:'', xxjd:'', yhjs:[], loading:false, form: { sjhm:'', }, rules: { sjhm: [ { required: true, message: '请输入手机号', trigger: 'blur' }, { validator: publicUtilsOfCheck.isValidPhoneNumber, trigger: 'blur' } ], } }; }, methods: { tijiao(formName){ var that = this this.$refs[formName].validate((valid) => { if (valid) { let that = this; const params = { sjhm:that.form.sjhm } $.post('/www/public/shouye/mima_update_mobile',params, function(msg){ if(msg.success == 1){ that.$message.success('联络人手机号已更新') that.$refs.lianluorenshoujihao.close() window.isfirstLogin = false } else { that.$message({ type: 'error', message: msg.message }); } }); } }) }, getjihuabiao(leibie){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var type if(user.Roles.includes('220')){ type = '1' }else if(user.Roles.includes('310')){ type = '2' }else if(user.Roles.includes('410')){ type = '3' }else if(user.Roles.includes('450')){ if(that.xxjd<5){ console.log(that.xxjd) type = '4' }else{ type = '5' } } const params = { type, jd:leibie } console.log(params,'params') $.get("/www/public/shangbao/findsysxlist", params, function(res){ if(res.success==1){ if(res.data){ that.jihuabiao = res.data }else{ that.$message.error('待办事项列表获取失败') } }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{}) }, changeactiveName(val = 1){ this.acitveName = val var leibie if(val==1){ leibie = '测前准备' } if(val==2){ leibie = '测试期间' } if(val==3){ leibie = '测试结束' } this.getjihuabiao(leibie) }, getStuListDft(){ var that = this const params = { bj:'', zy:'', schoolid:this.schoolid, userid:this.schoolid, yhjs:JSON.stringify([this.yhjs]), ftzt:'0' } console.log(params,'params') $.post("/www/public/shouye/ft_ftyystu", params, function(res){ if(res.success==1){ if(res.data.length){ that.$alert('无访谈老师,无法预约!', '提示', { confirmButtonText: '确定', center: true }).then(() => { that.loading=false }).catch(() => { that.loading=false }); }else{ that.$alert('无访谈老师和访谈学生,无法预约!', '提示', { confirmButtonText: '确定', center: true }).then(() => { that.loading=false }).catch(() => { that.loading=false }); } }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, getList(){ var that = this const params = { schoolid:this.schoolid } console.log(params,'params') $.post("/www/public/shouye/ft_ftlslist", params, function(res){ if(res.success==1){ if(res.data.length){ that.$router.push({ path:'/XDyuyue' }) }else{ that.getStuListDft() } }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, getStuList(){ var that = this if(that.loading) return that.loading = true const params = { schoolid:this.schoolid, userid:this.schoolid, yhjs:JSON.stringify(this.yhjs), ftzt:'1', ...this.pages } console.log(params,'params') $.post("/www/public/shouye/ft_ftyystu", params, function(res){ if(res.success==1){ if(res.data.length){ that.$router.push({ path:'/XDyyft' }) } else{ that.getList() } }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, handleConfirm(){ const that = this $.get("/www/public/cpgl/getBaseSj", {}, function(res){ if(res.error==0){ that.$router.push(`/beforeEvaluations?gaugeId=${res.data.xxy}`); }else{ } }) }, logout(){ localStorage.removeItem('user') this.$store.commit('user',undefined) this.$router.replace('/login') }, save() { const that = this that.$refs.formRef.validate((valid) => { if (valid) { const id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:'' let data = { xxyid:that.dataStatus?id:'', ...that.form } $.post("/www/public/shangbao/addjfxx", data, function(res){ if(res.error==0){ that.$message.success('提交成功') that.dialogVisible =false }else{ that.$message.error(res.message) } }) } else { console.error('表单验证失败'); return false; } })}, goPage(url){ var that = this if(url){ if(url.indexOf('beforeEvaluations')!=-1){ that.$alert( '请务必在机房测试答题!','作答测试注意事项', { confirmButtonText: '确定', center: true }).then(() => { that.handleConfirm() }).catch(() => { });; //this.$refs.zuodaceshitishi.show() }else if(url.indexOf('XDyyft')!=-1){ this.getStuList() } else{ this.$router.push(url) } }else{ this.dialogVisible =true } }, getImgsrc:function(val) { return "/content/image/xljkImg/"+val }, getIndex(index){ this.active = index }, onPanelChange(value, mode) { console.log(value, mode); }, getDay(val){ if(this.rqList.length>0){ if(val.type=='current-month'){ //this.currentList.push(val.day) } if(val.type=='current-month'&&this.rqList.indexOf(val.day)>=0){ return true }else{ return false } } }, getDate(val){ //console.log(this.currentList) this.crq = val this.getdb() }, //获取待办 getdb:function(){ let that = this //$.post("/www/py/fwpt/test", {crq:this.crq}, function(res){ $.post("/www/py/fwpt/user_event", {crq:this.crq}, function(res){ if(res.success==1){ if(res.data.data){ that.tzggList = res.data.data that.rqList = res.data.rq } } }) }, //获取学段 getxxjd(){ const that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params1 = { schoolid } $.get("/www/public/shangbao/findschoolxd", params1, function(res){ if(res.success==1){ that.xxjd=res.data.xd localStorage.setItem('xxjd',res.data.xd) that.getjihuabiao("测前准备") }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, glyxmget(){ var glyInfo = localStorage.getItem('glyInfo')?JSON.parse(localStorage.getItem('glyInfo')):{} this.glyxm = glyInfo.glyxm }, }, computed:{ user(){ return this.$store.state.user }, buttomList(){ let list = [] console.log(this.$store.state,'state') var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} console.log(this.user,'user') //220省310市410区县 //if(this.user&&this.user.Roles){ if(user.Roles.includes('220')){ list = [ //{ // img:'/content/image/xljkImg/人员上报.png', // title:"信息上报", // description:"工作组信息上报及样本校名单确认", // background:"radial-gradient( 0% 100% at 0% 0%, #2C79F9 0%, #56ADFF 100%)", // url:"/XDxxsb" //}, { img:'/content/image/xljkImg/资料下载.png', title:"信息审核", description:"工作组信息审核,直属校信息审核", background:"linear-gradient( 180deg, #8564FF 0%, #918DFF 100%)", url:"/XDzigeshenhehome" }, { img:'/content/image/xljkImg/进度督查.png', title:"进度查看", description:"下级单位上报、测评查看", background:"radial-gradient( 0% 100% at 0% 0%, #00B8CD 0%, #24D4B9 100%)", url: "/jinduchakan" }, /*{ img:'/content/image/xljkImg/shangjirenwu.png', title:"任务收发", description:"给本级或下级单位发布任务,查看任务完成情况", background:"radial-gradient( 0% 95% at 0% 0%, #FF7E27 0%, #FFAA41 100%)", url:"/taskList" },*/ { img:'/content/image/xljkImg/baogaoshangchuan.png', title:"上传下载", description:"各类资料上传、下载", background:"radial-gradient( 0% 100% at 0% 0%, #2C79F9 0%, #56ADFF 100%)", url:"/XDzlxz1" }, /*{ img:'/content/image/xljkImg/通知公告.png', title:"通知公告", description:"查看本级通知,给本级及下级发送通知", background:"radial-gradient( 0% 95% at 0% 0%, #3067FF 0%, #6095FF 100%)", url:"/XDnotice" },*/ ] }else if(user.Roles.includes('410')){ list = [ //{ // img:'/content/image/xljkImg/人员上报.png', // title:"信息上报", // description:"工作组信息上报", // background:"radial-gradient( 0% 100% at 0% 0%, #2C79F9 0%, #56ADFF 100%)", // url:"/XDxxsb" //}, /*{ img:'/content/image/xljkImg/资料下载.png', title:"信息审核", description:"学校上报信息审核", background:"linear-gradient( 180deg, #8564FF 0%, #918DFF 100%)", url:"/XDzigeshenhehome" },*/ { img:'/content/image/xljkImg/进度督查.png', title:"进度查看", //description:"下级单位上报、测评查看", description:"测评进度、上传文件查看", background:"radial-gradient( 0% 100% at 0% 0%, #00B8CD 0%, #24D4B9 100%)", url:"/jinduchakan" }, /*{ img:'/content/image/xljkImg/shangjirenwu.png', title:"任务收发", description:"给本级或下级单位发布任务,查看任务完成情况", background:"radial-gradient( 0% 95% at 0% 0%, #FF7E27 0%, #FFAA41 100%)", url:"/taskList" },*/ { img:'/content/image/xljkImg/baogaoshangchuan.png', title:"上传下载", description:"各类资料上传、下载", background:"radial-gradient( 0% 100% at 0% 0%, #2C79F9 0%, #56ADFF 100%)", url:"/XDzlxz1" }, /*{ img:'/content/image/xljkImg/通知公告.png', title:"通知公告", description:"查看上级通知,给本级及下级发送通知", background:"radial-gradient( 0% 95% at 0% 0%, #3067FF 0%, #6095FF 100%)", url:"/XDnotice" }*/ ] }else if(user.Roles.includes('310')){ list = [ /* { img:'/content/image/xljkImg/人员上报.png', title:"信息上报", description:"工作组信息上报", background:"radial-gradient( 0% 100% at 0% 0%, #2C79F9 0%, #56ADFF 100%)", url:"/XDxxsb" },*/ /*{ img:'/content/image/xljkImg/资料下载.png', title:"信息审核", description:"学校上报信息审核", background:"linear-gradient( 180deg, #8564FF 0%, #918DFF 100%)", url:"/XDzigeshenhehome" },*/ { img:'/content/image/xljkImg/进度督查.png', title:"进度查看", //description:"下级单位上报、测评查看", description:"测评进度、上传文件查看", background:"radial-gradient( 0% 100% at 0% 0%, #00B8CD 0%, #24D4B9 100%)", url:"/jinduchakan" }, /*{ img:'/content/image/xljkImg/shangjirenwu.png', title:"任务收发", description:"给本级或下级单位发布任务,查看任务完成情况", background:"radial-gradient( 0% 95% at 0% 0%, #FF7E27 0%, #FFAA41 100%)", url:"/taskList" },*/ { img:'/content/image/xljkImg/baogaoshangchuan.png', title:"上传下载", description:"各类资料上传、下载", background:"radial-gradient( 0% 100% at 0% 0%, #2C79F9 0%, #56ADFF 100%)", url:"/XDzlxz1" }, /*{ img:'/content/image/xljkImg/通知公告.png', title:"通知公告", description:"查看上级通知,给本级及下级发送通知", background:"radial-gradient( 0% 95% at 0% 0%, #3067FF 0%, #6095FF 100%)", url:"/XDnotice" }*/ ] } else if(user.Roles.includes('450')){ list = [ /* { img:'/content/image/xljkImg/人员上报.png', title:"信息上报", description:"学校、学生信息上报", background:"radial-gradient( 0% 100% at 0% 0%, #2C79F9 0%, #56ADFF 100%)", url:"/XDxxsb" }, { img:'/content/image/xljkImg/zhanghaoxiazai.png', title:"账号下载", description:"学生、老师账号下载", background:"radial-gradient( 0% 95% at 0% 0%, #FF7E27 0%, #FFAA41 100%)", url:"/stuIssued" }, { img:'/content/image/xljkImg/yuyuefangtan.png', title:"预约访谈", description:"帮助学生预约访谈老师", background:"radial-gradient( 0% 100% at 0% 0%, #00B8CD 0%, #24D4B9 100%)", url:"/XDyyft" },*/ { img:'/content/image/xljkImg/jinduchakan.png', title:"进度查看", description:"学校测评进度查看", background:"linear-gradient( 180deg, #8564FF 0%, #918DFF 100%)", url: '/XDjddc?type=third' // "/jinduchakan" }, { img:'/content/image/xljkImg/xsbg.png', title:"学生报告", description:"解决学生心理问题", background:"radial-gradient( 0% 100% at 0% 0%, #2C79F9 0%, #56ADFF 100%)", url: '/xsbg' }, { img:'/content/image/xljkImg/xuexiaobg.png', title:"学校报告", description:"学生测试进度,一目了然", background:"radial-gradient( 0% 95% at 0% 0%, #FF7E27 0%, #FFAA41 100%)", url: '/baogaotubiao' }, /*{ img:'/content/image/xljkImg/通知公告.png', title:"通知公告", description:"查看上级通知,给本级及下级发送通知", background:"linear-gradient( 180deg, #8564FF 0%, #918DFF 100%)", url:"/XDnotice" }, { img:'/content/image/xljkImg/shangjirenwu.png', title:"上级任务", description:"上级下发的任务查看、反馈", background:"radial-gradient( 0% 95% at 0% 0%, #FF7E27 0%, #FFAA41 100%)", url:"/taskList" }, { img:'/content/image/xljkImg/jscp.png', title:"作答测试", description:"作答环境测试", background:"radial-gradient( 0% 100% at 0% 0%, #00B8CD 0%, #24D4B9 100%)", url:"/beforeEvaluations?gaugeId=45ca7c69-37db-4e35-bd89-442577c07e48" },*/ /* { img:'/content/image/xljkImg/baogaoshangchuan.png', title:"上传下载", description:"各类资料上传、下载", background:"radial-gradient( 0% 100% at 0% 0%, #2C79F9 0%, #56ADFF 100%)", url:"/XDzlxz1" },*/ ] } //} return list } }, created: function(){ const that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} if(user.Roles.includes('450')){ this.getxxjd() } this.getdb() this.Nickname = user.Nickname this.user = user this.schoolid = this.user.ID this.yhjs = this.user.Roles $.post("/www/public/shangbao/findtaskbyrolesl", {}, function(res){ if(res.success==1){ that.sjrwjg =res.data.sjrwjg that.xxsbjg=res.data.xxsbjg that.skewedShow=res.data.zgscjg that.zlscjg =res.data.zlscjg that.zhxzjg=res.data.zhxzjg that.zdcsjg = res.data.zdcsjg }else{ } }) }, mounted: function(){ this.changeactiveName(this.acitveName) setTimeout(()=>{ this.changeactiveName(this.acitveName) },1000) setTimeout(()=>{ this.changeactiveName(this.acitveName) },2000) }, props: ['title', 'data', 'config','isHeight'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDyyft111-view", function(resolve, reject){ var template = "
\n \n
\n
\n
\n \n

\n 预约访谈\n

\n
\n \n \n\n\n
\n
\n
\n
\n 全部\n
\n
\n 未预约\n
\n
\n 已约满\n
\n
\n
\n
\n \n
\n
\n
\n
\n

\n {{item.name}}\n

\n 初级访谈\n
\n

\n {{item.gzms}}\n

\n
\n 立即预约\n
\n
\n
\n
\n \n

\n 电话:{{item.phone}}\n

\n
\n \n
\n \n

\n 专业:{{item.zy}}\n

\n
\n
\n
\n\n \n
\n \n

\n 职务:哲学院副院长\n

\n
\n
\n \n

\n 擅长:心理访谈\n

\n
\n
\n
\n\n
\n
-->\n \n
\n \n \n\n\n
\n
\n\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), ftsj:new Date(), yyzt:'', pages:{ pagesize:10, pagenum:1, }, listData:[], user:null, currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4 }; }, methods: { formatDate(date) { const year = date.getFullYear(); const month = (date.getMonth() + 1).toString().padStart(2, '0'); const day = date.getDate().toString().padStart(2, '0'); return `${year}-${month}-${day}`; }, handleDateChange(val){ console.log(val,'va;') this.getList() }, changeYyzt(val){ this.yyzt = val this.getList() }, getList(){ var that = this const params = { ftsj:this.formatDate(this.ftsj), yyzt:this.yyzt, ...this.pages, schoolid:this.schoolid } console.log(params,'params') $.post("/www/public/shouye/ft_ftyyls", params, function(res){ if(res.success==1){ that.listData = res.data }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, goyuyue(item){ this.$router.push({ path:"/XDyuyue", query:{ item:JSON.stringify(item) } }) }, handleSizeChange(val) { console.log(`每页 ${val} 条`); }, handleCurrentChange(val) { console.log(`当前页: ${val}`); } }, created: function(){ this.user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.schoolid = this.user.ID this.getList() }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDyuyue-view", function(resolve, reject){ var template = "
\n \n
\n
\n
\n \n

\n 点击选择访谈老师\n

\n
\n
\n \n
\n

\n {{item.name}}\n

\n

\n 常见的轻中度抑郁症、焦虑症、疑病症、恐惧症、强迫症心理疏导\n

\n
\n\n
\n
\n
\n
\n \n
\n
\n
\n
\n

\n {{cur.name}}\n

\n 已选择访谈老师\n
\n

\n 常见的轻中度抑郁症、焦虑症、疑病症、\n 恐惧症、强迫症心理疏导\n

\n
\n
\n
\n
\n
\n \n

\n 电话:{{cur.phone}}\n

\n
\n
\n \n

\n 职务:{{cur.zw}}\n

\n
\n\n\n
\n
\n
\n \n

\n 专业:{{cur.zy}}\n

\n
\n
\n \n

\n 擅长:心理访谈\n

\n
\n
\n\n
\n\n
\n
\n \n

\n 访谈时间\n

\n \n \n \n \n

\n 待访谈学生\n

\n
\n \n
\n

\n 班级\n

\n \n \n \n \n
\n\n
\n \n \n \n
\n \n {{item.xsmc}}\n
\n
\n
\n

5\" class=\"chakangengduo\" @click=\"showmore\">\n {{!showallstu?'查看更多':'收起'}}\n

\n
\n
\n \n

\n 暂无学生!\n

\n
\n

\n 访谈地点\n

\n \n \n \n\n \n 短信提醒\n \n
\n 一键预约\n
\n
\n\n\n
\t\n
\n\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), cur:{}, listData:[], value2:'', form:{name:'',stulist:[],ftdz:'',date:'',sfdx:''}, checkList:[], stuList:[], curIndex1:0, optionData:{bj:[],zy:[]}, selectData:{ bj:'',zy:'' }, xxjd:'', showallstu:false, rules: { stulist: [ { required: true, message: '请选择学生', trigger: 'blur' }, ], ftdz: [ { required: true, message: '请输入访谈地址', trigger: 'blur' }, ], date: [ { required: true, message: '请选择日期', trigger: 'blur' }, ], }, pickerOptions: { }, }; }, methods: { handlechange(val){ console.log(this.selectData,'selectData') this.selectData.bj='' this.getslectOption() this.getStuList() }, handleclasschange(){ this.getStuList() }, onSubmit(){ var that = this this.$refs.form.validate((valid) => { if (valid) { const params = { ftyid:this.cur.userid, kssj:this.form.date[0], jssj:this.form.date[1], stulist:JSON.stringify(this.form.stulist), ftdz:this.form.ftdz, isfs:this.form.sfdx?'1':'2',// 是否短信提醒, userid:this.user.ID } $.post("/www/public/shouye/ft_stufpls", params, function(res){ if(res.success==1){ that.$message.success('预约成功') that.getList() that.getStuList() }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('预约失败') }) } else { console.log('error submit!!'); return false; } }); }, showmore(){ this.showallstu = !this.showallstu }, changeCur(item,index){ this.curIndex1 = index this.cur = item }, formatDate(date) { const year = date.getFullYear(); const month = (date.getMonth() + 1).toString().padStart(2, '0'); const day = date.getDate().toString().padStart(2, '0'); return `${year}-${month}-${day}`; }, getList(){ var that = this const params = { schoolid:this.schoolid } console.log(params,'params') $.post("/www/public/shouye/ft_ftlslist", params, function(res){ if(res.success==1){ that.listData = res.data if(that.listData.length){ that.cur = that.listData[0]||{} } }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, getslectOption(){ var that = this const params = { schoolid:this.schoolid, userid:this.schoolid, yhjs:JSON.stringify([this.yhjs]), zymc:that.selectData.zy } if(['4','5','6'].includes(that.xxjd)){ params.isgj='1' }else{ params.isgj='2' } console.log(params,'params') $.post("/www/public/shouye/ft_ftyystupublic", params, function(res){ if(res.success==1){ that.optionData.bj = res.data.bj that.optionData.zy = res.data.zy }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, getStuList(){ var that = this const params = { bj:that.selectData.bj, zy:that.selectData.zy, schoolid:this.schoolid, userid:this.schoolid, yhjs:JSON.stringify([this.yhjs]), ftzt:'0' } console.log(params,'params') $.post("/www/public/shouye/ft_ftyystu", params, function(res){ if(res.success==1){ that.stuList = res.data }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) } }, created: function(){ this.user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.xxjd = localStorage.getItem('xxjd') this.schoolid = this.user.ID this.Nickname = this.user.Nickname this.yhjs = this.user.UserFilter.urole this.getList() this.getStuList() this.getslectOption() }, computed:{ showStulist(){ if(!this.showallstu){ return this.stuList.slice(0,5) }else{ return this.stuList.slice(0) } } }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-zrl", function(resolve, reject){ var template = "
\n
\n
\n 上周\n 本周\n 下周\n
\n {{ todayDate }}\n
\n
\n \n {{ sta.title }}\n
\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
    \n \n \n
    暂无数据
    \n
\n
\n
\n
\n \n\n \n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, props: { planList: { type: Array, default: [] }, //卡片状态 cardStatus: { type: Object, default: () => { return { 1: { title: '已过期', color: '#9CADADB7' }, 2: { title: '进行中', color: '#FF6200' }, 3: { title: '未开始', color: '#3291F8' }, } } }, //第一列是星期几 isFirstDayOfMondayOrSunday: { type: Number, default: 1, }, hasNumExpend:{ type:Number, default:2 } }, data () { return { weeks: [ '时段', '周一', '周二', '周三', '周四', '周五', '周六', '周日', ], todayDate: '', months: [], curDate: '', nowDate: new Date(), } }, watch: { isFirstDayOfMondayOrSunday: { handler (val) { if (val > 1) { let arr = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'] const arr1 = arr.slice(val - 1) const arr2 = arr.slice(0, val - 1) this.weeks = ['时段', ...arr1, ...arr2] } }, immediate: true } }, mounted () { this.getCurWeek() }, methods: { //展开与缩放操作 handleExpand (row) { row.isExpend = !row.isExpend }, /** * 获取 时间 * @param time */ getWeek (time) { this.curDate = new Date(time) //当前是周几 const whichDay = time.getDay() let num = 0 if (this.isFirstDayOfMondayOrSunday <= whichDay) { num = this.isFirstDayOfMondayOrSunday } else { num = this.isFirstDayOfMondayOrSunday - 7 } const weekDay = time.getDay() - num time = this.addDate(time, weekDay * -1) for (let i = 0; i < 7; i++) { const { year, month, day } = formatDate(i === 0 ? time : this.addDate(time, 1)) this.months.push({ date: `${year}-${month}-${day}`, showDate: `${month}-${day}`, timestamp: new Date(`${year}-${month}-${day}`).getTime() }) } this.months.sort((a, b) => a.timestamp - b.timestamp) delete this.months[0] this.todayDate = `${this.months[1].date} ~ ${this.months[this.months.length - 1].date}` }, /** * 处理日期 * @param date * @param n * @returns {*} */ addDate (date, n) { date.setDate(date.getDate() + n) return date }, /** * 上周 */ getLastWeek () { const date = this.addDate(this.curDate, -7), { year, month, day } = formatDate(date), dateObj = { date: `${year}-${month}-${day}`, timestamp: new Date(`${year}-${month}-${day}`).getTime() } this.dealDate(date) this.$emit('changeWeek', dateObj) }, /** * 本周 */ getCurWeek () { const { year, month, day } = formatDate(new Date()), dateObj = { date: `${year}-${month}-${day}`, timestamp: new Date(`${year}-${month}-${day}`).getTime() } this.dealDate(new Date()) this.$emit('changeWeek', dateObj) }, /** * 下周 */ getNextWeek () { const date = this.addDate(this.curDate, 7), { year, month, day } = formatDate(date), dateObj = { date: `${year}-${month}-${day}`, timestamp: new Date(`${year}-${month}-${day}`).getTime() } this.dealDate(date) this.$emit('changeWeek', dateObj) }, /** * 显示当天日期状态 * @param date */ dealDate (date) { this.months = [''] this.getWeek(date) const curDate = getCurDay() this.months.forEach(item => { item.isCurDate = item.date === curDate }) }, /** * 点击卡片子内容查看详情 * @param row */ handleDetail (row) { this.$emit('handleDetail', row) }, /** * 点击卡片查看全部内容 * @param month * @param period */ handleCardDetail (month, period) { this.$emit('handleCardDetail', { ...month, ...period }) } } }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDshijianyuyue-view", function(resolve, reject){ var template = "
\n \n \n \n
\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, name: 'App', data() { /** * 获取当天时间 * @returns {string} */ function getCurDay(num = 0) { var datetime = new Date(); var year = datetime.getFullYear(); var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1; let day = datetime.getDate() if ((day + num) > 0) { day = (day + num) < 10 ? "0" + (datetime.getDate() + num) : datetime.getDate() + num; } else { day = (day - num) < 10 ? "0" + (datetime.getDate() - num) : datetime.getDate() - num; } return `${year}-${month}-${day}` } return { timePeriodList: [ { timePeriod: '8:00~10:00', schedule: [ { isExpend: false, [getCurDay()]: [ { timePeriod: '8:00~10:00', date: getCurDay(), course: '大学英语', watchman: '井底的蜗牛', place: '测试地点', status: 1, }, { timePeriod: '8:00~10:00', date: getCurDay(), course: '大学英语', watchman: '井底的蜗牛', place: '测试地点', status: 2, }, { timePeriod: '8:00~10:00', date: getCurDay(), course: '大学英语', watchman: '井底的蜗牛', place: '测试地点', status: 3, }, ], }, { isExpend: false, [getCurDay(-1)]: [ { id: 1, timePeriod: '8:00~10:00', date: getCurDay(-1), course: '大学英语', watchman: '井底的蜗牛', place: '测试地点', status: 1, }, ] } ] }, { timePeriod: '12:00~14:00', schedule: [ { isExpend: false, [getCurDay()]: [ { timePeriod: '12:00~14:00', date: getCurDay(), course: '大学英语', watchman: '井底的蜗牛', place: '测试地点', status: 2, }, { timePeriod: '12:00~14:00', date: getCurDay(), course: '大学英语', watchman: '井底的蜗牛', place: '测试地点', status: 3, }, ], }, { isExpend: false, [getCurDay(-1)]: [ { timePeriod: '12:00~14:00', date: getCurDay(-1), course: '大学英语', watchman: '井底的蜗牛', place: '测试地点', status: 1, }, { timePeriod: '实验室1', date: getCurDay(-1), course: '大学英语', watchman: '井底的蜗牛', place: '测试地点', status: 1, }, { timePeriod: '实验室1', date: getCurDay(-1), course: '大学英语', watchman: '井底的蜗牛', place: '测试地点', status: 1, }, ] } ] }, { timePeriod: '14:00~16:00', schedule: [] }, ], } }, methods: { /** * 点击详情 * @param row */ handleDetail(row){ console.log(row) }, /** * 点击卡片查看全部内容 */ handleCardDetail(row) { console.log(row) }, /** * 切换周 * @param date */ changeWeek(date){ console.log(date) } }, }) }) })(template, resolve, reject); }); RegVueCom("xljk-ftzsls-view", function(resolve, reject){ var template = "
\n
\n
\n\n\n
\n
\n
\n
\n
\n \n
\n
\n
\n 安全防范实训指导证书\n
\n
\n 来源:普通考试 | 签发日期:2023-来源:普通考试 | 签发日期:2023-\n
\n\n\n
\n
\n
\n
\n 打印\n
\n
\n 下载\n
\n
\n 查看\n
\n
\n
\n\n\n\n
\n
\n\n
\n\n\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid() }; }, methods: { getImgsrc(val) { return "/content/image/xljkImg/"+val }, }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-ftyysz-view", function(resolve, reject){ var template = "
\n
\n \n \n \n \n \n\n \n \n 星期一\n 星期二\n 星期三\n 星期四\n 星期五\n 星期六\n 星期日\n \n \n\n \n \n 00:00 - 02:00\n 02:00 - 04:00\n 04:00 - 06:00\n 06:00 - 08:00\n 08:00 - 10:00\n 10:00 - 12:00\n 12:00 - 14:00\n 14:00 - 16:00\n 16:00 - 18:00\n 18:00 - 20:00\n 20:00 - 22:00\n 22:00 - 00:00\n \n \n\n \n \n \n \n 确定\n 取消\n \n \n\n
\n\n\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), dateRange: [], // 存储开始时间和结束时间的数组 selectedDay: [], // 存储选择的星期的数组 selectedTimeSlot: 1, // 存储选择的时间段 richText: '' // 存储富文本内容 }; }, methods: { onSubmit() { console.log('submit!'); }, getImgsrc(val) { return "/content/image/xljkImg/"+val }, toggleDay(day) { if (this.isSelectedDay(day)) { // 如果已经选中,则移除 const index = this.selectedDay.indexOf(day); if (index !== -1) { this.selectedDay.splice(index, 1); } } else { // 如果未选中,则添加 this.selectedDay.push(day); } }, isSelectedDay(day) { return this.selectedDay.includes(day); }, pickerOptions() { return { shortcuts: [{ text: '今天', onClick(picker) { const start = new Date(); const end = new Date(); end.setTime(start.getTime()); picker.$emit('pick', [start, end]); } }, { text: '昨天至今天', onClick(picker) { const end = new Date(); const start = new Date(); start.setTime(end.getTime() - 3600 * 1000 * 24); picker.$emit('pick', [start, end]); } }, { text: '最近一周', onClick(picker) { const end = new Date(); const start = new Date(); start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); picker.$emit('pick', [start, end]); } }] }; } }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDjinduduchaDialog", function(resolve, reject){ var template = "
\n \n
\n
\n 菜单\n 查看学生\n 查看教师\n 刷新数据\n 测评同意书\n 测评同意书二维码\n\n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), dialogVisible: false, tableData: [{ date: '2016-05-03', name: '王小虎', address: '上海市普陀区金沙江路 1518 弄', done: 50, total:150 }, { date: '2016-05-02', name: '王小虎', address: '上海市普陀区金沙江路 1518 弄', done: 150, total:150 }, { date: '2016-05-04', name: '王小虎', address: '上海市普陀区金沙江路 1518 弄', done: 50, total:150 }, { date: '2016-05-01', name: '王小虎', address: '上海市普陀区金沙江路 1518 弄', done: 50, total:150 }, { date: '2016-05-08', name: '王小虎', address: '上海市普陀区金沙江路 1518 弄', done: 50, total:150 }, { date: '2016-05-06', name: '王小虎', address: '上海市普陀区金沙江路 1518 弄', done: 50, total:150 }, { date: '2016-05-07', name: '王小虎', address: '上海市普陀区金沙江路 1518 弄', done: 50, total:150 }], multipleSelection: [], currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4}; }, methods: { show(){ this.dialogVisible = true }, handleSizeChange(val) { console.log(`每页 ${val} 条`); }, handleCurrentChange(val) { console.log(`当前页: ${val}`); }, handleClick(){}, handleClose(){ this.dialogVisible = false }, toggleSelection(rows) { if (rows) { rows.forEach(row => { this.$refs.multipleTable.toggleRowSelection(row); }); } else { this.$refs.multipleTable.clearSelection(); } }, handleSelectionChange(val) { this.multipleSelection = val; } }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-ftyyxg-view", function(resolve, reject){ var template = "
\n
\n
\n
\n
\n 开始时间:\n
\n
\n 2024.09.03\n
\n
\n
\n
\n 结束时间:\n
\n
\n 2024.09.09\n
\n
\n
\n
\n 选择星期:\n
\n
\n 星期一、星期二、星期三\n
\n
\n
\n
\n 选择时段:\n
\n
\n 08:00-08:40\n
\n
\n
\n
\n 访谈地址:\n
\n
\n 教学楼902室\n
\n
\n\n
\n 修改\n
\n\n\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid() }; }, methods: { }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-ftgtt-view", function(resolve, reject){ var template = "
\n
\n
\n 我的\n
\n 查看更多 \n
\n
\n
\n \n \n \n
\n
\n 非危急\n 危急\n 高危\n
\n
\n
\n
\n
时间
\n
\n 星期{{ weekList[index + 1] }}\n \n

{{ item.date }}

\n
\n
\n \n
\n \n
\n
\n {{ item.time }}\n
\n
\n \n
\n
\n \n \n
\n
\n
\n
\n
\n
\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), weekList: '日一二三四五六日', day: '', // 选中日期 sunday: '', // 选中周的周日 scheduleList: [] }; }, methods: { getSchedule() { try { const _endDate = moment(this.day).endOf('week').format('YYYY-MM-DD') console.log('日期选中的日期范围,用于请求选中周日程' + this.day + ',' + _endDate) const _scheduleList = [] for (let i = 0; i < 7; i++) { const _targetDay = moment(this.day).add(i, 'days').format('YYYY-MM-DD') const _schedule = { date: _targetDay, list: [ { id: 1, name: '李豆豆', stuNo: '11073912128', collageName: '北京师范大学', address: '北师大心理学部1318A', headTeacher: '任伟军', interviewType: '线下访谈', interviewAddress: '教4-309教室', className: '307', grade: '3', time: '9:00-10:30', level: 1 }, { id: 2, name: '李豆', stuNo: '11073912128', collageName: '北京师范大学', address: '北师大心理学部1318A', headTeacher: '任伟军', interviewType: '线下访谈', interviewAddress: '教4-309教室', className: '307', grade: '3', time: '10:30-12:00', level: 2 }, { id: 3, name: '李豆', stuNo: '11073912128', collageName: '北京师范大学', address: '北师大心理学部1318A', headTeacher: '任伟军', interviewType: '线下访谈', interviewAddress: '教4-309教室', className: '307', grade: '3', time: '14:00-15:30', level: 3 }, { id: 4, name: '', stuNo: '', collageName: '', address: '', headTeacher: '', interviewType: '', interviewAddress: '', className: '', grade: '', time: '14:00-15:30' } ] } _scheduleList.push(_schedule) } this.scheduleList = _scheduleList } catch (e) { console.error(e) } }, getLevelClass(item) { switch (item.level) { case 1: return 'not-risk' case 2: return 'normal-risk' case 3: return 'high-risk' default: return '' } }, handleWeek(type) { switch (type) { case 'pre': this.day = moment(this.day).subtract(1, 'weeks').format('YYYY-MM-DD') break case 'next': this.day = moment(this.day).add(1, 'weeks').format('YYYY-MM-DD') break } // 获取选中周次的日程list this.getSchedule() } }, created: function(){ }, mounted: function(){ this.day = moment().startOf('week').format('YYYY-MM-DD') this.getSchedule() }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDxuexiaoxxDialog-view", function(resolve, reject){ var template = "
\n \n\n
\n
\n
\n 学校信息上报\n
\n
\n
\n
\n \n \n

\n 1\n

\n
\n

\n 学校基本信息\n

\n
\n
\n
\n \n \n

\n 2\n

\n
\n 班级信息\n
\n
\n
\n \n \n

\n 3\n

\n
\n 学校施测环境信息\n
\n \n \n
\n
\n
\n
\n \n \n

\n 1\n

\n
\n

\n 学校基本信息\n

\n
\n \n
\n
\n \n \n

\n 2\n

\n
\n 专业班级人数\n
\n
\n
\n \n \n

\n 3\n

\n
\t\n 心理教师信息\n
\n
\n
\n \n \n

\n 4\n

\n
\n 学校施测环境信息\n
\n
\n
\n \n \n \n

*学校阶段

\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n

*区县名称

\n \n \n \n
\n \n

*学校名称

\n \n \n \n
\n\n\n \n\n \n

*主管单位

\n \n \n \n \n \n \n
\n\n \n

*学制

\n \n \n \n \n \n
\n \n

培养层次

\n \n\n \n\n \n \n \n \n \n \n
\n \n

*办学性质

\n \n \n \n \n \n \n
\n \n

*办学类型

\n \n \n \n \n \n \n \n \n
\n\n \n

*举办者类型

\n \n \n \n \n \n \n \n \n\n\n \n \n
\n \n

学校类别

\n \n \n \n
\n \n

*计划施测开始时间

\n \n \n \n \n
\n \n

*计划施测结束时间

\n \n \n \n \n
\n\n \n

*学校详细地址

\n \n \n \n
\n \n \n \n

*学校地理位置

\n \n \n \n \n \n
\n
\n \n \n

*学校负责人(分管学生德育和心理健康工作的副校长或中层领导)

\n \n \n \n
\n \n

*学校地理位置

\n \n \n \n \n \n
\n \n

*全校心理健康教师数量

\n \n \n \n
\n \n\n
\n \n
\n
\n \n 下 一 步\n 下 一 步\n
\n
\n
\n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n \n \n \n

*院系名称

\n \n \n \n
\n \n

*专业名称

\n \n \n \n
\n \n\n\n\n
\n
\n
\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), totalstep:4, done:0, Roles:[], xxwzList:['城市','县城','农村'], xzList:['五四制','六三制'], jbzlxList:['中央教育部门','省级教育部门','民办'], disableStatus:'', xxjd:'', options: [], value: [], list: [], loading: false, idEdit:false, states: [], isFirst:true, dialogVisible: false, tableData: [], multipleSelection: [], currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4, innerVisible:false, classList:[], total:0, pages:{ pageno:1, pagesize:5 }, step:1, gjstep:1, zyForm:{ zybm:'', zymc:'', yxmc:'', zzone:0, zztwo:0, zzthree:0, gzone:0, gztwo:0, gzthree:0, bkone:0, bktwo:0, bkthree:0, bkfour:0, bkfive:0, ssone:0, sstwo:0, ssthree:0, bsone:0, bstwo:0, bsthree:0, bsfour:0, }, reruleForm: { sfmc:'', qxmc:'', djsmc:'', xxmc:'', xxbm:'', zgdwbm:'', xxjd:'', xz:'', bxxz:'', // sckssj:'', // scjssj:'', xxwz:'', bxlx:'', jbzlx:'', pycc:[], jbzlx:'', xxlx:'', qybm:'', xxxljkfzrxm:'', //issdf:undefined,issmcyyy:undefined, wxzh:'', zzxlcnt:0, zxzzcnt:0, jygzinfo:'', wjgyinfo:'', xlpxinfo:'', xxForm:{ xfour:0, xfive:0, xsix:0 }, czForm:{ cone:0, ctwo:0, cthree:0, cfour:0 }, gForm:{ gone:0, gtwo:0, gthree:0 }, /*zzForm :{ zzone:0, zztwo:0, zzthree:0, }, gzForm :{ gzone:0, gztwo:0, gzthree:0, }, bkForm : { bkone:0, bktwo:0, bkthree:0, bkfour:0, bkfive:0, }, ssForm : { ssone:0, sstwo:0, ssthree:0, }, bsForm :{ bsone:0, bstwo:0, bsthree:0, bsfour:0, }*/ }, ruleForm: { jzxlcnt:'', xxwz:'', zzxlcnt:'', xz:'', jbzlx:'', sfmc:'', qxmc:'', djsmc:'', xxmc:'', xxbm:'', zgdwbm:'', xd:'', xz:'', bxxz:'', sckssj:'', scjssj:'', xxwz:'', bxlx:'', jbzlx:'', pycc:[], jbzlx:'', xxlx:'', //issdf:undefined,issmcy:undefined, wxzh:'', zzxlcnt:0, zxzzcnt:0, jygzinfo:'', wjgyinfo:'', xlpxinfo:'', qybm:'', xxForm:{ xfour:0, xfive:0, xsix:0 }, czForm:{ cone:0, ctwo:0, cthree:0, cfour:0 }, gForm:{ gone:0, gtwo:0, gthree:0 }, /*zzForm :{ zzone:0, zztwo:0, zzthree:0, }, gzForm :{ gzone:0, gztwo:0, gzthree:0, }, bkForm : { bkone:0, bktwo:0, bkthree:0, bkfour:0, bkfive:0, }, ssForm : { ssone:0, sstwo:0, ssthree:0, }, bsForm :{ bsone:0, bstwo:0, bsthree:0, bsfour:0, }*/ }, xxxzOption:[ { value:'1', label:'三年制', usefor:['2','3','4','5'] }, { value:'2', label:'四年制', usefor:['2'] }, { value:'3', label:'五年制', usefor:['1','5','4'] }, { value:'4', label:'六年制', usefor:['1'] }, { value:'5', label:'九年一贯制', usefor:['2'] }, { value:'6', label:'十二年一贯制', usefor:['3'] }, { value:'7', label:'初高中一贯制', usefor:['3'] }, { value:'10', label:'其他', usefor:['4','5','6'] }, ], zyrules: { sfmc: [ { required: true, message: '请输入省份姓名', trigger: 'blur' } ], }, rules: { sfmc: [ { required: true, message: '请输入省份姓名', trigger: 'blur' } ], qxmc: [ { required: true, message: '请输入区县名称', trigger: 'blur' } ], djsmc: [ { required: true, message: '请输入地级市名称', trigger: 'blur' } ], xxmc: [ { required: true, message: '请输入学校名称', trigger: 'blur' } ], xxbm: [ { required: true, message: '请输入学校编号', trigger: 'blur' } ], zgdw: [ { required: true, message: '请选择主管单位', trigger: 'blur' } ], xd: [ { required: true, message: '请选择学校阶段', trigger: 'blur' } ], dlwz: [ { required: true, message: '请选择地理位置', trigger: 'blur' } ], jzxlcnt: [ { required: true, message: '请输入全校心理健康教师数量', trigger: 'blur' } ], jzxlcnt: [ { required: true, message: '请输入全校心理健康教师数量', trigger: 'blur' } ], xxxz: [ { required: true, message: '请选择学校性质', trigger: 'blur' } ], xxxljkfzrxm: [ { required: true, message: '请选择学校负责人', trigger: 'blur' } ], xz: [ { required: true, message: '请选择学制', trigger: 'blur' } ], bxxz: [ { required: true, message: '请选择办学性质', trigger: 'blur' } ], sckssj: [ { required: true, message: '选择施测开始时间', trigger: 'blur' } ], scjssj: [ { required: true, message: '选择施测结束时间', trigger: 'blur' } ], xxwz: [ { required: true, message: '请输入学校地理位置', trigger: 'blur' } ], /* issmcyyy:[ { required: true, message: '请选择是否实名制参与试点校工作', trigger: 'blur' } ], issdf:[ { required: true, message: '请选择是否申请参与试点访谈', trigger: 'blur' } ],*/ }, isEdit:false, } }, methods:{ getjindu(val){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID //xxid,pageno,pagesize const params = { xxid:schoolid, } $.get("/www/public/shangbao/cnt_sb_jd", params, function(res){ if(res.success==1){ var num = res.data.xxcnt+1 if(num>=val){ if(['1','2','3','4'].includes(that.xxjd)){ that.gjstep=0 that.step = val }else{ that.step=0 that.gjstep = val } }else{ that.$message.warning('请先完成前面步骤信息上报') } }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, clicktab(val){ this.getjindu(val) }, preStep(){ if(['1','2','3','4'].includes(this.xxjd)){ this.gjstep=0 this.step-- }else{ this.step=0 this.gjstep-- } }, nextStep(){ if(['1','2','3','4'].includes(this.xxjd)){ this.gjstep=0 this.step++ }else{ this.step=0 this.gjstep++ } }, beforeClose(){ this.$refs.baseDialog2.close() }, getList(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID //xxid,pageno,pagesize const params = { xxid:schoolid, ...this.pages } $.get("/www/public/shangbao/get_zy_info", params, function(res){ if(res.success==1){ that.tableData = res.data that.total = res.total }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, handlexdChange(val){ this.ruleForm.sfmc = '' this.ruleForm.djsmc = '' this.ruleForm.xxwz = '' this.ruleForm.xxlx = '' this.ruleForm.bxxz = '' this.ruleForm.jbzlx = '' this.ruleForm.xz = '' }, getDetail(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { xxid:schoolid, } $.get("/www/public/shangbao/get_school_info", params, function(res){ if(res.success==1){ that.ruleForm = res.data that.disableStatus=res.data.shzt that.ruleForm.xxForm = {...that.reruleForm.xxForm} that.ruleForm.czForm = {...that.reruleForm.czForm} that.ruleForm.gForm = {...that.reruleForm.gForm} that.ruleForm.zzForm = {...that.reruleForm.zzForm} that.ruleForm.gzForm = {...that.reruleForm.gzForm} that.ruleForm.bkForm = {...that.reruleForm.bkForm} that.ruleForm.ssForm = {...that.reruleForm.ssForm} that.ruleForm.bsForm = {...that.reruleForm.bsForm} /*that.options = [{ mc:that.ruleForm.zgdwmc, id:that.ruleForm.zgdwbm }]*/ if(res.data.xd){ that.isFirst = false if(res.data.xd=='1'){ that.ruleForm.xxForm = { xfour:res.data.xfour, xfive:res.data.xfive, xsix:res.data.xsix, } }else if(res.data.xd=='2'){ that.ruleForm.czForm = { cone:res.data.cone, ctwo:res.data.ctwo, cthree:res.data.cthree, } }else if(res.data.xd=='3'){ that.ruleForm.gForm = { gone:res.data.gone, gtwo:res.data.gtwo, gthree:res.data.gthree, } }else if(res.data.xd=='4'){ that.ruleForm.zzForm = { zzone:res.data.zzone, zztwo:res.data.zztwo, zzthree:res.data.zzthree, } }else if(res.data.xd=='5'){ that.ruleForm.gzForm = { gzone:res.data.gzone, gztwo:res.data.gztwo, gzthree:res.data.gzthree, } }else if(res.data.xd=='6'){ if(res.data.pycc){ that.ruleForm.pycc = res.data.pycc.split(',') } that.ruleForm.bkForm = { bkone:res.data.bkone, bktwo:res.data.bktwo, bkthree:res.data.bkthree, bkfour:res.data.bkfour, bkfive:res.data.bkfive, } that.ruleForm.ssForm = { ssone:res.data.ssone, sstwo:res.data.sstwo, ssthree:res.data.ssthree, } that.ruleForm.bsForm = { bsone:res.data.bsone, bstwo:res.data.bstwo, bsthree:res.data.bsthree, bsfour:res.data.bsfour, } } } }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{ console.log(xhr,status,error) this.$message.error('请求错误') }) }, download(){ var that = this var xxjd = localStorage.getItem('xxjd') //1zz 2gz 3gx var type if(xxjd=='4'){ type = '1' }else if(xxjd=='5'){ type = '2' }else if(xxjd=='6'){ type = '3' } const params = { type, } axios({ method: 'get', url: '/www/public/shangbao/download_zy_mb', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '专业导入模版.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, del(row){ var that = this let params = {} if(row.id){ params = { ids:JSON.stringify([row.id]), } }else if(that.multipleSelection.length){ params.ids = [] console.log( that.multipleSelection,' that.multipleSelection') that.multipleSelection.forEach(item=>{ params.ids.push(item.id) }) params.ids = JSON.stringify(params.ids) console.log( params,' params') }else{ that.$message.warning('请先选择数据') } $.get("/www/public/shangbao/del_zy_info", params, function(res){ if(res.success==1){ that.$message.success('删除成功') that.getList() }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ that.$message.success('请求错误') }) }, handleEdit(row){ this.zyForm = {} this.zyForm = {...row} this.isEdit = true this.$refs.baseDialog2xx.show() }, customUpload(params) { var that = this var xxjd = localStorage.getItem('xxjd') var importType if(xxjd=='4'){ importType = '1' }else if(xxjd=='5'){ importType = '2' }else if(xxjd=='6'){ importType = '3' } that.loading = true // params是一个对象,包含了file和fileList, // 但是这个params参数可能每个版本不一样值就不一样,到时候自己打印看看, // 反正file的值就是原始的File对象 // 如果extraParams是个单独的值,直接加入 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const formData = new FormData() console.log(params.file,'params.file') formData.append('file', params.file) // 这是file入参,文件信息 formData.append('xxid', schoolid) formData.append('type', importType) // 如果extraParams是个对象,循环加入formData /*for (const key in this.extraParams) { formData.append(key, this.extraParams[key]) } */ // 调接口 axios.post('/www/public/shangbao/import_zy_info', formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ that.$message.success('导入成功') that.loading = false that.getList() }else{ that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false console.error(error); }); }, closeDialog(){ // if(this.tableData.length==0){ this.$message.warning('上报未完成') return } this.$refs.baseDialog2.close() this.$emit('closeDialog') }, closeDialog1(){ this.$refs.baseDialog2xx.close() }, confirm(){ this.$refs.baseDialog2xx.close() }, remoteMethod(val) { var that = this const params = { } $.get("/www/public/shangbao/findsjbmlist", params, function(res){ if(res.success==1){ that.options = res.data }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) }, submit(val){ // var that = this this.$refs.ruleForm.validate((valid) => { if (valid) { var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var result = that.options.find(item=>item.id==that.ruleForm.zgdwbm) let params = { xxbm:that.ruleForm.xxbm, zgdwbm:that.ruleForm.zgdwbm, zgdwmc:result.mc, sckssj:that.ruleForm.sckssj, scjssj:that.ruleForm.scjssj, bxlx:that.ruleForm.bxlx, jbzlx:that.ruleForm.jbzlx, xd:that.ruleForm.xd, //issmcyyy:that.ruleForm.issmcyyy, qybm:that.ruleForm.qybm, sfmc:that.ruleForm.sfmc, djsmc:that.ruleForm.djsmc, jzxlcnt:that.ruleForm.jzxlcnt, dlwz:that.ruleForm.dlwz, xxmc:that.ruleForm.xxmc, } /* if(that.ruleForm.issdf){ params.issdf = that.ruleForm.issdf }*/ if(val&&val==1){ params.wxzh = that.ruleForm.wxzh params.zzxlcnt = that.ruleForm.zzxlcnt params.zxzzcnt = that.ruleForm.zxzzcnt params.jygzinfo = that.ruleForm.jygzinfo params.wjgyinfo = that.ruleForm.wjgyinfo params.xlpxinfo = that.ruleForm.xlpxinfo } if(that.ruleForm.xd=='1'){ params = {...params, id:schoolid,...that.ruleForm.xxForm,qxmc:that.ruleForm.qxmc,xxwz:that.ruleForm.xxwz,bxxz:that.ruleForm.bxxz,xz:that.ruleForm.xz,} }else if(that.ruleForm.xd=='2'){ params = {...params, id:schoolid,...that.ruleForm.czForm,qxmc:that.ruleForm.qxmc,xxwz:that.ruleForm.xxwz,bxxz:that.ruleForm.bxxz,xz:that.ruleForm.xz,} }else if(that.ruleForm.xd=='3'){ params = {...params, id:schoolid,...that.ruleForm.gForm,qxmc:that.ruleForm.qxmc,xxwz:that.ruleForm.xxwz,bxxz:that.ruleForm.bxxz,xz:that.ruleForm.xz,} }else if(that.ruleForm.xd=='4'){ params = {...params, id:schoolid, qxmc:that.ruleForm.qxmc,xxwz:that.ruleForm.xxwz,jbzlx:that.ruleForm.jbzlx,xz:that.ruleForm.xz,xxlx:that.ruleForm.xxlx, } }else if(that.ruleForm.xd=='5'){ params = {...params, id:schoolid, xxlx:that.ruleForm.xxlx,bxxz:that.ruleForm.bxxz, } }else if(that.ruleForm.xd=='6'){ params = {...params, id:schoolid, pycc:that.ruleForm.pycc.toString(), } } console.log(params,'params') $.get("/www/public/shangbao/edit_school_info", params, function(res){ if(res.success==1){ //val&&val==1 是从第二步过来的 //val!=1 是从第一步过来的 that.nextStep() }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) } else { that.$message.warning('信息校验未正确填写或填写内容不全') console.log('error submit!!'); return false; } const dataxlj={ xm:that.ruleForm.xxxljkfzrxm, lsid:that.ruleForm.xxxljkfzrid, xxid:schoolid, } if(that.ruleForm.xd=='1'||that.ruleForm.xd=='2'||that.ruleForm.xd=='3'||that.ruleForm.xd=='4'){ $.post("/www/public/shangbao/addxljkfzr", dataxlj, function(res){ if(res.success==1){ }else{ that.$message.error(res.message) } }) } }); }, zysubmit(){ var that = this this.$refs['zyForm'].validate((valid) => { if (valid) { const params = { zybm:that.zyForm.zybm, zymc:that.zyForm.zymc, yxmc:that.zyForm.yxmc, zzone:that.zyForm.zzone||undefined, zztwo:that.zyForm.zztwo||undefined, zzthree:that.zyForm.zzthree||undefined, gzone:that.zyForm.gzone||undefined, gztwo:that.zyForm.gztwo||undefined, gzthree:that.zyForm.gzthree||undefined, bkone:that.zyForm.bkone||undefined, bktwo:that.zyForm.bktwo||undefined, bkthree:that.zyForm.bkthree||undefined, bkfour:that.zyForm.bkfour||undefined, bkfive:that.zyForm.bkfive||undefined, ssone:that.zyForm.ssone||undefined, sstwo:that.zyForm.sstwo||undefined, ssthree:that.zyForm.ssthree||undefined, bsone:that.zyForm.bsone||undefined, bstwo:that.zyForm.bstwo||undefined, bsthree:that.zyForm.bsthree||undefined, bsfour:that.zyForm.bsfour||undefined, id:that.zyForm.id } $.post("/www/public/shangbao/edit_zy_info", params, function(res){ if(res.success==1){ that.$message.success(res.message) that.$refs.baseDialog2xx.close() that.getList() }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) } else { console.log('error submit!!'); return false; } }); }, onError(){}, show(){ var that = this this.$refs.baseDialog2.show() this.$nextTick(()=>{ that.getDetail() that.$refs.ruleForm.resetFields() }) }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pagesize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageno = val this.getList() }, handleClick(){}, handleClose(){ console.log(1) this.dialogVisible = false }, handleSelectionChange(val) { console.log(val,'val') this.multipleSelection = val; }, getClass(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { schoolid } $.get("/www/public/shangbao/findschoolbj", params, function(res){ if(res.success==1){ that.classList = res.data }else{ this.$message.error(res.message) } }).fail((xhr,status,error)=>{ this.$message.error('请求错误') }) }, }, computed:{ isXCG(){ if(['1','2','3'].indexOf(this.ruleForm.xd)!=-1){ return true } return false }, noshowClose(){ var noshow if(this.step==1){ noshow = true }else if(this.step==2){ noshow = false }else{ noshow = false } } }, watch:{ "ruleForm.xd"(val){ /*this.ruleForm.sfmc = '' this.ruleForm.djsmc = '' this.ruleForm.xxwz = '' this.ruleForm.xxlx = '' this.ruleForm.bxxz = '' this.ruleForm.jbzlx = '' this.ruleForm.xz = ''*/ if(val=='1'){ }else{ } } }, created: function(){ this.xxjd = localStorage.getItem('xxjd') this.getDetail() this.remoteMethod() var done = Number(this.$route.query.done) this.shzt = this.$route.query.shzt if(['1','2','3','4'].includes(this.xxjd)){ this.totalstep = 3 if(done<3){ this.gjstep=0 this.step = done+1 } }else{ this.totalstep = 3 if(done<3){ this.step=0 this.gjstep = done+1 } } }, mounted: function(){ /*this.list = this.states.map(item => { return { value: `value:${item}`, label: `label:${item}` }; });*/ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDyuyue1-view", function(resolve, reject){ var template = "
\n \n
\n
\n
\n \n
\n
\n
\n
\n

\n 任伟军\n

\n 初级访谈\n
\n

\n 常见的轻中度抑郁症、焦虑症、疑病症、\n 恐惧症、强迫症心理疏导\n

\n
\n 立即预约\n
\n
\n
\n
\n \n

\n 电话:010-6660336\n

\n
\n
\n \n

\n 邮箱:9429233238@163.net\n

\n
\n
\n \n

\n 地址:北京师范大学哲学院\n

\n
\n
\n
\n\n
\n \n

\n 学校:哲学学院\n

\n
\n
\n \n

\n 区域:哲学院副院长\n

\n
\n
\n \n

\n 擅长:心理访谈\n

\n
\n
\n
\n\n
\n
\n\n\n
\n
\n
\n \n

\n 预约访谈\n

\n
\n\n\n\n\n
\n
\n\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid() }; }, methods: { }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-zrl1", function(resolve, reject){ var template = "
\n
\n\n
\n \n
\n
\n \n \n \n
\n
\n 非危急\n 危急\n 高危\n
\n
\n
\n \n
\n
时间
\n
\n 星期{{ weekList[index + 1] }}\n \n

{{ item.ftsj }}

\n
\n
\n \n \n
\n \n
\n
\n {{ item.kssj}}-{{item.jssj}}\n
\n
\n \n \n
\n \n
\n \n \n \n
\n
\n
\n
\n
\n
\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), weekList: '日一二三四五六日', day: '', // 选中日期 sunday: '', // 选中周的周日 //scheduleList: [] }; }, methods: { getSchedule(val) { console.log(val,'val') /*try { const _endDate = moment(this.day).endOf('week').format('YYYY-MM-DD') console.log('日期选中的日期范围,用于请求选中周日程' + this.day + ',' + _endDate) const _scheduleList = [] for (let i = 0; i < 7; i++) { const _targetDay = moment(this.day).add(i, 'days').format('YYYY-MM-DD') const _schedule = { date: _targetDay, list: [ { id: 1, name: '李豆豆', stuNo: '11073912128', collageName: '北京师范大学', address: '北师大心理学部1318A', headTeacher: '任伟军', interviewType: '线下访谈', interviewAddress: '教4-309教室', className: '307', grade: '3', time: '9:00-10:30', level: 1 }, { id: 2, name: '李豆', stuNo: '11073912128', collageName: '北京师范大学', address: '北师大心理学部1318A', headTeacher: '任伟军', interviewType: '线下访谈', interviewAddress: '教4-309教室', className: '307', grade: '3', time: '10:30-12:00', level: 2 }, { id: 3, name: '李豆', stuNo: '11073912128', collageName: '北京师范大学', address: '北师大心理学部1318A', headTeacher: '任伟军', interviewType: '线下访谈', interviewAddress: '教4-309教室', className: '307', grade: '3', time: '14:00-15:30', level: 3 }, { id: 4, name: 'fdsafd', stuNo: 'fd', collageName: 'fd', address: 'dfas', headTeacher: 'dfsa', interviewType: 'dsf', interviewAddress: 'dfa', className: 'dsf', grade: 'dsaf', time: '14:00-15:30' } ] } _scheduleList.push(_schedule) } this.scheduleList = _scheduleList } catch (e) { console.error(e) }*/ this.$emit('getSchedule',this.day) }, getLevelClass(item) { switch (item.level) { case 1: return 'not-risk' case 2: return 'normal-risk' case 3: return 'high-risk' default: return '' } }, handleWeek(type) { switch (type) { case 'pre': this.day = moment(this.day).subtract(1, 'weeks').format('YYYY-MM-DD') break case 'next': this.day = moment(this.day).add(1, 'weeks').format('YYYY-MM-DD') break } // 获取选中周次的日程list this.getSchedule() } }, created: function(){ }, mounted: function(){ this.day = moment().startOf('week').format('YYYY-MM-DD') //this.getSchedule() }, props: ['title', 'data', 'config','Sjd','scheduleList','otherInfo'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-baseDialog", function(resolve, reject){ var template = "
\n \n
\n \n
\n \n 关闭\n 确 定\n \n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), dialogVisible: false } }, methods: { show(){ this.dialogVisible = true }, close(){ this.dialogVisible = false }, handleClose(){ this.$emit('beforeClose') //this.dialogVisible = false }, confirm(){ this.$emit('confirm') } }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config','title','inner','reff','hidden','width','noshowClose','top','destroyonclose'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDjddc1-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n
\n \n

\n 上报进度\n

\n

\n 上报进度,一目了然\n

\n
\n
\n \n

\n 测评进度\n

\n

\n 测评进度,一目了然\n

\n
\n \n\n
\n\n \n \n \n\n
\n\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid() }; }, methods: { showJindu(type){ if(type==1){ this.$refs.XDStujingduDialog.show(type) }else if(type==2){ this.$refs.ftjinduDialog.show(type) }else{ this.$refs.sbjinduDialog.show(type) } } }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDStujingduDialog", function(resolve, reject){ var template = "
\n \n \n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), dialogVisible: false, tableData: [], multipleSelection: [], currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4, innerVisible:false, activeName: 'first', paramspath:[], Roles:[], pages:{ pageNo:1, pageSize:5 }, total:0, ruleForm: { }, type:'',//1测评,2访谈 isEdit:false } }, methods:{ handleback(){ var len = this.paramspath.length if(len>1){ this.paramspath.pop() this.getList(this.paramspath[len-1]) }else{ return } }, handleRowClick(row){ console.log(row,'row') var len = this.paramspath.length this.getList({typec:Number(this.paramspath[len-1].typec)+1+'',username:row.username}) }, handleClick(tab, event) { console.log(tab, event); }, onError(){}, show(type){ this.type = type this.getList() this.$refs.baseDialog.show() }, getList(param){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var typec let params if(param){ params = { ...param } }else{ if(user.Roles.includes('220')){ typec='1' }else if(user.Roles.includes('310')){ typec='2' }else if(user.Roles.includes('410')){ typec='3' }else if(user.Roles.includes('450')){ typec='4' } params = { username:user.Username, typec } } var url if(that.activeName == 'first'){ url = "/www/public/selectschool/cpjd" }else{ url = "/www/public/selectschool/cpjd-xx" } if(this.type==1){ $.get(url, params, function(res){ if(res.success==1){ if(res&&res.data){ if(that.activeName == 'first'){ that.tableData = res.data.zsxx that.total = res.total }else{ that.tableData = res.data.zsxx that.total = res.total } var len = that.paramspath.length if(len!=0){ if(that.paramspath[len-1].typec!=params.typec){ that.paramspath.push(params) } }else{ that.paramspath.push(params) } } }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) } else if(this.type==3){ $.get("/www/public/selectschool/sbjd", params, function(res){ if(res.success==1){ if(that.activeName == 'first'){ that.tableData = res.data.xj that.total = res.total }else{ that.tableData = res.data.zsxx that.total = res.total } }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }else{ $.get("/www/public/selectschool/ftjd", params, function(res){ if(res.success==1){ that.tableData = res.data.xj }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) } }, handleConfirm(){ this.$refs.baseDialog.close() }, handleSizeChange(val) { console.log(`每页 ${val} 条`); }, handleCurrentChange(val) { console.log(`当前页: ${val}`); }, handleClick(){}, handleClose(){ console.log(1) this.dialogVisible = false }, toggleSelection(rows) { if (rows) { rows.forEach(row => { this.$refs.multipleTable.toggleRowSelection(row); }); } else { this.$refs.multipleTable.clearSelection(); } }, handleSelectionChange(val) { this.multipleSelection = val; } }, computed:{ }, watch:{ activeName(val){ this.paramspath = [] this.getList() } }, created: function(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.Roles = user.Roles if(user.Roles.includes('450')){ this.activeName = 'second' } }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDyyft-view", function(resolve, reject){ var template = "
\n \n
\n
\n
\n
\n

\n \n 预约列表\n

\n 一键预约\n
\n\n
\n
\n
\n
\n \n
\n
\n {{item.xsmc}} \n
\n
\n
\n
\n 年级:{{item.nj}}\n
\n
\n 班级:{{item.bj}}\n
\n
\n 联系方式: {{item.xssjh}} \n
\n
\n 访谈老师: {{item.ftls}} \n
\n
\n 访谈时间: {{item.yysj}} \n
\n
\n 访谈地址: {{item.ftdz}} \n
\n
\n
\n
\n
\n \n

\n 暂无数据!\n

\n
\n
\n \n \n\n\n
\n
\n\n
\n\n\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), ftsj:new Date(), yyzt:'', pages:{ pagesize:9, pagenum:1, }, total:0, stuList:[], listData:[], user:null, currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4 }; }, methods: { getStuList(){ var that = this const params = { schoolid:this.schoolid, userid:this.schoolid, yhjs:JSON.stringify([this.yhjs]), ftzt:'1', ...this.pages } console.log(params,'params') $.post("/www/public/shouye/ft_ftyystu", params, function(res){ if(res.success==1){ that.stuList = res.data that.total = res.total }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, formatDate(date) { const year = date.getFullYear(); const month = (date.getMonth() + 1).toString().padStart(2, '0'); const day = date.getDate().toString().padStart(2, '0'); return `${year}-${month}-${day}`; }, handleDateChange(val){ console.log(val,'va;') this.getList() }, changeYyzt(val){ this.yyzt = val this.getList() }, getList(){ var that = this const params = { ftsj:this.formatDate(this.ftsj), yyzt:this.yyzt, ...this.pages, schoolid:this.schoolid } console.log(params,'params') $.post("/www/public/shouye/ft_ftyyls", params, function(res){ if(res.success==1){ that.listData = res.data }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, goyuyue(item){ this.$router.push({ path:"/XDyuyue", query:{ item:JSON.stringify(item) } }) }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pagesize = val this.getStuList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pagenum = val this.getStuList() } }, created: function(){ this.user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.schoolid = this.user.ID this.Nickname = this.user.Nickname this.yhjs = this.user.UserFilter.urole this.getStuList() }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDyuyue2-view", function(resolve, reject){ var template = "
\n \n
\n
\n
\n \n
\n
\n
\n
\n

\n {{item.name}}\n

\n 初级访谈\n
\n

\n 常见的轻中度抑郁症、焦虑症、疑病症、\n 恐惧症、强迫症心理疏导\n

\n
\n
\n
\n
\n
\n \n

\n 电话:{{item.phone}}\n

\n
\n
\n \n

\n 职务:{{item.zw}}\n

\n
\n \n\n
\n
\n\n
\n \n

\n 专业:{{item.zy}}\n

\n
\n
\n \n

\n 擅长:心理访谈\n

\n
\n
\n\n
\n\n
\n
\n\n\n
\n
\n
\n \n

\n 预约\n

\n
\n \n
\n
\n\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), item:null, Sjd:[], paibanInfo:[], otherInfo:{} }; }, methods: { getWeekDays1(date) { const daysOfWeek = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']; let result = []; let startDate = new Date(date); let currentDayCode = startDate.getDay(); let i = 0; for (i = 0; i < 7; i++) { let dayCode = (currentDayCode + i) % 7; let newDate = new Date(startDate); newDate.setDate(startDate.getDate() - startDate.getDay() + dayCode); let year = newDate.getFullYear(); let month = String(newDate.getMonth() + 1).padStart(2, '0'); let day = String(newDate.getDate()).padStart(2, '0'); result.push({ date: `${year}-${month}-${day}`, mon: daysOfWeek[dayCode] }); } return result; }, getWeekDays() { const today = new Date(); const weekStart = today.getDate() - today.getDay(); // 获取本周开始的日期 const weekDates = []; for (let i = 0; i < 7; i++) { const day = new Date(today.getFullYear(), today.getMonth(), weekStart + i); const dateFormatted = day.toISOString().slice(0, 10); // 格式化为 YYYY-MM-DD const dayOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][day.getDay()]; weekDates.push({ date: dateFormatted, dayOfWeek: dayOfWeek }); } return weekDates; } , formatDate(date) { const year = date.getFullYear(); const month = (date.getMonth() + 1).toString().padStart(2, '0'); const day = date.getDate().toString().padStart(2, '0'); return `${year}-${month}-${day}`; }, //排班信息 getpaiban(day){ var that = this const params = { userid:that.item.ftyid, time:day, status:'0' } console.log(params,'params') $.post("/www/public/shouye/ft_ftyyinfo", params, function(res){ if(res.success==1){ let date = new Date(day); var result = that.getWeekDays(date) console.log(result,'result') let data = res.data[0].ftsj that.paibanInfo = data.slice(4,11) that.otherInfo = res.data[0] }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, //访谈时间段 getsjd(){ var that = this const params = { userid:that.item.ftyid } console.log(params,'params') $.post("/www/public/shouye/ft_ftyysjd", params, function(res){ if(res.success==1){ that.Sjd = res.data }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) } }, created: function(){ if(this.$route.query.item){ this.item = JSON.parse(this.$route.query.item) console.log(this.item,'item') this.getsjd() this.getpaiban(this.formatDate(new Date())) } }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDftList-view", function(resolve, reject){ var template = "
\n \n
\n
\n
\n
\n 已通过\n
\n
\n 未通过\n
\n
\n 未审核\n
\n
\n
\n
\n \n \n
\n
\n
\n
\n

\n {{item.name}}\n

\n 未审核\n 已通过\n 未通过\n
\n

\n\n

\n
\n 查看\n
\n
\n
\n
\n \n

\n 性别:{{item.sex}}\n

\n
\n \n
\n \n

\n 电话:{{item.phone}}\n

\n
\n
\n
\n\n
\n \n

\n 民族:{{item.mz}}\n

\n
\n
\n \n

\n 职务:{{item.zw}}\n

\n
\n
\n
\n\n
\n
\n\n
\n
\n \n

\n 暂无数据!\n

\n
\n \n \n
\n
\n\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), ftsj:new Date(), yyzt:'', pages:{ pageSize:9, pageNum:1, }, listzt:'1', active:0, total:0, listData:[], user:null, currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4 }; }, methods: { changeYyzt(val,index){ this.listzt = val this.active = index this.getList() }, chakan(item){ if(item.ddztm=='0'||item.ddztm=='4'){ window.open(`https://xinlijc.bnu.edu.cn/www/dd/vue/spa/zxbm#/chakan?id=${item.id}&ddztm=${true}`) }else{ window.open(`https://xinlijc.bnu.edu.cn/www/dd/vue/spa/zxbm#/chakan?id=${item.id}`) } }, getList(val){ var that = this const params = { ztm:this.listzt, ...this.pages, } console.log(params,'params') $.post("/www/public/shouye/px_webftybm_listbygzdw", params, function(res){ if(res.success==1){ that.listData = res.data that.total = res.total }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNum = val this.getList() } }, created: function(){ this.getList() }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-ftrsc-view", function(resolve, reject){ var template = ""; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), content: '', // 保存文本域内容 isEditable: false, // 控制文本域是否可编辑 status:'', datahtml1:'', datahtml2:'', datahtml3:'', activeStatus:'1' }; }, methods: { active(v){ console.log(v) this.activeStatus=v }, openTX(){ window.open('https://meeting.tencent.com/user-center/start','_blank') }, getImgsrc(val) { return "/content/image/xljkls/"+val }, // 切换编辑状态 toggleEdit() { if (this.isEditable) { // 点击保存时,处理保存逻辑,例如将内容发送到服务器 this.saveContent(); } // 切换编辑状态 this.isEditable = !this.isEditable; }, // 更新内容 updateContent(value) { this.content = value; }, // 模拟保存内容的方法 saveContent() { // 这里可以调用 API 保存内容 console.log('保存内容:', this.content); }, // 初始化内容 fetchContent() { // 从接口获取内容,并设置到 content 中 this.content = '从接口获得的内容'; }, next(){ if(this.status==1){ if(this.item.xd<5){ this.$router.push({ path: '/interviewInfoLS', }); }else{ this.$router.push({ path: '/interviewInfoLSGj', }); } } if(this.status==2){ if(this.item.xd<5){ this.$router.push({ path: '/interviewInfoOnline', }); }else{ this.$router.push({ path: '/interviewInfoOnlineGj', }); } } } }, created: function(){ this.status = JSON.parse(localStorage.getItem('stuStatus')); let that = this that.item = JSON.parse(localStorage.getItem('stuItem')); this.fetchContent() }, mounted: function(){ const that =this let data = { } $.post("/www/public/shouye/ft_getftzdy", data, function(res){ if(res.error==0){ that.datahtml1 = res.data[0].tyhnr that.datahtml2 = res.data[0].tyhnr that.datahtml3 = res.data[0].tyhnr }else{ that.$message.error(res.message) } }) }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDgongzuozuShangbaoDialog", function(resolve, reject){ var template = "
\n \n \n \n \n \n \n
"; return ( function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), tishi:'', roleOption:[], loading:false, dialogVisible: false, tableData: [], gzzzt:'', xgzt:'', multipleSelection: [], currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4, innerVisible:false, selectList:[], selectListV:'', fetchUnitListStatus:false, classList:[], fetchUnitListDialog:false, user:{}, total:0, pages:{ pageNo:1, pageSize:5 }, reForm: { reason:'' }, Form: { reason:'' }, reruleForm: { xm:'',sjh:'',yx:'',roleid:'',odesc:'',dw:'',zw:'',xb:'' }, ruleForm: { xm:'',sjh:'',yx:'',roleid:'',odesc:'',dw:'',zw:'',xb:'',id:'' }, rules: { reason: [ { required: true, message: '请输入申请原因', trigger: 'blur' } ], xm: [ { required: true, message: '请输入姓名', trigger: 'blur' } ], roleid: [ { required: true, message: '请选择角色', trigger: 'change' } ], xb: [ { required: true, message: '请选择性别', trigger: 'change' } ], dw: [ { required: true, message: '请输入单位', trigger: 'blur' } ], zw: [ { required: true, message: '请输入职务', trigger: 'blur' } ], sjh: [ { required: true, message: '请输入联系方式', trigger: 'blur' }, { validator: publicUtilsOfCheck.isValidPhoneNumber, trigger: 'blur' } ], yx: [ { required: true, message: '请输入邮箱', trigger: 'blur' }, { validator: publicUtilsOfCheck.validateEmail, trigger: 'blur' } ], }, isEdit:false } }, methods:{ DexportFn(){ var that = this var name //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var username = user.Username var bm = username.substring(3) let type if(user.Roles.includes('220')){ type='1' name = '市级管理员账号信息.xls' if(['110000','120000','310000','500000'].includes(bm)){ type='1' name = '区县管理员账号信息.xls' } }else if(user.Roles.includes('310')){ type='2' name = '区县管理员账号信息.xls' } const params = { username:user.Username, type, state:'1' } axios({ method: 'get', url: '/www/public/shangbao/dcsqxzh', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, save(){ const that = this that.$confirm('是否确认提交', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { $.post("/www/public/bd/editjyttj", {}, function(res){ if(res.error==0){ that.$message.success(res.message) that.getgzzshzt() }else{ that.$message.error(res.message) } }) }).catch(() => { }); }, tijiaoch(){ var that = this that.$confirm('是否确认撤回提交', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var type ='' if(user.Roles.includes('450')){ type='2' }else{ type='1' } const params = { type } $.post("/www/public/shouye/gzzshch", params, function(res){ if(res.success==1){ that.$message.success('撤回成功') that.getgzzshzt() }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ }) }).catch(() => { }); }, getgzzshzt(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var gzzid = user.ID const params = { gzzid } $.get("/www/public/shangbao/gzz-getgzzshzt", params, function(res){ if(res.success==1){ that.gzzzt = res.data.gzzzt that.xgzt = res.data.xgzt }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ console.log(xhr,status,error) }) }, changegetList(v){ // 检查选择的值是否有效 if(!v || v === '') { return } let [zgdwbm, zgdwmc] = v.split('|') // 确保分割后的值都存在 if(!zgdwbm || !zgdwmc) { this.$message.error('选择的单位信息不完整') return } const that = this let data = { zgdwbm, zgdwmc } $.post("/www/public/shangbao/editzgdwbm", data, function(res){ if(res.error==0){ that.$message.success('修改成功') }else{ that.$message.error(res.message) } }) }, showshenqingxiugai(){ this.$refs.gzzshenqingxiugai.show() }, shenqingxiugai(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var gzzid = user.ID const params = { gzzid, xgzt:'1', msg:that.Form.reason } $.post("/www/public/shangbao/gzz-cxsqxggzz", params, function(res){ if(res.success==1){ that.$message.success('已申请') that.$refs.gzzshenqingxiugai.close() }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message.error(error||'未知错误') }) }, tijiao(){ var that = this that.$confirm('是否确认提交审核', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { var jscnt = {} var otype that.tableData.forEach(item=>{ if(!jscnt[item.gzzroleid]){ jscnt[item.gzzroleid] = 1 }else{ jscnt[item.gzzroleid]++ } otype = item.otype }) const params = { jscnt:JSON.stringify(jscnt), otype } $.post("/www/public/shouye/jd_gzzbm_com", params, function(res){ if(res.success==1){ that.$message.success('提交成功') that.$refs.baseDialoggzz0.close() that.$emit('closeDialog') that.getgzzshzt() }else if(res.success==0&&res.message=='没有上级单位'){ that.$message.error('没有上级单位,请选择一个单位'); that.fetchUnitList() that.fetchUnitListStatus=true }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ }) }).catch(() => { }); }, fetchUnitList() { const that = this let data = { } $.post("/www/public/shangbao/findsjbmlist", data, function(res){ if(res.error==0){ that.selectList=res.data }else{ that.$message.error(res.message) } }) }, getZgdwbmById() { const that = this $.get("/www/public/shangbao/zgdwbmbyxxid", function(res){ if(res.error==0 && res.data){ // 检查数据是否有效,避免显示nullnull const zgdwbm = res.data.zgdwbm || '' const zgdwmc = res.data.zgdwmc || '' if(zgdwbm && zgdwmc) { // 设置下拉框的选中值,格式为 "zgdwbm|zgdwmc" that.selectListV = `${zgdwbm}|${zgdwmc}` } else { that.selectListV = '' } }else{ console.log('获取回显数据失败:', res.message) that.selectListV = '' } }).fail(function(error){ console.log('获取回显数据请求失败:', error) that.selectListV = '' }) }, download(){ var that = this var type //1省,2区县,3学校 下载工作组导入模版 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} // var user = this.$store.state.user //220省310市410区县 var name if(user.Roles.includes('220')){ type = 1 name = '省工作组信息上报模版.xlsx' }else if(user.Roles.includes('310')){ type = 2 name = '市工作组信息上报模版.xlsx' }else if(user.Roles.includes('410')){ type = 3 name = '县工作组信息上报模板.xlsx' }else if(user.Roles.includes('450')){ //基教4高教5 var xxjd = localStorage.getItem('xxjd') if(['1','2','3','4'].includes(xxjd)){ type = 4 }else{ type = 5 } name = '工作组信息上报模版.xlsx' } const params = { type, } axios({ method: 'get', url: '/www/public/shangbao/downloadgzztemp', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, handlebeforeClose(){ this.$emit('closeDialog') }, handleRoleChange(val){ console.log(val,'val') var zz = this.roleOption.find(item=>{ return item.id==val }) console.log(zz,'zz') this.ruleForm.odesc = zz.odesc }, exportFn(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { schoolid, } axios({ method: 'get', url: '/www/public/shangbao/exportteather', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '学生数据.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, customUpload(params) { var that = this that.loading = true var type //1省,2区县,3学校 下载工作组导入模版 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} //var user = this.$store.state.user //220省310市410区县 if(user.Roles.includes('220')){ type = 1 }else if(user.Roles.includes('310')){ type = 2 }else if(user.Roles.includes('410')){ type = 3 }else if(user.Roles.includes('450')){ //基教4高教5 var xxjd = localStorage.getItem('xxjd') if(['1','2','3','4'].includes(xxjd)){ type = 4 }else{ type = 5 } } const formData = new FormData() console.log(params.file,'params.file') formData.append('file', params.file) // 这是file入参,文件信息 // 如果extraParams是个单独的值,直接加入 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var roles=user.UserFilter.urole // 调接口 axios.post(`/www/public/shangbao/uploadgzztemp?type=${type}`, formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ that.$message.success('导入成功') that.loading = false that.getList() }else{ that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false console.error(error); }); }, onError(){}, del(row){ var that = this const params = { ids:JSON.stringify([row.id]), } $.post("/www/public/shangbao/del_school_gzry", params, function(res){ if(res.success==1){ that.$message.success('删除成功') that.getList() }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{}) }, handleEdit(row){ this.isEdit = true this.$refs.baseDialoggzz1.show() this.$nextTick(()=>{ this.$refs.ruleFormgzz.resetFields() // 重新设置表单数据 this.ruleForm = { roleid: row.gzzroleid, id: row.id, xm: row.xm, sjh: row.sjh, yx: row.yx, odesc: row.odesc, xb: row.xb, dw: row.dw, zw: row.zw } console.log(this.ruleForm,'ruleForm') }) }, validatePhoneNumber(phoneNumber) { const regex = /^(0\d{2,3}[- ]?\d{7,8})|(1[3-9]\d{9})$/; return regex.test(phoneNumber); }, validateEmail(email) { const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; return emailRegex.test(email); }, submit(){ var that = this this.$refs['ruleFormgzz'].validate((valid) => { if (valid) { let that = this; //const {xm,zw,roleid,sjh,yx,xb,zw,dw} = that.ruleForm let newArr = {...this.ruleForm} newArr.id = this.ruleForm.id console.log(newArr,'newArr') $.post('/www/public/shouye/jd_gzzbm',{params:JSON.stringify(newArr)}, function(msg){ if(msg.success == 1){ if(newArr.id){ that.$message.success('修改成功') }else{ that.$message.success('添加成功') } that.$refs.baseDialoggzz1.close() that.getList() }else{ that.$message({ type: 'error', message: msg.message }); } }).fail(function(jqXHR, textStatus, errorThrown){ that.$message({ type: 'error', message: errorThrown }); }) /*}else{ alert(2) $.post('/www/public/shangbao/edit_school_gzry',newArr, function(msg){ if(msg.success == 1){ that.$message.success('修改成功') that.$refs.baseDialoggzz1.close() that.getList() }else{ that.$message({ type: 'error', message: msg.message }); } }).fail(function(jqXHR, textStatus, errorThrown){ that.$message({ type: 'error', message: errorThrown }); }) }*/ } else { return false; } }); }, handleAdd(){ this.isEdit = false this.$refs.baseDialoggzz1.show() this.$nextTick(()=>{ this.$refs.ruleFormgzz.resetFields() this.ruleForm = {xm:'',xb:'',sjh:'',yx:'',zw:'',roleid:'',dw:'',odesc:''} }) }, show(){ this.getRole() this.getList() console.log(this.$refs.baseDialoggzz0,'baseDialoggzz0') this.$refs.baseDialoggzz0.show() }, getRole(){ var that = this var otype var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var roles = user.Roles if(roles.indexOf('450')!=-1){ //基教4高教5 var xxjd = localStorage.getItem('xxjd') if(['1','2','3','4'].includes(xxjd)){ otype = '4' }else{ otype = '5' } } if(roles.indexOf('410')!=-1){ otype = '3' } if(roles.indexOf('310')!=-1){ otype = '2' } if(roles.indexOf('220')!=-1){ otype = '1' } const params = { otype } $.post("/www/public/shouye/jd_gzzbm_cxrole",params,res=>{ if(res.code==200&&res.data){ that.roleOption = res.data that.tishi = '' res.data.forEach(item=>{ that.tishi+= '

' that.tishi+=item.ovalue that.tishi+='('+item.rsc+'),' that.tishi+=item.odesc+'。' that.tishi+= '

' }) } }).fail((jqXHR, textStatus, errorThrown)=>{ that.$message({ type: 'error', message: errorThrown }); }) }, getList(){ var that = this //otype 1 省级 2 区县 3 学校 var otype var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var roles = user.Roles if(roles.indexOf('450')!=-1){ //基教4高教5 var xxjd = localStorage.getItem('xxjd') if(['1','2','3','4'].includes(xxjd)){ otype = '4' }else{ otype = '5' } } if(roles.indexOf('410')!=-1){ otype = '3' } if(roles.indexOf('310')!=-1){ otype = '2' } if(roles.indexOf('220')!=-1){ otype = '1' } const params = { otype } $.post("/www/public/shouye/jd_gzzbm_fxList", params, function(res){ if(res.success==1){ that.tableData = res.data }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, getClass(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { schoolid } $.get("/www/public/shangbao/findschoolbj", params, function(res){ if(res.success==1){ that.classList = res.data }else{ this.$message.error(res.message) } }).fail((xhr,status,error)=>{ this.$message.error('请求错误') }) }, handleConfirm(){ this.$refs.baseDialogjs.close() }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.getList() }, handleClick(){}, handleClose(){ console.log(1) this.dialogVisible = false }, toggleSelection(rows) { if (rows) { rows.forEach(row => { this.$refs.multipleTable.toggleRowSelection(row); }); } else { this.$refs.multipleTable.clearSelection(); } }, handleSelectionChange(val) { this.multipleSelection = val; } }, computed:{ }, watch:{ }, created: function(){ this.user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} if(this.user.Roles.includes('450')){ this.fetchUnitList() } this.getgzzshzt() }, mounted: function(){ // 获取回显数据 this.getZgdwbmById() }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-BZRHomePage-view", function(resolve, reject){ var template = "
\n
\n
\n
\n 您好,{{userInfo.Nickname}}班主任~\n
\n\n
\n
\n
\n \n
\n
\n
\n\n
\n
\n
\n
\n \n
\n
\n
\n 学习要求\n
\n
\n 勤奋、专注、思考、实践\n
\n
\n
\n
\n
\n \n
\n
\n
\n 学习课程\n
\n
\n 应知应会,方能胜任\n
\n
\n
\n
\n
\n \n\n
\n
\n
\n 在线考试\n
\n
\n 冷静分析,沉着应对\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n 考试记录\n
\n
\n 即时记录,准确回顾\n
\n
\n
\n
\n
\n \n
\n
\n
\n 教师测评\n
\n
\n 精准评估,科学考量\n
\n
\n
\n\n \n
\n
\n \n
\n
\n
\n 预约访谈\n
\n
\n 精准对接,高效沟通\n
\n
\n
\n
\n
\n \n
\n
\n
\n 进度督查\n
\n
\n 监督进度,确保高效\n
\n
\n
\n
\n
\n \n
\n
\n
\n 通知公告\n
\n
\n 重要通知,及时关注\n
\n
\n
\n
\n
\n \n
\n
\n
\n 资料下载\n
\n
\n 各类资料,应有尽有\n
\n
\n
\n
\n
\n\n
\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { butList:[], active:0, tzggList:[], value:'', reverse: false, crq:'', rqList:[], butList:[], active:0, tzggList:[], value:'', reverse: false, crq:'', rqList:[], currentList:[], userInfo:{}, type:'', gzdwmc:'', ifqs:'', currentList:[], glyxm:'', buttomList:[ { img:'/content/image/xljkImg/jscp.png', title:"教师测评", description:"学生自测,快速监测更安心", background:"radial-gradient( 0% 100% at 0% 0%, #2C79F9 0%, #56ADFF 100%)", url:"/BZRevaluationList" }, { img:'/content/image/xljkImg/预约访谈.png', title:"预约访谈", description:"快速预约,解决学生心理问题", background:"radial-gradient( 0% 95% at 0% 0%, #FF7E27 0%, #FFAA41 100%)", url:"/BZRyyft" }, { img:'/content/image/xljkImg/进度督查.png', title:"进度督查", description:"学生测试进度,一目了然", background:"radial-gradient( 0% 100% at 0% 0%, #00B8CD 0%, #24D4B9 100%)", url:"/BZRjddc" }, { img:'/content/image/xljkImg/资料下载.png', title:"资料下载", description:"各类资料,应有尽有", background:"linear-gradient( 180deg, #8564FF 0%, #918DFF 100%)", url:"/BZRzlxz1" }, ] }; }, methods: { goPage(url){ this.$router.push(url) }, getImgsrc:function(val) { return "/content/image/xljkImg/"+val }, getIndex(index){ this.active = index }, onPanelChange(value, mode) { console.log(value, mode); }, getDay(val){ if(this.rqList.length>0){ if(val.type=='current-month'){ //this.currentList.push(val.day) } if(val.type=='current-month'&&this.rqList.indexOf(val.day)>=0){ return true }else{ return false } } }, getDate(val){ //console.log(this.currentList) this.crq = val this.getdb() }, //获取待办 getdb:function(){ let that = this //$.post("/www/py/fwpt/test", {crq:this.crq}, function(res){ $.post("/www/py/fwpt/user_event", {crq:this.crq}, function(res){ if(res.success==1){ if(res.data.data){ that.tzggList = res.data.data that.rqList = res.data.rq } } }) }, //获取学段 getxxjd(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID this.Nickname = user.Nickname const params1 = { schoolid } $.get("/www/public/shangbao/findschoolxd", params1, function(res){ if(res.success==1){ localStorage.setItem('xxjd',res.data.xd) }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, glyxmget(){ var glyInfo = localStorage.getItem('glyInfo')?JSON.parse(localStorage.getItem('glyInfo')):{} this.glyxm = glyInfo.glyxm }, gointerviewLS(status) { this.$router.push({ path: '/interviewLS', query: { status: status } }); }, gg(){ window.open('https://xinlijc.bnu.edu.cn/www/dd/vue/spa/xljk#/FTnotice','_blank') }, czsc(){ window.open('https://xinlijc.bnu.edu.cn/content/image/xljkImg/ftsc.pdf','_blank') }, kszs(){ const that =this let data = { } $.post("/www/public/shouye/px_ftlssy_zscx", data, function(res){ if(res.error==0){ window.open(res.data.url) }else{ that.$message.error(res.message) } }) }, ksft(){ const that = this console.log(that.type) if(that.type==1){ if(that.ifqs==1){ this.$router.push({ path: '/interviewLS', }); }else{ that.$router.push('aggerTeacher') } } if(this.type==2){ that.$alert('该访谈员未完成培训无法开始访谈', '提示', { confirmButtonText: '确定', type: 'warning', callback: action => { } }); } }, routerPush(path){ this.$router.push(path) }, getImgsrc:function(val) { return "/content/image/xljkImg/"+val }, getIndex(index){ this.active = index }, onPanelChange(value, mode) { console.log(value, mode); }, getDay(val){ if(this.rqList.length>0){ if(val.type=='current-month'){ //this.currentList.push(val.day) } if(val.type=='current-month'&&this.rqList.indexOf(val.day)>=0){ return true }else{ return false } } }, getDate(val){ //console.log(this.currentList) this.crq = val this.getdb() }, //获取待办 getdb:function(){ let that = this //$.post("/www/py/fwpt/test", {crq:this.crq}, function(res){ $.post("/www/py/fwpt/user_event", {crq:this.crq}, function(res){ if(res.success==1){ if(res.data.data){ that.tzggList = res.data.data that.rqList = res.data.rq } } }) }, }, computed:{ }, created: function(){ let that = this that.getdb() that.userInfo =localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} $.post("/www/public/shouye/px_fty_sfftls", {}, function(res){ that.gzdwmc = res.data.gzdwmc that.type=res.data.type that.ifqs=res.data.ifqs }) that.getdb() that.getxxjd() }, mounted: function(){ setTimeout(()=>{ this.glyxmget() },1000) }, props: ['title', 'data', 'config','isHeight'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-BZRzlxz1-view", function(resolve, reject){ var template = "
\n \n
\n
\n
\n \n 资料下载\n
\n
\n
\n \n
\n \n
\n \n {{item.otitle}}\n \n
\n
\n
\n
\n \n \n 下载\n \n
\n
\n
\n
\n
\n \n \n
\n\n\n
\n\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), pages:{ pageSize:5, pageNo:1 }, List:[], typeMap:["/jpglogo.png","/yasuologo.png","/mp4logo.png","/wordlogo.png","/excellogo.png","/pdflogo.png"], loopData0: [ ], total:0, constants: {},}; }, methods: { handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.getList() }, download(item){ var that = this const params = { path:item.fileurl, fileName:item.otitle+'.'+item.fileurl.split('.')[1] } window.open(item.fileurl) /*axios({ method: 'get', url: '/www/public/shangbao/attachmentDownload', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', params.fileName); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } })*/ }, getFileTypeUrl(name){ var url = '' if(name){ var arr = name.split('.') if(arr&&arr.length){ var houzhui = arr[1] if(houzhui=='pdf'){ url = '/content/image/xljkImg/pdf.png' }else if(houzhui=='xls'||houzhui=='xlsx'){ url = '/content/image/xljkImg/exceltubiao.png' }else if(houzhui=='jpg'||houzhui=='jpeg'||houzhui=='png'){ url = '/content/image/xljkImg/jpg.png' }else if(houzhui=='doc'||houzhui=='docx'){ url = '/content/image/xljkImg/word.png' }else{ url = '/content/image/xljkImg/qtwjlx.png' } } } return url }, getList(){ var that = this const params = { type:'3', ...this.pages } $.get("/www/public/shangbao/findtzgg", params, function(res){ if(res.success==1){ that.loopData0 = res.data that.total = res.total }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, }, created: function(){ this.getList() }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-BZRnav", function(resolve, reject){ var template = "
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n
\n 取 消\n 确 定\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
\n 取 消\n 确 定\n
\n
\n
\n
\n \"\"/\n

\n 学生学习生活与心理素养调查\n

\n
\n
\n \n \"\"/\n \n

\n {{Nickname}}\n \n

\n \n 个人信息\n 修改密码\n 退出登录\n \n
\n\n
\n
\n
\n

\n \n 返回/ {{currentPage}}\n

\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), searchValue:'', dialogVisible:false, dialogVisibles:false, formLabelWidth: '130px', form: { xm: '', xb: '', sr: '', sjhm: '', yx: '', nl: '', qq: '', wx: '', qtlxdh: '', grsm: '', }, forms: { oldpassword: '', newpassword: '', confirmNewpassword: '' }, rules: { }, ruless: { oldpassword: [ { required: true, message: '请输入当前密码', trigger: 'blur' } ], newpassword: [ { required: true, message: '请输入新密码', trigger: 'blur' }, { pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[@$!%*?&=])[A-Za-z\d@$!%*?&=]{8,14}$/, message: '密码格式不符合要求,需包含字母、数字和特殊字符,长度8-14位', trigger: 'blur' } ], confirmNewpassword: [ { required: true, message: '请再次输入新密码', trigger: 'blur' }, { validator: this.validatePasswordMatch, trigger: 'blur' } ] } }; }, methods: { validatePasswordMatch(rule, value, callback) { if (value !== this.forms.newpassword) { callback(new Error('两次输入的新密码不一致')); } else { callback(); } }, formatDate(date) { const d = new Date(date); const year = d.getFullYear(); const month = ('0' + (d.getMonth() + 1)).slice(-2); const day = ('0' + d.getDate()).slice(-2); return `${year}-${month}-${day}`; }, save() { const that = this if (that.form.sr) { that.form.sr = that.formatDate(that.form.sr); } that.$refs.formRef.validate((valid) => { if (valid) { const id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:'' let data = { ...that.form, } $.post("/www/public/shangbao/edituserinfo ", data, function(res){ if(res.error==0){ that.$message.success('提交成功') that.dialogVisible =false }else{ that.$message.error(res.message) } }) } else { console.error('表单验证失败'); return false; } });}, saves() { const that = this that.$refs.formRefs.validate((valid) => { if (valid) { const id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:'' let data = { ...that.forms } $.post("/www/public/shangbao/editPassword", data, function(res){ if(res.error==0){ that.$message.success('修改成功') that.dialogVisibles =false }else{ that.$message.error(res.message) } }) } else { console.error('表单验证失败'); return false; } });}, jfjc(){ this.dialogVisible =true }, jfjcs(){ this.dialogVisibles =true }, goHome(){ this.$router.go(-1) }, grxx(){}, xgmm(){}, logout(){ localStorage.removeItem('user') this.$router.replace('/login') } }, created: function(){ const that = this const id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:'' let data ={ xxyid : id } $.get("/www/public/shangbao/finduserinfo", data, function(res){ if(res.error==0){ that.form = res.data }else{ that.$message.error(res.message) } }) }, mounted: function(){ }, computed:{ Nickname(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} return user.Nickname } }, props: ['title', 'data', 'config','currentPage'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-BZRjddc-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n
\n \n

\n 测评进度\n

\n

\n 测评进度,一目了然\n

\n
\n
\n \n

\n 访谈进度\n

\n

\n 访谈进度,一目了然\n

\n
\n \n
\n \n\t\t\n\n
\n\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid() }; }, methods: { showJindu(type){ this.$refs.BZRdialog.show(type) }, }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-BZRyyft-view", function(resolve, reject){ var template = "
\n \n
\n
\n
\n
\n

\n \n 预约列表\n

\n 一键预约\n
\n\n
\n
\n
\n
\n \n
\n
\n {{item.xsmc}} \n
\n
\n
\n
\n 年级:{{item.nj}}\n
\n
\n 班级:{{item.bj}}\n
\n
\n 联系方式: {{item.xssjh}} \n
\n
\n 访谈老师: {{item.ftls}} \n
\n
\n 访谈时间: {{item.yysj}} \n
\n
\n 访谈地址: {{item.ftdz}} \n
\n \n
\n
\n
\n
\n \n
\n 暂无数据\n
\n
\n \n
\n \n \n\n\n
\n
\n\n
\n\n\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), ftsj:new Date(), yyzt:'', pages:{ pagesize:9, pagenum:1, }, total:0, stuList:[], listData:[], user:null, currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4 }; }, methods: { goyuyue(){ this.$router.push({ path:'/BZRyuyue' }) }, getStuList(){ var that = this const params = { //userid,yhjs,ftzt schoolid:this.schoolid, userid:this.schoolid, yhjs:JSON.stringify([this.yhjs]), ftzt:'1', ...this.pages } console.log(params,'params') $.post("/www/public/shouye/ft_ftyystu", params, function(res){ if(res.success==1){ that.stuList = res.data that.total = res.total }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, formatDate(date) { const year = date.getFullYear(); const month = (date.getMonth() + 1).toString().padStart(2, '0'); const day = date.getDate().toString().padStart(2, '0'); return `${year}-${month}-${day}`; }, handleDateChange(val){ console.log(val,'va;') this.getList() }, changeYyzt(val){ this.yyzt = val this.getList() }, getList(){ var that = this const params = { ftsj:this.formatDate(this.ftsj), yyzt:this.yyzt, ...this.pages, schoolid:this.schoolid } console.log(params,'params') $.post("/www/public/shouye/ft_ftyyls", params, function(res){ if(res.success==1){ that.listData = res.data }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, goyuyue(item){ this.$router.push({ path:"/BZRyuyue", query:{ item:JSON.stringify(item) } }) }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pagesize = val this.getStuList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pagenum = val this.getStuList() } }, created: function(){ this.user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.schoolid = this.user.ID this.Nickname = this.user.Nickname this.yhjs = this.user.UserFilter.urole this.getStuList() }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-BZRyuyue-view", function(resolve, reject){ var template = "
\n \n
\n
\n
\n \n

\n 点击选择访谈老师\n

\n
\n
\n \n
\n

\n {{item.name}}\n

\n

\n 常见的轻中度抑郁症、焦虑症、疑病症、恐惧症、强迫症心理疏导\n

\n
\n\n
\n
\n
\n
\n \n
\n
\n
\n
\n

\n {{cur.name}}\n

\n 已选择访谈老师\n
\n

\n 常见的轻中度抑郁症、焦虑症、疑病症、\n 恐惧症、强迫症心理疏导\n

\n
\n
\n
\n
\n
\n \n

\n 电话:{{cur.phone}}\n

\n
\n
\n \n

\n 职务:{{cur.zw}}\n

\n
\n\n\n
\n
\n
\n \n

\n 专业:{{cur.zy}}\n

\n
\n
\n \n

\n 擅长:心理访谈\n

\n
\n
\n\n
\n\n
\n
\n \n

\n 访谈时间\n

\n \n \n \n \n

\n 待访谈学生\n

\n
\n
\n

\n 专业\n

\n \n \n \n \n
\n
\n

\n 班级\n

\n \n \n \n \n
\n\n
\n \n \n \n
\n \n {{item.xsmc}}\n
\n
\n
\n

5\" class=\"chakangengduo\" @click=\"showmore\">\n {{!showallstu?'查看更多':'收起'}}\n

\n
\n
\n \n

\n 暂无学生!\n

\n
\n

\n 访谈地点\n

\n \n \n \n \n 短信提醒\n \n
\n 一键预约\n
\n\n\n
\n\n\n
\t\n
\n\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), cur:{}, listData:[], value2:'', form:{name:'',stulist:[],ftdz:'',date:'',sfdx:''}, checkList:[], stuList:[], curIndex1:0, optionData:{bj:[],zy:[]}, selectData:{ bj:'',zy:'' }, showallstu:false, rules: { stulist: [ { required: true, message: '请选择学生', trigger: 'blur' }, ], ftdz: [ { required: true, message: '请输入访谈地址', trigger: 'blur' }, ], date: [ { required: true, message: '请选择日期', trigger: 'blur' }, ], sfdx: [ { required: true, message: '请选择是否短信提醒', trigger: 'blur' }, ], }, pickerOptions: { }, }; }, methods: { handlechange(val){ console.log(this.selectData,'selectData') this.getStuList() }, onSubmit(){ var that = this this.$refs.form.validate((valid) => { if (valid) { const params = { ftyid:this.cur.userid, kssj:this.form.date[0], jssj:this.form.date[1], stulist:JSON.stringify(this.form.stulist), ftdz:this.form.ftdz, isfs:this.form.sfdx?'1':'2',// 是否短信提醒, userid:this.schoolid } $.post("/www/public/shouye/ft_stufpls", params, function(res){ if(res.success==1){ that.$message.success('预约成功') that.getList() that.getStuList() }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('预约失败') }) } else { console.log('error submit!!'); return false; } }); }, showmore(){ this.showallstu = !this.showallstu }, changeCur(item,index){ this.curIndex1 = index this.cur = item }, formatDate(date) { const year = date.getFullYear(); const month = (date.getMonth() + 1).toString().padStart(2, '0'); const day = date.getDate().toString().padStart(2, '0'); return `${year}-${month}-${day}`; }, getList(){ var that = this const params = { schoolid:this.schoolid } console.log(params,'params') $.post("/www/public/shouye/ft_ftlslist", params, function(res){ if(res.success==1){ that.listData = res.data if(that.listData.length){ that.cur = that.listData[0]||{} } }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, getslectOption(){ var that = this const params = { userid:this.schoolid, yhjs:JSON.stringify([this.yhjs]), } console.log(params,'params') $.post("/www/public/shouye/ft_ftyystupublic", params, function(res){ if(res.success==1){ res.data.bj? that.optionData.bj = res.data.bj:'' res.data.zy? that.optionData.zy = res.data.zy:'' }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, getStuList(){ var that = this const params = { bj:that.selectData.bj, zy:that.selectData.zy, schoolid:this.schoolid, userid:this.schoolid, yhjs:JSON.stringify([this.yhjs]), ftzt:'0' } console.log(params,'params') $.post("/www/public/shouye/ft_ftyystu", params, function(res){ if(res.success==1){ that.stuList = res.data }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) } }, created: function(){ this.user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.xxjd = localStorage.getItem('xxjd') this.schoolid = this.user.ID this.Nickname = this.user.Nickname this.yhjs = this.user.UserFilter.urole this.getList() this.getStuList() this.getslectOption() }, computed:{ showStulist(){ if(!this.showallstu){ return this.stuList.slice(0,5) }else{ return this.stuList.slice(0) } } }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-BZRevaluationList-view", function(resolve, reject){ var template = "
\n \n\n
\n
\n
\n
\n
\n \n
\n
\n 暂无内容\n
\n
\n
\n
\n
\n \n
\n
\n
\n \n
\n
\n ● 进行中\n
\n
\n {{item.stmc}}\n
\n
\n
\n 答题角色 : {{jsMap[item.js]}}\n
\n \n
\n
\n \n
\n 请认真答题再提交。请仔细阅读每条测试项目,务必把意思弄明白理解清楚然后根据最近一周的实际感觉,选择最符合自己的选项。本测验共30道题预计用时5分钟左右。\n
\n
\n 是否签署参与测评同意书\n\n
\n
\n 进入测试系统\n
\n
\n
\n
\n 立即测评\n
\n
\n
\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), dataList:[], Loading: false, visibleIntroduceDialog: false, checked:false, item:'', jsMap:{ '500':'学生', '720':'班主任(辅导员)', '710':'心理老师', '730':'校长', '700':'学科老师', '750':'信息员', } }; }, methods: { goTest(item){ this.$router.push({ path: 'beforeEvaluations', query: { gaugeId:item.sjid } }); }, dialog(item){ this.visibleIntroduceDialog = true this.item = item }, getImgsrc(val) { return "/content/image/xljkImg/"+val }, checkbox(){ this.$router.push('agger') }, getGaugelist(){ let that = this let data = { } $.post("/www/public/st/getstlist", data, function(res){ if(res.code==200){ that.dataList = res.data } }) }, }, created: function(){ let that = this that.getGaugelist() }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XXHomePage-view", function(resolve, reject){ var template = "
\n \n \n

访谈时间:{{data?data.yysj:''}}

\n

访谈地址:{{data?data.ftdz:''}}

\n

访谈老师:{{data?data.ftls:''}}

\n

\n 请认真答题再提交。请仔细阅读每条测试项目,务必把意思弄明白理解清楚,然后根据最近一周的实际感觉,选择最符合自己的选项。本测验共30道题,预计用时5分钟左右。\n

\n \n 确 定\n \n \n
\n
\n
\n 您好,{{Nickname}}同学~\n
\n\n
\n
\n
\n \n
\n
\n
\n
\n
\n \n

\n 学生测评\n

\n

\n 进行全国心理测评\n

\n
\n
\n \n

\n 访谈任务\n

\n

\n 查看访谈任务\n

\n
\n \n
\n \n

\n 操作手册\n

\n

\n 下载查看操作手册\n

\n
\n
\n
\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { butList:[], active:0, tzggList:[], value:'', reverse: false, crq:'', rqList:[], currentList:[], glyxm:'', dialogVisible:false, data:'', status:false }; }, methods: { ftrw(){ if(this.status){ this.dialogVisible=true }else{ this.$alert('暂无访谈任务', '提示', { confirmButtonText: '确定', callback: action => { } } ) } }, czsc(){ window.open('https://hhqjjrli3n.feishu.cn/wiki/space/7408092979324387331?ccm_open_type=lark_wiki_spaceLink&open_tab_from=wiki_home','_blank') }, goPage(url){ this.$router.push(url) }, getImgsrc:function(val) { return "/content/image/xljkImg/"+val }, getIndex(index){ this.active = index }, onPanelChange(value, mode) { console.log(value, mode); }, getDay(val){ if(this.rqList.length>0){ if(val.type=='current-month'){ //this.currentList.push(val.day) } if(val.type=='current-month'&&this.rqList.indexOf(val.day)>=0){ return true }else{ return false } } }, getDate(val){ //console.log(this.currentList) this.crq = val this.getdb() }, //获取待办 getdb:function(){ let that = this //$.post("/www/py/fwpt/test", {crq:this.crq}, function(res){ $.post("/www/py/fwpt/user_event", {crq:this.crq}, function(res){ if(res.success==1){ if(res.data.data){ that.tzggList = res.data.data that.rqList = res.data.rq } } }) }, glyxmget(){ var glyInfo = localStorage.getItem('glyInfo')?JSON.parse(localStorage.getItem('glyInfo')):{} this.glyxm = glyInfo.glyxm } }, computed:{ }, created: function(){ let that =this let id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:{} let data = { stuid:id } $.post("/www/public/shouye/ft_stuftrw", data, function(res){ if(res.error ==0&&res.data.length>=1){ that.data = res.data[0] that.status = true console.log(that.data) }else{ } }) var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID this.Nickname = user.Nickname that.getdb() }, mounted: function(){ setTimeout(()=>{ this.glyxmget() },1000) }, props: ['title', 'data', 'config','isHeight'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDxiafaDialog", function(resolve, reject){ var template = "
\n \n \n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), loading:false, dialogVisible: false, tableData: [], multipleSelection: [], currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4, total:0, pages:{ pageNo:1, pageSize:5 }, } }, methods:{ handlebeforeClose(){ this.$emit('closeDialog') }, exportFn(){ var that = this var name //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var username = user.Username var bm = username.substring(3) let type if(user.Roles.includes('220')){ type='1' name = '市级管理员账号信息.xls' if(['110000','120000','310000','500000'].includes(bm)){ type='1' name = '区县管理员账号信息.xls' } }else if(user.Roles.includes('310')){ type='2' name = '区县管理员账号信息.xls' } const params = { username:user.Username, type, state:'1' } axios({ method: 'get', url: '/www/public/shangbao/dcsqxzh', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, show(){ this.getList() this.$refs.baseDialogjs.show() }, getList(){ var that = this //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} //type 1 市账号 2区县账号 let type if(user.Roles.includes('220')){ type='1' }else if(user.Roles.includes('310')){ type='2' } const params = { username:user.Username, type, ...this.pages } $.get("/www/public/shangbao/findsqxzh", params, function(res){ if(res.success==1){ that.tableData = res.data that.total = res.total }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.getList() }, handleClick(){}, handleClose(){ console.log(1) this.dialogVisible = false }, toggleSelection(rows) { if (rows) { rows.forEach(row => { this.$refs.multipleTable.toggleRowSelection(row); }); } else { this.$refs.multipleTable.clearSelection(); } }, handleSelectionChange(val) { this.multipleSelection = val; } }, computed:{ }, watch:{ }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XXzlxz1-view", function(resolve, reject){ var template = "
\n \n
\n
\n
\n \n 资料下载\n
\n
\n
\n \n
\n \n
\n \n {{item.otitle}}\n \n
\n
\n
\n
\n \n \n 下载\n \n
\n
\n
\n
\n
\n \n \n
\n\n\n
\n\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), pages:{ pageSize:5, pageNo:1 }, List:[], typeMap:["/jpglogo.png","/yasuologo.png","/mp4logo.png","/wordlogo.png","/excellogo.png","/pdflogo.png"], loopData0: [ ], total:0, constants: {},}; }, methods: { handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.getList() }, download(item){ var that = this const params = { path:item.fileurl, fileName:item.otitle+'.'+item.fileurl.split('.')[1] } window.open(item.fileurl) /*axios({ method: 'get', url: '/www/public/shangbao/attachmentDownload', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', params.fileName); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } })*/ }, getFileTypeUrl(name){ var url = '' if(name){ var arr = name.split('.') if(arr&&arr.length){ var houzhui = arr[1] if(houzhui=='pdf'){ url = '/content/image/xljkImg/pdf.png' }else if(houzhui=='xls'||houzhui=='xlsx'){ url = '/content/image/xljkImg/exceltubiao.png' }else if(houzhui=='jpg'||houzhui=='jpeg'||houzhui=='png'){ url = '/content/image/xljkImg/jpg.png' }else if(houzhui=='doc'||houzhui=='docx'){ url = '/content/image/xljkImg/word.png' }else{ url = '/content/image/xljkImg/qtwjlx.png' } } } return url }, getList(){ var that = this const params = { type:'3', ...this.pages } $.get("/www/public/shangbao/findtzgg", params, function(res){ if(res.success==1){ that.loopData0 = res.data that.total = res.total }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, }, created: function(){ this.getList() }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XXnav", function(resolve, reject){ var template = "
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n
\n 取 消\n 确 定\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
\n 取 消\n 确 定\n
\n
\n
\n
\n \"\"/\n

\n 学生学习生活与心理素养调查\n

\n
\n
\n \n \"\"/\n \n

\n {{Nickname}}\n \n

\n \n 个人信息\n 修改密码\n 退出登录\n \n
\n\n
\n
\n
\n

\n \n 首页/{{currentPage}}\n

\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), searchValue:'', dialogVisible:false, dialogVisibles:false, formLabelWidth: '130px', form: { xm: '', xb: '', sr: '', sjhm: '', yx: '', nl: '', qq: '', wx: '', qtlxdh: '', grsm: '', }, forms: { oldpassword: '', newpassword: '', confirmNewpassword: '' }, rules: { }, ruless: { oldpassword: [ { required: true, message: '请输入当前密码', trigger: 'blur' } ], newpassword: [ { required: true, message: '请输入新密码', trigger: 'blur' }, { pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,14}$/, message: '密码格式不符合要求,需包含字母、数字和特殊字符,长度8-14位', trigger: 'blur' } ], confirmNewpassword: [ { required: true, message: '请再次输入新密码', trigger: 'blur' }, { validator: this.validatePasswordMatch, trigger: 'blur' } ] } }; }, methods: { validatePasswordMatch(rule, value, callback) { if (value !== this.forms.newpassword) { callback(new Error('两次输入的新密码不一致')); } else { callback(); } }, formatDate(date) { const d = new Date(date); const year = d.getFullYear(); const month = ('0' + (d.getMonth() + 1)).slice(-2); const day = ('0' + d.getDate()).slice(-2); return `${year}-${month}-${day}`; }, save() { const that = this if (that.form.sr) { that.form.sr = that.formatDate(that.form.sr); } that.$refs.formRef.validate((valid) => { if (valid) { const id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:'' let data = { ...that.form, } $.post("/www/public/shangbao/edituserinfo ", data, function(res){ if(res.error==0){ that.$message.success('提交成功') that.dialogVisible =false }else{ that.$message.error(res.message) } }) } else { console.error('表单验证失败'); return false; } });}, saves() { const that = this that.$refs.formRefs.validate((valid) => { if (valid) { const id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:'' let data = { ...that.forms } $.post("/www/public/shangbao/editPassword", data, function(res){ if(res.error==0){ that.$message.success('修改成功') that.dialogVisible =false }else{ that.$message.error(res.message) } }) } else { console.error('表单验证失败'); return false; } });}, jfjc(){ this.dialogVisible =true }, jfjcs(){ this.dialogVisibles =true }, goHome(){ }, grxx(){}, xgmm(){}, logout(){ localStorage.removeItem('user') this.$router.replace('/login') } }, created: function(){ const that = this const id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:'' let data ={ xxyid : id } $.get("/www/public/shangbao/finduserinfo", data, function(res){ if(res.error==0){ that.form = res.data }else{ that.$message.error(res.message) } }) }, mounted: function(){ }, computed:{ Nickname(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} return user.Nickname } }, props: ['title', 'data', 'config','currentPage'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XXevaluationList-view", function(resolve, reject){ var template = "
\n \n\n
\n
\n
\n
\n
\n \n
\n
\n 暂无内容\n
\n
\n
\n
\n
\n \n
\n
\n
\n \n
\n
\n ● 进行中\n
\n
\n {{item.stmc}}\n
\n
\n
\n 答题角色 : {{jsMap[item.js]}}\n
\n \n
\n
\n \n
\n 请认真答题再提交。请仔细阅读每条测试项目,务必把意思弄明白理解清楚然后根据最近一周的实际感觉,选择最符合自己的选项。本测验共30道题预计用时5分钟左右。\n
\n
\n 是否签署参与测评同意书\n\n
\n
\n 进入测试系统\n
\n
\n
\n
\n 立即测评\n
\n
\n
\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), dataList:[], Loading: false, visibleIntroduceDialog: false, checked:false, item:'', jsMap:{ '500':'学生', '720':'班主任(辅导员)', '710':'心理老师', '730':'校长', '700':'学科老师', '750':'信息员', } }; }, methods: { goTest(item){ this.$router.push({ path: 'beforeEvaluations', query: { gaugeId:item.sjid } }); }, dialog(item){ this.visibleIntroduceDialog = true this.item = item }, getImgsrc(val) { return "/content/image/xljkImg/"+val }, checkbox(){ this.$router.push('agger') }, getGaugelist(){ let that = this let data = { } $.post("/www/public/st/getstlist", data, function(res){ if(res.code==200){ that.dataList = res.data } }) }, }, created: function(){ let that = this that.getGaugelist() }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDzxxxiafaDialog", function(resolve, reject){ var template = "
\n \n \n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), loading:false, dialogVisible: false, tableData: [], multipleSelection: [], currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4, pages:{ pageNo:1, pageSize:5 }, } }, methods:{ handlebeforeClose(){ this.$emit('closeDialog') }, exportFn(){ var that = this //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let type if(user.Roles.includes('220')){ type='1' }else if(user.Roles.includes('310')){ type='2' } const params = { username:user.Username, type, state:'1', } axios({ method: 'get', url: '/www/public/shangbao/exportzgxxx', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', '直管校管理员账号.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, show(){ this.getList() this.$refs.baseDialogjs.show() }, getList(){ var that = this const params = { ...that.pages } $.get("/www/public/shangbao/findzgxxx", params, function(res){ if(res.success==1){ that.tableData = res.data that.total = res.total }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.getList() }, handleClick(){}, handleClose(){ console.log(1) this.dialogVisible = false }, toggleSelection(rows) { if (rows) { rows.forEach(row => { this.$refs.multipleTable.toggleRowSelection(row); }); } else { this.$refs.multipleTable.clearSelection(); } }, handleSelectionChange(val) { this.multipleSelection = val; } }, computed:{ }, watch:{ }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XXYHomePage-view", function(resolve, reject){ var template = "
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n 取 消\n 确 定\n
\n
\n \n

\n 消防宣传进高校 新生齐学防火课 兰州消防消防宣传进高校 新生齐学防火课 兰州消防\n

\n

\n 发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间\n

\n

\n 发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间发布单位:甘南藏族自治州教育局 发布时间\n

\n \n \n \n
\n
\n
\n {{Nickname}}\n
\n
\n 欢迎您,{{glyxm}}!\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n \n

\n 机房检查\n

\n

\n 机房信息,一目了然\n

\n
\n
\n \n

\n 作答测试\n

\n

\n 教师自测,快速监测更安心\n

\n
\n
\n \n

\n 要求须知\n

\n

\n 要求须知,注意事项\n

\n
\n
\n
\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { butList:[], active:0, tzggList:[], value:'', reverse: false, crq:'', rqList:[], currentList:[], glyxm:'', dialogVisible:false, dialogVisibleText:false, data:'', status:false, formLabelWidth: '120px', dataStatus:true, form: { jfsl: '', dnsl: '', sflw: '', xxdk: '', czxt: '', llqmc: '', sfydn: '', }, rules: { jfsl: [{ required: true, message: '机房数量不能为空', trigger: 'blur' }], dnsl: [{ required: true, message: '电脑数量不能为空', trigger: 'blur' }], sflw: [{ required: true, message: '是否联网不能为空', trigger: 'change' }], xxdk: [{ required: true, message: '下行带宽不能为空', trigger: 'blur' }], czxt: [{ required: true, message: '操作系统不能为空', trigger: 'blur' }], llqmc: [{ required: true, message: '浏览器名称不能为空', trigger: 'blur' }], sfydn: [{ required: true, message: '是否云电脑不能为空', trigger: 'change' }] } }; }, methods: { save() { const that = this that.$refs.formRef.validate((valid) => { if (valid) { const id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:'' let data = { xxyid:that.dataStatus?id:'', ...that.form } $.post("/www/public/shangbao/addjfxx", data, function(res){ if(res.error==0){ that.$message.success('提交成功') that.dialogVisible =false }else{ that.$message.error(res.message) } }) } else { console.error('表单验证失败'); return false; } });}, jfjc(){ this.dialogVisible =true }, yqxz(){ this.dialogVisibleText=true }, goPage(url){ this.$router.push(url) }, getImgsrc:function(val) { return "/content/image/xljkImg/"+val }, getIndex(index){ this.active = index }, onPanelChange(value, mode) { console.log(value, mode); }, getDay(val){ if(this.rqList.length>0){ if(val.type=='current-month'){ //this.currentList.push(val.day) } if(val.type=='current-month'&&this.rqList.indexOf(val.day)>=0){ return true }else{ return false } } }, getDate(val){ //console.log(this.currentList) this.crq = val this.getdb() }, //获取待办 getdb:function(){ let that = this //$.post("/www/py/fwpt/test", {crq:this.crq}, function(res){ $.post("/www/py/fwpt/user_event", {crq:this.crq}, function(res){ if(res.success==1){ if(res.data.data){ that.tzggList = res.data.data that.rqList = res.data.rq } } }) }, //获取学段 getxxjd(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID this.Nickname = user.Nickname const params1 = { schoolid } $.get("/www/public/shangbao/findschoolxd", params1, function(res){ if(res.success==1){ localStorage.setItem('xxjd',res.data.xd) }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, glyxmget(){ var glyInfo = localStorage.getItem('glyInfo')?JSON.parse(localStorage.getItem('glyInfo')):{} this.glyxm = glyInfo.glyxm } }, computed:{ }, created: function(){ const that = this const id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:'' let data ={ xxyid : id } $.get("/www/public/shangbao/findjfxx", data, function(res){ if(res.error==0){ if(res.data == null){ that.dataStatus = false }else{ that.form = res.data } }else{ that.$message.error(res.message) } }) that.getdb() that.getxxjd() }, mounted: function(){ setTimeout(()=>{ this.glyxmget() },1000) }, props: ['title', 'data', 'config','isHeight'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDjibenzigeshenhe-view", function(resolve, reject){ var template = "
\n \n
\n
\n \n \n \n \n\n \n \n \n\n 批量通过 \n 通过剩余待审核学校\n 重新搜索\n 导出数据\n \n \n
\n \n \n \n
\n
\n 学校名称1:\n {{ chakanForm.bxxx1 || '-' }}\n
\n
\n 学校名称2:\n {{ chakanForm.bxxx2 || '-' }}\n
\n
\n 学校名称3:\n {{ chakanForm.bxxx3 || '-' }}\n
\n
\n
\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n

\n 请确认学校名称是否正确,名称有误时请更正\n

\n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n

\n 请确认学段是否正确\n

\n
\n
\n \n \n \n \n \n \n \n

\n
\n
\n \n
\n \n
\n \n \n

请提供3所同等类型(相同地区、相同学段)的学校,监测工作组从中选择1所作为替换学校

\n
\n
\n \n \n \n \n \n \n \n

\n 请填写完整的学校名称\n

\n
\n
\n \n \n \n \n \n \n \n

\n 可选,请填写完整的学校名称\n

\n
\n
\n \n \n \n \n \n \n \n

\n 可选,请填写完整的学校名称\n

\n
\n
\n
\n
\t\n
\n
\n\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), loading:false, dialogVisible: false, tableData: [], multipleSelection: [], currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4, innerVisible:false, activeName:'first', xxjd:'', xdMap:['','小学','初中','高中','中职','高职','高校',], searchVal:'', sfjj:'', buttonStatus:'', total:0, pages:{ pageNo:1, pageSize:50 }, reruleForm: { sfmc:'',djsmc:'',qxmc:'',xxmc:'',xd:'',sfcz:'',sfcjcp:'',bxxx1:'',bxxx2:'',bxxx3:'' }, ruleForm: { sfmc:'',djsmc:'',qxmc:'',xxmc:'',xd:'',sfcz:'',sfcjcp:'',bxxx1:'',bxxx2:'',bxxx3:'' }, chakanForm: { bxxx1:'',bxxx2:'',bxxx3:'' }, shenheForm:{conment:'',}, user:null, rules: { xxmc: [ { required: true, message: '请输入学校名称', trigger: 'blur' } ], sfcz: [ { required: true, message: '请选择', trigger: 'blur' } ], sfcjcp: [ { required: true, message: '请选择', trigger: 'blur' } ], bxxx1: [ { required: true, message: '请输入备选学校1', trigger: 'blur' } ], }, isEdit:false } }, methods:{ chakanDialogsub(){ const that =this that.$refs.chakanDialog.close() }, getButtonStatus(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { username:user.Username, } $.get("/www/public/bd/pdsfxzxxzh", params, function(res){ if(res.success==1){ that.buttonStatus = res.data }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{}) }, exportFn1(){ var that = this //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { username:user.Username, djsmc:that.djsmc } axios({ method: 'get', url: '/www/public/shangbao/exportxqnxxdc', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', '辖区内学校管理员账号.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, chakan(row){ this.chakanForm.bxxx1 = row.bxxx1 this.chakanForm.bxxx2 = row.bxxx2 this.chakanForm.bxxx3 = row.bxxx3 this.$refs.chakanDialog.show() }, chehui(row){ if(row.gzzcnt!=0){ this.$alert('学校已填写基本信息,无法撤回', '提示', { confirmButtonText: '确定', callback: action => { } }); return } var that = this const params = { schoolid:row.id, } $.post("/www/public/shangbao/editschooldycshch", params, function(res){ if(res.success==1){ that.$message.success('已撤回') that.getList() }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) }, tongguoshenyufn(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var type //type 1省 2市 3区县 if(user.Roles.includes('220')){ type='1' }else if(user.Roles.includes('310')){ type='2' }else if(user.Roles.includes('410')){ type='3' } const params = { type, username:user.Username } $.get("/www/public/shangbao/findjytshxx_all", params, function(res){ if(res.success==1){ that.getList() }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, tongguoshenyu(){ var that = this that.$alert('确认通过剩余所有学校吗', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', center: true }).then(() => { that.tongguoshenyufn() }).catch(() => { }); }, gosearch(){ this.pages.pageNo = 1 this.getList() }, gopiliang(){ var that = this that.$alert('确认批量通过吗', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', center: true }).then(() => { that.piliangshenhe() }).catch(() => { }); }, sfjjchange(val){ this.getList() }, chongzhi(){ this.searchVal = '' this.pages = { pageNo:1, pageSize:50 } this.getList() }, exportFn(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var type //type 1省 2市 3区县 if(user.Roles.includes('220')){ type='1' }else if(user.Roles.includes('310')){ type='2' }else if(user.Roles.includes('410')){ type='3' } const params = { xxmc:this.searchVal, shzt:this.activeName=='first'?'0':this.activeName=='third'?'-1':'1', schoolid, username:user.Username, type, sfjj:that.sfjj, ...this.pages } if(this.activeName=='second'){ params.jbxxshcgzt = '1' } /*const params = { //zgdwbm:user.ID, shzt:that.activeName=='first'?'0':this.activeName=='second'?'1':'-1', type, username:user.Username }*/ axios({ method: 'get', url:'/www/public/shangbao/dcxxjcdshlist', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '学校基本信息.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, tongguo(item){ this.curItem = item this.$refs.baseDialogshenhe.show() }, changeTab(tab, event) { console.log(tab, event); this.searchVal = '' this.pages = { pageNo:1, pageSize:50 } this.getList() }, handlebeforeClose(){ this.$emit('closeDialog') }, onError(){}, handleEdit(row){ this.$refs.baseDialog1js.show() this.$nextTick(()=>{ this.$refs.ruleForm.resetFields() // 使用Vue.set或者Object.assign确保响应式 this.ruleForm = Object.assign({}, { sfmc: row.sfmc || '', djsmc: row.djsmc || '', qxmc: row.qxmc || '', xxmc: row.xxmc || '', xd: row.xd || '', sfcz: row.sfcz || '', sfcjcp: row.sfcjcp || '', id: row.id || '', // 备选学校字段始终为空,不从原始数据获取 bxxx1: '', bxxx2: '', bxxx3: '' }) console.log(this.ruleForm) this.isEdit = true }) }, piliangshenhe(){ var that = this // this.$refs['shenheForm'].validate((valid) => { // if (valid) { const params = { shzt:'1' } params.ids = '' if(!that.multipleSelection.length) return this.$message.warning('请选择要审核的数据') that.multipleSelection.forEach(item=>{ params.ids+=item.id+',' }) if(params.ids.endsWith(',')){ params.ids = params.ids.substring(0,params.ids.length-1) } console.log( params,' params') $.post("/www/public/shangbao/xxyjsh", params, function(res){ if(res.success==1){ that.$message.success('审核成功') that.getList() }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) }, submit(){ var that = this this.$refs['ruleForm'].validate((valid) => { if (valid) { // 如果学校不存在,需要先保存替换学校信息 if(that.ruleForm.sfcz=='2'){ // 校验备选学校1必须填写 if(!that.ruleForm.bxxx1){ that.$message.error('请填写备选学校1'); return; } // 校验已填写的备选学校名称不重复 const schools = []; if(that.ruleForm.bxxx1 && that.ruleForm.bxxx1.trim()) schools.push(that.ruleForm.bxxx1.trim()); if(that.ruleForm.bxxx2 && that.ruleForm.bxxx2.trim()) schools.push(that.ruleForm.bxxx2.trim()); if(that.ruleForm.bxxx3 && that.ruleForm.bxxx3.trim()) schools.push(that.ruleForm.bxxx3.trim()); const uniqueSchools = [...new Set(schools)]; if(uniqueSchools.length !== schools.length){ that.$message.error('备选学校名称不能重复'); return; } // 保存替换学校信息 const replaceParams = { yxx: that.ruleForm.id, // 原学校id bxxx1: that.ruleForm.bxxx1, bxxx2: that.ruleForm.bxxx2 || '', bxxx3: that.ruleForm.bxxx3 || '' }; $.post("/www/public/xxxuanze/xxxzadd", replaceParams, function(res){ if(res.success==1 || res.error==0){ // 替换学校保存成功后,继续执行原有的审核逻辑 that.submitAudit(); }else{ that.$message.error(res.message || '保存替换学校失败'); } }).fail((xhr,status,error)=>{ that.$message.error('保存替换学校请求错误'); }); } else { // 学校存在,直接执行审核逻辑 that.submitAudit(); } } else { console.log('error submit!!'); return false; } }); }, // 执行审核逻辑 submitAudit(){ var that = this; var type = '1' if(that.ruleForm.sfcz=='2'){ type ='-1' }else{ if(that.ruleForm.sfcjcp=='2'){ type=-1 } } const params = { xxmc:that.ruleForm.xxmc, xd:that.ruleForm.xd, schoolid:that.ruleForm.id, sfcz:that.ruleForm.sfcz, sfcjcp:that.ruleForm.sfcjcp, type } $.post("/www/public/shangbao/editschooldycsh", params, function(res){ if(res.success==1){ that.$message.success('审核成功') that.$refs.baseDialog1js.close() that.getList() }else{ that.$message.error(res.message || '审核失败') } }).fail((xhr,status,error)=>{ that.$message.error('审核请求错误') }) }, show(){ this.getList() this.$refs.baseDialogjs.show() }, getList(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var type //type 1省 2市 3区县 if(user.Roles.includes('220')){ type='1' }else if(user.Roles.includes('310')){ type='2' }else if(user.Roles.includes('410')){ type='3' } const params = { xxmc:this.searchVal, shzt:this.activeName=='first'?'0':this.activeName=='third'?'-1':'', schoolid, username:user.Username, type, sfjj:that.sfjj, ...this.pages } if(this.activeName=='second'){ params.jbxxshcgzt = '1' } $.get("/www/public/shangbao/findjytshxx", params, function(res){ if(res.success==1){ that.tableData = res.data that.total = res.total that.getButtonStatus() }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, handleConfirm(){ this.$refs.baseDialogjs.close() }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.getList() }, handleClick(){}, handleClose(){ console.log(1) this.dialogVisible = false }, toggleSelection(rows) { if (rows) { rows.forEach(row => { this.$refs.multipleTable.toggleRowSelection(row); }); } else { this.$refs.multipleTable.clearSelection(); } }, handleSelectionChange(val) { this.multipleSelection = val; } }, computed:{ isXCG(){ if(['1','2','3'].indexOf(this.ruleForm.xxjd)!=-1){ return true } return false } }, watch:{ }, created: function(){ this.user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.xxjd = localStorage.getItem('xxjd') this.getList() }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDzigeshenhehome-view", function(resolve, reject){ var template = "\n
\n
\n \n
\n
\n
\n \n

\n 样本校基本信息审核\n

\n
\n \n
\n \n

\n 工作组信息审核\n

\n
\n
\n \n

\n 直管校上报信息审核\n

\n
\n \n
\n\n
\n
\n \n \n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), user:{}, type:'', }; }, methods: { confirm(){ if(this.type==1){ this.$router.push('/XDjibenzigeshenhe') }else if(this.type==2){ this.$router.push('/XDfangtanxinxishenhe') }else if(this.type==4){ this.$router.push('/zhiguanxiaoshenhe') } }, goshenhe(type){ this.type = type if(type==1){ this.$refs.baseDialogXDjddc.show() //this.$router.push('/XDjibenzigeshenhe') }else if(type==2){ this.$refs.baseDialogXDjddc.show() //this.$router.push('/XDfangtanxinxishenhe') }else if(type==3){ this.$router.push('/allgzzshenhe') }else if(type==4){ this.$refs.baseDialogXDjddc.show() }else if(type==5){ this.$router.push('/allgzzshenhe') } }, }, created: function(){ this.user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XXYevaluationList-view", function(resolve, reject){ var template = "
\n \n\n
\n
\n
\n
\n
\n \n
\n
\n 暂无内容\n
\n
\n
\n
\n
\n \n
\n
\n
\n \n
\n
\n ● 进行中\n
\n
\n {{item.stmc}}\n
\n
\n
\n 答题角色 : {{jsMap[item.js]}}\n
\n \n
\n
\n \n
\n 请认真答题再提交。请仔细阅读每条测试项目,务必把意思弄明白理解清楚然后根据最近一周的实际感觉,选择最符合自己的选项。本测验共30道题预计用时5分钟左右。\n
\n
\n 是否签署参与测评同意书\n\n
\n
\n 进入测试系统\n
\n
\n
\n
\n 立即测评\n
\n
\n
\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), dataList:[], Loading: false, visibleIntroduceDialog: false, checked:false, item:'', jsMap:{ '500':'学生', '720':'班主任(辅导员)', '710':'心理老师', '730':'校长', '700':'学科老师', '750':'信息员', } }; }, methods: { goTest(item){ this.$router.push({ path: 'beforeEvaluations', query: { gaugeId:item.sjid } }); }, dialog(item){ this.visibleIntroduceDialog = true this.item = item }, getImgsrc(val) { return "/content/image/xljkImg/"+val }, checkbox(){ this.$router.push('agger') }, getGaugelist(){ let that = this let data = { } $.post("/www/public/st/getstlist", data, function(res){ if(res.code==200){ that.dataList = res.data } }) }, }, created: function(){ let that = this that.getGaugelist() }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-FTnav", function(resolve, reject){ var template = "
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n
\n 取 消\n 确 定\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
\n 取 消\n 确 定\n
\n
\n
\n
\n \"\"/\n

\n 学生学习生活与心理素养调查\n

\n
\n
\n \n \"\"/\n \n

\n {{Nickname}}\n \n

\n \n 个人信息\n 修改密码\n 退出登录\n \n
\n\n
\n
\n
\n

\n \n 首页/{{currentPage}}\n

\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), searchValue:'', dialogVisible:false, dialogVisibles:false, formLabelWidth: '130px', form: { xm: '', xb: '', sr: '', sjhm: '', yx: '', nl: '', qq: '', wx: '', qtlxdh: '', grsm: '', }, forms: { oldpassword: '', newpassword: '', confirmNewpassword: '' }, rules: { }, ruless: { oldpassword: [ { required: true, message: '请输入当前密码', trigger: 'blur' } ], newpassword: [ { required: true, message: '请输入新密码', trigger: 'blur' }, { pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,14}$/, message: '密码格式不符合要求,需包含字母、数字和特殊字符,长度8-14位', trigger: 'blur' } ], confirmNewpassword: [ { required: true, message: '请再次输入新密码', trigger: 'blur' }, { validator: this.validatePasswordMatch, trigger: 'blur' } ] } }; }, methods: { validatePasswordMatch(rule, value, callback) { if (value !== this.forms.newpassword) { callback(new Error('两次输入的新密码不一致')); } else { callback(); } }, formatDate(date) { const d = new Date(date); const year = d.getFullYear(); const month = ('0' + (d.getMonth() + 1)).slice(-2); const day = ('0' + d.getDate()).slice(-2); return `${year}-${month}-${day}`; }, save() { const that = this if (that.form.sr) { that.form.sr = that.formatDate(that.form.sr); } that.$refs.formRef.validate((valid) => { if (valid) { const id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:'' let data = { ...that.form, } $.post("/www/public/shangbao/edituserinfo ", data, function(res){ if(res.error==0){ that.$message.success('提交成功') that.dialogVisible =false }else{ that.$message.error(res.message) } }) } else { console.error('表单验证失败'); return false; } });}, saves() { const that = this that.$refs.formRefs.validate((valid) => { if (valid) { const id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:'' let data = { ...that.forms } $.post("/www/public/shangbao/editPassword", data, function(res){ if(res.error==0){ that.$message.success('修改成功') that.dialogVisible =false }else{ that.$message.error(res.message) } }) } else { console.error('表单验证失败'); return false; } });}, jfjc(){ this.dialogVisible =true }, jfjcs(){ this.dialogVisibles =true }, goHome(){ this.$router.push('FTXZ3') }, grxx(){}, xgmm(){}, logout(){ localStorage.removeItem('user') this.$router.replace('/login') } }, created: function(){ const that = this const id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:'' let data ={ xxyid : id } $.get("/www/public/shangbao/finduserinfo", data, function(res){ if(res.error==0){ that.form = res.data }else{ that.$message.error(res.message) } }) }, mounted: function(){ }, computed:{ Nickname(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} return user.Nickname } }, props: ['title', 'data', 'config','currentPage'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-JSHomepage-view", function(resolve, reject){ var template = "
\n
\n
\n
\n 您好,{{userInfo.Nickname}}老师~\n
\n
\n
\n
\n \n
\n
\n
\n\n
\n
\n
\n
\n \n
\n
\n
\n 学习要求\n
\n
\n 勤奋、专注、思考、实践\n
\n
\n
\n
\n
\n \n
\n
\n
\n 学习课程\n
\n
\n 应知应会,方能胜任\n
\n
\n
\n
\n
\n \n\n
\n
\n
\n 在线考试\n
\n
\n 冷静分析,沉着应对\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n 考试记录\n
\n
\n 即时记录,准确回顾\n
\n
\n
\n
\n
\n \n
\n
\n
\n 操作手册\n
\n
\n 详尽指南,一目了然\n
\n
\n
\n\n \n
\n
\n \n
\n
\n
\n 教师测评\n
\n
\n 精准评估,科学考量\n
\n
\n
\n\n\n
\n
\n\n
\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { butList:[], active:0, tzggList:[], value:'', reverse: false, crq:'', rqList:[], currentList:[], userInfo:{}, type:'', gzdwmc:'' }; }, methods: { jscp(){ this.$router.push('BZRevaluationList') }, gointerviewLS(status) { this.$router.push({ path: '/interviewLS', query: { status: status } }); }, gg(){ window.open('https://xinlijc.bnu.edu.cn/www/dd/vue/spa/xljk#/XDnotice','_blank') }, czsc(){ window.open('https://xinlijc.bnu.edu.cn/content/image/xljkImg/ftsc.pdf','_blank') }, kszs(){ const that =this let data = { } $.post("/www/public/shouye/px_ftlssy_zscx", data, function(res){ if(res.error==0){ window.open(res.data.url) }else{ that.$message.error(res.message) } }) }, ksft(){ const that = this console.log(that.type) if(that.type==1){ that.$router.push('interviewLS') } if(this.type==2){ that.$alert('该访谈员未完成培训无法开始访谈', '提示', { confirmButtonText: '确定', type: 'warning', callback: action => { } }); } }, routerPush(path){ this.$router.push(path) }, getImgsrc:function(val) { return "/content/image/xljkImg/"+val }, getIndex(index){ this.active = index }, onPanelChange(value, mode) { console.log(value, mode); }, getDay(val){ if(this.rqList.length>0){ if(val.type=='current-month'){ //this.currentList.push(val.day) } if(val.type=='current-month'&&this.rqList.indexOf(val.day)>=0){ return true }else{ return false } } }, getDate(val){ //console.log(this.currentList) this.crq = val this.getdb() }, //获取待办 getdb:function(){ let that = this //$.post("/www/py/fwpt/test", {crq:this.crq}, function(res){ $.post("/www/py/fwpt/user_event", {crq:this.crq}, function(res){ if(res.success==1){ if(res.data.data){ that.tzggList = res.data.data that.rqList = res.data.rq } } }) }, }, created: function(){ let that = this that.getdb() that.userInfo =localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} $.post("/www/public/shouye/px_fty_sfftls", {}, function(res){ that.gzdwmc = res.data.gzdwmc that.type=res.data.type }) }, mounted: function(){ }, props: ['title', 'data', 'config','isHeight'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDpublicNoticeDialog", function(resolve, reject){ var template = "
\n \n
\n
\n \"\"/\n

\n 通知公告\n

\n
\n
\n \n\n

*标题

\n \n \n \n \n \n

*发布范围

\n \n

\n \n 点击添加\n \n \n

\n {{item.xxmc}}\n
\n
\n\n
\n\n \n 短信提醒\n \n \n 附件上传\n \n\n\n
\n
\n
\n
\n
\n
\n 发布\n
\n
\n\n
\n
\n \n
\n \n \n
\n
\n 确定\n
\n\n
\n\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), cur:null, listData:[], value2:'', form:{name:'',stulist:[],ftdz:'',date:''}, loading:false, checkList:[], stuList:[], curIndex1:0, editor:null, fileList:[], filesArr:[], html:'', checkedKeys:[], checkedNodes:[], ruleForm:{ otitle:'',// 标题, oabstract: '',//摘要, type:'',// 类型, ocontent:'',// 正文, roles:'',// 发布者, sfbj:'',// 是否本级, sfxjdw:'',// 是否下级单位, sfxqnxx:'',// 是否辖区内学校, sids:'',// 教育厅 xxids:'',// 学校 sfdx:'',// 是否短信提醒, files:'',// 附件对象 fanwei:'', checked:false }, data1: [ { id: '1', xxmc: '本级单位', firstlevel:true }, { id: '2', xxmc: '下级单位', firstlevel:true, children: [] }, { id: '3', xxmc: '辖区学校', firstlevel:true, children: [] }], defaultProps: { children: 'children', label: 'xxmc' }, showallstu:false, rules: { otitle: [ { required: true, message: '请输入标题', trigger: 'blur' } ], oabstract: [ { required: true, message: '请输入摘要', trigger: 'blur' } ], type: [ { required: true, message: '请选公告择类型', trigger: 'change' } ], }, }; }, methods: { beforeClose(){ this.ruleForm = { otitle:'',// 标题, oabstract: '',//摘要, type:'',// 类型, ocontent:'',// 正文, roles:'',// 发布者, sfbj:'',// 是否本级, sfxjdw:'',// 是否下级单位, sfxqnxx:'',// 是否辖区内学校, sids:'',// 教育厅 xxids:'',// 学校 sfdx:'',// 是否短信提醒, files:'',// 附件对象 fanwei:'', checked:false } this.fileList = [] this.filesArr = [] this.html = '' this.checkedKeys = [] this.checkedNodes = [] }, show(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} if(user.Roles.includes('450')){ this.data1 = [ { id: '1', xxmc: '本级单位', firstlevel:true }, { id: '4', xxmc: '全体老师', firstlevel:true, children:[ { id: '700', xxmc: '任课老师', }, { id: '710', xxmc: '心理老师', }, { id: '720', xxmc: '班主任(辅导员)', }, { id: '730', xxmc: '学校负责人', }, { id: '810', xxmc: '访谈老师', }, ] }, ] }else{ this.getXiajidanwei() } this.getSchoolList() this.$refs.baseDialogXDpublicNoticeDialog.show() this.$nextTick(()=>{ var that = this const { createEditor, createToolbar } = window.wangEditor const editorConfig = { placeholder: '正文...', onChange(editor) { var html = editor.getHtml() that.html = html console.log('editor content', html) // 也可以同步到 \n \n\n \n\n \n \n \n\n \n\n
\n 录音时长 {{ recordingLabel }}\n \n
\n \n\n
\n \n
\n \n \n \n \n
\n
\n

访谈回顾

\n \n ×\n \n
\n
\n
\n
\n
\n
\n 姓名\n {{ interviewReviewDisplayMeta.studentName }}\n
\n
\n 学号\n {{ interviewReviewDisplayMeta.studentNo }}\n
\n
\n 访谈老师\n {{ interviewReviewDisplayMeta.teacher }}\n
\n
\n
\n
\n 访谈时间\n {{ interviewReviewDisplayMeta.interviewDate }}\n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n {{ line.category }}\n \n \n \n \n
维度题目答题情况
{{ line.question }}{{ line.answer }}
\n
\n

暂无本次答题记录。

\n
\n
\n
\n \n \n"; return (function(template, resolve, reject) { seajs.use([], function () { return resolve({ template: template, name: "startTheInterviewh5", data: function () { return { phase: "micCheck", micCheckActive: false, micCheckLoading: false, micCheckSeconds: 0, _micCheckSecTimer: null, _micCheckRecorder: null, _micCheckStream: null, _micCheckChunks: [], micCheckMimeType: "", micCheckBlob: null, micCheckPlaybackUrl: "", micCheckPlaybackDurationSec: 0, micCheckPlaybackCurrentSec: 0, micCheckPlaybackPlaying: false, _micCheckRecordStartMs: 0, micCheckBarLevels: (function () { var a = [] for (var i = 0; i < 16; i++) { a.push(12) } return a })(), _micCheckRaf: null, _micCheckAudioCtx: null, _micCheckAnalyser: null, micCheckRecordedOnce: false, /** true:试录后「开始访谈并录音」;false:放弃录音(「开始访谈」,填空必填,fullpath 传空) */ interviewRecordingEnabled: true, noticeChecked: false, questionIndex: 0, openAnswer: "", judgmentValue: "", judgmentValues: [], scaleValue: 1, supplementText: "", /** 后置跳题:满足规则时下一题同屏展示,独立答题区 */ inlineOpenAnswer: "", inlineJudgmentValue: "", inlineJudgmentValues: [], inlineScaleValue: 1, /** 题目 id 索引,供后置跳题 sourceQuestionId 查找 */ _questionSourceIndex: {}, recordingSeconds: 0, recordingActive: false, _recTimer: null, _recorder: null, _recStream: null, _recChunks: [], recordingBlob: null, recordingFile: null, recordingMimeType: "", _finishAfterRecordStop: false, studentNo: "", studentName: "", className: "", openingScript: "先坐。最近学期过半/考试刚结束,老师在跟几位同学常规聊聊天,主要就是想听听大家最近在学校过得怎么样。在这里咱们可以随便聊,就像朋友聊天一样。你在这里跟我说的任何心里话,老师都尽可能地会替你保密。不过有一点老师要提前说,因为老师最看重的是你的安全,如果聊到的事情关系到你或者其他人的生命安全,老师不能让你一个人面对,我们会一起想办法找更多的人来保护你。\n\n除了这个,其他的你都可以放心大胆地说,最近有什么开心的、或者觉得心烦的事情,都可以和老师吐吐槽。", noticeBody: "请您在使用时注意:\n1. 请保证和学生的单独谈话在安全、私密的环境中进行,做好保密及保密例外的知情同意。\n2. 请依据您与学生的关系、学生的实际反应及谈话氛围,灵活调整提问的顺序、方式和深度,以建立信任、促进开放交流为首要目标。如学生抗拒,可跳过问题或暂停谈话。态度要温暖、关心的态度,目标是为了能够获得学生真实的想法和感受。\n3. 请根据该总分及具体记录,综合研判所有信息,尤其不可忽视具体的风险言行,给出「建议预警等级」。\n4. 请在表格空白处尽可能详尽、客观地记录关键信息,例如学生在访谈中透露的具体细节、原话表达、行为描述及相关事件,这些内容是后续支持与研判的根本依据。\n5. 本表涉及学生高度敏感信息,访谈完成后,必须按照学校制定的心理工作保密管理规定进行密封、保存与流转,确保信息仅限必要的工作组成员在职责范围内知悉。\n6. 单次访谈预留 15–20 分钟完整时段,请尽可能避免安排在你自己情绪疲惫或临近下班时段。", noticeConfirmLead: "请确认你已知晓以上内容,并愿意继续访谈。", questions: [], currentTkid: "f20e6261-d3e5-4c25-a21e-9051025748e4", visitedTkids: {}, sessionLoading: false, toolIdLoading: false, toolIdFromApi: "", answerScoreMap: {}, answerOptionMap: {}, jumpRuleMap: {}, /** 按 tkid 缓存 cxljfstt 分数题库跳题规则 */ ljfsttRuleMap: {}, _jumpCheckSeq: 0, interviewAnswers: [], sessionStartTs: 0, submitLoading: false, doneReturnTimer: null, /** 与 PC 一致:crisis(score 666 或 999)| focus(5 分且无危机)| normal;999 同时用于答题内直接结束 */ interviewResultLevel: "", /** 与 PC 一致:题库展示名(cxtkmc / tkZhInfo / 路由) */ currentBankDisplayName: "", /** 访谈回顾抽屉(H5 无 el-dialog,用遮罩层) */ interviewReviewDialogVisible: false, /** 「心情怎么样」整库同屏:按 tmid 存各题答案 */ bankAnswersMap: {} } }, computed: { studentDisplayNo: function () { return this.studentNo || "20261015" }, studentLine: function () { var no = this.studentDisplayNo var cls = this.className || "高一(1)班" return no + "(" + cls + ")" }, noticeBodyFinal: function () { var name = (this.studentName && String(this.studentName).trim()) || (this.studentNo && String(this.studentNo).trim()) || "同学" var tpl = this.noticeBody || "" return tpl.replace(/xx/g, name) }, sessionBarName: function () { var name = this.studentName && String(this.studentName).trim() ? String(this.studentName).trim() : "" return name || "—" }, sessionBarClass: function () { var cls = this.className && String(this.className).trim() ? String(this.className).trim() : "" return cls || "—" }, interviewStepBarLine: function () { var bank = this.bankDisplayName && String(this.bankDisplayName).trim() ? String(this.bankDisplayName).trim() : "—" var q = this.currentQ || {} var step = q.stepLabel && String(q.stepLabel).trim() ? String(q.stepLabel).trim() : "" if (step && step !== "—") { return bank } return bank }, bankDisplayName: function () { if (this.currentBankDisplayName && String(this.currentBankDisplayName).trim()) { return String(this.currentBankDisplayName).trim() } var q = this.$route && this.$route.query var fromRoute = (q && (q.tkmc || q.tkName) && String(q.tkmc || q.tkName).trim()) || "" return fromRoute || "—" }, /** 当前维度为「访谈结束」题库时,题目不作必填校验 */ isInterviewEndBank: function () { var bank = this.bankDisplayName != null ? String(this.bankDisplayName).trim() : "" return bank === "访谈结束" }, /** 当前维度为「心情怎么样」时,整库题目同屏展示(除填空外不作必填;填空是否必填见 interviewRecordingEnabled) */ isMoodDimensionBank: function () { var bank = this.bankDisplayName != null ? String(this.bankDisplayName).trim() : "" return bank === "心情怎么样" }, bankAllQuestions: function () { return this.questions || [] }, interviewDoneHeading: function () { if (this.interviewResultLevel === "crisis") { return "访谈结果 · 推送校心理中心" } if (this.interviewResultLevel === "focus") { return "访谈结果 · 重点关注" } return "访谈结果 · 暂不关注" }, interviewDoneStatusLabel: function () { if (this.interviewResultLevel === "crisis") { return "推送校心理中心" } if (this.interviewResultLevel === "focus") { return "重点关注" } return "暂不关注" }, interviewDoneStatusClass: function () { if (this.interviewResultLevel === "crisis") { return "startInterviewh5-doneStatus--crisis" } if (this.interviewResultLevel === "focus") { return "startInterviewh5-doneStatus--focus" } return "startInterviewh5-doneStatus--normal" }, interviewDoneResultText: function () { if (this.interviewResultLevel === "crisis") { return ( "访谈结果为「推送校心理中心」:在访谈中发现学生存在自伤、伤人或严重精神障碍等急性风险,且已触发预设的危机评估标准(如明确计划、近期行为、社会支持缺失等),请立即启动危机干预流程。" + "须第一时间将学生信息、访谈摘要及访谈结果推送至校心理中心,并同步联系班主任及家长,确保学生安全与后续系统干预。" ) } if (this.interviewResultLevel === "focus") { return ( "在访谈中识别出学生存在多个心理困扰指标(如持续情绪低落、学业社交功能受损、轻度自伤念头等),构成预警,但经评估未达到危机模块启动阈值(无明确风险计划或紧急控制需求)。" + "此类学生需列为重点关注对象,并请班主任日常观察其情绪行为变化,校心理中心可提供有限次数的跟踪支持,避免问题升级。" ) } return ( "访谈结果显示学生当前心理状态总体平稳,未出现明显情绪困扰、行为异常或认知偏差等警示指标,各项功能运行良好。" + "此类学生暂不纳入主动关注或干预范围,可视为普通人群进行常规心理健康教育。建议每学期按统一流程复评一次,或在学生主动求助时再行评估,无需额外占用心理服务资源。" ) }, interviewReviewDisplayMeta: function () { var user = {} var answererInfo = {} try { user = JSON.parse(localStorage.getItem("user") || "{}") } catch (e) {} try { answererInfo = JSON.parse(localStorage.getItem("answererInfo") || "{}") } catch (e) {} var teacher = (user && (user.Nickname || user.Username) && String(user.Nickname || user.Username).trim()) || "—" var name = (this.studentName && String(this.studentName).trim()) || (answererInfo.xm && String(answererInfo.xm).trim()) || "—" var no = (this.studentNo && String(this.studentNo).trim()) || (answererInfo.xh && String(answererInfo.xh).trim()) || "—" var time = this.sessionStartTs ? this.formatDateTimeYMDHMS(this.sessionStartTs) : "—" return { studentName: name, studentNo: no, teacher: teacher, interviewDate: time } }, interviewReviewTableLines: function () { var self = this var answers = this.interviewAnswers || [] if (!answers.length) { return [] } var catKey = function (e) { var s = e && e.bankDisplayName != null ? String(e.bankDisplayName).trim() : "" return s || "—" } var lines = [] var lineIdx = 0 var i = 0 while (i < answers.length) { var ck = catKey(answers[i]) var j = i + 1 while (j < answers.length && catKey(answers[j]) === ck) { j++ } var span = j - i for (var k = 0; k < span; k++) { var entry = answers[i + k] var qtext = self.stripHtmlForReview((entry && entry.questioncontent) || "—") lines.push({ key: "rev-h5-" + lineIdx++, showCategory: k === 0, categoryRowspan: span, category: ck, question: qtext, answer: self.formatInterviewAnswerEntry(entry) }) } i = j } return lines }, /** 开放题 / 结束语 / 量表题展示底部「下一步」;单选自动下一题;多选「完成本题」;访谈结束维度下判断题也可直接下一步;心情怎么样整库同屏恒展示 */ showSessionNextBtn: function () { if (this.isMoodDimensionBank) { return true } var q = this.currentQ || {} if (this.postJumpNextHasRules()) { return true } if (this.isInterviewEndBank && q.kind === "judgment") { return true } return q.kind === "open" || q.kind === "closing" || q.kind === "scale" }, currentScaleMax: function () { var q = this.currentQ || {} var n = Number(q.segment) if (!isFinite(n) || n < 1) { n = 5 } return Math.floor(n) }, /** 量表刻度下方数字 1..N */ scaleTickNumbers: function () { var max = this.currentScaleMax var arr = [] for (var i = 1; i <= max; i++) { arr.push(i) } return arr }, currentQ: function () { var list = this.questions || [] var i = Math.min(Math.max(0, this.questionIndex), Math.max(0, list.length - 1)) return list[i] || {} }, inlinePostJumpQ: function () { return this.getPostJumpTargetQuestion() || {} }, showInlinePostJump: function () { var nextQ = this.getPostJumpTargetQuestion() if (!nextQ || !nextQ.jumprules) { return false } return this.evaluateQuestionJumpRules(nextQ, true) }, inlineScaleMax: function () { var q = this.inlinePostJumpQ || {} var n = Number(q.segment) if (!isFinite(n) || n < 1) { n = 5 } return Math.floor(n) }, inlineScaleTickNumbers: function () { var max = this.inlineScaleMax var arr = [] for (var i = 1; i <= max; i++) { arr.push(i) } return arr }, inlineJudgmentOptions: function () { var q = this.inlinePostJumpQ || {} if (q.options && q.options.length) { return q.options } return [ { value: "yes", label: "是" }, { value: "no", label: "否" } ] }, currentJudgmentOptions: function () { if (this.currentQ && Array.isArray(this.currentQ.options) && this.currentQ.options.length) { return this.currentQ.options } return [ { value: "yes", label: "是" }, { value: "no", label: "否" } ] }, recordingLabel: function () { return this.formatRecordingClock(this.recordingSeconds) }, micCheckRecordingLabel: function () { if (this.micCheckLoading) { return "00:00" } return this.formatRecordingClock(this.micCheckSeconds) }, micCheckBtnLabel: function () { if (this.micCheckLoading) { return "正在准备…" } if (this.micCheckActive) { return "停止试录" } return "开始试录" }, micCheckPlaybackTimeLabel: function () { return ( this.formatMediaTime(this.micCheckPlaybackCurrentSec) + " / " + this.formatMediaTime(this.micCheckPlaybackDurationSec) ) }, micCheckPlaybackProgressPercent: function () { if (!this.micCheckPlaybackDurationSec) { return 0 } return Math.min( 100, Math.max(0, (this.micCheckPlaybackCurrentSec / this.micCheckPlaybackDurationSec) * 100) ) }, sessionPrimaryLabel: function () { if (this.sessionLoading) { return "加载中..." } if (this.isMoodDimensionBank) { var moodQs = this.bankAllQuestions || [] for (var li = 0; li < moodQs.length; li++) { if (moodQs[li] && moodQs[li].kind === "closing") { return "完成访谈" } } return "下一步" } if (this.currentQ.kind === "closing") { return "完成访谈" } return "下一步" }, sessionPrimaryDisabled: function () { if (this.sessionLoading) { return true } if (this.isMoodDimensionBank) { var moodList = this.bankAllQuestions for (var mi = 0; mi < moodList.length; mi++) { if (this.isQuestionAnswerEmpty(moodList[mi], this.getBankAnswerBag(moodList[mi]))) { return true } } return false } if (this.isInterviewEndBank && !this.showInlinePostJump) { return false } if (this.isQuestionAnswerEmpty(this.currentQ, this.getCurrentAnswerFieldBag())) { return true } if (this.showInlinePostJump && this.isQuestionAnswerEmpty(this.inlinePostJumpQ, this.getInlineAnswerFieldBag())) { return true } return false } }, mounted: function () { var q = (this.$route && this.$route.query) || {} if (q.studentNo) { this.studentNo = q.studentNo } if (q.studentName) { this.studentName = q.studentName } else if (q.xm) { this.studentName = q.xm } else if (q.student_xm) { this.studentName = q.student_xm } else if (q.xingming) { this.studentName = q.xingming } else if (q.name && q.name !== "访谈管理") { this.studentName = q.name } else { this.studentName = "" } if (q.className) { this.className = q.className } else if (q.bjmc) { this.className = q.bjmc } if (typeof window !== "undefined") { var that = this window.__interviewDumpSubmitParams = function () { that.debugPrintSubmitParams() } window.__interviewDumpRecordingFile = function () { that.debugPrintRecordingFile() } } }, beforeDestroy: function () { this.clearRecTimer() this.clearDoneReturnTimer() this.releaseMicCheckResources() this.revokeMicCheckPlayback() this.releaseRecordingResources() if (typeof window !== "undefined" && window.__interviewDumpSubmitParams) { try { delete window.__interviewDumpSubmitParams } catch (e) { window.__interviewDumpSubmitParams = null } } if (typeof window !== "undefined" && window.__interviewDumpRecordingFile) { try { delete window.__interviewDumpRecordingFile } catch (e) { window.__interviewDumpRecordingFile = null } } }, methods: { clearRecTimer: function () { if (this._recTimer) { clearInterval(this._recTimer) this._recTimer = null } }, backToInterviewList: function () { this.interviewReviewDialogVisible = false this.interviewResultLevel = "" this.clearRecTimer() this.clearDoneReturnTimer() this.releaseMicCheckResources() this.revokeMicCheckPlayback() this.releaseRecordingResources() if (this.$router) { this.$router.back() } }, clearDoneReturnTimer: function () { if (this.doneReturnTimer) { clearTimeout(this.doneReturnTimer) this.doneReturnTimer = null } }, /** 设备自测完成 → 开场白(须先完成一次试录) */ goToOpeningFromMicCheck: function () { if (!this.micCheckRecordedOnce) { if (this.$message) { this.$message.warning("请先完成一次试录(停止试录后可试听),再进入下一步") } return } this.releaseMicCheckResources() this.revokeMicCheckPlayback() this.micCheckRecordedOnce = false this.interviewRecordingEnabled = true this.phase = "opening" }, abandonRecordingAndGoOpening: function () { var that = this if (!this.$confirm) { this.releaseMicCheckResources() this.revokeMicCheckPlayback() this.micCheckRecordedOnce = false this.interviewRecordingEnabled = false this.phase = "opening" return } this.$confirm( "此次访谈不会被录音,请将访谈内容详细记录到系统中", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" } ) .then(function () { that.releaseMicCheckResources() that.revokeMicCheckPlayback() that.micCheckRecordedOnce = false that.interviewRecordingEnabled = false that.phase = "opening" }) .catch(function () {}) }, startSession: function () { if (!this.noticeChecked) { return } this.interviewResultLevel = "" this.interviewReviewDialogVisible = false this.phase = "session" this.questionIndex = 0 this.sessionStartTs = Date.now() this.resetQuestionFields() this.initInterviewQuestions() if (this.interviewRecordingEnabled) { this.toggleRecording() } }, initInterviewQuestions: function () { var routeTkid = this.$route && this.$route.query && this.$route.query.tkid this.questions = [] this.currentTkid = routeTkid || "f20e6261-d3e5-4c25-a21e-9051025748e4" this.visitedTkids = {} this.answerScoreMap = {} this.answerOptionMap = {} this.jumpRuleMap = {} this.ljfsttRuleMap = {} this.currentBankDisplayName = "" this.interviewAnswers = [] this.fetchToolIdFromApi() this.loadQuestionBank(this.currentTkid, true) }, fetchToolIdFromApi: function () { var that = this this.toolIdLoading = true $.get("/www/public/cpgl/ft_tbcx", {}, function (res) { var ok = res && (res.success === 1 || res.error === 0 || res.code === 0 || res.code === 200 || res.code === "0") if (!ok) return var data = res.data var toolId = "" if (typeof data === "string" || typeof data === "number") toolId = String(data) else if (Array.isArray(data) && data.length) { var first = data[0] || {} toolId = String(first.toolId || first.toolid || first.id || "") } else if (data && typeof data === "object") { toolId = String(data.toolId || data.toolid || data.id || "") } if (toolId) that.toolIdFromApi = toolId }).always(function () { that.toolIdLoading = false }) }, formatDateTimeYMDHMS: function (timeInput) { var date = timeInput ? new Date(timeInput) : new Date() var pad = function (n) { return n < 10 ? "0" + n : "" + n } return ( date.getFullYear() + "-" + pad(date.getMonth() + 1) + "-" + pad(date.getDate()) + " " + pad(date.getHours()) + ":" + pad(date.getMinutes()) + ":" + pad(date.getSeconds()) ) }, calculateTimeDifferenceSeconds: function (startMs, endMs) { if (!startMs || !endMs) return 0 var diff = Math.max(0, Number(endMs) - Number(startMs)) return Math.floor(diff / 1000) }, snapshotBankDisplayNameForAnswer: function () { var b = this.currentBankDisplayName != null ? String(this.currentBankDisplayName).trim() : "" if (b) { return b } var q = this.$route && this.$route.query var fromRoute = q && (q.tkmc || q.tkName) ? String(q.tkmc || q.tkName).trim() : "" return fromRoute || "" }, stripHtmlForReview: function (html) { if (html == null || html === "") { return "" } return String(html).replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim() }, formatInterviewAnswerEntry: function (entry) { if (!entry) { return "—" } if (entry.scaleAnswerLabel) { return String(entry.scaleAnswerLabel).trim() } var ic = entry.inputContent if (ic != null && String(ic).trim() !== "") { return String(ic).trim() } var list = entry.answerList || [] var parts = [] for (var i = 0; i < list.length; i++) { var a = list[i] if (a === "false" || !a) { continue } var t = a.answerText != null ? String(a.answerText).trim() : "" if (t) { parts.push(t) } } return parts.length ? parts.join(";") : "—" }, openInterviewReviewDialog: function () { if (this.phase !== "done") { return } this.interviewReviewDialogVisible = true }, closeInterviewReviewDialog: function () { this.interviewReviewDialogVisible = false }, onInterviewReviewMaskClick: function () { this.closeInterviewReviewDialog() }, /** * 与 PC 一致:危机 score 666 或 999(999 在 sessionPrimary 内直接结束,落库 ftjg 须为危机);重点关注 score 5。 */ computeInterviewResultLevelFromAnswers: function (answers) { var hasCrisis = false var has5 = false ;(answers || []).forEach(function (entry) { ;(entry.answerList || []).forEach(function (a) { if (!a || a === "false") { return } var s = a.score if (s !== "" && s != null) { var n = Number(String(s).trim()) if (!isNaN(n) && (n === 666 || n === 999)) { hasCrisis = true } if (!isNaN(n) && n === 5) { has5 = true } } }) }) if (hasCrisis) { return "crisis" } if (has5) { return "focus" } return "normal" }, resetQuestionFields: function () { this.openAnswer = "" this.judgmentValue = "" this.judgmentValues = [] this.scaleValue = 1 this.supplementText = "" this.inlineOpenAnswer = "" this.inlineJudgmentValue = "" this.inlineJudgmentValues = [] this.inlineScaleValue = 1 }, normalizeOptions: function (raw) { if (!raw) return [] var list = [] try { list = typeof raw === "string" ? JSON.parse(raw) : raw } catch (e) { list = [] } if (!Array.isArray(list)) return [] return list.map(function (item, index) { var value = item.optionNo || item.optionId || item.id || (index + 1) var label = item.optionName || ("选项" + (index + 1)) return { value: String(value), label: String(label).replace(/%s/g, ""), score: item.score !== undefined && item.score !== null ? Number(item.score) : null, answerBusiId: item.answerBusiId != null && item.answerBusiId !== "" ? String(item.answerBusiId) : "", optionNo: item.optionNo != null && item.optionNo !== "" ? String(item.optionNo) : String(value), optionId: item.optionId != null && item.optionId !== "" ? String(item.optionId) : "" } }) }, normalizeBankQuestions: function (rows) { var list = Array.isArray(rows) ? rows : [] var realList = list.filter(function (item) { return item && item.questionflag !== "1" && item.questionflag !== "2" }) var total = realList.length || 1 return realList.map(function (item, idx) { var rawTitle = item.questioncontent || "请作答" var isOpenByPlaceholder = String(rawTitle).indexOf("%s") > -1 var title = String(rawTitle).replace(/%s/g, "") var isScale = String(item.questiontype) === "8" && String(item.replytype) === "1" var isChoice = String(item.replytype) === "1" && !isOpenByPlaceholder && !isScale var options = isChoice ? this.normalizeOptions(item.mpanswerdtolist) : [] var segment = 5 var scaleMarks = {} var scaleOptions = [] if (isScale) { var segRaw = Number(item.segment) segment = !isFinite(segRaw) || segRaw < 1 ? 5 : Math.floor(segRaw) var axisStr = item.axisdesc != null ? String(item.axisdesc) : "" var axisParts = axisStr.split(";").map(function (s) { return String(s).trim() }) var si = 0 for (; si < segment; si++) { var step = si + 1 var lab = axisParts[si] != null && axisParts[si] !== "" ? axisParts[si] : String(step) scaleMarks[step] = lab scaleOptions.push({ value: String(step), label: lab, score: null }) } var fromMp = this.normalizeOptions(item.mpanswerdtolist) if (fromMp.length) { for (var fi = 0; fi < fromMp.length && fi < scaleOptions.length; fi++) { scaleOptions[fi].label = fromMp[fi].label || scaleOptions[fi].label scaleOptions[fi].value = fromMp[fi].value != null ? String(fromMp[fi].value) : scaleOptions[fi].value if (fromMp[fi].score !== null && fromMp[fi].score !== undefined && !isNaN(Number(fromMp[fi].score))) { scaleOptions[fi].score = Number(fromMp[fi].score) } } } } var kind = isScale ? "scale" : isChoice ? "judgment" : "open" var isChoiceOrScale = isChoice || isScale var jumprules = null var jumprulesRaw = item.jumprules || item.JumpRules || item.jumprule || "" if (jumprulesRaw) { try { jumprules = typeof jumprulesRaw === "string" ? JSON.parse(jumprulesRaw) : jumprulesRaw if (!jumprules || !Array.isArray(jumprules.groups) || !jumprules.groups.length) { jumprules = null } } catch (eJ) { jumprules = null } } return { tmid: item.id || item.tmid || item.tktmid || "", rawId: item.id || "", quesbusiid: item.quesbusiid || item.quesBusiId || item.id || "", questionno: item.questionno ? String(item.questionno) : "", tmbm: item.tmbm || "", tkid: item.tkid || this.currentTkid, kind: kind, isMulti: String(item.ismult || "0") === "1", stepLabel: "访谈题目", progressIndex: idx + 1, progressTotal: total, title: title || "请作答", subtitle: "", recordLabel: isChoiceOrScale ? "" : "请记录学生回答", placeholder: isChoiceOrScale ? "" : "请记录学生回答", bannerAlert: "", bannerSuccess: "", supplementLabel: isChoiceOrScale ? "补充记录(可选)" : "", supplementPlaceholder: isChoiceOrScale ? "可以补充学生原话、时间、场景等" : "", options: options, segment: segment, scaleMarks: scaleMarks, scaleOptions: scaleOptions, startscope: item.startscope || "", midscope: item.midscope || "", endscope: item.endscope || "", scorejumpquesno: item.scorejumpquesno ? String(item.scorejumpquesno) : "0", scorejumpnos: item.scorejumpnos ? String(item.scorejumpnos) : "", scorejumpmin: item.scorejumpmin ? String(item.scorejumpmin) : "", scorejumpmax: item.scorejumpmax ? String(item.scorejumpmax) : "", jumprules: jumprules } }, this) }, getCurrentAnswerFieldBag: function () { return { openAnswer: this.openAnswer, judgmentValue: this.judgmentValue, judgmentValues: this.judgmentValues, scaleValue: this.scaleValue } }, getInlineAnswerFieldBag: function () { return { openAnswer: this.inlineOpenAnswer, judgmentValue: this.inlineJudgmentValue, judgmentValues: this.inlineJudgmentValues, scaleValue: this.inlineScaleValue } }, getPostJumpTargetQuestion: function () { var list = this.questions || [] var idx = Number(this.questionIndex) if (!isFinite(idx) || idx < 0 || idx >= list.length - 1) { return null } return list[idx + 1] || null }, postJumpNextHasRules: function () { var nextQ = this.getPostJumpTargetQuestion() return !!(nextQ && nextQ.jumprules && Array.isArray(nextQ.jumprules.groups) && nextQ.jumprules.groups.length) }, rebuildQuestionSourceIndex: function () { var index = {} var list = this.questions || [] for (var i = 0; i < list.length; i++) { var q = list[i] if (!q) { continue } var keys = [q.rawId, q.tmid, q.quesbusiid, q.questionno] for (var k = 0; k < keys.length; k++) { if (keys[k] == null || keys[k] === "") { continue } index[String(keys[k])] = q index[String(keys[k]).toLowerCase()] = q } } this._questionSourceIndex = index }, findQuestionBySourceId: function (sourceQuestionId, sourceQuestionNo) { if (sourceQuestionId == null || sourceQuestionId === "") { if (sourceQuestionNo == null || sourceQuestionNo === "") { return null } } var index = this._questionSourceIndex || {} if (sourceQuestionId != null && sourceQuestionId !== "") { var sid = String(sourceQuestionId) if (index[sid]) { return index[sid] } if (index[sid.toLowerCase()]) { return index[sid.toLowerCase()] } } if (sourceQuestionNo != null && sourceQuestionNo !== "") { var sno = String(sourceQuestionNo) if (index[sno]) { return index[sno] } if (index[sno.toLowerCase()]) { return index[sno.toLowerCase()] } } var list = this.questions || [] for (var i = 0; i < list.length; i++) { var q = list[i] if (!q) { continue } if ( sourceQuestionId != null && sourceQuestionId !== "" && (String(q.rawId || "") === String(sourceQuestionId) || String(q.tmid || "") === String(sourceQuestionId) || String(q.quesbusiid || "") === String(sourceQuestionId) || String(q.questionno || "") === String(sourceQuestionId)) ) { return q } if ( sourceQuestionNo != null && sourceQuestionNo !== "" && String(q.questionno || "") === String(sourceQuestionNo) ) { return q } } return null }, collectOptionMatchKeys: function (sourceQ, token) { var keys = [] if (token == null || token === "") { return keys } var t = String(token) keys.push(t) var opts = sourceQ && Array.isArray(sourceQ.options) ? sourceQ.options : [] for (var i = 0; i < opts.length; i++) { var o = opts[i] || {} var aliases = [o.value, o.answerBusiId, o.optionNo, o.optionId] var hit = false for (var j = 0; j < aliases.length; j++) { if (aliases[j] != null && aliases[j] !== "" && String(aliases[j]) === t) { hit = true break } } if (!hit) { continue } for (var k = 0; k < aliases.length; k++) { if (aliases[k] != null && aliases[k] !== "") { var ak = String(aliases[k]) if (keys.indexOf(ak) < 0) { keys.push(ak) } } } break } return keys }, expandIdListForQuestion: function (sourceQ, ids) { var all = [] ;(ids || []).forEach(function (id) { this.collectOptionMatchKeys(sourceQ, id).forEach(function (k) { if (all.indexOf(k) < 0) { all.push(k) } }) }, this) return all }, optionKeySetsIntersect: function (a, b) { for (var i = 0; i < a.length; i++) { if (b.indexOf(a[i]) >= 0) { return true } } return false }, optionKeySetsEqual: function (a, b) { if (a.length !== b.length) { return false } var sa = a.slice().sort() var sb = b.slice().sort() for (var i = 0; i < sa.length; i++) { if (sa[i] !== sb[i]) { return false } } return true }, getInterviewQuestionSelectedOptionIds: function (sourceQ, useLiveCurrent) { if (!sourceQ) { return [] } var ids = [] var curIdx = Number(this.questionIndex) var curQ = this.questions && this.questions[curIdx] ? this.questions[curIdx] : this.currentQ var isCurrent = useLiveCurrent && curQ && (String(curQ.tmid || "") === String(sourceQ.tmid || "") || String(curQ.rawId || "") === String(sourceQ.rawId || "") || String(curQ.quesbusiid || "") === String(sourceQ.quesbusiid || "")) if (sourceQ.kind === "judgment") { if (sourceQ.isMulti) { var vals = isCurrent ? this.judgmentValues || [] : this.answerOptionMap[sourceQ.tmid] || [] if (!Array.isArray(vals)) { vals = vals ? [vals] : [] } vals.forEach(function (v) { if (v != null && v !== "") { ids.push(String(v)) } }) return ids } var sel = isCurrent ? this.judgmentValue : this.answerOptionMap[sourceQ.tmid] if (sel != null && sel !== "") { ids.push(String(sel)) } return ids } if (sourceQ.kind === "scale") { var segM = Number(sourceQ.segment) if (!isFinite(segM) || segM < 1) { segM = 5 } segM = Math.floor(segM) var sv = isCurrent ? this.scaleValue : this.answerOptionMap[sourceQ.tmid] if (sv === "" || sv === undefined || sv === null || !isFinite(Number(sv))) { return ids } var ui = Math.min(segM, Math.max(1, Math.floor(Number(sv)))) ids.push(String(ui - 1)) return ids } return ids }, getJumpRuleTargetOptionIds: function (cond, sourceQ) { var targetIds = (cond.optionIds || []).map(function (x) { return String(x) }) if (targetIds.length || !cond.optionNos || !cond.optionNos.length) { return targetIds } var opts = sourceQ && Array.isArray(sourceQ.options) ? sourceQ.options : [] cond.optionNos.forEach(function (no) { var opt = opts.find(function (o) { return ( String(o.value) === String(no) || String(o.optionNo) === String(no) || String(o.answerBusiId) === String(no) ) }) if (opt && opt.value != null && opt.value !== "") { targetIds.push(String(opt.value)) } }) return targetIds }, evaluateJumpRulesCondition: function (cond, useLiveCurrent) { if (!cond || (!cond.sourceQuestionId && !cond.sourceQuestionNo)) { return false } var source = this.findQuestionBySourceId(cond.sourceQuestionId, cond.sourceQuestionNo) if (!source) { return false } var selected = this.getInterviewQuestionSelectedOptionIds(source, useLiveCurrent) if (!selected.length) { return false } var targetIds = this.getJumpRuleTargetOptionIds(cond, source) if (!targetIds.length) { return false } var selectedExpanded = this.expandIdListForQuestion(source, selected) var targetExpanded = this.expandIdListForQuestion(source, targetIds) var operator = cond.operator || "includes_any" if (operator === "includes_any") { return this.optionKeySetsIntersect(selectedExpanded, targetExpanded) } if (operator === "includes_all") { return targetExpanded.every(function (tid) { return selectedExpanded.indexOf(tid) >= 0 }) } if (operator === "equals") { return this.optionKeySetsEqual(selectedExpanded, targetExpanded) } return false }, evaluateJumpRulesGroup: function (group, useLiveCurrent) { if (!group || group.enabled === false) { return false } var conditions = (group.conditions || []).filter(function (c) { return ( c && (c.sourceQuestionId || c.sourceQuestionNo) && ((c.optionIds && c.optionIds.length) || (c.optionNos && c.optionNos.length)) ) }) if (!conditions.length) { return false } var logic = String(group.logic || "AND").toUpperCase() if (logic === "OR") { return conditions.some(function (c) { return this.evaluateJumpRulesCondition(c, useLiveCurrent) }, this) } return conditions.every(function (c) { return this.evaluateJumpRulesCondition(c, useLiveCurrent) }, this) }, evaluateQuestionJumpRules: function (targetQ, useLiveCurrent) { var rules = targetQ && targetQ.jumprules if (!rules || !Array.isArray(rules.groups)) { return false } var groups = rules.groups.filter(function (g) { return ( g && g.enabled !== false && Array.isArray(g.conditions) && g.conditions.some(function (c) { return ( c && (c.sourceQuestionId || c.sourceQuestionNo) && ((c.optionIds && c.optionIds.length) || (c.optionNos && c.optionNos.length)) ) }) ) }) if (!groups.length) { return false } var topLogic = String(rules.logic || "OR").toUpperCase() if (topLogic === "AND") { return groups.every(function (g) { return this.evaluateJumpRulesGroup(g, useLiveCurrent) }, this) } return groups.some(function (g) { return this.evaluateJumpRulesGroup(g, useLiveCurrent) }, this) }, skipUnmatchedPostJumpQuestions: function (startIdx) { var idx = Number(startIdx) if (!isFinite(idx)) { idx = 0 } var list = this.questions || [] while (idx < list.length) { var q = list[idx] if (q && q.jumprules && !this.evaluateQuestionJumpRules(q, false)) { idx++ continue } break } return idx }, isEffectivelyLastQuestion: function (inlineShown) { var nextIdx = this.skipUnmatchedPostJumpQuestions(this.questionIndex + (inlineShown ? 2 : 1)) return nextIdx >= (this.questions || []).length }, moveToNextQuestionOrFinish: function (inlineShown) { var nextIdx = this.skipUnmatchedPostJumpQuestions(this.questionIndex + (inlineShown ? 2 : 1)) if (nextIdx >= (this.questions || []).length) { this.finishInterview() return } this.questionIndex = nextIdx this.resetQuestionFields() }, initBankAnswersMap: function () { var map = {} var list = this.questions || [] for (var i = 0; i < list.length; i++) { var q = list[i] if (!q || !q.tmid) { continue } map[String(q.tmid)] = { openAnswer: "", judgmentValue: "", judgmentValues: [], scaleValue: 1 } } this.bankAnswersMap = map }, getBankAnswerBag: function (q) { if (!q || !q.tmid) { return { openAnswer: "", judgmentValue: "", judgmentValues: [], scaleValue: 1 } } var key = String(q.tmid) if (!this.bankAnswersMap[key]) { this.$set(this.bankAnswersMap, key, { openAnswer: "", judgmentValue: "", judgmentValues: [], scaleValue: 1 }) } return this.bankAnswersMap[key] }, getBankJudgmentOptions: function (q) { if (q && Array.isArray(q.options) && q.options.length) { return q.options } return [ { value: "yes", label: "是" }, { value: "no", label: "否" } ] }, getBankScaleMax: function (q) { var n = Number(q && q.segment) if (!isFinite(n) || n < 1) { n = 5 } return Math.floor(n) }, getBankScaleTickNumbers: function (q) { var max = this.getBankScaleMax(q) var arr = [] for (var i = 1; i <= max; i++) { arr.push(i) } return arr }, isBankOptionSelected: function (q, value) { var bag = this.getBankAnswerBag(q) var key = String(value) if (q && q.isMulti) { return Array.isArray(bag.judgmentValues) && bag.judgmentValues.indexOf(key) > -1 } return String(bag.judgmentValue || "") === key }, setBankJudgment: function (q, value) { var bag = this.getBankAnswerBag(q) bag.judgmentValue = String(value) }, toggleBankMultiOption: function (q, value) { var bag = this.getBankAnswerBag(q) var key = String(value) var list = Array.isArray(bag.judgmentValues) ? bag.judgmentValues.slice() : [] var idx = list.indexOf(key) if (idx > -1) { list.splice(idx, 1) } else { list.push(key) } bag.judgmentValues = list }, isQuestionAnswerEmpty: function (q, bag) { q = q || {} bag = bag || {} if (this.isInterviewEndBank || this.isMoodDimensionBank) { return false } if (q.kind === "judgment") { if (q.isMulti) { return !Array.isArray(bag.judgmentValues) || !bag.judgmentValues.length } return !bag.judgmentValue } if (q.kind === "open" || q.kind === "closing") { if (this.interviewRecordingEnabled) { return false } var oa = bag.openAnswer != null ? String(bag.openAnswer).trim() : "" return !oa } return false }, cacheAnswerScoreForQuestion: function (q, bag) { q = q || {} bag = bag || {} if (!q.tmid) { return } if (q.kind === "scale") { var optsSc = Array.isArray(q.scaleOptions) ? q.scaleOptions : [] var idxSc = Number(bag.scaleValue) - 1 var pickedSc = optsSc[idxSc] var scoreSc = null if ( pickedSc && pickedSc.score !== null && pickedSc.score !== undefined && !isNaN(Number(pickedSc.score)) ) { scoreSc = Number(pickedSc.score) } this.answerScoreMap[q.tmid] = scoreSc if (q.questionno) { this.answerScoreMap[q.questionno] = this.answerScoreMap[q.tmid] } return } if (q.kind !== "judgment") { this.answerScoreMap[q.tmid] = null if (q.questionno) { this.answerScoreMap[q.questionno] = null } return } if (q.isMulti) { this.answerScoreMap[q.tmid] = null if (q.questionno) { this.answerScoreMap[q.questionno] = null } return } var selected = bag.judgmentValue if (!selected) { this.answerScoreMap[q.tmid] = null if (q.questionno) { this.answerScoreMap[q.questionno] = null } return } var opts = Array.isArray(q.options) ? q.options : [] var picked = opts.find(function (o) { return String(o.value) === String(selected) }) var score = picked && picked.score !== null && picked.score !== undefined ? Number(picked.score) : null this.answerScoreMap[q.tmid] = isNaN(score) ? null : score if (q.questionno) { this.answerScoreMap[q.questionno] = this.answerScoreMap[q.tmid] } }, cacheOptionSelectionForQuestion: function (q, bag) { q = q || {} bag = bag || {} if (!q.tmid) { return } if (q.kind === "scale") { var segM = Number(q.segment) if (!isFinite(segM) || segM < 1) { segM = 5 } segM = Math.floor(segM) var sv2 = bag.scaleValue if (sv2 === "" || sv2 === undefined || sv2 === null || !isFinite(Number(sv2))) { this.answerOptionMap[q.tmid] = "" return } var ui2 = Math.min(segM, Math.max(1, Math.floor(Number(sv2)))) this.answerOptionMap[q.tmid] = String(ui2 - 1) return } if (q.kind !== "judgment") { this.answerOptionMap[q.tmid] = "" return } if (q.isMulti) { this.answerOptionMap[q.tmid] = (bag.judgmentValues || []).slice() return } this.answerOptionMap[q.tmid] = bag.judgmentValue ? String(bag.judgmentValue) : "" }, cacheAnswerForSubmitForQuestion: function (q, bag) { q = q || {} bag = bag || {} if (!q || !q.tmid) { return } var entry = { questionno: q.questionno || "", tmid: q.tmid, tmbm: q.tmbm || "", questionId: q.rawId || q.tmid, tkid: q.tkid || this.currentTkid, questioncontent: q.title || "", tmlx: q.kind === "scale" ? 6 : q.kind === "judgment" ? (q.isMulti ? 3 : 1) : 2 } if (q.kind === "scale") { var segMax = Number(q.segment) if (!isFinite(segMax) || segMax < 1) { segMax = 5 } segMax = Math.floor(segMax) var sv = bag.scaleValue var ui = 1 if (sv !== "" && sv !== undefined && sv !== null && isFinite(Number(sv))) { ui = Math.min(segMax, Math.max(1, Math.floor(Number(sv)))) } entry.inputContent = ui - 1 entry.answerList = [] var marks = q.scaleMarks || {} var mk = marks[ui] entry.scaleAnswerLabel = mk != null && String(mk).trim() !== "" ? String(mk).trim() : String(ui) } else if (q.kind === "judgment") { if (q.isMulti) { var selectedMap = {} ;(bag.judgmentValues || []).forEach(function (v) { selectedMap[String(v)] = true }) entry.inputContent = "" entry.answerList = (q.options || []).map(function (opt) { if (!selectedMap[String(opt.value)]) return "false" return { answerText: opt.label || "", optionNo: Number(opt.value) || opt.value, score: opt.score !== undefined && opt.score !== null ? opt.score : "" } }) } else { var opt = (q.options || []).find(function (o) { return String(o.value) === String(bag.judgmentValue || "") }) entry.inputContent = "" entry.answerList = [{ optionNo: bag.judgmentValue ? (Number(bag.judgmentValue) || bag.judgmentValue) : "", score: opt && opt.score !== undefined && opt.score !== null ? opt.score : "", answerText: opt ? (opt.label || "") : "" }] } } else { entry.inputContent = bag.openAnswer || "" entry.answerList = [] } entry.bankDisplayName = this.snapshotBankDisplayNameForAnswer() var idx = this.interviewAnswers.findIndex(function (it) { return it.tmid === entry.tmid }) if (idx > -1) this.$set(this.interviewAnswers, idx, entry) else this.interviewAnswers.push(entry) }, cacheAnswerBundleForQuestion: function (q, bag) { this.cacheAnswerScoreForQuestion(q, bag) this.cacheOptionSelectionForQuestion(q, bag) this.cacheAnswerForSubmitForQuestion(q, bag) }, cacheCurrentAnswerScore: function () { this.cacheAnswerScoreForQuestion(this.currentQ, this.getCurrentAnswerFieldBag()) }, cacheCurrentOptionSelection: function () { this.cacheOptionSelectionForQuestion(this.currentQ, this.getCurrentAnswerFieldBag()) }, getScoreByRef: function (ref) { var key = ref != null ? String(ref).trim() : "" if (!key) return null if (this.answerScoreMap[key] !== undefined) return this.answerScoreMap[key] var list = this.questions || [] for (var i = 0; i < list.length; i++) { var q = list[i] || {} if (String(q.tmid || "") === key || String(q.questionno || "") === key) { return this.answerScoreMap[q.tmid] } } return null }, resolveScoreJumpTarget: function (q) { if (!q || !q.scorejumpquesno || q.scorejumpquesno === "0") return "" var targets = q.scorejumpquesno.split("#") if (!targets.length) return "" if (q.scorejumpnos && q.scorejumpnos !== "0") { var refs = q.scorejumpnos.split(",").map(function (s) { return s && s.trim() }).filter(Boolean) if (!refs.length) return "" var total = 0 for (var i = 0; i < refs.length; i++) { var score = this.getScoreByRef(refs[i]) if (score === undefined || score === null || isNaN(Number(score))) return "" total += Number(score) } var mins = q.scorejumpmin ? q.scorejumpmin.split(",") : [] var maxs = q.scorejumpmax ? q.scorejumpmax.split(",") : [] var pickTargetFromGroup = function (groupText) { var arr = String(groupText || "").split(",").map(function (s) { return s && s.trim() }).filter(Boolean) return arr[0] || "" } for (var j = 0; j < targets.length; j++) { var minRaw = mins[j] !== undefined && mins[j] !== "" ? Number(mins[j]) : -Infinity var maxRaw = maxs[j] !== undefined && maxs[j] !== "" ? Number(maxs[j]) : Infinity if (isNaN(minRaw)) minRaw = -Infinity if (isNaN(maxRaw)) maxRaw = Infinity var min = Math.min(minRaw, maxRaw) var max = Math.max(minRaw, maxRaw) if (total >= min && total <= max) return pickTargetFromGroup(targets[j]) } if (targets.length === 1) { var group = String(targets[0] || "") var twoTargets = group.split(",").map(function (s) { return s && s.trim() }).filter(Boolean) if (twoTargets.length >= 2) { var threshold = mins[0] !== undefined && mins[0] !== "" ? Number(mins[0]) : 1 if (isNaN(threshold)) threshold = 1 return Number(total) >= threshold ? twoTargets[0] : twoTargets[1] } } return "" } var selfScore = this.answerScoreMap[q.tmid] var singleMin = q.scorejumpmin !== "" ? Number(q.scorejumpmin) : -Infinity var singleMax = q.scorejumpmax !== "" ? Number(q.scorejumpmax) : Infinity if (isNaN(singleMin)) singleMin = -Infinity if (isNaN(singleMax)) singleMax = Infinity var singleLow = Math.min(singleMin, singleMax) var singleHigh = Math.max(singleMin, singleMax) if (selfScore !== null && selfScore !== undefined && !isNaN(Number(selfScore)) && Number(selfScore) >= singleLow && Number(selfScore) <= singleHigh) { return String(targets[0] || "").split(",")[0] || "" } if (targets.length === 1) { var singleGroup = String(targets[0] || "") var singleTwoTargets = singleGroup.split(",").map(function (s) { return s && s.trim() }).filter(Boolean) if (singleTwoTargets.length >= 2 && selfScore !== null && selfScore !== undefined && !isNaN(Number(selfScore))) { var singleThreshold = isFinite(singleLow) ? singleLow : 1 return Number(selfScore) >= Number(singleThreshold) ? singleTwoTargets[0] : singleTwoTargets[1] } } return "" }, matchJumpRuleTarget: function (rows, selectedOptionId) { var list = Array.isArray(rows) ? rows : [] if (!list.length) return "" var sid = selectedOptionId != null ? String(selectedOptionId).trim() : "" if (sid) { var matched = list.find(function (r) { return String(r.ttxx || "") === sid }) if (matched && matched.mbtkid) { return String(matched.mbtkid) } } var emptyRule = list.find(function (r) { return !r.ttxx && r.mbtkid }) return emptyRule && emptyRule.mbtkid ? String(emptyRule.mbtkid) : "" }, getCurrentBankSelectedScoreTotal: function () { var list = this.questions || [] var map = this.answerScoreMap || {} var total = 0 for (var i = 0; i < list.length; i++) { var tmid = list[i] && list[i].tmid if (tmid == null || tmid === "") { continue } var s = map[tmid] if (s !== null && s !== undefined && !isNaN(Number(s))) { total += Number(s) } } return total }, pickLjfsttMbtkidFromRules: function (rules, totalScore) { var list = (rules || []).filter(function (r) { return r && r.mbtkid != null && String(r.mbtkid).trim() !== "" && r.ljfs != null && String(r.ljfs).trim() !== "" }) list.sort(function (a, b) { return Number(b.ljfs) - Number(a.ljfs) }) var t = Number(totalScore) if (isNaN(t)) { t = 0 } for (var i = 0; i < list.length; i++) { var th = Number(list[i].ljfs) if (isNaN(th)) { continue } if (t >= th) { return String(list[i].mbtkid).trim() } } return "" }, fetchLjfsttRules: function (tkid, callback) { var that = this var key = tkid != null ? String(tkid).trim() : "" if (!key) { callback && callback([]) return } if (this.ljfsttRuleMap[key] !== undefined) { callback && callback(this.ljfsttRuleMap[key]) return } $.get("/www/public/cpgl/cxljfstt", { tkid: key }, function (res) { var ok = res && (res.error === 0 || res.code === 200 || res.code === 0 || res.success === 1) var rows = [] if (ok && res.data != null) { rows = Array.isArray(res.data) ? res.data : [res.data] } that.ljfsttRuleMap[key] = rows callback && callback(rows) }).fail(function () { that.ljfsttRuleMap[key] = [] callback && callback([]) }) }, fetchJumpRule: function (tmid, selectedOptionId) { var that = this return new Promise(function (resolve) { if (!tmid) { resolve("") return } var tmidKey = String(tmid) if (that.jumpRuleMap[tmidKey] !== undefined) { resolve(that.matchJumpRuleTarget(that.jumpRuleMap[tmidKey], selectedOptionId)) return } $.get("/www/public/cpgl/cxtktt", { tmid: tmid }, function (res) { var ok = res && (res.error === 0 || res.code === 200 || res.code === 0 || res.success === 1) if (!ok) { resolve("") return } var rows = Array.isArray(res.data) ? res.data : (res.data ? [res.data] : []) that.jumpRuleMap[tmidKey] = rows resolve(that.matchJumpRuleTarget(rows, selectedOptionId)) }).fail(function () { that.$message && that.$message.error("查询跳题规则失败") resolve("") }) }) }, loadQuestionBank: function (tkid, resetIndex, done) { var that = this if (!tkid) { if (this.$message) this.$message.warning("未获取到跳转题库ID") done && done(false) return } this.sessionLoading = true $.get("/www/public/cpgl/cxtkmc", { tkid: tkid }, function (cres) { var cok = cres && (cres.error === 0 || cres.code === 200 || cres.code === 0 || cres.success === 1) var cdata = cok && cres.data if (Array.isArray(cdata)) { for (var ci = 0; ci < cdata.length; ci++) { var crow = cdata[ci] if (crow && crow.mc != null) { var mcs = String(crow.mc).trim() if (mcs) { that.currentBankDisplayName = mcs break } } } } }) $.get("/www/public/cpgl/tkZhInfo", { tkid: tkid }, function (res) { var ok = res && (res.error === 0 || res.code === 200 || res.code === 0 || res.success === 1) if (!ok) { that.$message && that.$message.error((res && (res.message || res.msg)) || "加载题库失败") done && done(false) return } var payload = res.data var data = [] if (Array.isArray(payload)) { data = payload } else if (payload && Array.isArray(payload.list)) { data = payload.list } else if (payload && Array.isArray(payload.rows)) { data = payload.rows } if (!that.currentBankDisplayName || !String(that.currentBankDisplayName).trim()) { var bankNm = "" if (res.tkmc != null && String(res.tkmc).trim()) { bankNm = String(res.tkmc).trim() } else if (payload && typeof payload === "object" && !Array.isArray(payload)) { bankNm = String(payload.tkmc || payload.mc || payload.sjtitle || "").trim() } if (!bankNm && data.length) { for (var di = 0; di < data.length; di++) { var dr = data[di] if (!dr) { continue } bankNm = String( dr.tkmc || dr.tmmc || dr.tkname || dr.sjmc || dr.mc || dr.sjtitle || "" ).trim() if (bankNm) { break } } } that.currentBankDisplayName = bankNm } var normalized = that.normalizeBankQuestions(data) if (!normalized.length) { that.sessionLoading = false done && done(false) return } that.questions = normalized that.rebuildQuestionSourceIndex() that.initBankAnswersMap() that.currentTkid = tkid that.visitedTkids[tkid] = true if (resetIndex) { that.questionIndex = 0 } else { that.questionIndex = Math.min(that.questionIndex, Math.max(0, that.questions.length - 1)) } that.resetQuestionFields() that.sessionLoading = false done && done(true) }).fail(function () { that.$message && that.$message.error("加载题库请求失败") that.sessionLoading = false done && done(false) }) }, sessionPrimary: function () { if (this.sessionLoading) return var currentQuestion = this.currentQ var inlineShown = this.showInlinePostJump var inlineQuestion = inlineShown ? this.inlinePostJumpQ : null if (this.isMoodDimensionBank) { var moodList = this.bankAllQuestions for (var mi = 0; mi < moodList.length; mi++) { if (this.isQuestionAnswerEmpty(moodList[mi], this.getBankAnswerBag(moodList[mi]))) { if ( moodList[mi].kind === "open" || moodList[mi].kind === "closing" ) { this.$message && this.$message.warning("请填写本题内容") } return } } for (var mj = 0; mj < moodList.length; mj++) { this.cacheAnswerBundleForQuestion(moodList[mj], this.getBankAnswerBag(moodList[mj])) } for (var mk = 0; mk < moodList.length; mk++) { var mq = moodList[mk] var msc = this.answerScoreMap[mq.tmid] if (msc !== null && msc !== undefined && Number(String(msc).trim()) === 999) { this.finishInterview() return } if (mq.kind === "closing") { this.finishInterview() return } } if (moodList.length) { currentQuestion = moodList[moodList.length - 1] } inlineShown = false inlineQuestion = null } else { if (this.isQuestionAnswerEmpty(currentQuestion, this.getCurrentAnswerFieldBag())) { if (currentQuestion.kind === "open" || currentQuestion.kind === "closing") { this.$message && this.$message.warning("请填写本题内容") } return } if (inlineShown && this.isQuestionAnswerEmpty(inlineQuestion, this.getInlineAnswerFieldBag())) { if (inlineQuestion && (inlineQuestion.kind === "open" || inlineQuestion.kind === "closing")) { this.$message && this.$message.warning("请填写本题内容") } return } if (!currentQuestion || !currentQuestion.tmid) return this.cacheAnswerBundleForQuestion(currentQuestion, this.getCurrentAnswerFieldBag()) if (inlineShown && inlineQuestion && inlineQuestion.tmid) { this.cacheAnswerBundleForQuestion(inlineQuestion, this.getInlineAnswerFieldBag()) } if (currentQuestion.kind === "closing") { this.finishInterview() return } /** 选项分 999:立即结束访谈并提交(不走跳题);与 666 相同,提交后「访谈结果」与 ftjg 按危机计 */ var endByScoreEarly = this.answerScoreMap[currentQuestion.tmid] if (endByScoreEarly !== null && endByScoreEarly !== undefined && Number(String(endByScoreEarly).trim()) === 999) { this.finishInterview() return } } var that = this var isLastQuestion = this.isMoodDimensionBank ? true : this.isEffectivelyLastQuestion(inlineShown) var selectedOptionId = this.answerOptionMap[currentQuestion.tmid] || "" var jumpSourceTmid = currentQuestion.rawId || currentQuestion.tmid var currentBankId = this.currentTkid ? String(this.currentTkid) : "" this.sessionLoading = true var seq = Number(this._jumpCheckSeq) if (!isFinite(seq)) seq = 0 this._jumpCheckSeq = seq + 1 var reqSeq = this._jumpCheckSeq var scoreJumpTkid = "" if (this.isMoodDimensionBank) { var moodScoreQs = this.bankAllQuestions || [] for (var ms = 0; ms < moodScoreQs.length; ms++) { var msq = moodScoreQs[ms] if ( msq && (msq.kind === "judgment" || msq.kind === "scale") && msq.scorejumpquesno && String(msq.scorejumpquesno) !== "0" ) { scoreJumpTkid = this.resolveScoreJumpTarget(msq) if (scoreJumpTkid) { break } } } } else if (currentQuestion.kind === "judgment" || currentQuestion.kind === "scale") { scoreJumpTkid = this.resolveScoreJumpTarget(currentQuestion) } var runBankRuleJump = function () { that.fetchJumpRule(jumpSourceTmid, selectedOptionId).then(function (jumpTkid) { var latestSeq = Number(that._jumpCheckSeq) if (isFinite(latestSeq) && reqSeq !== latestSeq) return if (jumpTkid && currentBankId && String(jumpTkid) === currentBankId) jumpTkid = "" if (jumpTkid) { if (that.visitedTkids[jumpTkid]) { that.$message && that.$message.warning("检测到重复跳题,已停止循环跳转") return } that.loadQuestionBank(jumpTkid, true) return } if (!isLastQuestion) { that.moveToNextQuestionOrFinish(inlineShown) return } that.finishInterview() }).finally(function () { that.sessionLoading = false }) } /** 分数题库跳题 → 题库跳题;优先级低于题目分数跳题;满足累计分后须答至本题库最后一题再跳 */ var runLjfsttThenBankRule = function () { if (!currentBankId) { runBankRuleJump() return } that.fetchLjfsttRules(currentBankId, function (rules) { var latestSeq2 = Number(that._jumpCheckSeq) if (isFinite(latestSeq2) && reqSeq !== latestSeq2) { that.sessionLoading = false return } var totalScore = that.getCurrentBankSelectedScoreTotal() var ljfsttTkid = that.pickLjfsttMbtkidFromRules(rules, totalScore) if (ljfsttTkid && currentBankId && String(ljfsttTkid) === currentBankId) { runBankRuleJump() return } if (ljfsttTkid && !isLastQuestion) { runBankRuleJump() return } if (ljfsttTkid) { if (that.visitedTkids[ljfsttTkid]) { that.$message && that.$message.warning("检测到重复跳题,已停止循环跳转") that.sessionLoading = false if (!isLastQuestion) { that.moveToNextQuestionOrFinish(false) } else { that.finishInterview() } return } that.loadQuestionBank(ljfsttTkid, true, function (ok) { if (!ok) { that.sessionLoading = true runBankRuleJump() } }) return } runBankRuleJump() }) } if (scoreJumpTkid) { if (currentBankId && String(scoreJumpTkid) === currentBankId) { runLjfsttThenBankRule() return } if (that.visitedTkids[scoreJumpTkid]) { this.sessionLoading = false that.$message && that.$message.warning("检测到重复跳题,已停止循环跳转") if (!isLastQuestion) { that.moveToNextQuestionOrFinish(false) } else { that.finishInterview() } return } that.loadQuestionBank(scoreJumpTkid, true, function (ok) { if (!ok) { that.sessionLoading = true runLjfsttThenBankRule() } }) return } runLjfsttThenBankRule() }, finishInterview: function () { if (this.submitLoading) return if (!this.isMoodDimensionBank) { this.cacheCurrentAnswerForSubmit() } var that = this var submitWithFullpath = function (fullpath) { var submitParams = that.buildSubmitParams() submitParams.fullpath = fullpath != null && fullpath !== undefined ? String(fullpath) : "" $.post("/www/public/st/saveda_ft", submitParams, function (res) { that.submitLoading = false if (res && res.success == 1) { if (that.$message) { that.$message({ message: "访谈已完成", type: "success", customClass: "startInterviewh5-msgFinish" }) } that.interviewResultLevel = that.computeInterviewResultLevelFromAnswers(that.interviewAnswers) that.phase = "done" that.clearDoneReturnTimer() return } that.$message && that.$message.error((res && (res.message || res.msg)) || "提交失败,请稍后再试!") }).fail(function () { that.submitLoading = false that.$message && that.$message.error("网络连接错误,请检查本机网络!") }) } this.submitLoading = true var afterRecordingReady = Promise.resolve() if (this.interviewRecordingEnabled) { afterRecordingReady = this.pauseRecordingAndBuildFile() } afterRecordingReady .then(function () { if (!that.interviewRecordingEnabled) { submitWithFullpath("") return } return that.uploadInterviewRecording().then(function (fullpath) { submitWithFullpath(fullpath || "") }) }) .catch(function (errMsg) { that.submitLoading = false that.$message && that.$message.error(errMsg || "录音处理或上传失败,请稍后重试") }) }, buildSubmitParams: function () { var user = {} var answererInfo = {} try { user = JSON.parse(localStorage.getItem("user") || "{}") } catch (e) {} try { answererInfo = JSON.parse(localStorage.getItem("answererInfo") || "{}") } catch (e) {} var endTs = Date.now() var finalToolId = this.toolIdFromApi || this.currentTkid || "" var rawAnswers = this.interviewAnswers || [] var answersForPayload = rawAnswers.map(function (e) { if (!e || typeof e !== "object") { return e } var copy = {} Object.keys(e).forEach(function (key) { if (key === "bankDisplayName" || key === "scaleAnswerLabel") { return } copy[key] = e[key] }) return copy }) var payloadObj = { toolId: finalToolId, openQuestionAnswerVOS: answersForPayload, xb: answererInfo.xb || "" } var payloadStr = JSON.stringify(payloadObj) var encryptedPayload = payloadStr try { if (typeof Dengdu !== "undefined" && Dengdu.crypto && Dengdu.crypto.zip && Dengdu.crypto.zip.encrypt) { encryptedPayload = Dengdu.crypto.zip.encrypt(payloadStr) } } catch (e) {} var riskLevel = this.computeInterviewResultLevelFromAnswers(this.interviewAnswers || []) /** ftjg:0 暂不关注,1 重点关注,2 推送校心理中心(与 PC、interviewManagement 一致) */ var ftjg = 0 if (riskLevel === "crisis") { ftjg = 2 } else if (riskLevel === "focus") { ftjg = 1 } return { xm: answererInfo.xm || "", xsid: this.$route && this.$route.query ? (this.$route.query.studentId || "") : "", xxid: answererInfo.schoolid || answererInfo.xxid || "", xxmc: answererInfo.xxmc || "", zymc: answererInfo.zy || "", nj: answererInfo.nj || "", bjmc: answererInfo.bj || "", xd: answererInfo.xd || answererInfo.xxjd || "", account: user.Username || "", email: user.Email || "", ujs: Array.isArray(user.Roles) ? (user.Roles[0] || "") : "", toolId: finalToolId, stid: this.$route && this.$route.query ? (this.$route.query.sjid || this.$route.query.stid || "") : "", dtcnt: (this.interviewAnswers || []).length, dttime: this.calculateTimeDifferenceSeconds(this.sessionStartTs, endTs), starttime: this.formatDateTimeYMDHMS(this.sessionStartTs || endTs), questionAnswers: encryptedPayload, ftjg: ftjg } }, uploadInterviewRecording: function () { var that = this return new Promise(function (resolve, reject) { if (!that.recordingFile) { resolve("") return } var fd = new FormData() fd.append("file", that.recordingFile) fd.append("rel", "r_ft_ftjl") fd.append("attname", "lywj") $.ajax({ url: "/www/public/shouye/ft_lysc_new", type: "POST", data: fd, processData: false, contentType: false, success: function (res) { var ok = res && (res.success === 1 || res.error === 0 || res.code === 0 || res.code === "0" || res.code === 200) if (!ok) { reject((res && (res.message || res.msg)) || "录音文件上传失败") return } var fullpath = "" if (typeof res.data === "string") fullpath = res.data else if (res.data && typeof res.data.fullpath === "string") fullpath = res.data.fullpath else if (res.data && typeof res.data.path === "string") fullpath = res.data.path else if (typeof res.fullpath === "string") fullpath = res.fullpath else if (typeof res.path === "string") fullpath = res.path resolve(fullpath || "") }, error: function () { reject("录音文件上传请求失败") } }) }) }, encodeAudioBufferToWavBlob: function (audioBuffer) { var numChannels = audioBuffer.numberOfChannels var sampleRate = audioBuffer.sampleRate var bitDepth = 16 var samples = audioBuffer.length var blockAlign = (numChannels * bitDepth) / 8 var byteRate = sampleRate * blockAlign var dataSize = samples * blockAlign var buffer = new ArrayBuffer(44 + dataSize) var view = new DataView(buffer) var writeString = function (offset, str) { for (var i = 0; i < str.length; i++) { view.setUint8(offset + i, str.charCodeAt(i)) } } writeString(0, "RIFF") view.setUint32(4, 36 + dataSize, true) writeString(8, "WAVE") writeString(12, "fmt ") view.setUint32(16, 16, true) view.setUint16(20, 1, true) view.setUint16(22, numChannels, true) view.setUint32(24, sampleRate, true) view.setUint32(28, byteRate, true) view.setUint16(32, blockAlign, true) view.setUint16(34, bitDepth, true) writeString(36, "data") view.setUint32(40, dataSize, true) var offset = 44 var chData = [] var c for (c = 0; c < numChannels; c++) { chData.push(audioBuffer.getChannelData(c)) } var i for (i = 0; i < samples; i++) { for (c = 0; c < numChannels; c++) { var s = Math.max(-1, Math.min(1, chData[c][i])) view.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7fff, true) offset += 2 } } return new Blob([view], { type: "audio/wav" }) }, convertBlobToWavBlob: function (blob) { var that = this if (!blob) { return Promise.reject(new Error("录音数据为空")) } if (blob.type && blob.type.indexOf("wav") > -1) { return Promise.resolve(blob) } if (typeof window === "undefined" || typeof blob.arrayBuffer !== "function") { return Promise.reject(new Error("当前环境无法转换 WAV")) } var AC = window.AudioContext || window.webkitAudioContext if (!AC) { return Promise.reject(new Error("当前浏览器无法解码录音")) } var ctx = null return blob .arrayBuffer() .then(function (buf) { ctx = new AC() return ctx.decodeAudioData(buf) }) .then(function (audioBuffer) { if (ctx) { try { ctx.close() } catch (e) { } } return that.encodeAudioBufferToWavBlob(audioBuffer) }) .catch(function (err) { if (ctx) { try { ctx.close() } catch (e2) { } } return Promise.reject(err) }) }, buildRecordingWavFromChunks: function () { var that = this var chunks = (this._recChunks || []).slice() if (!chunks.length) { this.recordingBlob = null this.recordingFile = null this.recordingMimeType = "" return Promise.resolve() } var captureMime = this.recordingMimeType || "audio/webm" var rawBlob = new Blob(chunks, { type: captureMime }) var chain = rawBlob.type && rawBlob.type.indexOf("wav") > -1 ? Promise.resolve(rawBlob) : this.convertBlobToWavBlob(rawBlob) return chain.then(function (wavBlob) { that.recordingBlob = wavBlob that.recordingMimeType = "audio/wav" that.recordingFile = that.createRecordingFile(wavBlob) }) }, pauseRecordingAndBuildFile: function () { var that = this var recorder = this._recorder if (!recorder) { return Promise.resolve() } if (recorder.state === "recording") { try { recorder.pause() if (recorder.requestData) { recorder.requestData() } } catch (e) { } } this.recordingActive = false this.clearRecTimer() return this.buildRecordingWavFromChunks().then(function () { that.releaseRecordingResources() }) }, clearMicCheckSecTimer: function () { if (this._micCheckSecTimer) { clearInterval(this._micCheckSecTimer) this._micCheckSecTimer = null } }, resetMicCheckBarLevelsIdle: function () { var a = [] for (var i = 0; i < 16; i++) { a.push(12) } this.micCheckBarLevels = a }, stopMicCheckVisualizer: function () { if (this._micCheckRaf != null) { try { cancelAnimationFrame(this._micCheckRaf) } catch (e) {} this._micCheckRaf = null } this._micCheckAnalyser = null if (this._micCheckAudioCtx) { try { this._micCheckAudioCtx.close() } catch (e) {} this._micCheckAudioCtx = null } this.resetMicCheckBarLevelsIdle() }, startMicCheckVisualizer: function () { var that = this this.stopMicCheckVisualizer() if (!this._micCheckStream) { return } try { var AC = typeof window !== "undefined" && (window.AudioContext || window.webkitAudioContext) if (!AC) { return } var ctx = new AC() this._micCheckAudioCtx = ctx var source = ctx.createMediaStreamSource(this._micCheckStream) var analyser = ctx.createAnalyser() analyser.fftSize = 128 analyser.smoothingTimeConstant = 0.65 source.connect(analyser) this._micCheckAnalyser = analyser var buf = new Uint8Array(analyser.frequencyBinCount) var nBars = 16 var step = Math.max(1, Math.floor(buf.length / nBars)) var loop = function () { if (!that._micCheckAnalyser || !that.micCheckActive) { return } analyser.getByteFrequencyData(buf) var levels = [] for (var i = 0; i < nBars; i++) { var sum = 0 for (var j = 0; j < step; j++) { sum += buf[Math.min(i * step + j, buf.length - 1)] } var v = sum / step / 255 levels.push(Math.max(10, Math.min(100, 12 + v * 88))) } that.micCheckBarLevels = levels that._micCheckRaf = requestAnimationFrame(loop) } this._micCheckRaf = requestAnimationFrame(loop) } catch (e) { this.resetMicCheckBarLevelsIdle() } }, releaseMicCheckResources: function () { this.clearMicCheckSecTimer() this.stopMicCheckVisualizer() var rec = this._micCheckRecorder if (rec && (rec.state === "recording" || rec.state === "paused")) { try { rec.stop() } catch (e) {} } else { if (this._micCheckStream) { try { this._micCheckStream.getTracks().forEach(function (t) { t.stop() }) } catch (e) {} this._micCheckStream = null } this._micCheckRecorder = null this._micCheckChunks = [] } this.micCheckActive = false this.micCheckLoading = false this.micCheckSeconds = 0 this._micCheckRecordStartMs = 0 }, revokeMicCheckPlayback: function () { this.stopMicCheckPlayback() if (this.micCheckPlaybackUrl) { try { URL.revokeObjectURL(this.micCheckPlaybackUrl) } catch (e) {} this.micCheckPlaybackUrl = "" } this.micCheckBlob = null this.micCheckPlaybackDurationSec = 0 this.micCheckPlaybackCurrentSec = 0 this.micCheckPlaybackPlaying = false this._micCheckRecordStartMs = 0 }, formatRecordingClock: function (seconds) { var s = Math.max(0, Math.floor(Number(seconds) || 0)) var m = Math.floor(s / 60) var r = s % 60 return (m < 10 ? "0" : "") + m + ":" + (r < 10 ? "0" : "") + r }, formatMediaTime: function (seconds) { return this.formatRecordingClock(seconds) }, beginMicCheckPrepare: function () { this.micCheckLoading = true this.micCheckActive = false this.clearMicCheckSecTimer() this.stopMicCheckVisualizer() this.micCheckSeconds = 0 this._micCheckRecordStartMs = 0 }, beginMicCheckRecording: function () { this.micCheckActive = true this.micCheckLoading = false this.micCheckSeconds = 0 this.clearMicCheckSecTimer() var that = this this._micCheckSecTimer = setInterval(function () { if (!that.micCheckActive || that.micCheckLoading) { return } that.micCheckSeconds += 1 }, 1000) }, applyMicCheckPlaybackBlob: function (blob, durationMs) { var that = this var done = function (fixedBlob) { if (that.micCheckPlaybackUrl) { try { URL.revokeObjectURL(that.micCheckPlaybackUrl) } catch (e) {} } that.micCheckPlaybackUrl = URL.createObjectURL(fixedBlob) that.micCheckRecordedOnce = true that.$nextTick(function () { var el = that.$refs.micCheckPlaybackAudio if (el && typeof el.load === "function") { try { el.load() } catch (e2) {} } that.refineMicCheckPlaybackDuration(fixedBlob) }) } if (typeof window !== "undefined" && typeof window.ysFixWebmDuration === "function") { window.ysFixWebmDuration(blob, durationMs, done) return } done(blob) }, refineMicCheckPlaybackDuration: function (blob) { var that = this if (!blob || typeof window === "undefined") { return } var AC = window.AudioContext || window.webkitAudioContext if (!AC) { return } var ctx = null try { ctx = new AC() } catch (e) { return } var closeCtx = function () { if (!ctx) { return } try { ctx.close() } catch (e2) {} ctx = null } if (typeof blob.arrayBuffer !== "function") { closeCtx() return } blob.arrayBuffer().then(function (buf) { return ctx.decodeAudioData(buf) }).then(function (audioBuffer) { if ( !that.micCheckPlaybackDurationSec && audioBuffer && audioBuffer.duration && isFinite(audioBuffer.duration) && audioBuffer.duration > 0 ) { that.micCheckPlaybackDurationSec = Math.floor(audioBuffer.duration) } closeCtx() }).catch(function () { closeCtx() }) }, syncMicCheckPlaybackDuration: function () { var el = this.$refs.micCheckPlaybackAudio if (!el) { return } if (this.micCheckPlaybackDurationSec > 0) { return } var d = el.duration if (d && isFinite(d) && d > 0) { this.micCheckPlaybackDurationSec = Math.floor(d) } }, stopMicCheckPlayback: function () { var el = this.$refs.micCheckPlaybackAudio if (el && !el.paused) { try { el.pause() } catch (e) {} } this.micCheckPlaybackPlaying = false }, toggleMicCheckPlayback: function () { var that = this var el = this.$refs.micCheckPlaybackAudio if (!el || !this.micCheckPlaybackUrl) { return } if (this.micCheckPlaybackPlaying) { try { el.pause() } catch (e) {} } else { var playPromise = el.play() if (playPromise && typeof playPromise.then === "function") { playPromise.catch(function () { that.micCheckPlaybackPlaying = false if (that.$message) { that.$message.error("无法播放,请重试") } }) } } }, onMicCheckPlaybackPlay: function () { this.micCheckPlaybackPlaying = true }, onMicCheckPlaybackPause: function () { this.micCheckPlaybackPlaying = false }, onMicCheckPlaybackSeekClick: function (e) { var el = this.$refs.micCheckPlaybackAudio if (!el || !this.micCheckPlaybackDurationSec) { return } var track = e.currentTarget var rect = track.getBoundingClientRect() var w = rect.width if (!w) { return } var x = e.clientX - rect.left var p = Math.min(1, Math.max(0, x / w)) try { el.currentTime = p * this.micCheckPlaybackDurationSec } catch (err) {} }, onMicCheckPlaybackTimeupdate: function () { var el = this.$refs.micCheckPlaybackAudio if (!el) { return } this.micCheckPlaybackCurrentSec = el.currentTime || 0 }, onMicCheckPlaybackEnded: function () { this.micCheckPlaybackPlaying = false this.micCheckPlaybackCurrentSec = 0 var el = this.$refs.micCheckPlaybackAudio if (el) { try { el.currentTime = 0 } catch (e) {} } }, ensureMicCheckRecorder: function () { var that = this return new Promise(function (resolve, reject) { if (typeof navigator === "undefined" || !navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) { reject(new Error("当前环境不支持录音")) return } if (typeof MediaRecorder === "undefined") { reject(new Error("浏览器不支持录音")) return } navigator.mediaDevices.getUserMedia({ audio: true }).then(function (stream) { that._micCheckStream = stream that._micCheckChunks = [] var mimeType = that.getRecorderMimeType() if (!mimeType) { try { stream.getTracks().forEach(function (track) { track.stop() }) } catch (e) {} that._micCheckStream = null reject(new Error("当前浏览器不支持录音,请更换浏览器后重试")) return } var recorder = new MediaRecorder(stream, { mimeType: mimeType }) that.micCheckMimeType = mimeType recorder.ondataavailable = function (evt) { if (evt && evt.data && evt.data.size > 0) { that._micCheckChunks.push(evt.data) } } recorder.onstop = function () { var durationSec = Math.max(0, Math.floor(that.micCheckSeconds || 0)) var durationMs = durationSec * 1000 that.clearMicCheckSecTimer() that.stopMicCheckVisualizer() that._micCheckRecordStartMs = 0 that.micCheckActive = false that.micCheckSeconds = durationSec var chunks = that._micCheckChunks || [] if (chunks.length) { var blob = new Blob(chunks, { type: that.micCheckMimeType || "audio/webm" }) that.micCheckBlob = blob that.micCheckPlaybackDurationSec = durationSec > 0 ? durationSec : 0 that.micCheckPlaybackCurrentSec = 0 that.micCheckPlaybackPlaying = false that.applyMicCheckPlaybackBlob(blob, durationMs) } else { that.micCheckRecordedOnce = false that.micCheckPlaybackDurationSec = 0 that.micCheckPlaybackCurrentSec = 0 } if (that._micCheckStream) { try { that._micCheckStream.getTracks().forEach(function (t) { t.stop() }) } catch (e) {} that._micCheckStream = null } that._micCheckRecorder = null that._micCheckChunks = [] } that._micCheckRecorder = recorder resolve(recorder) }).catch(function (err) { reject(err || new Error("无法访问麦克风")) }) }) }, toggleMicCheckRecording: function () { var that = this if (this.micCheckLoading) { return } if (this._micCheckRecorder && this._micCheckRecorder.state === "recording") { this.clearMicCheckSecTimer() this.stopMicCheckVisualizer() try { if (this._micCheckRecorder.requestData) { this._micCheckRecorder.requestData() } } catch (e) {} try { this._micCheckRecorder.stop() } catch (e) {} return } this.beginMicCheckPrepare() this.ensureMicCheckRecorder().then(function (rec) { if (rec.state !== "inactive") { that.micCheckLoading = false return } that._micCheckChunks = [] that.micCheckSeconds = 0 if (that.micCheckPlaybackUrl) { try { URL.revokeObjectURL(that.micCheckPlaybackUrl) } catch (e) {} that.micCheckPlaybackUrl = "" } that.micCheckBlob = null that.micCheckRecordedOnce = false that.micCheckPlaybackDurationSec = 0 that.micCheckPlaybackCurrentSec = 0 that.stopMicCheckPlayback() try { rec.start(1000) } catch (e) { if (that.$message) { that.$message.error("无法开始试录") } that.releaseMicCheckResources() return } that.startMicCheckVisualizer() that.beginMicCheckRecording() }).catch(function (err) { that.micCheckLoading = false that.micCheckActive = false that.clearMicCheckSecTimer() that.micCheckSeconds = 0 that._micCheckRecordStartMs = 0 if (that.$message) { that.$message.error((err && err.message) || "无法访问麦克风,请在提示中选择允许后重试") } }) }, resetMicCheckRecording: function () { if (this.micCheckLoading) { return } this.micCheckRecordedOnce = false this.releaseMicCheckResources() this.revokeMicCheckPlayback() }, getRecorderMimeType: function () { if (typeof MediaRecorder === "undefined" || !MediaRecorder.isTypeSupported) { return "" } if (MediaRecorder.isTypeSupported("audio/wav")) { return "audio/wav" } if (MediaRecorder.isTypeSupported("audio/webm;codecs=opus")) { return "audio/webm;codecs=opus" } if (MediaRecorder.isTypeSupported("audio/webm")) { return "audio/webm" } if (MediaRecorder.isTypeSupported("audio/mp4")) { return "audio/mp4" } return "" }, createRecordingFile: function (blob) { var ext = "wav" if (blob.type && blob.type.indexOf("wav") > -1) { ext = "wav" } else if (blob.type && blob.type.indexOf("webm") > -1) { ext = "webm" } else if (blob.type && blob.type.indexOf("mp4") > -1) { ext = "mp4" } var now = new Date() var pad = function (n) { return n < 10 ? "0" + n : "" + n } var fileName = "interview-" + now.getFullYear() + pad(now.getMonth() + 1) + pad(now.getDate()) + "-" + pad(now.getHours()) + pad(now.getMinutes()) + pad(now.getSeconds()) + "." + ext return new File([blob], fileName, { type: blob.type || "audio/wav" }) }, ensureRecorderReady: function () { var that = this return new Promise(function (resolve, reject) { if (typeof navigator === "undefined" || !navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) { reject(new Error("当前环境不支持录音")) return } if (typeof MediaRecorder === "undefined") { reject(new Error("浏览器不支持录音")) return } if (that._recorder && that._recorder.state !== "inactive") { resolve(that._recorder) return } navigator.mediaDevices.getUserMedia({ audio: true }).then(function (stream) { that._recStream = stream that._recChunks = [] that.recordingBlob = null that.recordingFile = null var mimeType = that.getRecorderMimeType() if (!mimeType) { try { stream.getTracks().forEach(function (track) { track.stop() }) } catch (e) {} reject(new Error("当前浏览器不支持录音,请更换浏览器后重试")) return } var recorder = new MediaRecorder(stream, { mimeType: mimeType }) that.recordingMimeType = mimeType recorder.ondataavailable = function (evt) { if (evt && evt.data && evt.data.size > 0) that._recChunks.push(evt.data) } recorder.onstop = function () { that.recordingActive = false that.clearRecTimer() that.buildRecordingWavFromChunks().then(function () { that.releaseRecordingResources() }) } that._recorder = recorder resolve(recorder) }).catch(function (err) { reject(err) }) }) }, cacheCurrentAnswerForSubmit: function () { this.cacheAnswerForSubmitForQuestion(this.currentQ, this.getCurrentAnswerFieldBag()) }, debugPrintSubmitParams: function () { this.cacheCurrentAnswerForSubmit() return this.buildSubmitParams() }, debugPrintRecordingFile: function () { return { blob: this.recordingBlob, file: this.recordingFile } }, isInlineOptionSelected: function (value) { var key = String(value) var q = this.inlinePostJumpQ || {} if (q.isMulti) { return Array.isArray(this.inlineJudgmentValues) && this.inlineJudgmentValues.indexOf(key) > -1 } return String(this.inlineJudgmentValue || "") === key }, toggleInlineMultiOption: function (value) { var key = String(value) var list = Array.isArray(this.inlineJudgmentValues) ? this.inlineJudgmentValues.slice() : [] var idx = list.indexOf(key) if (idx > -1) { list.splice(idx, 1) } else { list.push(key) } this.inlineJudgmentValues = list }, isOptionSelected: function (value) { var key = String(value) if (this.currentQ && this.currentQ.isMulti) { return Array.isArray(this.judgmentValues) && this.judgmentValues.indexOf(key) > -1 } return String(this.judgmentValue || "") === key }, toggleMultiOption: function (value) { var key = String(value) var list = Array.isArray(this.judgmentValues) ? this.judgmentValues.slice() : [] var idx = list.indexOf(key) if (idx > -1) list.splice(idx, 1) else list.push(key) this.judgmentValues = list }, onSingleChoiceSelected: function () { if (!this.currentQ || this.currentQ.kind !== "judgment" || this.currentQ.isMulti) return if (this.sessionLoading) return if (!this.judgmentValue) return if (this.phase !== "session") return if (this.postJumpNextHasRules()) return this.sessionPrimary() }, toggleRecording: function () { var that = this this.ensureRecorderReady().then(function (recorder) { if (recorder.state === "recording") { recorder.pause() that.recordingActive = false that.clearRecTimer() return } if (recorder.state === "paused") recorder.resume() else { that.recordingSeconds = 0 recorder.start(1000) } that.recordingActive = true that.clearRecTimer() that._recTimer = setInterval(function () { that.recordingSeconds += 1 }, 1000) }).catch(function (err) { that.$message && that.$message.error((err && err.message) || "无法开始录音,请在浏览器提示中选择允许麦克风后重试") }) }, stopRecording: function () { if (this.$message) { this.$message.warning("录音会在访谈结束后自动暂停并生成文件") } }, releaseRecordingResources: function () { if (this._recStream && this._recStream.getTracks) { this._recStream.getTracks().forEach(function (t) { t.stop() }) } this._recStream = null this._recorder = null this._recChunks = [] } } }) }) })(template, resolve, reject); }); RegVueCom("xljk-addObservation", function(resolve, reject){ var template = ""; return (function(template, resolve, reject) { seajs.use([], function () { return resolve({ template: template, name: "xljk-addObservation", props: { studentNo: { type: String, default: "" }, studentName: { type: String, default: "" }, teacherName: { type: String, default: "李老师" }, studentSource: { type: String, default: "测评初筛" } }, data: function () { return { step: 1, period: null, selection: {}, User: {}, answererInfo: {}, startTime: 0, serverTime: "", submitLoading: false, checklistls5PromptVisible: false, checklistls5PromptData: {}, /** 有 Checklistls_5 提示且提交已成功时,等用户关掉提示后再 emit/reset */ pendingSubmitPayload: null, sjid: "", paperInfo: null, paperQuestionList: [], step2AnswerMap: {}, step2ChoiceMap: {}, step2: { riskLevel: "适时关注", dimension: "", remarks: "", previousWork: "", crisisForm: "否" } } }, computed: { displayStudentNo: function () { if (this.studentNo) { return this.studentNo } var q = this.$route && this.$route.query return (q && q.studentNo) || "2025003" }, displayStudentName: function () { if (this.studentName && String(this.studentName).trim()) { return String(this.studentName).trim() } var q = this.$route && this.$route.query return (q && (q.studentName || q.name) && String(q.studentName || q.name).trim()) || "" }, sections: function () { return this.buildSectionsFromPaperList() }, suggestedRiskLevel: function () { return this.computeSuggestedRiskLevel() }, riskLevelSuggestClass: function () { var m = { 无需刻意关注: "obsReport-suggestTag--none", 适时关注: "obsReport-suggestTag--timely", 重点关注: "obsReport-suggestTag--key", 危机预警: "obsReport-suggestTag--crisis" } return m[this.suggestedRiskLevel] || "" }, /** 与 Checklistls_5 提交一致:危机预警 / 重点关注 → 是,否则 → 否 */ riskInterviewTableSuggestText: function () { var r = this.suggestedRiskLevel || "" return r === "危机预警" || r === "重点关注" ? "是" : "否" }, riskInterviewTableSuggestClass: function () { return this.riskInterviewTableSuggestText === "是" ? "obsReport-suggestTag--crisis" : "obsReport-suggestTag--none" }, /** Checklistls_5 由系统根据观察结果自动带出,不在下方表单重复展示 */ step2QuestionsForForm: function () { return this.step2Questions.filter(function (q) { if (!q) { return false } var code = String(q.tmbm || q.questioncode || q.questionCode || "").trim() return code.toLowerCase() !== "checklistls_5" }) }, /** 第二步展示:已勾选观察项的完整文案(含频次),不再用「A类选择N项」汇总 */ step1SelectedDetails: function () { var self = this var rows = [] this.sections.forEach(function (sec) { sec.items.forEach(function (it) { var k = self.itemKey(sec.id, it.id) var sel = self.selection[k] if (!sel || !sel.checked) { return } var freq = "" if (sec.showFrequency && sel.frequency) { freq = self.formatObservationFrequencyDisplay(String(sel.frequency).trim()) } var desc = (it.text != null ? String(it.text) : "").trim() rows.push({ id: k, sectionTitle: sec.title || ((sec.category || sec.id) + "类观察项"), text: desc || "(无描述)", frequency: freq }) }) }) return rows }, step2Questions: function () { var list = Array.isArray(this.paperQuestionList) ? this.paperQuestionList : [] return list.filter(function (q) { if (!q) { return false } if (q.showflag === 0 || q.showflag === "0") { return false } var level = (q.questionlevel !== undefined && q.questionlevel !== null) ? String(q.questionlevel) : "1" return level === "2" }) } }, created: function () { this.User = localStorage.getItem("user") ? JSON.parse(localStorage.getItem("user")) : {} this.answererInfo = localStorage.getItem("answererInfo") ? JSON.parse(localStorage.getItem("answererInfo")) : {} this.startTime = new Date().getTime() this.resetForm() this.prefetchXwjcCx() }, methods: { prefetchXwjcCx: function () { var that = this $.post("/www/public/cpgl/xwjc_cx", {}).then(function (res) { that.sjid = (res && res.data && res.data.id) ? res.data.id : "" if (that.sjid) { that.fetchPaperInfo() } }).fail(function (err) { console.warn("prefetch /xwjc_cx failed", err) }) }, fetchPaperInfo: function () { var that = this if (!that.sjid) { return } if (typeof axios === "undefined") { console.warn("fetch /st/gettmlist skipped: axios is undefined") return } axios({ method: "get", url: "/www/public/st/gettmlist", params: { sjid: that.sjid }, responseType: "blob" }).then(function (response) { if (!response || !response.data) { that.paperInfo = null that.paperQuestionList = [] return } var reader = new FileReader() reader.onload = function () { try { var compressedData = new Uint8Array(reader.result) var unzipped = pako.ungzip(compressedData, { to: "string" }) var list = JSON.parse(unzipped || "[]"); that.paperQuestionList = Array.isArray(list) ? list : [] that.paperInfo = that.paperQuestionList.length ? that.paperQuestionList[0] : null console.log("[step2 questions]", that.paperQuestionList.filter(function (q) { if (!q) { return false } if (q.showflag === 0 || q.showflag === "0") { return false } var level = (q.questionlevel !== undefined && q.questionlevel !== null) ? String(q.questionlevel) : "1" return level === "2" })) that.syncSelectionWithSections() } catch (e) { console.warn("parse /st/gettmlist failed", e) that.paperInfo = null that.paperQuestionList = [] that.syncSelectionWithSections() } } reader.readAsArrayBuffer(response.data) }).catch(function (err) { console.warn("fetch /st/gettmlist failed", err) that.paperInfo = null that.paperQuestionList = [] that.syncSelectionWithSections() }) }, itemKey: function (secId, itemId) { return secId + "_" + itemId }, buildSectionsFromPaperList: function () { var list = Array.isArray(this.paperQuestionList) ? this.paperQuestionList : [] var visible = list.filter(function (q) { if (!q) { return false } if (q.showflag === 0 || q.showflag === "0") { return false } // 第一步只展示第一页分组(questionlevel=1) var level = (q.questionlevel !== undefined && q.questionlevel !== null) ? String(q.questionlevel) : "1" return level === "1" }) var self = this return visible.map(function (q, idx) { var cat = self.resolveCategoryFromQuestion(q, idx) var secId = self.getStep1SectionId(q, idx) var options = self.parseQuestionOptions(q) var seq = self.getAlphabetPrefix(idx) var rawTitle = self.stripHtml(q && q.questioncontent) || (cat + ". 观察项") return { id: secId, category: cat, title: seq + ". " + rawTitle, showFrequency: ["A", "B", "C", "D"].indexOf(cat) !== -1, items: options.map(function (opt, optIdx) { return { id: opt.answerBusiId || opt.id || opt.optionNo || ("opt_" + idx + "_" + optIdx), label: "", text: self.stripHtml(opt.optionName) || "" } }) } }) }, getStep1SectionId: function (q, idx) { if (q && (q.quesbusiid || q.id || q.tmbm)) { return String(q.quesbusiid || q.id || q.tmbm) } return "sec_" + idx }, parseQuestionOptions: function (q) { if (!q) { return [] } var options = q.mpanswerdtolist if (typeof options === "string") { try { options = JSON.parse(options) } catch (e) { options = [] } } return Array.isArray(options) ? options : [] }, resolveCategoryFromQuestion: function (q, idx) { var letters = ["A", "B", "C", "D", "E", "F"] var text = this.stripHtml(q && q.questioncontent).trim() var match = text.match(/^([A-Fa-f])[\.、\s]/) if (match && match[1]) { return match[1].toUpperCase() } return letters[idx] || ("Q" + (idx + 1)) }, getAlphabetPrefix: function (index) { var n = Number(index) + 1 var out = "" while (n > 0) { n -= 1 out = String.fromCharCode(65 + (n % 26)) + out n = Math.floor(n / 26) } return out || "A" }, stripHtml: function (text) { if (!text && text !== 0) { return "" } return String(text).replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim() }, /** 第二步汇总里展示观察频次时,附带与第一步选项一致的频次说明 */ formatObservationFrequencyDisplay: function (freq) { var f = freq == null ? "" : String(freq).trim() if (!f) { return "" } if (/([^)]*1-2\s*次[^)]*两周[^)]*)/.test(f)) { return f } if (/([^)]*3-5\s*次[^)]*两周[^)]*)/.test(f)) { return f } if (/([^)]*≥\s*5\s*次[^)]*)/.test(f) || /([^)]*≥5次[^)]*)/.test(f) || /几乎每日/.test(f)) { return f } if (f === "偶尔" || f === "1") { return "偶尔 (1-2次/两周)" } if (f === "经常" || f === "2") { return "经常(3-5次/两周)" } if (f === "持续" || f === "3") { return "持续(≥5次/两周或几乎每日)" } return f }, syncSelectionWithSections: function () { var nextSelection = {} var oldSelection = this.selection || {} var self = this this.sections.forEach(function (sec) { sec.items.forEach(function (it) { var k = self.itemKey(sec.id, it.id) var old = oldSelection[k] || {} nextSelection[k] = { checked: !!old.checked, frequency: old.frequency || "" } }) }) this.selection = nextSelection this.syncStep2AnswerMap() }, getStep2QuestionKey: function (q) { return (q && (q.id || q.quesbusiid || q.questionno)) ? String(q.id || q.quesbusiid || q.questionno) : "" }, getStep2DisplayTitle: function (q) { var txt = this.stripHtml(q && q.questioncontent) if (!txt) { return "" } return txt.replace(/%s/g, "").replace(/\s+/g, " ").trim() }, isStep2SingleChoice: function (q) { if (!q) { return false } return String(q.questiontype) === "2" && String(q.replytype) === "1" && this.parseQuestionOptions(q).length > 0 }, getQuestionTextParts: function (q) { var txt = this.stripHtml(q && q.questioncontent) if (!txt) { return [""] } return txt.split("%s") }, syncStep2AnswerMap: function () { var oldMap = this.step2AnswerMap || {} var oldChoiceMap = this.step2ChoiceMap || {} var nextMap = {} var nextChoiceMap = {} var self = this this.step2Questions.forEach(function (q) { var key = self.getStep2QuestionKey(q) if (!key) { return } var slotCount = Math.max(0, self.getQuestionTextParts(q).length - 1) var arr = Array.isArray(oldMap[key]) ? oldMap[key].slice(0, slotCount) : [] while (arr.length < slotCount) { arr.push("") } if (slotCount > 0) { nextMap[key] = arr } if (self.isStep2SingleChoice(q)) { nextChoiceMap[key] = oldChoiceMap[key] || "" } }) this.step2AnswerMap = nextMap this.step2ChoiceMap = nextChoiceMap }, resetForm: function () { this.step = 1 this.period = null this.selection = {} this.syncSelectionWithSections() this.step2AnswerMap = {} this.step2ChoiceMap = {} this.syncStep2AnswerMap() this.step2 = { riskLevel: "适时关注", dimension: "", remarks: "", previousWork: "", crisisForm: "否" } this.checklistls5PromptVisible = false this.pendingSubmitPayload = null }, buildStep1Counts: function () { var c = { A: 0, B: 0, C: 0, D: 0, E: 0, F: 0 } var hasPersistent = false var self = this this.sections.forEach(function (sec) { sec.items.forEach(function (it) { var k = self.itemKey(sec.id, it.id) var r = self.selection[k] if (r && r.checked) { var bucket = sec.category || sec.id if (c[bucket] === undefined) { c[bucket] = 0 } c[bucket] += 1 if (sec.showFrequency && r.frequency === "持续") { hasPersistent = true } } }) }) return { counts: c, hasPersistent: hasPersistent } }, computeSuggestedRiskLevel: function () { var x = this.buildStep1Counts() var c = x.counts var abcd = c.A + c.B + c.C + c.D if (c.E > 0) { return "危机预警" } if (c.D > 0 || x.hasPersistent) { return "重点关注" } if (abcd > 0) { return "适时关注" } if (c.F > 0 && abcd === 0 && c.E === 0) { return "无需刻意关注" } return "适时关注" }, onCheckChange: function (sec, key) { var row = this.selection[key] if (!row || !sec.showFrequency) { return } if (!row.checked) { row.frequency = "" } else if (!row.frequency) { row.frequency = "偶尔" } }, goBack: function () { this.$emit("back") }, goNext: function () { if (!this.period || !Array.isArray(this.period) || this.period.length !== 2) { if (this.$message) { this.$message.warning("请选择观察周期") } return } var hasOne = false var self = this this.sections.forEach(function (sec) { sec.items.forEach(function (it) { var k = self.itemKey(sec.id, it.id) if (self.selection[k] && self.selection[k].checked) { hasOne = true } }) }) if (!hasOne) { if (this.$message) { this.$message.warning("请至少勾选一项观察内容") } return } var ok = true this.sections.forEach(function (sec) { if (!sec.showFrequency) { return } sec.items.forEach(function (it) { var k = self.itemKey(sec.id, it.id) var r = self.selection[k] if (r && r.checked && !r.frequency) { ok = false } }) }) if (!ok) { if (this.$message) { this.$message.warning("请为已勾选的 A–D 类条目选择观察频次") } return } this.step2.riskLevel = this.computeSuggestedRiskLevel() if (this.buildStep1Counts().counts.E > 0) { this.step2.crisisForm = "是" } this.step = 2 var selfGo = this this.$nextTick(function () { selfGo.syncChecklistls5FromSuggestedRisk() }) this.scrollReportToTop() }, scrollReportToTop: function () { var self = this this.$nextTick(function () { var el = self.$refs.obsReportTop if (el && typeof el.scrollIntoView === "function") { el.scrollIntoView({ block: "start", behavior: "auto" }) } if (el && el.closest) { var scrollParent = el.closest(".trackStudents-page") if (scrollParent) { scrollParent.scrollTop = 0 } } if (typeof window !== "undefined" && window.scrollTo) { window.scrollTo(0, 0) } }) }, formatDateTimeYMDHMS: function (ts) { try { var d = new Date(ts) if (isNaN(d.getTime())) { return "" } var y = d.getFullYear() var m = (d.getMonth() + 1).toString().padStart(2, "0") var dd = d.getDate().toString().padStart(2, "0") var hh = d.getHours().toString().padStart(2, "0") var mm = d.getMinutes().toString().padStart(2, "0") var ss = d.getSeconds().toString().padStart(2, "0") return y + "-" + m + "-" + dd + " " + hh + ":" + mm + ":" + ss } catch (e) { return "" } }, calculateTimeDifference: function (startTime, endTime) { return endTime - startTime }, onChecklistls5PromptClose: function () { var p = this.pendingSubmitPayload this.pendingSubmitPayload = null if (p) { this.$emit("submit", p) this.resetForm() } }, /** Checklistls_5 仅作提示弹窗,不拦截提交 */ showChecklistls5PromptIfNeeded: function () { var that = this var list = Array.isArray(this.step2Questions) ? this.step2Questions : [] var targetQ = null for (var i = 0; i < list.length; i++) { var q = list[i] if (!q) continue var code = q.tmbm || q.questioncode || q.questionCode || q.quesbusiid || q.id || q.questionno || "" if (String(code) === "Checklistls_5") { targetQ = q break } } if (!targetQ) return if (!that.isStep2SingleChoice(targetQ)) return var key = that.getStep2QuestionKey(targetQ) var selectedId = (that.step2ChoiceMap && that.step2ChoiceMap[key]) ? that.step2ChoiceMap[key] : "" var opts = that.parseQuestionOptions(targetQ) var yesOpt = null var noOpt = null opts.forEach(function (opt) { if (!opt) return var name = that.stripHtml(opt.optionName || "") if (!name) return if (!yesOpt && name.indexOf("是") === 0) yesOpt = opt if (!noOpt && name.indexOf("否") === 0) noOpt = opt }) if (!yesOpt && opts.length) yesOpt = opts[0] if (!noOpt && opts.length > 1) noOpt = opts[1] var selectedOpt = null if (selectedId) { selectedOpt = opts.find(function (opt) { if (!opt) return false var oid = opt.answerBusiId || opt.optionId || opt.optionNo return String(oid) === String(selectedId) }) } // 暂时按你的要求先占位文案:后续你再填真实提示内容 var yesId = yesOpt ? (yesOpt.answerBusiId || yesOpt.optionId || yesOpt.optionNo || "") : "" var noId = noOpt ? (noOpt.answerBusiId || noOpt.optionId || noOpt.optionNo || "") : "" var selectedIsYes = selectedId && yesId && String(selectedId) === String(yesId) var selectedIsNo = selectedId && noId && String(selectedId) === String(noId) var yesText = "综合您本次的行为观察记录,建议贵校心理教师进一步开展访谈评估,以便为该生提供更好的支持。同时,建议班主任持续关注该生,为学生创造更为安全、积极的班级环境。" var noText = "综合您本次的行为观察记录,建议目前暂不需对该生开展进一步访谈评估。您可定期关注学生,并根据后续行为观察结果,开展后续工作。" var selectedText = selectedIsYes ? "是" : selectedIsNo ? "否" : "未选择" var hintText = selectedIsYes ? "综合您本次的行为观察记录,建议贵校心理教师进一步开展访谈评估,以便为该生提供更好的支持。同时,建议班主任持续关注该生,为学生创造更为安全、积极的班级环境。" : selectedIsNo ? "综合您本次的行为观察记录,建议目前暂不需对该生开展进一步访谈评估。您可定期关注学生,并根据后续行为观察结果,开展后续工作。" : "" that.checklistls5PromptData = { code: "Checklistls_5", selectedText: selectedText, yesText: yesText, noText: noText, hintText: hintText } that.checklistls5PromptVisible = true }, submitReport: function () { var that = this if (that.submitLoading) { return } that.syncChecklistls5FromSuggestedRisk() that.showChecklistls5PromptIfNeeded() var answerList = this.buildSubmitAnswerList() var toolId = (that.paperQuestionList[0] && that.paperQuestionList[0].toolid) ? that.paperQuestionList[0].toolid : "" var stid = (that.paperQuestionList[0] && that.paperQuestionList[0].sjid) ? that.paperQuestionList[0].sjid : that.sjid var openData = JSON.stringify({ toolId: toolId, openQuestionAnswerVOS: answerList, xb: that.answererInfo && that.answererInfo.xb }) console.log(openData,'openData') var encryptedAnswers = openData try { if (typeof Dengdu !== "undefined" && Dengdu.crypto && Dengdu.crypto.zip && typeof Dengdu.crypto.zip.encrypt === "function") { encryptedAnswers = Dengdu.crypto.zip.encrypt(openData) } } catch (e) {} var endTime = new Date().getTime() var params = { xm: that.answererInfo && that.answererInfo.xm, xxid: (that.answererInfo && (that.answererInfo.schoolid || that.answererInfo.xxid)) || "", xxmc: that.answererInfo && that.answererInfo.xxmc, zymc: that.answererInfo && that.answererInfo.zy, nj: that.answererInfo && that.answererInfo.nj, bjmc: that.answererInfo && that.answererInfo.bj, xd: that.answererInfo && (that.answererInfo.xd || that.answererInfo.xxjd), account: that.User && that.User.Username, email: that.User && that.User.Email, ujs: that.User && that.User.Roles && that.User.Roles[0], toolId: toolId, stid: stid, dtcnt: answerList.length, dttime: that.calculateTimeDifference(that.startTime, endTime), starttime: (that.serverTime && typeof that.serverTime === "string" && that.serverTime) || that.formatDateTimeYMDHMS(that.startTime), questionAnswers: encryptedAnswers } var payload = { studentNo: this.displayStudentNo, studentSource: this.studentSource, recorder: this.teacherName, period: this.period, answerList: answerList, fixedFields: { Checklistxs_1: this.displayStudentNo, Checklistxs_xsly: this.studentSource || "", Checklistxs_2: this.teacherName || "", Checklistxs_3: (this.period && this.period[0]) ? this.period[0] : "", Checklistxs_3_jssj: (this.period && this.period[1]) ? this.period[1] : "", Checklistls_1: (function () { var q1 = that.findPaperQuestionBySubmitCode("Checklistls_1") var label = that.getSubmitRiskLevelLabel() var opt = q1 ? that.findChecklistls1SelectedOption(q1, label) : null if (opt) { return { tmlx: 1, answerList: [{ optionNo: opt.optionNo, score: opt.score || "", answerText: that.stripHtml(opt.optionName || "") }] } } return that.mapRiskLevelLabelToCode(label) })(), Checklistls_2: this.buildChecklistls2DimensionString(), Checklistls_5: (function () { var needYes = that.suggestedRiskLevel === "危机预警" || that.suggestedRiskLevel === "重点关注" var opt5 = that.pickChecklistls5OptionByRisk(needYes) if (opt5) { return { tmlx: 1, answerList: [{ optionNo: opt5.optionNo, score: opt5.score || "", answerText: that.stripHtml(opt5.optionName || "") }] } } return needYes ? "是" : "否" })() }, selection: JSON.parse(JSON.stringify(this.selection)), sections: JSON.parse(JSON.stringify(this.sections)), step2Questions: JSON.parse(JSON.stringify(this.step2Questions)), step2AnswerMap: JSON.parse(JSON.stringify(this.step2AnswerMap)), step2ChoiceMap: JSON.parse(JSON.stringify(this.step2ChoiceMap)), step2: JSON.parse(JSON.stringify(this.step2)), suggestedRiskLevel: this.suggestedRiskLevel, teacherName: this.teacherName } that.submitLoading = true $.post("/www/public/st/saveda_xwjc", params, function (res) { that.submitLoading = false if (res && res.success == 1) { if (that.$message) { that.$message.success("提交成功") } if (that.checklistls5PromptVisible) { that.pendingSubmitPayload = payload } else { that.$emit("submit", payload) that.resetForm() } } else { that.pendingSubmitPayload = null if (that.$message) { that.$message.error("提交失败,请稍后再试!") } } }).fail(function () { that.submitLoading = false that.pendingSubmitPayload = null if (that.$message) { that.$message.error("网络连接错误,请检查本机网络!") } }) }, buildSubmitAnswerList: function () { var that = this var list = Array.isArray(this.paperQuestionList) ? this.paperQuestionList : [] var answers = [] var fixedMap = { Checklistxs_1: this.displayStudentNo || "", Checklistxs_xsly: this.studentSource || "", Checklistxs_2: this.teacherName || "", Checklistxs_3: (this.period && this.period[0]) ? this.period[0] : "", Checklistxs_3_jssj: (this.period && this.period[1]) ? this.period[1] : "" } list.forEach(function (q, idx) { if (!q) { return } var key = that.getStep2QuestionKey(q) var options = that.parseQuestionOptions(q) var isLevel2 = String(q.questionlevel) === "2" var parts = that.getQuestionTextParts(q) var base = { tmlx: 3, tmbm: q.tmbm || "", questionId: q.quesbusiid || q.id || "", questionno: Number(q.questionno || 0), inputContent: "", answerList: [] } // 隐藏题:风险等级 Checklistls_1 — 按单选题结构提交(tmlx=1 + answerList);无匹配选项时回退为数字码 var submitCode = that.getQuestionSubmitCode(q) if (/^checklistls_1$/i.test(submitCode)) { var riskLabel = that.getSubmitRiskLevelLabel() var selectedRiskOpt = that.findChecklistls1SelectedOption(q, riskLabel) if (selectedRiskOpt) { base.tmlx = 1 base.answerList = [{ optionNo: selectedRiskOpt.optionNo, score: selectedRiskOpt.score || "", answerText: that.stripHtml(selectedRiskOpt.optionName || "") }] } else { base.tmlx = 2 base.inputContent = that.mapRiskLevelLabelToCode(riskLabel) } answers.push(base) return } if (/^checklistls_2$/i.test(submitCode)) { base.tmlx = 2 base.inputContent = that.buildChecklistls2DimensionString() answers.push(base) return } // Checklistls_5:是否启动风险评估访谈表 — 按单选题提交(与系统建议「是/否」一致) if (/^checklistls_5$/i.test(submitCode)) { var needYes5 = that.suggestedRiskLevel === "危机预警" || that.suggestedRiskLevel === "重点关注" var pick5 = that.pickChecklistls5OptionByRisk(needYes5) if (pick5) { base.tmlx = 1 base.answerList = [{ optionNo: pick5.optionNo, score: pick5.score || "", answerText: that.stripHtml(pick5.optionName || "") }] } else { base.tmlx = 2 base.inputContent = needYes5 ? "是" : "否" } answers.push(base) return } // 隐藏字段/固定字段也按标准题目格式提交 if (Object.prototype.hasOwnProperty.call(fixedMap, base.tmbm)) { base.tmlx = 2 base.inputContent = fixedMap[base.tmbm] answers.push(base) return } // 第二步单选题:tmlx=1 if (isLevel2 && that.isStep2SingleChoice(q)) { base.tmlx = 1 var selectedId = that.step2ChoiceMap[key] || "" var selectedOpt = options.find(function (opt) { var oid = opt.answerBusiId || opt.optionId || opt.optionNo return String(oid) === String(selectedId) }) if (selectedOpt) { base.answerList = [{ optionNo: selectedOpt.optionNo, score: selectedOpt.score || "", answerText: that.stripHtml(selectedOpt.optionName || "") }] } answers.push(base) return } // 填空题:tmlx=2 if (parts.length > 1) { base.tmlx = 2 var fillArr = Array.isArray(that.step2AnswerMap[key]) ? that.step2AnswerMap[key] : [] base.inputContent = fillArr.join("####") answers.push(base) return } // 第一步多选题:tmlx=3,按选项位输出对象或"false" base.tmlx = 3 var secId = that.getStep1SectionId(q, idx) options.forEach(function (opt) { var itemId = opt.answerBusiId || opt.id || opt.optionNo || "" var sKey = that.itemKey(secId, itemId) var row = that.selection[sKey] if (row && row.checked) { var suffix = "" if (row.frequency === "偶尔") { suffix = "-1" } else if (row.frequency === "经常") { suffix = "-2" } else if (row.frequency === "持续") { suffix = "-3" } var optionText = that.stripHtml(opt.optionName || "") base.answerList.push({ answerText: optionText + suffix, optionNo: opt.optionNo, score: opt.score || "" }) } else { base.answerList.push("false") } }) answers.push(base) }) return answers }, /** 问卷题目编码(用于匹配 Checklistls_1 / Checklistls_2 等) */ getQuestionSubmitCode: function (q) { if (!q) { return "" } return String(q.tmbm || q.questioncode || q.questionCode || "").trim() }, /** 在整卷题目中按编码查找一题(如隐藏题 Checklistls_1) */ findPaperQuestionBySubmitCode: function (code) { var want = code != null ? String(code).trim() : "" if (!want) { return null } var list = Array.isArray(this.paperQuestionList) ? this.paperQuestionList : [] for (var i = 0; i < list.length; i++) { var q = list[i] if (!q) { continue } if (String(this.getQuestionSubmitCode(q)).toLowerCase() === want.toLowerCase()) { return q } } return null }, /** * 根据当前风险等级文案,在 Checklistls_1 题目的选项里匹配一项(与 mapRiskLevelLabelToCode 规则一致)。 */ findChecklistls1SelectedOption: function (q, label) { var opts = this.parseQuestionOptions(q) if (!opts.length) { return null } var code = this.mapRiskLevelLabelToCode(label) var self = this for (var i = 0; i < opts.length; i++) { var opt = opts[i] var name = self.stripHtml(opt.optionName || "") if (self.mapRiskLevelLabelToCode(name) === code) { return opt } } return null }, /** * Checklistls_5:在题目选项中匹配「是」「否」(与 showChecklistls5PromptIfNeeded 规则一致)。 * @param {boolean} wantYes 危机预警 / 重点关注 时为 true → 选「是」 */ pickChecklistls5OptionByRisk: function (wantYes) { var q = this.findPaperQuestionBySubmitCode("Checklistls_5") if (!q || !this.isStep2SingleChoice(q)) { return null } var opts = this.parseQuestionOptions(q) var yesOpt = null var noOpt = null var self = this opts.forEach(function (opt) { if (!opt) { return } var name = self.stripHtml(opt.optionName || "") if (!name) { return } if (!yesOpt && name.indexOf("是") === 0) { yesOpt = opt } if (!noOpt && name.indexOf("否") === 0) { noOpt = opt } }) if (!yesOpt && opts.length) { yesOpt = opts[0] } if (!noOpt && opts.length > 1) { noOpt = opts[1] } return wantYes ? yesOpt || null : noOpt || null }, /** 将 Checklistls_5 与 step2ChoiceMap 同步,便于提交前提示弹窗读取当前选择 */ syncChecklistls5FromSuggestedRisk: function () { var q = this.findPaperQuestionBySubmitCode("Checklistls_5") if (!q || !this.isStep2SingleChoice(q)) { return } var needYes = this.suggestedRiskLevel === "危机预警" || this.suggestedRiskLevel === "重点关注" var pick = this.pickChecklistls5OptionByRisk(needYes) if (!pick) { return } var key = this.getStep2QuestionKey(q) var oid = pick.answerBusiId || pick.optionId || pick.optionNo this.$set(this.step2ChoiceMap, key, oid) }, /** * 风险等级终值:优先从第二步可见单选题(题干含「关注等级」「观察关注」「风险等级」)解析; * 否则用 step2.riskLevel(进入第二步时由系统建议写入),再否则用 suggestedRiskLevel。 */ getSubmitRiskLevelLabel: function () { var fromVisible = this.readRiskLevelFromVisibleSingleChoice() if (fromVisible) { return fromVisible } var s = this.step2 && this.step2.riskLevel if (s && String(s).trim()) { return String(s).trim() } return this.suggestedRiskLevel || "适时关注" }, readRiskLevelFromVisibleSingleChoice: function () { var self = this var levels = ["无需刻意关注", "适时关注", "重点关注", "危机预警"] var list = Array.isArray(this.step2Questions) ? this.step2Questions : [] for (var i = 0; i < list.length; i++) { var q = list[i] if (!q || !self.isStep2SingleChoice(q)) { continue } var title = self.stripHtml(q.questioncontent || "") if (title.indexOf("关注等级") === -1 && title.indexOf("观察关注") === -1 && title.indexOf("风险等级") === -1) { continue } var key = self.getStep2QuestionKey(q) var selectedId = self.step2ChoiceMap[key] if (!selectedId) { continue } var opts = self.parseQuestionOptions(q) for (var j = 0; j < opts.length; j++) { var opt = opts[j] var oid = opt.answerBusiId || opt.optionId || opt.optionNo if (String(oid) !== String(selectedId)) { continue } var name = self.stripHtml(opt.optionName || "") for (var li = 0; li < levels.length; li++) { if (name.indexOf(levels[li]) !== -1) { return levels[li] } } return name } } return "" }, /** 1 无需特别关注 2 适时关注 3 重点关注 4 危机预警(与「无需刻意关注」同义) */ mapRiskLevelLabelToCode: function (label) { var t = label != null ? String(label).trim() : "" if (!t) { return "2" } if (t.indexOf("危机预警") !== -1) { return "4" } if (t.indexOf("重点关注") !== -1) { return "3" } if (t.indexOf("适时关注") !== -1) { return "2" } if (t.indexOf("无需刻意关注") !== -1 || t.indexOf("无需特别关注") !== -1) { return "1" } var m = { 无需刻意关注: "1", 无需特别关注: "1", 适时关注: "2", 重点关注: "3", 危机预警: "4" } if (m[t]) { return m[t] } return "2" }, /** * Checklistls_2:只提交大题题干(sec.title 去 HTML),不含选项说明、不含「A类:」等前缀(避免与题干内已有分类文字重复)。 * 该类下至少勾选一项时收录该题干;多条用中文分号分隔;题干(归一化空白后)相同则去重。 */ buildChecklistls2DimensionString: function () { var self = this var parts = [] var seenStem = {} this.sections.forEach(function (sec) { var hasAny = false sec.items.forEach(function (it) { var k = self.itemKey(sec.id, it.id) if (self.selection[k] && self.selection[k].checked) { hasAny = true } }) if (!hasAny) { return } var stem = self.stripHtml(sec.title || "") if (!stem) { return } var stemKey = stem.replace(/\s+/g, " ").trim() if (seenStem[stemKey]) { return } seenStem[stemKey] = true parts.push(stem) }) return parts.length ? parts.join(";") : "" } } }) }) })(template, resolve, reject); }); RegVueCom("xljk-behavioralObservation-view", function(resolve, reject){ var template = ""; return (function(template, resolve, reject) { seajs.use([], function () { return resolve({ template: template, name: "TrackStudentsBehavior", data: function () { return { teacherName: "", listLoading: false, studentListPage: 1, studentPageSize: 12, studentListTotal: 0, /** 观察学生列表筛选(/ckallstudent) */ studentListQuery: { name: "", xh: "", grade: "", bjmc: "" }, addSubmitting: false, pageMode: "list", detailStudent: null, detailTab: "behavior", behaviorFilterRange: null, behaviorRecordsLoading: false, students: [], assessmentDialogVisible: false, behaviorQuestionnaireVisible: false, behaviorQuestionnaireRec: null, addDialogVisible: false, addStudentClassLoading: false, addStudentClassLabel: "", currentStudent: null, addForm: { name: "", studentNo: "", grade: "", className: "", gender: "男", // source: "2" }, sourceTextMap: { "1": "测评初筛", "2": "教师添加" }, levelTextMap: { "1": "无需特别关注", "2": "适时关注", "3": "重点关注", "4": "危机预警" }, gradeOptionsRaw: [], classOptionsRaw: [], addRules: { name: [{ required: true, message: "请输入学生姓名", trigger: "blur" }], studentNo: [{ required: true, message: "请输入学号", trigger: "blur" }], grade: [{ required: true, message: "请选择或输入年级", trigger: ["blur", "change"] }], className: [{ required: true, message: "请选择或输入班级", trigger: ["blur", "change"] }], gender: [{ required: true, message: "请选择性别", trigger: "change" }] } } }, computed: { cardTitle: function () { var q = this.$route && this.$route.query return (q && q.name) || "初筛学生行为追踪系统" }, addStudentClassDisplay: function () { if (this.addStudentClassLoading) { return "加载中…" } if (this.addStudentClassLabel) { return this.addStudentClassLabel } return "当前班级" }, detailBehaviorRecords: function () { if (!this.detailStudent || !this.detailStudent.behaviorRecords) { return [] } var list = [].concat(this.detailStudent.behaviorRecords) return list.sort(function (a, b) { var sa = String(a.createtime != null ? a.createtime : "").trim() var sb = String(b.createtime != null ? b.createtime : "").trim() if (sa && sb) { return sb.localeCompare(sa) } var da = String(a.dateEnd || a.dateStart || "") var db = String(b.dateEnd || b.dateStart || "") return db.localeCompare(da) }) }, detailAssessmentRecords: function () { if (!this.detailStudent || !this.detailStudent.assessmentRecords) { return [] } return [].concat(this.detailStudent.assessmentRecords).sort(function (a, b) { return String(b.date).localeCompare(String(a.date)) }) }, questionnaireDetailSections: function () { var rec = this.behaviorQuestionnaireRec if (!rec) { return [] } var raw = rec.questionnaireCategories && rec.questionnaireCategories.length ? rec.questionnaireCategories : [] var self = this return raw.map(function (sec) { return { title: sec.title, items: (sec.items || []).map(function (line) { return self.enrichBehaviorFrequencyText(line != null ? String(line) : "") }) } }) }, addGradeOptions: function () { var map = {} return (this.gradeOptionsRaw || []).filter(function (v) { if (!v || map[v]) { return false } map[v] = true return true }) }, addClassOptions: function () { var map = {} return (this.classOptionsRaw || []).filter(function (v) { if (!v || map[v]) { return false } map[v] = true return true }) } }, created: function () { var u = this.getLoginUser() if (u && (u.Nickname || u.Username)) { this.teacherName = u.Nickname || u.Username } this.loadStudentList() this.fetchGradeOptions() }, methods: { getLoginUser: function () { var u = this.user if (u && (u.ID != null || u.id != null)) { return u } try { var raw = localStorage.getItem("user") if (raw) { return JSON.parse(raw) } } catch (e) {} return {} }, extractCkbdStudentList: function (res) { if (!res) { return [] } if (Array.isArray(res)) { return res } if (Array.isArray(res.data)) { return res.data } if (Array.isArray(res.list)) { return res.list } if (res.data && Array.isArray(res.data.list)) { return res.data.list } if (res.data && Array.isArray(res.data.rows)) { return res.data.rows } if (res.data && Array.isArray(res.data.records)) { return res.data.records } if (res.data && Array.isArray(res.data.data)) { return res.data.data } if (Array.isArray(res.rows)) { return res.rows } if (Array.isArray(res.records)) { return res.records } return [] }, parseStudentListTotal: function (res, raw) { var rawLen = Array.isArray(raw) ? raw.length : 0 var pickNum = function (v) { if (v == null || v === "") { return null } var n = Number(v) if (!isFinite(n) || n < 0) { return null } return Math.floor(n) } var tryFields = function (obj, keys) { if (!obj || typeof obj !== "object") { return null } for (var i = 0; i < keys.length; i++) { var n = pickNum(obj[keys[i]]) if (n != null) { return n } } return null } var totalKeys = ["total", "totalCount", "count", "recordsTotal", "recordTotal"] var data = res && res.data && typeof res.data === "object" && !Array.isArray(res.data) ? res.data : null /** ckallstudent:list/total/pageNo 在 data 内,根级 total 常为 0,须优先读 data */ if (data && Array.isArray(data.list)) { var fromPaged = tryFields(data, totalKeys) if (fromPaged != null) { return fromPaged } } if (data) { var fromData = tryFields(data, totalKeys) if (fromData != null) { return fromData } if (data.page && typeof data.page === "object") { var fromDataPage = tryFields(data.page, totalKeys) if (fromDataPage != null) { return fromDataPage } } } if (res && res.page && typeof res.page === "object") { var fromPage = tryFields(res.page, totalKeys) if (fromPage != null) { return fromPage } } var fromRoot = tryFields(res, totalKeys) if (fromRoot != null) { return fromRoot } return rawLen }, syncStudentListPageFromResponse: function (res) { var data = res && res.data && typeof res.data === "object" && !Array.isArray(res.data) ? res.data : null if (!data) { return } var pageNo = Number(data.pageNo) if (isFinite(pageNo) && pageNo >= 1) { this.studentListPage = Math.floor(pageNo) } }, mapCkbdRowToStudent: function (row, index) { var r = row || {} var id = r.id != null ? r.id : (r.studentid != null ? r.studentid : (r.studentId != null ? r.studentId : ("idx-" + index))) var xh = r.xh != null ? r.xh : (r.studentNo != null ? r.studentNo : (r.xuehao != null ? r.xuehao : "")) return { id: id, studentNo: String(xh != null ? xh : ""), name:r.name, gender: r.gender != null ? r.gender : (r.xb != null ? r.xb : ""), grade: r.nj != null ? r.nj : (r.grade != null ? r.grade : (r.njmc != null ? r.njmc : "")), className: r.bjmc != null ? r.bjmc : (r.className != null ? r.className : (r.bj != null ? r.bj : "")), source: this.normalizeSourceText(r.source != null ? r.source : (r.xsly != null ? r.xsly : "")), level: this.normalizeLevelText(r.level), recordCount: r.recordcount != null ? Number(r.recordcount) : (r.recordCount != null ? Number(r.recordCount) : (r.jls != null ? Number(r.jls) : 0)), createtime: r.createtime != null ? r.createtime : (r.createTime != null ? r.createTime : (r.updateTime != null ? r.updateTime : "")), lastgctime: r.lastgctime != null ? r.lastgctime : (r.lastGctime != null ? r.lastGctime : ""), behaviorRecords: Array.isArray(r.behaviorRecords) ? r.behaviorRecords : [], assessmentRecords: Array.isArray(r.assessmentRecords) ? r.assessmentRecords : [] } }, formatGradeClass: function (grade, className) { var g = grade == null ? "" : String(grade).trim() var c = className == null ? "" : String(className).trim() return (g + " " + c).trim() }, getTeacherIdForBjNj: function () { var user = this.getLoginUser() if (!user) { return "" } if (user.ID != null && user.ID !== "") { return String(user.ID) } if (user.id != null && user.id !== "") { return String(user.id) } if (user.UserFilter && user.UserFilter.uid != null && user.UserFilter.uid !== "") { return String(user.UserFilter.uid) } return "" }, parseTeacherBjNjLabels: function (res) { var self = this var labels = [] var seen = {} var pushLabel = function (nj, bj) { var text = self.formatGradeClass(nj, bj) if (!text || seen[text]) { return } seen[text] = 1 labels.push(text) } var data = res && res.data if (data && typeof data === "object" && !Array.isArray(data)) { if ( data.grade != null || data.bjmc != null || data.nj != null || data.njmc != null || data.className != null ) { pushLabel( data.grade || data.nj || data.njmc || "", data.bjmc || data.className || data.bj || "" ) return labels } Object.keys(data).forEach(function (nj) { var val = data[nj] if (Array.isArray(val)) { val.forEach(function (item) { if (typeof item === "string") { pushLabel(nj, item) return } pushLabel( nj, item && (item.bjmc || item.className || item.name || item.label || item.value) ) }) return } if (val && typeof val === "object") { Object.keys(val).forEach(function (bjKey) { pushLabel(nj, bjKey) }) } }) return labels } var raw = [] if (Array.isArray(data)) { raw = data } else if (data && Array.isArray(data.list)) { raw = data.list } else if (data && Array.isArray(data.rows)) { raw = data.rows } else if (Array.isArray(res.rows)) { raw = res.rows } raw.forEach(function (item) { if (!item) { return } if (typeof item === "string") { pushLabel("", item) return } var nj = item.nj || item.grade || item.njmc || item.name || item.label || item.value || "" var children = Array.isArray(item.children) ? item.children : [] if (children.length) { children.forEach(function (child) { if (typeof child === "string") { pushLabel(nj, child) return } pushLabel( nj, child && (child.bjmc || child.className || child.name || child.label || child.value) ) }) return } pushLabel(nj, item.bjmc || item.className || item.name) }) return labels }, fetchTeacherBjNjForAddStudent: function () { var self = this self.addStudentClassLoading = true self.addStudentClassLabel = "" var params = {} var teacherid = self.getTeacherIdForBjNj() if (teacherid) { params.teacherid = teacherid } $.get("/www/xwgcft/xwgc/ckteacherbjnj", params, function (res) { self.addStudentClassLoading = false var ok = res && (res.error === 0 || res.success === 1 || res.code === 0 || res.code === "0" || res.code === 200) if (!ok) { self.addStudentClassLabel = "" return } var labels = self.parseTeacherBjNjLabels(res) self.addStudentClassLabel = labels.length ? labels.join("、") : "暂无任教班级" }).fail(function () { self.addStudentClassLoading = false self.addStudentClassLabel = "" }) }, loadStudentList: function () { var self = this this.listLoading = true var q = this.studentListQuery || {} var query = { name: q.name != null ? String(q.name).trim() : "", xh: q.xh != null ? String(q.xh).trim() : "", grade: q.grade != null ? String(q.grade).trim() : "", bjmc: q.bjmc != null ? String(q.bjmc).trim() : "", pageNo: this.studentListPage, pageSize: this.studentPageSize } $.get("/www/xwgcft/xwgc/ckallstudent", query, function (res) { self.listLoading = false var ok = res && (res.success === 1 || res.error === 0 || res.code === 0 || res.code === "0" || res.code === 200) if (!ok) { self.students = [] self.studentListTotal = 0 if (self.$message) { self.$message.error((res && (res.message || res.msg)) || "加载学生列表失败") } return } var raw = self.extractCkbdStudentList(res) self.studentListTotal = self.parseStudentListTotal(res, raw) self.syncStudentListPageFromResponse(res) self.students = raw.map(function (row, i) { return self.mapCkbdRowToStudent(row, i) }) }).fail(function () { self.listLoading = false self.students = [] self.studentListTotal = 0 if (self.$message) { self.$message.error("加载学生列表请求失败") } }) }, onStudentListPageChange: function (p) { this.studentListPage = p || 1 this.loadStudentList() }, onStudentListPageSizeChange: function (s) { this.studentPageSize = s this.studentListPage = 1 this.loadStudentList() }, onStudentListFilterSearch: function () { this.studentListPage = 1 this.loadStudentList() }, resetStudentListFilter: function () { this.studentListQuery = { name: "", xh: "", grade: "", bjmc: "" } this.studentListPage = 1 this.loadStudentList() }, onListFilterGradeSelect: function (item) { var grade = item && item.value ? String(item.value) : "" this.studentListQuery.grade = grade this.studentListQuery.bjmc = "" if (!grade) { this.classOptionsRaw = [] return } this.fetchClassOptionsByGrade(grade) }, onListFilterGradeChange: function (val) { var grade = (val || "").trim() if (!grade) { this.classOptionsRaw = [] this.studentListQuery.bjmc = "" return } if (!this.classOptionsRaw.length) { this.fetchClassOptionsByGrade(grade) } }, queryListClassSuggestions: function (queryString, cb) { var grade = (this.studentListQuery.grade || "").trim() if (grade && !this.classOptionsRaw.length) { this.fetchClassOptionsByGrade(grade) } var list = this.addClassOptions || [] var q = (queryString || "").trim() if (q) { list = list.filter(function (item) { return String(item).indexOf(q) > -1 }) } cb(list.map(function (item) { return { value: item } })) }, fetchGradeOptions: function () { var self = this $.get("/www/xwgcft/xwgc/ckStudentnj", {}, function (res) { var ok = res && (res.success === 1 || res.error === 0 || res.code === 0 || res.code === "0") if (!ok) { self.gradeOptionsRaw = [] return } var list = [] if (Array.isArray(res.data)) { list = res.data } else if (res.data && Array.isArray(res.data.list)) { list = res.data.list } else if (Array.isArray(res.rows)) { list = res.rows } self.gradeOptionsRaw = list.map(function (item) { if (typeof item === "string") return item return item.grade || item.njmc || item.name || "" }).filter(function (v) { return !!v }) }).fail(function () { self.gradeOptionsRaw = [] }) }, fetchClassOptionsByGrade: function (grade) { var self = this var params = {} if (grade) { params.grade = grade } $.get("/www/xwgcft/xwgc/ckStudentbj", params, function (res) { var ok = res && (res.success === 1 || res.error === 0 || res.code === 0 || res.code === "0") if (!ok) { self.classOptionsRaw = [] return } var list = [] if (Array.isArray(res.data)) { list = res.data } else if (res.data && Array.isArray(res.data.list)) { list = res.data.list } else if (Array.isArray(res.rows)) { list = res.rows } self.classOptionsRaw = list.map(function (item) { if (typeof item === "string") return item return item.bjmc || item.className || item.name || "" }).filter(function (v) { return !!v }) }).fail(function () { self.classOptionsRaw = [] }) }, queryGradeSuggestions: function (queryString, cb) { var list = this.addGradeOptions || [] var q = (queryString || "").trim() if (q) { list = list.filter(function (item) { return String(item).indexOf(q) > -1 }) } cb(list.map(function (item) { return { value: item } })) }, queryClassSuggestions: function (queryString, cb) { var self = this var grade = (this.addForm.grade || "").trim() if (grade && !this.classOptionsRaw.length) { this.fetchClassOptionsByGrade(grade) } var list = this.addClassOptions || [] var q = (queryString || "").trim() if (q) { list = list.filter(function (item) { return String(item).indexOf(q) > -1 }) } cb(list.map(function (item) { return { value: item } })) }, onGradeSelected: function (item) { var grade = item && item.value ? String(item.value) : "" this.addForm.grade = grade this.addForm.className = "" var ref = this.$refs.addFormRef if (ref && ref.clearValidate) { ref.clearValidate("grade") ref.clearValidate("className") } if (ref && ref.validateField) { this.$nextTick(function () { ref.validateField("grade") }) } if (!grade) { this.classOptionsRaw = [] return } this.fetchClassOptionsByGrade(grade) }, onGradeInputChanged: function (val) { var grade = (val || "").trim() if (!grade) { this.classOptionsRaw = [] this.addForm.className = "" } else if (!this.classOptionsRaw.length) { this.fetchClassOptionsByGrade(grade) } var ref = this.$refs.addFormRef if (!ref) return if (!grade) { ref.clearValidate && ref.clearValidate("grade") ref.clearValidate && ref.clearValidate("className") return } ref.validateField && ref.validateField("grade") }, onClassSelected: function () { var ref = this.$refs.addFormRef if (ref && ref.clearValidate) { ref.clearValidate("className") } if (ref && ref.validateField) { this.$nextTick(function () { ref.validateField("className") }) } }, onClassInputChanged: function (val) { var ref = this.$refs.addFormRef if (!ref) return var cls = (val || "").trim() if (!cls) { ref.clearValidate && ref.clearValidate("className") return } ref.validateField && ref.validateField("className") }, levelTagClass: function (level) { var lv = this.normalizeLevelText(level) if (lv === "危机预警") { return "trackStudents-tag--crisis" } if (lv === "重点关注") { return "trackStudents-tag--key" } if (lv === "无需特别关注") { return "trackStudents-tag--neutral" } return "trackStudents-tag--timely" }, normalizeSourceText: function (source) { var v = source != null ? String(source) : "" return this.sourceTextMap[v] || v }, normalizeLevelText: function (level) { var v = level != null ? String(level) : "" return this.levelTextMap[v] || v }, /** 接口 priordailymgmtwork(及兼容字段),含 observationPayload 嵌套 */ pickPriorDailyMgmtWorkFromApi: function (row) { if (!row || typeof row !== "object") return "" var n = row.observationPayload var v = row.priordailymgmtwork || row.priorDailyMgmtWork || row.PriorDailyMgmtWork || row.Checklistls_4 || row.rcgzgz || row.bzrgz || (n && (n.priordailymgmtwork || n.priorDailyMgmtWork || n.Checklistls_4 || n.rcgzgz || n.bzrgz)) || "" if (v == null) return "" return String(v).trim() }, toDateOnly: function (v) { if (v == null || v === "") return "" var s = String(v).trim() if (!s) return "" return s.split(" ")[0].split("T")[0] }, /** * 观察频次:与 xljk-addObservation 一致,补全「(1-2次/两周)」等说明;展示前统一带「观察频次:」前缀(兼容已带前缀的文案)。 * 兼容纯汉字、数字码、-1/-2/-3 后缀、旧版「(偶尔)」无频次说明。 */ enrichBehaviorFrequencyText: function (text) { var s = text == null ? "" : String(text).trim() if (!s || s === "-") return s if (s.indexOf("观察频次:") !== -1) { if (/([^)]*1-2\s*次[^)]*两周[^)]*)/.test(s)) return s if (/([^)]*3-5\s*次[^)]*两周[^)]*)/.test(s)) return s if (/([^)]*≥\s*5\s*次[^)]*)/.test(s) || /([^)]*≥5次[^)]*)/.test(s) || /几乎每日/.test(s)) return s } s = s .replace(/(偶尔)\s*$/g, "观察频次:偶尔(1-2次/两周)") .replace(/(经常)\s*$/g, "观察频次:经常(3-5次/两周)") .replace(/(持续)\s*$/g, "观察频次:持续(≥5次/两周或几乎每日)") s = s .replace(/-1\s*$/g, "观察频次:偶尔(1-2次/两周)") .replace(/-2\s*$/g, "观察频次:经常(3-5次/两周)") .replace(/-3\s*$/g, "观察频次:持续(≥5次/两周或几乎每日)") if (s === "偶尔" || s === "1") return "观察频次:偶尔(1-2次/两周)" if (s === "经常" || s === "2") return "观察频次:经常(3-5次/两周)" if (s === "持续" || s === "3") return "观察频次:持续(≥5次/两周或几乎每日)" if (s.indexOf("观察频次:") === -1) { if (/偶尔(1-2次\/两周)$/.test(s)) s = s.replace(/(偶尔(1-2次\/两周))$/, "观察频次:$1") else if (/经常(3-5次\/两周)$/.test(s)) s = s.replace(/(经常(3-5次\/两周))$/, "观察频次:$1") else if (/持续(≥5次\/两周或几乎每日)$/.test(s)) s = s.replace(/(持续(≥5次\/两周或几乎每日))$/, "观察频次:$1") } return s }, openAssessment: function (student) { this.currentStudent = student this.assessmentDialogVisible = true }, viewDetail: function (student) { if (!student) { return } if (!student.behaviorRecords) { student.behaviorRecords = [] } if (!student.assessmentRecords) { student.assessmentRecords = [] } this.detailStudent = student this.detailTab = "behavior" this.behaviorFilterRange = null this.pageMode = "detail" this.loadBehaviorRecordList(student) }, /** 从学生列表直接进入新增观察,不经过详情页 */ startObservationFromList: function (student) { if (!student) { return } if (!student.behaviorRecords) { student.behaviorRecords = [] } if (!student.assessmentRecords) { student.assessmentRecords = [] } this.detailStudent = student this.detailTab = "behavior" this.behaviorFilterRange = null this.pageMode = "addObservation" }, onBehaviorFilterRangeChange: function () { if (!this.detailStudent || this.pageMode !== "detail" || this.detailTab !== "behavior") { return } this.loadBehaviorRecordList(this.detailStudent) }, loadBehaviorRecordList: function (student) { var self = this var s = student || this.detailStudent if (!s) { return } var stuid = s.id != null ? s.id : (s.studentid != null ? s.studentid : s.studentNo) if (stuid == null || stuid === "") { if (self.$message) { self.$message.warning("未获取到学生ID,无法加载行为记录") } return } var range = this.behaviorFilterRange var params = { stuid: stuid, starttime: (range && Array.isArray(range) && range[0]) ? range[0] : "", endtime: (range && Array.isArray(range) && range[1]) ? range[1] : "" } this.behaviorRecordsLoading = true $.get("/www/xwgcft/xwgc/ckxwgcjl", params, function (res) { if (res && (res.success === 0 || res.error === 1)) { if (self.$message) { self.$message.error((res.message || res.msg) || "加载行为记录失败") } s.behaviorRecords = [] return } var rows = [] if (Array.isArray(res)) { rows = res } else if (Array.isArray(res.data)) { rows = res.data } else if (res.data && Array.isArray(res.data.list)) { rows = res.data.list } else if (Array.isArray(res.rows)) { rows = res.rows } else if (Array.isArray(res.list)) { rows = res.list } s.behaviorRecords = rows.map(function (r, idx) { var start = self.toDateOnly(r.starttime || r.dateStart || r.ksrq || r.startTime || "") var end = self.toDateOnly(r.endtime || r.dateEnd || r.jsrq || r.endTime || "") var ct = r.createtime != null ? r.createtime : (r.createTime != null ? r.createTime : "") return { id: r.id != null ? r.id : ("br-api-" + idx + "-" + Date.now()), gcdtid: r.gcdtid != null ? r.gcdtid : (r.dtjlid != null ? r.dtjlid : (r.id != null ? r.id : "")), dateStart: start, dateEnd: end, createtime: ct, recorder: r.jlr || r.recorder || r.teachername || "—", riskLevel: self.normalizeLevelText(r.fxlevel || r.riskLevel || r.risklevel || r.level || "无需特别关注"), suggestion: r.jycs || r.suggestion || r.previousWork || "—", dimension: r.dimension || r.Checklistls_2 || r.zywtwd || "—", remarks: r.note || r.Checklistls_3 || r.dxwxbz || r.remarks || "", priorDailyMgmtWork: self.pickPriorDailyMgmtWorkFromApi(r), source: s.source, crisisForm: self.mapCrisisFormText(r.sfqdft != null ? r.sfqdft : (r.qdwhftb != null ? r.qdwhftb : (r.crisisForm != null ? r.crisisForm : r.crisisform))), observationPayload: r } }) }).fail(function () { s.behaviorRecords = [] if (self.$message) { self.$message.error("加载行为记录请求失败") } }).always(function () { self.behaviorRecordsLoading = false }) }, backToList: function () { this.pageMode = "list" this.detailStudent = null this.behaviorFilterRange = null }, /** 新增观察页点「返回」:从列表「开始记录」进入时直接回列表 */ closeAddObservation: function () { this.backToList() }, onObservationSubmitted: function (payload) { if (!this.detailStudent) { return } // this.detailTab = "behavior" // this.pageMode = "detail" this.backToList(); this.loadBehaviorRecordList(this.detailStudent) this.loadStudentList() if (this.$message) { this.$message.success("添加成功,已刷新行为记录") } }, viewQuestionnaire: function (rec) { if (!rec) { return } var self = this var gcdtid = rec.gcdtid || (rec.observationPayload && rec.observationPayload.gcdtid) || "" if (!gcdtid) { self.behaviorQuestionnaireRec = null self.behaviorQuestionnaireVisible = false if (self.$message) { self.$message.error("缺少问卷记录ID,无法查看问卷答案") } return } $.get("/www/xwgcft/xwgc/ckxwgcdtjl", { id: gcdtid }, function (res) { var ok = res && (res.success === 1 || res.error === 0 || res.code === 0 || res.code === "0") if (!ok) { self.behaviorQuestionnaireRec = null self.behaviorQuestionnaireVisible = false if (self.$message) { self.$message.error((res && (res.message || res.msg)) || "加载问卷答案失败") } return } var parsed = self.parseQuestionnaireAnswerResult(res.data) if (!parsed.toolId) { self.behaviorQuestionnaireRec = null self.behaviorQuestionnaireVisible = false if (self.$message) { self.$message.error("问卷答案缺少toolId,无法加载题本内容") } return } self.fetchToolBookByToolId(parsed.toolId).then(function (toolBookQuestions) { var categories = self.buildQuestionnaireCategoriesFromToolBook(toolBookQuestions, parsed.answers) var fixed = self.extractChecklistFixedFields(parsed.answers) var fixedPrior = fixed.priorDailyMgmtWork != null && String(fixed.priorDailyMgmtWork).trim() !== "" ? String(fixed.priorDailyMgmtWork).trim() : "" var merged = Object.assign({}, rec, { questionnaireCategories: categories, questionnaireToolId: parsed.toolId, dimension: fixed.dimension || rec.dimension || "—", remarks: fixed.remarks || rec.remarks || "", priorDailyMgmtWork: fixedPrior || self.pickPriorDailyMgmtWorkFromApi(rec), crisisForm: self.mapCrisisFormText(fixed.crisisForm || rec.crisisForm || (rec.observationPayload && rec.observationPayload.sfqdft)) }) self.behaviorQuestionnaireRec = merged self.behaviorQuestionnaireVisible = true }).catch(function () { self.behaviorQuestionnaireRec = null self.behaviorQuestionnaireVisible = false if (self.$message) { self.$message.error("加载题本内容失败") } }) }).fail(function () { self.behaviorQuestionnaireRec = null self.behaviorQuestionnaireVisible = false if (self.$message) { self.$message.error("加载问卷答案请求失败") } }) }, parseQuestionnaireAnswerResult: function (data) { var payload = data if (Array.isArray(data)) { payload = data[0] || {} } if (!payload || typeof payload !== "object") { return { toolId: "", answers: [] } } var toolId = payload.toolId || payload.toolid || payload.ToolId || "" var answers = [] if (payload.context) { try { var ctx = typeof payload.context === "string" ? JSON.parse(payload.context) : payload.context toolId = toolId || ctx.toolId || ctx.toolid || "" answers = Array.isArray(ctx.openQuestionAnswerVOS) ? ctx.openQuestionAnswerVOS : [] } catch (e) { answers = [] } } if (Array.isArray(payload.openQuestionAnswerVOS)) { answers = payload.openQuestionAnswerVOS } else if (payload.questionAnswers) { try { var qa = typeof payload.questionAnswers === "string" ? JSON.parse(payload.questionAnswers) : payload.questionAnswers toolId = toolId || qa.toolId || qa.toolid || "" answers = Array.isArray(qa.openQuestionAnswerVOS) ? qa.openQuestionAnswerVOS : [] } catch (e) { answers = [] } } return { toolId: String(toolId || ""), answers: answers } }, extractChecklistFixedFields: function (answers) { var list = Array.isArray(answers) ? answers : [] var out = { dimension: "", remarks: "", priorDailyMgmtWork: "", crisisForm: "" } list.forEach(function (a) { if (!a) return var key = String(a.tmbm || "") if (key === "Checklistls_2") { out.dimension = a.inputContent != null ? String(a.inputContent) : "" } else if (key === "Checklistls_3") { out.remarks = a.inputContent != null ? String(a.inputContent) : "" } else if (key === "Checklistls_4") { out.priorDailyMgmtWork = a.inputContent != null ? String(a.inputContent) : "" } else if (key === "Checklistls_5") { if (Array.isArray(a.answerList) && a.answerList.length) { var first = a.answerList[0] if (first && typeof first === "object") { out.crisisForm = first.answerText || first.optionNo || "" } } else if (a.inputContent != null && String(a.inputContent).trim() !== "") { out.crisisForm = String(a.inputContent) } } }) return out }, mapCrisisFormText: function (val) { if (val === null || val === undefined) return "" var v = String(val).trim() if (v === "1") return "是" if (v === "2") return "否" return v }, fetchToolBookByToolId: function (toolId) { return new Promise(function (resolve, reject) { $.post("/www/public/cpgl/cpSjInfo_toolid", { toolId: toolId }, function (res) { var ok = res && (res.success === 1 || res.error === 0 || res.code === 0 || res.code === 200 || res.code === "0") if (!ok) { reject(new Error("cpSjInfo_toolid failed")) return } var data = res.data var list = [] if (Array.isArray(data) && data.length) { var first = data[0] || {} if (Array.isArray(first.tktms)) { list = first.tktms } else if (Array.isArray(first.list)) { list = first.list } } else if (data && Array.isArray(data.tktms)) { list = data.tktms } else if (Array.isArray(data)) { list = data } else if (data && Array.isArray(data.list)) { list = data.list } else if (data && data.data && Array.isArray(data.data)) { list = data.data } resolve(list) }).fail(function () { reject(new Error("xwjc_cx request failed")) }) }) }, buildQuestionnaireCategoriesFromToolBook: function (questions, answers) { var self = this var qList = Array.isArray(questions) ? questions : [] var aList = Array.isArray(answers) ? answers : [] var answerMap = {} aList.forEach(function (a) { if (!a) return var qid = a.questionId || a.questionid || a.id || a.quesbusiid if (qid != null && qid !== "") { answerMap[String(qid)] = a } }) var formatSuffix = function (text) { var s = text == null ? "" : String(text) return s .replace(/-1$/, "观察频次:偶尔(1-2次/两周)") .replace(/-2$/, "观察频次:经常(3-5次/两周)") .replace(/-3$/, "观察频次:持续(≥5次/两周或几乎每日)") } var parseOptions = function (q) { var raw = q && q.mpanswerdtolist if (!raw) return [] try { var arr = typeof raw === "string" ? JSON.parse(raw) : raw return Array.isArray(arr) ? arr : [] } catch (e) { return [] } } var letterByIndex = function (idx) { return String.fromCharCode(65 + idx) } // 前 5 项固定字段过滤掉,仅处理后续行为观察题 var filteredQuestions = qList.slice(5) var categories = [] filteredQuestions.forEach(function (q, idx) { if (!q) return var qid = q.quesbusiid || q.questionId || q.id var ans = qid != null ? answerMap[String(qid)] : null if (!ans) return var qText = q.questioncontent || q.questionContent || q.timu || "" var items = [] if (Array.isArray(ans.answerList)) { var optionMap = {} parseOptions(q).forEach(function (opt) { if (!opt) return var key = opt.optionNo != null ? String(opt.optionNo) : (opt.optionId != null ? String(opt.optionId) : "") if (key) { optionMap[key] = opt.optionName || "" } }) ans.answerList.forEach(function (x) { if (!x || x === "false") return var t = x.answerText || optionMap[String(x.optionNo || "")] || "" t = formatSuffix(t) if (t) items.push(t) }) } if (!items.length && ans.inputContent != null && String(ans.inputContent).trim() !== "") { items.push(self.enrichBehaviorFrequencyText(String(ans.inputContent).trim())) } if (!items.length) return categories.push({ title: letterByIndex(idx) + "类 " + qText, items: items }) }) return categories }, openAddDialog: function () { this.resetAddForm() this.fetchGradeOptions() this.addDialogVisible = true }, resetAddForm: function () { this.addForm = { name: "", studentNo: "", grade: "", className: "", gender: "男", // source: "" } this.classOptionsRaw = [] var ref = this.$refs.addFormRef if (ref && ref.clearValidate) { ref.clearValidate() } }, submitAddStudent: function () { var self = this var ref = this.$refs.addFormRef var run = function () { self.addSubmitting = true var user = self.getLoginUser() var teacherid = user.UserFilter.uid; if (teacherid == null || teacherid === "") { self.addSubmitting = false if (self.$message) { self.$message.error("未获取到教师账号信息,请重新登录") } return } var name = (self.addForm.name || "").trim() var xh = (self.addForm.studentNo || "").trim() var bjmc = (self.addForm.className || "").trim() var grade = (self.addForm.grade || "").trim() if (!bjmc && grade) { bjmc = grade } // var source = (self.addForm.source || "").trim() var gender = self.addForm.gender var addParams = { name: name, bjmc: bjmc, grade: grade, xh: xh, // source: source === "测评初筛" ? "1" : source === "教师添加" ? "2" : source, gender: gender, sffttj:"0" } $.post("/www/xwgcft/xwgc/addgcStudent", addParams, function (res) { if(res.error == 1){ self.addSubmitting = false if (self.$message) { self.$message.error((res.message || res.msg)) } return } var sid = res.data && res.data.id != null ? res.data.id : res.data; if (sid != null && typeof sid === "object" && sid.id != null) { sid = sid.id } sid = sid != null ? String(sid).trim() : "" if (!sid) { self.addSubmitting = false if (self.$message) { self.$message.error("添加成功但未返回学生ID,无法绑定") } return } var bdParams = { studentid: sid, type: 1 } // $.post("/www/xwgcft/xwgc/bdstudentbyteacher", bdParams, function (bdRes) { // self.addSubmitting = false // if (bdRes && (bdRes.success === 0 || bdRes.error === 1)) { // if (self.$message) { // self.$message.error((bdRes.message || bdRes.msg)) // } // return // } // self.addDialogVisible = false // self.studentListPage = 1 // self.loadStudentList() // if (self.$message) { // self.$message.success("已添加并绑定学生") // } // }).fail(function () { // self.addSubmitting = false // if (self.$message) { // self.$message.error("绑定请求失败") // } // }) }).fail(function () { self.addSubmitting = false if (self.$message) { self.$message.error("添加学生请求失败") } }) } if (!ref || !ref.validate) { run() return } ref.validate(function (valid) { if (!valid) { return } run() }) } } }) }) })(template, resolve, reject); }); RegVueCom("xljk-intermode5", function(resolve, reject){ var template = ""; return (function(template, resolve, reject) { seajs.use([], function () { return resolve({ template: template, name: 'Mode5MockHome', data: function () { return { xljkCurrentRoleKey: "xljkCurrentRoles", roleInterview: "810", roleObserve: "811", user: {}, currentRoleId: "", mockItems: [], mockCsjd: { txs: 1200, wcxs: 987, tls: 210, wcls: 173 }, materialDialogVisible: false, materialFiles: [], materialLoading: false, /** findlsinfo 返回的说明/要求阅知状态,key 为 type 1–4 */ teacherSmyqReadMap: { "1": false, "2": false, "3": false, "4": false }, teacherSmyqLoading: false, teacherSmyqLoaded: false } }, computed: { interMode5GridStyle: function () { var n = this.mockItems && this.mockItems.length ? this.mockItems.length : 1 return { gridTemplateColumns: 'repeat(' + n + ', minmax(0, 1fr))' } }, showTeacherRoleSwitch: function () { return this.hasDualTeacherRole(this.user) }, teacherRoleOptions: function () { return [ { value: this.roleInterview, label: this.getRoleLabel(this.roleInterview) }, { value: this.roleObserve, label: this.getRoleLabel(this.roleObserve) } ] } }, created: function () { this.user = this.getLoginUser() this.currentRoleId = this.initXljkCurrentRole(this.user) this.rebuildMockItems() this.fetchTeacherSmyqInfo() }, activated: function () { this.fetchTeacherSmyqInfo() }, methods: { getLoginUser: function () { try { var raw = localStorage.getItem("user") return raw ? JSON.parse(raw) : {} } catch (e) { return {} } }, getUserRoleIds: function (user) { user = user || this.getLoginUser() var arr = [] var roles = user.Roles if (Array.isArray(roles)) { arr = roles .map(function (r) { return r != null ? String(r).trim() : "" }) .filter(Boolean) } if (!arr.length && user.UserFilter && user.UserFilter.urole != null && user.UserFilter.urole !== "") { arr.push(String(user.UserFilter.urole).trim()) } return arr }, hasRole: function (user, roleId) { return this.getUserRoleIds(user).indexOf(String(roleId)) !== -1 }, hasDualTeacherRole: function (user) { return this.hasRole(user, this.roleInterview) && this.hasRole(user, this.roleObserve) }, resolveXljkCurrentRoleId: function (user) { user = user || this.getLoginUser() var ids = this.getUserRoleIds(user) var stored = "" try { stored = String(localStorage.getItem(this.xljkCurrentRoleKey) || "").trim() } catch (e) { stored = "" } if (stored && ids.indexOf(stored) !== -1) { return stored } if (this.hasRole(user, this.roleInterview)) { return this.roleInterview } if (this.hasRole(user, this.roleObserve)) { return this.roleObserve } return ids.length ? ids[0] : "" }, setXljkCurrentRoleId: function (roleId) { try { localStorage.setItem(this.xljkCurrentRoleKey, String(roleId)) } catch (e) {} }, initXljkCurrentRole: function (user) { var id = this.resolveXljkCurrentRoleId(user) if (id) { this.setXljkCurrentRoleId(id) } return id }, getRoleLabel: function (roleId) { var map = { "810": "访谈老师", "811": "观察老师", "812": "档案老师", "815": "访谈管理员", "816": "行为观察管理员", "817": "学生档案管理" } if (roleId == null || roleId === "") { return "" } return map[String(roleId)] || "其他角色(" + roleId + ")" }, buildHubMenuItems: function (user) { user = user || this.getLoginUser() var roles = this.getUserRoleIds(user) var current = this.resolveXljkCurrentRoleId(user) var list = [ { jd: "gjsm", name: "工作说明", text: "查看" }, { jd: "gzyq", name: "工作要求", text: "查看" }, { jd: "zlxz", name: "资料下载", text: "下载" } ] if (roles.indexOf("815") !== -1 || roles.indexOf("816") !== -1) { list = [{ jd: "9", name: "用户管理", text: "管理" }] } if (this.hasDualTeacherRole(user)) { if (current === this.roleInterview) { list.push({ jd: "4", name: "学生访谈", text: "访谈" }) } else if (current === this.roleObserve) { list.push({ jd: "5", name: "学生行为观察", text: "观察" }) } } else { if (roles.indexOf("811") !== -1) { list.push({ jd: "5", name: "学生行为观察", text: "观察" }) } if (roles.indexOf("810") !== -1) { list.push({ jd: "4", name: "学生访谈", text: "访谈" }) } } if (roles.indexOf("816") !== -1) { list.push({ jd: "6", name: "行为观察管理", text: "管理" }) } if (roles.indexOf("815") !== -1) { list.push({ jd: "8", name: "访谈管理", text: "管理" }) } if (roles.indexOf("817") !== -1) { list.push({ jd: "1", name: "学生档案查看", text: "查看" }) } if (roles.indexOf("812") !== -1) { list.push({ jd: "1", name: "学生档案查看", text: "查看" }) } return list }, rebuildMockItems: function () { this.mockItems = this.buildHubMenuItems(this.user) }, onTeacherRoleSelectChange: function (roleId) { if (!roleId || !this.hasDualTeacherRole(this.user)) { return } this.setXljkCurrentRoleId(roleId) this.currentRoleId = String(roleId) this.rebuildMockItems() }, isApiSuccess: function (res) { return !!( res && (res.success === 1 || res.success === "1" || res.error === 0 || res.error === "0" || res.code === 0 || res.code === "0" || res.code === 200) ) }, isSmyqReadFlag: function (value) { if (value === true || value === 1) { return true } if (value == null || value === "") { return false } var s = String(value).trim().toLowerCase() return s === "1" || s === "true" || s === "yes" || s === "y" || s === "已阅" || s === "已阅知" }, normalizeTeacherSmyqReadMap: function (data) { data = data && typeof data === "object" ? data : {} return { "1": this.isSmyqReadFlag(data.sfgcsm), "2": this.isSmyqReadFlag(data.sfgcyq), "3": this.isSmyqReadFlag(data.sfftsm), "4": this.isSmyqReadFlag(data.sfftyq) } }, fetchTeacherSmyqInfo: function (done) { var that = this that.teacherSmyqLoading = true $.get("/www/xwgcft/xwgc/findlsinfo", {}, function (res) { that.teacherSmyqLoading = false that.teacherSmyqLoaded = true if (that.isApiSuccess(res)) { that.teacherSmyqReadMap = that.normalizeTeacherSmyqReadMap(res.data) } if (typeof done === "function") { done() } }).fail(function () { that.teacherSmyqLoading = false that.teacherSmyqLoaded = true if (typeof done === "function") { done() } }) }, resolveSmyqType: function (jd, roleId) { roleId = roleId != null ? String(roleId) : String(this.currentRoleId || this.resolveXljkCurrentRoleId(this.user)) var isInterview = roleId === this.roleInterview if (jd === "gjsm") { return isInterview ? "3" : "1" } if (jd === "gzyq") { return isInterview ? "4" : "2" } return "" }, getSmyqTypeLabel: function (type) { var map = { "1": "观察工作说明", "2": "观察工作要求", "3": "访谈工作说明", "4": "访谈工作要求" } return map[String(type)] || "说明/要求" }, getSmyqRouteNameByType: function (type) { return String(type) === "2" || String(type) === "4" ? "工作要求" : "工作说明" }, getRequiredSmyqTypesForAction: function (jd) { if (String(jd) === "4") { return ["3", "4"] } if (String(jd) === "5") { return ["1", "2"] } return [] }, isTeacherSmyqRead: function (type) { return !!(this.teacherSmyqReadMap && this.teacherSmyqReadMap[String(type)]) }, getFirstUnreadSmyqType: function (types) { types = types || [] for (var i = 0; i < types.length; i++) { if (!this.isTeacherSmyqRead(types[i])) { return String(types[i]) } } return "" }, openCommonToolInstructions: function (name, smyqType) { var query = { name: name || "工作说明" } if (smyqType) { query.smyqType = String(smyqType) } this.$router.push({ query: query, path: "commonToolInstructions" }) }, checkAndPromptSmyqBeforeAction: function (jd) { var required = this.getRequiredSmyqTypesForAction(jd) var unreadType = this.getFirstUnreadSmyqType(required) if (!unreadType) { return false } var label = this.getSmyqTypeLabel(unreadType) this.$message && this.$message.warning("请先阅读" + label) this.openCommonToolInstructions(this.getSmyqRouteNameByType(unreadType), unreadType) return true }, navigateWithSmyqGuard: function (jd, navigateFn) { var that = this that.fetchTeacherSmyqInfo(function () { if (that.checkAndPromptSmyqBeforeAction(jd)) { return } if (typeof navigateFn === "function") { navigateFn() } }) }, handleMockClick(item) { if (item.jd === 'gjsm' || item.jd === 'gzyq') { var smyqType = this.resolveSmyqType(item.jd, this.currentRoleId) this.openCommonToolInstructions(item.name, smyqType) return } if (item.jd === 'zlxz') { this.openMaterialDownloadDialog() return } if (item.jd == 1) { this.$router.push({ query: { name: item.name }, path: "studentPsychologicalArchives" }) } if (item.jd == 4) { var that4 = this this.navigateWithSmyqGuard(4, function () { that4.$router.push({ query: { name: item.name }, path: "interviewManagement" }) }) } if (item.jd == 3) { this.$router.push({ query: { name: item.name }, path: "interviewManagementh5" }) } if (item.jd == 5) { var that5 = this this.navigateWithSmyqGuard(5, function () { that5.$router.push({ query: { name: item.name }, path: "behavioralObservation" }) }) } if (item.jd == 6) { this.$router.push({ query: { name: item.name }, path: "behavioralObservationAdmin" }) } if (item.jd == 7) { this.$router.push({ query: { name: item.name }, path: "behavioralObservationh5" }) } if (item.jd == 8) { this.$router.push({ query: { name: item.name }, path: "interviewManagementAdmin" }) } if (item.jd == 9) { this.$router.push({ query: { name: item.name }, path: 'userManagementAdmin' }) } }, handleMockDetail(name) { this.$message.info('模拟详情:' + name) }, normalizeMaterialFile: function (item, index) { item = item || {} return { id: item.id || item.ID || "", filename: item.filename || item.fileName || item.name || ("文件" + (index + 1)), filepath: item.filepath || item.filePath || item.path || "" } }, parseMaterialFileList: function (data) { var that = this if (!data) { return [] } var list = Array.isArray(data) ? data : (data.list || data.rows || data.records || []) if (!Array.isArray(list) || !list.length) { if (typeof data === "object") { return [that.normalizeMaterialFile(data, 0)] } return [] } return list.map(function (row, index) { return that.normalizeMaterialFile(row, index) }) }, openMaterialDownloadDialog: function () { this.materialDialogVisible = true this.fetchMaterialFiles() }, fetchMaterialFiles: function () { var that = this that.materialFiles = [] that.materialLoading = true $.get("/www/xwgcft/xwgc/findgcftfile", {}, function (res) { that.materialLoading = false if (res && (res.success == 1 || res.error == 0)) { that.materialFiles = that.parseMaterialFileList(res.data) if (!that.materialFiles.length) { that.$message && that.$message.info("暂无资料文件") } return } that.$message && that.$message.error((res && res.message) || "获取资料列表失败") }).fail(function () { that.materialLoading = false that.$message && that.$message.error("获取资料列表失败") }) }, getMaterialDownloadParams: function (item) { item = item || {} var params = {} if (item.id) { params.id = item.id } if (item.filepath) { params.filepath = item.filepath params.path = item.filepath } return params }, downloadMaterialFile: function (item) { var that = this var params = that.getMaterialDownloadParams(item) if (!params.id && !params.filepath) { that.$message && that.$message.error("文件信息不完整,无法下载") return } var ax = typeof axios !== "undefined" ? axios : (typeof window !== "undefined" ? window.axios : null) if (!ax) { that.$message && that.$message.error("下载组件未就绪") return } ax({ method: "get", url: "/www/xwgcft/xwgc/downloadgcftfile", params: params, responseType: "blob" }) .then(function (res) { if (res && res.status == 200) { var blob = new Blob([res.data]) var link = document.createElement("a") link.href = window.URL.createObjectURL(blob) link.setAttribute("download", (item && item.filename) || "文件") document.body.appendChild(link) link.click() document.body.removeChild(link) window.URL.revokeObjectURL(link.href) that.$message && that.$message.success("下载成功") } else { that.$message && that.$message.error("下载失败") } }) .catch(function () { that.$message && that.$message.error("下载失败") }) }, canPreviewMaterialFile: function (item) { return !!(item && (item.filepath || item.id)) }, previewMaterialFile: function (item) { if (!item) { this.$message && this.$message.error("预览地址缺失") return } if (item.filepath && /^https?:\/\//i.test(item.filepath)) { window.open(item.filepath, "_blank") return } if (item.id) { window.open( "https://xinlijc.bnu.edu.cn/core/UForm/fileviewer/r_bg_file?ff=id&fv=" + encodeURIComponent(String(item.id)), "_blank" ) return } if (item.filepath) { window.open(item.filepath, "_blank") return } this.$message && this.$message.error("预览地址缺失") } } }) }) })(template, resolve, reject); }); RegVueCom("xljk-interviewManagement-view", function(resolve, reject){ var template = ""; return (function(template, resolve, reject) { seajs.use([], function () { return resolve({ template: template, name: "InterviewMockList", data: function () { return { assessmentOnlyModalVisible: false, behaviorOnlyModalVisible: false, currentStudent: null, recordingModalVisible: false, recordingStudent: null, recordingAudioSrc: "", recordingAudioBlob: null, recordingVoicePath: "", recordingDurationSec: 0, recordingCurrentSec: 0, recordingPlaying: false, recordingAudioLoading: false, transcriptModalVisible: false, transcriptStudent: null, recordFormModalVisible: false, recordFormStudent: null, recordFormRows: [], interviewReportModalVisible: false, interviewReportStudent: null, finishedRecordsModalVisible: false, finishedRecordsStudent: null, finishedRecordsList: [], finishedRecordsLoading: false, addReasonDialogVisible: false, addReasonText: "", sclyLabels: { "1": "心理测评", "2": "教师日常观察", "3": "同伴或家长反馈", "4": "主动求助", "5": "其他" }, studentDetailMap: {}, tabs: [ { label: "待访谈", value: "pending" }, { label: "已访谈", value: "finished" } ], activeTab: "pending", pendingList: [], finishedList: [], interviewListPage: 1, interviewPageSize: 12, interviewListTotal: 0, interviewListQuery: { name: "", xh: "", grade: "", bjmc: "" }, gradeOptionsRaw: [], classOptionsRaw: [], statusText: { pending: "待访谈", finished: "已访谈" }, statusClass: { pending: "interviewManager-statusTagPending", finished: "interviewManager-statusTagFinished" }, statusStyle: { pending: { backgroundColor: "#ff7a2d", color: "#ffffff" }, finished: { backgroundColor: "#67c23a", color: "#ffffff" } }, levelClass: { "适时关注": "interviewManager-levelTagNormal", "重点关注": "interviewManager-levelTagImportant", "危机预警": "interviewManager-levelTagDanger" }, levelStyle: { "适时关注": { color: "#67c23a", backgroundColor: "#f0f9eb", border: "1px solid #e1f3d8" }, "重点关注": { color: "#e6a23c", backgroundColor: "#fdf6ec", border: "1px solid #f5dab1" }, "危机预警": { color: "#f56c6c", backgroundColor: "#fef0f0", border: "1px solid #fbc4c4" } }, levelStyleDefault: { color: "#67c23a", backgroundColor: "#f0f9eb", border: "1px solid #e1f3d8" }, addStudentDialogVisible: false, addStudentSubmitting: false, addStudentClassLoading: false, addStudentClassLabel: "", addStudentDefaultGrade: "", addStudentDefaultBjmc: "", addStudentForm: { name: "", studentNo: "", gender: "男", scly: "", sclynote: "", ly: "" } } }, computed: { addStudentClassDisplay: function () { if (this.addStudentClassLoading) { return "加载中…" } if (this.addStudentClassLabel) { return this.addStudentClassLabel } return "暂无任教班级" }, addStudentSclyIsOther: function () { return String(this.addStudentForm.scly) === "5" }, addStudentRules: function () { var self = this return { name: [{ required: true, message: "请输入学生姓名", trigger: "blur" }], studentNo: [{ required: true, message: "请输入学号", trigger: "blur" }], gender: [{ required: true, message: "请选择性别", trigger: "change" }], scly: [{ required: true, message: "请选择筛查来源", trigger: "change" }], sclynote: [{ validator: function (rule, value, callback) { if (String(self.addStudentForm.scly) === "5") { if (!(value || "").trim()) { callback(new Error("请填写其他筛查来源")) return } } callback() }, trigger: "blur" }], ly: [{ required: true, message: "请输入理由", trigger: "blur" }] } }, visibleList: function () { if (this.activeTab === "finished") { return this.finishedList } return this.pendingList }, interviewListGradeOptions: function () { var map = {} return (this.gradeOptionsRaw || []).filter(function (v) { if (!v || map[v]) { return false } map[v] = true return true }) }, interviewListClassOptions: function () { var map = {} return (this.classOptionsRaw || []).filter(function (v) { if (!v || map[v]) { return false } map[v] = true return true }) }, currentAssessmentRecords: function () { if (!this.currentStudent) return [] var d = this.studentDetailMap[this.currentStudent.id] if (d && d.assessment && d.assessment.length) return d.assessment return [] }, currentBehaviorRecords: function () { if (!this.currentStudent) return [] var d = this.studentDetailMap[this.currentStudent.id] if (d && d.behavior && d.behavior.length) return d.behavior return [] }, recordingShowPlayer: function () { return !!(this.recordingAudioSrc && String(this.recordingAudioSrc).trim()) }, recordingEmptyHint: function () { if (this.recordingAudioLoading) { return "加载中…" } return "未上传录音" }, recordingTeacherDisplay: function () { if (!this.recordingStudent) return "—" return this.recordingStudent.interviewTeacher || "—" }, recordingTimeLabel: function () { return ( this.formatRecordingTime(this.recordingCurrentSec) + " / " + this.formatRecordingTime(this.recordingDurationSec) ) }, recordingProgressPercent: function () { if (!this.recordingDurationSec) return 0 return Math.min( 100, Math.max(0, (this.recordingCurrentSec / this.recordingDurationSec) * 100) ) }, transcriptRawText: function () { if (!this.transcriptStudent) return "" var t = this.transcriptStudent var text = t.transcriptContent || t.zjg || t.transcript || "" return String(text).trim() }, transcriptHasRealContent: function () { return !!this.transcriptRawText }, recordFormStudentName: function () { if (!this.recordFormStudent) return "—" var s = this.recordFormStudent var n = s.name || s.studentName || s.studentname || s.xm || "" n = n != null ? String(n).trim() : "" return n || "—" }, recordFormTeacherDisplay: function () { if (!this.recordFormStudent) return "—" return this.recordFormStudent.interviewTeacher || "—" }, recordFormInterviewDate: function () { if (!this.recordFormStudent) return "" return this.recordFormStudent.recordInterviewDate || "" }, recordFormTableRows: function () { if (!this.recordFormStudent) { return [] } if (this.recordFormRows && this.recordFormRows.length) { return this.recordFormRows } var rows = this.recordFormStudent.recordFormRows if (rows && rows.length) { return rows } return [] }, /** 访谈结果弹窗:无 ftjg 时不展示横幅+圆标区块 */ interviewReportHasFtjgBanner: function () { var s = this.interviewReportStudent if (!s) { return false } return !(s.ftjg == null || s.ftjg === "") }, interviewReportFtjgResultKind: function () { var s = this.interviewReportStudent if (!s) { return "—" } return this.getFtjgResultKindText(s.ftjg) }, interviewReportFtjgBody: function () { var s = this.interviewReportStudent if (!s) { return "" } return this.getFtjgResultBody(s.ftjg) }, interviewReportFtjgSummaryLine: function () { var s = this.interviewReportStudent if (!s) { return "" } return this.getFtjgResultSummaryLine(s.ftjg) }, interviewReportFtjgBadgeClass: function () { var s = this.interviewReportStudent if (!s || s.ftjg == null || s.ftjg === "") { return "interviewManager-ftjgBadge--empty" } var k = this.normalizeFtjg(s.ftjg) return "interviewManager-ftjgBadge--" + k }, interviewReportFtjgBannerClass: function () { var s = this.interviewReportStudent if (!s || s.ftjg == null || s.ftjg === "") { return "interviewManager-ftjgBanner--empty" } var k = this.normalizeFtjg(s.ftjg) return "interviewManager-ftjgBanner--" + k } }, watch: { behaviorOnlyModalVisible: function (v) { if (v && this.currentStudent) { var self = this this.$nextTick(function () { self.loadBehaviorQuestionnairesForStudent(self.currentStudent) }) } } }, methods: { mapLevelText: function (level) { var lv = level != null ? String(level) : "" if (lv === "1") return "无需特别关注" if (lv === "2") return "适时关注" if (lv === "3") return "重点关注" if (lv === "4") return "危机预警" return level || "适时关注" }, toDateOnly: function (v) { if (v == null || v === "") return "" var s = String(v).trim() if (!s) return "" return s.split(" ")[0].split("T")[0] }, formatGender: function (val) { if (val === true || val === 1 || val === "1") { return "男" } if (val === false || val === 2 || val === "2") { return "女" } var s = val != null ? String(val).trim() : "" if (s === "男" || s === "女") { return s } return s || "—" }, formatScly: function (scly, sclynote) { var s = scly != null ? String(scly).trim() : "" if (!s) { return "—" } var label = (this.sclyLabels && this.sclyLabels[s]) || s if (s === "5") { var note = sclynote != null ? String(sclynote).trim() : "" if (note) { return label + "(" + note + ")" } } return label }, openAddReasonDialog: function () { var card = this.finishedRecordsStudent var ly = card && card.ly != null ? String(card.ly).trim() : "" if (!ly) { this.$message && this.$message.info("暂无添加理由") return } this.addReasonText = ly this.addReasonDialogVisible = true }, behaviorRecordHasGcdtid: function (rec) { if (!rec) return false var g = rec.gcdtid || (rec.observationPayload && rec.observationPayload.gcdtid) return g != null && String(g).trim() !== "" }, behaviorQnSectionTitle: function (sec) { if (!sec || !sec.title) return "" return this.stripHtml(sec.title) }, stripHtml: function (text) { if (!text && text !== 0) return "" return String(text).replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim() }, /** 行为观察答题明细中的频次:与 addObservation 选项说明一致;展示前统一带「观察频次:」前缀(兼容已带前缀的文案) */ enrichBehaviorFrequencyText: function (text) { var s = text == null ? "" : String(text).trim() if (!s || s === "-") return s if (s.indexOf("观察频次:") !== -1) { if (/([^)]*1-2\s*次[^)]*两周[^)]*)/.test(s)) return s if (/([^)]*3-5\s*次[^)]*两周[^)]*)/.test(s)) return s if (/([^)]*≥\s*5\s*次[^)]*)/.test(s) || /([^)]*≥5次[^)]*)/.test(s) || /几乎每日/.test(s)) return s } s = s .replace(/(偶尔)\s*$/g, "观察频次:偶尔(1-2次/两周)") .replace(/(经常)\s*$/g, "观察频次:经常(3-5次/两周)") .replace(/(持续)\s*$/g, "观察频次:持续(≥5次/两周或几乎每日)") s = s .replace(/-1\s*$/g, "观察频次:偶尔(1-2次/两周)") .replace(/-2\s*$/g, "观察频次:经常(3-5次/两周)") .replace(/-3\s*$/g, "观察频次:持续(≥5次/两周或几乎每日)") if (s === "偶尔" || s === "1") return "观察频次:偶尔(1-2次/两周)" if (s === "经常" || s === "2") return "观察频次:经常(3-5次/两周)" if (s === "持续" || s === "3") return "观察频次:持续(≥5次/两周或几乎每日)" if (s.indexOf("观察频次:") === -1) { if (/偶尔(1-2次\/两周)$/.test(s)) s = s.replace(/(偶尔(1-2次\/两周))$/, "观察频次:$1") else if (/经常(3-5次\/两周)$/.test(s)) s = s.replace(/(经常(3-5次\/两周))$/, "观察频次:$1") else if (/持续(≥5次\/两周或几乎每日)$/.test(s)) s = s.replace(/(持续(≥5次\/两周或几乎每日))$/, "观察频次:$1") } return s }, patchBehaviorRecord: function (studentId, recId, patch) { var d = this.studentDetailMap[studentId] if (!d || !Array.isArray(d.behavior)) return var idx = d.behavior.findIndex(function (r) { return r && r.id === recId }) if (idx < 0) return var merged = Object.assign({}, d.behavior[idx], patch) this.$set(d.behavior, idx, merged) }, loadBehaviorQuestionnairesForStudent: function (student) { var self = this if (!student) return var sid = student.id var d = this.studentDetailMap[sid] if (!d || !Array.isArray(d.behavior)) return d.behavior.forEach(function (rec) { if (!rec || rec._qnLoaded || rec._qnLoading) return var gcdtid = rec.gcdtid || (rec.observationPayload && rec.observationPayload.gcdtid) || "" if (!gcdtid) { self.patchBehaviorRecord(sid, rec.id, { _qnLoaded: true }) return } self.loadSingleBehaviorQuestionnaire(sid, rec) }) }, loadSingleBehaviorQuestionnaire: function (studentId, rec) { var self = this if (!rec || rec._qnLoading) return var gcdtid = rec.gcdtid || (rec.observationPayload && rec.observationPayload.gcdtid) || "" if (!gcdtid) { this.patchBehaviorRecord(studentId, rec.id, { _qnLoaded: true }) return } this.patchBehaviorRecord(studentId, rec.id, { _qnLoading: true, _qnError: "" }) $.get("/www/xwgcft/xwgc/ckxwgcdtjl", { id: gcdtid }, function (res) { var ok = res && (res.success === 1 || res.error === 0 || res.code === 0 || res.code === "0") if (!ok) { self.patchBehaviorRecord(studentId, rec.id, { _qnLoading: false, _qnLoaded: true, _qnError: (res && (res.message || res.msg)) || "加载问卷答案失败", questionnaireCategories: [] }) return } var parsed = self.parseQuestionnaireAnswerResult(res.data) if (!parsed.toolId) { self.patchBehaviorRecord(studentId, rec.id, { _qnLoading: false, _qnLoaded: true, _qnError: "", questionnaireCategories: [] }) return } self.fetchToolBookByToolId(parsed.toolId).then(function (toolBookQuestions) { var categories = self.buildQuestionnaireCategoriesFromToolBook(toolBookQuestions, parsed.answers) var fixed = self.extractChecklistFixedFields(parsed.answers) var recNow = (self.studentDetailMap[studentId] && self.studentDetailMap[studentId].behavior && self.studentDetailMap[studentId].behavior.find(function (r) { return r && r.id === rec.id })) || rec var fromFixed = fixed.priorDailyMgmtWork != null ? String(fixed.priorDailyMgmtWork).trim() : "" var fromRec = recNow.priorDailyMgmtWork != null ? String(recNow.priorDailyMgmtWork).trim() : "" var mergedPrior = fromFixed || fromRec || "—" self.patchBehaviorRecord(studentId, rec.id, { questionnaireCategories: categories, priorDailyMgmtWork: mergedPrior, _qnLoading: false, _qnLoaded: true, _qnError: "" }) }).catch(function () { self.patchBehaviorRecord(studentId, rec.id, { _qnLoading: false, _qnLoaded: true, _qnError: "加载题本失败", questionnaireCategories: [] }) }) }).fail(function () { self.patchBehaviorRecord(studentId, rec.id, { _qnLoading: false, _qnLoaded: true, _qnError: "问卷答案请求失败", questionnaireCategories: [] }) }) }, parseQuestionnaireAnswerResult: function (data) { var payload = data if (Array.isArray(data)) { payload = data[0] || {} } if (!payload || typeof payload !== "object") { return { toolId: "", answers: [] } } var toolId = payload.toolId || payload.toolid || payload.ToolId || "" var answers = [] if (payload.context) { try { var ctx = typeof payload.context === "string" ? JSON.parse(payload.context) : payload.context toolId = toolId || ctx.toolId || ctx.toolid || "" answers = Array.isArray(ctx.openQuestionAnswerVOS) ? ctx.openQuestionAnswerVOS : [] } catch (e) { answers = [] } } if (Array.isArray(payload.openQuestionAnswerVOS)) { answers = payload.openQuestionAnswerVOS } else if (payload.questionAnswers) { try { var qa = typeof payload.questionAnswers === "string" ? JSON.parse(payload.questionAnswers) : payload.questionAnswers toolId = toolId || qa.toolId || qa.toolid || "" answers = Array.isArray(qa.openQuestionAnswerVOS) ? qa.openQuestionAnswerVOS : [] } catch (e) { answers = [] } } return { toolId: String(toolId || ""), answers: answers } }, extractChecklistFixedFields: function (answers) { var list = Array.isArray(answers) ? answers : [] var out = { dimension: "", remarks: "", priorDailyMgmtWork: "", crisisForm: "" } list.forEach(function (a) { if (!a) return var key = String(a.tmbm || "") if (key === "Checklistls_2") { out.dimension = a.inputContent != null ? String(a.inputContent) : "" } else if (key === "Checklistls_3") { out.remarks = a.inputContent != null ? String(a.inputContent) : "" } else if (key === "Checklistls_4") { out.priorDailyMgmtWork = a.inputContent != null ? String(a.inputContent) : "" } else if (key === "Checklistls_5") { if (Array.isArray(a.answerList) && a.answerList.length) { var first = a.answerList[0] if (first && typeof first === "object") { out.crisisForm = first.answerText || first.optionNo || "" } } else if (a.inputContent != null && String(a.inputContent).trim() !== "") { out.crisisForm = String(a.inputContent) } } }) return out }, fetchToolBookByToolId: function (toolId) { return new Promise(function (resolve, reject) { $.post("/www/public/cpgl/cpSjInfo_toolid", { toolId: toolId }, function (res) { var ok = res && (res.success === 1 || res.error === 0 || res.code === 0 || res.code === 200 || res.code === "0") if (!ok) { reject(new Error("cpSjInfo_toolid failed")) return } var data = res.data var list = [] if (Array.isArray(data) && data.length) { var first = data[0] || {} if (Array.isArray(first.tktms)) { list = first.tktms } else if (Array.isArray(first.list)) { list = first.list } } else if (data && Array.isArray(data.tktms)) { list = data.tktms } else if (Array.isArray(data)) { list = data } else if (data && Array.isArray(data.list)) { list = data.list } else if (data && data.data && Array.isArray(data.data)) { list = data.data } resolve(list) }).fail(function () { reject(new Error("cpSjInfo_toolid request failed")) }) }) }, buildQuestionnaireCategoriesFromToolBook: function (questions, answers) { var self = this var qList = Array.isArray(questions) ? questions : [] var aList = Array.isArray(answers) ? answers : [] var answerMap = {} aList.forEach(function (a) { if (!a) return var qid = a.questionId || a.questionid || a.id || a.quesbusiid if (qid != null && qid !== "") { answerMap[String(qid)] = a } }) var formatSuffix = function (text) { var s = text == null ? "" : String(text) return s .replace(/-1$/, "偶尔(1-2次/两周)") .replace(/-2$/, "经常(3-5次/两周)") .replace(/-3$/, "持续(≥5次/两周或几乎每日)") } var parseOptions = function (q) { var raw = q && q.mpanswerdtolist if (!raw) return [] try { var arr = typeof raw === "string" ? JSON.parse(raw) : raw return Array.isArray(arr) ? arr : [] } catch (e) { return [] } } var letterByIndex = function (idx) { return String.fromCharCode(65 + idx) } var filteredQuestions = qList.slice(5) var categories = [] filteredQuestions.forEach(function (q, idx) { if (!q) return var qid = q.quesbusiid || q.questionId || q.id var ans = qid != null ? answerMap[String(qid)] : null if (!ans) return var qText = q.questioncontent || q.questionContent || q.timu || "" var items = [] if (Array.isArray(ans.answerList)) { var optionMap = {} parseOptions(q).forEach(function (opt) { if (!opt) return var key = opt.optionNo != null ? String(opt.optionNo) : (opt.optionId != null ? String(opt.optionId) : "") if (key) { optionMap[key] = opt.optionName || "" } }) ans.answerList.forEach(function (x) { if (!x || x === "false") return var t = x.answerText || optionMap[String(x.optionNo || "")] || "" t = formatSuffix(t) t = self.stripHtml(t) t = self.enrichBehaviorFrequencyText(t) if (t) items.push(t) }) } if (!items.length && ans.inputContent != null && String(ans.inputContent).trim() !== "") { items.push(self.enrichBehaviorFrequencyText(self.stripHtml(String(ans.inputContent).trim()))) } if (!items.length) return categories.push({ title: letterByIndex(idx) + "类 " + qText, items: items }) }) return categories }, fetchBehaviorRecords: function (student) { var self = this var stuid = student && (student.stuid || student.studentid || student.id) if (!stuid) return $.get("/www/xwgcft/xwgc/ckxwgcjl", { stuid: stuid }, function (res) { var ok = res && (res.success === 1 || res.error === 0 || res.code === 0 || res.code === "0") if (!ok) { self.$set(self.studentDetailMap, student.id, Object.assign({}, self.studentDetailMap[student.id] || {}, { behavior: [] })) return } var list = [] if (Array.isArray(res.data)) list = res.data else if (res.data && Array.isArray(res.data.list)) list = res.data.list else if (res.data && Array.isArray(res.data.rows)) list = res.data.rows else if (Array.isArray(res.rows)) list = res.rows else if (Array.isArray(res.list)) list = res.list var mapped = list.map(function (item, idx) { var start = self.toDateOnly(item.starttime || item.dateStart || item.ksrq || item.startTime || "") var end = self.toDateOnly(item.endtime || item.dateEnd || item.jsrq || item.endTime || "") return { id: item.id || item.ID || ("b-" + idx), gcdtid: item.gcdtid != null ? item.gcdtid : (item.dtjlid != null ? item.dtjlid : ""), observationPayload: item, dateRange: (start && end) ? (start + " 至 " + end) : (start || end || "—"), recorder: item.jlr || item.recorder || item.teachername || "—", level: self.mapLevelText(item.fxlevel || item.riskLevel || item.risklevel || item.level || ""), suggestion: item.jycs || item.suggestion || item.advice || "—", dimension: item.dimension || item.Checklistls_2 || item.zywtwd || "—", remarks: item.note || item.Checklistls_3 || item.dxwxbz || item.remarks || "—", priorDailyMgmtWork: item.Checklistls_4 || item.priorDailyMgmtWork || item.rcgzgz || item.bzrgz || "—", questionnaireCategories: [], _qnLoading: false, _qnError: "", _qnLoaded: false } }) self.$set(self.studentDetailMap, student.id, Object.assign({}, self.studentDetailMap[student.id] || {}, { behavior: mapped })) if ( self.behaviorOnlyModalVisible && self.currentStudent && self.currentStudent.id === student.id ) { self.$nextTick(function () { self.loadBehaviorQuestionnairesForStudent(student) }) } }).fail(function () { self.$set(self.studentDetailMap, student.id, Object.assign({}, self.studentDetailMap[student.id] || {}, { behavior: [] })) }) }, fetchInterviewInfo: function (student, cb) { var self = this var done = typeof cb === "function" ? cb : function () {} var stuid = student && (student.stuid || student.studentid || student.id) var interviewId = student && (student.id || "") if (!stuid) { done(student || null) return } $.get( "/www/xwgcft/xwgc/ckxwftjl", { stuid: stuid, id: interviewId, restrictedTeacher: 1 }, function (res) { var ok = res && (res.success === 1 || res.error === 0 || res.code === 0 || res.code === "0") if (!ok) { done(student) return } var list = [] if (Array.isArray(res.data)) list = res.data else if (res.data && Array.isArray(res.data.list)) list = res.data.list else if (res.data && Array.isArray(res.data.rows)) list = res.data.rows else if (Array.isArray(res.rows)) list = res.rows else if (Array.isArray(res.list)) list = res.list if (!list.length) { done(student) return } var latest = list[0] || {} var merged = Object.assign({}, student, { interviewTeacher: latest.last_interview_teacher || latest.teachername || latest.lsxm || latest.interviewTeacher || student.interviewTeacher || "—", recordInterviewDate: self.toDateOnly(latest.ftdate || latest.ftrq || latest.date || latest.interviewDate || latest.createtime || latest.last_interview_date || ""), recordTaskDeadline: self.toDateOnly(latest.jzrq || latest.deadline || student.deadline || ""), grade: (student && student.grade != null && String(student.grade).trim()) || (latest.nj != null && String(latest.nj).trim()) || (latest.grade != null && String(latest.grade).trim()) || (latest.njmc != null && String(latest.njmc).trim()) || "", bjmc: (student && student.bjmc != null && String(student.bjmc).trim()) || (latest.bjmc != null && String(latest.bjmc).trim()) || (latest.className != null && String(latest.className).trim()) || "", ftdtid: latest.ftdtid || latest.id || "", transcriptContent: latest.zjg || latest.transcript || latest.transcriptContent || "", reportMainRisk: latest.mainRisk || latest.reportMainRisk || "", reportIntervention: latest.intervention || latest.reportIntervention || "", reportConclusion: latest.conclusion || latest.reportConclusion || "", ftjg: self.normalizeFtjg(latest.ftjg != null ? latest.ftjg : latest.ftJg), voicePath: latest.voice_path || latest.voicePath || student.voicePath || student.voice_path || "", audioUrl: latest.voice_path || latest.audioUrl || latest.lyurl || latest.lydz || student.audioUrl || student.voicePath || student.voice_path || "" }) self.$set(self.studentDetailMap, stuid, Object.assign({}, self.studentDetailMap[stuid] || {}, { interview: list })) done(merged) }) .fail(function () { done(student) }) }, mergeInterviewRowIntoStudent: function (student, latest) { var self = this if (!student || !latest) { return student || null } return Object.assign({}, student, { interviewTeacher: latest.last_interview_teacher || latest.teachername || latest.lsxm || latest.interviewTeacher || student.interviewTeacher || "—", recordInterviewDate: self.toDateOnly(latest.ftdate || latest.ftrq || latest.date || latest.interviewDate || latest.createtime || latest.last_interview_date || ""), recordTaskDeadline: self.toDateOnly(latest.jzrq || latest.deadline || student.deadline || ""), grade: (latest.grade != null && String(latest.grade).trim()) || (student.grade != null && String(student.grade).trim()) || "", bjmc: (latest.bjmc != null && String(latest.bjmc).trim()) || (student.bjmc != null && String(student.bjmc).trim()) || "", ftdtid: latest.ftdtid || latest.id || "", transcriptContent: latest.zjg || latest.transcript || latest.transcriptContent || "", reportMainRisk: latest.mainRisk || latest.reportMainRisk || "", reportIntervention: latest.intervention || latest.reportIntervention || "", reportConclusion: latest.conclusion || latest.reportConclusion || "", ftjg: self.normalizeFtjg( latest.ftjg != null ? latest.ftjg : latest.ftJg != null ? latest.ftJg : student && student.ftjg != null ? student.ftjg : 0 ), voicePath: latest.voice_path || latest.voicePath || student.voicePath || student.voice_path || "", audioUrl: latest.voice_path || latest.audioUrl || latest.lyurl || latest.lydz || student.audioUrl || student.voicePath || student.voice_path || "" }) }, normalizeFtjg: function (v) { var n = parseInt(v, 10) if (n === 0 || n === 1 || n === 2) { return n } return 0 }, /** 列表/报告:ftjg 0 暂不关注,1 重点关注,2 推送校心理中心;无字段时显示「—」 */ getFtjgResultKindText: function (ftjg) { if (ftjg == null || ftjg === "") { return "—" } var k = this.normalizeFtjg(ftjg) if (k === 2) { return "推送校心理中心" } if (k === 1) { return "重点关注" } return "暂不关注" }, getFtjgStatusClass: function (ftjg) { if (ftjg == null || ftjg === "") { return "interviewManager-ftjgStatus interviewManager-ftjgStatus--empty" } var k = this.normalizeFtjg(ftjg) return "interviewManager-ftjgStatus interviewManager-ftjgStatus--" + k }, getFtjgTagClass: function (ftjg) { if (ftjg == null || ftjg === "") { return "interviewManager-levelTagNormal" } var k = this.normalizeFtjg(ftjg) if (k === 2) { return "interviewManager-levelTagDanger" } if (k === 1) { return "interviewManager-levelTagImportant" } return "interviewManager-levelTagNormal" }, getFtjgTagStyle: function (ftjg) { if (ftjg == null || ftjg === "") { return { color: "#909399", backgroundColor: "#f4f4f5", border: "1px solid #e4e7ed" } } var k = this.normalizeFtjg(ftjg) if (k === 2) { return this.levelStyle["危机预警"] } if (k === 1) { return this.levelStyle["重点关注"] } return this.levelStyle["适时关注"] }, getFtjgResultBody: function (ftjg) { if (ftjg == null || ftjg === "") { return "" } var k = this.normalizeFtjg(ftjg) if (k === 2) { return ( "访谈结果为「推送校心理中心」:在访谈中发现学生存在自伤、伤人或严重精神障碍等急性风险,且已触发预设的危机评估标准(如明确计划、近期行为、社会支持缺失等),请立即启动危机干预流程。" + "须第一时间将学生信息、访谈摘要及访谈结果推送至校心理中心,并同步联系班主任及家长,确保学生安全与后续系统干预。" ) } if (k === 1) { return ( "在访谈中识别出学生存在多个心理困扰指标(如持续情绪低落、学业社交功能受损、轻度自伤念头等),构成预警,但经评估未达到危机模块启动阈值(无明确风险计划或紧急控制需求)。" + "此类学生需列为重点关注对象,并请班主任日常观察其情绪行为变化,校心理中心可提供有限次数的跟踪支持,避免问题升级。" ) } return ( "访谈结果显示学生当前心理状态总体平稳,未出现明显情绪困扰、行为异常或认知偏差等警示指标,各项功能运行良好。" + "此类学生暂不纳入主动关注或干预范围,可视为普通人群进行常规心理健康教育。建议每学期按统一流程复评一次,或在学生主动求助时再行评估,无需额外占用心理服务资源。" ) }, /** 访谈结果顶部摘要(与圆形状态同一行展示) */ getFtjgResultSummaryLine: function (ftjg) { if (ftjg == null || ftjg === "") { return "" } var k = this.normalizeFtjg(ftjg) if (k === 2) { return "访谈发现存在急性风险信号,须立即推送校心理中心并启动危机干预。" } if (k === 1) { return "访谈识别多项心理困扰指标,建议列入重点关注并持续观察跟进。" } return "学生当前心理状态总体平稳,无明显风险警示指标。" }, formatInterviewRecordDate: function (row) { if (!row) { return "—" } return ( this.toDateOnly( row.ftdate || row.ftrq || row.date || row.interviewDate || row.createtime || row.last_interview_date || "" ) || "—" ) }, fetchRecordFormRowsByFtdtid: function (ftdtid, cb) { var done = typeof cb === "function" ? cb : function () {} if (!ftdtid) { done([]) return } var self = this $.get("/www/xwgcft/xwgc/ckxwftdtjl", { id: ftdtid }, function (res) { var ok = res && (res.success === 1 || res.error === 0 || res.code === 0 || res.code === "0") if (!ok) { done([]) return } var list = [] if (Array.isArray(res.data)) list = res.data else if (res.data && Array.isArray(res.data.list)) list = res.data.list else if (res.data && Array.isArray(res.data.rows)) list = res.data.rows else if (Array.isArray(res.rows)) list = res.rows else if (Array.isArray(res.list)) list = res.list var base = [] list.forEach(function (item) { var parsed = null if (item && item.context != null && item.context !== "") { if (Array.isArray(item.context)) { parsed = item.context } else if (typeof item.context === "string") { try { parsed = JSON.parse(item.context) } catch (e) { parsed = null } } else if (typeof item.context === "object") { parsed = item.context } } var groups = Array.isArray(parsed) ? parsed : (parsed && Array.isArray(parsed.questions) ? [parsed] : []) if (groups.length) { groups.forEach(function (group) { var dim = (group && (group.tkmc || group.dimension || group.page || group.layer)) || "未分组" var qs = (group && Array.isArray(group.questions)) ? group.questions : [] if (!qs.length) { base.push({ dimension: dim, question: "—", answer: "—" }) return } qs.forEach(function (q) { base.push({ dimension: dim, question: (q && (q.questioncontent || q.question || q.tm || q.title)) || "—", answer: (q && (q.answer || q.daqk || q.da)) || "—" }) }) }) return } base.push({ dimension: item.dimension || item.page || item.ym || item.layer || "未分组", question: item.question || item.tm || item.title || "—", answer: item.answer || item.daqk || item.da || "—" }) }) var out = [] var i = 0 while (i < base.length) { var current = base[i] var dim = current.dimension var j = i while (j < base.length && base[j].dimension === dim) j++ var span = j - i for (var k = i; k < j; k++) { out.push({ dimension: base[k].dimension, question: base[k].question, answer: base[k].answer, dimStart: k === i, dimRowspan: span }) } i = j } done(out) }).fail(function () { done([]) }) }, fetchInterviewStudents: function () { var self = this var type = this.activeTab === "finished" ? 3 : 1 var q = self.interviewListQuery || {} var params = { type: type, pageNo: self.interviewListPage, pageSize: self.interviewPageSize, name: q.name != null ? String(q.name).trim() : "", xh: q.xh != null ? String(q.xh).trim() : "", grade: q.grade != null ? String(q.grade).trim() : "", bjmc: q.bjmc != null ? String(q.bjmc).trim() : "" } $.get("/www/xwgcft/xwgc/ftxsfindbyls", params, function (res) { var ok = res && (res.success === 1 || res.error === 0 || res.code === 0 || res.code === "0" || res.code === 200) if (!ok) { if (type === 1) { self.pendingList = [] } else { self.finishedList = [] } self.interviewListTotal = 0 self.$message && self.$message.error((res && res.message) || "获取访谈学生列表失败") return } var list = [] if (Array.isArray(res.data)) { list = res.data } else if (res.data && Array.isArray(res.data.list)) { list = res.data.list } else if (res.data && Array.isArray(res.data.rows)) { list = res.data.rows } else if (res.data && Array.isArray(res.data.records)) { list = res.data.records } else if (Array.isArray(res.rows)) { list = res.rows } else if (Array.isArray(res.list)) { list = res.list } var total = 0 if (typeof res.total === "number") { total = res.total } else if (res.data && typeof res.data.total === "number") { total = res.data.total } else if (typeof res.count === "number") { total = res.count } else if (res.data && typeof res.data.count === "number") { total = res.data.count } else { total = list.length } self.interviewListTotal = total var mapped = list.map(function (item, idx) { var teacherName = "" if (Array.isArray(item.teachers)) { teacherName = item.teachers .map(function (t) { return (t && (t.teachername || t.name)) || "" }) .filter(function (v) { return !!v }) .join("、") } var stuid = item.stuid || item.studentid || item.stuId || item.id var gradeVal = item.nj != null && String(item.nj).trim() !== "" ? String(item.nj).trim() : item.grade != null && String(item.grade).trim() !== "" ? String(item.grade).trim() : item.njmc != null && String(item.njmc).trim() !== "" ? String(item.njmc).trim() : "" var bjmcVal = item.bjmc != null && String(item.bjmc).trim() !== "" ? String(item.bjmc).trim() : "" return { name: item.name || item.studentname || "", id: type === 3 ? (stuid || ("stu-" + idx)) : (item.id || stuid || ("stu-" + idx)), stuid: stuid || "", studentid: stuid || "", studentNo: item.xh || item.studentNo || "", grade: gradeVal, bjmc: bjmcVal || item.className || "", gender: item.gender != null ? item.gender : item.xb || "", scly: item.scly != null ? String(item.scly) : "", sclynote: item.sclynote != null ? String(item.sclynote) : "", ly: item.ly != null ? String(item.ly) : "", ftjg: (function () { var raw = item.ftjg != null ? item.ftjg : item.ftJg if (raw == null || raw === "") { return null } return self.normalizeFtjg(raw) })(), deadline: item.deadline || item.jzrq || "—", recordInterviewDate: self.toDateOnly( item.ftdate || item.ftrq || item.date || item.interviewDate || item.createtime || item.last_interview_date || "" ), status: type === 1 ? "pending" : "finished", interviewTeacher: teacherName || item.teachername || item.interviewTeacher || "—", ftdtid: item.ftdtid || item.id || "", voicePath: item.voice_path || item.voicePath || "", audioUrl: item.voice_path || item.audioUrl || item.lyurl || item.lydz || "", transcriptBtnLabel: "访谈逐字稿", reportBtnLabel: "访谈结果" } }) if (type === 1) { self.pendingList = mapped } else { self.finishedList = mapped } }).fail(function () { if (type === 1) { self.pendingList = [] } else { self.finishedList = [] } self.interviewListTotal = 0 self.$message && self.$message.error("获取访谈学生列表失败") }) }, onInterviewListFilterSearch: function () { this.interviewListPage = 1 this.fetchInterviewStudents() }, resetInterviewListFilter: function () { this.interviewListQuery = { name: "", xh: "", grade: "", bjmc: "" } this.classOptionsRaw = [] this.interviewListPage = 1 this.fetchInterviewStudents() }, onInterviewListFilterGradeSelect: function (item) { var grade = item && item.value ? String(item.value) : "" this.interviewListQuery.grade = grade this.interviewListQuery.bjmc = "" if (!grade) { this.classOptionsRaw = [] return } this.fetchClassOptionsByGrade(grade) }, onInterviewListFilterGradeChange: function (val) { var grade = (val || "").trim() if (!grade) { this.classOptionsRaw = [] this.interviewListQuery.bjmc = "" return } if (!this.classOptionsRaw.length) { this.fetchClassOptionsByGrade(grade) } }, queryInterviewGradeSuggestions: function (queryString, cb) { var list = this.interviewListGradeOptions || [] var q = (queryString || "").trim() if (q) { list = list.filter(function (item) { return String(item).indexOf(q) > -1 }) } cb(list.map(function (item) { return { value: item } })) }, queryInterviewListClassSuggestions: function (queryString, cb) { var grade = (this.interviewListQuery.grade || "").trim() if (grade && !this.classOptionsRaw.length) { this.fetchClassOptionsByGrade(grade) } var list = this.interviewListClassOptions || [] var q = (queryString || "").trim() if (q) { list = list.filter(function (item) { return String(item).indexOf(q) > -1 }) } cb(list.map(function (item) { return { value: item } })) }, fetchGradeOptions: function () { var self = this $.get("/www/xwgcft/xwgc/ckStudentnj", {}, function (res) { var ok = res && (res.success === 1 || res.error === 0 || res.code === 0 || res.code === "0") if (!ok) { self.gradeOptionsRaw = [] return } var list = [] if (Array.isArray(res.data)) { list = res.data } else if (res.data && Array.isArray(res.data.list)) { list = res.data.list } else if (Array.isArray(res.rows)) { list = res.rows } self.gradeOptionsRaw = list.map(function (item) { if (typeof item === "string") return item return item.grade || item.njmc || item.name || "" }).filter(function (v) { return !!v }) }).fail(function () { self.gradeOptionsRaw = [] }) }, fetchClassOptionsByGrade: function (grade) { var self = this var params = {} if (grade) { params.grade = grade } $.get("/www/xwgcft/xwgc/ckStudentbj", params, function (res) { var ok = res && (res.success === 1 || res.error === 0 || res.code === 0 || res.code === "0") if (!ok) { self.classOptionsRaw = [] return } var list = [] if (Array.isArray(res.data)) { list = res.data } else if (res.data && Array.isArray(res.data.list)) { list = res.data.list } else if (Array.isArray(res.rows)) { list = res.rows } self.classOptionsRaw = list.map(function (item) { if (typeof item === "string") return item return item.bjmc || item.className || item.name || "" }).filter(function (v) { return !!v }) }).fail(function () { self.classOptionsRaw = [] }) }, onInterviewListPageChange: function (p) { this.interviewListPage = p || 1 this.fetchInterviewStudents() }, onInterviewListPageSizeChange: function (size) { this.interviewPageSize = size this.interviewListPage = 1 this.fetchInterviewStudents() }, onChangeTab: function (tabValue) { this.activeTab = tabValue this.interviewListPage = 1 this.fetchInterviewStudents() }, formatRecordingTime: function (sec) { var s = Math.floor(sec || 0) var m = Math.floor(s / 60) var r = s % 60 return m + ":" + (r < 10 ? "0" : "") + r }, fetchVoiceBlob: function (voicePath, studentName, cb) { var done = typeof cb === "function" ? cb : function () {} if (voicePath == null || voicePath === "") { done(null) return } var name = studentName == null ? "" : String(studentName) var url = "/www/xwgcft/xwgc/downloadftvoice?voice_path=" + encodeURIComponent(String(voicePath)) + "&name=" + encodeURIComponent(name) var xhr = new XMLHttpRequest() xhr.open("GET", url, true) xhr.responseType = "blob" xhr.onload = function () { if (xhr.status >= 200 && xhr.status < 300) { var blob = xhr.response if (blob && blob.size !== undefined && blob.size > 0) { done(blob) return } } done(null) } xhr.onerror = function () { done(null) } xhr.send() }, setRecordingAudioBlob: function (blob) { if (this.recordingAudioSrc && this.recordingAudioSrc.indexOf("blob:") === 0) { try { URL.revokeObjectURL(this.recordingAudioSrc) } catch (e) {} } this.recordingAudioBlob = blob || null this.recordingAudioSrc = blob ? URL.createObjectURL(blob) : "" }, triggerBlobDownload: function (blob, filename) { if (!blob) return var url = URL.createObjectURL(blob) try { var a = document.createElement("a") a.href = url a.download = filename || "audio.webm" document.body.appendChild(a) a.click() document.body.removeChild(a) } finally { setTimeout(function () { try { URL.revokeObjectURL(url) } catch (e) {} }, 1000) } }, openAssessmentOnlyModal: function (student) { var self = this this.behaviorOnlyModalVisible = false this.currentStudent = student this.assessmentOnlyModalVisible = true this.fetchInterviewInfo(student, function (merged) { self.currentStudent = merged || student }) }, closeAssessmentOnlyModal: function () { this.assessmentOnlyModalVisible = false if (!this.behaviorOnlyModalVisible) { this.currentStudent = null } }, openBehaviorOnlyModal: function (student) { var self = this this.assessmentOnlyModalVisible = false this.currentStudent = student this.behaviorOnlyModalVisible = true this.fetchBehaviorRecords(student) this.fetchInterviewInfo(student, function (merged) { self.currentStudent = merged || student }) }, closeBehaviorOnlyModal: function () { this.behaviorOnlyModalVisible = false if (!this.assessmentOnlyModalVisible) { this.currentStudent = null } }, goStartTheInterview: function (student) { var q = Object.assign({}, this.$route.query || {}) if (student) { var stuid = student.stuid || student.studentid || student.id if (stuid != null) { q.studentId = String(stuid) } if (student.studentNo) { q.studentNo = student.studentNo } if(student.name) { q.studentName = student.name } var bjmc = student.bjmc || student.className || "" bjmc = bjmc != null ? String(bjmc).trim() : "" if (bjmc) { q.bjmc = bjmc q.className = bjmc } } this.$router.push({ path: "startTheInterview", query: q }) }, openTranscriptModal: function (student) { this.transcriptStudent = student || null this.transcriptModalVisible = true }, closeTranscriptModal: function () { this.transcriptModalVisible = false this.transcriptStudent = null }, openRecordFormModal: function (student) { var self = this this.fetchInterviewInfo(student, function (merged) { var s = merged || student self.recordFormStudent = s self.fetchRecordFormRowsByFtdtid(s && s.ftdtid, function (rows) { self.recordFormRows = rows self.recordFormModalVisible = true }) }) }, closeRecordFormModal: function () { this.recordFormModalVisible = false this.recordFormStudent = null this.recordFormRows = [] }, openInterviewReportModal: function (student) { var self = this this.fetchInterviewInfo(student, function (merged) { self.interviewReportStudent = merged || student || null self.interviewReportModalVisible = true }) }, closeInterviewReportModal: function () { this.interviewReportModalVisible = false this.interviewReportStudent = null }, openFinishedInterviewRecordsModal: function (student) { var self = this this.assessmentOnlyModalVisible = false this.behaviorOnlyModalVisible = false this.currentStudent = null this.finishedRecordsStudent = student || null this.finishedRecordsModalVisible = true this.finishedRecordsLoading = true this.finishedRecordsList = [] var stuid = student && (student.stuid || student.studentid || student.id) if (!stuid) { this.finishedRecordsLoading = false return } $.get("/www/xwgcft/xwgc/ckxwftjl", { stuid: stuid, restrictedTeacher: 1 }, function (res) { self.finishedRecordsLoading = false var ok = res && (res.success === 1 || res.error === 0 || res.code === 0 || res.code === "0" || res.code === 200) if (!ok) { self.$message && self.$message.error((res && res.message) || "获取访谈记录失败") return } var list = [] if (Array.isArray(res.data)) { list = res.data } else if (res.data && Array.isArray(res.data.list)) { list = res.data.list } else if (res.data && Array.isArray(res.data.rows)) { list = res.data.rows } else if (Array.isArray(res.rows)) { list = res.rows } else if (Array.isArray(res.list)) { list = res.list } var card = self.finishedRecordsStudent var listGrade = card && card.grade != null ? String(card.grade).trim() : "" var listBjmc = card && card.bjmc != null ? String(card.bjmc).trim() : "" self.finishedRecordsList = list.map(function (item, idx) { var ftzt = item.ftzt != null ? String(item.ftzt) : "2" var teacherName = item.last_interview_teacher || item.teachername || item.lsxm || "—" var rawFtjg = item.ftjg != null ? item.ftjg : item.ftJg return Object.assign({}, item, { id: item.id || item.ID || ("ivr-" + idx), ftdtid: item.ftdtid || item.id || "", stuid: stuid, grade: listGrade, bjmc: listBjmc, studentName: (card && card.name) || item.studentname || "", studentNo: item.xh || item.studentNo || (card && card.studentNo) || "", last_interview_date: item.last_interview_date || item.ftdate || item.ftrq || item.createtime || "", last_interview_teacher: teacherName, teacherName: teacherName, interviewTeacher: teacherName, ftzt: ftzt === "2" ? "2" : "1", zgz: String(item.zzgzt || "") === "1", report: String(item.ftbgzt || "") === "1", ftjg: self.normalizeFtjg(rawFtjg), voicePath: item.voice_path || item.voicePath || "", audioUrl: item.voice_path || "" }) }) }).fail(function () { self.finishedRecordsLoading = false self.$message && self.$message.error("获取访谈记录失败") }) }, closeFinishedInterviewRecordsModal: function () { this.finishedRecordsModalVisible = false this.finishedRecordsStudent = null this.finishedRecordsList = [] this.finishedRecordsLoading = false }, openRecordFormForFinishedRecord: function (row) { var self = this var card = this.finishedRecordsStudent if (!card || !row) { return } var s = this.mergeInterviewRowIntoStudent(card, row) this.recordFormStudent = s this.fetchRecordFormRowsByFtdtid(s && s.ftdtid, function (rows) { self.recordFormRows = rows self.recordFormModalVisible = true }) }, openRecordingForFinishedRecord: function (row) { var self = this var card = this.finishedRecordsStudent if (!card || !row) { return } var s = this.mergeInterviewRowIntoStudent(card, row) var voicePath = s && (s.voicePath || s.voice_path || s.audioUrl || "") this.recordingStudent = s this.recordingVoicePath = voicePath ? String(voicePath) : "" this.setRecordingAudioBlob(null) this.recordingDurationSec = 0 this.recordingCurrentSec = 0 this.recordingPlaying = false this.recordingModalVisible = true this.recordingAudioLoading = !!this.recordingVoicePath if (this.recordingVoicePath) { this.fetchVoiceBlob(this.recordingVoicePath, s && s.name, function (blob) { self.recordingAudioLoading = false if (!self.recordingModalVisible) { return } if (!blob) { return } self.setRecordingAudioBlob(blob) self.$nextTick(function () { self.syncRecordingAudioElement() }) }) } }, openTranscriptForFinishedRecord: function (row) { var card = this.finishedRecordsStudent if (!card || !row) { return } this.transcriptStudent = this.mergeInterviewRowIntoStudent(card, row) this.transcriptModalVisible = true }, openReportForFinishedRecord: function (row) { var card = this.finishedRecordsStudent if (!card || !row) { return } this.interviewReportStudent = this.mergeInterviewRowIntoStudent(card, row) this.interviewReportModalVisible = true }, openRecordingModal: function (student) { var self = this this.fetchInterviewInfo(student, function (merged) { var s = merged || student var voicePath = s && (s.voicePath || s.voice_path || s.audioUrl || "") self.recordingStudent = s self.recordingVoicePath = voicePath ? String(voicePath) : "" self.setRecordingAudioBlob(null) self.recordingDurationSec = 0 self.recordingCurrentSec = 0 self.recordingPlaying = false self.recordingModalVisible = true self.recordingAudioLoading = !!self.recordingVoicePath if (self.recordingVoicePath) { self.fetchVoiceBlob(self.recordingVoicePath, s && s.name, function (blob) { self.recordingAudioLoading = false if (!self.recordingModalVisible) return if (!blob) { return } self.setRecordingAudioBlob(blob) self.$nextTick(function () { self.syncRecordingAudioElement() }) }) } }) }, closeRecordingModal: function () { this.pauseRecordingAudio() this.recordingModalVisible = false this.recordingStudent = null this.recordingVoicePath = "" this.recordingAudioLoading = false this.setRecordingAudioBlob(null) }, getRecordingAudioEl: function () { return this.$refs.recordingAudioEl }, syncRecordingAudioElement: function () { var el = this.getRecordingAudioEl() if (el) { el.muted = false } }, downloadRecordingAudio: function () { var voicePath = (this.recordingStudent && (this.recordingStudent.voicePath || this.recordingStudent.voice_path || this.recordingStudent.audioUrl)) || "" if (!voicePath) { if (this.$message && this.$message.warning) { this.$message.warning("暂无录音文件地址") } return } var name = "访谈录音-" + (this.recordingStudent && this.recordingStudent.studentNo ? this.recordingStudent.studentNo : "audio") + ".webm" if (this.recordingAudioBlob) { this.triggerBlobDownload(this.recordingAudioBlob, name) return } var self = this this.fetchVoiceBlob(voicePath, this.recordingStudent && this.recordingStudent.name, function (blob) { if (!blob) { self.$message && self.$message.warning && self.$message.warning("录音下载失败") return } self.triggerBlobDownload(blob, name) }) }, toggleRecordingPlay: function () { var self = this if (!this.recordingAudioSrc) { if (this.$message) { this.$message.warning("暂无录音文件,上传后可在此播放") } return } var el = this.getRecordingAudioEl() if (!el) { return } if (this.recordingPlaying) { el.pause() } else { el.play().catch(function () { if (self.$message) { self.$message.error("无法播放,请检查文件地址或格式") } }) } }, pauseRecordingAudio: function () { var el = this.getRecordingAudioEl() if (el) { try { el.pause() } catch (e) {} } this.recordingPlaying = false }, onRecordingTimeUpdate: function () { var el = this.getRecordingAudioEl() if (el) { this.recordingCurrentSec = el.currentTime || 0 } }, resolveDurationFromBlob: function () { var self = this var blob = this.recordingAudioBlob if (!blob || !blob.size || !window.AudioContext) return var reader = new FileReader() reader.onload = function () { var buffer = reader.result if (!buffer) return var ctx = new AudioContext() ctx.decodeAudioData(buffer).then(function (audioBuffer) { if (audioBuffer && audioBuffer.duration && isFinite(audioBuffer.duration)) { self.recordingDurationSec = audioBuffer.duration } }).catch(function () { }).finally(function () { try { ctx.close() } catch (e) {} }) } reader.readAsArrayBuffer(blob) }, onRecordingLoadedMetadata: function () { var el = this.getRecordingAudioEl() if (el && el.duration && !isNaN(el.duration) && isFinite(el.duration)) { this.recordingDurationSec = el.duration return } this.resolveDurationFromBlob() }, onRecordingEnded: function () { this.recordingPlaying = false this.recordingCurrentSec = 0 var el = this.getRecordingAudioEl() if (el) { el.currentTime = 0 } }, onRecordingPlay: function () { this.recordingPlaying = true }, onRecordingPause: function () { this.recordingPlaying = false }, onRecordingSeekClick: function (e) { var el = this.getRecordingAudioEl() if (!el || !this.recordingDurationSec) { return } var track = e.currentTarget var rect = track.getBoundingClientRect() var w = rect.width if (!w) { return } var x = e.clientX - rect.left var p = Math.min(1, Math.max(0, x / w)) el.currentTime = p * this.recordingDurationSec }, getLoginUserForAddStudent: function () { var u = this.user if (u && (u.ID != null || u.id != null)) { return u } try { var raw = localStorage.getItem("user") if (raw) { return JSON.parse(raw) } } catch (e) {} return {} }, formatGradeClass: function (grade, className) { var g = grade == null ? "" : String(grade).trim() var c = className == null ? "" : String(className).trim() return (g + " " + c).trim() }, getTeacherIdForBjNj: function () { var user = this.getLoginUserForAddStudent() if (!user) { return "" } if (user.ID != null && user.ID !== "") { return String(user.ID) } if (user.id != null && user.id !== "") { return String(user.id) } if (user.UserFilter && user.UserFilter.uid != null && user.UserFilter.uid !== "") { return String(user.UserFilter.uid) } return "" }, parseTeacherBjNjLabels: function (res) { var self = this var labels = [] var seen = {} var pushLabel = function (nj, bj) { var text = self.formatGradeClass(nj, bj) if (!text || seen[text]) { return } seen[text] = 1 labels.push(text) } var data = res && res.data if (data && typeof data === "object" && !Array.isArray(data)) { if ( data.grade != null || data.bjmc != null || data.nj != null || data.njmc != null || data.className != null ) { pushLabel( data.grade || data.nj || data.njmc || "", data.bjmc || data.className || data.bj || "" ) return labels } Object.keys(data).forEach(function (nj) { var val = data[nj] if (Array.isArray(val)) { val.forEach(function (item) { if (typeof item === "string") { pushLabel(nj, item) return } pushLabel( nj, item && (item.bjmc || item.className || item.name || item.label || item.value) ) }) return } if (val && typeof val === "object") { Object.keys(val).forEach(function (bjKey) { pushLabel(nj, bjKey) }) } }) return labels } var raw = [] if (Array.isArray(data)) { raw = data } else if (data && Array.isArray(data.list)) { raw = data.list } else if (data && Array.isArray(data.rows)) { raw = data.rows } else if (Array.isArray(res.rows)) { raw = res.rows } raw.forEach(function (item) { if (!item) { return } if (typeof item === "string") { pushLabel("", item) return } var nj = item.nj || item.grade || item.njmc || item.name || item.label || item.value || "" var children = Array.isArray(item.children) ? item.children : [] if (children.length) { children.forEach(function (child) { if (typeof child === "string") { pushLabel(nj, child) return } pushLabel( nj, child && (child.bjmc || child.className || child.name || child.label || child.value) ) }) return } pushLabel(nj, item.bjmc || item.className || item.name) }) return labels }, parseTeacherBjNjClassList: function (res) { var self = this var list = [] var seen = {} var pushPair = function (nj, bj) { var grade = nj != null ? String(nj).trim() : "" var className = bj != null ? String(bj).trim() : "" if (!grade && !className) { return } var key = grade + "\0" + className if (seen[key]) { return } seen[key] = 1 list.push({ grade: grade, className: className }) } var data = res && res.data if (data && typeof data === "object" && !Array.isArray(data)) { if ( data.grade != null || data.bjmc != null || data.nj != null || data.njmc != null || data.className != null ) { pushPair( data.grade || data.nj || data.njmc || "", data.bjmc || data.className || data.bj || "" ) return list } Object.keys(data).forEach(function (nj) { var val = data[nj] if (Array.isArray(val)) { val.forEach(function (item) { if (typeof item === "string") { pushPair(nj, item) return } pushPair( nj, item && (item.bjmc || item.className || item.name || item.label || item.value) ) }) return } if (val && typeof val === "object") { Object.keys(val).forEach(function (bjKey) { pushPair(nj, bjKey) }) } }) return list } var raw = [] if (Array.isArray(data)) { raw = data } else if (data && Array.isArray(data.list)) { raw = data.list } else if (data && Array.isArray(data.rows)) { raw = data.rows } else if (Array.isArray(res.rows)) { raw = res.rows } raw.forEach(function (item) { if (!item) { return } if (typeof item === "string") { pushPair("", item) return } var nj = item.nj || item.grade || item.njmc || item.name || item.label || item.value || "" var children = Array.isArray(item.children) ? item.children : [] if (children.length) { children.forEach(function (child) { if (typeof child === "string") { pushPair(nj, child) return } pushPair( nj, child && (child.bjmc || child.className || child.name || child.label || child.value) ) }) return } pushPair(nj, item.bjmc || item.className || item.name) }) return list }, fetchTeacherBjNjForAddStudent: function () { var self = this self.addStudentClassLoading = true self.addStudentClassLabel = "" self.addStudentDefaultGrade = "" self.addStudentDefaultBjmc = "" var params = {} var teacherid = self.getTeacherIdForBjNj() if (teacherid) { params.teacherid = teacherid } $.get("/www/xwgcft/xwgc/ckteacherbjnj", params, function (res) { self.addStudentClassLoading = false var ok = res && (res.error === 0 || res.success === 1 || res.code === 0 || res.code === "0" || res.code === 200) if (!ok) { self.addStudentClassLabel = "" self.addStudentDefaultGrade = "" self.addStudentDefaultBjmc = "" return } var pairs = self.parseTeacherBjNjClassList(res) var labels = pairs.map(function (p) { return self.formatGradeClass(p.grade, p.className) }).filter(function (t) { return !!t }) self.addStudentClassLabel = labels.length ? labels.join("、") : "暂无任教班级" if (pairs.length) { self.addStudentDefaultGrade = pairs[0].grade || "" self.addStudentDefaultBjmc = pairs[0].className || "" } }).fail(function () { self.addStudentClassLoading = false self.addStudentClassLabel = "" self.addStudentDefaultGrade = "" self.addStudentDefaultBjmc = "" }) }, openAddStudentDialog: function () { this.resetAddStudentForm() this.fetchTeacherBjNjForAddStudent() this.addStudentDialogVisible = true }, onAddStudentSclyChange: function () { if (!this.addStudentSclyIsOther) { this.addStudentForm.sclynote = "" } var ref = this.$refs.addStudentFormRef if (ref && ref.clearValidate) { ref.clearValidate(["sclynote"]) } }, resetAddStudentForm: function () { this.addStudentForm = { name: "", studentNo: "", gender: "男", scly: "", sclynote: "", ly: "" } this.addStudentDefaultGrade = "" this.addStudentDefaultBjmc = "" var ref = this.$refs.addStudentFormRef if (ref && ref.clearValidate) { ref.clearValidate() } }, submitAddStudentForInterview: function () { var self = this var ref = this.$refs.addStudentFormRef var pickNewStudentId = function (r) { if (!r || r.data == null) { return "" } var d = r.data if (typeof d === "string" && String(d).trim() !== "") { return String(d).trim() } if (d && typeof d === "object") { if (d.id != null && String(d.id).trim() !== "") { return String(d.id).trim() } if (d.studentid != null && String(d.studentid).trim() !== "") { return String(d.studentid).trim() } } return "" } var run = function () { self.addStudentSubmitting = true var user = self.getLoginUserForAddStudent() var teacherid = user.UserFilter && user.UserFilter.uid != null ? user.UserFilter.uid : user.uid if (teacherid == null || teacherid === "") { self.addStudentSubmitting = false if (self.$message) { self.$message.error("未获取到教师账号信息,请重新登录") } return } var name = (self.addStudentForm.name || "").trim() var xh = (self.addStudentForm.studentNo || "").trim() var grade = (self.addStudentDefaultGrade || "").trim() var bjmc = (self.addStudentDefaultBjmc || "").trim() if (!grade && !bjmc) { self.addStudentSubmitting = false if (self.$message) { self.$message.warning("未获取到任教班级,无法添加学生") } return } var gender = self.addStudentForm.gender var ly = (self.addStudentForm.ly || "").trim() var scly = self.addStudentForm.scly var sclynote = String(scly) === "5" ? (self.addStudentForm.sclynote || "").trim() : "" var addParams = { name: name, xh: xh, grade: grade, bjmc: bjmc, gender: gender, scly: scly, sclynote: sclynote, ly: ly, sffttj: 1 } $.post("/www/xwgcft/xwgc/addgcStudent", addParams, function (res) { if (res && (res.error == 1 || res.success === 0)) { self.addStudentSubmitting = false if (self.$message) { self.$message.error((res && (res.message || res.msg)) || "添加失败") } return } var sid = pickNewStudentId(res) if (!sid) { self.addStudentSubmitting = false if (self.$message) { self.$message.error("添加成功但未返回学生ID,无法绑定教师") } return } var bdParams = { studentid: sid, type: 2 } $.post("/www/xwgcft/xwgc/bdstudentbyteacher", bdParams, function (bdRes) { self.addStudentSubmitting = false if (bdRes && (bdRes.success === 0 || bdRes.error === 1)) { if (self.$message) { self.$message.error((bdRes && (bdRes.message || bdRes.msg)) || "绑定失败") } return } self.addStudentDialogVisible = false self.resetAddStudentForm() self.activeTab = "pending" self.interviewListPage = 1 self.fetchInterviewStudents() if (self.$message) { self.$message.success("已添加并绑定学生") } }).fail(function () { self.addStudentSubmitting = false if (self.$message) { self.$message.error("绑定请求失败") } }) }).fail(function () { self.addStudentSubmitting = false if (self.$message) { self.$message.error("添加学生请求失败") } }) } if (!ref || !ref.validate) { run() return } ref.validate(function (valid) { if (!valid) { return } run() }) } }, created: function () { this.fetchGradeOptions() this.fetchInterviewStudents() }, beforeDestroy: function () { this.setRecordingAudioBlob(null) } }) }) })(template, resolve, reject); }); RegVueCom("xljk-startTheInterview-view", function(resolve, reject){ var template = ""; return (function(template, resolve, reject) { seajs.use([], function () { return resolve({ template: template, name: "startTheInterview", data: function () { return { phase: "micCheck", micCheckActive: false, micCheckLoading: false, micCheckSeconds: 0, _micCheckSecTimer: null, _micCheckRecorder: null, _micCheckStream: null, _micCheckChunks: [], micCheckMimeType: "", micCheckBlob: null, micCheckPlaybackUrl: "", micCheckPlaybackDurationSec: 0, micCheckPlaybackCurrentSec: 0, micCheckPlaybackPlaying: false, _micCheckRecordStartMs: 0, micCheckBarLevels: (function () { var a = [] for (var i = 0; i < 16; i++) { a.push(12) } return a })(), _micCheckRaf: null, _micCheckAudioCtx: null, _micCheckAnalyser: null, micCheckRecordedOnce: false, /** true:走录音流程(试录后「开始访谈并录音」);false:放弃录音(仅「开始访谈」,填空题必填) */ interviewRecordingEnabled: true, noticeChecked: false, questionIndex: 0, openAnswer: "", judgmentValue: "", judgmentValues: [], /** 量表题(questiontype=8)当前刻度,与测评页 tmlx=6 一致,默认 1 */ scaleValue: 1, supplementText: "", /** 后置跳题:满足规则时下一题同屏展示,独立答题区 */ inlineOpenAnswer: "", inlineJudgmentValue: "", inlineJudgmentValues: [], inlineScaleValue: 1, /** 题目 id 索引,供后置跳题 sourceQuestionId 查找 */ _questionSourceIndex: {}, /** 「心情怎么样」维度:整库同屏,按 tmid 存各题答案 */ bankAnswersMap: {}, recordingSeconds: 0, recordingActive: false, _recTimer: null, _recorder: null, _recStream: null, _recChunks: [], recordingBlob: null, recordingFile: null, recordingMimeType: "", _finishAfterRecordStop: false, studentNo: "", studentName: "", className: "", openingScript: "先坐。最近学期过半/考试刚结束,老师在跟几位同学常规聊聊天,主要就是想听听大家最近在学校过得怎么样。在这里咱们可以随便聊,就像朋友聊天一样。你在这里跟我说的任何心里话,老师都尽可能地会替你保密。不过有一点老师要提前说,因为老师最看重的是你的安全,如果聊到的事情关系到你或者其他人的生命安全,老师不能让你一个人面对,我们会一起想办法找更多的人来保护你。\n\n除了这个,其他的你都可以放心大胆地说,最近有什么开心的、或者觉得心烦的事情,都可以和老师吐吐槽。", noticeBody: "请您在使用时注意:\n1. 请保证和学生的单独谈话在安全、私密的环境中进行,做好保密及保密例外的知情同意。\n2. 请依据您与学生的关系、学生的实际反应及谈话氛围,灵活调整提问的顺序、方式和深度,以建立信任、促进开放交流为首要目标。如学生抗拒,可跳过问题或暂停谈话。态度要温暖、关心的态度,目标是为了能够获得学生真实的想法和感受。\n3. 请根据该总分及具体记录,综合研判所有信息,尤其不可忽视具体的风险言行,给出「建议预警等级」。\n4. 请在表格空白处尽可能详尽、客观地记录关键信息,例如学生在访谈中透露的具体细节、原话表达、行为描述及相关事件,这些内容是后续支持与研判的根本依据。\n5. 本表涉及学生高度敏感信息,访谈完成后,必须按照学校制定的心理工作保密管理规定进行密封、保存与流转,确保信息仅限必要的工作组成员在职责范围内知悉。\n6. 单次访谈预留 15–20 分钟完整时段,请尽可能避免安排在你自己情绪疲惫或临近下班时段。", noticeConfirmLead: "请确认你已知晓以上内容,并愿意继续访谈。", questions: [], currentTkid: "f20e6261-d3e5-4c25-a21e-9051025748e4", visitedTkids: {}, sessionLoading: false, toolIdLoading: false, toolIdFromApi: "", answerScoreMap: {}, answerOptionMap: {}, jumpRuleMap: {}, /** 当前会话内按 tkid 缓存的分数题库跳题规则(cxljfstt) */ ljfsttRuleMap: {}, _jumpCheckSeq: 0, interviewAnswers: [], sessionStartTs: 0, submitLoading: false, doneReturnTimer: null, /** 访谈结束页分级:crisis(所选 score 666 或 999)| focus(5 分且无危机)| normal;999 同时用于答题内直接结束 */ interviewResultLevel: "", /** 当前加载的题库名称(cxtkmc / tkZhInfo 多行中取首个非空 mc、tkmc 等,再回退路由) */ currentBankDisplayName: "", /** 完成页「访谈回顾」记录表弹窗 */ interviewReviewDialogVisible: false } }, computed: { /** 卡片标题随流程变化:前置步骤 → 正式访谈「学生访谈」→ 结束页 */ cardTitle: function () { var p = this.phase if (p === "micCheck") { return "录音功能引导测试" } if (p === "opening") { return "访谈开场白" } if (p === "session") { return "学生访谈" } if (p === "done") { return "访谈结束" } return "学生访谈" }, noticeBodyFinal: function () { var name = (this.studentName && String(this.studentName).trim()) || (this.studentNo && String(this.studentNo).trim()) || "同学" var tpl = this.noticeBody || "" return tpl.replace(/xx/g, name) }, /** 开场白按 \\n 分段,每段首行缩进 2em(首段前加「姓名,」) */ openingScriptDisplayLines: function () { var raw = this.openingScript != null ? String(this.openingScript) : "" var parts = raw.split(/\r?\n/) var name = (this.studentName && String(this.studentName).trim()) || "" var out = [] for (var i = 0; i < parts.length; i++) { var seg = parts[i] if (i === 0) { out.push((name || "") + "," + seg) } else { out.push(seg === "" ? "\u00a0" : seg) } } return out }, /** 须知正文按 \\n 分段;仅当模板含「xx」占位时首段前加「姓名,」(教师须知不加前缀) */ noticeBodyDisplayLines: function () { var raw = this.noticeBodyFinal != null ? String(this.noticeBodyFinal) : "" var parts = raw.split(/\r?\n/) var name = (this.studentName && String(this.studentName).trim()) || "" var tplHasXx = (this.noticeBody && String(this.noticeBody).indexOf("xx") >= 0) var out = [] for (var i = 0; i < parts.length; i++) { var seg = parts[i] if (i === 0 && tplHasXx) { out.push((name || "") + "," + seg) } else { out.push(seg === "" ? "\u00a0" : seg) } } return out }, /** 答题顶栏:姓名(与班级分开展示) */ sessionBarName: function () { var name = this.studentName && String(this.studentName).trim() ? String(this.studentName).trim() : "" return name || "—" }, sessionBarClass: function () { var cls = this.className && String(this.className).trim() ? String(this.className).trim() : "" return cls || "—" }, /** 当前步骤条:题库名称 + 步骤说明 */ interviewStepBarLine: function () { var bank = this.bankDisplayName && String(this.bankDisplayName).trim() ? String(this.bankDisplayName).trim() : "—" var q = this.currentQ || {} var step = q.stepLabel && String(q.stepLabel).trim() ? String(q.stepLabel).trim() : "" if (step && step !== "—") { return bank } return bank }, bankDisplayName: function () { if (this.currentBankDisplayName && String(this.currentBankDisplayName).trim()) { return String(this.currentBankDisplayName).trim() } var q = this.$route && this.$route.query var fromRoute = (q && (q.tkmc || q.tkName) && String(q.tkmc || q.tkName).trim()) || "" return fromRoute || "—" }, /** 当前维度为「访谈结束」题库时,题目不作必填校验 */ isInterviewEndBank: function () { var bank = this.bankDisplayName != null ? String(this.bankDisplayName).trim() : "" return bank === "访谈结束" }, /** 当前维度为「心情怎么样」时,整库题目同屏展示(题目不作必填校验) */ isMoodDimensionBank: function () { var bank = this.bankDisplayName != null ? String(this.bankDisplayName).trim() : "" return bank === "心情怎么样" }, bankAllQuestions: function () { return this.questions || [] }, interviewDoneHeading: function () { if (this.interviewResultLevel === "crisis") { return "访谈结果 · 推送校心理中心" } if (this.interviewResultLevel === "focus") { return "访谈结果 · 重点关注" } return "访谈结果 · 暂不关注" }, /** 完成页 ftjg 数值:与提交参数、访谈管理页 normalizeFtjg 一致 */ interviewDoneFtjgNum: function () { if (this.interviewResultLevel === "crisis") { return 2 } if (this.interviewResultLevel === "focus") { return 1 } return 0 }, interviewDoneFtjgResultKind: function () { var k = this.interviewDoneFtjgNum if (k === 2) { return "推送校心理中心" } if (k === 1) { return "重点关注" } return "暂不关注" }, interviewDoneFtjgSummaryLine: function () { var k = this.interviewDoneFtjgNum if (k === 2) { return "访谈发现存在急性风险信号,须立即推送校心理中心并启动危机干预。" } if (k === 1) { return "访谈识别多项心理困扰指标,建议列入重点关注并持续观察跟进。" } return "学生当前心理状态总体平稳,无明显风险警示指标。" }, interviewDoneFtjgBody: function () { var k = this.interviewDoneFtjgNum if (k === 2) { return ( "访谈结果为「推送校心理中心」:在访谈中发现学生存在自伤、伤人或严重精神障碍等急性风险,且已触发预设的危机评估标准(如明确计划、近期行为、社会支持缺失等),请立即启动危机干预流程。" + "须第一时间将学生信息、访谈摘要及访谈结果推送至校心理中心,并同步联系班主任及家长,确保学生安全与后续系统干预。" ) } if (k === 1) { return ( "在访谈中识别出学生存在多个心理困扰指标(如持续情绪低落、学业社交功能受损、轻度自伤念头等),构成预警,但经评估未达到危机模块启动阈值(无明确风险计划或紧急控制需求)。" + "此类学生需列为重点关注对象,并请班主任日常观察其情绪行为变化,校心理中心可提供有限次数的跟踪支持,避免问题升级。" ) } return ( "访谈结果显示学生当前心理状态总体平稳,未出现明显情绪困扰、行为异常或认知偏差等警示指标,各项功能运行良好。" + "此类学生暂不纳入主动关注或干预范围,可视为普通人群进行常规心理健康教育。建议每学期按统一流程复评一次,或在学生主动求助时再行评估,无需额外占用心理服务资源。" ) }, interviewDoneFtjgBadgeClass: function () { return "startInterview-doneFtjgBadge--" + this.interviewDoneFtjgNum }, interviewDoneFtjgBannerClass: function () { return "startInterview-doneFtjgBanner--" + this.interviewDoneFtjgNum }, /** 访谈回顾:表头元信息(与 interProcess 记录表一致项) */ interviewReviewDisplayMeta: function () { var user = {} var answererInfo = {} try { user = JSON.parse(localStorage.getItem("user") || "{}") } catch (e) {} try { answererInfo = JSON.parse(localStorage.getItem("answererInfo") || "{}") } catch (e) {} var teacher = (user && (user.Nickname || user.Username) && String(user.Nickname || user.Username).trim()) || "—" var name = (this.studentName && String(this.studentName).trim()) || (answererInfo.xm && String(answererInfo.xm).trim()) || "—" var no = (this.studentNo && String(this.studentNo).trim()) || (answererInfo.xh && String(answererInfo.xh).trim()) || "—" var time = this.sessionStartTs ? this.formatDateTimeYMDHMS(this.sessionStartTs) : "—" return { studentName: name, studentNo: no, teacher: teacher, interviewDate: time } }, /** * 访谈回顾表格:仅按 interviewAnswers 顺序展示; * 维度列使用每条答案落库时快照的 bankDisplayName(跳题库后 questions 会被替换,必须随答随存)。 */ interviewReviewTableLines: function () { var self = this var answers = this.interviewAnswers || [] if (!answers.length) { return [] } var catKey = function (e) { var s = e && e.bankDisplayName != null ? String(e.bankDisplayName).trim() : "" return s || "—" } var lines = [] var lineIdx = 0 var i = 0 while (i < answers.length) { var ck = catKey(answers[i]) var j = i + 1 while (j < answers.length && catKey(answers[j]) === ck) { j++ } var span = j - i for (var k = 0; k < span; k++) { var entry = answers[i + k] var qtext = self.stripHtmlForReview((entry && entry.questioncontent) || "—") lines.push({ key: "rev-" + lineIdx++, showCategory: k === 0, categoryRowspan: span, category: ck, question: qtext, answer: self.formatInterviewAnswerEntry(entry) }) } i = j } return lines }, /** 仅填空类(开放题 / 结束语开放题)与量表题展示底部「下一步」;单选题选中自动下一题,多选使用「完成本题」;访谈结束维度下判断题也可直接下一步;下一题有后置跳题规则时展示「下一步」 */ showSessionNextBtn: function () { if (this.isMoodDimensionBank) { return true } var q = this.currentQ || {} if (this.postJumpNextHasRules()) { return true } if (this.isInterviewEndBank && q.kind === "judgment") { return true } return q.kind === "open" || q.kind === "closing" || q.kind === "scale" }, currentScaleMax: function () { var q = this.currentQ || {} var n = Number(q.segment) if (!isFinite(n) || n < 1) { n = 5 } return Math.floor(n) }, currentScaleMarks: function () { var q = this.currentQ || {} var marks = q.scaleMarks if (marks && typeof marks === "object") { return marks } return {} }, currentQ: function () { var list = this.questions || [] var i = Math.min(Math.max(0, this.questionIndex), Math.max(0, list.length - 1)) return list[i] || {} }, inlinePostJumpQ: function () { return this.getPostJumpTargetQuestion() || {} }, showInlinePostJump: function () { var nextQ = this.getPostJumpTargetQuestion() if (!nextQ || !nextQ.jumprules) { return false } return this.evaluateQuestionJumpRules(nextQ, true) }, inlineScaleMax: function () { var q = this.inlinePostJumpQ || {} var n = Number(q.segment) if (!isFinite(n) || n < 1) { n = 5 } return Math.floor(n) }, inlineScaleMarks: function () { var q = this.inlinePostJumpQ || {} var marks = q.scaleMarks if (marks && typeof marks === "object") { return marks } return {} }, inlineJudgmentOptions: function () { var q = this.inlinePostJumpQ || {} if (q.options && q.options.length) { return q.options } return [ { value: "yes", label: "是" }, { value: "no", label: "否" } ] }, recordingLabel: function () { return this.formatRecordingClock(this.recordingSeconds) }, micCheckRecordingLabel: function () { if (this.micCheckLoading) { return "00:00" } return this.formatRecordingClock(this.micCheckSeconds) }, micCheckBtnLabel: function () { if (this.micCheckLoading) { return "正在准备…" } if (this.micCheckActive) { return "停止试录" } return "开始试录" }, micCheckPlaybackTimeLabel: function () { return ( this.formatMediaTime(this.micCheckPlaybackCurrentSec) + " / " + this.formatMediaTime(this.micCheckPlaybackDurationSec) ) }, micCheckPlaybackProgressPercent: function () { if (!this.micCheckPlaybackDurationSec) { return 0 } return Math.min( 100, Math.max(0, (this.micCheckPlaybackCurrentSec / this.micCheckPlaybackDurationSec) * 100) ) }, sessionPrimaryLabel: function () { if (this.sessionLoading) { return "加载中..." } if (this.isMoodDimensionBank) { var moodQs = this.bankAllQuestions || [] for (var li = 0; li < moodQs.length; li++) { if (moodQs[li] && moodQs[li].kind === "closing") { return "完成访谈" } } return "下一步" } if (this.currentQ.kind === "closing") { return "完成访谈" } return "下一步" }, sessionPrimaryDisabled: function () { if (this.sessionLoading) { return true } if (this.isMoodDimensionBank) { var moodList = this.bankAllQuestions for (var mi = 0; mi < moodList.length; mi++) { if (this.isQuestionAnswerEmpty(moodList[mi], this.getBankAnswerBag(moodList[mi]))) { return true } } return false } if (this.isInterviewEndBank && !this.showInlinePostJump) { return false } if (this.isQuestionAnswerEmpty(this.currentQ, this.getCurrentAnswerFieldBag())) { return true } if (this.showInlinePostJump && this.isQuestionAnswerEmpty(this.inlinePostJumpQ, this.getInlineAnswerFieldBag())) { return true } return false }, currentJudgmentOptions: function () { if (this.currentQ && Array.isArray(this.currentQ.options) && this.currentQ.options.length) { return this.currentQ.options } return [ { value: "yes", label: "是" }, { value: "no", label: "否" } ] } }, mounted: function () { var q = (this.$route && this.$route.query) || {} if (q.studentNo) { this.studentNo = q.studentNo } // 可能的“学生名称”字段:不同上游接口/页面可能使用不同 key if (q.studentName) { this.studentName = q.studentName } else if (q.xm) { this.studentName = q.xm } else if (q.student_xm) { this.studentName = q.student_xm } else if (q.xingming) { this.studentName = q.xingming } else if (q.name && q.name !== "访谈管理") { this.studentName = q.name } else { this.studentName = "" } if (q.className) { this.className = q.className } else if (q.bjmc) { this.className = q.bjmc } // 便于联调:在控制台手动执行 __interviewDumpSubmitParams() if (typeof window !== "undefined") { var that = this window.__interviewDumpSubmitParams = function () { that.debugPrintSubmitParams() } window.__interviewDumpRecordingFile = function () { that.debugPrintRecordingFile() } } }, beforeDestroy: function () { this.clearRecTimer() this.clearDoneReturnTimer() this.releaseMicCheckResources() this.revokeMicCheckPlayback() this.releaseRecordingResources() if (typeof window !== "undefined" && window.__interviewDumpSubmitParams) { try { delete window.__interviewDumpSubmitParams } catch (e) { window.__interviewDumpSubmitParams = null } } if (typeof window !== "undefined" && window.__interviewDumpRecordingFile) { try { delete window.__interviewDumpRecordingFile } catch (e) { window.__interviewDumpRecordingFile = null } } }, methods: { clearRecTimer: function () { if (this._recTimer) { clearInterval(this._recTimer) this._recTimer = null } }, backToInterviewList: function () { this.interviewReviewDialogVisible = false this.interviewResultLevel = "" this.clearRecTimer() this.clearDoneReturnTimer() this.releaseMicCheckResources() this.revokeMicCheckPlayback() this.releaseRecordingResources() if (this.$router) { this.$router.back() } }, clearDoneReturnTimer: function () { if (this.doneReturnTimer) { clearTimeout(this.doneReturnTimer) this.doneReturnTimer = null } }, /** 设备自测完成 → 开场白(须先完成一次试录) */ goToOpeningFromMicCheck: function () { if (!this.micCheckRecordedOnce) { if (this.$message) { this.$message.warning("请先完成一次试录(停止试录后可试听),再进入下一步") } return } this.releaseMicCheckResources() this.revokeMicCheckPlayback() this.micCheckRecordedOnce = false this.interviewRecordingEnabled = true this.phase = "opening" }, /** 放弃录音:跳过试录要求,进入开场白后以「开始访谈」进入(不自动录音,填空题为必填) */ abandonRecordingAndGoOpening: function () { var that = this if (!this.$confirm) { this.releaseMicCheckResources() this.revokeMicCheckPlayback() this.micCheckRecordedOnce = false this.interviewRecordingEnabled = false this.phase = "opening" return } this.$confirm( "此次访谈不会被录音,请将访谈内容详细记录到系统中", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" } ) .then(function () { that.releaseMicCheckResources() that.revokeMicCheckPlayback() that.micCheckRecordedOnce = false that.interviewRecordingEnabled = false that.phase = "opening" }) .catch(function () {}) }, startSession: function () { if (!this.noticeChecked) { return } this.interviewResultLevel = "" this.phase = "session" this.questionIndex = 0 this.sessionStartTs = Date.now() this.resetQuestionFields() this.initInterviewQuestions() if (this.interviewRecordingEnabled) { this.toggleRecording() } }, initInterviewQuestions: function () { var routeTkid = this.$route && this.$route.query && this.$route.query.tkid this.questions = [] this.currentBankDisplayName = "" this.currentTkid = routeTkid || "f20e6261-d3e5-4c25-a21e-9051025748e4" this.visitedTkids = {} this.answerScoreMap = {} this.answerOptionMap = {} this.jumpRuleMap = {} this.ljfsttRuleMap = {} this.interviewAnswers = [] this.fetchToolIdFromApi() this.loadQuestionBank(this.currentTkid, true) }, fetchToolIdFromApi: function () { var that = this this.toolIdLoading = true $.get("/www/public/cpgl/ft_tbcx", {}, function (res) { var ok = res && (res.success === 1 || res.error === 0 || res.code === 0 || res.code === 200 || res.code === "0") if (!ok) { return } var data = res.data var toolId = "" if (typeof data === "string" || typeof data === "number") { toolId = String(data) } else if (Array.isArray(data) && data.length) { var first = data[0] || {} toolId = String(first.toolId || first.toolid || first.id || "") } else if (data && typeof data === "object") { toolId = String(data.toolId || data.toolid || data.id || "") } if (toolId) { that.toolIdFromApi = toolId console.log("[InterviewDebug][Submit] toolId from ft_tbcx", toolId) } }).always(function () { that.toolIdLoading = false }) }, openInterviewReviewDialog: function () { if (this.phase !== "done") { return } this.interviewReviewDialogVisible = true }, onInterviewReviewDialogClosed: function () { this.interviewReviewDialogVisible = false }, stripHtmlForReview: function (html) { if (html == null || html === "") { return "" } return String(html).replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim() }, formatInterviewAnswerEntry: function (entry) { if (!entry) { return "—" } if (entry.scaleAnswerLabel) { return String(entry.scaleAnswerLabel).trim() } var ic = entry.inputContent if (ic != null && String(ic).trim() !== "") { return String(ic).trim() } var list = entry.answerList || [] var parts = [] for (var i = 0; i < list.length; i++) { var a = list[i] if (a === "false" || !a) { continue } var t = a.answerText != null ? String(a.answerText).trim() : "" if (t) { parts.push(t) } } return parts.length ? parts.join(";") : "—" }, formatDateTimeYMDHMS: function (timeInput) { var date = timeInput ? new Date(timeInput) : new Date() var pad = function (n) { return n < 10 ? "0" + n : "" + n } return ( date.getFullYear() + "-" + pad(date.getMonth() + 1) + "-" + pad(date.getDate()) + " " + pad(date.getHours()) + ":" + pad(date.getMinutes()) + ":" + pad(date.getSeconds()) ) }, calculateTimeDifferenceSeconds: function (startMs, endMs) { if (!startMs || !endMs) return 0 var diff = Math.max(0, Number(endMs) - Number(startMs)) return Math.floor(diff / 1000) }, /** 写入答题缓存时快照当前题库名称(跳题后 questions 会被整库替换,回顾表维度依赖此字段) */ snapshotBankDisplayNameForAnswer: function () { var b = this.currentBankDisplayName != null ? String(this.currentBankDisplayName).trim() : "" if (b) { return b } var q = this.$route && this.$route.query var fromRoute = q && (q.tkmc || q.tkName) ? String(q.tkmc || q.tkName).trim() : "" return fromRoute || "" }, cacheCurrentAnswerForSubmit: function () { this.cacheAnswerForSubmitForQuestion(this.currentQ, this.getCurrentAnswerFieldBag()) }, /** * 危机:任意所选选项 score 为 666 或 999(Number(String(s).trim()));999 与 sessionPrimary 内「选分即结束」一致,落库 ftjg 须为危机。 * 重点关注:无危机前提下,任意所选选项 score 为 5。 * 否则暂不关注。 */ computeInterviewResultLevelFromAnswers: function (answers) { var hasCrisis = false var has5 = false ;(answers || []).forEach(function (entry) { ;(entry.answerList || []).forEach(function (a) { if (!a || a === "false") { return } var s = a.score if (s !== "" && s != null) { var n = Number(String(s).trim()) if (!isNaN(n) && (n === 666 || n === 999)) { hasCrisis = true } if (!isNaN(n) && n === 5) { has5 = true } } }) }) if (hasCrisis) { return "crisis" } if (has5) { return "focus" } return "normal" }, buildSubmitParams: function () { var user = {} var answererInfo = {} try { user = JSON.parse(localStorage.getItem("user") || "{}") } catch (e) { } try { answererInfo = JSON.parse(localStorage.getItem("answererInfo") || "{}") } catch (e) { } var endTs = Date.now() var finalToolId = this.toolIdFromApi || this.currentTkid || "" var rawAnswers = this.interviewAnswers || [] var answersForPayload = rawAnswers.map(function (e) { if (!e || typeof e !== "object") { return e } var copy = {} Object.keys(e).forEach(function (key) { if (key === "bankDisplayName" || key === "scaleAnswerLabel") { return } copy[key] = e[key] }) return copy }) var payloadObj = { toolId: finalToolId, openQuestionAnswerVOS: answersForPayload, xb: answererInfo.xb || "" } var payloadStr = JSON.stringify(payloadObj) console.log("[InterviewDebug][Submit] before encrypt payloadObj", payloadObj) console.log("[InterviewDebug][Submit] before encrypt payloadStr", payloadStr) var encryptedPayload = payloadStr try { if (typeof Dengdu !== "undefined" && Dengdu.crypto && Dengdu.crypto.zip && Dengdu.crypto.zip.encrypt) { encryptedPayload = Dengdu.crypto.zip.encrypt(payloadStr) } } catch (e) { } var riskLevel = this.computeInterviewResultLevelFromAnswers(this.interviewAnswers || []) /** 访谈结果 ftjg:0 暂不关注,1 重点关注,2 推送校心理中心(落库与 interviewManagement ftjg 一致) */ var ftjg = 0 if (riskLevel === "crisis") { ftjg = 2 } else if (riskLevel === "focus") { ftjg = 1 } return { xm: answererInfo.xm || "", xsid: this.$route && this.$route.query ? (this.$route.query.studentId || "") : "", xxid: answererInfo.schoolid || answererInfo.xxid || "", xxmc: answererInfo.xxmc || "", zymc: answererInfo.zy || "", nj: answererInfo.nj || "", bjmc: answererInfo.bj || "", xd: answererInfo.xd || answererInfo.xxjd || "", account: user.Username || "", email: user.Email || "", ujs: Array.isArray(user.Roles) ? (user.Roles[0] || "") : "", toolId: finalToolId, stid: this.$route && this.$route.query ? (this.$route.query.sjid || this.$route.query.stid || "") : "", dtcnt: (this.interviewAnswers || []).length, dttime: this.calculateTimeDifferenceSeconds(this.sessionStartTs, endTs), starttime: this.formatDateTimeYMDHMS(this.sessionStartTs || endTs), questionAnswers: encryptedPayload, ftjg: ftjg } }, debugPrintSubmitParams: function () { this.cacheCurrentAnswerForSubmit() var params = this.buildSubmitParams() console.log("[InterviewDebug][Submit] manual params", params) return params }, debugPrintRecordingFile: function () { var info = { mimeType: this.recordingMimeType || "", blobSize: this.recordingBlob ? this.recordingBlob.size : 0, fileName: this.recordingFile ? this.recordingFile.name : "", fileSize: this.recordingFile ? this.recordingFile.size : 0, fileType: this.recordingFile ? this.recordingFile.type : "", hasBlob: !!this.recordingBlob, hasFile: !!this.recordingFile } console.log("[InterviewDebug][Recording] file stream info", info) console.log("[InterviewDebug][Recording] blob", this.recordingBlob) console.log("[InterviewDebug][Recording] file", this.recordingFile) return { info: info, blob: this.recordingBlob, file: this.recordingFile } }, isOptionSelected: function (value) { var key = String(value) if (this.currentQ && this.currentQ.isMulti) { return Array.isArray(this.judgmentValues) && this.judgmentValues.indexOf(key) > -1 } return String(this.judgmentValue || "") === key }, toggleMultiOption: function (value) { var key = String(value) var list = Array.isArray(this.judgmentValues) ? this.judgmentValues.slice() : [] var idx = list.indexOf(key) if (idx > -1) { list.splice(idx, 1) } else { list.push(key) } this.judgmentValues = list }, onSingleChoiceSelected: function () { if (!this.currentQ || this.currentQ.kind !== "judgment" || this.currentQ.isMulti) return if (this.sessionLoading) return if (!this.judgmentValue) return if (this.phase !== "session") return if (this.postJumpNextHasRules()) return this.sessionPrimary() }, normalizeOptions: function (raw) { if (!raw) return [] var list = [] try { list = typeof raw === "string" ? JSON.parse(raw) : raw } catch (e) { list = [] } if (!Array.isArray(list)) return [] return list.map(function (item, index) { var value = item.optionNo || item.optionId || item.id || (index + 1) var label = item.optionName || ("选项" + (index + 1)) return { value: String(value), label: String(label).replace(/%s/g, ""), score: item.score !== undefined && item.score !== null ? Number(item.score) : null, answerBusiId: item.answerBusiId != null && item.answerBusiId !== "" ? String(item.answerBusiId) : "", optionNo: item.optionNo != null && item.optionNo !== "" ? String(item.optionNo) : String(value), optionId: item.optionId != null && item.optionId !== "" ? String(item.optionId) : "" } }) }, normalizeBankQuestions: function (rows) { var list = Array.isArray(rows) ? rows : [] var realList = list.filter(function (item) { return item && item.questionflag !== "1" && item.questionflag !== "2" }) var total = realList.length || 1 return realList.map(function (item, idx) { var rawTitle = item.questioncontent || "请作答" var isOpenByPlaceholder = String(rawTitle).indexOf("%s") > -1 var title = String(rawTitle).replace(/%s/g, "") /** 量表题:与测评页 gettmlx 中 questiontype=='8' → tmlx=6 一致 */ var isScale = String(item.questiontype) === "8" && String(item.replytype) === "1" var isChoice = String(item.replytype) === "1" && !isOpenByPlaceholder && !isScale var options = isChoice ? this.normalizeOptions(item.mpanswerdtolist) : [] var segment = 5 var scaleMarks = {} var scaleOptions = [] if (isScale) { var segRaw = Number(item.segment) segment = !isFinite(segRaw) || segRaw < 1 ? 5 : Math.floor(segRaw) var axisStr = item.axisdesc != null ? String(item.axisdesc) : "" var axisParts = axisStr.split(";").map(function (s) { return String(s).trim() }) var si = 0 for (; si < segment; si++) { var step = si + 1 var lab = axisParts[si] != null && axisParts[si] !== "" ? axisParts[si] : String(step) scaleMarks[step] = lab scaleOptions.push({ value: String(step), label: lab, score: null }) } var fromMp = this.normalizeOptions(item.mpanswerdtolist) if (fromMp.length) { for (var fi = 0; fi < fromMp.length && fi < scaleOptions.length; fi++) { scaleOptions[fi].label = fromMp[fi].label || scaleOptions[fi].label scaleOptions[fi].value = fromMp[fi].value != null ? String(fromMp[fi].value) : scaleOptions[fi].value if (fromMp[fi].score !== null && fromMp[fi].score !== undefined && !isNaN(Number(fromMp[fi].score))) { scaleOptions[fi].score = Number(fromMp[fi].score) } } } } var kind = isScale ? "scale" : isChoice ? "judgment" : "open" var jumprules = null var jumprulesRaw = item.jumprules || item.JumpRules || item.jumprule || "" if (jumprulesRaw) { try { jumprules = typeof jumprulesRaw === "string" ? JSON.parse(jumprulesRaw) : jumprulesRaw if (!jumprules || !Array.isArray(jumprules.groups) || !jumprules.groups.length) { jumprules = null } } catch (eJ) { jumprules = null } } return { tmid: item.id || item.tmid || item.tktmid || "", rawId: item.id || "", quesbusiid: item.quesbusiid || item.quesBusiId || item.id || "", questionno: item.questionno ? String(item.questionno) : "", tmbm: item.tmbm || "", tkid: item.tkid || this.currentTkid, kind: kind, isMulti: String(item.ismult || "0") === "1", stepLabel: "访谈题目", progressIndex: idx + 1, progressTotal: total, title: title || "请作答", subtitle: "", recordLabel: isChoice || isScale ? "" : "请记录学生回答", placeholder: isChoice || isScale ? "" : "请记录学生回答", bannerAlert: "", bannerSuccess: "", supplementLabel: isChoice || isScale ? "补充记录(可选)" : "", supplementPlaceholder: isChoice || isScale ? "可以补充学生原话、时间、场景等" : "", options: options, segment: segment, scaleMarks: scaleMarks, scaleOptions: scaleOptions, startscope: item.startscope || "", midscope: item.midscope || "", endscope: item.endscope || "", scorejumpquesno: item.scorejumpquesno ? String(item.scorejumpquesno) : "0", scorejumpnos: item.scorejumpnos ? String(item.scorejumpnos) : "", scorejumpmin: item.scorejumpmin ? String(item.scorejumpmin) : "", scorejumpmax: item.scorejumpmax ? String(item.scorejumpmax) : "", jumprules: jumprules } }, this) }, getCurrentAnswerFieldBag: function () { return { openAnswer: this.openAnswer, judgmentValue: this.judgmentValue, judgmentValues: this.judgmentValues, scaleValue: this.scaleValue } }, initBankAnswersMap: function () { var map = {} var list = this.questions || [] for (var i = 0; i < list.length; i++) { var q = list[i] if (!q || !q.tmid) { continue } map[String(q.tmid)] = { openAnswer: "", judgmentValue: "", judgmentValues: [], scaleValue: 1 } } this.bankAnswersMap = map }, getBankAnswerBag: function (q) { if (!q || !q.tmid) { return { openAnswer: "", judgmentValue: "", judgmentValues: [], scaleValue: 1 } } var key = String(q.tmid) if (!this.bankAnswersMap[key]) { this.$set(this.bankAnswersMap, key, { openAnswer: "", judgmentValue: "", judgmentValues: [], scaleValue: 1 }) } return this.bankAnswersMap[key] }, getBankJudgmentOptions: function (q) { if (q && Array.isArray(q.options) && q.options.length) { return q.options } return [ { value: "yes", label: "是" }, { value: "no", label: "否" } ] }, getBankScaleMax: function (q) { var n = Number(q && q.segment) if (!isFinite(n) || n < 1) { n = 5 } return Math.floor(n) }, getBankScaleMarks: function (q) { var marks = q && q.scaleMarks if (marks && typeof marks === "object") { return marks } return {} }, isBankOptionSelected: function (q, value) { var bag = this.getBankAnswerBag(q) var key = String(value) if (q && q.isMulti) { return Array.isArray(bag.judgmentValues) && bag.judgmentValues.indexOf(key) > -1 } return String(bag.judgmentValue || "") === key }, setBankJudgment: function (q, value) { var bag = this.getBankAnswerBag(q) bag.judgmentValue = String(value) }, toggleBankMultiOption: function (q, value) { var bag = this.getBankAnswerBag(q) var key = String(value) var list = Array.isArray(bag.judgmentValues) ? bag.judgmentValues.slice() : [] var idx = list.indexOf(key) if (idx > -1) { list.splice(idx, 1) } else { list.push(key) } bag.judgmentValues = list }, getInlineAnswerFieldBag: function () { return { openAnswer: this.inlineOpenAnswer, judgmentValue: this.inlineJudgmentValue, judgmentValues: this.inlineJudgmentValues, scaleValue: this.inlineScaleValue } }, getPostJumpTargetQuestion: function () { var list = this.questions || [] var idx = Number(this.questionIndex) if (!isFinite(idx) || idx < 0 || idx >= list.length - 1) { return null } return list[idx + 1] || null }, postJumpNextHasRules: function () { var nextQ = this.getPostJumpTargetQuestion() return !!(nextQ && nextQ.jumprules && Array.isArray(nextQ.jumprules.groups) && nextQ.jumprules.groups.length) }, rebuildQuestionSourceIndex: function () { var index = {} var list = this.questions || [] for (var i = 0; i < list.length; i++) { var q = list[i] if (!q) { continue } var keys = [q.rawId, q.tmid, q.quesbusiid, q.questionno] for (var k = 0; k < keys.length; k++) { if (keys[k] == null || keys[k] === "") { continue } index[String(keys[k])] = q index[String(keys[k]).toLowerCase()] = q } } this._questionSourceIndex = index }, findQuestionBySourceId: function (sourceQuestionId, sourceQuestionNo) { if (sourceQuestionId == null || sourceQuestionId === "") { if (sourceQuestionNo == null || sourceQuestionNo === "") { return null } } var index = this._questionSourceIndex || {} if (sourceQuestionId != null && sourceQuestionId !== "") { var sid = String(sourceQuestionId) if (index[sid]) { return index[sid] } if (index[sid.toLowerCase()]) { return index[sid.toLowerCase()] } } if (sourceQuestionNo != null && sourceQuestionNo !== "") { var sno = String(sourceQuestionNo) if (index[sno]) { return index[sno] } if (index[sno.toLowerCase()]) { return index[sno.toLowerCase()] } } var list = this.questions || [] for (var i = 0; i < list.length; i++) { var q = list[i] if (!q) { continue } if ( sourceQuestionId != null && sourceQuestionId !== "" && (String(q.rawId || "") === String(sourceQuestionId) || String(q.tmid || "") === String(sourceQuestionId) || String(q.quesbusiid || "") === String(sourceQuestionId) || String(q.questionno || "") === String(sourceQuestionId)) ) { return q } if ( sourceQuestionNo != null && sourceQuestionNo !== "" && String(q.questionno || "") === String(sourceQuestionNo) ) { return q } } return null }, collectOptionMatchKeys: function (sourceQ, token) { var keys = [] if (token == null || token === "") { return keys } var t = String(token) keys.push(t) var opts = sourceQ && Array.isArray(sourceQ.options) ? sourceQ.options : [] for (var i = 0; i < opts.length; i++) { var o = opts[i] || {} var aliases = [o.value, o.answerBusiId, o.optionNo, o.optionId] var hit = false for (var j = 0; j < aliases.length; j++) { if (aliases[j] != null && aliases[j] !== "" && String(aliases[j]) === t) { hit = true break } } if (!hit) { continue } for (var k = 0; k < aliases.length; k++) { if (aliases[k] != null && aliases[k] !== "") { var ak = String(aliases[k]) if (keys.indexOf(ak) < 0) { keys.push(ak) } } } break } return keys }, expandIdListForQuestion: function (sourceQ, ids) { var all = [] ;(ids || []).forEach(function (id) { this.collectOptionMatchKeys(sourceQ, id).forEach(function (k) { if (all.indexOf(k) < 0) { all.push(k) } }) }, this) return all }, optionKeySetsIntersect: function (a, b) { for (var i = 0; i < a.length; i++) { if (b.indexOf(a[i]) >= 0) { return true } } return false }, optionKeySetsEqual: function (a, b) { if (a.length !== b.length) { return false } var sa = a.slice().sort() var sb = b.slice().sort() for (var i = 0; i < sa.length; i++) { if (sa[i] !== sb[i]) { return false } } return true }, getInterviewQuestionSelectedOptionIds: function (sourceQ, useLiveCurrent) { if (!sourceQ) { return [] } var ids = [] var curIdx = Number(this.questionIndex) var curQ = this.questions && this.questions[curIdx] ? this.questions[curIdx] : this.currentQ var isCurrent = useLiveCurrent && curQ && (String(curQ.tmid || "") === String(sourceQ.tmid || "") || String(curQ.rawId || "") === String(sourceQ.rawId || "") || String(curQ.quesbusiid || "") === String(sourceQ.quesbusiid || "")) if (sourceQ.kind === "judgment") { if (sourceQ.isMulti) { var vals = isCurrent ? this.judgmentValues || [] : this.answerOptionMap[sourceQ.tmid] || [] if (!Array.isArray(vals)) { vals = vals ? [vals] : [] } vals.forEach(function (v) { if (v != null && v !== "") { ids.push(String(v)) } }) return ids } var sel = isCurrent ? this.judgmentValue : this.answerOptionMap[sourceQ.tmid] if (sel != null && sel !== "") { ids.push(String(sel)) } return ids } if (sourceQ.kind === "scale") { var segM = Number(sourceQ.segment) if (!isFinite(segM) || segM < 1) { segM = 5 } segM = Math.floor(segM) var sv = isCurrent ? this.scaleValue : this.answerOptionMap[sourceQ.tmid] if (sv === "" || sv === undefined || sv === null || !isFinite(Number(sv))) { return ids } var ui = Math.min(segM, Math.max(1, Math.floor(Number(sv)))) ids.push(String(ui - 1)) return ids } return ids }, getJumpRuleTargetOptionIds: function (cond, sourceQ) { var targetIds = (cond.optionIds || []).map(function (x) { return String(x) }) if (targetIds.length || !cond.optionNos || !cond.optionNos.length) { return targetIds } var opts = sourceQ && Array.isArray(sourceQ.options) ? sourceQ.options : [] cond.optionNos.forEach(function (no) { var opt = opts.find(function (o) { return ( String(o.value) === String(no) || String(o.optionNo) === String(no) || String(o.answerBusiId) === String(no) ) }) if (opt && opt.value != null && opt.value !== "") { targetIds.push(String(opt.value)) } }) return targetIds }, evaluateJumpRulesCondition: function (cond, useLiveCurrent) { if (!cond || (!cond.sourceQuestionId && !cond.sourceQuestionNo)) { return false } var source = this.findQuestionBySourceId(cond.sourceQuestionId, cond.sourceQuestionNo) if (!source) { return false } var selected = this.getInterviewQuestionSelectedOptionIds(source, useLiveCurrent) if (!selected.length) { return false } var targetIds = this.getJumpRuleTargetOptionIds(cond, source) if (!targetIds.length) { return false } var selectedExpanded = this.expandIdListForQuestion(source, selected) var targetExpanded = this.expandIdListForQuestion(source, targetIds) var operator = cond.operator || "includes_any" if (operator === "includes_any") { return this.optionKeySetsIntersect(selectedExpanded, targetExpanded) } if (operator === "includes_all") { return targetExpanded.every(function (tid) { return selectedExpanded.indexOf(tid) >= 0 }) } if (operator === "equals") { return this.optionKeySetsEqual(selectedExpanded, targetExpanded) } return false }, evaluateJumpRulesGroup: function (group, useLiveCurrent) { if (!group || group.enabled === false) { return false } var conditions = (group.conditions || []).filter(function (c) { return ( c && (c.sourceQuestionId || c.sourceQuestionNo) && ((c.optionIds && c.optionIds.length) || (c.optionNos && c.optionNos.length)) ) }) if (!conditions.length) { return false } var logic = String(group.logic || "AND").toUpperCase() if (logic === "OR") { return conditions.some(function (c) { return this.evaluateJumpRulesCondition(c, useLiveCurrent) }, this) } return conditions.every(function (c) { return this.evaluateJumpRulesCondition(c, useLiveCurrent) }, this) }, evaluateQuestionJumpRules: function (targetQ, useLiveCurrent) { var rules = targetQ && targetQ.jumprules if (!rules || !Array.isArray(rules.groups)) { return false } var groups = rules.groups.filter(function (g) { return ( g && g.enabled !== false && Array.isArray(g.conditions) && g.conditions.some(function (c) { return ( c && (c.sourceQuestionId || c.sourceQuestionNo) && ((c.optionIds && c.optionIds.length) || (c.optionNos && c.optionNos.length)) ) }) ) }) if (!groups.length) { return false } var topLogic = String(rules.logic || "OR").toUpperCase() if (topLogic === "AND") { return groups.every(function (g) { return this.evaluateJumpRulesGroup(g, useLiveCurrent) }, this) } return groups.some(function (g) { return this.evaluateJumpRulesGroup(g, useLiveCurrent) }, this) }, skipUnmatchedPostJumpQuestions: function (startIdx) { var idx = Number(startIdx) if (!isFinite(idx)) { idx = 0 } var list = this.questions || [] while (idx < list.length) { var q = list[idx] if (q && q.jumprules && !this.evaluateQuestionJumpRules(q, false)) { idx++ continue } break } return idx }, isEffectivelyLastQuestion: function (inlineShown) { var nextIdx = this.skipUnmatchedPostJumpQuestions(this.questionIndex + (inlineShown ? 2 : 1)) return nextIdx >= (this.questions || []).length }, moveToNextQuestionOrFinish: function (inlineShown) { var nextIdx = this.skipUnmatchedPostJumpQuestions(this.questionIndex + (inlineShown ? 2 : 1)) if (nextIdx >= (this.questions || []).length) { this.finishInterview() return } this.questionIndex = nextIdx this.resetQuestionFields() }, isQuestionAnswerEmpty: function (q, bag) { q = q || {} bag = bag || {} if (this.isInterviewEndBank || this.isMoodDimensionBank) { return false } if (q.kind === "judgment") { if (q.isMulti) { return !Array.isArray(bag.judgmentValues) || !bag.judgmentValues.length } return !bag.judgmentValue } if (q.kind === "open" || q.kind === "closing") { if (this.interviewRecordingEnabled) { return false } var oa = bag.openAnswer != null ? String(bag.openAnswer).trim() : "" return !oa } return false }, isInlineOptionSelected: function (value) { var key = String(value) var q = this.inlinePostJumpQ || {} if (q.isMulti) { return Array.isArray(this.inlineJudgmentValues) && this.inlineJudgmentValues.indexOf(key) > -1 } return String(this.inlineJudgmentValue || "") === key }, toggleInlineMultiOption: function (value) { var key = String(value) var list = Array.isArray(this.inlineJudgmentValues) ? this.inlineJudgmentValues.slice() : [] var idx = list.indexOf(key) if (idx > -1) { list.splice(idx, 1) } else { list.push(key) } this.inlineJudgmentValues = list }, cacheAnswerBundleForQuestion: function (q, bag) { this.cacheAnswerScoreForQuestion(q, bag) this.cacheOptionSelectionForQuestion(q, bag) this.cacheAnswerForSubmitForQuestion(q, bag) }, cacheAnswerScoreForQuestion: function (q, bag) { q = q || {} bag = bag || {} if (!q.tmid) { return } if (q.kind === "scale") { var optsSc = Array.isArray(q.scaleOptions) ? q.scaleOptions : [] var idxSc = Number(bag.scaleValue) - 1 var pickedSc = optsSc[idxSc] var scoreSc = null if ( pickedSc && pickedSc.score !== null && pickedSc.score !== undefined && !isNaN(Number(pickedSc.score)) ) { scoreSc = Number(pickedSc.score) } this.answerScoreMap[q.tmid] = scoreSc if (q.questionno) { this.answerScoreMap[q.questionno] = this.answerScoreMap[q.tmid] } return } if (q.kind !== "judgment") { this.answerScoreMap[q.tmid] = null if (q.questionno) { this.answerScoreMap[q.questionno] = null } return } if (q.isMulti) { this.answerScoreMap[q.tmid] = null if (q.questionno) { this.answerScoreMap[q.questionno] = null } return } var selected = bag.judgmentValue if (!selected) { this.answerScoreMap[q.tmid] = null if (q.questionno) { this.answerScoreMap[q.questionno] = null } return } var opts = Array.isArray(q.options) ? q.options : [] var picked = opts.find(function (o) { return String(o.value) === String(selected) }) var score = picked && picked.score !== null && picked.score !== undefined ? Number(picked.score) : null this.answerScoreMap[q.tmid] = isNaN(score) ? null : score if (q.questionno) { this.answerScoreMap[q.questionno] = this.answerScoreMap[q.tmid] } }, cacheOptionSelectionForQuestion: function (q, bag) { q = q || {} bag = bag || {} if (!q.tmid) { return } if (q.kind === "scale") { var segM = Number(q.segment) if (!isFinite(segM) || segM < 1) { segM = 5 } segM = Math.floor(segM) var sv2 = bag.scaleValue if (sv2 === "" || sv2 === undefined || sv2 === null || !isFinite(Number(sv2))) { this.answerOptionMap[q.tmid] = "" return } var ui2 = Math.min(segM, Math.max(1, Math.floor(Number(sv2)))) this.answerOptionMap[q.tmid] = String(ui2 - 1) return } if (q.kind !== "judgment") { this.answerOptionMap[q.tmid] = "" return } if (q.isMulti) { this.answerOptionMap[q.tmid] = (bag.judgmentValues || []).slice() return } this.answerOptionMap[q.tmid] = bag.judgmentValue ? String(bag.judgmentValue) : "" }, cacheAnswerForSubmitForQuestion: function (q, bag) { q = q || {} bag = bag || {} if (!q || !q.tmid) { return } var entry = { questionno: q.questionno || "", tmid: q.tmid, tmbm: q.tmbm || "", questionId: q.rawId || q.tmid, tkid: q.tkid || this.currentTkid, questioncontent: q.title || "", tmlx: q.kind === "scale" ? 6 : q.kind === "judgment" ? (q.isMulti ? 3 : 1) : 2 } if (q.kind === "scale") { var segMax = Number(q.segment) if (!isFinite(segMax) || segMax < 1) { segMax = 5 } segMax = Math.floor(segMax) var sv = bag.scaleValue var ui = 1 if (sv !== "" && sv !== undefined && sv !== null && isFinite(Number(sv))) { ui = Math.min(segMax, Math.max(1, Math.floor(Number(sv)))) } entry.inputContent = ui - 1 entry.answerList = [] var marks = q.scaleMarks || {} var mk = marks[ui] entry.scaleAnswerLabel = mk != null && String(mk).trim() !== "" ? String(mk).trim() : String(ui) } else if (q.kind === "judgment") { if (q.isMulti) { var selectedMap = {} ;(bag.judgmentValues || []).forEach(function (v) { selectedMap[String(v)] = true }) entry.inputContent = "" entry.answerList = (q.options || []).map(function (opt) { if (!selectedMap[String(opt.value)]) { return "false" } return { answerText: opt.label || "", optionNo: Number(opt.value) || opt.value, score: opt.score !== undefined && opt.score !== null ? opt.score : "" } }) } else { var opt = (q.options || []).find(function (o) { return String(o.value) === String(bag.judgmentValue || "") }) entry.inputContent = "" entry.answerList = [ { optionNo: bag.judgmentValue ? Number(bag.judgmentValue) || bag.judgmentValue : "", score: opt && opt.score !== undefined && opt.score !== null ? opt.score : "", answerText: opt ? opt.label || "" : "" } ] } } else { entry.inputContent = bag.openAnswer || "" entry.answerList = [] } entry.bankDisplayName = this.snapshotBankDisplayNameForAnswer() var idx = this.interviewAnswers.findIndex(function (it) { return it.tmid === entry.tmid }) if (idx > -1) { this.$set(this.interviewAnswers, idx, entry) } else { this.interviewAnswers.push(entry) } }, cacheCurrentAnswerScore: function () { this.cacheAnswerScoreForQuestion(this.currentQ, this.getCurrentAnswerFieldBag()) }, cacheCurrentOptionSelection: function () { this.cacheOptionSelectionForQuestion(this.currentQ, this.getCurrentAnswerFieldBag()) }, getScoreByRef: function (ref) { var key = ref != null ? String(ref).trim() : "" if (!key) { console.log("[InterviewDebug][Score] empty ref key") return null } if (this.answerScoreMap[key] !== undefined) { console.log("[InterviewDebug][Score] hit score map by key", { ref: key, score: this.answerScoreMap[key] }) return this.answerScoreMap[key] } var list = this.questions || [] for (var i = 0; i < list.length; i++) { var q = list[i] || {} if (String(q.tmid || "") === key || String(q.questionno || "") === key) { console.log("[InterviewDebug][Score] hit score map by question match", { ref: key, matchTmid: q.tmid, matchQuestionNo: q.questionno, score: this.answerScoreMap[q.tmid] }) return this.answerScoreMap[q.tmid] } } console.log("[InterviewDebug][Score] miss score ref", { ref: key, scoreMap: this.answerScoreMap }) return null }, resolveScoreJumpTarget: function (q) { if (!q || !q.scorejumpquesno || q.scorejumpquesno === "0") { console.log("[InterviewDebug][ScoreJump] no score jump config", { tmid: q && q.tmid, scorejumpquesno: q && q.scorejumpquesno }) return "" } var targets = q.scorejumpquesno.split("#") if (!targets.length) { console.log("[InterviewDebug][ScoreJump] empty targets after split", { tmid: q.tmid, scorejumpquesno: q.scorejumpquesno }) return "" } console.log("[InterviewDebug][ScoreJump] start evaluate", { tmid: q.tmid, questionno: q.questionno, scorejumpquesno: q.scorejumpquesno, scorejumpnos: q.scorejumpnos, scorejumpmin: q.scorejumpmin, scorejumpmax: q.scorejumpmax, answerScoreMap: this.answerScoreMap }) if (q.scorejumpnos && q.scorejumpnos !== "0") { var refs = q.scorejumpnos.split(",").map(function (s) { return s && s.trim() }).filter(Boolean) if (!refs.length) { console.log("[InterviewDebug][ScoreJump] refs empty", { tmid: q.tmid, scorejumpnos: q.scorejumpnos }) return "" } var total = 0 var refScores = [] for (var i = 0; i < refs.length; i++) { var score = this.getScoreByRef(refs[i]) if (score === undefined || score === null || isNaN(Number(score))) { console.log("[InterviewDebug][ScoreJump] missing ref score", { tmid: q.tmid, ref: refs[i], score: score }) return "" } refScores.push({ ref: refs[i], score: Number(score) }) total += Number(score) } var mins = q.scorejumpmin ? q.scorejumpmin.split(",") : [] var maxs = q.scorejumpmax ? q.scorejumpmax.split(",") : [] console.log("[InterviewDebug][ScoreJump] aggregate score", { tmid: q.tmid, refs: refs, refScores: refScores, total: total, mins: mins, maxs: maxs, targets: targets }) var pickTargetFromGroup = function (groupText) { var arr = String(groupText || "").split(",").map(function (s) { return s && s.trim() }).filter(Boolean) return arr[0] || "" } for (var j = 0; j < targets.length; j++) { var minRaw = mins[j] !== undefined && mins[j] !== "" ? Number(mins[j]) : -Infinity var maxRaw = maxs[j] !== undefined && maxs[j] !== "" ? Number(maxs[j]) : Infinity if (isNaN(minRaw)) minRaw = -Infinity if (isNaN(maxRaw)) maxRaw = Infinity var min = Math.min(minRaw, maxRaw) var max = Math.max(minRaw, maxRaw) if (total >= min && total <= max) { var picked = pickTargetFromGroup(targets[j]) console.log("[InterviewDebug][ScoreJump] hit aggregate range", { tmid: q.tmid, rangeIndex: j, min: min, max: max, total: total, pickedTarget: picked }) return picked } } // 兜底:常见二分配置(例如 scorejumpmin=1,score=0)按阈值前后选择不同目标 if (targets.length === 1) { var group = String(targets[0] || "") var twoTargets = group.split(",").map(function (s) { return s && s.trim() }).filter(Boolean) if (twoTargets.length >= 2) { var threshold = mins[0] !== undefined && mins[0] !== "" ? Number(mins[0]) : 1 if (isNaN(threshold)) threshold = 1 var fallbackPicked = Number(total) >= threshold ? twoTargets[0] : twoTargets[1] console.log("[InterviewDebug][ScoreJump] fallback binary pick", { tmid: q.tmid, total: total, threshold: threshold, twoTargets: twoTargets, pickedTarget: fallbackPicked }) return fallbackPicked || "" } } console.log("[InterviewDebug][ScoreJump] aggregate no match", { tmid: q.tmid, total: total, mins: mins, maxs: maxs }) return "" } var selfScore = this.answerScoreMap[q.tmid] var singleMin = q.scorejumpmin !== "" ? Number(q.scorejumpmin) : -Infinity var singleMax = q.scorejumpmax !== "" ? Number(q.scorejumpmax) : Infinity if (isNaN(singleMin)) singleMin = -Infinity if (isNaN(singleMax)) singleMax = Infinity var singleLow = Math.min(singleMin, singleMax) var singleHigh = Math.max(singleMin, singleMax) console.log("[InterviewDebug][ScoreJump] single score mode", { tmid: q.tmid, selfScore: selfScore, singleMin: singleMin, singleMax: singleMax, singleLow: singleLow, singleHigh: singleHigh, targets: targets }) if (selfScore !== null && selfScore !== undefined && !isNaN(Number(selfScore)) && Number(selfScore) >= singleLow && Number(selfScore) <= singleHigh) { var pickedSingle = String(targets[0] || "").split(",")[0] || "" console.log("[InterviewDebug][ScoreJump] hit single range", { tmid: q.tmid, pickedTarget: pickedSingle }) return pickedSingle } if (targets.length === 1) { var singleGroup = String(targets[0] || "") var singleTwoTargets = singleGroup.split(",").map(function (s) { return s && s.trim() }).filter(Boolean) if (singleTwoTargets.length >= 2 && selfScore !== null && selfScore !== undefined && !isNaN(Number(selfScore))) { var singleThreshold = isFinite(singleLow) ? singleLow : 1 var pickedSingleFallback = Number(selfScore) >= Number(singleThreshold) ? singleTwoTargets[0] : singleTwoTargets[1] console.log("[InterviewDebug][ScoreJump] single fallback binary pick", { tmid: q.tmid, selfScore: selfScore, singleThreshold: singleThreshold, singleTwoTargets: singleTwoTargets, pickedTarget: pickedSingleFallback }) return pickedSingleFallback || "" } } console.log("[InterviewDebug][ScoreJump] single no match", { tmid: q.tmid, selfScore: selfScore, singleMin: singleMin, singleMax: singleMax }) return "" }, // keep for quick grep when debugging线上分数跳题 debugScoreSnapshot: function () { console.log("[InterviewDebug][Score] snapshot", { currentTkid: this.currentTkid, questionIndex: this.questionIndex, currentQ: this.currentQ, answerScoreMap: this.answerScoreMap, answerOptionMap: this.answerOptionMap }) }, matchJumpRuleTarget: function (rows, selectedOptionId) { var list = Array.isArray(rows) ? rows : [] if (!list.length) { return "" } var sid = selectedOptionId != null ? String(selectedOptionId).trim() : "" if (sid) { var matched = list.find(function (r) { return String(r.ttxx || "") === sid }) if (matched && matched.mbtkid) { return String(matched.mbtkid) } } var emptyRule = list.find(function (r) { return !r.ttxx && r.mbtkid }) return emptyRule && emptyRule.mbtkid ? String(emptyRule.mbtkid) : "" }, loadQuestionBank: function (tkid, resetIndex, done) { var that = this if (!tkid) { if (this.$message) this.$message.warning("未获取到跳转题库ID") done && done(false) return } this.sessionLoading = true // that.currentBankDisplayName = "" $.get("/www/public/cpgl/cxtkmc", { tkid: tkid }, function (cres) { var cok = cres && (cres.error === 0 || cres.code === 200 || cres.code === 0 || cres.success === 1) var cdata = cok && cres.data if (Array.isArray(cdata)) { for (var ci = 0; ci < cdata.length; ci++) { var crow = cdata[ci] if (crow && crow.mc != null) { var mcs = String(crow.mc).trim() if (mcs) { that.currentBankDisplayName = mcs break } } } } }) $.get("/www/public/cpgl/tkZhInfo", { tkid: tkid }, function (res) { var ok = res && (res.error === 0 || res.code === 200 || res.code === 0 || res.success === 1) if (!ok) { that.$message && that.$message.error((res && (res.message || res.msg)) || "加载题库失败") done && done(false) return } var payload = res.data var data = [] if (Array.isArray(payload)) { data = payload } else if (payload && Array.isArray(payload.list)) { data = payload.list } else if (payload && Array.isArray(payload.rows)) { data = payload.rows } if (!that.currentBankDisplayName || !String(that.currentBankDisplayName).trim()) { var bankNm = "" if (res.tkmc != null && String(res.tkmc).trim()) { bankNm = String(res.tkmc).trim() } else if (payload && typeof payload === "object" && !Array.isArray(payload)) { bankNm = String(payload.tkmc || payload.mc || payload.sjtitle || "").trim() } if (!bankNm && data.length) { for (var di = 0; di < data.length; di++) { var dr = data[di] if (!dr) { continue } bankNm = String( dr.tkmc || dr.tmmc || dr.tkname || dr.sjmc || dr.mc || dr.sjtitle || "" ).trim() if (bankNm) { break } } } that.currentBankDisplayName = bankNm } var normalized = that.normalizeBankQuestions(data) if (!normalized.length) { that.sessionLoading = false done && done(false) return } that.questions = normalized that.rebuildQuestionSourceIndex() that.initBankAnswersMap() that.currentTkid = tkid that.visitedTkids[tkid] = true if (resetIndex) { that.questionIndex = 0 } else { that.questionIndex = Math.min(that.questionIndex, Math.max(0, that.questions.length - 1)) } that.resetQuestionFields() that.sessionLoading = false done && done(true) }).fail(function () { that.$message && that.$message.error("加载题库请求失败") that.sessionLoading = false done && done(false) }) }, /** 当前题库内已选题目的得分合计(用于分数题库跳题) */ getCurrentBankSelectedScoreTotal: function () { var list = this.questions || [] var map = this.answerScoreMap || {} var total = 0 for (var i = 0; i < list.length; i++) { var tmid = list[i] && list[i].tmid if (tmid == null || tmid === "") { continue } var s = map[tmid] if (s !== null && s !== undefined && !isNaN(Number(s))) { total += Number(s) } } return total }, pickLjfsttMbtkidFromRules: function (rules, totalScore) { var list = (rules || []).filter(function (r) { return r && r.mbtkid != null && String(r.mbtkid).trim() !== "" && r.ljfs != null && String(r.ljfs).trim() !== "" }) list.sort(function (a, b) { return Number(b.ljfs) - Number(a.ljfs) }) var t = Number(totalScore) if (isNaN(t)) { t = 0 } for (var i = 0; i < list.length; i++) { var th = Number(list[i].ljfs) if (isNaN(th)) { continue } if (t >= th) { return String(list[i].mbtkid).trim() } } return "" }, fetchLjfsttRules: function (tkid, callback) { var that = this var key = tkid != null ? String(tkid).trim() : "" if (!key) { callback && callback([]) return } if (this.ljfsttRuleMap[key] !== undefined) { callback && callback(this.ljfsttRuleMap[key]) return } $.get("/www/public/cpgl/cxljfstt", { tkid: key }, function (res) { var ok = res && (res.error === 0 || res.code === 200 || res.code === 0 || res.success === 1) var rows = [] if (ok && res.data != null) { rows = Array.isArray(res.data) ? res.data : [res.data] } that.ljfsttRuleMap[key] = rows callback && callback(rows) }).fail(function () { that.ljfsttRuleMap[key] = [] callback && callback([]) }) }, fetchJumpRule: function (tmid, selectedOptionId) { var that = this return new Promise(function (resolve) { if (!tmid) { resolve("") return } var tmidKey = String(tmid) if (that.jumpRuleMap[tmidKey] !== undefined) { resolve(that.matchJumpRuleTarget(that.jumpRuleMap[tmidKey], selectedOptionId)) return } $.get("/www/public/cpgl/cxtktt", { tmid: tmid }, function (res) { var ok = res && (res.error === 0 || res.code === 200 || res.code === 0 || res.success === 1) if (!ok) { resolve("") return } var rows = Array.isArray(res.data) ? res.data : (res.data ? [res.data] : []) that.jumpRuleMap[tmidKey] = rows resolve(that.matchJumpRuleTarget(rows, selectedOptionId)) }).fail(function () { that.$message && that.$message.error("查询跳题规则失败") resolve("") }) }) }, resetQuestionFields: function () { this.openAnswer = "" this.judgmentValue = "" this.judgmentValues = [] this.scaleValue = 1 this.supplementText = "" this.inlineOpenAnswer = "" this.inlineJudgmentValue = "" this.inlineJudgmentValues = [] this.inlineScaleValue = 1 }, sessionPrimary: function () { if (this.sessionLoading) { console.log("[InterviewDebug] next blocked by loading", { tkid: this.currentTkid, questionIndex: this.questionIndex }) return } var currentQuestion = this.currentQ var inlineShown = this.showInlinePostJump var inlineQuestion = inlineShown ? this.inlinePostJumpQ : null if (this.isMoodDimensionBank) { var moodList = this.bankAllQuestions for (var mi = 0; mi < moodList.length; mi++) { if (this.isQuestionAnswerEmpty(moodList[mi], this.getBankAnswerBag(moodList[mi]))) { if ( moodList[mi].kind === "open" || moodList[mi].kind === "closing" ) { this.$message && this.$message.warning("请填写本题内容") } return } } for (var mj = 0; mj < moodList.length; mj++) { this.cacheAnswerBundleForQuestion(moodList[mj], this.getBankAnswerBag(moodList[mj])) } for (var mk = 0; mk < moodList.length; mk++) { var mq = moodList[mk] var msc = this.answerScoreMap[mq.tmid] if (msc !== null && msc !== undefined && Number(String(msc).trim()) === 999) { this.finishInterview() return } if (mq.kind === "closing") { this.finishInterview() return } } if (moodList.length) { currentQuestion = moodList[moodList.length - 1] } inlineShown = false inlineQuestion = null } else { console.log("[InterviewDebug] next click", { tkid: this.currentTkid, questionIndex: this.questionIndex, currentTmid: currentQuestion && currentQuestion.tmid, currentKind: currentQuestion && currentQuestion.kind, inlineShown: inlineShown, inlineTmid: inlineQuestion && inlineQuestion.tmid }) if (this.isQuestionAnswerEmpty(currentQuestion, this.getCurrentAnswerFieldBag())) { if (currentQuestion.kind === "open" || currentQuestion.kind === "closing") { this.$message && this.$message.warning("请填写本题内容") } return } if (inlineShown && this.isQuestionAnswerEmpty(inlineQuestion, this.getInlineAnswerFieldBag())) { if (inlineQuestion && (inlineQuestion.kind === "open" || inlineQuestion.kind === "closing")) { this.$message && this.$message.warning("请填写本题内容") } return } if (!currentQuestion || !currentQuestion.tmid) { console.log("[InterviewDebug] next blocked: invalid current question") return } this.cacheAnswerBundleForQuestion(currentQuestion, this.getCurrentAnswerFieldBag()) if (inlineShown && inlineQuestion && inlineQuestion.tmid) { this.cacheAnswerBundleForQuestion(inlineQuestion, this.getInlineAnswerFieldBag()) } } console.log("[InterviewDebug] next proceed", { tkid: this.currentTkid, moodBank: this.isMoodDimensionBank, currentTmid: currentQuestion && currentQuestion.tmid }) if (!this.isMoodDimensionBank) { if (currentQuestion.kind === "closing") { this.finishInterview() return } /** 选项分 999:立即结束访谈并提交(不走跳题);与 666 相同,提交后「访谈结果」与 ftjg 按危机计 */ var endByScore = this.answerScoreMap[currentQuestion.tmid] if (endByScore !== null && endByScore !== undefined && Number(String(endByScore).trim()) === 999) { this.finishInterview() return } } var that = this var isLastQuestion = this.isMoodDimensionBank ? true : this.isEffectivelyLastQuestion(inlineShown) var selectedOptionId = this.answerOptionMap[currentQuestion.tmid] || "" var jumpSourceTmid = currentQuestion.rawId || currentQuestion.tmid var currentBankId = this.currentTkid ? String(this.currentTkid) : "" this.sessionLoading = true var seq = Number(this._jumpCheckSeq) if (!isFinite(seq)) { seq = 0 } this._jumpCheckSeq = seq + 1 var reqSeq = this._jumpCheckSeq console.log("[InterviewDebug] jump check start", { reqSeq: reqSeq, latestSeq: this._jumpCheckSeq, questionCount: (this.questions || []).length, isLastQuestion: isLastQuestion, jumpSourceTmid: jumpSourceTmid, selectedOptionId: selectedOptionId }) var scoreJumpTkid = "" if (this.isMoodDimensionBank) { var moodScoreQs = this.bankAllQuestions || [] for (var ms = 0; ms < moodScoreQs.length; ms++) { var msq = moodScoreQs[ms] if ( msq && (msq.kind === "judgment" || msq.kind === "scale") && msq.scorejumpquesno && String(msq.scorejumpquesno) !== "0" ) { scoreJumpTkid = this.resolveScoreJumpTarget(msq) if (scoreJumpTkid) { break } } } } else if (currentQuestion.kind === "judgment" || currentQuestion.kind === "scale") { scoreJumpTkid = this.resolveScoreJumpTarget(currentQuestion) } console.log("[InterviewDebug] score jump result", { reqSeq: reqSeq, scoreJumpTkid: scoreJumpTkid }) var runBankRuleJump = function () { that.fetchJumpRule(jumpSourceTmid, selectedOptionId).then(function (jumpTkid) { var latestSeq = Number(that._jumpCheckSeq) if (isFinite(latestSeq) && reqSeq !== latestSeq) { console.log("[InterviewDebug] jump ignored by stale req", { reqSeq: reqSeq, latest: latestSeq }) return } console.log("[InterviewDebug] bank jump result", { reqSeq: reqSeq, tmid: jumpSourceTmid, jumpTkid: jumpTkid }) if (jumpTkid && currentBankId && String(jumpTkid) === currentBankId) { console.log("[InterviewDebug] bank jump equals current bank, ignore jump", { reqSeq: reqSeq, currentBankId: currentBankId, jumpTkid: jumpTkid }) jumpTkid = "" } if (jumpTkid) { if (that.visitedTkids[jumpTkid]) { that.$message && that.$message.warning("检测到重复跳题,已停止循环跳转") return } that.loadQuestionBank(jumpTkid, true) return } if (!isLastQuestion) { console.log("[InterviewDebug] no jump, move next question", { reqSeq: reqSeq, fromIndex: that.questionIndex, inlineShown: inlineShown }) that.moveToNextQuestionOrFinish(inlineShown) return } console.log("[InterviewDebug] no jump and last question, finish interview", { reqSeq: reqSeq }) that.finishInterview() }).finally(function () { that.sessionLoading = false }) } /** 分数题库跳题(cxljfstt)→ 无则题库跳题(cxtktt);优先级低于题目级分数跳题。满足累计分后须答至本题库最后一题再跳目标库。 */ var runLjfsttThenBankRule = function () { if (!currentBankId) { runBankRuleJump() return } that.fetchLjfsttRules(currentBankId, function (rules) { var latestSeq2 = Number(that._jumpCheckSeq) if (isFinite(latestSeq2) && reqSeq !== latestSeq2) { console.log("[InterviewDebug] ljfstt ignored by stale req", { reqSeq: reqSeq, latest: latestSeq2 }) that.sessionLoading = false return } var totalScore = that.getCurrentBankSelectedScoreTotal() var ljfsttTkid = that.pickLjfsttMbtkidFromRules(rules, totalScore) console.log("[InterviewDebug] ljfstt result", { reqSeq: reqSeq, currentBankId: currentBankId, totalScore: totalScore, ljfsttTkid: ljfsttTkid, ruleCount: (rules && rules.length) || 0 }) if (ljfsttTkid && currentBankId && String(ljfsttTkid) === currentBankId) { console.log("[InterviewDebug] ljfstt equals current bank, fallback to tktt", { reqSeq: reqSeq, ljfsttTkid: ljfsttTkid }) runBankRuleJump() return } // 分数题库跳题:须答完本题库最后一题后再跳转,中途仅满足累计分不直接跳 if (ljfsttTkid && !isLastQuestion) { console.log("[InterviewDebug] ljfstt deferred until last question of bank", { reqSeq: reqSeq, ljfsttTkid: ljfsttTkid, questionIndex: that.questionIndex, bankSize: (that.questions || []).length }) runBankRuleJump() return } if (ljfsttTkid) { if (that.visitedTkids[ljfsttTkid]) { that.$message && that.$message.warning("检测到重复跳题,已停止循环跳转") that.sessionLoading = false if (!isLastQuestion) { that.moveToNextQuestionOrFinish(false) } else { that.finishInterview() } return } that.loadQuestionBank(ljfsttTkid, true, function (ok) { if (!ok) { console.log("[InterviewDebug] ljfstt load failed, fallback to tktt", { reqSeq: reqSeq, ljfsttTkid: ljfsttTkid }) that.sessionLoading = true runBankRuleJump() } }) return } runBankRuleJump() }) } if (scoreJumpTkid) { if (currentBankId && String(scoreJumpTkid) === currentBankId) { console.log("[InterviewDebug] score jump equals current bank, fallback to bank rule", { reqSeq: reqSeq, currentBankId: currentBankId, scoreJumpTkid: scoreJumpTkid }) runLjfsttThenBankRule() return } if (that.visitedTkids[scoreJumpTkid]) { this.sessionLoading = false that.$message && that.$message.warning("检测到重复跳题,已停止循环跳转") if (!isLastQuestion) { that.moveToNextQuestionOrFinish(false) } else { that.finishInterview() } return } that.loadQuestionBank(scoreJumpTkid, true, function (ok) { if (!ok) { console.log("[InterviewDebug] score jump target load failed, fallback bank jump", { reqSeq: reqSeq, scoreJumpTkid: scoreJumpTkid, tmid: jumpSourceTmid }) that.sessionLoading = true runLjfsttThenBankRule() } }) return } runLjfsttThenBankRule() }, finishInterview: function () { if (this.submitLoading) { return } this.cacheCurrentAnswerForSubmit() var that = this var submitWithFullpath = function (fullpath) { var submitParams = that.buildSubmitParams() submitParams.fullpath = fullpath != null && fullpath !== undefined ? String(fullpath) : "" console.log("[InterviewDebug][Submit] params", submitParams) that.$emit("submit-payload-ready", submitParams) $.post("/www/public/st/saveda_ft", submitParams, function (res) { that.submitLoading = false if (res && res.success == 1) { that.$emit("recording-ready", { blob: that.recordingBlob, file: that.recordingFile, mimeType: that.recordingMimeType }) that.$emit("submit-success", res) if (that.$message) { that.$message.success("访谈已完成") } that.interviewResultLevel = that.computeInterviewResultLevelFromAnswers(that.interviewAnswers) that.phase = "done" that.clearDoneReturnTimer() return } if (that.$message) { that.$message.error((res && (res.message || res.msg)) || "提交失败,请稍后再试!") } }).fail(function () { that.submitLoading = false if (that.$message) { that.$message.error("网络连接错误,请检查本机网络!") } }) } this.submitLoading = true var afterRecordingReady = Promise.resolve() if (this.interviewRecordingEnabled) { afterRecordingReady = this.pauseRecordingAndBuildFile() } afterRecordingReady .then(function () { if (!that.interviewRecordingEnabled) { submitWithFullpath("") return } return that.uploadInterviewRecording().then(function (fullpath) { submitWithFullpath(fullpath || "") }) }) .catch(function (errMsg) { that.submitLoading = false if (that.$message) { that.$message.error(errMsg || "录音处理或上传失败,请稍后重试") } }) }, uploadInterviewRecording: function () { var that = this return new Promise(function (resolve, reject) { if (!that.recordingFile) { resolve("") return } var fd = new FormData() fd.append("file", that.recordingFile) fd.append("rel", "r_ft_ftjl") fd.append("attname", "lywj") $.ajax({ url: "/www/public/shouye/ft_lysc_new", type: "POST", data: fd, processData: false, contentType: false, success: function (res) { var ok = res && (res.success === 1 || res.error === 0 || res.code === 0 || res.code === "0" || res.code === 200) if (!ok) { reject((res && (res.message || res.msg)) || "录音文件上传失败") return } var fullpath = "" if (typeof res.data === "string") { fullpath = res.data } else if (res.data && typeof res.data.fullpath === "string") { fullpath = res.data.fullpath } else if (res.data && typeof res.data.path === "string") { fullpath = res.data.path } else if (typeof res.fullpath === "string") { fullpath = res.fullpath } else if (typeof res.path === "string") { fullpath = res.path } resolve(fullpath || "") }, error: function () { reject("录音文件上传请求失败") } }) }) }, encodeAudioBufferToWavBlob: function (audioBuffer) { var numChannels = audioBuffer.numberOfChannels var sampleRate = audioBuffer.sampleRate var bitDepth = 16 var samples = audioBuffer.length var blockAlign = (numChannels * bitDepth) / 8 var byteRate = sampleRate * blockAlign var dataSize = samples * blockAlign var buffer = new ArrayBuffer(44 + dataSize) var view = new DataView(buffer) var writeString = function (offset, str) { for (var i = 0; i < str.length; i++) { view.setUint8(offset + i, str.charCodeAt(i)) } } writeString(0, "RIFF") view.setUint32(4, 36 + dataSize, true) writeString(8, "WAVE") writeString(12, "fmt ") view.setUint32(16, 16, true) view.setUint16(20, 1, true) view.setUint16(22, numChannels, true) view.setUint32(24, sampleRate, true) view.setUint32(28, byteRate, true) view.setUint16(32, blockAlign, true) view.setUint16(34, bitDepth, true) writeString(36, "data") view.setUint32(40, dataSize, true) var offset = 44 var chData = [] var c for (c = 0; c < numChannels; c++) { chData.push(audioBuffer.getChannelData(c)) } var i for (i = 0; i < samples; i++) { for (c = 0; c < numChannels; c++) { var s = Math.max(-1, Math.min(1, chData[c][i])) view.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7fff, true) offset += 2 } } return new Blob([view], { type: "audio/wav" }) }, convertBlobToWavBlob: function (blob) { var that = this if (!blob) { return Promise.reject(new Error("录音数据为空")) } if (blob.type && blob.type.indexOf("wav") > -1) { return Promise.resolve(blob) } if (typeof window === "undefined" || typeof blob.arrayBuffer !== "function") { return Promise.reject(new Error("当前环境无法转换 WAV")) } var AC = window.AudioContext || window.webkitAudioContext if (!AC) { return Promise.reject(new Error("当前浏览器无法解码录音")) } var ctx = null return blob .arrayBuffer() .then(function (buf) { ctx = new AC() return ctx.decodeAudioData(buf) }) .then(function (audioBuffer) { if (ctx) { try { ctx.close() } catch (e) { } } return that.encodeAudioBufferToWavBlob(audioBuffer) }) .catch(function (err) { if (ctx) { try { ctx.close() } catch (e2) { } } return Promise.reject(err) }) }, buildRecordingWavFromChunks: function () { var that = this var chunks = (this._recChunks || []).slice() if (!chunks.length) { this.recordingBlob = null this.recordingFile = null this.recordingMimeType = "" return Promise.resolve() } var captureMime = this.recordingMimeType || "audio/webm" var rawBlob = new Blob(chunks, { type: captureMime }) var chain = rawBlob.type && rawBlob.type.indexOf("wav") > -1 ? Promise.resolve(rawBlob) : this.convertBlobToWavBlob(rawBlob) return chain.then(function (wavBlob) { that.recordingBlob = wavBlob that.recordingMimeType = "audio/wav" that.recordingFile = that.createRecordingFile(wavBlob) }) }, pauseRecordingAndBuildFile: function () { var that = this var recorder = this._recorder if (!recorder) { return Promise.resolve() } if (recorder.state === "recording") { try { recorder.pause() if (recorder.requestData) { recorder.requestData() } } catch (e) { } } this.recordingActive = false this.clearRecTimer() return this.buildRecordingWavFromChunks().then(function () { that.releaseRecordingResources() }) }, clearMicCheckSecTimer: function () { if (this._micCheckSecTimer) { clearInterval(this._micCheckSecTimer) this._micCheckSecTimer = null } }, resetMicCheckBarLevelsIdle: function () { var a = [] for (var i = 0; i < 16; i++) { a.push(12) } this.micCheckBarLevels = a }, stopMicCheckVisualizer: function () { if (this._micCheckRaf != null) { try { cancelAnimationFrame(this._micCheckRaf) } catch (e) { } this._micCheckRaf = null } this._micCheckAnalyser = null if (this._micCheckAudioCtx) { try { this._micCheckAudioCtx.close() } catch (e) { } this._micCheckAudioCtx = null } this.resetMicCheckBarLevelsIdle() }, startMicCheckVisualizer: function () { var that = this this.stopMicCheckVisualizer() if (!this._micCheckStream) { return } try { var AC = typeof window !== "undefined" && (window.AudioContext || window.webkitAudioContext) if (!AC) { return } var ctx = new AC() this._micCheckAudioCtx = ctx var source = ctx.createMediaStreamSource(this._micCheckStream) var analyser = ctx.createAnalyser() analyser.fftSize = 128 analyser.smoothingTimeConstant = 0.65 source.connect(analyser) this._micCheckAnalyser = analyser var buf = new Uint8Array(analyser.frequencyBinCount) var nBars = 16 var step = Math.max(1, Math.floor(buf.length / nBars)) var loop = function () { if (!that._micCheckAnalyser || !that.micCheckActive) { return } analyser.getByteFrequencyData(buf) var levels = [] for (var i = 0; i < nBars; i++) { var sum = 0 for (var j = 0; j < step; j++) { sum += buf[Math.min(i * step + j, buf.length - 1)] } var v = sum / step / 255 levels.push(Math.max(10, Math.min(100, 12 + v * 88))) } that.micCheckBarLevels = levels that._micCheckRaf = requestAnimationFrame(loop) } this._micCheckRaf = requestAnimationFrame(loop) } catch (e) { this.resetMicCheckBarLevelsIdle() } }, releaseMicCheckResources: function () { this.clearMicCheckSecTimer() this.stopMicCheckVisualizer() var rec = this._micCheckRecorder if (rec && (rec.state === "recording" || rec.state === "paused")) { try { rec.stop() } catch (e) { } } else { if (this._micCheckStream) { try { this._micCheckStream.getTracks().forEach(function (t) { t.stop() }) } catch (e) { } this._micCheckStream = null } this._micCheckRecorder = null this._micCheckChunks = [] } this.micCheckActive = false this.micCheckLoading = false this.micCheckSeconds = 0 this._micCheckRecordStartMs = 0 }, revokeMicCheckPlayback: function () { this.stopMicCheckPlayback() if (this.micCheckPlaybackUrl) { try { URL.revokeObjectURL(this.micCheckPlaybackUrl) } catch (e) { } this.micCheckPlaybackUrl = "" } this.micCheckBlob = null this.micCheckPlaybackDurationSec = 0 this.micCheckPlaybackCurrentSec = 0 this.micCheckPlaybackPlaying = false this._micCheckRecordStartMs = 0 }, /** 与正式访谈录音时长同款:整数秒,向下取整,mm:ss */ formatRecordingClock: function (seconds) { var s = Math.max(0, Math.floor(Number(seconds) || 0)) var m = Math.floor(s / 60) var r = s % 60 return (m < 10 ? "0" : "") + m + ":" + (r < 10 ? "0" : "") + r }, formatMediaTime: function (seconds) { return this.formatRecordingClock(seconds) }, /** 准备麦克风(loading):停表、停波形,试录时长保持 00:00 */ beginMicCheckPrepare: function () { this.micCheckLoading = true this.micCheckActive = false this.clearMicCheckSecTimer() this.stopMicCheckVisualizer() this.micCheckSeconds = 0 this._micCheckRecordStartMs = 0 }, /** 与正式访谈 recordingSeconds 一致:rec.start 成功后每秒 +1 */ beginMicCheckRecording: function () { this.micCheckActive = true this.micCheckLoading = false this.micCheckSeconds = 0 this.clearMicCheckSecTimer() var that = this this._micCheckSecTimer = setInterval(function () { if (!that.micCheckActive || that.micCheckLoading) { return } that.micCheckSeconds += 1 }, 1000) }, applyMicCheckPlaybackBlob: function (blob, durationMs) { var that = this var done = function (fixedBlob) { if (that.micCheckPlaybackUrl) { try { URL.revokeObjectURL(that.micCheckPlaybackUrl) } catch (e) { } } that.micCheckPlaybackUrl = URL.createObjectURL(fixedBlob) that.micCheckRecordedOnce = true that.$nextTick(function () { var el = that.$refs.micCheckPlaybackAudio if (el && typeof el.load === "function") { try { el.load() } catch (e2) { } } that.refineMicCheckPlaybackDuration(fixedBlob) }) } if (typeof window !== "undefined" && typeof window.ysFixWebmDuration === "function") { window.ysFixWebmDuration(blob, durationMs, done) return } done(blob) }, refineMicCheckPlaybackDuration: function (blob) { var that = this if (!blob || typeof window === "undefined") { return } var AC = window.AudioContext || window.webkitAudioContext if (!AC) { return } var ctx = null try { ctx = new AC() } catch (e) { return } var closeCtx = function () { if (!ctx) { return } try { ctx.close() } catch (e2) { } ctx = null } if (typeof blob.arrayBuffer !== "function") { closeCtx() return } blob.arrayBuffer().then(function (buf) { return ctx.decodeAudioData(buf) }).then(function (audioBuffer) { if ( !that.micCheckPlaybackDurationSec && audioBuffer && audioBuffer.duration && isFinite(audioBuffer.duration) && audioBuffer.duration > 0 ) { that.micCheckPlaybackDurationSec = Math.floor(audioBuffer.duration) } closeCtx() }).catch(function () { closeCtx() }) }, syncMicCheckPlaybackDuration: function () { var el = this.$refs.micCheckPlaybackAudio if (!el) { return } if (this.micCheckPlaybackDurationSec > 0) { return } var d = el.duration if (d && isFinite(d) && d > 0) { this.micCheckPlaybackDurationSec = Math.floor(d) } }, stopMicCheckPlayback: function () { var el = this.$refs.micCheckPlaybackAudio if (el && !el.paused) { try { el.pause() } catch (e) { } } this.micCheckPlaybackPlaying = false }, toggleMicCheckPlayback: function () { var that = this var el = this.$refs.micCheckPlaybackAudio if (!el || !this.micCheckPlaybackUrl) { return } if (this.micCheckPlaybackPlaying) { try { el.pause() } catch (e) { } } else { var playPromise = el.play() if (playPromise && typeof playPromise.then === "function") { playPromise.catch(function () { that.micCheckPlaybackPlaying = false if (that.$message) { that.$message.error("无法播放,请重试") } }) } } }, onMicCheckPlaybackPlay: function () { this.micCheckPlaybackPlaying = true }, onMicCheckPlaybackPause: function () { this.micCheckPlaybackPlaying = false }, onMicCheckPlaybackSeekClick: function (e) { var el = this.$refs.micCheckPlaybackAudio if (!el || !this.micCheckPlaybackDurationSec) { return } var track = e.currentTarget var rect = track.getBoundingClientRect() var w = rect.width if (!w) { return } var x = e.clientX - rect.left var p = Math.min(1, Math.max(0, x / w)) try { el.currentTime = p * this.micCheckPlaybackDurationSec } catch (err) { } }, onMicCheckPlaybackTimeupdate: function () { var el = this.$refs.micCheckPlaybackAudio if (!el) { return } this.micCheckPlaybackCurrentSec = el.currentTime || 0 }, onMicCheckPlaybackEnded: function () { this.micCheckPlaybackPlaying = false this.micCheckPlaybackCurrentSec = 0 var el = this.$refs.micCheckPlaybackAudio if (el) { try { el.currentTime = 0 } catch (e) { } } }, ensureMicCheckRecorder: function () { var that = this return new Promise(function (resolve, reject) { if (typeof navigator === "undefined" || !navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) { reject(new Error("当前环境不支持录音")) return } if (typeof MediaRecorder === "undefined") { reject(new Error("浏览器不支持录音")) return } navigator.mediaDevices.getUserMedia({ audio: true }).then(function (stream) { that._micCheckStream = stream that._micCheckChunks = [] var mimeType = that.getRecorderMimeType() if (!mimeType) { try { stream.getTracks().forEach(function (track) { track.stop() }) } catch (e) { } that._micCheckStream = null reject(new Error("当前浏览器不支持录音,请更换浏览器后重试")) return } var recorder = new MediaRecorder(stream, { mimeType: mimeType }) that.micCheckMimeType = mimeType recorder.ondataavailable = function (evt) { if (evt && evt.data && evt.data.size > 0) { that._micCheckChunks.push(evt.data) } } recorder.onstop = function () { var durationSec = Math.max(0, Math.floor(that.micCheckSeconds || 0)) var durationMs = durationSec * 1000 that.clearMicCheckSecTimer() that.stopMicCheckVisualizer() that._micCheckRecordStartMs = 0 that.micCheckActive = false that.micCheckSeconds = durationSec var chunks = that._micCheckChunks || [] if (chunks.length) { var blob = new Blob(chunks, { type: that.micCheckMimeType || "audio/webm" }) that.micCheckBlob = blob that.micCheckPlaybackDurationSec = durationSec > 0 ? durationSec : 0 that.micCheckPlaybackCurrentSec = 0 that.micCheckPlaybackPlaying = false that.applyMicCheckPlaybackBlob(blob, durationMs) } else { that.micCheckRecordedOnce = false that.micCheckPlaybackDurationSec = 0 that.micCheckPlaybackCurrentSec = 0 } if (that._micCheckStream) { try { that._micCheckStream.getTracks().forEach(function (t) { t.stop() }) } catch (e) { } that._micCheckStream = null } that._micCheckRecorder = null that._micCheckChunks = [] } that._micCheckRecorder = recorder resolve(recorder) }).catch(function (err) { reject(err || new Error("无法访问麦克风")) }) }) }, toggleMicCheckRecording: function () { var that = this if (this.micCheckLoading) { return } if (this._micCheckRecorder && this._micCheckRecorder.state === "recording") { this.clearMicCheckSecTimer() this.stopMicCheckVisualizer() try { if (this._micCheckRecorder.requestData) { this._micCheckRecorder.requestData() } } catch (e) { } try { this._micCheckRecorder.stop() } catch (e) { } return } this.beginMicCheckPrepare() this.ensureMicCheckRecorder().then(function (rec) { if (rec.state !== "inactive") { that.micCheckLoading = false return } that._micCheckChunks = [] that.micCheckSeconds = 0 if (that.micCheckPlaybackUrl) { try { URL.revokeObjectURL(that.micCheckPlaybackUrl) } catch (e) { } that.micCheckPlaybackUrl = "" } that.micCheckBlob = null that.micCheckRecordedOnce = false that.micCheckPlaybackDurationSec = 0 that.micCheckPlaybackCurrentSec = 0 that.stopMicCheckPlayback() try { /* 分片写入便于浏览器解析时长;总时长以录音起止时间为准立即展示 */ rec.start(1000) } catch (e) { if (that.$message) { that.$message.error("无法开始试录") } that.releaseMicCheckResources() return } that.startMicCheckVisualizer() that.beginMicCheckRecording() }).catch(function (err) { that.micCheckLoading = false that.micCheckActive = false that.clearMicCheckSecTimer() that.micCheckSeconds = 0 that._micCheckRecordStartMs = 0 if (that.$message) { that.$message.error("无法访问麦克风,请检查权限设置") } }) }, resetMicCheckRecording: function () { if (this.micCheckLoading) { return } this.micCheckRecordedOnce = false this.releaseMicCheckResources() this.revokeMicCheckPlayback() }, getRecorderMimeType: function () { if (typeof MediaRecorder === "undefined" || !MediaRecorder.isTypeSupported) { return "" } if (MediaRecorder.isTypeSupported("audio/wav")) { return "audio/wav" } if (MediaRecorder.isTypeSupported("audio/webm;codecs=opus")) { return "audio/webm;codecs=opus" } if (MediaRecorder.isTypeSupported("audio/webm")) { return "audio/webm" } if (MediaRecorder.isTypeSupported("audio/mp4")) { return "audio/mp4" } return "" }, createRecordingFile: function (blob) { var ext = "wav" if (blob.type && blob.type.indexOf("wav") > -1) { ext = "wav" } else if (blob.type && blob.type.indexOf("webm") > -1) { ext = "webm" } else if (blob.type && blob.type.indexOf("mp4") > -1) { ext = "mp4" } var now = new Date() var pad = function (n) { return n < 10 ? "0" + n : "" + n } var fileName = "interview-" + now.getFullYear() + pad(now.getMonth() + 1) + pad(now.getDate()) + "-" + pad(now.getHours()) + pad(now.getMinutes()) + pad(now.getSeconds()) + "." + ext return new File([blob], fileName, { type: blob.type || "audio/wav" }) }, ensureRecorderReady: function () { var that = this return new Promise(function (resolve, reject) { if (typeof navigator === "undefined" || !navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) { reject(new Error("当前环境不支持录音")) return } if (typeof MediaRecorder === "undefined") { reject(new Error("浏览器不支持录音")) return } if (that._recorder && that._recorder.state !== "inactive") { resolve(that._recorder) return } navigator.mediaDevices.getUserMedia({ audio: true }).then(function (stream) { that._recStream = stream that._recChunks = [] that.recordingBlob = null that.recordingFile = null var mimeType = that.getRecorderMimeType() if (!mimeType) { try { stream.getTracks().forEach(function (track) { track.stop() }) } catch (e) { } reject(new Error("当前浏览器不支持录音,请更换浏览器后重试")) return } var recorder = new MediaRecorder(stream, { mimeType: mimeType }) that.recordingMimeType = mimeType recorder.ondataavailable = function (evt) { if (evt && evt.data && evt.data.size > 0) { that._recChunks.push(evt.data) } } recorder.onstop = function () { that.recordingActive = false that.clearRecTimer() that.buildRecordingWavFromChunks().then(function () { that.releaseRecordingResources() }) } that._recorder = recorder resolve(recorder) }).catch(function (err) { reject(err) }) }) }, toggleRecording: function () { var that = this this.ensureRecorderReady().then(function (recorder) { if (recorder.state === "recording") { recorder.pause() that.recordingActive = false that.clearRecTimer() return } if (recorder.state === "paused") { recorder.resume() } else { that.recordingSeconds = 0 recorder.start(1000) } that.recordingActive = true that.clearRecTimer() that._recTimer = setInterval(function () { that.recordingSeconds += 1 }, 1000) }).catch(function (err) { that.$message && that.$message.error("无法开始录音,请检查麦克风权限") }) }, stopRecording: function () { if (this.$message) { this.$message.warning("录音会在访谈结束后自动暂停并生成文件") } }, releaseRecordingResources: function () { if (this._recStream && this._recStream.getTracks) { this._recStream.getTracks().forEach(function (t) { t.stop() }) } this._recStream = null this._recorder = null this._recChunks = [] } } }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDjddcBJ-view", function(resolve, reject){ var template = ""; return ( function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), pageName:'', totalJindu:{}, xxss:'', xxxd:'', gzzjd:{}, xxxxjd:{}, gzzss:'', dialogVisible: false, tableData1: [], tableData2: [], tableData3:[], curData:{}, multipleSelection: [], currentPage1: 5, xxjd:'', currentPage2: 5, currentPage3: 5, currentPage4: 4, sfwcFilter: '', // 是否完成作答筛选 tableData3Backup: [], // 备份原始数据用于筛选 innerVisible:false, sfxzdw:'1', activeName: 'first', status:'', paramspath:[], Roles:[], pages:{ pageNo:1, pageSize:5 }, total:0, ruleForm: { }, type:'',//1测评,2访谈 isEdit:false, stuortea:'1', stuList: [] } }, methods:{ wancheng(row,type){ const that = this console.log(row) if (row.xm.includes("备用")) { if(type==1){ this.$prompt('请输入原因', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', }).then(({ value }) => { if(!value) return that.$message.error('请完成/未完成输入原因') let data = { lsid:row.id, sfwc:'1', reason:value, } $.post("/www/public/jingdu/updatewcztandyy", data, function(res){ if(res.error==0){ that.$message.success(res.message) that.getList() }else{ that.$message.error(res.message) } }) }).catch(() => { }); }else{ let data = { lsid:row.id, sfwc:'2', } $.post("/www/public/jingdu/updatewcztandyy", data, function(res){ if(res.error==0){ that.$message.success(res.message) that.getList() }else{ that.$message.error(res.message) } }) } } else { if(type==1){ let data = { lsid:row.id, sfwc:type, //reason:value, } $.post("/www/public/jingdu/updatewcztandyy", data, function(res){ if(res.error==0){ that.$message.success(res.message) that.getList() }else{ that.$message.error(res.message) } }) }else{ this.$prompt('请输入原因', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', }).then(({ value }) => { if(!value) return that.$message.error('请完成/未完成输入原因') let data = { lsid:row.id, sfwc:type, reason:value, } $.post("/www/public/jingdu/updatewcztandyy", data, function(res){ if(res.error==0){ that.$message.success(res.message) that.getList() }else{ that.$message.error(res.message) } }) }).catch(() => { }); } } }, xswancheng(row,type){ const that = this console.log(row) if(row['cpzrs']==row['cprs']&&type==1){ let data = { bjid:row.bjid, sfwc:type, } $.post("/www/public/selectschool/cpjd-cz", data, function(res){ if(res.error==0){ that.$message.success(res.data) that.getList() }else{ that.$message.error(res.data) } }) }else if(type==1){ this.$prompt('请补充实测人数不等于应测人数的原因', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', }).then(({ value }) => { if(!value) return that.$message.error('请完成/未完成输入原因') let data = { bjid:row.bjid, sfwc:type, reason:value } $.post("/www/public/selectschool/cpjd-cz", data, function(res){ if(res.error==0){ that.$message.success(res.data) that.getList() }else{ that.$message.error(res.data) } }) }).catch(() => { }); }else { this.$prompt('请输入原因', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', }).then(({ value }) => { if(!value) return that.$message.error('请完成/未完成输入原因') let data = { bjid:row.bjid, sfwc:type, reason:value } $.post("/www/public/selectschool/cpjd-cz", data, function(res){ if(res.error==0){ that.$message.success(res.data) that.getList() }else{ that.$message.error(res.data) } }) }).catch(() => { }); } }, getXSDetail(row){ var that = this const params = { bjid: row.bjid } $.get("/www/public/shimingimport/findbjxs", params, function(res){ if(res.success==1){ const xbMap = new Map([['1', '男'], ['2', '女']]) const sfwczdMap = new Map([['0', '未完成'], ['1', '已完成']]) that.stuList = res.data.length ? res.data.map(s => ({ ...s, sfwczd: sfwczdMap.get(s.sfwczd) })) : [] }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) }, xschakan(row) { console.log(row) this.getXSDetail(row) this.$refs.jsxxxxjxgshenhe.show() }, duban(row,type){ var that = this data = { xxid:row.id, type } url = "/www/public/shangbao/dbcpxx" $.get(url, data, function(res){ if(res.success==1){ that.$message.success('已发送短信督办') }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message('请求错误') }) }, downloads0(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var name = '全校未测学生.xls' var url = '/www/public/selectschool/cpjdwwc-dc' const params = { userid:user.ID, } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, downloads2(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var name = '全校已测学生.xls' var url = '/www/public/selectschool/cpjdwc-dc' const params = { userid:user.ID, } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, downloads11(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var name = '教师测评进度.xls' var url = '/www/public/jingdu/lslistbyls_export' if(user.Roles.includes('410')){ url = '/www/public/jingdu/lslistbyls_export_sc' } const params = { userid:user.ID, roles:user.Roles[0], username:user.Username, typec } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, downloads1(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var name = '学生测评进度.xls' var url = '/www/public/jingdu/findzdlvdc' if(user.Roles.includes('220')){ typec='1' }else if(user.Roles.includes('310')){ typec='2' }else if(user.Roles.includes('410')){ url = '/www/public/jingdu/findzdlvdc_sc' typec='2' }else if(user.Roles.includes('450')){ typec='4' url = '/www/public/selectschool/cpjd-dc' } const params = { userid:user.ID, roles:user.Roles[0], username:user.Username, typec } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, downloads(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var name = '测评进度.xls' if(user.Roles.includes('220')){ typec='1' }else if(user.Roles.includes('310')||user.Roles.includes('410')){ typec='2' }else if(user.Roles.includes('450')){ typec='4' } const params = { userid:user.ID, roles:user.Roles[0], username:user.Username, typec } axios({ method: 'get', url: '/www/public/selectschool/cpjd-dc', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, download(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var sfxzdw= '' var name = '' if(that.activeName=='first'&&that.sfxzdw=='1'){ sfxzdw=that.sfxzdw name= '市教育局工作组上报进度.xls' }else if(that.activeName=='first'&&that.sfxzdw=='3'){ sfxzdw=that.sfxzdw name= '区县教育局工作组上报进度.xls' }else if(that.activeName=='first'&&that.sfxzdw=='2'){ sfxzdw=that.sfxzdw name= '学校工作组上报进度.xls' }else if(that.activeName=='second'){ sfxzdw='4' name= '学校信息上报进度.xls' } const params = { userid:user.ID, roles:user.Roles[0], sfxzdw, xxxd:this.xxxd } axios({ method: 'get', url: '/www/public/shangbao/sb-gzzsbjd-dc', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, getDetail(row){ this.curData = {...row} this.$refs.XDgongzuozuDetail.show() }, tabchange(){ console.log(this.activeName) this.getList() }, handleback(){ var len = this.paramspath.length if(len>1){ this.paramspath.pop() this.getList(this.paramspath[len-1]) }else{ return } }, handleRowClick(row){ console.log(row,'row') var len = this.paramspath.length this.getList({typec:Number(this.paramspath[len-1].typec)+1+'',username:row.username}) }, handleClick(tab, event) { console.log(tab, event); }, onError(){}, show(type){ this.type = type this.getList() this.$refs.baseDialog.show() }, getTotalcpjd(username,typec){ var that = this const data = { username, typec, } url = "/www/public/selectschool/cpjd-zt" $.get(url, data, function(res){ if(res.success==1){ if(res.data&&res.data.length){ that.totalJindu = res.data[0] } }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ }) }, getList(param){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var data = {} if(that.activeName =='third'){ var url = "/www/public/jingdu/findzdlv" if(user.Roles.includes('220')){ typec='1' }else if(user.Roles.includes('310')){ typec='2' }else if(user.Roles.includes('410')){ url = "/www/public/jingdu/findzdlv_sc" typec='4' }else if(user.Roles.includes('450')){ url = "/www/public/selectschool/cpjd" typec='4' }else if(user.Roles.includes('410')){ url = "/www/public/selectschool/cpjd-ssd-2026" typec='4' } data = { username:user.Username, typec, } $.get(url, data, function(res){ if(res.success==1){ if(user.Roles.includes('450')){ that.tableData3 = res.data.filter(item=>item.xxmc.includes(that.xxss)) }else{ that.tableData3 = res.data } that.tableData3Backup = [...that.tableData3] // 备份当前显示的数据 }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{}) if(user.Roles.includes('450')){ // that.getTotaljd() }else{ // that.getTotalcpjd(user.Username,typec) } }else if(that.activeName =='third-fiveth'){ /* var url = "/www/public/jingdu/lslist" data = { } $.get(url, data, function(res){ if(res.success==1){ that.tableData3 = res.data that.tableData3Backup = [...res.data] // 备份原始数据 }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{}) that.getTotaljd() */ var url = "/www/public/jingdu/findzdlv" if(user.Roles.includes('220')){ url = "/www/public/jingdu/findzdlv" typec='1' }else if(user.Roles.includes('310')){ url = "/www/public/jingdu/findzdlv" typec='2' }else if(user.Roles.includes('410')){ url = "/www/public/jingdu/findzdlv_sc" typec='4' }else if(user.Roles.includes('450')){ if(this.status==1){ url = "/www/public/jingdu/lslistbyls202604bj" typec='4' }else{ url = "/www/public/jingdu/lslistbyxxfzr" typec='4' } } data = { schoolid:user.ID } $.get(url, data, function(res){ if(res.success==1){ that.tableData3 = res.data that.tableData3Backup = [...res.data] // 备份原始数据用于筛选 }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{}) if(user.Roles.includes('450')){ // that.getTotaljd() }else{ // that.getTotalcpjd(user.Username,typec) } }else{ data = { userid:user.ID, roles:user.Roles[0], gzzss:that.gzzss, xxss:that.xxss, sfxzdw:!that.Roles.includes('410')?that.sfxzdw:'2', xxxd:this.xxxd } url = "/www/public/shangbao/sb-gzzsbjd" $.post(url, data, function(res){ if(res.success==1){ that.tableData1 = res.data.gzz that.tableData2 = res.data.sclxx that.gzzjd = res.data.gzzjd that.xxxxjd = res.data.xxxxjd }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) } }, getTotaljd(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let data = { xxid:user.ID } $.get('/www/public/jingdu/findxxjdbyid', data, function(res){ if(res.success==1){ that.totalJindu = res.data?res.data:{} }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, handleConfirm(){ this.$refs.baseDialog.close() }, // 筛选表格数据 filterTableData() { if (this.activeName == 'third-fiveth') { if (this.sfwcFilter) { // 使用备份数据进行筛选 this.tableData3 = this.tableData3Backup.filter(item => { const answerStatus = item['学校负责人作答数']; if (this.sfwcFilter == '已完成') { return answerStatus == '已完成' } else if (this.sfwcFilter == '未完成') { return answerStatus == '未完成' || answerStatus == null } return true }) } else { // 如果没有筛选条件,显示全部数据 this.tableData3 = [...this.tableData3Backup] } } }, handleClick(){}, handleClose(){ this.dialogVisible = false }, toggleSelection(rows) { if (rows) { rows.forEach(row => { this.$refs.multipleTable.toggleRowSelection(row); }); } else { this.$refs.multipleTable.clearSelection(); } }, handleSelectionChange(val) { this.multipleSelection = val; } }, computed:{ isZXS(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var userName = user.Username var quyubianma = userName.substring(3) console.log(quyubianma,'quyubianma') return ['110000','120000','310000','500000'].includes(quyubianma) } }, watch:{ activeName(val){ this.paramspath = [] } }, created: function(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.Roles = user.Roles var type = this.$route.query.type this.status= this.$route.query.status this.xxjd = localStorage.getItem('xxjd') this.activeName = type if(this.Roles.includes('220')){ if(this.isZXS){ this.sfxzdw = '3' } }else if(this.Roles.includes('310')){ this.sfxzdw = '3' }else if(this.Roles.includes('410')){ this.sfxzdw = '2' } if(this.activeName=='first'){ this.pageName = '工作组信息上报进度' }else if(this.activeName=='second'){ this.pageName = '学校信息上报进度' } else if(this.activeName=='third'){ this.pageName = '测评进度' if(this.Roles.includes('450')){ this.pageName = '学生测评进度' } } else if(this.activeName=='fourth'){ this.pageName = '样本校测试安排表' } else if(this.activeName=='fiveth'){ this.pageName = '文件上传进度' }else if(this.activeName == 'third-fiveth') this.pageName = '老师测评进度' this.getList() }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-ckccbjmdBJ-view", function(resolve, reject){ var template = ""; return ( function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { bjList: [], // 班级数据 currentPage: 1, // 当前页码 pageSize: 10, // 每页条数 total: 0, // 总条数 xxjd:'' }; }, methods: { fetchBjList() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; let params = { xxid: user.ID, pageNo: this.currentPage, pageSize: this.pageSize }; // 调用查询接口 $.get("/www/public/shangbao/exportbj_bj_test", params, function(res) { if (res.error == 0) { that.bjList = res.data; that.total = res.total; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleSizeChange(size) { this.pageSize = size; this.currentPage = 1; this.fetchBjList(); }, // 改变当前页 handleCurrentChange(page) { this.currentPage = page; this.fetchBjList(); } }, created: function() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; that.xxjd=JSON.parse(localStorage.getItem('xxjd')) let params = { userid: user.ID, }; // 调用查询接口 $.post("/www/public/bd/sfckcybjedit", params, function(res) { if (res.error == 0) { } else { } }) that.fetchBjList(); } }); }); })(template, resolve, reject); }); RegVueCom("xljk-XDzlxz01BJSC-view", function(resolve, reject){ var template = ""; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), uploading:false, percentage:0, showpercent:false, customColor: '#409eff', currentId:'', loading:false, pages:{ pageSize:10, pageNo:1 }, List:[], typeMap:["/jpglogo.png","/yasuologo.png","/mp4logo.png","/wordlogo.png","/excellogo.png","/pdflogo.png"], menuDocList: [], menuDocLcid: '', videoList:[], videoDialogVisible:false, currentVideoUrl:'', total:0, constants: {}, studentTestLinks: [], }; }, methods: { handleVideoClose(){ try{ const v = this.$refs.videoPlayer if(v && typeof v.pause === 'function'){ v.pause() } }catch(e){} this.currentVideoUrl = '' }, handleVideoClosed(){ try{ const v = this.$refs.videoPlayer if(v){ v.removeAttribute('src') v.load() } }catch(e){} }, copyLink(url){ const text = String(url || ''); const done = ()=> this.$message && this.$message.success('链接已复制'); try{ if(navigator.clipboard && window.isSecureContext){ navigator.clipboard.writeText(text).then(done).catch(()=> this.fallbackCopyText(text)); }else{ this.fallbackCopyText(text); } }catch(e){ this.fallbackCopyText(text); } }, fallbackCopyText(text){ try{ const ta = document.createElement('textarea'); ta.value = text; ta.setAttribute('readonly',''); ta.style.position = 'fixed'; ta.style.top = '-1000px'; document.body.appendChild(ta); ta.select(); const ok = document.execCommand('copy'); document.body.removeChild(ta); if(ok){ this.$message && this.$message.success('链接已复制'); }else{ this.$message && this.$message.error('复制失败,请手动复制'); } }catch(e){ this.$message && this.$message.error('复制失败,请手动复制'); } }, handlebeforeClose(){ this.$emit('closeDialog') }, show(){ console.log(this.$refs.baseDialoggzz0,'baseDialoggzz0') this.$refs.baseDialoggzz0.show() }, handleConfirm(){ this.$refs.baseDialogjs.close() }, /* // customUpload(params,item) { var that = this that.loading = true var xxjd = localStorage.getItem('xxjd') //1小学 2初中 3高中 4中职 5高职 7本科 8硕士 9博士 var importType if(['1','2','3'].indexOf(xxjd)!=-1){ importType = '1' }else{ importType = '2' } // params是一个对象,包含了file和fileList, // 但是这个params参数可能每个版本不一样值就不一样,到时候自己打印看看, // 反正file的值就是原始的File对象 const formData = new FormData() console.log(params.file,'params.file') formData.append('file', params.file) // 这是file入参,文件信息 // 如果extraParams是个对象,循环加入formData for (const key in this.extraParams) { formData.append(key, this.extraParams[key]) } // 如果extraParams是个单独的值,直接加入 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var roles=user.UserFilter.urole // 调接口 axios.post(`/www/public/shangbao/addfiletemprecord?filetempid=${item.id}`, formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ that.$message.success(data.message) that.loading = false that.fetchMenuDocuments() }else{ that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false that.$message.error('文件上传异常!') console.error(error); }); }, */ getMd5(file) { return new Promise((resolve) => { // 对文件对象的处理 const spark = new SparkMD5.ArrayBuffer()// md5的ArrayBuffer加密类 var fileReader = new FileReader(); fileReader.readAsArrayBuffer(file); // fileReader.onload为异步函数,要放到Promise对象中,等待状态的变更后再返回生成的md5值 fileReader.onload = function (e) { spark.append(e.target.result); resolve(spark.end()); }; }); }, async uploadFile(params,item){ if(this.loading){ return this.$message.error('有文件正在上传,请稍后再试!') } var that = this that.currentId = item.id that.loading = true that.percentage = 0 var xxjd = localStorage.getItem('xxjd') //1小学 2初中 3高中 4中职 5高职 7本科 8硕士 9博士 var importType if(['1','2','3'].indexOf(xxjd)!=-1){ importType = '1' }else{ importType = '2' } var successhh = 0 that.loading = true const file = params.file console.log(file,'file') const fileReader = new FileReader()// 文件读取 console.log(file) const chunkSize = 1024 * 1024 * 6 let fileChunkedList = [] // 文件分片完成之后的数组 const name=file.name let md5 = await that.getMd5(file) // 文件开始分片,push到fileChunkedList数组中, 并用第一个分片去计算文件的md5 for (let i = 0; i < file.size; i = i + chunkSize) { const tmp = file.slice(i, Math.min((i + chunkSize), file.size)) if (i === 0) { fileReader.readAsArrayBuffer(tmp) } fileChunkedList.push(tmp) } console.log(fileChunkedList,'数组') const chunks=fileChunkedList.length that.showpercent = true for (let i = 1; i <= fileChunkedList.length; i =i+1) { const formData = new FormData() formData.append('imgFile', fileChunkedList[i-1],file.name) formData.append('chunk', i) formData.append('old', that.old) formData.append('size', file.size) formData.append('name', name) formData.append('md5', md5) for (var value of formData.values()) { console.log(value); } try { const result = await that.uploads(formData,item.id) console.log(result,'result') if(result){ if(result.status==200){ if(result.data){ //console.log(result.data,'result.data') const data = result.data that.old = data.data if(data.success==1){ successhh += 1 that.percentage = ((successhh/fileChunkedList.length)*100).toFixed(0) console.log(that.percentage,' that.percentage') if(data.message=="上传成功"&&successhh{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, XXexportFn(activeName){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { schoolid, } var url var name if(activeName=='first'){ url = "/www/public/shangbao/exportStudent" name = '学生账号.xls' }else if(activeName == 'second'){ url = "/www/public/shangbao/exportteather" name = '教师账号.xls' }else{ url = "/www/public/shouye/px_webftybm_dcbxftyzh" name = '访谈员账号.xls' } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, DexportFn(){ var that = this var name //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var username = user.Username var bm = username.substring(3) let type if(user.Roles.includes('220')){ type='1' name = '市级管理员账号信息.xls' if(['110000','120000','310000','500000'].includes(bm)){ type='1' name = '区县管理员账号信息.xls' } }else if(user.Roles.includes('310')){ type='2' name = '区县管理员账号信息.xls' } const params = { username:user.Username, type, state:'1' } axios({ method: 'get', url: '/www/public/shangbao/dcsqxzh', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, exportFn(){ var that = this //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let type if(user.Roles.includes('220')){ type='1' }else if(user.Roles.includes('310')){ type='2' } const params = { username:user.Username, type, state:'1', } axios({ method: 'get', url: '/www/public/shangbao/exportzgxxx', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', '直管校管理员账号.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, delfn(item){ var that = this const params = { id:item.recordId, tempid:item.filetempid } $.post("/www/public/shangbao/deletefilerecord", params, function(res){ if(res.error==0){ that.$message.success('删除成功') that.fetchMenuDocuments() }else{ that.$message.error(res.message) } }).fail((err)=>{ that.loading = false that.$message({ type: "error", message: '请求错误' }) }) }, yulan(item){ window.open('/core/UForm/fileviewer/r_temp_file_record?ff=id&fv='+item.recordId,'_blank') }, onError(){}, // customUpload(params,item) { var that = this that.loading = true var xxjd = localStorage.getItem('xxjd') //1小学 2初中 3高中 4中职 5高职 7本科 8硕士 9博士 var importType if(['1','2','3'].indexOf(xxjd)!=-1){ importType = '1' }else{ importType = '2' } // params是一个对象,包含了file和fileList, // 但是这个params参数可能每个版本不一样值就不一样,到时候自己打印看看, // 反正file的值就是原始的File对象 const formData = new FormData() console.log(params.file,'params.file') formData.append('file', params.file) // 这是file入参,文件信息 // 如果extraParams是个对象,循环加入formData for (const key in this.extraParams) { formData.append(key, this.extraParams[key]) } // 如果extraParams是个单独的值,直接加入 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var roles=user.UserFilter.urole // 调接口 axios.post(`/www/public/shangbao/addfiletemprecord?filetempid=${item.id}`, formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ that.$message.success(data.message) that.loading = false that.fetchMenuDocuments() }else{ that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false that.$message.error('文件上传异常!') console.error(error); }); }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.fetchMenuDocuments() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.fetchMenuDocuments() }, exportFn1(){ var that = this //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { username:user.Username, djsmc:that.djsmc } axios({ method: 'get', url: '/www/public/shangbao/exportxqnxxdc', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', '辖区内学校管理员账号.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, teshudownload(item){ if(item.id==3||item.id==4||item.id==8){ const that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let data = { xxid:user.ID } $.post("/www/public/chouyang/sb_findzhxfzt", data, function(res){ if(res.error==0){ if(item.id==3){ that.XXexportFn('first') }else if(item.id==4){ that.XXexportFn('second') }else if(item.id==8){ that.xljkfzrdown() } }else{ that.$message.error(res.message) } }) } if(item.id==7){ const that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let data = { xxid:user.ID } $.post("/www/public/chouyang/sb_findbjxfzt", data, function(res){ if(res.error==0){ if(item.id==7){ that.bjxxdown() } }else{ that.$message.error(res.message) } }) } if(item.id==2){ this.exportFn1() }else if(item.id==1){ this.DexportFn() }else if(item.id==5){ this.YBXCYBJexportFn() }else if(item.id==6){ this.ptljurl() }else if(item.id==9){ this.downcyzyls() }else if(item.id==10){ this.cqzbdown() }else if(item.id==11){ this.ybxllymddown() } }, ybxllymddown(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { } axios({ method: 'get', url: '/www/public/download/xxgzzlly_byqybm_dc', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '样本校联络员名单.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败失败') } }) }, cqzbdown(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { schoolid : user.ID } axios({ method: 'get', url: '/www/public/shangbao/dccqzbzhff', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '【20241206】测前准备及参测师生账号分发说明(基教).pdf'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败失败') } }) }, downcyzyls(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { schoolid : user.ID } axios({ method: 'get', url: '/www/public/chouyang/sb-dczy', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '抽样专业列表.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }) }, bjxxdown(activeName){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { } var url = '/www/public/shangbao/exportbj_new' var name = '班级信息.xls' axios({ method: 'get', url, params: { schoolid }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, xljkfzrdown(activeName){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { } var url = '/www/public/shangbao/exportxxfzr' var name = '学校负责人登录账号.xls' axios({ method: 'get', url, params: { schoolid }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, ptljurl(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var xxjd = localStorage.getItem('xxjd') var schoolid = user.ID var type = '' if(['1'].includes(xxjd)){ type='1' }else if(['2','3','4'].includes(xxjd)){ type='2' }else if(['5','6'].includes(xxjd)){ type='3' } const params = { type } var url = '/www/public/shangbao/downloadUrl' var name = '全国学生心理健康监测与服务平台链接.url' axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, download(item){ var that = this let params = {} var name if(item.isupload=='1'){ params = { id :item.recordId, type:'2' } name = item.originFilename }else if(item.isupload=='2'){ params = { id :item.filetempid, type:'1' } name = item.filename } // window.open(item.file) axios({ method: 'get', url: '/www/public/shangbao/downloadtempFile', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, getFileTypeUrl(name){ var url = '' if(name){ var houzhui = this.gettype(name) if(houzhui=='pdf'){ url = '/content/image/xljkImg/pdf.png' }else if(houzhui=='xls'||houzhui=='xlsx'){ url = '/content/image/xljkImg/exceltubiao.png' }else if(houzhui=='jpg'||houzhui=='jpeg'||houzhui=='png'){ url = '/content/image/xljkImg/jpg.png' }else if(houzhui=='doc'||houzhui=='docx'){ url = '/content/image/xljkImg/word.png' }else{ url = '/content/image/xljkImg/qtwjlx.png' } } return url }, gettype(name){ var houzhui if(name){ var arr = name.split('.') houzhui = arr[1] } return houzhui }, getAccept(name){ var accept var houzhui = this.gettype(name) if(houzhui=='xls'||houzhui=='xlsx'){ accept = '.xls,.xlsx' }else if(houzhui=='doc'||houzhui=='docx'||houzhui=='pdf'||houzhui=='zip'){ accept = '.doc,.docx,.pdf,.zip,.rar' }else{ accept = '.zip,.rar' } return accept }, // 菜单配置类接口:roles=user.UserFilter.urole,xd=localStorage xxjd getMenuConfigRolesXd: function () { var roles = '' var xd = '' try { var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} if (user && user.UserFilter && user.UserFilter.urole != null && user.UserFilter.urole !== '') { roles = String(user.UserFilter.urole) } } catch (e) { } try { var j = localStorage.getItem('xxjd') if (j != null && j !== '') xd = String(j) } catch (e2) { } return { roles: roles, xd: xd } }, fetchMenuDocuments(){ var that = this $.get('/www/public/menuconfig/userzt', {}, function (resd) { if (resd.success != 1 || !resd.data) { that.menuDocLcid = '' that.menuDocList = [] return } var cd = resd.data var lcid = cd.lcid if (lcid == null || lcid === '') { try { var ls = localStorage.getItem('lcid') if (ls) { var parsed = JSON.parse(ls) lcid = parsed != null ? parsed : '' } } catch (e) { } } if (lcid == null || lcid === '') { that.menuDocLcid = '' that.menuDocList = [] return } that.menuDocLcid = String(lcid) var q = that.getMenuConfigRolesXd() axios({ method: 'get', url: '/www/public/menuconfig/ckmenufile', params: { lcid: that.menuDocLcid, roles: q.roles, xd: q.xd } }).then(function (res) { var data = res && res.data ? res.data : {} if (data.error == 0) { that.menuDocList = Array.isArray(data.data) ? data.data : [] } else { that.$message.error(data.message || '获取文档列表失败') that.menuDocList = [] } }).catch(function () { that.menuDocList = [] that.$message.error('获取文档列表请求失败') }) }).fail(function () { that.menuDocLcid = '' that.menuDocList = [] }) }, fetchMenuLinks(){ var that = this $.get('/www/public/menuconfig/userzt', {}, function (resd) { if (resd.success != 1 || !resd.data) { that.studentTestLinks = [] return } var cd = resd.data var lcid = cd.lcid if (lcid == null || lcid === '') { try { var ls = localStorage.getItem('lcid') if (ls) { var parsed = JSON.parse(ls) lcid = parsed != null ? parsed : '' } } catch (e) { } } if (lcid == null || lcid === '') { that.studentTestLinks = [] return } var q2 = that.getMenuConfigRolesXd() axios({ method: 'get', url: '/www/public/menuconfig/ckmenulink', params: { lcid: String(lcid), roles: q2.roles, xd: q2.xd } }).then(function (res) { var data = res && res.data ? res.data : {} if (data.error == 0) { that.studentTestLinks = Array.isArray(data.data) ? data.data : [] } else { that.studentTestLinks = [] } }).catch(function () { that.studentTestLinks = [] }) }).fail(function () { that.studentTestLinks = [] }) }, menuDocDisplayName(row){ if (!row) return '-' return row.file_name || row.filename || row.name || row.fileName || row.title || '-' }, menuDocDisplayFile(row){ return this.menuDocDisplayName(row) }, downloadMenuFile(row){ var that = this var file_path = row && (row.file_path || row.filePath || row.path || row.url || '') var file_name = that.menuDocDisplayName(row) if (!file_path) { that.$message.warning('文件路径缺失,无法下载') return } axios({ method: 'get', url: '/www/public/menuconfig/menudownloadfile', params: { file_path: file_path, file_name: file_name }, responseType: 'blob' }).then(function (res) { var blob = res && res.data ? res.data : null if (!blob) { that.$message.error('下载失败') return } var url = window.URL.createObjectURL(blob) var aLink = document.createElement('a') aLink.href = url aLink.setAttribute('download', file_name) document.body.appendChild(aLink) aLink.click() document.body.removeChild(aLink) window.URL.revokeObjectURL(url) that.$message.success('下载成功') }).catch(function () { that.$message.error('下载失败') }) }, // 操作视频相关:先查当前流程全部培训绑定,再拼接所有培训视频 fetchVideos(){ var that = this that.videoList = [] $.get('/www/public/menuconfig/userzt', {}, function (resd) { if (resd.success != 1 || !resd.data) { that.videoList = [] return } var cd = resd.data var lcid = cd.lcid if (lcid == null || lcid === '') { try { var ls = localStorage.getItem('lcid') if (ls) { var parsed = JSON.parse(ls) lcid = parsed != null ? parsed : '' } } catch (e) { } } if (lcid == null || lcid === '') { that.videoList = [] return } var q3 = that.getMenuConfigRolesXd() axios({ method: 'get', url: '/www/public/menuconfig/ckmenupx', params: { lcid: String(lcid), roles: q3.roles, xd: q3.xd } }).then(function (res) { var data = res && res.data ? res.data : {} var bindList = (data && data.error == 0 && Array.isArray(data.data)) ? data.data : [] if (!bindList.length) { that.videoList = [] return } var pxBinds = bindList.map(function (it) { return { pxid: String(it.pxid || it.id || it.ID || ''), pxmc: String(it.pxmc || it.name || it.mc || '培训视频') } }).filter(function (it) { return it.pxid }) if (!pxBinds.length) { that.videoList = [] return } var reqs = pxBinds.map(function (b) { return axios.get('/www/public/pxks/pxNrInfo', { params: { id: b.pxid } }) .then(function (resp) { var list = that.normalizeVideoResponse(resp && resp.data ? resp.data : resp) return list.map(function (v) { return { name: b.pxmc + ' - ' + (v.name || '操作视频'), url: v.url || '', cover: v.cover || '' } }) }).catch(function () { return [] }) }) Promise.all(reqs).then(function (all) { var merged = [] all.forEach(function (arr) { if (Array.isArray(arr)) merged = merged.concat(arr) }) that.videoList = merged }) }).catch(function () { that.videoList = [] }) }).fail(function () { that.videoList = [] }) }, normalizeVideoResponse(resp){ const root = (resp && resp.data!==undefined) ? resp.data : resp // root 为数组,每项含 kc(视频列表)、ks(考试等),我们仅取 kc。 const sections = Array.isArray(root) ? root : [] const exts = ['.mp4','.mov','.m4v','.m3u8','.flv','.webm'] const list = [] sections.forEach(sec=>{ const kc = Array.isArray(sec && sec.kc) ? sec.kc : [] kc.forEach(it=>{ const url = it.kcfile || '' const name = it.kcmc || '操作视频' const cover = it.kcfm || '' const u = (url||'').toLowerCase() if(u && exts.some(e=>u.endsWith(e))){ list.push({ name, url, cover }) } }) }) return list }, extractUrl(item){ return item && (item.kcfile||item.url||item.fileUrl||item.file||item.filePath||item.path||item.playUrl||item.src) || '' }, playVideo(item){ const url = this.extractUrl(item) if(!url){ return this.$message.error('无法播放:视频地址缺失') } this.currentVideoUrl = url this.videoDialogVisible = true }, downloadVideo(item){ const url = this.extractUrl(item) if(!url){ return this.$message.error('无法下载:视频地址缺失') } // 解析文件名(优先使用名称 + 扩展名) let baseName = (item && (item.name || item.kcmc)) || '视频' baseName = String(baseName).replace(/[\\/:*?"<>|]/g,'_').trim() || '视频' let ext = '' try{ const u = new URL(url, window.location.origin) const pathname = u.pathname || '' const last = (pathname.split('/').pop() || '').split('?')[0].split('#')[0] const m = last.match(/\.[a-z0-9]+$/i) ext = m ? m[0] : '' const sameOrigin = u.origin === window.location.origin const filename = `${baseName}${ext}` if(sameOrigin){ axios({ method:'get', url, responseType:'blob' }).then(res=>{ const ok = (res && (res.status===200 || (res.request && res.request.status===200))) if(ok){ let binaryData = [] binaryData.push(res.data) var blobUrl = window.URL.createObjectURL(new Blob(binaryData)) var aLink = document.createElement('a') aLink.href = blobUrl aLink.setAttribute('download', filename) document.body.appendChild(aLink) aLink.click() document.body.removeChild(aLink) window.URL.revokeObjectURL(blobUrl) this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }).catch(err=>{ // 同源失败时降级为直接触发下载 var aLink = document.createElement('a') aLink.href = url aLink.setAttribute('download', filename) aLink.rel = 'noopener' document.body.appendChild(aLink) aLink.click() document.body.removeChild(aLink) }) }else{ // 跨域资源:尝试使用 download 属性直接下载 var aLink = document.createElement('a') aLink.href = url aLink.setAttribute('download', filename) aLink.rel = 'noopener' document.body.appendChild(aLink) aLink.click() document.body.removeChild(aLink) } }catch(e){ // URL 解析失败时兜底处理 var aLink = document.createElement('a') aLink.href = url aLink.setAttribute('download', baseName) aLink.rel = 'noopener' document.body.appendChild(aLink) aLink.click() document.body.removeChild(aLink) } }, }, created: function(){ var that = this that.fetchMenuLinks() that.fetchMenuDocuments() that.fetchVideos() }, computed:{ yuzhishuju(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var arr = [] if(user.Roles.includes('220')){ arr = [ //{name:'市、区、县管理员账号.xls',id:1,img:"/content/image/xljkImg/excellogo.png"}, //{name:'样本校名单及账号.xls',id:2,img:"/content/image/xljkImg/excellogo.png"}, //{name:'样本校抽样班级.xls',id:5,img:"/content/image/xljkImg/excellogo.png"}, //{name:'样本校联络员名单.xls',id:11,img:"/content/image/xljkImg/excellogo.png"}, ] }else if(user.Roles.includes('450')){ var xxjd = localStorage.getItem('xxjd') if(['1','2','3'].includes(xxjd)){ arr = [ // {name:'【20241206】测前准备及参测师生账号分发说明(基教).pdf',id:10,img:"/content/image/xljkImg/pdf.png"}, // {name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, //{name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测教师登录账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, // {name:'学校负责人登录账号.xls',id:8,img:"/content/image/xljkImg/excellogo.png"}, //{name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"} ] }else if(['5','6'].includes(xxjd)){ arr = [ // {name:'测前准备及参测师生账号分发说明.docx',id:10,img:"/content/image/xljkImg/word.png"}, // {name:'抽样专业下载.xls',id:9,img:"/content/image/xljkImg/excellogo.png"}, //{name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, // {name:'老师测评账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, //{name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"}, ] }else if(['4'].includes(xxjd)){ arr = [ // {name:'【20241206】测前准备及参测师生账号分发说明(基教).pdf',id:10,img:"/content/image/xljkImg/pdf.png"}, // {name:'抽样专业下载.xls',id:9,img:"/content/image/xljkImg/excellogo.png"}, // {name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测教师登录账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, // {name:'学校负责人登录账号.xls',id:8,img:"/content/image/xljkImg/excellogo.png"}, // {name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"}, ] }else{ arr = [ // {name:'测前准备及参测师生账号分发说明.docx',id:10,img:"/content/image/xljkImg/word.png"}, // {name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测教师登录账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, // {name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, // {name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"} ] } }else{ arr = [ // {name:'样本校抽样班级.xls',id:5,img:"/content/image/xljkImg/excellogo.png"}, ] } return arr } }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDgongzuozuShangbaoDialogBJ202604", function(resolve, reject){ var template = ""; return (function(template, resolve, reject) { seajs.use([], function () { return resolve({ template: template, data: function () { return { id: Math.uuid(), tishi: '', gzzPzConfig: { sfycshxx: '0', pz: '' }, roleOption: [], loading: false, dialogVisible: false, tableData: [], gzzzt: '', xgzt: '', multipleSelection: [], currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4, innerVisible: false, selectList: [], selectListV: '', fetchUnitListStatus: false, classList: [], fetchUnitListDialog: false, user: {}, total: 0, pages: { pageNo: 1, pageSize: 5 }, reForm: { reason: '' }, Form: { reason: '' }, reruleForm: { xm: '', sjh: '', roleid: '', odesc: '', dw: '', zw: '', xb: '' }, ruleForm: { xm: '', sjh: '', roleid: '', odesc: '', dw: '', zw: '', xb: '', id: '' }, rules: { reason: [ { required: true, message: '请输入申请原因', trigger: 'blur' } ], xm: [ { required: true, message: '请输入姓名', trigger: 'blur' } ], roleid: [ { required: true, message: '请选择角色', trigger: 'change' } ], xb: [ { required: true, message: '请选择性别', trigger: 'change' } ], dw: [ { required: true, message: '请输入单位', trigger: 'blur' } ], zw: [ { required: true, message: '请输入职务', trigger: 'blur' } ], sjh: [ { required: true, message: '请输入联系方式', trigger: 'blur' }, { validator: publicUtilsOfCheck.isValidPhoneNumber, trigger: 'blur' } ], }, isEdit: false } }, methods: { DexportFn() { var that = this var name //var user = this.$store.state.user var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var username = user.Username var bm = username.substring(3) let type if (user.Roles.includes('220')) { type = '1' name = '市级管理员账号信息.xls' if (['110000', '120000', '310000', '500000'].includes(bm)) { type = '1' name = '区县管理员账号信息.xls' } } else if (user.Roles.includes('310')) { type = '2' name = '区县管理员账号信息.xls' } const params = { username: user.Username, type: '7', state: '1' } axios({ method: 'get', url: '/www/public/shangbao/dcsqxzh', params: { ...params }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { let data = res.data let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') } else { this.$message.error('导出失败') } }).catch(err => { this.$message.error('导出失败') }) }, save() { const that = this that.$confirm('是否确认提交', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { $.post("/www/public/bd/editjyttj", {}, function (res) { if (res.error == 0) { that.$message.success(res.message) that.getgzzshzt() } else { that.$message.error(res.message) } }) }).catch(() => { }); }, tijiaoch() { var that = this that.$confirm('是否确认撤回提交', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = '' if (user.Roles.includes('450')) { type = '2' } else { type = '1' } const params = { type } $.post("/www/public/shouye/gzzshch", params, function (res) { if (res.success == 1) { that.$message.success('撤回成功') that.getgzzshzt() } else { that.$message.error(res.message) } }).fail((xhr, status, error) => { }) }).catch(() => { }); }, getgzzshzt() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var gzzid = user.ID const params = { gzzid } $.get("/www/public/shangbao/gzz-getgzzshzt", params, function (res) { if (res.success == 1) { that.gzzzt = res.data.gzzzt that.xgzt = res.data.xgzt } else { that.$message.success(res.message) } }).fail((xhr, status, error) => { console.log(xhr, status, error) }) }, changegetList(v) { // 检查选择的值是否有效 if (!v || v === '') { return } let [zgdwbm, zgdwmc] = v.split('|') // 确保分割后的值都存在 if (!zgdwbm || !zgdwmc) { this.$message.error('选择的单位信息不完整') return } const that = this let data = { zgdwbm, zgdwmc } $.post("/www/public/shangbao/editzgdwbm", data, function (res) { if (res.error == 0) { that.$message.success('修改成功') } else { that.$message.error(res.message) } }) }, showshenqingxiugai() { this.$refs.gzzshenqingxiugai.show() }, shenqingxiugai() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var gzzid = user.ID const params = { gzzid, xgzt: '1', msg: that.Form.reason } $.post("/www/public/shangbao/gzz-cxsqxggzz", params, function (res) { if (res.success == 1) { that.$message.success('已申请') that.$refs.gzzshenqingxiugai.close() } else { that.$message.error(res.message) } }).fail((xhr, status, error) => { that.$message.error(error || '未知错误') }) }, tijiao() { var that = this that.$confirm('是否确认提交审核', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { var jscnt = {} var otype that.tableData.forEach(item => { if (!jscnt[item.gzzroleid]) { jscnt[item.gzzroleid] = 1 } else { jscnt[item.gzzroleid]++ } otype = item.otype }) const params = { jscnt: JSON.stringify(jscnt), otype } $.post("/www/public/shouye/jd_gzzbm_com", params, function (res) { if (res.success == 1) { that.$message.success('提交成功') that.$refs.baseDialoggzz0.close() that.$emit('closeDialog') that.getgzzshzt() } else if (res.success == 0 && res.message == '没有上级单位') { that.$message.error('没有上级单位,请选择一个单位'); that.fetchUnitList() that.fetchUnitListStatus = true } else { that.$message.error(res.message) } }).fail((xhr, status, error) => { }) }).catch(() => { }); }, fetchUnitList() { const that = this let data = { } $.post("/www/public/shangbao/findsjbmlist", data, function (res) { if (res.error == 0) { that.selectList = res.data } else { that.$message.error(res.message) } }) }, getZgdwbmById() { const that = this $.get("/www/public/shangbao/zgdwbmbyxxid", function (res) { if (res.error == 0 && res.data) { // 检查数据是否有效,避免显示nullnull const zgdwbm = res.data.zgdwbm || '' const zgdwmc = res.data.zgdwmc || '' if (zgdwbm && zgdwmc) { // 设置下拉框的选中值,格式为 "zgdwbm|zgdwmc" that.selectListV = `${zgdwbm}|${zgdwmc}` } else { that.selectListV = '' } } else { console.log('获取回显数据失败:', res.message) that.selectListV = '' } }).fail(function (error) { console.log('获取回显数据请求失败:', error) that.selectListV = '' }) }, download() { var that = this var type //1省,2区县,3学校 下载工作组导入模版 var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} // var user = this.$store.state.user //220省310市410区县 var name if (user.Roles.includes('220')) { type = 1 name = '省工作组信息上报模版.xlsx' } else if (user.Roles.includes('310')) { type = 2 name = '市工作组信息上报模版.xlsx' } else if (user.Roles.includes('410')) { type = 3 name = '县工作组信息上报模板.xlsx' } else if (user.Roles.includes('450')) { //基教4高教5 var xxjd = localStorage.getItem('xxjd') if (['1', '2', '3', '4'].includes(xxjd)) { type = 4 } else { type = 5 } name = '工作组信息上报模版.xlsx' } var templateType = type != null ? type : 7 var roles = user && user.UserFilter && user.UserFilter.urole != null ? String(user.UserFilter.urole) : '' var xd = localStorage.getItem('xxjd') ? String(localStorage.getItem('xxjd')) : '' var headers_str = that.getGzzPzHeadersStr() function runAxios(roles_config, lcid) { var params = { headers_str: headers_str, roles_config: JSON.stringify(roles_config), } axios({ method: 'post', url: '/www/public/menuconfig/downloadmenu_gzz_role', params: params, responseType: 'blob' }).then(function (res) { if (res.request.status == 200) { var binaryData = [] binaryData.push(res.data) var url = window.URL.createObjectURL(new Blob(binaryData)) var aLink = document.createElement('a') aLink.href = url aLink.setAttribute('download', name || '工作组信息上报模版.xlsx') document.body.appendChild(aLink) aLink.click() document.body.removeChild(aLink) that.$message.success('下载成功') } else { that.$message.error('下载失败') } }).catch(function () { that.$message.error('下载失败') }) } function mapRowsToRolesConfig(rows) { return (rows || []).map(function (item) { return { name: String(item.ovalue || ''), count: item.rsc, description: String(item.odesc || '') } }) } $.get('/www/public/menuconfig/userzt', {}, function (resd) { if (!(resd && resd.success == 1 && resd.data)) { runAxios(mapRowsToRolesConfig(that.roleOption), '') return } var lcid = resd.data.lcid if (lcid == null || lcid === '') { runAxios(mapRowsToRolesConfig(that.roleOption), '') return } $.get('/www/public/menuconfig/ckmenu_gzz_role', { lcid: String(lcid), roles: roles, xd: xd }, function (res) { var rows = [] if (res && res.error == 0) { var data = res.data rows = Array.isArray(data) ? data : (data ? [data] : []) } var roles_config = mapRowsToRolesConfig(rows) if (!roles_config.length) roles_config = mapRowsToRolesConfig(that.roleOption) runAxios(roles_config, lcid) }).fail(function () { runAxios(mapRowsToRolesConfig(that.roleOption), lcid || '') }) }).fail(function () { runAxios(mapRowsToRolesConfig(that.roleOption), '') }) }, handlebeforeClose() { this.$emit('closeDialog') }, handleRoleChange(val) { console.log(val, 'val') var zz = this.roleOption.find(item => { return item.id == val }) console.log(zz, 'zz') this.ruleForm.odesc = zz.odesc }, exportFn() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var schoolid = user.ID const params = { schoolid, } axios({ method: 'get', url: '/www/public/shangbao/exportteather', params: { ...params }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { let data = res.data let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '学生数据.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') } else { this.$message.error('导出失败') } }).catch(err => { this.$message.error('导出失败') }) }, customUpload(params) { var that = this that.loading = true var type //1省,2区县,3学校 下载工作组导入模版 var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} //var user = this.$store.state.user //220省310市410区县 if (user.Roles.includes('220')) { type = 1 } else if (user.Roles.includes('310')) { type = 2 } else if (user.Roles.includes('410')) { type = 3 } else if (user.Roles.includes('450')) { //基教4高教5 var xxjd = localStorage.getItem('xxjd') if (['1', '2', '3', '4'].includes(xxjd)) { type = 4 } else { type = 5 } } const formData = new FormData() console.log(params.file, 'params.file') // 如果extraParams是个单独的值,直接加入 var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var xd = localStorage.getItem('xxjd') var roles = user && user.UserFilter && user.UserFilter.urole != null ? String(user.UserFilter.urole) : '' axios.get('/www/public/menuconfig/userzt', {}).then(function (res) { var d = res && res.data ? res.data : {} var lcid = d && d.data && d.data.lcid != null ? String(d.data.lcid) : '' formData.append('file', params.file) // 这是file入参,文件信息 formData.append('roles', roles); formData.append('xd', xd); formData.append('lcid', lcid); // 调接口 axios.post(`/www/public/menuconfig/upload_gzz_role`, formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({ data }) => { if (data && data.success == 1) { that.$message.success('导入成功') that.loading = false that.getList() } else { that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false console.error(error); }); }).catch(function () { that.loading = false that.$message.error('获取流程信息失败') }) }, onError() { }, del(row) { var that = this const params = { ids: JSON.stringify([row.id]), } $.post("/www/public/shangbao/del_school_gzry", params, function (res) { if (res.success == 1) { that.$message.success('删除成功') that.getList() } else { that.$message.error(res.message) } }).fail((xhr, status, error) => { }) }, handleEdit(row) { this.isEdit = true this.$refs.baseDialoggzz1.show() this.$nextTick(() => { this.$refs.ruleFormgzz.resetFields() // 重新设置表单数据 this.ruleForm = { roleid: row.gzzroleid, id: row.id, xm: row.xm, sjh: row.sjh, odesc: row.odesc, xb: row.xb, dw: row.dw, zw: row.zw } console.log(this.ruleForm, 'ruleForm') }) }, validatePhoneNumber(phoneNumber) { const regex = /^(0\d{2,3}[- ]?\d{7,8})|(1[3-9]\d{9})$/; return regex.test(phoneNumber); }, validateEmail(email) { const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; return emailRegex.test(email); }, submit() { var that = this this.$refs['ruleFormgzz'].validate((valid) => { if (valid) { let that = this; //const {xm,zw,roleid,sjh,yx,xb,zw,dw} = that.ruleForm let newArr = { ...this.ruleForm } newArr.id = this.ruleForm.id console.log(newArr, 'newArr') $.post('/www/public/shouye/jd_gzzbm_202604', { params: JSON.stringify(newArr) }, function (msg) { if (msg.success == 1) { if (newArr.id) { that.$message.success('修改成功') } else { that.$message.success('添加成功') } that.$refs.baseDialoggzz1.close() that.getList() } else { that.$message({ type: 'error', message: msg.message }); } }).fail(function (jqXHR, textStatus, errorThrown) { that.$message({ type: 'error', message: errorThrown }); }) /*}else{ alert(2) $.post('/www/public/shangbao/edit_school_gzry',newArr, function(msg){ if(msg.success == 1){ that.$message.success('修改成功') that.$refs.baseDialoggzz1.close() that.getList() }else{ that.$message({ type: 'error', message: msg.message }); } }).fail(function(jqXHR, textStatus, errorThrown){ that.$message({ type: 'error', message: errorThrown }); }) }*/ } else { return false; } }); }, handleAdd() { this.isEdit = false this.$refs.baseDialoggzz1.show() this.$nextTick(() => { this.$refs.ruleFormgzz.resetFields() this.ruleForm = { xm: '', xb: '', sjh: '', zw: '', roleid: '', dw: '', odesc: '' } }) }, show() { this.getRole() this.getList() console.log(this.$refs.baseDialoggzz0, 'baseDialoggzz0') this.$refs.baseDialoggzz0.show() }, getRole() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var roles = user && user.UserFilter && user.UserFilter.urole != null ? String(user.UserFilter.urole) : '' var xd = localStorage.getItem('xxjd') ? String(localStorage.getItem('xxjd')) : '' $.get('/www/public/menuconfig/userzt', {}, function (resd) { if (!(resd && resd.success == 1 && resd.data)) { that.roleOption = [] that.loadMenuConfigGzzTishi() that.loadMenuConfigGzzPz() return } var lcid = resd.data.lcid if (lcid == null || lcid === '') { that.roleOption = [] that.loadMenuConfigGzzTishi() that.loadMenuConfigGzzPz() return } $.get('/www/public/menuconfig/ckmenu_gzz_role', { lcid: String(lcid), roles: roles, xd: xd }, function (res) { if (res && res.error == 0) { var data = res.data that.roleOption = Array.isArray(data) ? data : (data ? [data] : []) } else { that.roleOption = [] } that.loadMenuConfigGzzTishi() that.loadMenuConfigGzzPz() }).fail(function () { that.roleOption = [] that.loadMenuConfigGzzTishi() that.loadMenuConfigGzzPz() }) }).fail((jqXHR, textStatus, errorThrown) => { that.roleOption = [] that.loadMenuConfigGzzTishi() that.loadMenuConfigGzzPz() that.$message({ type: 'error', message: errorThrown }); }) }, loadMenuConfigGzzTishi: function () { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var roles = user && user.UserFilter && user.UserFilter.urole != null ? String(user.UserFilter.urole) : '' var xd = localStorage.getItem('xxjd') ? String(localStorage.getItem('xxjd')) : '' $.get('/www/public/menuconfig/userzt', {}, function (resd) { if (!(resd && resd.success == 1 && resd.data)) return var lcid = resd.data.lcid if (lcid == null || lcid === '') return $.get('/www/public/menuconfig/ckmenu_gzz_role', { lcid: String(lcid), roles: roles, xd: xd }, function (res) { if (!(res && res.error == 0)) return var data = Array.isArray(res.data) ? res.data : (res.data ? [res.data] : []) var html = '' data.forEach(function (item) { html += '

' html += (item.ovalue || '') html += '(' + (item.rsc || '') + '),' html += (item.odesc || '') + '。' html += '

' }) that.tishi = html }) }) }, loadMenuConfigGzzPz: function () { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var roles = user && user.UserFilter && user.UserFilter.urole != null ? String(user.UserFilter.urole) : '' var xd = localStorage.getItem('xxjd') ? String(localStorage.getItem('xxjd')) : '' $.get('/www/public/menuconfig/userzt', {}, function (resd) { if (!(resd && resd.success == 1 && resd.data)) return var lcid = resd.data.lcid if (lcid == null || lcid === '') return $.get('/www/public/menuconfig/ckmenu_gzz_pz', { lcid: String(lcid), roles: roles, xd: xd }, function (res) { if (!(res && res.error == 0)) return var data = res.data that.gzzPzConfig = Array.isArray(data) ? (data[0] || null) : (data || null) }) }) }, /** 与 ckmenu_gzz_pz 的 pz 一致:逗号分隔表头,* 表示必填项,供下载模板接口 headers_str */ getGzzPzHeadersStr: function () { var def = '角色,*姓名,*联系方式,*性别,*职务' var raw = this.gzzPzConfig && this.gzzPzConfig.pz if (raw == null || raw === '') return def var parts = [] if (Array.isArray(raw)) { parts = raw.map(function (x) { return String(x || '').trim() }).filter(function (x) { return !!x }) } else { var str = String(raw).trim() if (str[0] === '[' && str[str.length - 1] === ']') { try { var parsed = JSON.parse(str) if (Array.isArray(parsed)) { parts = parsed.map(function (x) { return String(x || '').trim() }).filter(function (x) { return !!x }) } } catch (e1) { } if (!parts.length) { var inner = str.slice(1, -1).trim() parts = inner.split(',').map(function (x) { var t = String(x || '').trim() if ((t[0] === '"' && t[t.length - 1] === '"') || (t[0] === "'" && t[t.length - 1] === "'")) { t = t.slice(1, -1) } return t }).filter(function (x) { return !!x }) } } else { try { var p2 = JSON.parse(str) if (Array.isArray(p2)) { parts = p2.map(function (x) { return String(x || '').trim() }).filter(function (x) { return !!x }) } } catch (e2) { } } } if (!parts.length) return def return parts.join(',') }, getGzzPzFields: function () { var def = ['角色', '姓名', '联系方式', '性别', '职务'] var raw = this.gzzPzConfig && this.gzzPzConfig.pz if (raw == null || raw === '') return def.slice() var arr = [] if (Array.isArray(raw)) { arr = raw } else { var str = String(raw).trim() if (str[0] === '[' && str[str.length - 1] === ']') { var inner = str.slice(1, -1).trim() try { var parsed = JSON.parse(str) if (Array.isArray(parsed)) arr = parsed } catch (e1) { } if (!arr.length) { arr = inner.split(',').map(function (x) { var t = String(x || '').trim() if ((t[0] === '"' && t[t.length - 1] === '"') || (t[0] === "'" && t[t.length - 1] === "'")) { t = t.slice(1, -1) } return t }).filter(function (x) { return !!x }) } } else { try { var p2 = JSON.parse(str) if (Array.isArray(p2)) arr = p2 } catch (e2) { } } } arr = arr.map(function (x) { return String(x || '').trim().replace(/^\*/, '') }).filter(function (x) { return !!x }) if (arr.indexOf('角色') < 0) arr.unshift('角色') return arr }, hasGzzPzField: function (name) { var target = String(name || '').trim().replace(/^\*/, '') var fields = this.getGzzPzFields() return fields.indexOf(target) >= 0 }, getList() { var that = this //otype 1 省级 2 区县 3 学校 var otype var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var roles = user.Roles if (roles.indexOf('450') != -1) { //基教4高教5 var xxjd = localStorage.getItem('xxjd') if (['1', '2', '3', '4'].includes(xxjd)) { otype = '4' } else { otype = '5' } } if (roles.indexOf('410') != -1) { otype = '3' } if (roles.indexOf('310') != -1) { otype = '2' } if (roles.indexOf('220') != -1) { otype = '1' } const params = { otype: '7' } $.post("/www/public/shouye/jd_gzzbm_fxList", params, function (res) { if (res.success == 1) { that.tableData = res.data } else { this.$message.success(res.message) } }).fail((xhr, status, error) => { }) }, getClass() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var schoolid = user.ID const params = { schoolid } $.get("/www/public/shangbao/findschoolbj", params, function (res) { if (res.success == 1) { that.classList = res.data } else { this.$message.error(res.message) } }).fail((xhr, status, error) => { this.$message.error('请求错误') }) }, handleConfirm() { this.$refs.baseDialogjs.close() }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.getList() }, handleClick() { }, handleClose() { console.log(1) this.dialogVisible = false }, toggleSelection(rows) { if (rows) { rows.forEach(row => { this.$refs.multipleTable.toggleRowSelection(row); }); } else { this.$refs.multipleTable.clearSelection(); } }, handleSelectionChange(val) { this.multipleSelection = val; } }, computed: { }, watch: { }, created: function () { this.user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} if (this.user.Roles.includes('450')) { this.fetchUnitList() } this.getgzzshzt() }, mounted: function () { // 获取回显数据 this.getZgdwbmById() }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-computerRoomInfosc", function(resolve, reject){ var template = "
\n \n \n \n

*机房总数量

\n \n \n \n
\n \n

*电脑总数量

\n \n \n \n
\n\n \n

*是否联网

\n \n \n \n \n \n \n
\n\n \n

\n *下载速率 测速链接\n

\n \n \n mbps\n \n\n
\n \n

*上传速率

\n \n \n mbps\n \n
\n \n

*操作系统

\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n

*网络运营商类型

\n \n \n \n \n \n \n \n \n \n
\n\n \n

*浏览器名称

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n\n \n

*是否云电脑

\n \n \n \n \n \n \n
\n\n \n

*本校机房是否能容纳最大班额

\n \n \n \n \n \n \n
\n \n

*不能满足最大班额是否有解决办法

\n \n \n \n \n \n \n
\n \n \n \n

*是否能打开测评平台

\n \n \n \n \n \n \n
\n \n

*本校机房条件能否参加在线问卷测试

\n \n \n \n \n \n \n
\n\n
\n
\n
\n 上 一 步\n 提 交\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), form: { jfsl: '', dnsl: '', sflw: '', xxdk: '', sxdk: '', czxt: '', llqmc: '', sfydn: '', sfrnzdbe:'', sfyjjbf:'', //sfyjpzdb:'', sfgxdzxbb:'', homezt:'0', //sfwlsdmzyq:'', sfndkpt:'', sfncjwjdc:'', yyslx:'' }, dataStatus:false, formLabelWidth: '0px', rules: { jfsl: [{ required: true, message: '机房数量不能为空', trigger: 'blur' }], dnsl: [{ required: true, message: '电脑数量不能为空', trigger: 'blur' }], sflw: [{ required: true, message: '是否联网不能为空', trigger: 'change' }], xxdk: [{ required: true, message: '下行带宽不能为空', trigger: 'blur' }], sxdk: [{ required: true, message: '上行带宽不能为空', trigger: 'blur' }], czxt: [{ required: true, message: '操作系统不能为空', trigger: 'blur' }], llqmc: [{ required: true, message: '浏览器名称不能为空', trigger: 'blur' }], yyslx: [{ required: true, message: '运营商类型不能为空', trigger: 'blur' }], sfydn: [{ required: true, message: '是否云电脑不能为空', trigger: 'change' }], sfrnzdbe: [{ required: true, message: '不能满足最大班额是否有解决办法', trigger: 'change' }], // sfyjpzdb: [{ required: true, message: '是否硬件配置达标', trigger: 'change' }], // sfwlsdmzyq: [{ required: true, message: '网络速度是否满足要求', trigger: 'change' }], sfndkpt: [{ required: true, message: '是否能打开测评平台', trigger: 'change' }], sfncjwjdc: [{ required: true, message: '本校机房条件能否参加在线问卷调查', trigger: 'change' }], }}; }, methods: { back(){ this.$emit('back') }, validateNumber(field) { // 如果输入的值小于0,则设置为0 if (this.form[field] < 0) { this.form[field] = 0; } }, preStep(){ this.$emit('preStep') }, getComputerRoomInfo(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const id = user.ID||'' let data ={ xxid : id } $.get("/www/public/shangbao/findjfxx", data, function(res){ if(res.error==0){ if(res.data == null){ that.dataStatus = false }else{ that.dataStatus = true that.form = res.data } }else{ that.$message.error(res.message) } }) }, save() { const that = this that.$refs.formRef.validate((valid) => { if (valid) { const id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:'' let data = { xxid:that.dataStatus?id:'', ...that.form } $.post("/www/public/shangbao/addjfxx", data, function(res){ if(res.error==0){ that.$router.push('home') }else{ that.$message.error(res.message) } }) } else { that.$message.warning('信息校验未正确填写或填写内容不全') console.error('表单验证失败'); return false; } })}, }, created: function(){ this.homezt = this.$route.query.homezt this.getComputerRoomInfo() }, mounted: function(){ }, props: ['title', 'data', 'config','disableStatus'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-schjyqsc-view", function(resolve, reject){ var template = "
\n \n
\n

学校测试环境要求

\n
\n

一、场地要求

\n
    \n
  • 参测学生须统一安排在机房内参与问卷测试,每人使用1台电脑作答。确保机房环境安静、无干扰。
  • \n \n
\n
\n\n
\n

二、软硬件要求

\n\n

1、硬件配置

\n
    \n
  • 处理器:至少为Intel Core i3或同等性能的处理器
  • \n
  • 内存:至少2GB RAM
  • \n
  • 硬盘空间:至少100MB 的可用硬盘空间用于安装浏览器和测试软件
  • \n
  • 外设要求:必须配备鼠标,以便于进行网页上的点选操作
  • \n
\n\n

2、操作系统

\n
    \n
  • 支持Windows 7及以上版本,或MacOS 10.12及以上版本
  • \n
  • 推荐操作系统已更新至最新版本,以减少潜在的问题
  • \n
\n\n

3、浏览器

\n
    \n
  • 推荐使用最新版本的Google Chrome或Microsoft Edge浏览器进行测试
  • \n
  • 如使用其他浏览器,请确保其为最新版本,并具有良好的兼容性和稳定性
  • \n
  • Google Chrome浏览器:官方下载
  • \n
  • Microsoft Edge浏览器:官方下载
  • \n
\n
\n\n
\n

三、网络要求

\n
    \n
  • 具备稳定的互联网连接,推荐使用有线连接以保证网络稳定性。
  • \n
  • 网络速度应满足基本的网页浏览需求,即下载速度不低于2Mbps,上传速度不低于1Mbps。
  • \n
\n
\n\n
\n

四、其他

\n
    \n
  • 电脑应无明显性能问题,确保测试过程中不会出现卡顿或频繁崩溃的情况。
  • \n
  • 确保测试过程中电脑有足够的电量或已连接电源,避免因电量不足导致测试中断。
  • \n
  • 确保电脑已安装必要的安全更新和防病毒软件。
  • \n
\n
\n\n \n
\n \n
\n \n \n
\n
\n
"; return ( function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), showCRInfo: false }; }, methods: { save(){ var that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; that.userid = user.ID let data = { userid: user.ID, } $.post("/www/public/bd/scqkyqedit", data, function(res) { if (res.error == 0) { var xxjd = localStorage.getItem('xxjd') if(xxjd>4){ that.$router.push('home') }else{ that.showCRInfo = true } } else if (res.error != 0) { that.$message.error(res.message); } }); }, goBack() { // 返回上一步,隐藏机房信息组件,显示环境要求页面 this.showCRInfo = false; } }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-gzzshenheDialogsc", function(resolve, reject){ var template = "
\n \n \n \n \n \n \n\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), roleOption:[], loading:false, dialogVisible: false, tableData: [], multipleSelection: [], currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4, innerVisible:false, classList:[], item:{}, total:0, pages:{ pageNo:1, pageSize:5 }, reruleForm: { reason:'' }, ruleForm: { reason:'' }, user:null, rules: { reason: [ { required: true, message: '请输入不通过原因', trigger: 'blur' } ], }, isEdit:false } }, methods:{ butongguo(){ this.$refs.gzzbutongguo.show() }, tongguo(item,type){ var that = this var zzsjh = '' that.tableData.forEach(item=>{ if(item.sfzz=='1'){ zzsjh = item.sjh } }) if(item.gzzsfsh=='3'){ //gzzid,zt,zzsjh,errormsg params = { gzzid:that.item.id, zt:type, zzsjh, errormsg:that.ruleForm.reason, } url = "/www/public/shangbao/gzzsh" }else if(item.gzzshzt=='3'){ //gzzshzt,xxid,zzsjh,errormsg,xxmc //gzzshzt 3未审核 1已审核 2不同过 0待提交 xxid 学校id var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} params = { gzzshzt:type, xxid:that.item.id, zzsjh, errormsg:that.ruleForm.reason, xxmc:that.item.xxmc } url = "/www/public/shangbao/editxxgzz" }else{ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} params = { gzzshzt:type, xxid:that.item.id, zzsjh, errormsg:that.ruleForm.reason, xxmc:that.item.xxmc } url = "/www/public/shangbao/editxxgzz" } $.post(url, params, function(res){ if(res.success==1){ that.listData = res.data that.$refs.baseDialoggzz.close() if(type=='2'){ that.$refs.gzzbutongguo.close() that.$message.success("已驳回,已短信通知修改") }else{ that.$message.success(res.message+',已短信通知审核结果') } that.$emit('closeDialog',that.item) }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{}) }, handlebeforeClose(){ this.$emit('closeDialog') }, handleRoleChange(val){ console.log(val,'val') var zz = this.roleOption.find(item=>{ return item.id==val }) console.log(zz,'zz') this.ruleForm.odesc = zz.odesc }, onError(){}, handleAdd(){ this.ruleForm = {xm:'',xb:'',sjh:'',yx:'',zw:'',roleid:''} this.isEdit = false this.$refs.baseDialoggzz1.show() this.$nextTick(()=>{ this.$refs.ruleFormgzz.resetFields() }) }, show(item){ this.item = JSON.parse(item) this.tableData = this.item.value this.$refs.baseDialoggzz.show() }, handleConfirm(){ this.$refs.baseDialogjs.close() }, handleClick(){}, handleClose(){ console.log(1) this.dialogVisible = false }, toggleSelection(rows) { if (rows) { rows.forEach(row => { this.$refs.multipleTable.toggleRowSelection(row); }); } else { this.$refs.multipleTable.clearSelection(); } }, handleSelectionChange(val) { this.multipleSelection = val; } }, watch:{ "ruleForm.xxjd"(val){ if(['1','2','3'].indexOf(val)!=-1){ this.ruleForm.xh = '' }else{ this.ruleForm.xjh = '' } } }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config','iszgx'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-dcsbybxscqksmsc-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n 查询\n 表格导出\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n\n\n
\n \n\n
\n

一、组织实施和测试过程中发现的问题及意见建议

\n

{{detailData.jy}}

\n \n

二、您认为还有哪些方面需要进一步改进和完善

\n

{{detailData.ws}}

\n
\n \n 关闭\n \n
\n
\n\n\n
\n
"; return (function(template, resolve, reject) { seajs.use([], function () { return resolve({ template: template, data: function () { return { events: [], // 应急事件数据 currentPage: 1, // 当前页码 pageSize: 10, // 每页条数 total: 0, // 总条数 search: { xxmc: '', xd: '', sftj: '', sfzgx: '', zgdwmc: '' }, detailDialogVisible: false, detailData: { jy: '', ws: '' } }; }, methods: { allsend() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 7, userid: user.ID } $.post("/www/public/bd/sendyjdcsms", data, function (res) { if (res.error == 0) { that.$message.success('督办短信发送成功') } else { that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, sendSms(row) { var that = this this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 7, userid: row.id // 学校id } $.post("/www/public/bd/senddcsms", data, function (res) { if (res.error == 0) { that.$message.success('督办短信发送成功') } else { that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, down() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; const type = this.activeName === 'first' ? '1' : '2'; let params = { code: code, xxmc: this.search.xxmc, xd: this.search.xd, sftj: this.search.sftj, sfzgx: this.search.sfzgx, userid: user.ID }; /*const params = { //zgdwbm:user.ID, shzt:that.activeName=='first'?'0':this.activeName=='second'?'1':'-1', type, username:user.Username }*/ axios({ method: 'get', url: '/www/public/bd/ybxssqksmlistexport', params: { ...params }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { let data = res.data let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '表格信息.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') } else { this.$message.error('导出失败') } }).catch(err => { this.$message.error('导出失败') }) }, formatXd(row, column, cellValue) { const xdMap = { 1: '小学', 2: '初中', 3: '高中', 4: '中职', 5: '高职', 6: '高校' }; return xdMap[cellValue] || ''; }, formatSftj(row, column, cellValue) { const sftjMap = { 2: '已提交', 1: '未提交', null: '未提交' }; return sftjMap[cellValue] || ''; }, fetchEvents() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; let params = { pageNo: this.currentPage, pageSize: this.pageSize, code: code, xxmc: this.search.xxmc, xd: this.search.xd, sftj: this.search.sftj, sfzgx: this.search.sfzgx, zgdwmc: this.search.zgdwmc, userid: user.ID }; // 调用查询接口 $.get("/www/public/bd/ybxssqksmlist", params, function (res) { if (res.error == 0) { that.events = res.data; that.total = res.total; } else { that.$message.error(res.message); } }).fail(function () { that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleSizeChange(size) { this.pageSize = size; this.currentPage = 1; this.fetchEvents(); }, // 改变当前页 handleCurrentChange(page) { this.currentPage = page; this.fetchEvents(); }, // 查看详情 viewDetail(row) { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; $.get("/www/public/bd/ybxssqksmfind", { userid: row.id }, function (res) { if (res.error == 0) { that.detailData = { jy: res.data.jy || '', ws: res.data.ws || '' }; that.detailDialogVisible = true; } else { that.$message.error(res.message); } }).fail(function () { that.$message.error('请求失败,请检查网络连接'); }); } }, created: function () { this.fetchEvents(); } }); }); })(template, resolve, reject); }); RegVueCom("xljk-dcybxtxcsgcjlbsc-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 查询\n 表格导出\n \n
\n \n\n \n \n \n \n \n \n \n \n\n \n\n \n
\n \n \n
\n\n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n
\n
\n\n \n
\n \n
\n \n\n\n \n
\n
\n \n 测试信息\n
\n
\n
\n\n
\n
测试班级
\n
{{ fullDetailData.csbj || '-' }}
\n
\n
\n
开始时间
\n
{{ fullDetailData.cskssj || '-' }}
\n
\n
\n
结束时间
\n
{{ fullDetailData.csjssj || '-' }}
\n
\n
\n
\n
\n\n \n
\n
\n \n 人数统计\n
\n
\n
\n
\n
{{ fullDetailData.ycrs !== null && fullDetailData.ycrs !== undefined ? fullDetailData.ycrs : 0 }}
\n
应测人数
\n
\n
\n
{{ fullDetailData.scrs !== null && fullDetailData.scrs !== undefined ? fullDetailData.scrs : 0 }}
\n
实测人数
\n
\n\n
\n
{{ fullDetailData.qxrs !== null && fullDetailData.qxrs !== undefined ? fullDetailData.qxrs : 0 }}
\n
缺席人数
\n
\n
\n
\n
\n\n \n
\n
\n \n 学生测试详情\n
\n
\n
\n
\n
计算机和网络情况
\n
{{ (fullDetailData.sfjsjzc === '1' || fullDetailData.sfjsjzc === '存在问题') ? '存在问题' : (fullDetailData.sfjsjzc === '0' || fullDetailData.sfjsjzc === '正常') ? '正常' : (fullDetailData.sfjsjzc || '-') }}
\n
\n
\n
计算机网络问题详细说明
\n
{{ fullDetailData.jsjwlwtms || '-' }}
\n
\n
\n
纪律情况
\n
{{ (fullDetailData.jlqk === '1' || fullDetailData.jlqk === '存在问题') ? '存在问题' : (fullDetailData.jlqk === '0' || fullDetailData.jlqk === '正常') ? '正常' : (fullDetailData.jlqk || '-') }}
\n
\n
\n
纪律问题详细说明
\n
{{ fullDetailData.jlwtms || '-' }}
\n
\n
\n
特殊情况
\n
{{ (fullDetailData.tsqk === '1' || fullDetailData.tsqk === '有特殊情况') ? '有特殊情况' : (fullDetailData.tsqk === '0' || fullDetailData.tsqk === '无特殊情况') ? '无特殊情况' : (fullDetailData.tsqk || '-') }}
\n
\n
\n
特殊情况详细说明
\n
{{ fullDetailData.tsqkms || '-' }}
\n
\n
\n
测试问题疑问
\n
{{ (fullDetailData.qtqk === '1' || fullDetailData.qtqk === '有疑问') ? '有疑问' : (fullDetailData.qtqk === '0' || fullDetailData.qtqk === '无疑问') ? '无疑问' : (fullDetailData.qtqk || '-') }}
\n
\n
\n
疑问详细说明
\n
{{ fullDetailData.ywms || '-' }}
\n
\n
\n
缺席原因
\n
{{ fullDetailData.qtqxyy || '-' }}
\n
\n\n
\n
\n
\n\n \n
\n
\n \n 老师测试详情\n
\n
\n
\n
\n
事假人数
\n
{{ fullDetailData.sjrs !== null && fullDetailData.sjrs !== undefined ? fullDetailData.sjrs : '-' }}
\n
\n
\n
病假人数
\n
{{ fullDetailData.bjrs !== null && fullDetailData.bjrs !== undefined ? fullDetailData.bjrs : '-' }}
\n
\n
\n
其他情况
\n
{{ fullDetailData.qtqk || '-' }}
\n
\n
\n
题目理解情况
\n
{{ fullDetailData.ljqk || '-' }}
\n
\n
\n
\n
\n\n \n
\n
\n \n 其他信息\n
\n
\n
\n\n
\n
备注
\n
{{ fullDetailData.bz || '-' }}
\n
\n
\n
\n
\n
\n\n
\n
\n
\n\n\n
\n
"; return (function(template, resolve, reject) { seajs.use([], function () { return resolve({ template: template, data: function () { return { events: [], // 应急事件数据 currentPage: 1, // 当前页码 pageSize: 10, // 每页条数 total: 0, // 总条数 search: { xxmc: '', xd: '', sfxsssfa: '', sflsssfa: '', sfzgx: '', zgdwmc: '' }, detailDialogVisible: false, fullDetailDialogVisible: false, currentRow: null, activeName: 'first', studentData: [], teacherData: [], detailCurrentPage: 1, detailPageSize: 10, detailTotal: 0, fullDetailData: {} }; }, methods: { allsend() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 6, userid: user.ID } $.post("/www/public/bd/sendyjdcsms", data, function (res) { if (res.error == 0) { that.$message.success('督办短信发送成功') } else { that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, sendSms(row) { var that = this this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 6, userid: row.id // 学校id } $.post("/www/public/bd/senddcsms", data, function (res) { if (res.error == 0) { that.$message.success('督办短信发送成功') } else { that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, down() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; const type = this.activeName === 'first' ? '1' : '2'; let params = { code: code, xxmc: this.search.xxmc, xd: this.search.xd, sfxsssfa: this.search.sfxsssfa, sflsssfa: this.search.sflsssfa, sfzgx: this.search.sfzgx, zgdwmc: this.search.zgdwmc, userid: user.ID }; /*const params = { //zgdwbm:user.ID, shzt:that.activeName=='first'?'0':this.activeName=='second'?'1':'-1', type, username:user.Username }*/ axios({ method: 'get', url: '/www/public/bd/xscsgcjlbflistExport', params: { ...params }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { let data = res.data let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '表格信息.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') } else { this.$message.error('导出失败') } }).catch(err => { this.$message.error('导出失败') }) }, formatXd(row, column, cellValue) { const xdMap = { 1: '小学', 2: '初中', 3: '高中', 4: '中职', 5: '高职', 6: '高校' }; return xdMap[cellValue] || ''; }, formatStatus(row, column) { const value = row[column.property]; if (value === '2') { return '已完成'; } else if (value === '1') { return '未完成'; } return ''; }, fetchEvents() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; let params = { pageNo: this.currentPage, pageSize: this.pageSize, code: code, xxmc: this.search.xxmc, xd: this.search.xd, sfxsssfa: this.search.sfxsssfa, sflsssfa: this.search.sflsssfa, sfzgx: this.search.sfzgx, zgdwmc: this.search.zgdwmc, userid: user.ID }; // 调用查询接口 $.get("/www/public/bd/xscsgcjlbflist", params, function (res) { if (res.error == 0) { that.events = res.data; that.total = res.total; } else { that.$message.error(res.message); } }).fail(function () { that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleSizeChange(size) { this.pageSize = size; this.currentPage = 1; this.fetchEvents(); }, // 改变当前页 handleCurrentChange(page) { this.currentPage = page; this.fetchEvents(); }, // 查看详情 viewDetail(row) { this.currentRow = row; // 保存整行数据 this.detailDialogVisible = true; this.getDetailList(); }, closeDetailDialog() { this.detailDialogVisible = false; this.currentXxid = null; this.activeName = 'first'; this.studentData = []; this.teacherData = []; this.fetchEvents(); }, handleTabClick() { this.detailCurrentPage = 1; this.getDetailList(); }, handleDetailSizeChange(size) { this.detailPageSize = size; this.detailCurrentPage = 1; this.getDetailList(); }, handleDetailCurrentChange(page) { this.detailCurrentPage = page; this.getDetailList(); }, getDetailList() { if (!this.currentRow) return; const that = this; const type = this.activeName === 'first' ? '1' : '2'; // 使用新的接口 const url = type === '1' ? '/www/public/bd/ywtdsjapbxs' : '/www/public/bd/ywtdsjapbls'; var params = { pageNo: this.detailCurrentPage, pageSize: this.detailPageSize, xxid: this.currentRow.id }; $.get(url, params, function (res) { if (res.success == 1) { if (type === '1') { that.studentData = res.data; } else { that.teacherData = res.data; } that.detailTotal = res.total; } else { that.$message.error(res.message); } }).fail(function () { that.$message.error('请求失败,请检查网络连接'); }); }, viewFullDetail(row) { const that = this; const type = this.activeName === 'first' ? '1' : '2'; // 使用新的详情接口 const url = type === '1' ? '/www/public/bd/csgcjlbxqxs' : '/www/public/bd/csgcjlbxqls'; var params = { id: row.id }; $.get(url, params, function (res) { if (res.success == 1) { that.fullDetailData = res.data; that.fullDetailData.type = type; // 添加类型标识 that.fullDetailDialogVisible = true; } else { that.$message.error(res.message || '获取详情失败'); } }).fail(function () { that.$message.error('请求失败,请检查网络连接'); }); }, closeFullDetailDialog() { this.fullDetailDialogVisible = false; this.fullDetailData = {}; } }, created: function () { this.fetchEvents(); } }); }); })(template, resolve, reject); }); RegVueCom("xljk-ssfajindusc", function(resolve, reject){ var template = "
\n
\n \n
\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n 查询\n 批量导出学生时间安排\n \n 导出上传情况\n\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n\n\n \n \n \n \n \n \n \n \n
\n 取 消\n 确 定\n
\n
\n \n 新增视导员\n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), xxss:'', search: { xxmc: '', xd: '', sfzgx: '', sfxssjapwc: '' }, tableData:[], XStableData:[], pageName:'', totalJindu:{}, xxxd:'', gzzjd:{}, xxxxjd:{}, gzzss:'', xxjd:'', dialogVisible: false, curData:{}, multipleSelection: [], innerVisible:false, Roles:[], currow:{}, pages:{ pageNo:1, pageSize:5 }, Detailpages:{ pageNo:1, pageSize:5 }, total:0, DetailTotal:0, type:1, activeName:'first', sdymddetaillist:[], dialogVisible:false, schoolrow:'', form:{ xm:'', lxfs:'', sj:'' }, sdyrow:'', rules: { xm: [ { required: true, message: '请输入名字', trigger: 'change' } ], lxfs: [ { required: true, message: '请输入联系方式', trigger: 'change' } ], sj: [ { required: true, message: '请选择实施日期', trigger: 'change' } ], } } }, methods: { formatXd(row, column, cellValue) { const xdMap = { 1: '小学', 2: '初中', 3: '高中', 4: '中职', 5: '高职', 6: '高校' }; return xdMap[cellValue] || ''; }, allsend(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 3, userid: user.ID } $.post("/www/public/bd/sendyjdcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, down1(type){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var name='' if(type==1){ name='学生测试时间安排表.xls' }else{ name='教师测试时间安排表.xls' } const params = { jytid:user.ID, type } axios({ method: 'get', url:'/www/public/shangbao/findssfa_dcbyjyt', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download',name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, downdata(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var type if(user.Roles.includes('220')){ type='1' }else if(user.Roles.includes('310')){ type='2' }else if(user.Roles.includes('410')){ type='3' }else if(user.Roles.includes('450')){ type='4' } const params = { username:user.Username, type, } axios({ method: 'get', url:'/www/public/shangbao/findssfaxxExport', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download','表格数据.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, down(row,type){ var that = this const params = { xxid:row.id, type } axios({ method: 'get', url:'/www/public/shangbao/findssfa_dcbyxxid_sc', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download','时间安排列表.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, sendSms(row){ var that = this this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 3, userid: row.id } $.post("/www/public/bd/senddcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, del(row){ const that = this let data = { sdyid:row.id } $.post("/www/public/shangbao/delsdy", data, function(res){ if(res.error==0){ that.$message.success(res.message) that.editList() }else{ that.$message.error(res.message) } }) }, addsdy(){ const that = this that.form={ } that.sdyrow.id='' //this.$refs.formRef?this.$refs.formRef.clearValidate():'' this.$refs.formRef?this.$refs.formRef.resetFields():'' that.dialogVisible=true }, editsdy(row){ this.sdyrow=row this.form=row this.dialogVisible=true }, editListclose(){ const that = this that.$refs.sdymddetail.close() }, editList(row){ const that = this let data = { schoolid:row?row.id:that.schoolrow.id } $.post("/www/public/shangbao/findsdyinfo", data, function(res){ if(res.error==0){ that.sdymddetaillist = res.data that.$refs.sdymddetail.show() }else{ that.$message.error(res.message) } }) that.schoolrow= row?row:that.schoolrow }, save(){ const that = this let data = { sdyid:that.sdyrow?that.sdyrow.id:'', schoolid:that.schoolrow.id, ...that.form, } $.post("/www/public/shangbao/editsdyinfo", data, function(res){ if(res.error==0){ that.dialogVisible=false that.editList() }else{ that.$message.error(res.message) } }) }, changeTab(val, event){ var that = this that.Detailpages.pageNo=1 console.log(val,'val',event) if(this.activeName=='first'){ this.type = 1 }else if(this.activeName=='second'){ this.type = 2 } this.getDetail(that.currow) }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.pages.pageNo = 1 this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.getList() }, handleDetailSizeChange(val) { console.log(`每页 ${val} 条`); this.Detailpages.pageSize = val this.getDetail(this.currow) }, handleDetailCurrentChange(val) { console.log(`当前页: ${val}`); this.Detailpages.pageNo = val this.getDetail(this.currow) }, getDetail(row){ var that = this console.log(row,'row') data = { xxid:row.id, type:'1', ...that.Detailpages } url = "/www/public/shangbao/findssfa" $.get(url, data, function(res){ if(res.success==1){ that.XStableData = res.data that.DetailTotal = res.total }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message('请求错误') }) }, getDetaills(row){ var that = this console.log(row,'row') data = { xxid:row.id, type:'2', ...that.Detailpages } url = "/www/public/shangbao/findssfa" $.get(url, data, function(res){ if(res.success==1){ that.XStableData = res.data that.DetailTotal = res.total }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message('请求错误') }) }, showDetail(row){ this.currow = {...row} this.$refs.ssfajinduDetail.show() this.getDetail(row) }, showDetaills(row){ this.currow = {...row} this.$refs.ssfajinduDetaills.show() this.getDetaills(row) }, duban(row,type){ var that = this data = { xxid:row.id, type } url = "/www/public/shangbao/dbcpxx" $.get(url, data, function(res){ if(res.success==1){ that.$message.success('已发送短信督办') }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message('请求错误') }) }, toggleSelection(rows) { if (rows) { rows.forEach(row => { this.$refs.multipleTable.toggleRowSelection(row); }); } else { this.$refs.multipleTable.clearSelection(); } }, handleSelectionChange(val) { this.multipleSelection = val; }, shouldHideSmsButton(row) { // 学生已上传状态 const studentUploaded = row.sfxssjapwc == '2'; return studentUploaded; // 如果是学段5、6,老师不需要上传,只要学生已上传就隐藏 // if (['5', '6'].includes(row.xd)) { // return studentUploaded; // } // 其他学段,需要学生和老师都已上传才隐藏 // const teacherUploaded = row.sflssjapwc == '2'; // return studentUploaded && teacherUploaded; }, getList(param){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var data = {} var type if(user.Roles.includes('220')){ type='1' }else if(user.Roles.includes('310')){ type='2' }else if(user.Roles.includes('410')){ type='3' }else if(user.Roles.includes('450')){ type='4' } data = { usid: user.ID, username:user.Username, type, ...that.pages } if (['1', '2','3'].includes(type)) { data = { ...data, ...this.search } } url = "/www/public/shangbao/findssfaxx" $.get(url, data, function(res){ if(res.success==1){ that.tableData = res.data that.total = res.total }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{}) //that.getTotalcpjd(user.Username,type) }, }, created: function(){ this.getList() this.xxjd=localStorage.getItem('xxjd')?JSON.parse(localStorage.getItem('xxjd')):'' }, mounted: function(){ }, props: ['title', 'data', 'config','','totalJindu'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDjddcsc-view", function(resolve, reject){ var template = ""; return ( function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), pageName:'', totalJindu:{}, xxss:'', xxxd:'', gzzjd:{}, xxxxjd:{}, gzzss:'', dialogVisible: false, tableData1: [], tableData2: [], tableData3:[], curData:{}, multipleSelection: [], currentPage1: 5, xxjd:'', currentPage2: 5, currentPage3: 5, currentPage4: 4, sfwcFilter: '', // 是否完成作答筛选 tableData3Backup: [], // 备份原始数据用于筛选 innerVisible:false, sfxzdw:'1', activeName: 'first', status:'', paramspath:[], Roles:[], pages:{ pageNo:1, pageSize:5 }, total:0, ruleForm: { }, type:'',//1测评,2访谈 isEdit:false, stuortea:'1', stuList: [] } }, methods:{ wancheng(row,type){ const that = this console.log(row) if (row.xm.includes("备用")) { if(type==1){ this.$prompt('请输入原因', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', }).then(({ value }) => { if(!value) return that.$message.error('请完成/未完成输入原因') let data = { lsid:row.id, sfwc:'1', reason:value, } $.post("/www/public/jingdu/updatewcztandyy", data, function(res){ if(res.error==0){ that.$message.success(res.message) that.getList() }else{ that.$message.error(res.message) } }) }).catch(() => { }); }else{ let data = { lsid:row.id, sfwc:'2', } $.post("/www/public/jingdu/updatewcztandyy", data, function(res){ if(res.error==0){ that.$message.success(res.message) that.getList() }else{ that.$message.error(res.message) } }) } } else { if(type==1){ let data = { lsid:row.id, sfwc:type, //reason:value, } $.post("/www/public/jingdu/updatewcztandyy", data, function(res){ if(res.error==0){ that.$message.success(res.message) that.getList() }else{ that.$message.error(res.message) } }) }else{ this.$prompt('请输入原因', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', }).then(({ value }) => { if(!value) return that.$message.error('请完成/未完成输入原因') let data = { lsid:row.id, sfwc:type, reason:value, } $.post("/www/public/jingdu/updatewcztandyy", data, function(res){ if(res.error==0){ that.$message.success(res.message) that.getList() }else{ that.$message.error(res.message) } }) }).catch(() => { }); } } }, xswancheng(row,type){ const that = this console.log(row) if(row['cpzrs']==row['cprs']&&type==1){ let data = { bjid:row.bjid, sfwc:type, } $.post("/www/public/selectschool/cpjd-cz", data, function(res){ if(res.error==0){ that.$message.success(res.data) that.getList() }else{ that.$message.error(res.data) } }) }else if(type==1){ this.$prompt('请补充实测人数不等于应测人数的原因', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', }).then(({ value }) => { if(!value) return that.$message.error('请完成/未完成输入原因') let data = { bjid:row.bjid, sfwc:type, reason:value } $.post("/www/public/selectschool/cpjd-cz", data, function(res){ if(res.error==0){ that.$message.success(res.data) that.getList() }else{ that.$message.error(res.data) } }) }).catch(() => { }); }else { this.$prompt('请输入原因', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', }).then(({ value }) => { if(!value) return that.$message.error('请完成/未完成输入原因') let data = { bjid:row.bjid, sfwc:type, reason:value } $.post("/www/public/selectschool/cpjd-cz", data, function(res){ if(res.error==0){ that.$message.success(res.data) that.getList() }else{ that.$message.error(res.data) } }) }).catch(() => { }); } }, getXSDetail(row){ var that = this const params = { bjid: row.bjid } $.get("/www/public/shimingimport/findbjxs", params, function(res){ if(res.success==1){ const xbMap = new Map([['1', '男'], ['2', '女']]) const sfwczdMap = new Map([['0', '未完成'], ['1', '已完成']]) that.stuList = res.data.length ? res.data.map(s => ({ ...s, sfwczd: sfwczdMap.get(s.sfwczd) })) : [] }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) }, xschakan(row) { console.log(row) this.getXSDetail(row) this.$refs.jsxxxxjxgshenhe.show() }, duban(row,type){ var that = this data = { xxid:row.id, type } url = "/www/public/shangbao/dbcpxx" $.get(url, data, function(res){ if(res.success==1){ that.$message.success('已发送短信督办') }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message('请求错误') }) }, downloads0(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var name = '全校未测学生.xls' var url = '/www/public/selectschool/cpjdwwc-dc' const params = { userid:user.ID, } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, downloads2(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var name = '全校已测学生.xls' var url = '/www/public/selectschool/cpjdwc-dc' const params = { userid:user.ID, } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, downloads11(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var name = '教师测评进度.xls' var url = '/www/public/jingdu/lslistbyls_export' const params = { userid:user.ID, roles:user.Roles[0], username:user.Username, typec } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, downloads1(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var name = '学生测评进度.xls' var url = '/www/public/jingdu/findzdlvdc' if(user.Roles.includes('220')){ typec='1' }else if(user.Roles.includes('310')||user.Roles.includes('410')){ typec='2' }else if(user.Roles.includes('450')){ typec='4' url = '/www/public/selectschool/cpjd-dc' } const params = { userid:user.ID, roles:user.Roles[0], username:user.Username, typec } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, downloads(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var name = '测评进度.xls' if(user.Roles.includes('220')){ typec='1' }else if(user.Roles.includes('310')||user.Roles.includes('410')){ typec='2' }else if(user.Roles.includes('450')){ typec='4' } const params = { userid:user.ID, roles:user.Roles[0], username:user.Username, typec } axios({ method: 'get', url: '/www/public/selectschool/cpjd-dc', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, download(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var sfxzdw= '' var name = '' if(that.activeName=='first'&&that.sfxzdw=='1'){ sfxzdw=that.sfxzdw name= '市教育局工作组上报进度.xls' }else if(that.activeName=='first'&&that.sfxzdw=='3'){ sfxzdw=that.sfxzdw name= '区县教育局工作组上报进度.xls' }else if(that.activeName=='first'&&that.sfxzdw=='2'){ sfxzdw=that.sfxzdw name= '学校工作组上报进度.xls' }else if(that.activeName=='second'){ sfxzdw='4' name= '学校信息上报进度.xls' } const params = { userid:user.ID, roles:user.Roles[0], sfxzdw, xxxd:this.xxxd } axios({ method: 'get', url: '/www/public/shangbao/sb-gzzsbjd-dc', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, getDetail(row){ this.curData = {...row} this.$refs.XDgongzuozuDetail.show() }, tabchange(){ console.log(this.activeName) this.getList() }, handleback(){ var len = this.paramspath.length if(len>1){ this.paramspath.pop() this.getList(this.paramspath[len-1]) }else{ return } }, handleRowClick(row){ console.log(row,'row') var len = this.paramspath.length this.getList({typec:Number(this.paramspath[len-1].typec)+1+'',username:row.username}) }, handleClick(tab, event) { console.log(tab, event); }, onError(){}, show(type){ this.type = type this.getList() this.$refs.baseDialog.show() }, getTotalcpjd(username,typec){ var that = this const data = { username, typec, } url = "/www/public/selectschool/cpjd-zt" $.get(url, data, function(res){ if(res.success==1){ if(res.data&&res.data.length){ that.totalJindu = res.data[0] } }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ }) }, getList(param){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var data = {} if(that.activeName =='third'){ var url = "/www/public/jingdu/findzdlv" if(user.Roles.includes('220')){ typec='1' }else if(user.Roles.includes('310')||user.Roles.includes('410')){ typec='2' }else if(user.Roles.includes('450')){ url = "/www/public/selectschool/cpjd" typec='4' } data = { username:user.Username, typec, } $.get(url, data, function(res){ if(res.success==1){ if(user.Roles.includes('450')){ that.tableData3 = res.data.filter(item=>item.xxmc.includes(that.xxss)) }else{ that.tableData3 = res.data } that.tableData3Backup = [...that.tableData3] // 备份当前显示的数据 }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{}) if(user.Roles.includes('450')){ // that.getTotaljd() }else{ // that.getTotalcpjd(user.Username,typec) } }else if(that.activeName =='third-fiveth'){ /* var url = "/www/public/jingdu/lslist" data = { } $.get(url, data, function(res){ if(res.success==1){ that.tableData3 = res.data that.tableData3Backup = [...res.data] // 备份原始数据 }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{}) that.getTotaljd() */ var url = "/www/public/jingdu/findzdlv" if(user.Roles.includes('220')){ url = "/www/public/jingdu/findzdlv" typec='1' }else if(user.Roles.includes('310')||user.Roles.includes('410')){ url = "/www/public/jingdu/findzdlv" typec='2' }else if(user.Roles.includes('450')){ if(this.status==1){ url = "/www/public/jingdu/lslistbyls" typec='4' }else{ url = "/www/public/jingdu/lslistbyxxfzr" typec='4' } } data = { username:user.Username, typec, } $.get(url, data, function(res){ if(res.success==1){ that.tableData3 = res.data that.tableData3Backup = [...res.data] // 备份原始数据用于筛选 }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{}) if(user.Roles.includes('450')){ // that.getTotaljd() }else{ // that.getTotalcpjd(user.Username,typec) } }else{ data = { userid:user.ID, roles:user.Roles[0], gzzss:that.gzzss, xxss:that.xxss, sfxzdw:!that.Roles.includes('410')?that.sfxzdw:'2', xxxd:this.xxxd } url = "/www/public/shangbao/sb-gzzsbjd" $.post(url, data, function(res){ if(res.success==1){ that.tableData1 = res.data.gzz that.tableData2 = res.data.sclxx that.gzzjd = res.data.gzzjd that.xxxxjd = res.data.xxxxjd }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) } }, getTotaljd(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let data = { xxid:user.ID } $.get('/www/public/jingdu/findxxjdbyid', data, function(res){ if(res.success==1){ that.totalJindu = res.data?res.data:{} }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, handleConfirm(){ this.$refs.baseDialog.close() }, // 筛选表格数据 filterTableData() { if (this.activeName == 'third-fiveth') { if (this.sfwcFilter) { // 使用备份数据进行筛选 this.tableData3 = this.tableData3Backup.filter(item => { const answerStatus = item['学校负责人作答数']; if (this.sfwcFilter == '已完成') { return answerStatus == '已完成' } else if (this.sfwcFilter == '未完成') { return answerStatus == '未完成' || answerStatus == null } return true }) } else { // 如果没有筛选条件,显示全部数据 this.tableData3 = [...this.tableData3Backup] } } }, handleClick(){}, handleClose(){ this.dialogVisible = false }, toggleSelection(rows) { if (rows) { rows.forEach(row => { this.$refs.multipleTable.toggleRowSelection(row); }); } else { this.$refs.multipleTable.clearSelection(); } }, handleSelectionChange(val) { this.multipleSelection = val; } }, computed:{ isZXS(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var userName = user.Username var quyubianma = userName.substring(3) console.log(quyubianma,'quyubianma') return ['110000','120000','310000','500000'].includes(quyubianma) } }, watch:{ activeName(val){ this.paramspath = [] } }, created: function(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.Roles = user.Roles var type = this.$route.query.type this.status= this.$route.query.status this.xxjd = localStorage.getItem('xxjd') this.activeName = type if(this.Roles.includes('220')){ if(this.isZXS){ this.sfxzdw = '3' } }else if(this.Roles.includes('310')){ this.sfxzdw = '3' }else if(this.Roles.includes('410')){ this.sfxzdw = '2' } if(this.activeName=='first'){ this.pageName = '工作组信息上报进度' }else if(this.activeName=='second'){ this.pageName = '学校信息上报进度' } else if(this.activeName=='third'){ this.pageName = '测评进度' if(this.Roles.includes('450')){ this.pageName = '学生测评进度' } } else if(this.activeName=='fourth'){ this.pageName = '样本校测试安排表' } else if(this.activeName=='fiveth'){ this.pageName = '文件上传进度' }else if(this.activeName == 'third-fiveth') this.pageName = '老师测评进度' this.getList() }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-ckxsdwsc-view", function(resolve, reject){ var template = ""; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), totalstep:4, xxjd:'', currentRow:{}, isyijingshenhe:false, form: { jfsl: '', dnsl: '', sflw: '', xxdk: '', czxt: '', llqmc: '', sfydn: '', sfrnzdbe:'', sfyjjbf:'', sfyjpzdb:'', sfgxdzxbb:'', sfwlsdmzyq:'', sfndkpt:'', sfncjwjdc:'', }, user:'', userProvinceCode: '', // 用户所在省份的区域编码 xxxzOption:[ { value:'3', label:'五四制', usefor:['1','2'] }, { value:'4', label:'六三制', usefor:['1','2'] }, { value:'1', label:'三年制', usefor:['4'] }, { value:'5', label:'五年制', usefor:['4'] }, { value:'10', label:'其他', usefor:['4'] }, ], reruleForm:{ sfmc:'', qxmc:'', djsmc:'', xxmc:'', xxbm:'', zgdwbm:'', xd:'', xz:'', bxxz:'', sckssj:'', scjssj:'', dlwz:'', bxlx:'', jbzlx:'', pycc:[], jbzlx:'', xxlx:'', issdf:undefined,issmcy:undefined, }, ruleForm: { sfmc:'', qxmc:'', djsmc:'', xxmc:'', xxbm:'', zgdwbm:'', xd:'', xz:'', bxxz:'', sckssj:'', scjssj:'', xxwz:'', bxlx:'', jbzlx:'', pycc:[], jbzlx:'', xxlx:'', issdf:undefined,issmcy:undefined, }, step:1, formLabelWidth: '0px', rules: { jfsl: [{ required: true, message: '机房数量不能为空', trigger: 'blur' }], dnsl: [{ required: true, message: '电脑数量不能为空', trigger: 'blur' }], sflw: [{ required: true, message: '是否联网不能为空', trigger: 'change' }], xxdk: [{ required: true, message: '下行带宽不能为空', trigger: 'blur' }], czxt: [{ required: true, message: '操作系统不能为空', trigger: 'blur' }], llqmc: [{ required: true, message: '浏览器名称不能为空', trigger: 'blur' }], sfydn: [{ required: true, message: '是否云电脑不能为空', trigger: 'change' }], xm: [ { required: true, message: '请输入学生姓名', trigger: 'blur' } ], }, loading:false, dialogVisible: false, tableData: [], multipleSelection: [], currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4, innerVisible:false, curSchoolid:'', // Tabs 与查询 activeName:'zgxx', searchPlaceholder:'请输入学校名称', searchVal:'', // 列表数据 tableDataZg:[], tableDataJyj:[], tableDataQs:[], // 分页 totalZg:0, totalJyj:0, totalQs:0, pagesZg:{ pageNo:1, pageSize:10 }, pagesJyj:{ pageNo:1, pageSize:10 }, pagesQs:{ pageNo:1, pageSize:10 }, // 全省/全市学校标签控制 hasAllSchoolsAccess: false, allSchoolsTabLabel: '全省学校', xdMap:['','小学','初中','高中','中职','高职','高校',], // 旧的 total/pages 保留但不再使用 total:0, pages:{ pageNo:1, pageSize:5 }, reruleForm: { sfmc:'',djsmc:'',qxmc:'',xxmc:'',xd:'',wxzh:'' }, ruleForm: { sfmc:'',djsmc:'',qxmc:'',xxmc:'',xd:'',wxzh:'' }, shenherules:{ sfxxjbxxzq: [{ required: true, message: '请选择学校基本信息是否正确', trigger: 'blur' }], sfschjdb: [{ required: true, message: '请选择施测环境是否达标', trigger: 'blur' }], sfrsxxzq: [{ required: true, message: '请选择年级班级/专业人数信息是否齐全', trigger: 'blur' }], sflsxxzq: [{ required: true, message: '请选择教师信息是否齐全', trigger: 'blur' }], }, reshenheForm:{ shbtgyy:'', sfschjdb:'', sfxxjbxxzq:'', sfrsxxzq:'', sflsxxzq:'', }, shenheForm:{ shbtgyy:'', sfschjdb:'', sfxxjbxxzq:'', sfrsxxzq:'', sflsxxzq:'', }, user:null, fangtanxinxiFormrules:{}, fangtanxinxiForm:{ wxzh:'', zzxlcnt:0, jzxlcnt:0, zxzzcnt:0, jygzinfo:'', wjgyinfo:'', xlpxinfo:'', isxlroom:'', roomcnt :'' }, isEdit:false, // 当前选择行及弹窗相关 curId: '', currentRow: {}, // 不参测设置相关 noParticipateForm:{ reason:'' }, noParticipateRow:null, // 地区与学段筛选(源自 dataListTable15.html) selectList:[], qybmlist:[], // 工作组详情 workGroupList:[], workGroupLoading:false, workGroupRow:null, searchForm: { shzt: '', xd: '' } } }, methods:{ htEdit(row){ const that =this console.log(row) this.$confirm('是否确认回退?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { shzt:'1', xxid:row.id, xxmc:row.xxmc } $.post("/www/public/shouye/cxy_ybxcx_update", data, function(res){ if(res.error==0){ that.getZgList() that. that.$message.success(res.message) }else{ that.$message.error(res.message) } }) }).catch(() => { }); }, allsend(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 1, userid: user.ID } $.post("/www/public/bd/sendyjdcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, sendSms(row){ var that = this this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 1, // 直管校审核 userid: row.id // 学校id } $.post("/www/public/bd/senddcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, clicktab(val){ var that = this that.step = val }, changeStep(val){ }, tongguo(){ this.shenhefn(this.curId,'2') }, butongguo(){ var that = this this.$refs.baseDialogshenhe.show() this.$nextTick(()=>{ that.$refs.shenheForm.resetFields() }) //this.shenhefn(this.curId,'-2') }, shenhefn(id,shzt){ var that = this let data ={ ...that.shenheForm, shzt, xxid: id, issmcy:'2' } $.post("/www/public/shangbao/editxxsh", data, function(res){ if(res.error==0){ that.$message.success(res.message) that.$refs.baseDialog1js.close() that.getZgList() if(shzt=='-2'){ that.$refs.baseDialogshenhe.close() } that.shenheForm = {...that.reshenheForm} }else{ that.$message.error(res.message) } }) }, nextStep(val){ this.step++ }, preStep(){ this.step-- }, search(){ if(this.activeName === 'zgxx'){ this.pagesZg.pageNo = 1 this.getZgList() } else if(this.activeName === 'qsxx'){ this.pagesQs.pageNo = 1 this.getQsList() } else { this.pagesJyj.pageNo = 1 this.getJyjList() } }, getComputerRoomInfo(id){ var that = this let data ={ xxid : id } $.get("/www/public/shangbao/findjfxx", data, function(res){ if(res.error==0){ if(res.data == null){ that.dataStatus = false }else{ that.form = res.data } }else{ that.$message.error(res.message) } }) }, // 机房信息接口复用 chongzhi(){ this.searchVal = '' if(this.activeName === 'zgxx'){ this.pagesZg = { pageNo:1, pageSize:10 } this.getZgList() } else if(this.activeName === 'qsxx'){ this.pagesQs = { pageNo:1, pageSize:10 } this.getQsList() } else { this.pagesJyj = { pageNo:1, pageSize:10 } this.getJyjList() } }, shenhecancel(){ this.$refs.baseDialog1js.close() }, getDetail(schoolid){ var that = this this.curSchoolid = schoolid const params = { xxid:schoolid, } $.get("/www/public/shangbao/get_school_info", params, function(res){ if(res.success==1){ that.ruleForm = res.data that.ruleForm.pycc = res.data.pycc?res.data.pycc.split(','):res.data.pycc that.fangtanxinxiForm = { wxzh:res.data.wxzh, zzxlcnt:res.data.zzxlcnt, jzxlcnt:res.data.jzxlcnt, zxzzcnt:res.data.zxzzcnt, jygzinfo:res.data.jygzinfo, wjgyinfo:res.data.wjgyinfo, xlpxinfo:res.data.xlpxinfo, isxlroom:res.data.isxlroom, roomcnt:res.data.roomcnt, } console.log(that.fangtanxinxiForm.pycc) }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{ this.$message.error('请求错误') }) }, changeTab(tab, event) { this.searchVal = '' if(this.activeName === 'zgxx'){ this.searchPlaceholder = '请输入学校名称' this.getZgList() }else if(this.activeName === 'qsxx'){ this.searchPlaceholder = '请输入学校名称' this.getQsList() }else{ this.searchPlaceholder = '请输入教育局名称' this.getJyjList() } }, // 补充学生学校审核相关方法 handleBCXSEdit(row){ this.curId = row.id this.currentRow = {...row} this.bcxsStatus = row.bcxsxh // 保存审核状态 // 直接显示学生列表弹窗 this.showStudentListDialog() }, // 打开师生信息(复用多步审核弹窗) viewTeacherStudentInfo(row){ this.handleEdit(row,false) // 标记当前是从全省/全市学校标签页打开的 this.isFromAllSchools = this.activeName === 'qsxx' }, handlebeforeClose(){ this.$emit('closeDialog') }, onError(){}, handleEdit(row,isyijingshenhe){ this.isyijingshenhe = isyijingshenhe this.step = 1 this.$refs.baseDialog1js.show() this.$nextTick(()=>{ //this.$refs.fangtanxinxiForm.resetFields() this.curId = row.id this.currentRow = {...row} this.getDetail(row.id) this.isEdit = true }) }, // 查看机房信息 viewComputerRoomInfo(row){ const id = row.id || row.xxid if(!id){ this.$message.error('缺少学校ID,无法查询机房信息') return } this.getComputerRoomInfo(id) this.$refs.computerRoomDialog.show() }, // 设置不参测 openNoParticipate(row){ // 每次打开先重置表单,避免保留上次填写内容 this.resetNoParticipateForm() this.noParticipateRow = row // 仅保留原因输入,不再加载或使用区域数据 this.$refs.noParticipateDialog.show() }, // 取消不参测,关闭并重置 cancelNoParticipate(){ this.$refs.noParticipateDialog.close() this.resetNoParticipateForm() }, submitNoParticipate(){ const that = this const xxid = this.noParticipateRow ? (this.noParticipateRow.id || this.noParticipateRow.xxid) : '' const bccyy = (this.noParticipateForm.reason || '').trim() if(!xxid){ this.$message.error('缺少学校ID,无法提交不参测设置') return } if(!bccyy){ this.$message.warning('请填写不参测原因') return } const params = { xxid: xxid, bccyy: bccyy } $.post('/www/public/newcy/xxszwbcc', params, function(res){ if(res && (res.success==1 || res.error==0)){ that.$message.success(res.message || '设置不参测成功') that.$refs.noParticipateDialog.close() that.resetNoParticipateForm() // 刷新列表 if(typeof that.getZgList === 'function') that.getZgList() if(typeof that.getQsList === 'function') that.getQsList() }else{ that.$message.error(res.message || '设置不参测失败') } }).fail(function(){ that.$message.error('请求错误') }) }, // 重置不参测表单内容 resetNoParticipateForm(){ this.noParticipateForm = { reason:'' } }, // 教育局工作组详情 openWorkGroupDetail(row){ const that = this this.workGroupRow = row const xxid = row && (row.id || row.xxid) if(!xxid){ this.$message.error('缺少教育局ID,无法查询工作组详情') return } this.workGroupLoading = true this.workGroupList = [] this.$refs.workGroupDialog.show() $.get('/www/public/newcy/gzzlxrlb', { xxid: xxid }, function(res){ if(res && (res.success==1 || res.error==0)){ that.workGroupList = (res.data || []).map(function(item){ var sfllyVal = item.sflly var isLiaison = (sfllyVal === '1' || sfllyVal === 1 || sfllyVal === true) return Object.assign({}, item, { sflly: isLiaison ? '是' : '否' }) }) }else{ that.$message.error(res.message || '获取工作组详情失败') } that.workGroupLoading = false }).fail(function(){ that.$message.error('请求错误') that.workGroupLoading = false }) }, // 省市区选择已移除 // 加载区域树(来自 dataListTable15.html) getSelect(){ const that = this // 获取当前用户所在省份的区域编码(优先用当前行,其次用户信息) var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var userProv = user.UserFilter && user.UserFilter.qybm ? user.UserFilter.qybm.substring(0, 2) : (user.qybm ? String(user.qybm).substring(0,2) : ''); this.userProvinceCode = this.userProvinceCode || userProv; // 将省份编码作为参数,让后端尽量只返回该省份的数据 const params = {}; if (this.userProvinceCode) { params.sfbm = this.userProvinceCode; } $.post('/www/public/shouye/cxy_ssqxldcx', params, function(res){ if(res && res.error == 0){ const list = res.data || []; // 兜底:前端再次过滤,确保只保留当前省份 if (that.userProvinceCode) { that.selectList = list.filter(item => item.qybm && String(item.qybm).substring(0,2) === that.userProvinceCode) } else { that.selectList = list } } }) }, // 根据区域编码获取省市区名称 getAreaNames(code){ const result = { sfmc:'', djsmc:'', qxmc:'' } const list = this.selectList || [] if(!code || !list.length) return result const findPath = (nodes, target, path=[]) => { for(let i=0;i { if (valid) { var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.shenhefn(this.curId,'-2') } else { console.log('error submit!!'); return false; } }); }, submit(){ var that = this this.$refs['ruleForm'].validate((valid) => { if (valid) { const params = { xxmc:that.ruleForm.xxmc, xd:that.ruleForm.xd, schoolid:that.ruleForm.id, type:'0' } $.post("/www/public/shangbao/editschooldycsh", params, function(res){ if(res.success==1){ that.$message.success(res.message) that.$refs.baseDialog1js.close() that.getZgList() }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) } else { console.log('error submit!!'); return false; } }); }, // 新接口:全省/全市学校列表 getQsList(){ const that = this const params = { xxmc: this.searchVal, ...this.searchForm, pageNo: this.pagesQs.pageNo, pageSize: this.pagesQs.pageSize } $.get('/www/public/newcy/jyjdzgxxlb_qb', params, function(res){ if(res && (res.success==1 || res.error==0)){ that.tableDataQs = res.data || [] that.totalQs = res.total || (res.data ? res.data.length : 0) }else{ that.$message.error(res.message || '获取学校列表失败') that.tableDataQs = [] that.totalQs = 0 } }).fail(()=>{ that.$message.error('请求错误') }) }, // 分页(全省/全市学校) handleSizeChangeQs(val){ this.pagesQs.pageSize = val this.pagesQs.pageNo = 1 this.getQsList() }, handleCurrentChangeQs(val){ this.pagesQs.pageNo = val this.getQsList() }, // 新接口:直管学校列表 getZgList(){ const that = this const params = { xxmc: this.searchVal, ...this.searchForm, pageNo: this.pagesZg.pageNo, pageSize: this.pagesZg.pageSize } $.get('/www/public/newcy/jyjdzgxxlb', params, function(res){ if(res && (res.success==1 || res.error==0)){ that.tableDataZg = res.data || [] that.totalZg = res.total || (res.data ? res.data.length : 0) }else{ that.$message.error(res.message || '获取直管学校列表失败') that.tableDataZg = [] that.totalZg = 0 } }).fail(()=>{ that.$message.error('请求错误') }) }, // 新接口:下属教育局列表 getJyjList(){ const that = this const params = { sssjxzq: this.searchVal, pageNo: this.pagesJyj.pageNo, pageSize: this.pagesJyj.pageSize } $.get('/www/public/newcy/jyjdzgjyjlb', params, function(res){ if(res && (res.success==1 || res.error==0)){ that.tableDataJyj = res.data || [] that.totalJyj = res.total || (res.data ? res.data.length : 0) }else{ that.$message.error(res.message || '获取教育局列表失败') that.tableDataJyj = [] that.totalJyj = 0 } }).fail(()=>{ that.$message.error('请求错误') }) }, handleConfirm(){ this.$refs.baseDialogjs.close() }, // 分页(直管学校) handleSizeChangeZg(val){ this.pagesZg.pageSize = val this.pagesZg.pageNo = 1 this.getZgList() }, handleCurrentChangeZg(val){ this.pagesZg.pageNo = val this.getZgList() }, // 分页(教育局) handleSizeChangeJyj(val){ this.pagesJyj.pageSize = val this.pagesJyj.pageNo = 1 this.getJyjList() }, handleCurrentChangeJyj(val){ this.pagesJyj.pageNo = val this.getJyjList() }, // 行操作可见性 canViewJf(row){ const v = String(row.schjstu) return v === '1' }, canViewSs(row){ const v = String(row.xxxxsfsb) return v === '1' }, canSetNoParticipate(row){ const v = String(row.shzt) // 仅判断是否已是不参测状态 return v !== '-1' }, handleClick(){}, handleClose(){ console.log(1) this.dialogVisible = false }, toggleSelection(rows) { if (rows) { rows.forEach(row => { this.$refs.multipleTable.toggleRowSelection(row); }); } else { this.$refs.multipleTable.clearSelection(); } }, handleSelectionChange(val) { this.multipleSelection = val; } }, computed:{ isXCG(){ if(['1','2','3'].indexOf(this.ruleForm.xxjd)!=-1){ return true } return false }, workGroupColumns(){ return [ { prop:'xm', label:'姓名' }, { prop:'sjh', label:'手机号' }, { prop:'yx', label:'邮箱' }, { prop:'xb', label:'性别' }, { prop:'zw', label:'职务' }, { prop:'dw', label:'单位' }, { prop:'ovalue', label:'角色' }, { prop:'sflly', label:'是否联络员' }, ] } }, watch:{ "ruleForm.xxjd"(val){ if(['1','2','3'].indexOf(val)!=-1){ this.ruleForm.xh = '' }else{ this.ruleForm.xjh = '' } } }, created: function(){ this.user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.xxjd = localStorage.getItem('xxjd') // 获取当前用户所在省份的区域编码(前两位) if (this.user && this.user.UserFilter && this.user.UserFilter.qybm) { this.userProvinceCode = this.user.UserFilter.qybm.substring(0, 2) } // 检查用户角色,设置全省/全市学校标签访问权限 if (this.user && this.user.Roles) { if (this.user.Roles.includes('220')) { this.hasAllSchoolsAccess = true this.allSchoolsTabLabel = '全省学校' } else if (this.user.Roles.includes('310')) { this.hasAllSchoolsAccess = true this.allSchoolsTabLabel = '全市学校' } } // 预加载省市区数据供不参测弹窗使用 this.getSelect() // 默认加载直管学校列表 this.getZgList() if(['5','6'].includes(this.xxjd)){ this.totalstep = 3 }else{ this.totalstep = 2 } }, mounted: function(){ //this.$refs.baseDialog1js.show() }, props: ['title', 'data', 'config','disableStatus'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-classInfoUploadshenhesc", function(resolve, reject){ var template = "
\n
\n
\n \n 查看已修改学生名单\n
\n \n
\n \n\n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n
\n
\n
\n 查看已修改学生名单\n ×\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n \n \n
\n \n \n \n \n \n \n \n
\n
\n
\n \n
\n \n \n \n \n \n \n \n
\n
\n
"; return ( function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid() , tableData: [], teaList:[], multipleSelection: [], loading: false, currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4, smzt:'', stuList: [], total:0, xxjd:'', pages:{ pageNo:1, pageSize:5 }, // 学生名单弹框相关数据 studentListDialogVisible: false, activeTab: 'bcyxs', // 不参与学生名单 bcyxsData: [], bcyxsTotal: 0, bcyxsPages: { pageNo: 1, pageSize: 10 }, // 学校自行添加学生 tjxsData: [], tjxsTotal: 0, tjxsPages: { pageNo: 1, pageSize: 10 }, // 修改教育局学生 xgxsData: [], xgxsTotal: 0, xgxsPages: { pageNo: 1, pageSize: 10 }, ruleForm:{ nj:'', bjmc:'', bjrs:'' }, njOption:[], rules: { bjmc: [ { required: true, message: '请输入班级名称', trigger: 'blur' } ], bjrs: [ { required: true, message: '请输入班级人数', trigger: 'blur' } ], }, } }, methods: { xschakan(row) { console.log(row,'111') this.getXSDetail(row) this.$refs.jsxxxxjxgshenhe.show() }, getXSDetail(row){ var that = this const params = { bjid: row.id } $.get("/www/public/shimingimport/findbjxs", params, function(res){ if(res.success==1){ const xbMap = new Map([['1', '男'], ['2', '女']]) const sfwczdMap = new Map([['0', '未完成'], ['1', '已完成']]) that.stuList = res.data.length ? res.data.map(s => ({ ...s, sfwczd: sfwczdMap.get(s.sfwczd) })) : [] }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) }, getDetail(row){ var that = this const params = { nj:row.nj, bjmc:row.bjmc, xxid:this.currentRow.id } $.get("/www/public/shangbao/findsbbjlsmc", params, function(res){ if(res.success==1){ that.teaList = res.data }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) }, showDetail(row){ this.getDetail(row) this.$refs.jsxxxxjxgshenhe.show() }, nextStep(){ this.$emit('nextStep') }, submit(){ var that = this this.$refs['ruleForm'].validate((valid) => { if (valid) { const params = { ...this.ruleForm } $.post("/www/public/shangbao/editbjinfo", params, function(res){ if(res.success==1){ that.$message.success(res.message) that.$refs.baseDialog1js.close() that.getList() }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) } else { console.log('error submit!!'); return false; } }); }, handleEdit(row){ this.ruleForm = {...row} this.$refs.baseDialog1js.show() }, getList(){ var that = this const params = { xxxid:that.currentRow.id, ...this.pages } $.get("/www/public/shangbao/findbjinfo", params, function(res){ if(res.success==1){ that.tableData = res.data that.total = res.total }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, onError(){}, // /www/public/shangbao/findbjinfo download(){ var that = this var xxjd = localStorage.getItem('xxjd') //1zz 2gz 3gx var type = xxjd /*switch(xxjd) { case 1: alert(1) break; case 2: 代码块 break; default: 默认代码块 } */ const params = { type, } axios({ method: 'get', url: '/www/public/shangbao/bjImportTmepDownload', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '班级信息导入模版.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, customUpload(params) { var that = this var xxjd = localStorage.getItem('xxjd') var importType = xxjd that.loading = true // params是一个对象,包含了file和fileList, // 但是这个params参数可能每个版本不一样值就不一样,到时候自己打印看看, // 反正file的值就是原始的File对象 // 如果extraParams是个单独的值,直接加入 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const formData = new FormData() console.log(params.file,'params.file') formData.append('file', params.file) // 这是file入参,文件信息 formData.append('type', importType) // 如果extraParams是个对象,循环加入formData /*for (const key in this.extraParams) { formData.append(key, this.extraParams[key]) } */ // 调接口 axios.post('/www/public/shangbao/import_bj_info', formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ that.$message.success('导入成功') that.loading = false that.getList() }else{ that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false console.error(error); }); }, del(row){ var that = this let params = {id:row.id} /*if(row.id){ params = { ids:JSON.stringify([row.id]), } }else if(that.multipleSelection.length){ params.ids = [] console.log( that.multipleSelection,' that.multipleSelection') that.multipleSelection.forEach(item=>{ params.ids.push(item.id) }) params.ids = JSON.stringify(params.ids) console.log( params,' params') }else{ that.$message.warning('请先选择数据') }*/ $.post("/www/public/shangbao/deletebjinfo", params, function(res){ if(res.success==1){ that.$message.success('删除成功') that.getList() }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ that.$message.success('请求错误') }) }, handleSelectionChange(val) { console.log(val,'val') this.multipleSelection = val; }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pagesize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.getList() }, // 显示学生名单弹框 showStudentListDialog() { this.studentListDialogVisible = true; this.activeTab = 'bcyxs'; this.loadBcyxsData(); }, // 关闭学生名单弹框 closeStudentListDialog() { this.studentListDialogVisible = false; }, // tab切换处理 handleTabClick(tab) { if (tab.name === 'bcyxs') { this.loadBcyxsData(); } else if (tab.name === 'tjxs') { this.loadTjxsData(); } else if (tab.name === 'xgxs') { this.loadXgxsData(); } }, // 加载不参与学生名单数据 loadBcyxsData() { var that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; const params = { xxid: this.currentRow ? this.currentRow.id : '', pageNo: this.bcyxsPages.pageNo, pageSize: this.bcyxsPages.pageSize }; $.get("/www/public/daoru/shfindbcyxs", params, function(res){ if(res.success == 1 || res.error == 0){ that.bcyxsData = res.data || []; that.bcyxsTotal = res.total || 0; } else { that.$message.error(res.message || '获取不参与学生名单失败'); } }).fail((xhr,status,error)=>{ that.$message.error('请求失败'); }); }, // 加载学校自行添加学生数据 loadTjxsData() { var that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; const params = { xxid: this.currentRow ? this.currentRow.id : '', pageNo: this.tjxsPages.pageNo, pageSize: this.tjxsPages.pageSize }; $.get("/www/public/daoru/shfindtjxs", params, function(res){ if(res.success == 1 || res.error == 0){ that.tjxsData = res.data || []; that.tjxsTotal = res.total || 0; } else { that.$message.error(res.message || '获取学校自行添加学生失败'); } }).fail((xhr,status,error)=>{ that.$message.error('请求失败'); }); }, // 加载修改教育局学生数据 loadXgxsData() { var that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; const params = { xxid: this.currentRow ? this.currentRow.id : '', pageNo: this.xgxsPages.pageNo, pageSize: this.xgxsPages.pageSize }; $.get("/www/public/daoru/shfindxgxs", params, function(res){ if(res.success == 1 || res.error == 0){ that.xgxsData = res.data || []; that.xgxsTotal = res.total || 0; } else { that.$message.error(res.message || '获取修改教育局学生失败'); } }).fail((xhr,status,error)=>{ that.$message.error('请求失败'); }); }, // 不参与学生名单分页处理 handleBcyxsSizeChange(val) { this.bcyxsPages.pageSize = val; this.bcyxsPages.pageNo = 1; this.loadBcyxsData(); }, handleBcyxsCurrentChange(val) { this.bcyxsPages.pageNo = val; this.loadBcyxsData(); }, // 学校自行添加学生分页处理 handleTjxsSizeChange(val) { this.tjxsPages.pageSize = val; this.tjxsPages.pageNo = 1; this.loadTjxsData(); }, handleTjxsCurrentChange(val) { this.tjxsPages.pageNo = val; this.loadTjxsData(); }, // 修改教育局学生分页处理 handleXgxsSizeChange(val) { this.xgxsPages.pageSize = val; this.xgxsPages.pageNo = 1; this.loadXgxsData(); }, handleXgxsCurrentChange(val) { this.xgxsPages.pageNo = val; this.loadXgxsData(); } }, computed:{ }, created: function(){ this.getList() var xxjd = localStorage.getItem('xxjd')||'' this.xxjd = xxjd this.smzt=this.$route.query.smzt var njOption switch(xxjd) { case '1': njOption = ['小学四年级','小学五年级','小学六年级'] break; case '2': njOption = ['初一','初二','初三'] break; case '3': njOption = ['高一','高二','高三'] break; case '4': njOption = ['中职一年级','中职二年级','中职三年级'] break; case '5': njOption = ['高职一年级','高职二年级','高职三年级'] break; case '6': njOption = ['大一','大二','大三','大四','大五','硕士一年级','硕士二年级','硕士三年级','博士一年级','博士二年级','博士三年级'] break; default: njOption = [] } this.njOption = njOption }, mounted: function(){ }, props: ['title', 'data', 'config','currentRow'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-classinfoUploadgjshenhesc", function(resolve, reject){ var template = "\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid() }; }, methods: { }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-allgzzshenhesc-view", function(resolve, reject){ var template = "
\n \n
\n \n \n \n \n \n \n \n \n \n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), activeName: 'first', }; }, methods: { handleClick(tab, event) { console.log(tab, event); }, }, created: function(){ this.user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} if(this.user.Roles.includes('410')){ this.activeName = 'second' } }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-zgxgzzshenhesc", function(resolve, reject){ var template = "
\n
\n
\n
\n \n
\n \n \n \n 重置\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n {{item.xxmc}} \n
\n
\n\n
\n
\n
\n 工作组:{{item.value.length}}人 \n 查看\n\n
\n
\n
\n
\n
\n \n \n
\n \n

\n 目前学校均未上报工作组信息\n

\n
\n
\n
\n \n \n \n \n \n \n \n
\n"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), Form:{ reason:'' }, rules: { reason: [ { required: true, message: '请输入驳回原因', trigger: 'blur' } ], }, cur:{}, ftsj:new Date(), yyzt:'', mc:'', pages:{ pageSize:9, pageNo:1, }, activeName :'first', areaCode:'', total:0, listData:[], paramspath:[], user:{}, currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4 }; }, methods: { showbutongguo(){ this.$refs.butongguo.show() }, gzzshenqingxiugai(item){ this.cur = {...item} this.$refs.gzzshenqingxiugai.show() }, shenhexgsq(type,gzzid){ var that = this //var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} //var gzzid = user.ID var zzsjh = '' that.cur.value.forEach(item=>{ if(item.sfzz){ zzsjh = item.sjh } }) const params = { gzzid:gzzid?gzzid:that.cur.id, xgzt:type, msg:that.Form.reason, zzsjh } $.post("/www/public/shangbao/gzz-cxsqxggzz", params, function(res){ if(res.success==1){ if(type=='0'){ that.$message.success('已同意') }else{ that.$message.success('已同意修改') } if(type=="2"){ that.$refs.butongguo.close() } that.$refs.gzzshenqingxiugai.close() that.getList() }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message.error(error||'未知错误') }) }, handleclose(row){ this.getList({ mc:'', username: row.username, ...this.pages,}) }, handleRowClick(row){ var that = this console.log(row,'row') var len = this.paramspath.length if(len==2) return this.$message.warning('无法往下查看了') this.getList({ mc:'', username: row.username, ...this.pages,}) }, goback(){ var len = this.paramspath.length if(len>1){ this.paramspath.pop() this.getList() }else{ return } }, showDialog(item){ this.$refs.gzzshenheDialog.show(JSON.stringify(item)) }, chongzhi(){ this.mc = '' this.getList() }, formatDate(date) { const year = date.getFullYear(); const month = (date.getMonth() + 1).toString().padStart(2, '0'); const day = date.getDate().toString().padStart(2, '0'); return `${year}-${month}-${day}`; }, handleDateChange(val){ console.log(val,'va;') this.getList() }, changeYyzt(val){ this.yyzt = val this.getList() }, getList(param){ var that = this let params console.log(this.pages,'pages') params = { mc:that.mc, username: that.user.Username, pageSize:that.pages.pageSize, pageNo:that.pages.pageNo, } var url = "/www/public/shangbao/findzgxgzzList_sc" if(that.user.Roles.includes('220')){ url = "/www/public/shangbao/findzgxgzzList_new" } console.log(params,'params') $.get(url, params, function(res){ if(res.success==1){ that.listData = res.data that.total = res.total var len = that.paramspath.length if(len!=0){ if(that.paramspath[len-1].username!=params.username){ that.paramspath.push(params) } }else{ that.paramspath.push(params) } }else{ this.$message.error(res.message) } }).fail((xhr,status,error)=>{}) }, goyuyue(item){ this.$router.push({ path:"/XDyuyue", query:{ item:JSON.stringify(item) } }) }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.getList() } }, created: function(){ this.user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.schoolid = this.user.ID this.areaCode = this.user.Username.substring(this.user.Username.length-6,this.user.Username.length) this.Nickname = this.user.Nickname this.yhjs = this.user.UserFilter.urole this.getList() }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDzlxz01sc-view", function(resolve, reject){ var template = "
\n \n \n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), uploading:false, percentage:0, showpercent:false, customColor: '#409eff', currentId:'', loading:false, pages:{ pageSize:10, pageNo:1 }, List:[], typeMap:["/jpglogo.png","/yasuologo.png","/mp4logo.png","/wordlogo.png","/excellogo.png","/pdflogo.png"], loopData0: [ ], loopData4: [ ], loopData1:[], loopData2:[], videoList:[], videoDialogVisible:false, currentVideoUrl:'', total:0, constants: {}, studentTestLinks: [ { key: 'primary_pc', label: '小学(电脑端)', url: 'http://xinlijc.bnu.edu.cn/www/dd/vue/spa/xljk?#/loginPrimary' }, { key: 'middle_pc', label: '初高中中职(电脑端)', url: 'http://xinlijc.bnu.edu.cn/www/dd/vue/spa/xljk?#/loginMiddle' }, { key: 'primary_h5', label: '小学(手机端)', url: 'https://xinlijc.bnu.edu.cn/www/dd/vue/spa/xljk?#/loginPrimaryH5' }, { key: 'middle_h5', label: '初高中中职(手机端)', url: 'https://xinlijc.bnu.edu.cn/www/dd/vue/spa/xljk?#/loginMiddleH5' }, ], }; }, methods: { handleVideoClose(){ try{ const v = this.$refs.videoPlayer if(v && typeof v.pause === 'function'){ v.pause() } }catch(e){} this.currentVideoUrl = '' }, handleVideoClosed(){ try{ const v = this.$refs.videoPlayer if(v){ v.removeAttribute('src') v.load() } }catch(e){} }, copyLink(url){ const text = String(url || ''); const done = ()=> this.$message && this.$message.success('链接已复制'); try{ if(navigator.clipboard && window.isSecureContext){ navigator.clipboard.writeText(text).then(done).catch(()=> this.fallbackCopyText(text)); }else{ this.fallbackCopyText(text); } }catch(e){ this.fallbackCopyText(text); } }, fallbackCopyText(text){ try{ const ta = document.createElement('textarea'); ta.value = text; ta.setAttribute('readonly',''); ta.style.position = 'fixed'; ta.style.top = '-1000px'; document.body.appendChild(ta); ta.select(); const ok = document.execCommand('copy'); document.body.removeChild(ta); if(ok){ this.$message && this.$message.success('链接已复制'); }else{ this.$message && this.$message.error('复制失败,请手动复制'); } }catch(e){ this.$message && this.$message.error('复制失败,请手动复制'); } }, handlebeforeClose(){ this.$emit('closeDialog') }, show(){ console.log(this.$refs.baseDialoggzz0,'baseDialoggzz0') this.$refs.baseDialoggzz0.show() }, handleConfirm(){ this.$refs.baseDialogjs.close() }, /* // customUpload(params,item) { var that = this that.loading = true var xxjd = localStorage.getItem('xxjd') //1小学 2初中 3高中 4中职 5高职 7本科 8硕士 9博士 var importType if(['1','2','3'].indexOf(xxjd)!=-1){ importType = '1' }else{ importType = '2' } // params是一个对象,包含了file和fileList, // 但是这个params参数可能每个版本不一样值就不一样,到时候自己打印看看, // 反正file的值就是原始的File对象 const formData = new FormData() console.log(params.file,'params.file') formData.append('file', params.file) // 这是file入参,文件信息 // 如果extraParams是个对象,循环加入formData for (const key in this.extraParams) { formData.append(key, this.extraParams[key]) } // 如果extraParams是个单独的值,直接加入 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var roles=user.UserFilter.urole // 调接口 axios.post(`/www/public/shangbao/addfiletemprecord?filetempid=${item.id}`, formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ that.$message.success(data.message) that.loading = false that.getList() }else{ that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false that.$message.error('文件上传异常!') console.error(error); }); }, */ getMd5(file) { return new Promise((resolve) => { // 对文件对象的处理 const spark = new SparkMD5.ArrayBuffer()// md5的ArrayBuffer加密类 var fileReader = new FileReader(); fileReader.readAsArrayBuffer(file); // fileReader.onload为异步函数,要放到Promise对象中,等待状态的变更后再返回生成的md5值 fileReader.onload = function (e) { spark.append(e.target.result); resolve(spark.end()); }; }); }, async uploadFile(params,item){ if(this.loading){ return this.$message.error('有文件正在上传,请稍后再试!') } var that = this that.currentId = item.id that.loading = true that.percentage = 0 var xxjd = localStorage.getItem('xxjd') //1小学 2初中 3高中 4中职 5高职 7本科 8硕士 9博士 var importType if(['1','2','3'].indexOf(xxjd)!=-1){ importType = '1' }else{ importType = '2' } var successhh = 0 that.loading = true const file = params.file console.log(file,'file') const fileReader = new FileReader()// 文件读取 console.log(file) const chunkSize = 1024 * 1024 * 6 let fileChunkedList = [] // 文件分片完成之后的数组 const name=file.name let md5 = await that.getMd5(file) // 文件开始分片,push到fileChunkedList数组中, 并用第一个分片去计算文件的md5 for (let i = 0; i < file.size; i = i + chunkSize) { const tmp = file.slice(i, Math.min((i + chunkSize), file.size)) if (i === 0) { fileReader.readAsArrayBuffer(tmp) } fileChunkedList.push(tmp) } console.log(fileChunkedList,'数组') const chunks=fileChunkedList.length that.showpercent = true for (let i = 1; i <= fileChunkedList.length; i =i+1) { const formData = new FormData() formData.append('imgFile', fileChunkedList[i-1],file.name) formData.append('chunk', i) formData.append('old', that.old) formData.append('size', file.size) formData.append('name', name) formData.append('md5', md5) for (var value of formData.values()) { console.log(value); } try { const result = await that.uploads(formData,item.id) console.log(result,'result') if(result){ if(result.status==200){ if(result.data){ //console.log(result.data,'result.data') const data = result.data that.old = data.data if(data.success==1){ successhh += 1 that.percentage = ((successhh/fileChunkedList.length)*100).toFixed(0) console.log(that.percentage,' that.percentage') if(data.message=="上传成功"&&successhh{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, XXexportFn(activeName){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { schoolid, } var url var name if(activeName=='first'){ url = "/www/public/shangbao/exportStudent" name = '学生账号.xls' }else if(activeName == 'second'){ url = "/www/public/shangbao/exportteather" name = '教师账号.xls' }else{ url = "/www/public/shouye/px_webftybm_dcbxftyzh" name = '访谈员账号.xls' } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, DexportFn(){ var that = this var name //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var username = user.Username var bm = username.substring(3) let type if(user.Roles.includes('220')){ type='1' name = '市级管理员账号信息.xls' if(['110000','120000','310000','500000'].includes(bm)){ type='1' name = '区县管理员账号信息.xls' } }else if(user.Roles.includes('310')){ type='2' name = '区县管理员账号信息.xls' } const params = { username:user.Username, type, state:'1' } axios({ method: 'get', url: '/www/public/shangbao/dcsqxzh', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, exportFn(){ var that = this //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let type if(user.Roles.includes('220')){ type='1' }else if(user.Roles.includes('310')){ type='2' } const params = { username:user.Username, type, state:'1', } axios({ method: 'get', url: '/www/public/shangbao/exportzgxxx', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', '直管校管理员账号.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, delfn(item){ var that = this const params = { id:item.recordId, tempid:item.filetempid } $.post("/www/public/shangbao/deletefilerecord", params, function(res){ if(res.error==0){ that.$message.success('删除成功') that.getList() }else{ that.$message.error(res.message) } }).fail((err)=>{ that.loading = false that.$message({ type: "error", message: '请求错误' }) }) }, yulan(item){ window.open('/core/UForm/fileviewer/r_temp_file_record?ff=id&fv='+item.recordId,'_blank') }, onError(){}, // customUpload(params,item) { var that = this that.loading = true var xxjd = localStorage.getItem('xxjd') //1小学 2初中 3高中 4中职 5高职 7本科 8硕士 9博士 var importType if(['1','2','3'].indexOf(xxjd)!=-1){ importType = '1' }else{ importType = '2' } // params是一个对象,包含了file和fileList, // 但是这个params参数可能每个版本不一样值就不一样,到时候自己打印看看, // 反正file的值就是原始的File对象 const formData = new FormData() console.log(params.file,'params.file') formData.append('file', params.file) // 这是file入参,文件信息 // 如果extraParams是个对象,循环加入formData for (const key in this.extraParams) { formData.append(key, this.extraParams[key]) } // 如果extraParams是个单独的值,直接加入 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var roles=user.UserFilter.urole // 调接口 axios.post(`/www/public/shangbao/addfiletemprecord?filetempid=${item.id}`, formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ that.$message.success(data.message) that.loading = false that.getList() }else{ that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false that.$message.error('文件上传异常!') console.error(error); }); }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.getList() }, exportFn1(){ var that = this //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { username:user.Username, djsmc:that.djsmc } axios({ method: 'get', url: '/www/public/shangbao/exportxqnxxdc', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', '辖区内学校管理员账号.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, teshudownload(item){ if(item.id==3||item.id==4||item.id==8){ const that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let data = { xxid:user.ID } $.post("/www/public/chouyang/sb_findzhxfzt", data, function(res){ if(res.error==0){ if(item.id==3){ that.XXexportFn('first') }else if(item.id==4){ that.XXexportFn('second') }else if(item.id==8){ that.xljkfzrdown() } }else{ that.$message.error(res.message) } }) } if(item.id==7){ const that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let data = { xxid:user.ID } $.post("/www/public/chouyang/sb_findbjxfzt", data, function(res){ if(res.error==0){ if(item.id==7){ that.bjxxdown() } }else{ that.$message.error(res.message) } }) } if(item.id==2){ this.exportFn1() }else if(item.id==1){ this.DexportFn() }else if(item.id==5){ this.YBXCYBJexportFn() }else if(item.id==6){ this.ptljurl() }else if(item.id==9){ this.downcyzyls() }else if(item.id==10){ this.cqzbdown() }else if(item.id==11){ this.ybxllymddown() } }, ybxllymddown(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { } axios({ method: 'get', url: '/www/public/download/xxgzzlly_byqybm_dc', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '样本校联络员名单.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败失败') } }) }, cqzbdown(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { schoolid : user.ID } axios({ method: 'get', url: '/www/public/shangbao/dccqzbzhff', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '【20241206】测前准备及参测师生账号分发说明(基教).pdf'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败失败') } }) }, downcyzyls(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { schoolid : user.ID } axios({ method: 'get', url: '/www/public/chouyang/sb-dczy', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '抽样专业列表.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }) }, bjxxdown(activeName){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { } var url = '/www/public/shangbao/exportbj_new' var name = '班级信息.xls' axios({ method: 'get', url, params: { schoolid }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, xljkfzrdown(activeName){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { } var url = '/www/public/shangbao/exportxxfzr' var name = '学校负责人登录账号.xls' axios({ method: 'get', url, params: { schoolid }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, ptljurl(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var xxjd = localStorage.getItem('xxjd') var schoolid = user.ID var type = '' if(['1'].includes(xxjd)){ type='1' }else if(['2','3','4'].includes(xxjd)){ type='2' }else if(['5','6'].includes(xxjd)){ type='3' } const params = { type } var url = '/www/public/shangbao/downloadUrl' var name = '全国学生心理健康监测与服务平台链接.url' axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, download(item){ var that = this let params = {} var name if(item.isupload=='1'){ params = { id :item.recordId, type:'2' } name = item.originFilename }else if(item.isupload=='2'){ params = { id :item.filetempid, type:'1' } name = item.filename } // window.open(item.file) axios({ method: 'get', url: '/www/public/shangbao/downloadtempFile', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, getFileTypeUrl(name){ var url = '' if(name){ var houzhui = this.gettype(name) if(houzhui=='pdf'){ url = '/content/image/xljkImg/pdf.png' }else if(houzhui=='xls'||houzhui=='xlsx'){ url = '/content/image/xljkImg/exceltubiao.png' }else if(houzhui=='jpg'||houzhui=='jpeg'||houzhui=='png'){ url = '/content/image/xljkImg/jpg.png' }else if(houzhui=='doc'||houzhui=='docx'){ url = '/content/image/xljkImg/word.png' }else{ url = '/content/image/xljkImg/qtwjlx.png' } } return url }, gettype(name){ var houzhui if(name){ var arr = name.split('.') houzhui = arr[1] } return houzhui }, getAccept(name){ var accept var houzhui = this.gettype(name) if(houzhui=='xls'||houzhui=='xlsx'){ accept = '.xls,.xlsx' }else if(houzhui=='doc'||houzhui=='docx'||houzhui=='pdf'||houzhui=='zip'){ accept = '.doc,.docx,.pdf,.zip,.rar' }else{ accept = '.zip,.rar' } return accept }, getList(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var type if(user.Roles.includes('450')){ var xd = localStorage.getItem('xxjd') if(['1','2','3','4'].includes(xd)){ type='1' }else{ type='2' } } const params = { type, } $.get("/www/public/shangbao/findfiletyperecord", params, function(res){ if(res.success==1){ console.log(res) that.loopData0 = res.data.filter(item=>item.sfsc=='0') //that.loopData1 = res.data.filter(item=>item.sfsc=='1') //that.loopData2 = res.data.filter(item=>item.sfsc=='2') //that.loopData4 = res.data.filter(item=>item.sfsc=='4') }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, // 操作视频相关(按你提供的接口结构:kcfile 为视频,kcfm 为封面) fetchVideos(){ // const id = '0a5498ad-f85e-47f1-bda3-c189847c0659' const id = 'f875d2ed-74c1-4da0-8eb7-fea9e2797015' axios.get('/www/public/pxks/pxNrInfo', { params: { id } }) .then(({data})=>{ try { this.videoList = this.normalizeVideoResponse(data) } catch(e) { console.error('normalize video error', e) this.videoList = [] } }).catch(err=>{ console.error('fetch videos error', err) this.videoList = [] }) }, normalizeVideoResponse(resp){ const root = (resp && resp.data!==undefined) ? resp.data : resp // root 为数组,每项含 kc(视频列表)、ks(考试等),我们仅取 kc。 const sections = Array.isArray(root) ? root : [] const exts = ['.mp4','.mov','.m4v','.m3u8','.flv','.webm'] const list = [] sections.forEach(sec=>{ const kc = Array.isArray(sec && sec.kc) ? sec.kc : [] kc.forEach(it=>{ const url = it.kcfile || '' const name = it.kcmc || '操作视频' const cover = it.kcfm || '' const u = (url||'').toLowerCase() if(u && exts.some(e=>u.endsWith(e))){ list.push({ name, url, cover }) } }) }) return list }, extractUrl(item){ return item && (item.kcfile||item.url||item.fileUrl||item.file||item.filePath||item.path||item.playUrl||item.src) || '' }, playVideo(item){ const url = this.extractUrl(item) if(!url){ return this.$message.error('无法播放:视频地址缺失') } this.currentVideoUrl = url this.videoDialogVisible = true }, downloadVideo(item){ const url = this.extractUrl(item) if(!url){ return this.$message.error('无法下载:视频地址缺失') } // 解析文件名(优先使用名称 + 扩展名) let baseName = (item && (item.name || item.kcmc)) || '视频' baseName = String(baseName).replace(/[\\/:*?"<>|]/g,'_').trim() || '视频' let ext = '' try{ const u = new URL(url, window.location.origin) const pathname = u.pathname || '' const last = (pathname.split('/').pop() || '').split('?')[0].split('#')[0] const m = last.match(/\.[a-z0-9]+$/i) ext = m ? m[0] : '' const sameOrigin = u.origin === window.location.origin const filename = `${baseName}${ext}` if(sameOrigin){ axios({ method:'get', url, responseType:'blob' }).then(res=>{ const ok = (res && (res.status===200 || (res.request && res.request.status===200))) if(ok){ let binaryData = [] binaryData.push(res.data) var blobUrl = window.URL.createObjectURL(new Blob(binaryData)) var aLink = document.createElement('a') aLink.href = blobUrl aLink.setAttribute('download', filename) document.body.appendChild(aLink) aLink.click() document.body.removeChild(aLink) window.URL.revokeObjectURL(blobUrl) this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }).catch(err=>{ // 同源失败时降级为直接触发下载 var aLink = document.createElement('a') aLink.href = url aLink.setAttribute('download', filename) aLink.rel = 'noopener' document.body.appendChild(aLink) aLink.click() document.body.removeChild(aLink) }) }else{ // 跨域资源:尝试使用 download 属性直接下载 var aLink = document.createElement('a') aLink.href = url aLink.setAttribute('download', filename) aLink.rel = 'noopener' document.body.appendChild(aLink) aLink.click() document.body.removeChild(aLink) } }catch(e){ // URL 解析失败时兜底处理 var aLink = document.createElement('a') aLink.href = url aLink.setAttribute('download', baseName) aLink.rel = 'noopener' document.body.appendChild(aLink) aLink.click() document.body.removeChild(aLink) } }, }, created: function(){ var that = this that.getList() that.fetchVideos() }, computed:{ yuzhishuju(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var arr = [] if(user.Roles.includes('220')){ arr = [ //{name:'市、区、县管理员账号.xls',id:1,img:"/content/image/xljkImg/excellogo.png"}, //{name:'样本校名单及账号.xls',id:2,img:"/content/image/xljkImg/excellogo.png"}, //{name:'样本校抽样班级.xls',id:5,img:"/content/image/xljkImg/excellogo.png"}, //{name:'样本校联络员名单.xls',id:11,img:"/content/image/xljkImg/excellogo.png"}, ] }else if(user.Roles.includes('450')){ var xxjd = localStorage.getItem('xxjd') if(['1','2','3'].includes(xxjd)){ arr = [ // {name:'【20241206】测前准备及参测师生账号分发说明(基教).pdf',id:10,img:"/content/image/xljkImg/pdf.png"}, // {name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, //{name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测教师登录账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, // {name:'学校负责人登录账号.xls',id:8,img:"/content/image/xljkImg/excellogo.png"}, //{name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"} ] }else if(['5','6'].includes(xxjd)){ arr = [ // {name:'测前准备及参测师生账号分发说明.docx',id:10,img:"/content/image/xljkImg/word.png"}, // {name:'抽样专业下载.xls',id:9,img:"/content/image/xljkImg/excellogo.png"}, //{name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, // {name:'老师测评账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, //{name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"}, ] }else if(['4'].includes(xxjd)){ arr = [ // {name:'【20241206】测前准备及参测师生账号分发说明(基教).pdf',id:10,img:"/content/image/xljkImg/pdf.png"}, // {name:'抽样专业下载.xls',id:9,img:"/content/image/xljkImg/excellogo.png"}, // {name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测教师登录账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, // {name:'学校负责人登录账号.xls',id:8,img:"/content/image/xljkImg/excellogo.png"}, // {name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"}, ] }else{ arr = [ // {name:'测前准备及参测师生账号分发说明.docx',id:10,img:"/content/image/xljkImg/word.png"}, // {name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测教师登录账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, // {name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, // {name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"} ] } }else{ arr = [ // {name:'样本校抽样班级.xls',id:5,img:"/content/image/xljkImg/excellogo.png"}, ] } return arr } }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-zdcssjapsc-view", function(resolve, reject){ var template = ""; return (function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { // 当前行数据(机构信息) currow: {}, studentInfoDialogVisible: false, // 标签页控制 activeName: 'first', xxjd:'', type: 1, // 1=学生, 2=老师 // 状态数据 statusData: {}, // 按钮loading状态 saveStudentLoading: false, // 学生实施方案弹窗控制 studentDialogVisible: false, isEditing: false, // 老师实施方案弹窗控制 teacherDialogVisible: false, // 详情查看弹窗控制 detailDialogVisible: false, detailData: {}, // 学生实施方案表单 studentForm: { id: '', xxid: '', xxmc: '', rq: '', cc: '', bj: [], bjStr: '', zdsj: '', zddd: '', zdfs: '', zjky: '', xxy: '', rs: '', zdjssj: '' }, // 班级列表 classList: [], // 学生表单验证规则 studentRules: { rq: [{ required: true, message: '请选择日期', trigger: 'change' }], cc: [{ required: true, message: '请输入场次', trigger: 'blur' }], bj: [{ required: true, message: '请输入班级', trigger: 'blur' }], zdsj: [{ required: true, message: '请输入作答开始时间', trigger: 'blur' }], zddd: [{ required: true, message: '请输入作答地点', trigger: 'blur' }], zdfs: [{ required: true, message: '请输入作答方式', trigger: 'blur' }], zjky: [{ required: true, message: '请输入主监考员', trigger: 'blur' }], xxy: [{ required: true, message: '请输入信息员', trigger: 'blur' }], rs: [{ required: true, message: '请输入人数', trigger: 'blur' }], zdjssj: [{ required: true, message: '请选择作答结束时间', trigger: 'change' }] }, // 老师实施方案表单 teacherForm: { id: '', xxid: '', xxmc: '', createtime: '', rq: '', cc: '', zdsj: '', zddd: '', zdfs: '', fxz: '', rs: '', zdjssj: '' }, // 老师表单验证规则 teacherRules: { rq: [{ required: true, message: '请选择日期', trigger: 'change' }], cc: [{ required: true, message: '请输入场次', trigger: 'blur' }], zdsj: [{ required: true, message: '请输入作答开始时间', trigger: 'blur' }], zddd: [{ required: true, message: '请输入作答地点', trigger: 'blur' }], zdfs: [{ required: true, message: '请输入作答方式', trigger: 'blur' }], fxz: [{ required: true, message: '请输入副校长', trigger: 'blur' }], rs: [{ required: true, message: '请输入人数', trigger: 'blur' }], zdjssj: [{ required: true, message: '请选择作答结束时间', trigger: 'change' }] }, // 表格数据 XStableData: [], // 分页信息 Detailpages: { pageNo: 1, pageSize: 10 }, DetailTotal: 0, // 搜索表单 searchForm: { rq: '', zdfs: '' }, // 日期选择器配置 datePickerOptions: { disabledDate(time) { // 不禁用任何日期 return false; }, onPick: ({ maxDate, minDate }, visible) => { if(!visible && !maxDate && !minDate) { // 当选择了范围外的日期时显示提示 this.$message.warning('测试安排日期不在学生测试系统开放日期内'); } } }, // 加载状态 loading: false }; }, methods: { showStudentInfoDialog() { const that =this that.studentInfoDialogVisible = true; }, formatDate(row, column, cellValue) { if (cellValue) { return cellValue.split(' ')[0]; } return ''; }, importStudentInfo() { const that = this; const input = document.createElement('input'); input.type = 'file'; input.accept = '.xls,.xlsx'; input.onchange = function(e) { const file = e.target.files[0]; if (!file) return; const isLt100M = file.size / 1024 / 1024 < 100; if (!isLt100M) { that.$message.error('上传文件大小不能超过100MB!'); return; } const formData = new FormData(); formData.append('file', file); $.ajax({ url: '/www/public/bd/ssfaxsimport-sc', type: 'POST', data: formData, processData: false, contentType: false, success: function(res) { if(res.error == 0 || res.success == 1) { that.$message.success(res.message || '学生时间安排表导入成功'); that.getDetail(); } else { that.$message.error(res.message || '学生时间安排表导入失败'); } }, error: function() { that.$message.error('上传失败'); } }); }; input.click(); }, down(){ var that = this let params = { }; /*const params = { //zgdwbm:user.ID, shzt:that.activeName=='first'?'0':this.activeName=='second'?'1':'-1', type, username:user.Username }*/ axios({ method: 'get', url:'/www/public/bd/ssfaxstempDownload-sc', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download','学生测试时间安排表.xlsx'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, getSchoolList(){ const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; $.get("/www/public/bd/findsjbbjList", { xxid: user.ID, }, function(res) { if (res.success == 1) { that.classList = res.data || []; } else { that.$message.error(res.message ); } }).fail(function() { that.loading = false; that.$message.error('请求失败,请检查网络连接'); }); }, // 处理班级选择变化 handleClassChange(selectedClasses) { // 将选中的班级数组转换为逗号分隔的字符串,用于后端处理 this.studentForm.bjStr = selectedClasses.join(','); // 计算选中班级的总人数 let totalStudents = 0; selectedClasses.forEach(className => { const classInfo = this.classList.find(item => item.bj === className); if (classInfo && classInfo.bjrs) { totalStudents += parseInt(classInfo.bjrs) || 0; } }); // 自动设置人数 this.studentForm.rs = totalStudents.toString(); }, // 查看详情 viewDetail(row) { this.detailData = { ...row }; this.detailDialogVisible = true; }, // 编辑项目 editItem(row) { if (this.activeName === 'first') { // 学生实施方案 this.isEditing = true; this.studentDialogVisible = true; this.studentForm = Object.assign({}, row); // 将逗号分隔的班级字符串转换为数组 if (this.studentForm.bj && typeof this.studentForm.bj === 'string') { this.studentForm.bj = this.studentForm.bj.split(','); } // 获取班级列表 this.getSchoolList(); } else if (this.activeName === 'second') { // 老师实施方案 this.isEditing = true; this.teacherDialogVisible = true; this.teacherForm = Object.assign({}, row); } }, // 删除项目 deleteItem(row) { const that = this; const type = this.type; // 1=学生, 2=老师 // 确认对话框 this.$confirm('确定要删除这条记录吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { // 调用删除接口 $.get("/www/public/bd/ssfadelete", { id: row.id, type: type }, function(res) { if (res.success == 1) { that.$message.success('删除成功'); that.getDetail(); // 刷新列表 } else { that.$message.error(res.message || '删除失败'); } }, "json").fail(function(xhr) { that.$message.error('请求失败:' + (xhr.responseJSON?.message || xhr.statusText)); }); }).catch(() => { // 用户取消删除 }); }, // 打开新增弹窗 openAddDialog() { const that = this; this.isEditing = false; if (this.activeName === 'first') { // 学生实施方案 this.isEditing = false; // 先获取班级列表 const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; $.get("/www/public/bd/findsjbbjList", { xxid: user.ID, }, function(res) { if (res.success == 1) { that.classList = res.data || []; // 检查班级列表是否为空 if (that.classList.length === 0) { that.$message.warning('还未完成班级抽样,抽样后即可添加'); return; } // 有班级才弹框 that.studentForm = { id: '', xxid: '', xxmc: '', rq: '', cc: '', bj: [], bjStr: '', zdsj: '', zddd: '', zdfs: '', zjky: '', xxy: '', rs: '', zdjssj: '' }; that.studentDialogVisible = true; // 设置学校信息 that.studentForm.xxid = user.ID || ''; that.studentForm.xxmc = user.Nickname || ''; // 重置表单验证状态 if (that.$refs.studentForm) { that.$refs.studentForm.resetFields(); } } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); } else if (this.activeName === 'second') { // 老师实施方案 this.isEditing = false; this.teacherForm = { id: '', xxid: '', xxmc: '', createtime: '', rq: '', cc: '', zdsj: '', zddd: '', zdfs: '', fxz: '', rs: '', zdjssj: '' }; this.teacherDialogVisible = true; // 设置学校信息 const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; this.teacherForm.xxid = user.ID || ''; this.teacherForm.xxmc = user.Nickname || ''; // 重置表单验证状态 if (this.$refs.teacherForm) { this.$refs.teacherForm.resetFields(); } } }, // 保存学生实施方案 saveStudent() { this.$refs.studentForm.validate((valid) => { if (!valid) { this.$message.warning('请填写所有必填项'); return; } // 验证时间逻辑:结束时间不能早于开始时间 if (this.studentForm.zdsj && this.studentForm.zdjssj) { if (this.studentForm.zdjssj <= this.studentForm.zdsj) { this.$message.error('作答结束时间不能早于或等于开始时间'); return; } } const that = this; const url = "/www/public/bd/ssfaxsadd"; // 设置loading状态 this.saveStudentLoading = true; // 准备提交数据,将班级数组转换为逗号分隔的字符串 const submitData = { ...this.studentForm }; submitData.bj = this.studentForm.bjStr || this.studentForm.bj.join(','); delete submitData.bjStr; // 删除临时字段 // 调用接口 $.post(url, submitData, function(res) { // 请求完成,取消loading状态 that.saveStudentLoading = false; if (res.success == 1) { that.$message.success('保存成功'); that.studentDialogVisible = false; that.isEditing = false; that.getDetail(); // 刷新列表 } else { that.$message.error(res.message || '保存失败'); } }, "json").fail(function(xhr) { // 请求失败,取消loading状态 that.saveStudentLoading = false; that.$message.error('请求失败:' + (xhr.responseJSON?.message || xhr.statusText)); }); }); }, saveTeacher() { this.$refs.teacherForm.validate((valid) => { if (!valid) { this.$message.warning('请填写所有必填项'); return; } // 验证时间逻辑:结束时间不能早于开始时间 if (this.teacherForm.zdsj && this.teacherForm.zdjssj) { if (this.teacherForm.zdjssj <= this.teacherForm.zdsj) { this.$message.error('作答结束时间不能早于或等于开始时间'); return; } } const that = this; const url = "/www/public/bd/ssfalsadd"; // 调用接口 $.post(url, this.teacherForm, function(res) { if (res.success == 1) { that.$message.success('保存成功'); that.teacherDialogVisible = false; that.isEditing = false; that.getDetail(); // 刷新列表 } else { that.$message.error(res.message || '保存失败'); } }, "json").fail(function(xhr) { that.$message.error('请求失败:' + (xhr.responseJSON?.message || xhr.statusText)); }); }); }, // 标签切换 changeTab(tab) { if (tab.name === 'first') { this.type = 1; // 学生 } else if (tab.name === 'second') { this.type = 2; // 老师 } // 切换标签时重置搜索条件 this.searchForm.rq = ''; this.searchForm.zdfs = ''; this.getDetail(); }, // 处理搜索 handleSearch() { this.Detailpages.pageNo = 1; this.getDetail(); }, // 获取详情数据 getDetail() { const that = this; that.loading = true; // 原始接口调用 var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; $.get("/www/public/shangbao/findssfa", { xxid: user.ID, type: this.type, pageNo: this.Detailpages.pageNo, pageSize: this.Detailpages.pageSize, rq: this.searchForm.rq, zdfs: this.searchForm.zdfs }, function(res) { that.loading = false; if (res.success == 1) { that.XStableData = res.data || []; that.DetailTotal = res.total || 0; } else { that.$message.error(res.message || '获取详情失败'); } }).fail(function() { that.loading = false; that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleDetailSizeChange(size) { this.Detailpages.pageSize = size; this.Detailpages.pageNo = 1; this.getDetail(); }, // 改变当前页 handleDetailCurrentChange(page) { this.Detailpages.pageNo = page; this.getDetail(); }, // 获取状态数据 getStatusData: function() { var that = this; $.get('/www/public/bd/txqkztfindbyxxid', {}, function(res) { if (res.success == 1) { that.statusData = res.data; } }); }, // 完成上传 completeUpload: function(field) { if (!this.DetailTotal) { this.$message.error('请制定时间安排后,进行提交。'); return; } var self = this; const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var params = { userid: user.ID, }; params[field] = '2'; // 标记为已完成 this.$confirm('确认完成上传吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(function() { $.post('/www/public/bd/sjapztedit', params, function(res) { if (res.error === 0) { self.$message.success('操作成功'); self.getStatusData(); // 重新获取状态数据 } else { self.$message.error(res.message || '操作失败'); } }); }).catch(function() {}); } }, computed: { isCompleted: function() { return this.activeName === 'first' ? this.statusData.sfxssjapwc === '2' : this.statusData.sflssjapwc === '2'; } }, created: function(){ this.getStatusData(); this.getDetail(); this.getSchoolList(); this.xxjd = localStorage.getItem('xxjd')?JSON.parse(localStorage.getItem('xxjd')):{} } }); }); })(template, resolve, reject); }); RegVueCom("xljk-XDgongzuozuShangbaoDialogBJ", function(resolve, reject){ var template = ""; return ( function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), tishi:'', roleOption:[], loading:false, dialogVisible: false, tableData: [], gzzzt:'', xgzt:'', multipleSelection: [], currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4, innerVisible:false, selectList:[], selectListV:'', fetchUnitListStatus:false, classList:[], fetchUnitListDialog:false, user:{}, total:0, pages:{ pageNo:1, pageSize:5 }, reForm: { reason:'' }, Form: { reason:'' }, reruleForm: { xm:'',sjh:'',yx:'',roleid:'',odesc:'',dw:'',zw:'',xb:'' }, ruleForm: { xm:'',sjh:'',yx:'',roleid:'',odesc:'',dw:'',zw:'',xb:'',id:'' }, rules: { reason: [ { required: true, message: '请输入申请原因', trigger: 'blur' } ], xm: [ { required: true, message: '请输入姓名', trigger: 'blur' } ], roleid: [ { required: true, message: '请选择角色', trigger: 'change' } ], xb: [ { required: true, message: '请选择性别', trigger: 'change' } ], dw: [ { required: true, message: '请输入单位', trigger: 'blur' } ], zw: [ { required: true, message: '请输入职务', trigger: 'blur' } ], sjh: [ { required: true, message: '请输入联系方式', trigger: 'blur' }, { validator: publicUtilsOfCheck.isValidPhoneNumber, trigger: 'blur' } ], yx: [ { required: true, message: '请输入邮箱', trigger: 'blur' }, { validator: publicUtilsOfCheck.validateEmail, trigger: 'blur' } ], }, isEdit:false } }, methods:{ DexportFn(){ var that = this var name //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var username = user.Username var bm = username.substring(3) let type if(user.Roles.includes('220')){ type='1' name = '市级管理员账号信息.xls' if(['110000','120000','310000','500000'].includes(bm)){ type='1' name = '区县管理员账号信息.xls' } }else if(user.Roles.includes('310')){ type='2' name = '区县管理员账号信息.xls' } const params = { username:user.Username, type, state:'1' } axios({ method: 'get', url: '/www/public/shangbao/dcsqxzh', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, save(){ const that = this that.$confirm('是否确认提交', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { $.post("/www/public/bd/editjyttj", {}, function(res){ if(res.error==0){ that.$message.success(res.message) that.getgzzshzt() }else{ that.$message.error(res.message) } }) }).catch(() => { }); }, tijiaoch(){ var that = this that.$confirm('是否确认撤回提交', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var type ='' if(user.Roles.includes('450')){ type='2' }else{ type='1' } const params = { type } $.post("/www/public/shouye/gzzshch", params, function(res){ if(res.success==1){ that.$message.success('撤回成功') that.getgzzshzt() }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ }) }).catch(() => { }); }, getgzzshzt(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var gzzid = user.ID const params = { gzzid } $.get("/www/public/shangbao/gzz-getgzzshzt", params, function(res){ if(res.success==1){ that.gzzzt = res.data.gzzzt that.xgzt = res.data.xgzt }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ console.log(xhr,status,error) }) }, changegetList(v){ // 检查选择的值是否有效 if(!v || v === '') { return } let [zgdwbm, zgdwmc] = v.split('|') // 确保分割后的值都存在 if(!zgdwbm || !zgdwmc) { this.$message.error('选择的单位信息不完整') return } const that = this let data = { zgdwbm, zgdwmc } $.post("/www/public/shangbao/editzgdwbm", data, function(res){ if(res.error==0){ that.$message.success('修改成功') }else{ that.$message.error(res.message) } }) }, showshenqingxiugai(){ this.$refs.gzzshenqingxiugai.show() }, shenqingxiugai(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var gzzid = user.ID const params = { gzzid, xgzt:'1', msg:that.Form.reason } $.post("/www/public/shangbao/gzz-cxsqxggzz", params, function(res){ if(res.success==1){ that.$message.success('已申请') that.$refs.gzzshenqingxiugai.close() }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message.error(error||'未知错误') }) }, tijiao(){ var that = this that.$confirm('是否确认提交审核', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { var jscnt = {} var otype that.tableData.forEach(item=>{ if(!jscnt[item.gzzroleid]){ jscnt[item.gzzroleid] = 1 }else{ jscnt[item.gzzroleid]++ } // 统一 otype:按需求全部固定为 6 otype = '6' }) const params = { jscnt:JSON.stringify(jscnt), otype } $.post("/www/public/shouye/jd_gzzbm_com", params, function(res){ if(res.success==1){ that.$message.success('提交成功') that.$refs.baseDialoggzz0.close() that.$emit('closeDialog') that.getgzzshzt() }else if(res.success==0&&res.message=='没有上级单位'){ that.$message.error('没有上级单位,请选择一个单位'); that.fetchUnitList() that.fetchUnitListStatus=true }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ }) }).catch(() => { }); }, fetchUnitList() { const that = this let data = { } $.post("/www/public/shangbao/findsjbmlist", data, function(res){ if(res.error==0){ that.selectList=res.data }else{ that.$message.error(res.message) } }) }, getZgdwbmById() { const that = this $.get("/www/public/shangbao/zgdwbmbyxxid", function(res){ if(res.error==0 && res.data){ // 检查数据是否有效,避免显示nullnull const zgdwbm = res.data.zgdwbm || '' const zgdwmc = res.data.zgdwmc || '' if(zgdwbm && zgdwmc) { // 设置下拉框的选中值,格式为 "zgdwbm|zgdwmc" that.selectListV = `${zgdwbm}|${zgdwmc}` } else { that.selectListV = '' } }else{ console.log('获取回显数据失败:', res.message) that.selectListV = '' } }).fail(function(error){ console.log('获取回显数据请求失败:', error) that.selectListV = '' }) }, download(){ var that = this var type //1省,2区县,3学校 下载工作组导入模版 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} // var user = this.$store.state.user //220省310市410区县 var name if(user.Roles.includes('220')){ type = 1 name = '省工作组信息上报模版.xlsx' }else if(user.Roles.includes('310')){ type = 2 name = '市工作组信息上报模版.xlsx' }else if(user.Roles.includes('410')){ type = 3 name = '县工作组信息上报模板.xlsx' }else if(user.Roles.includes('450')){ //基教4高教5 var xxjd = localStorage.getItem('xxjd') if(['1','2','3','4'].includes(xxjd)){ type = 4 }else{ type = 5 } name = '工作组信息上报模版.xlsx' } const params = { type:6, } axios({ method: 'get', url: '/www/public/shangbao/downloadgzztemp', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, handlebeforeClose(){ this.$emit('closeDialog') }, handleRoleChange(val){ console.log(val,'val') var zz = this.roleOption.find(item=>{ return item.id==val }) console.log(zz,'zz') this.ruleForm.odesc = zz.odesc }, exportFn(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { schoolid, } axios({ method: 'get', url: '/www/public/shangbao/exportteather', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '学生数据.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, customUpload(params) { var that = this that.loading = true var type //1省,2区县,3学校 下载工作组导入模版 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} //var user = this.$store.state.user //220省310市410区县 // if(user.Roles.includes('220')){ // type = 1 // }else if(user.Roles.includes('310')){ // type = 2 // }else if(user.Roles.includes('410')){ // type = 3 // }else if(user.Roles.includes('450')){ // //基教4高教5 // var xxjd = localStorage.getItem('xxjd') // if(['1','2','3','4'].includes(xxjd)){ // type = 4 // }else{ // type = 5 // } // } type = 6 const formData = new FormData() console.log(params.file,'params.file') formData.append('file', params.file) // 这是file入参,文件信息 // 如果extraParams是个单独的值,直接加入 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var roles=user.UserFilter.urole // 调接口 axios.post(`/www/public/shangbao/uploadgzztemp?type=${type}`, formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ that.$message.success('导入成功') that.loading = false that.getList() }else{ that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false console.error(error); }); }, onError(){}, del(row){ var that = this const params = { ids:JSON.stringify([row.id]), } $.post("/www/public/shangbao/del_school_gzry", params, function(res){ if(res.success==1){ that.$message.success('删除成功') that.getList() }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{}) }, handleEdit(row){ this.isEdit = true this.$refs.baseDialoggzz1.show() this.$nextTick(()=>{ this.$refs.ruleFormgzz.resetFields() // 重新设置表单数据 this.ruleForm = { roleid: row.gzzroleid, id: row.id, xm: row.xm, sjh: row.sjh, yx: row.yx, odesc: row.odesc, xb: row.xb, dw: row.dw, zw: row.zw } console.log(this.ruleForm,'ruleForm') }) }, validatePhoneNumber(phoneNumber) { const regex = /^(0\d{2,3}[- ]?\d{7,8})|(1[3-9]\d{9})$/; return regex.test(phoneNumber); }, validateEmail(email) { const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; return emailRegex.test(email); }, submit(){ var that = this this.$refs['ruleFormgzz'].validate((valid) => { if (valid) { let that = this; //const {xm,zw,roleid,sjh,yx,xb,zw,dw} = that.ruleForm let newArr = {...this.ruleForm,otype:6} newArr.id = this.ruleForm.id console.log(newArr,'newArr') $.post('/www/public/shouye/jd_gzzbm',{params:JSON.stringify(newArr)}, function(msg){ if(msg.success == 1){ if(newArr.id){ that.$message.success('修改成功') }else{ that.$message.success('添加成功') } that.$refs.baseDialoggzz1.close() that.getList() }else{ that.$message({ type: 'error', message: msg.message }); } }).fail(function(jqXHR, textStatus, errorThrown){ that.$message({ type: 'error', message: errorThrown }); }) /*}else{ alert(2) $.post('/www/public/shangbao/edit_school_gzry',newArr, function(msg){ if(msg.success == 1){ that.$message.success('修改成功') that.$refs.baseDialoggzz1.close() that.getList() }else{ that.$message({ type: 'error', message: msg.message }); } }).fail(function(jqXHR, textStatus, errorThrown){ that.$message({ type: 'error', message: errorThrown }); }) }*/ } else { return false; } }); }, handleAdd(){ this.isEdit = false this.$refs.baseDialoggzz1.show() this.$nextTick(()=>{ this.$refs.ruleFormgzz.resetFields() this.ruleForm = {xm:'',xb:'',sjh:'',yx:'',zw:'',roleid:'',dw:'',odesc:''} }) }, show(){ this.getRole() this.getList() console.log(this.$refs.baseDialoggzz0,'baseDialoggzz0') this.$refs.baseDialoggzz0.show() }, getRole(){ var that = this var otype var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var roles = user.Roles if(roles.indexOf('450')!=-1){ //基教4高教5 var xxjd = localStorage.getItem('xxjd') if(['1','2','3','4'].includes(xxjd)){ otype = '6' }else{ otype = '6' } } if(roles.indexOf('410')!=-1){ otype = '6' } if(roles.indexOf('310')!=-1){ otype = '6' } if(roles.indexOf('220')!=-1){ otype = '6' } const params = { otype } $.post("/www/public/shouye/jd_gzzbm_cxrole",params,res=>{ if(res.code==200&&res.data){ that.roleOption = res.data that.tishi = '' res.data.forEach(item=>{ that.tishi+= '

' that.tishi+=item.ovalue that.tishi+='('+item.rsc+'),' that.tishi+=item.odesc+'。' that.tishi+= '

' }) } }).fail((jqXHR, textStatus, errorThrown)=>{ that.$message({ type: 'error', message: errorThrown }); }) }, getList(){ var that = this //otype 1 省级 2 区县 3 学校 var otype var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var roles = user.Roles if(roles.indexOf('450')!=-1){ //基教4高教5 var xxjd = localStorage.getItem('xxjd') if(['1','2','3','4'].includes(xxjd)){ otype = '6' }else{ otype = '6' } } if(roles.indexOf('410')!=-1){ otype = '6' } if(roles.indexOf('310')!=-1){ otype = '6' } if(roles.indexOf('220')!=-1){ otype = '6' } const params = { otype } $.post("/www/public/shouye/jd_gzzbm_fxList", params, function(res){ if(res.success==1){ that.tableData = res.data }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, getClass(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { schoolid } $.get("/www/public/shangbao/findschoolbj", params, function(res){ if(res.success==1){ that.classList = res.data }else{ this.$message.error(res.message) } }).fail((xhr,status,error)=>{ this.$message.error('请求错误') }) }, handleConfirm(){ this.$refs.baseDialogjs.close() }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.getList() }, handleClick(){}, handleClose(){ console.log(1) this.dialogVisible = false }, toggleSelection(rows) { if (rows) { rows.forEach(row => { this.$refs.multipleTable.toggleRowSelection(row); }); } else { this.$refs.multipleTable.clearSelection(); } }, handleSelectionChange(val) { this.multipleSelection = val; } }, computed:{ }, watch:{ }, created: function(){ this.user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} if(this.user.Roles.includes('450')){ this.fetchUnitList() } this.getgzzshzt() }, mounted: function(){ // 获取回显数据 this.getZgdwbmById() }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDzlxz01BJ-view", function(resolve, reject){ var template = "
\n \n \n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), uploading:false, percentage:0, showpercent:false, customColor: '#409eff', currentId:'', loading:false, pages:{ pageSize:10, pageNo:1 }, List:[], typeMap:["/jpglogo.png","/yasuologo.png","/mp4logo.png","/wordlogo.png","/excellogo.png","/pdflogo.png"], loopData0: [ ], loopData4: [ ], loopData1:[], loopData2:[], videoList:[], videoDialogVisible:false, currentVideoUrl:'', total:0, constants: {}, studentTestLinks: [ { key: 'primary_pc', label: '小学(电脑端)', url: 'http://xinlijc.bnu.edu.cn/www/dd/vue/spa/xljk?#/loginPrimary' }, { key: 'middle_pc', label: '初高中中职(电脑端)', url: 'http://xinlijc.bnu.edu.cn/www/dd/vue/spa/xljk?#/loginMiddle' }, //{ key: 'college_pc', label: '高教(电脑端)', url: 'https://xinlijc.bnu.edu.cn/www/dd/vue/spa/xljk#/loginStu' }, { key: 'primary_h5', label: '小学(手机端)', url: 'https://xinlijc.bnu.edu.cn/www/dd/vue/spa/xljk?#/loginPrimaryH5' }, { key: 'middle_h5', label: '初高中中职(手机端)', url: 'https://xinlijc.bnu.edu.cn/www/dd/vue/spa/xljk?#/loginMiddleH5' }, //{ key: 'college_h5', label: '高教(手机端)', url: 'https://xinlijc.bnu.edu.cn/www/dd/vue/spa/xljk#/loginStuH5' }, ], }; }, methods: { handleVideoClose(){ try{ const v = this.$refs.videoPlayer if(v && typeof v.pause === 'function'){ v.pause() } }catch(e){} this.currentVideoUrl = '' }, handleVideoClosed(){ try{ const v = this.$refs.videoPlayer if(v){ v.removeAttribute('src') v.load() } }catch(e){} }, copyLink(url){ const text = String(url || ''); const done = ()=> this.$message && this.$message.success('链接已复制'); try{ if(navigator.clipboard && window.isSecureContext){ navigator.clipboard.writeText(text).then(done).catch(()=> this.fallbackCopyText(text)); }else{ this.fallbackCopyText(text); } }catch(e){ this.fallbackCopyText(text); } }, fallbackCopyText(text){ try{ const ta = document.createElement('textarea'); ta.value = text; ta.setAttribute('readonly',''); ta.style.position = 'fixed'; ta.style.top = '-1000px'; document.body.appendChild(ta); ta.select(); const ok = document.execCommand('copy'); document.body.removeChild(ta); if(ok){ this.$message && this.$message.success('链接已复制'); }else{ this.$message && this.$message.error('复制失败,请手动复制'); } }catch(e){ this.$message && this.$message.error('复制失败,请手动复制'); } }, handlebeforeClose(){ this.$emit('closeDialog') }, show(){ console.log(this.$refs.baseDialoggzz0,'baseDialoggzz0') this.$refs.baseDialoggzz0.show() }, handleConfirm(){ this.$refs.baseDialogjs.close() }, /* // customUpload(params,item) { var that = this that.loading = true var xxjd = localStorage.getItem('xxjd') //1小学 2初中 3高中 4中职 5高职 7本科 8硕士 9博士 var importType if(['1','2','3'].indexOf(xxjd)!=-1){ importType = '1' }else{ importType = '2' } // params是一个对象,包含了file和fileList, // 但是这个params参数可能每个版本不一样值就不一样,到时候自己打印看看, // 反正file的值就是原始的File对象 const formData = new FormData() console.log(params.file,'params.file') formData.append('file', params.file) // 这是file入参,文件信息 // 如果extraParams是个对象,循环加入formData for (const key in this.extraParams) { formData.append(key, this.extraParams[key]) } // 如果extraParams是个单独的值,直接加入 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var roles=user.UserFilter.urole // 调接口 axios.post(`/www/public/shangbao/addfiletemprecord?filetempid=${item.id}`, formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ that.$message.success(data.message) that.loading = false that.getList() }else{ that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false that.$message.error('文件上传异常!') console.error(error); }); }, */ getMd5(file) { return new Promise((resolve) => { // 对文件对象的处理 const spark = new SparkMD5.ArrayBuffer()// md5的ArrayBuffer加密类 var fileReader = new FileReader(); fileReader.readAsArrayBuffer(file); // fileReader.onload为异步函数,要放到Promise对象中,等待状态的变更后再返回生成的md5值 fileReader.onload = function (e) { spark.append(e.target.result); resolve(spark.end()); }; }); }, async uploadFile(params,item){ if(this.loading){ return this.$message.error('有文件正在上传,请稍后再试!') } var that = this that.currentId = item.id that.loading = true that.percentage = 0 var xxjd = localStorage.getItem('xxjd') //1小学 2初中 3高中 4中职 5高职 7本科 8硕士 9博士 var importType if(['1','2','3'].indexOf(xxjd)!=-1){ importType = '1' }else{ importType = '2' } var successhh = 0 that.loading = true const file = params.file console.log(file,'file') const fileReader = new FileReader()// 文件读取 console.log(file) const chunkSize = 1024 * 1024 * 6 let fileChunkedList = [] // 文件分片完成之后的数组 const name=file.name let md5 = await that.getMd5(file) // 文件开始分片,push到fileChunkedList数组中, 并用第一个分片去计算文件的md5 for (let i = 0; i < file.size; i = i + chunkSize) { const tmp = file.slice(i, Math.min((i + chunkSize), file.size)) if (i === 0) { fileReader.readAsArrayBuffer(tmp) } fileChunkedList.push(tmp) } console.log(fileChunkedList,'数组') const chunks=fileChunkedList.length that.showpercent = true for (let i = 1; i <= fileChunkedList.length; i =i+1) { const formData = new FormData() formData.append('imgFile', fileChunkedList[i-1],file.name) formData.append('chunk', i) formData.append('old', that.old) formData.append('size', file.size) formData.append('name', name) formData.append('md5', md5) for (var value of formData.values()) { console.log(value); } try { const result = await that.uploads(formData,item.id) console.log(result,'result') if(result){ if(result.status==200){ if(result.data){ //console.log(result.data,'result.data') const data = result.data that.old = data.data if(data.success==1){ successhh += 1 that.percentage = ((successhh/fileChunkedList.length)*100).toFixed(0) console.log(that.percentage,' that.percentage') if(data.message=="上传成功"&&successhh{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, XXexportFn(activeName){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { schoolid, } var url var name if(activeName=='first'){ url = "/www/public/shangbao/exportStudent" name = '学生账号.xls' }else if(activeName == 'second'){ url = "/www/public/shangbao/exportteather" name = '教师账号.xls' }else{ url = "/www/public/shouye/px_webftybm_dcbxftyzh" name = '访谈员账号.xls' } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, DexportFn(){ var that = this var name //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var username = user.Username var bm = username.substring(3) let type if(user.Roles.includes('220')){ type='1' name = '市级管理员账号信息.xls' if(['110000','120000','310000','500000'].includes(bm)){ type='1' name = '区县管理员账号信息.xls' } }else if(user.Roles.includes('310')){ type='2' name = '区县管理员账号信息.xls' } const params = { username:user.Username, type, state:'1' } axios({ method: 'get', url: '/www/public/shangbao/dcsqxzh', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, exportFn(){ var that = this //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let type if(user.Roles.includes('220')){ type='1' }else if(user.Roles.includes('310')){ type='2' } const params = { username:user.Username, type, state:'1', } axios({ method: 'get', url: '/www/public/shangbao/exportzgxxx', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', '直管校管理员账号.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, delfn(item){ var that = this const params = { id:item.recordId, tempid:item.filetempid } $.post("/www/public/shangbao/deletefilerecord", params, function(res){ if(res.error==0){ that.$message.success('删除成功') that.getList() }else{ that.$message.error(res.message) } }).fail((err)=>{ that.loading = false that.$message({ type: "error", message: '请求错误' }) }) }, yulan(item){ window.open('/core/UForm/fileviewer/r_temp_file_record?ff=id&fv='+item.recordId,'_blank') }, onError(){}, // customUpload(params,item) { var that = this that.loading = true var xxjd = localStorage.getItem('xxjd') //1小学 2初中 3高中 4中职 5高职 7本科 8硕士 9博士 var importType if(['1','2','3'].indexOf(xxjd)!=-1){ importType = '1' }else{ importType = '2' } // params是一个对象,包含了file和fileList, // 但是这个params参数可能每个版本不一样值就不一样,到时候自己打印看看, // 反正file的值就是原始的File对象 const formData = new FormData() console.log(params.file,'params.file') formData.append('file', params.file) // 这是file入参,文件信息 // 如果extraParams是个对象,循环加入formData for (const key in this.extraParams) { formData.append(key, this.extraParams[key]) } // 如果extraParams是个单独的值,直接加入 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var roles=user.UserFilter.urole // 调接口 axios.post(`/www/public/shangbao/addfiletemprecord?filetempid=${item.id}`, formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ that.$message.success(data.message) that.loading = false that.getList() }else{ that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false that.$message.error('文件上传异常!') console.error(error); }); }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.getList() }, exportFn1(){ var that = this //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { username:user.Username, djsmc:that.djsmc } axios({ method: 'get', url: '/www/public/shangbao/exportxqnxxdc', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', '辖区内学校管理员账号.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, teshudownload(item){ if(item.id==3||item.id==4||item.id==8){ const that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let data = { xxid:user.ID } $.post("/www/public/chouyang/sb_findzhxfzt", data, function(res){ if(res.error==0){ if(item.id==3){ that.XXexportFn('first') }else if(item.id==4){ that.XXexportFn('second') }else if(item.id==8){ that.xljkfzrdown() } }else{ that.$message.error(res.message) } }) } if(item.id==7){ const that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let data = { xxid:user.ID } $.post("/www/public/chouyang/sb_findbjxfzt", data, function(res){ if(res.error==0){ if(item.id==7){ that.bjxxdown() } }else{ that.$message.error(res.message) } }) } if(item.id==2){ this.exportFn1() }else if(item.id==1){ this.DexportFn() }else if(item.id==5){ this.YBXCYBJexportFn() }else if(item.id==6){ this.ptljurl() }else if(item.id==9){ this.downcyzyls() }else if(item.id==10){ this.cqzbdown() }else if(item.id==11){ this.ybxllymddown() } }, ybxllymddown(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { } axios({ method: 'get', url: '/www/public/download/xxgzzlly_byqybm_dc', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '样本校联络员名单.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败失败') } }) }, cqzbdown(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { schoolid : user.ID } axios({ method: 'get', url: '/www/public/shangbao/dccqzbzhff', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '【20241206】测前准备及参测师生账号分发说明(基教).pdf'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败失败') } }) }, downcyzyls(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { schoolid : user.ID } axios({ method: 'get', url: '/www/public/chouyang/sb-dczy', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '抽样专业列表.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }) }, bjxxdown(activeName){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { } var url = '/www/public/shangbao/exportbj_new' var name = '班级信息.xls' axios({ method: 'get', url, params: { schoolid }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, xljkfzrdown(activeName){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { } var url = '/www/public/shangbao/exportxxfzr' var name = '学校负责人登录账号.xls' axios({ method: 'get', url, params: { schoolid }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, ptljurl(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var xxjd = localStorage.getItem('xxjd') var schoolid = user.ID var type = '' if(['1'].includes(xxjd)){ type='1' }else if(['2','3','4'].includes(xxjd)){ type='2' }else if(['5','6'].includes(xxjd)){ type='3' } const params = { type } var url = '/www/public/shangbao/downloadUrl' var name = '全国学生心理健康监测与服务平台链接.url' axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, download(item){ var that = this let params = {} var name if(item.isupload=='1'){ params = { id :item.recordId, type:'2' } name = item.originFilename }else if(item.isupload=='2'){ params = { id :item.filetempid, type:'1' } name = item.filename } // window.open(item.file) axios({ method: 'get', url: '/www/public/shangbao/downloadtempFile', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, getFileTypeUrl(name){ var url = '' if(name){ var houzhui = this.gettype(name) if(houzhui=='pdf'){ url = '/content/image/xljkImg/pdf.png' }else if(houzhui=='xls'||houzhui=='xlsx'){ url = '/content/image/xljkImg/exceltubiao.png' }else if(houzhui=='jpg'||houzhui=='jpeg'||houzhui=='png'){ url = '/content/image/xljkImg/jpg.png' }else if(houzhui=='doc'||houzhui=='docx'){ url = '/content/image/xljkImg/word.png' }else{ url = '/content/image/xljkImg/qtwjlx.png' } } return url }, gettype(name){ var houzhui if(name){ var arr = name.split('.') houzhui = arr[1] } return houzhui }, getAccept(name){ var accept var houzhui = this.gettype(name) if(houzhui=='xls'||houzhui=='xlsx'){ accept = '.xls,.xlsx' }else if(houzhui=='doc'||houzhui=='docx'||houzhui=='pdf'||houzhui=='zip'){ accept = '.doc,.docx,.pdf,.zip,.rar' }else{ accept = '.zip,.rar' } return accept }, getList(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var type if(user.Roles.includes('450')){ var xd = localStorage.getItem('xxjd') if(['1','2','3','4'].includes(xd)){ type='1' }else{ type='2' } } const params = { type, } $.get("/www/public/shangbao/findfiletyperecord", params, function(res){ if(res.success==1){ console.log(res) that.loopData0 = res.data.filter(item=>item.sfsc=='0') //that.loopData1 = res.data.filter(item=>item.sfsc=='1') //that.loopData2 = res.data.filter(item=>item.sfsc=='2') //that.loopData4 = res.data.filter(item=>item.sfsc=='4') }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, // 操作视频相关(按你提供的接口结构:kcfile 为视频,kcfm 为封面) fetchVideos(){ const id = 'f875d2ed-74c1-4da0-8eb7-fea9e2797015' axios.get('/www/public/pxks/pxNrInfo', { params: { id } }) .then(({data})=>{ try { this.videoList = this.normalizeVideoResponse(data) } catch(e) { console.error('normalize video error', e) this.videoList = [] } }).catch(err=>{ console.error('fetch videos error', err) this.videoList = [] }) }, normalizeVideoResponse(resp){ const root = (resp && resp.data!==undefined) ? resp.data : resp // root 为数组,每项含 kc(视频列表)、ks(考试等),我们仅取 kc。 const sections = Array.isArray(root) ? root : [] const exts = ['.mp4','.mov','.m4v','.m3u8','.flv','.webm'] const list = [] sections.forEach(sec=>{ const kc = Array.isArray(sec && sec.kc) ? sec.kc : [] kc.forEach(it=>{ const url = it.kcfile || '' const name = it.kcmc || '操作视频' const cover = it.kcfm || '' const u = (url||'').toLowerCase() if(u && exts.some(e=>u.endsWith(e))){ list.push({ name, url, cover }) } }) }) return list }, extractUrl(item){ return item && (item.kcfile||item.url||item.fileUrl||item.file||item.filePath||item.path||item.playUrl||item.src) || '' }, playVideo(item){ const url = this.extractUrl(item) if(!url){ return this.$message.error('无法播放:视频地址缺失') } this.currentVideoUrl = url this.videoDialogVisible = true }, downloadVideo(item){ const url = this.extractUrl(item) if(!url){ return this.$message.error('无法下载:视频地址缺失') } // 解析文件名(优先使用名称 + 扩展名) let baseName = (item && (item.name || item.kcmc)) || '视频' baseName = String(baseName).replace(/[\\/:*?"<>|]/g,'_').trim() || '视频' let ext = '' try{ const u = new URL(url, window.location.origin) const pathname = u.pathname || '' const last = (pathname.split('/').pop() || '').split('?')[0].split('#')[0] const m = last.match(/\.[a-z0-9]+$/i) ext = m ? m[0] : '' const sameOrigin = u.origin === window.location.origin const filename = `${baseName}${ext}` if(sameOrigin){ axios({ method:'get', url, responseType:'blob' }).then(res=>{ const ok = (res && (res.status===200 || (res.request && res.request.status===200))) if(ok){ let binaryData = [] binaryData.push(res.data) var blobUrl = window.URL.createObjectURL(new Blob(binaryData)) var aLink = document.createElement('a') aLink.href = blobUrl aLink.setAttribute('download', filename) document.body.appendChild(aLink) aLink.click() document.body.removeChild(aLink) window.URL.revokeObjectURL(blobUrl) this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }).catch(err=>{ // 同源失败时降级为直接触发下载 var aLink = document.createElement('a') aLink.href = url aLink.setAttribute('download', filename) aLink.rel = 'noopener' document.body.appendChild(aLink) aLink.click() document.body.removeChild(aLink) }) }else{ // 跨域资源:尝试使用 download 属性直接下载 var aLink = document.createElement('a') aLink.href = url aLink.setAttribute('download', filename) aLink.rel = 'noopener' document.body.appendChild(aLink) aLink.click() document.body.removeChild(aLink) } }catch(e){ // URL 解析失败时兜底处理 var aLink = document.createElement('a') aLink.href = url aLink.setAttribute('download', baseName) aLink.rel = 'noopener' document.body.appendChild(aLink) aLink.click() document.body.removeChild(aLink) } }, }, created: function(){ var that = this that.getList() that.fetchVideos() }, computed:{ yuzhishuju(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var arr = [] if(user.Roles.includes('220')){ arr = [ //{name:'市、区、县管理员账号.xls',id:1,img:"/content/image/xljkImg/excellogo.png"}, //{name:'样本校名单及账号.xls',id:2,img:"/content/image/xljkImg/excellogo.png"}, //{name:'样本校抽样班级.xls',id:5,img:"/content/image/xljkImg/excellogo.png"}, //{name:'样本校联络员名单.xls',id:11,img:"/content/image/xljkImg/excellogo.png"}, ] }else if(user.Roles.includes('450')){ var xxjd = localStorage.getItem('xxjd') if(['1','2','3'].includes(xxjd)){ arr = [ // {name:'【20241206】测前准备及参测师生账号分发说明(基教).pdf',id:10,img:"/content/image/xljkImg/pdf.png"}, // {name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, //{name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测教师登录账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, // {name:'学校负责人登录账号.xls',id:8,img:"/content/image/xljkImg/excellogo.png"}, //{name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"} ] }else if(['5','6'].includes(xxjd)){ arr = [ // {name:'测前准备及参测师生账号分发说明.docx',id:10,img:"/content/image/xljkImg/word.png"}, // {name:'抽样专业下载.xls',id:9,img:"/content/image/xljkImg/excellogo.png"}, //{name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, // {name:'老师测评账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, //{name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"}, ] }else if(['4'].includes(xxjd)){ arr = [ // {name:'【20241206】测前准备及参测师生账号分发说明(基教).pdf',id:10,img:"/content/image/xljkImg/pdf.png"}, // {name:'抽样专业下载.xls',id:9,img:"/content/image/xljkImg/excellogo.png"}, // {name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测教师登录账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, // {name:'学校负责人登录账号.xls',id:8,img:"/content/image/xljkImg/excellogo.png"}, // {name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"}, ] }else{ arr = [ // {name:'测前准备及参测师生账号分发说明.docx',id:10,img:"/content/image/xljkImg/word.png"}, // {name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测教师登录账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, // {name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, // {name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"} ] } }else{ arr = [ // {name:'样本校抽样班级.xls',id:5,img:"/content/image/xljkImg/excellogo.png"}, ] } return arr } }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDjddcssd-view", function(resolve, reject){ var template = "
\n \n \n \n \n
\n \n \n \n \n \n \n \n
\n
\n\n
"; return (function(template, resolve, reject) { seajs.use([], function () { return resolve({ template: template, data: function () { return { id: Math.uuid(), pageName: '', totalJindu: {}, xxss: '', xxxd: '', gzzjd: {}, xxxxjd: {}, gzzss: '', dialogVisible: false, tableData1: [], tableData2: [], tableData3: [], curData: {}, multipleSelection: [], currentPage1: 5, xxjd: '', currentPage2: 5, currentPage3: 5, currentPage4: 4, sfwcFilter: '', // 是否完成作答筛选 tableData3Backup: [], // 备份原始数据用于筛选 innerVisible: false, sfxzdw: '1', activeName: 'first', status: '', paramspath: [], Roles: [], pages: { pageNo: 1, pageSize: 5 }, total: 0, ruleForm: { }, type: '',//1测评,2访谈 isEdit: false, stuortea: '1', stuList: [] } }, methods: { wancheng(row, type) { const that = this console.log(row) if (row.xm.includes("备用")) { if (type == 1) { this.$prompt('请输入原因', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', }).then(({ value }) => { if (!value) return that.$message.error('请完成/未完成输入原因') let data = { lsid: row.id, sfwc: '1', reason: value, } $.post("/www/public/jingdu/updatewcztandyy", data, function (res) { if (res.error == 0) { that.$message.success(res.message) that.getList() } else { that.$message.error(res.message) } }) }).catch(() => { }); } else { let data = { lsid: row.id, sfwc: '2', } $.post("/www/public/jingdu/updatewcztandyy", data, function (res) { if (res.error == 0) { that.$message.success(res.message) that.getList() } else { that.$message.error(res.message) } }) } } else { if (type == 1) { let data = { lsid: row.id, sfwc: type, //reason:value, } $.post("/www/public/jingdu/updatewcztandyy", data, function (res) { if (res.error == 0) { that.$message.success(res.message) that.getList() } else { that.$message.error(res.message) } }) } else { this.$prompt('请输入原因', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', }).then(({ value }) => { if (!value) return that.$message.error('请完成/未完成输入原因') let data = { lsid: row.id, sfwc: type, reason: value, } $.post("/www/public/jingdu/updatewcztandyy", data, function (res) { if (res.error == 0) { that.$message.success(res.message) that.getList() } else { that.$message.error(res.message) } }) }).catch(() => { }); } } }, xswancheng(row, type) { const that = this console.log(row) if (row['cpzrs'] == row['cprs'] && type == 1) { let data = { bjid: row.bjid, sfwc: type, } $.post("/www/public/selectschool/cpjd-cz", data, function (res) { if (res.error == 0) { that.$message.success(res.data) that.getList() } else { that.$message.error(res.data) } }) } else if (type == 1) { this.$prompt('请补充实测人数不等于应测人数的原因', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', }).then(({ value }) => { if (!value) return that.$message.error('请完成/未完成输入原因') let data = { bjid: row.bjid, sfwc: type, reason: value } $.post("/www/public/selectschool/cpjd-cz", data, function (res) { if (res.error == 0) { that.$message.success(res.data) that.getList() } else { that.$message.error(res.data) } }) }).catch(() => { }); } else { this.$prompt('请输入原因', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', }).then(({ value }) => { if (!value) return that.$message.error('请完成/未完成输入原因') let data = { bjid: row.bjid, sfwc: type, reason: value } $.post("/www/public/selectschool/cpjd-cz", data, function (res) { if (res.error == 0) { that.$message.success(res.data) that.getList() } else { that.$message.error(res.data) } }) }).catch(() => { }); } }, getXSDetail(row) { var that = this const params = { bjid: row.bjid } $.get("/www/public/shimingimport/findbjxs-ssd", params, function (res) { if (res.success == 1) { const xbMap = new Map([['1', '男'], ['2', '女']]) const sfwczdMap = new Map([['0', '未完成'], ['1', '已完成']]) that.stuList = res.data.length ? res.data.map(s => ({ ...s, sfwczd: sfwczdMap.get(s.sfwczd) })) : [] } else { that.$message.error(res.message) } }).fail((xhr, status, error) => { that.$message.error('请求错误') }) }, xschakan(row) { console.log(row) this.getXSDetail(row) this.$refs.jsxxxxjxgshenhe.show() }, duban(row, type) { var that = this data = { xxid: row.id, type } url = "/www/public/shangbao/dbcpxx" $.get(url, data, function (res) { if (res.success == 1) { that.$message.success('已发送短信督办') } else { that.$message.error(res.message) } }).fail((xhr, status, error) => { that.$message('请求错误') }) }, downloads0() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var name = '全校未测学生.xls' var url = '/www/public/selectschool/cpjdwwc-dc-ssd-2026' const params = { userid: user.ID, } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { let data = res.data let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') } else { this.$message.error('下载失败') } }) }, downloads2() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var name = '全校已测学生.xls' var url = '/www/public/selectschool/cpjdwc-dc-ssd' const params = { userid: user.ID, } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { let data = res.data let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') } else { this.$message.error('下载失败') } }) }, downloads11() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var name = '教师测评进度.xls' var url = '/www/public/jingdu/lslistbyls_export' const params = { userid: user.ID, roles: user.Roles[0], username: user.Username, typec } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { let data = res.data let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') } else { this.$message.error('下载失败') } }) }, downloads1() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var name = '学生测评进度.xls' var url = '/www/public/jingdu/findzdlvdc' if (user.Roles.includes('220')) { typec = '1' } else if (user.Roles.includes('310') || user.Roles.includes('410')) { typec = '2' } else if (user.Roles.includes('450')) { typec = '4' url = '/www/public/selectschool/cpjd-dc-ssd-2026' } const params = { userid: user.ID, roles: user.Roles[0], username: user.Username, typec } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { let data = res.data let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') } else { this.$message.error('下载失败') } }) }, downloads() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var name = '测评进度.xls' if (user.Roles.includes('220')) { typec = '1' } else if (user.Roles.includes('310') || user.Roles.includes('410')) { typec = '2' } else if (user.Roles.includes('450')) { typec = '4' } const params = { userid: user.ID, roles: user.Roles[0], username: user.Username, typec } axios({ method: 'get', url: '/www/public/selectschool/cpjd-dc-ssd-2026', params: { ...params }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { let data = res.data let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') } else { this.$message.error('下载失败') } }) }, download() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var sfxzdw = '' var name = '' if (that.activeName == 'first' && that.sfxzdw == '1') { sfxzdw = that.sfxzdw name = '市教育局工作组上报进度.xls' } else if (that.activeName == 'first' && that.sfxzdw == '3') { sfxzdw = that.sfxzdw name = '区县教育局工作组上报进度.xls' } else if (that.activeName == 'first' && that.sfxzdw == '2') { sfxzdw = that.sfxzdw name = '学校工作组上报进度.xls' } else if (that.activeName == 'second') { sfxzdw = '4' name = '学校信息上报进度.xls' } const params = { userid: user.ID, roles: user.Roles[0], sfxzdw, xxxd: this.xxxd } axios({ method: 'get', url: '/www/public/shangbao/sb-gzzsbjd-dc', params: { ...params }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { let data = res.data let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') } else { this.$message.error('下载失败') } }) }, getDetail(row) { this.curData = { ...row } this.$refs.XDgongzuozuDetail.show() }, tabchange() { console.log(this.activeName) this.getList() }, handleback() { var len = this.paramspath.length if (len > 1) { this.paramspath.pop() this.getList(this.paramspath[len - 1]) } else { return } }, handleRowClick(row) { console.log(row, 'row') var len = this.paramspath.length this.getList({ typec: Number(this.paramspath[len - 1].typec) + 1 + '', username: row.username }) }, handleClick(tab, event) { console.log(tab, event); }, onError() { }, show(type) { this.type = type this.getList() this.$refs.baseDialog.show() }, getTotalcpjd(username, typec) { var that = this const data = { username, typec, } url = "/www/public/selectschool/cpjd-zt" $.get(url, data, function (res) { if (res.success == 1) { if (res.data && res.data.length) { that.totalJindu = res.data[0] } } else { that.$message.success(res.message) } }).fail((xhr, status, error) => { }) }, getList(param) { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var data = {} if (that.activeName == 'third') { var url = "/www/public/jingdu/findzdlv" if (user.Roles.includes('220')) { typec = '1' } else if (user.Roles.includes('310') || user.Roles.includes('410')) { typec = '2' } else if (user.Roles.includes('450')) { url = "/www/public/selectschool/cpjd-ssd-2026" typec = '4' } data = { username: user.Username, typec, } $.get(url, data, function (res) { if (res.success == 1) { if (user.Roles.includes('450')) { that.tableData3 = res.data.filter(item => item.xxmc.includes(that.xxss)) } else { that.tableData3 = res.data } that.tableData3Backup = [...that.tableData3] // 备份当前显示的数据 } else { that.$message.success(res.message) } }).fail((xhr, status, error) => { }) if (user.Roles.includes('450')) { // that.getTotaljd() } else { // that.getTotalcpjd(user.Username,typec) } } else if (that.activeName == 'third-fiveth') { /* var url = "/www/public/jingdu/lslist" data = { } $.get(url, data, function(res){ if(res.success==1){ that.tableData3 = res.data that.tableData3Backup = [...res.data] // 备份原始数据 }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{}) that.getTotaljd() */ var url = "/www/public/jingdu/findzdlv" if (user.Roles.includes('220')) { url = "/www/public/jingdu/findzdlv" typec = '1' } else if (user.Roles.includes('310') || user.Roles.includes('410')) { url = "/www/public/jingdu/findzdlv" typec = '2' } else if (user.Roles.includes('450')) { if (this.status == 1) { url = "/www/public/jingdu/lslistbyls" typec = '4' } else { url = "/www/public/jingdu/lslistbyxxfzr" typec = '4' } } data = { username: user.Username, typec, } $.get(url, data, function (res) { if (res.success == 1) { that.tableData3 = res.data that.tableData3Backup = [...res.data] // 备份原始数据用于筛选 } else { that.$message.success(res.message) } }).fail((xhr, status, error) => { }) if (user.Roles.includes('450')) { // that.getTotaljd() } else { // that.getTotalcpjd(user.Username,typec) } } else { data = { userid: user.ID, roles: user.Roles[0], gzzss: that.gzzss, xxss: that.xxss, sfxzdw: !that.Roles.includes('410') ? that.sfxzdw : '2', xxxd: this.xxxd } url = "/www/public/shangbao/sb-gzzsbjd" $.post(url, data, function (res) { if (res.success == 1) { that.tableData1 = res.data.gzz that.tableData2 = res.data.sclxx that.gzzjd = res.data.gzzjd that.xxxxjd = res.data.xxxxjd } else { this.$message.success(res.message) } }).fail((xhr, status, error) => { }) } }, getTotaljd() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} let data = { xxid: user.ID } $.get('/www/public/jingdu/findxxjdbyid', data, function (res) { if (res.success == 1) { that.totalJindu = res.data ? res.data : {} } else { this.$message.success(res.message) } }).fail((xhr, status, error) => { }) }, handleConfirm() { this.$refs.baseDialog.close() }, // 筛选表格数据 filterTableData() { if (this.activeName == 'third-fiveth') { if (this.sfwcFilter) { // 使用备份数据进行筛选 this.tableData3 = this.tableData3Backup.filter(item => { const answerStatus = item['学校负责人作答数']; if (this.sfwcFilter == '已完成') { return answerStatus == '已完成' } else if (this.sfwcFilter == '未完成') { return answerStatus == '未完成' || answerStatus == null } return true }) } else { // 如果没有筛选条件,显示全部数据 this.tableData3 = [...this.tableData3Backup] } } }, handleClick() { }, handleClose() { this.dialogVisible = false }, toggleSelection(rows) { if (rows) { rows.forEach(row => { this.$refs.multipleTable.toggleRowSelection(row); }); } else { this.$refs.multipleTable.clearSelection(); } }, handleSelectionChange(val) { this.multipleSelection = val; } }, computed: { isZXS() { var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var userName = user.Username var quyubianma = userName.substring(3) console.log(quyubianma, 'quyubianma') return ['110000', '120000', '310000', '500000'].includes(quyubianma) } }, watch: { activeName(val) { this.paramspath = [] } }, created: function () { var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} this.Roles = user.Roles var type = this.$route.query.type this.status = this.$route.query.status this.xxjd = localStorage.getItem('xxjd') this.activeName = type if (this.Roles.includes('220')) { if (this.isZXS) { this.sfxzdw = '3' } } else if (this.Roles.includes('310')) { this.sfxzdw = '3' } else if (this.Roles.includes('410')) { this.sfxzdw = '2' } if (this.activeName == 'first') { this.pageName = '工作组信息上报进度' } else if (this.activeName == 'second') { this.pageName = '学校信息上报进度' } else if (this.activeName == 'third') { this.pageName = '测评进度' if (this.Roles.includes('450')) { this.pageName = '学生测评进度' } } else if (this.activeName == 'fourth') { this.pageName = '样本校测试安排表' } else if (this.activeName == 'fiveth') { this.pageName = '文件上传进度' } else if (this.activeName == 'third-fiveth') this.pageName = '老师测评进度' this.getList() }, mounted: function () { }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-grbgSsd-view", function(resolve, reject){ var template = ""; return (function(template, resolve, reject) { seajs.use([], function () { return resolve({ template: template, data: function () { return { res: {} }; }, methods: { getDimensionName(key) { const names = { 'qpzz': '强迫症状', 'dd': '敌对', 'jsbx': '精神病性', 'pz': '偏执', 'kb': '恐怖', 'yy': '抑郁', 'jl': '焦虑', 'qth': '躯体化', 'rjgxmg': '人际关系敏感' }; return names[key] || key; }, exportPDF() { const element = document.getElementById("pdf-content"); if (!element) { console.error("错误:未找到元素 'pdf-content'"); return; } // 显示加载提示 const spinner = document.createElement("div"); spinner.innerHTML = `
PDF生成中,请勿操作页面...
`; document.body.appendChild(spinner); // 1. 处理所有ECharts图表 const charts = []; const chartElements = element.querySelectorAll(".grbg-chart-container"); chartElements.forEach(container => { const chartInstance = echarts.getInstanceByDom(container); if (chartInstance) { chartInstance.resize(); charts.push({ instance: chartInstance, container: container }); } }); // 2. 给图表渲染留足时间 setTimeout(() => { const chartPromises = []; const replacedCharts = []; charts.forEach(({ instance, container }) => { const canvas = instance.getDom(); const tempImg = document.createElement('img'); tempImg.style.width = canvas.offsetWidth + 'px'; tempImg.style.height = canvas.offsetHeight + 'px'; tempImg.src = instance.getDataURL({ backgroundColor: '#fff', pixelRatio: 2 }); const promise = new Promise(resolve => { tempImg.onload = () => { const parent = canvas.parentNode; parent.insertBefore(tempImg, canvas); parent.removeChild(canvas); replacedCharts.push({ instance: instance, parent: parent, img: tempImg, canvas: canvas }); resolve(); }; }); chartPromises.push(promise); }); // 3. 等所有图表转换完成后进行PDF导出 Promise.all(chartPromises).then(() => { // 单页长图模式 this.generateSinglePagePDF(element, replacedCharts, spinner); }); }, 800); }, generateSinglePagePDF(element, replacedCharts, spinner) { // 单页长图模式 - 生成一个超长的PDF页面 html2canvas(element, { scale: 1.2, useCORS: true, backgroundColor: "#fff", width: element.scrollWidth, height: element.scrollHeight }).then(canvas => { const imgData = canvas.toDataURL('image/png'); // 计算合适的PDF尺寸 const imgWidth = canvas.width; const imgHeight = canvas.height; // 创建自定义尺寸的PDF,宽度固定为A4宽度,高度根据内容调整 const pdfWidth = 595; // A4宽度(pt) const pdfHeight = imgHeight * pdfWidth / imgWidth; const pdf = new jspdf.jsPDF({ orientation: 'portrait', unit: 'pt', format: [pdfWidth, pdfHeight] }); // 添加图片到PDF,填满整个页面 pdf.addImage( imgData, 'PNG', 0, 0, pdfWidth, pdfHeight, '', 'FAST' ); // 保存PDF pdf.save(`${this.$route.query.id}心理健康报告.pdf`); // 恢复图表 replacedCharts.forEach(item => { item.parent.insertBefore(item.canvas, item.img); item.parent.removeChild(item.img); item.instance.resize(); }); document.body.removeChild(spinner); }).catch(error => { console.error('单页PDF生成失败:', error); document.body.removeChild(spinner); alert('导出失败: ' + error.message); }); }, getDataList() { const that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} let data = { // xh:that.$route.query.id id: that.$route.query.id } $.post("/www/public/cpgl/agetCpBgptByAppid", data, function (res) { that.res = (res && res.data != null) ? res.data : res }) }, }, created: function () { this.getDataList() }, mounted: function () { }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-evaluationStatisticsSsd-view", function(resolve, reject){ var template = ""; return (function(template, resolve, reject) { seajs.use([], function () { return resolve({ template: template, data: function () { return { id: Math.uuid(), // 进度用接口返回字段:pucesecond/cnttotal/pucefinish/sclfinish/sclsecond pucesecond: 0, cnttotal: 0, pucefinish: 0, sclfinish: 0, sclsecond: 0, activeTab: 'scl90_total', searchName: '', searchXh: '', tableList: [], loading: false, pageNo: 1, pageSize: 10, total: 0, scltotal: 0, sclsecond_total: 0 }; }, computed: { cpPercent: function () { if (this.cnttotal <= 0) return 0; return Math.min(100, Number(((this.pucefinish / this.cnttotal) * 100).toFixed(1))); }, sclPercent: function () { if (this.cnttotal <= 0) return 0; return Math.min(100, Number(((this.sclfinish / this.cnttotal) * 100).toFixed(1))); } }, methods: { switchTab: function (tab) { if (this.activeTab === tab) return; this.activeTab = tab; this.pageNo = 1; this.loadList(); }, loadList: function () { var vm = this; var schoolId = vm.$route.query.id || ''; var tab = vm.activeTab; var isfirst = (tab === 'scl90_total') ? 1 : 2; var xm = (vm.searchName || '').trim(); var xh = (vm.searchXh || '').trim(); vm.loading = true; $.get('/www/public/cpgl/pccpjlck', { schoolId: schoolId, xm: xm, xh: xh, pagesize: vm.pageSize, pageno: vm.pageNo, isfirst: isfirst, listType: 'scl90' }, function (res) { vm.loading = false; if (res.code === 200) { var scl90Data = (res.data && res.data.scl90_data) ? res.data.scl90_data : []; var list = vm.formatScl90List(scl90Data); vm.tableList = list; vm.total = (res.data.scl90_total != null ? res.data.scl90_total : 0); } else { vm.tableList = []; vm.total = 0; if (res.message) vm.$message.error(res.message); } }).fail(function () { vm.loading = false; vm.tableList = []; vm.total = 0; vm.$message.error('请求失败'); }); }, formatScl90List: function (arr) { arr = Array.isArray(arr) ? arr : []; return arr.map(function (item) { return { zy: item.zy != null ? item.zy : (item.zymc != null ? item.zymc : ''), rxnf: item.nj != null ? item.nj : '', bj: item.bj != null ? item.bj : (item.bjmc != null ? item.bjmc : ''), xm: item.xm != null ? item.xm : '', xh: item.xh != null ? String(item.xh) : '', endTime: item.starttime != null ? item.starttime : (item.endtime != null ? item.endtime : ''), xy:item.xy != null ? item.xy : item.xy, }; }); }, handleSizeChange: function (val) { this.pageSize = val; this.pageNo = 1; this.loadList(); }, handleCurrentChange: function (val) { this.pageNo = val; this.loadList(); }, loadProgressSummary: function () { var vm = this; var schoolId = vm.$route.query.id; if (!schoolId) return; $.get('/www/public/cpgl/ssdcpjd', { schoolId: schoolId }, function (res) { if (res.code !== 200 || !res.data) return; var d = res.data; vm.pucesecond = d.pucesecond != null ? Number(d.pucesecond) : 0; vm.cnttotal = d.cnttotal != null ? Number(d.cnttotal) : 0; vm.pucefinish = d.pucefinish != null ? Number(d.pucefinish) : 0; vm.sclfinish = d.sclfinish != null ? Number(d.sclfinish) : 0; vm.sclsecond = d.sclsecond != null ? Number(d.sclsecond) : 0; vm.scltotal = d.scltotal != null ? Number(d.scltotal) : 0; vm.sclsecond_total = d.sclsecond_total != null ? Number(d.sclsecond_total) : 0; }); }, onSearch: function () { this.pageNo = 1; this.loadList(); } }, created: function () { }, mounted: function () { this.loadProgressSummary(); this.loadList(); } }); }); })(template, resolve, reject); }); RegVueCom("xljk-showReportSsd-view", function(resolve, reject){ var template = " "; return (function(template, resolve, reject) { seajs.use([], function () { return resolve({ template: template, data: function () { return { id: Math.uuid(), form: { searchKey: '', // 学生姓名、学号 pclx: '', // 选择批次 xxjd: '', // 学段 bj: '', // 学院(院系名称 yxmc) nj: '', // 年级 // sfyj: '', // 是否预警 }, totalItems: 0, page: { pageNum: 1, pageSize: 10 }, studentList: [], reportIndex: 0, reportsData: null, reportsBlob: [], reportDownloading: false, xdList: [], njList: [] }; }, computed: { reportData() { if (!this.reportsData || !this.reportsData.length) return null; return this.reportsData[this.reportIndex]; } }, methods: { // 下载学校报告 downloadSchoolReport() { console.log('下载学校报告'); const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var name ='学生心理健康测评报告.pdf' var that = this $.get('/www/public/baogao/pdwjsfcz', { id: user.ID, type: 1, xmid: '2c13a854-8c9d-438a-bc79-084b5517bc11' }, function (res1) { if (res1.success == 1 || res1.error == 0) { $.get('/www/public/baogao/cksfsq', {}, function (res) { if (res.success == 1 || res.error == 0) { if (String(res.data) === '1') { axios({ method: 'get', url: '/www/public/baogao/xxbgdownload', params: { id: user.ID, type: 1, xmid: '2c13a854-8c9d-438a-bc79-084b5517bc11' }, responseType: 'blob' }) .then(function (response) { var blob = new Blob([response.data]) var link = document.createElement('a') link.href = window.URL.createObjectURL(blob) link.download = name document.body.appendChild(link) link.click() document.body.removeChild(link) that.$message.success('下载成功') }).catch(function () { that.$message.error('下载失败') }) } else { that.$message.warning('暂无权限下载,请等待上级授权后重试') } } else { that.$message.error(res.message || '请求失败') } }).fail(function () { that.$message.error('请求失败') }) } else { that.$message.error(res1.message || '请求失败') } }).fail(function () { that.$message.error('请求失败') }) return }, // 下载学生预警名单:GET /www/public/home/exportxxyjmd-ssd,参数 xxid downloadStudentWarningList() { const that = this; const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; const xxid = user.ID; axios({ method: 'get', url: '/www/public/home/exportxxyjmd-ssd', params: { xxid }, responseType: 'blob' }).then(function (response) { const blob = new Blob([response.data]); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = '学生测评结果.xlsx'; document.body.appendChild(a); a.click(); document.body.removeChild(a); window.URL.revokeObjectURL(url); }).catch(function () { that.$message.error('下载失败,请稍后重试'); }); }, onXdChange(val) { this.form.bj = ''; this.form.nj = ''; this.njList = []; this.getXdList(val); }, getXdList(xd) { const that = this; that.form.bj = ''; that.form.nj = ''; that.njList = []; const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; const params = { xxid: user.ID, xd }; $.get('/www/public/baogao/ssdfindxyList', params, function (res) { console.log(res); if (res.success == 1 || res.error == 0) { that.xdList = res.data || []; } else { that.$message.error(res.message || '获取学段列表失败'); that.xdList = []; } }) }, // 选择学院后拉取年级列表:GET ssdfindnjList,xxid、xd、yxmc onCollegeChange() { const that = this; that.form.nj = ''; that.njList = []; if (!that.form.xxjd || !that.form.bj) return; const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; $.get('/www/public/baogao/ssdfindnjList', { xxid: user.ID, xd: that.form.xxjd, yxmc: that.form.bj }, function (res) { if (res.success == 1 || res.error == 0) { that.njList = res.data || []; } else { that.$message.error(res.message || '获取年级列表失败'); that.njList = []; } }).fail(function () { that.$message.error('获取年级列表请求失败'); that.njList = []; }); }, // 获取学生列表 fetchStudents() { this.getList(); }, // 搜索处理 handleSearch() { this.page.pageNum = 1; this.getList(); }, handleSizeChange(val) { this.page.pageSize = val; this.page.pageNum = 1; this.getList(); }, handleCurrentChange(val) { this.page.pageNum = val; this.getList(); }, // 查看报告 viewReport(studentId) { /* const filters = JSON.stringify(this.form); localStorage.setItem('xxbgFilter', filters); // 跳转到报告详情页 this.$router.push({ path: '/grbg', query: { id: studentId } }); */ window.open(`${window.location.origin}${window.location.pathname}?#/grbgSsd?id=${studentId}`, '_blank'); }, goBack() { this.$router.go(-1) }, getList() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; let data = { xxid: user.ID, // nj: this.searchGrade, ...this.form, pagesize: this.page.pageSize, pageno: this.page.pageNum, }; $.post("/www/public/home/bgList", data, function (res) { if (res.success == 1 || res.error == 0) { that.studentList = res.data || []; that.totalItems = res.total || 0; } else { that.$message.error(res.message || '获取学生列表失败'); that.studentList = []; that.totalItems = 0; } }).fail(function (xhr, status, error) { that.$message.error('网络请求失败,请稍后重试'); that.studentList = []; that.totalItems = 0; }); }, getReportDetail(id) { return new Promise(resolve => { let data = { id, } $.post("/www/public/cpgl/agetCpBgptByAppid", data, function (res) { resolve(res); }); }); }, getDimensionName(key) { const names = { 'qpzz': '强迫症状', 'dd': '敌对', 'jsbx': '精神病性', 'pz': '偏执', 'kb': '恐怖', 'yy': '抑郁', 'jl': '焦虑', 'qth': '躯体化', 'rjgxmg': '人际关系敏感' }; return names[key] || key; }, getDataList() { // if (!this.form.pclx || !this.form.xxjd || !this.form.bj) { // this.$message.warning('选择批次、学段、学院不能为空'); // return; // } if (!this.form.xxjd || !this.form.bj) { this.$message.warning('学段、学院不能为空'); return; } const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; let data = { xxid: user.ID, ...this.form }; this.reportDownloading = true; $.post("/www/public/home/bgListExportAppids", data, function (res) { if (res.success == 1 || res.error == 0) { var list = res.data && Array.isArray(res.data) ? res.data : []; if (!list.length) { that.$message.warning('暂无符合条件的学生报告'); that.reportDownloading = false; return; } Promise.all(list.map(r => that.getReportDetail(r.id))).then(ress => { console.log(ress, '返回批量下载'); if (ress && ress.length) { // 接口可能返回 { data: 报告对象 },统一成报告对象数组 that.reportsData = ress.map(function (item) { return item && item.data != null ? item.data : item; }); that.reportsBlob = []; that.reportIndex = 0; that.$nextTick(() => { that.exportPDF([]); }); } else { that.reportDownloading = false; } }); } else { that.$message.error(res.message || '获取学生报告失败'); that.reportsData = []; } }).fail(function (xhr, status, error) { that.$message.error('网络请求失败,请稍后重试'); that.reportsData = []; this.reportDownloading = false; }); }, exportPDF() { const element = document.getElementById("pdf-content"); if (!element) { console.error("错误:未找到元素 'pdf-content'"); return; } let spinner = document.getElementById('spinner-download'); if (!spinner) { // 显示加载提示 spinner = document.createElement("div"); spinner.id = 'spinner-download'; spinner.innerHTML = `
PDF生成中(1/${this.reportsData.length}),请勿操作页面...
`; document.body.appendChild(spinner); } else { spinner.innerHTML = `
PDF生成中(${this.reportIndex + 1}/${this.reportsData.length}),请勿操作页面...
`; } // 1. 处理所有ECharts图表 const charts = []; const chartElements = element.querySelectorAll(".chart-container"); chartElements.forEach(container => { const chartInstance = echarts.getInstanceByDom(container); if (chartInstance) { chartInstance.resize(); charts.push({ instance: chartInstance, container: container }); } }); // 2. 给图表渲染留足时间 setTimeout(() => { const chartPromises = []; const replacedCharts = []; charts.forEach(({ instance, container }) => { const canvas = instance.getDom(); const tempImg = document.createElement('img'); tempImg.style.width = canvas.offsetWidth + 'px'; tempImg.style.height = canvas.offsetHeight + 'px'; tempImg.src = instance.getDataURL({ backgroundColor: '#fff', pixelRatio: 2 }); const promise = new Promise(resolve => { tempImg.onload = () => { const parent = canvas.parentNode; parent.insertBefore(tempImg, canvas); parent.removeChild(canvas); replacedCharts.push({ instance: instance, parent: parent, img: tempImg, canvas: canvas }); resolve(); }; }); chartPromises.push(promise); }); // 3. 等所有图表转换完成后进行PDF导出 Promise.all(chartPromises).then(() => { // 单页长图模式 this.generateSinglePagePDF(element, replacedCharts, spinner); }); }, 800); }, generateSinglePagePDF(element, replacedCharts, spinner) { // 单页长图模式 - 生成一个超长的PDF页面 html2canvas(element, { scale: 1.2, useCORS: true, backgroundColor: "#fff", width: element.scrollWidth, height: element.scrollHeight }).then(canvas => { const imgData = canvas.toDataURL('image/png'); // 计算合适的PDF尺寸 const imgWidth = canvas.width; const imgHeight = canvas.height; // 创建自定义尺寸的PDF,宽度固定为A4宽度,高度根据内容调整 const pdfWidth = 595; // A4宽度(pt) const pdfHeight = imgHeight * pdfWidth / imgWidth; const pdf = new jspdf.jsPDF({ orientation: 'portrait', unit: 'pt', format: [pdfWidth, pdfHeight] }); // 添加图片到PDF,填满整个页面 pdf.addImage( imgData, 'PNG', 0, 0, pdfWidth, pdfHeight, '', 'FAST' ); // 保存PDF // pdf.save(`${this.$route.query.id}心理健康报告.pdf`); // 获取 PDF 的输出为 Uint8Array const pdfOutputArray = pdf.output('arraybuffer'); // 将 Uint8Array 转换为 Blob const pdfBlob = new Blob([pdfOutputArray], { type: 'application/pdf' }); // 恢复图表 replacedCharts.forEach(item => { item.parent.insertBefore(item.canvas, item.img); item.parent.removeChild(item.img); item.instance.resize(); }); this.$set(this.$data, 'reportsBlob', [...this.reportsBlob, pdfBlob]); const nextIdx = this.reportIndex + 1; if (nextIdx < this.reportsData.length) { this.$set(this.$data, 'reportIndex', nextIdx); // 等 Vue 把当前报告切到下一份并更新 DOM 后再导出 this.$nextTick(() => { setTimeout(() => { this.exportPDF(); }, 350); }); } else { const zip = new JSZip(); this.reportsBlob.forEach((blob, index) => { const item = this.reportsData[index]; const xh = (item && item.xh) ? String(item.xh) : 'report'; console.log(item, 'item'); const date = (item && item.date) ? String(item.date) : ''; const name = date ? `${xh}心理健康报告-${date}作答.pdf` : `${xh}心理健康报告.pdf`; zip.file(name, blob); }); zip.generateAsync({ type: "blob" }).then((content) => { // 创建一个临时的 URL 来触发下载,而不是在浏览器中打开或预览 ZIP 文件。 const url = URL.createObjectURL(content); const a = document.createElement('a'); a.href = url; a.download = '心理健康报告.zip'; // 设置下载文件的名称 document.body.appendChild(a); // 将元素添加到文档中以便触发下载事件。 a.click(); // 触发下载事件。 document.body.removeChild(a); // 清理文档。 URL.revokeObjectURL(url); // 释放临时 URL。 this.$set(this.$data, 'reportsBlob', []); this.$set(this.$data, 'reportIndex', 0); }); document.body.removeChild(spinner); this.reportDownloading = false; } }).catch(error => { console.error('单页PDF生成失败:', error); document.body.removeChild(spinner); alert('导出失败: ' + error.message); this.reportDownloading = false; }); }, }, created: function () { }, mounted: function () { this.getList(); }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-showReport-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n
\n
\n
\n

尊敬的学校负责人:

\n

您好!您即将下载的文件为本次测评结果,请作为学校内部资料,在后续使用中:

\n

注意保密:请您严格保密预警学生数据,避免外传。

\n

客观解读:学校报告和预警学生名单是根据学生测试时的作答结果生成,请根据学生具体情况,分层干预指导。

\n

谨慎传递:建议您避免使用微信、QQ等即时通讯工具传递,文档已加密,密码可从贵校上级教育管理部门获取。

\n

感谢您的支持!

\n
\n
\n
\n
{{ idx < 9 ? '0' + (idx + 1) : (idx + 1) }}
\n
\n \"\"\n
\n
{{ item.name }}
\n
{{ item.action || '下载' }}
\n
\n
\n
\n
\n
\n
\n
\n
\n\n \n
\n
\n
\n
\n \n
\n

{{ item.filename }}

\n
\n
\n \n

下载

\n
\n \n

预览

\n
\n
\n
\n
\n
\n
\n
\n\n \n \n \n \n \n \n \n \n \n
\n \n 0\" @click=\"getViewReportCode\">\n {{ viewReportCodeCountdown > 0 ? viewReportCodeCountdown + 's后重试' : '获取验证码' }}\n \n
\n
\n
\n \n 取消\n 确定\n \n
\n
\n
"; return (function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { user: {}, sfzg: '1', sfkqbg: '1', sfqy: '', bgPath: '', isYunnanUser: false, isXionganUser: false, yunnanDialogVisible: false, yunnanFiles: [], reportItemsCity: [ { code: 'city-report', name: '市级报告下载', action: '下载' }, { code: 'county-report-auth', name: '县级报告下载与授权', action: '查看' }, { code: 'school-report-auth', name: '校级报告下载', action: '查看' } ], reportItemsProvince: [ { code: 'prov-report', name: '省级报告下载', action: '下载' }, { code: 'county-report-download', name: '区县级报告下载', action: '查看' }, { code: 'county-report-auth', name: '县级报告下载与授权', action: '查看' }, { code: 'school-report-auth', name: '校级报告下载', action: '查看' } ], reportItemsCounty: [ { code: 'county-report-auth', name: '县级报告下载', action: '查看' }, { code: 'school-report-auth', name: '校级报告下载与授权', action: '查看' } ], reportItemsSchool: [ { code: 'student-report', name: '学生心理健康测评报告下载', action: '下载' }, { code: 'warning-interpret', name: '预警结果解读下载', action: '下载' }, { code: 'warning-stu-list', name: '预警学生名单下载', action: '下载' } ], viewReportDialogVisible: false, viewReportForm: { name: '', phone: '', verifyCode: '' }, viewReportCodeCountdown: 0 }; }, computed: { // 管理端与报告查看端对应:校端450->653 省端220->651 市端310->654 区县410->652;当前登录多为管理端,按对应关系展示报告项 currentReportItems: function() { var user = this.user || {}; // 兼容 Roles 为数字或字符串(如 450 与 '450') var roles = (user.Roles || []).map(function(r) { return String(r); }); var has = function(r) { return roles.includes(String(r)); }; var showDownload = this.isYunnanUser || this.isXionganUser || String(this.sfqy) === '1'; if (has('651') || has('220')) { if (this.sfzg == '0') { var arr = [ { code: 'prov-report', name: '省级报告下载', action: '下载' }, { code: 'city-report-auth', name: '市级报告权限授权', action: '查看' }, { code: 'county-report-download', name: '区县级报告下载', action: '查看' }, { code: 'school-report-auth', name: '校级报告下载', action: '查看' } ]; if (showDownload) arr.unshift({ code: 'yunnan_download', name: '资料下载', action: '下载' }); return arr; } var arr = this.reportItemsProvince.slice(); if (this.sfzg == '1') arr = arr.filter(function(item) { return item.code !== 'county-report-download'; }); if (showDownload) arr.unshift({ code: 'yunnan_download', name: '资料下载', action: '下载' }); return arr; } if (has('652') || has('410')) { var arr = this.reportItemsCounty.slice(); if (showDownload) arr.unshift({ code: 'yunnan_download', name: '资料下载', action: '下载' }); return arr; } if (has('653') || has('450')) { var arr = this.reportItemsSchool.slice(); if (showDownload) arr.unshift({ code: 'yunnan_download', name: '资料下载', action: '下载' }); return arr; } if (has('654') || has('310')) { if (this.sfkqbg == '0') { var arr = this.reportItemsCity.filter(function(item) { return item.code !== 'city-report'; }); if (showDownload) arr.unshift({ code: 'yunnan_download', name: '资料下载', action: '下载' }); return arr; } var arr = this.reportItemsCity.slice(); if (showDownload) arr.unshift({ code: 'yunnan_download', name: '资料下载', action: '下载' }); return arr; } return []; }, // 是否显示校端提示(653/450,兼容数字与字符串角色) showSchoolReportTip: function() { var roles = (this.user && this.user.Roles) ? (this.user.Roles || []).map(function(r) { return String(r); }) : []; return roles.includes('653') || roles.includes('450'); } }, methods: { handleReportItemClick: function(item) { var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; if (item.code === 'yunnan_download') { this.handleYunnanDownload(); return; } if (item.code === 'account') { if (user.Roles && user.Roles.includes('651')) { this.$message.success('开始下载'); return; } var that = this; const data = { } const ssdRoles = [220, 310, 410, 450]; if (ssdRoles.includes(Number(user.Roles))) { data.xmid = '2c13a854-8c9d-438a-bc79-084b5517bc11'; } $.get('/www/public/baogao/cksfsq', data, function(res) { if (res.success == 1 || res.error == 0) { if (String(res.data) === '1') { that.$message.success('已授权,开始下载'); } else { that.$message.warning('暂无权限下载,请等待上级授权后重试'); } } else { that.$message.error(res.message || '请求失败'); } }).fail(function() { that.$message.error('请求失败'); }); return; } if (item.code === 'city-report') { var that = this; if (user.Roles && user.Roles.includes('654') && that.sfkqbg == '1') { that.downloadJYJReport(user.ID, '市级报告.zip'); } else { that.$message.warning('报告未生成或无权限下载'); } return; } if (item.code === 'city-report-auth') { this.$router.push({ path: '/bgAuth', query: { type: '3' } }); return; } if (item.code === 'prov-report') { var that = this; if (user.Roles && user.Roles.includes('651')) { that.downloadJYJReport(user.ID, '省级报告.zip'); } else { that.$message.success('开始下载'); } return; } if (item.code === 'county-report-auth') { if (user.Roles && user.Roles.includes('652')) { var that = this; const data = { } const ssdRoles = [220, 310, 410, 450]; if (ssdRoles.includes(Number(user.Roles))) { data.xmid = '2c13a854-8c9d-438a-bc79-084b5517bc11'; } $.get('/www/public/baogao/cksfsq', data, function(res) { if (res.success == 1 || res.error == 0) { if (String(res.data) === '1') { that.downloadJYJReport(user.ID, '县级报告.zip'); } else { that.$message.warning('暂无权限下载,请等待上级授权后重试'); } } else { that.$message.error(res.message || '请求失败'); } }).fail(function() { that.$message.error('请求失败'); }); return; } this.$router.push({ path: '/bgAuth', query: { type: '1' } }); return; } if (item.code === 'student-report' || item.code === 'warning-interpret' || item.code === 'warning-stu-list') { var typeMap = { 'student-report': 1, 'warning-interpret': 2, 'warning-stu-list': 3 }; var fileNameMap = { 'student-report': '学生心理健康测评报告.pdf', 'warning-interpret': '预警结果解读.pdf', 'warning-stu-list': '预警学生名单.xlsx' }; var t = typeMap[item.code]; var name = fileNameMap[item.code]; var that = this; const data = { id: user.ID, type: t } const ssdRoles = [220, 310, 410, 450]; if (ssdRoles.includes(Number(user.Roles))) { data.xmid = '2c13a854-8c9d-438a-bc79-084b5517bc11'; } $.get('/www/public/baogao/pdwjsfcz', data, function(res1) { if (res1.success == 1 || res1.error == 0) { const data = { } const ssdRoles = [220, 310, 410, 450]; if (ssdRoles.includes(Number(user.Roles))) { data.xmid = '2c13a854-8c9d-438a-bc79-084b5517bc11'; } $.get('/www/public/baogao/cksfsq', data, function(res) { if (res.success == 1 || res.error == 0) { if (String(res.data) === '1') { const data2 = { id: user.ID, type: t } const ssdRoles = [220, 310, 410, 450]; if (ssdRoles.includes(Number(user.Roles))) { data2.xmid = '2c13a854-8c9d-438a-bc79-084b5517bc11'; } axios({ method: 'get', url: '/www/public/baogao/xxbgdownload', params: data2, responseType: 'blob' }) .then(function(response) { var blob = new Blob([response.data]); var link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = name; document.body.appendChild(link); link.click(); document.body.removeChild(link); that.$message.success('下载成功'); }).catch(function() { that.$message.error('下载失败'); }); } else { that.$message.warning('暂无权限下载,请等待上级授权后重试'); } } else { that.$message.error(res.message || '请求失败'); } }).fail(function() { that.$message.error('请求失败'); }); } else { that.$message.error(res1.message || '请求失败'); } }).fail(function() { that.$message.error('请求失败'); }); return; } if (item.code === 'county-report-download') { this.$router.push({ path: '/bgAuth2', query: { type: '1' } }); return; } if (item.code === 'school-report-auth') { this.$router.push({ path: '/bgAuth', query: { type: '2' } }); return; } this.$message('功能稍后接入'); }, downloadJYJReport: function(id, filename) { var that = this; axios({ method: 'GET', url: '/www/public/baogao/jyjbgdownload', params: { id: id }, responseType: 'blob' }).then(function(res) { if (res.status == 200) { var blob = new Blob([res.data]); var link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = filename; document.body.appendChild(link); link.click(); document.body.removeChild(link); that.$message.success('下载成功'); } else { that.$message.error('下载失败'); } }).catch(function() { that.$message.error('下载失败'); }); }, handleYunnanDownload: function() { var that = this; that.yunnanFiles = []; that.yunnanDialogVisible = true; if (String(this.sfqy) === '1' && this.bgPath) { $.get('/www/public/baogao/findbgfile', { path: this.bgPath }, function(res) { if (res.success == 1 || res.error == 0) { if (res.data && Array.isArray(res.data)) { that.yunnanFiles = res.data.map(function(item, index) { return { id: item.id || '', filename: item.filename || item.fileName || ('文件' + (index + 1)), filepath: item.filepath || item.filePath || '', ddmpath: item.ddmpath || '', bgpath: item.bgpath || '', isBgFile: true }; }); } else if (res.data) { that.yunnanFiles = [{ id: res.data.id || '', filename: res.data.filename || res.data.fileName || '文件', filepath: res.data.filepath || res.data.filePath || '', ddmpath: res.data.ddmpath || '', bgpath: res.data.bgpath || '', isBgFile: true }]; } } else { that.$message.error(res.message || '请求失败'); } }).fail(function() { that.$message.error('请求失败'); }); return; } if (this.isYunnanUser || this.isXionganUser) { var isXA = this.isXionganUser; var t1 = isXA ? 3 : 1; var t2 = isXA ? 4 : 2; $.get('/www/public/baogao/findPDFFile', { type: t1 }, function(res) { if (res.success == 1 || res.error == 0 && res.data) { var fn = res.data.fileName || res.data.filename; var preview1 = isXA ? 'https://xinlijc.bnu.edu.cn/content/yn/雄安新区教师心理培训学习材料0114.pdf' : 'https://xinlijc.bnu.edu.cn/content/yn/1.pdf'; that.yunnanFiles.push({ filename: fn, path: preview1, type: t1, isBgFile: false }); } }); $.get('/www/public/baogao/findPDFFile', { type: t2 }, function(res) { if (res.success == 1 || res.error == 0 && res.data) { var fn = res.data.fileName || res.data.filename; var preview2 = isXA ? 'https://xinlijc.bnu.edu.cn/content/yn/预警学生名单保密协议1.pdf' : 'https://xinlijc.bnu.edu.cn/content/yn/2.pdf'; that.yunnanFiles.push({ filename: fn, path: preview2, type: t2, isBgFile: false }); } }); } }, downloadYunnanFile: function(item) { var that = this; if (item && item.isBgFile && item.id) { axios({ method: 'get', url: '/www/public/baogao/downloadbgfile', params: { id: item.id }, responseType: 'blob' }).then(function(res) { if (res.status == 200) { var blob = new Blob([res.data]); var link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.setAttribute('download', item.filename || '文件'); document.body.appendChild(link); link.click(); document.body.removeChild(link); that.$message.success('下载成功'); } else { that.$message.error('下载失败'); } }).catch(function() { that.$message.error('下载失败'); }); return; } if (item && item.type !== undefined) { var t = Number(item.type); axios({ method: 'get', url: '/www/public/baogao/downloadPDFFile1', params: { type: String(t) }, responseType: 'blob' }).then(function(res) { if (res.status == 200) { var blob = new Blob([res.data]); var link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.setAttribute('download', (item && item.filename) || '文件'); document.body.appendChild(link); link.click(); document.body.removeChild(link); that.$message.success('下载成功'); } else { that.$message.error('下载失败'); } }).catch(function() { that.$message.error('下载失败'); }); } }, previewYunnanFile: function(item) { if (!item) { this.$message.error('预览地址缺失'); return; } if (item.isBgFile && item.id) { window.open('https://xinlijc.bnu.edu.cn/core/UForm/fileviewer/r_bg_file?ff=id&fv=' + item.id, '_blank'); return; } if (item.path) { window.open(item.path, '_blank'); } else { this.$message.error('预览地址缺失'); } }, getViewReportCode: function() { var vm = this; var phone = (vm.viewReportForm.phone || '').trim(); if (!/^1\d{10}$/.test(phone)) { vm.$message.warning('请输入正确的手机号'); return; } vm.viewReportCodeCountdown = 60; var t = setInterval(function() { vm.viewReportCodeCountdown--; if (vm.viewReportCodeCountdown <= 0) clearInterval(t); }, 1000); }, confirmViewReport: function() { var vm = this; var name = (vm.viewReportForm.name || '').trim(); var phone = (vm.viewReportForm.phone || '').trim(); var code = (vm.viewReportForm.verifyCode || '').trim(); if (!name) { vm.$message.warning('请输入姓名'); return; } if (!/^1\d{10}$/.test(phone)) { vm.$message.warning('请输入正确的手机号'); return; } if (!code) { vm.$message.warning('请输入验证码'); return; } vm.viewReportDialogVisible = false; vm.viewReportForm = { name: '', phone: '', verifyCode: '' }; vm.$router.push({ path: '/viewReport', query: { name: name, phone: phone } }); }, getZhzt: function() { var that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; const data = { userid: user.ID, } const ssdRoles = [220, 310, 410, 450]; if (ssdRoles.includes(Number(user.Roles))) { data.xmid = '2c13a854-8c9d-438a-bc79-084b5517bc11'; } $.get('/www/public/baogao/findzhzt', data, function(res) { if (res.success == 1 || res.error == 0) { if (res.data) { that.sfzg = res.data.sfzg; that.sfkqbg = res.data.sfkqbg; that.sfqy = res.data.sfqy || ''; var p = res.path || res.data.path; that.bgPath = p || ''; that.isYunnanUser = !!(p && p.indexOf('/app_data/vp/uform/bg/yunnan2025/') !== -1); that.isXionganUser = !!(p && p.indexOf('/app_data/vp/uform/bg/xionganbaogao/') !== -1); } } }); } }, created: function() { var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; this.user = user; var roles = (user.Roles || []).map(function(r) { return String(r); }); var isReportRole = [651, 652, 653, 654, 220, 310, 410, 450].some(function(r) { return roles.includes(String(r)); }); if (isReportRole) { this.getZhzt(); } } }); }); })(template, resolve, reject); }); RegVueCom("xljk-evaluationStatistics-view", function(resolve, reject){ var template = ""; return (function(template, resolve, reject) { seajs.use([], function () { return resolve({ template: template, data: function () { return { id: Math.uuid(), // 进度用接口返回字段:pucesecond/cnttotal/pucefinish/sclfinish/sclsecond pucesecond: 0, cnttotal: 0, pucefinish: 0, sclfinish: 0, sclsecond: 0, activeTab: 'pc_total', searchName: '', searchXh: '', tableList: [], loading: false, pageNo: 1, pageSize: 10, total: 0 }; }, computed: { cpPercent: function () { if (this.cnttotal <= 0) return 0; return Math.min(100, Number(((this.pucefinish / this.cnttotal) * 100).toFixed(1))); }, sclPercent: function () { if (this.cnttotal <= 0) return 0; return Math.min(100, Number(((this.sclfinish / this.cnttotal) * 100).toFixed(1))); } }, methods: { switchTab: function (tab) { if (this.activeTab === tab) return; this.activeTab = tab; this.pageNo = 1; this.loadList(); }, loadList: function () { var vm = this; var schoolId = vm.$route.query.id || ''; var tab = vm.activeTab; var isfirst = (tab === 'pc_total' || tab === 'scl90_total') ? 1 : 2; var usePc = (tab === 'pc_total' || tab === 'pc_retest'); var xm = (vm.searchName || '').trim(); var xh = (vm.searchXh || '').trim(); vm.loading = true; $.get('/www/public/cpgl/pccpjlck', { schoolId: schoolId, xm: xm, xh: xh, pagesize: vm.pageSize, pageno: vm.pageNo, isfirst: isfirst, listType: usePc ? 'pc' : 'scl90' }, function (res) { vm.loading = false; if (res.code === 200) { var pcData = (res.data && res.data.pc_data) ? res.data.pc_data : []; var scl90Data = (res.data && res.data.scl90_data) ? res.data.scl90_data : []; var list = usePc ? vm.formatPcList(pcData) : vm.formatScl90List(scl90Data); vm.tableList = list; vm.total = usePc ? (res.data.pc_total != null ? res.data.pc_total : 0) : (res.data.scl90_total != null ? res.data.scl90_total : 0); } else { vm.tableList = []; vm.total = 0; if (res.message) vm.$message.error(res.message); } }).fail(function () { vm.loading = false; vm.tableList = []; vm.total = 0; vm.$message.error('请求失败'); }); }, formatPcList: function (arr) { arr = Array.isArray(arr) ? arr : []; return arr.map(function (item) { return { zy: item.zymc != null ? item.zymc : (item.zy != null ? item.zy : ''), rxnf: item.nj != null ? item.nj : '', bj: item.bjmc != null ? item.bjmc : (item.bj != null ? item.bj : ''), xm: item.xm != null ? item.xm : '', xh: item.xh != null ? String(item.xh) : '', endTime: item.starttime != null ? item.starttime : (item.endtime != null ? item.endtime : '') }; }); }, formatScl90List: function (arr) { arr = Array.isArray(arr) ? arr : []; return arr.map(function (item) { return { zy: item.zy != null ? item.zy : (item.zymc != null ? item.zymc : ''), rxnf: item.nj != null ? item.nj : '', bj: item.bj != null ? item.bj : (item.bjmc != null ? item.bjmc : ''), xm: item.xm != null ? item.xm : '', xh: item.xh != null ? String(item.xh) : '', endTime: item.starttime != null ? item.starttime : (item.endtime != null ? item.endtime : ''), xy:item.xy != null ? item.xy : item.xy, }; }); }, handleSizeChange: function (val) { this.pageSize = val; this.pageNo = 1; this.loadList(); }, handleCurrentChange: function (val) { this.pageNo = val; this.loadList(); }, loadProgressSummary: function () { var vm = this; var schoolId = vm.$route.query.id; if (!schoolId) return; $.get('/www/public/cpgl/ssdcpjd', { schoolId: schoolId }, function (res) { if (res.code !== 200 || !res.data) return; var d = res.data; vm.pucesecond = d.pucesecond != null ? Number(d.pucesecond) : 0; vm.cnttotal = d.cnttotal != null ? Number(d.cnttotal) : 0; vm.pucefinish = d.pucefinish != null ? Number(d.pucefinish) : 0; vm.sclfinish = d.sclfinish != null ? Number(d.sclfinish) : 0; vm.sclsecond = d.sclsecond != null ? Number(d.sclsecond) : 0; }); }, onSearch: function () { this.pageNo = 1; this.loadList(); } }, created: function () { }, mounted: function () { this.loadProgressSummary(); this.loadList(); } }); }); })(template, resolve, reject); }); RegVueCom("xljk-classInfoUploadNewSsd", function(resolve, reject){ var template = "
\n
\n
\n
\n \n 添加单个学生\n
\n
\n \n 导出学生信息\n 批量添加学生信息\n \n \n 查询\n
\n
\n
\n \n
\n \n
\n
\n \n \n {{ user.Nickname || '学校名称' }}\n \n
\n \n \n \n \n {{ node.label }}\n \n \n \n \n \n \n \n
\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n
\n \n 下 一 步\n 撤回修改\n 提 交\n \n
\n \n \n \n
\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n 取 消\n 确 定\n
\n
\n \n \n \n \n \n \n 参加\n 不参加\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n 取 消\n 确 定\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n 取 消\n 确 定\n
\n
\n \n \n \n
\n
\n 学生姓名:\n {{ currentStudent.xm || '-' }}\n
\n
\n 班级:\n {{ currentStudent.bj || '-' }}\n
\n
\n 未参加原因:\n {{ currentStudent.reason || '暂无原因' }}\n
\n
\n
\n 关 闭\n
\n
\n \n \n \n
\n
\n

模板下载

\n

下载学生信息导入模板,按照模板格式填写学生信息

\n 下载学生信息导入模版\n
\n \n
\n

批量导入

\n

选择填写好的学生信息表文件进行批量导入

\n \n 批量导入且覆盖已有信息\n

\n 提示:首次导入时,将上传所有学生信息。再次导入时,平台中原有学生信息将被【覆盖】,整体更新为最新导入的信息。\n

\n
\n \n
\n
\n 关 闭\n
\n
\n \n \n
\n \n
\n

提示:若要将学生添加到现有班级,其“年级班级学院”信息必须与目标班级的名称完全一致,表格内只填写新增学生,系统中已有学生请勿添加在表格中

\n 学校现有班级年级学院信息查看\n 追加学生信息导入\n
\n \n \n
\n
\n 关 闭\n
\n
\n \n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n 查询\n 导出\n \n \n
\n \n \n
\n \n \n \n \n \n \n
\n \n \n
\n \n \n
\n
\n \n
\n
"; return (function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { id: Math.uuid(), user: '', homezt: '1', // 页面状态标识,设置为1显示完成按钮 treeData: [], sfnmlc:'', tableData: [], tableLoading: false, loading:false, loading1:false, currentSelection: '请选择班级', selectedNode: null, xxjd: '', // 学段:1-小学,2-初中,3-高中,4-中职 selectedStudents: [], // 选中的学生 participationDialog: false, // 修改参与情况弹窗 participationForm: { cyqk: '', // 参与情况 1参加 0不参加(默认不选) reason: '', // 不参与原因 customReason: '' // 自定义原因 }, reasonOptions: [ { value: '家长不同意', label: '家长不同意' }, { value: '学生不存在', label: '学生不存在' }, { value: '休学', label: '休学' }, { value: '事假', label: '事假' }, { value: '病假', label: '病假' }, { value: '其他', label: '其他' } ], treeProps: { children: 'children', label: 'label' }, expandedKeys: [], // 默认展开的节点 currentNodeKey: null, // 当前选中的节点 // 添加学生弹窗 addStudentDialogVisible: false, // 添加学生表单数据 studentForm: { nj: '', bj: '', bjid: '', xm: '', xh: '', xb: '', zy: '', //zybm: '', xxid: '' }, // 表单验证规则 studentRules: { nj: [{ required: true, message: '请选择年级', trigger: 'change' }], bj: [{ required: true, message: '请选择班级', trigger: 'change' }], xm: [{ required: true, message: '请输入学生姓名', trigger: 'blur' }], xh: [{ required: true, message: '请输入唯一标识号', trigger: 'blur' }], xb: [{ required: true, message: '请选择性别', trigger: 'change' }] }, // 下拉选项数据 njOptions: [], bjOptions: [], zyOptions: [], isEdit: false, // 是否为编辑模式 // 添加班级弹窗 addClassDialogVisible: false, // 添加班级表单数据 classForm: { nj: '', bj: '', zy: '', //zybm: '', xd: '', bjlx: '', xxid: '' }, // 班级表单验证规则 classRules: { nj: [{ required: true, message: '请选择年级', trigger: 'change' }], bj: [{ required: true, message: '请输入班级名称', trigger: 'blur' }], zy: [{ required: true, message: '请选择学院', trigger: 'change' }], // zybm: [{ required: true, message: '请输入专业编码', trigger: 'blur' }], bjlx: [{ required: true, message: '请选择班级类型', trigger: 'change' }] }, // 原因弹框相关 reasonDialogVisible: false, currentStudent: {}, // 查询相关 searchForm: { xm: '', // 姓名 xh: '' // 学号 }, // 学生信息表管理弹框 studentInfoDialogVisible: false, studentInfoDialogVisible1: false, studentInfoDialogVisible2: false, // 学校现有班级年级信息相关数据 classGradeInfoData: [], // 表格数据 classGradeInfoLoading: false, // 加载状态 classGradeInfoTotal: 0, // 总条数 classGradeInfoPageNum: 1, // 当前页码 classGradeInfoPageSize: 10, // 每页条数 // 查询表单 classGradeInfoSearchForm: { nj: '', // 年级 bj: '', // 班级 zy: '' // 专业(仅中职) } } }, computed: { // 判断是否为基础教育(小初高) isBasicEducation() { return ['1', '2', '3'].includes(this.xxjd); } }, methods: { withdrawSubmit(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.$confirm('确定要撤回上报吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { const params = { xxid: user.ID, shzt: '1' } $.post("/www/public/shangbao/chshangbao", params, function(res){ if(res.success==1 || res.error==0){ that.$message.success('撤回成功') that.initFormOptions(); that.$nextTick(() => { that.loadTreeData(); }); that.$emit('refreshStatus') // 通知父组件刷新状态 // 添加整页刷新功能 setTimeout(function() { window.location.reload() }, 1000) // 延迟1秒后刷新,确保消息提示能够显示 }else{ that.$message.error(res.message || '撤回失败') } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) }).catch(() => { that.$message.info('已取消撤回') }) }, // 获取用户信息和学段 initUserInfo() { const that = this that.user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; that.xxjd = localStorage.getItem('xxjd') || ''; }, // 获取树形数据 loadTreeData() { const that = this; $.get('/www/public/daoru/findxxbjlist', {}, function(res) { if (res.success == 1 || res.error == 0) { that.treeData = res.data || []; // 规范化:为所有节点补充顶层 id,确保与 node-key 匹配 that.normalizeTreeData(that.treeData); // 默认加载第一个班级的数据(等待树渲染完成) if (that.treeData.length > 0) { that.$nextTick(() => { that.loadFirstClassData(); }); } } else { that.$message.error(res.message || '获取数据失败'); } }).fail((xhr, status, error) => { that.$message.error('请求失败'); }); }, // 加载第一个班级数据(默认展开第一个年级并选中其下第一个班级) loadFirstClassData() { const isBasic = this.isBasicEducation; const getKey = (n) => (n && (n.id || (n.data && n.data.id))) || null; if (!this.treeData || this.treeData.length === 0) return; const firstGrade = this.treeData[0]; let firstMajor = null; let firstClass = null; if (isBasic) { // 基础教育:年级 -> 班级 if (firstGrade && Array.isArray(firstGrade.children) && firstGrade.children.length > 0) { firstClass = firstGrade.children.find(n => this.isClassNode(n)) || firstGrade.children[0]; } } else { // 中职:年级 -> 专业 -> 班级 if (firstGrade && Array.isArray(firstGrade.children) && firstGrade.children.length > 0) { firstMajor = firstGrade.children[0]; if (!this.isMajorNode(firstMajor)) { firstMajor = firstGrade.children.find(n => this.isMajorNode(n)) || firstMajor; } if (firstMajor && Array.isArray(firstMajor.children) && firstMajor.children.length > 0) { firstClass = firstMajor.children.find(n => this.isClassNode(n)) || firstMajor.children[0]; } } } // 回退策略:全树范围查找第一个班级 if (!firstClass) { const findFirstClass = (nodes) => { for (let node of nodes || []) { if (this.isClassNode(node)) return node; if (node.children && node.children.length > 0) { const found = findFirstClass(node.children); if (found) return found; } } return null; }; firstClass = findFirstClass(this.treeData); } if (!firstClass) return; // 设置选中的班级与显示文本 this.selectedNode = { data: firstClass, node: null }; if (isBasic) { this.currentSelection = `${firstClass.data.nj} - ${firstClass.data.bjmc}`; } else { this.currentSelection = `${firstClass.data.nj} - ${firstClass.data.zymc} - ${firstClass.data.bjmc}`; } // 需要展开的父节点keys const expandedKeys = []; const gradeKey = getKey(firstGrade); if (gradeKey) expandedKeys.push(gradeKey); if (!isBasic) { const majorKey = getKey(firstMajor); if (majorKey) expandedKeys.push(majorKey); } const classKey = getKey(firstClass); // 下一帧:展开树并高亮选中班级 this.$nextTick(() => { const runExpand = () => { const tree = this.$refs.tree; if (!tree) return; // 先高亮选中班级 if (classKey) { try { tree.setCurrentKey(classKey); } catch (e) {} } // 显式展开:根据选中班级节点,向上展开父链(年级/专业) let classNodeObj = classKey ? tree.getNode(classKey) : null; let p = classNodeObj ? classNodeObj.parent : null; while (p && p.level >= 1) { try { typeof p.expand === 'function' && p.expand(true); } catch (e) {} p.expanded = true; p = p.parent; } // 兜底:如果传入了需要展开的 keys,逐个尝试展开 (expandedKeys || []).forEach(k => { const n = tree.getNode(k); if (n) { try { typeof n.expand === 'function' && n.expand(true); } catch (e) {} n.expanded = true; } }); // 如果本帧还未拿到节点,再延迟一次重试 if (!classNodeObj) { setTimeout(() => { const t = this.$refs.tree; if (!t) return; classNodeObj = classKey ? t.getNode(classKey) : null; let pp = classNodeObj ? classNodeObj.parent : null; while (pp && pp.level >= 1) { try { typeof pp.expand === 'function' && pp.expand(true); } catch (e) {} pp.expanded = true; pp = pp.parent; } (expandedKeys || []).forEach(k => { const nn = t.getNode(k); if (nn) { try { typeof nn.expand === 'function' && nn.expand(true); } catch (e) {} nn.expanded = true; } }); }, 0); } }; // 再加一次 nextTick,确保 el-tree 完整渲染后再执行展开 this.$nextTick(runExpand); }); // 加载表格数据 this.loadTableData(); }, // 判断节点类型 isGradeNode(data) { // 小初高:年级节点没有data属性或data中没有bjmc if (this.isBasicEducation) { return !data.data || !data.data.bjmc; } // 中职:年级节点(第一层) return data.children && data.children.length > 0 && data.children[0].children; }, isClassNode(data) { // 小初高:班级节点有data且有bjmc if (this.isBasicEducation) { return data.data && data.data.bjmc; } // 中职:班级节点(第三层) return data.data && data.data.bjmc && data.data.zymc; }, isMajorNode(data) { // 只有中职有专业节点(第二层) return !this.isBasicEducation && data.children && data.children.length > 0 && !data.children[0].children; }, // 规范化树数据,确保每个节点都有唯一 id 供 node-key 使用 normalizeTreeData(nodes) { const ensureId = (node) => { if (!node) return; // el-tree 使用 node-key="id",确保此字段存在 if (!node.id) { node.id = (node.data && node.data.id) || `${Date.now()}_${Math.random().toString(36).slice(2,8)}`; } if (Array.isArray(node.children)) { node.children.forEach(ensureId); } }; (nodes || []).forEach(ensureId); }, // 处理树节点点击 handleNodeClick(data, node) { this.selectedNode = { data, node }; // 只有班级节点才加载学生数据 if (this.isClassNode(data)) { if (this.isBasicEducation) { this.currentSelection = `${data.data.nj} - ${data.data.bjmc}`; } else { this.currentSelection = `${data.data.nj} - ${data.data.zymc} - ${data.data.bjmc}`; } this.loadTableData(); } }, // 加载表格数据 loadTableData() { if (!this.selectedNode || !this.selectedNode.data) { return; } const that = this; this.tableLoading = true; // 调试信息:检查选中节点和班级ID console.log('loadTableData - selectedNode:', this.selectedNode); console.log('loadTableData - selectedNode.data:', this.selectedNode.data); // 从树状结构中正确获取班级ID let bjid = ''; if (this.selectedNode && this.selectedNode.data) { // 树状结构中班级ID在data.data.id中 bjid = this.selectedNode.data.data ? this.selectedNode.data.data.id : this.selectedNode.data.id; } console.log('loadTableData - bjid:', bjid); const params = { xxid: this.user.ID, bjid: bjid, xm: this.searchForm.xm || '', // 姓名查询参数 xh: this.searchForm.xh || '' // 学号查询参数 }; console.log('loadTableData - 请求参数:', params); $.get('/www/public/daoru/findbjxslist', params, function(res) { if (res.success == 1 || res.error == 0) { that.tableData = res.data || []; } else { that.$message.error(res.message || '获取学生列表失败'); that.tableData = []; } that.tableLoading = false; }).fail(() => { that.$message.error('请求失败'); that.tableData = []; that.tableLoading = false; }); }, // 添加年级 addGrade() { this.$message.info('添加年级功能待实现'); }, // 添加班级 addClass(data) { this.$message.info('添加班级功能待实现'); }, // 删除年级 deleteGrade(data) { this.$message.info('删除年级功能待实现'); }, // 删除班级 deleteClass(data) { const that = this; // 先检查班级下是否有学生 const checkParams = { xxid: this.user.ID, bjid: data.id }; $.get('/www/public/daoru/findbjxslist', checkParams, function(res) { if (res.success == 1 || res.error == 0) { const studentList = res.data || []; if (studentList.length > 0) { that.$message.warning('该班级下还有学生,不能删除!'); return; } // 班级下没有学生,可以删除 that.$confirm('确定要删除该班级吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { const params = { bjid: data.id }; $.post('/www/public/daoru/deletebj', params, function(res) { if (res.success == 1 || res.error == 0) { that.$message.success('删除成功'); that.loadTreeData(); // 重新加载树形数据 that.tableData = []; // 清空表格数据 } else { that.$message.error(res.message); } }).fail(() => { that.$message.error('请求失败'); }); }).catch(() => { that.$message.info('已取消删除'); }); } else { that.$message.error('检查班级学生信息失败'); } }).fail(() => { that.$message.error('检查班级学生信息请求失败'); }); }, // 删除专业(中职) deleteMajor(data) { this.$message.info('删除专业功能待实现'); }, // 打开添加班级弹窗 addClassDialog() { this.resetClassForm(); this.loadNjOptions(); // 移除直接加载专业列表的代码,改为在选择年级后通过onClassNjChange加载 this.zyOptions = []; this.addClassDialogVisible = true; }, // 重置班级表单 resetClassForm() { this.classForm = { nj: '', bj: '', zy: '', // zybm: '', xd: this.xxjd, bjlx: '', xxid: this.user.ID }; this.$nextTick(() => { if (this.$refs.classForm) { this.$refs.classForm.clearValidate(); } }); }, // 提交添加班级 submitAddClass() { const that = this; this.$refs.classForm.validate((valid) => { if (valid) { const params = { nj: that.classForm.nj, bj: that.classForm.bj, zy: that.classForm.zy || '', // zybm: that.classForm.zybm || '', xd: that.classForm.xd, bjlx: that.classForm.bjlx || '', xxid: that.classForm.xxid }; $.post('/www/public/daoru/addbj', params, function(res) { if (res.success == 1 || res.error == 0) { that.$message.success('添加班级成功'); that.addClassDialogVisible = false; that.loadTreeData(); // 重新加载树形数据 } else { that.$message.error(res.message || '添加班级失败'); } }).fail(() => { that.$message.error('请求失败'); }); } else { that.$message.error('请检查表单信息'); return false; } }); }, // 添加学生 addStudent() { if (!this.selectedNode || !this.selectedNode.data) { this.$message.warning('请先选择班级'); return; } this.isEdit = false; // 先加载年级选项 this.loadNjOptions(); // 直接设置表单数据,不调用resetStudentForm this.studentForm = { nj: this.selectedNode.data.data.nj, bj: this.selectedNode.data.data.bjmc, bjid: this.selectedNode.data.id, xm: '', xh: '', xb: '', zy: (this.xxjd === '5' || this.xxjd === '6') && this.selectedNode.data.data.zymc ? this.selectedNode.data.data.zymc : '', // zybm: (this.xxjd === '5' || this.xxjd === '6') && this.selectedNode.data.data.zybm ? this.selectedNode.data.data.zybm : '', xxid: '' }; console.log('设置班级信息后的bjid:', this.studentForm.bjid); // 清除表单验证状态 this.$nextTick(() => { if (this.$refs.studentForm) { this.$refs.studentForm.clearValidate(); } }); // 延迟加载班级选项,确保年级已设置 this.$nextTick(() => { if (this.xxjd === '5' || this.xxjd === '6') { // 5、6 学段:先加载专业选项,再加载班级选项 this.loadZyOptions(); this.$nextTick(() => { this.loadBjOptions(); }); } else { // 基础教育:直接加载班级选项 this.loadBjOptions(); } }); this.addStudentDialogVisible = true; }, // 重置学生表单 resetStudentForm() { this.studentForm = { nj: '', bj: '', bjid: '', xm: '', xh: '', xb: '', zy: '', //zybm: '', xxid: '' }; this.$nextTick(() => { if (this.$refs.studentForm) { this.$refs.studentForm.clearValidate(); } }); }, // 提交添加/编辑学生 submitAddStudent() { const that = this; this.$refs.studentForm.validate((valid) => { if (valid) { // 设置学校ID that.studentForm.xxid = this.user.ID || ''; // 确保bjid有值 - 多重保障 if (!that.studentForm.bjid) { // 第一优先级:从班级选项中获取 if (that.studentForm.bj && that.bjOptions.length > 0) { const selectedBj = that.bjOptions.find(option => option.value === that.studentForm.bj); if (selectedBj && selectedBj.id) { that.studentForm.bjid = selectedBj.id; console.log('从班级选项中设置bjid:', that.studentForm.bjid); } } // 第二优先级:从选中节点获取 if (!that.studentForm.bjid && that.selectedNode && that.selectedNode.data) { that.studentForm.bjid = that.selectedNode.data.id; console.log('从选中节点设置bjid:', that.studentForm.bjid); } } // 最终检查bjid是否有值 if (!that.studentForm.bjid) { that.$message.error('无法获取班级ID,请重新选择班级'); return; } // 如果是中职,设置专业编码(临时处理) // if (that.xxjd === '4' && that.studentForm.zy) { // that.studentForm.zybm = that.studentForm.zy + '001'; // } const params = { nj: that.studentForm.nj, bj: that.studentForm.bj, bjid: that.studentForm.bjid, xm: that.studentForm.xm, xh: that.studentForm.xh, xb: that.studentForm.xb, zy: that.studentForm.zy, // zybm: that.studentForm.zybm, xxid: that.studentForm.xxid }; // 调试信息:打印提交参数 console.log('提交学生参数:', params); // 如果是编辑模式,添加xsid参数 if (this.isEdit) { params.xsid = this.studentForm.xsid; } const url = this.isEdit ? '/www/public/daoru/editxs' : '/www/public/daoru/addxs'; const successMsg = this.isEdit ? '修改学生成功' : '添加学生成功'; const errorMsg = this.isEdit ? '修改学生失败' : '添加学生失败'; if(this.user.Roles.includes('450')){ params.xmid = '2c13a854-8c9d-438a-bc79-084b5517bc11'; } $.post(url, params, function(res) { if (res.success == 1 || res.error == 0) { that.$message.success(successMsg); that.addStudentDialogVisible = false; // 刷新表格数据 that.loadTableData(); } else { that.$message.error(res.message || errorMsg); } }).fail((xhr, status, error) => { that.$message.error('请求错误'); }); } else { that.$message.error('请检查表单信息'); return false; } }); }, // 初始化表单选项 initFormOptions() { this.loadNjOptions(); // 中职需要专业验证 if (this.xxjd === '5' || this.xxjd === '6') { this.studentRules.zy = [{ required: true, message: '请选择学院', trigger: 'change' }]; } }, // 加载年级选项 loadNjOptions() { const that = this; console.log(that.user) $.get('/www/public/daoru/findnjlsit', { xxid: that.user.ID }, function(res) { if (res.success == 1 || res.error == 0) { that.njOptions = res.data.map(item => item.nj || item.njmc || item.name); } else { that.$message.error(res.message || '获取年级列表失败'); } }).fail((xhr, status, error) => { that.$message.error('获取年级列表请求失败'); }); }, // 年级变化时加载专业和班级(学生添加/编辑) onNjChange() { this.studentForm.zy = ''; this.studentForm.bj = ''; this.studentForm.bjid = ''; // 清空班级ID this.zyOptions = []; this.bjOptions = []; if (this.xxjd === '5' || this.xxjd === '6') { this.loadZyOptions(); } else { this.loadBjOptions(); } }, // 班级添加弹窗中年级变化时加载专业 onClassNjChange() { this.classForm.zy = ''; this.zyOptions = []; if (this.xxjd === '5' || this.xxjd === '6') { this.loadClassZyOptions(); } }, // 编辑时加载专业选项(中职) loadZyOptionsForEdit(row) { const that = this; const xxid = this.user.ID || ''; $.get('/www/public/daoru/findzylist', { xxid: xxid, nj: this.studentForm.nj }, function(res) { if (res.success == 1 || res.error == 0) { that.zyOptions = res.data.map(item => ({ value: item.zy || item.zymc || item.name, label: item.zy || item.zymc || item.name })); // 专业选项加载完成后,加载班级选项 that.loadBjOptionsForEdit(row); } else { that.$message.error(res.message || '获取学院列表失败'); } }).fail((xhr, status, error) => { that.$message.error('获取学院列表请求失败'); }); }, // 编辑时加载班级选项 loadBjOptionsForEdit(row) { const that = this; const xxid = this.user.ID || ''; const params = { xxid: xxid, nj: this.studentForm.nj }; // 5、6 学段需要传专业参数 if ((this.xxjd === '5' || this.xxjd === '6') && this.studentForm.zy) { params.zy = this.studentForm.zy; } $.get('/www/public/daoru/findbjlist', params, function(res) { if (res.success == 1 || res.error == 0) { that.bjOptions = res.data.map(item => ({ value: item.bj || item.bjmc || item.name, label: item.bj || item.bjmc || item.name, id: item.id })); // 班级选项加载完成后,设置班级ID if (row.bj) { const selectedBj = that.bjOptions.find(option => option.value === row.bj); if (selectedBj && selectedBj.id) { that.studentForm.bjid = selectedBj.id; } } } else { that.$message.error(res.message || '获取班级列表失败'); } }).fail((xhr, status, error) => { that.$message.error('获取班级列表请求失败'); }); }, // 加载专业选项(中职 - 学生添加/编辑) loadZyOptions() { const xxid = this.user.ID || ''; if (!xxid || !this.studentForm.nj) { return; } const that = this; $.get('/www/public/daoru/findzylist', { xxid: xxid, nj: this.studentForm.nj }, function(res) { if (res.success == 1 || res.error == 0) { that.zyOptions = res.data.map(item => ({ value: item.zy || item.zymc || item.name, label: item.zy || item.zymc || item.name })); } else { that.$message.error(res.message || '获取学院列表失败'); } }).fail((xhr, status, error) => { that.$message.error('获取学院列表请求失败'); }); }, // 加载专业选项(中职 - 班级添加) loadClassZyOptions() { const xxid = this.user.ID || ''; if (!xxid || !this.classForm.nj) { return; } const that = this; $.get('/www/public/daoru/findzylist', { xxid: xxid, nj: this.classForm.nj }, function(res) { if (res.success == 1 || res.error == 0) { that.zyOptions = res.data.map(item => ({ value: item.zy || item.zymc || item.name, label: item.zy || item.zymc || item.name })); } else { that.$message.error(res.message || '获取学院列表失败'); } }).fail((xhr, status, error) => { that.$message.error('获取学院列表请求失败'); }); }, // 专业变化时加载班级 onZyChange() { this.studentForm.bj = ''; this.studentForm.bjid = ''; // 清空班级ID this.bjOptions = []; this.loadBjOptions(); }, // 班级选择变化时设置班级ID onBjChange() { if (this.studentForm.bj) { // 从班级选项中找到对应的班级ID const selectedBj = this.bjOptions.find(option => option.value === this.studentForm.bj); if (selectedBj && selectedBj.id) { this.studentForm.bjid = selectedBj.id; console.log('班级选择变化,设置bjid:', this.studentForm.bjid); } } else { this.studentForm.bjid = ''; } }, // 加载班级选项 loadBjOptions() { const xxid = this.user.ID || ''; if (!xxid || !this.studentForm.nj) { return; } const params = { xxid: xxid, nj: this.studentForm.nj }; // 5、6 学段需要传专业参数 if ((this.xxjd === '5' || this.xxjd === '6') && this.studentForm.zy) { params.zy = this.studentForm.zy; } const that = this; $.get('/www/public/daoru/findbjlist', params, function(res) { if (res.success == 1 || res.error == 0) { that.bjOptions = res.data.map(item => ({ value: item.bjmc || item.bj || item.name, label: item.bjmc || item.bj || item.name, id: item.id // 保存班级ID })); // 加载完班级选项后,如果当前有选中的班级,重新设置bjid if (that.studentForm.bj) { const selectedBj = that.bjOptions.find(option => option.value === that.studentForm.bj); if (selectedBj && selectedBj.id) { that.studentForm.bjid = selectedBj.id; console.log('加载班级选项后重新设置bjid:', that.studentForm.bjid); } } } else { that.$message.error(res.message || '获取班级列表失败'); } }).fail((xhr, status, error) => { that.$message.error('获取班级列表请求失败'); }); }, // 修改参与情况 modifyParticipation() { if (this.selectedStudents.length === 0) { this.$message.warning('请先选择学生'); return; } // 打开前重置弹窗表单,默认不选中任何项且不显示原因 this.participationForm.cyqk = ''; this.participationForm.reason = ''; this.participationForm.customReason = ''; this.participationDialog = true; }, // 处理表格选择变化 handleSelectionChange(selection) { this.selectedStudents = selection; }, // 处理参与情况开关变化 handleParticipationChange(row) { // 恢复开关状态,等待用户在弹窗中确认 row.sfcycp = row.sfcycp === '1' ? '0' : '1'; // 设置当前操作的学生 this.selectedStudents = [row]; // 根据开关状态设置默认参与情况(使用字符串,和单选保持一致) this.participationForm.cyqk = row.sfcycp; this.participationForm.reason = ''; this.participationForm.customReason = ''; // 显示参与情况修改弹窗 this.participationDialog = true; }, // 编辑学生 editStudent(row) { // 直接填充表单数据进行回显 this.studentForm = { xsid: row.id, // 学生ID字段 nj: row.rxnf || row.nj, // 使用rxnf字段作为年级 bj: row.bj, bjid: row.bjid || row.id, // 班级ID xm: row.xm, xh: row.xh, xb: row.xb, zy: row.zy || '', // 专业名称 // zybm: row.zybm || '', // 专业编码 xxid: this.user.ID || '' // 学校ID }; this.isEdit = true; this.addStudentDialogVisible = true; // 正常加载年级选项 this.loadNjOptions(); // 根据当前年级加载班级选项 if (this.studentForm.nj) { if (this.xxjd === '4') { // 中职:先加载专业选项,再加载班级选项 this.loadZyOptions(); this.$nextTick(() => { this.loadBjOptions(); }); } else { // 基础教育:直接加载班级选项 this.loadBjOptions(); } } }, // 删除学生 deleteStudent(row) { const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; this.$confirm('确定要删除该学生吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { const that = this; const params = { xsid: row.id }; if(user.Roles.includes('450')){ params.xmid = '2c13a854-8c9d-438a-bc79-084b5517bc11'; } $.post('/www/public/daoru/deletexs', params, function(res) { if (res.success == 1 || res.error == 0) { that.$message.success('删除成功'); that.loadTableData(); } else { that.$message.error(res.message); } }).fail(() => { that.$message.error('请求失败'); }); }).catch(() => { this.$message.info('已取消删除'); }); }, // 移除分页相关方法 // 上一步 preStep: function() { this.$emit('preStep'); }, // 下一步 nextStep: function() { if(!this.tableData.length) return this.$message.warning('请先完成数据上报'); this.$confirm('是否确认进入下一步?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { this.$emit('nextStep', 3); }).catch(() => { this.$message.info('已取消删除'); }); }, // 完成 nextStep1: function() { if(!this.tableData.length) return this.$message.warning('请先完成数据上报'); this.$emit('nextStep1', ''); }, // 提交参与情况修改 submitParticipationChange() { const that = this; const studentIds = this.selectedStudents.map(student => student.id); const reason = this.participationForm.cyqk === '0' ? (this.participationForm.reason === '其他' ? this.participationForm.customReason : this.participationForm.reason) : ''; const params = { ids: JSON.stringify(studentIds), cyqk: this.participationForm.cyqk, reason: reason }; $.post('/www/public/daoru/editcyqk', params, function(res) { if (res.success == 1 || res.error == 0) { that.$message.success('批量更新成功'); that.participationDialog = false; that.loadTableData(); that.selectedStudents = []; // 重置表单 that.participationForm = { cyqk: '1', reason: '', customReason: '' }; } else { that.$message.error(res.message || '批量更新失败'); } }).fail(() => { that.$message.error('请求失败'); }); }, // 模板下载 downloadTemplate() { const that = this; const xd = this.xxjd; // 当前学段 if (!xd) { this.$message.error('无法获取学段信息'); return; } // 学段映射:1小学->9, 2初中->10, 3高中->11, 4中职->12 // const typeMapping = {'1': '9', '2': '10', '3': '11', '4': '12'}; const typeMapping = { '1' : '14', '2' : '15', '3' : '16', '4' : '12', } const mappedType = typeMapping[xd]; //if (!mappedType) { // this.$message.error('不支持的学段类型'); // return; //} axios({ method: 'get', url: '/www/public/daoru/excelTempExport', params: { type: 13 }, responseType: 'blob' }).then(function(response) { const typeNames = {'1': '小学', '2': '初中', '3': '高中', '4': '中职'}; const typeName = typeNames[xd] || '学生'; const blob = new Blob([response.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }); const link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = typeName + '学生信息导入模板.xlsx'; link.click(); that.$message.success('模板下载成功'); }).catch(function(error) { that.$message.error('模板下载失败'); }); }, importStudentInfo1() { const that = this; if(that.loading1){ return } const input = document.createElement('input'); input.type = 'file'; input.accept = '.xls,.xlsx'; input.onchange = function(e) { const file = e.target.files[0]; if (!file) return; const isLt100M = file.size / 1024 / 1024 < 100; if (!isLt100M) { that.$message.error('上传文件大小不能超过100MB!'); return; } // 学段映射:1小学->9, 2初中->10, 3高中->11, 4中职->12 const typeMapping = {'1': '1', '2': '2', '3': '3', '4': '4'}; const mappedType = typeMapping[that.xxjd]; //if (!mappedType) { //that.$message.error('不支持的学段类型'); // return; //} const formData = new FormData(); formData.append('file', file); formData.append('type', mappedType); // 映射后的学段类型 formData.append('xxid', that.user.ID); // 学校ID that.loading1 = true $.ajax({ url: '/www/public/daoru/xsxxdr_zj', type: 'POST', data: formData, processData: false, contentType: false, success: function(res) { if(res.error == 0 || res.success == 1) { that.$message.success(res.message || '学生信息导入成功'); that.loading1 = false that.loadTreeData(); // 重新加载树数据 that.loadTableData(); // 重新加载表格数据 } else { that.loading1 = false that.$message.error(res.message || '学生信息导入失败'); } }, error: function() { that.loading1 = false that.$message.error('上传失败'); } }); }; input.click(); }, // 学生信息导入 importStudentInfo() { const that = this; if(that.loading){ return } var tsmessage if(that.sfnmlc==null){ tsmessage='首次导入时,将上传所有学生信息。再次导入时,平台中原有学生信息将被【覆盖】,整体更新为最新导入的信息。' }else{ tsmessage='平台中原有学生信息将被【覆盖】,整体更新为学校最新导入的信息。' } that.$confirm(tsmessage, '提示', { type: 'warning' }).then(() => { const input = document.createElement('input'); input.type = 'file'; input.accept = '.xls,.xlsx'; input.onchange = function(e) { const file = e.target.files[0]; if (!file) return; const isLt100M = file.size / 1024 / 1024 < 100; if (!isLt100M) { that.$message.error('上传文件大小不能超过100MB!'); return; } // 学段映射:1小学->9, 2初中->10, 3高中->11, 4中职->12 const typeMapping = {'1': '1', '2': '2', '3': '3', '4': '4'}; const mappedType = typeMapping[that.xxjd]; // if (!mappedType) { // that.$message.error('不支持的学段类型'); // return; //} const formData = new FormData(); formData.append('file', file); formData.append('type', 6); // 映射后的学段类型 formData.append('xxid', that.user.ID); // 学校ID if(that.user.Roles.includes('450')){ formData.append('xmid', '2c13a854-8c9d-438a-bc79-084b5517bc11'); } $.ajax({ url: '/www/public/daoru/xsxxdr_ssd', type: 'POST', data: formData, processData: false, contentType: false, success: function(res) { if(res.error == 0 ) { that.$message.success(res.message); that.loadTreeData(); // 重新加载树数据 that.loadTableData(); // 重新加载表格数据 } else { that.$message.error(res.message); } }, error: function() { that.$message.error('上传失败'); } }); }; input.click(); }).catch(() => { that.loading = false; // 取消操作时重置状态 }); }, // 显示原因弹框 showReason(row) { this.currentStudent = row; this.reasonDialogVisible = true; }, // 查询学生 searchStudents() { this.loadTableData(); }, // 学生信息导出(页面按钮) exportStudentInfo() { const that = this; const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; // 学段映射:1→9、2→10、3→11、4→12 const xdMapping = { '1': '9', // 小学 '2': '10', // 初中 '3': '11', // 高中 '4': '12' // 中职 }; const mappedXd = xdMapping[that.xxjd]; // if (!mappedXd) { // that.$message.error('当前学段不支持导出'); // return; //} const params = { schoolid: user.ID, xd: localStorage.getItem('xxjd') }; // 构建下载URL const url = '/www/public/daoru/xsxxdc_ssd?' + Object.keys(params).map(key => key + '=' + encodeURIComponent(params[key])).join('&'); // 创建隐藏的下载链接 const link = document.createElement('a'); link.href = url; link.download = '学生信息导出.xls'; document.body.appendChild(link); link.click(); document.body.removeChild(link); that.$message.success('学生信息导出已开始'); }, // 学生信息导出(弹框中) exportStudentInfoFromDialog() { const that = this; const user = this.user; if (!user || !user.ID) { that.$message.error('无法获取学校信息'); return; } // 学段映射 const xdMapping = { '1': '1', // 小学 '2': '2', // 初中 '3': '3', // 高中 '4': '4' // 中职 }; const mappedXd = xdMapping[that.xxjd]; // if (!mappedXd) { // that.$message.error('当前学段不支持导出'); // return; //} axios({ method: 'get', url: '/www/public/daoru/xsxxdc_ssd', params: { schoolid: user.ID, xd: localStorage.getItem('xxjd') }, responseType: 'blob' }).then(function(response) { const typeNames = {'1': '小学', '2': '初中', '3': '高中', '4': '中职'}; const typeName = typeNames[that.xxjd] || '学校'; const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' }); const link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = typeName + '学生信息导出.xls'; link.click(); that.$message.success('学生信息导出成功'); }).catch(function(error) { that.$message.error('学生信息导出失败'); }); }, // 显示学生信息表管理弹框 showStudentInfoDialog() { const that = this; if(this.sfnmlc==null){ that.$confirm(`

(1)下载学生信息导入模板,填写本校所有参测学生信息;

(2)选择“批量导入且覆盖已有信息”功能。

---操作结果:首次导入时,将上传所有学生信息。再次导入时,平台中原有学生信息将被【覆盖】,整体更新为最新导入的信息。

`, '学生信息批量导入说明', { dangerouslyUseHTMLString: true, confirmButtonText: '我知道了', showCancelButton: false, center: true, customClass: 'student-info-scheme-confirm' }).then(() => { that.studentInfoDialogVisible = true; }).catch(() => { }); }else{ that.$confirm(`

(1)下载学生信息导入模板,填写本校所有参测学生信息;

(2)选择“批量导入且覆盖已有信息”功能。

---操作结果:平台中原有学生信息将被【覆盖】,整体更新为最新导入的信息。

`, '学生信息批量导入说明', { dangerouslyUseHTMLString: true, confirmButtonText: '我知道了', showCancelButton: false, center: true, customClass: 'student-info-scheme-confirm' }).then(() => { that.studentInfoDialogVisible = true; }).catch(() => { }); } }, showStudentInfoDialog1() { this.studentInfoDialogVisible1 = true; }, showStudentInfoDialog2() { this.studentInfoDialogVisible2 = true; // 打开弹框时加载数据 this.loadClassGradeInfoData(); }, // 加载学校现有班级年级信息数据 loadClassGradeInfoData() { const that = this; that.classGradeInfoLoading = true; const params = { pageSize: that.classGradeInfoPageSize, pageNum: that.classGradeInfoPageNum, nj: that.classGradeInfoSearchForm.nj, bj: that.classGradeInfoSearchForm.bj }; // 如果是中职学段,添加专业参数 if (that.xxjd === '4') { params.zy = that.classGradeInfoSearchForm.zy; } $.get('/www/public/shangbao/xxnjbjfind', params, function(res) { that.classGradeInfoLoading = false; if (res.success == 1 || res.error == 0) { that.classGradeInfoData = res.data || []; that.classGradeInfoTotal = res.total || 0; } else { that.$message.error(res.message || '获取数据失败'); } }).fail((xhr, status, error) => { that.classGradeInfoLoading = false; that.$message.error('请求失败'); }); }, // 查询班级年级信息 searchClassGradeInfo() { this.classGradeInfoPageNum = 1; this.loadClassGradeInfoData(); }, // 分页大小改变 handleClassGradeInfoSizeChange(val) { this.classGradeInfoPageSize = val; this.loadClassGradeInfoData(); }, // 当前页改变 handleClassGradeInfoCurrentChange(val) { this.classGradeInfoPageNum = val; this.loadClassGradeInfoData(); }, // 导出班级年级列表 exportClassGradeInfo() { const that = this; const params = {}; // 只添加有值的查询参数 if (that.classGradeInfoSearchForm.nj) { params.nj = that.classGradeInfoSearchForm.nj; } if (that.classGradeInfoSearchForm.bj) { params.bj = that.classGradeInfoSearchForm.bj; } // 如果是 5、6 学段,添加专业参数 if ((that.xxjd === '5' || that.xxjd === '6') && that.classGradeInfoSearchForm.zy) { params.zy = that.classGradeInfoSearchForm.zy; } // 使用axios进行导出,参考模板下载的方式 axios({ method: 'get', url: '/www/public/shangbao/xxnjbjfind_export', params: params, responseType: 'blob' }).then(function(response) { const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' }); const link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = '班级年级信息列表.xls'; link.click(); that.$message.success('班级年级信息导出成功'); }).catch(function(error) { that.$message.error('班级年级信息导出失败'); }); } }, created: function() { this.initUserInfo(); this.initFormOptions(); this.sfnmlc = JSON.parse(localStorage.getItem('sfnmlc')) }, mounted: function() { // DOM 渲染完成后再加载树数据,确保能正确展开与选中 this.$nextTick(() => { this.loadTreeData(); }); }, props: ['title', 'data', 'config','disableStatus'] }); }); })(template, resolve, reject); }); RegVueCom("xljk-ssdStudentInfoAdd-view", function(resolve, reject){ var template = "
\n \n\n\n
\n
\n
\n 学生信息上报\n
\n\n
\n
\n
\n \n \n

\n 1\n

\n
\n

\n 学校基本信息\n

\n
\n
\n
\n \n \n

\n 2\n

\n
\n {{lcid?'班级信息':'学生信息'}}\n
\n \n \n \n
\n \n\n
\n \n \n \n

*学校阶段

\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n

*区县名称

\n \n \n \n
\n \n

*学校名称

\n \n \n \n
\n\n\n \n\n \n

*主管单位

\n \n \n \n \n \n \n
\n\n \n \n

*学制

\n \n \n \n \n \n
\n \n

*学制

\n \n \n \n \n \n \n \n
\n \n

*培养层次

\n \n\n \n\n \n \n \n \n \n \n
\n \n \n

*学校类别

\n \n \n \n \n \n \n \n
\n \n

*办学性质

\n \n \n \n \n \n \n
\n \n

*办学类型

\n \n \n \n \n \n \n \n \n
\n\n \n

*举办者类型

\n \n \n \n \n \n \n \n \n\n\n \n \n
\n \n

学校类别

\n \n \n \n
\n \n\n \n

*学校详细地址

\n \n \n \n
\n \n \n \n

*学校地理位置

\n \n \n \n \n \n
\n \n \n \n

*校心理健康中心教师人数\n \n

\n \n \n \n
\n \n

*学校心理健康工作负责人问卷填写人姓名

\n \n \n \n
\n
\n \n \n \n

*学校地理位置

\n \n \n \n \n \n
\n \n

*全校心理健康教师数量

\n \n \n \n
\n \n\n
\n \n
\n
\n \n 下 一 步\n 下 一 步\n
\n
\n
\n \n \n \n \n \n \n
\n
\n \n
\n \n \n \n

*院系名称

\n \n \n \n
\n \n

*专业名称

\n \n \n \n
\n \n\n\n\n
\n
\n
\n
\n
\n
"; return ( function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), totalstep:4, done:0, Roles:[], sfnmlc:'', lcid:'', xxwzList:['城市','县城','农村'], xzList:['五四制','六三制'], jbzlxList:['中央教育部门','省级教育部门','民办'], disableStatus:'', xxjd:'', options: [], value: [], list: [], homezt:'', loading: false, idEdit:false, states: [], isFirst:true, dialogVisible: false, tableData: [], multipleSelection: [], currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4, innerVisible:false, classList:[], total:0, pages:{ pageno:1, pagesize:5 }, step:1, gjstep:1, zyForm:{ zybm:'', zymc:'', yxmc:'', zzone:0, zztwo:0, zzthree:0, gzone:0, gztwo:0, gzthree:0, bkone:0, bktwo:0, bkthree:0, bkfour:0, bkfive:0, ssone:0, sstwo:0, ssthree:0, bsone:0, bstwo:0, bsthree:0, bsfour:0, }, reruleForm: { sfmc:'', qxmc:'', djsmc:'', xxmc:'', xxbm:'', zgdwbm:'', xxjd:'', xz:'', bxxz:'', // sckssj:'', // scjssj:'', xxwz:'', bxlx:'', jbzlx:'', pycc:[], jbzlx:'', xxlx:'', qybm:'', xxxljkfzrxm:'', //issdf:undefined,issmcyyy:undefined, wxzh:'', zzxlcnt:0, zxzzcnt:0, jygzinfo:'', wjgyinfo:'', xlpxinfo:'', xxForm:{ xfour:0, xfive:0, xsix:0 }, czForm:{ cone:0, ctwo:0, cthree:0, cfour:0 }, gForm:{ gone:0, gtwo:0, gthree:0 }, /*zzForm :{ zzone:0, zztwo:0, zzthree:0, }, gzForm :{ gzone:0, gztwo:0, gzthree:0, }, bkForm : { bkone:0, bktwo:0, bkthree:0, bkfour:0, bkfive:0, }, ssForm : { ssone:0, sstwo:0, ssthree:0, }, bsForm :{ bsone:0, bstwo:0, bsthree:0, bsfour:0, }*/ }, ruleForm: { jzxlcnt: null, xxwz:'', zzxlcnt:'', xz:'', jbzlx:'', sfmc:'', qxmc:'', djsmc:'', xxmc:'', xxbm:'', zgdwbm:'', xd:'', xz:'', bxxz:'', sckssj:'', scjssj:'', xxwz:'', bxlx:'', jbzlx:'', pycc:[], jbzlx:'', xxlx:'', //issdf:undefined,issmcy:undefined, wxzh:'', zzxlcnt:0, zxzzcnt:0, jygzinfo:'', wjgyinfo:'', xlpxinfo:'', qybm:'', xxForm:{ xfour:0, xfive:0, xsix:0 }, czForm:{ cone:0, ctwo:0, cthree:0, cfour:0 }, gForm:{ gone:0, gtwo:0, gthree:0 }, /*zzForm :{ zzone:0, zztwo:0, zzthree:0, }, gzForm :{ gzone:0, gztwo:0, gzthree:0, }, bkForm : { bkone:0, bktwo:0, bkthree:0, bkfour:0, bkfive:0, }, ssForm : { ssone:0, sstwo:0, ssthree:0, }, bsForm :{ bsone:0, bstwo:0, bsthree:0, bsfour:0, }*/ }, xxxzOption:[ { value:'1', label:'三年制', usefor:['2','3','4','5'] }, { value:'2', label:'四年制', usefor:['2'] }, { value:'3', label:'五年制', usefor:['1','5','4'] }, { value:'4', label:'六年制', usefor:['1'] }, { value:'5', label:'九年一贯制', usefor:['2'] }, { value:'6', label:'十二年一贯制', usefor:['3'] }, { value:'7', label:'初高中一贯制', usefor:['3'] }, { value:'10', label:'其他', usefor:['4','5','6'] }, ], zyrules: { sfmc: [ { required: true, message: '请输入省份姓名', trigger: 'blur' } ], }, rules: { sfmc: [ { required: true, message: '请输入省份姓名', trigger: 'blur' } ], qxmc: [ { required: true, message: '请输入区县名称', trigger: 'blur' } ], djsmc: [ { required: true, message: '请输入地级市名称', trigger: 'blur' } ], xxmc: [ { required: true, message: '请输入学校名称', trigger: 'blur' } ], xxbm: [ { required: true, message: '请输入学校编号', trigger: 'blur' } ], zgdw: [ { required: true, message: '请选择主管单位', trigger: 'blur' } ], xd: [ { required: true, message: '请选择学校阶段', trigger: 'blur' } ], dlwz: [ { required: true, message: '请选择地理位置', trigger: 'blur' } ], jzxlcnt: [ { required: true, type: 'number', message: '请输入教师人数', trigger: 'change' }, { validator: function(rule, value, callback){ if(value === '' || value === undefined || value === null){ callback(new Error('请输入教师人数')) return } var n = Number(value) if(!isFinite(n) || Math.floor(n) !== n || n < 1){ callback(new Error('请输入大于0的整数')) }else{ callback() } }, trigger: 'change' } ], xxxz: [ { required: true, message: '请选择学校性质', trigger: 'blur' } ], xxxljkfzrxm: [ { required: true, message: '请选择学校负责人', trigger: 'blur' } ], xz: [ { required: true, message: '请选择学制', trigger: 'blur' } ], bxxz: [ { required: true, message: '请选择办学性质', trigger: 'blur' } ], sckssj: [ { required: true, message: '选择施测开始时间', trigger: 'blur' } ], scjssj: [ { required: true, message: '选择施测结束时间', trigger: 'blur' } ], xxwz: [ { required: true, message: '请输入学校地理位置', trigger: 'blur' } ], /* issmcyyy:[ { required: true, message: '请选择是否实名制参与试点校工作', trigger: 'blur' } ], issdf:[ { required: true, message: '请选择是否申请参与试点访谈', trigger: 'blur' } ],*/ }, isEdit:false, } }, methods:{ getjindu(val){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID //xxid,pageno,pagesize const params = { xxid:schoolid, } $.get("/www/public/shangbao/cnt_sb_jd", params, function(res){ if(res.success==1){ // 根据不同学段选择正确的服务端进度字段 var num if(['1','2','3','4'].includes(that.xxjd)){ // 使用服务端返回的当前完成步数作为可访问的最大步数 num = Number(res.data.xxcnt || 0) }else{ var gj = res.data.gzzstuxx num = gj == null || gj === '' ? 1 : Number(gj) } if(num>=val){ if(['1','2','3','4'].includes(that.xxjd)){ that.gjstep=0 that.step = val console.log(that.step) }else{ that.step=0 that.gjstep = val } }else{ that.$message.warning('请先完成前面步骤信息上报') } }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, // 提交第一步并在成功后继续推进(用于顶部直达场景) submitAndThen(cb){ this._silentNext = true this._afterSubmit = cb this.submit() }, // 顶部跳转时按步骤顺序依次校验与推进 advanceToStep(target){ const isBase = ['1','2','3','4'].includes(this.xxjd) const current = isBase ? this.step : this.gjstep const goto = (n)=>{ if(isBase){ this.gjstep = 0 this.step = n }else{ this.step = 0 this.gjstep = n } } // 后退或同步:直接到目标步 if(target <= current){ goto(target) this._chainTargetStep = null this._chainInProgress = false return } // 目标为第二步:若当前在第一步,必须先通过第一步校验与保存 if(target === 2){ if(current === 1){ // 使用与“下一步”一致的提交流程(包含表单校验与保存) this._afterSubmit = null this._silentNext = false this.submit() return }else{ goto(2) this._chainTargetStep = null this._chainInProgress = false return } } // 从第一步尝试直达第三步及以上:先校验第一步,成功后进入第二步,再依据第二步数据是否就绪决定是否进入第三步 if(current === 1 && target >= 3){ const form = this.$refs && this.$refs.ruleForm if(form){ form.validate((valid)=>{ if(!valid){ this.$message.warning('请先完成学校基本信息') return } // 提交第一步,成功后进入第二步;进入第二步后再判断第二步数据是否就绪 this._afterSubmit = ()=>{ // 进入第二步后进行即时就绪检查 const ready = this.isStep2Ready ? this.isStep2Ready() : false if(ready){ goto(3) }else{ this.$message.warning('请先完成第二步数据上报') } } this._silentNext = false this.submit() }) }else{ // 若无法获得表单引用,回退到通用提示 this.$message.warning('请先完成学校基本信息') } this._chainTargetStep = null this._chainInProgress = false return } // 第二步进入第三步:即时检查是否具备数据,不做等待 if(current === 2 && target >= 3){ const ready = this.isStep2Ready ? this.isStep2Ready() : false if(ready){ goto(3) // 若继续更高目标,递进推进 if(target > 3){ this.advanceToStep(target) } }else{ this.$message.warning('请先完成第二步数据上报') } this._chainTargetStep = null this._chainInProgress = false return } // 其他情况(当前≥3或目标为4等):直接设置为目标步 goto(target) this._chainTargetStep = null this._chainInProgress = false }, // 等待第二步组件数据就绪(有数据或在限定时间内) waitForStep2Ready(maxWaitMs){ const isBase = ['1','2','3','4'].includes(this.xxjd) const refName = 'step2Base' const start = Date.now() return new Promise((resolve)=>{ const check = ()=>{ const comp = this.$refs[refName] if(comp && Array.isArray(comp.tableData) && comp.tableData.length > 0){ resolve(true) return } if(Date.now() - start >= (maxWaitMs || 1500)){ resolve(false) return } setTimeout(check, 120) } check() }) }, // 即时判断第二步是否具备数据,无等待 isStep2Ready(){ const isBase = ['1','2','3','4'].includes(this.xxjd) const refName = 'step2Base' const comp = this.$refs[refName] return !!(comp && Array.isArray(comp.tableData) && comp.tableData.length > 0) }, clicktab(val){ // 顶部点击采用防抖:短时间内仅处理最后一次点击 if(this._tabDebounceTimer){ clearTimeout(this._tabDebounceTimer) this._tabDebounceTimer = null } this._lastTargetStep = val this._tabDebounceTimer = setTimeout(()=>{ const isBase = ['1','2','3','4'].includes(this.xxjd) const current = isBase ? this.step : this.gjstep const target = this._lastTargetStep // 后退或相同:立即跳转,不受提交锁影响 if(target <= current){ if(isBase){ this.gjstep = 0 this.step = target }else{ this.step = 0 this.gjstep = target } }else{ // 前进:按既有推进逻辑逐步验证 this.advanceToStep(target) } this._tabDebounceTimer = null }, 200) }, preStep(){ if(['1','2','3','4'].includes(this.xxjd)){ this.gjstep=0 this.step-- }else{ this.step=0 this.gjstep-- } }, nextStep(){ if(['1','2','3','4'].includes(this.xxjd)){ this.gjstep=0 this.step++ }else{ this.step=0 this.gjstep++ } // 若存在“提交后继续推进”的回调,则在进入下一步后触发 if(this._afterSubmit){ const cb = this._afterSubmit this._afterSubmit = null try{ cb() }catch(e){} } }, nextStep1(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { xxid:schoolid, } $.post("/www/public/shangbao/wcjbxxtx", params, function(res){ if(res.error==0){ setTimeout(()=>{ $.post("/www/public/bd/editxxxxsbsfwc", {}, function(res){ if(res.success==1){ }else{ this.$message.success(res.message) } }) that.$router.push('home') }) }else{ that.$message.error(res.message) } }).fail((err)=>{ that.loading = false that.$message({ type: "error", message: '请求错误' }) }) }, beforeClose(){ this.$refs.baseDialog2.close() }, getList(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID //xxid,pageno,pagesize const params = { xxid:schoolid, ...this.pages } $.get("/www/public/shangbao/get_zy_info", params, function(res){ if(res.success==1){ that.tableData = res.data that.total = res.total }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, handlexdChange(val){ this.ruleForm.sfmc = '' this.ruleForm.djsmc = '' this.ruleForm.xxwz = '' this.ruleForm.xxlx = '' this.ruleForm.bxxz = '' this.ruleForm.jbzlx = '' this.ruleForm.xz = '' }, getDetail(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { xxid:schoolid, } $.get("/www/public/shangbao/get_school_info", params, function(res){ if(res.success==1){ that.ruleForm = res.data that.disableStatus=res.data.shzt that.ruleForm.xxForm = {...that.reruleForm.xxForm} that.ruleForm.czForm = {...that.reruleForm.czForm} that.ruleForm.gForm = {...that.reruleForm.gForm} that.ruleForm.zzForm = {...that.reruleForm.zzForm} that.ruleForm.gzForm = {...that.reruleForm.gzForm} that.ruleForm.bkForm = {...that.reruleForm.bkForm} that.ruleForm.ssForm = {...that.reruleForm.ssForm} that.ruleForm.bsForm = {...that.reruleForm.bsForm} // 确保主管单位选项包含当前值,避免显示ID而非名称 if(that.ruleForm.zgdwbm && that.ruleForm.zgdwmc){ // 检查当前options是否已包含该主管单位 const existingOption = that.options.find(item => item.id === that.ruleForm.zgdwbm) if(!existingOption){ // 如果不存在,添加到options数组 that.options.push({ mc:that.ruleForm.zgdwmc, id:that.ruleForm.zgdwbm }) } } if(res.data.xd){ that.isFirst = false if(res.data.xd=='1'){ that.ruleForm.xxForm = { xfour:res.data.xfour, xfive:res.data.xfive, xsix:res.data.xsix, } }else if(res.data.xd=='2'){ that.ruleForm.czForm = { cone:res.data.cone, ctwo:res.data.ctwo, cthree:res.data.cthree, } }else if(res.data.xd=='3'){ that.ruleForm.gForm = { gone:res.data.gone, gtwo:res.data.gtwo, gthree:res.data.gthree, } }else if(res.data.xd=='4'){ that.ruleForm.zzForm = { zzone:res.data.zzone, zztwo:res.data.zztwo, zzthree:res.data.zzthree, } }else if(res.data.xd=='5'){ that.ruleForm.gzForm = { gzone:res.data.gzone, gztwo:res.data.gztwo, gzthree:res.data.gzthree, } }else if(res.data.xd=='6'){ if(res.data.pycc){ that.ruleForm.pycc = res.data.pycc.split(',') } that.ruleForm.bkForm = { bkone:res.data.bkone, bktwo:res.data.bktwo, bkthree:res.data.bkthree, bkfour:res.data.bkfour, bkfive:res.data.bkfive, } that.ruleForm.ssForm = { ssone:res.data.ssone, sstwo:res.data.sstwo, ssthree:res.data.ssthree, } that.ruleForm.bsForm = { bsone:res.data.bsone, bstwo:res.data.bstwo, bsthree:res.data.bsthree, bsfour:res.data.bsfour, } } // 将当前页面学段xxjd与ruleForm.xd保持一致,避免显示与提交不一致 if(that.xxjd){ that.ruleForm.xd = that.xxjd } } }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{ console.log(xhr,status,error) this.$message.error('请求错误') }) }, download(){ var that = this var xxjd = localStorage.getItem('xxjd') //1zz 2gz 3gx var type if(xxjd=='4'){ type = '1' }else if(xxjd=='5'){ type = '2' }else if(xxjd=='6'){ type = '3' } const params = { type, } axios({ method: 'get', url: '/www/public/shangbao/download_zy_mb', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '专业导入模版.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, del(row){ var that = this let params = {} if(row.id){ params = { ids:JSON.stringify([row.id]), } }else if(that.multipleSelection.length){ params.ids = [] console.log( that.multipleSelection,' that.multipleSelection') that.multipleSelection.forEach(item=>{ params.ids.push(item.id) }) params.ids = JSON.stringify(params.ids) console.log( params,' params') }else{ that.$message.warning('请先选择数据') } $.get("/www/public/shangbao/del_zy_info", params, function(res){ if(res.success==1){ that.$message.success('删除成功') that.getList() }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ that.$message.success('请求错误') }) }, handleEdit(row){ this.zyForm = {} this.zyForm = {...row} this.isEdit = true this.$refs.baseDialog2xx.show() }, customUpload(params) { var that = this var xxjd = localStorage.getItem('xxjd') var importType if(xxjd=='4'){ importType = '1' }else if(xxjd=='5'){ importType = '2' }else if(xxjd=='6'){ importType = '3' } that.loading = true // params是一个对象,包含了file和fileList, // 但是这个params参数可能每个版本不一样值就不一样,到时候自己打印看看, // 反正file的值就是原始的File对象 // 如果extraParams是个单独的值,直接加入 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const formData = new FormData() console.log(params.file,'params.file') formData.append('file', params.file) // 这是file入参,文件信息 formData.append('xxid', schoolid) formData.append('type', importType) // 如果extraParams是个对象,循环加入formData /*for (const key in this.extraParams) { formData.append(key, this.extraParams[key]) } */ // 调接口 axios.post('/www/public/shangbao/import_zy_info', formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ that.$message.success('导入成功') that.loading = false that.getList() }else{ that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false console.error(error); }); }, closeDialog(){ // if(this.tableData.length==0){ this.$message.warning('上报未完成') return } this.$refs.baseDialog2.close() this.$emit('closeDialog') }, closeDialog1(){ this.$refs.baseDialog2xx.close() }, confirm(){ this.$refs.baseDialog2xx.close() }, remoteMethod(val) { var that = this const params = { } return new Promise((resolve, reject) => { $.get("/www/public/shangbao/findsjbmlist", params, function(res){ if(res.success==1){ that.options = res.data resolve(res.data) }else{ that.$message.error(res.message) reject(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') reject(error) }) }) }, // 根据学段动态设置验证规则 updateValidationRules() { // 确保所有必填字段都有验证规则 if (this.xxjd == '4') { // 中职学校必填字段验证 this.rules.zgdw = [ { required: true, message: '请选择主管单位', trigger: 'change' } ]; this.rules.bxlx = [ { required: true, message: '请选择办学类型', trigger: 'change' } ]; this.rules.jbzlx = [ { required: true, message: '请选择举办者类型', trigger: 'change' } ]; this.rules.xxxz = [ { required: true, message: '请选择学校性质', trigger: 'change' } ]; this.rules.xxxljkfzrxm = [ { required: true, message: '请输入分管学生德育和心理健康工作的领导', trigger: 'blur' } ]; this.rules.xz = [ { required: true, message: '请选择学制', trigger: 'change' } ]; } else if (['5', '6'].includes(this.xxjd)) { // 高职/高校必填字段验证 this.rules.zgdw = [ { required: true, message: '请选择主管单位', trigger: 'change' } ]; this.rules.bxxz = [ { required: true, message: '请选择办学性质', trigger: 'change' } ]; this.rules.jbzlx = [ { required: true, message: '请选择举办者类型', trigger: 'change' } ]; // 其他特定于高职/高校的字段 if (this.xxjd == '6') { this.rules.pycc = [ { required: true, message: '请选择培养层次', trigger: 'change' } ]; } } else if (['1', '2', '3'].includes(this.xxjd)) { // 小学/初中/高中必填字段验证 this.rules.zgdw = [ { required: true, message: '请选择主管单位', trigger: 'change' } ]; this.rules.bxxz = [ { required: true, message: '请选择办学性质', trigger: 'change' } ]; this.rules.xxlx = [ { required: true, message: '请选择学校类别', trigger: 'change' } ]; } }, submit(val){ if(this._submitting){ return } this._submitting = true // var that = this // 根据学段动态设置必填规则 this.updateValidationRules(); this.$refs.ruleForm.validate((valid) => { if (valid) { // 检查施测时间 if (that.ruleForm.sckssj && that.ruleForm.scjssj) { var startDate = new Date(that.ruleForm.sckssj); var endDate = new Date(that.ruleForm.scjssj); if (endDate < startDate) { that._submitting = false that.$message.error('施测结束时间不能早于开始时间'); return; } } var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var result = that.options.find(item=>item.id==that.ruleForm.zgdwbm) let params = { xxbm:that.ruleForm.xxbm, zgdwbm:that.ruleForm.zgdwbm, zgdwmc:(result && result.mc) || '', sckssj:that.ruleForm.sckssj, scjssj:that.ruleForm.scjssj, bxlx:that.ruleForm.bxlx, jbzlx:that.ruleForm.jbzlx, xd:that.ruleForm.xd, //issmcyyy:that.ruleForm.issmcyyy, qybm:that.ruleForm.qybm, sfmc:that.ruleForm.sfmc, djsmc:that.ruleForm.djsmc, jzxlcnt: parseInt(that.ruleForm.jzxlcnt, 10), dlwz:that.ruleForm.dlwz, xxmc:that.ruleForm.xxmc, } /* if(that.ruleForm.issdf){ params.issdf = that.ruleForm.issdf }*/ if(val&&val==1){ params.wxzh = that.ruleForm.wxzh params.zzxlcnt = that.ruleForm.zzxlcnt params.zxzzcnt = that.ruleForm.zxzzcnt params.jygzinfo = that.ruleForm.jygzinfo params.wjgyinfo = that.ruleForm.wjgyinfo params.xlpxinfo = that.ruleForm.xlpxinfo } if(that.ruleForm.xd=='1'){ params = {...params, id:schoolid,...that.ruleForm.xxForm,qxmc:that.ruleForm.qxmc,xxwz:that.ruleForm.xxwz,bxxz:that.ruleForm.bxxz,xz:that.ruleForm.xz,xxlx:that.ruleForm.xxlx,} }else if(that.ruleForm.xd=='2'){ params = {...params, id:schoolid,...that.ruleForm.czForm,qxmc:that.ruleForm.qxmc,xxwz:that.ruleForm.xxwz,bxxz:that.ruleForm.bxxz,xz:that.ruleForm.xz,xxlx:that.ruleForm.xxlx,} }else if(that.ruleForm.xd=='3'){ params = {...params, id:schoolid,...that.ruleForm.gForm,qxmc:that.ruleForm.qxmc,xxwz:that.ruleForm.xxwz,bxxz:that.ruleForm.bxxz,xz:that.ruleForm.xz,xxlx:that.ruleForm.xxlx,} }else if(that.ruleForm.xd=='4'){ params = {...params, id:schoolid, qxmc:that.ruleForm.qxmc,xxwz:that.ruleForm.xxwz,jbzlx:that.ruleForm.jbzlx,xz:that.ruleForm.xz,xxlx:that.ruleForm.xxlx, } }else if(that.ruleForm.xd=='5'){ params = {...params, id:schoolid, bxxz:that.ruleForm.bxxz, } }else if(that.ruleForm.xd=='6'){ params = {...params, id:schoolid, pycc:that.ruleForm.pycc.toString(), } } console.log(params,'params') $.get("/www/public/shangbao/edit_school_info", params, function(res){ if(res.success==1){ // 静默模式:不触发视觉上的下一步,仅回调继续推进 if(that._silentNext){ const cb = that._afterSubmit that._afterSubmit = null that._silentNext = false if(cb){ try{ cb() }catch(e){} } }else{ // 常规模式:进入第二步 that.nextStep() } that._submitting = false }else{ that._submitting = false that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that._submitting = false that.$message.error('请求错误') }) } else { that._submitting = false that.$message.warning('信息校验未正确填写或填写内容不全') console.log('error submit!!'); return false; } const dataxlj={ xm:that.ruleForm.xxxljkfzrxm, lsid:that.ruleForm.xxxljkfzrid, xxid:schoolid, } if(that.ruleForm.xd=='1'||that.ruleForm.xd=='2'||that.ruleForm.xd=='3'||that.ruleForm.xd=='4'){ $.post("/www/public/shangbao/addxljkfzr", dataxlj, function(res){ if(res.success==1){ }else{ that.$message.error(res.message) } }) } }); }, zysubmit(){ var that = this this.$refs['zyForm'].validate((valid) => { if (valid) { const params = { zybm:that.zyForm.zybm, zymc:that.zyForm.zymc, yxmc:that.zyForm.yxmc, zzone:that.zyForm.zzone||undefined, zztwo:that.zyForm.zztwo||undefined, zzthree:that.zyForm.zzthree||undefined, gzone:that.zyForm.gzone||undefined, gztwo:that.zyForm.gztwo||undefined, gzthree:that.zyForm.gzthree||undefined, bkone:that.zyForm.bkone||undefined, bktwo:that.zyForm.bktwo||undefined, bkthree:that.zyForm.bkthree||undefined, bkfour:that.zyForm.bkfour||undefined, bkfive:that.zyForm.bkfive||undefined, ssone:that.zyForm.ssone||undefined, sstwo:that.zyForm.sstwo||undefined, ssthree:that.zyForm.ssthree||undefined, bsone:that.zyForm.bsone||undefined, bstwo:that.zyForm.bstwo||undefined, bsthree:that.zyForm.bsthree||undefined, bsfour:that.zyForm.bsfour||undefined, id:that.zyForm.id } $.post("/www/public/shangbao/edit_zy_info", params, function(res){ if(res.success==1){ that.$message.success(res.message) that.$refs.baseDialog2xx.close() that.getList() }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) } else { console.log('error submit!!'); return false; } }); }, onError(){}, show(){ var that = this this.$refs.baseDialog2.show() this.$nextTick(()=>{ that.getDetail() that.$refs.ruleForm.resetFields() }) }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pagesize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageno = val this.getList() }, handleClick(){}, handleClose(){ console.log(1) this.dialogVisible = false }, handleSelectionChange(val) { console.log(val,'val') this.multipleSelection = val; }, getClass(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { schoolid } $.get("/www/public/shangbao/findschoolbj", params, function(res){ if(res.success==1){ that.classList = res.data }else{ this.$message.error(res.message) } }).fail((xhr,status,error)=>{ this.$message.error('请求错误') }) }, }, computed:{ isXCG(){ if(['1','2','3'].indexOf(this.ruleForm.xd)!=-1){ return true } return false }, noshowClose(){ var noshow if(this.step==1){ noshow = true }else if(this.step==2){ noshow = false }else{ noshow = false } } }, watch:{ "ruleForm.xd"(val){ /*this.ruleForm.sfmc = '' this.ruleForm.djsmc = '' this.ruleForm.xxwz = '' this.ruleForm.xxlx = '' this.ruleForm.bxxz = '' this.ruleForm.jbzlx = '' this.ruleForm.xz = ''*/ if(val=='1'){ }else{ } } }, created: function(){ const that =this that.xxjd = localStorage.getItem('xxjd') that.sfnmlc = JSON.parse(localStorage.getItem('sfnmlc')) that.lcid = JSON.parse(localStorage.getItem('lcid')) var done = Number(that.$route.query.done) that.shzt = that.$route.query.shzt that.homezt = that.$route.query.homezt that.status = that.$route.query.status if(['1','2','3','4'].includes(that.xxjd)){ that.totalstep = 3 if(done<3){ that.gjstep=0 that.step = 1 } } else { that.totalstep = 1 that.step = 0 that.gjstep = 1 } // 先加载主管单位列表,再获取学校详情,确保回显正常 that.remoteMethod().then(() => { that.getDetail() }) }, mounted: function(){ /*this.list = this.states.map(item => { return { value: `value:${item}`, label: `label:${item}` }; });*/ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-bgAuth2-view", function(resolve, reject){ var template = "
\n \n
\n
\n \n \n \n \n 查询\n 所选下载\n \n
\n
\n 一次最多勾选下载五十个文件\n
\n\n \n \n \n \n \n \n \n\n
\n \n \n
\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { tableData: [], total: 0, pages: { pageNo: 1, pageSize: 10 }, search: { xm: '', qxid: '', sfsq: '' }, qxOptions: [], selectedIds: [], downloadLoading: false, canAuth: false, canAuths: false, } }, computed: { pageTitle() { var type = this.$route.query.type; var canAuth = this.canAuth; return '县级报告下载'; } }, methods: { checkSelectable(row) { return String(row.sfkqbg) !== '0'; }, formatSq(row){ return row && String(row.sfsq)==='1' ? '已授权' : '未授权' }, downloadRow(row){ var that = this if(!row || !row.id){ this.$message.error('缺少ID'); return } var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1'; var isProvincial = user.Roles && (user.Roles.includes('651') || user.Roles.includes('654')); // 只有省级用户且在县级报告下载与授权(type=1)页面时,才使用新接口 // 651在type=3(市级)时,或者654在type=1(县级)时,也可能需要用jyj接口? // 根据之前的逻辑,651查看县级用downloadjyjdxzip。 // 假设市级(654)查看县级(1)也用downloadjyjdxzip // 假设省级(651)查看市级(3)也用downloadjyjdxzip var url = '/www/public/baogao/downloadzip'; if (isProvincial) { if (type === '1' || type === '3') { url = '/www/public/baogao/downloadjyjdxzip'; } } axios({ method: 'GET', url: url, params: { ids:JSON.stringify([row.id]) }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; var suffix = '_报告.zip'; if (type === '1') suffix = '县级_报告.zip'; if (type === '2') suffix = '学校_报告.zip'; if (type === '3') suffix = '市级_报告.zip'; aLink.setAttribute('download', (row.mc||'报告') + suffix); document.body.appendChild(aLink); aLink.click(); document.body.removeChild(aLink); that.$message.success('下载成功') }else{ that.$message.error('下载失败') } }).catch(err=>{ that.$message.error('下载失败') }) }, authorizeRow(row){ var that = this if(!row || !row.id){ this.$message.error('缺少ID'); return } var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1' var is651 = user.Roles && user.Roles.includes('651'); // 授权角色ID映射 var roles = '652'; // default county var authType = 2; // 默认 type=2 (部分授权) if (type === '1') { roles = '652'; } if (type === '2') roles = '653'; if (type === '3') roles = '654'; this.$confirm('是否确认授权?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) .then(function(){ const params = { userid: user.ID, type: 2, ids: JSON.stringify([row.id]), roles: roles } $.post('/www/public/baogao/bgsq', params, function(res){ if(res.success==1 || res.error==0){ that.$message.success('授权成功') that.fetchList() }else{ that.$message.error(res.message || '授权失败') } }).fail(function(){ that.$message.error('请求失败') }) }).catch(function(){}) }, noAuthorizeRow(row){ var that = this if(!row || !row.id){ this.$message.error('缺少ID'); return } var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1' var is651 = user.Roles && user.Roles.includes('651'); // 授权角色ID映射 var roles = '652'; // default county var authType = 2; // 默认 type=2 (部分授权) if (type === '1') { roles = '652'; } if (type === '2') roles = '653'; if (type === '3') roles = '654'; this.$confirm('是否确认取消授权?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) .then(function(){ const params = { userid: user.ID, type: 2, ids: JSON.stringify([row.id]), roles: roles } $.post('/www/public/baogao/bgqxsq', params, function(res){ if(res.success==1 || res.error==0){ that.$message.success('取消授权成功') that.fetchList() }else{ that.$message.error(res.message || '取消授权失败') } }).fail(function(){ that.$message.error('请求失败') }) }).catch(function(){}) }, handleSizeChange(size){ this.pages.pageSize = size this.pages.pageNo = 1 this.fetchList() }, handleCurrentChange(page){ this.pages.pageNo = page this.fetchList() }, handleSelectionChange(rows){ this.selectedIds = (rows || []).map(r => r.id).filter(Boolean) }, fetchQxList(){ var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} $.get('/www/public/baogao/findqxList', { userid: user.ID }, function(res){ if(res.success==1 || res.error==0){ that.qxOptions = res.data || [] } }) }, fetchList(){ var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1' const params = { pageNo: this.pages.pageNo, pageSize: this.pages.pageSize, type: type, xm: this.search.xm, qxid: this.search.qxid, sfsq: this.search.sfsq } $.get('/www/public/baogao/findxxbglist', params, function(res){ if(res.success==1 || res.error==0){ that.tableData = res.data || [] that.total = res.total || (res.data ? res.data.length : 0) }else{ that.$message.error(res.message || '请求失败') } }).fail(function(){ that.$message.error('请求失败') }) }, authorizeAll(){ var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1' var is651 = user.Roles && user.Roles.includes('651'); var roles = '652'; var authType = 1; // 默认 type=1 (全部授权) if (type === '1') { roles = '652'; if (is651) authType = 1; } if (type === '2') { roles = '653'; authType = 3; } if (type === '3') roles = '654'; this.$confirm('是否确认全部授权?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) .then(function(){ const params = { userid: user.ID, type: authType, roles: roles } $.post('/www/public/baogao/bgsq', params, function(res){ if(res.success==1 || res.error==0){ that.$message.success('授权成功') that.fetchList() }else{ that.$message.error(res.message || '授权失败') } }).fail(function(){ that.$message.error('请求失败') }) }).catch(function(){}) }, noAuthorizeAll(){ var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1' var is651 = user.Roles && user.Roles.includes('651'); var roles = '652'; var authType = 1; // 默认 type=1 (全部授权) if (type === '1') { roles = '652'; if (is651) authType = 1; } if (type === '2') { roles = '653'; authType = 3; } if (type === '3') roles = '654'; this.$confirm('是否确认取消全部授权?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) .then(function(){ const params = { userid: user.ID, type: authType, roles: roles } $.post('/www/public/baogao/bgqxsq', params, function(res){ if(res.success==1 || res.error==0){ that.$message.success('取消授权成功') that.fetchList() }else{ that.$message.error(res.message || '取消授权失败') } }).fail(function(){ that.$message.error('请求失败') }) }).catch(function(){}) }, authorizeSelected(){ var that = this if(!this.selectedIds.length){ this.$message.warning('请先选择需要授权的项'); return } var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1' var is651 = user.Roles && user.Roles.includes('651'); var roles = '652'; var authType = 2; // 默认 type=2 (部分授权) if (type === '1') { roles = '652'; } if (type === '2') { roles = '653'; authType = (user.Roles && user.Roles.includes('652')) ? 2 : 3; } if (type === '3') roles = '654'; this.$confirm('是否确认授权所选?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) .then(function(){ const params = { userid: user.ID, type: authType, ids: JSON.stringify(that.selectedIds), roles: roles } $.post('/www/public/baogao/bgsq', params, function(res){ if(res.success==1 || res.error==0){ that.$message.success('授权成功') that.fetchList() }else{ that.$message.error(res.message || '授权失败') } }).fail(function(){ that.$message.error('请求失败') }) }).catch(function(){}) }, noAuthorizeSelected(){ var that = this if(!this.selectedIds.length){ this.$message.warning('请先选择需要取消授权的项'); return } var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1' var is651 = user.Roles && user.Roles.includes('651'); var roles = '652'; var authType = 2; // 默认 type=2 (部分授权) if (type === '1') { roles = '652'; } if (type === '2') { roles = '653'; authType = (user.Roles && user.Roles.includes('652')) ? 2 : 3; } if (type === '3') roles = '654'; this.$confirm('是否确认取消所选授权?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) .then(function(){ const params = { userid: user.ID, type: authType, ids: JSON.stringify(that.selectedIds), roles: roles } $.post('/www/public/baogao/bgqxsq', params, function(res){ if(res.success==1 || res.error==0){ that.$message.success('取消授权成功') that.fetchList() }else{ that.$message.error(res.message || '取消授权失败') } }).fail(function(){ that.$message.error('请求失败') }) }).catch(function(){}) }, downloadSelected(){ var that = this if(!that.selectedIds.length){ that.$message.warning('请先选择需要下载的项'); return } if(that.selectedIds.length>50){ that.$message.warning('一次最多选择50个'); return } var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1'; var isProvincial = user.Roles && user.Roles.includes('651'); var isMunicipal = user.Roles && user.Roles.includes('654'); var url = '/www/public/baogao/downloadzip'; // 默认接口 if (isProvincial && type === '1') { url = '/www/public/baogao/downloadjyjdxzip'; // 省级用户下县级报告 } else if (isMunicipal && type === '1') { url = '/www/public/baogao/downloadzipjyj'; } this.$confirm('下载可能需要较长时间,请耐心等待,是否继续?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'info' }).then(() => { that.downloadLoading = true axios({ method: 'GET', url: url, params: { ids: JSON.stringify(that.selectedIds) }, responseType: 'blob' }).then(res=>{ that.downloadLoading = false if(res.request.status==200){ let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; var fileName = type === '1' ? '县级报告.zip' : '学校报告.zip'; aLink.setAttribute('download', fileName); document.body.appendChild(aLink); aLink.click(); document.body.removeChild(aLink); that.$message.success('下载成功') }else{ that.$message.error('下载失败') } }).catch(err=>{ that.downloadLoading = false that.$message.error('下载失败') }) }).catch(() => { // 取消下载 }); } }, created: function(){ var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1'; var is651 = user.Roles && user.Roles.includes('651'); var is654 = user.Roles && user.Roles.includes('654'); var is652 = user.Roles && user.Roles.includes('652'); this.canAuth = false; this.canAuths = false; if (is651) { // 省级: // type 1 (县级): 授权 (传 type: 3) // type 2 (校级): 仅下载,隐藏授权操作 + 筛选区县 // type 3 (市级): 授权 if (type == '1' || type == '3') this.canAuth = true; if (type == '2') { this.canAuth = false; this.canAuths = true; } } if (is654) { // 市级: // type 1 (县级): 授权 (因为管理县) // type 2 (校级): 仅查询/下载 + 筛选区县 (不能授权学校,由县级授权) if (type == '1') this.canAuth = true; if (type == '2') { this.canAuth = false; // 不授权学校 this.canAuths = true; // 需筛选区县 } } if (is652 && type == '2') { this.canAuth = true; } if(this.canAuths){ this.fetchQxList() } this.fetchList() } }) }) })(template, resolve, reject); }); RegVueCom("xljk-SingleSignOn-view", function(resolve, reject){ var template = " "; return (function(template, resolve, reject) { var store = new Vuex.Store({ state: { accessToken: '', userInfo: {}, user: localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} }, mutations: { accessToken(state, accessToken) { state.accessToken = accessToken; }, userInfo(state, userInfo) { state.userInfo = userInfo; }, user(state, user) { state.user = user; }, } }); seajs.use([], function () { return resolve({ template: template, data: function () { return { id: Math.uuid(), codesrc: '/owin/api/authcode?q=2069', ruleForm: { name: '', paw: '', authcode: '', rememberMe: false }, rules: { name: [ { required: true, message: '请输入姓名', trigger: 'blue' } ], paw: [ { required: true, message: '请输入密码', trigger: 'blue' } ], authcode: [ { required: true, message: '请输入验证码', trigger: 'blue' } ] } }; }, methods: { remeber() { if (this.ruleForm.rememberMe) { // 加密密码 const encryptedPassword = CryptoJS.AES.encrypt(this.ruleForm.paw, 'quanguoxinlijiankang').toString(); // 存储用户信息到 localStorage localStorage.setItem('username', this.ruleForm.name); localStorage.setItem('password', encryptedPassword); localStorage.setItem('rememberMe', 'true'); } else { // 清除存储的用户信息 localStorage.removeItem('username'); localStorage.removeItem('password'); localStorage.removeItem('rememberMe'); } }, rulesInput(formName) { this.$refs[formName].validate((valid) => { if (valid) { this.goHome() } else { return false; } }); }, getReturnUrl() { // 辅助函数:检查参数名(不区分大小写) const getParam = function (params, key) { // 先尝试精确匹配 let value = params.get(key); if (value) return value; // 如果不区分大小写查找 for (let [paramKey, paramValue] of params.entries()) { if (paramKey.toLowerCase() === key.toLowerCase()) { return paramValue; } } return null; }; // 辅助函数:手动解析参数(不区分大小写) const findParam = function (params, key) { for (let i = 0; i < params.length; i++) { const pair = params[i].split('='); const paramKey = pair[0].toLowerCase(); if (paramKey === key.toLowerCase()) { return decodeURIComponent(pair[1] || ''); } } return null; }; // 方法1: 从 query 参数中获取 const queryString = window.location.search; if (queryString) { const params = new URLSearchParams(queryString); const returnUrl = getParam(params, 'returnUrl') || getParam(params, 'returnurl'); if (returnUrl) { return decodeURIComponent(returnUrl); } } // 方法2: 从 hash 中获取(支持 hash 路由) const hash = window.location.hash; if (hash) { const hashIndex = hash.indexOf('?'); if (hashIndex !== -1) { const hashParams = hash.substring(hashIndex + 1); const params = new URLSearchParams(hashParams); const returnUrl = getParam(params, 'returnUrl') || getParam(params, 'returnurl'); if (returnUrl) { return decodeURIComponent(returnUrl); } } } // 方法3: 手动解析 query 字符串(兼容性更好) const search = window.location.search.substring(1); if (search) { const params = search.split('&'); const returnUrl = findParam(params, 'returnUrl') || findParam(params, 'returnurl'); if (returnUrl) { return returnUrl; } } // 方法4: 从 hash 中手动解析 if (hash && hash.indexOf('?') !== -1) { const hashPart = hash.split('?')[1]; if (hashPart) { const params = hashPart.split('&'); const returnUrl = findParam(params, 'returnUrl') || findParam(params, 'returnurl'); if (returnUrl) { return returnUrl; } } } return ''; }, goHome() { const that = this that.remeber() let data = { username: this.ruleForm.name.trim(), password: this.ruleForm.paw, authcode: this.ruleForm.authcode.trim().toLowerCase() } // 验证登录接口 $.get("/www/public/home/dologingld", { username: data.username }, function (resCheck) { if (resCheck.success != 1) { return that.$message.warning(resCheck.message) } // 登录接口 $.post("/core/Login/DoLogin", data, function (res) { if (res.success == 1) { that.$message.success('登录成功'); // 获取 returnUrl const returnUrl = that.getReturnUrl(); if (returnUrl) { $.post("/www/dd/ai/user", function(userres){ const getAidData = { username: userres.Phone,uid: userres.ID }; // 调用接口获取 aid $.post("/www/dandiandenglu/dengluapi/aid", getAidData, function (aidRes) { console.log(aidRes); if (aidRes.code == 200) { const aid = aidRes.data.aid; // 构建跳转 URL,带上 aid const separator = returnUrl.includes('?') ? '&' : '?'; const redirectUrl = aid ? `${returnUrl}${separator}aid=${encodeURIComponent(aid)}` : returnUrl; // 跳转到 returnUrl window.location.href = redirectUrl; // window.location.href = redirectUrl; } }) }) // const getAidData = { username: that.ruleForm.name }; } else { // 如果没有 returnUrl,可以跳转到默认页面 // that.$router.push('/home'); } } else { that.loading = false that.$message.warning(res.message); // 登录失败时自动刷新验证码 that.getCodeSrc(); // 清空验证码输入框 that.ruleForm.authcode = ''; } }) }).fail(function () { that.$message.error('请求失败') }) }, getCodeSrc() { this.codesrc = this.codesrc.replace(/\d+$/, parseInt(Math.random() * 10000)) }, }, created: function () { this.getCodeSrc() }, mounted: function () { const that = this; // 检查 localStorage 中是否有记住的用户信息 if (localStorage.getItem('rememberMe') === 'true') { this.ruleForm.name = localStorage.getItem('username'); // 解密密码 const encryptedPassword = localStorage.getItem('password'); const bytes = CryptoJS.AES.decrypt(encryptedPassword, 'quanguoxinlijiankang'); this.ruleForm.paw = bytes.toString(CryptoJS.enc.Utf8); this.ruleForm.rememberMe = true; } // 检查 $store.state.user 中是否有 Phone,如果有则自动获取 aid 并跳转 const user = that.$store.state.user; if (user && user.Phone) { const returnUrl = that.getReturnUrl(); if (returnUrl) { const getAidData = { username: user.Phone,uid: user.ID }; // const getAidData = { username: user.Phone }; // 调用接口获取 aid $.post("/www/dandiandenglu/dengluapi/aid", getAidData, function (aidRes) { if (aidRes.code == 200) { const aid = aidRes.data.aid; // 构建跳转 URL,带上 aid const separator = returnUrl.includes('?') ? '&' : '?'; const redirectUrl = aid ? `${returnUrl}${separator}aid=${encodeURIComponent(aid)}` : returnUrl; // 自动跳转到 returnUrl window.location.href = redirectUrl; } }) } } }, store: store, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-bgAuth-view", function(resolve, reject){ var template = "
\n \n
\n
\n \n \n \n \n \n \n \n \n 查询\n 全部授权\n 取消全部授权\n 所选授权\n 取消所选授权\n 所选下载\n
\n
\n 一次最多勾选下载五十个文件\n
\n\n \n \n \n \n \n \n \n \n\n
\n \n \n
\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { tableData: [], total: 0, pages: { pageNo: 1, pageSize: 10 }, search: { xm: '', qxid: '', sfsq: '' }, qxOptions: [], selectedIds: [], downloadLoading: false, canAuth: false, canAuths: false, } }, computed: { pageTitle() { var type = this.$route.query.type; var canAuth = this.canAuth; if (type == '1') { return canAuth ? '县级报告下载与授权' : '县级报告下载'; } if (type == '2') { return canAuth ? '校级报告下载与授权' : '校级报告下载'; } if (type == '3') { return canAuth ? '市级报告权限授权' : '市级报告下载'; } return canAuth ? '报告下载与授权' : '报告下载'; } }, methods: { checkSelectable(row) { return String(row.sfkqbg) !== '0'; }, formatSq(row){ return row && String(row.sfsq)==='1' ? '已授权' : '未授权' }, downloadRow(row){ var that = this if(!row || !row.id){ this.$message.error('缺少ID'); return } var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1'; var isProvincial = user.Roles && (user.Roles.includes('651') || user.Roles.includes('654')); // 只有省级用户且在县级报告下载与授权(type=1)页面时,才使用新接口 // 651在type=3(市级)时,或者654在type=1(县级)时,也可能需要用jyj接口? // 根据之前的逻辑,651查看县级用downloadjyjdxzip。 // 假设市级(654)查看县级(1)也用downloadjyjdxzip // 假设省级(651)查看市级(3)也用downloadjyjdxzip var url = '/www/public/baogao/downloadzip'; if (isProvincial) { if (type === '1' || type === '3') { url = '/www/public/baogao/downloadjyjdxzip'; } } axios({ method: 'GET', url: url, params: { ids:JSON.stringify([row.id]) }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; var suffix = '_报告.zip'; if (type === '1') suffix = '县级_报告.zip'; if (type === '2') suffix = '学校_报告.zip'; if (type === '3') suffix = '市级_报告.zip'; aLink.setAttribute('download', (row.mc||'报告') + suffix); document.body.appendChild(aLink); aLink.click(); document.body.removeChild(aLink); that.$message.success('下载成功') }else{ that.$message.error('下载失败') } }).catch(err=>{ that.$message.error('下载失败') }) }, authorizeRow(row){ var that = this if(!row || !row.id){ this.$message.error('缺少ID'); return } var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1' var is651 = user.Roles && user.Roles.includes('651'); // 授权角色ID映射 var roles = '652'; // default county var authType = 2; // 默认 type=2 (部分授权) if (type === '1') { roles = '652'; } if (type === '2') roles = '653'; if (type === '3') roles = '654'; this.$confirm('是否确认授权?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) .then(function(){ const params = { userid: user.ID, type: 2, ids: JSON.stringify([row.id]), roles: roles } $.post('/www/public/baogao/bgsq', params, function(res){ if(res.success==1 || res.error==0){ that.$message.success('授权成功') that.fetchList() }else{ that.$message.error(res.message || '授权失败') } }).fail(function(){ that.$message.error('请求失败') }) }).catch(function(){}) }, noAuthorizeRow(row){ var that = this if(!row || !row.id){ this.$message.error('缺少ID'); return } var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1' var is651 = user.Roles && user.Roles.includes('651'); // 授权角色ID映射 var roles = '652'; // default county var authType = 2; // 默认 type=2 (部分授权) if (type === '1') { roles = '652'; } if (type === '2') roles = '653'; if (type === '3') roles = '654'; this.$confirm('是否确认取消授权?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) .then(function(){ const params = { userid: user.ID, type: 2, ids: JSON.stringify([row.id]), roles: roles } $.post('/www/public/baogao/bgqxsq', params, function(res){ if(res.success==1 || res.error==0){ that.$message.success('取消授权成功') that.fetchList() }else{ that.$message.error(res.message || '取消授权失败') } }).fail(function(){ that.$message.error('请求失败') }) }).catch(function(){}) }, handleSizeChange(size){ this.pages.pageSize = size this.pages.pageNo = 1 this.fetchList() }, handleCurrentChange(page){ this.pages.pageNo = page this.fetchList() }, handleSelectionChange(rows){ this.selectedIds = (rows || []).map(r => r.id).filter(Boolean) }, fetchQxList(){ var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} $.get('/www/public/baogao/findqxList', { userid: user.ID }, function(res){ if(res.success==1 || res.error==0){ that.qxOptions = res.data || [] } }) }, fetchList(){ var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1' const params = { pageNo: this.pages.pageNo, pageSize: this.pages.pageSize, type: type, xm: this.search.xm, qxid: this.search.qxid, sfsq: this.search.sfsq } $.get('/www/public/baogao/findxxbglist', params, function(res){ if(res.success==1 || res.error==0){ that.tableData = res.data || [] that.total = res.total || (res.data ? res.data.length : 0) }else{ that.$message.error(res.message || '请求失败') } }).fail(function(){ that.$message.error('请求失败') }) }, authorizeAll(){ var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1' var is651 = user.Roles && user.Roles.includes('651'); var roles = '652'; var authType = 1; // 默认 type=1 (全部授权) if (type === '1') { roles = '652'; if (is651) authType = 1; } if (type === '2') { roles = '653'; authType = 3; } if (type === '3') roles = '654'; this.$confirm('是否确认全部授权?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) .then(function(){ const params = { userid: user.ID, type: authType, roles: roles } $.post('/www/public/baogao/bgsq', params, function(res){ if(res.success==1 || res.error==0){ that.$message.success('授权成功') that.fetchList() }else{ that.$message.error(res.message || '授权失败') } }).fail(function(){ that.$message.error('请求失败') }) }).catch(function(){}) }, noAuthorizeAll(){ var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1' var is651 = user.Roles && user.Roles.includes('651'); var roles = '652'; var authType = 1; // 默认 type=1 (全部授权) if (type === '1') { roles = '652'; if (is651) authType = 1; } if (type === '2') { roles = '653'; authType = 3; } if (type === '3') roles = '654'; this.$confirm('是否确认取消全部授权?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) .then(function(){ const params = { userid: user.ID, type: authType, roles: roles } $.post('/www/public/baogao/bgqxsq', params, function(res){ if(res.success==1 || res.error==0){ that.$message.success('取消授权成功') that.fetchList() }else{ that.$message.error(res.message || '取消授权失败') } }).fail(function(){ that.$message.error('请求失败') }) }).catch(function(){}) }, authorizeSelected(){ var that = this if(!this.selectedIds.length){ this.$message.warning('请先选择需要授权的项'); return } var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1' var is651 = user.Roles && user.Roles.includes('651'); var roles = '652'; var authType = 2; // 默认 type=2 (部分授权) if (type === '1') { roles = '652'; } if (type === '2') { roles = '653'; authType = (user.Roles && user.Roles.includes('652')) ? 2 : 3; } if (type === '3') roles = '654'; this.$confirm('是否确认授权所选?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) .then(function(){ const params = { userid: user.ID, type: authType, ids: JSON.stringify(that.selectedIds), roles: roles } $.post('/www/public/baogao/bgsq', params, function(res){ if(res.success==1 || res.error==0){ that.$message.success('授权成功') that.fetchList() }else{ that.$message.error(res.message || '授权失败') } }).fail(function(){ that.$message.error('请求失败') }) }).catch(function(){}) }, noAuthorizeSelected(){ var that = this if(!this.selectedIds.length){ this.$message.warning('请先选择需要取消授权的项'); return } var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1' var is651 = user.Roles && user.Roles.includes('651'); var roles = '652'; var authType = 2; // 默认 type=2 (部分授权) if (type === '1') { roles = '652'; } if (type === '2') { roles = '653'; authType = (user.Roles && user.Roles.includes('652')) ? 2 : 3; } if (type === '3') roles = '654'; this.$confirm('是否确认取消所选授权?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) .then(function(){ const params = { userid: user.ID, type: authType, ids: JSON.stringify(that.selectedIds), roles: roles } $.post('/www/public/baogao/bgqxsq', params, function(res){ if(res.success==1 || res.error==0){ that.$message.success('取消授权成功') that.fetchList() }else{ that.$message.error(res.message || '取消授权失败') } }).fail(function(){ that.$message.error('请求失败') }) }).catch(function(){}) }, downloadSelected(){ var that = this if(!that.selectedIds.length){ that.$message.warning('请先选择需要下载的项'); return } if(that.selectedIds.length>50){ that.$message.warning('一次最多选择50个'); return } var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1'; var isProvincial = user.Roles && user.Roles.includes('651'); var isMunicipal = user.Roles && user.Roles.includes('654'); var url = '/www/public/baogao/downloadzip'; // 默认接口 if (isProvincial && type === '1') { url = '/www/public/baogao/downloadjyjdxzip'; // 省级用户下县级报告 } else if (isMunicipal && type === '1') { url = '/www/public/baogao/downloadzipjyj'; } this.$confirm('下载可能需要较长时间,请耐心等待,是否继续?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'info' }).then(() => { that.downloadLoading = true axios({ method: 'GET', url: url, params: { ids: JSON.stringify(that.selectedIds) }, responseType: 'blob' }).then(res=>{ that.downloadLoading = false if(res.request.status==200){ let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; var fileName = type === '1' ? '县级报告.zip' : '学校报告.zip'; aLink.setAttribute('download', fileName); document.body.appendChild(aLink); aLink.click(); document.body.removeChild(aLink); that.$message.success('下载成功') }else{ that.$message.error('下载失败') } }).catch(err=>{ that.downloadLoading = false that.$message.error('下载失败') }) }).catch(() => { // 取消下载 }); } }, created: function(){ var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var type = this.$route.query.type || '1'; var is651 = user.Roles && user.Roles.includes('651'); var is654 = user.Roles && user.Roles.includes('654'); var is652 = user.Roles && user.Roles.includes('652'); this.canAuth = false; this.canAuths = false; if (is651) { // 省级: // type 1 (县级): 授权 (传 type: 3) // type 2 (校级): 仅下载,隐藏授权操作 + 筛选区县 // type 3 (市级): 授权 if (type == '1' || type == '3') this.canAuth = true; if (type == '2') { this.canAuth = false; this.canAuths = true; } } if (is654) { // 市级: // type 1 (县级): 授权 (因为管理县) // type 2 (校级): 仅查询/下载 + 筛选区县 (不能授权学校,由县级授权) if (type == '1') this.canAuth = true; if (type == '2') { this.canAuth = false; // 不授权学校 this.canAuths = true; // 需筛选区县 } } if (is652 && type == '2') { this.canAuth = true; } if(this.canAuths){ this.fetchQxList() } this.fetchList() } }) }) })(template, resolve, reject); }); RegVueCom("xljk-cksdcl-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n \n \n \n \n \n 查询\n \n
\n\n \n \n \n \n \n \n \n \n \n\n \n
\n \n \n
\n
\n
\n
"; return (function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { tableData: [], total: 0, pages: { pageNo: 1, pageSize: 10 }, search: { jgmc: '', sftj: '' }, }; }, methods: { formatStatus(row, col, val){ if(row && row.zlid){ return '已提交'; } return '未提交'; }, handleSizeChange(size){ this.pages.pageSize = size; this.pages.pageNo = 1; this.fetchList(); }, handleCurrentChange(page){ this.pages.pageNo = page; this.fetchList(); }, resetFilters(){ this.search = { jyjmc: '', status: '' }; this.fetchList(); }, // 获取列表(预留接口) fetchList(){ var that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; const params = { pageNo: this.pages.pageNo, pageSize: this.pages.pageSize, code: code, jgmc: this.search.jgmc, sftj: this.search.sftj }; $.get('/www/public/bd/sdyzllist', params, function(res){ if(res.success==1 || res.error==0){ that.tableData = res.data || []; that.total = res.total || (res.data ? res.data.length : 0); }else{ that.$message.error(res.message || '请求失败'); } }).fail(function(){ that.$message.error('请求失败'); }); }, // 下载视导员资料(按blob下载,id为userid) downloadMaterial(row){ var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var id = row.id || ''; if(!id){ this.$message.error('缺少资料ID'); return; } var name = row.filename || (row.xm ? (row.xm + '资料.zip') : '视导员资料.zip'); axios({ method: 'get', url: '/www/public/bd/downloadsdyzl', params: { id }, responseType: 'blob' }).then(res => { if(res.request && res.request.status == 200){ let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); document.body.appendChild(aLink); aLink.click(); document.body.removeChild(aLink); this.$message.success('下载成功'); }else{ this.$message.error('下载失败'); } }).catch(err => { this.$message.error('下载失败'); }); }, // 短信督办(预留接口) sendSms(row){ var that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) .then(function(){ $.post('/www/public/bd/sdyzldb', { userid: row.id }, function(res){ if(res.success==1 || res.error==0){ that.$message.success('发送成功'); }else{ that.$message.error(res.message || '发送失败'); } }).fail(function(){ that.$message.error('请求失败'); }); }).catch(function(){}); } }, created: function(){ this.fetchList(); } }); }); })(template, resolve, reject); }); RegVueCom("xljk-scsdcl-view", function(resolve, reject){ var template = "
\n \n
\n
\n
视导资料上传要求:
\n
请上传汇总后的本级派出的视导员提交的材料,包含视导工作手册中工作用表的扫描件,以及测试现场照片。
\n
\n\n
\n
材料上传:
\n
\n \n
\n \n
{{ zipFile.name }}
\n 下载\n 重新上传\n
\n\n \n \n
\n \n
\n \n
\n
限制上传1个压缩包文件,支持rar、zip格式,大小不超过50M
\n
\n
\n
\n
"; return (function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { userid: '', uploadType: '', editId: '', uploadData: {}, zipFile: null, uploadLoading: false }; }, methods: { // 初始化用户与上传附加参数 initUser: function(){ var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; this.userid = user.ID; var type = ''; if(user.Roles && user.Roles.includes('220')){ // 省级 type = '1'; }else if(user.Roles && user.Roles.includes('310')){ // 市级 type = '2'; }else if(user.Roles && user.Roles.includes('410')){ // 区县级 type = '3'; } this.uploadType = type; this.editId = (this.$route && this.$route.query && this.$route.query.id) ? this.$route.query.id : ''; this.uploadData = { userid: this.userid, type: this.uploadType }; if(this.editId){ this.uploadData.id = this.editId; } }, // 读取已上传文件(回显接口) getUploaded() { var that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; that.userid = user.ID; const params = { userid: user.ID }; $.get('/www/public/bd/sdyzlfind', params, function(res){ if(res.success==1 || res.error==0){ if(res.data){ that.zipFile = { name: res.data.filename, id: res.data.id }; if(res.data.id){ that.editId = res.data.id; that.uploadData.id = res.data.id; } }else{ that.zipFile = null; } }else{ that.$message.error(res.message || '获取失败'); } }).fail((xhr,status,error)=>{ that.$message.error('请求失败'); }); }, // 上传前校验(zip/rar + 50MB) beforeUpload(file) { const name = (file.name || '').toLowerCase(); const isAllowed = name.endsWith('.zip') || name.endsWith('.rar') || name.endsWith('.7z'); const isLt50M = file.size / 1024 / 1024 < 50; if(!isAllowed){ this.$message.error('仅支持上传 .zip/.rar/.7z 压缩包'); return false; } if(!isLt50M){ this.$message.error('文件大小不能超过50MB'); return false; } return true; }, beforeUploadWithLoading(file){ if(this.uploadLoading){ this.$message.warning('正在上传,请稍候'); return false; } // 确保上传携带最新参数 this.uploadData = { userid: this.userid, type: this.uploadType }; if(this.editId){ this.uploadData.id = this.editId; } const pass = this.beforeUpload(file); if(pass){ this.uploadLoading = true; } return pass; }, handleUploadSuccess(res, file){ this.uploadLoading = false; if(res.success==1 || res.error==0){ this.zipFile = { name: file.name, url: res.data && res.data.url, id: res.data && (res.data.id || res.data.materialId) }; if(this.zipFile && this.zipFile.id){ this.editId = this.zipFile.id; this.uploadData.id = this.zipFile.id; } this.$message.success('上传成功'); // 回显刷新(可选) setTimeout(()=>this.getUploaded(), 300); }else{ this.$message.error(res.message || '上传失败'); } }, handleUploadError(){ this.uploadLoading = false; this.$message.error('上传失败,请重试'); }, // 下载视导员资料(按blob下载,id为userid) downloadFile: function(){ var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var id = this.userid || user.ID || ''; var name = (this.zipFile && this.zipFile.name) || '视导员资料.zip'; axios({ method: 'get', url: '/www/public/bd/downloadsdyzl', params: { id }, responseType: 'blob' }).then(res => { if(res.request && res.request.status == 200){ let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); document.body.appendChild(aLink); aLink.click(); document.body.removeChild(aLink); this.$message.success('下载成功'); }else{ this.$message.error('下载失败'); } }).catch(err => { this.$message.error('下载失败'); }); }, handleRemoveFile(){ this.zipFile = null; this.$nextTick(()=>{ const u = this.$refs.zipUpload; if(u) u.clearFiles(); }); this.$message.info('已移除文件'); } }, created: function(){ this.initUser(); this.getUploaded(); } }); }); })(template, resolve, reject); }); RegVueCom("xljk-ckybxsjapb-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n \n \n \n 查询\n
\n \n\n \n \n \n \n \n \n \n\n \n\n \n
\n \n \n
\n \n \n
\n \n \n\n \n\n \n\n \n
\n \n 关闭\n \n
\n
\n\n\n
\n
"; return (function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { user: {}, events: [], // 应急事件数据 currentPage: 1, // 当前页码 pageSize: 10, // 每页条数 total: 0, // 总条数 search: { xxmc: '', xd: '', sfxssjapwc: '' }, detailDialogVisible: false, detailRole: '450', // 默认为学校角色 detailData: { gk: '', bz: '', ya: '', zzfg: '' } }; }, methods: { handleTabChange() { this.handleCurrentChange(1) }, allsend(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 2, userid: user.ID } $.post("/www/public/bd/sendyjdcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, sendSms(row){ var that = this this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 2, userid: row.id // 学校id } $.post("/www/public/bd/senddcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, listDown(){ var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; // 学校数据导出 const params = { code: code, xxmc: this.search.xxmc, xd: this.search.xd, sftj: this.search.sftj }; const url = '/www/public/bd/ssgzfajdlisExport'; axios({ method: 'post', url: url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download','表格信息.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, formatXd(row, column, cellValue) { const xdMap = { 1: '小学', 2: '初中', 3: '高中', 4: '中职', 5: '高职', 6: '高校' }; return xdMap[cellValue] || ''; }, formatSftj(row, column, cellValue) { const sftjMap = { 2: '已提交', 1: '未提交', 0: '未提交', null: '未提交', }; // 如果是教育局数据,根据faid字段判断是否提交 if (this.activeName !== '1') { return row.faid ? '已提交' : '未提交'; } return sftjMap[cellValue] || ''; }, fetchEvents() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; let params = { pageNo: this.currentPage, pageSize: this.pageSize, code: code, xxmc: this.search.xxmc, xd: this.search.xd, sfxssjapwc: this.search.sfxssjapwc }; // 调用查询接口 $.get("/www/public/sdy/sdydzgxxlb",params , function(res) { if (res.error == 0) { that.events = res.data; that.total = res.total; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleSizeChange(size) { this.pageSize = size; this.currentPage = 1; this.fetchEvents(); }, // 改变当前页 handleCurrentChange(page) { this.currentPage = page; this.fetchEvents(); }, // 查看详情 viewDetail(row) { const that = this; // 教育局和学校使用相同的查看详情接口 let url = "/www/public/sdy/dsydybxssfaxq"; // 统一使用xxid字段查询详情 $.get(url, {xxid: row.id}, function(res) { if (res.error == 0) { that.detailData = { gk: res.data.gk || '', bz: res.data.bz || '', ya: res.data.ya || '', zzfg: res.data.zzfg || '' }; // 根据角色设置详情显示类型 if (that.activeName === '1') { // 学校数据,默认为450角色 that.detailRole = '450'; } else { // 教育局数据,根据roles字段判断 that.detailRole = row.roles || '410'; } that.detailDialogVisible = true; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, }, created: function() { this.user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; this.fetchEvents(); } }); }); } /** function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { dataInfo: [], // 应急事件数据 }; }, methods: { fetchData() { const that = this; let params = {}; // 调用查询接口 $.get("/www/public/sdy/sdydzgxxlb",params , function(res) { if (res.error == 0) { res.data.ya = res.data.ya.replaceAll('\n', '
') that.dataInfo = res.data; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, fetchDataDetail() { const that = this; let params = {}; // 调用查询接口 $.get("/www/public/sdy/dsydybxssfaxq",params , function(res) { if (res.error == 0) { res.data.ya = res.data.ya.replaceAll('\n', '
') that.dataInfo = res.data; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); } }, created: function() { this.fetchDataDetail(); } }); }); } */)(template, resolve, reject); }); RegVueCom("xljk-AIMonitoringAssistant", function(resolve, reject){ var template = "\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid() }; }, methods: { }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-dcccxkzczygfpx-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n 查询\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n\n\n
\n \n\n
\n
\n

签到表照片

\n \n \n
\n
\n

现场照片

\n \n \n
\n
\n \n 关闭\n \n
\n
\n\n\n
\n
"; return (function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { events: [], // 应急事件数据 currentPage: 1, // 当前页码 pageSize: 10, // 每页条数 total: 0, // 总条数 search: { xxmc: '', xd: '', sfqdb: '', sfhy: '' }, detailDialogVisible: false, detailData: { qdbimg: '', hyimg: '' } }; }, methods: { allsend(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 4, userid: user.ID } $.post("/www/public/bd/sendyjdcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, sendSms(row){ var that = this this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 4, userid: row.id // 学校id } $.post("/www/public/bd/senddcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, down(){ var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; let params = { code: code, xxmc: this.search.xxmc, xd: this.search.xd, sfqdb: this.search.sfqdb, sfhy: this.search.sfhy }; /*const params = { //zgdwbm:user.ID, shzt:that.activeName=='first'?'0':this.activeName=='second'?'1':'-1', type, username:user.Username }*/ axios({ method: 'get', url:'/www/public/bd/hysclistexport', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download','表格信息.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, formatXd(row, column, cellValue) { const xdMap = { 1: '小学', 2: '初中', 3: '高中', 4: '中职', 5: '高职', 6: '高校' }; return xdMap[cellValue] || ''; }, fetchEvents() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; let params = { pageNo: this.currentPage, pageSize: this.pageSize, code: code, xxmc: this.search.xxmc, xd: this.search.xd, sfqdb: this.search.sfqdb, sfhy: this.search.sfhy }; // 调用查询接口 $.get("/www/public/sdy/sdydzgxxlb",params , function(res) { if (res.error == 0) { that.events = res.data; that.total = res.total; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleSizeChange(size) { this.pageSize = size; this.currentPage = 1; this.fetchEvents(); }, // 改变当前页 handleCurrentChange(page) { this.currentPage = page; this.fetchEvents(); }, // 查看详情 viewDetail(row) { let qdbimgUrl = ''; if (row.qdbimg) { qdbimgUrl = '/www/public/bd/hyimghx?id=' + row.hyid + '&type=2'; } let hyimgUrl = ''; if (row.hyimg) { hyimgUrl = '/www/public/bd/hyimghx?id=' + row.hyid + '&type=1'; } this.detailData = { qdbimg: qdbimgUrl, hyimg: hyimgUrl }; this.detailDialogVisible = true; } }, created: function() { this.fetchEvents(); } }); }); })(template, resolve, reject); }); RegVueCom("xljk-ckgzzlxr-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n 搜索\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n
\n \n \n
\n
\n\n \n \n
\n \n \n 搜索\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n
\n \n \n
\n
\n
\n
\n
\n
\n
"; return (function(template, resolve, reject) { seajs.use([], function() { resolve({ template: template, data: function() { return { activeName: 'first', tableData: [], total: 0, pages: { pageNo: 1, pageSize: 10 }, // 学校标签页数据 qybmlist: [], qybm: '', xd: '', xxmc: '', // 教育局标签页数据 sssjxzq: '', // 区域选择器数据 selectList: [] } }, methods: { // 切换标签页 changeTab: function() { this.pages.pageNo = 1; this.tableData = []; this.total = 0; this.qybm = ''; this.qybmlist = []; if (this.activeName === 'first') { // 切换到学校标签页 this.xd = ''; this.xxmc = ''; } else { // 切换到教育局标签页 this.sssjxzq = ''; } this.getList(); }, // 获取区域编码 getqybm: function() { if (this.qybmlist && this.qybmlist.length > 0) { this.qybm = this.qybmlist[this.qybmlist.length - 1]; } else { this.qybm = ''; } this.changegetList(); }, // 搜索条件变更时重新获取数据 changegetList: function() { this.pages.pageNo = 1; this.getList(); }, // 获取数据列表 getList: function() { var that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; // 构建请求参数 const params = { userid: user.ID, pageNo: this.pages.pageNo, pageSize: this.pages.pageSize }; // 添加区域编码参数 if (this.qybm) { params.qybm = this.qybm; } let apiUrl = ''; if (this.activeName === 'first') { // 学校标签页 apiUrl = '/www/public/sdy/sdydckgzzlxrxx'; // 添加学校标签页特有参数 if (this.xd) { params.xd = this.xd; } if (this.xxmc) { params.xxmc = this.xxmc; } } else { // 教育局标签页 apiUrl = '/www/public/sdy/sdydckgzzlxrjyt'; // 添加教育局标签页特有参数 if (this.sssjxzq) { params.sssjxzq = this.sssjxzq; } } // 发送请求获取数据 $.get(apiUrl, params, function(res) { if (res.success == 1 || res.error == 0) { that.tableData = res.data || []; that.total = res.total || 0; } else { that.$message.error(res.message || '获取数据失败'); } }).fail(function(xhr, status, error) { that.$message.error('请求失败'); }); }, // 获取区域选择器数据 getSelectList: function() { var that = this; $.post("/www/public/shouye/cxy_ssqxldcx", {}, function(res) { if (res.error == 0) { that.selectList = res.data; } else { that.$message.error(res.message || '获取区域数据失败'); } }).fail(function(xhr, status, error) { that.$message.error('请求失败'); }); }, // 分页大小变更 handleSizeChange: function(val) { this.pages.pageSize = val; this.getList(); }, // 页码变更 handleCurrentChange: function(val) { this.pages.pageNo = val; this.getList(); } }, created: function() { // 获取区域选择器数据 this.getSelectList(); }, mounted: function() { // 获取数据列表 this.getList(); } }); }); })(template, resolve, reject); }); RegVueCom("xljk-ckxsdw-view", function(resolve, reject){ var template = "
\n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 重置\n 一键督办还未提交的直管校\n
\n \n \n\n \n
\n
\n
\n \n \n

\n 1\n

\n
\n 学校基本信息审核\n
\n
\n
\n \n \n

\n 2\n

\n
\n 年级班级人数信息审核\n
\n \n \n
\n
\n
\n
\n \n \n

\n 1\n

\n
\n 学校基本信息审核\n
\n
\n
\n \n \n

\n 2\n

\n
\n 专业班级人数\n
\n
\n
\n \n \n

\n 3\n

\n
\t\n 心理教师信息\n
\n \n
\n
\n

\n 审核内容:学校基本信息是否准确。\n

\n \n \n \n

*学校阶段

\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n

*区县名称

\n \n \n \n
\n \n

*学校名称

\n \n \n \n
\n\n \n \n

*主管单位

\n \n \n \n
\n\n\n \n\n \n\n \n

*学制

\n \n \n \n \n \n
\n \n

培养层次

\n \n \n \n \n \n \n \n \n
\n \n \n

*学校类别

\n \n \n \n \n \n \n \n
\n \n

*办学性质

\n \n \n \n \n \n \n
\n\n \n \n

*校心理健康中心教师人数

\n \n \n \n
\n \n

*办学类型

\n \n \n \n \n \n \n \n \n
\n\n \n

*举办者类型

\n \n \n \n \n \n \n \n \n \n \n
\n \n \n\n \n \n

*学校地理位置

\n \n \n \n
\n \n \n

*学校负责人问卷填写人姓名

\n \n \n \n
\n
\n \n \n \n

*申请参与试点访谈

\n \n \n \n \n \n

\n
\n
\n\n
\n
\n
\n 下 一 步\n
\n
\n\n
\n \n
\n 上一步\n 下一步\n
\n
\n\n \n
\n \n
\n 上一步\n 审核\n
\n
\n\n
\n \n \n \n
\n 上一步\n 审核\n
\n
\n \n \n
\n \n \n
\n \n \n \n

*学校基本信息是否正确

\n \n \n \n \n \n

\n
\n
\n \n

*机房施测环境是否达标

\n \n \n \n \n \n

\n
\n
\n \n

*年级班级/专业人数信息是否齐全准确

\n \n \n \n \n \n

\n
\n
\n \n

*老师信息是否齐全准确

\n \n \n \n \n \n

\n
\n
\n
\n

审核意见

\n \n \n \n\n\n\n\n\n
\n
\n 确定\n
\n
\n
\n \n \n
\n \n \n \n

机房数量

\n \n \n \n
\n \n

电脑数量

\n \n \n \n
\n \n

是否联网

\n \n \n \n \n \n \n
\n \n

下行带宽

\n \n \n mbps\n \n
\n \n

上行带宽

\n \n \n mbps\n \n
\n \n

操作系统

\n \n \n \n
\n \n

浏览器名称

\n \n \n \n
\n \n

是否云电脑

\n \n \n \n \n \n \n
\n \n

是否能容纳最大班额

\n \n \n \n \n \n \n
\n \n

不能满足最大班额是否有解决办法

\n \n \n \n \n \n \n
\n \n

是否能打开测试平台

\n \n \n \n \n \n \n
\n \n

本校机房条件能否参加在线问卷测试

\n \n \n \n \n \n \n
\n
\n
\n
\n 关闭\n
\n
\n
\n\n \n \n
\n

不参测原因

\n \n
\n 提交\n 取消\n
\n
\n
\n\n \n \n
\n \n \n \n \n
\n 关闭\n
\n
\n
\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), totalstep:4, xxjd:'', currentRow:{}, isyijingshenhe:false, form: { jfsl: '', dnsl: '', sflw: '', xxdk: '', czxt: '', llqmc: '', sfydn: '', sfrnzdbe:'', sfyjjbf:'', sfyjpzdb:'', sfgxdzxbb:'', sfwlsdmzyq:'', sfndkpt:'', sfncjwjdc:'', }, user:'', userProvinceCode: '', // 用户所在省份的区域编码 xxxzOption:[ { value:'3', label:'五四制', usefor:['1','2'] }, { value:'4', label:'六三制', usefor:['1','2'] }, { value:'1', label:'三年制', usefor:['4'] }, { value:'5', label:'五年制', usefor:['4'] }, { value:'10', label:'其他', usefor:['4'] }, ], reruleForm:{ sfmc:'', qxmc:'', djsmc:'', xxmc:'', xxbm:'', zgdwbm:'', xd:'', xz:'', bxxz:'', sckssj:'', scjssj:'', dlwz:'', bxlx:'', jbzlx:'', pycc:[], jbzlx:'', xxlx:'', issdf:undefined,issmcy:undefined, }, ruleForm: { sfmc:'', qxmc:'', djsmc:'', xxmc:'', xxbm:'', zgdwbm:'', xd:'', xz:'', bxxz:'', sckssj:'', scjssj:'', xxwz:'', bxlx:'', jbzlx:'', pycc:[], jbzlx:'', xxlx:'', issdf:undefined,issmcy:undefined, }, step:1, formLabelWidth: '0px', rules: { jfsl: [{ required: true, message: '机房数量不能为空', trigger: 'blur' }], dnsl: [{ required: true, message: '电脑数量不能为空', trigger: 'blur' }], sflw: [{ required: true, message: '是否联网不能为空', trigger: 'change' }], xxdk: [{ required: true, message: '下行带宽不能为空', trigger: 'blur' }], czxt: [{ required: true, message: '操作系统不能为空', trigger: 'blur' }], llqmc: [{ required: true, message: '浏览器名称不能为空', trigger: 'blur' }], sfydn: [{ required: true, message: '是否云电脑不能为空', trigger: 'change' }], xm: [ { required: true, message: '请输入学生姓名', trigger: 'blur' } ], }, loading:false, dialogVisible: false, tableData: [], multipleSelection: [], currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4, innerVisible:false, curSchoolid:'', // Tabs 与查询 activeName:'zgxx', searchPlaceholder:'请输入学校名称', searchVal:'', // 列表数据 tableDataZg:[], tableDataJyj:[], tableDataQs:[], // 分页 totalZg:0, totalJyj:0, totalQs:0, pagesZg:{ pageNo:1, pageSize:10 }, pagesJyj:{ pageNo:1, pageSize:10 }, pagesQs:{ pageNo:1, pageSize:10 }, // 全省/全市学校标签控制 hasAllSchoolsAccess: false, allSchoolsTabLabel: '全省学校', xdMap:['','小学','初中','高中','中职','高职','高校',], // 旧的 total/pages 保留但不再使用 total:0, pages:{ pageNo:1, pageSize:5 }, reruleForm: { sfmc:'',djsmc:'',qxmc:'',xxmc:'',xd:'',wxzh:'' }, ruleForm: { sfmc:'',djsmc:'',qxmc:'',xxmc:'',xd:'',wxzh:'' }, shenherules:{ sfxxjbxxzq: [{ required: true, message: '请选择学校基本信息是否正确', trigger: 'blur' }], sfschjdb: [{ required: true, message: '请选择施测环境是否达标', trigger: 'blur' }], sfrsxxzq: [{ required: true, message: '请选择年级班级/专业人数信息是否齐全', trigger: 'blur' }], sflsxxzq: [{ required: true, message: '请选择教师信息是否齐全', trigger: 'blur' }], }, reshenheForm:{ shbtgyy:'', sfschjdb:'', sfxxjbxxzq:'', sfrsxxzq:'', sflsxxzq:'', }, shenheForm:{ shbtgyy:'', sfschjdb:'', sfxxjbxxzq:'', sfrsxxzq:'', sflsxxzq:'', }, user:null, fangtanxinxiFormrules:{}, fangtanxinxiForm:{ wxzh:'', zzxlcnt:0, jzxlcnt:0, zxzzcnt:0, jygzinfo:'', wjgyinfo:'', xlpxinfo:'', isxlroom:'', roomcnt :'' }, isEdit:false, // 当前选择行及弹窗相关 curId: '', currentRow: {}, // 不参测设置相关 noParticipateForm:{ reason:'' }, noParticipateRow:null, // 地区与学段筛选(源自 dataListTable15.html) selectList:[], qybmlist:[], // 工作组详情 workGroupList:[], workGroupLoading:false, workGroupRow:null, searchForm: { shzt: '', xd: '' } } }, methods:{ htEdit(row){ const that =this console.log(row) this.$confirm('是否确认回退?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { shzt:'1', xxid:row.id, xxmc:row.xxmc } $.post("/www/public/shouye/cxy_ybxcx_update", data, function(res){ if(res.error==0){ that.getZgList() that. that.$message.success(res.message) }else{ that.$message.error(res.message) } }) }).catch(() => { }); }, allsend(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 1, userid: user.ID } $.post("/www/public/bd/sendyjdcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, sendSms(row){ var that = this this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 1, // 直管校审核 userid: row.id // 学校id } $.post("/www/public/bd/senddcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, clicktab(val){ var that = this that.step = val }, changeStep(val){ }, tongguo(){ this.shenhefn(this.curId,'2') }, butongguo(){ var that = this this.$refs.baseDialogshenhe.show() this.$nextTick(()=>{ that.$refs.shenheForm.resetFields() }) //this.shenhefn(this.curId,'-2') }, shenhefn(id,shzt){ var that = this let data ={ ...that.shenheForm, shzt, xxid: id, issmcy:'2' } $.post("/www/public/shangbao/editxxsh", data, function(res){ if(res.error==0){ that.$message.success(res.message) that.$refs.baseDialog1js.close() that.getZgList() if(shzt=='-2'){ that.$refs.baseDialogshenhe.close() } that.shenheForm = {...that.reshenheForm} }else{ that.$message.error(res.message) } }) }, nextStep(val){ this.step++ }, preStep(){ this.step-- }, search(){ if(this.activeName === 'zgxx'){ this.pagesZg.pageNo = 1 this.getZgList() } else if(this.activeName === 'qsxx'){ this.pagesQs.pageNo = 1 this.getQsList() } else { this.pagesJyj.pageNo = 1 this.getJyjList() } }, getComputerRoomInfo(id){ var that = this let data ={ xxid : id } $.get("/www/public/shangbao/findjfxx", data, function(res){ if(res.error==0){ if(res.data == null){ that.dataStatus = false }else{ that.form = res.data } }else{ that.$message.error(res.message) } }) }, // 机房信息接口复用 chongzhi(){ this.searchVal = '' if(this.activeName === 'zgxx'){ this.pagesZg = { pageNo:1, pageSize:10 } this.getZgList() } else if(this.activeName === 'qsxx'){ this.pagesQs = { pageNo:1, pageSize:10 } this.getQsList() } else { this.pagesJyj = { pageNo:1, pageSize:10 } this.getJyjList() } }, shenhecancel(){ this.$refs.baseDialog1js.close() }, getDetail(schoolid){ var that = this this.curSchoolid = schoolid const params = { xxid:schoolid, } $.get("/www/public/shangbao/get_school_info", params, function(res){ if(res.success==1){ that.ruleForm = res.data that.ruleForm.pycc = res.data.pycc?res.data.pycc.split(','):res.data.pycc that.fangtanxinxiForm = { wxzh:res.data.wxzh, zzxlcnt:res.data.zzxlcnt, jzxlcnt:res.data.jzxlcnt, zxzzcnt:res.data.zxzzcnt, jygzinfo:res.data.jygzinfo, wjgyinfo:res.data.wjgyinfo, xlpxinfo:res.data.xlpxinfo, isxlroom:res.data.isxlroom, roomcnt:res.data.roomcnt, } console.log(that.fangtanxinxiForm.pycc) }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{ this.$message.error('请求错误') }) }, changeTab(tab, event) { this.searchVal = '' if(this.activeName === 'zgxx'){ this.searchPlaceholder = '请输入学校名称' this.getZgList() }else if(this.activeName === 'qsxx'){ this.searchPlaceholder = '请输入学校名称' this.getQsList() }else{ this.searchPlaceholder = '请输入教育局名称' this.getJyjList() } }, // 补充学生学校审核相关方法 handleBCXSEdit(row){ this.curId = row.id this.currentRow = {...row} this.bcxsStatus = row.bcxsxh // 保存审核状态 // 直接显示学生列表弹窗 this.showStudentListDialog() }, // 打开师生信息(复用多步审核弹窗) viewTeacherStudentInfo(row){ this.handleEdit(row,false) // 标记当前是从全省/全市学校标签页打开的 this.isFromAllSchools = this.activeName === 'qsxx' }, handlebeforeClose(){ this.$emit('closeDialog') }, onError(){}, handleEdit(row,isyijingshenhe){ this.isyijingshenhe = isyijingshenhe this.step = 1 this.$refs.baseDialog1js.show() this.$nextTick(()=>{ //this.$refs.fangtanxinxiForm.resetFields() this.curId = row.id this.currentRow = {...row} this.getDetail(row.id) this.isEdit = true }) }, // 查看机房信息 viewComputerRoomInfo(row){ const id = row.id || row.xxid if(!id){ this.$message.error('缺少学校ID,无法查询机房信息') return } this.getComputerRoomInfo(id) this.$refs.computerRoomDialog.show() }, // 设置不参测 openNoParticipate(row){ // 每次打开先重置表单,避免保留上次填写内容 this.resetNoParticipateForm() this.noParticipateRow = row // 仅保留原因输入,不再加载或使用区域数据 this.$refs.noParticipateDialog.show() }, // 取消不参测,关闭并重置 cancelNoParticipate(){ this.$refs.noParticipateDialog.close() this.resetNoParticipateForm() }, submitNoParticipate(){ const that = this const xxid = this.noParticipateRow ? (this.noParticipateRow.id || this.noParticipateRow.xxid) : '' const bccyy = (this.noParticipateForm.reason || '').trim() if(!xxid){ this.$message.error('缺少学校ID,无法提交不参测设置') return } if(!bccyy){ this.$message.warning('请填写不参测原因') return } const params = { xxid: xxid, bccyy: bccyy } $.post('/www/public/newcy/xxszwbcc', params, function(res){ if(res && (res.success==1 || res.error==0)){ that.$message.success(res.message || '设置不参测成功') that.$refs.noParticipateDialog.close() that.resetNoParticipateForm() // 刷新列表 if(typeof that.getZgList === 'function') that.getZgList() if(typeof that.getQsList === 'function') that.getQsList() }else{ that.$message.error(res.message || '设置不参测失败') } }).fail(function(){ that.$message.error('请求错误') }) }, // 重置不参测表单内容 resetNoParticipateForm(){ this.noParticipateForm = { reason:'' } }, // 教育局工作组详情 openWorkGroupDetail(row){ const that = this this.workGroupRow = row const xxid = row && (row.id || row.xxid) if(!xxid){ this.$message.error('缺少教育局ID,无法查询工作组详情') return } this.workGroupLoading = true this.workGroupList = [] this.$refs.workGroupDialog.show() $.get('/www/public/newcy/gzzlxrlb', { xxid: xxid }, function(res){ if(res && (res.success==1 || res.error==0)){ that.workGroupList = (res.data || []).map(function(item){ var sfllyVal = item.sflly var isLiaison = (sfllyVal === '1' || sfllyVal === 1 || sfllyVal === true) return Object.assign({}, item, { sflly: isLiaison ? '是' : '否' }) }) }else{ that.$message.error(res.message || '获取工作组详情失败') } that.workGroupLoading = false }).fail(function(){ that.$message.error('请求错误') that.workGroupLoading = false }) }, // 省市区选择已移除 // 加载区域树(来自 dataListTable15.html) getSelect(){ const that = this // 获取当前用户所在省份的区域编码(优先用当前行,其次用户信息) var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var userProv = user.UserFilter && user.UserFilter.qybm ? user.UserFilter.qybm.substring(0, 2) : (user.qybm ? String(user.qybm).substring(0,2) : ''); this.userProvinceCode = this.userProvinceCode || userProv; // 将省份编码作为参数,让后端尽量只返回该省份的数据 const params = {}; if (this.userProvinceCode) { params.sfbm = this.userProvinceCode; } $.post('/www/public/shouye/cxy_ssqxldcx', params, function(res){ if(res && res.error == 0){ const list = res.data || []; // 兜底:前端再次过滤,确保只保留当前省份 if (that.userProvinceCode) { that.selectList = list.filter(item => item.qybm && String(item.qybm).substring(0,2) === that.userProvinceCode) } else { that.selectList = list } } }) }, // 根据区域编码获取省市区名称 getAreaNames(code){ const result = { sfmc:'', djsmc:'', qxmc:'' } const list = this.selectList || [] if(!code || !list.length) return result const findPath = (nodes, target, path=[]) => { for(let i=0;i { if (valid) { var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.shenhefn(this.curId,'-2') } else { console.log('error submit!!'); return false; } }); }, submit(){ var that = this this.$refs['ruleForm'].validate((valid) => { if (valid) { const params = { xxmc:that.ruleForm.xxmc, xd:that.ruleForm.xd, schoolid:that.ruleForm.id, type:'0' } $.post("/www/public/shangbao/editschooldycsh", params, function(res){ if(res.success==1){ that.$message.success(res.message) that.$refs.baseDialog1js.close() that.getZgList() }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) } else { console.log('error submit!!'); return false; } }); }, // 新接口:全省/全市学校列表 getQsList(){ const that = this const params = { xxmc: this.searchVal, ...this.searchForm, pageNo: this.pagesQs.pageNo, pageSize: this.pagesQs.pageSize } $.get('/www/public/newcy/jyjdzgxxlb_qb', params, function(res){ if(res && (res.success==1 || res.error==0)){ that.tableDataQs = res.data || [] that.totalQs = res.total || (res.data ? res.data.length : 0) }else{ that.$message.error(res.message || '获取学校列表失败') that.tableDataQs = [] that.totalQs = 0 } }).fail(()=>{ that.$message.error('请求错误') }) }, // 分页(全省/全市学校) handleSizeChangeQs(val){ this.pagesQs.pageSize = val this.pagesQs.pageNo = 1 this.getQsList() }, handleCurrentChangeQs(val){ this.pagesQs.pageNo = val this.getQsList() }, // 新接口:直管学校列表 getZgList(){ const that = this const params = { xxmc: this.searchVal, ...this.searchForm, pageNo: this.pagesZg.pageNo, pageSize: this.pagesZg.pageSize } $.get('/www/public/newcy/jyjdzgxxlb', params, function(res){ if(res && (res.success==1 || res.error==0)){ that.tableDataZg = res.data || [] that.totalZg = res.total || (res.data ? res.data.length : 0) }else{ that.$message.error(res.message || '获取直管学校列表失败') that.tableDataZg = [] that.totalZg = 0 } }).fail(()=>{ that.$message.error('请求错误') }) }, // 新接口:下属教育局列表 getJyjList(){ const that = this const params = { sssjxzq: this.searchVal, pageNo: this.pagesJyj.pageNo, pageSize: this.pagesJyj.pageSize } $.get('/www/public/newcy/jyjdzgjyjlb', params, function(res){ if(res && (res.success==1 || res.error==0)){ that.tableDataJyj = res.data || [] that.totalJyj = res.total || (res.data ? res.data.length : 0) }else{ that.$message.error(res.message || '获取教育局列表失败') that.tableDataJyj = [] that.totalJyj = 0 } }).fail(()=>{ that.$message.error('请求错误') }) }, handleConfirm(){ this.$refs.baseDialogjs.close() }, // 分页(直管学校) handleSizeChangeZg(val){ this.pagesZg.pageSize = val this.pagesZg.pageNo = 1 this.getZgList() }, handleCurrentChangeZg(val){ this.pagesZg.pageNo = val this.getZgList() }, // 分页(教育局) handleSizeChangeJyj(val){ this.pagesJyj.pageSize = val this.pagesJyj.pageNo = 1 this.getJyjList() }, handleCurrentChangeJyj(val){ this.pagesJyj.pageNo = val this.getJyjList() }, // 行操作可见性 canViewJf(row){ const v = String(row.schjstu) return v === '1' }, canViewSs(row){ const v = String(row.xxxxsfsb) return v === '1' }, canSetNoParticipate(row){ const v = String(row.shzt) // 仅判断是否已是不参测状态 return v !== '-1' }, handleClick(){}, handleClose(){ console.log(1) this.dialogVisible = false }, toggleSelection(rows) { if (rows) { rows.forEach(row => { this.$refs.multipleTable.toggleRowSelection(row); }); } else { this.$refs.multipleTable.clearSelection(); } }, handleSelectionChange(val) { this.multipleSelection = val; } }, computed:{ isXCG(){ if(['1','2','3'].indexOf(this.ruleForm.xxjd)!=-1){ return true } return false }, workGroupColumns(){ return [ { prop:'xm', label:'姓名' }, { prop:'sjh', label:'手机号' }, { prop:'yx', label:'邮箱' }, { prop:'xb', label:'性别' }, { prop:'zw', label:'职务' }, { prop:'dw', label:'单位' }, { prop:'ovalue', label:'角色' }, { prop:'sflly', label:'是否联络员' }, ] } }, watch:{ "ruleForm.xxjd"(val){ if(['1','2','3'].indexOf(val)!=-1){ this.ruleForm.xh = '' }else{ this.ruleForm.xjh = '' } } }, created: function(){ this.user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.xxjd = localStorage.getItem('xxjd') // 获取当前用户所在省份的区域编码(前两位) if (this.user && this.user.UserFilter && this.user.UserFilter.qybm) { this.userProvinceCode = this.user.UserFilter.qybm.substring(0, 2) } // 检查用户角色,设置全省/全市学校标签访问权限 if (this.user && this.user.Roles) { if (this.user.Roles.includes('220')) { this.hasAllSchoolsAccess = true this.allSchoolsTabLabel = '全省学校' } else if (this.user.Roles.includes('310')) { this.hasAllSchoolsAccess = true this.allSchoolsTabLabel = '全市学校' } } // 预加载省市区数据供不参测弹窗使用 this.getSelect() // 默认加载直管学校列表 this.getZgList() if(['5','6'].includes(this.xxjd)){ this.totalstep = 3 }else{ this.totalstep = 2 } }, mounted: function(){ //this.$refs.baseDialog1js.show() }, props: ['title', 'data', 'config','disableStatus'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-classInfoUploadNew1-view", function(resolve, reject){ var template = "
\n \n
\n
\n
\n
\n \n 添加单个学生\n
\n
\n 查看班级名单\n 批量添加学生信息\n \n \n 查询\n
\n
\n
\n \n
\n \n
\n
\n \n \n {{ user.Nickname || '学校名称' }}\n \n
\n \n \n \n \n {{ node.label }}\n \n \n \n \n \n \n \n
\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n
\n \n {{ isSubmitted ? '已提交' : '提交' }}\n \n
\n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n 取 消\n 确 定\n
\n
\n \n \n \n \n \n \n 参加\n 不参加\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n 取 消\n 确 定\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n 取 消\n 确 定\n
\n
\n \n \n \n
\n
\n 学生姓名:\n {{ currentStudent.xm || '-' }}\n
\n
\n 班级:\n {{ currentStudent.bj || '-' }}\n
\n
\n 未参加原因:\n {{ currentStudent.reason || '暂无原因' }}\n
\n
\n
\n 关 闭\n
\n
\n \n \n \n
\n
\n

模板下载

\n

下载学生信息导入模板,按照模板格式填写学生信息

\n 下载学生信息导入模版\n
\n \n
\n

批量导入

\n

选择填写好的学生信息表文件进行批量导入

\n \n 批量导入且覆盖已有信息\n
\n \n
\n

学生信息导出

\n

导出当前学校的学生信息数据

\n 导出学生信息\n
\n
\n
\n 关 闭\n
\n
\n \n \n
\n \n
\n

提示:若要将学生添加到现有班级,其“年级班级专业”信息必须与目标班级的名称完全一致,表格内只填写新增学生,系统中已有学生请勿添加在表格中

\n 学校现有班级年级专业信息查看\n 追加学生信息导入\n
\n \n \n
\n
\n 关 闭\n
\n
\n \n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n 查询\n 导出\n \n \n
\n \n \n
\n \n \n \n \n \n \n
\n \n \n
\n \n \n
\n
\n \n
\n \n \n
\n \n
\n 班级信息下载\n
\n\n \n \n \n \n \n \n \n\n \n
\n \n \n
\n
\n \n
\n
\n
\n
"; return (function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { id: Math.uuid(), user: '', homezt: '1', // 页面状态标识,设置为1显示完成按钮 ckccbjmdDialogVisible: false, // 抽测班级名单弹框 // 抽测班级名单数据 bjList: [], currentPage: 1, pageSize: 10, total: 0, treeData: [], tableData: [], tableLoading: false, loading:false, loading1:false, currentSelection: '请选择班级', selectedNode: null, xxjd: '', // 学段:1-小学,2-初中,3-高中,4-中职 selectedStudents: [], // 选中的学生 participationDialog: false, // 修改参与情况弹窗 participationForm: { cyqk: '', // 参与情况 1参加 0不参加(默认不选) reason: '', // 不参与原因 customReason: '' // 自定义原因 }, reasonOptions: [ { value: '家长不同意', label: '家长不同意' }, { value: '学生不存在', label: '学生不存在' }, { value: '休学', label: '休学' }, { value: '事假', label: '事假' }, { value: '病假', label: '病假' }, { value: '其他', label: '其他' } ], treeProps: { children: 'children', label: 'label' }, expandedKeys: [], // 默认展开的节点 currentNodeKey: null, // 当前选中的节点 // 添加学生弹窗 addStudentDialogVisible: false, // 添加学生表单数据 studentForm: { nj: '', bj: '', bjid: '', xm: '', xh: '', xb: '', zy: '', //zybm: '', xxid: '' }, // 表单验证规则 studentRules: { nj: [{ required: true, message: '请选择年级', trigger: 'change' }], bj: [{ required: true, message: '请选择班级', trigger: 'change' }], xm: [{ required: true, message: '请输入学生姓名', trigger: 'blur' }], xh: [{ required: true, message: '请输入学号', trigger: 'blur' }], xb: [{ required: true, message: '请选择性别', trigger: 'change' }] }, // 下拉选项数据 njOptions: [], bjOptions: [], zyOptions: [], isEdit: false, // 是否为编辑模式 // 添加班级弹窗 addClassDialogVisible: false, // 添加班级表单数据 classForm: { nj: '', bj: '', zy: '', //zybm: '', xd: '', bjlx: '', xxid: '' }, // 班级表单验证规则 classRules: { nj: [{ required: true, message: '请选择年级', trigger: 'change' }], bj: [{ required: true, message: '请输入班级名称', trigger: 'blur' }], zy: [{ required: true, message: '请选择专业', trigger: 'change' }], // zybm: [{ required: true, message: '请输入专业编码', trigger: 'blur' }], bjlx: [{ required: true, message: '请选择班级类型', trigger: 'change' }] }, // 原因弹框相关 reasonDialogVisible: false, currentStudent: {}, // 查询相关 searchForm: { xm: '', // 姓名 xh: '' // 学号 }, // 学生信息表管理弹框 studentInfoDialogVisible: false, studentInfoDialogVisible1: false, studentInfoDialogVisible2: false, // 学校现有班级年级信息相关数据 classGradeInfoData: [], // 表格数据 classGradeInfoLoading: false, // 加载状态 classGradeInfoTotal: 0, // 总条数 classGradeInfoPageNum: 1, // 当前页码 classGradeInfoPageSize: 10, // 每页条数 // 查询表单 classGradeInfoSearchForm: { nj: '', // 年级 bj: '', // 班级 zy: '' // 专业(仅中职) }, // 提交状态相关 isSubmitted: false, // 是否已提交 smlcsfsb: '0' // 实名流程是否上报:0-未提交,1-已提交 } }, computed: { // 判断是否为基础教育(小初高) isBasicEducation() { return ['1', '2', '3'].includes(this.xxjd); } }, methods: { // 查询提交状态 getSubmitStatus() { const that = this; const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; if (!user.ID) { that.$message.error('无法获取用户信息'); return; } $.get('/www/public/shimingimport/smxstjztfind', { schoolid: user.ID }, function(res) { if (res.error == 0 || res.success == 1) { that.smlcsfsb = res.data; that.isSubmitted = (res.data === '1'); } else { that.$message.error(res.message || '获取提交状态失败'); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 处理提交按钮点击 handleSubmit() { const that = this; that.$confirm( '提交后将无法修改学生信息,是否确认提交?', '确认提交学生信息', { confirmButtonText: '确认提交', type: 'warning', center: true } ).then(() => { that.submitStudentInfo(); }).catch(() => { // 用户取消提交 }); }, // 提交学生信息 submitStudentInfo() { const that = this; const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; if (!user.ID) { that.$message.error('无法获取用户信息'); return; } $.post('/www/public/shimingimport/smxstjztedit', { smlcsfsb: '1' }, function(res) { if (res.error == 0 || res.success == 1) { that.$message.success(res.message); that.getSubmitStatus() } else { that.$message.error(res.message || '提交失败,请稍后重试'); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 查看抽测班级名单 viewCybjmd() { const that = this; this.ckccbjmdDialogVisible = true; // 打开弹框时,先记录查看行为,然后拉取数据 const user = that.user || (localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}); $.post('/www/public/bd/sfckcybjedit', { userid: user.ID }, function(res) { // 无论成功与否都继续拉取列表 that.fetchBjList(); }).fail(function(){ that.fetchBjList(); }); }, // 拉取抽测班级名单 fetchBjList() { const that = this; const params = { pageNo: this.currentPage, pageSize: this.pageSize }; $.get('/www/public/shangbao/findbjinfoBycy', params, function(res) { if (res.error == 0) { that.bjList = res.data || []; that.total = res.total || 0; } else { that.$message.error(res.message || '获取抽测班级名单失败'); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleSizeChange(size) { this.pageSize = size; this.currentPage = 1; this.fetchBjList(); }, // 改变当前页 handleCurrentChange(page) { this.currentPage = page; this.fetchBjList(); }, bjxxdown() { var that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var schoolid = user.ID; const params = {}; var url = '/www/public/shangbao/exportbj_new'; var name = '班级信息.xls'; axios({ method: 'get', url, params: { schoolid }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { console.log(res, 'res'); let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(可选) document.body.removeChild(aLink); this.$message.success('导出成功'); } else { this.$message.error('导出失败'); } }).catch(err => { this.$message.error('导出失败'); }); }, // 获取用户信息和学段 initUserInfo() { const that = this that.user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; that.xxjd = localStorage.getItem('xxjd') || ''; }, // 获取树形数据 loadTreeData() { const that = this; $.get('/www/public/daoru/findxxbjlist', {sfcy:'1'}, function(res) { if (res.success == 1 || res.error == 0) { that.treeData = res.data || []; // 规范化:为所有节点补充顶层 id,确保与 node-key 匹配 that.normalizeTreeData(that.treeData); // 默认加载第一个班级的数据(等待树渲染完成) if (that.treeData.length > 0) { that.$nextTick(() => { that.loadFirstClassData(); }); } } else { that.$message.error(res.message || '获取数据失败'); } }).fail((xhr, status, error) => { that.$message.error('请求失败'); }); }, // 加载第一个班级数据(默认展开第一个年级并选中其下第一个班级) loadFirstClassData() { const isBasic = this.isBasicEducation; const getKey = (n) => (n && (n.id || (n.data && n.data.id))) || null; if (!this.treeData || this.treeData.length === 0) return; const firstGrade = this.treeData[0]; let firstMajor = null; let firstClass = null; if (isBasic) { // 基础教育:年级 -> 班级 if (firstGrade && Array.isArray(firstGrade.children) && firstGrade.children.length > 0) { firstClass = firstGrade.children.find(n => this.isClassNode(n)) || firstGrade.children[0]; } } else { // 中职:年级 -> 专业 -> 班级 if (firstGrade && Array.isArray(firstGrade.children) && firstGrade.children.length > 0) { firstMajor = firstGrade.children[0]; if (!this.isMajorNode(firstMajor)) { firstMajor = firstGrade.children.find(n => this.isMajorNode(n)) || firstMajor; } if (firstMajor && Array.isArray(firstMajor.children) && firstMajor.children.length > 0) { firstClass = firstMajor.children.find(n => this.isClassNode(n)) || firstMajor.children[0]; } } } // 回退策略:全树范围查找第一个班级 if (!firstClass) { const findFirstClass = (nodes) => { for (let node of nodes || []) { if (this.isClassNode(node)) return node; if (node.children && node.children.length > 0) { const found = findFirstClass(node.children); if (found) return found; } } return null; }; firstClass = findFirstClass(this.treeData); } if (!firstClass) return; // 设置选中的班级与显示文本 this.selectedNode = { data: firstClass, node: null }; if (isBasic) { this.currentSelection = `${firstClass.data.nj} - ${firstClass.data.bjmc}`; } else { this.currentSelection = `${firstClass.data.nj} - ${firstClass.data.zymc} - ${firstClass.data.bjmc}`; } // 需要展开的父节点keys const expandedKeys = []; const gradeKey = getKey(firstGrade); if (gradeKey) expandedKeys.push(gradeKey); if (!isBasic) { const majorKey = getKey(firstMajor); if (majorKey) expandedKeys.push(majorKey); } const classKey = getKey(firstClass); // 下一帧:展开树并高亮选中班级 this.$nextTick(() => { const runExpand = () => { const tree = this.$refs.tree; if (!tree) return; // 先高亮选中班级 if (classKey) { try { tree.setCurrentKey(classKey); } catch (e) {} } // 显式展开:根据选中班级节点,向上展开父链(年级/专业) let classNodeObj = classKey ? tree.getNode(classKey) : null; let p = classNodeObj ? classNodeObj.parent : null; while (p && p.level >= 1) { try { typeof p.expand === 'function' && p.expand(true); } catch (e) {} p.expanded = true; p = p.parent; } // 兜底:如果传入了需要展开的 keys,逐个尝试展开 (expandedKeys || []).forEach(k => { const n = tree.getNode(k); if (n) { try { typeof n.expand === 'function' && n.expand(true); } catch (e) {} n.expanded = true; } }); // 如果本帧还未拿到节点,再延迟一次重试 if (!classNodeObj) { setTimeout(() => { const t = this.$refs.tree; if (!t) return; classNodeObj = classKey ? t.getNode(classKey) : null; let pp = classNodeObj ? classNodeObj.parent : null; while (pp && pp.level >= 1) { try { typeof pp.expand === 'function' && pp.expand(true); } catch (e) {} pp.expanded = true; pp = pp.parent; } (expandedKeys || []).forEach(k => { const nn = t.getNode(k); if (nn) { try { typeof nn.expand === 'function' && nn.expand(true); } catch (e) {} nn.expanded = true; } }); }, 0); } }; // 再加一次 nextTick,确保 el-tree 完整渲染后再执行展开 this.$nextTick(runExpand); }); // 加载表格数据 this.loadTableData(); }, // 判断节点类型 isGradeNode(data) { // 小初高:年级节点没有data属性或data中没有bjmc if (this.isBasicEducation) { return !data.data || !data.data.bjmc; } // 中职:年级节点(第一层) return data.children && data.children.length > 0 && data.children[0].children; }, isClassNode(data) { // 小初高:班级节点有data且有bjmc if (this.isBasicEducation) { return data.data && data.data.bjmc; } // 中职:班级节点(第三层) return data.data && data.data.bjmc && data.data.zymc; }, isMajorNode(data) { // 只有中职有专业节点(第二层) return !this.isBasicEducation && data.children && data.children.length > 0 && !data.children[0].children; }, // 规范化树数据,确保每个节点都有唯一 id 供 node-key 使用 normalizeTreeData(nodes) { const ensureId = (node) => { if (!node) return; // el-tree 使用 node-key="id",确保此字段存在 if (!node.id) { node.id = (node.data && node.data.id) || `${Date.now()}_${Math.random().toString(36).slice(2,8)}`; } if (Array.isArray(node.children)) { node.children.forEach(ensureId); } }; (nodes || []).forEach(ensureId); }, // 处理树节点点击 handleNodeClick(data, node) { this.selectedNode = { data, node }; // 只有班级节点才加载学生数据 if (this.isClassNode(data)) { if (this.isBasicEducation) { this.currentSelection = `${data.data.nj} - ${data.data.bjmc}`; } else { this.currentSelection = `${data.data.nj} - ${data.data.zymc} - ${data.data.bjmc}`; } this.loadTableData(); } }, // 加载表格数据 loadTableData() { if (!this.selectedNode || !this.selectedNode.data) { return; } const that = this; this.tableLoading = true; // 调试信息:检查选中节点和班级ID console.log('loadTableData - selectedNode:', this.selectedNode); console.log('loadTableData - selectedNode.data:', this.selectedNode.data); // 从树状结构中正确获取班级ID let bjid = ''; if (this.selectedNode && this.selectedNode.data) { // 树状结构中班级ID在data.data.id中 bjid = this.selectedNode.data.data ? this.selectedNode.data.data.id : this.selectedNode.data.id; } console.log('loadTableData - bjid:', bjid); const params = { xxid: this.user.ID, bjid: bjid, xm: this.searchForm.xm || '', // 姓名查询参数 xh: this.searchForm.xh || '' // 学号查询参数 }; console.log('loadTableData - 请求参数:', params); $.get('/www/public/daoru/findbjxslist', params, function(res) { if (res.success == 1 || res.error == 0) { that.tableData = res.data || []; } else { that.$message.error(res.message || '获取学生列表失败'); that.tableData = []; } that.tableLoading = false; }).fail(() => { that.$message.error('请求失败'); that.tableData = []; that.tableLoading = false; }); }, // 添加年级 addGrade() { this.$message.info('添加年级功能待实现'); }, // 添加班级 addClass(data) { this.$message.info('添加班级功能待实现'); }, // 删除年级 deleteGrade(data) { this.$message.info('删除年级功能待实现'); }, // 删除班级 deleteClass(data) { const that = this; // 先检查班级下是否有学生 const checkParams = { xxid: this.user.ID, bjid: data.id }; $.get('/www/public/daoru/findbjxslist', checkParams, function(res) { if (res.success == 1 || res.error == 0) { const studentList = res.data || []; if (studentList.length > 0) { that.$message.warning('该班级下还有学生,不能删除!'); return; } // 班级下没有学生,可以删除 that.$confirm('确定要删除该班级吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { const params = { bjid: data.id }; $.post('/www/public/daoru/deletebj', params, function(res) { if (res.success == 1 || res.error == 0) { that.$message.success('删除成功'); that.loadTreeData(); // 重新加载树形数据 that.tableData = []; // 清空表格数据 } else { that.$message.error(res.message); } }).fail(() => { that.$message.error('请求失败'); }); }).catch(() => { that.$message.info('已取消删除'); }); } else { that.$message.error('检查班级学生信息失败'); } }).fail(() => { that.$message.error('检查班级学生信息请求失败'); }); }, // 删除专业(中职) deleteMajor(data) { this.$message.info('删除专业功能待实现'); }, // 打开添加班级弹窗 addClassDialog() { this.resetClassForm(); this.loadNjOptions(); // 移除直接加载专业列表的代码,改为在选择年级后通过onClassNjChange加载 this.zyOptions = []; this.addClassDialogVisible = true; }, // 重置班级表单 resetClassForm() { this.classForm = { nj: '', bj: '', zy: '', // zybm: '', xd: this.xxjd, bjlx: '', xxid: this.user.ID }; this.$nextTick(() => { if (this.$refs.classForm) { this.$refs.classForm.clearValidate(); } }); }, // 提交添加班级 submitAddClass() { const that = this; this.$refs.classForm.validate((valid) => { if (valid) { const params = { nj: that.classForm.nj, bj: that.classForm.bj, zy: that.classForm.zy || '', // zybm: that.classForm.zybm || '', xd: that.classForm.xd, bjlx: that.classForm.bjlx || '', xxid: that.classForm.xxid }; $.post('/www/public/daoru/addbj', params, function(res) { if (res.success == 1 || res.error == 0) { that.$message.success('添加班级成功'); that.addClassDialogVisible = false; that.loadTreeData(); // 重新加载树形数据 } else { that.$message.error(res.message || '添加班级失败'); } }).fail(() => { that.$message.error('请求失败'); }); } else { that.$message.error('请检查表单信息'); return false; } }); }, // 添加学生 addStudent() { if (!this.selectedNode || !this.selectedNode.data) { this.$message.warning('请先选择班级'); return; } this.isEdit = false; // 先加载年级选项 this.loadNjOptions(); // 直接设置表单数据,不调用resetStudentForm this.studentForm = { nj: this.selectedNode.data.data.nj, bj: this.selectedNode.data.data.bjmc, bjid: this.selectedNode.data.id, xm: '', xh: '', xb: '', zy: this.xxjd === '4' && this.selectedNode.data.data.zymc ? this.selectedNode.data.data.zymc : '', // zybm: this.xxjd === '4' && this.selectedNode.data.data.zybm ? this.selectedNode.data.data.zybm : '', xxid: '' }; console.log('设置班级信息后的bjid:', this.studentForm.bjid); // 清除表单验证状态 this.$nextTick(() => { if (this.$refs.studentForm) { this.$refs.studentForm.clearValidate(); } }); // 延迟加载班级选项,确保年级已设置 this.$nextTick(() => { if (this.xxjd === '4') { // 中职:先加载专业选项,再加载班级选项 this.loadZyOptions(); this.$nextTick(() => { this.loadBjOptions(); }); } else { // 基础教育:直接加载班级选项 this.loadBjOptions(); } }); this.addStudentDialogVisible = true; }, // 重置学生表单 resetStudentForm() { this.studentForm = { nj: '', bj: '', bjid: '', xm: '', xh: '', xb: '', zy: '', //zybm: '', xxid: '' }; this.$nextTick(() => { if (this.$refs.studentForm) { this.$refs.studentForm.clearValidate(); } }); }, // 提交添加/编辑学生 submitAddStudent() { const that = this; this.$refs.studentForm.validate((valid) => { if (valid) { // 设置学校ID that.studentForm.xxid = this.user.ID || ''; // 确保bjid有值 - 多重保障 if (!that.studentForm.bjid) { // 第一优先级:从班级选项中获取 if (that.studentForm.bj && that.bjOptions.length > 0) { const selectedBj = that.bjOptions.find(option => option.value === that.studentForm.bj); if (selectedBj && selectedBj.id) { that.studentForm.bjid = selectedBj.id; console.log('从班级选项中设置bjid:', that.studentForm.bjid); } } // 第二优先级:从选中节点获取 if (!that.studentForm.bjid && that.selectedNode && that.selectedNode.data) { that.studentForm.bjid = that.selectedNode.data.id; console.log('从选中节点设置bjid:', that.studentForm.bjid); } } // 最终检查bjid是否有值 if (!that.studentForm.bjid) { that.$message.error('无法获取班级ID,请重新选择班级'); return; } // 如果是中职,设置专业编码(临时处理) // if (that.xxjd === '4' && that.studentForm.zy) { // that.studentForm.zybm = that.studentForm.zy + '001'; // } const params = { nj: that.studentForm.nj, bj: that.studentForm.bj, bjid: that.studentForm.bjid, xm: that.studentForm.xm, xh: that.studentForm.xh, xb: that.studentForm.xb, zy: that.studentForm.zy, // zybm: that.studentForm.zybm, xxid: that.studentForm.xxid }; // 调试信息:打印提交参数 console.log('提交学生参数:', params); // 如果是编辑模式,添加xsid参数 if (this.isEdit) { params.xsid = this.studentForm.xsid; } const url = this.isEdit ? '/www/public/daoru/editxs' : '/www/public/daoru/addxs'; const successMsg = this.isEdit ? '修改学生成功' : '添加学生成功'; const errorMsg = this.isEdit ? '修改学生失败' : '添加学生失败'; $.post(url, params, function(res) { if (res.success == 1 || res.error == 0) { that.$message.success(successMsg); that.addStudentDialogVisible = false; // 刷新表格数据 that.loadTableData(); } else { that.$message.error(res.message || errorMsg); } }).fail((xhr, status, error) => { that.$message.error('请求错误'); }); } else { that.$message.error('请检查表单信息'); return false; } }); }, // 初始化表单选项 initFormOptions() { this.loadNjOptions(); // 中职需要专业验证 if (this.xxjd === '4') { this.studentRules.zy = [{ required: true, message: '请选择专业', trigger: 'change' }]; } }, // 加载年级选项 loadNjOptions() { const that = this; console.log(that.user) $.get('/www/public/daoru/findnjlsit', { xxid: that.user.ID }, function(res) { if (res.success == 1 || res.error == 0) { that.njOptions = res.data.map(item => item.nj || item.njmc || item.name); } else { that.$message.error(res.message || '获取年级列表失败'); } }).fail((xhr, status, error) => { that.$message.error('获取年级列表请求失败'); }); }, // 年级变化时加载专业和班级(学生添加/编辑) onNjChange() { this.studentForm.zy = ''; this.studentForm.bj = ''; this.studentForm.bjid = ''; // 清空班级ID this.zyOptions = []; this.bjOptions = []; if (this.xxjd === '4') { this.loadZyOptions(); } else { this.loadBjOptions(); } }, // 班级添加弹窗中年级变化时加载专业 onClassNjChange() { this.classForm.zy = ''; this.zyOptions = []; if (this.xxjd === '4') { this.loadClassZyOptions(); } }, // 编辑时加载专业选项(中职) loadZyOptionsForEdit(row) { const that = this; const xxid = this.user.ID || ''; $.get('/www/public/daoru/findzylist', { xxid: xxid, nj: this.studentForm.nj }, function(res) { if (res.success == 1 || res.error == 0) { that.zyOptions = res.data.map(item => ({ value: item.zy || item.zymc || item.name, label: item.zy || item.zymc || item.name })); // 专业选项加载完成后,加载班级选项 that.loadBjOptionsForEdit(row); } else { that.$message.error(res.message || '获取专业列表失败'); } }).fail((xhr, status, error) => { that.$message.error('获取专业列表请求失败'); }); }, // 编辑时加载班级选项 loadBjOptionsForEdit(row) { const that = this; const xxid = this.user.ID || ''; const params = { xxid: xxid, nj: this.studentForm.nj }; // 中职需要传专业参数 if (this.xxjd === '4' && this.studentForm.zy) { params.zy = this.studentForm.zy; } $.get('/www/public/daoru/findbjlist', params, function(res) { if (res.success == 1 || res.error == 0) { that.bjOptions = res.data.map(item => ({ value: item.bj || item.bjmc || item.name, label: item.bj || item.bjmc || item.name, id: item.id })); // 班级选项加载完成后,设置班级ID if (row.bj) { const selectedBj = that.bjOptions.find(option => option.value === row.bj); if (selectedBj && selectedBj.id) { that.studentForm.bjid = selectedBj.id; } } } else { that.$message.error(res.message || '获取班级列表失败'); } }).fail((xhr, status, error) => { that.$message.error('获取班级列表请求失败'); }); }, // 加载专业选项(中职 - 学生添加/编辑) loadZyOptions() { const xxid = this.user.ID || ''; if (!xxid || !this.studentForm.nj) { return; } const that = this; $.get('/www/public/daoru/findzylist', { xxid: xxid, nj: this.studentForm.nj }, function(res) { if (res.success == 1 || res.error == 0) { that.zyOptions = res.data.map(item => ({ value: item.zy || item.zymc || item.name, label: item.zy || item.zymc || item.name })); } else { that.$message.error(res.message || '获取专业列表失败'); } }).fail((xhr, status, error) => { that.$message.error('获取专业列表请求失败'); }); }, // 加载专业选项(中职 - 班级添加) loadClassZyOptions() { const xxid = this.user.ID || ''; if (!xxid || !this.classForm.nj) { return; } const that = this; $.get('/www/public/daoru/findzylist', { xxid: xxid, nj: this.classForm.nj }, function(res) { if (res.success == 1 || res.error == 0) { that.zyOptions = res.data.map(item => ({ value: item.zy || item.zymc || item.name, label: item.zy || item.zymc || item.name })); } else { that.$message.error(res.message || '获取专业列表失败'); } }).fail((xhr, status, error) => { that.$message.error('获取专业列表请求失败'); }); }, // 专业变化时加载班级 onZyChange() { this.studentForm.bj = ''; this.studentForm.bjid = ''; // 清空班级ID this.bjOptions = []; this.loadBjOptions(); }, // 班级选择变化时设置班级ID onBjChange() { if (this.studentForm.bj) { // 从班级选项中找到对应的班级ID const selectedBj = this.bjOptions.find(option => option.value === this.studentForm.bj); if (selectedBj && selectedBj.id) { this.studentForm.bjid = selectedBj.id; console.log('班级选择变化,设置bjid:', this.studentForm.bjid); } } else { this.studentForm.bjid = ''; } }, // 加载班级选项 loadBjOptions() { const xxid = this.user.ID || ''; if (!xxid || !this.studentForm.nj) { return; } const params = { xxid: xxid, nj: this.studentForm.nj }; // 中职需要传专业参数 if (this.xxjd === '4' && this.studentForm.zy) { params.zy = this.studentForm.zy; } const that = this; $.get('/www/public/daoru/findbjlist', params, function(res) { if (res.success == 1 || res.error == 0) { that.bjOptions = res.data.map(item => ({ value: item.bjmc || item.bj || item.name, label: item.bjmc || item.bj || item.name, id: item.id // 保存班级ID })); // 加载完班级选项后,如果当前有选中的班级,重新设置bjid if (that.studentForm.bj) { const selectedBj = that.bjOptions.find(option => option.value === that.studentForm.bj); if (selectedBj && selectedBj.id) { that.studentForm.bjid = selectedBj.id; console.log('加载班级选项后重新设置bjid:', that.studentForm.bjid); } } } else { that.$message.error(res.message || '获取班级列表失败'); } }).fail((xhr, status, error) => { that.$message.error('获取班级列表请求失败'); }); }, // 修改参与情况 modifyParticipation() { if (this.selectedStudents.length === 0) { this.$message.warning('请先选择学生'); return; } // 打开前重置弹窗表单,默认不选中任何项且不显示原因 this.participationForm.cyqk = ''; this.participationForm.reason = ''; this.participationForm.customReason = ''; this.participationDialog = true; }, // 处理表格选择变化 handleSelectionChange(selection) { this.selectedStudents = selection; }, // 处理参与情况开关变化 handleParticipationChange(row) { // 恢复开关状态,等待用户在弹窗中确认 row.sfcycp = row.sfcycp === '1' ? '0' : '1'; // 设置当前操作的学生 this.selectedStudents = [row]; // 根据开关状态设置默认参与情况(使用字符串,和单选保持一致) this.participationForm.cyqk = row.sfcycp; this.participationForm.reason = ''; this.participationForm.customReason = ''; // 显示参与情况修改弹窗 this.participationDialog = true; }, // 编辑学生 editStudent(row) { // 直接填充表单数据进行回显 this.studentForm = { xsid: row.id, // 学生ID字段 nj: row.rxnf || row.nj, // 使用rxnf字段作为年级 bj: row.bj, bjid: row.bjid || row.id, // 班级ID xm: row.xm, xh: row.xh, xb: row.xb, zy: row.zy || '', // 专业名称 // zybm: row.zybm || '', // 专业编码 xxid: this.user.ID || '' // 学校ID }; this.isEdit = true; this.addStudentDialogVisible = true; // 正常加载年级选项 this.loadNjOptions(); // 根据当前年级加载班级选项 if (this.studentForm.nj) { if (this.xxjd === '4') { // 中职:先加载专业选项,再加载班级选项 this.loadZyOptions(); this.$nextTick(() => { this.loadBjOptions(); }); } else { // 基础教育:直接加载班级选项 this.loadBjOptions(); } } }, // 删除学生 deleteStudent(row) { this.$confirm('确定要删除该学生吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { const that = this; const params = { xsid: row.id }; $.post('/www/public/daoru/deletexs', params, function(res) { if (res.success == 1 || res.error == 0) { that.$message.success('删除成功'); that.loadTableData(); } else { that.$message.error(res.message); } }).fail(() => { that.$message.error('请求失败'); }); }).catch(() => { this.$message.info('已取消删除'); }); }, // 移除分页相关方法 // 上一步 preStep: function() { this.$emit('preStep'); }, // 下一步 nextStep: function() { if(!this.tableData.length) return this.$message.warning('请先完成数据上报'); this.$confirm('是否确认进入下一步?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { this.$emit('nextStep', 3); }).catch(() => { this.$message.info('已取消删除'); }); }, // 完成 nextStep1: function() { if(!this.tableData.length) return this.$message.warning('请先完成数据上报'); this.$emit('nextStep1', ''); }, // 提交参与情况修改 submitParticipationChange() { const that = this; const studentIds = this.selectedStudents.map(student => student.id); const reason = this.participationForm.cyqk === '0' ? (this.participationForm.reason === '其他' ? this.participationForm.customReason : this.participationForm.reason) : ''; const params = { ids: JSON.stringify(studentIds), cyqk: this.participationForm.cyqk, reason: reason }; $.post('/www/public/daoru/editcyqk', params, function(res) { if (res.success == 1 || res.error == 0) { that.$message.success('批量更新成功'); that.participationDialog = false; that.loadTableData(); that.selectedStudents = []; // 重置表单 that.participationForm = { cyqk: '1', reason: '', customReason: '' }; } else { that.$message.error(res.message || '批量更新失败'); } }).fail(() => { that.$message.error('请求失败'); }); }, // 模板下载 downloadTemplate() { const that = this; const xd = this.xxjd; // 当前学段 if (!xd) { this.$message.error('无法获取学段信息'); return; } // 学段映射:1小学->9, 2初中->10, 3高中->11, 4中职->12 // const typeMapping = {'1': '9', '2': '10', '3': '11', '4': '12'}; const typeMapping = { '1' : '14', '2' : '15', '3' : '16', '4' : '17', } const mappedType = typeMapping[xd]; if (!mappedType) { this.$message.error('不支持的学段类型'); return; } axios({ method: 'get', url: '/www/public/daoru/excelTempExport', params: { type: mappedType }, responseType: 'blob' }).then(function(response) { const typeNames = {'1': '小学', '2': '初中', '3': '高中', '4': '中职'}; const typeName = typeNames[xd] || '学生'; const blob = new Blob([response.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }); const link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = typeName + '学生信息导入模板.xlsx'; link.click(); that.$message.success('模板下载成功'); }).catch(function(error) { that.$message.error('模板下载失败'); }); }, importStudentInfo1() { const that = this; if(that.loading1){ return } const input = document.createElement('input'); input.type = 'file'; input.accept = '.xls,.xlsx'; input.onchange = function(e) { const file = e.target.files[0]; if (!file) return; const isLt100M = file.size / 1024 / 1024 < 100; if (!isLt100M) { that.$message.error('上传文件大小不能超过100MB!'); return; } // 学段映射:1小学->9, 2初中->10, 3高中->11, 4中职->12 const typeMapping = {'1': '1', '2': '2', '3': '3', '4': '4'}; const mappedType = typeMapping[that.xxjd]; if (!mappedType) { that.$message.error('不支持的学段类型'); return; } const formData = new FormData(); formData.append('file', file); formData.append('type', mappedType); // 映射后的学段类型 formData.append('xxid', that.user.ID); // 学校ID that.loading1 = true $.ajax({ url: '/www/public/daoru/xsxxdr_zj_pc', type: 'POST', data: formData, processData: false, contentType: false, success: function(res) { if(res.error == 0) { that.loading1 = false that.loadTreeData(); // 重新加载树数据 that.loadTableData(); // 重新加载表格数据 that.$message.success(res.message); } else { that.loading1 = false that.$message.error(res.message); } }, error: function() { that.loading1 = false that.$message.error('上传失败'); } }); }; input.click(); }, // 学生信息导入 importStudentInfo() { const that = this; if(that.loading){ return } that.$confirm('平台中原有学生信息将被【覆盖】,整体更新为学校最新导入的信息。', '提示', { type: 'warning' }).then(() => { const input = document.createElement('input'); input.type = 'file'; input.accept = '.xls,.xlsx'; input.onchange = function(e) { const file = e.target.files[0]; if (!file) return; const isLt100M = file.size / 1024 / 1024 < 100; if (!isLt100M) { that.$message.error('上传文件大小不能超过100MB!'); return; } // 学段映射:1小学->9, 2初中->10, 3高中->11, 4中职->12 const typeMapping = {'1': '1', '2': '2', '3': '3', '4': '4'}; const mappedType = typeMapping[that.xxjd]; if (!mappedType) { that.$message.error('不支持的学段类型'); return; } const formData = new FormData(); formData.append('file', file); formData.append('type', mappedType); // 映射后的学段类型 formData.append('xxid', that.user.ID); // 学校ID $.ajax({ url: '/www/public/daoru/xsxxdr_pc', type: 'POST', data: formData, processData: false, contentType: false, success: function(res) { if(res.error == 0) { that.$message.success(res.message); that.loadTreeData(); // 重新加载树数据 that.loadTableData(); // 重新加载表格数据 } else { that.$message.error(res.message); } }, error: function() { that.$message.error('上传失败'); } }); }; input.click(); }).catch(() => { that.loading = false; // 取消操作时重置状态 }); }, // 显示原因弹框 showReason(row) { this.currentStudent = row; this.reasonDialogVisible = true; }, // 查询学生 searchStudents() { this.loadTableData(); }, // 学生信息导出(页面按钮) exportStudentInfo() { const that = this; const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; // 学段映射:1→9、2→10、3→11、4→12 const xdMapping = { '1': '9', // 小学 '2': '10', // 初中 '3': '11', // 高中 '4': '12' // 中职 }; const mappedXd = xdMapping[that.xxjd]; if (!mappedXd) { that.$message.error('当前学段不支持导出'); return; } const params = { schoolid: user.ID, xd: mappedXd }; // 构建下载URL const url = '/www/public/daoru/xsxxdc?' + Object.keys(params).map(key => key + '=' + encodeURIComponent(params[key])).join('&'); // 创建隐藏的下载链接 const link = document.createElement('a'); link.href = url; link.download = '学生信息导出.xls'; document.body.appendChild(link); link.click(); document.body.removeChild(link); that.$message.success('学生信息导出已开始'); }, // 学生信息导出(弹框中) exportStudentInfoFromDialog() { const that = this; const user = this.user; if (!user || !user.ID) { that.$message.error('无法获取学校信息'); return; } // 学段映射 const xdMapping = { '1': '1', // 小学 '2': '2', // 初中 '3': '3', // 高中 '4': '4' // 中职 }; const mappedXd = xdMapping[that.xxjd]; if (!mappedXd) { that.$message.error('当前学段不支持导出'); return; } axios({ method: 'get', url: '/www/public/daoru/xsxxdc', params: { schoolid: user.ID, xd: mappedXd }, responseType: 'blob' }).then(function(response) { const typeNames = {'1': '小学', '2': '初中', '3': '高中', '4': '中职'}; const typeName = typeNames[that.xxjd] || '学校'; const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' }); const link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = typeName + '学生信息导出.xls'; link.click(); that.$message.success('学生信息导出成功'); }).catch(function(error) { that.$message.error('学生信息导出失败'); }); }, // 显示学生信息表管理弹框 showStudentInfoDialog() { const that = this; that.$confirm(`

(1)下载学生信息导入模板,填写本校所有参测学生信息;

(2)选择“批量导入且覆盖已有信息”功能。

---操作结果:平台中原有学生信息将被【覆盖】,整体更新为最新导入的信息。

`, '学生信息批量导入说明', { dangerouslyUseHTMLString: true, confirmButtonText: '我知道了', showCancelButton: false, center: true, customClass: 'student-info-scheme-confirm' }).then(() => { that.studentInfoDialogVisible = true; }).catch(() => { }); }, showStudentInfoDialog1() { this.studentInfoDialogVisible1 = true; }, showStudentInfoDialog2() { this.studentInfoDialogVisible2 = true; // 打开弹框时加载数据 this.loadClassGradeInfoData(); }, // 加载学校现有班级年级信息数据 loadClassGradeInfoData() { const that = this; that.classGradeInfoLoading = true; const params = { pageSize: that.classGradeInfoPageSize, pageNum: that.classGradeInfoPageNum, nj: that.classGradeInfoSearchForm.nj, bj: that.classGradeInfoSearchForm.bj }; // 如果是中职学段,添加专业参数 if (that.xxjd === '4') { params.zy = that.classGradeInfoSearchForm.zy; } $.get('/www/public/shangbao/xxnjbjfind', params, function(res) { that.classGradeInfoLoading = false; if (res.success == 1 || res.error == 0) { that.classGradeInfoData = res.data || []; that.classGradeInfoTotal = res.total || 0; } else { that.$message.error(res.message || '获取数据失败'); } }).fail((xhr, status, error) => { that.classGradeInfoLoading = false; that.$message.error('请求失败'); }); }, // 查询班级年级信息 searchClassGradeInfo() { this.classGradeInfoPageNum = 1; this.loadClassGradeInfoData(); }, // 分页大小改变 handleClassGradeInfoSizeChange(val) { this.classGradeInfoPageSize = val; this.loadClassGradeInfoData(); }, // 当前页改变 handleClassGradeInfoCurrentChange(val) { this.classGradeInfoPageNum = val; this.loadClassGradeInfoData(); }, // 导出班级年级列表 exportClassGradeInfo() { const that = this; const params = {}; // 只添加有值的查询参数 if (that.classGradeInfoSearchForm.nj) { params.nj = that.classGradeInfoSearchForm.nj; } if (that.classGradeInfoSearchForm.bj) { params.bj = that.classGradeInfoSearchForm.bj; } // 如果是中职学段,添加专业参数 if (that.xxjd === '4' && that.classGradeInfoSearchForm.zy) { params.zy = that.classGradeInfoSearchForm.zy; } // 使用axios进行导出,参考模板下载的方式 axios({ method: 'get', url: '/www/public/shangbao/xxnjbjfind_export', params: params, responseType: 'blob' }).then(function(response) { const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' }); const link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = '班级年级信息列表.xls'; link.click(); that.$message.success('班级年级信息导出成功'); }).catch(function(error) { that.$message.error('班级年级信息导出失败'); }); } }, created: function() { this.initUserInfo(); this.initFormOptions(); }, mounted: function() { // DOM 渲染完成后再加载树数据,确保能正确展开与选中 this.$nextTick(() => { this.loadTreeData(); this.getSubmitStatus(); // 查询提交状态 }); }, props: ['title', 'data', 'config','disableStatus'] }); }); })(template, resolve, reject); }); RegVueCom("xljk-xuekelaoshiUpload", function(resolve, reject){ var template = "
\n
\n
\n

\n *注:要求班级信息表中填写的专业名称和专业代码,必须与本校抽样专业表中的专业名称和专业代码完全一样。\n

\n

\n 信息上报审核通过前,教师信息表可修改后再次导入;\n

\n \n
\n \n 第1步:查看本校抽样专业详情\n 第2步:下载班级信息表模板\n \n \n \n 第3步:班级信息表导入\n
\n
\n 学校现有班级年级专业信息查看\n 第1步:下载教师信息表模板\n \n 第2步:教师信息表导入\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n 上 一 步\n 撤回修改\n 提 交\n
\n
\n \n
\n
本次2025年全国学生心理健康监测对贵校的抽样专业为:
\n
\n
\n
{{ item.zymc }}
\n
学段:{{ item.xd }}
\n
专业代码:{{ item.zybm }}
\n
\n
\n
\n
\n 确认全部专业无误\n 修改已选专业\n
\n
\n
\n\n \n
\n

\n 请上报与\n \n 相关的专业;请确保上报的专业每个年级班级数超过2个,每个班级人数超过30人。\n

\n
\n {{ specialtyList[specialtyIndex].zymc }}\n \n \n \n \n
\n
\n
\n\n \n
\n \n \n\n \n
\n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n \n \n \n \n \n \n \n\n \n
\n
\n \n \n \n \n
\n
\n

第1步:下载班级信息表模板

\n

下载班级信息导入模板,按照模板格式填写班级信息

\n 下载班级信息导入模版\n
\n \n
\n

第2步:班级信息表导入

\n

选择填写好的班级信息表文件进行批量导入

\n \n 批量导入且覆盖已有信息\n \n
\n \n
\n
\n
\n

第1步:查看本校抽样专业详情

\n 查看\n
\n \n
\n

第2步:下载班级信息表模板

\n

下载班级信息导入模板,按照模板格式填写班级信息

\n 下载班级信息导入模版\n
\n \n
\n

第3步:班级信息表导入

\n

选择填写好的班级信息表文件进行批量导入

\n \n \n 批量导入且覆盖已有信息\n
\n
\n
\n 关 闭\n
\n
\n \n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n 查询\n 导出\n \n \n
\n \n \n
\n \n \n \n \n \n \n
\n \n \n
\n \n \n
\n
\n \n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid() , tableData: [], teaList:[], multipleSelection: [], loading: false, sfnmlc:'', studentInfoDialogVisible2: false, classGradeInfoData: [], // 表格数据 classGradeInfoLoading: false, // 加载状态 classGradeInfoTotal: 0, // 总条数 classGradeInfoPageNum: 1, // 当前页码 classGradeInfoPageSize: 10, // 每页条数 // 查询表单 classGradeInfoSearchForm: { nj: '', // 年级 bj: '', // 班级 zy: '' // 专业(仅中职) }, currentPage1: 5, currentPage2: 5, currentPage3: 5, currentPage4: 4, result:'', qrzt:'0', cyzylist:[], specialtyList: [], selectedSpecialtyIndexes: [], // 选中的专业索引数组 showSpecialtyButtons: true, // 控制专业弹框按钮显示 reportForm: { specialties: [] }, total:0, xxjd:'', xxjdArr:[], detailrow:'', pages:{ pageNo:1, pageSize:5 }, JSForm:{ }, ruleForm:{ nj:'', bjmc:'', bjrs:'' }, ruleForms:{ xm:'' }, njOption:[], rules: { bjmc: [ { required: true, message: '请输入班级名称', trigger: 'blur' } ], bjrs: [ { required: true, message: '请输入班级人数', trigger: 'blur' } ], }, ruless: { xm: [ { required: true, message: '请输入教师名称', trigger: 'blur' } ], }, classInfoDialogVisible: false, classInfoLoading: false, } }, methods: { withdrawSubmit(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.$confirm('确定要撤回上报吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { const params = { xxid: user.ID, shzt: '1' } $.post("/www/public/shangbao/chshangbao", params, function(res){ if(res.success==1 || res.error==0){ that.$message.success('撤回成功') window.location.reload() }else{ that.$message.error(res.message || '撤回失败') } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) }).catch(() => { that.$message.info('已取消撤回') }) }, // 查询班级年级信息 searchClassGradeInfo() { this.classGradeInfoPageNum = 1; this.loadClassGradeInfoData(); }, // 分页大小改变 handleClassGradeInfoSizeChange(val) { this.classGradeInfoPageSize = val; this.loadClassGradeInfoData(); }, // 当前页改变 handleClassGradeInfoCurrentChange(val) { this.classGradeInfoPageNum = val; this.loadClassGradeInfoData(); }, // 导出班级年级列表 exportClassGradeInfo() { const that = this; const params = {}; // 只添加有值的查询参数 if (that.classGradeInfoSearchForm.nj) { params.nj = that.classGradeInfoSearchForm.nj; } if (that.classGradeInfoSearchForm.bj) { params.bj = that.classGradeInfoSearchForm.bj; } // 如果是中职学段,添加专业参数 if (that.xxjd === '4' && that.classGradeInfoSearchForm.zy) { params.zy = that.classGradeInfoSearchForm.zy; } // 使用axios进行导出,参考模板下载的方式 axios({ method: 'get', url: '/www/public/shangbao/xxnjbjfind_export', params: params, responseType: 'blob' }).then(function(response) { const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' }); const link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = '班级年级信息列表.xls'; link.click(); that.$message.success('班级年级信息导出成功'); }).catch(function(error) { that.$message.error('班级年级信息导出失败'); }); }, showStudentInfoDialog2() { this.studentInfoDialogVisible2 = true; // 打开弹框时加载数据 this.loadClassGradeInfoData(); }, // 加载学校现有班级年级信息数据 loadClassGradeInfoData() { const that = this; that.classGradeInfoLoading = true; const params = { pageSize: that.classGradeInfoPageSize, pageNum: that.classGradeInfoPageNum, nj: that.classGradeInfoSearchForm.nj, bj: that.classGradeInfoSearchForm.bj }; // 如果是中职学段,添加专业参数 if (that.xxjd === '4') { params.zy = that.classGradeInfoSearchForm.zy; } $.get('/www/public/shangbao/xxnjbjfind', params, function(res) { that.classGradeInfoLoading = false; if (res.success == 1 || res.error == 0) { that.classGradeInfoData = res.data || []; that.classGradeInfoTotal = res.total || 0; } else { that.$message.error(res.message || '获取数据失败'); } }).fail((xhr, status, error) => { that.classGradeInfoLoading = false; that.$message.error('请求失败'); }); }, handleImportClick() { var that = this // 先执行状态判断 if(that.qrzt==1){ that.$message.warning('学校未确认,无法导入') return }else if(that.qrzt==2){ that.$message.warning('等待管理端确认您的专业后再进行导入') return } // 判断通过后,安全触发文件选择,并在触发前 clearFiles that.$nextTick(function(){ var upload = that.$refs && that.$refs.uploadRef ? that.$refs.uploadRef : null if(upload){ if(upload.clearFiles){ try{ upload.clearFiles() }catch(e){} } if(upload.$el){ var inputEl = upload.$el.querySelector('input[type="file"]') if(inputEl){ inputEl.click() }else{ that.$message.error('文件选择控件未就绪,请稍后再试或刷新页面') } }else{ that.$message.error('上传组件未就绪,请稍后再试') } }else{ that.$message.error('未获取到上传组件引用,请刷新页面后重试') } }) }, onFileChange(file, fileList){ var that = this // 选择文件后,手动触发提交,走自定义 http-request if(that.$refs && that.$refs.uploadRef && that.$refs.uploadRef.submit){ try{ that.$refs.uploadRef.submit() }catch(e){ console.error(e) that.$message.error('提交上传失败,请重试') } }else{ that.$message.error('上传组件未就绪,无法提交') } }, getDownStatus(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { xxid:user.ID } $.get("/www/public/newcy/sfksbxxsj", params, function(res){ if(res.success==1){ that.qrzt=res.data.qrzt }else{ } }).fail((xhr,status,error)=>{}) }, nextStep1(){ this.$emit('nextStep1','') }, downloaddata(){ var that = this if(that.qrzt==1){ that.$message.warning('学校未确认,无法下载') return }else if(that.qrzt==2){ that.$message.warning('等待管理端确认您的专业后再进行下载') return } var xxjddata = localStorage.getItem('xxjd') var status = that.$route.query.status var xxjd if (status == '2') { xxjd = xxjddata == 1 ? '1' : xxjddata == 2 ? '2' : xxjddata == 3 ? '3' : xxjddata == 4 ? '4' : '' } else { xxjd = xxjddata == 1 ? '1' : xxjddata == 2 ? '2' : xxjddata == 3 ? '3' : xxjddata == 4 ? '4' : '' } //1zz 2gz 3gx var type = xxjd /*switch(xxjd) { case 1: alert(1) break; case 2: 代码块 break; default: 默认代码块 } */ const params = { type, } axios({ method: 'get', url: '/www/public/shangbao/import_bjls_info_temp', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '教师信息表模板.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }) }, downcyzyls(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { schoolid : user.ID } axios({ method: 'get', url: '/www/public/chouyang/sb-dczy', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '抽样专业列表.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }) }, cyzyLists(){ const that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { xxid: user.ID } $.post("/www/public/newcy/schoolzhuanyelist", params, function(res){ if(res.success==1 || res.error==0){ const list = Array.isArray(res.data)?res.data:[] that.specialtyList = list // 检查专业确认状态 that.checkSpecialtyConfirmStatus(user.ID) that.$refs.cyzydl && that.$refs.cyzydl.show() }else{ that.$message.error(res.message || '获取抽样专业失败') } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) }, // 检查专业确认状态 checkSpecialtyConfirmStatus(xxid){ const that = this const params = { xxid: xxid } $.post("/www/public/newcy/xxzyqrzt", params, function(res){ if(res.success==1 || res.error==0){ // 返回的是未确认的数量,0则不显示按钮,大于0显示按钮 const unconfirmedCount = res.data || 0 that.showSpecialtyButtons = unconfirmedCount == 0 }else{ // 接口失败时默认显示按钮 that.showSpecialtyButtons = true } }).fail((xhr,status,error)=>{ // 请求失败时默认显示按钮 that.showSpecialtyButtons = true }) }, // 选中/取消选中专业 selectSpecialty(index) { const selectedIndex = this.selectedSpecialtyIndexes.indexOf(index); if (selectedIndex > -1) { // 如果已选中,则取消选中 this.selectedSpecialtyIndexes.splice(selectedIndex, 1); } else { // 如果未选中,则添加到选中列表 this.selectedSpecialtyIndexes.push(index); } }, confirmSpecialty(){ const that = this if(!that.specialtyList || !that.specialtyList.length){ return that.$message.warning('暂无抽样专业') } // 如果有选中的专业,只确认选中的专业;否则确认所有专业 const specialtiesToConfirm = that.selectedSpecialtyIndexes.length > 0 ? that.selectedSpecialtyIndexes.map(index => that.specialtyList[index]) : that.specialtyList; const names = specialtiesToConfirm.map(i=>i.zymc).join('、') this.$confirm(`是否确定${names}?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(()=>{ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { xxid: user.ID } $.post('/www/public/newcy/zyqr', params, function(res){ if(res.success==1 || res.error==0){ that.$message.success(res.message || '确认成功') that.getDownStatus() that.$refs.cyzydl && that.$refs.cyzydl.close && that.$refs.cyzydl.close() }else{ that.$message.error(res.message || '确认失败') } }).fail(()=>{ that.$message.error('请求错误') }) }).catch(()=>{}) }, closecyzydl(){ const that = this that.$refs.cyzydl.close() that.selectedSpecialtyIndexes = []; // 重置选中状态 }, rejectSpecialty(){ const that = this if (that.selectedSpecialtyIndexes.length === 0) { that.$message.warning('请先选择需要修改的专业'); return; } // 只显示选中的专业 that.reportForm = { specialties: that.selectedSpecialtyIndexes.map(() => ({ name: '', code: '' })) } that.$refs.reportSpecialtyDialog && that.$refs.reportSpecialtyDialog.show() }, // 更新专业名称 updateSpecialtyName(index, value) { this.$set(this.reportForm.specialties, index, { ...this.reportForm.specialties[index], name: value }); }, // 更新专业代码 updateSpecialtyCode(index, value) { this.$set(this.reportForm.specialties, index, { ...this.reportForm.specialties[index], code: value }); }, submitReportSpecialty(){ const that = this const list = [] // 遍历specialtyList来构建传参数组 that.specialtyList.forEach((specialty, index) => { const reportSpecialty = that.reportForm.specialties[index] if(reportSpecialty) { const zymc = reportSpecialty.name || specialty.zymc const zybm = reportSpecialty.code || specialty.zybm if(zymc && zybm) { list.push({ id: specialty.id, zymc: zymc, zybm: zybm }) } } }) if(!list.length){ return that.$message.warning('请至少填写一个完整的专业名称和代码') } var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { list: JSON.stringify(list) } $.post('/www/public/newcy/zhuanyefugai', params, function(res){ if(res.success==1 || res.error==0){ that.$message.success(res.message || '上报成功') that.cyzyLists() that.$refs.reportSpecialtyDialog && that.$refs.reportSpecialtyDialog.close && that.$refs.reportSpecialtyDialog.close() }else{ that.$message.error(res.message || '上报失败') } }).fail(()=>{ that.$message.error('请求错误') }) }, cyzydlclose(){ const that = this that.$refs.cyzydl.close() }, teachersubmit(){ var that = this this.$refs['ruleForms'].validate((valid) => { if (valid) { const params = { ...this.ruleForms } $.post("/www/public/shangbao/updatejjlsxm ", params, function(res){ if(res.success==1){ that.getDetail() that.$message.success(res.message) that.$refs.baseDialog1jss.close() }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) } else { console.log('error submit!!'); return false; } }); }, editTeacher(row){ this.ruleForms = {...row} this.$refs.baseDialog1jss.show() }, getDetail(row){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { nj:that.detailrow.nj, bjmc:that.detailrow.bjmc, xxid:user.ID } $.get("/www/public/shangbao/findsbbjlsmc", params, function(res){ if(res.success==1){ that.teaList = res.data }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) }, showDetail(row){ this.detailrow=row this.getDetail(this.detailrow) this.$refs.jsxxxxjxg.show() }, preStep(){ this.$emit('preStep') }, nextStep(){ if(!this.tableData.length) return this.$message.warning('请先完成数据上报') this.$emit('nextStep',3) }, submit(){ var that = this this.$refs['ruleForm'].validate((valid) => { if (valid) { const params = { ...this.ruleForm } $.post("/www/public/shangbao/editbjinfo", params, function(res){ if(res.success==1){ that.$message.success(res.message) that.$refs.baseDialog1js.close() that.getList() }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{ that.$message.error('请求错误') }) } else { console.log('error submit!!'); return false; } }); }, handleEdit(row){ this.ruleForm = {...row} this.$refs.baseDialog1js.show() }, getList(){ var that = this const params = { ...this.pages } $.get("/www/public/shangbao/findbjinfo", params, function(res){ if(res.success==1){ that.tableData = res.data that.total = res.total }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, onError(){}, // /www/public/shangbao/findbjinfo download(){ var that = this var xxjd = localStorage.getItem('xxjd') //1zz 2gz 3gx var type = xxjd /*switch(xxjd) { case 1: alert(1) break; case 2: 代码块 break; default: 默认代码块 } */ const params = { type, } axios({ method: 'get', url: '/www/public/shangbao/bjImportTmepDownload', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '班级信息导入模版.xlsx'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, customUpload(params) { var that = this var xxjd = localStorage.getItem('xxjd') var importType = xxjd that.loading = true // 获取路由参数status var status = that.$route.query.status var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const formData = new FormData() console.log(params.file,'params.file') formData.append('file', params.file) // 这是file入参,文件信息 if(status == '1') { // 原来的逻辑 formData.append('type', importType) // 调接口 axios.post('/www/public/shangbao/import_bj_info_new', formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ //that.$message.success('导入成功') that.loading = false that.getList() }else{ that.loading = false //that.$message.error(data.message) } that.result = data.message that.$refs.importResultDialogW.show() }) .catch(error => { that.loading = false that.$message.error(error) console.error(error); }); } else if(status == '2') { // 新的逻辑 formData.append('xxid', schoolid) // 调接口 axios.post('/www/public/shimingimport/drxs1', formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ //that.$message.success('导入成功') that.loading = false that.getList() }else{ that.loading = false //that.$message.error(data.message) } that.result = data.message that.$refs.importResultDialogW.show() }) .catch(error => { that.loading = false that.$message.error(error) console.error(error); }); } else { // 默认使用原来的逻辑 formData.append('type', importType) // 调接口 axios.post('/www/public/shangbao/import_bjls_info_new', formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ //that.$message.success('导入成功') that.loading = false that.getList() }else{ that.loading = false //that.$message.error(data.message) } that.result = data.message that.$refs.importResultDialogW.show() }) .catch(error => { that.loading = false that.$message.error(error) console.error(error); }); } }, del(row){ var that = this let params = {id:row.id} /*if(row.id){ params = { ids:JSON.stringify([row.id]), } }else if(that.multipleSelection.length){ params.ids = [] console.log( that.multipleSelection,' that.multipleSelection') that.multipleSelection.forEach(item=>{ params.ids.push(item.id) }) params.ids = JSON.stringify(params.ids) console.log( params,' params') }else{ that.$message.warning('请先选择数据') }*/ $.post("/www/public/shangbao/deletebjinfo", params, function(res){ if(res.success==1){ that.$message.success('删除成功') that.getList() }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{ that.$message.success('请求错误') }) }, handleSelectionChange(val) { console.log(val,'val') this.multipleSelection = val; }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.getList() }, downloadTemplate() {}, showStudentInfoDialog1() {}, importStudentInfo() {}, exportStudentInfoFromDialog() {}, }, computed:{ }, created: function(){ this.getList() var xxjd = localStorage.getItem('xxjd')||'' this.sfnmlc = JSON.parse(localStorage.getItem('sfnmlc')) this.xxjd = xxjd if(this.xxjd>3){ this.getDownStatus() } var njOption this.homezt = this.$route.query.homezt switch(xxjd) { case '1': njOption = ['四年级','五年级','六年级'] break; case '2': njOption = ['七年级','八年级','九年级'] break; case '3': njOption = ['高一年级','高二年级','高三年级'] break; case '4': njOption = ['中职一年级','中职二年级','中职三年级'] break; case '5': njOption = ['高职一年级','高职二年级','高职三年级'] break; case '6': njOption = ['本科一年级','本科二年级','本科三年级','本科四年级','本科五年级','硕士一年级','硕士二年级','硕士三年级','博士一年级','博士二年级','博士三年级','博士四年级','博士五年级'] break; default: njOption = [] } this.njOption = njOption }, mounted: function(){ }, props: ['title', 'data', 'config','disableStatus'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-ssgzzj-view", function(resolve, reject){ var template = "
\n\n \n
\n\n
{{titles.title1}}
\n
\n \n \n
{{(textarea.jbqk || '').length}}/1000
\n
\n
{{titles.title2}}
\n\n
\n \n \n
{{(textarea.qkhz || '').length}}/1000
\n
\n
{{titles.title3}}
\n
\n \n \n
{{(textarea.jy || '').length}}/1000
\n
\n
{{titles.title4}}
\n
\n \n \n
{{(textarea.ws || '').length}}/1000
\n
\n
\n 暂存\n 提交\n
\n\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { textarea:{ jbqk:'', qkhz:'', jy:'', ws:'' }, id:'', type:0, // 1:220, 2:310, 3:410, 4:450 titles: { title1: '', title2: '', title3: '', title4: '' } }; }, methods: { save(){ const that =this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} // 验证至少有一个字段不为空 let hasContent = false; if(that.textarea.jbqk && that.textarea.jbqk.trim()) hasContent = true; if(that.textarea.qkhz && that.textarea.qkhz.trim()) hasContent = true; if(that.textarea.jy && that.textarea.jy.trim()) hasContent = true; if(that.type !== 4 && that.textarea.ws && that.textarea.ws.trim()) hasContent = true; if(!hasContent){ that.$message.warning('请至少填写一项内容后再提交'); return; } let data ={ id:that.id, userid:user.ID, type:that.type, sftj:'2', ...that.textarea } $.post("/www/public/bd/ybxssqksmadd", data, function(res){ if(res.error==0){ that.getList() that.$router.push('home') that.$message.success(res.message) }else{ that.$message.error(res.message) } }) }, savezc(){ const that =this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let data ={ id:that.id, userid:user.ID, type:that.type, sftj:'1', ...that.textarea } $.post("/www/public/bd/ybxssqksmadd", data, function(res){ if(res.error==0){ that.getList() that.$message.success(res.message) }else{ that.$message.error(res.message) } }) }, getList(){ const that =this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let data ={ userid:user.ID, } $.get("/www/public/bd/ybxssqksmfind",data, function(res){ if (res.error == 0) { that.id = res.data.id; that.textarea.jbqk = res.data.jbqk; that.textarea.qkhz = res.data.qkhz; that.textarea.jy = res.data.jy; if(res.data.ws) { that.textarea.ws = res.data.ws; } }else{ // that.$message.error(res.message) } }) }, updateTitles(){ if(this.type == 1) { // 220 this.titles.title1 = '一、组织实施的基本情况'; this.titles.title2 = '二、测前准备情况汇总(含省级视导员测前指导监督各抽测区县和参测学校准备情况)'; this.titles.title3 = '三、测试过程中发现问题及意见建议'; this.titles.title4 = '四、您认为其他方面需要改进和完善的意见建议'; } else if (this.type == 2) { // 310 this.titles.title1 = '一、组织实施的基本情况'; this.titles.title2 = '二、测前准备情况汇总(含省级视导员测前指导监督各抽测区县和参测学校准备情况)'; this.titles.title3 = '三、测试过程中发现问题及意见建议'; this.titles.title4 = '四、您认为其他方面需要改进和完善的意见建议'; } else if (this.type == 3) { // 410 this.titles.title1 = '一、组织实施的基本情况'; this.titles.title2 = '二、测前准备情况汇总(含省级视导员测前指导监督各抽测区县和参测学校准备情况)'; this.titles.title3 = '三、测试过程中发现问题及意见建议'; this.titles.title4 = '四、您认为其他方面需要改进和完善的意见建议'; } else if (this.type == 4) { // 450 this.titles.title1 = '一、本校监测任务概况'; this.titles.title3 = '二、本校实施工作的安排与条件保障(包括:各样本校机房情况、测试时间安排、校内监测工作人员安排要求等)'; this.titles.title4 = '三、本校实施工作应急处置预案'; } } }, created: function(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} if(user.Roles.includes("220")){ this.type = 1; } if(user.Roles.includes("310")){ this.type = 2; } if(user.Roles.includes("410")){ this.type = 3; } if(user.Roles.includes("450")){ this.type = 4; } this.updateTitles(); this.getList(); }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-hzyjsj-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n \n 新增事件\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n 取 消\n 确 定\n
\n
\n \n \n \n \n \n {{ detailData.sjfssj }}\n {{ detailData.bgrq }}\n {{ detailData.bgr }}\n {{ detailData.fzr }}\n {{ detailData.jtsj }}\n {{ detailData.czbf }}\n \n \n
\n 关 闭\n
\n
\n
\n
\n
"; return (function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { searchQuery: '', // 搜索关键词 events: [], // 应急事件数据 currentPage: 1, // 当前页码 pageSize: 10, // 每页条数 total: 0, // 总条数 rolestype:'', // 状态数据 statusData: {}, // 弹窗控制 dialogVisible: false, isEditing: false, // 是否为编辑模式 detailDialogVisible: false, // 详情弹窗控制 // 详情数据 detailData: {}, // 表单数据 - 严格匹配接口字段 eventForm: { id: '', userid: '', // sf: '', // 省份名称 // djs: '', // 地级市名称 // qx: '', // 区县名称 //xxmc: '', // 学校名称 sjfssj: '', // 事件发生时间 jtsj: '', // 具体事件 czbf: '', // 处置办法 bgr: '', // 报告人 fzr: '', // 负责人 bgrq: '' // 报告时间 }, // 表单验证规则 formRules: { // sf: [{ required: true, message: '请输入省份名称', trigger: 'blur' }], // djs: [{ required: true, message: '请输入地级市名称', trigger: 'blur' }], // qx: [{ required: true, message: '请输入区县名称', trigger: 'blur' }], //xxmc: [{ required: true, message: '请输入学校名称', trigger: 'blur' }], sjfssj: [{ required: true, message: '请选择事件发生时间', trigger: 'change' }], jtsj: [{ required: true, message: '请输入具体事件描述', trigger: 'blur' }], czbf: [{ required: true, message: '请输入处置办法', trigger: 'blur' }], bgr: [{ required: true, message: '请输入报告人', trigger: 'blur' }], bgrq: [{ required: true, message: '请选择报告时间', trigger: 'change' }], fzr: [{ required: true, message: '请输入负责人', trigger: 'blur' }], } }; }, computed: { // 过滤后的应急事件数据(实现搜索功能) filteredEvents() { if (!this.searchQuery) return this.events; return this.events.filter(event => { return ( (event.jtsj && event.jtsj.includes(this.searchQuery)) || (event.czbf && event.czbf.includes(this.searchQuery)) || (event.bgr && event.bgr.includes(this.searchQuery)) || (event.fzr && event.fzr.includes(this.searchQuery)) ); }); } }, methods: { // 获取状态数据 getStatusData() { const that = this; $.get("/www/public/bd/txqkztfindbyxxid", function(res) { if (res.error == 0 && res.data) { that.statusData = res.data; } else { that.$message.error(res.message || '获取状态失败'); } }).fail(function() { that.$message.error('获取状态失败,请检查网络连接'); }); }, // 获取应急事件列表 - 使用GET接口 fetchEvents() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; // 调用查询接口 $.get("/www/public/bd/yjsjbgpage", { userid: user.ID, type:this.rolestype, pageNo: this.currentPage, pageSize: this.pageSize }, function(res) { if (res.error == 0) { that.events = res.data.data; that.total = res.data.total; } else { that.$message.error(res.message || '获取应急事件失败'); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, completeUpload: function(field) { var self = this; const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var params = { xxid: user.ID, yjsjsfscwc:'2' }; this.$confirm('确认完成上传吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(function() { $.post('/www/public/bd/yjsjbgtjedit', params, function(res) { if (res.code === 200) { self.$message.success('操作成功'); self.getStatusData(); // 重新获取状态数据 } else { self.$message.error(res.message || '操作失败'); } }); }).catch(function() {}); }, // 打开新增弹窗 openAddDialog() { this.isEditing = false; this.eventForm = { id: '', userid: '', type: this.rolestype, // sf: '', //djs: '', //qx: '', //xxmc: '', sjfssj: '', jtsj: '', czbf: '', bgr: '', fzr: '', bgrq: '' }; this.dialogVisible = true; // 重置表单验证状态 if (this.$refs.eventForm) { this.$refs.eventForm.resetFields(); } }, // 编辑事件 editEvent(event) { this.isEditing = true; this.eventForm = { id: event.id, userid: event.userid, type: event.type || this.rolestype, // sf: event.sf, // djs: event.djs, //qx: event.qx, //xxmc: event.xxmc, sjfssj: event.sjfssj, jtsj: event.jtsj, czbf: event.czbf, bgr: event.bgr, fzr: event.fzr, bgrq: event.bgrq }; this.dialogVisible = true; }, // 查看详情 viewDetail(event) { this.detailData = { // sf: event.sf, // djs: event.djs, //qx: event.qx, //xxmc: event.xxmc, sjfssj: event.sjfssj, jtsj: event.jtsj, czbf: event.czbf, bgr: event.bgr, fzr: event.fzr, bgrq: event.bgrq }; this.detailDialogVisible = true; }, // 保存事件(新增或更新) saveEvent() { this.$refs.eventForm.validate((valid) => { if (!valid) { this.$message.warning('请填写所有必填项'); return; } const that = this; const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; const userId = user.ID || ""; // 设置userid this.eventForm.userid = userId; // 调用添加/编辑接口 $.post("/www/public/bd/yjsjbgadd", this.eventForm, function(res) { if (res.error == 0) { that.$message.success(res.message || '保存成功'); that.dialogVisible = false; that.fetchEvents(); // 刷新列表 } else { that.$message.error(res.message || '保存失败'); } }, "json").fail(function(xhr) { that.$message.error('请求失败:' + (xhr.responseJSON?.message || xhr.statusText)); }); }); }, // 删除事件(预留功能) deleteEvent(id) { const that = this that.$confirm('确定要删除此事件吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { // 实际接口调用 $.get("/www/public/bd/yjsjbgdelete", { id: id }, function(res) { if (res.error == 0) { that.$message.success('删除成功'); that.fetchEvents(); } else { that.$message.error(res.message || '删除失败'); } }); }).catch(() => { this.$message.info('已取消删除'); }); }, // 改变每页数量 handleSizeChange(size) { this.pageSize = size; this.currentPage = 1; this.fetchEvents(); }, // 改变当前页 handleCurrentChange(page) { this.currentPage = page; this.fetchEvents(); } }, created: function() { this.rolestype = this.$route.query.rolestype this.fetchEvents(); this.getStatusData(); }, mounted: function() { } }); }); })(template, resolve, reject); }); RegVueCom("xljk-loginssd-view", function(resolve, reject){ var template = "
\n \n \n \n \n 此处手机号用于接收“忘记密码”的短信,不用于登录\n \n \n \n \n \n \n 密码格式为长度8-14位字母、数字和特殊字符的组合\n \n \n \n \n \n
\n 取 消\n 确 定\n
\n
\n\n \n \n \n \n \n \n \n {{buttonText}}\n \n \n \n
\n 取 消\n 确 定\n
\n
\n \n \n \n \n 密码格式为长度8-14位字母、数字和特殊字符的组合\n \n \n \n \n \n
\n 取 消\n 确 定\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n
\n
\n
\n
\n \n 记住密码\n \n \n 忘记密码\n \n
\n
\n
\n
\n 登录\n
\n
\n \n
\n 请使用谷歌浏览器访问\n
\n
"; return (function(template, resolve, reject){ var store = new Vuex.Store({ state: { accessToken:'', userInfo:{}, user:localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} }, mutations:{ accessToken(state, accessToken) { state.accessToken = accessToken; }, userInfo(state, userInfo) { state.userInfo = userInfo; }, user(state, user) { state.user = user; }, } }); seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), GdialogVisibles:false, WdialogVisibles:false, codesrc:'/owin/api/authcode?q=2069', isTiming: false, timeLeft: 30, // 倒计时秒数 intervalId: null, // 定时器ID buttonText: '发送短信', buttoncolor:'#409EFF',//#F5F7FA textcolor:'#fff',//#909399 Wforms:{ msCode:'', phone:'' }, Gforms:{ oldpassword: '', newpassword: '', GconfirmNewpassword:'' }, ruleForm:{ name:'', paw:'', authcode:'', rememberMe:false }, formLabelWidth: '130px', forms: { oldpassword: '', newpassword: '', confirmNewpassword: '', sjhm:'' }, dialogVisibles:false, Gruless: { newpassword: [ { required: true, message: '请输入新密码', trigger: 'blur' }, { pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[@$!%*?&=])[A-Za-z\d@$!%*?&=]{8,14}$/, message: '密码格式不符合要求,需包含字母、数字和特殊字符,长度8-14位', trigger: 'blur' } ], GconfirmNewpassword: [ { required: true, message: '请再次输入新密码!', trigger: 'blur' }, { validator: this.validatePasswordMatch, trigger: 'blur' } ], }, ruless: { oldpassword: [ { required: true, message: '请输入当前密码', trigger: 'blur' } ], newpassword: [ { required: true, message: '请输入新密码', trigger: 'blur' }, { pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[@$!%*?&=])[A-Za-z\d@$!%*?&=]{8,14}$/, message: '密码格式不符合要求,需包含字母、数字和特殊字符,长度8-14位', trigger: 'blur' } ], confirmNewpassword: [ { required: true, message: '请再次输入新密码。', trigger: 'blur' }, { validator: this.validatePasswordMatch1, trigger: 'blur' } ], phone: [ { required: true, message: '请输入手机号', trigger: 'blur' }, { validator: publicUtilsOfCheck.isValidPhoneNumber, trigger: 'blur' } ], sjhm: [ { required: true, message: '请输入联络人手机', trigger: 'blur' }, { validator: publicUtilsOfCheck.isValidPhoneNumber, trigger: 'blur' } ], }, rules: { name: [ { required: true, message: '请输入姓名', trigger: 'blue' } ], paw: [ { required: true, message: '请输入密码', trigger: 'blue' } ], authcode: [ { required: true, message: '请输入验证码', trigger: 'blue' } ] }, }; }, methods: { validatePasswordMatch1(rule, value, callback){ if(value===this.forms.newpassword){ return callback(); }else{ return callback(new Error('密码不一致')); } }, validatePasswordMatch(rule, value, callback){ if(value===this.Gforms.newpassword){ return callback(); }else{ return callback(new Error('密码不一致')); } }, tijiaoGforms(formName){ var that = this this.$refs[formName].validate((valid) => { if (valid) { const params = { xmima:this.Gforms.newpassword, sjhm:this.Wforms.phone } $.get("/www/public/shouye/mima_chongzhi", params, function(res){ if(res.error==0){ that.$message.success(res.message) that.GdialogVisibles = false that.WdialogVisibles = false }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{}) } else { console.log('error submit!!'); return false; } }); }, tijiaoWforms(formName){ var that = this this.$refs[formName].validate((valid) => { if (valid) { const params = { yzm:this.Wforms.msCode, sjhm:this.Wforms.phone } $.get("/www/public/shouye/mima_hs_yzm", params, function(res){ if(res.error==0){ that.GdialogVisibles = true that.$nextTick(()=>{ that.Gforms = { oldpassword: '', newpassword: '', GconfirmNewpassword:'' } that.$refs.GformRefs.resetFields() }) }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{}) } else { console.log('error submit!!'); return false; } }); }, showWDialog(){ this.WdialogVisibles = true this.$nextTick(()=>{ this.$refs.WformRefs.resetFields(); this.Wforms = { msCode:'', phone:'' } }) }, sendSms() { var that = this if(!this.Wforms.phone){ return this.$message.warning('请先填写手机号') } publicUtilsOfCheck.isValidPhoneNumber({},this.Wforms.phone,(promise)=>{ console.log(promise,'promise') console.log(promise=='Error: 手机号格式不对','promise') if(promise=='Error: 手机号格式不对') return that.$message.warning('手机号格式不对') // 这里添加发送短信的逻辑,比如调用API const params = { sjhm:this.Wforms.phone } console.log('短信已发送'); $.get("/www/public/shouye/mima_send_yzm", params, function(res){ if(res.error==0){ // 开始倒计时 that.buttoncolor = '#F5F7FA' that.textcolor = '#909399' that.startTimer(); }else{ that.$message.error(res.message) } }).fail((xhr,status,error)=>{}) }) }, startTimer() { this.isTiming = true; this.buttonText = `重新发送 (${this.timeLeft}s)`; // 使用setInterval设置一个每秒执行一次的定时器 this.intervalId = setInterval(() => { this.timeLeft--; this.buttonText = `重新发送 (${this.timeLeft}s)`; // 当倒计时结束时,重置状态 if (this.timeLeft <= 0) { this.stopTimer(); this.textcolor = '#fff' this.buttoncolor = '#409EFF' } }, 1000); }, stopTimer() { this.isTiming = false; this.timeLeft = 30; this.buttonText = '发送短信'; // 清除定时器 if (this.intervalId) { clearInterval(this.intervalId); this.intervalId = null; } }, remeber() { if (this.ruleForm.rememberMe) { // 加密密码 const encryptedPassword = CryptoJS.AES.encrypt(this.ruleForm.paw, 'quanguoxinlijiankang').toString(); // 存储用户信息到 localStorage localStorage.setItem('username', this.ruleForm.name); localStorage.setItem('password', encryptedPassword); localStorage.setItem('rememberMe', 'true'); } else { // 清除存储的用户信息 localStorage.removeItem('username'); localStorage.removeItem('password'); localStorage.removeItem('rememberMe'); } }, rulesInput(formName){ this.$refs[formName].validate((valid) => { if (valid) { this.goHome() } else { return false; } }); }, rulesInputs(formName){ $.post("/www/public/mh/get_pgsxx", {}, function(res){ }) }, //获取学段 getBzrxd(){ $.get("/www/public/shangbao/findlsxxxd", {}, function(res){ if(res.error==0){ localStorage.setItem('xxjd',res.data.xd) }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, getxxjd(user){ //var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID this.Nickname = user.Nickname const params1 = { schoolid } $.get("/www/public/shangbao/findschoolxd", params1, function(res){ if(res.success==1){ localStorage.setItem('xxjd',res.data.xd) }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, getadminInfo(user){ var schoolid = user.ID const params1 = { schoolid } $.post("/www/public/shangbao/findschollgly", params1, function(res){ if(res.success==1){ localStorage.setItem('glyInfo',JSON.stringify(res.data)) }else{ that.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, resetForm(formName) { this.$refs[formName].resetFields(); }, saves() { const that = this that.$refs.formRefs.validate((valid) => { if (valid) { const id = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')).ID:'' let data = { ...that.forms } $.post("/www/public/shangbao/editPassword", data, function(res){ if(res.error==0){ that.$message.success('登录成功'); that.$router.push('/XDHomePage') that.dialogVisibles =false }else{ that.$message.error(res.message) } }) } else { console.error('表单验证失败'); return false; } })}, goHome(){ const that = this this.getCodeSrc() that.remeber() let data = { username:this.ruleForm.name, password:this.ruleForm.paw, authcode:this.ruleForm.authcode } $.post("/core/Login/DoLogin", data, function(res){ if(res.success==1){ $.post("/www/dd/ai/user", function(res){ if(res.Roles.includes("123123")){ if(res.ID){ that.$store.commit('user', res); localStorage.setItem('user', JSON.stringify(res)) /*$.post("/www/public/liangbiao/cp_getAccessToken", {}, function(res){ if(res.code==200){ that.$store.commit('accessToken', res.data.accessToken); localStorage.setItem('accessToken', res.data.accessToken) setTimeout(()=>{ that.$router.push('beforeEvaluations') },100) that.$message.success('登录成功'); } })*/ that.$message.success('登录成功'); that.$router.push('evaluationList') } else{ that.$message.error(res.message); } }else if(res.Roles.includes("110")){ window.open('/www/dd/vue/spa/xljkmh#/',"_self") } else if(res.Roles.includes("998")||res.Roles.includes("999")||res.Roles.includes("221")||res.Roles.includes("120")){ window.open('/content/vab/#/index',"_self") }else if(res.Roles.includes("810")){ localStorage.setItem('Roles', JSON.stringify(res.Roles)) if(res.ID){ that.$store.commit('user', res); localStorage.setItem('user', JSON.stringify(res)) that.$router.push('NewftInterviewHomepage') that.$message.success('登录成功'); $.post("/www/public/liangbiao/cp_getAccessToken", {}, function(res){ if(res.code==200){ that.$store.commit('accessToken', res.data.accessToken); localStorage.setItem('accessToken', res.data.accessToken) } }) }else{ that.$message.error(res.message); } }else if(res.Roles.includes("450")){ if(res.ID){ //that.getxxjd(res) that.$store.commit('user', res); localStorage.setItem('user', JSON.stringify(res)) that.getadminInfo(res) if(res.UserFilter.sfdycdl=='f'){ that.dialogVisibles = true return } that.$message.success('登录成功'); that.$router.push('/XDHomePage') } else{ that.$message.error(res.message); } }else if(res.Roles.includes("600")){ if(res.ID){ that.$store.commit('user', res); localStorage.setItem('user', JSON.stringify(res)) that.getxxjd(res) that.getadminInfo(res) that.$message.success('登录成功'); that.$router.push('/ZJYJLS') } else{ that.$message.error(res.message); } }else if(res.Roles.includes("750")){ if(res.ID){ that.$store.commit('user', res); localStorage.setItem('user', JSON.stringify(res)) that.getxxjd(res) that.getadminInfo(res) $.get("/www/public/shangbao/findxsxdxx", {}, function(res){ if(res.error ==0){ $.post("/www/public/st/getstlist", data, function(res){ if(res.error==0){ if(res.data[0]){ const sjid = res.data[0].sjid that.$router.push({ path:'csgl', query:{gaugeId:sjid} }) that.$message.success('登录成功'); } } }) }else{ } }) } else{ that.$message.error(res.message); } }else if(res.Roles.includes("700")||res.Roles.includes("710")||res.Roles.includes("720")||res.Roles.includes("730")){ if(res.ID){ that.$store.commit('user', res); localStorage.setItem('user', JSON.stringify(res)) // 动态获取当前域名/IP和路径 const currentUrl = new URL(window.location.href); const baseUrl = `${currentUrl.protocol}//${currentUrl.host}`; // 从当前URL中提取基础路径(移除哈希和参数) const pathSegments = currentUrl.pathname.split('/'); pathSegments.pop(); // 移除当前文件名 const basePath = pathSegments.join('/'); // 拼接动态目标URL const targetUrl = `${baseUrl}${basePath}/pxglweb#/?user=${encodeURIComponent(JSON.stringify(res))}`; window.location.href = targetUrl; } }else if(res.Roles.includes("610")){ if(res.ID){ that.$store.commit('user', res); localStorage.setItem('user', JSON.stringify(res)) that.getxxjd(res) that.getadminInfo(res) that.$message.success('登录成功'); that.$router.push('/CYLS') } else{ that.$message.error(res.message); } }else if(res.Roles.includes("890")){ if(res.ID){ that.$store.commit('user', res); localStorage.setItem('user', JSON.stringify(res)) that.getxxjd(res) that.getadminInfo(res) that.$message.success('登录成功'); that.$router.push('/dataList') } else{ that.$message.error(res.message); } }else if(res.Roles.includes("500")){ if(res.ID){ that.$store.commit('user', res); localStorage.setItem('user', JSON.stringify(res)) that.getxxjd(res) that.getadminInfo(res) $.get("/www/public/shangbao/findxsxdxx", {}, function(res){ if(res.error ==0){ $.post("/www/public/st/getstlist", data, function(res){ if(res.error==0){ if(res.data[0]){ const sjid = res.data[0].sjid that.$router.push({ path:'beforeEvaluations', query:{gaugeId:sjid} }) that.$message.success('登录成功'); } } }) }else{ } }) } else{ that.$message.error(res.message); } }else if(res.Roles.includes("220")||res.Roles.includes("310")||res.Roles.includes("410")){ if(res.ID){ that.$store.commit('user', res); localStorage.setItem('user', JSON.stringify(res)) if(res.UserFilter.sfdycdl=='f'){ that.dialogVisibles = true return } that.$message.success('登录成功'); that.$router.push('/XDHomePage') } else{ that.$message.error(res.message); } }else if(res.Roles.includes("820")){ if(res.ID){ that.$store.commit('user', res); localStorage.setItem('user', JSON.stringify(res)) // 动态获取当前域名/IP和路径 const currentUrl = new URL(window.location.href); const baseUrl = `${currentUrl.protocol}//${currentUrl.host}`; // 从当前URL中提取基础路径(移除哈希和参数) const pathSegments = currentUrl.pathname.split('/'); pathSegments.pop(); // 移除当前文件名 const basePath = pathSegments.join('/'); // 拼接动态目标URL const targetUrl = `${baseUrl}${basePath}/sjgl#/?user=${encodeURIComponent(JSON.stringify(res))}`; window.open(targetUrl); } } else if(res.Roles.includes("770")){ if(res.ID){ that.$store.commit('user', res); localStorage.setItem('user', JSON.stringify(res)) if(res.UserFilter.sfdycdl=='f'){ that.dialogVisibles = true return } that.$message.success('登录成功'); that.$router.push('/home') } else{ that.$message.error(res.message); } } else{ that.$message.error('该账号目前无权限'); } }) }else{ that.loading=false that.$message.warning(res.message); } }) }, getCodeSrc(){ this.codesrc = this.codesrc.replace(/\d+$/, parseInt(Math.random()*10000)) }, }, created: function(){ this.getCodeSrc() }, mounted: function(){ // 检查 localStorage 中是否有记住的用户信息 if (localStorage.getItem('rememberMe') === 'true') { this.ruleForm.name = localStorage.getItem('username'); // 解密密码 const encryptedPassword = localStorage.getItem('password'); const bytes = CryptoJS.AES.decrypt(encryptedPassword, 'quanguoxinlijiankang'); this.ruleForm.paw = bytes.toString(CryptoJS.enc.Utf8); this.ruleForm.rememberMe = true; } }, beforeDestroy() { // 组件销毁前清除定时器 this.stopTimer(); }, store: store, watch:{ //监听参数中的 props.markerLists 变化 $route:{ handler(newValue, oldValue){ if(newValue.query.otype == '0'){ this.routerAcitve = '/evaluation' }else if(newValue.query.otype == '1'){ this.routerAcitve = '/interview' }else{ this.routerAcitve = newValue.path } }, // 深度侦听需要遍历被侦听对象中的所有嵌套的属性,当用于大型数据结构时,开销很大。 // 因此请只在必要时才使用它,并且要留意性能。 deep: true, }, }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-classInfoUploadNew", function(resolve, reject){ var template = "
\n
\n
\n
\n 添加单个班级\n 添加单个学生\n
\n
\n \n 导出学生信息\n 批量添加学生信息\n \n \n 查询\n
\n
\n
\n \n
\n \n
\n
\n \n \n {{ user.Nickname || '学校名称' }}\n \n
\n \n \n \n \n {{ node.label }}\n \n \n \n \n \n \n \n
\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n
\n 上 一 步\n 下 一 步\n 撤回修改\n 提 交\n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n 取 消\n 确 定\n
\n
\n \n \n \n \n \n \n 参加\n 不参加\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n 取 消\n 确 定\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n 取 消\n 确 定\n
\n
\n \n \n \n
\n
\n 学生姓名:\n {{ currentStudent.xm || '-' }}\n
\n
\n 班级:\n {{ currentStudent.bj || '-' }}\n
\n
\n 未参加原因:\n {{ currentStudent.reason || '暂无原因' }}\n
\n
\n
\n 关 闭\n
\n
\n \n \n \n
\n
\n

模板下载

\n

下载学生信息导入模板,按照模板格式填写学生信息

\n 下载学生信息导入模版\n
\n \n
\n

批量导入

\n

选择填写好的学生信息表文件进行批量导入

\n \n 批量导入且覆盖已有信息\n

\n 提示:首次导入时,将上传所有学生信息。再次导入时,平台中原有学生信息将被【覆盖】,整体更新为最新导入的信息。\n

\n
\n \n
\n
\n 关 闭\n
\n
\n \n \n
\n \n
\n

提示:若要将学生添加到现有班级,其“年级班级专业”信息必须与目标班级的名称完全一致,表格内只填写新增学生,系统中已有学生请勿添加在表格中

\n 学校现有班级年级专业信息查看\n 追加学生信息导入\n
\n \n \n
\n
\n 关 闭\n
\n
\n \n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n 查询\n 导出\n \n \n
\n \n \n
\n \n \n \n \n \n \n
\n \n \n
\n \n \n
\n
\n \n
\n
"; return (function(template, resolve, reject) { seajs.use([], function () { return resolve({ template: template, data: function () { return { id: Math.uuid(), user: '', homezt: '1', // 页面状态标识,设置为1显示完成按钮 treeData: [], sfnmlc: '', tableData: [], tableLoading: false, loading: false, loading1: false, currentSelection: '请选择班级', selectedNode: null, xxjd: '', // 学段:1-小学,2-初中,3-高中,4-中职 selectedStudents: [], // 选中的学生 participationDialog: false, // 修改参与情况弹窗 participationForm: { cyqk: '', // 参与情况 1参加 0不参加(默认不选) reason: '', // 不参与原因 customReason: '' // 自定义原因 }, reasonOptions: [ { value: '家长不同意', label: '家长不同意' }, { value: '学生不存在', label: '学生不存在' }, { value: '休学', label: '休学' }, { value: '事假', label: '事假' }, { value: '病假', label: '病假' }, { value: '其他', label: '其他' } ], treeProps: { children: 'children', label: 'label' }, expandedKeys: [], // 默认展开的节点 currentNodeKey: null, // 当前选中的节点 // 添加学生弹窗 addStudentDialogVisible: false, // 添加学生表单数据 studentForm: { nj: '', bj: '', bjid: '', xm: '', xh: '', xb: '', zy: '', //zybm: '', xxid: '' }, // 表单验证规则 studentRules: { nj: [{ required: true, message: '请选择年级', trigger: 'change' }], bj: [{ required: true, message: '请选择班级', trigger: 'change' }], xm: [{ required: true, message: '请输入学生姓名', trigger: 'blur' }], xh: [{ required: true, message: '请输入唯一标识号', trigger: 'blur' }], xb: [{ required: true, message: '请选择性别', trigger: 'change' }] }, // 下拉选项数据 njOptions: [], bjOptions: [], zyOptions: [], isEdit: false, // 是否为编辑模式 // 添加班级弹窗 addClassDialogVisible: false, // 添加班级表单数据 classForm: { nj: '', bj: '', zy: '', //zybm: '', xd: '', bjlx: '', xxid: '' }, // 班级表单验证规则 classRules: { nj: [{ required: true, message: '请选择年级', trigger: 'change' }], bj: [{ required: true, message: '请输入班级名称', trigger: 'blur' }], zy: [{ required: true, message: '请选择专业', trigger: 'change' }], // zybm: [{ required: true, message: '请输入专业编码', trigger: 'blur' }], bjlx: [{ required: true, message: '请选择班级类型', trigger: 'change' }] }, // 原因弹框相关 reasonDialogVisible: false, currentStudent: {}, // 查询相关 searchForm: { xm: '', // 姓名 xh: '' // 学号 }, // 学生信息表管理弹框 studentInfoDialogVisible: false, studentInfoDialogVisible1: false, studentInfoDialogVisible2: false, // 学校现有班级年级信息相关数据 classGradeInfoData: [], // 表格数据 classGradeInfoLoading: false, // 加载状态 classGradeInfoTotal: 0, // 总条数 classGradeInfoPageNum: 1, // 当前页码 classGradeInfoPageSize: 10, // 每页条数 // 查询表单 classGradeInfoSearchForm: { nj: '', // 年级 bj: '', // 班级 zy: '' // 专业(仅中职) } } }, computed: { // 判断是否为基础教育(小初高) isBasicEducation() { return ['1', '2', '3'].includes(this.xxjd); } }, methods: { withdrawSubmit() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} this.$confirm('确定要撤回上报吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { const params = { xxid: user.ID, shzt: '1' } $.post("/www/public/shangbao/chshangbao", params, function (res) { if (res.success == 1 || res.error == 0) { that.$message.success('撤回成功') that.initFormOptions(); that.$nextTick(() => { that.loadTreeData(); }); that.$emit('refreshStatus') // 通知父组件刷新状态 // 添加整页刷新功能 setTimeout(function () { window.location.reload() }, 1000) // 延迟1秒后刷新,确保消息提示能够显示 } else { that.$message.error(res.message || '撤回失败') } }).fail((xhr, status, error) => { that.$message.error('请求错误') }) }).catch(() => { that.$message.info('已取消撤回') }) }, // 获取用户信息和学段 initUserInfo() { const that = this that.user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; that.xxjd = localStorage.getItem('xxjd') || ''; }, // 获取树形数据 loadTreeData() { const that = this; $.get('/www/public/daoru/findxxbjlist', {}, function (res) { if (res.success == 1 || res.error == 0) { that.treeData = res.data || []; // 规范化:为所有节点补充顶层 id,确保与 node-key 匹配 that.normalizeTreeData(that.treeData); // 默认加载第一个班级的数据(等待树渲染完成) if (that.treeData.length > 0) { that.$nextTick(() => { that.loadFirstClassData(); }); } } else { that.$message.error(res.message || '获取数据失败'); } }).fail((xhr, status, error) => { that.$message.error('请求失败'); }); }, // 加载第一个班级数据(默认展开第一个年级并选中其下第一个班级) loadFirstClassData() { const isBasic = this.isBasicEducation; const getKey = (n) => (n && (n.id || (n.data && n.data.id))) || null; if (!this.treeData || this.treeData.length === 0) return; const firstGrade = this.treeData[0]; let firstMajor = null; let firstClass = null; if (isBasic) { // 基础教育:年级 -> 班级 if (firstGrade && Array.isArray(firstGrade.children) && firstGrade.children.length > 0) { firstClass = firstGrade.children.find(n => this.isClassNode(n)) || firstGrade.children[0]; } } else { // 中职:年级 -> 专业 -> 班级 if (firstGrade && Array.isArray(firstGrade.children) && firstGrade.children.length > 0) { firstMajor = firstGrade.children[0]; if (!this.isMajorNode(firstMajor)) { firstMajor = firstGrade.children.find(n => this.isMajorNode(n)) || firstMajor; } if (firstMajor && Array.isArray(firstMajor.children) && firstMajor.children.length > 0) { firstClass = firstMajor.children.find(n => this.isClassNode(n)) || firstMajor.children[0]; } } } // 回退策略:全树范围查找第一个班级 if (!firstClass) { const findFirstClass = (nodes) => { for (let node of nodes || []) { if (this.isClassNode(node)) return node; if (node.children && node.children.length > 0) { const found = findFirstClass(node.children); if (found) return found; } } return null; }; firstClass = findFirstClass(this.treeData); } if (!firstClass) return; // 设置选中的班级与显示文本 this.selectedNode = { data: firstClass, node: null }; if (isBasic) { this.currentSelection = `${firstClass.data.nj} - ${firstClass.data.bjmc}`; } else { this.currentSelection = `${firstClass.data.nj} - ${firstClass.data.zymc} - ${firstClass.data.bjmc}`; } // 需要展开的父节点keys const expandedKeys = []; const gradeKey = getKey(firstGrade); if (gradeKey) expandedKeys.push(gradeKey); if (!isBasic) { const majorKey = getKey(firstMajor); if (majorKey) expandedKeys.push(majorKey); } const classKey = getKey(firstClass); // 下一帧:展开树并高亮选中班级 this.$nextTick(() => { const runExpand = () => { const tree = this.$refs.tree; if (!tree) return; // 先高亮选中班级 if (classKey) { try { tree.setCurrentKey(classKey); } catch (e) { } } // 显式展开:根据选中班级节点,向上展开父链(年级/专业) let classNodeObj = classKey ? tree.getNode(classKey) : null; let p = classNodeObj ? classNodeObj.parent : null; while (p && p.level >= 1) { try { typeof p.expand === 'function' && p.expand(true); } catch (e) { } p.expanded = true; p = p.parent; } // 兜底:如果传入了需要展开的 keys,逐个尝试展开 (expandedKeys || []).forEach(k => { const n = tree.getNode(k); if (n) { try { typeof n.expand === 'function' && n.expand(true); } catch (e) { } n.expanded = true; } }); // 如果本帧还未拿到节点,再延迟一次重试 if (!classNodeObj) { setTimeout(() => { const t = this.$refs.tree; if (!t) return; classNodeObj = classKey ? t.getNode(classKey) : null; let pp = classNodeObj ? classNodeObj.parent : null; while (pp && pp.level >= 1) { try { typeof pp.expand === 'function' && pp.expand(true); } catch (e) { } pp.expanded = true; pp = pp.parent; } (expandedKeys || []).forEach(k => { const nn = t.getNode(k); if (nn) { try { typeof nn.expand === 'function' && nn.expand(true); } catch (e) { } nn.expanded = true; } }); }, 0); } }; // 再加一次 nextTick,确保 el-tree 完整渲染后再执行展开 this.$nextTick(runExpand); }); // 加载表格数据 this.loadTableData(); }, // 判断节点类型 isGradeNode(data) { // 小初高:年级节点没有data属性或data中没有bjmc if (this.isBasicEducation) { return !data.data || !data.data.bjmc; } // 中职:年级节点(第一层) return data.children && data.children.length > 0 && data.children[0].children; }, isClassNode(data) { // 小初高:班级节点有data且有bjmc if (this.isBasicEducation) { return data.data && data.data.bjmc; } // 中职:班级节点(第三层) return data.data && data.data.bjmc && data.data.zymc; }, isMajorNode(data) { // 只有中职有专业节点(第二层) return !this.isBasicEducation && data.children && data.children.length > 0 && !data.children[0].children; }, // 规范化树数据,确保每个节点都有唯一 id 供 node-key 使用 normalizeTreeData(nodes) { const ensureId = (node) => { if (!node) return; // el-tree 使用 node-key="id",确保此字段存在 if (!node.id) { node.id = (node.data && node.data.id) || `${Date.now()}_${Math.random().toString(36).slice(2, 8)}`; } if (Array.isArray(node.children)) { node.children.forEach(ensureId); } }; (nodes || []).forEach(ensureId); }, // 处理树节点点击 handleNodeClick(data, node) { this.selectedNode = { data, node }; // 只有班级节点才加载学生数据 if (this.isClassNode(data)) { if (this.isBasicEducation) { this.currentSelection = `${data.data.nj} - ${data.data.bjmc}`; } else { this.currentSelection = `${data.data.nj} - ${data.data.zymc} - ${data.data.bjmc}`; } this.loadTableData(); } }, // 加载表格数据 loadTableData() { if (!this.selectedNode || !this.selectedNode.data) { return; } const that = this; this.tableLoading = true; // 调试信息:检查选中节点和班级ID console.log('loadTableData - selectedNode:', this.selectedNode); console.log('loadTableData - selectedNode.data:', this.selectedNode.data); // 从树状结构中正确获取班级ID let bjid = ''; if (this.selectedNode && this.selectedNode.data) { // 树状结构中班级ID在data.data.id中 bjid = this.selectedNode.data.data ? this.selectedNode.data.data.id : this.selectedNode.data.id; } console.log('loadTableData - bjid:', bjid); const params = { xxid: this.user.ID, bjid: bjid, xm: this.searchForm.xm || '', // 姓名查询参数 xh: this.searchForm.xh || '' // 学号查询参数 }; console.log('loadTableData - 请求参数:', params); $.get('/www/public/daoru/findbjxslist', params, function (res) { if (res.success == 1 || res.error == 0) { that.tableData = res.data || []; } else { that.$message.error(res.message || '获取学生列表失败'); that.tableData = []; } that.tableLoading = false; }).fail(() => { that.$message.error('请求失败'); that.tableData = []; that.tableLoading = false; }); }, // 添加年级 addGrade() { this.$message.info('添加年级功能待实现'); }, // 添加班级 addClass(data) { this.$message.info('添加班级功能待实现'); }, // 删除年级 deleteGrade(data) { this.$message.info('删除年级功能待实现'); }, // 删除班级 deleteClass(data) { const that = this; // 先检查班级下是否有学生 const checkParams = { xxid: this.user.ID, bjid: data.id }; $.get('/www/public/daoru/findbjxslist', checkParams, function (res) { if (res.success == 1 || res.error == 0) { const studentList = res.data || []; if (studentList.length > 0) { that.$message.warning('该班级下还有学生,不能删除!'); return; } // 班级下没有学生,可以删除 that.$confirm('确定要删除该班级吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { const params = { bjid: data.id }; $.post('/www/public/daoru/deletebj', params, function (res) { if (res.success == 1 || res.error == 0) { that.$message.success('删除成功'); that.loadTreeData(); // 重新加载树形数据 that.tableData = []; // 清空表格数据 } else { that.$message.error(res.message); } }).fail(() => { that.$message.error('请求失败'); }); }).catch(() => { that.$message.info('已取消删除'); }); } else { that.$message.error('检查班级学生信息失败'); } }).fail(() => { that.$message.error('检查班级学生信息请求失败'); }); }, // 删除专业(中职) deleteMajor(data) { this.$message.info('删除专业功能待实现'); }, // 打开添加班级弹窗 addClassDialog() { this.resetClassForm(); this.loadNjOptions(); // 移除直接加载专业列表的代码,改为在选择年级后通过onClassNjChange加载 this.zyOptions = []; this.addClassDialogVisible = true; }, // 重置班级表单 resetClassForm() { this.classForm = { nj: '', bj: '', zy: '', // zybm: '', xd: this.xxjd, bjlx: '', xxid: this.user.ID }; this.$nextTick(() => { if (this.$refs.classForm) { this.$refs.classForm.clearValidate(); } }); }, // 提交添加班级 submitAddClass() { const that = this; this.$refs.classForm.validate((valid) => { if (valid) { const params = { nj: that.classForm.nj, bj: that.classForm.bj, zy: that.classForm.zy || '', // zybm: that.classForm.zybm || '', xd: that.classForm.xd, bjlx: that.classForm.bjlx || '', xxid: that.classForm.xxid }; $.post('/www/public/daoru/addbj', params, function (res) { if (res.success == 1 || res.error == 0) { that.$message.success('添加班级成功'); that.addClassDialogVisible = false; that.loadTreeData(); // 重新加载树形数据 } else { that.$message.error(res.message || '添加班级失败'); } }).fail(() => { that.$message.error('请求失败'); }); } else { that.$message.error('请检查表单信息'); return false; } }); }, // 添加学生 addStudent() { if (!this.selectedNode || !this.selectedNode.data) { this.$message.warning('请先选择班级'); return; } this.isEdit = false; // 先加载年级选项 this.loadNjOptions(); // 直接设置表单数据,不调用resetStudentForm this.studentForm = { nj: this.selectedNode.data.data.nj, bj: this.selectedNode.data.data.bjmc, bjid: this.selectedNode.data.id, xm: '', xh: '', xb: '', zy: this.xxjd === '4' && this.selectedNode.data.data.zymc ? this.selectedNode.data.data.zymc : '', // zybm: this.xxjd === '4' && this.selectedNode.data.data.zybm ? this.selectedNode.data.data.zybm : '', xxid: '' }; console.log('设置班级信息后的bjid:', this.studentForm.bjid); // 清除表单验证状态 this.$nextTick(() => { if (this.$refs.studentForm) { this.$refs.studentForm.clearValidate(); } }); // 延迟加载班级选项,确保年级已设置 this.$nextTick(() => { if (this.xxjd === '4') { // 中职:先加载专业选项,再加载班级选项 this.loadZyOptions(); this.$nextTick(() => { this.loadBjOptions(); }); } else { // 基础教育:直接加载班级选项 this.loadBjOptions(); } }); this.addStudentDialogVisible = true; }, // 重置学生表单 resetStudentForm() { this.studentForm = { nj: '', bj: '', bjid: '', xm: '', xh: '', xb: '', zy: '', //zybm: '', xxid: '' }; this.$nextTick(() => { if (this.$refs.studentForm) { this.$refs.studentForm.clearValidate(); } }); }, // 提交添加/编辑学生 submitAddStudent() { const that = this; this.$refs.studentForm.validate((valid) => { if (valid) { // 设置学校ID that.studentForm.xxid = this.user.ID || ''; // 确保bjid有值 - 多重保障 if (!that.studentForm.bjid) { // 第一优先级:从班级选项中获取 if (that.studentForm.bj && that.bjOptions.length > 0) { const selectedBj = that.bjOptions.find(option => option.value === that.studentForm.bj); if (selectedBj && selectedBj.id) { that.studentForm.bjid = selectedBj.id; console.log('从班级选项中设置bjid:', that.studentForm.bjid); } } // 第二优先级:从选中节点获取 if (!that.studentForm.bjid && that.selectedNode && that.selectedNode.data) { that.studentForm.bjid = that.selectedNode.data.id; console.log('从选中节点设置bjid:', that.studentForm.bjid); } } // 最终检查bjid是否有值 if (!that.studentForm.bjid) { that.$message.error('无法获取班级ID,请重新选择班级'); return; } // 如果是中职,设置专业编码(临时处理) // if (that.xxjd === '4' && that.studentForm.zy) { // that.studentForm.zybm = that.studentForm.zy + '001'; // } const params = { nj: that.studentForm.nj, bj: that.studentForm.bj, bjid: that.studentForm.bjid, xm: that.studentForm.xm, xh: that.studentForm.xh, xb: that.studentForm.xb, zy: that.studentForm.zy, // zybm: that.studentForm.zybm, xxid: that.studentForm.xxid }; // 调试信息:打印提交参数 console.log('提交学生参数:', params); // 如果是编辑模式,添加xsid参数 if (this.isEdit) { params.xsid = this.studentForm.xsid; } const url = this.isEdit ? '/www/public/daoru/editxs' : '/www/public/daoru/addxs'; const successMsg = this.isEdit ? '修改学生成功' : '添加学生成功'; const errorMsg = this.isEdit ? '修改学生失败' : '添加学生失败'; $.post(url, params, function (res) { if (res.success == 1 || res.error == 0) { that.$message.success(successMsg); that.addStudentDialogVisible = false; // 刷新表格数据 that.loadTableData(); } else { that.$message.error(res.message || errorMsg); } }).fail((xhr, status, error) => { that.$message.error('请求错误'); }); } else { that.$message.error('请检查表单信息'); return false; } }); }, // 初始化表单选项 initFormOptions() { this.loadNjOptions(); // 中职需要专业验证 if (this.xxjd === '4') { this.studentRules.zy = [{ required: true, message: '请选择专业', trigger: 'change' }]; } }, // 加载年级选项 loadNjOptions() { const that = this; console.log(that.user) $.get('/www/public/daoru/findnjlsit', { xxid: that.user.ID }, function (res) { if (res.success == 1 || res.error == 0) { that.njOptions = res.data.map(item => item.nj || item.njmc || item.name); } else { that.$message.error(res.message || '获取年级列表失败'); } }).fail((xhr, status, error) => { that.$message.error('获取年级列表请求失败'); }); }, // 年级变化时加载专业和班级(学生添加/编辑) onNjChange() { this.studentForm.zy = ''; this.studentForm.bj = ''; this.studentForm.bjid = ''; // 清空班级ID this.zyOptions = []; this.bjOptions = []; if (this.xxjd === '4') { this.loadZyOptions(); } else { this.loadBjOptions(); } }, // 班级添加弹窗中年级变化时加载专业 onClassNjChange() { this.classForm.zy = ''; this.zyOptions = []; if (this.xxjd === '4') { this.loadClassZyOptions(); } }, // 编辑时加载专业选项(中职) loadZyOptionsForEdit(row) { const that = this; const xxid = this.user.ID || ''; $.get('/www/public/daoru/findzylist', { xxid: xxid, nj: this.studentForm.nj }, function (res) { if (res.success == 1 || res.error == 0) { that.zyOptions = res.data.map(item => ({ value: item.zy || item.zymc || item.name, label: item.zy || item.zymc || item.name })); // 专业选项加载完成后,加载班级选项 that.loadBjOptionsForEdit(row); } else { that.$message.error(res.message || '获取专业列表失败'); } }).fail((xhr, status, error) => { that.$message.error('获取专业列表请求失败'); }); }, // 编辑时加载班级选项 loadBjOptionsForEdit(row) { const that = this; const xxid = this.user.ID || ''; const params = { xxid: xxid, nj: this.studentForm.nj }; // 中职需要传专业参数 if (this.xxjd === '4' && this.studentForm.zy) { params.zy = this.studentForm.zy; } $.get('/www/public/daoru/findbjlist', params, function (res) { if (res.success == 1 || res.error == 0) { that.bjOptions = res.data.map(item => ({ value: item.bj || item.bjmc || item.name, label: item.bj || item.bjmc || item.name, id: item.id })); // 班级选项加载完成后,设置班级ID if (row.bj) { const selectedBj = that.bjOptions.find(option => option.value === row.bj); if (selectedBj && selectedBj.id) { that.studentForm.bjid = selectedBj.id; } } } else { that.$message.error(res.message || '获取班级列表失败'); } }).fail((xhr, status, error) => { that.$message.error('获取班级列表请求失败'); }); }, // 加载专业选项(中职 - 学生添加/编辑) loadZyOptions() { const xxid = this.user.ID || ''; if (!xxid || !this.studentForm.nj) { return; } const that = this; $.get('/www/public/daoru/findzylist', { xxid: xxid, nj: this.studentForm.nj }, function (res) { if (res.success == 1 || res.error == 0) { that.zyOptions = res.data.map(item => ({ value: item.zy || item.zymc || item.name, label: item.zy || item.zymc || item.name })); } else { that.$message.error(res.message || '获取专业列表失败'); } }).fail((xhr, status, error) => { that.$message.error('获取专业列表请求失败'); }); }, // 加载专业选项(中职 - 班级添加) loadClassZyOptions() { const xxid = this.user.ID || ''; if (!xxid || !this.classForm.nj) { return; } const that = this; $.get('/www/public/daoru/findzylist', { xxid: xxid, nj: this.classForm.nj }, function (res) { if (res.success == 1 || res.error == 0) { that.zyOptions = res.data.map(item => ({ value: item.zy || item.zymc || item.name, label: item.zy || item.zymc || item.name })); } else { that.$message.error(res.message || '获取专业列表失败'); } }).fail((xhr, status, error) => { that.$message.error('获取专业列表请求失败'); }); }, // 专业变化时加载班级 onZyChange() { this.studentForm.bj = ''; this.studentForm.bjid = ''; // 清空班级ID this.bjOptions = []; this.loadBjOptions(); }, // 班级选择变化时设置班级ID onBjChange() { if (this.studentForm.bj) { // 从班级选项中找到对应的班级ID const selectedBj = this.bjOptions.find(option => option.value === this.studentForm.bj); if (selectedBj && selectedBj.id) { this.studentForm.bjid = selectedBj.id; console.log('班级选择变化,设置bjid:', this.studentForm.bjid); } } else { this.studentForm.bjid = ''; } }, // 加载班级选项 loadBjOptions() { const xxid = this.user.ID || ''; if (!xxid || !this.studentForm.nj) { return; } const params = { xxid: xxid, nj: this.studentForm.nj }; // 中职需要传专业参数 if (this.xxjd === '4' && this.studentForm.zy) { params.zy = this.studentForm.zy; } const that = this; $.get('/www/public/daoru/findbjlist', params, function (res) { if (res.success == 1 || res.error == 0) { that.bjOptions = res.data.map(item => ({ value: item.bjmc || item.bj || item.name, label: item.bjmc || item.bj || item.name, id: item.id // 保存班级ID })); // 加载完班级选项后,如果当前有选中的班级,重新设置bjid if (that.studentForm.bj) { const selectedBj = that.bjOptions.find(option => option.value === that.studentForm.bj); if (selectedBj && selectedBj.id) { that.studentForm.bjid = selectedBj.id; console.log('加载班级选项后重新设置bjid:', that.studentForm.bjid); } } } else { that.$message.error(res.message || '获取班级列表失败'); } }).fail((xhr, status, error) => { that.$message.error('获取班级列表请求失败'); }); }, // 修改参与情况 modifyParticipation() { if (this.selectedStudents.length === 0) { this.$message.warning('请先选择学生'); return; } // 打开前重置弹窗表单,默认不选中任何项且不显示原因 this.participationForm.cyqk = ''; this.participationForm.reason = ''; this.participationForm.customReason = ''; this.participationDialog = true; }, // 处理表格选择变化 handleSelectionChange(selection) { this.selectedStudents = selection; }, // 处理参与情况开关变化 handleParticipationChange(row) { // 恢复开关状态,等待用户在弹窗中确认 row.sfcycp = row.sfcycp === '1' ? '0' : '1'; // 设置当前操作的学生 this.selectedStudents = [row]; // 根据开关状态设置默认参与情况(使用字符串,和单选保持一致) this.participationForm.cyqk = row.sfcycp; this.participationForm.reason = ''; this.participationForm.customReason = ''; // 显示参与情况修改弹窗 this.participationDialog = true; }, // 编辑学生 editStudent(row) { // 直接填充表单数据进行回显 this.studentForm = { xsid: row.id, // 学生ID字段 nj: row.rxnf || row.nj, // 使用rxnf字段作为年级 bj: row.bj, bjid: row.bjid || row.id, // 班级ID xm: row.xm, xh: row.xh, xb: row.xb, zy: row.zy || '', // 专业名称 // zybm: row.zybm || '', // 专业编码 xxid: this.user.ID || '' // 学校ID }; this.isEdit = true; this.addStudentDialogVisible = true; // 正常加载年级选项 this.loadNjOptions(); // 根据当前年级加载班级选项 if (this.studentForm.nj) { if (this.xxjd === '4') { // 中职:先加载专业选项,再加载班级选项 this.loadZyOptions(); this.$nextTick(() => { this.loadBjOptions(); }); } else { // 基础教育:直接加载班级选项 this.loadBjOptions(); } } }, // 删除学生 deleteStudent(row) { this.$confirm('确定要删除该学生吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { const that = this; const params = { xsid: row.id }; $.post('/www/public/daoru/deletexs', params, function (res) { if (res.success == 1 || res.error == 0) { that.$message.success('删除成功'); that.loadTableData(); } else { that.$message.error(res.message); } }).fail(() => { that.$message.error('请求失败'); }); }).catch(() => { this.$message.info('已取消删除'); }); }, // 移除分页相关方法 // 上一步 preStep: function () { this.$emit('preStep'); }, // 下一步 nextStep: function () { if (!this.tableData.length) return this.$message.warning('请先完成数据上报'); this.$confirm('是否确认进入下一步?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { this.$emit('nextStep', 3); }).catch(() => { this.$message.info('已取消删除'); }); }, // 完成 nextStep1: function () { if (!this.tableData.length) return this.$message.warning('请先完成数据上报'); this.$emit('nextStep1', ''); }, // 提交参与情况修改 submitParticipationChange() { const that = this; const studentIds = this.selectedStudents.map(student => student.id); const reason = this.participationForm.cyqk === '0' ? (this.participationForm.reason === '其他' ? this.participationForm.customReason : this.participationForm.reason) : ''; const params = { ids: JSON.stringify(studentIds), cyqk: this.participationForm.cyqk, reason: reason }; $.post('/www/public/daoru/editcyqk', params, function (res) { if (res.success == 1 || res.error == 0) { that.$message.success('批量更新成功'); that.participationDialog = false; that.loadTableData(); that.selectedStudents = []; // 重置表单 that.participationForm = { cyqk: '1', reason: '', customReason: '' }; } else { that.$message.error(res.message || '批量更新失败'); } }).fail(() => { that.$message.error('请求失败'); }); }, // 模板下载 downloadTemplate() { const that = this; const xd = this.xxjd; // 当前学段 if (!xd) { this.$message.error('无法获取学段信息'); return; } // 学段映射:1小学->9, 2初中->10, 3高中->11, 4中职->12 // const typeMapping = { // '1': '9', // '2': '10', // '3': '11', // '4': '12', // }; const typeMapping = { '1': '14', '2': '15', '3': '16', '4': '17', } const mappedType = typeMapping[xd]; if (!mappedType) { this.$message.error('不支持的学段类型'); return; } axios({ method: 'get', url: '/www/public/daoru/excelTempExport', params: { type: mappedType }, responseType: 'blob' }).then(function (response) { const typeNames = { '1': '小学', '2': '初中', '3': '高中', '4': '中职' }; const typeName = typeNames[xd] || '学生'; const blob = new Blob([response.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }); const link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = typeName + '学生信息导入模板.xlsx'; link.click(); that.$message.success('模板下载成功'); }).catch(function (error) { that.$message.error('模板下载失败'); }); }, importStudentInfo1() { const that = this; if (that.loading1) { return } const input = document.createElement('input'); input.type = 'file'; input.accept = '.xls,.xlsx'; input.onchange = function (e) { const file = e.target.files[0]; if (!file) return; const isLt100M = file.size / 1024 / 1024 < 100; if (!isLt100M) { that.$message.error('上传文件大小不能超过100MB!'); return; } // 学段映射:1小学->9, 2初中->10, 3高中->11, 4中职->12 const typeMapping = { '1': '1', '2': '2', '3': '3', '4': '4' }; const mappedType = typeMapping[that.xxjd]; if (!mappedType) { that.$message.error('不支持的学段类型'); return; } const formData = new FormData(); formData.append('file', file); formData.append('type', mappedType); // 映射后的学段类型 formData.append('xxid', that.user.ID); // 学校ID that.loading1 = true $.ajax({ url: '/www/public/daoru/xsxxdr_zj', type: 'POST', data: formData, processData: false, contentType: false, success: function (res) { if (res.error == 0 || res.success == 1) { that.$message.success(res.message || '学生信息导入成功'); that.loading1 = false that.loadTreeData(); // 重新加载树数据 that.loadTableData(); // 重新加载表格数据 } else { that.loading1 = false that.$message.error(res.message || '学生信息导入失败'); } }, error: function () { that.loading1 = false that.$message.error('上传失败'); } }); }; input.click(); }, // 学生信息导入 importStudentInfo() { const that = this; if (that.loading) { return } var tsmessage $.get('/www/public/shangbao/findxxsfxzzh', {}, function (isTips) { console.log(isTips); if (isTips.data == 1) { tsmessage = '您已生成或下载过学生账号,如再次批量上报信息,已生成的学生账号将废弃不能填答。请重新生成账号并下载,下发更新后的学生账号。' } else { if (that.sfnmlc == null) { tsmessage = '首次导入时,将上传所有学生信息。再次导入时,平台中原有学生信息将被【覆盖】,整体更新为最新导入的信息。' } else { tsmessage = '平台中原有学生信息将被【覆盖】,整体更新为学校最新导入的信息。' } } that.$confirm(tsmessage, '提示', { type: 'warning' }).then(() => { const input = document.createElement('input'); input.type = 'file'; input.accept = '.xls,.xlsx'; input.onchange = function (e) { const file = e.target.files[0]; if (!file) return; const isLt100M = file.size / 1024 / 1024 < 100; if (!isLt100M) { that.$message.error('上传文件大小不能超过100MB!'); return; } // 学段映射:1小学->9, 2初中->10, 3高中->11, 4中职->12 const typeMapping = { '1': '1', '2': '2', '3': '3', '4': '4' }; const mappedType = typeMapping[that.xxjd]; if (!mappedType) { that.$message.error('不支持的学段类型'); return; } const formData = new FormData(); formData.append('file', file); formData.append('type', mappedType); // 映射后的学段类型 formData.append('xxid', that.user.ID); // 学校ID $.ajax({ url: '/www/public/daoru/xsxxdr', type: 'POST', data: formData, processData: false, contentType: false, success: function (res) { if (res.error == 0) { that.$message.success(res.message); that.loadTreeData(); // 重新加载树数据 that.loadTableData(); // 重新加载表格数据 } else { that.$message.error(res.message); } }, error: function () { that.$message.error('上传失败'); } }); }; input.click(); }).catch(() => { that.loading = false; // 取消操作时重置状态 }); }) }, // 显示原因弹框 showReason(row) { this.currentStudent = row; this.reasonDialogVisible = true; }, // 查询学生 searchStudents() { this.loadTableData(); }, // 学生信息导出(页面按钮) exportStudentInfo() { const that = this; const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; // 学段映射:1→9、2→10、3→11、4→12 const xdMapping = { '1': '9', // 小学 '2': '10', // 初中 '3': '11', // 高中 '4': '12' // 中职 }; const mappedXd = xdMapping[that.xxjd]; if (!mappedXd) { that.$message.error('当前学段不支持导出'); return; } const params = { schoolid: user.ID, xd: mappedXd }; // 构建下载URL const url = '/www/public/daoru/xsxxdc?' + Object.keys(params).map(key => key + '=' + encodeURIComponent(params[key])).join('&'); // 创建隐藏的下载链接 const link = document.createElement('a'); link.href = url; link.download = '学生信息导出.xls'; document.body.appendChild(link); link.click(); document.body.removeChild(link); that.$message.success('学生信息导出已开始'); }, // 学生信息导出(弹框中) exportStudentInfoFromDialog() { const that = this; const user = this.user; if (!user || !user.ID) { that.$message.error('无法获取学校信息'); return; } // 学段映射 const xdMapping = { '1': '1', // 小学 '2': '2', // 初中 '3': '3', // 高中 '4': '4' // 中职 }; const mappedXd = xdMapping[that.xxjd]; if (!mappedXd) { that.$message.error('当前学段不支持导出'); return; } axios({ method: 'get', url: '/www/public/daoru/xsxxdc', params: { schoolid: user.ID, xd: mappedXd }, responseType: 'blob' }).then(function (response) { const typeNames = { '1': '小学', '2': '初中', '3': '高中', '4': '中职' }; const typeName = typeNames[that.xxjd] || '学校'; const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' }); const link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = typeName + '学生信息导出.xls'; link.click(); that.$message.success('学生信息导出成功'); }).catch(function (error) { that.$message.error('学生信息导出失败'); }); }, // 显示学生信息表管理弹框 showStudentInfoDialog() { const that = this; if (this.sfnmlc == null) { that.$confirm(`

(1)下载学生信息导入模板,填写本校所有参测学生信息;

(2)选择“批量导入且覆盖已有信息”功能。

---操作结果:首次导入时,将上传所有学生信息。再次导入时,平台中原有学生信息将被【覆盖】,整体更新为最新导入的信息。

`, '学生信息批量导入说明', { dangerouslyUseHTMLString: true, confirmButtonText: '我知道了', showCancelButton: false, center: true, customClass: 'student-info-scheme-confirm' }).then(() => { that.studentInfoDialogVisible = true; }).catch(() => { }); } else { that.$confirm(`

(1)下载学生信息导入模板,填写本校所有参测学生信息;

(2)选择“批量导入且覆盖已有信息”功能。

---操作结果:平台中原有学生信息将被【覆盖】,整体更新为最新导入的信息。

`, '学生信息批量导入说明', { dangerouslyUseHTMLString: true, confirmButtonText: '我知道了', showCancelButton: false, center: true, customClass: 'student-info-scheme-confirm' }).then(() => { that.studentInfoDialogVisible = true; }).catch(() => { }); } }, showStudentInfoDialog1() { this.studentInfoDialogVisible1 = true; }, showStudentInfoDialog2() { this.studentInfoDialogVisible2 = true; // 打开弹框时加载数据 this.loadClassGradeInfoData(); }, // 加载学校现有班级年级信息数据 loadClassGradeInfoData() { const that = this; that.classGradeInfoLoading = true; const params = { pageSize: that.classGradeInfoPageSize, pageNum: that.classGradeInfoPageNum, nj: that.classGradeInfoSearchForm.nj, bj: that.classGradeInfoSearchForm.bj }; // 如果是中职学段,添加专业参数 if (that.xxjd === '4') { params.zy = that.classGradeInfoSearchForm.zy; } $.get('/www/public/shangbao/xxnjbjfind', params, function (res) { that.classGradeInfoLoading = false; if (res.success == 1 || res.error == 0) { that.classGradeInfoData = res.data || []; that.classGradeInfoTotal = res.total || 0; } else { that.$message.error(res.message || '获取数据失败'); } }).fail((xhr, status, error) => { that.classGradeInfoLoading = false; that.$message.error('请求失败'); }); }, // 查询班级年级信息 searchClassGradeInfo() { this.classGradeInfoPageNum = 1; this.loadClassGradeInfoData(); }, // 分页大小改变 handleClassGradeInfoSizeChange(val) { this.classGradeInfoPageSize = val; this.loadClassGradeInfoData(); }, // 当前页改变 handleClassGradeInfoCurrentChange(val) { this.classGradeInfoPageNum = val; this.loadClassGradeInfoData(); }, // 导出班级年级列表 exportClassGradeInfo() { const that = this; const params = {}; // 只添加有值的查询参数 if (that.classGradeInfoSearchForm.nj) { params.nj = that.classGradeInfoSearchForm.nj; } if (that.classGradeInfoSearchForm.bj) { params.bj = that.classGradeInfoSearchForm.bj; } // 如果是中职学段,添加专业参数 if (that.xxjd === '4' && that.classGradeInfoSearchForm.zy) { params.zy = that.classGradeInfoSearchForm.zy; } // 使用axios进行导出,参考模板下载的方式 axios({ method: 'get', url: '/www/public/shangbao/xxnjbjfind_export', params: params, responseType: 'blob' }).then(function (response) { const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' }); const link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = '班级年级信息列表.xls'; link.click(); that.$message.success('班级年级信息导出成功'); }).catch(function (error) { that.$message.error('班级年级信息导出失败'); }); } }, created: function () { this.initUserInfo(); this.initFormOptions(); this.sfnmlc = JSON.parse(localStorage.getItem('sfnmlc')) }, mounted: function () { // DOM 渲染完成后再加载树数据,确保能正确展开与选中 this.$nextTick(() => { this.loadTreeData(); }); }, props: ['title', 'data', 'config', 'disableStatus'] }); }); })(template, resolve, reject); }); RegVueCom("xljk-home-view", function(resolve, reject){ var template = ""; return (function(template, resolve, reject) { seajs.use([], function () { return resolve({ template: template, data: function () { return { id: Math.uuid(), aiQuestion: '', commonQuestions: ['2025年全国学生心理监测的时间是什么时候', '如何查看测评结果?'], dialogId: '', showAiWelcome: true, sendAiLoading: false, aiDialogue: [], dataList: [], group1: [], group2: [], user: {}, group3: [], sfnmlc: '', loading1: false, studentInfoDialogVisible: false, studentInfoDialogVisible1: false, studentInfoDialogVisible2: false, sfzg: '1', sfkqbg: '1', reportItemsCity: [ { code: 'city-report', name: '市级报告下载', action: '下载' }, { code: 'county-report-auth', name: '县级报告下载与授权', action: '查看' }, { code: 'school-report-auth', name: '校级报告下载', action: '查看' } ], reportItemsProvince: [ { code: 'prov-report', name: '省级报告下载', action: '下载' }, { code: 'county-report-download', name: '区县级报告下载', action: '查看' }, { code: 'county-report-auth', name: '县级报告下载与授权', action: '查看' }, { code: 'school-report-auth', name: '校级报告下载', action: '查看' } ], reportItemsCounty: [ { code: 'county-report-auth', name: '县级报告下载', action: '查看' }, { code: 'school-report-auth', name: '校级报告下载与授权', action: '查看' } ], reportItemsSchool: [ { code: 'student-report', name: '学生心理健康测评报告下载', action: '下载' }, { code: 'warning-interpret', name: '预警结果解读下载', action: '下载' }, { code: 'warning-stu-list', name: '预警学生名单下载', action: '下载' } ], // 学校现有班级年级信息相关数据 classGradeInfoData: [], // 表格数据 classGradeInfoLoading: false, // 加载状态 classGradeInfoTotal: 0, // 总条数 classGradeInfoPageNum: 1, // 当前页码 classGradeInfoPageSize: 10, // 每页条数 // 查询表单 classGradeInfoSearchForm: { nj: '', // 年级 bj: '', // 班级 zy: '' // 专业(仅中职) }, smzt: '0', currentProgress: 1, xxjd: '', jindu: '', csjd: '', downloadDialogVisible: false, downloadDialogVisibleGxx202604bj: false, downloadDialogVisiblejj: false, // 下载学生账号排序方式:1=按名称,2=按学号 studentAccountSortType: '1', // 学生账号生成并下载:选择排列方式弹窗 studentGenSortDialogVisible: false, // 待下载类型:3=参测学生,2=补报参测学生 studentGenSortPendingItem: '3', // 学生账号「生成并下载」全屏 loading(仅 item 2/3) studentGenDownloadFullLoading: false, // 来自 userzt.menutype 的首页布局强制覆盖(menutype==1 => homeLayoutMode==4) menuTypeHomeLayoutMode: 0, // syfind 返回的全部菜单项(用于 layoutmode==4 横向一排展示) syfindAllItems: [], downloadzhDialogVisible: false, downloadjyjDialogVisible: false, // 标记:当触发 bj202603 流程时,学生账号导出接口改用 _lpsc 版本 isBj202603LpscStudentSm: false, sdyDialogVisible: false, sdyList: [], viewReportDialogVisible: false, viewReportForm: { name: '', phone: '', verifyCode: '' }, viewReportCodeCountdown: 0, viewReportSsdDialogVisible: false, viewReportSsdForm: { name: '', phone: '', verifyCode: '' }, viewReportSsdCodeCountdown: 0, isCheckedsdx: { issmcy: -1, shzt: '' }, jdtjData: {}, // 存储接口返回的数据 bsMap: { shj1: '填写', shj10: '查看', shj11: '查看', shj2: '下载', shj3: '审核', shj4: '审核', shj5: '编写', shj6: '查看', shj7: '查看', shj8: '填写', shj9: '查看', shj12: '详情', shj13: '查看', shj14: '查看', shj15: '查看', shj16: '查看', sj1: '填写', sj10: '查看', sj11: '查看', sj2: '下载', sj3: '审核', sj4: '审核', sj5: '编写', sj6: '查看', sj7: '查看', sj8: '填写', sj9: '查看', sj12: '详情', sj13: '查看', sj14: '查看', sj15: '查看', sj16: '查看', sj19: '查看', xj1: '填写', xj10: '查看', xj11: '查看', xj2: '下载', 'xj2-sc': '下载', xj3: '审核', xj4: '审核', xj5: '编写', xj6: '查看', xj7: '查看', xj8: '填写', xj9: '查看', xj12: '详情', xj13: '查看', xj14: '查看', xj15: '查看', xj16: '查看', xj19: '查看', xx1: '填写', xx2: '下载', xx17: '上报', 'xx17-1': '上报', 'xx17-2': '上报', xx4: '制定', xx5: '填写 ', xx6: '查看', xx7: '开展', xx8: '安排', xx9: '测试', xx10: '下载', xx11: '核查', xx12: '详情', xx13: '填写', xx14: '上报', xx15: '上报', xx16: '查看', xx20: '查看', gxx1: '填写', 'gxx1-202604bj': '填写', gxx2: '下载', gxx17: '上报', 'gxx17-1': '上报', 'gxx17-2': '上报', gxx4: '制定', gxx5: '查看', gxx6: '查看', gxx7: '开展', gxx8: '安排', gxx9: '测试', gxx10: '下载', gxx11: '核查', gxx12: '详情', gxx13: '填写', gxx14: '上报', gxx15: '上报', gxx16: '查看', gxx19: '查看', gxx21: '查看', gxx20: '查看', 'xx-22': '查看', 'xx-23': '查看', 'xx-24': '下载', 'xx-25': '管理', 'xx-26': '管理', 'xx-27': '管理', 'gxx-22': '查看', 'gxx-23': '查看', 'gxx-24': '下载', 'gxx-25': '管理', 'gxx-26': '管理', 'gxx-27': '管理', 'gxx17-2-ssd': '上报', 'gxx19-ssd': '查看', 'gxx21-ssd': '查看', 'xx2-bj202603': '下载', }, AIVisible: false, AIShowAccounts: ['9ae5da14-e4b4-4844-8ed0-ef1328a619a8'] , yunnanDialogVisible: false, yunnanFiles: [], isYunnanUser: false, isXionganUser: false, sfqy: '', // 是否启用区域 bgPath: '', // 报告文件路径 // 首页文字配置(先只拉取,不渲染) homeTextConfig: { lcid: '', roles: '', content: '', id: '', raw: null }, }; }, methods: { // findcontent 角色映射: // 220 -> 1, 310 -> 2, 410 -> 3, 450+xd(1/2/3/4)->4, 450+xd(5/6)->5 resolveFindContentRole: function () { var user = this.user && this.user.Roles ? this.user : (localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}); var roles = Array.isArray(user.Roles) ? user.Roles : []; var xdVal = String(this.xxjd || (localStorage.getItem('xxjd') ? JSON.parse(localStorage.getItem('xxjd')) : '') || ''); if (roles.includes('220')) return '1'; if (roles.includes('310')) return '2'; if (roles.includes('410')) return '3'; if (roles.includes('450')) { if (['1', '2', '3', '4'].includes(xdVal)) return '4'; if (['5', '6'].includes(xdVal)) return '5'; } return ''; }, fetchHomeTextConfig: function (lcid) { console.log('fetchHomeTextConfig', lcid) var that = this; var lcidVal = lcid != null && lcid !== '' ? String(lcid) : ''; var roleVal = that.resolveFindContentRole(); that.homeTextConfig.lcid = lcidVal; that.homeTextConfig.roles = roleVal; var params = {}; if (lcidVal) params.lcid = lcidVal; if (roleVal) params.roles = roleVal; if (Object.keys(params).length === 0) return; $.get('/www/public/menuconfig/findcontent', params, function (res) { if (res.success == 1 || res.error == 0) { var d = res.data; var content = ''; var contentId = ''; if (typeof d === 'string') { content = d; } else if (Array.isArray(d) && d.length > 0) { var first = d[0] || {}; content = first.content != null ? String(first.content) : ''; contentId = first.id != null ? String(first.id) : ''; } else if (d && typeof d === 'object') { content = d.content != null ? String(d.content) : ''; contentId = d.id != null ? String(d.id) : ''; } that.homeTextConfig.content = content; that.homeTextConfig.id = contentId; that.homeTextConfig.raw = d; } else { that.homeTextConfig.content = ''; that.homeTextConfig.id = ''; that.homeTextConfig.raw = null; } }).fail(function () { that.homeTextConfig.content = ''; that.homeTextConfig.id = ''; that.homeTextConfig.raw = null; }); }, handleReportItemClick(item) { var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} if (item.code === 'yunnan_download') { this.handleYunnanDownload() return } if (item.code === 'account') { if (user.Roles && user.Roles.includes('651')) { this.$message.success('开始下载') return } var that = this $.get('/www/public/baogao/cksfsq', {}, function (res) { if (res.success == 1 || res.error == 0) { if (String(res.data) === '1') { that.$message.success('已授权,开始下载') } else { that.$message.warning('暂无权限下载,请等待上级授权后重试') } } else { that.$message.error(res.message || '请求失败') } }).fail(function () { that.$message.error('请求失败') }) return } if (item.code === 'city-report') { const that = this if (user.Roles && user.Roles.includes('654')) { // 市级报告下载逻辑 // 注意:sfkqbg控制显示,这里做双重校验 if (that.sfkqbg == '1') { that.downloadJYJReport(user.ID, '市级报告.zip'); } else { that.$message.warning('报告未生成或无权限下载'); } } return } if (item.code === 'city-report-auth') { // 市级报告权限授权 (651 -> type 3) this.$router.push({ path: '/bgAuth', query: { type: '3' } }) return } if (item.code === 'prov-report') { const that = this // 省级报告下载 if (user.Roles && user.Roles.includes('651')) { that.downloadJYJReport(user.ID, '省级报告.zip'); } else { that.$message.success('开始下载') } return } if (item.code === 'county-report-auth') { // 县级报告下载 (652) if (user.Roles && user.Roles.includes('652')) { const that = this $.get('/www/public/baogao/cksfsq', {}, function (res) { if (res.success == 1 || res.error == 0) { if (String(res.data) === '1') { that.downloadJYJReport(user.ID, '县级报告.zip'); } else { that.$message.warning('暂无权限下载,请等待上级授权后重试') } } else { that.$message.error(res.message || '请求失败') } }).fail(function () { that.$message.error('请求失败') }) return; } // 县级报告下载与授权 (651) -> 跳转 this.$router.push({ path: '/bgAuth', query: { type: '1' } }) return } if (item.code === 'student-report' || item.code === 'warning-interpret' || item.code === 'warning-stu-list') { var typeMap = { 'student-report': 1, 'warning-interpret': 2, 'warning-stu-list': 3 } var fileNameMap = { 'student-report': '学生心理健康测评报告.pdf', 'warning-interpret': '预警结果解读.pdf', 'warning-stu-list': '预警学生名单.xlsx' } var t = typeMap[item.code] var name = fileNameMap[item.code] var that = this $.get('/www/public/baogao/pdwjsfcz', { id: user.ID, type: t }, function (res1) { if (res1.success == 1 || res1.error == 0) { $.get('/www/public/baogao/cksfsq', {}, function (res) { if (res.success == 1 || res.error == 0) { if (String(res.data) === '1') { axios({ method: 'get', url: '/www/public/baogao/xxbgdownload', params: { id: user.ID, type: t }, responseType: 'blob' }) .then(function (response) { var blob = new Blob([response.data]) var link = document.createElement('a') link.href = window.URL.createObjectURL(blob) link.download = name document.body.appendChild(link) link.click() document.body.removeChild(link) that.$message.success('下载成功') }).catch(function () { that.$message.error('下载失败') }) } else { that.$message.warning('暂无权限下载,请等待上级授权后重试') } } else { that.$message.error(res.message || '请求失败') } }).fail(function () { that.$message.error('请求失败') }) } else { that.$message.error(res1.message || '请求失败') } }).fail(function () { that.$message.error('请求失败') }) return } if (item.code === 'county-report-download') { // 区县级报告下载,跳转到授权页面 this.$router.push({ path: '/bgAuth2', query: { type: '1' } }) return } if (item.code === 'school-report-auth') { this.$router.push({ path: '/bgAuth', query: { type: '2' } }) return } this.$message('功能稍后接入'); }, downloadJYJReport(id, filename) { var that = this; axios({ method: 'GET', url: '/www/public/baogao/jyjbgdownload', params: { id: id }, responseType: 'blob' }).then(function (res) { if (res.status == 200) { var blob = new Blob([res.data]) var link = document.createElement('a') link.href = window.URL.createObjectURL(blob) link.download = filename document.body.appendChild(link) link.click() document.body.removeChild(link) that.$message.success('下载成功') } else { that.$message.error('下载失败') } }).catch(function () { that.$message.error('下载失败') }) }, handleOpenAiDrawer() { this.AIVisible = true; this.createDialog(); setTimeout(() => { this.flushScrollTop(); }); }, handleAIClose(done) { done(); }, createDialog() { const that = this; $.get('/www/public/xybb/cjzs', {}, function (res) { if (res.success == 1 || res.error == 0) { that.dialogId = res.data; } else { that.$message.error(res.message || '获取数据失败'); } }).fail((xhr, status, error) => { that.$message.error('请求失败'); }); }, // 刷新对话列表 flushScrollTop() { this.$nextTick(() => { const contentHeight = document.getElementById('content-inner'); if (contentHeight) { contentHeight.scrollTop = contentHeight.scrollHeight; } }); }, handleAiKeyup(e) { console.log('e', e) this.sendMessage(); }, sendMessage(q) { this.showAiWelcome = false; if (this.sendAiLoading) { this.$message('请等待机器人回复完成之后再进行提问'); return; } this.sendAiLoading = true; const queryText = (q ?? this.aiQuestion).trim(); console.log('queryText', queryText) if (!queryText) { this.$message('请输入您的问题'); this.aiQuestion = ''; this.sendAiLoading = false; return; } const newDialogue = { question: queryText, anwser: '' } this.aiDialogue.push(newDialogue); this.flushScrollTop(); const that = this; const params = { input: queryText, dialogId: this.dialogId } $.get('/www/public/xybb/duihua', params, function (res) { if (res.success == 1 || res.error == 0) { newDialogue.anwser = res.data?.replaceAll('\n', '
'); that.flushScrollTop(); that.aiQuestion = ''; that.sendAiLoading = false; } else { that.$message.error(res.message || '获取数据失败'); } }).fail((xhr, status, error) => { that.$message.error('请求失败'); }); }, importStudentInfo1() { const that = this; if (that.loading1) { return } const input = document.createElement('input'); input.type = 'file'; input.accept = '.xls,.xlsx'; input.onchange = function (e) { const file = e.target.files[0]; if (!file) return; const isLt100M = file.size / 1024 / 1024 < 100; if (!isLt100M) { that.$message.error('上传文件大小不能超过100MB!'); return; } // 学段映射:1小学->9, 2初中->10, 3高中->11, 4中职->12 const typeMapping = { '1': '1', '2': '2', '3': '3', '4': '4' }; const mappedType = typeMapping[that.xxjd]; if (!mappedType) { that.$message.error('不支持的学段类型'); return; } const formData = new FormData(); formData.append('file', file); formData.append('type', mappedType); // 映射后的学段类型 formData.append('xxid', that.user.ID); // 学校ID that.loading1 = true $.ajax({ url: '/www/public/daoru/xsxxdr_zjbc_pc', type: 'POST', data: formData, processData: false, contentType: false, success: function (res) { if (res.error == 0) { that.$message.success(res.message); that.loading1 = false that.loadTreeData(); // 重新加载树数据 that.loadTableData(); // 重新加载表格数据 } else { that.loading1 = false that.$message.error(res.message); } }, error: function () { that.loading1 = false that.$message.error('上传失败'); } }); }; input.click(); }, // 查询班级年级信息 searchClassGradeInfo() { this.classGradeInfoPageNum = 1; this.loadClassGradeInfoData(); }, // 分页大小改变 handleClassGradeInfoSizeChange(val) { this.classGradeInfoPageSize = val; this.loadClassGradeInfoData(); }, // 当前页改变 handleClassGradeInfoCurrentChange(val) { this.classGradeInfoPageNum = val; this.loadClassGradeInfoData(); }, // 导出班级年级列表 exportClassGradeInfo() { const that = this; const params = {}; // 只添加有值的查询参数 if (that.classGradeInfoSearchForm.nj) { params.nj = that.classGradeInfoSearchForm.nj; } if (that.classGradeInfoSearchForm.bj) { params.bj = that.classGradeInfoSearchForm.bj; } // 如果是中职学段,添加专业参数 if (that.xxjd === '4' && that.classGradeInfoSearchForm.zy) { params.zy = that.classGradeInfoSearchForm.zy; } // 使用axios进行导出,参考模板下载的方式 axios({ method: 'get', url: '/www/public/shangbao/xxnjbjfind_export', params: params, responseType: 'blob' }).then(function (response) { const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' }); const link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = '班级年级信息列表.xls'; link.click(); that.$message.success('班级年级信息导出成功'); }).catch(function (error) { that.$message.error('班级年级信息导出失败'); }); }, // 加载学校现有班级年级信息数据 loadClassGradeInfoData() { const that = this; that.classGradeInfoLoading = true; const params = { pageSize: that.classGradeInfoPageSize, pageNum: that.classGradeInfoPageNum, nj: that.classGradeInfoSearchForm.nj, bj: that.classGradeInfoSearchForm.bj }; // 如果是中职学段,添加专业参数 if (that.xxjd === '4') { params.zy = that.classGradeInfoSearchForm.zy; } $.get('/www/public/shangbao/xxnjbjfind', params, function (res) { that.classGradeInfoLoading = false; if (res.success == 1 || res.error == 0) { that.classGradeInfoData = res.data || []; that.classGradeInfoTotal = res.total || 0; } else { that.$message.error(res.message || '获取数据失败'); } }).fail((xhr, status, error) => { that.classGradeInfoLoading = false; that.$message.error('请求失败'); }); }, showStudentInfoDialog2() { this.studentInfoDialogVisible2 = true; // 打开弹框时加载数据 this.loadClassGradeInfoData(); }, downloadTemplate() { const that = this; const xd = this.xxjd; // 当前学段 if (!xd) { this.$message.error('无法获取学段信息'); return; } // 学段映射:1小学->9, 2初中->10, 3高中->11, 4中职->12 // const typeMapping = { '1': '9', '2': '10', '3': '11', '4': '12' }; const typeMapping = { '1': '14', '2': '15', '3': '16', '4': '17', } const mappedType = typeMapping[xd]; if (!mappedType) { this.$message.error('不支持的学段类型'); return; } axios({ method: 'get', url: '/www/public/daoru/excelTempExport', params: { type: mappedType }, responseType: 'blob' }).then(function (response) { const typeNames = { '1': '小学', '2': '初中', '3': '高中', '4': '中职' }; const typeName = typeNames[xd] || '学生'; const blob = new Blob([response.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }); const link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = typeName + '学生信息导入模板.xlsx'; link.click(); that.$message.success('模板下载成功'); }).catch(function (error) { that.$message.error('模板下载失败'); }); }, // 显示学生信息表管理弹框 showStudentInfoDialog() { const that = this; that.studentInfoDialogVisible = true; }, showStudentInfoDialog1() { this.studentInfoDialogVisible1 = true; }, //获取学段 getxxjd() { const that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var schoolid = user.ID const params1 = { schoolid } $.get("/www/public/shangbao/findschoolxd", params1, function (res) { if (res.success == 1) { that.xxjd = res.data.xd } }).fail((xhr, status, error) => { }) }, goToDetail(route) { this.$router.push({ path: '/' + route }); }, getStatus() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var xd = localStorage.getItem('xxjd') ? JSON.parse(localStorage.getItem('xxjd')) : '' const params = { username: user.Username, xd } $.get("/www/public/bd/jdtj", params, function (res) { if (res.success == 1) { // 存储接口返回的数据 that.jdtjData = res.data // 根据接口返回的数据更新步骤完成状态 that.updateStepStatus(res.data) } }).fail((xhr, status, error) => { }) }, updateStepStatus(statusData) { console.log('更新步骤状态:', statusData) console.log('模块三原始数据:', this.group3) // 更新第一模块(测前准备)的步骤状态 this.group1.forEach((item, index) => { if (statusData[item.bs]) { // 1是完成,2是未完成 const isCompleted = statusData[item.bs] === '1' item.ycw = isCompleted ? 1 : 0 console.log(`第一模块步骤${index + 1}(${item.bs}): ${isCompleted ? '已完成' : '未完成'}`) } }) // 更新第二模块(测中阶段)的步骤状态 - 仅对权限770用户 if (this.isRole770) { this.group2.forEach((item, index) => { console.log(`检查第二模块步骤${index + 1}:`, item) if (statusData[item.bs]) { // 1是完成,2是未完成 const isCompleted = statusData[item.bs] === '1' item.ycw = isCompleted ? 1 : 0 console.log(`第二模块步骤${index + 1}(${item.bs}): ${isCompleted ? '已完成' : '未完成'},ycw值:${item.ycw}`) } else { console.log(`第二模块步骤${index + 1}(${item.bs}): 在状态数据中未找到对应字段`) } }) console.log('更新后的模块二数据:', this.group2) } // 更新第三模块(测后阶段)的步骤状态 this.group3.forEach((item, index) => { console.log(`检查第三模块步骤${index + 1}:`, item) if (statusData[item.bs]) { // 1是完成,2是未完成 const isCompleted = statusData[item.bs] === '1' item.ycw = isCompleted ? 1 : 0 console.log(`第三模块步骤${index + 1}(${item.bs}): ${isCompleted ? '已完成' : '未完成'},ycw值:${item.ycw}`) } else { console.log(`第三模块步骤${index + 1}(${item.bs}): 在状态数据中未找到对应字段`) } }) console.log('更新后的模块三数据:', this.group3) // 强制更新视图 this.$forceUpdate() // 自动定位到第一个未完成的步骤 this.$nextTick(() => { this.scrollToFirstIncompleteStep() }) }, scrollToFirstIncompleteStep() { // 优先使用聚合键恢复,其次兼容旧键恢复并迁移;仅当无任何缓存时才执行自动定位 try { const aggRaw = localStorage.getItem('homeScrollPositions') if (aggRaw) { const pos = JSON.parse(aggRaw) || {} const topEl = document.querySelector('.top-items-container') const blEl = document.querySelector('.homeInfoBottomLeft .bottom-items-container') const brEl = document.querySelector('.homeInfoBottomRight .bottom-items-container') requestAnimationFrame(() => { if (topEl && typeof pos.top === 'number') topEl.scrollTo({ left: pos.top, behavior: 'auto' }) if (blEl && typeof pos.bottomLeft === 'number') blEl.scrollTo({ left: pos.bottomLeft, behavior: 'auto' }) if (brEl && typeof pos.bottomRight === 'number') brEl.scrollTo({ left: pos.bottomRight, behavior: 'auto' }) }) console.log('检测到聚合缓存 homeScrollPositions,跳过自动定位逻辑') return } } catch (e) { /* ignore */ } try { const t = localStorage.getItem('homeScroll_top') const l = localStorage.getItem('homeScroll_bottomLeft') const r = localStorage.getItem('homeScroll_bottomRight') if (t !== null || l !== null || r !== null) { const pos = { top: t !== null ? (parseInt(t, 10) || 0) : 0, bottomLeft: l !== null ? (parseInt(l, 10) || 0) : 0, bottomRight: r !== null ? (parseInt(r, 10) || 0) : 0 } const topEl = document.querySelector('.top-items-container') const blEl = document.querySelector('.homeInfoBottomLeft .bottom-items-container') const brEl = document.querySelector('.homeInfoBottomRight .bottom-items-container') requestAnimationFrame(() => { if (topEl) topEl.scrollTo({ left: pos.top, behavior: 'auto' }) if (blEl) blEl.scrollTo({ left: pos.bottomLeft, behavior: 'auto' }) if (brEl) brEl.scrollTo({ left: pos.bottomRight, behavior: 'auto' }) }) try { localStorage.setItem('homeScrollPositions', JSON.stringify(pos)) localStorage.removeItem('homeScroll_top') localStorage.removeItem('homeScroll_bottomLeft') localStorage.removeItem('homeScroll_bottomRight') } catch (e) { } console.log('已从旧键恢复并迁移至 homeScrollPositions,跳过自动定位逻辑') return } } catch (e) { } console.log('开始检查需要滚动的步骤') console.log('模块一数据:', this.group1.map((item, idx) => ({ index: idx + 1, bs: item.bs, ycw: item.ycw, status: this.jdtjData[item.bs] }))) if (this.isRole770) { console.log('模块二数据:', this.group2.map((item, idx) => ({ index: idx + 1, bs: item.bs, ycw: item.ycw, status: this.jdtjData[item.bs] }))) } console.log('模块三数据:', this.group3.map((item, idx) => ({ index: idx + 1, bs: item.bs, ycw: item.ycw, status: this.jdtjData[item.bs] }))) // 分别检查模块一的第一个需要处理的步骤(未完成或待办但不是0) let module1FirstIncomplete = -1 for (let i = 0; i < this.group1.length; i++) { const item = this.group1[i] const statusValue = this.jdtjData[item.bs] // 检查是否需要处理:未完成(ycw !== 1)或者有待办数字(数字类型且不为0) const needsAttention = item.ycw !== 1 || (typeof statusValue === 'number' && statusValue > 0) if (needsAttention) { module1FirstIncomplete = i console.log(`模块一发现第一个需要处理的步骤:第${i + 1}步,状态:${statusValue}`) break } } // 检查模块二的第一个需要处理的步骤(仅对权限770用户) let module2FirstIncomplete = -1 if (this.isRole770) { for (let i = 0; i < this.group2.length; i++) { const item = this.group2[i] const statusValue = this.jdtjData[item.bs] // 检查是否需要处理:未完成(ycw !== 1)或者有待办数字(数字类型且不为0) const needsAttention = item.ycw !== 1 || (typeof statusValue === 'number' && statusValue > 0) if (needsAttention) { module2FirstIncomplete = i console.log(`模块二发现第一个需要处理的步骤:第${i + 1}步,状态:${statusValue}`) break } } } // 分别检查模块三的第一个需要处理的步骤(未完成或待办但不是0) let module3FirstIncomplete = -1 for (let i = 0; i < this.group3.length; i++) { const item = this.group3[i] const statusValue = this.jdtjData[item.bs] // 检查是否需要处理:未完成(ycw !== 1)或者有待办数字(数字类型且不为0) const needsAttention = item.ycw !== 1 || (typeof statusValue === 'number' && statusValue > 0) if (needsAttention) { module3FirstIncomplete = i console.log(`模块三发现第一个需要处理的步骤:第${i + 1}步,状态:${statusValue}`) break } } // 如果模块一有需要处理的步骤,滚动到模块一 if (module1FirstIncomplete !== -1) { console.log(`准备滚动到模块一第${module1FirstIncomplete + 1}步`) this.scrollToModule1Step(module1FirstIncomplete) } // 如果模块二有需要处理的步骤,滚动到模块二(仅对权限770用户) if (this.isRole770 && module2FirstIncomplete !== -1) { console.log(`准备滚动到模块二第${module2FirstIncomplete + 1}步`) this.scrollToModule2Step(module2FirstIncomplete) } // 如果模块三有需要处理的步骤,滚动到模块三 if (module3FirstIncomplete !== -1) { console.log(`准备滚动到模块三第${module3FirstIncomplete + 1}步`) this.scrollToModule3Step(module3FirstIncomplete) } // 检查是否所有模块都已完成 const allModulesComplete = module1FirstIncomplete === -1 && (!this.isRole770 || module2FirstIncomplete === -1) && module3FirstIncomplete === -1 if (allModulesComplete) { console.log('所有步骤都已完成或无需处理,无需滚动') } }, scrollToModule1Step(index) { const container = document.querySelector('.top-items-container') const targetItem = container && container.children[index] if (container && targetItem) { const doScroll = () => { const containerRect = container.getBoundingClientRect() const targetRect = targetItem.getBoundingClientRect() let scrollLeft if (index > 0) { const prevItem = container.children[index - 1] const prevRect = prevItem.getBoundingClientRect() scrollLeft = prevRect.left - containerRect.left + container.scrollLeft } else { scrollLeft = targetRect.left - containerRect.left + container.scrollLeft } this.__autoScrolling = true container.scrollTo({ left: Math.max(0, scrollLeft), behavior: 'smooth' }) setTimeout(() => { this.__autoScrolling = false }, 600) console.log(`自动定位到第一模块第${index + 1}步(未完成),滚动距离:${scrollLeft}`) } requestAnimationFrame(() => requestAnimationFrame(doScroll)) } }, scrollToModule2Step(index) { const container = document.querySelector('.homeInfoBottomLeft .bottom-items-container') const targetItem = container && container.children[index] if (container && targetItem) { const doScroll = () => { const containerRect = container.getBoundingClientRect() const targetRect = targetItem.getBoundingClientRect() let scrollLeft if (index > 0) { const prevItem = container.children[index - 1] const prevRect = prevItem.getBoundingClientRect() scrollLeft = prevRect.left - containerRect.left + container.scrollLeft } else { scrollLeft = targetRect.left - containerRect.left + container.scrollLeft } this.__autoScrolling = true container.scrollTo({ left: Math.max(0, scrollLeft), behavior: 'smooth' }) setTimeout(() => { this.__autoScrolling = false }, 600) console.log(`自动定位到第二模块第${index + 1}步(未完成),滚动距离:${scrollLeft}`) } requestAnimationFrame(() => requestAnimationFrame(doScroll)) } }, scrollToModule3Step(index) { const container = document.querySelector('.homeInfoBottomRight .bottom-items-container') const targetItem = container && container.children[index] if (container && targetItem) { const doScroll = () => { const containerRect = container.getBoundingClientRect() const targetRect = targetItem.getBoundingClientRect() let scrollLeft if (index > 0) { const prevItem = container.children[index - 1] const prevRect = prevItem.getBoundingClientRect() scrollLeft = prevRect.left - containerRect.left + container.scrollLeft } else { scrollLeft = targetRect.left - containerRect.left + container.scrollLeft } this.__autoScrolling = true container.scrollTo({ left: Math.max(0, scrollLeft), behavior: 'smooth' }) setTimeout(() => { this.__autoScrolling = false }, 600) console.log(`自动定位到第三模块第${index + 1}步(未完成),滚动距离:${scrollLeft}`) } requestAnimationFrame(() => requestAnimationFrame(doScroll)) } }, anyPreviousCompleted(currentIndex) { return this.group1.slice(0, currentIndex).some(item => item.completed); }, handleGroup1Item(item) { console.log('处理测前准备项目', item); const that = this; switch (item.bs) { case 'yunnan_download': this.handleYunnanDownload() break; case 'xx1': case 'shj1': case 'sj1': case 'xj1': this.$refs.XDgongzuozuShangbaoDialog.show() break; case 'xx1-scjj': this.$refs.XDgongzuozuShangbaoDialogBJ && this.$refs.XDgongzuozuShangbaoDialogBJ.show() break; case 'xx2': case 'shj2': case 'sj2': case 'xj2': case 'gxx2': case 'sdy1': var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; if (user.Roles.includes("220") || user.Roles.includes("310") || user.Roles.includes("410")) { $.post("/www/public/bd/editjyjsfckwj", {}, function (res) { if (res.error == 0) { } else { } }) } if (user.Roles.includes("450")) { let params = { userid: user.ID, }; $.post("/www/public/bd/sfxzwjedit", params, function (res) { if (res.error == 0) { } else { } }) } this.$router.push({ path: '/XDzlxz01', query: { name: item.name } }) break; case 'gxx2-sc': var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; if (user.Roles.includes("220") || user.Roles.includes("310") || user.Roles.includes("410")) { $.post("/www/public/bd/editjyjsfckwj", {}, function (res) { if (res.error == 0) { } else { } }) } if (user.Roles.includes("450")) { let params = { userid: user.ID, }; $.post("/www/public/bd/sfxzwjedit", params, function (res) { if (res.error == 0) { } else { } }) } this.$router.push({ path: '/XDzlxz01BJSC', query: { name: item.name } }) break; case 'xx2-sc': var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; if (user.Roles.includes("220") || user.Roles.includes("310") || user.Roles.includes("410")) { $.post("/www/public/bd/editjyjsfckwj", {}, function (res) { if (res.error == 0) { } else { } }) } if (user.Roles.includes("450")) { let params = { userid: user.ID, }; $.post("/www/public/bd/sfxzwjedit", params, function (res) { if (res.error == 0) { } else { } }) } this.$router.push({ path: '/XDzlxz01BJSC', query: { name: item.name } }) break; case 'xj2-sc-kpz': var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; if (user.Roles.includes("220") || user.Roles.includes("310") || user.Roles.includes("410")) { $.post("/www/public/bd/editjyjsfckwj", {}, function (res) { if (res.error == 0) { } else { } }) } if (user.Roles.includes("450")) { let params = { userid: user.ID, }; $.post("/www/public/bd/sfxzwjedit", params, function (res) { if (res.error == 0) { } else { } }) } this.$router.push({ path: '/XDzlxz01BJSC', query: { name: item.name } }) break; case 'xj2-sc': var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; if (user.Roles.includes("220") || user.Roles.includes("310") || user.Roles.includes("410")) { $.post("/www/public/bd/editjyjsfckwj", {}, function (res) { if (res.error == 0) { } else { } }) } if (user.Roles.includes("450")) { let params = { userid: user.ID, }; $.post("/www/public/bd/sfxzwjedit", params, function (res) { if (res.error == 0) { } else { } }) } this.$router.push({ path: '/XDzlxz01sc', query: { name: item.name } }) break; case 'xx3-1': // if(!this.jindu.gzzcnt){ // this.$alert('请先上报工作组信息', '提示', { // confirmButtonText: '确定', // }); // return // } this.$router.push({ path: '/XDxuexiaoxxDialog0', query: { done: this.jindu.xxcnt, shzt: this.isCheckedsdx.cyzt, status: '2', name: item.name } }) break; case 'xx2-bj202603': var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; if (user.Roles.includes("220") || user.Roles.includes("310") || user.Roles.includes("410")) { $.post("/www/public/bd/editjyjsfckwj", {}, function (res) { if (res.error == 0) { } else { } }) } if (user.Roles.includes("450")) { let params = { userid: user.ID, }; $.post("/www/public/bd/sfxzwjedit", params, function (res) { if (res.error == 0) { } else { } }) } this.$router.push({ path: '/XDzlxz01BJ', query: { name: item.name } }) break; case 'sdy2': this.$router.push({ path: '/txcqzbqk', query: { name: item.name } }) break; case 'sdy3': this.$router.push({ path: '/ckxxsjapb', query: { name: item.name } }) break; case 'sdy4': this.$router.push({ path: '/txhcqkjwtjl', query: { name: item.name } }) break; case 'sdy5': this.$router.push({ path: '/scsdtp', query: { name: item.name } }) break; case 'sdy6': this.$router.push({ path: '/ckgzzlxr', query: { name: item.name } }) break; case 'sdy7': this.$router.push({ path: '/ckybxschjxx', query: { name: item.name } }) break; case 'sdy8': this.$router.push({ path: '/ybxssfaxq', query: { name: item.name } }) break; case 'sdy9': this.$router.push({ path: '/ckybxsjapb', query: { name: item.name } }) break; case 'gxx21': console.log('this.user', this.user) this.$router.push({ path: '/evaluationStatistics', query: { name: item.name, id: this.user.ID, xxmc: this.user.Nickname } }) break; case 'gxx21-ssd': console.log('this.user', this.user) this.$router.push({ path: '/evaluationStatisticsSsd', query: { name: item.name, id: this.user.ID, xxmc: this.user.Nickname } }) break; case 'sdy10': this.$router.push({ path: '/dcccxkzczygfpx', query: { name: item.name } }) break; case 'sdy11': this.$router.push({ path: '/ckybxzbqkzc', query: { name: item.name } }) break; case 'xx17': if (!this.jindu.gzzcnt) { this.$alert('请先上报工作组信息', '提示', { confirmButtonText: '确定', }); return } this.$router.push({ path: '/XDxuexiaoxxDialog0', query: { done: this.jindu.xxcnt, shzt: this.isCheckedsdx.cyzt, status: '1', name: item.name } }) break; case 'xx17-1': if (!this.jindu.gzzcnt) { this.$alert('请先上报工作组信息', '提示', { confirmButtonText: '确定', }); return } this.$router.push({ path: '/XDxuexiaoxxDialog0', query: { done: this.jindu.xxcnt, shzt: this.isCheckedsdx.cyzt, status: '2', name: item.name } }) break; case 'xx17-2': // if (!this.jindu.gzzcnt) { // this.$alert('请先上报工作组信息', '提示', { // confirmButtonText: '确定', // }); // return // } this.$router.push({ path: '/XDxuexiaoxxDialog0', query: { done: this.jindu.xxcnt, shzt: this.isCheckedsdx.cyzt, status: '3', name: item.name } }) break; case 'gxx17-2-ssd': this.$router.push({ path: '/ssdStudentInfoAdd', query: { done: this.jindu.xxcnt, shzt: this.isCheckedsdx.cyzt, status: '3', name: item.name } }) break; case 'gxx1': this.$refs.XDgongzuozuShangbaoDialog.show() break; case 'gxx1-202604bj': this.$refs.XDgongzuozuShangbaoDialogBJ202604.show() break; case 'gxx17': if (!this.jindu.gzzcnt) { this.$alert('请先上报工作组信息', '提示', { confirmButtonText: '确定', }); return } this.$router.push({ path: '/XDxuexiaoxxDialog0', query: { done: this.jindu.xxcnt, shzt: this.isCheckedsdx.cyzt, status: '1', name: item.name } }) break; case 'gxx17-1': if (!this.jindu.gzzcnt) { this.$alert('请先上报工作组信息', '提示', { confirmButtonText: '确定', }); return } this.$router.push({ path: '/XDxuexiaoxxDialog0', query: { done: this.jindu.xxcnt, shzt: this.isCheckedsdx.cyzt, status: '2', name: item.name } }) break; case 'gxx17-2': if (!this.jindu.gzzcnt) { this.$alert('请先上报工作组信息', '提示', { confirmButtonText: '确定', }); return } this.$router.push({ path: '/XDxuexiaoxxDialog0', query: { done: this.jindu.xxcnt, shzt: this.isCheckedsdx.cyzt, status: '3', name: item.name } }) break; case 'gxx4': this.$router.push({ path: '/zdssfa', query: { name: item.name } }) break; case 'gxx5': this.$router.push({ path: '/schjyq', query: { name: item.name } }) break; case 'gxx6': $.get("/www/public/shangbao/exportbj_pd", { schoolid: that.user.ID }, function (res) { if (res.error == 0) { that.$router.push({ path: '/ckccbjmd', query: { name: item.name } }) } else { that.$message.error(res.message) } }).fail((xhr, status, error) => { }) break; case 'gxx6-202604bj': $.get("/www/public/shangbao/exportbj_pd", { schoolid: that.user.ID }, function (res) { if (res.error == 0) { that.$router.push({ path: '/ckccbjmdBJ', query: { name: item.name } }) } else { that.$message.error(res.message) } }).fail((xhr, status, error) => { }) break; case 'gxx7': this.$router.push({ path: '/czygfpx', query: { name: item.name } }) break; case 'gxx8': this.$router.push({ path: '/zdcssjap', query: { name: item.name } }) break; case 'gxx9': this.$alert('请务必在学生测试场地测试答题!', '作答测试注意事项', { confirmButtonText: '确定', center: true }).then(() => { const that = this $.get("/www/public/cpgl/getBaseSj", {}, function (res) { if (res.error == 0) { if (that.xxjd > 4) { that.$router.push(`/beforeEvaluations?gaugeId=${res.data.gjxxy}`); } else { that.$router.push(`/beforeEvaluations?gaugeId=${res.data.jjxxy}`); } } else { } }) }) break; case 'gxx10': this.exportzh_pd() break; case 'gxx10-202604bj': this.exportzh_pd_gxx202604bj() break; case 'gxx11': this.$router.push({ path: '/zczbqk', query: { name: item.name } }) break; case 'gxx12': this.$router.push({ path: '/XDjddc', query: { type: 'fourth', name: item.name } }) break; case 'gxx13': this.$router.push({ path: '/csgcjlb', query: { name: item.name } }) break; case 'gxx14': this.$router.push({ path: '/ybxscsm', query: { name: item.name } }) break; case 'gxx15': const that2 = this that2.$confirm('若无应急事件发生可不上传', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(function () { that2.$router.push({ path: '/sbyjsj', query: { name: item.name } }) }).catch(function () { }); break; case 'gxx16': this.$router.push({ path: '/sbtsqk', query: { name: item.name } }) break; /*case 'gxx17': if(!this.jindu.gzzcnt){ this.$alert('请先上报工作组信息', '提示', { confirmButtonText: '确定', }); return } this.clicktab(3) break; */ case 'xx4': this.$router.push({ path: '/zdssfa', query: { name: item.name } }) break; case 'shj5': case 'sj5': case 'xj5': this.$router.push({ path: '/zdssfa', query: { name: item.name } }) break; case 'shj4': case 'sj4': case 'xj4': this.$refs.baseDialogXDjddc.show() break; case 'shj4-1': case 'sj4-1': case 'xj4-1': this.smzt = '1' this.$refs.baseDialogXDjddc.show() break; case 'shj4-2': case 'sj4-2': case 'xj4-2': this.$router.push({ path: '/ckxsdw', query: { name: item.name } }) break; case 'xj4-2-sc': this.$router.push({ path: '/ckxsdwsc', query: { name: item.name } }) break; case 'xx5': this.$router.push({ path: '/schjyq', query: { name: item.name } }) break; case 'xx5-sc': this.$router.push({ path: '/schjyqsc', query: { name: item.name } }) break; case 'xx6': const thats = this $.get("/www/public/shangbao/exportbj_pd", { schoolid: thats.user.ID }, function (res) { if (res.error == 0) { thats.$router.push({ path: '/ckccbjmd', query: { name: item.name } }) } else { thats.$message.error(res.message) } }).fail((xhr, status, error) => { }) break; case 'shj6': case 'sj6': case 'xj6': this.$router.push({ path: '/dcybxwcssfa', query: { name: item.name } }) break; case 'xx7': this.$router.push({ path: '/czygfpx', query: { name: item.name } }) break; case 'shj7': case 'sj7': case 'xj7': this.$router.push({ path: '/ckbqxccbjmd', query: { name: item.name } }) break; case 'xx8': this.$router.push({ path: '/zdcssjap', query: { name: item.name } }) break; case 'xx8-scjj': this.$router.push({ path: '/zdcssjapsc', query: { name: item.name } }) break; case 'shj3': case 'sj3': case 'xj3': this.$router.push({ path: '/allgzzshenhe', query: { name: item.name } }) break; case 'xj3-sc': this.$router.push({ path: '/allgzzshenhesc', query: { name: item.name } }) break; case 'xx11': this.$router.push({ path: '/zczbqk', query: { name: item.name } }) break; case 'xx13': this.$router.push({ path: '/csgcjlb', query: { name: item.name } }) break; case 'xx14': this.$router.push({ path: '/ybxscsm', query: { name: item.name } }) break; case 'xx15': const that1 = this that1.$confirm('若无应急事件发生可不上传', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(function () { that1.$router.push({ path: '/sbyjsj', query: { name: item.name } }) }).catch(function () { }); break; case 'xx16': this.$router.push({ path: '/sbtsqk', query: { name: item.name } }) break; /* case 'xx17': if(!this.jindu.gzzcnt){ this.$alert('请先上报工作组信息', '提示', { confirmButtonText: '确定', }); return } this.clicktab(3) break;*/ case 'xx9': this.$alert('请务必在机房测试答题!', '作答测试注意事项', { confirmButtonText: '确定', center: true }).then(() => { const that = this $.get("/www/public/cpgl/getBaseSj", {}, function (res) { if (res.error == 0) { if (that.xxjd > 4) { that.$router.push(`/beforeEvaluations?gaugeId=${res.data.gjxxy}`); } else { that.$router.push(`/beforeEvaluations?gaugeId=${res.data.jjxxy}`); } } else { } }) }) break; case 'shj8': case 'sj8': case 'xj8': this.$router.push({ path: '/apsdy', query: { name: item.name } }) break; case 'shj9': case 'sj9': case 'xj9': this.$router.push({ path: '/XDjddc', query: { type: 'fourth', name: item.name } }) break; case 'xj9-sc': this.$router.push({ path: '/XDjddcsc', query: { type: 'fourth', name: item.name } }) break; case 'shj10': case 'sj10': case 'xj10': this.$router.push({ path: '/dcybxkzcz', query: { name: item.name } }) break; case 'shj11': case 'sj11': case 'xj11': this.$router.push({ path: '/dcybxjxzbqkzc', query: { name: item.name } }) break; case 'xx10': this.exportzh_pd() break; case 'xx10-1': this.isBj202603LpscStudentSm = false; this.exportzh_pdjj() break; case 'xx10-1-bj202603': this.isBj202603LpscStudentSm = true; this.exportzh_pdjj() break; case 'shj13': case 'sj13': case 'xj13': this.$router.push({ path: '/dcybxtxcsgcjlb', query: { name: item.name } }) break; case 'xj13-sc': this.$router.push({ path: '/dcybxtxcsgcjlbsc', query: { name: item.name } }) break; case 'shj14': case 'sj14': case 'xj14': this.$router.push({ path: '/dcsbybxscqksm', query: { name: item.name } }) break; case 'xj14-sc': this.$router.push({ path: '/dcsbybxscqksmsc', query: { name: item.name } }) break; case 'shj15': case 'sj15': case 'xj15': this.$router.push({ path: '/dcsbyjsjbg', query: { name: item.name } }) break; case 'shi21': case 'sj20': case 'xj19': var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; if (user.Roles.includes("220")) { this.$router.push({ path: '/hzyjsj', query: { name: item.name, rolestype: '1' } }) } if (user.Roles.includes("310")) { this.$router.push({ path: '/hzyjsj', query: { name: item.name, rolestype: '2' } }) } if (user.Roles.includes("410")) { this.$router.push({ path: '/hzyjsj', query: { name: item.name, rolestype: '3' } }) } if (user.Roles.includes("450")) { this.$router.push({ path: '/hzyjsj', query: { name: item.name, rolestype: '4' } }) } break; case 'shj16': case 'sj16': case 'xj16': this.$router.push({ path: '/tsqksm', query: { name: item.name } }) break; case 'shj19': case 'xj19': this.$router.push({ path: '/XDjibenzigeshenhe', query: { name: item.name } }) break; case 'sj19': this.downloadjyj() break; case 'shj20': this.downloadzh() break; case 'shj22': this.$router.push({ path: '/ssgzzj', query: { name: item.name } }) break; case 'gxx19': this.viewReportDialogVisible = true; break; case 'gxx19-ssd': this.viewReportSsdDialogVisible = true; break; case 'xx20': case 'gxx20': this.showSdyList() break; case 'xx21': this.$router.push({ path: '/classInfoUploadNew1', query: { name: item.name } }) break; case 'shj23': case 'sj23': case 'xj20': this.$router.push({ path: '/scsdcl', query: { name: item.name } }) break; case 'sj24': case 'shj24': this.$router.push({ path: '/cksdcl', query: { name: item.name } }) break; case 'xx-22': case 'gxx-22': case 'xx-23': case 'gxx-23': this.$router.push({ path: 'commonToolInstructions', query: { name: item.name } }) break; case 'xx-24': case 'gxx-24': this.handleYunnanDownload() break; case 'xx-25': case 'gxx-25': this.$router.push({ path: 'behavioralObservationAdmin', query: { name: item.name } }) break; case 'xx-26': case 'gxx-26': this.$router.push({ path: 'interviewManagementAdmin', query: { name: item.name } }) break; case 'xx-27': case 'gxx-27': this.$router.push({ path: 'studentPsychologicalArchives', query: { name: item.name } }) break; default: } }, handleYunnanDownload() { var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var that = this; that.yunnanFiles = []; that.yunnanDialogVisible = true; // 如果是 sfqy == 1 的情况,调用新接口 findbgfile if (String(this.sfqy) === '1' && this.bgPath) { $.get('/www/public/baogao/findbgfile', { path: this.bgPath }, function (res) { if (res.success == 1 || res.error == 0) { if (res.data && Array.isArray(res.data)) { // 返回的是文件列表数组,包含 id、filename、filepath 等字段 that.yunnanFiles = res.data.map(function (item, index) { return { id: item.id || '', // 行的 id,用于下载和预览 filename: item.filename || item.fileName || ('文件' + (index + 1)), filepath: item.filepath || item.filePath || '', ddmpath: item.ddmpath || '', bgpath: item.bgpath || '', isBgFile: true // 标记这是通过 findbgfile 接口获取的文件 }; }); } else if (res.data) { // 如果返回的是单个对象 that.yunnanFiles = [{ id: res.data.id || '', filename: res.data.filename || res.data.fileName || '文件', filepath: res.data.filepath || res.data.filePath || '', ddmpath: res.data.ddmpath || '', bgpath: res.data.bgpath || '', isBgFile: true }]; } } else { that.$message.error(res.message || '请求失败'); } }).fail(function () { that.$message.error('请求失败') }); return; } // 原有的云南/雄安逻辑(仅当不是 sfqy == 1 时执行);810/811/815/816 同步拉 findPDFFile if (this.isYunnanUser || this.isXionganUser || this.isInterViewMaterialRole) { var isXA = this.isXionganUser var t1 = isXA ? 3 : 1 var t2 = isXA ? 4 : 2 $.get('/www/public/baogao/findPDFFile', { type: t1 }, function (res) { if (res.success == 1 || res.error == 0) { if (res.data) { var fn = res.data.fileName || res.data.filename; var preview1 = isXA ? 'https://xinlijc.bnu.edu.cn/content/yn/雄安新区教师心理培训学习材料0114.pdf' : 'https://xinlijc.bnu.edu.cn/content/yn/1.pdf'; that.yunnanFiles.push({ filename: fn, path: preview1, type: t1, isBgFile: false }); } } else { that.$message.error(res.message || '请求失败'); } }).fail(function () { that.$message.error('请求失败') }); $.get('/www/public/baogao/findPDFFile', { type: t2 }, function (res) { if (res.success == 1 || res.error == 0) { if (res.data) { var fn = res.data.fileName || res.data.filename; var preview2 = isXA ? 'https://xinlijc.bnu.edu.cn/content/yn/预警学生名单保密协议1.pdf' : 'https://xinlijc.bnu.edu.cn/content/yn/2.pdf'; that.yunnanFiles.push({ filename: fn, path: preview2, type: t2, isBgFile: false }); } } else { that.$message.error(res.message || '请求失败'); } }).fail(function () { that.$message.error('请求失败') }); } }, downloadYunnanFile(item) { var that = this // 如果是通过 findbgfile 接口获取的文件,使用 id 下载 if (item && item.isBgFile && item.id) { axios({ method: 'get', url: '/www/public/baogao/downloadbgfile', params: { id: item.id }, responseType: 'blob' }).then(function (res) { if (res.status == 200) { var blob = new Blob([res.data]) var link = document.createElement('a') link.href = window.URL.createObjectURL(blob) link.setAttribute('download', item.filename || '文件') document.body.appendChild(link) link.click() document.body.removeChild(link) that.$message.success('下载成功') } else { that.$message.error('下载失败') } }).catch(function () { that.$message.error('下载失败') }) return } // 原有的云南/雄安下载逻辑 if (item && item.type !== undefined) { var t = Number(item.type) axios({ method: 'get', url: '/www/public/baogao/downloadPDFFile1', params: { type: String(t) }, responseType: 'blob' }).then(function (res) { if (res.status == 200) { var blob = new Blob([res.data]) var link = document.createElement('a') link.href = window.URL.createObjectURL(blob) link.setAttribute('download', (item && item.filename) || '文件') document.body.appendChild(link) link.click() document.body.removeChild(link) that.$message.success('下载成功') } else { that.$message.error('下载失败') } }).catch(function () { that.$message.error('下载失败') }) } }, previewYunnanFile(item) { if (!item) { this.$message.error('预览地址缺失') return } // 如果是通过 findbgfile 接口获取的文件,使用 id 生成预览链接 if (item.isBgFile && item.id) { var previewUrl = 'https://xinlijc.bnu.edu.cn/core/UForm/fileviewer/r_bg_file?ff=id&fv=' + item.id window.open(previewUrl, '_blank') return } // 原有的云南/雄安预览逻辑 if (item.path) { window.open(item.path, '_blank') } else { this.$message.error('预览地址缺失') } }, downloadzh() { var that = this that.downloadzhDialogVisible = true; }, downloadjyj() { var that = this that.downloadjyjDialogVisible = true; }, DexportFn() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var name //var user = this.$store.state.user var username = user.Username var bm = username.substring(3) let type if (user.Roles.includes('220')) { type = '1' name = '市、区、县管理员账号信息.xls' } else if (user.Roles.includes('310')) { type = '2' name = '区县教育局管理员账号信息.xls' } const params = { username: user.Username, type, state: '1' } axios({ method: 'get', url: '/www/public/shangbao/dcsqxzh', params: { ...params }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { let data = res.data let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') } else { this.$message.error('导出失败') } }).catch(err => { this.$message.error('导出失败') }) }, exportFn1() { var that = this //var user = this.$store.state.user var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} const params = { username: user.Username, } $.get("/www/public/bd/pdsfxzxxzh", params, function (res) { if (res.success == 1) { if (res.data == 1) { const params = { username: user.Username, djsmc: that.djsmc } axios({ method: 'get', url: '/www/public/shangbao/exportxqnxxdc', params: { ...params }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { let data = res.data let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', '辖区内学校管理员账号.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') } else { this.$message.error('导出失败') } }).catch(err => { this.$message.error('导出失败') }) } else if (res.data == 2) { that.$message.warning('暂无权限下载样本校名单') } else { that.$message.warning('存在样本校基本信息未审核 请审核完成后在进行下载') } } else { that.$message.error(res.message) } }).fail((xhr, status, error) => { }) }, exportzh_pd() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} let data = { schoolid: user.ID } $.get("/www/public/shangbao/exportzh_pd", data, function (res) { if (res.error == 0) { that.downloadDialogVisible = true; } else { that.$message.error(res.message) } }).fail((xhr, status, error) => { }) }, exportzh_pd_gxx202604bj() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} let data = { schoolid: user.ID } $.get("/www/public/shangbao/exportzh_pd", data, function (res) { if (res.error == 0) { that.downloadDialogVisibleGxx202604bj = true; } else { that.$message.error(res.message) } }).fail((xhr, status, error) => { }) }, exportzh_pdjj() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} let data = { schoolid: user.ID } $.get("/www/public/shangbao/exportzh_pd", data, function (res) { if (res.error == 0) { that.$confirm(`

如账号下发后,出现学生测试账号缺失的情况,需要补报参测学生信息,请根据以下提示操作

  • 1、点击“补报参测学生信息”-出现弹框点击“下载学生信息导入模板”,仅需将补报学生的信息填入模板中,不需要填写己有测试账号的学生信息。
  • 2、点击“补报参测学生信息”-出现弹框点击“追加学生信息”,上传填写后的学生信息导入表。请务必确认已包含全部补报的学生,避免多次补报。
`, '下载学生账号说明', { dangerouslyUseHTMLString: true, confirmButtonText: '我知道了', showCancelButton: false, center: true, customClass: 'student-info-scheme-confirm' }).then(() => { that.downloadDialogVisiblejj = true; }).catch(() => { }); } else { that.$message.error(res.message) } }).fail((xhr, status, error) => { }) }, confirm() { this.$router.push({ path: '/zhiguanxiaoshenhe', query: { name: '审核直管参测校上报信息', smzt: this.smzt, } }) }, jdck() { this.$router.push('/jinduchakan') }, // 打开“生成并下载”排列方式弹窗 openStudentGenSortDialog(pendingItem) { this.studentGenSortPendingItem = String(pendingItem); this.studentGenSortDialogVisible = true; }, onStudentGenSortDialogClose() { // 关闭弹窗但不清空 pendingItem,方便再次打开 }, // 根据排列方式选择下载 confirmStudentGenSort(sortType) { this.studentGenSortDialogVisible = false; this.downloadAccount(this.studentGenSortPendingItem, sortType); }, downloadAccount(item, sortType) { console.log(`请求下载类型: ${item}`); const that = this const isStudentGenDownload = item == 2 || item == 3 if (isStudentGenDownload) { that.studentGenDownloadFullLoading = true } var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} let data = { xxid: user.ID } $.post("/www/public/chouyang/sb_findzhxfzt", data, function (res) { if (res.error == 0) { if (item == 3) { that.XXexportFn('first', sortType) } else if (item == 2) { that.XXexportFn('third', sortType) } else if (item == 4) { that.XXexportFn('second') } else if (item == 8) { that.xljkfzrdown() } } else { that.$message.error(res.message) if (isStudentGenDownload) { that.studentGenDownloadFullLoading = false } } }).fail((xhr, status, error) => { if (isStudentGenDownload) { that.studentGenDownloadFullLoading = false } }) this.downloadDialogVisible = false; // 点击后关闭弹窗 this.downloadDialogVisiblejj = false; }, downloadAccount_202604bj(item) { const that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var schoolid = user.ID if (item == 3) { axios({ method: 'get', url: '/www/public/shangbao/exportStudent_202604bj', params: { schoolid }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '学生账号.xls'); document.body.appendChild(aLink); aLink.click(); document.body.removeChild(aLink); this.$message.success('导出成功') } else { this.$message.error('导出失败') } }).catch(() => { this.$message.error('导出失败') }).finally(() => { that.downloadDialogVisibleGxx202604bj = false; }) return } if (item == 4) { axios({ method: 'get', url: '/www/public/shangbao/exportteather_202604bj', params: { schoolid }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '教师账号.xls'); document.body.appendChild(aLink); aLink.click(); document.body.removeChild(aLink); this.$message.success('导出成功') } else { this.$message.error('导出失败') } }).catch(() => { this.$message.error('导出失败') }).finally(() => { that.downloadDialogVisibleGxx202604bj = false; }) return } else if (item == 8) { that.xljkfzrdown() } that.downloadDialogVisibleGxx202604bj = false; }, xljkfzrdown(activeName) { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var schoolid = user.ID const params = { } var url = '/www/public/shangbao/exportxxfzr' var name = '学校心理健康负责人登录账号.xls' axios({ method: 'get', url, params: { schoolid }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { console.log(res, 'res') let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') } else { this.$message.error('导出失败') } }).catch(err => { this.$message.error('导出失败') }) }, XXexportFn(activeName, sortType) { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var schoolid = user.ID const params = { schoolid, } if (sortType === '1' || sortType === '2' || sortType === 1 || sortType === 2) { params.sortType = String(sortType); } var url var name if (activeName == 'first') { if (that.sfnmlc == 0) { url = "/www/public/shangbao/exportStudent" } else { // bj202603 流程:学生账号导出改用 lpsc 接口 url = that.isBj202603LpscStudentSm ? "/www/public/shangbao/exportStudent_sm_lpsc" : "/www/public/shangbao/exportStudent_sm" } name = '学生账号.xls' } else if (activeName == 'second') { url = "/www/public/shangbao/exportteather_new" name = '教师账号.xls' } else if (activeName == 'third') { url = "/www/public/shangbao/exportStudent_zjpc" name = '追加学生账号.xls' } else { url = "/www/public/shouye/px_webftybm_dcbxftyzh" name = '访谈员账号.xls' } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { console.log(res, 'res') let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') } else { this.$message.error('导出失败') } }).catch(err => { this.$message.error('导出失败') }).finally(() => { if (activeName === 'first' || activeName === 'third') { this.studentGenDownloadFullLoading = false } }) }, getIsCheckedsdx() { var that = this const params = { } $.get("/www/public/shangbao/findschloolshztandsfsdx", params, function (res) { if (res.success == 1) { console.log(res.data, 'res.data') that.isCheckedsdx = res.data } }).fail((xhr, status, error) => { }) }, clicktab(val) { this.getjindu1(val) }, getjindu(val) { var that = this that.getStatus() var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var schoolid = user.ID //xxid,pageno,pagesize const params = { xxid: schoolid, } $.get("/www/public/shangbao/cnt_sb_jd", params, function (res) { if (res.success == 1) { that.jindu = res.data } }).fail((xhr, status, error) => { }) }, getjindu1(val) { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var schoolid = user.ID //xxid,pageno,pagesize const params = { xxid: schoolid, } $.get("/www/public/shangbao/cnt_sb_jd", params, function (res) { if (res.success == 1) { var num = res.data.xxcnt + 1 console.log(num) console.log(val) if (num >= val) { if (['1', '2', '3', '4'].includes(that.xxjd)) { that.gjstep = 0 that.step = val that.$router.push({ path: '/XDxuexiaoxxDialog0', query: { done: that.jindu.xxcnt, shzt: that.isCheckedsdx.cyzt, } }) } else { that.step = 0 that.gjstep = val that.$router.push({ path: '/XDxuexiaoxxDialog0', query: { done: that.jindu.xxcnt, shzt: that.isCheckedsdx.cyzt, } }) } } else { that.$message.warning('请先完成前面步骤信息上报') } } else { this.$message.error(res.message) } }).fail((xhr, status, error) => { }) }, getList() { var menuRoles = localStorage.getItem('menuRoles') ? JSON.parse(localStorage.getItem('menuRoles')) : {} const that = this; $.get("/www/public/menuconfig/userzt", {}, function (resd) { if (resd.success == 1) { var cdlist = resd.data // userzt 返回的菜单类型:menutype==1 => mode=4;其他不覆盖 var mt = String(cdlist && cdlist.menutype) that.menuTypeHomeLayoutMode = mt === '1' ? 4 : 0 that.sfnmlc = resd.data.sfnmlc localStorage.setItem('lcid', JSON.stringify(cdlist.lcid)) localStorage.setItem('sfnmlc', JSON.stringify(cdlist.sfnmlc)) const data = { roles: menuRoles, lcid: cdlist.lcid ? cdlist.lcid : '', nmzt: cdlist.sfnmlc } // 首页文字配置:根据 userzt 返回 lcid + 当前角色映射调用 findcontent(先不展示) that.fetchHomeTextConfig(cdlist.lcid) $.get("/www/public/menuconfig/syfind", data, function (res) { if (res.success == 1) { // 数据处理 const items = res.data || []; var interviewHomeStepNameMap = { 'xx-22': '工作说明', 'gxx-22': '工作说明', 'xx-23': '工作要求', 'gxx-23': '工作要求', 'xx-24': '资料下载', 'gxx-24': '资料下载', 'xx-25': '行为观察管理', 'gxx-25': '行为观察管理', 'xx-26': '访谈管理', 'gxx-26': '访谈管理', 'xx-27': '学生档案管理', 'gxx-27': '学生档案管理' }; items.forEach(function (i) { if (i && i.bs && interviewHomeStepNameMap[i.bs]) { i.name = interviewHomeStepNameMap[i.bs]; } }); // 保存全量用于 layoutmode==4 // 按阶段分组并排序 that.group1 = items.filter(i => i.jd === '1').sort((a, b) => a.px - b.px); that.group2 = items.filter(i => i.jd === '2').sort((a, b) => a.px - b.px); that.group3 = items.filter(i => i.jd === '3').sort((a, b) => a.px - b.px); // that.getcsjd() that.csjdList() that.syfindAllItems = [...that.group1, ...that.group2, ...that.group3]; if ((that.isYunnanUser || that.isXionganUser || String(that.sfqy) === '1' || that.isInterViewMaterialRole) && !that.showReportCenter()) { var exists = Array.isArray(that.group1) && that.group1.some(function (i) { return i.bs === 'yunnan_download' }) if (!exists) { that.group1.unshift({ name: '资料下载', bs: 'yunnan_download', ycw: 0 }) that.bsMap['yunnan_download'] = '下载' } } // 获取菜单数据后,立即获取步骤状态 that.getStatus(); } else { } }).fail((xhr, status, error) => { that.$message.error('登录信息过期') that.$router.push('/login'); }) } else { } }).fail((xhr, status, error) => { that.$message.error('登录信息过期') that.$router.push('/login'); }) }, formatDate(item) { if (item.kssj && item.jssj) { // 2025/07/08 => 2025 07.08 var start = item.kssj.replace(/\//g, '-').replace(/^(\d{4})-(\d{2})-(\d{2})$/, '$1 $2.$3'); var end = item.jssj.replace(/\//g, '-').replace(/^(\d{4})-(\d{2})-(\d{2})$/, '$1 $2.$3'); return start + '-' + end; } return ''; }, // 显示视导员名单 getViewReportCode() { var vm = this; var name = (vm.viewReportForm.name || '').trim(); var phone = (vm.viewReportForm.phone || '').trim(); if (!name) { vm.$message.warning('请输入姓名'); return; } if (!/^1\d{10}$/.test(phone)) { vm.$message.warning('请输入正确的手机号'); return; } var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var userid = (user && user.ID) || ''; $.get('/www/public/cpgl/ckbgjlverifyCode', { name: name, phone: phone, userid: userid }, function (res) { console.log(res, 'res') if (res.success == 1 || res.error == 0) { vm.viewReportCodeCountdown = 60; var t = setInterval(function () { vm.viewReportCodeCountdown--; if (vm.viewReportCodeCountdown <= 0) clearInterval(t); }, 1000); vm.$message.success('验证码已发送'); } else { vm.$message.error(res.message || '获取验证码失败'); } }).fail(function () { vm.$message.error('请求失败'); }); }, confirmViewReport() { var vm = this; var name = (vm.viewReportForm.name || '').trim(); var phone = (vm.viewReportForm.phone || '').trim(); var yanzhengma = (vm.viewReportForm.verifyCode || '').trim(); if (!name) { vm.$message.warning('请输入姓名'); return; } if (!/^1\d{10}$/.test(phone)) { vm.$message.warning('请输入正确的手机号'); return; } if (!yanzhengma) { vm.$message.warning('请输入验证码'); return; } $.get('/www/public/cpgl/ckbgjl', { yanzhengma: yanzhengma }, function (res) { console.log(res, 'res') if (res.success == 1 || res.error == 0) { vm.viewReportDialogVisible = false; vm.viewReportForm = { name: '', phone: '', verifyCode: '' }; vm.$router.push({ path: '/showReport' }); } else { vm.$message.error(res.message || '验证失败'); } }).fail(function () { vm.$message.error('请求失败'); }); }, getViewReportCodeSsd() { var vm = this; var name = (vm.viewReportSsdForm.name || '').trim(); var phone = (vm.viewReportSsdForm.phone || '').trim(); if (!name) { vm.$message.warning('请输入姓名'); return; } if (!/^1\d{10}$/.test(phone)) { vm.$message.warning('请输入正确的手机号'); return; } var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var userid = (user && user.ID) || ''; $.get('/www/public/cpgl/ckbgjlverifyCode', { name: name, phone: phone, userid: userid }, function (res) { if (res.success == 1 || res.error == 0) { vm.viewReportSsdCodeCountdown = 60; var t = setInterval(function () { vm.viewReportSsdCodeCountdown--; if (vm.viewReportSsdCodeCountdown <= 0) clearInterval(t); }, 1000); vm.$message.success('验证码已发送'); } else { vm.$message.error(res.message || '获取验证码失败'); } }).fail(function () { vm.$message.error('请求失败'); }); }, confirmViewReportSsd() { var vm = this; var name = (vm.viewReportSsdForm.name || '').trim(); var phone = (vm.viewReportSsdForm.phone || '').trim(); var yanzhengma = (vm.viewReportSsdForm.verifyCode || '').trim(); if (!name) { vm.$message.warning('请输入姓名'); return; } if (!/^1\d{10}$/.test(phone)) { vm.$message.warning('请输入正确的手机号'); return; } if (!yanzhengma) { vm.$message.warning('请输入验证码'); return; } $.get('/www/public/cpgl/ckbgjl', { yanzhengma: yanzhengma }, function (res) { if (res.success == 1 || res.error == 0) { vm.viewReportSsdDialogVisible = false; vm.viewReportSsdForm = { name: '', phone: '', verifyCode: '' }; vm.$router.push({ path: '/showReportSsd' }); } else { vm.$message.error(res.message || '验证失败'); } }).fail(function () { vm.$message.error('请求失败'); }); }, showSdyList() { const that = this // 先调用查询视导员名单接口 $.get("/www/public/sdy/xxfindsdyList", function (res) { if (res.success == 1) { if (res.data && res.data.length > 0) { // 有视导员数据,显示弹框 that.sdyList = res.data that.sdyDialogVisible = true // 调用更新状态接口 $.post("/www/public/sdy/cdsdygx", {}, function (updateRes) { // 更新状态接口调用完成 }) } else { // 没有视导员数据,显示提示 that.$message({ message: '暂未指派视导员', type: 'warning' }) } } else { that.$message({ message: '查询视导员名单失败', type: 'error' }) } }) }, // 弹框关闭时的回调(通过@close事件触发) onSdyDialogClose() { // 只调用菜单状态接口,不手动设置sdyDialogVisible // 因为:visible.sync会自动处理弹框状态 this.getStatus() }, csjdList() { const that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var code = '' var id = '' if (user.Roles.includes("220") || user.Roles.includes("310") || user.Roles.includes("410")) { code = user.Username.slice(-6); } if (user.Roles.includes("450")) { id = user.ID } let data = { code: code, id: id } const progressApi = this.homeLayoutMode === 4 ? "/www/public/bd/jdrscx202604bj" : "/www/public/bd/jdrscx" $.get(progressApi, data, function (res) { if (res.success == 1) { that.csjd = res.data } }) }, isStepCompleted(index) { for (let i = 0; i <= index; i++) { if (!this.group1[i]?.completed) return false; } return true; }, // 判断是否显示状态标识 getStatusDisplay(item, groupType) { if (!this.jdtjData || !item.bs) return false; const value = this.jdtjData[item.bs]; // 只有已完成(字符串'1')或数字状态才显示 return (typeof value === 'string' && value === '1') || typeof value === 'number'; }, // 判断是否显示对号(只有字符串'1'显示绿色对号) isCheckMark(item) { if (!this.jdtjData || !item.bs) return false; const value = this.jdtjData[item.bs]; return typeof value === 'string' && value === '1'; }, // 判断是否是数字状态(显示三个点) isNumberStatus(item) { if (!this.jdtjData || !item.bs) return false; const value = this.jdtjData[item.bs]; return typeof value === 'number'; }, // 获取状态数字 getStatusNumber(item) { if (!this.jdtjData || !item.bs) return ''; const value = this.jdtjData[item.bs]; return typeof value === 'number' ? value : ''; }, // 获取状态样式类名 getStatusClass(item, groupType) { if (!this.jdtjData || !item.bs) return ''; const value = this.jdtjData[item.bs]; // 字符串'1'显示绿色对号 if (typeof value === 'string' && value === '1') { return 'green-check'; } // 数字类型显示三个点 if (typeof value === 'number') { return 'dots-indicator'; } return ''; }, // mode4:根据 item.jd 只区分 jd==2(02样式/内容),其它用 01 样式/内容 getMode4GroupKey(item) { return item && String(item.jd) === '2' ? 'group2' : 'group1' }, getMode4ItemKey(item) { if (!item) return '' return item.bs || item.id || item.name || '' }, getMode4GroupList(groupKey) { if (groupKey === 'group2') return this.group2 || [] // 其它全部按 group1 渲染 return this.group1 || [] }, getMode4IndexInGroup(item, groupKey) { const list = this.getMode4GroupList(groupKey) const key = this.getMode4ItemKey(item) if (!key) return -1 return (list || []).findIndex(x => this.getMode4ItemKey(x) === key) }, isMode4LastInGroup(item, groupKey) { const list = this.getMode4GroupList(groupKey) if (!list || !list.length) return true const idx = this.getMode4IndexInGroup(item, groupKey) return idx === list.length - 1 }, isMode4NextYcwCompleted(item, groupKey) { const list = this.getMode4GroupList(groupKey) if (!list || !list.length) return false const idx = this.getMode4IndexInGroup(item, groupKey) if (idx < 0) return false const next = list[idx + 1] return !!(item && item.ycw === 1 && next && next.ycw === 1) }, getZhzt() { const that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; $.get("/www/public/baogao/findzhzt", { userid: user.ID }, function (res) { if (res.success == 1 || res.error == 0) { if (res.data) { that.sfzg = res.data.sfzg; that.sfkqbg = res.data.sfkqbg; that.sfqy = res.data.sfqy || ''; var p = res.path || res.data.path; that.bgPath = p || ''; that.isYunnanUser = !!(p && p.indexOf('/app_data/vp/uform/bg/yunnan2025/') !== -1); that.isXionganUser = !!(p && p.indexOf('/app_data/vp/uform/bg/xionganbaogao/') !== -1); } } }) } }, computed: { // 模块整体时间(示例格式) module1Date() { return this.group1.length > 0 ? `${this.formatDate(this.group1[0])}-${this.formatDate(this.group1[this.group1.length - 1])}` : ''; }, // 判断是否为权限770用户 isRole770() { var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; return user.Roles && user.Roles.includes('770'); }, // 判断:角色为教育局并且用户名第4-5位是19,就不显示测评进度的教师进度和心理健康负责人进度 hideProgressJyj() { var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; const needHide = (user.Roles.includes('220') || user.Roles.includes('410')) && user.Username.slice(3, 5) == '19' return !needHide }, // userid 为指定值时:三块同一行左右并排,其他用户保持原布局 isSingleColumnLayout() { var user = this.user && (this.user.ID != null || this.user.id != null) ? this.user : (localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}); var uid = user.ID != null ? String(user.ID) : (user.id != null ? String(user.id) : ''); return uid === 'bb1bbed4-4488-4185-bc5c-98d7c743f61a'; }, showReportCenter() { var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; return user.Roles && (user.Roles.includes('651') || user.Roles.includes('652') || user.Roles.includes('653') || user.Roles.includes('654')); }, // 首页三块显示模式:1=报告中心 2=原布局(顶一底二) 3=单列左右并排;用于 v-if 与顶部调试展示 homeLayoutMode() { var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; if ( user.Roles && (user.Roles.includes('810') || user.Roles.includes('811') || user.Roles.includes('815') || user.Roles.includes('816') || user.Roles.includes('817') || user.Roles.includes('812')) ) return 5; if (this.menuTypeHomeLayoutMode === 4) return 4 if (this.showReportCenter && !this.isSingleColumnLayout) return 1; if (!this.isSingleColumnLayout) return 2; return 3; }, // mode3 下排两块:测后工作拆成左右两半 group3Left() { const list = this.group3 || []; const mid = Math.ceil(list.length / 2); return list.slice(0, mid); }, group3Right() { const list = this.group3 || []; const mid = Math.ceil(list.length / 2); return list.slice(mid); }, // 访谈老师/观察老师/两类管理员(810/811/815/816):与 intermode5 一致,可走云南资料接口 isInterViewMaterialRole() { var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var roles = user.Roles; var codes = ['810', '811', '815', '816', '812']; if (roles && Array.isArray(roles)) { for (var i = 0; i < codes.length; i++) { if (roles.indexOf(codes[i]) !== -1) return true; } } var ur = user.UserFilter && user.UserFilter.urole; if (ur != null) { var n = Number(ur); if (n === 810 || n === 811 || n === 815 || n === 816 || n === 818 || n === 812) return true; } return false; }, currentReportItems() { var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; // 统一判断是否显示资料下载的条件 var showDownload = this.isYunnanUser || this.isXionganUser || String(this.sfqy) === '1' || this.isInterViewMaterialRole; if (user.Roles && user.Roles.includes('651')) { // 省级角色 (651) // sfzg == '0': 第二个模块改为 市级报告权限授权 if (this.sfzg == '0') { var arr = [ { code: 'prov-report', name: '省级报告下载', action: '下载' }, { code: 'city-report-auth', name: '市级报告权限授权', action: '查看' }, { code: 'county-report-download', name: '区县级报告下载', action: '查看' }, { code: 'school-report-auth', name: '校级报告下载', action: '查看' } ]; if (showDownload) arr.unshift({ code: 'yunnan_download', name: '资料下载', action: '下载' }) return arr } var arr = this.reportItemsProvince.slice(); // sfzg == 1 时不显示区县级报告下载 if (this.sfzg == '1') { arr = arr.filter(item => item.code !== 'county-report-download'); } if (showDownload) arr.unshift({ code: 'yunnan_download', name: '资料下载', action: '下载' }) return arr } if (user.Roles && user.Roles.includes('652')) { var arr = this.reportItemsCounty.slice(); if (showDownload) arr.unshift({ code: 'yunnan_download', name: '资料下载', action: '下载' }) return arr } if (user.Roles && user.Roles.includes('653')) { var arr = this.reportItemsSchool.slice(); if (showDownload) arr.unshift({ code: 'yunnan_download', name: '资料下载', action: '下载' }) return arr } if (user.Roles && user.Roles.includes('654')) { // 市级角色 (654) // sfkqbg == '0': 去掉第一步 (市级报告下载) if (this.sfkqbg == '0') { var arr = this.reportItemsCity.filter(item => item.code !== 'city-report'); if (showDownload) arr.unshift({ code: 'yunnan_download', name: '资料下载', action: '下载' }) return arr } var arr = this.reportItemsCity.slice(); if (showDownload) arr.unshift({ code: 'yunnan_download', name: '资料下载', action: '下载' }) return arr } return []; } }, created: function () { const that = this that.user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {} var user = that.user if (user.Roles && (user.Roles.includes('651') || user.Roles.includes('652') || user.Roles.includes('653') || user.Roles.includes('654'))) { that.getZhzt() } var interMatRoles = user.Roles && (user.Roles.includes('810') || user.Roles.includes('811') || user.Roles.includes('815') || user.Roles.includes('816')); var interMatUrole = user.UserFilter && [810, 811, 815, 816].indexOf(Number(user.UserFilter.urole)) !== -1; if (interMatRoles || interMatUrole) { that.getZhzt() } if (user.Roles && user.Roles.includes('450')) { that.getxxjd() } that.getList() // getList中会调用getStatus that.getjindu() that.getIsCheckedsdx() // that.csjdList() }, mounted: function () { try { const topC = document.querySelector('.top-items-container') const leftC = document.querySelector('.homeInfoBottomLeft .bottom-items-container') const rightC = document.querySelector('.homeInfoBottomRight .bottom-items-container') const parseNum = (v) => v == null ? null : (isNaN(parseInt(v, 10)) ? null : parseInt(v, 10)) // 优先恢复聚合键 try { const agg = localStorage.getItem('homeScrollPositions') if (agg) { const pos = JSON.parse(agg) requestAnimationFrame(() => { if (topC && typeof pos.top === 'number') topC.scrollTo({ left: pos.top, behavior: 'auto' }) if (leftC && typeof pos.bottomLeft === 'number') leftC.scrollTo({ left: pos.bottomLeft, behavior: 'auto' }) if (rightC && typeof pos.bottomRight === 'number') rightC.scrollTo({ left: pos.bottomRight, behavior: 'auto' }) }) } else { // 兼容旧键并迁移 const t = parseNum(localStorage.getItem('homeScroll_top')) const l = parseNum(localStorage.getItem('homeScroll_bottomLeft')) const r = parseNum(localStorage.getItem('homeScroll_bottomRight')) if (t !== null || l !== null || r !== null) { const pos = { top: t || 0, bottomLeft: l || 0, bottomRight: r || 0 } requestAnimationFrame(() => { if (topC) topC.scrollTo({ left: pos.top, behavior: 'auto' }) if (leftC) leftC.scrollTo({ left: pos.bottomLeft, behavior: 'auto' }) if (rightC) rightC.scrollTo({ left: pos.bottomRight, behavior: 'auto' }) }) try { localStorage.setItem('homeScrollPositions', JSON.stringify(pos)) localStorage.removeItem('homeScroll_top') localStorage.removeItem('homeScroll_bottomLeft') localStorage.removeItem('homeScroll_bottomRight') } catch (e) { } } } } catch (e) { } // 冷启动抑制:若由登录首次进入首页,短暂禁止保存,避免布局/动画中间值写入 try { if (localStorage.getItem('homeColdStart')) { this.__autoScrolling = true setTimeout(() => { this.__autoScrolling = false }, 800) localStorage.removeItem('homeColdStart') } } catch (e) { } // 绑定监听,统一写入聚合键(保护:避免把已有非零值用0覆盖 + 节流 + 程序化滚动抑制) let __lastSaveTs = 0 const saveAgg = () => { try { // 程序化滚动或冷启动期间不保存 if (this && this.__autoScrolling) return // 简单节流,避免高频触发 const __now = Date.now() if (__now - __lastSaveTs < 120) return __lastSaveTs = __now const stored = (() => { try { return JSON.parse(localStorage.getItem('homeScrollPositions')) || {}; } catch (e) { return {}; } })() const readVal = (el, key) => { if (el && typeof el.scrollLeft === 'number') return Math.round(el.scrollLeft || 0) return (typeof stored[key] === 'number') ? stored[key] : undefined } const topVal = readVal(topC, 'top') const leftVal = readVal(leftC, 'bottomLeft') const rightVal = readVal(rightC, 'bottomRight') const next = {} if (typeof topVal === 'number') next.top = topVal if (typeof leftVal === 'number') next.bottomLeft = leftVal if (typeof rightVal === 'number') next.bottomRight = rightVal // 如果将要写入的三个值都为0,且历史中存在任一非零值,则跳过写入,避免清零 const allZeroNext = ((next.top | 0) === 0) && ((next.bottomLeft | 0) === 0) && ((next.bottomRight | 0) === 0) const hasHistoryNonZero = (stored && (((stored.top | 0) > 0) || ((stored.bottomLeft | 0) > 0) || ((stored.bottomRight | 0) > 0))) if (allZeroNext && hasHistoryNonZero) { return } const merged = { ...stored, ...next } if (Object.keys(merged).length > 0) { localStorage.setItem('homeScrollPositions', JSON.stringify(merged)) } } catch (e) { } } if (topC) topC.addEventListener('scroll', saveAgg, { passive: true }) if (leftC) leftC.addEventListener('scroll', saveAgg, { passive: true }) if (rightC) rightC.addEventListener('scroll', saveAgg, { passive: true }) try { window.addEventListener('hashchange', saveAgg) } catch (e) { } // 记录解绑函数 this._cleanupScroll = () => { try { if (topC) topC.removeEventListener('scroll', saveAgg) if (leftC) leftC.removeEventListener('scroll', saveAgg) if (rightC) rightC.removeEventListener('scroll', saveAgg) try { window.removeEventListener('hashchange', saveAgg) } catch (e) { } // 离开前兜底保存一次(同样带保护逻辑) saveAgg() } catch (e) { } } } catch (e) { } }, beforeDestroy: function () { if (this._cleanupScroll) this._cleanupScroll() }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-editTrainingStep3", function(resolve, reject){ var template = "\n
\n
\n \n \n 颁发证书\n 不颁发证书\n \n \n \n
\n
\n \t\n
\n
\n \n
\n
\n \n
\n 最低学时\n \n\t\t\t\t\t\t\t分钟\n
\n
\n 总学时\n\t\t\t\t\t\t\t{{zxs}}\n
\n
\n
\n
\n
\t\n
\n \n 取消\n 完成\n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ const validateZdxs = (rule, value, callback) => { console.log(this.form) if (value === '' && this.form.xsdb) { callback(new Error('请输入最低学时')); } else { callback(); } }; return { form: { pxid: '', zxzs: 1, wcxx: 0, ksjg: 0, xsdb: 0, zdxs: null, zxs: this.zxs, }, rules: { zdxs: [ { validator: validateZdxs, trigger: 'blur' } ] } }; }, methods: { async getCertificateInfo() { let url = '/www/public/pxks/pxZsInfo'; const params = { pxid: this.editId } try{ const {error, data} = await $.get(url, params) if(error == 0 && data){ const { createtime, ...restData } = data; this.$set(this.$data, 'form', { ...restData }); } } catch(e){ this.$message({ type: 'warning', message: "获取证书条件失败" }); } }, handleCancel() { this.$set(this.$data, 'form', { pxid: '', zxzs: 1, wcxx: 0, ksjg: 0, xsdb: 0, zdxs: null, zxs: this.zxs, }) this.$emit('cancel'); }, onSubmit() { this.$refs['form'].validate(async (valid) => { if (valid) { let url = '/www/public/pxks/pxZsAdd'; const {id, ...restData} = this.form const params = { ...this.form, pxid: this.editId } if (id) { params.id = id; delete params.pxid; url = '/www/public/pxks/pxZsEdit'; } try{ const {error, message, data} = await $.get(url, params) if(error == 0){ this.handleCancel(); } const msg = message ?? '编辑证书条件成功'; this.$message({ type: error == 0 ? 'success': 'error', message: msg }); } catch(e){ this.$message({ type: 'warning', message: "新增证书条件失败" }); } } else { console.log('error submit!!'); return false; } }); }, }, created: function(){ }, mounted: function(){ if (this.editId) { this.getCertificateInfo(); } }, props: ['editId', 'zxs'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-examJudgment", function(resolve, reject){ var template = "
\n
\n {{tmOrder}}、\n
\n \n
\n 正确答案\n \n
\n {{opt.optionName}}\n
\n
\n
\n
\n
\n\t
\n
\n 设置分数:\n
\n
\n \t删除\n \t上移\n \t下移\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, name: 'ExamJudgment', props: { // 问题结构 非一定注入 questionItem: { type: Object, default: () => { return { tmId: Math.uuid(), tmlx: 3, // 题目类型:1-单选 2-多选 3-判断 tmnr: '', tmno: 3, tmsorce: '', tmcorrectanswer: '', tmxx: [ { optionName: '对', optionId: Math.uuid(), isCorrect: false }, { optionName: '错', optionId: Math.uuid(), isCorrect: false } ], } } }, questionIdx: { type: Number, default: 0 }, questionTotal: { type: Number, default: 0 } }, data: function(){ return { id: Math.uuid(), tmOrder: this.questionIdx + 1 }; }, watch: { questionIdx(v) { this.tmOrder = v + 1 } }, methods: { moveQuestion(code) { this.$emit('move', this.questionIdx, code) }, deleteQuestion() { this.$emit('delete', this.questionIdx) } }, created: function(){ }, mounted: function(){ }, }) }) })(template, resolve, reject); }); RegVueCom("xljk-examMultipleChoice", function(resolve, reject){ var template = "
\n
\n {{tmOrder}}、\n
\n \n \n
\n \n \n \n
\n
添加
\n
删除
\n 正确答案\n
\n
\n \n
\n 添加选项\n 批量编辑\n
\n
\n
\n\t
\n
\n 设置分数:\n
\n
\n \t删除\n \t上移\n \t下移\n
\n
\n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, name: 'ExamMultipleChoice', props: { // 问题结构 非一定注入 questionItem: { type: Object, default: () => { return { tmId: Math.uuid(), tmlx: 2, // 题目类型:1-单选 2-多选 3-判断 tmnr: '', tmno: 1, tmsorce: '', tmcorrectanswer: [], tmxx: [ { optionName: '选项1', optionId: Math.uuid(), isCorrect: false }, { optionName: '选项2', optionId: Math.uuid(), isCorrect: false } ], } } }, questionIdx: { type: Number, default: 0 }, questionTotal: { type: Number, default: 0 } }, data: function(){ return { id: Math.uuid(), tmOrder: this.questionIdx + 1 }; }, watch: { questionIdx(v) { this.tmOrder = v + 1 } }, methods: { changeStart(val) { const reg = /^(-?\d+|--)$/; if(val && !reg.test(val)) { this.$message.warning('只能输入整数和固定字符“--”') return } }, changeEnd(val) { const reg = /^(-?\d+|\+\+)$/; if(val && !reg.test(val)) { this.$message.warning('只能输入整数和固定字符“++”') return } }, showOptionName(obj) { if(obj.replyType == 2) { return obj.optionName + '__' } else { return obj.optionName } }, // 增加选项 addOptions(name = '', i) { const len = this.questionItem.tmxx.length + 1; if (typeof i === 'undefined') { this.questionItem.tmxx.push({ optionName: name ? name : '选项' + len, optionId: Math.uuid(), isCorrect: false }); } else { this.questionItem.tmxx.splice(i + 1, 0, { optionName: name ? name : '选项' + len, optionId: Math.uuid(), isCorrect: false }); } }, // 删除选项 deleteOption(i) { this.questionItem.tmxx.splice(i, 1) }, // 打开批量编辑 openBatchEdit(){ const list = this.questionItem.tmxx.map(m => m.optionName); this.$refs.batchRef.open(list) }, // 批量编辑保存 batchConfirm(data) { data?.forEach((item, index) =>{ const obj = this.questionItem.tmxx[index] || undefined; if(obj) { obj.optionName = item } else { this.addOptions(item) } }) }, moveQuestion(code) { this.$emit('move', this.questionIdx, code) }, deleteQuestion() { this.$emit('delete', this.questionIdx) } }, created: function(){ }, mounted: function(){ }, }) }) })(template, resolve, reject); }); RegVueCom("xljk-examSingleChoice", function(resolve, reject){ var template = "
\n
\n {{tmOrder}}、\n
\n \n \n
\n \n \n \n
\n
添加
\n
删除
\n 正确答案\n
\n
\n
\n
\n 添加选项\n 批量编辑\n
\n
\n
\n\t
\n
\n 设置分数:\n
\n
\n \t删除\n \t上移\n \t下移\n
\n
\n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, name: 'ExamSingleChoice', props: { // 问题结构 非一定注入 questionItem: { type: Object, default: () => { return { tmId: Math.uuid(), tmlx: 1, // 题目类型:1-单选 2-多选 3-判断 tmnr: '', tmno: 1, tmsorce: '', tmcorrectanswer: '', tmxx: [ { optionName: '选项1', optionId: Math.uuid(), isCorrect: false }, { optionName: '选项2', optionId: Math.uuid(), isCorrect: false } ], } } }, questionIdx: { type: Number, default: 0 }, questionTotal: { type: Number, default: 0 } }, data: function(){ return { id: Math.uuid(), tmOrder: this.questionIdx + 1 }; }, watch: { questionIdx(v) { this.tmOrder = v + 1 } }, methods: { changeStart(val) { const reg = /^(-?\d+|--)$/; if(val && !reg.test(val)) { this.$message.warning('只能输入整数和固定字符“--”') return } }, changeEnd(val) { const reg = /^(-?\d+|\+\+)$/; if(val && !reg.test(val)) { this.$message.warning('只能输入整数和固定字符“++”') return } }, showOptionName(obj) { if(obj.replyType == 2) { return obj.optionName + '__' } else { return obj.optionName } }, // 增加选项 addOptions(name = '', i) { const len = this.questionItem.tmxx.length + 1; if (typeof i === 'undefined') { this.questionItem.tmxx.push({ optionName: name ? name : '选项' + len, optionId: Math.uuid(), isCorrect: false }); } else { this.questionItem.tmxx.splice(i + 1, 0, { optionName: name ? name : '选项' + len, optionId: Math.uuid(), isCorrect: false }); } }, // 删除选项 deleteOption(i) { this.questionItem.tmxx.splice(i, 1) }, // 打开批量编辑 openBatchEdit(){ const list = this.questionItem.tmxx.map(m => m.optionName); this.$refs.batchRef.open(list) }, // 批量编辑保存 batchConfirm(data) { data?.forEach((item, index) =>{ const obj = this.questionItem.tmxx[index] || undefined; if(obj) { obj.optionName = item } else { this.addOptions(item) } }) }, moveQuestion(code) { this.$emit('move', this.questionIdx, code) }, deleteQuestion() { this.$emit('delete', this.questionIdx) } }, created: function(){ }, mounted: function(){ }, }) }) })(template, resolve, reject); }); RegVueCom("xljk-QuestionBatchEdit", function(resolve, reject){ var template = "
\n \n \n \n \n \n \n \n\n
\n 取 消\n 确 认\n
\n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, name: 'QuestionBatch', data: function(){ return { id: Math.uuid(), formData: { content: '', }, dialogVisible: false, }; }, methods: { open(data) { this.dialogVisible = true; this.$nextTick(() => { this.formData.content = data.join('\n') }) }, handleSubmit() { if(this.formData.content) { this.$emit('confirm', this.formData.content.split('\n')) } this.handleClose() }, handleClose() { this.dialogVisible = false } }, created: function(){ }, mounted: function(){ } }) }) })(template, resolve, reject); }); RegVueCom("xljk-scsdtp-view", function(resolve, reject){ var template = "
\n \n \n
\n \n
\n

上传要求

\n
\n

请上传视导员相关图片,最多可上传3张图片,至少需要上传1张图片。

\n

图片格式支持JPG、JPEG、PNG,单张图片大小不超过5MB。

\n

请确保图片清晰,内容真实有效。

\n
\n
\n\n \n
\n

图片上传

\n
\n \n
\n
\n
图片1
\n
请上传第一张图片
\n
\n
\n \n \n
{{ photo1File.name || '图片1' }}
\n 重新上传\n
\n\n handlePhoto1UploadSuccess(res, file)\"\n :before-remove=\"beforeRemove\"\n :before-upload=\"beforeUpload\"\n accept=\".jpg,.jpeg,.png\">\n 点击上传\n \n
\n\n \n
\n
\n
图片2
\n
请上传第二张图片(可选)
\n
\n
\n \n \n
{{ photo2File.name || '图片2' }}
\n 重新上传\n
\n\n handlePhoto2UploadSuccess(res, file)\"\n :before-remove=\"beforeRemove\"\n :before-upload=\"beforeUpload\"\n accept=\".jpg,.jpeg,.png\">\n 点击上传\n \n
\n\n \n
\n
\n
图片3
\n
请上传第三张图片(可选)
\n
\n
\n \n \n
{{ photo3File.name || '图片3' }}
\n 重新上传\n
\n\n handlePhoto3UploadSuccess(res, file)\"\n :before-remove=\"beforeRemove\"\n :before-upload=\"beforeUpload\"\n accept=\".jpg,.jpeg,.png\">\n 点击上传\n \n
\n
\n \n \n
\n 提交图片\n
\n
\n
\n
\n
"; return (function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { id: Math.uuid(), photo1File: null, // 存储图片1文件 photo2File: null, // 存储图片2文件 photo3File: null, // 存储图片3文件 userid: '', imgid: '' // 图片ID,有则更新,无则新增 }; }, computed: { hasAtLeastOnePhoto() { return this.photo1File || this.photo2File || this.photo3File; } }, methods: { // 获取图片列表(回显用) getImgList() { var that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; that.userid = user.ID; let data = { userid: user.ID, }; $.get("/www/public/sdy/sdyimgfind", data, function(res) { if (res.error == 0 && res.data && res.data.id) { that.imgid = res.data.id; // 添加随机参数避免缓存 const timestamp = new Date().getTime(); // 优先使用按imgid+type的回显接口,失败则回退到接口返回的相对路径 const photo1Url = '/www/public/sdy/sdyimghx?id=' + that.imgid + '&type=1&t=' + timestamp; const photo2Url = '/www/public/sdy/sdyimghx?id=' + that.imgid + '&type=2&t=' + timestamp; const photo3Url = '/www/public/sdy/sdyimghx?id=' + that.imgid + '&type=3&t=' + timestamp; const checkImage = (url, callback) => { const img = new Image(); img.onload = () => callback(true); img.onerror = () => callback(false); img.src = url; }; // 回退路径构建 const buildDirectUrl = function(p){ return p ? ('/www/public/' + p + '?t=' + timestamp) : null; }; // 检查图片1(先imghx,失败则用img1相对路径) checkImage(photo1Url, (exists) => { if (exists) { that.photo1File = { url: photo1Url, name: '图片1', type: 'photo1' }; } else { var u1 = buildDirectUrl(res.data && res.data.img1); if (u1) { checkImage(u1, function(ok){ if (ok) { that.photo1File = { url: u1, name: '图片1', type: 'photo1' }; } }); } } }); // 检查图片2(先imghx,失败则用img2相对路径) checkImage(photo2Url, (exists) => { if (exists) { that.photo2File = { url: photo2Url, name: '图片2', type: 'photo2' }; } else { var u2 = buildDirectUrl(res.data && res.data.img2); if (u2) { checkImage(u2, function(ok){ if (ok) { that.photo2File = { url: u2, name: '图片2', type: 'photo2' }; } }); } } }); // 检查图片3(先imghx,失败则用img3相对路径) checkImage(photo3Url, (exists) => { if (exists) { that.photo3File = { url: photo3Url, name: '图片3', type: 'photo3' }; } else { var u3 = buildDirectUrl(res.data && res.data.img3); if (u3) { checkImage(u3, function(ok){ if (ok) { that.photo3File = { url: u3, name: '图片3', type: 'photo3' }; } }); } } }); } else { // 如果没有数据,确保imgid为空,这样上传时会创建新记录 that.imgid = ''; } }).fail(function() { // 请求失败时也要确保imgid为空 that.imgid = ''; }); }, // 图片1上传成功 handlePhoto1UploadSuccess(response, file) { if (response && response.success == 1) { // 添加时间戳防止缓存 const timestamp = new Date().getTime(); // 统一使用对象格式 this.photo1File = { url: response.data.url + '?t=' + timestamp, name: response.data.fileName, rawFile: file, type: 'photo1' }; this.$message.success('图片1上传成功'); // 刷新图片列表获取imgid setTimeout(() => this.getImgList(), 300); } else { this.$message.warning(response.message || '上传失败'); } }, // 图片2上传成功 handlePhoto2UploadSuccess(response, file) { if (response && response.success == 1) { // 添加时间戳防止缓存 const timestamp = new Date().getTime(); // 统一使用对象格式 this.photo2File = { url: response.data.url + '?t=' + timestamp, name: response.data.fileName, rawFile: file, type: 'photo2' }; this.$message.success('图片2上传成功'); // 刷新图片列表获取imgid setTimeout(() => this.getImgList(), 300); } else { this.$message.warning(response.message || '上传失败'); } }, // 图片3上传成功 handlePhoto3UploadSuccess(response, file) { if (response && response.success == 1) { // 添加时间戳防止缓存 const timestamp = new Date().getTime(); // 统一使用对象格式 this.photo3File = { url: response.data.url + '?t=' + timestamp, name: response.data.fileName, rawFile: file, type: 'photo3' }; this.$message.success('图片3上传成功'); // 刷新图片列表获取imgid setTimeout(() => this.getImgList(), 300); } else { this.$message.warning(response.message || '上传失败'); } }, // 上传前校验 beforeUpload(file) { const isImage = file.type.includes('image/'); const isLt5M = file.size / 1024 / 1024 < 5; if (!isImage) { this.$message.error('只能上传图片文件!'); return false; } if (!isLt5M) { this.$message.error('文件大小不能超过5MB!'); return false; } return true; }, // 移除文件前的确认 beforeRemove(file, fileList) { return this.$confirm(`确定移除 ${ file.name }?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }); }, // 手动移除文件 handleRemoveFile(fileType) { if (fileType === 'photo1File') { this.photo1File = null; } else if (fileType === 'photo2File') { this.photo2File = null; } else if (fileType === 'photo3File') { this.photo3File = null; } this.$message.info('已移除文件'); }, // 提交图片 submitPhotos() { if (!this.hasAtLeastOnePhoto) { this.$message.warning('至少需要上传一张图片!'); return; } var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; $.post("/www/public/sdy/sdyimgtj", {}, function(res) { if (res.error == 0) { this.$message.success('图片提交成功!'); } else { this.$message.error(res.message || '提交失败'); } }.bind(this)).fail(function() { this.$message.error('提交失败,请重试'); }.bind(this)); }, }, created: function() { this.getImgList(); } }); }); })(template, resolve, reject); }); RegVueCom("xljk-SelectQuestionSider", function(resolve, reject){ var template = "
\n
\n
\n \n \n \n
\n\n
\n
\n
\n
\n \n \n {{ item.name }}\n \n
\n
\n
\n\n\n
\n 导入题目\n 规则编辑\n 保存题目\n
\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, props: ["selectedQuestions"], data: function(){ return { id: Math.uuid(), activeTab: '1', questionTypesList: [ // 题目类型:1-单选 2-多选 3-判断 { id: '1', name: '选择题', type: 1 }, { id: '2', name: '多选题', type: 2 }, { id: '3', name: '判断题', type: 3 }, // { id: '3', name: '填空题', tag: 'sjgl-InputCom' }, // { id: '4', name: '多项填空题', tag: 'sjgl-InputCom' }, // { id: '5', name: '简答题', tag: 'sjgl-TextareaCom' }, // { id: '6', name: '量表题', tag: 'sjgl-ScaleCom' }, // { id: '7', name: '矩阵量表题', tag: 'sjgl-MatrixScaleCom' }, // { id: '8', name: '图片题', tag: 'sjgl-PictureCom' }, ], }; }, methods: { searchInput(){ this.getQuestionBank() }, handleSelect(item) { this.$emit('select', item.type) }, }, created: function(){ }, mounted: function(){ }, }) }) })(template, resolve, reject); }); RegVueCom("xljk-ckxxsjapb-view", function(resolve, reject){ var template = "
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n
\n
\n
\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n
\n
\n\n
\n 关 闭\n
\n
\n
"; return ( function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{}; return { currow: {}, activeName: 'first', type: 'jijiao', // jijiao=基教, gaojiao=高教 detailDialogVisible: false, detailActiveName: 'student', // 详情弹窗内部的学生/老师切换 detailType: 1, // 1=学生, 2=老师 detailData: [], detailPages: { pageNo: 1, pageSize: 10 }, detailTotal: 0, currentRow: {}, // 当前查看详情的行数据 XStableData: [], loading: false }; }, methods: { // 查看详情 viewDetail: function(row) { var self = this; self.currentRow = row; self.detailActiveName = 'student'; // 默认显示学生 self.detailType = 1; // 默认type=1(学生) // 重置分页参数 self.detailPages.pageNo = 1; self.detailPages.pageSize = 10; // 调用详情接口获取学生数据 self.loadDetailData(); self.detailDialogVisible = true; }, // 详情弹窗内部标签切换 changeDetailTab: function(tab) { if (tab.name === 'student') { this.detailType = 1; } else if (tab.name === 'teacher') { this.detailType = 2; } // 重置分页参数 this.detailPages.pageNo = 1; this.detailPages.pageSize = 10; this.loadDetailData(); }, // 加载详情数据 loadDetailData: function() { var self = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; $.get("/www/public/shangbao/findssfa", { xxid: self.currentRow.id, type: self.detailType, pageNo: self.detailPages.pageNo, pageSize: self.detailPages.pageSize }, function(res) { if (res.success == 1) { self.detailData = res.data || []; self.detailTotal = res.total || 0; } else { self.$message.error(res.message || '获取详情失败'); } }, "json").fail(function(xhr) { self.$message.error('请求失败:' + (xhr.responseJSON?.message || xhr.statusText)); }); }, // 关闭详情弹框 closeDetailDialog: function() { this.detailData = []; this.detailPages.pageNo = 1; this.detailPages.pageSize = 10; this.detailTotal = 0; }, // 标签切换 changeTab: function(tab, event) { this.activeName = tab.name; if (tab.name === 'first') { this.type = 'jijiao'; // 基教 } else if (tab.name === 'second') { this.type = 'gaojiao'; // 高教 } this.detailPages.pageNo = 1; this.getDetail(); }, // 获取列表数据 getDetail: function() { var self = this; var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{}; self.loading = true; // 调用列表接口 $.get('/www/public/sdy/ssfaListBySdy', { }, function(res) { self.loading = false; if (res.error == 0) { // 根据type过滤数据 var allData = res.data || []; if (self.type === 'jijiao') { // 基教数据 (学段1-4: 小学、初中、高中、中职) self.XStableData = allData.filter(function(item) { return item.xd == '1' || item.xd == '2' || item.xd == '3' || item.xd == '4'; }); } else if (self.type === 'gaojiao') { // 高教数据 (学段5-6: 高职、高校) self.XStableData = allData.filter(function(item) { return item.xd == '5' || item.xd == '6'; }); } else { self.XStableData = allData; } self.detailTotal = self.XStableData.length; } else { self.$message.error(res.message || '获取数据失败'); } }).fail(function() { self.loading = false; self.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleDetailSizeChange: function(val) { this.detailPages.pageSize = val; this.detailPages.pageNo = 1; this.loadDetailData(); }, // 改变当前页 handleDetailCurrentChange: function(val) { this.detailPages.pageNo = val; this.loadDetailData(); } }, created: function() { this.getDetail(); } }); }); })(template, resolve, reject); }); RegVueCom("xljk-apsdy-view", function(resolve, reject){ var template = "
\n \n
\n \n \n \n
\n \n \n \n 新增视导员信息\n 批量导入视导员信息\n 查看视导员列表\n 安排视导员\n 导出视导员账号\n
\n \n \n \n \n \n \n \n \n \n\n \n \n \n\n\n \n\n \n
\n \n \n
\n
\n \n \n
\n \n \n \n 新增视导员信息\n \n 查看视导员列表\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n
\n \n \n
\n
\n
\n
\n
\n \n \n \n
\n
\n

第一步:下载导入模板

\n
\n \n
\n

第二步:上传填写完成的视导员信息表

\n \n \n
将文件拖到此处,或点击上传
\n \n
\n
\n \n
\n 取消\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n 取消\n 确定\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n 取消\n 确定\n
\n
\n \n \n \n
\n
\n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n 关闭\n
\n
\n \n \n \n
\n

已选择 {{ selectedSchools.length }} 所学校

\n \n \n \n \n \n \n \n \n
\n \n
\n 取消\n 确定\n
\n
\n
"; return (function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { activeName: '1', events: [], // 视导员数据 currentPage: 1, // 当前页码 pageSize: 10, // 每页条数 total: 0, // 总条数 loading: false, // 批量导入相关 importDialogVisible: false, uploadLoading: false, // 新增/编辑相关 addDialogVisible: false, editMode: false, currentEditId: '', formData: { xm: '', lxfs: '', xxList: [] }, schoolOptions: [], // 安排视导员相关 assignDialogVisible: false, selectedSchools: [], instructorOptions: [], selectedInstructorId: '', assignLoading: false, // 查看视导员列表相关 viewInstructorDialogVisible: false, allInstructorList: [], instructorSearchName: '', viewPages: { pageNo: 1, pageSize: 10 }, viewTotal: 0, // 主页面搜索 searchName: '', addJYJDialogVisible: false, jyjloading: false, regionList: [], formJYJData: { xm: '', lxfs: '', qybmlist: [] }, jyjevents: [], }; }, computed: { }, methods: { handleTabChange(tab) { this.pageSize = 10; this.pageNo = 1; if (tab == 1) { this.fetchEvents(); } else { this.fetchJYJEvents(); } }, exportSdyZh(){ var that = this; axios({ method: 'get', url: '/www/public/sdy/exportSdyZh', responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '视导员账号.xls'); // 设置下载的文件名 document.body.appendChild(aLink); aLink.click(); document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }).catch(err=>{ this.$message.error('下载失败') }) }, fetchEvents() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; let params = { pageNo: this.currentPage, pageSize: this.pageSize }; // 添加姓名搜索参数 if (this.searchName) { params.xm = this.searchName; } // 调用查询接口 $.get("/www/public/sdy/sdylist",params , function(res) { if (res.error == 0) { that.events = res.data; that.total = res.total; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleSizeChange(size) { this.pageSize = size; this.currentPage = 1; this.fetchEvents(); }, // 改变当前页 handleCurrentChange(page) { this.currentPage = page; this.fetchEvents(); }, // 显示批量导入弹框 showImportDialog() { this.importDialogVisible = true; }, // 模板下载 downloadTemplate() { var that = this; axios({ method: 'get', url: '/www/public/sdy/sdyTempDownload', responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '视导员模板.xls'); // 设置下载的文件名 document.body.appendChild(aLink); aLink.click(); document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }).catch(err=>{ this.$message.error('下载失败') }) }, // 自定义上传 customUpload(file) { var that = this; that.uploadLoading = true; const formData = new FormData(); formData.append('file', file.file); var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; formData.append('userid', user.ID); axios({ method: 'post', url: '/www/public/sdy/sdyimport2', data: formData, headers: { 'Content-Type': 'multipart/form-data' } }).then(res => { that.uploadLoading = false; if (res.data.error == 0) { that.$message.success('导入成功'); that.importDialogVisible = false; that.fetchEvents(); // 刷新列表 } else { that.$message.error(res.data.message || '导入失败'); } }).catch(err => { that.uploadLoading = false; that.$message.error('导入失败'); }); }, // 上传错误处理 onError(err) { this.uploadLoading = false; this.$message.error('上传失败'); }, // 显示新增弹框 showAddDialog() { this.editMode = false; this.currentEditId = ''; this.formData = { xm: '', lxfs: '', xxList: [] }; this.loadSchoolOptions(); this.addDialogVisible = true; }, // 显示新增弹框 showAddJYJDialog() { this.editMode = false; this.currentEditId = ''; this.formJYJData = { xm: '', lxfs: '', qybmlist: [] }; this.getRegionList(); this.addJYJDialogVisible = true; }, // 教育局端-当前省份下拉选择框-市级 getRegionList() { const that = this; // 调用查询接口 $.get("/www/public/sdy/jyjddqsfxlxzksj", {} , function(res) { if (res.error == 0) { that.regionList = res.data; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 编辑行 editRow(row) { this.editMode = true; this.currentEditId = row.id; this.formData = { xm: row.xm, lxfs: row.lxfs, xxList: [] }; this.loadSchoolOptions(); this.addDialogVisible = true; }, // 删除行 deleteRow(row) { this.$confirm('确定要删除该视导员吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; $.post('/www/public/sdy/sdyDelete', { userid: user.ID, id: row.id }, (res) => { if (res.error == 0) { this.$message.success('删除成功'); this.fetchEvents(); } else { this.$message.error(res.msg || '删除失败'); } }, 'json').fail(() => { this.$message.error('删除失败'); }); }).catch(() => { this.$message.info('已取消删除'); }); }, // 修改密码 resetPassword(row) { this.$confirm('是否初始化密码?', '提示', { confirmButtonText: '是', cancelButtonText: '否', type: 'warning' }).then(() => { $.post('/www/public/sdy/sdypasswordReset', { id: row.id }, (res) => { if (res.error == 0) { this.$message.success('密码初始化成功'); } else { this.$message.error(res.msg || '密码初始化失败'); } }, 'json').fail(() => { this.$message.error('密码初始化失败'); }); }).catch(() => { this.$message.info('已取消操作'); }); }, // 下载待分配样本校名单 downloadSampleList() { var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; const type = this.activeName === 'first' ? '1' : '2'; let params = { }; /*const params = { //zgdwbm:user.ID, shzt:that.activeName=='first'?'0':this.activeName=='second'?'1':'-1', type, username:user.Username }*/ axios({ method: 'get', url:'/www/public/sdy/xxmdExport', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download','待分配样本校名单.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, // 获取学校选项列表 loadSchoolOptions() { var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; if (this.editMode) { // 编辑模式:获取该视导员可选择的学校 $.get('/www/public/sdy/sdyxxEditListzj', { userid: user.ID, id: this.currentEditId }, (res) => { if (res.error == 0) { this.schoolOptions = res.data || []; // 获取视导员详细信息,包含当前绑定的学校 this.loadInstructorDetail(); } else { this.$message.error('获取学校列表失败'); } }, 'json').fail(() => { this.$message.error('获取学校列表失败'); }); } else { // 新增模式:获取所有可分配的学校 $.get('/www/public/sdy/sdyxxEditList', { userid: user.ID }, (res) => { if (res.error == 0) { this.schoolOptions = res.data || []; // if (this.schoolOptions.length === 0) { // this.$message.warning('所有学校已派遣视导员,无法新增'); // this.addDialogVisible = false; // } } else { this.$message.error('获取学校列表失败'); } }, 'json').fail(() => { this.$message.error('获取学校列表失败'); }); } }, // 获取视导员详细信息 loadInstructorDetail() { $.get('/www/public/sdy/sdylistDetail', { id: this.currentEditId }, (res) => { if (res.error == 0 && res.data) { // 设置当前绑定的学校为已选中状态 this.formData.xxList = res.data.map(school => school.id); } else { this.$message.error('获取视导员详细信息失败'); } }, 'json').fail(() => { this.$message.error('获取视导员详细信息失败'); }); }, // 保存视导员 saveInstructor() { if (!this.formData.xm) { this.$message.error('请输入姓名'); return; } if (!this.formData.lxfs) { this.$message.error('请输入手机号'); return; } // 手机号格式验证 const phoneRegex = /^1[3-9]\d{9}$/; if (!phoneRegex.test(this.formData.lxfs)) { this.$message.error('请输入正确的手机号格式'); return; } this.loading = true; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; // 处理学校列表 let xxListArray = Array.isArray(this.formData.xxList) ? this.formData.xxList : []; const postData = { id: this.editMode ? this.currentEditId : '', xm: this.formData.xm, lxfs: this.formData.lxfs, ssjg: user.ID, // 当前教育局id xxList: JSON.stringify(xxListArray) }; $.post('/www/public/sdy/sdyadd', postData, (res) => { this.loading = false; if (res.error == 0) { this.$message.success(res.message); this.addDialogVisible = false; this.fetchEvents(); } else { this.$message.error(res.message); } }, 'json').fail(() => { this.loading = false; this.$message.error(this.editMode ? '编辑失败' : '新增失败'); }); }, // 保存视导员 saveJYJInstructor() { if (!this.formJYJData.xm) { this.$message.error('请输入姓名'); return; } if (!this.formJYJData.lxfs) { this.$message.error('请输入手机号'); return; } // 手机号格式验证 const phoneRegex = /^1[3-9]\d{9}$/; if (!phoneRegex.test(this.formJYJData.lxfs)) { this.$message.error('请输入正确的手机号格式'); return; } this.jyjloading = true; // 处理区域列表 let xxListArray = Array.isArray(this.formJYJData.qybmlist) ? this.formJYJData.qybmlist : []; const postData = { id: this.editMode ? this.currentEditId : '', xm: this.formJYJData.xm, lxfs: this.formJYJData.lxfs, qybmlist: JSON.stringify(xxListArray) }; $.post('/www/public/sdy/xzsjsdy', postData, (res) => { this.jyjloading = false; if (res.error == 0) { this.$message.success(res.message); this.addJYJDialogVisible = false; this.fetchJYJEvents(); } else { this.$message.error(res.message); } }, 'json').fail(() => { this.jyjloading = false; this.$message.error(this.editMode ? '编辑失败' : '新增失败'); }); }, fetchJYJEvents() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; let params = { pageNo: this.currentPage, pageSize: this.pageSize }; // 添加姓名搜索参数 if (this.searchName) { params.xm = this.searchName; } // 调用查询接口 $.get("/www/public/sdy/jyjdsjsdylb",params , function(res) { if (res.error == 0) { that.jyjevents = res.data; that.total = res.total; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleJYJSizeChange(size) { this.pageSize = size; this.currentPage = 1; this.fetchJYJEvents(); }, // 改变当前页 handleJYJCurrentChange(page) { this.currentPage = page; this.fetcfetchJYJEventshEvents(); }, // 编辑行 editJYJRow(row) { this.editMode = true; this.currentEditId = row.id; this.formJYJData = { xm: row.xm, lxfs: row.lxfs, qybmlist: row.qybmlist?.split(',') }; this.getRegionList(); this.addJYJDialogVisible = true; }, // 删除行 deleteJYJRow(row) { this.$confirm('确定要删除该视导员吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; $.post('/www/public/sdy/jyjdscsjsdy', { userid: user.ID, id: row.id }, (res) => { if (res.error == 0) { this.$message.success('删除成功'); this.fetchJYJEvents(); } else { this.$message.error(res.msg || '删除失败'); } }, 'json').fail(() => { this.$message.error('删除失败'); }); }).catch(() => { this.$message.info('已取消删除'); }); }, // 处理表格多选 handleSelectionChange(selection) { this.selectedSchools = selection; }, // 显示安排视导员弹框 showAssignDialog() { if (this.selectedSchools.length === 0) { this.$message.warning('请先选择要安排视导员的学校'); return; } this.selectedInstructorId = ''; this.loadInstructorOptions(); this.assignDialogVisible = true; }, // 获取视导员选项列表 loadInstructorOptions() { var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; $.get('/www/public/sdy/sdyxlxz', { }, (res) => { if (res.error == 0) { this.instructorOptions = res.data || []; } else { this.$message.error('获取视导员列表失败'); } }, 'json').fail(() => { this.$message.error('获取视导员列表失败'); }); }, // 视导员选择变化 onInstructorChange(value) { this.selectedInstructorId = value; }, // 确认安排视导员 confirmAssign() { if (!this.selectedInstructorId) { this.$message.warning('请选择视导员'); return; } if (this.selectedSchools.length === 0) { this.$message.warning('请选择学校'); return; } this.assignLoading = true; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; // 构建学校ID数组 const xxids = this.selectedSchools.map(school => school.id); const postData = { xxids: JSON.stringify(xxids), sdyid: this.selectedInstructorId }; $.post('/www/public/sdy/xxbdsdy', postData, (res) => { this.assignLoading = false; if (res.error == 0) { this.$message.success('安排视导员成功'); this.assignDialogVisible = false; this.selectedSchools = []; this.fetchEvents(); // 刷新列表 } else { this.$message.error(res.message || '安排视导员失败'); } }, 'json').fail(() => { this.assignLoading = false; this.$message.error('安排视导员失败'); }); }, // 显示查看视导员列表弹框 showViewInstructorDialog() { this.viewInstructorDialogVisible = true; this.instructorSearchName = ''; this.viewPages.pageNo = 1; this.loadAllInstructors(); }, // 显示查看视导员列表弹框 showViewJYJInstructorDialog() { this.viewInstructorDialogVisible = true; this.instructorSearchName = ''; this.viewPages.pageNo = 1; this.loadAllJYJInstructors(); }, // 加载所有视导员列表 loadAllInstructors() { var that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; const params = { userid: user.ID, pageNo: this.viewPages.pageNo, pageSize: this.viewPages.pageSize }; if(this.instructorSearchName) { params.xm = this.instructorSearchName; } $.get("/www/public/sdy/qbsdylist", params, function(res){ if(res.success == 1 || res.error == 0){ that.allInstructorList = res.data || []; that.viewTotal = res.total || 0; } else { that.$message.error(res.message || '获取视导员列表失败'); } }).fail((xhr,status,error)=>{ that.$message.error('请求失败'); }); }, // 加载所有视导员列表 loadAllJYJInstructors() { var that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; const params = { userid: user.ID, pageNo: this.viewPages.pageNo, pageSize: this.viewPages.pageSize }; if(this.instructorSearchName) { params.xm = this.instructorSearchName; } $.get("/www/public/sdy/jyjdsjcksdylb", params, function(res){ if(res.success == 1 || res.error == 0){ that.allInstructorList = res.data || []; that.viewTotal = res.total || 0; } else { that.$message.error(res.message || '获取视导员列表失败'); } }).fail((xhr,status,error)=>{ that.$message.error('请求失败'); }); }, // 查看视导员列表搜索 handleInstructorSearch() { this.viewPages.pageNo = 1; if (this.activeName === '1') { this.loadAllInstructors(); } else { this.loadAllJYJInstructors(); } }, // 查看视导员列表分页相关方法 handleViewSizeChange(val) { this.viewPages.pageSize = val; this.viewPages.pageNo = 1; this.loadAllInstructors(); }, handleViewCurrentChange(val) { this.viewPages.pageNo = val; this.loadAllInstructors(); }, // 主页面搜索 handleSearch() { this.currentPage = 1; if (this.activeName === '1') { this.fetchEvents(); } else { this.fetchJYJEvents(); } } }, created: function() { if (this.activeName === '1') { this.fetchEvents(); } else { this.fetchJYJEvents(); } } }); }); })(template, resolve, reject); }); RegVueCom("xljk-txhcqkjwtjl-view", function(resolve, reject){ var template = "
\n \n \n
\n
\n \n \n \n \n 新增\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n
\n \n \n
\n \n \n
\n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
测前准备学校工作组组长或副组长,施测现场工作人员已全部到岗,有序组织施测工作。
计算机运行良好、网络连接正常、问卷测试系统可以正常登录。
文本材料准备齐全:现场操作手册、本场学生登录账号、测试过程记录表、本场参测学生名单(用于检录)。
检录情况学生按照参测名单进入机房、按机位落座、发放账号有序开展。
主监测员已宣读填答注意事项,提醒学生如实作答。
学生登录账号顺利。
主监测员已提醒学生阅读\"指导语\",作答时间到再开始作答。
测试过程主监测员在《测试过程记录表》中,如实记录学生出勤情况(包括且不限于应测、实测、缺席、迟到和休学等)。
监测员有效维持现场纪律。针对学生是否有交头接耳、读题出声等扰乱他人作答等情况,及时提醒和制止。
学生作答时,无学生表示难以理解、需要解释、无法填答、感觉有歧义的题目。如有,主监测员已填写在《测试过程记录表》。
现场人员(工作人员或学生)没有用手机拍摄或保存题目的情况;如有,务必及时制止。
测试现场如有网络故障、系统问题或其他应急事件,已得到及时解决,主监测员已填写在《测试过程记录表》。
测试结束确认已提醒完成作答的学生成功提交。40分钟作答时间到,安排提交成功的学生统一离场。
现场发现的其他问题及意见建议
学校反映的问题
总体印象\n \n \n 非常好\n 比较好\n 一般\n 较差\n \n \n
视导时间年月日
视导图片\n
\n \n
\n
\n \n \n
\n 删除\n
\n
\n
\n \n \n
\n 删除\n
\n
\n
\n \n \n
\n 删除\n
\n
\n
\n \n \n
\n handlePhoto1UploadSuccess(res, file)\"\n :before-upload=\"beforeUpload\"\n accept=\".jpg,.jpeg,.png\">\n 上传图片1\n \n \n handlePhoto2UploadSuccess(res, file)\"\n :before-upload=\"beforeUpload\"\n accept=\".jpg,.jpeg,.png\">\n 上传图片2\n \n \n handlePhoto3UploadSuccess(res, file)\"\n :before-upload=\"beforeUpload\"\n accept=\".jpg,.jpeg,.png\">\n 上传图片3\n \n
\n \n
支持JPG、JPEG、PNG格式,单张图片不超过5MB,最多可上传3张图片
\n
\n
\n
\n\n
\n 确 定\n
\n
\n\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
集中测试测前准备学校工作组组长或副组长,施测现场工作人员已全部到岗,有序组织施测工作。
网络连接正常、问卷测试系统可以正常登录。
文本材料准备齐全:现场操作手册、本场学生登录账号、测试过程记录表、本场参测学生名单(用于检录)。
集中测试检录情况学生按照参测名单进入教室、按编号落座、发放账号有序开展。
主监测员已宣读填答注意事项,提醒学生如实作答。
学生登录账号顺利。
主监测员已提醒学生阅读\"指导语\",作答时间到再开始作答。
集中测试测试过程主监测员在《测试过程记录表》中,如实记录学生出勤情况(包括且不限于应测、实测、缺席、迟到和休学等)。
监测员有效维持现场纪律。针对学生是否有交头接耳、读题出声扰乱他人作答等情况,及时提醒和制止。
学生作答时,无学生提问表示难以理解、需要解释、无法填答、感觉有歧义的题目。如有,主监测员已填写在《测试过程记录表》。
现场人员(工作人员或学生)没有用手机拍摄、截屏或保存题目的情况;如有,务必及时制止。
测试现场如有网络故障、系统问题或其他应急事件,已得到及时解决,主监测员已填写在《测试过程记录表》。
集中测试测试结束确认已提醒完成作答的学生成功提交。
信息员已检查本场问卷提交情况,点击\"全部完成测试\"。
其他\"非集中测试\"学生的班主任或辅导员已及时督促学生作答。
现场发现的其他问题及意见建议
学校反映的问题
总体印象\n \n \n 非常好\n 比较好\n 一般\n 较差\n \n \n
视导时间年月日
视导图片\n
\n \n
\n
\n \n \n
\n 删除\n
\n
\n
\n \n \n
\n 删除\n
\n
\n
\n \n \n
\n 删除\n
\n
\n
\n \n \n
\n handlePhoto1UploadSuccess(res, file)\"\n :before-upload=\"beforeUpload\"\n accept=\".jpg,.jpeg,.png\">\n 上传图片1\n \n \n handlePhoto2UploadSuccess(res, file)\"\n :before-upload=\"beforeUpload\"\n accept=\".jpg,.jpeg,.png\">\n 上传图片2\n \n \n handlePhoto3UploadSuccess(res, file)\"\n :before-upload=\"beforeUpload\"\n accept=\".jpg,.jpeg,.png\">\n 上传图片3\n \n
\n \n
支持JPG、JPEG、PNG格式,单张图片不超过5MB,最多可上传3张图片
\n
\n
\n
\n\n
\n 确 定\n
\n
\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
主监测员(学校校长或其他中层领导干部)已到岗,组织教师测试。
教师进场后完成签到,领取登录账号。主监测员在《测试过程记录表》中,如实记录教师出勤情况。
教师登录账号顺利。
开始作答前,主监测员已宣读教师问卷填答注意事项,强调监测工具和数据保密性,要求教师如实填答。
测试现场不存在网络故障、系统问题或其他应急事件。如存在,已得到及时解决,主监测员已填写在《测试过程记录表》。
测试现场纪律良好,无作答受影响情况。
其他问题记录和情况反馈:
视导时间年月日
\n
\n\n
\n 确 定\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n
\n 取 消\n 确 定\n
\n
\n
"; return (function(template, resolve, reject) { seajs.use([], function() { resolve({ template: template, data: function() { return { currentView: 'list', activeName: 'first', currentMode: 'student', // 当前模式:student学生, teacher教师 isEditing: false, isViewing: false, currentEditRow: null, tableData: [], schoolList: [], schoolLoading: false, showSchoolDialog: false, // 学校选择弹框 selectedSchool: null, // 选中的学校 Detailpages: { pageNo: 1, pageSize: 10 }, DetailTotal: 0, jijiaoForm: { xxid: '', cqzb1: '', cqzb2: '', cqzb3: '', jlqk1: '', jlqk2: '', jlqk3: '', jlqk4: '', csgc1: '', csgc2: '', csgc3: '', csgc4: '', csgc5: '', csjs1: '', qt: '', wt: '', ztyx: '', sdsj: '' }, gaojiaoForm: { xxid: '', cqzb1: '', cqzb2: '', cqzb3: '', jlqk1: '', jlqk2: '', jlqk3: '', jlqk4: '', csgc1: '', csgc2: '', csgc3: '', csgc4: '', csgc5: '', csjs1: '', csjs2: '', qt: '', jy: '', wt: '', ztyx: '', sdsj: '' }, teacherForm: { xxid: '', jcydgqk: '', // 主监测员到岗情况 cqqk: '', // 教师签到情况 dlqk: '', // 登录情况 zysx: '', // 注意事项宣读 yjsj: '', // 应急事件处理 jlqk: '', // 纪律情况 qtwt: '', // 其他问题记录和情况反馈 sdsj: '' // 视导时间 }, jijiaoRules: { xxid: [{ required: true, message: '请选择学校', trigger: 'change' }], cqzb1: [{ required: true, message: '请选择', trigger: 'change' }], cqzb2: [{ required: true, message: '请选择', trigger: 'change' }], cqzb3: [{ required: true, message: '请选择', trigger: 'change' }], jlqk1: [{ required: true, message: '请选择', trigger: 'change' }], jlqk2: [{ required: true, message: '请选择', trigger: 'change' }], jlqk3: [{ required: true, message: '请选择', trigger: 'change' }], jlqk4: [{ required: true, message: '请选择', trigger: 'change' }], csgc1: [{ required: true, message: '请选择', trigger: 'change' }], csgc2: [{ required: true, message: '请选择', trigger: 'change' }], csgc3: [{ required: true, message: '请选择', trigger: 'change' }], csgc4: [{ required: true, message: '请选择', trigger: 'change' }], csgc5: [{ required: true, message: '请选择', trigger: 'change' }], csjs1: [{ required: true, message: '请选择', trigger: 'change' }], ztyx: [{ required: true, message: '请选择总体印象', trigger: 'change' }], sdsj: [{ required: true, message: '请选择视导时间', trigger: 'change' }] }, gaojiaoRules: { xxid: [{ required: true, message: '请选择学校', trigger: 'change' }], cqzb1: [{ required: true, message: '请选择', trigger: 'change' }], cqzb2: [{ required: true, message: '请选择', trigger: 'change' }], cqzb3: [{ required: true, message: '请选择', trigger: 'change' }], jlqk1: [{ required: true, message: '请选择', trigger: 'change' }], jlqk2: [{ required: true, message: '请选择', trigger: 'change' }], jlqk3: [{ required: true, message: '请选择', trigger: 'change' }], jlqk4: [{ required: true, message: '请选择', trigger: 'change' }], csgc1: [{ required: true, message: '请选择', trigger: 'change' }], csgc2: [{ required: true, message: '请选择', trigger: 'change' }], csgc3: [{ required: true, message: '请选择', trigger: 'change' }], csgc4: [{ required: true, message: '请选择', trigger: 'change' }], csgc5: [{ required: true, message: '请选择', trigger: 'change' }], csjs1: [{ required: true, message: '请选择', trigger: 'change' }], csjs2: [{ required: true, message: '请选择', trigger: 'change' }], qt: [{ required: true, message: '请选择', trigger: 'change' }], ztyx: [{ required: true, message: '请选择总体印象', trigger: 'change' }], sdsj: [{ required: true, message: '请选择视导时间', trigger: 'change' }] }, teacherRules: { jcydgqk: [{ required: true, message: '请选择', trigger: 'change' }], cqqk: [{ required: true, message: '请选择', trigger: 'change' }], dlqk: [{ required: true, message: '请选择', trigger: 'change' }], zysx: [{ required: true, message: '请选择', trigger: 'change' }], yjsj: [{ required: true, message: '请选择', trigger: 'change' }], jlqk: [{ required: true, message: '请选择', trigger: 'change' }], sdsj: [{ required: true, message: '请选择视导时间', trigger: 'change' }] }, // 图片上传相关 photo1File: null, photo2File: null, photo3File: null, imgid: '' }; }, computed: { formTitle: function() { var schoolName = this.selectedSchool ? this.selectedSchool.xxmc : ''; var suffix = '现场核查表'; if (this.isViewing) { return schoolName ? schoolName + suffix : '现场核查表'; } else if (this.isEditing) { return schoolName ? schoolName + suffix : '现场核查表'; } else { return schoolName ? schoolName + suffix :'现场核查表'; } } }, created: function() { this.getList(); // this.getSchoolList(); }, methods: { getList: function() { const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var params = { ...this.Detailpages }; var that = this; // 根据当前模式选择不同的接口 var apiUrl = this.currentMode === 'teacher' ? '/www/public/sdy/sdysdyjshcList' : '/www/public/sdy/sdysdyxchcList'; $.get(apiUrl, params, function(res) { if (res.error == 0) { // 根据xd字段过滤数据:1-4为基教,其他为高教 /** var allData = res.data || []; var filteredData = []; if (that.activeName === 'first') { // 基教:xd为1,2,3,4 filteredData = allData.filter(function(item) { return item.xd && ['1', '2', '3', '4'].includes(item.xd.toString()); }); } else { // 高教:xd不为1,2,3,4 filteredData = allData.filter(function(item) { return item.xd && !['1', '2', '3', '4'].includes(item.xd.toString()); }); } */ that.tableData = res.data || []; // filteredData; that.DetailTotal = res.total || 0; // filteredData.length; } else { that.$message.error(res.message); } }); }, getSchoolList: function() { var that = this; that.schoolLoading = true; var type = this.activeName === 'first' ? '1' : '2'; $.get('/www/public/sdy/xxListBysdy', { type: type }, function(res) { that.schoolLoading = false; if (res.error == 0) { that.schoolList = res.data; } else { that.$message.error(res.message); } }); }, handleDetailSizeChange: function(val) { this.Detailpages.pageSize = val; this.Detailpages.pageNo = 1; this.getList(); }, handleDetailCurrentChange: function(val) { this.Detailpages.pageNo = val; this.getList(); }, backToList: function() { this.currentView = 'list'; this.isEditing = false; this.isViewing = false; this.currentEditRow = null; }, changeTab: function() { this.Detailpages.pageNo = 1; this.getList(); // this.getSchoolList(); }, changeModeTab: function() { // 切换模式时重置页面状态 this.Detailpages.pageNo = 1; this.activeName = 'first'; // 教师模式只有基教 this.getList(); // this.getSchoolList(); }, openAddDialog: function() { this.isEditing = false; this.isViewing = false; this.currentEditRow = null; this.selectedSchool = null; this.showSchoolDialog = true; }, editItem: function(row) { this.isEditing = true; this.isViewing = false; this.currentEditRow = row; // 判断是否可以选择学校(如果sfddtj不等于'0',则可以选择学校) var canSelectSchool = row.sfddtj != '0'; if (canSelectSchool) { // 可以选择学校,显示弹框并回显当前学校 this.selectedSchool = { xxmc: row.xxmc, id: row.xxid }; this.showSchoolDialog = true; } else { // 不能选择学校,直接进入表单 this.selectedSchool = { xxmc: row.xxmc, id: row.xxid }; this.currentView = 'form'; // 先加载数据,再设置学校ID this.loadFormData(row.id); } }, viewItem: function(row) { this.isEditing = false; this.isViewing = true; this.selectedSchool = { xxmc: row.xxmc, id: row.xxid }; this.currentView = 'form'; // 先加载数据,再设置学校ID this.loadFormData(row.id); }, enterForm: function() { this.currentView = 'form'; if (this.currentMode === 'teacher') { this.resetTeacherForm(); this.activeName = 'first'; // 教师模式只有基教 if (this.selectedSchool) { this.teacherForm.xxid = this.selectedSchool.id; } } else if (this.activeName === 'first') { this.resetJijiaoForm(); if (this.selectedSchool) { this.jijiaoForm.xxid = this.selectedSchool.id; } } else { this.resetGaojiaoForm(); if (this.selectedSchool) { this.gaojiaoForm.xxid = this.selectedSchool.id; } } // 重置图片 this.photo1File = null; this.photo2File = null; this.photo3File = null; this.imgid = ''; // 加载图片列表 this.getImgList(); }, confirmSchoolSelection: function() { if (!this.selectedSchool) { this.$message.warning('请选择学校'); return; } this.showSchoolDialog = false; if (this.isEditing && this.currentEditRow) { // 编辑模式下,直接进入表单并加载数据 this.currentView = 'form'; this.loadFormData(this.currentEditRow.id); } else { // 新增模式下,重置表单 this.enterForm(); } }, cancelSchoolSelection: function() { this.showSchoolDialog = false; this.selectedSchool = null; }, getSchoolList: function() { var that = this; that.schoolLoading = true; // 根据当前激活的标签页确定type参数:基教为1,高教为2 var type = that.activeName === 'first' ? '1' : '2'; $.get('/www/public/sdy/xxListBysdy', { type: type }, function(res) { that.schoolLoading = false; if (res.error == 0) { that.schoolList = res.data || []; } else { that.$message.error(res.msg || '获取学校列表失败'); } }).fail(function() { that.schoolLoading = false; that.$message.error('获取学校列表失败'); }); }, loadFormData: function(id) { var that = this; // 根据当前模式选择不同的接口 var apiUrl = this.currentMode === 'teacher' ? '/www/public/sdy/sdysdyjshcfindByid' : '/www/public/sdy/sdysdyxchcfindByid'; $.get(apiUrl, { id: id }, function(res) { if (res.error == 0) { if (that.currentMode === 'teacher') { that.teacherForm = Object.assign({}, that.teacherForm, res.data); // 确保学校ID正确设置 if (that.selectedSchool) { that.teacherForm.xxid = that.selectedSchool.id; } } else if (that.activeName === 'first') { that.jijiaoForm = Object.assign({}, that.jijiaoForm, res.data); // 确保学校ID正确设置 if (that.selectedSchool) { that.jijiaoForm.xxid = that.selectedSchool.id; } } else { that.gaojiaoForm = Object.assign({}, that.gaojiaoForm, res.data); // 确保学校ID正确设置 if (that.selectedSchool) { that.gaojiaoForm.xxid = that.selectedSchool.id; } } // 加载图片列表 that.getImgList(); } else { that.$message.error(res.message); } }); }, deleteItem: function(row) { var that = this; this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(function() { const deleteUrl = that.currentMode === 'teacher' ? '/www/public/sdy/sdysdyjshcDelete' : '/www/public/sdy/sdysdyxchcDelete'; $.post(deleteUrl, { id: row.id }, function(res) { if (res.error == 0) { that.$message.success('删除成功'); that.getList(); } else { that.$message.error(res.message || '删除失败'); } }).fail(function() { that.$message.error('删除失败'); }); }).catch(function() {}); }, saveJijiao: function() { var that = this; this.$refs.jijiaoForm.validate(function(valid) { if (valid) { const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var params = { ...that.jijiaoForm, userid: that.jijiaoForm.xxid, sdyid: user.ID, type: '1' }; delete params.xxid; if (!that.isEditing) { params.sfddtj = '1'; } $.post('/www/public/sdy/sdysdyxchcAdd', params, function(res) { if (res.error == 0) { that.$message.success('保存成功'); that.backToList(); that.getList(); } else { that.$message.error(res.message || '保存失败'); } }, "json").fail(function(xhr) { that.$message.error('请求失败:' + (xhr.responseJSON?.message || xhr.statusText)); }); } }); }, saveGaojiao: function() { var that = this; this.$refs.gaojiaoForm.validate(function(valid) { if (valid) { const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var params = { ...that.gaojiaoForm, userid: that.gaojiaoForm.xxid, sdyid: user.ID, type: '2' }; delete params.xxid; if (!that.isEditing) { params.sfddtj = '1'; } $.post('/www/public/sdy/sdysdyxchcAdd', params, function(res) { if (res.error == 0) { that.$message.success('保存成功'); that.backToList(); that.getList(); } else { that.$message.error(res.message || '保存失败'); } }, "json").fail(function(xhr) { that.$message.error('请求失败:' + (xhr.responseJSON?.message || xhr.statusText)); }); } }); }, resetJijiaoForm: function() { this.jijiaoForm = { xxid: '', cqzb1: '', cqzb2: '', cqzb3: '', jlqk1: '', jlqk2: '', jlqk3: '', jlqk4: '', csgc1: '', csgc2: '', csgc3: '', csgc4: '', csgc5: '', csjs1: '', qt: '', wt: '', ztyx: '', sdsj: '' }; }, resetGaojiaoForm: function() { this.gaojiaoForm = { xxid: '', cqzb1: '', cqzb2: '', cqzb3: '', jlqk1: '', jlqk2: '', jlqk3: '', jlqk4: '', csgc1: '', csgc2: '', csgc3: '', csgc4: '', csgc5: '', csjs1: '', csjs2: '', qt: '', jy: '', wt: '', ztyx: '', sdsj: '' }; }, saveTeacher: function() { var that = this; this.$refs.teacherForm.validate(function(valid) { if (valid) { const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var params = { ...that.teacherForm, userid: that.teacherForm.xxid, sdyid: user.ID, type: '1' // 教师只有基教 }; delete params.xxid; if (!that.isEditing) { params.sfddtj = '1'; } $.post('/www/public/sdy/sdysdyjshcAdd', params, function(res) { if (res.error == 0) { that.$message.success('保存成功'); that.backToList(); that.getList(); } else { that.$message.error(res.message || '保存失败'); } }, "json").fail(function(xhr) { that.$message.error('请求失败:' + (xhr.responseJSON?.message || xhr.statusText)); }); } }); }, resetTeacherForm: function() { this.teacherForm = { xxid: '', jcydgqk: '', cqqk: '', dlqk: '', zysx: '', yjsj: '', jlqk: '', qtwt: '', sdsj: '' }; }, // 图片上传相关方法 getImgList: function() { var that = this; if (!this.selectedSchool || !this.selectedSchool.id) { return; } const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; $.get('/www/public/sdy/sdyimgfind2', { userid: user.ID, xxid: this.selectedSchool.id }, function(res) { // 先清空之前的图片数据 that.photo1File = null; that.photo2File = null; that.photo3File = null; that.imgid = ''; if (res.error == 0 && res.data && res.data.id) { that.imgid = res.data.id; // 添加随机参数避免缓存 const timestamp = new Date().getTime(); // 优先使用按imgid+type的回显接口,失败则回退到接口返回的相对路径 const photo1Url = '/www/public/sdy/sdyimghx?id=' + that.imgid + '&type=1&xxid=' + that.selectedSchool.id + '&t=' + timestamp; const photo2Url = '/www/public/sdy/sdyimghx?id=' + that.imgid + '&type=2&xxid=' + that.selectedSchool.id + '&t=' + timestamp; const photo3Url = '/www/public/sdy/sdyimghx?id=' + that.imgid + '&type=3&xxid=' + that.selectedSchool.id + '&t=' + timestamp; const checkImage = (url, callback) => { const img = new Image(); img.onload = () => callback(true); img.onerror = () => callback(false); img.src = url; }; // 回退路径构建 const buildDirectUrl = function(p){ return p ? ('/www/public/' + p + '?t=' + timestamp) : null; }; // 检查图片1(先imghx,失败则用img1相对路径) checkImage(photo1Url, (exists) => { if (exists) { that.photo1File = { url: photo1Url, name: '图片1', type: 'photo1' }; } else { var u1 = buildDirectUrl(res.data && res.data.img1); if (u1) { checkImage(u1, function(ok){ if (ok) { that.photo1File = { url: u1, name: '图片1', type: 'photo1' }; } }); } } }); // 检查图片2(先imghx,失败则用img2相对路径) checkImage(photo2Url, (exists) => { if (exists) { that.photo2File = { url: photo2Url, name: '图片2', type: 'photo2' }; } else { var u2 = buildDirectUrl(res.data && res.data.img2); if (u2) { checkImage(u2, function(ok){ if (ok) { that.photo2File = { url: u2, name: '图片2', type: 'photo2' }; } }); } } }); // 检查图片3(先imghx,失败则用img3相对路径) checkImage(photo3Url, (exists) => { if (exists) { that.photo3File = { url: photo3Url, name: '图片3', type: 'photo3' }; } else { var u3 = buildDirectUrl(res.data && res.data.img3); if (u3) { checkImage(u3, function(ok){ if (ok) { that.photo3File = { url: u3, name: '图片3', type: 'photo3' }; } }); } } }); } else { // 如果没有数据,确保imgid为空,这样上传时会创建新记录 that.imgid = ''; } }).fail(function() { // 请求失败时也要确保imgid为空 that.imgid = ''; }); }, handlePhoto1UploadSuccess: function(res, file) { if (res && res.success == 1) { // 添加时间戳防止缓存 const timestamp = new Date().getTime(); // 统一使用对象格式 this.photo1File = { url: res.data.url + '?t=' + timestamp, name: res.data.fileName || '图片1', rawFile: file, type: 'photo1' }; this.$message.success('图片1上传成功'); // 延迟刷新图片列表,确保服务器处理完成 setTimeout(() => { this.getImgList(); }, 500); } else { this.$message.error(res.message || '上传失败'); } }, handlePhoto2UploadSuccess: function(res, file) { if (res && res.success == 1) { // 添加时间戳防止缓存 const timestamp = new Date().getTime(); // 统一使用对象格式 this.photo2File = { url: res.data.url + '?t=' + timestamp, name: res.data.fileName || '图片2', rawFile: file, type: 'photo2' }; this.$message.success('图片2上传成功'); // 延迟刷新图片列表,确保服务器处理完成 setTimeout(() => { this.getImgList(); }, 500); } else { this.$message.error(res.message || '上传失败'); } }, handlePhoto3UploadSuccess: function(res, file) { if (res && res.success == 1) { // 添加时间戳防止缓存 const timestamp = new Date().getTime(); // 统一使用对象格式 this.photo3File = { url: res.data.url + '?t=' + timestamp, name: res.data.fileName || '图片3', rawFile: file, type: 'photo3' }; this.$message.success('图片3上传成功'); // 延迟刷新图片列表,确保服务器处理完成 setTimeout(() => { this.getImgList(); }, 500); } else { this.$message.error(res.message || '上传失败'); } }, beforeUpload: function(file) { const isJPG = file.type === 'image/jpeg' || file.type === 'image/jpg' || file.type === 'image/png'; const isLt5M = file.size / 1024 / 1024 < 5; if (!isJPG) { this.$message.error('上传图片只能是 JPG/JPEG/PNG 格式!'); } if (!isLt5M) { this.$message.error('上传图片大小不能超过 5MB!'); } return isJPG && isLt5M; }, handleRemoveFile: function(fileType) { var that = this; this.$confirm('确定要删除这张图片吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(function() { if (fileType === 'photo1File') { that.photo1File = null; } else if (fileType === 'photo2File') { that.photo2File = null; } else if (fileType === 'photo3File') { that.photo3File = null; } that.$message.success('删除成功'); }); } } }); }); })(template, resolve, reject); }); RegVueCom("xljk-editTrainingExamStep2", function(resolve, reject){ var template = "
\n
\n
\n \n
\n
\n \n
\n
\n
\n \n \n \n \n \n
\n
\t\n
\n
\n
\n
\n
\n 上一步\n 完成\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { form: { // 试卷数据 questionList: [ { tmId: Math.uuid(), tmlx: 1, // 题目类型:1-单选 2-多选 3-判断 tmnr: '', tmno: 1, tmsorce: '', tmcorrectanswer: '', tmxx: [ { optionName: '选项1', optionId: Math.uuid(), isCorrect: false }, { optionName: '选项2', optionId: Math.uuid(), isCorrect: false } ], }, { tmId: Math.uuid(), tmlx: 2, // 题目类型:1-单选 2-多选 3-判断 tmnr: '', tmno: 2, tmsorce: '', tmcorrectanswer: [], tmxx: [ { optionName: '选项1', optionId: Math.uuid(), isCorrect: false }, { optionName: '选项2', optionId: Math.uuid(), isCorrect: false } ], }, { tmId: Math.uuid(), tmlx: 3, // 题目类型:1-单选 2-多选 3-判断 tmnr: '', tmno: 3, tmsorce: '', tmcorrectanswer: '', tmxx: [ { optionName: '对', optionId: Math.uuid(), isCorrect: false }, { optionName: '错', optionId: Math.uuid(), isCorrect: false } ], }, ], } }; }, methods: { // 选择题目 handleSelectQuestion(type) { if (type === 1) { console.log('form', this.form.questionList) this.form.questionList.push({ tmId: Math.uuid(), tmlx: 1, // 题目类型:1-单选 2-多选 3-判断 tmnr: '', tmno: 1, tmsorce: '', tmcorrectanswer: '', tmxx: [ { optionName: '选项1', optionId: Math.uuid(), isCorrect: false }, { optionName: '选项2', optionId: Math.uuid(), isCorrect: false } ] }) } else if (type === 2) { this.form.questionList.push({ tmId: Math.uuid(), tmlx: 2, // 题目类型:1-单选 2-多选 3-判断 tmnr: '', tmno: 2, tmsorce: '', tmcorrectanswer: [], tmxx: [ { optionName: '选项1', optionId: Math.uuid(), isCorrect: false }, { optionName: '选项2', optionId: Math.uuid(), isCorrect: false } ], }) } else if (type === 3) { this.form.questionList.push({ tmId: Math.uuid(), tmlx: 3, // 题目类型:1-单选 2-多选 3-判断 tmnr: '', tmno: 3, tmsorce: '', tmcorrectanswer: '', tmxx: [ { optionName: '对', optionId: Math.uuid(), isCorrect: false }, { optionName: '错', optionId: Math.uuid(), isCorrect: false } ], }) } this.flushScrollTop(); }, // 刷新对话列表 flushScrollTop() { this.$nextTick(() => { const contentHeight = document.getElementById('content-inner'); if(contentHeight) { contentHeight.scrollTop = contentHeight.scrollHeight; } }); }, async getExamInfo() { let url = '/www/public/pxks/pxNrKsTmInfo'; const params = { ksid: this.examId } try{ const {error, data} = await $.get(url, params) if(error == 0 && data.length){ for(let i = 0; i < data.length; i++) { const q = data[i]; const tmxx = JSON.parse(q.tmxx); let tmcorrectanswer = null; if ([1, 3].includes(q.tmlx)) { tmcorrectanswer = tmxx.find(xx => xx.isCorrect).optionId; } else { tmcorrectanswer = tmxx.filter(xx => xx.isCorrect).map(xx => xx.optionId); } q.tmcorrectanswer = tmcorrectanswer; q.tmxx = tmxx; } this.$set(this.form, 'questionList', [ ...data ]); } } catch(e){ this.$message({ type: 'warning', message: "获取考试信息失败" }); } }, handlePrev() { /* this.$set(this.$data, 'form', { zjid: '', ksmc: '', kssc: '', kszf: '', jgfs: '', zdcs: '' }) */ this.$emit('prev'); }, validateQuestion(rule, value, callback) { // console.log(rule, value); const curQues = this.form.questionList.find(q => q.tmId === value); const hasBlankOption = curQues.tmxx.some(xx => !Boolean(xx.optionName)); if (!curQues.tmnr) { callback(new Error('请输入题目内容')); } else if (hasBlankOption) { callback(new Error('请输入题目选项内容')); } else if (!curQues.tmsorce) { callback(new Error('请输入题目分数')); } else if (!curQues.tmcorrectanswer) { callback(new Error('请选择题目正确答案')); } else if (curQues.tmcorrectanswer && !curQues.tmcorrectanswer.length) { callback(new Error('请选择题目正确答案')); } else { callback(); } }, onSubmit() { this.$refs['form'].validate(async (valid) => { if (valid) { let url = '/www/public/pxks/pxNrKsTmAdd'; const params = { ksid: this.examId, params: [...this.form.questionList] } for(let i = 0; i < params.params.length; i++) { const q = params.params[i]; q.tmno = i + 1; q.tmsorce = +q.tmsorce; for(let j = 0; j < q.tmxx.length; j++) { const xx = q.tmxx[j]; if ([1, 3].includes(q.tmlx)) { xx.isCorrect = q.tmcorrectanswer === xx.optionId; } else { xx.isCorrect = q.tmcorrectanswer.includes(xx.optionId); } } delete q.tmcorrectanswer; } params.params = JSON.stringify(params.params); try{ const {error, message, data} = await $.post(url, {...params}) if(error == 0){ this.$emit('done'); } const msg = message ?? '编辑成功'; this.$message({ type: error == 0 ? 'success': 'error', message: msg }); } catch(e){ console.log(e) this.$message({ type: 'warning', message: "新增考试失败" }); } } else { console.log('error submit!!'); return false; } }); }, // 移动题目 上移/下移/最前/最后 moveQuestion(i, code) { console.log(i, code); /* if(code === 'first') { const obj = this.form.questionList.splice(i, 1) if(obj) this.form.questionList.unshift(obj) return } if(code === 'last') { const obj = this.form.questionList.splice(i, 1) if(obj) this.form.questionList.push(obj) return } */ if(code === 'moveUp') { const prev = {...this.form.questionList[i - 1]}; this.$set(this.form.questionList, i - 1, {...this.form.questionList[i]}) this.$set(this.form.questionList, i, {...prev}) return } if(code === 'moveDown') { const next = {...this.form.questionList[i + 1]}; this.$set(this.form.questionList, i + 1, {...this.form.questionList[i]}) this.$set(this.form.questionList, i, {...next}) return } this.form.questionList.splice(i, 1); }, deleteQuestion(i) { console.log('i', i); this.form.questionList.splice(i, 1); } }, created: function(){ }, mounted: function(){ if (this.examId) { this.getExamInfo(); } }, props: ['chapterId', 'examId'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-editTrainingStep2", function(resolve, reject){ var template = "
\n
\n
\n
\n
\n
\n {{chapter.zjmc}}\n
\n
\n \n 添加已有课程\n 添加课程\n 添加考试\n 编辑\n \n
确定删除【{{chapter.zjmc}}】吗?
\n
\n 取消\n 确定\n
\n 删除\n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \t\n 添加章节\n
\n
\n
\t\n
\n \n
\n 取消\n 下一步\n
\n \t\n \n \n \n \n \n \n \n 取消\n \t确认\n \t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 分钟\n \n \n 取消\n \t确认\n \t\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n
请上传MP4格式视频,大小不超过2G
\n \n
\n \n
\n \n \n
支持PDF、word、PPT格式文件,大小不超过100MB
\n \n
\n
\n \n \t\n \n \n 分钟\n \n \n \t\n \n \n \n \n \n \n 取消\n \t确认\n \t\n
\n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ const validateKjfile = (rule, value, callback) => { if (!value || !value.length) { callback(new Error('请上传课件文件')); } else { callback(); } }; return { chaptersInfo: [], addChapterVisible: false, addChapterForm: { zjmc: '' }, addChapterRules: { zjmc: [ { required: true, message: '请输入章节名称', trigger: 'blur' }, ], }, selectCourseVisible: false, selectCourseForm: { zjid: '', kcfl: '', kcid: '', xs: '', gksc: '' }, selectCourseRules: { kcfl: [ { required: true, message: '请选择课程分类', trigger: ['change', 'blur'] }, ], kcid: [ { required: true, message: '请选择课程', trigger: ['change', 'blur'] }, ], xs: [ { required: true, message: '请输入学时', trigger: 'blur' }, ], gksc: [ { required: true, message: '请输入观看时长', trigger: 'blur' }, ], }, classification: '', classifications: [ { label: '心理辅导', value: '1' }, { label: '心理咨询', value: '2' }, { label: '情绪疏导', value: '3' }, { label: '身心健康', value: '4' } ], courseList: [], addCourseVisible: false, addCourseForm: { zjid: '', kcmc: '', kcfl: '', kcjj: '', kcfile: '', kjfile: '', kcfm: '', kcsc: '', gksc: '', xs: '' }, addCourseRules: { kcmc: [ { required: true, message: '请输入课程名称', trigger: 'blur' }, ], kcjj: [ { required: true, message: '请输入课程简介', trigger: 'blur' }, ], kcfile: [ { required: true, message: '请上传课程文件', trigger: 'blur' } ], kjfile: [ { validator: validateKjfile, trigger: 'blur' } ], xs: [ { required: true, message: '请输入学时', trigger: 'blur' }, ], gksc: [ { required: true, message: '请输入观看时长', trigger: 'blur' }, ] }, coursewareFileList: [], courseFileList: [], zxs: 0 // 总学时,第三步培训证书中使用 }; }, methods: { /** * @description el-upload + accept限制上传的文件格式 * @param e 校验的类型 * @param isArr 返回形式是否 array * @returns {string | null} */ acceptFile(e, isArr = false) { const allowHook = { video: 'video/mp4', file: 'application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation', img: 'image/jpg,image/jpeg,image/png' } return isArr ? allowHook[e].split(',') : allowHook[e] }, async getChapterInfo() { let url = '/www/public/pxks/pxNrInfo'; const params = { id: this.editId } try{ const {error, data} = await $.get(url, params) if(error == 0){ data.forEach(chapter => { this.zxs += chapter.kc.reduce((prev, kc) => (prev + kc.xs), 0); const kcTable = chapter.kc.map(kc => { const durationMin = Math.floor(kc.kcsc / 60) const durationSec = Math.floor(kc.kcsc % 60) return { type: 'kc', id: kc.id, name: kc.kcmc, durationOrScore: `课程时长${durationMin}分${durationSec}秒   达标时长${kc.gksc}分`, classhourOrNum: `学时:${kc.xs}` } }) const ksTable = chapter.ks.map(ks => ({ type: 'ks', id: ks.id, name: ks.ksmc, durationOrScore: `总分:${ks.kszf}   及格分数:${ks.jgfs}分`, classhourOrNum: ks.zdcs ? `${ks.zdcs}次` : '不限次数' })) chapter.contentTable = [...kcTable, ...ksTable] }) this.chaptersInfo = data; } } catch(e){ console.log(e) this.$message({ type: 'warning', message: "获取章节失败" }); } }, handleCancel() { this.$emit('cancel'); }, handleAddChapterCancel() { this.addChapterForm = { zjmc: '' }; this.$set(this.$data, 'addChapterVisible', false); }, submitAddChapterForm(formName) { this.$refs[formName].validate(async (valid) => { if (valid) { let url = '/www/public/pxks/pxZjEdit'; const {id, zjmc, sort} = this.addChapterForm; const params = { id, zjmc, sort, pxid: this.editId } if (!id) { delete params.id; url = '/www/public/pxks/pxZjAdd'; params.sort = this.chaptersInfo.length + 1; } try{ const {error, message} = await $.get(url, params) if(error == 0){ this.getChapterInfo(); this.handleAddChapterCancel() } const msg = message ?? '编辑章节成功'; this.$message({ type: error == 0 ? 'success': 'error', message: msg }); } catch(e){ this.$message({ type: 'warning', message: "编辑章节失败" }); } } else { console.log('error submit!!'); return false; } }); }, handleEditChapter(row) { if (row) { this.addChapterForm = row; } this.$set(this.$data, 'addChapterVisible', true); }, async handleDeleteChapter(chapter) { const url = "/www/public/pxks/pxZjDel" let params = { id: chapter.id } try{ const {error, message} = await $.get(url, params) if (error == 0) { this.getChapterInfo(); } else { const msg = message ?? '删除章节失败'; this.$message({ message: msg, type: 'error' }); } } catch(e){ console.log('[error]', e) this.$message({ type: 'warning', message: '删除章节失败' }); } }, handleSelectCourseCancel() { this.selectCourseForm = { zjid: '', kcfl: '', kcid: '', xs: '', gksc: '' } this.$set(this.$data, 'selectCourseVisible', false); }, submitSelectCourseForm(formName) { this.$refs[formName].validate(async (valid) => { if (valid) { let url = '/www/public/pxks/pxNrKcXz'; const { kcfl, ...cData } = this.selectCourseForm; const params = { ...cData, pxid: this.editId } try{ const {error, message} = await $.get(url, params) if(error == 0){ this.getChapterInfo(); this.handleSelectCourseCancel(); } const msg = message ?? '编辑章节成功'; this.$message({ type: error == 0 ? 'success': 'error', message: msg }); } catch(e){ this.$message({ type: 'warning', message: "编辑章节失败" }); } } else { console.log('error submit!!'); return false; } }); }, handleSelectCourse(row, type) { if (type === 1) { this.selectCourseForm.zjid = row.id; this.$set(this.$data, 'selectCourseVisible', true); } else { this.addCourseForm.zjid = row.id; this.$set(this.$data, 'addCourseVisible', true); } }, handleAddExam(chapter) { console.log('chapter', chapter); this.$emit('addExam', chapter.id); }, async getTrainingCourseList(kcfl) { if (!kcfl) { this.$message({ type: 'warning', message: "请先选择课程分类进行筛选" }); return; } const url = "/www/public/pxks/pxNrKcXl" let params = { kcfl } try{ this.courseList = [] const {error, data, message} = await $.get(url, params) if(error == 0){ this.courseList = (data ?? []).map(course => { return { label: course.kcmc, value: course.id } }) } else { this.$message.error(message) } } catch(e){ console.log('e', e) this.$message({ type: 'warning', message: "获取课程失败" }); } }, handleSelectKcfl(kcfl) { this.getTrainingCourseList(kcfl); }, beforeSelectCourse(show) { if (show) { const kcfl = this.selectCourseForm.kcfl; this.getTrainingCourseList(kcfl); } }, async handleDeleteCourse(row) { const url = row.type === 'kc' ? '/www/public/pxks/pxNrKcDel' : '/www/public/pxks/pxNrKsDel'; let params = { id: row.id } try{ const {error, message} = await $.get(url, params) if (error == 0) { this.getChapterInfo(); } else { const msg = message ?? `删除${row.type === 'kc' ? '课程' : '考试'}失败`; this.$message({ message: msg, type: 'error' }); } } catch(e){ console.log('[error]', e) this.$message({ type: 'warning', message: `删除${row.type === 'kc' ? '课程' : '考试'}失败` }); } }, handleClosePopover(index) { console.log(this.$refs[`popover-${index}`]) this.$refs[`popover-${index}`][0].doClose(); }, handleAddCourseCancel() { this.addCourseForm = { zjid: '', kcmc: '', kcfl: '', kcjj: '', kcfile: '', kjfile: '', kcfm: '', gksc: '', xs: '' } this.$set(this.$data, 'addCourseVisible', false); }, submitAddCourseForm(formName) { this.$refs[formName].validate(async (valid) => { if (valid) { let url = '/www/public/pxks/pxNrKcEdit'; const params = { ...this.addCourseForm, kjfile: this.addCourseForm.kjfile.join(',') } if (!this.addCourseForm.id) { delete params.id; url = '/www/public/pxks/pxNrKcAdd'; params.pxid = this.editId; } try{ const {error, message} = await $.get(url, params) if(error == 0){ this.getChapterInfo(); this.handleAddCourseCancel(); } const msg = message ?? '编辑课程成功'; this.$message({ type: error == 0 ? 'success': 'error', message: msg }); } catch(e){ this.$message({ type: 'warning', message: "编辑课程失败" }); } } else { console.log('error submit!!'); return false; } }); }, beforeCoursewareUpload(file) { // 定义允许的文件类型 const allowedTypes = this.acceptFile('file', true); // 检查文件类型是否在允许列表中 if (!allowedTypes.includes(file.type)) { this.$message.error('只能上传 pdf、doc、docx、ppt、pptx 格式的文件!'); return false; // 阻止上传 } // 限制文件大小 const maxSize = 100 * 1024 * 1024; // 100MB if (file.size > maxSize) { this.$message.error('文件大小不能超过 100MB!'); return false; } return true; // 允许上传 }, handleCoursewareUploaded(response, file, fileList) { console.log(response); const paths = [...this.addCourseForm.kjfile, response.data.path] this.$set(this.addCourseForm, 'kjfile', paths) }, handleCoursewareRemove(file, fileList){ const paths = fileList.map(f => f.url) this.$set(this.addCourseForm, 'kjfile', paths) }, handleCoursewarePreview(file){ console.log(file); }, beforeCourseUpload(file) { // 定义允许的文件类型 const allowedTypes = this.acceptFile('video', true); // 检查文件类型是否在允许列表中 if (!allowedTypes.includes(file.type)) { this.$message.error('只能上传 mp4 格式的文件!'); return false; // 阻止上传 } // 限制文件大小 const maxSize = 2 * 1024 * 1024 * 1024; // 100MB if (file.size > maxSize) { this.$message.error('文件大小不能超过 2G!'); return false; } return true; // 允许上传 }, handleCourseUploaded(response, file, fileList) { console.log(response); this.addCourseForm.kcfile = response.data.path; }, handleCourseRemove(){ this.$set(this.addCourseForm, 'kcfile', ''); this.$set(this.$data, 'courseFileList', []); }, kcfileVideoLoaded() { const duration = Math.floor(this.$refs.kcfileVideoRef.duration); this.$set(this.addCourseForm, 'kcsc', duration); }, handleEditCourseExam(row, chapter) { console.log(row, chapter); if (row.type === 'kc') { const chapterRow = this.chaptersInfo.find(c => c.id === chapter.id); const kcRow = chapterRow.kc.find(r => r.id === row.id); const { id, kcmc, kcjj, kcfile, kjfile, gksc, xs } = kcRow; const kjfiles = kjfile.split(','); this.$set(this.$data, 'addCourseForm', { id, kcmc, kcjj, kcfile, kjfile, gksc, xs, kjfile: kjfiles, zjid: chapter.id }); this.$set(this.$data, 'coursewareFileList', kjfiles.map(kjfile => { return { name: kjfile, url: kjfile } })); this.$set(this.$data, 'addCourseVisible', true); } else { this.$emit('addExam', chapter.id, row.id); // 章节id、考试id(编辑考试时用到) } }, onSubmit() { this.$emit('next', { step: 2, id: this.editId, zxs: this.zxs }); } }, created: function(){ }, mounted: function(){ if (this.editId) { this.getChapterInfo(); } }, props: ['editId'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-editTrainingExamStep1", function(resolve, reject){ var template = "\n
\n
\n \n \t\n \n \n \n \n \t\n \n \n 分钟\n \n \n \n \n \t\n \n \n \n \n \n \t\n \n \n \n \n \n \n \n \n \n \n \n
\t\n
\n \n 取消\n 下一步\n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { form: { zjid: '', ksmc: '', kssc: '', kszf: '', jgfs: '', zdcs: '' }, rules: { ksmc: [ { required: true, message: '请输入考试名称', trigger: 'blur' }, { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } ], kssc: [ { required: true, message: '请输入考试时长', trigger: 'blur' } ], kszf: [ { required: true, message: '请输入考试总分', trigger: 'blur' } ], jgfs: [ { required: true, message: '请输入及格分数', trigger: 'blur' } ], zdcs: [ { required: true, message: '请输入作答次数间', trigger: 'blur' } ], }, postFileList: [] }; }, methods: { async getExamInfo() { let url = '/www/public/pxks/pxNrKsInfo'; const params = { id: this.examId } try{ const {error, data} = await $.get(url, params) if(error == 0){ this.$set(this.$data, 'form', { ...data }); } } catch(e){ this.$message({ type: 'warning', message: "获取考试信息失败" }); } }, handleCancel() { this.$set(this.$data, 'form', { zjid: '', ksmc: '', kssc: '', kszf: '', jgfs: '', zdcs: '' }) this.$emit('cancel'); }, onSubmit() { this.$refs['form'].validate(async (valid) => { if (valid) { let url = '/www/public/pxks/pxNrKsAdd'; const params = { ...this.form, zjid: this.chapterId, pxid: this.editId } if (this.examId) { params.id = this.examId; delete params.zjid; delete params.createtime; delete params.pxid; url = '/www/public/pxks/pxNrKsEdit'; } try{ const {error, message, data} = await $.get(url, params) if(error == 0){ this.$emit('next', { step: 1, id: this.examId ? this.examId : data }); } const msg = message ?? '编辑成功'; this.$message({ type: error == 0 ? 'success': 'error', message: msg }); } catch(e){ this.$message({ type: 'warning', message: "新增考试失败" }); } } else { console.log('error submit!!'); return false; } }); }, /** * @description el-upload + accept限制上传的文件格式 * @param e 校验的类型 * @param isArr 返回形式是否 array * @returns {string | null} */ acceptFile(e, isArr = false) { const allowHook = { video: 'video/mp4', file: 'application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation', img: 'image/jpg,image/jpeg,image/png' } return isArr ? allowHook[e].split(',') : allowHook[e] }, beforePostUpload(file) { const allowedTypes = this.acceptFile('img', true); if (!allowedTypes.includes(file.type)) { this.$message.error('上传图片只能是 JPG、JPEG、PNG 格式!'); return false; // 阻止上传 } // 限制文件大小 const maxSize = 20 * 1024 * 1024; // 20MB if (file.size > maxSize) { this.$message.error('上传图片大小不能超过 20MB!'); return false; } return true; // 允许上传 }, handlePostUploaded(response, file, fileList) { console.log(response); this.form.pxfm = response.data.path; }, handlePostRemove(){ this.$set(this.form, 'pxfm', '') }, }, created: function(){ }, mounted: function(){ if (this.examId) { this.getExamInfo(); } }, props: ['editId', 'chapterId', 'examId'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-editTrainingStep1", function(resolve, reject){ var template = "\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n
支持PNG、Jpeg格式图片,推荐比例16:9,推荐尺寸300*150,大小不超过20MB添加一些事件描述
\n \n
\n
\t\n
\n \n 取消\n 下一步\n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { form: { pxmc: '', pxjj: '', pxtime: '', pxfm: '' }, rules: { pxmc: [ { required: true, message: '请输入培训名称', trigger: 'blur' }, { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } ], pxjj: [ { required: true, message: '请输入培训简介', trigger: 'blur' } ], pxtime: [ { required: true, message: '请选择培训时间', trigger: 'blur' } ], pxfm: [ { required: true, message: '请上传培训封面', trigger: 'blur' } ], }, postFileList: [] }; }, methods: { async getTrainingInfo() { let url = '/www/public/pxks/pxJbxxInfo'; const params = { id: this.editId } try{ const {error, data} = await $.get(url, params) if(error == 0){ const {starttime, endtime, ...restData} = data this.$set(this.$data, 'form', { ...restData, pxtime: [starttime, endtime] }); this.$set(this.$data, 'postFileList', [{ name: data.pxfm, url: data.pxfm }]); } } catch(e){ this.$message({ type: 'warning', message: "获取课程失败" }); } }, handleCancel() { this.$set(this.$data, 'form', { pxmc: '', pxjj: '', pxfm: '' }) this.$emit('cancel'); }, onSubmit() { this.$refs['form'].validate(async (valid) => { if (valid) { let url = '/www/public/pxks/pxJbxxAdd'; const {pxtime, ...restData} = this.form const params = { ...restData, starttime: moment(pxtime[0]).set({h: 0, m: 0, s: 0}).format('YYYY-MM-DD HH:mm:ss'), endtime: moment(pxtime[1]).set({h: 23, m: 59, s: 59}).format('YYYY-MM-DD HH:mm:ss'), } if (this.editId) { params.id = this.editId; url = '/www/public/pxks/pxJbxxEdit'; } try{ const {error, message, data} = await $.get(url, params) if(error == 0){ this.$emit('next', { step: 1, id: this.editId ? this.editId : data }); } else { const msg = message ?? '编辑培训失败'; this.$message({ message: msg, type: 'error' }); } } catch(e){ this.$message({ type: 'warning', message: "新增培训失败" }); } } else { console.log('error submit!!'); return false; } }); }, /** * @description el-upload + accept限制上传的文件格式 * @param e 校验的类型 * @param isArr 返回形式是否 array * @returns {string | null} */ acceptFile(e, isArr = false) { const allowHook = { video: 'video/mp4', file: 'application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation', img: 'image/jpg,image/jpeg,image/png' } return isArr ? allowHook[e].split(',') : allowHook[e] }, beforePostUpload(file) { const allowedTypes = this.acceptFile('img', true); if (!allowedTypes.includes(file.type)) { this.$message.error('上传图片只能是 JPG、JPEG、PNG 格式!'); return false; // 阻止上传 } // 限制文件大小 const maxSize = 20 * 1024 * 1024; // 20MB if (file.size > maxSize) { this.$message.error('上传图片大小不能超过 20MB!'); return false; } return true; // 允许上传 }, handlePostUploaded(response, file, fileList) { console.log(response); this.form.pxfm = response.data.path; }, handlePostRemove(){ this.$set(this.form, 'pxfm', ''); this.$set(this.$data, 'postFileList', []); }, }, created: function(){ }, mounted: function(){ if (this.editId) { this.getTrainingInfo(); } }, props: ['editId'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-txcqzbqk-view", function(resolve, reject){ var template = "
\n \n
\n
\n 新增\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n
\n \n \n
\n \n \n
\n
\n \n \n \n \n \n \n
\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
测试时间安排样本校测试时间已确定。
对照样本校提交的《测试时间安排表》,与样本校再次确认,学生和教师的测试时间安排无变化。
(原则上各样本校上报测试时间安排表后,不允许变动。
如有特殊情况,需及时上报直属上级工作组)
实施方案与应急预案样本校工作组已制定实施工作方案与应急处置预案,内容充分,结合实际,指导性强。
可查看学校实施工作方案与应急预案。
工作人员安排样本校工作组成员配备齐全,职责明确,分工合理。
可查看工作组名单。
工作组成员及相关工作人员已参加\"信息上报与组织实施工作培训会\"。
可查看\"信息上报与组织实施工作培训会\"培训签到表
施测现场工作人员已明确。
学生测试现场:每场次主监测员、副监测员、信息员(计算机教师)、司时员(吹哨或其他方式)、保障人员(学校负责人和心理健康教师)。
教师测试现场:校长/中层领导干部作为主监测员,组织本校相关教师到教师问卷填答室统一作答。
施测现场工作人员已参加学校组织的现场操作程序与规范培训。
可查看培训签到表
施测环境安排已安排学生测试机房,能容纳整班测试人数。
如不能容纳,学校是怎样协调安排测试的?
(补充说明:允许大班额班级组织两场测试;如果只有几名学生不能容纳,可考虑每个班级多余的几名学生一起组织一场测试,但注意务必为每名学生发放本班学生账号)。
学生测试机房计算机能正常运转,网络连接正常。
学生测试机房门口已贴好门签,并在机位上贴上编号(按S型顺序依次贴上01、02、03……)。
已安排教师填答室,网络连接正常。
已在\"监测平台\"的\"作答测试\"导航模块,进行答题系统测试,
登录正常、作答顺畅。
相关文档材料打印已打印\"测试过程记录表\",
学生测试每个场次打印1份,教师测试打印1份。
已打印参测学生账号、参测教师账号、学校负责人账号(仅小学、初中、普通高中准备),
并沿虚线将每人的账号剪开。
已打印本校所有参测教师名单、所有参测班级学生名单,
该名单不提交,仅供现场检录使用。
发现的其他问题
学校反映的主要问题和困难,及解决的建议
视导时间年月日
\n
\n\n
\n 确 定\n
\n
\n\n \n
\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
测试时间安排学校测试时间已确定,参测学生与教师已知晓。
对照学校提交的《测试时间安排表》,与学校再次确认,学生和教师的测试时间安排无变化。
(原则上各学校上报测试时间安排表后,不允许变动。
如有特殊情况,需及时上报省级工作组)
已通知\"非集中测试\"班级学生测试时间和要求,班主任或辅导员已及时督促。
实施方案与应急预案学校工作组制定了实施工作方案与应急处置预案,内容充分,结合实际情况,指导性强。
可查看学校实施工作方案与应急预案。
工作人员安排学校工作组成员配备齐全,职责明确,分工合理。
可查看工作组名单。
工作组成员及相关工作人员已参加\"信息上报与组织实施工作培训会\"。可查看\"信息上报与组织实施工作培训会\"培训签到表
施测现场工作人员已明确。
学生测试现场:每场次主监测员、副监测员、信息员、司时员(吹哨或其他方式)、保障人员(实施负责人和心理健康教师)。
教师测试安排:实施负责人已明确教师账号发放规则。
所有参测教师通知到位。
施测现场工作人员已参加学校组织的现场操作程序与规范培训。可查看培训签到表
施测环境安排已安排学生测试教室,能容纳整班测试人数。
学生测试教室计算机或手机网络连接正常。
学生测试教室门口已贴好门签,并在座位上贴上编号(按S型顺序依次贴上01、02、03……)。
已在\"监测平台\"的\"作答测试\"导航模块,进行答题系统测试,登录正常、作答顺畅。
相关文档材料打印已打印\"测试过程记录表\",
学生测试每个场次打印1份。
已打印参测学生账号。
已打印本校所有参测班级学生名单,
该名单不提交,仅供现场检录使用。
发现的其他问题
学校反映的主要问题和困难,以及解决的建议
视导时间年月日
\n
\n\n
\n 确 定\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n
\n 取 消\n 确 定\n
\n
\n
"; return (function(template, resolve, reject) { seajs.use([], function() { resolve({ template: template, props: ['xxid'], data: function() { return { activeName: 'first', currentView: 'list', // 'list' 或 'form' tableData: [], Detailpages: { pageNo: 1, pageSize: 10 }, DetailTotal: 0, isEditing: false, isViewing: false, schoolList: [], schoolLoading: false, currentEditRow: null, showSchoolDialog: false, // 学校选择弹框 selectedSchool: null, // 选中的学校 jijiaoForm: { id: null, type: '1', userid: '', xxid: '', cssjap1: '', cssjap2: '', ya: '', ap1: '', ap2: '', ap3: '', ap4: '', scap1: '', scap2: '', scap3: '', scap4: '', scap5: '', cldy1: '', cldy2: '', cldy3: '', wt: '', jy: '', sdsj: '', sdyid: '' }, gaojiaoForm: { id: null, type: '2', userid: '', xxid: '', cssjap1: '', cssjap2: '', ya: '', ap1: '', ap2: '', ap3: '', ap4: '', scap1: '', scap2: '', scap3: '', scap4: '', cldy1: '', cldy2: '', cldy3: '', wt: '', jy: '', sdsj: '', sdyid: '' }, jijiaoRules: { xxid: [{ required: true, message: '请选择学校', trigger: 'change' }], cssjap1: [{ required: true, message: '请选择测试时间安排', trigger: 'change' }], ya: [{ required: true, message: '请选择实施方案与应急预案', trigger: 'change' }], ap1: [{ required: true, message: '请选择工作人员安排1', trigger: 'change' }], ap2: [{ required: true, message: '请选择工作人员安排2', trigger: 'change' }], ap3: [{ required: true, message: '请选择工作人员安排3', trigger: 'change' }], ap4: [{ required: true, message: '请选择工作人员安排4', trigger: 'change' }], scap1: [{ required: true, message: '请选择施测环境安排1', trigger: 'change' }], scap2: [{ required: true, message: '请选择施测环境安排2', trigger: 'change' }], scap3: [{ required: true, message: '请选择施测环境安排3', trigger: 'change' }], scap4: [{ required: true, message: '请选择施测环境安排4', trigger: 'change' }], scap5: [{ required: true, message: '请选择施测环境安排5', trigger: 'change' }], cldy1: [{ required: true, message: '请选择相关文档材料打印1', trigger: 'change' }], cldy2: [{ required: true, message: '请选择相关文档材料打印2', trigger: 'change' }], cldy3: [{ required: true, message: '请选择相关文档材料打印3', trigger: 'change' }], wt: [{ required: true, message: '请填写发现的其他问题', trigger: 'blur' }], jy: [{ required: true, message: '请填写学校反映的主要问题和困难', trigger: 'blur' }], sdsj: [{ required: true, message: '请选择视导时间', trigger: 'change' }] }, gaojiaoRules: { xxid: [{ required: true, message: '请选择学校', trigger: 'change' }], cssjap1: [{ required: true, message: '请选择测试时间安排1', trigger: 'change' }], cssjap2: [{ required: true, message: '请选择测试时间安排2', trigger: 'change' }], ya: [{ required: true, message: '请选择实施方案与应急预案', trigger: 'change' }], ap1: [{ required: true, message: '请选择工作人员安排1', trigger: 'change' }], ap2: [{ required: true, message: '请选择工作人员安排2', trigger: 'change' }], ap3: [{ required: true, message: '请选择工作人员安排3', trigger: 'change' }], ap4: [{ required: true, message: '请选择工作人员安排4', trigger: 'change' }], scap1: [{ required: true, message: '请选择施测环境安排1', trigger: 'change' }], scap2: [{ required: true, message: '请选择施测环境安排2', trigger: 'change' }], scap3: [{ required: true, message: '请选择施测环境安排3', trigger: 'change' }], scap4: [{ required: true, message: '请选择施测环境安排4', trigger: 'change' }], cldy1: [{ required: true, message: '请选择相关文档材料打印1', trigger: 'change' }], cldy2: [{ required: true, message: '请选择相关文档材料打印2', trigger: 'change' }], cldy3: [{ required: true, message: '请选择相关文档材料打印3', trigger: 'change' }], wt: [{ required: true, message: '请填写发现的其他问题', trigger: 'blur' }], jy: [{ required: true, message: '请填写学校反映的主要问题和困难', trigger: 'blur' }], sdsj: [{ required: true, message: '请选择视导时间', trigger: 'change' }] } }; }, computed: { formTitle() { const type = this.activeName === 'first' ? '基教' : '高教'; var baseTitle = `${type}测前准备情况`; if (this.selectedSchool) { return baseTitle + ' - ' + this.selectedSchool.xxmc; } return baseTitle; } }, mounted: function() { this.getList(); // this.getSchoolList(); // 页面加载时获取所有学校数据 }, methods: { getSchoolList: function(){ var that = this; // 根据当前激活的标签页确定type参数:基教为1,高教为2 var type = that.activeName === 'first' ? '1' : '2'; $.get('/www/public/sdy/xxListBysdy', { type: type }, function(res) { if (res.error == 0) { that.schoolList = res.data || []; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('获取学校列表失败'); }); }, getList: function() { const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var params = { ...this.Detailpages }; var that = this; $.get('/www/public/sdy/sdysdycqzbList', params, function(res) { if (res.error == 0) { // 根据xd字段过滤数据:1-4为基教,其他为高教 /** var allData = res.data || []; var filteredData = []; if (that.activeName === 'first') { // 基教:xd为1,2,3,4 filteredData = allData.filter(function(item) { return item.xd && ['1', '2', '3', '4'].includes(item.xd.toString()); }); } else { // 高教:xd不为1,2,3,4 filteredData = allData.filter(function(item) { return item.xd && !['1', '2', '3', '4'].includes(item.xd.toString()); }); } */ that.tableData = res.data || []; // filteredData; that.DetailTotal = res.total; } else { that.$message.error(res.message); } }); }, changeTab: function() { this.Detailpages.pageNo = 1; this.getList(); // this.getSchoolList(); // 重新获取学校列表 }, openAddDialog: function() { this.isEditing = false; this.isViewing = false; this.currentEditRow = null; this.selectedSchool = null; this.showSchoolDialog = true; }, editItem: function(row) { this.isEditing = true; this.isViewing = false; this.currentEditRow = row; // 判断是否可以选择学校(如果sfddtj不等于'0',则可以选择学校) var canSelectSchool = row.sfddtj != '0'; if (canSelectSchool) { // 可以选择学校,显示弹框并回显当前学校 this.selectedSchool = { xxmc: row.xxmc, id: row.xxid }; this.showSchoolDialog = true; } else { // 不能选择学校,直接进入表单 this.selectedSchool = { xxmc: row.xxmc, id: row.xxid }; this.currentView = 'form'; // 根据xd字段判断切换到对应标签页 if (row.xd && ['1', '2', '3', '4'].includes(row.xd.toString())) { this.activeName = 'first'; } else { this.activeName = 'second'; } this.loadFormData(row.id); } }, viewItem: function(row) { this.isEditing = false; this.isViewing = true; this.currentEditRow = row; this.selectedSchool = { xxmc: row.xxmc, id: row.xxid }; this.currentView = 'form'; // 根据xd字段判断切换到对应标签页 if (row.xd && ['1', '2', '3', '4'].includes(row.xd.toString())) { this.activeName = 'first'; } else { this.activeName = 'second'; } this.loadFormData(row.id); }, loadFormData: function(id) { var that = this; // 如果有id,调用接口获取详情数据 if (id) { $.get('/www/public/sdy/sdysdycqzfindByid', { id: id }, function(res) { if (res.error == 0) { if (that.activeName === 'first') { that.jijiaoForm = Object.assign({}, that.jijiaoForm, res.data); } else { that.gaojiaoForm = Object.assign({}, that.gaojiaoForm, res.data); } } else { that.$message.error(res.message); } }); } else { // 如果没有id,使用row的数据填充表单(主要是学校信息) if (that.currentEditRow) { var rowData = { xxid: that.currentEditRow.xxid, xxmc: that.currentEditRow.xxmc, qxmc: that.currentEditRow.qxmc, xd: that.currentEditRow.xd }; if (that.activeName === 'first') { that.jijiaoForm = Object.assign({}, that.jijiaoForm, rowData); } else { that.gaojiaoForm = Object.assign({}, that.gaojiaoForm, rowData); } } } }, deleteItem: function(row) { var that = this; this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(function() { $.post('/www/public/sdy/sdysdycqzbDelete', { id: row.id }, function(res) { if (res.error == 0) { that.$message.success('删除成功'); that.getList(); } else { that.$message.error(res.message || '删除失败'); } }).fail(function() { that.$message.error('删除失败'); }); }).catch(function() {}); }, saveJijiao: function() { var that = this; this.$refs.jijiaoForm.validate(function(valid) { if (valid) { const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var params = { ...that.jijiaoForm, userid: that.jijiaoForm.xxid, sdyid: user.ID, type: '1' // 基教类型 }; // 删除多余的xxid字段 delete params.xxid; // 如果是新增,添加sfddtj字段 if (!that.isEditing) { params.sfddtj = '1'; } $.post('/www/public/sdy/sdysdycqzbAdd', params, function(res) { if (res.error == 0) { that.$message.success(that.isEditing ? '编辑成功' : '新增成功'); that.currentView = 'list'; that.getList(); } else { that.$message.error(res.message || '操作失败'); } }); } }); }, saveGaojiao: function() { var that = this; console.log(that.gaojiaoForm) this.$refs.gaojiaoForm.validate(function(valid) { if (valid) { const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var params = { ...that.gaojiaoForm, userid: that.gaojiaoForm.xxid, sdyid: user.ID, type: '2' // 高教类型 }; // 删除多余的xxid字段 delete params.xxid; // 如果是新增,添加sfddtj字段 if (!that.isEditing) { params.sfddtj = '1'; } $.post('/www/public/sdy/sdysdycqzbAdd', params, function(res) { if (res.error == 0) { that.$message.success(that.isEditing ? '编辑成功' : '新增成功'); that.currentView = 'list'; that.getList(); } else { that.$message.error(res.message || '操作失败'); } }); } }); }, backToList: function() { this.currentView = 'list'; }, resetJijiaoForm: function() { const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; this.jijiaoForm = { id: null, type: '1', userid: '', xxid: '', cssjap1: '', cssjap2: '', ya: '', ap1: '', ap2: '', ap3: '', ap4: '', scap1: '', scap2: '', scap3: '', scap4: '', scap5: '', cldy1: '', cldy2: '', cldy3: '', wt: '', jy: '', sdsj: '', sdyid: user.ID }; }, resetGaojiaoForm: function() { const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; this.gaojiaoForm = { id: null, type: '2', userid: '', xxid: '', cssjap1: '', cssjap2: '', ya: '', ap1: '', ap2: '', ap3: '', ap4: '', scap1: '', scap2: '', scap3: '', scap4: '', cldy1: '', cldy2: '', cldy3: '', wt: '', jy: '', sdsj: '', sdyid: user.ID }; }, handleDetailSizeChange: function(val) { this.Detailpages.pageSize = val; this.getList(); }, handleDetailCurrentChange: function(val) { this.Detailpages.pageNo = val; this.getList(); }, // 学校选择相关方法 confirmSchoolSelection: function() { if (!this.selectedSchool) { this.$message.warning('请选择学校'); return; } this.showSchoolDialog = false; this.enterForm(); }, cancelSchoolSelection: function() { this.showSchoolDialog = false; this.selectedSchool = null; }, enterForm: function() { this.currentView = 'form'; // 重置表单 if (this.activeName === 'first') { this.resetJijiaoForm(); if (this.selectedSchool) { this.jijiaoForm.xxid = this.selectedSchool.id; this.jijiaoForm.xxmc = this.selectedSchool.xxmc; } } else { this.resetGaojiaoForm(); if (this.selectedSchool) { this.gaojiaoForm.xxid = this.selectedSchool.id; this.gaojiaoForm.xxmc = this.selectedSchool.xxmc; } } // 如果是编辑或查看模式,加载数据 if (this.currentEditRow && this.currentEditRow.id) { this.loadFormData(this.currentEditRow.id); } } } }); }); })(template, resolve, reject); }); RegVueCom("xljk-classificationTool", function(resolve, reject){ var template = "
\n 类型:\n
\n {{ classification.label }}\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, props: ['value'], data: function(){ return { id: Math.uuid(), classifications: [ { label: '全部', value: '' }, { label: '心理辅导', value: '1' }, { label: '心理咨询', value: '2' }, { label: '情绪疏导', value: '3' }, { label: '身心健康', value: '4' } ] }; }, methods: { changeClassification(v) { this.$emit('update:value', v) // 通知父组件更新 this.$emit('change', v) } }, created: function(){ }, mounted: function(){ console.log('value', this.value); } }) }) })(template, resolve, reject); }); RegVueCom("xljk-courseMgr-view", function(resolve, reject){ var template = "
\n
\n
\n
\n \n
\n
\n \n
\n 创建课程\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n
\n
\n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, name: "CourseMgr", data() { return { courseTitle: '', classification: '', // 课程分类:1-心理辅导 2-心理咨询 3-情绪疏导 4-身心健康 listData: [ /*{ id:1, title: '这是一个测试名字', status: '已发布', usefor:'小学 初中 高中 中职 高职 本科', }, { id:2, title: '这是一个测试名字', status: '已发布', usefor:'小学 初中 高中 中职 高职 本科', }, { id:3, title: '这是一个测试名字', status: '已发布', usefor:'小学 初中 高中 中职 高职 本科', }, { id:4, title: '这是一个测试名字', status: '已发布', } */ ], activeItem:{}, loading: false, pagination:{ currentPage: 1, pageSize: 10, pageSizes: [10,20,30,40], total: 0 }, }; }, mounted(){ this.getCourseList() }, methods: { funClick(funName,item){ switch (funName){ case 'edit': console.log('edit'); this.$router.push(`/addOrEditTest?cpid=${item.id}&role=${item.roles}&xd=${item.xd}`) break; case 'send': console.log('send'); break; case 'download': console.log('download'); break; default: console.log('default'); } }, handleAction(actionName,item){ switch (actionName){ case 'publish': console.log('publish'); const params = { id: item.id, sffb: item.sffb ^ 1 } $.get("/www/public/cpgl/cpFb",params, res => { if(res.code == 200) { this.$message({ type: 'success', message: '操作成功!' }); this.getcplb() } }) break; case 'copy': console.log('publish'); break; case 'move': console.log('publish'); break; case 'delete': let isDelete = encodeURIComponent(this.activeItem.wjjmc) === encodeURIComponent('回收站') if(isDelete) { this.$confirm('此操作将彻底删除该测评数据, 是否继续?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { $.get('/www/public/cpgl/cplbsc', {id: item.id},(res) => { console.log(res) if(res.error == 0) { this.$message({ type: 'success', message: '删除成功!' }); this.getcplb() } }) }).catch(() => { }); } else { this.$confirm('此操作将删除该测评数据, 是否继续?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { $.post('/www/public/cpgl/cplbrsc', {id: item.id},(res) => { console.log(res) if(res.error == 0) { this.$message({ type: 'success', message: '删除成功!' }); this.getcplb() } }) }).catch(() => { }); } break; default: console.log('default'); } }, // 获取课程列表 async getCourseList(isReset = false){ if(isReset){ this.pagination = { ...this.pagination, currentPage: 1 } } var that = this const url = "/www/public/pxks/kcList" const params = { pagesize: this.pagination.pageSize, pageno: this.pagination.currentPage, // 题本名称 kcmc: this.courseTitle, kcfl: this.classification } try{ this.loading = true this.listData = [] //this.pagination.total = 0 const {error, data, message, total} = await $.get(url, params) if(error == 0){ this.listData = data this.pagination.total = total } else { this.$message.error(message) } } catch(e){ this.$message({ type: 'warning', message: "获取课程失败" }); } finally{ this.loading = false } }, // 搜索 onSubmit() { if(this.loading){ return } this.getCourseList() }, // 重置 handleReset(){ this.$refs.formInline.resetFields() this.onSubmit() }, async handleClassChange(v) { await this.$nextTick(); this.getCourseList() }, openDialog(id) { this.$refs.dialog.openDialog(id) }, handleEditCourse(row) { } } }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDCard", function(resolve, reject){ var template = "
\n \n
\n
\n \n
\n {{title}}\n
\n \n
\n \n
\n
\n
\n \n
\n
\n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid() }; }, methods: { }, created: function(){ }, mounted: function(){ }, props: ['title', 'data', 'config','currentPage','navColor','cardWidth','cardHeight','hideReturnBtn'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-XDzlxz0", function(resolve, reject){ var template = "
\n \n \n \n \n
"; return (function(template, resolve, reject){ seajs.use([], function(){ return resolve({ template: template, data: function(){ return { id: Math.uuid(), uploading:false, percentage:0, showpercent:false, customColor: '#409eff', currentId:'', loading:false, pages:{ pageSize:10, pageNo:1 }, List:[], typeMap:["/jpglogo.png","/yasuologo.png","/mp4logo.png","/wordlogo.png","/excellogo.png","/pdflogo.png"], loopData0: [ ], loopData4: [ ], loopData1:[], loopData2:[], total:0, constants: {},}; }, methods: { handlebeforeClose(){ this.$emit('closeDialog') }, show(){ console.log(this.$refs.baseDialoggzz0,'baseDialoggzz0') this.$refs.baseDialoggzz0.show() }, handleConfirm(){ this.$refs.baseDialogjs.close() }, /* // customUpload(params,item) { var that = this that.loading = true var xxjd = localStorage.getItem('xxjd') //1小学 2初中 3高中 4中职 5高职 7本科 8硕士 9博士 var importType if(['1','2','3'].indexOf(xxjd)!=-1){ importType = '1' }else{ importType = '2' } // params是一个对象,包含了file和fileList, // 但是这个params参数可能每个版本不一样值就不一样,到时候自己打印看看, // 反正file的值就是原始的File对象 const formData = new FormData() console.log(params.file,'params.file') formData.append('file', params.file) // 这是file入参,文件信息 // 如果extraParams是个对象,循环加入formData for (const key in this.extraParams) { formData.append(key, this.extraParams[key]) } // 如果extraParams是个单独的值,直接加入 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var roles=user.UserFilter.urole // 调接口 axios.post(`/www/public/shangbao/addfiletemprecord?filetempid=${item.id}`, formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ that.$message.success(data.message) that.loading = false that.getList() }else{ that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false that.$message.error('文件上传异常!') console.error(error); }); }, */ getMd5(file) { return new Promise((resolve) => { // 对文件对象的处理 const spark = new SparkMD5.ArrayBuffer()// md5的ArrayBuffer加密类 var fileReader = new FileReader(); fileReader.readAsArrayBuffer(file); // fileReader.onload为异步函数,要放到Promise对象中,等待状态的变更后再返回生成的md5值 fileReader.onload = function (e) { spark.append(e.target.result); resolve(spark.end()); }; }); }, async uploadFile(params,item){ if(this.loading){ return this.$message.error('有文件正在上传,请稍后再试!') } var that = this that.currentId = item.id that.loading = true that.percentage = 0 var xxjd = localStorage.getItem('xxjd') //1小学 2初中 3高中 4中职 5高职 7本科 8硕士 9博士 var importType if(['1','2','3'].indexOf(xxjd)!=-1){ importType = '1' }else{ importType = '2' } var successhh = 0 that.loading = true const file = params.file console.log(file,'file') const fileReader = new FileReader()// 文件读取 console.log(file) const chunkSize = 1024 * 1024 * 6 let fileChunkedList = [] // 文件分片完成之后的数组 const name=file.name let md5 = await that.getMd5(file) // 文件开始分片,push到fileChunkedList数组中, 并用第一个分片去计算文件的md5 for (let i = 0; i < file.size; i = i + chunkSize) { const tmp = file.slice(i, Math.min((i + chunkSize), file.size)) if (i === 0) { fileReader.readAsArrayBuffer(tmp) } fileChunkedList.push(tmp) } console.log(fileChunkedList,'数组') const chunks=fileChunkedList.length that.showpercent = true for (let i = 1; i <= fileChunkedList.length; i =i+1) { const formData = new FormData() formData.append('imgFile', fileChunkedList[i-1],file.name) formData.append('chunk', i) formData.append('old', that.old) formData.append('size', file.size) formData.append('name', name) formData.append('md5', md5) for (var value of formData.values()) { console.log(value); } try { const result = await that.uploads(formData,item.id) console.log(result,'result') if(result){ if(result.status==200){ if(result.data){ //console.log(result.data,'result.data') const data = result.data that.old = data.data if(data.success==1){ successhh += 1 that.percentage = ((successhh/fileChunkedList.length)*100).toFixed(0) console.log(that.percentage,' that.percentage') if(data.message=="上传成功"&&successhh{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, XXexportFn(activeName){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { schoolid, } var url var name if(activeName=='first'){ url = "/www/public/shangbao/exportStudent" name = '学生账号.xls' }else if(activeName == 'second'){ url = "/www/public/shangbao/exportteather" name = '教师账号.xls' }else{ url = "/www/public/shouye/px_webftybm_dcbxftyzh" name = '访谈员账号.xls' } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, DexportFn(){ var that = this var name //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var username = user.Username var bm = username.substring(3) let type if(user.Roles.includes('220')){ type='1' name = '市级管理员账号信息.xls' if(['110000','120000','310000','500000'].includes(bm)){ type='1' name = '区县管理员账号信息.xls' } }else if(user.Roles.includes('310')){ type='2' name = '区县管理员账号信息.xls' } const params = { username:user.Username, type, state:'1' } axios({ method: 'get', url: '/www/public/shangbao/dcsqxzh', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, exportFn(){ var that = this //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let type if(user.Roles.includes('220')){ type='1' }else if(user.Roles.includes('310')){ type='2' } const params = { username:user.Username, type, state:'1', } axios({ method: 'get', url: '/www/public/shangbao/exportzgxxx', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', '直管校管理员账号.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, delfn(item){ var that = this const params = { id:item.recordId, tempid:item.filetempid } $.post("/www/public/shangbao/deletefilerecord", params, function(res){ if(res.error==0){ that.$message.success('删除成功') that.getList() }else{ that.$message.error(res.message) } }).fail((err)=>{ that.loading = false that.$message({ type: "error", message: '请求错误' }) }) }, yulan(item){ window.open('/core/UForm/fileviewer/r_temp_file_record?ff=id&fv='+item.recordId,'_blank') }, onError(){}, // customUpload(params,item) { var that = this that.loading = true var xxjd = localStorage.getItem('xxjd') //1小学 2初中 3高中 4中职 5高职 7本科 8硕士 9博士 var importType if(['1','2','3'].indexOf(xxjd)!=-1){ importType = '1' }else{ importType = '2' } // params是一个对象,包含了file和fileList, // 但是这个params参数可能每个版本不一样值就不一样,到时候自己打印看看, // 反正file的值就是原始的File对象 const formData = new FormData() console.log(params.file,'params.file') formData.append('file', params.file) // 这是file入参,文件信息 // 如果extraParams是个对象,循环加入formData for (const key in this.extraParams) { formData.append(key, this.extraParams[key]) } // 如果extraParams是个单独的值,直接加入 var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID var roles=user.UserFilter.urole // 调接口 axios.post(`/www/public/shangbao/addfiletemprecord?filetempid=${item.id}`, formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(({data}) => { if(data&&data.success==1){ that.$message.success(data.message) that.loading = false that.getList() }else{ that.loading = false that.$message.error(data.message) } }) .catch(error => { that.loading = false that.$message.error('文件上传异常!') console.error(error); }); }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pages.pageSize = val this.getList() }, handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pages.pageNo = val this.getList() }, exportFn1(){ var that = this //var user = this.$store.state.user var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { username:user.Username, djsmc:that.djsmc } axios({ method: 'get', url: '/www/public/shangbao/exportxqnxxdc', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; //let name = type=='1'?'市及管理员账号' aLink.setAttribute('download', '辖区内学校管理员账号.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, teshudownload(item){ if(item.id==3||item.id==4||item.id==8){ const that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let data = { xxid:user.ID } $.post("/www/public/chouyang/sb_findzhxfzt", data, function(res){ if(res.error==0){ if(item.id==3){ that.XXexportFn('first') }else if(item.id==4){ that.XXexportFn('second') }else if(item.id==8){ that.xljkfzrdown() } }else{ that.$message.error(res.message) } }) } if(item.id==7){ const that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} let data = { xxid:user.ID } $.post("/www/public/chouyang/sb_findbjxfzt", data, function(res){ if(res.error==0){ if(item.id==7){ that.bjxxdown() } }else{ that.$message.error(res.message) } }) } if(item.id==2){ this.exportFn1() }else if(item.id==1){ this.DexportFn() }else if(item.id==5){ this.YBXCYBJexportFn() }else if(item.id==6){ this.ptljurl() }else if(item.id==9){ this.downcyzyls() }else if(item.id==10){ this.cqzbdown() }else if(item.id==11){ this.ybxllymddown() } }, ybxllymddown(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { } axios({ method: 'get', url: '/www/public/download/xxgzzlly_byqybm_dc', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '样本校联络员名单.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败失败') } }) }, cqzbdown(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { schoolid : user.ID } axios({ method: 'get', url: '/www/public/shangbao/dccqzbzhff', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '【20241206】测前准备及参测师生账号分发说明(基教).pdf'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败失败') } }) }, downcyzyls(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} const params = { schoolid : user.ID } axios({ method: 'get', url: '/www/public/chouyang/sb-dczy', params, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', '抽样专业列表.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }) }, bjxxdown(activeName){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { } var url = '/www/public/shangbao/exportbj_new' var name = '班级信息.xls' axios({ method: 'get', url, params: { schoolid }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, xljkfzrdown(activeName){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var schoolid = user.ID const params = { } var url = '/www/public/shangbao/exportxxfzr' var name = '学校负责人登录账号.xls' axios({ method: 'get', url, params: { schoolid }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, ptljurl(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var xxjd = localStorage.getItem('xxjd') var schoolid = user.ID var type = '' if(['1'].includes(xxjd)){ type='1' }else if(['2','3','4'].includes(xxjd)){ type='2' }else if(['5','6'].includes(xxjd)){ type='3' } const params = { type } var url = '/www/public/shangbao/downloadUrl' var name = '全国学生心理健康监测与服务平台链接.url' axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, download(item){ var that = this let params = {} var name if(item.isupload=='1'){ params = { id :item.recordId, type:'2' } name = item.originFilename }else if(item.isupload=='2'){ params = { id :item.filetempid, type:'1' } name = item.filename } // window.open(item.file) axios({ method: 'get', url: '/www/public/shangbao/downloadtempFile', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ console.log(res,'res') let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('下载成功') }else{ this.$message.error('下载失败') } }) }, getFileTypeUrl(name){ var url = '' if(name){ var houzhui = this.gettype(name) if(houzhui=='pdf'){ url = '/content/image/xljkImg/pdf.png' }else if(houzhui=='xls'||houzhui=='xlsx'){ url = '/content/image/xljkImg/exceltubiao.png' }else if(houzhui=='jpg'||houzhui=='jpeg'||houzhui=='png'){ url = '/content/image/xljkImg/jpg.png' }else if(houzhui=='doc'||houzhui=='docx'){ url = '/content/image/xljkImg/word.png' }else{ url = '/content/image/xljkImg/qtwjlx.png' } } return url }, gettype(name){ var houzhui if(name){ var arr = name.split('.') houzhui = arr[1] } return houzhui }, getAccept(name){ var accept var houzhui = this.gettype(name) if(houzhui=='xls'||houzhui=='xlsx'){ accept = '.xls,.xlsx' }else if(houzhui=='doc'||houzhui=='docx'||houzhui=='pdf'||houzhui=='zip'){ accept = '.doc,.docx,.pdf,.zip,.rar' }else{ accept = '.zip,.rar' } return accept }, getList(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var type if(user.Roles.includes('450')){ var xd = localStorage.getItem('xxjd') if(['1','2','3','4'].includes(xd)){ type='1' }else{ type='2' } } const params = { type, } $.get("/www/public/shangbao/findfiletyperecord", params, function(res){ if(res.success==1){ console.log(res) that.loopData0 = res.data.filter(item=>item.sfsc=='0') //that.loopData1 = res.data.filter(item=>item.sfsc=='1') //that.loopData2 = res.data.filter(item=>item.sfsc=='2') //that.loopData4 = res.data.filter(item=>item.sfsc=='4') }else{ this.$message.success(res.message) } }).fail((xhr,status,error)=>{}) }, }, created: function(){ var that = this that.getList() }, computed:{ yuzhishuju(){ var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} var arr = [] if(user.Roles.includes('220')){ arr = [ //{name:'市、区、县管理员账号.xls',id:1,img:"/content/image/xljkImg/excellogo.png"}, //{name:'样本校名单及账号.xls',id:2,img:"/content/image/xljkImg/excellogo.png"}, //{name:'样本校抽样班级.xls',id:5,img:"/content/image/xljkImg/excellogo.png"}, //{name:'样本校联络员名单.xls',id:11,img:"/content/image/xljkImg/excellogo.png"}, ] }else if(user.Roles.includes('450')){ var xxjd = localStorage.getItem('xxjd') if(['1','2','3'].includes(xxjd)){ arr = [ // {name:'【20241206】测前准备及参测师生账号分发说明(基教).pdf',id:10,img:"/content/image/xljkImg/pdf.png"}, // {name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, //{name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测教师登录账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, // {name:'学校负责人登录账号.xls',id:8,img:"/content/image/xljkImg/excellogo.png"}, //{name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"} ] }else if(['5','6'].includes(xxjd)){ arr = [ // {name:'测前准备及参测师生账号分发说明.docx',id:10,img:"/content/image/xljkImg/word.png"}, // {name:'抽样专业下载.xls',id:9,img:"/content/image/xljkImg/excellogo.png"}, //{name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, // {name:'老师测评账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, //{name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"}, ] }else if(['4'].includes(xxjd)){ arr = [ // {name:'【20241206】测前准备及参测师生账号分发说明(基教).pdf',id:10,img:"/content/image/xljkImg/pdf.png"}, // {name:'抽样专业下载.xls',id:9,img:"/content/image/xljkImg/excellogo.png"}, // {name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测教师登录账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, // {name:'学校负责人登录账号.xls',id:8,img:"/content/image/xljkImg/excellogo.png"}, // {name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"}, ] }else{ arr = [ // {name:'测前准备及参测师生账号分发说明.docx',id:10,img:"/content/image/xljkImg/word.png"}, // {name:'参测学生登录账号.xls',id:3,img:"/content/image/xljkImg/excellogo.png"}, // {name:'参测教师登录账号.xls',id:4,img:"/content/image/xljkImg/excellogo.png"}, // {name:'抽样班级信息.xls',id:7,img:"/content/image/xljkImg/excellogo.png"}, // {name:'全国学生心理健康监测与服务平台链接.url',id:6,img:"/content/image/xljkImg/google.png"} ] } }else{ arr = [ // {name:'样本校抽样班级.xls',id:5,img:"/content/image/xljkImg/excellogo.png"}, ] } return arr } }, mounted: function(){ }, props: ['title', 'data', 'config'] }) }) })(template, resolve, reject); }); RegVueCom("xljk-ckbqxccbjmd-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n \n \n \n \n \n \n \n \n \n 查询\n 抽样班级导出\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n\n\n
\n \n
\n\n\n\n\n\n \n \n \n \n \n
\n \n \n
\n
\n
\n
"; return ( function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { events: [], // 学校数据 currentPage: 1, // 当前页码 pageSize: 10, // 每页条数 total: 0, // 总条数 search: { xxmc: '', xd: '' }, detailDialogVisible: false, currentRow: null, detailEvents: [], detailCurrentPage: 1, detailPageSize: 10, detailTotal: 0 }; }, methods: { bjxxdown() { var that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var schoolid = user.ID; const params = {}; var url = '/www/public/shangbao/exportbj_jd'; var name = '抽样班级.xls'; axios({ method: 'get', url, params: { code:user.Username.slice(-6) }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { console.log(res, 'res'); let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(可选) document.body.removeChild(aLink); this.$message.success('导出成功'); } else { this.$message.error('导出失败'); } }).catch(err => { this.$message.error('导出失败'); }); }, formatXd(row, column, cellValue) { const xdMap = { 1: '小学', 2: '初中', 3: '高中', 4: '中职', 5: '高职', 6: '高校' }; return xdMap[cellValue] || ''; }, fetchEvents() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; let params = { pageNo: this.currentPage, pageSize: this.pageSize, code: code, xd: this.search.xd, xxmc: this.search.xxmc }; // 调用查询接口 $.get("/www/public/bd/ccbjlist", params, function(res) { if (res.error == 0) { that.events = res.data; that.total = res.total; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleSizeChange(size) { this.pageSize = size; this.currentPage = 1; this.fetchEvents(); }, // 改变当前页 handleCurrentChange(page) { this.currentPage = page; this.fetchEvents(); }, // 查看详情 viewDetail(row) { this.currentRow = row; // 保存整行数据 this.detailDialogVisible = true; this.getDetailList(); }, closeDetailDialog() { this.detailDialogVisible = false; this.currentRow = null; this.detailEvents = []; }, handleDetailSizeChange(size) { this.detailPageSize = size; this.detailCurrentPage = 1; this.getDetailList(); }, handleDetailCurrentChange(page) { this.detailCurrentPage = page; this.getDetailList(); }, getDetailList() { if (!this.currentRow) return; const that = this; var params = { xxid: this.currentRow.id }; $.get('/www/public/bd/ccbjlistByxxid', params, function(res) { if (res.error == 0) { that.detailEvents = res.data; that.detailTotal = res.total || (res.data ? res.data.length : 0); } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); } }, created: function() { this.fetchEvents(); $.post("/www/public/bd/editjyjsfckccbj", {}, function(res){ if(res.error==0){ }else{ } }) } }); }); })(template, resolve, reject); }); RegVueCom("xljk-ckccbjmd-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n

'4'\" style=\"color:red;font-weight:600;font-size:18px;\" >\n 以下为参与本次测试的各专业年级人数,平台将按照每个年级的学生人数生成对应数量的学生测评账号\n

\n

\n 以下为参与本次测试的班级名单,平台将按照每个班级的学生人数生成对应数量的学生测评账号\n

\n '4'\" type=\"primary\" @click=\"bjxxdown()\">抽测专业信息下载\n 抽测班级信息下载\n
\n \n \n \n \n \n \n '4'\" show-overflow-tooltip prop=\"bjmc\" label=\"专业名称\" align=\"center\">\n \n \n \n \n \n \n \n
\n \n \n
\n \n
\n
\n
"; return ( function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { bjList: [], // 班级数据 currentPage: 1, // 当前页码 pageSize: 10, // 每页条数 total: 0, // 总条数 xxjd:'' }; }, methods: { fetchBjList() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; let params = { pageNo: this.currentPage, pageSize: this.pageSize }; // 调用查询接口 $.get("/www/public/shangbao/findbjinfoBycy", params, function(res) { if (res.error == 0) { that.bjList = res.data; that.total = res.total; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleSizeChange(size) { this.pageSize = size; this.currentPage = 1; this.fetchBjList(); }, // 改变当前页 handleCurrentChange(page) { this.currentPage = page; this.fetchBjList(); }, // 班级信息下载 bjxxdown() { var that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var schoolid = user.ID; const params = {}; var url = '/www/public/shangbao/exportbj_new'; var name if(that.xxjd > 4){ name='抽测专业信息.xls' }else{ name='抽测班级信息.xls' } axios({ method: 'get', url, params: { schoolid }, responseType: 'blob' }).then(res => { if (res.request.status == 200) { console.log(res, 'res'); let binaryData = []; binaryData.push(res.data); var url = window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download', name); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(可选) document.body.removeChild(aLink); this.$message.success('导出成功'); } else { this.$message.error('导出失败'); } }).catch(err => { this.$message.error('导出失败'); }); } }, created: function() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; that.xxjd=JSON.parse(localStorage.getItem('xxjd')) let params = { userid: user.ID, }; // 调用查询接口 $.post("/www/public/bd/sfckcybjedit", params, function(res) { if (res.error == 0) { } else { } }) that.fetchBjList(); } }); }); })(template, resolve, reject); }); RegVueCom("xljk-dcsbyjsjbg-view", function(resolve, reject){ var template = "
\n \t\n
\n \n \n\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 查询\n 表格导出\n \n
\n \n\n \n \n \n \n \n \n \n \n\n \n\n \n
\n \n \n \n \n\n \n
\n \n \n \n \n \n 查询\n 表格导出\n \n
\n \n\n \n \n \n \n \n \n\n \n\n \n
\n \n \n \n \n
\n\t\n\t\n \n \n \n \n \n \n \n \n \n \n
\n \n \n
\n
\n
"; return ( function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { user: {}, activeName: '1', events: [], // 应急事件数据(学校) currentPage: 1, // 当前页码 pageSize: 10, // 每页条数 total: 0, // 总条数 search: { xxmc: '', xd: '', yjsjsfscwc: '', sfzgx: '', zgdwmc: '' }, detailDialogVisible: false, currentRow: null, detailEvents: [], detailCurrentPage: 1, detailPageSize: 10, detailTotal: 0, eventsJyt: [], // 应急事件数据(学校) currentPageJyt: 1, // 当前页码 pageSizeJyt: 10, // 每页条数 totalJyt: 0, // 总条数 searchJyt: { jytmc: '', yjsjsfscwc: '' } }; }, methods: { allsend(){ var that = this this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 8, userid: this.user.ID } $.post("/www/public/bd/sendyjdcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, sendSms(row){ var that = this this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 8, userid: row.id // 学校id } $.post("/www/public/bd/senddcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, down(){ var that = this var code = this.user.Username ? this.user.Username.slice(-6) : ''; let params = { code: code, xxmc: this.search.xxmc, xd: this.search.xd, yjsjsfscwc: this.search.yjsjsfscwc, sfzgx: this.search.sfzgx }; let url = '/www/public/bd/yjsjbglistexport' if (this.activeName === '2') { // url = '/www/public/bd/yjsjjdckjytdc' url = '/www/public/bd/yjsjbglistjytexport' params.xxmc = this.searchJyt.jytmc params.yjsjsfscwc = this.searchJyt.yjsjsfscwc delete params.xd } axios({ method: 'get', url, params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download','表格信息.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, formatXd(row, column, cellValue) { const xdMap = { 1: '小学', 2: '初中', 3: '高中', 4: '中职', 5: '高职', 6: '高校' }; return xdMap[cellValue] || ''; }, formatStatus(row, column) { const value = row[column.property]; if (value === '2') { return '已完成'; } else if (value === '1') { return '未完成'; }else if (value === null) { return '未完成'; } return ''; }, fetchEvents() { const that = this; var code = this.user.Username ? this.user.Username.slice(-6) : ''; let params = { pageNo: this.currentPage, pageSize: this.pageSize, code: code, xxmc: this.search.xxmc, xd: this.search.xd, yjsjsfscwc: this.search.yjsjsfscwc, sfzgx: this.search.sfzgx, zgdwmc: this.search.zgdwmc }; // 调用查询接口 $.get('/www/public/bd/yjsjbglist', params , function(res) { if (res.error == 0) { that.events = res.data; that.total = res.total; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleSizeChange(size) { this.pageSize = size; this.currentPage = 1; this.fetchEvents(); }, // 改变当前页 handleCurrentChange(page) { this.currentPage = page; this.fetchEvents(); }, // 查看详情 viewDetail(row) { this.currentRow = row; // 保存整行数据 this.detailDialogVisible = true; this.getDetailList(); }, closeDetailDialog() { this.detailDialogVisible = false; this.currentRow = null; this.detailEvents = []; this.fetchEvents(); }, handleDetailSizeChange(size) { this.detailPageSize = size; this.detailCurrentPage = 1; this.getDetailList(); }, handleDetailCurrentChange(page) { this.detailCurrentPage = page; this.getDetailList(); }, getDetailList() { if (!this.currentRow) return; const that = this; var params = { pageNo: this.detailCurrentPage, pageSize: this.detailPageSize }; let url = '/www/public/bd/yjsjbgpage' if (this.activeName === '1') { params.userid = this.currentRow.id } else { url = '/www/public/bd/yjsjlbjyt' params.id = this.currentRow.id } $.get(url, params, function(res) { if (res.error == 0) { that.detailEvents = res.data.data; that.detailTotal = res.data.total; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, handleTabChange() { if (this.activeName === '1') { this.handleCurrentChange(1) } else { this.handleCurrentChangeJyt(1) } }, fetchEventsJyt() { const that = this; var code = this.user.Username ? this.user.Username.slice(-6) : ''; let params = { pageNo: this.currentPageJyt, pageSize: this.pageSizeJyt, code: code, xxmc: this.searchJyt.jytmc, yjsjsfscwc: this.searchJyt.yjsjsfscwc }; // 调用查询接口 $.get('/www/public/bd/yjsjbglistjyt', params , function(res) { if (res.error == 0) { that.eventsJyt = res.data; that.totalJyt = res.total; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleSizeChangeJyt(size) { this.pageSizeJyt = size; this.currentPageJyt = 1; this.fetchEventsJyt(); }, // 改变当前页 handleCurrentChangeJyt(page) { this.currentPageJyt = page; this.fetchEventsJyt(); }, sendSmsJyt(row) { var that = this this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 8, userid: row.id // 学校id } $.post("/www/public/bd/senddbsmsjyt", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, allsendJyt() { var that = this this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 8, userid: this.user.ID } $.post("/www/public/bd/sendyjdcsmsjyt", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, }, created: function() { this.user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.fetchEvents(); } }); }); })(template, resolve, reject); }); RegVueCom("xljk-tsqksm-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n 查询\n 表格导出\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n\n\n
\n \n\n
\n

学校如有特殊情况请填写

\n

{{detailData.sm}}

\n
\n \n 关闭\n \n
\n
\n\n\n
\n
"; return ( function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { events: [], // 应急事件数据 currentPage: 1, // 当前页码 pageSize: 10, // 每页条数 total: 0, // 总条数 search: { xxmc: '', xd: '', sftj: '' }, detailDialogVisible: false, detailData: { jy: '' } }; }, methods: { down(){ var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; const type = this.activeName === 'first' ? '1' : '2'; let params = { code: code, xxmc: this.search.xxmc, xd: this.search.xd, sftj: this.search.sftj }; /*const params = { //zgdwbm:user.ID, shzt:that.activeName=='first'?'0':this.activeName=='second'?'1':'-1', type, username:user.Username }*/ axios({ method: 'get', url:'/www/public/bd/tsqksmlistexport', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download','表格信息.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, formatXd(row, column, cellValue) { const xdMap = { 1: '小学', 2: '初中', 3: '高中', 4: '中职', 5: '高职', 6: '高校' }; return xdMap[cellValue] || ''; }, formatSftj(row, column, cellValue) { const sftjMap = { 1: '已提交', 0: '未提交', null: '未提交' }; return sftjMap[cellValue] || ''; }, fetchEvents() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; let params = { pageNo: this.currentPage, pageSize: this.pageSize, code: code, xxmc: this.search.xxmc, xd: this.search.xd, sftj: this.search.sftj }; // 调用查询接口 $.get("/www/public/bd/tsqksmlist",params , function(res) { if (res.error == 0) { that.events = res.data; that.total = res.total; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleSizeChange(size) { this.pageSize = size; this.currentPage = 1; this.fetchEvents(); }, // 改变当前页 handleCurrentChange(page) { this.currentPage = page; this.fetchEvents(); }, // 查看详情 viewDetail(row) { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; $.get("/www/public/bd/tsqksmfind", {userid: row.id}, function(res) { if (res.error == 0) { that.detailData = { sm: res.data.sm || '' }; that.detailDialogVisible = true; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); } }, created: function() { this.fetchEvents(); } }); }); })(template, resolve, reject); }); RegVueCom("xljk-dcsbybxscqksm-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 查询\n 表格导出\n 一键督办未完成直管校\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n\n\n
\n \n\n
\n

一、组织实施和测试过程中发现的问题及意见建议

\n

{{detailData.jy}}

\n \n

二、您认为还有哪些方面需要进一步改进和完善

\n

{{detailData.ws}}

\n
\n \n 关闭\n \n
\n
\n\n\n
\n
"; return (function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { events: [], // 应急事件数据 currentPage: 1, // 当前页码 pageSize: 10, // 每页条数 total: 0, // 总条数 search: { xxmc: '', xd: '', sftj: '', sfzgx: '', zgdwmc: '' }, detailDialogVisible: false, detailData: { jy: '', ws: '' } }; }, methods: { allsend(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 7, userid: user.ID } $.post("/www/public/bd/sendyjdcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, sendSms(row){ var that = this this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 7, userid: row.id // 学校id } $.post("/www/public/bd/senddcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, down(){ var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; const type = this.activeName === 'first' ? '1' : '2'; let params = { code: code, xxmc: this.search.xxmc, xd: this.search.xd, sftj: this.search.sftj, sfzgx:this.search.sfzgx }; /*const params = { //zgdwbm:user.ID, shzt:that.activeName=='first'?'0':this.activeName=='second'?'1':'-1', type, username:user.Username }*/ axios({ method: 'get', url:'/www/public/bd/ybxssqksmlistexport', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download','表格信息.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, formatXd(row, column, cellValue) { const xdMap = { 1: '小学', 2: '初中', 3: '高中', 4: '中职', 5: '高职', 6: '高校' }; return xdMap[cellValue] || ''; }, formatSftj(row, column, cellValue) { const sftjMap = { 2: '已提交', 1: '未提交', null:'未提交' }; return sftjMap[cellValue] || ''; }, fetchEvents() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; let params = { pageNo: this.currentPage, pageSize: this.pageSize, code: code, xxmc: this.search.xxmc, xd: this.search.xd, sftj: this.search.sftj, sfzgx:this.search.sfzgx, zgdwmc: this.search.zgdwmc }; // 调用查询接口 $.get("/www/public/bd/ybxssqksmlist",params , function(res) { if (res.error == 0) { that.events = res.data; that.total = res.total; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleSizeChange(size) { this.pageSize = size; this.currentPage = 1; this.fetchEvents(); }, // 改变当前页 handleCurrentChange(page) { this.currentPage = page; this.fetchEvents(); }, // 查看详情 viewDetail(row) { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; $.get("/www/public/bd/ybxssqksmfind", {userid: row.id}, function(res) { if (res.error == 0) { that.detailData = { jy: res.data.jy || '', ws: res.data.ws || '' }; that.detailDialogVisible = true; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); } }, created: function() { this.fetchEvents(); } }); }); })(template, resolve, reject); }); RegVueCom("xljk-dcybxtxcsgcjlb-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 查询\n 表格导出\n 一键督办还未提交的直管校\n
\n \n\n \n \n \n \n \n \n \n \n\n \n\n \n
\n \n \n
\n\n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n
\n
\n\n \n
\n \n
\n \n\n\n \n
\n
\n \n 测试信息\n
\n
\n
\n\n
\n
测试班级
\n
{{ fullDetailData.csbj || '-' }}
\n
\n
\n
开始时间
\n
{{ fullDetailData.cskssj || '-' }}
\n
\n
\n
结束时间
\n
{{ fullDetailData.csjssj || '-' }}
\n
\n
\n
\n
\n\n \n
\n
\n \n 人数统计\n
\n
\n
\n
\n
{{ fullDetailData.ycrs !== null && fullDetailData.ycrs !== undefined ? fullDetailData.ycrs : 0 }}
\n
应测人数
\n
\n
\n
{{ fullDetailData.scrs !== null && fullDetailData.scrs !== undefined ? fullDetailData.scrs : 0 }}
\n
实测人数
\n
\n\n
\n
{{ fullDetailData.qxrs !== null && fullDetailData.qxrs !== undefined ? fullDetailData.qxrs : 0 }}
\n
缺席人数
\n
\n
\n
\n
\n\n \n
\n
\n \n 学生测试详情\n
\n
\n
\n
\n
计算机和网络情况
\n
{{ (fullDetailData.sfjsjzc === '1' || fullDetailData.sfjsjzc === '存在问题') ? '存在问题' : (fullDetailData.sfjsjzc === '0' || fullDetailData.sfjsjzc === '正常') ? '正常' : (fullDetailData.sfjsjzc || '-') }}
\n
\n
\n
计算机网络问题详细说明
\n
{{ fullDetailData.jsjwlwtms || '-' }}
\n
\n
\n
纪律情况
\n
{{ (fullDetailData.jlqk === '1' || fullDetailData.jlqk === '存在问题') ? '存在问题' : (fullDetailData.jlqk === '0' || fullDetailData.jlqk === '正常') ? '正常' : (fullDetailData.jlqk || '-') }}
\n
\n
\n
纪律问题详细说明
\n
{{ fullDetailData.jlwtms || '-' }}
\n
\n
\n
特殊情况
\n
{{ (fullDetailData.tsqk === '1' || fullDetailData.tsqk === '有特殊情况') ? '有特殊情况' : (fullDetailData.tsqk === '0' || fullDetailData.tsqk === '无特殊情况') ? '无特殊情况' : (fullDetailData.tsqk || '-') }}
\n
\n
\n
特殊情况详细说明
\n
{{ fullDetailData.tsqkms || '-' }}
\n
\n
\n
测试问题疑问
\n
{{ (fullDetailData.qtqk === '1' || fullDetailData.qtqk === '有疑问') ? '有疑问' : (fullDetailData.qtqk === '0' || fullDetailData.qtqk === '无疑问') ? '无疑问' : (fullDetailData.qtqk || '-') }}
\n
\n
\n
疑问详细说明
\n
{{ fullDetailData.ywms || '-' }}
\n
\n
\n
缺席原因
\n
{{ fullDetailData.qtqxyy || '-' }}
\n
\n\n
\n
\n
\n\n \n
\n
\n \n 老师测试详情\n
\n
\n
\n
\n
事假人数
\n
{{ fullDetailData.sjrs !== null && fullDetailData.sjrs !== undefined ? fullDetailData.sjrs : '-' }}
\n
\n
\n
病假人数
\n
{{ fullDetailData.bjrs !== null && fullDetailData.bjrs !== undefined ? fullDetailData.bjrs : '-' }}
\n
\n
\n
其他情况
\n
{{ fullDetailData.qtqk || '-' }}
\n
\n
\n
题目理解情况
\n
{{ fullDetailData.ljqk || '-' }}
\n
\n
\n
\n
\n\n \n
\n
\n \n 其他信息\n
\n
\n
\n\n
\n
备注
\n
{{ fullDetailData.bz || '-' }}
\n
\n
\n
\n
\n
\n\n
\n
\n
\n\n\n
\n
"; return ( function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { events: [], // 应急事件数据 currentPage: 1, // 当前页码 pageSize: 10, // 每页条数 total: 0, // 总条数 search: { xxmc: '', xd: '', sfxsssfa: '', sflsssfa: '', sfzgx: '', zgdwmc: '' }, detailDialogVisible: false, fullDetailDialogVisible: false, currentRow: null, activeName: 'first', studentData: [], teacherData: [], detailCurrentPage: 1, detailPageSize: 10, detailTotal: 0, fullDetailData: {} }; }, methods: { allsend(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 6, userid: user.ID } $.post("/www/public/bd/sendyjdcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, sendSms(row){ var that = this this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 6, userid: row.id // 学校id } $.post("/www/public/bd/senddcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, down(){ var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; const type = this.activeName === 'first' ? '1' : '2'; let params = { code: code, xxmc: this.search.xxmc, xd: this.search.xd, sfxsssfa: this.search.sfxsssfa, sflsssfa: this.search.sflsssfa, sfzgx: this.search.sfzgx, zgdwmc: this.search.zgdwmc }; /*const params = { //zgdwbm:user.ID, shzt:that.activeName=='first'?'0':this.activeName=='second'?'1':'-1', type, username:user.Username }*/ axios({ method: 'get', url:'/www/public/bd/xscsgcjlbflistExport', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download','表格信息.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, formatXd(row, column, cellValue) { const xdMap = { 1: '小学', 2: '初中', 3: '高中', 4: '中职', 5: '高职', 6: '高校' }; return xdMap[cellValue] || ''; }, formatStatus(row, column) { const value = row[column.property]; if (value === '2') { return '已完成'; } else if (value === '1') { return '未完成'; } return ''; }, fetchEvents() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; let params = { pageNo: this.currentPage, pageSize: this.pageSize, code: code, xxmc: this.search.xxmc, xd: this.search.xd, sfxsssfa: this.search.sfxsssfa, sflsssfa: this.search.sflsssfa, sfzgx: this.search.sfzgx, zgdwmc: this.search.zgdwmc }; // 调用查询接口 $.get("/www/public/bd/xscsgcjlbflist",params , function(res) { if (res.error == 0) { that.events = res.data; that.total = res.total; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleSizeChange(size) { this.pageSize = size; this.currentPage = 1; this.fetchEvents(); }, // 改变当前页 handleCurrentChange(page) { this.currentPage = page; this.fetchEvents(); }, // 查看详情 viewDetail(row) { this.currentRow = row; // 保存整行数据 this.detailDialogVisible = true; this.getDetailList(); }, closeDetailDialog() { this.detailDialogVisible = false; this.currentXxid = null; this.activeName = 'first'; this.studentData = []; this.teacherData = []; this.fetchEvents(); }, handleTabClick() { this.detailCurrentPage = 1; this.getDetailList(); }, handleDetailSizeChange(size) { this.detailPageSize = size; this.detailCurrentPage = 1; this.getDetailList(); }, handleDetailCurrentChange(page) { this.detailCurrentPage = page; this.getDetailList(); }, getDetailList() { if (!this.currentRow) return; const that = this; const type = this.activeName === 'first' ? '1' : '2'; // 使用新的接口 const url = type === '1' ? '/www/public/bd/ywtdsjapbxs' : '/www/public/bd/ywtdsjapbls'; var params = { pageNo: this.detailCurrentPage, pageSize: this.detailPageSize, xxid: this.currentRow.id }; $.get(url, params, function(res) { if (res.success == 1) { if (type === '1') { that.studentData = res.data; } else { that.teacherData = res.data; } that.detailTotal = res.total; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, viewFullDetail(row) { const that = this; const type = this.activeName === 'first' ? '1' : '2'; // 使用新的详情接口 const url = type === '1' ? '/www/public/bd/csgcjlbxqxs' : '/www/public/bd/csgcjlbxqls'; var params = { id: row.id }; $.get(url, params, function(res) { if (res.success == 1) { that.fullDetailData = res.data; that.fullDetailData.type = type; // 添加类型标识 that.fullDetailDialogVisible = true; } else { that.$message.error(res.message || '获取详情失败'); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, closeFullDetailDialog() { this.fullDetailDialogVisible = false; this.fullDetailData = {}; } }, created: function() { this.fetchEvents(); } }); }); })(template, resolve, reject); }); RegVueCom("xljk-ckybxzbqkzc-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 查询\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n\n\n
\n \n\n
\n
\n {{ item.label }}\n \n \n {{ detailData[key] === '1' ? '已完成' : '未完成' }}\n \n
\n
\n \n 关闭\n \n
\n
\n\n\n
\n
"; return ( function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { events: [], // 应急事件数据 currentPage: 1, // 当前页码 pageSize: 10, // 每页条数 total: 0, // 总条数 search: { xxmc: '', xd: '', sftj: '' }, detailDialogVisible: false, detailData: {}, detailMapping: { rs: { label: '充分认识本次监测目的' }, xnpx: { label: '校内宣传培训' }, csgzpx: { label: '校内测试工作人员安排' }, jspx: { label: '参测教师安排' }, jfone: { label: '机房配备情况、联网自查、系统试用等' }, jftwo: { label: '学生测试机房已安排并贴好门签' }, jfthree: { label: '测试机房计算机数量满足要求' }, jffour: { label: '计算机联网正常并能登录测试系统' }, clone: { label: '每个参测班级的学生名册已打印' }, cltwo: { label: '每个参测班级的学生、教师登录账号已下载打印' }, clthree: { label: '《测试过程记录表》已打印' }, ya: { label: '已制定应急处置预案' } } }; }, methods: { allsend(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 5, userid: user.ID } $.post("/www/public/bd/sendyjdcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, sendSms(row){ var that = this this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 5, userid: row.id // 学校id } $.post("/www/public/bd/senddcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, down(){ var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; let params = { code: code, xxmc: this.search.xxmc, xd: this.search.xd, sftj: this.search.sftj }; /*const params = { //zgdwbm:user.ID, shzt:that.activeName=='first'?'0':this.activeName=='second'?'1':'-1', type, username:user.Username }*/ axios({ method: 'get', url:'/www/public/bd/ybxcszbgzzcqdlistExport', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download','表格信息.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, formatXd(row, column, cellValue) { const xdMap = { 1: '小学', 2: '初中', 3: '高中', 4: '中职', 5: '高职', 6: '高校' }; return xdMap[cellValue] || ''; }, formatSftj(row, column, cellValue) { const sftjMap = { 2: '已完成', 1: '已提交未完成', 0: '未提交', null: '未提交', }; return sftjMap[cellValue] || ''; }, fetchEvents() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; let params = { pageNo: this.currentPage, pageSize: this.pageSize, code: code, xxmc: this.search.xxmc, xd: this.search.xd, sftj: this.search.sftj }; // 调用查询接口 $.get("/www/public/sdy/sdydzgxxlb",params , function(res) { if (res.error == 0) { that.events = res.data; that.total = res.total; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleSizeChange(size) { this.pageSize = size; this.currentPage = 1; this.fetchEvents(); }, // 改变当前页 handleCurrentChange(page) { this.currentPage = page; this.fetchEvents(); }, // 查看详情 viewDetail(row) { const that = this; $.get("/www/public/bd/ybxcszbgzzcqdfind", {userid: row.id}, function(res) { if (res.error == 0) { that.detailData = res.data; that.detailDialogVisible = true; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); } }, created: function() { this.fetchEvents(); } }); }); })(template, resolve, reject); }); RegVueCom("xljk-dcybxjxzbqkzc-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 查询\n 表格导出\n 一键督办未完成直管校\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n\n\n
\n \n\n
\n
\n {{ item.label }}\n \n \n {{ detailData[key] === '1' ? '已完成' : '未完成' }}\n \n
\n
\n \n 关闭\n \n
\n
\n\n\n
\n
"; return (function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { events: [], // 应急事件数据 currentPage: 1, // 当前页码 pageSize: 10, // 每页条数 total: 0, // 总条数 sfnmlc:'', search: { xxmc: '', xd: '', sftj: '', sfzgx: '', zgdwmc: '' }, detailDialogVisible: false, detailData: {}, detailMapping: {}, detailMappingSchool: { rs: { label: '充分认识本次监测目的是为了客观反映我国中小学生的心理健康状况及重要影响因素' }, xnpx: { label: '校内宣传培训:已经开展校内监测工作动员和现场操作程序与规范培训' }, csgzpx: { label: '校内测试工作人员:根据本校测试安排,按要求选派校内测试工作人员' }, ccjs: { label: '参测教师:参测教师名单正确,且已经开会动员参测教师认真作答' }, jspx: { label: '参测学生:上报参测班级学生数量符合实际情况,无漏报、瞒报情况' }, jfone: { label: '机房配备情况、联网自查、答题测试等' }, jftwo: { label: '学生测试机房已经安排好' }, jfthree: { label: '测试机房的计算机数量能够容纳参测班级最大班额人数' }, jffour: { label: '计算机能联网正常运转,能打开学生测试系统' }, clone: { label: '每个参测班级的学生名册已经打印' }, cltwo: { label: '每个参测班级的学生登录账号、教师登录账号已经下载并打印' }, clthree: { label: '下载并打印《测试过程记录表》,每个学生测试场次各打印1份' }, ya: { label: '学校针对学生突发不适、学校停电、断网、计算机出问题等影响网络测试的情况,已经制订好应急处置预案' } }, detailMappingCollege: { rs: { label: '充分认识本次监测目的是为了客观反映我国大学生的心理健康状况及重要影响因素' }, xnpx: { label: '校内培训:已经开展校内监测工作动员和现场操作程序与规范培训' }, csgzpx: { label: '校内测试工作人员:根据本校测试安排,按要求选派校内测试工作人员' }, ccjs: { label: '参测教师:参测教师名单正确,且已经动员参测教师认真作答' }, jspx: { label: '参测学生:上报抽测专业的参测学生数量符合实际情况,无漏报、瞒报情况' }, jfone: { label: '教室配备情况、联网自查、答题测试等' }, jftwo: { label: '学生测试教室已经安排好' }, jfthree: { label: '测试教室能够容纳每个测试场次的人数' }, jffour: { label: '测试教室无线网络正常,能打开学生测试系统' }, clone: { label: '每个测试场次的参测学生名册已经打印' }, cltwo: { label: '每个测试场次的学生登录账号已经下载并打印' }, clthree: { label: '下载并打印《测试过程记录表》,每个学生测试场次打印1份' }, ya: { label: '学校针对学生突发不适、学校停电、断网、计算机出问题等影响网络测试的情况,已经制订好应急处置预案' } } }; }, methods: { allsend(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 5, userid: user.ID } $.post("/www/public/bd/sendyjdcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, sendSms(row){ var that = this this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 5, userid: row.id // 学校id } $.post("/www/public/bd/senddcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, down(){ var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; let params = { code: code, xxmc: this.search.xxmc, xd: this.search.xd, sftj: this.search.sftj, sfzgx: this.search.sfzgx }; /*const params = { //zgdwbm:user.ID, shzt:that.activeName=='first'?'0':this.activeName=='second'?'1':'-1', type, username:user.Username }*/ axios({ method: 'get', url:'/www/public/bd/ybxcszbgzzcqdlistExport', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download','表格信息.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, formatXd(row, column, cellValue) { const xdMap = { 1: '小学', 2: '初中', 3: '高中', 4: '中职', 5: '高职', 6: '高校' }; return xdMap[cellValue] || ''; }, formatSftj(row, column, cellValue) { const sftjMap = { 2: '已完成', 1: '已提交未完成', 0: '未提交', null: '未提交', }; return sftjMap[cellValue] || ''; }, fetchEvents() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; let params = { pageNo: this.currentPage, pageSize: this.pageSize, code: code, xxmc: this.search.xxmc, xd: this.search.xd, sftj: this.search.sftj, sfzgx: this.search.sfzgx, zgdwmc: this.search.zgdwmc }; // 调用查询接口 $.get("/www/public/bd/ybxcszbgzzcqdlist",params , function(res) { if (res.error == 0) { that.events = res.data; that.total = res.total; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleSizeChange(size) { this.pageSize = size; this.currentPage = 1; this.fetchEvents(); }, // 改变当前页 handleCurrentChange(page) { this.currentPage = page; this.fetchEvents(); }, // 查看详情 viewDetail(row) { const that = this; $.get("/www/public/bd/ybxcszbgzzcqdfind", {userid: row.id}, function(res) { if (res.error == 0) { that.detailData = res.data; // 根据学段选择正确的detailMapping if (row.xd >= 5) { // 高职和高校使用大学生版本 that.detailMapping = that.detailMappingCollege; } else { // 其他学段使用中小学版本 that.detailMapping = that.detailMappingSchool; } that.detailDialogVisible = true; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); } }, created: function() { this.fetchEvents(); this.sfnmlc = JSON.parse(localStorage.getItem('sfnmlc')) } }); }); })(template, resolve, reject); }); RegVueCom("xljk-dcybxkzcz-view", function(resolve, reject){ var template = "
\n \n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n 查询\n 表格导出\n 一键督办未完成直管校\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n\n\n
\n \n\n
\n
\n

签到表照片

\n \n \n
\n
\n

现场照片

\n \n \n
\n
\n \n 关闭\n \n
\n
\n\n\n
\n
"; return (function(template, resolve, reject) { seajs.use([], function() { return resolve({ template: template, data: function() { return { events: [], // 应急事件数据 currentPage: 1, // 当前页码 pageSize: 10, // 每页条数 total: 0, // 总条数 search: { xxmc: '', xd: '', sfqdb: '', sfhy: '', sfzgx: '', zgdwmc: '' }, detailDialogVisible: false, detailData: { qdbimg: '', hyimg: '' } }; }, methods: { allsend(){ var that = this var user = localStorage.getItem('user')?JSON.parse(localStorage.getItem('user')):{} this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 4, userid: user.ID } $.post("/www/public/bd/sendyjdcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, sendSms(row){ var that = this this.$confirm('确定发送督办短信吗?', '确认发送', { confirmButtonText: '确定发送', cancelButtonText: '取消', type: 'warning' }).then(() => { let data = { type: 4, userid: row.id // 学校id } $.post("/www/public/bd/senddcsms", data, function(res){ if(res.error == 0){ that.$message.success('督办短信发送成功') }else{ that.$message.error(res.message || '督办短信发送失败') } }) }).catch(() => { that.$message.info('已取消发送') }) }, down(){ var that = this var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; let params = { code: code, xxmc: this.search.xxmc, xd: this.search.xd, sfqdb: this.search.sfqdb, sfhy: this.search.sfhy, sfzgx: this.search.sfzgx }; /*const params = { //zgdwbm:user.ID, shzt:that.activeName=='first'?'0':this.activeName=='second'?'1':'-1', type, username:user.Username }*/ axios({ method: 'get', url:'/www/public/bd/hysclistexport', params: { ...params }, responseType: 'blob' }).then(res=>{ if(res.request.status==200){ let data = res.data let binaryData = []; binaryData.push(res.data); var url= window.URL.createObjectURL(new Blob(binaryData)); var aLink = document.createElement('a'); aLink.href = url; aLink.setAttribute('download','表格信息.xls'); // 设置下载的文件名 // 将a标签添加到DOM中并模拟点击事件以开始下载 document.body.appendChild(aLink); aLink.click(); // 下载完成后移除a标签元素(‌可选)‌ document.body.removeChild(aLink); this.$message.success('导出成功') }else{ this.$message.error('导出失败') } }).catch(err=>{ this.$message.error('导出失败') }) }, formatXd(row, column, cellValue) { const xdMap = { 1: '小学', 2: '初中', 3: '高中', 4: '中职', 5: '高职', 6: '高校' }; return xdMap[cellValue] || ''; }, fetchEvents() { const that = this; var user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}; var code = user.Username ? user.Username.slice(-6) : ''; let params = { pageNo: this.currentPage, pageSize: this.pageSize, code: code, xxmc: this.search.xxmc, xd: this.search.xd, sfqdb: this.search.sfqdb, sfhy: this.search.sfhy, sfzgx: this.search.sfzgx, zgdwmc: this.search.zgdwmc }; // 调用查询接口 $.get("/www/public/bd/hysclist",params , function(res) { if (res.error == 0) { that.events = res.data; that.total = res.total; } else { that.$message.error(res.message); } }).fail(function() { that.$message.error('请求失败,请检查网络连接'); }); }, // 改变每页数量 handleSizeChange(size) { this.pageSize = size; this.currentPage = 1; this.fetchEvents(); }, // 改变当前页 handleCurrentChange(page) { this.currentPage = page; this.fetchEvents(); }, // 查看详情 viewDetail(row) { let qdbimgUrl = ''; if (row.qdbimg) { qdbimgUrl = '/www/public/bd/hyimghx?id=' + row.hyid + '&type=2'; } let hyimgUrl = ''; if (row.hyimg) { hyimgUrl = '/www/public/bd/hyimghx?id=' + row.hyid + '&type=1'; } this.detailData = { qdbimg: qdbimgUrl, hyimg: hyimgUrl }; this.detailDialogVisible = true; } }, created: function() { this.fetchEvents(); } }); }); })(template, resolve, reject); }); RegVueCom("xljk-dcybxwcssfa-view", function(resolve, reject){ var template = "
\n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 查询\n 表格导出\n 一键督办还未提交的直管校\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n\n\n
\n
\n \n \n
\n \n \n \n \n \n 查询\n 表格导出\n 一键督办还未提交的直管校\n
\n \n \n \n \n \n \n \n \n \n
\n \n \n
\n
\n
\n \n\n
\n \n \n \n \n \n \n