Commit d791a8fb authored by Mac's avatar Mac

1

parent 52862d5f
......@@ -28,4 +28,53 @@ export function delContributeMediumGroup(data) {
method: 'post',
data
})
}
// 获取投稿类型枚举列表
export function getContributeInfoTypeEnumList(data) {
return request({
url: '/QYContribute/GetContributeInfoTypeEnumList',
method: 'post',
data
})
}
// 获取投稿状态枚举列表
export function getContributeInfoStateEnumList(data) {
return request({
url: '/QYContribute/GetContributeInfoStateEnumList',
method: 'post',
data
})
}
// 获取我的投稿分页列表
export function getMyContributeInfoPageList(data) {
return request({
url: '/QYContribute/GetMyContributeInfoPageList',
method: 'post',
data
})
}
// 设置投稿状态
export function setContributeInfoState(data) {
return request({
url: '/QYContribute/SetContributeInfoState',
method: 'post',
data
})
}
// 设置投稿状态
export function setContributeInfo(data) {
return request({
url: '/QYContribute/SetContributeInfo',
method: 'post',
data
})
}
// 获取投稿详情
export function getContributeInfo(data) {
return request({
url: '/QYContribute/GetContributeInfo',
method: 'post',
data
})
}
\ No newline at end of file
......@@ -8,7 +8,7 @@
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>">
<meta name="referrer" content="never">
<link rel="icon" type="image/png" sizes="128x128" href="icons/favicon-128x128.png">
<link rel="icon" type="image/png" sizes="96x96" href="icons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png">
......
......@@ -300,7 +300,7 @@
goDetailed(row) {//删除
this.$q.dialog({
title: '提示信息',
message: '是否确定删除此欢迎语?',
message: '是否确定删除此欢迎语?',
cancel: true,
persistent: true,
ok: "确定",
......
......@@ -218,9 +218,17 @@
PageSelect(item) {
this.emitmsg = [];
console.log(item,'item');
let url = ''
if(this.type==1){
url = item.ImageUrl
}else if(this.type==2){
url = item.Media_Id
}else if(this.type==3){
url = item.VideoWXPath
}
this.emitmsg.push({
selectId: item.Id,
url: item.Path,
url: url,
Name:item.MediaName
});
this.selectId = item.Id;
......
......@@ -2,8 +2,9 @@
.addimageText {
width: 100%;
height: 100%;
margin: 15px;
display: flex;
justify-content: center;
background: rgba(0, 0, 0, 0.03);
}
.box_l {
......@@ -18,10 +19,8 @@
}
.box_r {
flex: 1;
width: 1px;
width: 800px;
background: #FFF;
border-radius: 9px;
padding: 15px;
margin-right: 30px;
overflow: auto;
......@@ -54,7 +53,7 @@
</style>
<template>
<div class="addimageText">
<div class="box_l" style="display:none;">
<!-- <div class="box_l" style="display:none;">
<div class="box_l_center">
<div class="appmsg_account">
<img style="width: 24px;height: 24px;border-radius: 50%;margin-right: 10px;"
......@@ -73,37 +72,58 @@
</div>
</div>
</div>
</div> -->
<div class="box_r">
<div style="width: 100%;display: flex;align-items: center;justify-content: center;">
<q-btn-group push>
<q-btn-dropdown push label="图片">
<q-list>
<q-item>
<el-upload :action="importFileUrl2"
:multiple="false" :on-success="successUpload" :show-file-list="false"
accept="image/gif,image/jpeg,image/png,image/jpg,image/bmp">
<el-upload :action="importFileUrl2" :multiple="false" :on-success="successUpload"
:show-file-list="false" accept="image/gif,image/jpeg,image/png,image/jpg,image/bmp">
本地上传
</el-upload>
</q-item>
<q-item clickable v-close-popup @click="getChoice(1)">
<q-item clickable v-close-popup @click="getChoice(1),iscover=false">
从图片库选择
</q-item>
</q-list>
</q-btn-dropdown>
<q-btn push label="视频" @click="getChoice(3)"/>
<q-btn push label="音频" @click="getChoice(2)"/>
<q-btn push label="超链接" @click="hyperlinks"/>
<q-btn push label="视频" @click="getChoice(3)" />
<q-btn push label="音频" @click="getChoice(2)" />
<q-btn push label="超链接" @click="hyperlinks" />
<q-btn push label="小程序" />
</q-btn-group>
</div>
<q-input clearable filled v-model="Name" label="标题" maxlength="64" style="margin-top: 20px;"/>
<q-input clearable filled v-model="author" label="作者" maxlength="8"
<q-input clearable filled v-model="addMsg.Title" label="标题" maxlength="64" counter
style="margin-top: 20px;" />
<q-input clearable filled v-model="addMsg.Author" label="作者" maxlength="8" counter
style="margin-top: 20px;" />
<div style="margin-top: 20px;">
<contributionUE :config="config" ref="UE_cb"></contributionUE>
<contributionUE :config="config" ref="UE_cb" @input="getcontnet" v-model="addMsg.Content" ></contributionUE>
</div>
<div style="display: flex;align-items: flex-start;margin-top: 20px;">
<div v-if=" addMsg.CoverImageId==0"
style="width:210px;height:90px;border:2px dashed #ebebeb;display: flex;align-items: center;justify-content: center;flex-direction: column;"
@click="getChoice(1),iscover=true">
<span style="font-size: 40px;">+</span>
<span style="display: block; color: #7e8081;font-size: 14px;">选择封面</span>
</div>
<div v-if="addMsg.CoverImageId && addMsg.CoverImageId>0 && coverimg!='' "
style="width:210px;height:90px" @click="getChoice(1),iscover=true">
<el-image style="width: 100%; height: 100%" :src="coverimg" fit="cover"></el-image>
</div>
<q-input clearable filled v-model="addMsg.Description" label="描述/摘要" maxlength="120" counter
type="textarea" bottom-slots style="margin-left: 20px;width: 500px;" />
</div>
<q-btn color="accent" class="q-mr-md" label="暂存" @click="savemove(0)" style="width: 100px;"
:loading="loading" />
<q-btn color="accent" class="q-mr-md" label="保存" @click="savemove(1)" style="width: 100px;"
:loading="loading" />
<q-btn class="q-mr-md" label="返回" @click="goblck()" style="width: 60px;" />
</div>
<!-- 选择文件 -->
<q-dialog title="选择文件" v-model="getImgChoice" width="1200px">
......@@ -115,6 +135,10 @@
<script>
import contributionUE from './ue/contributionUE'
import ChooseImg from '../components/ChooseImg'
import {
setContributeInfo,
getContributeInfo
} from '../../../api/teacher/contribution';
export default {
meta: {
title: "新增/修改图文"
......@@ -127,66 +151,134 @@
data() {
return {
select: 1,
list: [{ Id: 1, Name: '' }, { Id: 2, Name: '23' }],
Name: '',
author: '',
list: [],
config: {
initialFrameWidth: null,
initialFrameHeight: 300,
zIndex:99
initialFrameHeight: 500,
zIndex: 99
},
importFileUrl2: this.domainManager().UploadFileUrl2,
getImgChoice:false,
type:-1
getImgChoice: false,
type: -1,
ContributionType: 1,//进入的类型
addMsg: {
Id: 0,
Type: 1,
CoverImageId: 0,
Title: '',
Author: '',
Description: '',
VideoMediumId: 0,
ImageList: [],
Content: '',
AuditState: 0
},
loading: false,
iscover: false,//是否选择封面
coverimg: '',
}
},
created() {
if (this.$route.query && this.$route.query.type) {
this.addMsg.Type = this.$route.query.type
}
if (this.$route.query && this.$route.query.Id) {//编辑
this.addMsg.Id = this.$route.query.Id;
this.getdetails()//获取投稿详情
}
},
mounted() {
},
methods: {
getChoice(type){
this.getImgChoice=true;
this.type=type;
getdetails(){
getContributeInfo({ContributeId:this.addMsg.Id}).then(res => {
if (res.Code == 1) {
this.addMsg = res.Data
this.coverimg = res.Data.CoverImagePath
}
}).catch(() => {
})
},
getChoice(type) {
this.getImgChoice = true;
this.type = type;
},
//选择图片
SelectId(obj){
if(obj){
let data = [{
fileName:obj.Name,
fileUrl: obj.url
}]
if(this.type==1){
this.$refs.UE_cb.instertImage(data)
}
if(this.type==2){
this.$refs.UE_cb.insertaudio(data)
}
if(this.type==3){
this.$refs.UE_cb.insertVideo(data)
SelectId(obj) {
if (obj) {
let data = [{
fileName: obj.Name,
fileUrl: obj.url
}]
if (this.type == 1) {
if (this.iscover == true) {//选择的封面图
this.coverimg = obj.url;
console.log(obj)
this.addMsg.CoverImageId = obj.selectId
} else {//选择图片插入富文本
this.$refs.UE_cb.instertImage(data)
}
}
if (this.type == 2) {
this.$refs.UE_cb.insertaudio(data)
}
if (this.type == 3) {
this.$refs.UE_cb.insertVideo(data)
}
this.getImgChoice = false;
}
this.getImgChoice=false;
}
},
successUpload(file) {
console.log(file,'file');
console.log(file, 'file');
if (file.Code == 1) {
let data = [{
fileName:file.Data.Name,
fileUrl: this.domainManager().DomainUrl+''+file.Data.HttpPath
fileName: file.Data.Name,
fileUrl: this.domainManager().DomainUrl + '' + file.Data.HttpPath
}]
console.log(data,'data');
console.log(data, 'data');
this.$refs.UE_cb.instertImage(data)
}
},
hyperlinks(){
hyperlinks() {
// <a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzU3OTUwMjg4OQ==&amp;mid=2247489291&amp;idx=1&amp;sn=3c31ecd91398b9ba04baf03451add5bd&amp;chksm=fd64414dca13c85b2e42aa6e8ec071538dccf54edd7d6580fd7f9cfeef67823ce3f6f33e9dd3#rd" data-itemshowtype="0" tab="innerlink">散步看日本「会津若松」</a>
let data = [{
fileName:'散步看日本「会津若松」',
fileName: '散步看日本「会津若松」',
fileUrl: "http://mp.weixin.qq.com/s?__biz=MzU3OTUwMjg4OQ==&amp;mid=2247489291&amp;idx=1&amp;sn=3c31ecd91398b9ba04baf03451add5bd&amp;chksm=fd64414dca13c85b2e42aa6e8ec071538dccf54edd7d6580fd7f9cfeef67823ce3f6f33e9dd3#rd"
}]
this.$refs.UE_cb.hyperlinks(data)
}
},
getcontnet(data){
console.log(data)
this.addMsg.Content = data
},
savemove(type) {
this.loading = true
setContributeInfo(this.addMsg).then(res => {
this.loading = false
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: res.Message,
position: 'top'
})
this.goblck()
}
}).catch(() => {
})
},
goblck() {//返回上一个页面
this.$router.push({
path: '/teacher/contribution/imageTextlist',
});
},
}
}
......
<template>
<div class="page-body">
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="新增素材"
@click="addimgtext(null)" />
<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 stack-label @input="changePage(1)" option-value="Id" option-label="Name"
v-model="msg.Type" ref="Id" :options="TypeList" label="类型" :dense="false" emit-value
map-options />
</div>
<div class="col-3">
<q-select filled stack-label @input="changePage(1)" option-value="Id" option-label="Name"
v-model="msg.AuditState" ref="Id" :options="StateList" label="状态" :dense="false" emit-value
map-options />
</div>
<div class="col-3">
<q-input @keyup.enter.native="changePage(1)" @clear="changePage(1)" clearable
standout="bg-primary text-white" v-model="msg.Title" label="输入标题内容" maxlength="20" />
</div>
</div>
</div>
<div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table"
separator="none" title="" :data="data" :columns="columns" row-key="name">
<template v-slot:top="props">
<div class="col-2 q-table__title">图文素材</div>
<q-space />
<q-btn-dropdown color="accent" size="sm" class="q-mr-md" style="float:right;margin-right:0;"
label="新增创作">
<q-list>
<q-item clickable v-close-popup @click="goadd(x.Id)" v-for="(x,y) in TypeList2" :key="y">
<q-item-section>
<q-item-label>{{x.Name}}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</template>
<template v-slot:body-cell-CoverImagePath="props">
<el-image style="width: 200px;height: 100px;padding: 10px 0 ;" :src="props.row.CoverImagePath" fit="cover"></el-image>
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<!-- <q-btn flat size="xs" icon="iconfont icon-view" style="font-weight:400;color: #3FC4FF"
class="q-mr-xs" label="详情" @click="viewDetails(props.row)" /> -->
<q-btn flat size="xs" icon="edit" style="font-weight:400;color: #3FC4FF" class="q-mr-xs"
label="编辑" @click="goedit(props.row)" />
<q-btn flat size="xs" icon="delete" color="negative" class="q-mr-xs" label="删除"
@click="goDetailed(props.row)" />
</q-td>
</template>
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary"
:max="pageCount" :input="true" @input="changePage" />
</template>
</q-table>
</div>
</div>
</template>
<script>
import {
getContributeInfoTypeEnumList,
getContributeInfoStateEnumList,
getMyContributeInfoPageList,
setContributeInfoState
} from '../../../api/teacher/contribution';
export default {
meta: {
......@@ -16,25 +74,162 @@
data() {
return {
loading: false,
msg: {
pageIndex: 1,
pageSize: 15,
rowsPerPage: 15,
Name: "", //系列名称
AuditState: "-1", //审核状态
Type: '-1',//类型
Title: '',//标题
},
TypeList: [],//类型
TypeList2: [],//类型
StateList: [],//状态
data: [],
pageCount: 0,
columns: [{
name: 'Id',
label: 'Id',
field: 'Id',
align: 'left'
},
{
name: 'TypeName',
field: 'TypeName',
label: '类型',
align: 'left',
},
{
name: 'CoverImagePath',
field: 'CoverImagePath',
label: '封面图',
align: 'left'
},
{
name: 'Title',
field: 'Title',
label: '标题',
align: 'left'
},
{
name: 'AuditStateName',
field: 'AuditStateName',
label: '审核状态',
align: 'left'
},
{
name: 'UpdateByName',
field: 'UpdateByName',
label: '创建者',
align: 'left'
},
{
name: 'UpdateTime',
field: 'UpdateTime',
label: '创建时间',
align: 'left'
},
{
name: 'optioned',
label: '操作',
field: 'DeptId'
}
],
}
},
mounted() {
this.getTypeList()
this.getStateList()
this.getList()
},
methods: {
addimgtext(){
this.$router.push({
path: '/teacher/contribution/addimageText',
getTypeList() {
getContributeInfoTypeEnumList({}).then(res => {
if (res.Code == 1) {
this.TypeList2 = JSON.parse(JSON.stringify(res.Data));
this.TypeList = res.Data;
let obj = {
Name: '不限',
Id: '-1',
}
this.TypeList.unshift(obj)
}
}).catch(() => {
})
},
getStateList() {
getContributeInfoStateEnumList({}).then(res => {
if (res.Code == 1) {
this.StateList = res.Data;
let obj = {
Name: '不限',
Id: '-1',
}
this.StateList.unshift(obj)
}
}).catch(() => {
})
},
changePage(e) {
this.msg.pageIndex = 1
this.getList()
},
getList() {
this.loading = true
getMyContributeInfoPageList(this.msg).then(res => {
if (res.Code == 1) {
this.loading = false
this.data = res.Data.PageData;
this.pageCount = res.Data.PageCount
}
}).catch(() => {
})
},
viewDetails() {//详情
},
goDetailed(row) {//删除
this.$q.dialog({
title: '提示信息',
message: '是否确定删除此内容?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
setContributeInfoState({ ContributeId: row.Id, Type: 2 }).then(res => {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: res.Message,
position: 'top'
})
this.getList()
})
}).onCancel(() => {
});
}
},
goedit(row){//编辑
this.OpenNewUrl("/teacher/contribution/addimageText", {
type: row.Type,
Id:row.Id
});
},
goadd(type) {//新增
this.OpenNewUrl("/teacher/contribution/addimageText", {
type: type
});
},
}
}
......
......@@ -1452,6 +1452,11 @@ const routes = [{
component: () =>
import("pages/teacher/contribution/graphicType")
},
{
path: "/teacher/contribution/addimageText",//投稿设置 新增修改图文
component: () =>
import("pages/teacher/contribution/addimageText")
},
{
path: "*",
component: () =>
......
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