Commit 35bd7af6 authored by zhengke's avatar zhengke

修改

parent 493e6cea
......@@ -12,7 +12,7 @@ export default {
<style>
@import url('~assets/css/font.css');
@import url('//at.alicdn.com/t/font_2077629_jx56ujw7s6.css');
@import url('//at.alicdn.com/t/font_2077629_ctho1lelfhe.css');
html,
body,
......
......@@ -144,3 +144,14 @@ export function queryQuestionCategory() {
method: 'post',
})
}
/**
* 题目上移下移
*/
export function UpdateQuestionSort(data) {
return request({
url: '/Question/UpdateQuestionSort',
method: 'post',
})
}
......@@ -120,7 +120,7 @@
},
{
name: 'CategoryName',
label: '类',
label: '类',
field: 'CategoryName',
align: 'left',
},
......
<style>
.page-content p {
margin: 16px 0 0 0 !important;
margin: 10px 0 0 0 !important;
}
.quetion_Title {
......@@ -8,7 +8,7 @@
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width: 280px;
width: 400px;
}
......@@ -67,8 +67,10 @@
</div>
</template>
<template v-slot:body-cell-Title="props">
<div v-html="props.row.Title" class="quetion_Title">
</div>
<td style="width:400px;">
<div v-html="props.row.Title" class="quetion_Title">
</div>
</td>
</template>
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
......@@ -78,8 +80,14 @@
<q-td :props="props">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="EditQuestion(props.row)" />
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="删除"
<q-btn flat size="xs" icon="edit" color="negative" style="font-weight:400" label="删除"
@click="setQuestionStatus(props.row)"></q-btn>
<q-btn flat size="xs" icon="iconfont icon-shangyi2" v-if="props.row.isShowFirst" color="accent" title="上移" style="font-weight:400;display:none;" label=""
@click="getUpStatus(props.row,1)"></q-btn>
<q-btn flat size="xs" icon="iconfont icon-xiayi" v-if="props.row.isShowLast" color="accent" title="下移" style="font-weight:400;display:none;" label=""
@click="getUpStatus(props.row,2)"></q-btn>
<q-btn flat size="xs" icon="iconfont icon-fuzhi" color="accent" style="font-weight:400;display:none;" label=""
@click="getCopyItem(props.row)"></q-btn>
</q-td>
</template>
</q-table>
......@@ -98,7 +106,8 @@
queryQuestionTypeList,
deleteQuestion,
queryDifficultyType,
queryQuestionCategory
queryQuestionCategory,
UpdateQuestionSort
} from '../../api/question/question';
import questionForm from '../../components/question/question-form';
import questionUpload from '../../components/question/question-upload';
......@@ -120,7 +129,7 @@
},
{
name: 'CategoryName',
label: '类',
label: '类',
field: 'CategoryName',
align: 'left',
},
......@@ -273,6 +282,18 @@
this.loading = false;
this.data = res.Data.PageData;
this.pageCount = res.Data.PageCount;
this.data.forEach((x,index)=>{
if(index==0){
x.isShowFirst=false
}else{
x.isShowFirst=true
}
if(index==this.data.length-1){
x.isShowLast=false
}else{
x.isShowLast=true
}
})
}).catch(() => {
this.loading = false
})
......@@ -299,6 +320,39 @@
this.isShowImportUpload = false;
this.importType = 0;
},
//上移
getUpStatus(item,num){
console.log(item,'数据');
var QuestionId = item.QuestionId;
var index = -1;
for(var i=0;i<this.data.length;i++){
if(this.data[i].QuestionId==QuestionId){
index=i;
break;
}
}
if(num==1){ //上移
var targetQId = this.data[index-1].QuestionId;
}
if(num==2){ //下移
var targetQId = this.data[index+1].QuestionId;
}
console.log(targetQId,'targetQId');
var msg = {
curQId:QuestionId,
targetQId:targetQId
}
UpdateQuestionSort(msg).then(res => {
console.log(res,'数据');
if (res.Code == 1) {
this.getQuestionList();
}
});
},
//复制
getCopyItem(item){
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment