|
@@ -1,253 +1,293 @@
|
|
|
<template>
|
|
|
- <!-- 测试上传组件 -->
|
|
|
- <div v-loading="loading" id="MakerActivityWord">
|
|
|
- <div class="pAHeader">
|
|
|
- <div class="pAHeader1">创客活动申请</div>
|
|
|
- </div>
|
|
|
- <hr>
|
|
|
- <!-- 创客专项资金及项目申请表(创客活动) -->
|
|
|
- <markeractivityWord :wordData="wordData" :total="total"/>
|
|
|
- <div style="position: fixed;bottom: 5%;right: 2%;">
|
|
|
- <el-button type="primary" @click="test">提交活动</el-button>
|
|
|
- </div>
|
|
|
- <el-dialog
|
|
|
- title="提示"
|
|
|
- :visible.sync="submitHint"
|
|
|
- width="600px"
|
|
|
- class="pageSubmitData">
|
|
|
-
|
|
|
- <div class="deleteContent">确定提交“{{wordData['activityName']}}”创客活动吗?</div>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="applyActivity" class="AllDialogBtn">确认提交</el-button>
|
|
|
- <el-button @click="submitHint=false" class="AllDialogBtn">取消</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
+ <!-- 测试上传组件 -->
|
|
|
+ <div v-loading="loading" id="MakerActivityWord">
|
|
|
+ <div class="pAHeader">
|
|
|
+ <div class="pAHeader1">创客活动申请</div>
|
|
|
+ </div>
|
|
|
+ <hr />
|
|
|
+ <!-- 创客专项资金及项目申请表(创客活动) -->
|
|
|
+ <markeractivityWord :wordData="wordData" :total="total" />
|
|
|
+ <div style="position: fixed; bottom: 5%; right: 2%">
|
|
|
+ <el-button type="primary" @click="test">提交活动</el-button>
|
|
|
</div>
|
|
|
- </template>
|
|
|
-
|
|
|
- <script>
|
|
|
- import markeractivityWord from './components/markeractivityWord.vue';
|
|
|
- import {getNowDate} from '@/components/tool/Date.js'
|
|
|
- import getProjectNo from '@/components/tool/getProjectNo';
|
|
|
- export default {
|
|
|
- components: {
|
|
|
- markeractivityWord
|
|
|
+ <el-dialog
|
|
|
+ title="提示"
|
|
|
+ :visible.sync="submitHint"
|
|
|
+ width="600px"
|
|
|
+ class="pageSubmitData"
|
|
|
+ >
|
|
|
+ <div class="deleteContent">
|
|
|
+ 确定提交“{{ wordData["activityName"] }}”创客活动吗?
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="applyActivity" class="AllDialogBtn"
|
|
|
+ >确认提交</el-button
|
|
|
+ >
|
|
|
+ <el-button @click="submitHint = false" class="AllDialogBtn"
|
|
|
+ >取消</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import markeractivityWord from "./components/markeractivityWord.vue";
|
|
|
+import { getNowDate } from "@/components/tool/Date.js";
|
|
|
+import getProjectNo from "@/components/tool/getProjectNo";
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ markeractivityWord,
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ loading: false,
|
|
|
+ submitHint: false,
|
|
|
+ wordData: {
|
|
|
+ applicationDate: getNowDate(1), //申请日期
|
|
|
+ associatedProjects: "", //关联项目
|
|
|
+ activityName: "", //项目名称
|
|
|
+ pro_leader: "", //活动负责人
|
|
|
+ college: "", //所在学院
|
|
|
+ tel: "", //联系电话
|
|
|
+ activityTime: [], //活动时间
|
|
|
+ student: 0, //参与学生人数
|
|
|
+ member: [
|
|
|
+ { name: "", collage: "", work: "" },
|
|
|
+ { name: "", collage: "", work: "" },
|
|
|
+ { name: "", collage: "", work: "" },
|
|
|
+ ],
|
|
|
+ activityPlan: "", //活动计划
|
|
|
+ expectations: "", //预期目标
|
|
|
+ eventAudience: "", //活动受众面
|
|
|
+ fundingPlan: "", //经费支出计划
|
|
|
+ expenditureMothPlan: ["", "", "", "", "", "", "", "", "", "", "", ""],
|
|
|
+ fund: {
|
|
|
+ device: "",
|
|
|
+ Material: "",
|
|
|
+ processing: "",
|
|
|
+ Collaboration: "",
|
|
|
+ APPRAISAL: "",
|
|
|
+ entery: "",
|
|
|
+ activities: "",
|
|
|
+ Transaction: "",
|
|
|
+ }, //预算经费
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ total() {
|
|
|
+ let num = 0;
|
|
|
+ for (let i in this.wordData["fund"])
|
|
|
+ num += Number(this.wordData["fund"][i]);
|
|
|
+ return num;
|
|
|
},
|
|
|
- data() {
|
|
|
- return {
|
|
|
- loading:false,
|
|
|
- submitHint:false,
|
|
|
- wordData:{
|
|
|
- applicationDate:getNowDate(1),//申请日期
|
|
|
- associatedProjects:"",//关联项目
|
|
|
- activityName:'',//项目名称
|
|
|
- pro_leader:"",//活动负责人
|
|
|
- college: '',//所在学院
|
|
|
- tel:'',//联系电话
|
|
|
- activityTime:[],//活动时间
|
|
|
- student:0,//参与学生人数
|
|
|
- member:[
|
|
|
- {name:"",collage:"",work:""},
|
|
|
- {name:"",collage:"",work:""},
|
|
|
- {name:"",collage:"",work:""},
|
|
|
- ],
|
|
|
- activityPlan:"",//活动计划
|
|
|
- expectations:"",//预期目标
|
|
|
- eventAudience:"",//活动受众面
|
|
|
- fundingPlan:"",//经费支出计划
|
|
|
- expenditureMothPlan:['','','','','','','','','','','',''],
|
|
|
- fund:{
|
|
|
- device:"",
|
|
|
- Material:"",
|
|
|
- processing:"",
|
|
|
- Collaboration:"",
|
|
|
- APPRAISAL:"",
|
|
|
- entery:"",
|
|
|
- activities:"",
|
|
|
- Transaction:"",
|
|
|
- },//预算经费
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // changeFund(newFund){
|
|
|
+ // this.wordData['allFund'] = newFund;
|
|
|
+ // },
|
|
|
+ test() {
|
|
|
+ const cEmpty = /^\s*$/g;
|
|
|
+ const checkPhone =
|
|
|
+ /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/; //获取正则表达式 存放到verify变量中
|
|
|
+ for (let i in this.wordData) {
|
|
|
+ switch (i) {
|
|
|
+ // case "associatedProjects":
|
|
|
+ // if(cEmpty.test(this.wordData[i])){
|
|
|
+ // this.$message.error("请选择关联项目")
|
|
|
+ // document.querySelector('#one').scrollIntoView({ behavior: "smooth" });
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // break;
|
|
|
+ case "activityName":
|
|
|
+ if (cEmpty.test(this.wordData[i])) {
|
|
|
+ this.$message.error("请输入活动名称");
|
|
|
+ document
|
|
|
+ .querySelector("#two")
|
|
|
+ .scrollIntoView({ behavior: "smooth" });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "pro_leader":
|
|
|
+ if (cEmpty.test(this.wordData[i])) {
|
|
|
+ this.$message.error("请输入活动负责人");
|
|
|
+ document
|
|
|
+ .querySelector("#three")
|
|
|
+ .scrollIntoView({ behavior: "smooth" });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "college":
|
|
|
+ if (cEmpty.test(this.wordData[i])) {
|
|
|
+ this.$message.error("请选择所在学院");
|
|
|
+ document
|
|
|
+ .querySelector("#three")
|
|
|
+ .scrollIntoView({ behavior: "smooth" });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "tel":
|
|
|
+ if (cEmpty.test(this.wordData[i])) {
|
|
|
+ this.$message.error("请输入联系电话");
|
|
|
+ document
|
|
|
+ .querySelector("#three")
|
|
|
+ .scrollIntoView({ behavior: "smooth" });
|
|
|
+ return false;
|
|
|
+ } else if (!checkPhone.test(this.wordData[i])) {
|
|
|
+ this.$message.error("请输入正确的手机号");
|
|
|
+ document
|
|
|
+ .querySelector("#three")
|
|
|
+ .scrollIntoView({ behavior: "smooth" });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "activityTime":
|
|
|
+ if (this.wordData[i].length <= 0) {
|
|
|
+ this.$message.error("请选择活动时间");
|
|
|
+ document
|
|
|
+ .querySelector("#four")
|
|
|
+ .scrollIntoView({ behavior: "smooth" });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "allFund":
|
|
|
+ console.log(11111);
|
|
|
+ if (this.total <= 0) {
|
|
|
+ this.$message.error("请输入预算经费");
|
|
|
+ document
|
|
|
+ .querySelector("#fund")
|
|
|
+ .scrollIntoView({ behavior: "smooth" });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ // case "member":
|
|
|
+ // let num = 0;
|
|
|
+ // this.wordData[i].forEach(item=>{
|
|
|
+ // if(cEmpty.test(item['name']))num++;
|
|
|
+ // // for(let j in item){
|
|
|
+ // // if(cEmpty.test(item[j])){
|
|
|
+ // // num++;
|
|
|
+ // // }
|
|
|
+ // // }
|
|
|
+
|
|
|
+ // })
|
|
|
+ // if(num>0){
|
|
|
+ // this.$message.error("指导老师姓名不能为空");
|
|
|
+ // document.querySelector('#five').scrollIntoView({ behavior: "smooth" });
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // break;
|
|
|
+ // case "activityPlan":
|
|
|
+ // if(cEmpty.test(this.wordData[i][0])){
|
|
|
+ // this.$message.error("请输入活动计划");
|
|
|
+ // document.querySelector('#six').scrollIntoView({ behavior: "smooth" });
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // break;
|
|
|
+ // case "expectations":
|
|
|
+ // if(cEmpty.test(this.wordData[i][0])){
|
|
|
+ // this.$message.error("预期目标");
|
|
|
+ // document.querySelector('#seven').scrollIntoView({ behavior: "smooth" });
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // break;
|
|
|
+ // case "eventAudience":
|
|
|
+ // if(cEmpty.test(this.wordData[i][0])){
|
|
|
+ // this.$message.error("活动受众面")
|
|
|
+ // document.querySelector('#nine').scrollIntoView({ behavior: "smooth" });
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // break;
|
|
|
+ // case "fundingPlan":
|
|
|
+ // if(cEmpty.test(this.wordData[i][0])){
|
|
|
+ // this.$message.error("经费支出计划")
|
|
|
+ // document.querySelector('#ten').scrollIntoView({ behavior: "smooth" });
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // break;
|
|
|
}
|
|
|
- };
|
|
|
- },
|
|
|
- computed:{
|
|
|
- total() {
|
|
|
- let num = 0;
|
|
|
- for(let i in this.wordData['fund'])num += Number(this.wordData['fund'][i]);
|
|
|
- return num;
|
|
|
- }
|
|
|
+ }
|
|
|
+ // if()
|
|
|
+ this.submitHint = true;
|
|
|
},
|
|
|
- methods: {
|
|
|
- // changeFund(newFund){
|
|
|
- // this.wordData['allFund'] = newFund;
|
|
|
- // },
|
|
|
- test(){
|
|
|
- const cEmpty = /^\s*$/g;
|
|
|
- const checkPhone = /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/; //获取正则表达式 存放到verify变量中
|
|
|
- for(let i in this.wordData){
|
|
|
- switch(i){
|
|
|
- // case "associatedProjects":
|
|
|
- // if(cEmpty.test(this.wordData[i])){
|
|
|
- // this.$message.error("请选择关联项目")
|
|
|
- // document.querySelector('#one').scrollIntoView({ behavior: "smooth" });
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // break;
|
|
|
- case "activityName":
|
|
|
- if(cEmpty.test(this.wordData[i])){
|
|
|
- this.$message.error("请输入活动名称")
|
|
|
- document.querySelector('#two').scrollIntoView({ behavior: "smooth" });
|
|
|
- return false;
|
|
|
- }
|
|
|
- break;
|
|
|
- case "pro_leader":
|
|
|
- if(cEmpty.test(this.wordData[i])){
|
|
|
- this.$message.error("请输入活动负责人")
|
|
|
- document.querySelector('#three').scrollIntoView({ behavior: "smooth" });
|
|
|
- return false;
|
|
|
- }
|
|
|
- break;
|
|
|
- case "college":
|
|
|
- if(cEmpty.test(this.wordData[i])){
|
|
|
- this.$message.error("请选择所在学院")
|
|
|
- document.querySelector('#three').scrollIntoView({ behavior: "smooth" });
|
|
|
- return false;;
|
|
|
- }
|
|
|
- break;
|
|
|
- case "tel":
|
|
|
- if(cEmpty.test(this.wordData[i])){
|
|
|
- this.$message.error("请输入联系电话")
|
|
|
- document.querySelector('#three').scrollIntoView({ behavior: "smooth" });
|
|
|
- return false;
|
|
|
- }else if(!checkPhone.test(this.wordData[i])){
|
|
|
- this.$message.error("请输入正确的手机号");
|
|
|
- document.querySelector('#three').scrollIntoView({ behavior: "smooth" });
|
|
|
- return false;
|
|
|
- }
|
|
|
- break;
|
|
|
- case "activityTime":
|
|
|
- if(this.wordData[i].length<=0){
|
|
|
- this.$message.error("请选择活动时间")
|
|
|
- document.querySelector('#four').scrollIntoView({ behavior: "smooth" });
|
|
|
- return false;;
|
|
|
- }
|
|
|
- break;
|
|
|
- case "allFund":
|
|
|
- console.log(11111)
|
|
|
- if(this.total<=0){
|
|
|
- this.$message.error('请输入预算经费')
|
|
|
- document.querySelector('#fund').scrollIntoView({ behavior: "smooth" });
|
|
|
- return false;
|
|
|
- }
|
|
|
- break;
|
|
|
- // case "member":
|
|
|
- // let num = 0;
|
|
|
- // this.wordData[i].forEach(item=>{
|
|
|
- // if(cEmpty.test(item['name']))num++;
|
|
|
- // // for(let j in item){
|
|
|
- // // if(cEmpty.test(item[j])){
|
|
|
- // // num++;
|
|
|
- // // }
|
|
|
- // // }
|
|
|
-
|
|
|
- // })
|
|
|
- // if(num>0){
|
|
|
- // this.$message.error("指导老师姓名不能为空");
|
|
|
- // document.querySelector('#five').scrollIntoView({ behavior: "smooth" });
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // break;
|
|
|
- // case "activityPlan":
|
|
|
- // if(cEmpty.test(this.wordData[i][0])){
|
|
|
- // this.$message.error("请输入活动计划");
|
|
|
- // document.querySelector('#six').scrollIntoView({ behavior: "smooth" });
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // break;
|
|
|
- // case "expectations":
|
|
|
- // if(cEmpty.test(this.wordData[i][0])){
|
|
|
- // this.$message.error("预期目标");
|
|
|
- // document.querySelector('#seven').scrollIntoView({ behavior: "smooth" });
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // break;
|
|
|
- // case "eventAudience":
|
|
|
- // if(cEmpty.test(this.wordData[i][0])){
|
|
|
- // this.$message.error("活动受众面")
|
|
|
- // document.querySelector('#nine').scrollIntoView({ behavior: "smooth" });
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // break;
|
|
|
- // case "fundingPlan":
|
|
|
- // if(cEmpty.test(this.wordData[i][0])){
|
|
|
- // this.$message.error("经费支出计划")
|
|
|
- // document.querySelector('#ten').scrollIntoView({ behavior: "smooth" });
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // break;
|
|
|
- }
|
|
|
- }
|
|
|
- // if()
|
|
|
- this.submitHint = true;
|
|
|
- },
|
|
|
- applyActivity(){
|
|
|
- getProjectNo("HD").then(result=>{
|
|
|
- let pram = {
|
|
|
- uid:this.$store.state.userInfo.userid,//用户ID
|
|
|
- aNo:result,//活动编号
|
|
|
- tit:this.wordData['activityName'],//活动名称
|
|
|
- courseId:this.wordData['associatedProjects'],//关联项目ID
|
|
|
- pLeader:this.wordData['pro_leader'],//活动负责人
|
|
|
- mon:this.total,//预算经费
|
|
|
- st:this.wordData['student'],//参与学生人数
|
|
|
- ct:JSON.stringify(this.wordData['member']),//活动指导老师
|
|
|
- chp:JSON.stringify({
|
|
|
- activityPlan:this.wordData['activityName'],//活动计划
|
|
|
- expectations:this.wordData['expectations'],//预期目标
|
|
|
- eventAudience:this.wordData['eventAudience'],//活动受众面
|
|
|
- fundingPlan:this.wordData['fundingPlan'],//经费支出计划
|
|
|
- }),//活动信息
|
|
|
- cid:this.wordData['college'],//学院ID,
|
|
|
- ph:this.wordData['tel'],//联系电话
|
|
|
- beg:JSON.stringify(this.wordData['activityTime']),//活动时间
|
|
|
- f:JSON.stringify(this.wordData['fund']),//预算经费明细
|
|
|
- appltTime:this.wordData['applicationDate'],//申请日期
|
|
|
- mp:JSON.stringify(this.wordData['expenditureMothPlan']),
|
|
|
- t:this.wordData['associatedProjects']!=''?0:1,//活动分类 0 创客活动
|
|
|
- }
|
|
|
- this.ajax.post(this.$store.state.api+'/ActivityApply',pram).then(result=>{
|
|
|
- if(result['data']==1){
|
|
|
+ applyActivity() {
|
|
|
+ getProjectNo("HD").then((result) => {
|
|
|
+ let pram = {
|
|
|
+ uid: this.$store.state.userInfo.userid, //用户ID
|
|
|
+ aNo: result, //活动编号
|
|
|
+ tit: this.wordData["activityName"], //活动名称
|
|
|
+ courseId: this.wordData["associatedProjects"], //关联项目ID
|
|
|
+ pLeader: this.wordData["pro_leader"], //活动负责人
|
|
|
+ mon: this.total, //预算经费
|
|
|
+ st: this.wordData["student"], //参与学生人数
|
|
|
+ ct: JSON.stringify(this.wordData["member"]), //活动指导老师
|
|
|
+ chp: JSON.stringify({
|
|
|
+ activityPlan: this.wordData["activityName"], //活动计划
|
|
|
+ expectations: this.wordData["expectations"], //预期目标
|
|
|
+ eventAudience: this.wordData["eventAudience"], //活动受众面
|
|
|
+ fundingPlan: this.wordData["fundingPlan"], //经费支出计划
|
|
|
+ }), //活动信息
|
|
|
+ cid: this.wordData["college"], //学院ID,
|
|
|
+ ph: this.wordData["tel"], //联系电话
|
|
|
+ beg: JSON.stringify(this.wordData["activityTime"]), //活动时间
|
|
|
+ f: JSON.stringify(this.wordData["fund"]), //预算经费明细
|
|
|
+ appltTime: this.wordData["applicationDate"], //申请日期
|
|
|
+ mp: JSON.stringify(this.wordData["expenditureMothPlan"]),
|
|
|
+ t: this.wordData["associatedProjects"] != "" ? 0 : 1, //活动分类 0 创客活动
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .post(this.$store.state.api + "/ActivityApply", pram)
|
|
|
+ .then((result) => {
|
|
|
+ if (result["data"] == 1) {
|
|
|
this.$message.success("活动提交成功");
|
|
|
//提交项目成功,查看sessionStore是否有数据,有则删
|
|
|
- if(sessionStorage.getItem("makerActivityApplyData"))sessionStorage.removeItem('makerActivityApplyData');
|
|
|
- this.$router.push('/makerActvity');
|
|
|
- }else{
|
|
|
- this.$message.error("活动提交失败")
|
|
|
+ if (localStorage.getItem("makerActivityApplyData"))
|
|
|
+ localStorage.removeItem("makerActivityApplyData");
|
|
|
+ this.$router.push("/makerActvity");
|
|
|
+ } else {
|
|
|
+ this.$message.error("活动提交失败");
|
|
|
}
|
|
|
- }).catch(err=>{
|
|
|
- console.log(err)
|
|
|
})
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
- },
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
- mounted(){ //跳转到此页面立刻获取数据
|
|
|
- //判断,如果sessionStore里有MakerSpaceApplyData这个字段,则存到this.wordData里
|
|
|
- if(sessionStorage.getItem('makerActivityApplyData'))this.wordData = JSON.parse(sessionStorage.getItem('makerActivityApplyData'))
|
|
|
- },
|
|
|
- beforeRouteLeave (to, from, next) {
|
|
|
- //判断,如果还没提交然后切换页面了,则把数据存到sessionStore里;
|
|
|
- if(!this.submitHint)sessionStorage.setItem('makerActivityApplyData',JSON.stringify(this.wordData));
|
|
|
- next();
|
|
|
+ saveData(){
|
|
|
+ localStorage.setItem(
|
|
|
+ "makerActivityApplyData",
|
|
|
+ JSON.stringify(this.wordData)
|
|
|
+ );
|
|
|
}
|
|
|
- };
|
|
|
- </script>
|
|
|
-
|
|
|
- <style lang="less" scoped>
|
|
|
-#MakerActivityWord{
|
|
|
- width:100%;
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ //跳转到此页面立刻获取数据
|
|
|
+ //判断,如果sessionStore里有MakerSpaceApplyData这个字段,则存到this.wordData里
|
|
|
+ if (localStorage.getItem("makerActivityApplyData"))
|
|
|
+ this.wordData = JSON.parse(
|
|
|
+ localStorage.getItem("makerActivityApplyData")
|
|
|
+ );
|
|
|
+ window.addEventListener("beforeunload", () => this.saveData());
|
|
|
+ },
|
|
|
+ destroyed() {
|
|
|
+ window.removeEventListener("beforeunload", (e) => this.saveData());
|
|
|
+ },
|
|
|
+ // beforeDestroy() {},
|
|
|
+ beforeRouteLeave(to, from, next) {
|
|
|
+ //判断,如果还没提交然后切换页面了,则把数据存到sessionStore里;
|
|
|
+ if (!this.submitHint)this.saveData();
|
|
|
+
|
|
|
+ next();
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+#MakerActivityWord {
|
|
|
+ width: 100%;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
|
}
|
|
|
- </style>
|
|
|
+</style>
|