Commit 800df0df authored by Mac's avatar Mac

1

parent adf8ef09
......@@ -140,4 +140,16 @@ export function SetSynvEduEmployee(data) {
method: 'post',
data
})
}
/**
* 素材管理 素材移动
*
*/
export function setWecharMediumMore(data) {
return request({
url: '/QYWeChat/SetWecharMediumMore',
method: 'post',
data
})
}
\ No newline at end of file
......@@ -305,7 +305,7 @@
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn class="q-mr-md" label="取消" @click="getcancel" />
<q-btn color="accent" class="q-mr-md" label="添加" @click="savefile()" />
<q-btn color="accent" class="q-mr-md" label="确定" @click="savefile()" />
</q-card-actions>
</q-card>
</q-dialog>
......
......@@ -5,6 +5,10 @@
<div>
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="add" label="添加小程序"
@click="goadd()"></q-btn>
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="delete" label="批量删除"
@click="pldelete()"></q-btn>
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="edit" label="修改分组"
@click="plmove()"></q-btn>
</div>
<div style="width: 100%;display: flex;align-items: center;flex-wrap: wrap;padding: 10px 20px;" v-if="dataList.length>0">
<q-card class="imgcard" v-for="(x,y) in dataList" :key='y'
......@@ -85,6 +89,12 @@
this.$emit('editsuccess')
this.Isadd = false
},
pldelete(){
this.$emit('getdelete')
},
plmove(){
this.$emit('getmove')
}
}
}
......
......@@ -3,8 +3,12 @@
<div class="page-content">
<div>
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="add" label="上传音频"
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="cloud_upload" label="上传音频"
@click="goadd()"></q-btn>
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="delete" label="批量删除"
@click="pldelete()"></q-btn>
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="edit" label="修改分组"
@click="plmove()"></q-btn>
</div>
<div style="width: 100%;display: flex;align-items: center;flex-wrap: wrap;padding: 10px 20px;" v-if="dataList.length>0">
<q-card class="imgcard" v-for="(x,y) in dataList" :key='y'
......@@ -15,8 +19,8 @@
style="display:flex;align-items: center;justify-content: space-between;margin-bottom: 5px;">
<span>{{x.UpdateTime}}</span>
<!-- <q-btn class="q-mr-md" label="编辑" size="xs" color="accent" style="margin-right: 0;" @click.stop="goedit(x)" /> -->
<i class="el-icon-edit-outline" style="font-size: 20px;color: #1890ff;"
@click.stop="goedit(x)"></i>
<!-- <i class="el-icon-edit-outline" style="font-size: 20px;color: #1890ff;"
@click.stop="goedit(x)"></i> -->
</div>
<audio controls="controls" v-if='x.AudioModel && x.AudioModel.AudioPath' style="margin-top: 10px;" class="imgstyle">
<source :src="x.AudioModel.AudioPath" type="audio/ogg">
......@@ -85,47 +89,12 @@
this.Isadd = false
},
uploadFile(file) {//图片上传
// 文件类型进行判断
const isAudio = file.type === "audio/mp3" || file.type === "audio/mpeg";
const isLt2M = file.size / 1024 / 1024 < 2;
const isTime60S = this.getTimes(file) >= 60 ? true : false;
// 获取时长
;
if (!isAudio) {
this.$q.notify({
type: 'negative',
message: `上传文件只能是Mp3格式!`,
position: 'top'
})
} else {
if (!isLt2M) {
this.$q.notify({
type: 'negative',
message: `上传文件大小不能超过 2MB!!`,
position: 'top'
})
} else {
if (isTime60S) {
this.$q.notify({
type: 'negative',
message: `上传文件时长不能超过60秒!!`,
position: 'top'
})
} else {
UploadSelfFile("course", file, res => {
if (res.Code == 1) {
this.addMsg.img = res.FileUrl;
}
});
}
}
}
pldelete(){
this.$emit('getdelete')
},
plmove(){
this.$emit('getmove')
}
}
......
......@@ -3,8 +3,12 @@
<div class="page-content">
<div>
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="add" label="上传文件"
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="cloud_upload" label="上传文件"
@click="goadd()"></q-btn>
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="delete" label="批量删除"
@click="pldelete()"></q-btn>
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="edit" label="修改分组"
@click="plmove()"></q-btn>
</div>
<div style="width: 100%;display: flex;align-items: center;flex-wrap: wrap;padding: 10px 20px;"
v-if="dataList.length>0">
......@@ -16,8 +20,8 @@
style="display:flex;align-items: center;justify-content: space-between;margin-bottom: 5px;">
<span>{{x.UpdateTime}}</span>
<!-- <q-btn class="q-mr-md" label="编辑" size="xs" color="accent" style="margin-right: 0;" @click.stop="goedit(x)" /> -->
<i class="el-icon-edit-outline" style="font-size: 20px;color: #1890ff;"
@click.stop="goedit(x)"></i>
<!-- <i class="el-icon-edit-outline" style="font-size: 20px;color: #1890ff;"
@click.stop="goedit(x)"></i> -->
</div>
<div class="iconfontfile " v-if="x.FileModel && x.FileModel.FilePath!=''"
......@@ -96,6 +100,12 @@
this.$emit('editsuccess')
this.Isadd = false
},
pldelete(){
this.$emit('getdelete')
},
plmove(){
this.$emit('getmove')
},
showUpLoadFile(i) {
// 文件类型进行判断
......
......@@ -3,8 +3,13 @@
<div class="page-content">
<div>
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="cloud_upload" label="上传图片"
@click="goadd()"></q-btn>
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="delete" label="批量删除"
@click="pldelete()"></q-btn>
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="edit" label="修改分组"
@click="plmove()"></q-btn>
</div>
<div style="width: 100%;display: flex;align-items: center;flex-wrap: wrap;padding: 10px 20px;" v-if="dataList.length>0">
<q-card class="imgcard" v-for="(x,y) in dataList" :key='y'
......@@ -15,7 +20,7 @@
style="display:flex;align-items: center;justify-content: space-between;margin-bottom: 5px;">
<span>{{x.UpdateTime}}</span>
<!-- <q-btn class="q-mr-md" label="编辑" size="xs" color="accent" style="margin-right: 0;" @click.stop="goedit(x)" /> -->
<i class="el-icon-edit-outline" style="font-size: 20px;color: #1890ff;" @click.stop="goedit(x)"></i>
<!-- <i class="el-icon-edit-outline" style="font-size: 20px;color: #1890ff;" @click.stop="goedit(x)"></i> -->
</div>
<q-img :src="x.ImageModel && x.ImageModel.ImagePath?x.ImageModel.ImagePath:''" class="imgstyle">
<div class="absolute-bottom text-subtitle1 text-center onetext"
......@@ -86,6 +91,12 @@
this.$emit('editsuccess')
this.Isadd = false
},
pldelete(){
this.$emit('getdelete')
},
plmove(){
this.$emit('getmove')
}
}
}
......
......@@ -5,6 +5,10 @@
<div>
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="add" label="添加图文"
@click="goadd()"></q-btn>
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="delete" label="批量删除"
@click="pldelete()"></q-btn>
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="edit" label="修改分组"
@click="plmove()"></q-btn>
</div>
<div style="width: 100%;display: flex;align-items: center;flex-wrap: wrap;padding: 10px 20px;">
<q-card class="imgcard" v-for="(x,y) in dataList" :key='y'
......@@ -84,6 +88,12 @@
this.$emit('editsuccess')
this.Isadd = false
},
pldelete(){
this.$emit('getdelete')
},
plmove(){
this.$emit('getmove')
}
}
}
......
......@@ -3,8 +3,12 @@
<div class="page-content">
<div>
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="add" label="上传视频"
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="cloud_upload" label="上传视频"
@click="goadd()"></q-btn>
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="delete" label="批量删除"
@click="pldelete()"></q-btn>
<q-btn color="accent" style="float:right;" size="sm" class="q-mr-md" icon="edit" label="修改分组"
@click="plmove()"></q-btn>
</div>
<div style="width: 100%;display: flex;align-items: center;flex-wrap: wrap;padding: 10px 20px;" v-if="dataList.length>0">
<q-card class="imgcard" v-for="(x,y) in dataList" :key='y'
......@@ -15,8 +19,8 @@
style="display:flex;align-items: center;justify-content: space-between;margin-bottom: 5px;">
<span>{{x.UpdateTime}}</span>
<!-- <q-btn class="q-mr-md" label="编辑" size="xs" color="accent" style="margin-right: 0;" @click.stop="goedit(x)" /> -->
<i class="el-icon-edit-outline" style="font-size: 20px;color: #1890ff;"
@click.stop="goedit(x)"></i>
<!-- <i class="el-icon-edit-outline" style="font-size: 20px;color: #1890ff;"
@click.stop="goedit(x)"></i> -->
</div>
<video width="260" height="180" controls="controls" v-if="x.VideoModel && x.VideoModel.VideoPath">
<source :src="x.VideoModel.VideoPath" type="video/ogg" />
......@@ -87,15 +91,12 @@
this.$emit('editsuccess')
this.Isadd = false
},
uploadFile(file) {//图片上传
UploadSelfFile("course", file, res => {
if (res.Code == 1) {
this.addMsg.img = res.FileUrl;
}
});
pldelete(){
this.$emit('getdelete')
},
plmove(){
this.$emit('getmove')
}
}
}
......
......@@ -26,29 +26,46 @@
 <textmaterial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren"></textmaterial>
