文档服务地址:http://47.92.0.57:3000/ 周报索引地址:http://47.92.0.57:3000/s/NruNXRYmV

Commit b3f9849d by 郭婉茹

弹框实体属性

parent c0e4d848
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
</ul> </ul>
</div> </div>
<div> <div>
<el-button type="primary">保存</el-button> <el-button type="primary" @click="save()">保存</el-button>
<el-button type="primary" @click="save()">提交</el-button> <el-button type="primary" @click="submit()">提交</el-button>
</div> </div>
<!-- 弹窗--> <!-- 弹窗-->
<el-dialog title="请标注" :visible.sync="ifAlert"> <el-dialog title="请标注" :visible.sync="ifAlert">
...@@ -186,19 +186,36 @@ export default { ...@@ -186,19 +186,36 @@ export default {
}, },
highlight() { highlight() {
this.ifAlert = true; this.ifAlert = true;
const search = window.getSelection().toString(); var search;
if (window.getSelection) {
search = window.getSelection().toString();
}else {
search = document.selection.createRange().search;
}
this.msg = this.msg.map(item => { this.msg = this.msg.map(item => {
let replaceReg = new RegExp(search, "g"); // 匹配关键字正则 let replaceReg = new RegExp(search, "g"); // 匹配关键字正则
let replaceString = let replaceString =
'<span class="highlights-text">' + search + '</span>'; // 高亮替换v-html值 '<span class="highlights-text">' + search + '</span>'; // 高亮替换v-html值
return item.replace(replaceReg, replaceString); return item.replace(replaceReg, replaceString);
}); });
if(search){
this.$message({
message: '保存成功!',
type: 'success'
});
}
}, },
save() { save() {
this.$message({ this.$message({
message: '保存成功!', message: '保存成功!',
type: 'success' type: 'success'
}); });
},
submit() {
this.$message({
message: '保存成功!',
type: 'success'
});
this.$router.replace("/completed"); this.$router.replace("/completed");
} }
} }
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
<el-container class="filter-container"> <el-container class="filter-container">
<el-main style="background-color: #FFFFFF"> <el-main style="background-color: #FFFFFF">
<div style="overflow-y:auto;height:100%;"> <div style="overflow-y:auto;height:100%;">
<span id="demo1">实体: 属性:</span>
<span id="demo2">实体:属性:</span>
<div @mouseup="highlight()"> <div @mouseup="highlight()">
<!-- <div @mouseup="highlight()">--> <!-- <div @mouseup="highlight()">-->
<ul class="list"> <ul class="list">
...@@ -13,8 +15,8 @@ ...@@ -13,8 +15,8 @@
</ul> </ul>
</div> </div>
<div> <div>
<el-button type="primary">保存</el-button> <el-button type="primary" @click="save()">保存</el-button>
<el-button type="primary" @click="save()">提交</el-button> <el-button type="primary" @click="submit()">提交</el-button>
</div> </div>
<!-- 弹窗--> <!-- 弹窗-->
<el-dialog title="请标注" :visible.sync="ifAlert"> <el-dialog title="请标注" :visible.sync="ifAlert">
...@@ -198,6 +200,12 @@ export default { ...@@ -198,6 +200,12 @@ export default {
message: '保存成功!', message: '保存成功!',
type: 'success' type: 'success'
}); });
},
submit() {
this.$message({
message: '保存成功!',
type: 'success'
});
this.$router.replace("/completed"); this.$router.replace("/completed");
} }
} }
...@@ -250,4 +258,20 @@ export default { ...@@ -250,4 +258,20 @@ export default {
margin-top: 15px; margin-top: 15px;
margin-bottom: 10px; margin-bottom: 10px;
} }
#demo1 {
width: 140px;
height: 20px;
background-color: rgba(255,255,0,0.47);
position: absolute;
left: 320px;
top: 150px;
}
#demo2 {
width: 140px;
height: 20px;
background-color: rgb(50,205,50);
position: absolute;
left: 175px;
top: 180px;
}
</style> </style>
\ No newline at end of file
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