dev_2022-05-11
luoJunYong.123 3 years ago
parent 9968525fc4
commit fe1e2aff7e
  1. 33
      src/pages/match/manage/index.vue
  2. 27
      src/pages/match/manage/matchProgress.vue
  3. 6
      src/store/modules/match.js

@ -25,6 +25,7 @@
import MatchDetail from "./matchDetail";
import MatchProgress from "./matchProgress";
import MatchSignup from "./matchSignup";
import EventBus from "@/libs/bus.js";
export default {
name: "matchManage",
@ -44,35 +45,29 @@ export default {
MatchSignup
},
created() {
EventBus.$on("tabChangeWait", (waitIndex) => {
this.tabChange(waitIndex)
});
},
beforeDestroy() {
// EventBus.$off()
},
methods: {
goBack() {
this.$router.back();
},
tabChange(index) {
console.log('changewait?')
console.log(this.wait)
// this.active = index;
if(!this.wait) {
this.$store.commit("match/setWaitIndex", index);
if(!(this.wait !== 999)) {
this.active = index;
}else {
sessionStorage.setItem('tabIndex', index)
EventBus.$emit("tabClickWait", this.wait);
this.$store.commit("match/setWait", 999);
}
},
tabChangeWait() {
tabChange(sessionStorage.setItem('tabIndex', index))
},
beforeLeave(newTab, oldTab) {
console.log(newTab)
console.log(oldTab)
// if(sessionStorage.getItem('wait')) {
// this.$confirm('?', '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning'
// })
// }
tabChangeWait(index) {
this.tabChange(index)
// tabChange(sessionStorage.setItem('tabIndex', fromIndex))
}
},
computed: {

@ -9,18 +9,18 @@
</el-table-column>
<el-table-column prop="name" label="标题">
<template slot-scope="scope">
<el-input placeholder="请输入标题" :disabled="!scope.row.operate" @blur="blur(scope.row)" @focus="focus()" v-model="scope.row.title"></el-input>
<el-input placeholder="请输入标题" :disabled="!scope.row.operate" v-model="scope.row.title"></el-input>
</template>
</el-table-column>
<el-table-column prop="name" label="详情描述">
<template slot-scope="scope">
<el-input placeholder="请输入详情描述" :disabled="!scope.row.operate" @blur="blur(scope.row)" @focus="focus()" type="textarea" v-model="scope.row.description"></el-input>
<el-input placeholder="请输入详情描述" :disabled="!scope.row.operate" type="textarea" v-model="scope.row.description"></el-input>
</template>
</el-table-column>
<el-table-column prop="name" label="状态" width="150">
<template slot-scope="scope">
<el-select v-model="scope.row.status" :disabled="!scope.row.operate" clearable placeholder="请选择状态">
<el-option v-for="(item,index) in statusList" :key="index" @blur="blur(scope.row)" @focus="focus()" :label="item.name" :value="item.value"></el-option>
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</template>
</el-table-column>
@ -40,6 +40,7 @@
<script>
import util from "@/libs/util";
import EventBus from "@/libs/bus.js";
export default {
name: "matchProgress",
@ -73,10 +74,11 @@ export default {
mounted() {
this.getData();
console.log(this.listData)
EventBus.$on("tabClickWait", () => this.waitSave());
},
methods: {
operateIt(row) {
this.$store.commit("match/setWait", true);
this.$store.commit("match/setWait", 1);
row.operate = true
},
blur(row) {
@ -112,13 +114,12 @@ export default {
//
this.$set(this.listData, index, { operate: false, ...this.listData[index]})
}
console.log(this.listData)
}).catch(res => {
});
},
saveData(row) {
//
this.$store.commit("match/setWait", false);
this.$store.commit("match/setWait", 999);
let data = row;
if (data.title.length) {
if (row.id) {
@ -225,17 +226,16 @@ export default {
message: '保存成功!'
});
}
this.$store.commit("match/setWait", false);
this.$emit('waitChange')
EventBus.$emit('tabChangeWait', this.$store.state.match.waitIndex)
}).catch(() => {
this.$message({
type: 'info',
message: '已取消保存'
});
this.$store.commit("match/setWait", false);
this.$emit('waitChange')
EventBus.$emit('tabChangeWait', this.$store.state.match.waitIndex)
});
}
}
},
computed: {
@ -245,7 +245,12 @@ export default {
}
},
beforeDestroy() {
console.log('beforeDestroy')
// EventBus.$off();
// this.waitSave()
// if(this.hasEdit) {
// console.log('what')
// }
// if (this.touchTime>0){
// if (this.hasEdit){
// this.$confirm('?', '', {

@ -5,7 +5,8 @@ export default {
namespaced: true,
state: {
matchId: "",
wait: false
wait: false,
waitIndex: 0
},
mutations: {
SET_MATCH_ID: (state, id) => {
@ -13,6 +14,9 @@ export default {
},
setWait: (state, wait) => {
state.wait = wait;
},
setWaitIndex: (state, waitIndex) => {
state.waitIndex = waitIndex;
}
},
actions: {

Loading…
Cancel
Save