Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SuperMan
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
SuperMan
Commits
3b31c7d8
Commit
3b31c7d8
authored
Aug 30, 2023
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
5a7bc4ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
51 deletions
+12
-51
VEditDiv.vue
...wTravelmanager/TravelGroupControl/TravelTemp/VEditDiv.vue
+8
-50
index.vue
...ravelmanager/TravelGroupControl/UpgradedVersion/index.vue
+4
-1
No files found.
src/components/newTravelmanager/TravelGroupControl/TravelTemp/VEditDiv.vue
View file @
3b31c7d8
<
template
>
<div
class=
"edit_div"
:contenteditable=
"canEdit"
v-html=
"innerText"
@
focus=
"isLocked = true"
@
blur=
"isLocked = fals
e"
@
input=
"changeText"
>
<div
:data-name=
"isLocked"
class=
"edit_div"
:contenteditable=
"canEdit"
v-html=
"innerText"
@
focus=
"isLocked = tru
e"
@
blur=
"isLocked = false"
@
input=
"changeText"
>
</div>
</
template
>
<
script
>
...
...
@@ -21,7 +21,6 @@
},
methods
:
{
changeText
:
function
()
{
var
that
=
this
;
let
sel
=
window
.
getSelection
();
let
offset
=
sel
.
anchorOffset
;
if
(
this
.
textLength
&&
this
.
$el
.
innerText
.
length
>
this
.
textLength
)
{
...
...
@@ -29,55 +28,14 @@
}
this
.
$emit
(
"input"
,
this
.
$el
.
innerText
);
setTimeout
(()
=>
{
try
{
var
range
=
sel
.
getRangeAt
(
0
);
var
textNode
=
range
.
startContainer
;
var
textNodeName
=
textNode
.
nodeName
;
if
(
textNodeName
==
"#text"
)
{
range
.
setStart
(
textNode
,
offset
);
sel
.
removeAllRanges
();
sel
.
addRange
(
range
);
}
else
{
that
.
setCaretPosition
(
that
.
$el
,
offset
);
}
}
catch
(
err
)
{
console
.
log
(
err
);
}
},
0
);
},
//重置div光标位置
setCaretPosition
(
element
,
offset
)
{
var
range
=
document
.
createRange
();
var
sel
=
window
.
getSelection
();
//select appropriate node
var
currentNode
=
null
;
var
previousNode
=
null
;
for
(
var
i
=
0
;
i
<
element
.
childNodes
.
length
;
i
++
)
{
//save previous node
previousNode
=
currentNode
;
//get current node
currentNode
=
element
.
childNodes
[
i
];
//if we get span or something else then we should get child node
while
(
currentNode
.
childNodes
.
length
>
0
)
{
currentNode
=
currentNode
.
childNodes
[
0
];
}
//calc offset in current node
if
(
previousNode
!=
null
)
{
offset
-=
previousNode
.
length
;
}
//check whether current node has enough length
if
(
offset
<=
currentNode
.
length
)
{
break
;
}
}
//move caret to specified offset
if
(
currentNode
!=
null
)
{
range
.
setStart
(
currentNode
,
offset
);
range
.
collapse
(
true
);
var
range
=
sel
.
getRangeAt
(
0
);
var
textNode
=
range
.
startContainer
;
range
.
setStart
(
textNode
,
offset
);
sel
.
removeAllRanges
();
sel
.
addRange
(
range
);
}
}
},
0
);
},
}
};
...
...
src/components/newTravelmanager/TravelGroupControl/UpgradedVersion/index.vue
View file @
3b31c7d8
<
template
>
<div
id=
"newFeatureBox3"
>
<div
id=
"newFeatureBox3"
v-if=
"RenderingOk"
>
<!-- UpgradedVersion-homebj 首页、介绍、食、宿、景 UpgradedVersion-otherBj 餐介绍 -->
<div
class=
"UpgradedVersion-box UpgradedVersion-homebj relative"
:class=
"
{'UpgradedVersion-otherBj':item.pageType==3}" v-for="(item,index) in pageList" :key="index+1000">
...
...
@@ -114,6 +114,7 @@
dinner2
:
"http://imgfile.oytour.com/Static/NewTripFeature/dinner2.jpg"
,
dinner3
:
"http://imgfile.oytour.com/Static/NewTripFeature/dinner3.jpg"
,
dinner4
:
"https://imgfile.oytour.com/Static/NewTripFeature/dinner4.jpg"
,
RenderingOk
:
false
,
};
},
methods
:
{
...
...
@@ -194,6 +195,7 @@
""
;
if
(
oldJson
&&
oldJson
.
length
>
0
)
{
this
.
pageList
=
oldJson
;
this
.
RenderingOk
=
true
;
}
else
{
var
tripObj
=
this
.
getTripData
();
this
.
pageList
.
forEach
(
pItem
=>
{
...
...
@@ -227,6 +229,7 @@
}
pItem
.
dataObj
=
newObj
;
});
this
.
RenderingOk
=
true
;
}
},
//首页数据渲染
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment