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

add

上级 ccb053d5
...@@ -10,7 +10,8 @@ export const envConfig = { ...@@ -10,7 +10,8 @@ export const envConfig = {
// baseUrl: 'https://test1-sc.yunqueyi.com/', // baseUrl: 'https://test1-sc.yunqueyi.com/',
//baseUrl: 'https://uat-sc.yunqueyi.com/', //baseUrl: 'https://uat-sc.yunqueyi.com/',
baseUrl: 'https://dev-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", qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
qiniuImgUrl: "https://test1-file.yunqueyi.com", qiniuImgUrl: "https://test1-file.yunqueyi.com",
loginUrl: 'https://dev-saas.yunqueyi.com/pica-login/work_station.html', loginUrl: 'https://dev-saas.yunqueyi.com/pica-login/work_station.html',
......
...@@ -455,7 +455,7 @@ export const doUpload = (self,file, filePath, previewId,progressId, fileType) => ...@@ -455,7 +455,7 @@ export const doUpload = (self,file, filePath, previewId,progressId, fileType) =>
// obj.css('max-width', '100%'); // obj.css('max-width', '100%');
// } // }
},2000); },500);
}; };
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
<el-dialog :title="title" :visible.sync="dialogFormVisible" @close="optFun('1')"> <el-dialog :title="title" :visible.sync="dialogFormVisible" @close="optFun('1')">
<el-form :model="form" class="topicOpt"> <el-form :model="form" class="topicOpt">
<el-form-item label="主题" :label-width="formLabelWidth"> <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>
<el-form-item label="内容" :label-width="formLabelWidth" required> <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>
<el-form-item label="话题配图" :label-width="formLabelWidth"> <el-form-item label="话题配图" :label-width="formLabelWidth" class="teste1">
<!-- <el-upload <!-- <el-upload
action="#" action="#"
list-type="picture-card" list-type="picture-card"
...@@ -19,11 +19,13 @@ ...@@ -19,11 +19,13 @@
<el-upload <el-upload
action="#" action="#"
list-type="picture-card" list-type="picture-card"
:auto-upload="false"
:file-list="fileList" :file-list="fileList"
:on-preview="handlePictureCardPreview" :on-preview="handlePictureCardPreview"
:on-remove="handleRemove" :on-remove="handleRemove"
:on-change="selectImg"> :before-upload="beforeAvatarUpload"
>
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
</el-upload> </el-upload>
<el-dialog :visible.sync="dialogVisible" size="tiny" :modal="false" :close-on-click-modal="false"> <el-dialog :visible.sync="dialogVisible" size="tiny" :modal="false" :close-on-click-modal="false">
...@@ -53,11 +55,14 @@ export default { ...@@ -53,11 +55,14 @@ export default {
form:{}, form:{},
id:null, id:null,
dialogImageUrl:'', dialogImageUrl:'',
max:60,
maxL:1000,
dialogVisible:false, dialogVisible:false,
dialogFormVisible:false, dialogFormVisible:false,
fileList:[], fileList:[],
title:'编辑话题', title:'编辑话题',
reType: ['PUT','POST'], reType: ['PUT','POST'],
isEdit:false,
objInfo:{ objInfo:{
topic:{ topic:{
subject:'', subject:'',
...@@ -75,6 +80,10 @@ export default { ...@@ -75,6 +80,10 @@ export default {
editInfo:{ editInfo:{
default:()=>{}, default:()=>{},
type:Object type:Object
},
discussId:{
default:0,
type:Number
} }
}, },
computed: { computed: {
...@@ -85,9 +94,11 @@ export default { ...@@ -85,9 +94,11 @@ export default {
this.dialogFormVisible = this.isShow this.dialogFormVisible = this.isShow
if(this.editInfo.topic){ if(this.editInfo.topic){
this.isEdit = true;
this.objInfo = this.editInfo; this.objInfo = this.editInfo;
}else{ }else{
this.title = '新增话题' this.title = '新增话题'
this.isEdit = false
} }
console.log(this.editInfo); console.log(this.editInfo);
...@@ -95,7 +106,7 @@ export default { ...@@ -95,7 +106,7 @@ export default {
for(let i=0;i<this.objInfo.images.length;i++){ for(let i=0;i<this.objInfo.images.length;i++){
this.fileList.push({ this.fileList.push({
url:this.objInfo.images[i].imageurl, url:this.objInfo.images[i].imageurl,
imageUrl:this.objInfo.images[i].imageurl, imageurl:this.objInfo.images[i].imageurl,
id:this.objInfo.images[i].id id:this.objInfo.images[i].id
}) })
} }
...@@ -109,17 +120,58 @@ export default { ...@@ -109,17 +120,58 @@ export default {
}, },
methods: { methods: {
handlePictureCardPreview(file){ handlePictureCardPreview(file){
console.log(file) //console.log(file)
this.dialogImageUrl = file.url; this.dialogImageUrl = file.url;
this.dialogVisible = true; this.dialogVisible = true;
}, },
selectImg(file){ selectImg(file){
console.log(file) //console.log(file)
this.fileList.push({ this.fileList.push({
url:file.url, url:file.url,
imageurl: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){ handleRemove(file, fileList){
let index = null; let index = null;
...@@ -134,8 +186,8 @@ export default { ...@@ -134,8 +186,8 @@ export default {
if(index != null){ if(index != null){
this.fileList.splice(index,1) this.fileList.splice(index,1)
} }
console.log(file) //console.log(file)
console.log(this.fileList) //console.log(this.fileList)
} }
}, },
optFun(index){ optFun(index){
...@@ -155,7 +207,7 @@ export default { ...@@ -155,7 +207,7 @@ export default {
}, },
showError(str){ showError(str){
console.log(str) //console.log(str)
this.$message({ this.$message({
message: str, message: str,
type: 'warning' type: 'warning'
...@@ -164,25 +216,27 @@ export default { ...@@ -164,25 +216,27 @@ export default {
}, },
//保存修改讨论组件详细 //保存修改讨论组件详细
subFun(id){ subFun(){
///let A = ['PUT','POST'] ///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){ if(this.objInfo.topic.content.length == 0){
this.showError('主题内容不能为空!'); this.showError('内容不能为空!');
return; return;
} }
let parm = { let parm = {
topic:{ topic:{
subject:this.objInfo.topic.subject, subject:this.objInfo.topic.subject,
content:this.objInfo.topic.content, content:this.objInfo.topic.content,
discussid:this.objInfo.topic.discussid, discussid:this.objInfo.topic.discussid || this.discussId,
id:this.objInfo.topic.id id:this.objInfo.topic.id
}, },
images:this.fileList images:this.fileList
} }
this.PUT('/interaction/topic/',parm).then((res) => { this[A]('/interaction/topic/',parm).then((res) => {
// closeLoading(vm) // closeLoading(vm)
if( res.code == '000000' ) { if( res.code == '000000' ) {
this.$message({ this.$message({
...@@ -201,17 +255,17 @@ export default { ...@@ -201,17 +255,17 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.topicOpt{ .topicOpt{
.el-input__inner,.el-textarea__inner{ .el-form-item__content{
width:300px; width:500px;
} }
.el-upload--picture-card{ .el-upload--picture-card{
height: 100px; height: 80px;
width: 100px; width: 80px;
line-height: 100px; line-height: 80px;
} }
.el-upload-list--picture-card .el-upload-list__item{ .el-upload-list--picture-card .el-upload-list__item{
width: 100px; width: 80px;
height: 100px; height: 80px;
} }
.el-form-item__label{ .el-form-item__label{
// line-height: 26px; // line-height: 26px;
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
</el-pagination> </el-pagination>
</div> </div>
</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> </div>
</template> </template>
<script> <script>
...@@ -149,7 +149,7 @@ export default { ...@@ -149,7 +149,7 @@ export default {
discussId:null, discussId:null,
pageNo:1, pageNo:1,
pageSize:20, pageSize:20,
editInfo:{} editInfo:{},
} }
}, },
...@@ -160,24 +160,10 @@ export default { ...@@ -160,24 +160,10 @@ export default {
'idType' 'idType'
]) ])
}, },
filters:{
filteFun(index){
let str = '';
if(index == 1){
str = '未发布'
}else if(index == 2){
str = '已发布'
}else if(index == 3){
str = '已下线'
}
return str
}
},
created() { created() {
this.discussId = this.$route.query.id; this.discussId = Number(this.$route.query.id);
this.getData() this.getData()
//this.sun() //this.sun()
}, },
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册