Compare commits
6 Commits
3626842554
...
a51f925485
Author | SHA1 | Date |
---|---|---|
myxiaowei | a51f925485 | 1 year ago |
Suyu.Zhang | c245dbcf9c | 1 year ago |
Wangwei | 463df93806 | 1 year ago |
Wangwei | d319454cb4 | 1 year ago |
Wangwei | f75384e9ad | 2 years ago |
Wangwei | 9afe22c075 | 2 years ago |
17 changed files with 6771 additions and 6772 deletions
File diff suppressed because one or more lines are too long
@ -1,339 +1,320 @@ |
|||||||
<template> |
<template> |
||||||
|
<div> |
||||||
<div> |
<el-table v-loading="loading" :data="tableData" style="width: 100%" @selection-change="handleSelectionChange" row-key="id" default-expand-all lazy :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> |
||||||
|
<el-table-column prop="title" label="目录大纲"> |
||||||
<el-table v-loading="loading" :data="tableData" style="width: 100%" |
<template #default="scope"> |
||||||
@selection-change="handleSelectionChange" row-key="id" default-expand-all lazy |
<span v-if="scope.row.children" class="f18 fw600 col333">{{ scope.row.title }}</span> |
||||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"> |
<a v-else :href="'/class/play/' + classid + '/' + scope.row.id" target="_blank" class="item-pl f15"> <i class="iconfont icon-bofang2 colb3c f14 mrt10"></i>{{ scope.row.title }} </a> |
||||||
|
</template> |
||||||
<el-table-column prop="title" label="目录大纲"> |
</el-table-column> |
||||||
<template #default='scope'> |
|
||||||
<span v-if="scope.row.children" class="f18 fw600 col333">{{scope.row.title}}</span> |
<el-table-column fixed="right" label="发布状态" width="100"> |
||||||
<a v-else :href="'/class/play/'+classid+'/'+scope.row.id" target="_blank" class="item-pl f15"> |
<template #default="scope"> |
||||||
<i class="iconfont icon-bofang2 colb3c f14 mrt10"></i>{{scope.row.title}} |
<el-switch v-if="!scope.row.children" v-model="scope.row.display" :active-value="1" :inactive-value="0" active-color="#0082fc" inactive-color="#dadde5" @click="handleClose(scope.row)"> </el-switch> |
||||||
</a> |
</template> |
||||||
</template> |
</el-table-column> |
||||||
</el-table-column> |
</el-table> |
||||||
|
</div> |
||||||
<el-table-column fixed="right" label="发布状态" width="100"> |
|
||||||
<template #default="scope"> |
|
||||||
|
|
||||||
<el-switch v-if="!scope.row.children" v-model="scope.row.display" :active-value="1" |
|
||||||
:inactive-value="0" active-color="#0082fc" inactive-color="#dadde5" |
|
||||||
@click="handleClose(scope.row)"> |
|
||||||
</el-switch> |
|
||||||
|
|
||||||
</template> |
|
||||||
</el-table-column> |
|
||||||
|
|
||||||
</el-table> |
|
||||||
|
|
||||||
</div> |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</template> |
</template> |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script> |
<script> |
||||||
import { useRoute } from 'vue-router' |
import { useRoute } from "vue-router"; |
||||||
import { scheduleList, noticeAdd, noticeEdit, scheduleUpdate, studyLog } from "@/api/study_admin"; |
import { scheduleList, noticeAdd, noticeEdit, scheduleUpdate, studyLog } from "@/api/study_admin"; |
||||||
import { ref, toRefs, reactive, getCurrentInstance, nextTick } from 'vue'; |
import { ref, toRefs, reactive, getCurrentInstance, nextTick } from "vue"; |
||||||
import store from '@/store' |
import store from "@/store"; |
||||||
import { _debounce } from "@/utils/debounce"; |
import { _debounce } from "@/utils/debounce"; |
||||||
export default { |
export default { |
||||||
name: 'class_homework', |
name: "class_homework", |
||||||
setup() { |
setup() { |
||||||
const { proxy } = getCurrentInstance() |
const { proxy } = getCurrentInstance(); |
||||||
const route = useRoute() |
const route = useRoute(); |
||||||
const classid = route.params.classid; |
const classid = route.params.classid; |
||||||
const state = reactive({ |
const state = reactive({ |
||||||
headers: { |
headers: { |
||||||
'authentication': store.getters.get_authentication |
authentication: store.getters.get_authentication, |
||||||
}, |
}, |
||||||
loading: true, |
loading: true, |
||||||
tableData: [], // 数据列表 |
tableData: [], // 数据列表 |
||||||
multipleSelection: [], // 选中项 |
multipleSelection: [], // 选中项 |
||||||
total: 0, // 总条数 |
total: 0, // 总条数 |
||||||
page: 1, // 当前页 |
page: 1, // 当前页 |
||||||
perpage: 10, // 分页大小 |
perpage: 10, // 分页大小 |
||||||
id: '', |
id: "", |
||||||
kw: '', |
kw: "", |
||||||
dialogFormVisible: false, |
dialogFormVisible: false, |
||||||
dialogEdit: false, |
dialogEdit: false, |
||||||
dialogUidLog: false, |
dialogUidLog: false, |
||||||
numbereRef: { |
numbereRef: { |
||||||
title: '', |
title: "", |
||||||
url: '', |
url: "", |
||||||
}, |
}, |
||||||
rules: { |
rules: { |
||||||
title: [ |
title: [{ required: true, message: "请输入公告内容", trigger: "blur" }], |
||||||
{ required: true, message: '请输入公告内容', trigger: 'blur' }, |
url: [{ required: true, type: "url", message: "请输入正确的url", trigger: "blur" }], |
||||||
], |
}, |
||||||
url: [ |
rowStudent: {}, |
||||||
{ required: true, type: "url", message: '请输入正确的url', trigger: 'blur' }, |
modEdit: { |
||||||
], |
id: "", |
||||||
}, |
xs_name: "", |
||||||
rowStudent: {}, |
gongsi: "", |
||||||
modEdit: { |
gangwei: "", |
||||||
id: '', |
shouji: "", |
||||||
xs_name: '', |
fenshu: "", |
||||||
gongsi: '', |
beizhu: "", |
||||||
gangwei: '', |
}, |
||||||
shouji: '', |
uidLog: [], |
||||||
fenshu: '', |
alltime: "", |
||||||
beizhu: '', |
username: "", |
||||||
}, |
}); |
||||||
uidLog: [], |
|
||||||
alltime: '', |
// 获取学生列表 |
||||||
username: '', |
const getnotice = async () => { |
||||||
}) |
state.loading = true; |
||||||
|
const res = await scheduleList(classid); |
||||||
// 获取学生列表 |
if (res.code === 200) { |
||||||
const getnotice = async () => { |
state.tableData = res.data; |
||||||
state.loading = true |
state.total = res.data.total; |
||||||
const res = await scheduleList(classid); |
state.page = res.data.current_page; |
||||||
if (res.code === 200) { |
state.loading = false; |
||||||
state.tableData = res.data |
} |
||||||
state.total = res.data.total |
}; |
||||||
state.page = res.data.current_page |
getnotice(); |
||||||
state.loading = false |
|
||||||
} |
// 观看记录 |
||||||
}; |
const getUserLog = async (uid) => { |
||||||
getnotice(); |
state.loading = true; |
||||||
|
const res = await studyLog(classid, uid); |
||||||
// 观看记录 |
if (res.code === 200) { |
||||||
const getUserLog = async (uid) => { |
state.uidLog = res.data.data; |
||||||
state.loading = true |
state.alltime = res.data.alltime; |
||||||
const res = await studyLog(classid, uid); |
state.username = res.data.username; |
||||||
if (res.code === 200) { |
state.dialogUidLog = true; |
||||||
state.uidLog = res.data.data; |
state.loading = false; |
||||||
state.alltime = res.data.alltime; |
} |
||||||
state.username = res.data.username; |
}; |
||||||
state.dialogUidLog = true; |
|
||||||
state.loading = false |
// 设置当前查看的数据item |
||||||
} |
const setItem = (item) => { |
||||||
}; |
state.item = item; |
||||||
|
state.isShowItem = true; |
||||||
// 设置当前查看的数据item |
}; |
||||||
const setItem = (item) => { |
|
||||||
state.item = item |
const handleOption = () => { |
||||||
state.isShowItem = true |
state.page = 1; |
||||||
} |
getnotice(); |
||||||
|
}; |
||||||
const handleOption = () => { |
|
||||||
state.page = 1 |
// 选择项 |
||||||
getnotice() |
const handleSelectionChange = (val) => { |
||||||
} |
state.multipleSelection = val; |
||||||
|
}; |
||||||
|
const changePage = (val) => { |
||||||
// 选择项 |
state.page = val; |
||||||
const handleSelectionChange = (val) => { |
getnotice(); |
||||||
state.multipleSelection = val |
}; |
||||||
} |
// 每页显示条数 |
||||||
const changePage = (val) => { |
const handleSizeChange = (val) => { |
||||||
state.page = val |
state.perpage = val; |
||||||
getnotice() |
getnotice(); |
||||||
} |
}; |
||||||
// 每页显示条数 |
|
||||||
const handleSizeChange = (val) => { |
// 更新状态 |
||||||
state.perpage = val |
const handleClose = async (row) => { |
||||||
getnotice() |
const params = { |
||||||
} |
data: { |
||||||
|
id: row.id, |
||||||
// 更新状态 |
display: row.display, |
||||||
const handleClose = async (row) => { |
title: row.title, |
||||||
const params = { |
}, |
||||||
data: { |
}; |
||||||
id: row.id, |
const res = await scheduleUpdate(classid, params); |
||||||
display: row.display, |
if (res.message === "success") { |
||||||
title: row.title, |
if (res.data.display == 1) { |
||||||
} |
proxy.$notify({ |
||||||
} |
title: "发布成功", |
||||||
const res = await scheduleUpdate(classid, params); |
type: "success", |
||||||
if (res.message === 'success') { |
iconClass: "schedule-success", |
||||||
if (res.data.display == 1) { |
message: res.data.title + "【发布成功】", |
||||||
proxy.$notify({ |
}); |
||||||
title: '发布成功', |
} else { |
||||||
type: 'success', |
proxy.$notify.info({ |
||||||
message: res.data.title + '【发布成功】', |
title: "取消发布成功", |
||||||
}); |
type: "info", |
||||||
} else { |
iconClass: "schedule-info", |
||||||
proxy.$notify.info({ |
message: res.data.title + "【已取消发布】", |
||||||
title: '取消发布成功', |
}); |
||||||
message: res.data.title + '【已取消发布】', |
} |
||||||
}); |
} else { |
||||||
} |
proxy.$message({ |
||||||
} else { |
type: "error", |
||||||
proxy.$message({ |
message: "服务器错误", |
||||||
type: 'error', |
center: true, |
||||||
message: '服务器错误', |
}); |
||||||
center: true |
} |
||||||
}); |
}; |
||||||
} |
|
||||||
|
// 添加公告 |
||||||
|
const submitForm = _debounce(() => { |
||||||
|
_submitForm(); |
||||||
|
}, 300); |
||||||
|
const numberValidateRef = ref(null); |
||||||
|
const _submitForm = () => { |
||||||
|
nextTick(() => { |
||||||
|
numberValidateRef.value.validate(async (valid) => { |
||||||
|
if (valid) { |
||||||
|
const params = { |
||||||
|
title: state.numbereRef.title, |
||||||
|
url: state.numbereRef.url, |
||||||
}; |
}; |
||||||
|
const res = await noticeAdd(classid, params); |
||||||
|
if (res.message === "success") { |
||||||
|
state.dialogFormVisible = false; |
||||||
|
proxy.$message({ |
||||||
// 添加公告 |
type: "success", |
||||||
const submitForm = _debounce(() => { |
message: "添加成功", |
||||||
_submitForm(); |
center: true, |
||||||
}, 300) |
}); |
||||||
const numberValidateRef = ref(null); |
setTimeout(function() { |
||||||
const _submitForm = () => { |
getnotice(); |
||||||
nextTick(() => { |
}, 100); |
||||||
numberValidateRef.value.validate(async (valid) => { |
|
||||||
if (valid) { |
|
||||||
const params = { |
|
||||||
title: state.numbereRef.title, |
|
||||||
url: state.numbereRef.url, |
|
||||||
} |
|
||||||
const res = await noticeAdd(classid, params) |
|
||||||
if (res.message === 'success') { |
|
||||||
state.dialogFormVisible = false; |
|
||||||
proxy.$message({ |
|
||||||
type: 'success', |
|
||||||
message: '添加成功', |
|
||||||
center: true |
|
||||||
}); |
|
||||||
setTimeout(function () { |
|
||||||
getnotice() |
|
||||||
}, 100); |
|
||||||
} |
|
||||||
} |
|
||||||
}); |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
const noticeValidateRef = ref(null); |
|
||||||
const resnoticeEdit = () => { |
|
||||||
noticeValidateRef.value.validate(async (valid) => { |
|
||||||
if (valid) { |
|
||||||
const params = { |
|
||||||
data: state.modEdit, |
|
||||||
} |
|
||||||
const res = await noticeEdit(classid, params); |
|
||||||
if (res.code === 200) { |
|
||||||
state.dialogEdit = false; |
|
||||||
proxy.$message({ |
|
||||||
type: 'success', |
|
||||||
message: '编辑成功', |
|
||||||
center: true |
|
||||||
}); |
|
||||||
getnotice() |
|
||||||
} |
|
||||||
} |
|
||||||
}); |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
const openStudent = (row) => { |
|
||||||
state.modEdit = row; |
|
||||||
state.dialogEdit = true; |
|
||||||
} |
|
||||||
|
|
||||||
const eidtForm = () => { |
|
||||||
resnoticeEdit(); |
|
||||||
} |
|
||||||
|
|
||||||
// const tableRowClassName = ({ row }) => { |
|
||||||
// if (row.children) { |
|
||||||
// return 'title-row'; |
|
||||||
// } |
|
||||||
// return ''; |
|
||||||
// } |
|
||||||
|
|
||||||
return { |
|
||||||
...toRefs(state), |
|
||||||
classid, |
|
||||||
setItem, |
|
||||||
handleSelectionChange, |
|
||||||
getnotice, |
|
||||||
changePage, |
|
||||||
handleOption, |
|
||||||
handleClose, |
|
||||||
handleSizeChange, |
|
||||||
numberValidateRef, |
|
||||||
submitForm, |
|
||||||
openStudent, |
|
||||||
eidtForm, |
|
||||||
getUserLog, |
|
||||||
noticeValidateRef, |
|
||||||
//tableRowClassName |
|
||||||
} |
} |
||||||
|
} |
||||||
|
}); |
||||||
|
}); |
||||||
|
}; |
||||||
|
|
||||||
|
const noticeValidateRef = ref(null); |
||||||
|
const resnoticeEdit = () => { |
||||||
|
noticeValidateRef.value.validate(async (valid) => { |
||||||
|
if (valid) { |
||||||
|
const params = { |
||||||
|
data: state.modEdit, |
||||||
|
}; |
||||||
|
const res = await noticeEdit(classid, params); |
||||||
|
if (res.code === 200) { |
||||||
|
state.dialogEdit = false; |
||||||
|
proxy.$message({ |
||||||
|
type: "success", |
||||||
|
message: "编辑成功", |
||||||
|
center: true, |
||||||
|
}); |
||||||
|
getnotice(); |
||||||
|
} |
||||||
} |
} |
||||||
} |
}); |
||||||
|
}; |
||||||
|
|
||||||
|
const openStudent = (row) => { |
||||||
|
state.modEdit = row; |
||||||
|
state.dialogEdit = true; |
||||||
|
}; |
||||||
|
|
||||||
|
const eidtForm = () => { |
||||||
|
resnoticeEdit(); |
||||||
|
}; |
||||||
|
|
||||||
|
// const tableRowClassName = ({ row }) => { |
||||||
|
// if (row.children) { |
||||||
|
// return 'title-row'; |
||||||
|
// } |
||||||
|
// return ''; |
||||||
|
// } |
||||||
|
|
||||||
|
return { |
||||||
|
...toRefs(state), |
||||||
|
classid, |
||||||
|
setItem, |
||||||
|
handleSelectionChange, |
||||||
|
getnotice, |
||||||
|
changePage, |
||||||
|
handleOption, |
||||||
|
handleClose, |
||||||
|
handleSizeChange, |
||||||
|
numberValidateRef, |
||||||
|
submitForm, |
||||||
|
openStudent, |
||||||
|
eidtForm, |
||||||
|
getUserLog, |
||||||
|
noticeValidateRef, |
||||||
|
//tableRowClassName |
||||||
|
}; |
||||||
|
}, |
||||||
|
}; |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="scss" scoped> |
<style lang="scss" scoped> |
||||||
.item-pl:hover{ |
.item-pl:hover { |
||||||
.icon-bofang2{ |
.icon-bofang2 { |
||||||
color: #0082fc; |
color: #0082fc; |
||||||
} |
} |
||||||
} |
} |
||||||
.item_log { |
.item_log { |
||||||
width: 120px; |
width: 120px; |
||||||
display: inline-block; |
display: inline-block; |
||||||
text-align: right; |
text-align: right; |
||||||
} |
} |
||||||
|
|
||||||
.tab-header { |
.tab-header { |
||||||
padding: 24px 0 10px 0; |
padding: 24px 0 10px 0; |
||||||
} |
} |
||||||
|
|
||||||
.ptlist { |
.ptlist { |
||||||
padding: 6px 0; |
padding: 6px 0; |
||||||
overflow-y: auto; |
overflow-y: auto; |
||||||
font-size: 14px; |
font-size: 14px; |
||||||
|
|
||||||
li { |
li { |
||||||
padding: 2px 0; |
padding: 2px 0; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
.ifprt { |
.ifprt { |
||||||
padding-right: 10px !important; |
padding-right: 10px !important; |
||||||
} |
} |
||||||
|
|
||||||
.infobox { |
.infobox { |
||||||
line-height: 24px; |
line-height: 24px; |
||||||
padding: 0 20px; |
padding: 0 20px; |
||||||
} |
} |
||||||
|
|
||||||
.scrollbar { |
.scrollbar { |
||||||
height: 106px; |
height: 106px; |
||||||
overflow: hidden; |
overflow: hidden; |
||||||
} |
} |
||||||
|
|
||||||
.min-pd { |
.min-pd { |
||||||
padding: 6px 10px; |
padding: 6px 10px; |
||||||
} |
} |
||||||
|
|
||||||
::v-deep .el-scrollbar__wrap { |
::v-deep .el-scrollbar__wrap { |
||||||
max-height: 300px; |
max-height: 300px; |
||||||
overflow-x: hidden; |
overflow-x: hidden; |
||||||
} |
} |
||||||
|
|
||||||
::v-deep .el-icon-close { |
::v-deep .el-icon-close { |
||||||
display: none !important; |
display: none !important; |
||||||
} |
} |
||||||
|
|
||||||
::v-deep .el-icon-close-tip { |
::v-deep .el-icon-close-tip { |
||||||
display: none !important; |
display: none !important; |
||||||
} |
} |
||||||
|
|
||||||
::v-deep .el-button i { |
::v-deep .el-button i { |
||||||
line-height: 0; |
line-height: 0; |
||||||
} |
} |
||||||
</style> |
</style> |
||||||
|
|
||||||
<style> |
<style> |
||||||
.el-dialog__body { |
.el-dialog__body { |
||||||
padding: 20px 30px 30px 30px; |
padding: 20px 30px 30px 30px; |
||||||
} |
} |
||||||
/* .title-row td{ |
.schedule-success { |
||||||
|
color: #67c23a !important; |
||||||
|
} |
||||||
|
.schedule-info { |
||||||
|
color: #909399 !important; |
||||||
|
} |
||||||
|
/* .title-row td{ |
||||||
background-color:#F3F8FF; |
background-color:#F3F8FF; |
||||||
} */ |
} */ |
||||||
</style> |
</style> |
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue