Commit d22acd91 authored by Mac's avatar Mac

1

parent 800df0df
...@@ -398,7 +398,7 @@ ...@@ -398,7 +398,7 @@
ImageName: '', ImageName: '',
ImagePath: '', ImagePath: '',
}; };
} else if (this.type == 7) {//小程序 } else if (this.type == 7) {//文件
this.addMsg.FileModel = { this.addMsg.FileModel = {
FileName: '', FileName: '',
FilePath: '', FilePath: '',
......
<template> <template>
<div class="allmaterial" style="padding: 0;margin: 0;"> <div class="allmaterial" style="padding: 0;margin: 0;">
<!-- <div class="page-search row items-center"> <!-- <div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md"> <div class="col row wrap q-mr-lg q-col-gutter-md">
</div> </div>
</div> --> </div> -->
<div class="page-content"> <div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table" <q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table no-bottom-table"
separator="none" title="" :data="data" :columns="columns" row-key="name"> separator="none" title="" :data="dataList" :columns="columns" row-key="name">
<!-- <template v-slot:top="props">
<div class="col-2 q-table__title"></div> <template v-slot:body-cell-title="props">
<q-space /> <q-td :props="props">
<q-btn color="accent" style="float:right;margin-right:0;" size="sm" class="q-mr-md" icon="add" <span>{{getType(props.row,'title')}}</span>
label="新增欢迎语" @click="goadd()"></q-btn> </q-td>
</template> --> </template>
<template v-slot:body-cell-Type="props">
<q-td :props="props"> <template v-slot:body-cell-Content="props">
<span v-if="props.row.Type==1">图文</span> <q-td :props="props">
<span v-if="props.row.Type==2">图片</span> <span v-if="props.row.Type==1">{{getType(props.row,'content')}}</span>
</q-td> <q-img v-if="props.row.Type==2 || props.row.Type==3 || props.row.Type==6"
</template> :src="getType(props.row,'content')" style="width: 80px;height: 80px;border-radius: 6px;display: flex;">
<template v-slot:body-cell-Content="props">
<q-td :props="props">
<q-img
:src="props.row.Content"
style="width: 80px;height: 80px;border-radius: 6px;display: flex;"
>
</q-img> </q-img>
</q-td> <audio controls="controls"
</template> v-if='props.row.Type==4 && props.row.AudioModel && props.row.AudioModel.AudioPath'
<template v-slot:body-cell-optioned="props"> style="width: 200px;height: 40px;">
<q-td :props="props"> <source :src="props.row.AudioModel.AudioPath" type="audio/ogg">
<source :src="props.row.AudioModel.AudioPath" type="audio/mpeg">
<q-btn flat size="xs" icon="edit" style="font-weight:400;color: #3FC4FF" class="q-mr-xs" </audio>
label="编辑" @click="goDetailed(props.row,'0')" /> <video width="200" height="120" controls="controls"
<q-btn flat size="xs" icon="delete" style="font-weight:400;color: #3FC4FF" class="q-mr-xs" v-if="props.row.Type==5 && props.row.VideoModel && props.row.VideoModel.VideoPath">
label="删除" @click="goDetailed(props.row,'0')" /> <source :src="props.row.VideoModel.VideoPath" type="video/ogg" />
</q-td> <source :src="props.row.VideoModel.VideoPath" type="video/mp4" />
</template> <source :src="props.row.VideoModel.VideoPath" type="video/webm" />
<template v-slot:bottom> </video>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount" <div v-if="props.row.Type==7 && props.row.FileModel && props.row.FileModel.FilePath!=''"
:input="true" @input="changePage" /> @click.stop="showUpLoadFile(props.row.FileModel)">
</template> <i v-if="props.row.FileModel.FilePath.substring(props.row.FileModel.FilePath.lastIndexOf('.')+1,props.row.FileModel.FilePath.length).toUpperCase()=='PDF'"
</q-table> class="iconfont icon-pdf"></i>
</div> <i v-else-if="props.row.FileModel.FilePath.substring(props.row.FileModel.FilePath.lastIndexOf('.')+1,props.row.FileModel.FilePath.length).toUpperCase()=='TXT'"
class="iconfont icon-txt"></i>
<i v-else-if="props.row.FileModel.FilePath.substring(props.row.FileModel.FilePath.lastIndexOf('.')+1,props.row.FileModel.FilePath.length).toUpperCase()=='DOCX' ||
props.row.FileModel.FilePath.substring(props.row.FileModel.FilePath.lastIndexOf('.')+1,props.row.FileModel.FilePath.length).toUpperCase()=='DOC'
" class="iconfont icon-word"></i>
<i v-else class="iconfont icon-excel"></i>
</div>
</q-td>
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<q-btn flat size="xs" icon="edit" style="font-weight:400;color: #3FC4FF" class="q-mr-xs" label="编辑" v-if="props.row.Type==1 || props.row.Type==3 || props.row.Type==6 "
@click="goedit(props.row)" />
<q-btn flat size="xs" icon="edit" style="font-weight:400;color: #3FC4FF" class="q-mr-xs" label="移动"
@click="plmove(props)" />
<q-btn flat size="xs" icon="delete" color="negative" class="q-mr-xs" label="删除"
@click="goDetailed(props.row,'0')" />
</q-td>
</template>
</q-table>
</div> </div>
</template> <div v-if="Isadd==true">
<alladdsc :allclassifyList="allclassifyList" :type='showtype' @editsuccess="getchildren" :editobj='editobj'
<script> @getcancel='Isadd=false'></alladdsc>
</div>
export default { </div>
</template>
name: "allmaterial",
data() { <script>
return {
loading: false, import alladdsc from './allAddSC'
ISsystem: false, import {
data: [{Type:1, delWecharMediumInfo,//删除素材
title:'阿萨欢声雷动.png', } from '../../../api/system/wechat';
Content:'http://imgfile.oytour.com/EduSystem/Test/Upload/course/202107070330161360000000064.jpg', export default {
applymember:'通用', components: {
source:'本地上传', alladdsc,
CreatorName:'小张', },
UpdateTime:'2021-08-04 15:48'}], name: "allmaterial",
pageCount: 0, props: {
msg: { dataList: {
pageIndex: 1, type: Array,
pageSize: 10, default: [],
rowsPerPage: 10,
Month: '',
TeacherId: 0,
State: 0,
},
//公告column
columns: [{
name: 'title',
field: 'title',
label: '标题',
align: 'left'
},
{
name: 'Content',
field: 'Content',
label: '内容',
align: 'left',
},
{
name: 'CreatorName',
field: 'CreatorName',
label: '上传者',
align: 'left'
},
{
name: 'source',
field: 'source',
label: '素材来源',
align: 'left'
},
{
name: 'Type',
field: 'Type',
label: '类型',
align: 'left'
},
{
name: 'UpdateTime',
field: 'UpdateTime',
label: '添加时间',
align: 'left'
},
{
name: 'optioned',
label: '操作',
field: 'DeptId'
}
],
}
},
created() {
}, },
methods: { allclassifyList: {
changePage(e){ type: Array,
default: [],
}
},
data() {
return {
loading: false,
Isadd: false,
ISsystem: false,
editobj:null,
showtype:1,
msg: {
pageIndex: 1,
pageSize: 10,
rowsPerPage: 10,
},
//公告column
columns: [{
name: 'title',
field: 'title',
label: '标题',
align: 'left'
}, },
goadd(){ {
this.$router.push({ name: 'Content',
path:'/enterprise/addWelcome', field: 'Content',
}); label: '内容',
align: 'left',
},
{
name: 'UpdateByName',
field: 'UpdateByName',
label: '上传者',
align: 'left'
},
{
name: 'MediumGroupName',
field: 'MediumGroupName',
label: '分组',
align: 'left'
},
{
name: 'TypeName',
field: 'TypeName',
label: '类型',
align: 'left'
},
{
name: 'UpdateTime',
field: 'UpdateTime',
label: '添加时间',
align: 'left'
},
{
name: 'optioned',
label: '操作',
field: 'DeptId'
} }
],
} }
},
created() {
},
methods: {
getType(row, name) {
let title = ''
let content = ''
if (row.Type == 1) {
title = row.TextModel.Title
content = row.TextModel.Content
} else if (row.Type == 2) {
title = row.ImageModel.ImageName
content = row.ImageModel.ImagePath
} else if (row.Type == 3) {
title = row.ImgTextModel.Title
content = row.ImgTextModel.ImgPath
} else if (row.Type == 4) {
title = row.AudioModel.AudioName
content = row.AudioModel.AudioPath
} else if (row.Type == 5) {
title = row.VideoModel.VideoName
content = row.VideoModel.VideoPath
} else if (row.Type == 6) {
title = row.AppletModel.Title
content = row.AppletModel.ImagePath
} else if (row.Type == 7) {
title = row.FileModel.FileName
content = row.FileModel.FilePath
}
if (name == 'title') {
return title
} else if (name == 'content') {
return content
}
},
showUpLoadFile(i) {
// 文件类型进行判断
if (
i.FileName.substring(
i.FileName.lastIndexOf(".") + 1,
i.FileName.length
).toUpperCase() == "PDF" ||
i.FileName.substring(
i.FileName.lastIndexOf(".") + 1,
i.FileName.length
).toUpperCase() == "TXT"
) {
this.previewPDF(i.Url);
} else {
window.open(
"https://view.officeapps.live.com/op/view.aspx?src=" + i.FilePath
);
}
},
goDetailed(row) {//删除
let delMsg = {
MediumIds: row.Id,
};
this.$q.dialog({
title: '提示信息',
message: '是否确定删除该素材?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
delWecharMediumInfo(delMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '删除成功!',
position: 'top'
})
this.$emit('editsuccess')
}
})
}).onCancel(() => {
});
},
plmove(row) {
this.dataList[row.rowIndex].check = !this.dataList[row.rowIndex].check
this.$emit('getmove')
},
goedit(row) {
this.editobj = {}
this.editobj.Id = row.Id;
this.editobj.MediaGroupId = row.MediaGroupId;
this.editobj.Type = row.Type;
if(row.Type==1){
this.editobj.TextModel = JSON.parse(JSON.stringify(row.TextModel));
}else if(row.Type==3){
this.editobj.ImgTextModel = JSON.parse(JSON.stringify(row.ImgTextModel));
}else if(row.Type==6){
this.editobj.AppletModel = JSON.parse(JSON.stringify(row.AppletModel));
}
this.showtype = row.Type.toString()
this.Isadd = true
},
getchildren(){
this.$emit('editsuccess')
this.Isadd = false
},
} }
}
</script>
</script>
<style>
.allmaterial .Sysuser_Date .el-input--prefix .el-input__inner { <style>
background-color: red; .allmaterial .Sysuser_Date .el-input--prefix .el-input__inner {
border: 0; background-color: red;
} border: 0;
}
.allmaterial .state-item {
padding: 2px 5px; .allmaterial .state-item {
border-radius: 3px; padding: 2px 5px;
text-align: center; border-radius: 3px;
font-size: 10px; text-align: center;
} font-size: 10px;
}
.allmaterial .frIdlist {
padding: 3px 10px; .allmaterial .frIdlist {
border-radius: 3px; padding: 3px 10px;
background: #EEEEEF; border-radius: 3px;
align-items: center; background: #EEEEEF;
justify-content: center; align-items: center;
margin-right: 5px; justify-content: center;
margin-bottom: 5px; margin-right: 5px;
cursor: pointer; margin-bottom: 5px;
} cursor: pointer;
}
.class-popover .q-pr-lg {
padding-right: 0; .class-popover .q-pr-lg {
margin-top: 20px; padding-right: 0;
} margin-top: 20px;
}
.allmaterial .el-date-editor.el-input {
width: 100%; .allmaterial .el-date-editor.el-input {
} width: 100%;
}
.allmaterial .el-date-editor.el-input input {
background-color: transparent !important; .allmaterial .el-date-editor.el-input input {
} background-color: transparent !important;
}
.allmaterial .el-range-editor .el-range-input {
background: none; .allmaterial .el-range-editor .el-range-input {
} background: none;
}
.Sysuser_Date .el-input__inner {
background: transparent !important; .Sysuser_Date .el-input__inner {
border: 0 !important; background: transparent !important;
} border: 0 !important;
.allmaterial .el-drawer.rtl{ }
overflow: inherit;
} .allmaterial .el-drawer.rtl {
</style> overflow: inherit;
}
\ No newline at end of file
.allmaterial .icon-excel,
.allmaterial .icon-pdf,
.allmaterial .icon-txt,
.allmaterial .icon-wenjian,
.allmaterial .icon-yasuobao,
.allmaterial .icon-shipin,
.allmaterial .icon-word {
font-size: 38px;
color: green;
line-height: 75px;
}
</style>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="textmaterial" style="padding: 0;margin: 0;"> <div class="textmaterial" style="padding: 0;margin: 0;">
<div class="page-content"> <div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table" <q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table no-bottom-table"
separator="none" title="" :data="dataList" :columns="columns" row-key="name"> separator="none" title="" :data="dataList" :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>
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
<q-btn flat size="xs" icon="edit" style="font-weight:400;color: #3FC4FF" class="q-mr-xs" <q-btn flat size="xs" icon="edit" style="font-weight:400;color: #3FC4FF" class="q-mr-xs"
label="编辑" @click="goedits(props.row)" /> label="编辑" @click="goedits(props.row)" />
<q-btn flat size="xs" icon="delete" style="font-weight:400;color: #3FC4FF" class="q-mr-xs" <q-btn flat size="xs" icon="edit" style="font-weight:400;color: #3FC4FF" class="q-mr-xs"
label="移动" @click="plmove(props)" />
<q-btn flat size="xs" icon="delete" color="negative" class="q-mr-xs"
label="删除" @click="goDetailed(props.row)" /> label="删除" @click="goDetailed(props.row)" />
</q-td> </q-td>
</template> </template>
...@@ -172,9 +174,11 @@ ...@@ -172,9 +174,11 @@
}).onCancel(() => { }).onCancel(() => {
}); });
},
plmove(row){
this.dataList[row.rowIndex].check = !this.dataList[row.rowIndex].check
this.$emit('getmove')
} }
} }
} }
......
...@@ -19,11 +19,11 @@ ...@@ -19,11 +19,11 @@
<q-tab :ripple="false" :name="x.Id" :label="x.Name" v-for="(x,y) in MediumList" :key="y" <q-tab :ripple="false" :name="x.Id" :label="x.Name" v-for="(x,y) in MediumList" :key="y"
@click="msg.Type = x.Id,resetSearch()" /> @click="msg.Type = x.Id,resetSearch()" />
</q-tabs> </q-tabs>
<!-- <div v-if="tabCheck=='1'" > <div v-if="tabCheck=='0'" >
 <allmaterial></allmaterial>  <allmaterial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren" @getmove="getmove"></allmaterial>
