Commit 239dc13b authored by youjie's avatar youjie
parents 880ddc88 aa4588c0
<template>
<span :data-name="isLocked" class="edit_div" :contenteditable="canEdit" v-html="innerText" @focus="isLocked = true"
@blur="isLocked = false" @input="changeText">
</span>
</template>
<script>
export default {
props: ["value", "canEdit", "textLength"],
data() {
return {
innerText: this.value,
isLocked: false
};
},
watch: {
value() {
if (!this.isLocked || !this.innerText) {
this.$el.innerText = this.value;
}
}
},
methods: {
changeText: function () {
let sel = window.getSelection();
let offset = sel.anchorOffset;
if (this.textLength && this.$el.innerText.length > this.textLength) {
this.$el.innerText = this.$el.innerText.slice(0, this.textLength);
}
this.$emit("input", this.$el.innerText);
setTimeout(() => {
try {
var range = sel.getRangeAt(0);
var textNode = range.startContainer;
range.setStart(textNode, offset);
sel.removeAllRanges();
sel.addRange(range);
} catch (err) {
console.warn(err);
}
}, 0);
},
}
};
</script>
<style>
.edit_div {}
</style>
......@@ -77,7 +77,7 @@
</div>
</td>
<td rowspan="2">
<span class="bianji opbd" @click="goUrl('TravelManager2',item.ID,false)">
<span class="bianji opbd" @click="goUrl('TravelManager',item.ID,false)">
<el-tooltip class="item" effect="dark" content="行程修改" placement="top-start" popper-class="max-w250">
<i class="iconfont icon-bianji-smal"></i>
</el-tooltip>
......
......@@ -41,43 +41,38 @@
class="absolute" :src="ScenicArrayList[0].NewImaArray[0].Url"
:id="'viewSpotImg_'+(item*4)+'_0'+index">
</template>
<img v-if="ScenicArrayList.length==0&&item.ScenicArray.length==0" class="absolute"
:src="item.TrafficObj.trafficIntroduce.IntroduceImage" :id="'viewSpotImg_'+(item*4)+'_0'+index">
</VueDraggableResizable>
<img
<img
v-if="ScenicArrayList.length==0&&item.ScenicArray.length==0&&!item.TrafficObj.trafficIntroduce.IntroduceImage"
class="absolute" :src="domainManager().ViittoFileUrl+'/Upload/DefalutImage/DMC/defaultairline.png'">
</div>
</div>
</div>
<div class="travelDaysContent">
<div class="travelDaysContent-text" v-for="(jindian,j) in item.ScenicArray" v-if="item.ScenicArray.length>0"
:key="j">
<span class="textBold">
【{{jindian.CouponsName}}】
</span>
<span>
<vEditDiv :canEdit='canEdit' v-model="jindian.Description"></vEditDiv>
</span>
</div>
<template v-if="item.ScenicArray.length>0">
<div class="travelDaysContent-text" v-for="(jindian,j) in item.ScenicArray" :key="j">
<span class="textBold">
{{jindian.CouponsName}}
</span>
<vEditSpan :canEdit='canEdit' v-model="jindian.Description"></vEditSpan>
</div>
</template>
<div v-if="item.ScenicArray.length==0" class="travelDaysContent-text">
<span class="textBold">
<vEditDiv class="dayCouponsName" :canEdit='canEdit'
v-model="'【'+item.TrafficObj.trafficIntroduce.IntroduceTitle+'】'"></vEditDiv>
</span>
<span>
<vEditDiv :canEdit='canEdit' v-model="item.TrafficObj.trafficIntroduce.IntroduceDetail"></vEditDiv>
</span>
<vEditSpan :canEdit='canEdit' v-model="item.TrafficObj.trafficIntroduce.IntroduceDetail"></vEditSpan>
</div>
</div>
<div class="travelDaysdetails-tsTextBox">
<div class="travelDaysdetails-tsTextBox"
v-if="item.WarmTipObj.Description&&getHtmlPlainText(item.WarmTipObj.Description).length>0">
<div class="travelDaysdetails-tsText" :style="{'background':backgroundColor2}">
<span class="travelDaysdetails-text0">温馨提示:</span>
<template v-if="item.WarmTipObj.Description&&getHtmlPlainText(item.WarmTipObj.Description).length>0">
<div v-html="item.WarmTipObj.Description"></div>
</template>
<template v-else>暂无提示</template>
<span v-html="item.WarmTipObj.Description"></span>
</div>
</div>
<div class="travelDaysdetails">
......@@ -150,12 +145,14 @@
<script>
import Header from "./header";
import vEditDiv from "../../TravelGroupControl/TravelTemp/VEditDiv";
import vEditSpan from "../../TravelGroupControl/TravelTemp/VEditSpan";
import FeatureControls from "../../TravelGroupControl/UpgradedVersion/components/featureControls";
import DMCchooseImg from "../../../commonPage/DMCchooseImg.vue";
import VueDraggableResizable from "vue-draggable-resizable";
export default {
components: {
vEditDiv,
vEditSpan,
Header,
FeatureControls,
DMCchooseImg,
......@@ -350,9 +347,6 @@
}
});
}
if (this.ScenicArrayList && this.ScenicArrayList.length > 0) this.ScenicArrayList.sort((a, b) => {
return a.Rank - b.Rank
})
this.RenderingOk = true;
},
deep: 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