Commit 96c5dd21 authored by 罗超's avatar 罗超

1

parent c90d34bc
<template> <template>
<!-- 可补课时 --> <q-dialog
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale"> v-model="persistent"
<q-card style="width: 900px;max-width:900px;"> content-class="bg-grey-1"
persistent
transition-show="scale"
transition-hide="scale"
>
<q-card style="width: 900px; max-width: 900px">
<q-card-section> <q-card-section>
<div class="text-h6">事件记录</div> <div class="text-h6">事件记录</div>
</q-card-section> </q-card-section>
<q-card-section class="q-pt-none"> <q-card-section class="q-pt-none">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table " <q-table
separator="none" :data="data" :columns="columns" row-key="name"> :pagination="msg"
:loading="loading"
no-data-label="暂无相关数据"
flat
class="sticky-column-table"
separator="none"
:data="data"
:columns="columns"
row-key="name"
>
<template v-slot:top="props"> <template v-slot:top="props">
<!-- <div class="col-2 q-table__title">可补课课时</div> --> <!-- <div class="col-2 q-table__title">事件记录</div> -->
</template> </template>
<template v-slot:body-cell-EventType="props"> <template v-slot:body-cell-EventType="props">
<q-td :props="props"> <q-td :props="props">
<div v-if="props.row.EventType===1" style="color:#ff0000">处分</div> <div v-if="props.row.EventType === 1" style="color: #ff0000">
<div v-if="props.row.EventType===2" style="color:#00ff00">奖励</div> 处分
</q-td> </div>
</template> <div v-if="props.row.EventType === 2" style="color: #00ff00">
<template v-slot:body-cell-optioned="props"> 奖励
<q-td :props="props"> </div>
<div> </q-td>
<q-btn size="xs" color="accent" style="font-weight:400" label="修改" </template>
@click="modify(props.row)" /> <template v-slot:body-cell-optioned="props">
</div> <q-td :props="props">
</q-td> <div>
</template> <q-btn
size="xs"
color="accent"
style="font-weight: 400"
label="修改"
@click="modify(props.row)"
/>
</div>
</q-td>
</template>
<template v-slot:bottom> <template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount" <q-pagination
:input="true" @input="changePage" /> class="full-width justify-end"
v-model="msg.pageIndex"
color="primary"
:max="pageCount"
:input="true"
@input="changePage"
/>
</template> </template>
</q-table> </q-table>
</q-card-section> </q-card-section>
<q-card-actions align="right" class="bg-white"> <q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeSaveForm" /> <q-btn
label="取消"
flat
color="grey-10"
style="font-weight: 400 !important"
@click="closeSaveForm"
/>
<!-- <q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveLoading" <!-- <q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveLoading"
@click="save" /> --> @click="save" /> -->
</q-card-actions> </q-card-actions>
...@@ -41,188 +76,184 @@ ...@@ -41,188 +76,184 @@
</template> </template>
<script> <script>
import { import { getEventLogPageList } from "../../api/stuMan/index.js";
getEventLogPageList export default {
} from '../../api/stuMan/index.js' props: {
export default { setObj: {
props: { type: Object,
setObj: {
type: Object,
}
}, },
data() { },
return { data() {
persistent: true, return {
loading: false, persistent: true,
pageCount: 0, loading: false,
msg: { pageCount: 0,
pageIndex: 1, msg: {
pageSize: 10, pageIndex: 1,
rowsPerPage: 10, pageSize: 10,
StuId:0, rowsPerPage: 10,
EventType:0 StuId: 0,
EventType: 0,
},
data: [],
columns: [
{
name: "Title",
label: "标题",
align: "left",
field: "Title",
},
{
name: "EventType",
label: "类型",
align: "left",
field: "EventType",
},
{
name: "EventContent",
label: "内容",
align: "left",
field: "EventContent",
required: true,
}, },
data: [],
columns: [ {
{ name: "CreateByName",
name: "Title", label: "创建人",
label: "标题", align: "left",
align: "left", field: "CreateByName",
field: "Title", },
}, {
{ name: "CreateTime",
name: "EventType", label: "创建时间",
label: "类型", align: "left",
align: "left", field: "CreateTime",
field: "EventType" },
}, {
{ name: "optioned",
name: "EventContent", label: "操作",
label: "内容", align: "left",
align: "left", },
field: "EventContent", ],
required: true, };
}, },
mounted() {
{ if (this.setObj) {
name: "CreateByName", this.msg.StuId = this.setObj.Id;
label: "创建人", }
align: "left",
field: "CreateByName", this.getList();
}, },
{ methods: {
name: "CreateTime", closeSaveForm() {
label: "创建时间", this.$emit("close");
align: "left", this.persistent = false;
field: "CreateTime",
},
{
name: "optioned",
label: "操作",
align: "left",
},
]
}
}, },
mounted() { getList() {
if (this.setObj) { getEventLogPageList(this.msg).then((res) => {
this.msg.StuId = this.setObj.Student_Id if (res.Code === 1) {
} this.data = res.Data.PageData;
this.pageCount = res.Data.PageCount;
}
});
},
//重新查询
resetSearch() {
this.msg.pageIndex = 1;
this.getList(); this.getList();
}, },
methods: { //翻页
closeSaveForm() { changePage(val) {
this.$emit('close') this.msg.pageIndex = val;
this.persistent = false this.getList();
},
getList() {
getEventLogPageList(this.msg).then(res => {
if (res.Code === 1) {
this.data = res.Data.PageData
this.pageCount = res.Data.PageCount
}
})
},
//重新查询
resetSearch() {
this.msg.pageIndex = 1;
this.getList();
},
//翻页
changePage(val) {
this.msg.pageIndex = val;
this.getList()
},
//修改
modify(item){
this.persistent = false
this.$emit('modify',item)
}
}, },
} //修改
modify(item) {
this.persistent = false;
this.$emit("modify", item);
},
},
};
</script> </script>
<style> <style>
.avatar-uploader .el-upload { .avatar-uploader .el-upload {
border-radius: 6px; border-radius: 6px;
cursor: pointer; cursor: pointer;
width: 100%; width: 100%;
height: 100%; height: 100%;
color: #8c939d; color: #8c939d;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
.addDutyMain {
display: inline-block;
width: 118px;
height: 118px;
font-size: 70px;
border: 1px dashed #d9d9d9;
line-height: 120px;
}
.ItemImgDiv { .addDutyMain {
width: 118px; display: inline-block;
height: 118px; width: 118px;
position: relative; height: 118px;
margin: 0 10px 10px 0; font-size: 70px;
display: inline-block; border: 1px dashed #d9d9d9;
} line-height: 120px;
}
._delete_img { .ItemImgDiv {
position: absolute; width: 118px;
top: 0px; height: 118px;
height: 82px; position: relative;
width: 143px; margin: 0 10px 10px 0;
line-height: 34px; display: inline-block;
text-align: center; }
background-color: rgba(2, 2, 2, 0.6);
display: inherit;
opacity: 0;
transition: all linear .5s
}
._delete_img i.iconfont { ._delete_img {
display: inline-block; position: absolute;
width: 32px; top: 0px;
height: 32px; height: 82px;
border-radius: 50%; width: 143px;
color: #E95252 !important; line-height: 34px;
background-color: rgba(251, 251, 251, 0.9); text-align: center;
margin-top: 26px; background-color: rgba(2, 2, 2, 0.6);
} display: inherit;
opacity: 0;
transition: all linear 0.5s;
}
._upload_box ul li { ._delete_img i.iconfont {
float: left; display: inline-block;
height: 82px; width: 32px;
width: 143px; height: 32px;
padding: 0px 20px 20px 0; border-radius: 50%;
text-align: center; color: #e95252 !important;
position: relative; background-color: rgba(251, 251, 251, 0.9);
cursor: pointer; margin-top: 26px;
margin-right: 10px; }
}
._upload_box ul li img { ._upload_box ul li {
height: 82px; float: left;
width: 143px; height: 82px;
} width: 143px;
padding: 0px 20px 20px 0;
text-align: center;
position: relative;
cursor: pointer;
margin-right: 10px;
}
._upload_box ul li:hover ._delete_img { ._upload_box ul li img {
opacity: 1; height: 82px;
} width: 143px;
}
._upload_tips { ._upload_box ul li:hover ._delete_img {
font-size: 12px; opacity: 1;
position: absolute; }
top: 71%;
width: 100%;
left: 0;
text-align: center;
color: #949494;
}
._upload_tips {
font-size: 12px;
position: absolute;
top: 71%;
width: 100%;
left: 0;
text-align: center;
color: #949494;
}
</style> </style>
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