Commit eed41121 authored by zhengke's avatar zhengke

修改

parent 0f7fd213
...@@ -577,6 +577,45 @@ export function SetSynvEduEmployee(data) { ...@@ -577,6 +577,45 @@ export function SetSynvEduEmployee(data) {
}) })
} }
//素材聊表
/**
* 获取素材类型枚举列表
*/
export function GetContributeMediumType(data) {
return request({
url: '/QYContribute/GetContributeMediumTypeEnumList',
method: 'post',
data
})
}
/**
* 获取素材分页列表
*/
export function GetContributeMediumPage(data) {
return request({
url: '/QYContribute/GetContributeMediumPageList',
method: 'post',
data
})
}
/**
* 获取平台类型
*/
export function GetContributePlatfrom(data) {
return request({
url: '/QYContribute/GetContributePlatfromList',
method: 'post',
data
})
}
......
This diff is collapsed.
<template>
<div class="imgmaterial" style="padding: 0;margin: 0;">
<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'
:style="{border:x.check==true?'2px solid #91d5ff':'2px solid #FFF'}"
@click="dataList[y].check = !dataList[y].check,$forceUpdate()">
<q-card-section>
<div style="display:flex;align-items: center;justify-content: space-between;margin-bottom: 5px;">
<span>{{x.UpdateTime}}</span>
</div>
<q-img :src="x.Path" class="imgstyle">
<div class="absolute-bottom text-subtitle1 text-center onetext"
style="padding: 0;padding: 0 5px;font-size: 12px;">
</div>
<q-icon v-if="x.Media_Id && x.Media_Id!=''" class="absolute all-pointer-events" size="20px"
name="iconfont icon-yiqueren" color="green" style="top: 8px; right: 8px">
<q-tooltip anchor="top middle" self="bottom middle" :offset="[10, 10]">
已更新
</q-tooltip>
</q-icon>
<q-icon v-if="x.Media_Id==''" class="absolute all-pointer-events" size="20px"
name="iconfont icon-weiwancheng" color="red" style="top: 8px; right: 8px">
<q-tooltip anchor="top middle" self="bottom middle" :offset="[10, 10]">
未更新
</q-tooltip>
</q-icon>
</q-img>
<div class="onetext" style="margin-top: 5px;">上传者:{{x.UpdateBy}}</div>
<div class="onetext" style="margin-top: 5px;">分组:{{x.MediaName}}</div>
</q-card-section>
</q-card>
</div>
<div style="width: 100%;height: 50px;line-height: 50px;text-align: center;" v-if="dataList.length==0">暂无数据
</div>
</div>
<div v-if="Isadd==true">
<alladdsc :allclassifyList="allclassifyList" type='2' @editsuccess="getchildren" :editobj='editobj'
@getcancel='Isadd=false'></alladdsc>
</div>
</div>
</template>
<script>
import alladdsc from '../components/alladdsc'
export default {
name: "imgmaterial",
components: {
alladdsc
},
props: {
dataList: {
type: Array,
default: [],
},
allclassifyList: {
type: Array,
default: [],
}
},
data() {
return {
loading: false,
Isadd: false,
editobj: null
}
},
created() {
},
methods: {
goadd() {
this.Isadd = true;
this.editobj = null
},
goedit(row) {
this.editobj = {}
this.editobj.Id = row.Id;
this.editobj.MediaGroupId = row.MediaGroupId;
this.editobj.Type = row.Type;
this.editobj.ImageModel = JSON.parse(JSON.stringify(row.ImageModel));
this.Isadd = true
},
getchildren() {
this.$emit('editsuccess')
this.Isadd = false
},
pldelete() {
this.$emit('getdelete')
},
plmove() {
this.$emit('getmove')
}
}
}
</script>
<style>
.imgmaterial .Sysuser_Date .el-input--prefix .el-input__inner {
background-color: red;
border: 0;
}
.imgmaterial .state-item {
padding: 2px 5px;
border-radius: 3px;
text-align: center;
font-size: 10px;
}
.imgmaterial .frIdlist {
padding: 3px 10px;
border-radius: 3px;
background: #EEEEEF;
align-items: center;
justify-content: center;
margin-right: 5px;
margin-bottom: 5px;
cursor: pointer;
}
.class-popover .q-pr-lg {
padding-right: 0;
margin-top: 20px;
}
.imgmaterial .el-date-editor.el-input {
width: 100%;
}
.imgmaterial .el-date-editor.el-input input {
background-color: transparent !important;
}
.imgmaterial .el-range-editor .el-range-input {
background: none;
}
.Sysuser_Date .el-input__inner {
background: transparent !important;
border: 0 !important;
}
.imgmaterial .el-drawer.rtl {
overflow: inherit;
}
.imgmaterial .imgcard {
width: 240px;
margin: 0 15px 15px 0
}
.imgmaterial .imgstyle {
width: 100%;
height: 120px;
border-radius: 0;
}
.imgmaterial .onetext {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 208px;
}
</style>
<template>
<div class="materialManage page-body">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-select filled @input="resetSearch" option-value="Id" option-label="Name"
v-model="msg.MediaGroupId" ref="Id" :options="classifyList" label="分组" :dense="false" emit-value
map-options />
</div>
<div class="col-3">
<q-input @keyup.enter.native="resetSearch" @clear="resetSearch()" clearable filled
v-model="msg.MediaName" label="输入搜索内容" maxlength="20" />
</div>
</div>
</div>
<div class="page-content">
<q-tabs style="margin-bottom:20px;" v-model="tabCheck" narrow-indicator dense align="left" class="text-primary">
<q-tab :ripple="false" :name="x.Id" :label="x.Name" v-for="(x,y) in MediumList" :key="y"
@click="msg.Type = x.Id,resetSearch()" />
</q-tabs>
<div v-if="tabCheck=='1'" >
 <imgmaterial :dataList='dataList' :allclassifyList='allclassifyList' @editsuccess="getchildren" @getdelete="getdelete" @getmove="getmove"></imgmaterial>
