|
@@ -1,9 +1,9 @@
|
|
<template>
|
|
<template>
|
|
- <vxe-modal v-model="value" id="questModel" width="70%" v-loading="load" @show="show" height="80%" show-zoom resize transfer show-footer>
|
|
|
|
|
|
+ <vxe-modal v-model="value" id="questModel" width="70%" v-loading="load" @show="show" @hide="hide" height="80%" show-zoom resize transfer show-footer>
|
|
<template #title>
|
|
<template #title>
|
|
<span>异常类型</span>
|
|
<span>异常类型</span>
|
|
</template>
|
|
</template>
|
|
- <by-table :propConfig="tableConfig" ref="table">
|
|
|
|
|
|
+ <by-table :propConfig="tableConfig" ref="table" id="quest-table">
|
|
<template v-slot:ordered="{row}">
|
|
<template v-slot:ordered="{row}">
|
|
<span v-if="row.isSystem == 1">{{ row.ordered }}</span>
|
|
<span v-if="row.isSystem == 1">{{ row.ordered }}</span>
|
|
<vxe-input v-else v-model="row.ordered" size="small" type="number"></vxe-input>
|
|
<vxe-input v-else v-model="row.ordered" size="small" type="number"></vxe-input>
|
|
@@ -17,6 +17,7 @@
|
|
v-model="row.isShow"
|
|
v-model="row.isShow"
|
|
:active-value="1"
|
|
:active-value="1"
|
|
:inactive-value="0"
|
|
:inactive-value="0"
|
|
|
|
+ @change="changeShow($event,row)"
|
|
:disabled="row.isSystem == 1">
|
|
:disabled="row.isSystem == 1">
|
|
</el-switch>
|
|
</el-switch>
|
|
</template>
|
|
</template>
|
|
@@ -32,7 +33,7 @@
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
-import { queryAll } from '@/api/question'
|
|
|
|
|
|
+import { queryAll,updateOrdered,updatePriority,updateShow,del } from '@/api/question'
|
|
import AddQuestModel from "./addQuest.vue";
|
|
import AddQuestModel from "./addQuest.vue";
|
|
@Component({components:{AddQuestModel}})
|
|
@Component({components:{AddQuestModel}})
|
|
export default class QuestModel extends Vue {
|
|
export default class QuestModel extends Vue {
|
|
@@ -71,7 +72,7 @@ export default class QuestModel extends Vue {
|
|
return row.isSystem != 1
|
|
return row.isSystem != 1
|
|
},
|
|
},
|
|
click:(row:any) => {
|
|
click:(row:any) => {
|
|
-
|
|
|
|
|
|
+ this.sortHandle(row);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},{
|
|
},{
|
|
@@ -81,7 +82,7 @@ export default class QuestModel extends Vue {
|
|
return row.isSystem != 1
|
|
return row.isSystem != 1
|
|
},
|
|
},
|
|
click:(row:any) => {
|
|
click:(row:any) => {
|
|
-
|
|
|
|
|
|
+ this.priorityHandle(row)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},{
|
|
},{
|
|
@@ -91,7 +92,7 @@ export default class QuestModel extends Vue {
|
|
return row.isSystem != 1
|
|
return row.isSystem != 1
|
|
},
|
|
},
|
|
click:(row:any) => {
|
|
click:(row:any) => {
|
|
-
|
|
|
|
|
|
+ this.delHandle(row);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}]
|
|
}]
|
|
@@ -101,8 +102,68 @@ export default class QuestModel extends Vue {
|
|
|
|
|
|
mounted(){
|
|
mounted(){
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+ sortHandle(row:any){
|
|
|
|
+ this.load = true;
|
|
|
|
+ updateOrdered({
|
|
|
|
+ id:row.id,
|
|
|
|
+ ordered:row.ordered
|
|
|
|
+ }).then(()=>{
|
|
|
|
+ this.$message({message:'“'+row.type+'”'+'排序修改成功!',type:'success'})
|
|
|
|
+ this.load = false;
|
|
|
|
+ this.getQuestionList();
|
|
|
|
+ }).catch(()=>{
|
|
|
|
+ this.load = false;
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ priorityHandle(row:any){
|
|
|
|
+ this.load = true;
|
|
|
|
+ updatePriority({
|
|
|
|
+ id:row.id,
|
|
|
|
+ priority:row.priority
|
|
|
|
+ }).then(()=>{
|
|
|
|
+ this.$message({message:'“'+row.type+'”'+'优先级修改成功!',type:'success'})
|
|
|
|
+ this.load = false;
|
|
|
|
+ this.getQuestionList();
|
|
|
|
+ }).catch(()=>{
|
|
|
|
+ this.load = false;
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ changeShow(v:number,row:any){
|
|
|
|
+ this.load = true;
|
|
|
|
+ updateShow({
|
|
|
|
+ id:row.id,
|
|
|
|
+ isShow:v
|
|
|
|
+ }).then(()=>{
|
|
|
|
+ this.$message({message:'“'+row.type+'”'+'显示修改成功!',type:'success'})
|
|
|
|
+ this.load = false;
|
|
|
|
+ this.getQuestionList();
|
|
|
|
+ }).catch(()=>{
|
|
|
|
+ this.load = false;
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ delHandle(row:any){
|
|
|
|
+ this.$confirm('此操作将删除“'+row.type+'”, 是否继续?', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.load = true;
|
|
|
|
+ del({
|
|
|
|
+ id:row.id,
|
|
|
|
+ }).then(()=>{
|
|
|
|
+ this.$message({message:'删除成功!',type:'success'})
|
|
|
|
+ this.load = false;
|
|
|
|
+ this.getQuestionList();
|
|
|
|
+ }).catch(()=>{
|
|
|
|
+ this.load = false;
|
|
|
|
+ })
|
|
|
|
+ })
|
|
}
|
|
}
|
|
show(){
|
|
show(){
|
|
|
|
+ let height = (document.getElementById('quest-table') as any).parentNode.offsetHeight;
|
|
|
|
+ this.tableConfig.attr.height=height - 36;
|
|
|
|
+ (this.$refs.table as any).setConfig(this.tableConfig);
|
|
this.getQuestionList()
|
|
this.getQuestionList()
|
|
}
|
|
}
|
|
handleSuccess(){
|
|
handleSuccess(){
|
|
@@ -129,6 +190,9 @@ export default class QuestModel extends Vue {
|
|
add(){
|
|
add(){
|
|
(this.$refs.addQuestModel as any).setShow(true)
|
|
(this.$refs.addQuestModel as any).setShow(true)
|
|
}
|
|
}
|
|
|
|
+ hide(){
|
|
|
|
+ this.$emit('questHide')
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|