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

新增图片裁剪

parent 519b442f
......@@ -284,7 +284,7 @@
<div class="resourceList" v-for="(item,index) in tableData" :key="index">
<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-else :src="item.PicPath">
<img v-else :src='compressImg(item.PicPath, "filt", 213, "")' :onerror="defaultImg">
<div class="RemainingInventory">{{item.RemainingInventory}}</div>
<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>
......@@ -356,6 +356,7 @@
label: "删除"
}
],
defaultImg: 'this.src="' + require("../../assets/img/bg_z1@2x.png") + '"',
loading: true,
msg: {
pageIndex: 1,
......
......@@ -301,7 +301,7 @@
<div class="resourceList" v-for="(item,index) in tableData" :key="index">
<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-else :src="item.PicPath" :onerror="defaultImg">
<img v-else :src='compressImg(item.PicPath, "filt", 213, "")' :onerror="defaultImg">
<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}"
:key="index">{{items.Name}}</span>
......
......@@ -143,7 +143,7 @@
<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="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>
<div class="imgDescription">{{item.Name}}</div>
......
......@@ -18,8 +18,8 @@
<div class="five-box day_table">
<div class="left">
<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-else :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='compressImg(day.details[2].img, "filt", 663, "")' />
</div>
<table class="day_table">
<tr>
......@@ -52,8 +52,8 @@
<div class="item item5">
<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 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-else :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='compressImg(item.img, "filt", 663, "")' />
</div>
<div class="down">
......
......@@ -21,8 +21,8 @@
<td>
<div class="item big">
<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-else :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='compressImg(day.details[0].img, "filt", 663, "")' />
</div>
<div class="right">
<div class="details">
......@@ -54,8 +54,8 @@
<div class="item">
<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 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-else :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='compressImg(item.img, "filt", 663, "")' />
</div>
<div class="down">
<h4 v-html="item.title" @click.stop="goUrl(item.url)" style="cursor: pointer" ></h4>
......
......@@ -21,7 +21,7 @@
<td>
<div class="item big" style='margin-bottom:20px;'>
<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-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'" />
......
......@@ -20,8 +20,9 @@
<td>
<div class="item big">
<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-else :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='compressImg(day.details[0].img, "filt", 663, "")' />
</div>
<div class="right">
<div class="details">
......@@ -72,8 +73,9 @@
<div>
<div class="item hor-box">
<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-else :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'}"
:src='compressImg(day.details[1].img, "filt", 663, "")'/>
<img v-else :src='compressImg(day.details[1].img, "filt", 663, "")' />
</div>
</div>
</div>
......@@ -88,8 +90,8 @@
<div>
<div class="item hor-box">
<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-else :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='compressImg(day.details[2].img, "filt", 663, "")' />
</div>
</div>
</div>
......
......@@ -22,8 +22,8 @@
<div class="twoday_item" v-for="item in day.details" :key="item.dayNum">
<div class="item">
<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-else :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='compressImg(item.img, "filt", 663, 325)' />
</div>
<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>
......
......@@ -652,8 +652,8 @@
if (this.showType >= 4) { // 判断是否为行程特色
var apiurl = this.domainManager().UploadUrl + '/Upload/GetImage?filePath=Feature/' + tcid;
this.$http.post(apiurl).then(res => {
let msg = res
if (msg.ResultCode) { // 已经存在文件 直接调用下载
let msg = res.data
if (msg.ResultCode === 1 && _this.vshowC) { // 已经存在文件 直接调用下载
_this.ToWord(_this.orderMsg.startDate + _this.orderMsg.lineteamName + _this.orderMsg.dayNum +
'日游', isPc)
} else if (document.querySelector("#gernalCanvas")) { // 不存在图片保存图片后下载
......@@ -662,14 +662,6 @@
'日游', isPc)
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 = ''
if (_this.showType == 4) {
cName = '.feature-box'
......@@ -1042,6 +1034,12 @@
for (let i = 0; i < imgs.length; i++) {
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 => {})
},
......
......@@ -151,7 +151,7 @@
<div class="Travel_ImgList clearfix">
<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-else :src="item.Url">
<img v-else :src='compressImg(item.Url, "filt", 170, "")'>
<div class="TFIMGzhe">
<div class="TFreupload" @click="updateTFimg(index)">
<el-upload :file-list="PostConfig.fileList" :http-request="reUpload" :multiple="true"
......
......@@ -5,7 +5,7 @@
<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"
: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>
<div class="TC_uploadDiv">
<el-form-item>
......@@ -48,7 +48,7 @@
<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"
: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>
<div class="TC_uploadDiv">
......@@ -91,7 +91,7 @@
<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"
: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>
<div class="TC_uploadDiv">
......@@ -134,7 +134,7 @@
<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"
: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>
<div class="TC_uploadDiv">
<el-form-item>
......@@ -177,7 +177,7 @@
<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"
: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>
<div class="TC_uploadDiv">
......
......@@ -22,7 +22,7 @@
<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"
: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>
<div class="TC_uploadDiv">
<el-form-item>
......@@ -65,7 +65,7 @@
<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"
: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>
<div class="TC_uploadDiv">
......@@ -108,7 +108,7 @@
<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"
: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>
<!-- <img v-if="scenicArray[2].NewImaArray.length>0&&scenicArray[2].NewImaArray[0].Url" :src="scenicArray[2].NewImaArray[0].Url" alt="" />
......@@ -153,7 +153,7 @@
<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"
: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>
<div class="TC_uploadDiv">
<el-form-item>
......
......@@ -26,7 +26,7 @@
<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"
: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>
<!-- <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> -->
......
......@@ -21,7 +21,7 @@
<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"
: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>
<div class="TC_uploadDiv">
<el-form-item>
......@@ -88,7 +88,7 @@
<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"
: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>
<div class="TC_uploadDiv">
<el-form-item>
......@@ -109,7 +109,7 @@
<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"
: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>
<div class="TC_uploadDiv">
<el-form-item>
......
......@@ -10,7 +10,7 @@
<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"
: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>
<div class="TC_uploadDiv">
<el-form-item>
......@@ -54,7 +54,7 @@
<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"
: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>
<div class="TC_uploadDiv">
<el-form-item>
......
......@@ -285,7 +285,7 @@ export default {
.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 .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 .phoverStype:hover{text-decoration: underline; cursor: pointer;}
.admissionStatistics_tripDetails {padding: 0; box-shadow: 0px 1px 3px 0px #dedede; max-height: 400px;overflow-y: auto;}
......
......@@ -312,7 +312,7 @@
<div class="resourceList" v-for="item in tableData" :key="item.subCode">
<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-else :src="item.PicPath" :onerror="defaultImg">
<img v-else :src='compressImg(item.PicPath, "filt", 213, "")' :onerror="defaultImg">
<div class="resTypeList">
<span
v-for="(items,index) in item.OpenPlatformList"
......
......@@ -50,7 +50,7 @@
<tr v-for="(item,index) in DataList">
<td class="picturMG">
<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>{{item.TypeName}}</td>
<td>{{item.Name}}</td>
......
......@@ -11,92 +11,94 @@ export default {
install(Vue, options) {
Vue.prototype.MsgBus = MsgBus;
Vue.prototype.md5 = md5;
Vue.prototype.orderBy=function(source, orders, type) {
if (
source instanceof Array &&
orders instanceof Array &&
orders.length > 0
) {
var ordersc = orders.concat([]);
var sorttype = type || "asc";
var results = [];
var totalSum = {};
function grouporder(source, orders, totalSum) {
source.sort(function(a, b) {
var convertA = a[orders[0]];
var convertB = b[orders[0]];
if (typeof convertA == "string" && typeof convertB == "string") {
if (sorttype.toUpperCase() == "ASC") {
return convertA.localeCompare(convertB);
Vue.prototype.orderBy = function (source, orders, type) {
if (
source instanceof Array &&
orders instanceof Array &&
orders.length > 0
) {
var ordersc = orders.concat([]);
var sorttype = type || "asc";
var results = [];
var totalSum = {};
function grouporder(source, orders, totalSum) {
source.sort(function (a, b) {
var convertA = a[orders[0]];
var convertB = b[orders[0]];
if (typeof convertA == "string" && typeof convertB == "string") {
if (sorttype.toUpperCase() == "ASC") {
return convertA.localeCompare(convertB);
} else {
return convertB.localeCompare(convertA);
}
} else {
return convertB.localeCompare(convertA);
if (sorttype.toUpperCase() == "ASC") {
return convertA - convertB;
} else {
return convertB - convertA;
}
}
} else {
if (sorttype.toUpperCase() == "ASC") {
return convertA - convertB;
});
var groupmap = new Map();
source.forEach(item => {
if (groupmap.has(item[orders[0]])) {
groupmap.get(item[orders[0]]).push(item);
} else {
return convertB - convertA;
groupmap.set(item[orders[0]], []);
groupmap.get(item[orders[0]]).push(item);
}
}
});
});
var groupmap = new Map();
source.forEach(item => {
if (groupmap.has(item[orders[0]])) {
groupmap.get(item[orders[0]]).push(item);
} else {
groupmap.set(item[orders[0]], []);
groupmap.get(item[orders[0]]).push(item);
}
});
orders.shift();
orders.shift();
for (let [key, val] of groupmap) {
totalSum[key] = {};
totalSum[key].name = key;
totalSum[key].value = val.length;
if (orders.length == 0) {
results = results.concat(val);
} else {
totalSum[key].children = {};
var orderscopy = orders.concat([]);
grouporder(val, orderscopy, totalSum[key].children);
for (let [key, val] of groupmap) {
totalSum[key] = {};
totalSum[key].name = key;
totalSum[key].value = val.length;
if (orders.length == 0) {
results = results.concat(val);
} else {
totalSum[key].children = {};
var orderscopy = orders.concat([]);
grouporder(val, orderscopy, totalSum[key].children);
}
}
}
}
grouporder(source, ordersc, totalSum);
grouporder(source, ordersc, totalSum);
return {
results: results,
totalSum: totalSum
};
} else {
return source;
return {
results: results,
totalSum: totalSum
};
} else {
return source;
}
},
Vue.prototype.calcPageSize = function (itemHeight) {
let yuHeight = itemHeight
try {
let obj = null
document.querySelectorAll('.frame-box').forEach(x => {
if (x.style.display != 'none') {
obj = x
}
})
let dom = obj.offsetHeight
yuHeight = dom - (obj.querySelector('.v-table-header') ? obj.querySelector('.v-table-header').offsetHeight : 39) - 50 //减去面包屑,减去表格头部,减去分页,减去偏量
//减去其它同级元素
obj.childNodes[0].childNodes.forEach(x => {
if (x.className && x.className.indexOf('v-table-views') == -1) {
yuHeight -= x.offsetHeight ? x.offsetHeight : 0
}
})
} catch (error) {
console.log(error)
}
return Math.floor(yuHeight / itemHeight)
}
},
Vue.prototype.calcPageSize=function(itemHeight){
let yuHeight=itemHeight
try {
let obj=null
document.querySelectorAll('.frame-box').forEach(x=>{
if(x.style.display!='none'){
obj=x
}
})
let dom=obj.offsetHeight
yuHeight=dom-(obj.querySelector('.v-table-header')?obj.querySelector('.v-table-header').offsetHeight:39)-50//减去面包屑,减去表格头部,减去分页,减去偏量
//减去其它同级元素
obj.childNodes[0].childNodes.forEach(x=>{
if(x.className && x.className.indexOf('v-table-views')==-1){
yuHeight-=x.offsetHeight?x.offsetHeight:0
}
})
} catch (error) {console.log(error)}
return Math.floor(yuHeight/itemHeight)
}
Vue.prototype.random_string = function (len) {
len = len || 32;
var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
......@@ -113,16 +115,15 @@ export default {
},
//域名管理对象
Vue.prototype.domainManager = function () {
let domainUrl = '';
let locationName = window.location.hostname;
// domainUrl = "http://192.168.2.65:8025"; //214主域名
domainUrl = "http://192.168.2.214:8082"; //214主域名
if (locationName.indexOf('oytour')!==-1) {
domainUrl = "http://reborn.oytour.com";
}
else if (locationName.indexOf('viitto')!==-1) {
domainUrl = "http://test.viitto.com";
}
let domainUrl = '';
let locationName = window.location.hostname;
// domainUrl = "http://192.168.2.65:8025"; //214主域名
domainUrl = "http://192.168.2.214:8082"; //214主域名
if (locationName.indexOf('oytour') !== -1) {
domainUrl = "http://reborn.oytour.com";
} else if (locationName.indexOf('viitto') !== -1) {
domainUrl = "http://test.viitto.com";
}
var obj = {
//主地址
DomainUrl: domainUrl,
......@@ -145,10 +146,11 @@ export default {
//google地图图片地址
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',
javaUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto')!==-1 ? "http://efficient.oytour.com" : "http://192.168.2.215:9000",
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",
compressUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto') !== -1 ? "http://imgfile.oytour.com" : 'http://192.168.2.214:8120',
};
return obj;
},
......@@ -211,31 +213,31 @@ export default {
//打开新窗口连接
Vue.prototype.OpenNewUrl = function (URL) {
if (URL != '') {
if(URL.indexOf("https")!=-1){
var str='http://' + URL.substring(8);
window.open(str, '_blank');
}else if(URL.indexOf("http")!=-1)
{
var str='http://' + URL.substring(7);
if (URL.indexOf("https") != -1) {
var str = 'http://' + URL.substring(8);
window.open(str, '_blank');
}
else
{
window.open("http://"+URL, '_blank');
} else if (URL.indexOf("http") != -1) {
var str = 'http://' + URL.substring(7);
window.open(str, '_blank');
} else {
window.open("http://" + URL, '_blank');
}
}
}
Vue.prototype.uploadImg = function (tcID, msg, successCall, faildCall) {
var apiurl = this.domainManager().UploadUrl + '/Upload/UploadBase64Two?fileType=1&fileLimit=5&&filePath=Freature/' + tcID;
console.log("msg",msg);
this.$http.post(apiurl,{FileIndex:msg.FileIndex,MyFile:msg.MyFile},{
console.log("msg", msg);
this.$http.post(apiurl, {
FileIndex: msg.FileIndex,
MyFile: msg.MyFile
}, {
headers: {
"Content-Type": "application/x-www-form-urlencoded;"
},
}).then(function(res){
console.log(res)
}).then(function (res) {
console.log(res)
})
}
......@@ -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 == "") {
msg = {}
}
var apiNewurl = this.domainManager().DomainUrl;
var timestamp = (new Date()).valueOf();
apiNewurl = apiNewurl+"/Api/Trip/"+cmd;
apiNewurl = apiNewurl + "/Api/Trip/" + cmd;
if (this.$route.path.toLowerCase() == "/signature") {
this.$router.push({
path: '/signature'
......@@ -326,7 +328,7 @@ export default {
"timestamp": timestamp,
"token": token,
"sign": md5Str,
"uid":this.getLocalStorage().EmployeeId
"uid": this.getLocalStorage().EmployeeId
}
this.$http.post(apiNewurl, postData, {
......@@ -348,9 +350,9 @@ export default {
}, faildCall)
},
Vue.prototype.apiJavaPost = function(cmd, msg, successCall, faildCall) {
Vue.prototype.apiJavaPost = function (cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") {
msg = {}
msg = {}
}
var apiurl = this.domainManager().javaUrl + cmd;
var timestamp = (new Date()).valueOf();
......@@ -361,39 +363,39 @@ export default {
let groupId = userInfo.RB_Group_id ? userInfo.RB_Group_id : 0;
let uid = userInfo.EmployeeId ? userInfo.EmployeeId : 0;
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().token;
key = this.getLocalStorage().SecretKey;
token = this.getLocalStorage().token;
key = this.getLocalStorage().SecretKey;
}
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
var postData = {
"msg": msg,
"timestamp": timestamp,
"token": token,
"sign": md5Str,
"uid": uid,
"groupId":groupId
"msg": msg,
"timestamp": timestamp,
"token": token,
"sign": md5Str,
"uid": uid,
"groupId": groupId
}
if(localStorage.g && localStorage.g!='undefined'){
postData.groupId = parseInt(JSON.parse(localStorage.g).i)
if (localStorage.g && localStorage.g != 'undefined') {
postData.groupId = parseInt(JSON.parse(localStorage.g).i)
}
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
.then(res => {
})
.then(res => {
if (res.resultCode == 10000 || res.resultCode == 10001) {
this.$router.push({
path: '/login'
})
this.$router.push({
path: '/login'
})
} else if (res.resultCode == 10005) {
this.$router.go(-1)
this.$router.go(-1)
} else {
successCall(res)
successCall(res)
}
}, faildCall)
}, faildCall)
},
//下载文件
Vue.prototype.GetLocalFile = function (cmd, msg, fileName, successCall) {
......@@ -434,19 +436,19 @@ export default {
successCall(res);
}).catch(function (res) {});
},
Vue.prototype.getLocalStorage = function () {
var localStorageData = window.localStorage["userInfo"];
if (localStorageData !== undefined && localStorageData!='undefined') {
if (localStorageData !== undefined && localStorageData != 'undefined') {
return JSON.parse(localStorageData);
} else {
return null;
}
},
//PDF预览
Vue.prototype.previewPDF = function (url) {
//PDF预览
Vue.prototype.previewPDF = function (url) {
window.open(this.domainManager().PDFViewUrl + url);
},
......@@ -473,12 +475,12 @@ export default {
var oss = new OSS({
region: 'oss-cn-hangzhou',
accessKeyId: 'LTAIwE7l9dImZSa3',
accessKeySecret: 'j47Ajn0d0WzUCIX8Biyj3P2r8QDltI',
accessKeySecret: 'j47Ajn0d0WzUCIX8Biyj3P2r8QDltI',
bucket: 'reborndev'
})
let url = '';
if(fileurl)
if (fileurl)
url = fileurl
else
url = oss.signatureUrl(objectKey);
......@@ -535,13 +537,15 @@ export default {
},
Vue.prototype.uploadSelfBlob = function (path, files, successCall) {
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();
formData.append("myfile", files[0]);
that.$http.post(uploadUrl, formData,{'Content-Type':'multipart/form-data'})
.then(res => {
successCall(res);
})
that.$http.post(uploadUrl, formData, {
'Content-Type': 'multipart/form-data'
})
.then(res => {
successCall(res);
})
},
//path 请按照"/模块名称/用户ID/自定义文件夹/" /谁搞错一次5块红包
//files 文件数组
......@@ -562,7 +566,7 @@ export default {
co(function* () {
for (let index = 0; index < files.length; 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], {
progress: function* (p) {},
mime: 'application/octet-stream'
......@@ -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) {
let nameList = new Array()
for (let index = 0; index < files.length; index++) {
......@@ -589,28 +592,46 @@ export default {
let fileName = nameList[index]
fileName = path + fileName + "." + files[index].name.split('.').pop()
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]);
that.$http.post(uploadUrl, formData, {})
.then(res => {
successCall(res);
})
.then(res => {
successCall(res);
})
}
}).catch(function (err) {
console.log("上传文件出错"+err);
console.log("上传文件出错" + err);
});
}
}
Vue.prototype.uploadSelfBlob = function (path, files, successCall) {
//压缩图片
//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) {
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();
formData.append("myfile", files[0]);
that.$http.post(uploadUrl, formData,{'Content-Type':'multipart/form-data'})
.then(res => {
successCall(res);
})
that.$http.post(uploadUrl, formData, {
'Content-Type': 'multipart/form-data'
})
.then(res => {
successCall(res);
})
},
//验证只能输入2位小数【负数:isMinus传true】
......
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