</div>
<div v-if="tabCheck=='2'">
 <imgmaterial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren"></imgmaterial>
 <imgmaterial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren" @getdelete="getdelete" @getmove="getmove"></imgmaterial>
</div>
<div v-if="tabCheck=='3'">
 <imgtextmaterial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren"></imgtextmaterial>
 <imgtextmaterial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren" @getdelete="getdelete" @getmove="getmove"></imgtextmaterial>
</div>
<div v-if="tabCheck=='4'">
 <audiomaterial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren"></audiomaterial>
 <audiomaterial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren" @getdelete="getdelete" @getmove="getmove"></audiomaterial>
</div>
<div v-if="tabCheck=='5'">
 <videomaterial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren"></videomaterial>
 <videomaterial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren" @getdelete="getdelete" @getmove="getmove"></videomaterial>
</div>
<div v-if="tabCheck=='6'">
 <appletmaterial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren"></appletmaterial>
 <appletmaterial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren" @getdelete="getdelete" @getmove="getmove"></appletmaterial>
</div>
<div v-if="tabCheck=='7'">
 <filematerial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren"></filematerial>
 <filematerial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren" @getdelete="getdelete" @getmove="getmove"></filematerial>
</div>
</div>
<!-- <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-card style="width: 520px; max-width: 80vw;" class="addscfile">
<q-card-section>
<div class="text-h6">选择分组</div>
</q-card-section>
<q-separator />
<q-card-section class="q-pt-none" style="margin-top: 15px;padding: 20px;">
<q-select filled stack-label option-value="Id" option-label="Name" v-model="moveMsg.MediumGroupId"
@input="$forceUpdate()" ref="Id" :options="allclassifyList" label="分组" :dense="false"
emit-value map-options />
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn class="q-mr-md" label="取消" @click="Ismove=false" />
<q-btn color="accent" class="q-mr-md" label="确定" @click="savemove()" />
</q-card-actions>
</q-card>
</q-dialog>
</div>
</template>
......@@ -59,6 +76,8 @@
getWeChatMediumGroupList,
getWeChatMediumPageList,
setWeChatMediumInfo,//新增修改素材
delWecharMediumInfo,//删除
setWecharMediumMore,//批量分组
} from '../../api/system/wechat';
import allmaterial from '../../components/enterprise/material/allmaterial'
import textmaterial from '../../components/enterprise/material/textmaterial'
......@@ -100,7 +119,12 @@
classifyList: [],
MediumList: [],
dataList: [],
allclassifyList: []
allclassifyList: [],
Ismove:false,
moveMsg:{
MediumIds:'',
MediumGroupId:'',
}
}
},
created() {
......@@ -145,6 +169,86 @@
},
getchildren(addMsg) {//子级过来的新增和修改
this.getList()
},
getdelete(){//批量删除
let data= []
this.dataList.forEach(x=>{
if(x.check == true){
data.push(x.Id)
}
})
if(data.length==0){
this.$q.notify({
type: 'negative',
message: `请选择删除的对象`,
position: 'top'
})
return
}
let msg = data.join(',')
this.$q.dialog({
title: '提示信息',
message: '是否确定删除所选素材?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
delWecharMediumInfo({MediumIds:msg}).then(res => {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: res.Message,
position: 'top'
})
this.getList()
})
}).onCancel(() => {
});
},
getmove(){
let data= []
this.dataList.forEach(x=>{
if(x.check == true){
data.push(x.Id)
}
})
if(data.length==0){
this.$q.notify({
type: 'negative',
message: `请选择分组的对象`,
position: 'top'
})
return
};
this.moveMsg.MediumIds = data.join(',')
this.Ismove = true
},
savemove(){
if (this.moveMsg.MediumGroupId == '') {
this.$q.notify({
type: 'negative',
message: `请选择分组选择`,
position: 'top'
})
return
}
setWecharMediumMore(this.moveMsg).then(res => {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: res.Message,
position: 'top'
})
this.Ismove = false
this.moveMsg.MediumGroupId = ''
this.getList()
})
}
}
......
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