</div>
</div>
</div>
</template>
<script>
import {
GetContributeMediumType,
getWeChatMediumGroupList,
GetContributeMediumPage
} from '../../../api/system/wechat';
import imgmaterial from '../components/imgmaterial'
import BenzAMRRecorder from 'benz-amr-recorder'
export default {
components: {
imgmaterial
},
meta: {
title: "素材库"
},
name: "materialManage",
data() {
return {
loading: false,
PageCount: 0,
tabCheck: 1,
msg: {
pageIndex: 1,
pageSize: 10,
rowsPerPage: 10,
MediaGroupId: 0, //分组
Type: 1, //类型
MediaName: '',
},
classifyList: [],
MediumList: [],
dataList: [],
allclassifyList: [],
Ismove: false,
moveMsg: {
MediumIds: '',
MediumGroupId: '',
}
}
},
created() {},
mounted() {
this.getMediumTypeList() //素材类型枚举
this.getWeChatMediumGroupList() //素材分组
this.getList()//获取列表数据
},
methods: {
getMediumTypeList() {
GetContributeMediumType({}).then(res => {
this.MediumList = res.Data
})
},
getWeChatMediumGroupList() {
getWeChatMediumGroupList({}).then(res => {
this.classifyList = res.Data
this.allclassifyList = JSON.parse(JSON.stringify(res.Data))
let obj = {
Name: '全部',
Id: 0,
}
this.classifyList.unshift(obj)
})
},
getList() {
this.loading = true
console.log('111111111');
if (this.tabCheck == 0 || this.tabCheck == 1) {
this.msg.pageSize = 15
} else if (this.tabCheck == 2 || this.tabCheck == 3 || this.tabCheck == 6) {
this.msg.pageSize = 12
} else if (this.tabCheck == 4 || this.tabCheck == 5 || this.tabCheck == 7) {
this.msg.pageSize = 10
}
GetContributeMediumPage(this.msg).then(res => {
this.loading = false
this.dataList = res.Data.PageData;
this.PageCount = res.Data.Count
this.dataList.forEach(x => {
x.check = false;
let amr = new BenzAMRRecorder()
if (x.Type == 4 && x.AudioModel != null) {
x.timevalue = 0;
amr.initWithUrl(x.AudioModel.AudioPath).then(function () {
x.duration = amr.getDuration()
}).catch((e) => {
})
}
})
console.log(this.dataList,'主页');
})
.catch(err => {
this.loading = false
})
},
changePage(e) {
if (this.tabCheck == 0 || this.tabCheck == 4) {
this.$refs.allm.stopPlayVoice()
}
this.msg.pageIndex = e;
this.getList()
},
resetSearch() {
this.msg.pageIndex = 1;
this.getList()
},
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()
})
}
}
}
</script>
<style>
.materialManage .Sysuser_Date .el-input--prefix .el-input__inner {
background-color: red;
border: 0;
}
.materialManage .state-item {
padding: 2px 5px;
border-radius: 3px;
text-align: center;
font-size: 10px;
}
.materialManage .frIdlist {
padding: 3px 10px;
border-radius: 3px;
background: #EEEEEF;
align-items: center;
justify-content: center;
margin-right: 5px;
margin-bottom: 5px;
cursor: pointer;
}
.class-popover .q-pr-lg {
padding-right: 0;
margin-top: 20px;
}
.materialManage .el-date-editor.el-input {
width: 100%;
}
.materialManage .el-date-editor.el-input input {
background-color: transparent !important;
}
.materialManage .el-range-editor .el-range-input {
background: none;
}
.Sysuser_Date .el-input__inner {
background: transparent !important;
border: 0 !important;
}
.materialManage .el-drawer.rtl {
overflow: inherit;
}
.materialupload {
width: 118px;
height: 118px;
border-radius: 4px;
border: 1px dashed #d9d9d9;
background: #fafafa;
display: flex;
align-items: center;
justify-content: center;
padding: 4px;
}
</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