</div> --> </div>
<div v-if="tabCheck=='1'"> <div v-if="tabCheck=='1'">
 <textmaterial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren"></textmaterial>  <textmaterial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren" @getmove="getmove"></textmaterial>
</div> </div>
<div v-if="tabCheck=='2'"> <div v-if="tabCheck=='2'">
 <imgmaterial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren" @getdelete="getdelete" @getmove="getmove"></imgmaterial>  <imgmaterial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren" @getdelete="getdelete" @getmove="getmove"></imgmaterial>
...@@ -43,11 +43,18 @@ ...@@ -43,11 +43,18 @@
<div v-if="tabCheck=='7'"> <div v-if="tabCheck=='7'">
 <filematerial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren" @getdelete="getdelete" @getmove="getmove"></filematerial>  <filematerial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren" @getdelete="getdelete" @getmove="getmove"></filematerial>
</div> </div>
<div style="width: 100%;height: 50px;">
<el-pagination @current-change="changePage" style="float: right;margin-top: 9px;" layout="total,prev, pager, next, jumper"
:current-page.sync="msg.pageIndex" :page-size="msg.pageSize" :total='PageCount'>
</el-pagination>
</div>
<q-inner-loading :showing="loading">
<q-spinner-gears size="50px" color="primary" />
</q-inner-loading>
</div> </div>
<!-- <q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="PageCount" :input="true" @input="changePage" /> --> <!-- <q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="PageCount" :input="true" @input="changePage" /> -->
<el-pagination @current-change="changePage" style="float: right;" layout="total,prev, pager, next, jumper"
:current-page.sync="msg.pageIndex" :page-size="msg.pageSize" :total='PageCount'>
</el-pagination>
<q-dialog v-model="Ismove" persistent> <q-dialog v-model="Ismove" persistent>
<q-card style="width: 520px; max-width: 80vw;" class="addscfile"> <q-card style="width: 520px; max-width: 80vw;" class="addscfile">
<q-card-section> <q-card-section>
...@@ -107,13 +114,13 @@ ...@@ -107,13 +114,13 @@
return { return {
loading: false, loading: false,
PageCount: 0, PageCount: 0,
tabCheck: 1, tabCheck: 0,
msg: { msg: {
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
rowsPerPage: 10, rowsPerPage: 10,
MediaGroupId: 0,//分组 MediaGroupId: 0,//分组
Type: 1,//类型 Type: 0,//类型
Content: '', Content: '',
}, },
classifyList: [], classifyList: [],
...@@ -136,6 +143,11 @@ ...@@ -136,6 +143,11 @@
getMediumTypeList() { getMediumTypeList() {
getMediumTypeEnumList({}).then(res => { getMediumTypeEnumList({}).then(res => {
this.MediumList = res.Data this.MediumList = res.Data
let obj = {
Name: '全部',
Id: 0,
}
this.MediumList.unshift(obj)
}) })
}, },
getWeChatMediumGroupList() { getWeChatMediumGroupList() {
...@@ -150,17 +162,20 @@ ...@@ -150,17 +162,20 @@
}) })
}, },
getList() { getList() {
this.loading=true
getWeChatMediumPageList(this.msg).then(res => { getWeChatMediumPageList(this.msg).then(res => {
this.loading=false
this.dataList = res.Data.PageData; this.dataList = res.Data.PageData;
this.PageCount = res.Data.PageCount this.PageCount = res.Data.Count
this.dataList.forEach(x=>{ this.dataList.forEach(x=>{
x.check= false x.check= false
}) })
}) })
}, },
changePage(e) { changePage(e) {
this.msg.PageIndex = e; this.msg.pageIndex = e;
this.getList() this.getList()
}, },
resetSearch() { resetSearch() {
...@@ -317,4 +332,5 @@ ...@@ -317,4 +332,5 @@
justify-content: center; justify-content: center;
padding: 4px; padding: 4px;
} }
</style> </style>
\ No newline at end of file
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