Commit 9f5c021b authored by 华国豪's avatar 华国豪 🙄

新增图片裁剪

parent 519b442f
...@@ -284,7 +284,7 @@ ...@@ -284,7 +284,7 @@
<div class="resourceList" v-for="(item,index) in tableData" :key="index"> <div class="resourceList" v-for="(item,index) in tableData" :key="index">
<div class="reTopInfo" :class="{'comCursorUrl':item.URL}" @click="OpenNewUrl(item.URL)"> <div class="reTopInfo" :class="{'comCursorUrl':item.URL}" @click="OpenNewUrl(item.URL)">
<img v-if="!item.PicPath" src="../../assets/img/bg_c3@3x.png"> <img v-if="!item.PicPath" src="../../assets/img/bg_c3@3x.png">
<img v-else :src="item.PicPath"> <img v-else :src='compressImg(item.PicPath, "filt", 213, "")' :onerror="defaultImg">
<div class="RemainingInventory">{{item.RemainingInventory}}</div> <div class="RemainingInventory">{{item.RemainingInventory}}</div>
<div class="resTypeList"> <div class="resTypeList">
<span v-for="(items,index) in item.OpenPlatformList" :key="index" :class="{'L1':items.ID==1,'L2':items.ID==2,'L3':items.ID==3,'L4':items.ID==4,'L5':items.ID==5}">{{items.Name}}</span> <span v-for="(items,index) in item.OpenPlatformList" :key="index" :class="{'L1':items.ID==1,'L2':items.ID==2,'L3':items.ID==3,'L4':items.ID==4,'L5':items.ID==5}">{{items.Name}}</span>
...@@ -356,6 +356,7 @@ ...@@ -356,6 +356,7 @@
label: "删除" label: "删除"
} }
], ],
defaultImg: 'this.src="' + require("../../assets/img/bg_z1@2x.png") + '"',
loading: true, loading: true,
msg: { msg: {
pageIndex: 1, pageIndex: 1,
......
...@@ -301,7 +301,7 @@ ...@@ -301,7 +301,7 @@
<div class="resourceList" v-for="(item,index) in tableData" :key="index"> <div class="resourceList" v-for="(item,index) in tableData" :key="index">
<div class="reTopInfo" :class="{'comCursorUrl':item.URL}" @click="OpenNewUrl(item.URL)"> <div class="reTopInfo" :class="{'comCursorUrl':item.URL}" @click="OpenNewUrl(item.URL)">
<img v-if="!item.PicPath" src="../../assets/img/bg_c3@3x.png"> <img v-if="!item.PicPath" src="../../assets/img/bg_c3@3x.png">
<img v-else :src="item.PicPath" :onerror="defaultImg"> <img v-else :src='compressImg(item.PicPath, "filt", 213, "")' :onerror="defaultImg">
<div class="resTypeList"> <div class="resTypeList">
<span v-for="(items,index) in item.OpenPlatformList" :class="{'L1':items.ID==1,'L2':items.ID==2,'L3':items.ID==3,'L4':items.ID==4,'L5':items.ID==5}" <span v-for="(items,index) in item.OpenPlatformList" :class="{'L1':items.ID==1,'L2':items.ID==2,'L3':items.ID==3,'L4':items.ID==4,'L5':items.ID==5}"
:key="index">{{items.Name}}</span> :key="index">{{items.Name}}</span>
......
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
<div class="addimgContent test-1"> <div class="addimgContent test-1">
<div class="addimgDiv" v-for="(item,index) in imglistArry" :key="item.subCode" v-if="item.isShowImgDiv&&item.Path!=null"> <div class="addimgDiv" v-for="(item,index) in imglistArry" :key="item.subCode" v-if="item.isShowImgDiv&&item.Path!=null">
<div class="itemImgdiv" @click="selectImg(index)"> <div class="itemImgdiv" @click="selectImg(index)">
<img :src="item.Path" @error="imgError(item)"/> <img :src='compressImg(item.Path, "filt", 160, "")' @error="imgError(item)"/>
<div class="imgseclet" v-show="item.isShow"><i class="iconfont icon-dagouyouquan"></i></div> <div class="imgseclet" v-show="item.isShow"><i class="iconfont icon-dagouyouquan"></i></div>
</div> </div>
<div class="imgDescription">{{item.Name}}</div> <div class="imgDescription">{{item.Name}}</div>
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
<div class="five-box day_table"> <div class="five-box day_table">
<div class="left"> <div class="left">
<div class="image"> <div class="image">
<img v-if="day.details[0].img!='' && day.details[0].scenicJson" :style="{'top':day.details[0].scenicJson.y+'px'}" :src="$commonUtils.replaceHttps(day.details[0].img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> <img v-if="day.details[0].img!='' && day.details[0].scenicJson" :style="{'top':day.details[0].scenicJson.y+'px'}" :src='compressImg(day.details[2].img, "filt", 663, "")' />
<img v-else :src="$commonUtils.replaceHttps(day.details[0].img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> <img v-else :src='compressImg(day.details[2].img, "filt", 663, "")' />
</div> </div>
<table class="day_table"> <table class="day_table">
<tr> <tr>
...@@ -52,8 +52,8 @@ ...@@ -52,8 +52,8 @@
<div class="item item5"> <div class="item item5">
<div class="upFour"> <div class="upFour">
<!-- <img :style="{'top':item.scenicJson.y+'px'}" :src="$commonUtils.replaceHttps(item.img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> --> <!-- <img :style="{'top':item.scenicJson.y+'px'}" :src="$commonUtils.replaceHttps(item.img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> -->
<img v-if="item.img!=''&& item.scenicJson" :style="{'top':item.scenicJson.y+'px'}" :src="$commonUtils.replaceHttps(item.img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> <img v-if="item.img!=''&& item.scenicJson" :style="{'top':item.scenicJson.y+'px'}" :src='compressImg(item.img, "filt", 663, "")' />
<img v-else :src="$commonUtils.replaceHttps(item.img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> <img v-else :src='compressImg(item.img, "filt", 663, "")' />
</div> </div>
<div class="down"> <div class="down">
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
<td> <td>
<div class="item big"> <div class="item big">
<div class="left"> <div class="left">
<img v-if="day.details[0].img!='' && day.details[0].scenicJson" :style="{'top':day.details[0].scenicJson.y+'px'}" :src="$commonUtils.replaceHttps(day.details[0].img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> <img v-if="day.details[0].img!='' && day.details[0].scenicJson" :style="{'top':day.details[0].scenicJson.y+'px'}" :src='compressImg(day.details[0].img, "filt", 663, "")' />
<img v-else :src="$commonUtils.replaceHttps(day.details[0].img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> <img v-else :src='compressImg(day.details[0].img, "filt", 663, "")' />
</div> </div>
<div class="right"> <div class="right">
<div class="details"> <div class="details">
...@@ -54,8 +54,8 @@ ...@@ -54,8 +54,8 @@
<div class="item"> <div class="item">
<div class="upFour"> <div class="upFour">
<!-- <img :style="{'top':item.scenicJson.y+'px'}" :src="$commonUtils.replaceHttps(item.img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> --> <!-- <img :style="{'top':item.scenicJson.y+'px'}" :src="$commonUtils.replaceHttps(item.img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> -->
<img v-if="item.img!=''&& item.scenicJson" :style="{'top':item.scenicJson.y+'px'}" :src="$commonUtils.replaceHttps(item.img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> <img v-if="item.img!=''&& item.scenicJson" :style="{'top':item.scenicJson.y+'px'}" :src='compressImg(item.img, "filt", 663, "")' />
<img v-else :src="$commonUtils.replaceHttps(item.img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> <img v-else :src='compressImg(item.img, "filt", 663, "")' />
</div> </div>
<div class="down"> <div class="down">
<h4 v-html="item.title" @click.stop="goUrl(item.url)" style="cursor: pointer" ></h4> <h4 v-html="item.title" @click.stop="goUrl(item.url)" style="cursor: pointer" ></h4>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<td> <td>
<div class="item big" style='margin-bottom:20px;'> <div class="item big" style='margin-bottom:20px;'>
<div class="left"> <div class="left">
<img v-if="day.details[0].img!='' && day.details[0].scenicJson" :style="{'top':day.details[0].scenicJson.y+'px'}" :src="$commonUtils.replaceHttps(day.details[0].img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> <img v-if="day.details[0].img!='' && day.details[0].scenicJson" :style="{'top':day.details[0].scenicJson.y+'px'}" :src='compressImg(day.details[0].img, "filt", 663, "")'/>
<img v-else :src="domainManager().ViittoFileUrl+'/Upload/DefalutImage/DMC/defaultairline.png'" /> <img v-else :src="domainManager().ViittoFileUrl+'/Upload/DefalutImage/DMC/defaultairline.png'" />
<img v-else-if="day.dayNum==1 && day.details[0].img==''" :src="domainManager().ViittoFileUrl+'/Upload/PictureMaterial/Web/nll.jpg'" /> <img v-else-if="day.dayNum==1 && day.details[0].img==''" :src="domainManager().ViittoFileUrl+'/Upload/PictureMaterial/Web/nll.jpg'" />
<img v-else-if="day.islast && day.details[0].img==''" :src="domainManager().ViittoFileUrl+'/Upload/PictureMaterial/Web/nll.jpg'" /> <img v-else-if="day.islast && day.details[0].img==''" :src="domainManager().ViittoFileUrl+'/Upload/PictureMaterial/Web/nll.jpg'" />
......
...@@ -20,8 +20,9 @@ ...@@ -20,8 +20,9 @@
<td> <td>
<div class="item big"> <div class="item big">
<div class="left"> <div class="left">
<img v-if="day.details[0].img!='' && day.details[0].scenicJson" :style="{'top':day.details[0].scenicJson.y+'px'}" :src="$commonUtils.replaceHttps(day.details[0].img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> <img v-if="day.details[0].img!='' && day.details[0].scenicJson" :style="{'top':day.details[0].scenicJson.y+'px'}"
<img v-else :src="$commonUtils.replaceHttps(day.details[0].img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> :src='compressImg(day.details[0].img, "filt", 663, "")' />
<img v-else :src='compressImg(day.details[0].img, "filt", 663, "")' />
</div> </div>
<div class="right"> <div class="right">
<div class="details"> <div class="details">
...@@ -72,8 +73,9 @@ ...@@ -72,8 +73,9 @@
<div> <div>
<div class="item hor-box"> <div class="item hor-box">
<div class="image"> <div class="image">
<img v-if="day.details[1].img!='' && day.details[1].scenicJson" :style="{'top':day.details[1].scenicJson.y+'px'}" :src="$commonUtils.replaceHttps(day.details[1].img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> <img v-if="day.details[1].img!='' && day.details[1].scenicJson" :style="{'top':day.details[1].scenicJson.y+'px'}"
<img v-else :src="$commonUtils.replaceHttps(day.details[1].img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> :src='compressImg(day.details[1].img, "filt", 663, "")'/>
<img v-else :src='compressImg(day.details[1].img, "filt", 663, "")' />
</div> </div>
</div> </div>
</div> </div>
...@@ -88,8 +90,8 @@ ...@@ -88,8 +90,8 @@
<div> <div>
<div class="item hor-box"> <div class="item hor-box">
<div class="image"> <div class="image">
<img v-if="day.details[2].img!='' && day.details[2].scenicJson" :style="{'top':day.details[2].scenicJson.y+'px'}" :src="$commonUtils.replaceHttps(day.details[2].img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> <img v-if="day.details[2].img!='' && day.details[2].scenicJson" :style="{'top':day.details[2].scenicJson.y+'px'}" :src='compressImg(day.details[2].img, "filt", 663, "")' />
<img v-else :src="$commonUtils.replaceHttps(day.details[2].img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663'" /> <img v-else :src='compressImg(day.details[2].img, "filt", 663, "")' />
</div> </div>
</div> </div>
</div> </div>
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
<div class="twoday_item" v-for="item in day.details" :key="item.dayNum"> <div class="twoday_item" v-for="item in day.details" :key="item.dayNum">
<div class="item"> <div class="item">
<div class="up"> <div class="up">
<img v-if="item.img!=''&& item.scenicJson" :style="{'top':item.scenicJson.y+'px'}" :src="$commonUtils.replaceHttps(item.img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663,h_325'" /> <img v-if="item.img!=''&& item.scenicJson" :style="{'top':item.scenicJson.y+'px'}" :src='compressImg(item.img, "filt", 663, 325)'/>
<img v-else :src="$commonUtils.replaceHttps(item.img)+'?x-oss-process=image/resize,w_663,image/crop,g_west,w_663,h_325'" /> <img v-else :src='compressImg(item.img, "filt", 663, 325)' />
</div> </div>
<div class="down" style='padding:22px 0;'> <div class="down" style='padding:22px 0;'>
<h4 v-if='item.title!=""' v-html="item.title" @click.stop="goUrl(item.url)" style="cursor: pointer" ></h4> <h4 v-if='item.title!=""' v-html="item.title" @click.stop="goUrl(item.url)" style="cursor: pointer" ></h4>
......
...@@ -652,8 +652,8 @@ ...@@ -652,8 +652,8 @@
if (this.showType >= 4) { // 判断是否为行程特色 if (this.showType >= 4) { // 判断是否为行程特色
var apiurl = this.domainManager().UploadUrl + '/Upload/GetImage?filePath=Feature/' + tcid; var apiurl = this.domainManager().UploadUrl + '/Upload/GetImage?filePath=Feature/' + tcid;
this.$http.post(apiurl).then(res => { this.$http.post(apiurl).then(res => {
let msg = res let msg = res.data
if (msg.ResultCode) { // 已经存在文件 直接调用下载 if (msg.ResultCode === 1 && _this.vshowC) { // 已经存在文件 直接调用下载
_this.ToWord(_this.orderMsg.startDate + _this.orderMsg.lineteamName + _this.orderMsg.dayNum + _this.ToWord(_this.orderMsg.startDate + _this.orderMsg.lineteamName + _this.orderMsg.dayNum +
'日游', isPc) '日游', isPc)
} else if (document.querySelector("#gernalCanvas")) { // 不存在图片保存图片后下载 } else if (document.querySelector("#gernalCanvas")) { // 不存在图片保存图片后下载
...@@ -662,14 +662,6 @@ ...@@ -662,14 +662,6 @@
'日游', isPc) '日游', isPc)
return return
} }
document.querySelector("#gernalCanvas").querySelectorAll('img').forEach(x => {
let src = x.src
src = src.replace('https:', 'http:')
if (src.indexOf('http') != -1) {
x.setAttribute('crossOrigin', 'anonymous')
}
x.src = src
});
let cName = '' let cName = ''
if (_this.showType == 4) { if (_this.showType == 4) {
cName = '.feature-box' cName = '.feature-box'
...@@ -1042,6 +1034,12 @@ ...@@ -1042,6 +1034,12 @@
for (let i = 0; i < imgs.length; i++) { for (let i = 0; i < imgs.length; i++) {
document.getElementsByTagName('img')[i].removeAttribute('crossOrigin') document.getElementsByTagName('img')[i].removeAttribute('crossOrigin')
} }
// let imgList = document.getElementById("gernalCanvas").getElementsByTagName("img")
// for (let i = 0; i < imgList.length; i++) {
// if (imgList[i].src.indexOf('http') !== -1 && imgList[i].src.indexOf('icon') === -1 && imgList[i].src.indexOf('_bg_') === -1 && imgList[i].src.indexOf('_top_') === -1 && imgList[i].src.indexOf('_title') === -1) {
// imgList[i].src = this.compressImg(imgList[i].src, "filt", imgList[i].clientWidth, '')
// }
// }
}) })
}, err => {}) }, err => {})
}, },
......
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
<div class="Travel_ImgList clearfix"> <div class="Travel_ImgList clearfix">
<div class="TFimgList" v-for="(item,index) in PostConfig.fileList" :key="item.subCode"> <div class="TFimgList" v-for="(item,index) in PostConfig.fileList" :key="item.subCode">
<img v-if="!item.Url" src="../../../assets/img/bg_c3@3x.png"> <img v-if="!item.Url" src="../../../assets/img/bg_c3@3x.png">
<img v-else :src="item.Url"> <img v-else :src='compressImg(item.Url, "filt", 170, "")'>
<div class="TFIMGzhe"> <div class="TFIMGzhe">
<div class="TFreupload" @click="updateTFimg(index)"> <div class="TFreupload" @click="updateTFimg(index)">
<el-upload :file-list="PostConfig.fileList" :http-request="reUpload" :multiple="true" <el-upload :file-list="PostConfig.fileList" :http-request="reUpload" :multiple="true"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="TC-ImgTop" :id='"boxs_"+DayNum+"_"+0'> <div class="TC-ImgTop" :id='"boxs_"+DayNum+"_"+0'>
<VueDraggableResizable axis="y" :ref='"fiveDay_"+DayNum+"_"+0' tabindex="0" :w="318" :h="525" :resizable='false' :x="scenicArray[0].ScenicJson.x" <VueDraggableResizable axis="y" :ref='"fiveDay_"+DayNum+"_"+0' tabindex="0" :w="318" :h="525" :resizable='false' :x="scenicArray[0].ScenicJson.x"
:y="scenicArray[0].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(0)"> :y="scenicArray[0].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(0)">
<img :src='scenicArray[0].NewImaArray[0].Url' :id='"bodys_"+DayNum+"_"+0' /> <img :src='compressImg(scenicArray[0].NewImaArray[0].Url, "filt", 318, "")' :id='"bodys_"+DayNum+"_"+0' />
</VueDraggableResizable> </VueDraggableResizable>
<div class="TC_uploadDiv"> <div class="TC_uploadDiv">
<el-form-item> <el-form-item>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<div class="TC-fiveTopImg" :id='"boxs_"+DayNum+"_"+1'> <div class="TC-fiveTopImg" :id='"boxs_"+DayNum+"_"+1'>
<VueDraggableResizable axis="y" :ref='"fiveDay_"+DayNum+"_"+1' tabindex="0" :w="323" :h="246" :resizable='false' :x="scenicArray[1].ScenicJson.x" <VueDraggableResizable axis="y" :ref='"fiveDay_"+DayNum+"_"+1' tabindex="0" :w="323" :h="246" :resizable='false' :x="scenicArray[1].ScenicJson.x"
:y="scenicArray[1].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(1)"> :y="scenicArray[1].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(1)">
<img :src='scenicArray[1].NewImaArray[0].Url' :id='"bodys_"+DayNum+"_"+1' /> <img :src='compressImg(scenicArray[1].NewImaArray[0].Url, "filt", 323, "")' :id='"bodys_"+DayNum+"_"+1' />
</VueDraggableResizable> </VueDraggableResizable>
<div class="TC_uploadDiv"> <div class="TC_uploadDiv">
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
<div class="TC-fiveTopImg" :id='"boxs_"+DayNum+"_"+2'> <div class="TC-fiveTopImg" :id='"boxs_"+DayNum+"_"+2'>
<VueDraggableResizable axis="y" :ref='"fiveDay_"+DayNum+"_"+2' tabindex="0" :w="323" :h="246" :resizable='false' :x="scenicArray[2].ScenicJson.x" <VueDraggableResizable axis="y" :ref='"fiveDay_"+DayNum+"_"+2' tabindex="0" :w="323" :h="246" :resizable='false' :x="scenicArray[2].ScenicJson.x"
:y="scenicArray[2].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(2)"> :y="scenicArray[2].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(2)">
<img :src='scenicArray[2].NewImaArray[0].Url' :id='"bodys_"+DayNum+"_"+2' /> <img :src='compressImg(scenicArray[2].NewImaArray[0].Url, "filt", 323, "")' :id='"bodys_"+DayNum+"_"+2' />
</VueDraggableResizable> </VueDraggableResizable>
<div class="TC_uploadDiv"> <div class="TC_uploadDiv">
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
<div class="TC-fiveTopImg" :id='"boxs_"+DayNum+"_"+3'> <div class="TC-fiveTopImg" :id='"boxs_"+DayNum+"_"+3'>
<VueDraggableResizable axis="y" :ref='"fiveDay_"+DayNum+"_"+3' tabindex="0" :w="323" :h="246" :resizable='false' :x="scenicArray[3].ScenicJson.x" <VueDraggableResizable axis="y" :ref='"fiveDay_"+DayNum+"_"+3' tabindex="0" :w="323" :h="246" :resizable='false' :x="scenicArray[3].ScenicJson.x"
:y="scenicArray[3].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(3)"> :y="scenicArray[3].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(3)">
<img :src='scenicArray[3].NewImaArray[0].Url' :id='"bodys_"+DayNum+"_"+3' /> <img :src='compressImg(scenicArray[3].NewImaArray[0].Url, "filt", 323, "")' :id='"bodys_"+DayNum+"_"+3' />
</VueDraggableResizable> </VueDraggableResizable>
<div class="TC_uploadDiv"> <div class="TC_uploadDiv">
<el-form-item> <el-form-item>
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
<div class="TC-fiveTopImg" :id='"boxs_"+DayNum+"_"+4'> <div class="TC-fiveTopImg" :id='"boxs_"+DayNum+"_"+4'>
<VueDraggableResizable axis="y" :ref='"fiveDay_"+DayNum+"_"+4' tabindex="0" :w="323" :h="246" :resizable='false' :x="scenicArray[4].ScenicJson.x" <VueDraggableResizable axis="y" :ref='"fiveDay_"+DayNum+"_"+4' tabindex="0" :w="323" :h="246" :resizable='false' :x="scenicArray[4].ScenicJson.x"
:y="scenicArray[4].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(4)"> :y="scenicArray[4].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(4)">
<img :src='scenicArray[4].NewImaArray[0].Url' :id='"bodys_"+DayNum+"_"+4' /> <img :src='compressImg(scenicArray[4].NewImaArray[0].Url, "filt", 323, "")' :id='"bodys_"+DayNum+"_"+4' />
</VueDraggableResizable> </VueDraggableResizable>
<div class="TC_uploadDiv"> <div class="TC_uploadDiv">
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<div class="TC-OneDayImg" :id='"boxs_"+DayNum+"_"+0'> <div class="TC-OneDayImg" :id='"boxs_"+DayNum+"_"+0'>
<VueDraggableResizable axis="y" :ref='"fourDay_"+DayNum+"_"+0' tabindex="0" :w="660" :h="449" :resizable='false' :x="scenicArray[0].ScenicJson.x" <VueDraggableResizable axis="y" :ref='"fourDay_"+DayNum+"_"+0' tabindex="0" :w="660" :h="449" :resizable='false' :x="scenicArray[0].ScenicJson.x"
:y="scenicArray[0].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(0)"> :y="scenicArray[0].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(0)">
<img :src='scenicArray[0].NewImaArray[0].Url' :id='"bodys_"+DayNum+"_"+0' /> <img :src='compressImg(scenicArray[0].NewImaArray[0].Url, "filt", 660, "")' :id='"bodys_"+DayNum+"_"+0' />
</VueDraggableResizable> </VueDraggableResizable>
<div class="TC_uploadDiv"> <div class="TC_uploadDiv">
<el-form-item> <el-form-item>
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<div class="image" :id='"boxs_"+DayNum+"_"+1'> <div class="image" :id='"boxs_"+DayNum+"_"+1'>
<VueDraggableResizable axis="y" :ref='"fourDay_"+DayNum+"_"+1' tabindex="0" :w="321" :h="246" :resizable='false' :x="scenicArray[1].ScenicJson.x" <VueDraggableResizable axis="y" :ref='"fourDay_"+DayNum+"_"+1' tabindex="0" :w="321" :h="246" :resizable='false' :x="scenicArray[1].ScenicJson.x"
:y="scenicArray[1].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(1)"> :y="scenicArray[1].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(1)">
<img :src='scenicArray[1].NewImaArray[0].Url' :id='"bodys_"+DayNum+"_"+1' /> <img :src='compressImg(scenicArray[1].NewImaArray[0].Url, "filt", 321, "")' :id='"bodys_"+DayNum+"_"+1' />
</VueDraggableResizable> </VueDraggableResizable>
<div class="TC_uploadDiv"> <div class="TC_uploadDiv">
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<div class="image" :id='"boxs_"+DayNum+"_"+2'> <div class="image" :id='"boxs_"+DayNum+"_"+2'>
<VueDraggableResizable axis="y" :ref='"fourDay_"+DayNum+"_"+2' tabindex="0" :w="321" :h="246" :resizable='false' :x="scenicArray[2].ScenicJson.x" <VueDraggableResizable axis="y" :ref='"fourDay_"+DayNum+"_"+2' tabindex="0" :w="321" :h="246" :resizable='false' :x="scenicArray[2].ScenicJson.x"
:y="scenicArray[2].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(2)"> :y="scenicArray[2].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(2)">
<img :src='scenicArray[2].NewImaArray[0].Url' :id='"bodys_"+DayNum+"_"+2' /> <img :src='compressImg(scenicArray[2].NewImaArray[0].Url, "filt", 321, "")' :id='"bodys_"+DayNum+"_"+2' />
</VueDraggableResizable> </VueDraggableResizable>
<!-- <img v-if="scenicArray[2].NewImaArray.length>0&&scenicArray[2].NewImaArray[0].Url" :src="scenicArray[2].NewImaArray[0].Url" alt="" /> <!-- <img v-if="scenicArray[2].NewImaArray.length>0&&scenicArray[2].NewImaArray[0].Url" :src="scenicArray[2].NewImaArray[0].Url" alt="" />
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
<div class="image" :id='"boxs_"+DayNum+"_"+3'> <div class="image" :id='"boxs_"+DayNum+"_"+3'>
<VueDraggableResizable axis="y" :ref='"fourDay_"+DayNum+"_"+3' tabindex="0" :w="321" :h="246" :resizable='false' :x="scenicArray[3].ScenicJson.x" <VueDraggableResizable axis="y" :ref='"fourDay_"+DayNum+"_"+3' tabindex="0" :w="321" :h="246" :resizable='false' :x="scenicArray[3].ScenicJson.x"
:y="scenicArray[3].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(3)"> :y="scenicArray[3].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(3)">
<img :src='scenicArray[3].NewImaArray[0].Url' :id='"bodys_"+DayNum+"_"+3' /> <img :src='compressImg(scenicArray[3].NewImaArray[0].Url, "filt", 321, "")' :id='"bodys_"+DayNum+"_"+3' />
</VueDraggableResizable> </VueDraggableResizable>
<div class="TC_uploadDiv"> <div class="TC_uploadDiv">
<el-form-item> <el-form-item>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<div class="TC-OneDayImg" :id='"boxs_"+DayNum+"_"+0'> <div class="TC-OneDayImg" :id='"boxs_"+DayNum+"_"+0'>
<VueDraggableResizable axis="y" :ref='"oneDay_"+DayNum+"_"+0' tabindex="0" :w="660" :h="449" :resizable='false' :x="scenicArray[0].ScenicJson.x" <VueDraggableResizable axis="y" :ref='"oneDay_"+DayNum+"_"+0' tabindex="0" :w="660" :h="449" :resizable='false' :x="scenicArray[0].ScenicJson.x"
:y="scenicArray[0].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(0)"> :y="scenicArray[0].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(0)">
<img :src='scenicArray[0].NewImaArray[0].Url' :id='"bodys_"+DayNum+"_"+0' /> <img :src='compressImg(scenicArray[0].NewImaArray[0].Url, "filt", 600, "")' :id='"bodys_"+DayNum+"_"+0' />
</VueDraggableResizable> </VueDraggableResizable>
<!-- <img v-if="scenicArray[0].NewImaArray.length>0&&scenicArray[0].NewImaArray[0].Url" :src="scenicArray[0].NewImaArray[0].Url" alt> <!-- <img v-if="scenicArray[0].NewImaArray.length>0&&scenicArray[0].NewImaArray[0].Url" :src="scenicArray[0].NewImaArray[0].Url" alt>
<div v-else class="_noData_img" src=""></div> --> <div v-else class="_noData_img" src=""></div> -->
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<div class="TC-threeOneImg" :id='"boxs_"+DayNum+"_"+0'> <div class="TC-threeOneImg" :id='"boxs_"+DayNum+"_"+0'>
<VueDraggableResizable axis="y" :ref='"threeDay_"+DayNum+"_"+0' tabindex="0" :w="660" :h="449" :resizable='false' :x="scenicArray[0].ScenicJson.x" <VueDraggableResizable axis="y" :ref='"threeDay_"+DayNum+"_"+0' tabindex="0" :w="660" :h="449" :resizable='false' :x="scenicArray[0].ScenicJson.x"
:y="scenicArray[0].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(0)"> :y="scenicArray[0].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(0)">
<img :src='scenicArray[0].NewImaArray[0].Url' :id='"bodys_"+DayNum+"_"+0' /> <img :src='compressImg(scenicArray[0].NewImaArray[0].Url, "filt", 660, "")' :id='"bodys_"+DayNum+"_"+0' />
</VueDraggableResizable> </VueDraggableResizable>
<div class="TC_uploadDiv"> <div class="TC_uploadDiv">
<el-form-item> <el-form-item>
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<div class="TC-ThreeDetail" :id='"boxs_"+DayNum+"_"+1'> <div class="TC-ThreeDetail" :id='"boxs_"+DayNum+"_"+1'>
<VueDraggableResizable axis="y" :ref='"threeDay_"+DayNum+"_"+1' tabindex="0" :w="665" :resizable='false' :x="scenicArray[1].ScenicJson.x" <VueDraggableResizable axis="y" :ref='"threeDay_"+DayNum+"_"+1' tabindex="0" :w="665" :resizable='false' :x="scenicArray[1].ScenicJson.x"
:y="scenicArray[1].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(1)"> :y="scenicArray[1].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(1)">
<img :src='scenicArray[1].NewImaArray[0].Url' :id='"bodys_"+DayNum+"_"+1' /> <img :src='compressImg(scenicArray[1].NewImaArray[0].Url, "filt", 665, "")' :id='"bodys_"+DayNum+"_"+1' />
</VueDraggableResizable> </VueDraggableResizable>
<div class="TC_uploadDiv"> <div class="TC_uploadDiv">
<el-form-item> <el-form-item>
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
<div class="TC-ThreeDetail" :id='"boxs_"+DayNum+"_"+2'> <div class="TC-ThreeDetail" :id='"boxs_"+DayNum+"_"+2'>
<VueDraggableResizable axis="y" :ref='"threeDay_"+DayNum+"_"+2' tabindex="0" :w="665" :resizable='false' :x="scenicArray[2].ScenicJson.x" <VueDraggableResizable axis="y" :ref='"threeDay_"+DayNum+"_"+2' tabindex="0" :w="665" :resizable='false' :x="scenicArray[2].ScenicJson.x"
:y="scenicArray[2].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(2)"> :y="scenicArray[2].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(2)">
<img :src='scenicArray[2].NewImaArray[0].Url' :id='"bodys_"+DayNum+"_"+2' /> <img :src='compressImg(scenicArray[2].NewImaArray[0].Url, "filt", 486, "")' :id='"bodys_"+DayNum+"_"+2' />
</VueDraggableResizable> </VueDraggableResizable>
<div class="TC_uploadDiv"> <div class="TC_uploadDiv">
<el-form-item> <el-form-item>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<div class="TC-twoimage" :id='"boxs_"+DayNum+"_"+0'> <div class="TC-twoimage" :id='"boxs_"+DayNum+"_"+0'>
<VueDraggableResizable axis="y" :ref='"twoDay_"+DayNum+"_"+0' tabindex="0" :w="486" :resizable='false' :x="scenicArray[0].ScenicJson.x" <VueDraggableResizable axis="y" :ref='"twoDay_"+DayNum+"_"+0' tabindex="0" :w="486" :resizable='false' :x="scenicArray[0].ScenicJson.x"
:y="scenicArray[0].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(0)"> :y="scenicArray[0].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(0)">
<img :src='scenicArray[0].NewImaArray[0].Url' :id='"bodys_"+DayNum+"_"+0' /> <img :src='compressImg(scenicArray[0].NewImaArray[0].Url, "filt", 486, "")' :id='"bodys_"+DayNum+"_"+0' />
</VueDraggableResizable> </VueDraggableResizable>
<div class="TC_uploadDiv"> <div class="TC_uploadDiv">
<el-form-item> <el-form-item>
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<div class="TC-twoimage" :id='"boxs_"+DayNum+"_"+1'> <div class="TC-twoimage" :id='"boxs_"+DayNum+"_"+1'>
<VueDraggableResizable axis="y" :ref='"twoDay_"+DayNum+"_"+1' tabindex="0" :w="486" :resizable='false' :x="scenicArray[1].ScenicJson.x" <VueDraggableResizable axis="y" :ref='"twoDay_"+DayNum+"_"+1' tabindex="0" :w="486" :resizable='false' :x="scenicArray[1].ScenicJson.x"
:y="scenicArray[1].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(1)"> :y="scenicArray[1].ScenicJson.y" :z="2" :active="false" :parent="false" @dragstop="onDragImagestop" @activated="onActivated(1)">
<img :src='scenicArray[1].NewImaArray[0].Url' :id='"bodys_"+DayNum+"_"+1' /> <img :src='compressImg(scenicArray[1].NewImaArray[0].Url, "filt", 486, "")' :id='"bodys_"+DayNum+"_"+1' />
</VueDraggableResizable> </VueDraggableResizable>
<div class="TC_uploadDiv"> <div class="TC_uploadDiv">
<el-form-item> <el-form-item>
......
...@@ -285,7 +285,7 @@ export default { ...@@ -285,7 +285,7 @@ export default {
.admissionStatisticsTalbe tr td .pHouseStyle{border-bottom: 1px solid #ccc; height: 20px; line-height: 20px;} .admissionStatisticsTalbe tr td .pHouseStyle{border-bottom: 1px solid #ccc; height: 20px; line-height: 20px;}
.admissionStatisticsTalbe tr td .pHouseStyle:last-child{border-bottom: none;} .admissionStatisticsTalbe tr td .pHouseStyle:last-child{border-bottom: none;}
.admissionStatisticsTalbe tr td .pDateStyle{border-bottom: 1px solid #ccc; height: 20px; line-height: 20px; margin-top: 0;} .admissionStatisticsTalbe tr td .pDateStyle{border-bottom: 1px solid #ccc; height: 20px; line-height: 20px; margin-top: 0;}
.admissionStatisticsTalbe tr td .pMsgStyle{; padding: 0 10px; line-height: 20px;} .admissionStatisticsTalbe tr td .pMsgStyle{padding: 0 10px; line-height: 20px;}
.admissionStatisticsTalbe tr td .link p:hover{text-decoration: underline; cursor: pointer;} .admissionStatisticsTalbe tr td .link p:hover{text-decoration: underline; cursor: pointer;}
.admissionStatisticsTalbe tr td .phoverStype:hover{text-decoration: underline; cursor: pointer;} .admissionStatisticsTalbe tr td .phoverStype:hover{text-decoration: underline; cursor: pointer;}
.admissionStatistics_tripDetails {padding: 0; box-shadow: 0px 1px 3px 0px #dedede; max-height: 400px;overflow-y: auto;} .admissionStatistics_tripDetails {padding: 0; box-shadow: 0px 1px 3px 0px #dedede; max-height: 400px;overflow-y: auto;}
......
...@@ -312,7 +312,7 @@ ...@@ -312,7 +312,7 @@
<div class="resourceList" v-for="item in tableData" :key="item.subCode"> <div class="resourceList" v-for="item in tableData" :key="item.subCode">
<div class="reTopInfo" :class="{'comCursorUrl':item.Url}" @click="OpenNewUrl(item.Url)"> <div class="reTopInfo" :class="{'comCursorUrl':item.Url}" @click="OpenNewUrl(item.Url)">
<img v-if="!item.PicPath" src="../../assets/img/bg_c3@3x.png"> <img v-if="!item.PicPath" src="../../assets/img/bg_c3@3x.png">
<img v-else :src="item.PicPath" :onerror="defaultImg"> <img v-else :src='compressImg(item.PicPath, "filt", 213, "")' :onerror="defaultImg">
<div class="resTypeList"> <div class="resTypeList">
<span <span
v-for="(items,index) in item.OpenPlatformList" v-for="(items,index) in item.OpenPlatformList"
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<tr v-for="(item,index) in DataList"> <tr v-for="(item,index) in DataList">
<td class="picturMG"> <td class="picturMG">
<img v-if="!item.PicPath" src="../../assets/img/bg_c3@3x.png"> <img v-if="!item.PicPath" src="../../assets/img/bg_c3@3x.png">
<img v-else :src="item.PicPath" :onerror='defaultImg'> <img v-else :src='compressImg(item.PicPath, "filt", 213, "")' :onerror='defaultImg'>
</td> </td>
<td>{{item.TypeName}}</td> <td>{{item.TypeName}}</td>
<td>{{item.Name}}</td> <td>{{item.Name}}</td>
......
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
install(Vue, options) { install(Vue, options) {
Vue.prototype.MsgBus = MsgBus; Vue.prototype.MsgBus = MsgBus;
Vue.prototype.md5 = md5; Vue.prototype.md5 = md5;
Vue.prototype.orderBy=function(source, orders, type) { Vue.prototype.orderBy = function (source, orders, type) {
if ( if (
source instanceof Array && source instanceof Array &&
orders instanceof Array && orders instanceof Array &&
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
var totalSum = {}; var totalSum = {};
function grouporder(source, orders, totalSum) { function grouporder(source, orders, totalSum) {
source.sort(function(a, b) { source.sort(function (a, b) {
var convertA = a[orders[0]]; var convertA = a[orders[0]];
var convertB = b[orders[0]]; var convertB = b[orders[0]];
if (typeof convertA == "string" && typeof convertB == "string") { if (typeof convertA == "string" && typeof convertB == "string") {
...@@ -77,25 +77,27 @@ export default { ...@@ -77,25 +77,27 @@ export default {
return source; return source;
} }
}, },
Vue.prototype.calcPageSize=function(itemHeight){ Vue.prototype.calcPageSize = function (itemHeight) {
let yuHeight=itemHeight let yuHeight = itemHeight
try { try {
let obj=null let obj = null
document.querySelectorAll('.frame-box').forEach(x=>{ document.querySelectorAll('.frame-box').forEach(x => {
if(x.style.display!='none'){ if (x.style.display != 'none') {
obj=x obj = x
} }
}) })
let dom=obj.offsetHeight let dom = obj.offsetHeight
yuHeight=dom-(obj.querySelector('.v-table-header')?obj.querySelector('.v-table-header').offsetHeight:39)-50//减去面包屑,减去表格头部,减去分页,减去偏量 yuHeight = dom - (obj.querySelector('.v-table-header') ? obj.querySelector('.v-table-header').offsetHeight : 39) - 50 //减去面包屑,减去表格头部,减去分页,减去偏量
//减去其它同级元素 //减去其它同级元素
obj.childNodes[0].childNodes.forEach(x=>{ obj.childNodes[0].childNodes.forEach(x => {
if(x.className && x.className.indexOf('v-table-views')==-1){ if (x.className && x.className.indexOf('v-table-views') == -1) {
yuHeight-=x.offsetHeight?x.offsetHeight:0 yuHeight -= x.offsetHeight ? x.offsetHeight : 0
} }
}) })
} catch (error) {console.log(error)} } catch (error) {
return Math.floor(yuHeight/itemHeight) console.log(error)
}
return Math.floor(yuHeight / itemHeight)
} }
Vue.prototype.random_string = function (len) { Vue.prototype.random_string = function (len) {
len = len || 32; len = len || 32;
...@@ -117,10 +119,9 @@ export default { ...@@ -117,10 +119,9 @@ export default {
let locationName = window.location.hostname; let locationName = window.location.hostname;
// domainUrl = "http://192.168.2.65:8025"; //214主域名 // domainUrl = "http://192.168.2.65:8025"; //214主域名
domainUrl = "http://192.168.2.214:8082"; //214主域名 domainUrl = "http://192.168.2.214:8082"; //214主域名
if (locationName.indexOf('oytour')!==-1) { if (locationName.indexOf('oytour') !== -1) {
domainUrl = "http://reborn.oytour.com"; domainUrl = "http://reborn.oytour.com";
} } else if (locationName.indexOf('viitto') !== -1) {
else if (locationName.indexOf('viitto')!==-1) {
domainUrl = "http://test.viitto.com"; domainUrl = "http://test.viitto.com";
} }
var obj = { var obj = {
...@@ -145,10 +146,11 @@ export default { ...@@ -145,10 +146,11 @@ export default {
//google地图图片地址 //google地图图片地址
GoogleMapImageUrl: "http://super.oytour.com", GoogleMapImageUrl: "http://super.oytour.com",
//上传站点 //上传站点
UploadUrl: locationName.indexOf('oytour') !== -1||locationName.indexOf('viitto')!==-1 ? "http://upload.oytour.com" : "http://192.168.2.214:8120", UploadUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto') !== -1 ? "http://upload.oytour.com" : "http://192.168.2.214:8120",
//文件站点 //文件站点
ViittoFileUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto')!==-1 ? "http://imgfile.oytour.com" : 'http://192.168.2.214:8130', ViittoFileUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto') !== -1 ? "http://imgfile.oytour.com" : 'http://192.168.2.214:8130',
javaUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto')!==-1 ? "http://efficient.oytour.com" : "http://192.168.2.215:9000", javaUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto') !== -1 ? "http://efficient.oytour.com" : "http://192.168.2.215:9000",
compressUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto') !== -1 ? "http://imgfile.oytour.com" : 'http://192.168.2.214:8120',
}; };
return obj; return obj;
}, },
...@@ -211,30 +213,30 @@ export default { ...@@ -211,30 +213,30 @@ export default {
//打开新窗口连接 //打开新窗口连接
Vue.prototype.OpenNewUrl = function (URL) { Vue.prototype.OpenNewUrl = function (URL) {
if (URL != '') { if (URL != '') {
if(URL.indexOf("https")!=-1){ if (URL.indexOf("https") != -1) {
var str='http://' + URL.substring(8); var str = 'http://' + URL.substring(8);
window.open(str, '_blank'); window.open(str, '_blank');
}else if(URL.indexOf("http")!=-1) } else if (URL.indexOf("http") != -1) {
{ var str = 'http://' + URL.substring(7);
var str='http://' + URL.substring(7);
window.open(str, '_blank'); window.open(str, '_blank');
} } else {
else window.open("http://" + URL, '_blank');
{
window.open("http://"+URL, '_blank');
} }
} }
} }
Vue.prototype.uploadImg = function (tcID, msg, successCall, faildCall) { Vue.prototype.uploadImg = function (tcID, msg, successCall, faildCall) {
var apiurl = this.domainManager().UploadUrl + '/Upload/UploadBase64Two?fileType=1&fileLimit=5&&filePath=Freature/' + tcID; var apiurl = this.domainManager().UploadUrl + '/Upload/UploadBase64Two?fileType=1&fileLimit=5&&filePath=Freature/' + tcID;
console.log("msg",msg); console.log("msg", msg);
this.$http.post(apiurl,{FileIndex:msg.FileIndex,MyFile:msg.MyFile},{ this.$http.post(apiurl, {
FileIndex: msg.FileIndex,
MyFile: msg.MyFile
}, {
headers: { headers: {
"Content-Type": "application/x-www-form-urlencoded;" "Content-Type": "application/x-www-form-urlencoded;"
}, },
}).then(function(res){ }).then(function (res) {
console.log(res) console.log(res)
}) })
...@@ -294,13 +296,13 @@ export default { ...@@ -294,13 +296,13 @@ export default {
}, },
Vue.prototype.ApiPost2=function (cmd, msg, successCall, faildCall) { Vue.prototype.ApiPost2 = function (cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") { if (msg == null || msg == "") {
msg = {} msg = {}
} }
var apiNewurl = this.domainManager().DomainUrl; var apiNewurl = this.domainManager().DomainUrl;
var timestamp = (new Date()).valueOf(); var timestamp = (new Date()).valueOf();
apiNewurl = apiNewurl+"/Api/Trip/"+cmd; apiNewurl = apiNewurl + "/Api/Trip/" + cmd;
if (this.$route.path.toLowerCase() == "/signature") { if (this.$route.path.toLowerCase() == "/signature") {
this.$router.push({ this.$router.push({
path: '/signature' path: '/signature'
...@@ -326,7 +328,7 @@ export default { ...@@ -326,7 +328,7 @@ export default {
"timestamp": timestamp, "timestamp": timestamp,
"token": token, "token": token,
"sign": md5Str, "sign": md5Str,
"uid":this.getLocalStorage().EmployeeId "uid": this.getLocalStorage().EmployeeId
} }
this.$http.post(apiNewurl, postData, { this.$http.post(apiNewurl, postData, {
...@@ -348,7 +350,7 @@ export default { ...@@ -348,7 +350,7 @@ export default {
}, faildCall) }, faildCall)
}, },
Vue.prototype.apiJavaPost = function(cmd, msg, successCall, faildCall) { Vue.prototype.apiJavaPost = function (cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") { if (msg == null || msg == "") {
msg = {} msg = {}
} }
...@@ -372,9 +374,9 @@ export default { ...@@ -372,9 +374,9 @@ export default {
"token": token, "token": token,
"sign": md5Str, "sign": md5Str,
"uid": uid, "uid": uid,
"groupId":groupId "groupId": groupId
} }
if(localStorage.g && localStorage.g!='undefined'){ if (localStorage.g && localStorage.g != 'undefined') {
postData.groupId = parseInt(JSON.parse(localStorage.g).i) postData.groupId = parseInt(JSON.parse(localStorage.g).i)
} }
this.$http.post(apiurl, postData, { this.$http.post(apiurl, postData, {
...@@ -437,7 +439,7 @@ export default { ...@@ -437,7 +439,7 @@ export default {
Vue.prototype.getLocalStorage = function () { Vue.prototype.getLocalStorage = function () {
var localStorageData = window.localStorage["userInfo"]; var localStorageData = window.localStorage["userInfo"];
if (localStorageData !== undefined && localStorageData!='undefined') { if (localStorageData !== undefined && localStorageData != 'undefined') {
return JSON.parse(localStorageData); return JSON.parse(localStorageData);
} else { } else {
return null; return null;
...@@ -478,7 +480,7 @@ export default { ...@@ -478,7 +480,7 @@ export default {
}) })
let url = ''; let url = '';
if(fileurl) if (fileurl)
url = fileurl url = fileurl
else else
url = oss.signatureUrl(objectKey); url = oss.signatureUrl(objectKey);
...@@ -535,10 +537,12 @@ export default { ...@@ -535,10 +537,12 @@ export default {
}, },
Vue.prototype.uploadSelfBlob = function (path, files, successCall) { Vue.prototype.uploadSelfBlob = function (path, files, successCall) {
let that = this; let that = this;
var uploadUrl=that.domainManager().UploadUrl+"/Upload/UploadBlob?fileType=1&fileLimit=5&&filePath="+path; var uploadUrl = that.domainManager().UploadUrl + "/Upload/UploadBlob?fileType=1&fileLimit=5&&filePath=" + path;
var formData = new FormData(); var formData = new FormData();
formData.append("myfile", files[0]); formData.append("myfile", files[0]);
that.$http.post(uploadUrl, formData,{'Content-Type':'multipart/form-data'}) that.$http.post(uploadUrl, formData, {
'Content-Type': 'multipart/form-data'
})
.then(res => { .then(res => {
successCall(res); successCall(res);
}) })
...@@ -562,7 +566,7 @@ export default { ...@@ -562,7 +566,7 @@ export default {
co(function* () { co(function* () {
for (let index = 0; index < files.length; index++) { for (let index = 0; index < files.length; index++) {
let fileName = nameList[index] let fileName = nameList[index]
fileName ="/New"+ path + fileName + "." + files[index].name.split('.').pop() fileName = "/New" + path + fileName + "." + files[index].name.split('.').pop()
var result = yield oss.multipartUpload(fileName, files[index], { var result = yield oss.multipartUpload(fileName, files[index], {
progress: function* (p) {}, progress: function* (p) {},
mime: 'application/octet-stream' mime: 'application/octet-stream'
...@@ -576,8 +580,7 @@ export default { ...@@ -576,8 +580,7 @@ export default {
} }
}, },
//上传文件到本地服务器 //上传文件到本地服务器
Vue.prototype.UploadSelfFileT=function(path,files,successCall) Vue.prototype.UploadSelfFileT = function (path, files, successCall) {
{
if (files && files.length > 0) { if (files && files.length > 0) {
let nameList = new Array() let nameList = new Array()
for (let index = 0; index < files.length; index++) { for (let index = 0; index < files.length; index++) {
...@@ -589,7 +592,7 @@ export default { ...@@ -589,7 +592,7 @@ export default {
let fileName = nameList[index] let fileName = nameList[index]
fileName = path + fileName + "." + files[index].name.split('.').pop() fileName = path + fileName + "." + files[index].name.split('.').pop()
var formData = new FormData(); var formData = new FormData();
var uploadUrl=that.domainManager().UploadUrl+"/Upload?filePath="+path; var uploadUrl = that.domainManager().UploadUrl + "/Upload?filePath=" + path;
formData.append("myfile", files[index]); formData.append("myfile", files[index]);
that.$http.post(uploadUrl, formData, {}) that.$http.post(uploadUrl, formData, {})
.then(res => { .then(res => {
...@@ -597,17 +600,35 @@ export default { ...@@ -597,17 +600,35 @@ export default {
}) })
} }
}).catch(function (err) { }).catch(function (err) {
console.log("上传文件出错"+err); console.log("上传文件出错" + err);
}); });
} }
} }
//压缩图片
//path : 图片路径
//type : m_filt 填充 m_w 宽度固定 高度不固定 m_h 高度固定 宽度不固定
// w : 宽
// h : 高
Vue.prototype.compressImg = function (path, type, w, h) {
let url = this.domainManager().compressUrl;
let poise = 'm_filt';
w = w ? w : ''
h = h ? h : ''
if (type === 'w') {
poise = 'm_w'
} else if (type === 'h') {
poise = 'm_h'
}
return url + '/image/index?filePath=' + path.replace('http://192.168.2.214:8130', '').replace('http://imgfile.oytour.com', '').split('?')[0] + '&process=resize,' + poise + ',w_' + w + ',h_' + h;
}
Vue.prototype.uploadSelfBlob = function (path, files, successCall) { Vue.prototype.uploadSelfBlob = function (path, files, successCall) {
let that = this; let that = this;
var uploadUrl=that.domainManager().UploadUrl+"/Upload/UploadBlob?fileType=1&fileLimit=5&&filePath="+path; var uploadUrl = that.domainManager().UploadUrl + "/Upload/UploadBlob?fileType=1&fileLimit=5&&filePath=" + path;
var formData = new FormData(); var formData = new FormData();
formData.append("myfile", files[0]); formData.append("myfile", files[0]);
that.$http.post(uploadUrl, formData,{'Content-Type':'multipart/form-data'}) that.$http.post(uploadUrl, formData, {
'Content-Type': 'multipart/form-data'
})
.then(res => { .then(res => {
successCall(res); successCall(res);
}) })
......
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