Commit bc9fb94e authored by 黄奎's avatar 黄奎

页面修改

parent a13da573
......@@ -60,6 +60,37 @@ export function UploadSelfFile(path, file, callback, configObj) {
}
}
//上传视频文件到本地服务器
export function UploadViittoFile(path, file, callback) {
var uploadLoadding = Loading;
uploadLoadding.show({
message: '正在上传文件,请稍后...'
})
let viewFileUrl = 'http://192.168.20.214:8130';
let vtUploadUrl = "http://192.168.20.214:8120";
let locationName = window.location.hostname;
if (locationName.indexOf('testerp.oytour') !== -1) {
vtUploadUrl = "http://upload.oytour.com";
viewFileUrl = "https://imgfile.oytour.com";
} else if (locationName.indexOf('oytour') !== -1) {
vtUploadUrl = "http://upload.oytour.com";
viewFileUrl = "https://imgfile.oytour.com";
}
var UploadConfig = {
Bucket: "系统",
CustomDomain: viewFileUrl,
Region: "成都",
SecretId: "SecreId",
SecretKey: "SecreKey",
StoreType: 3,
UploadDomain: vtUploadUrl,
};
var configObj = {
isCreateCover: 1
}
UploadFileToSystem(UploadConfig, path, file, uploadLoadding, callback, configObj)
}
/**
* 上传到当前站点
*/
......@@ -115,6 +146,9 @@ export function UploadFileToSystem(uploadConfig, fileFullPath, fileObj, uploadLo
if (configObj.isTrans && configObj.isTrans == 1) {
url += "&isTrans=1"
}
if (configObj.isCreateCover && configObj.isCreateCover == 1) {
url += "&isCreateCover=1"
}
}
let formData = new FormData()
formData.append('myfile', fileObj)
......
......@@ -8,7 +8,7 @@
<!-- <span :class="commonType==3?'spanActive':''" @click="handleClick(3)">其他</span> -->
</div>
<div>
<div style="height: 718px;display:flex;" flex="box:first" >
<div style="height: 718px;display:flex;" flex="box:first">
<div style="margin-right: 15px;width: auto;-webkit-box-flex: 0;flex-shrink: 0;flex-grow: 0;">
<q-btn @click="addGroup" style="margin-bottom: 12px;" color="accent" size="sm">添加分组</q-btn>
<div style="border: 1px solid rgb(227, 227, 227);width:250px">
......@@ -71,7 +71,8 @@
<div class="material-item material-upload">
<el-upload class="avatar-uploader" action="" accept="image/jpeg,image/gif,image/png,image/bmp"
:show-file-list="false" :http-request="UploadImage" multiple>
<div class="app-upload" flex="main:center cross:center" style="width: 140px; height: 140px;display:flex;justify-content:center;align-items:center">
<div class="app-upload" flex="main:center cross:center"
style="width: 140px; height: 140px;display:flex;justify-content:center;align-items:center">
<i class="el-icon-upload"></i>
</div>
</el-upload>
......@@ -98,7 +99,8 @@
<el-upload class="avatar-uploader" action="" :before-upload="beforeAvatarUpload"
accept="video/mp4,video/ogg,video/webm" :show-file-list="false" :http-request="UploadVideo"
multiple>
<div class="app-upload" flex="main:center cross:center" style="width: 140px; height: 140px;display:flex;justify-content:center;align-items:center">
<div class="app-upload" flex="main:center cross:center"
style="width: 140px; height: 140px;display:flex;justify-content:center;align-items:center">
<i class="el-icon-upload"></i>
</div>
</el-upload>
......@@ -127,7 +129,8 @@
<div class="material-item material-upload">
<el-upload class="avatar-uploader" action="" accept=".pdf,.PDF,.ppt,.PPT,.doc,.docx"
:show-file-list="false" :http-request="UploadpdfFile" multiple>
<div class="app-upload" flex="main:center cross:center" style="width: 140px; height: 140px;display:flex;justify-content:center;align-items:center">
<div class="app-upload" flex="main:center cross:center"
style="width: 140px; height: 140px;display:flex;justify-content:center;align-items:center">
<i class="el-icon-upload"></i>
</div>
</el-upload>
......@@ -162,8 +165,8 @@
</div>
<div style="padding-top:10px;float:right">
<el-pagination style="text-align:right width:100%" background :current-page="currentPage4"
@current-change="handleCurrentChange" :page-size="PageMsg.pageSize"
layout="prev, pager, next,jumper" :total="total">
@current-change="handleCurrentChange" :page-size="PageMsg.pageSize" layout="prev, pager, next,jumper"
:total="total">
</el-pagination>
</div>
</div>
......@@ -207,6 +210,9 @@
</div>
</template>
<script>
import {
UploadViittoFile
} from "../../api/common/common";
export default {
name: 'ChooseImg',
data() {
......@@ -222,9 +228,9 @@
Name: '',
Type: 1,
// Recycled: 1,
ActivityId:0,
pageIndex:1,
pageSize:10,
ActivityId: 0,
pageIndex: 1,
pageSize: 10,
},
isIndeterminate: false,
......@@ -234,7 +240,7 @@
Name: '',
Type: '',
Sort: '',
ActivityId:0
ActivityId: 0
},
addGroupMsgrules: {
Name: [{
......@@ -254,7 +260,7 @@
Name: '',
Type: 1,
// Recycled: 1,
ActivityId:0,
ActivityId: 0,
pageIndex: 1,
pageSize: 20,
GroupId: 0,
......@@ -270,8 +276,8 @@
Image: '',
VideoTime: 0,
WithHeight: 0,
PathType:0,
ActivityId:0,
PathType: 0,
ActivityId: 0,
},
pageMsgDig: false,
checkList: [],
......@@ -281,11 +287,11 @@
}
},
created() {
if(this.$route.query.Id){
this.scgroupMsg.ActivityId=this.$route.query.Id
this.addGroupMsg.ActivityId=this.$route.query.Id
this.PageMsg.ActivityId=this.$route.query.Id
this.addpageMsg.ActivityId=this.$route.query.Id
if (this.$route.query.Id) {
this.scgroupMsg.ActivityId = this.$route.query.Id
this.addGroupMsg.ActivityId = this.$route.query.Id
this.PageMsg.ActivityId = this.$route.query.Id
this.addpageMsg.ActivityId = this.$route.query.Id
}
this.GetMemberGradeList();
this.GetPageList();
......@@ -297,18 +303,18 @@
},
methods: {
goBack(){
goBack() {
this.$router.go(-1)
},
//登录后获取上传配置
getUpConfig(){
getUpConfig() {
this.apipostDS("/api/MallBase/GetDefaultFileStore", {}, res => {
if(res.data.resultCode == 1){
console.log(312,res)
if (res.data.resultCode == 1) {
console.log(312, res)
var upData = res.data.data;
localStorage.uploadInfo = JSON.stringify(upData);
}else{
} else {
this.Error(res.data.message);
}
})
......@@ -377,7 +383,7 @@
},
// 删除素材
DeletePage() {
let that=this
let that = this
this.checkList = [];
this.PageList.forEach(item => {
if (item.Selected) {
......@@ -534,8 +540,8 @@
//上传视频
UploadVideo(file) {
var that = this;
this.UploadSelfFile(this.FileType().Video, file.file, res => {
console.log(526,res)
UploadViittoFile('Edu/Video', file.file, res => {
console.log("res",res);
if (res.resultCode == 1) {
that.addpageMsg.Image = res.VideoCoverImg;
that.addpageMsg.Path = res.FileUrl;
......@@ -566,8 +572,8 @@
// 新增素材信息
addPageList() {
var upInfo = JSON.parse(localStorage.uploadInfo);
if(upInfo){
this.addpageMsg.PathType=upInfo.StoreType;
if (upInfo) {
this.addpageMsg.PathType = upInfo.StoreType;
}
this.apipostDS("/api/Education/SetGetMaterialInfo", this.addpageMsg, res => {
if (res.data.resultCode == 1) {
......@@ -593,7 +599,7 @@
}
},
// 删除分组
delGroup(item){
delGroup(item) {
let that = this;
that.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
......@@ -691,10 +697,10 @@
// Type: this.commonType,
// Sort: '',
// }
this.addGroupMsg.Id=0
this.addGroupMsg.Name=""
this.addGroupMsg.Type=this.commonType
this.addGroupMsg.Sort=""
this.addGroupMsg.Id = 0
this.addGroupMsg.Name = ""
this.addGroupMsg.Type = this.commonType
this.addGroupMsg.Sort = ""
},
// 修改图片视频分组
GroupsubmitForm(formName) {
......@@ -723,7 +729,7 @@
this.loading = true;
this.apipostDS("/api/Education/GetMaterialGroupList", this.scgroupMsg, res => {
this.loading = false;
if(res.data.resultCode===1){
if (res.data.resultCode === 1) {
this.groupList = res.data.data;
}
......
......@@ -83,9 +83,9 @@ export default {
let domainUrl = 'http://192.168.20.24';
let viewFileUrl = 'http://192.168.20.214:8120';
let mallUrl = "http://192.168.20.17:8014";
let vtUploadUrl = "http://192.168.20.214:8120";
let vtUploadUrl = "http://192.168.20.24:8120";
// let vtUploadUrl = "http://upload.oytour.com";
let vtViewUrl = "http://192.168.20.214:8130";
let vtViewUrl = "http://192.168.20.24:8130";
let locationName = window.location.hostname;
if (locationName.indexOf('testerp.oytour') !== -1) {
domainUrl = "http://testapi.oytour.com";
......@@ -533,31 +533,6 @@ export default {
//是否是线上环境【发布时修改为true】
Vue.prototype.isOnline = function () {
return process.env.NODE_ENV !== 'development';
},
//上传文件到本地服务器
Vue.prototype.UploadSelfFile = function (path, file, callback) {
var that = this;
that.Info('上传中...')
var newPath = '/Upload/' + path + "/";
var formData = new FormData();
var uploadUrl = that.domainManager().VTUploadUrl + "/Upload?filePath=" + newPath + "&isCreateCover=1";
formData.append("myfile", file);
that.$http.post(uploadUrl, formData, {})
.then(res => {
if (res && res.status == 200 && res.data && res.data.FilePath) {
var uploadResult = {
resultCode: 1,
FileName: file.name,
FileUrl: that.domainManager().VTViewUrl + res.data.FilePath,
VideoCoverImg: that.domainManager().VTViewUrl + res.data.VideoCoverImg
}
if (callback) {
callback(uploadResult);
}
}
}).catch(function (reason) {
console.log(reason)
});
}
}
}
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