提交 00fdd61b 编写于 作者: chendeli's avatar chendeli

add

上级 ccb053d5
......@@ -10,7 +10,8 @@ export const envConfig = {
// baseUrl: 'https://test1-sc.yunqueyi.com/',
//baseUrl: 'https://uat-sc.yunqueyi.com/',
baseUrl: 'https://dev-sc.yunqueyi.com',
qiniuFileUrl: "http://localhost:10201/contents/admin/qiniu/token1",
qiniuFileUrl: "https://dev-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
qiniuImgUrl: "https://test1-file.yunqueyi.com",
loginUrl: 'https://dev-saas.yunqueyi.com/pica-login/work_station.html',
......
......@@ -455,7 +455,7 @@ export const doUpload = (self,file, filePath, previewId,progressId, fileType) =>
// obj.css('max-width', '100%');
// }
},2000);
},500);
};
......
......@@ -2,12 +2,12 @@
<el-dialog :title="title" :visible.sync="dialogFormVisible" @close="optFun('1')">
<el-form :model="form" class="topicOpt">
<el-form-item label="主题" :label-width="formLabelWidth">
<el-input v-model="objInfo.topic.subject" auto-complete="off" clearable size="mini"></el-input>
<el-input v-model="objInfo.topic.subject" auto-complete="off" clearable size="mini" :maxLength="max" placeholder="请输入主题(最长60个字符)"></el-input>
</el-form-item>
<el-form-item label="内容" :label-width="formLabelWidth" required>
<el-input type="textarea" v-model="objInfo.topic.content" auto-complete="off" clearable size="mini"></el-input>
<el-input type="textarea" v-model="objInfo.topic.content" auto-complete="off" clearable size="mini" :maxLength="maxL" placeholder="请输入主题(最长1000个字符)" rows="5"></el-input>
</el-form-item>
<el-form-item label="话题配图" :label-width="formLabelWidth">
<el-form-item label="话题配图" :label-width="formLabelWidth" class="teste1">
<!-- <el-upload
action="#"
list-type="picture-card"
......@@ -19,11 +19,13 @@
<el-upload
action="#"
list-type="picture-card"
:auto-upload="false"
:file-list="fileList"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
:on-change="selectImg">
:before-upload="beforeAvatarUpload"
>
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible" size="tiny" :modal="false" :close-on-click-modal="false">
......@@ -53,11 +55,14 @@ export default {
form:{},
id:null,
dialogImageUrl:'',
max:60,
maxL:1000,
dialogVisible:false,
dialogFormVisible:false,
fileList:[],
title:'编辑话题',
reType: ['PUT','POST'],
isEdit:false,
objInfo:{
topic:{
subject:'',
......@@ -75,6 +80,10 @@ export default {
editInfo:{
default:()=>{},
type:Object
},
discussId:{
default:0,
type:Number
}
},
computed: {
......@@ -85,9 +94,11 @@ export default {
this.dialogFormVisible = this.isShow
if(this.editInfo.topic){
this.isEdit = true;
this.objInfo = this.editInfo;
}else{
this.title = '新增话题'
this.isEdit = false
}
console.log(this.editInfo);
......@@ -95,7 +106,7 @@ export default {
for(let i=0;i<this.objInfo.images.length;i++){
this.fileList.push({
url:this.objInfo.images[i].imageurl,
imageUrl:this.objInfo.images[i].imageurl,
imageurl:this.objInfo.images[i].imageurl,
id:this.objInfo.images[i].id
})
}
......@@ -109,17 +120,58 @@ export default {
},
methods: {
handlePictureCardPreview(file){
console.log(file)
//console.log(file)
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
selectImg(file){
console.log(file)
//console.log(file)
this.fileList.push({
url:file.url,
imageurl:file.url,
})
},
beforeAvatarUpload(file){
// console.log(file)
// console.log(this.fileList)
if(this.fileList.length > 5 ){
// /、this.$message.info('图片个数不能超过6个')
this.showError('上传图片个数不能超过6个');
return false;
}
this.imgDoUpload(file, 4, 2048, 400, 400)
},
imgDoUpload(file, urlType, size, w, h) {
let vm = this;
const isSize = file.size / 1024 < size;
if (!isSize) {
//vm.$message.info('上传图片要小于' + size + 'k')
//vm.$message.info('上传图片要小于2M')
vm.showError('上传图片要小于2M');
return;
}
var _img = new FileReader()
_img.readAsDataURL(file)
_img.onload = function(theFile) {
let image = new Image()
image.src = theFile.target.result
image.onload = function() {
let _this = this
vm.$message.info('开始上传');
doUpload(vm, file, getFilePath(file, null), 'preview4', 'progress1', 1).then(function(path) {
//console.log(path)
vm.fileList.push({
url:path.fullPath,
imageurl:path.fullPath
})
vm.$message.success('上传成功')
});
}
}
},
handleRemove(file, fileList){
let index = null;
......@@ -134,8 +186,8 @@ export default {
if(index != null){
this.fileList.splice(index,1)
}
console.log(file)
console.log(this.fileList)
//console.log(file)
//console.log(this.fileList)
}
},
optFun(index){
......@@ -155,7 +207,7 @@ export default {
},
showError(str){
console.log(str)
//console.log(str)
this.$message({
message: str,
type: 'warning'
......@@ -164,25 +216,27 @@ export default {
},
//保存修改讨论组件详细
subFun(id){
subFun(){
///let A = ['PUT','POST']
let A = this.isEdit ? this.reType[0] : this.reType[1];
//console.log(this[A])
if(this.objInfo.topic.content.length == 0){
this.showError('主题内容不能为空!');
this.showError('内容不能为空!');
return;
}
let parm = {
topic:{
subject:this.objInfo.topic.subject,
content:this.objInfo.topic.content,
discussid:this.objInfo.topic.discussid,
discussid:this.objInfo.topic.discussid || this.discussId,
id:this.objInfo.topic.id
},
images:this.fileList
}
this.PUT('/interaction/topic/',parm).then((res) => {
this[A]('/interaction/topic/',parm).then((res) => {
// closeLoading(vm)
if( res.code == '000000' ) {
this.$message({
......@@ -201,17 +255,17 @@ export default {
</script>
<style lang="scss">
.topicOpt{
.el-input__inner,.el-textarea__inner{
width:300px;
.el-form-item__content{
width:500px;
}
.el-upload--picture-card{
height: 100px;
width: 100px;
line-height: 100px;
height: 80px;
width: 80px;
line-height: 80px;
}
.el-upload-list--picture-card .el-upload-list__item{
width: 100px;
height: 100px;
width: 80px;
height: 80px;
}
.el-form-item__label{
// line-height: 26px;
......
......@@ -95,7 +95,7 @@
</el-pagination>
</div>
</div>
<AddEdit :isShow="isShow" v-on:setFun="getFun" v-if="isShow" :editInfo="editInfo"></AddEdit>
<AddEdit :isShow="isShow" v-on:setFun="getFun" v-if="isShow" :editInfo="editInfo" :discussId="discussId"></AddEdit>
</div>
</template>
<script>
......@@ -149,7 +149,7 @@ export default {
discussId:null,
pageNo:1,
pageSize:20,
editInfo:{}
editInfo:{},
}
},
......@@ -160,24 +160,10 @@ export default {
'idType'
])
},
filters:{
filteFun(index){
let str = '';
if(index == 1){
str = '未发布'
}else if(index == 2){
str = '已发布'
}else if(index == 3){
str = '已下线'
}
return str
}
},
created() {
this.discussId = this.$route.query.id;
this.discussId = Number(this.$route.query.id);
this.getData()
//this.sun()
},
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册