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

Commit f7436f9c by 李梓桢

image

parent ac8676d1
...@@ -110,6 +110,7 @@ export default { ...@@ -110,6 +110,7 @@ export default {
name: 'imageAnnotation', name: 'imageAnnotation',
data () { data () {
return { return {
pictureId: 1,
scaleSize: 1, scaleSize: 1,
height_res: 0, height_res: 0,
activeIndex1: 1, activeIndex1: 1,
...@@ -118,7 +119,7 @@ export default { ...@@ -118,7 +119,7 @@ export default {
"relationId": 123, "relationId": 123,
"imageUrl": "...", "imageUrl": "...",
"labelList": [{ "labelList": [{
"labelId": "1", "labelId": 0,
"labelName": "label1", "labelName": "label1",
"pointList": [{ "pointList": [{
"pointId": "1-1", "pointId": "1-1",
...@@ -130,7 +131,7 @@ export default { ...@@ -130,7 +131,7 @@ export default {
"Y": 2.3 "Y": 2.3
}] }]
},{ },{
"labelId": "2", "labelId": 1,
"labelName": "label2", "labelName": "label2",
"pointList": [{ "pointList": [{
"pointId": "2-1", "pointId": "2-1",
...@@ -211,10 +212,11 @@ export default { ...@@ -211,10 +212,11 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.deleteLabel();
this.$message({ this.$message({
type: 'success', type: 'success',
message: '删除成功!' message: '删除成功!'
}) });
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
...@@ -265,6 +267,7 @@ export default { ...@@ -265,6 +267,7 @@ export default {
label: '图片1', label: '图片1',
url: 'https://juanmdbucket.oss-cn-beijing.aliyuncs.com/20200301231737.png', url: 'https://juanmdbucket.oss-cn-beijing.aliyuncs.com/20200301231737.png',
children: [{ children: [{
id: 0,
label: '二级 1-1' label: '二级 1-1'
}] }]
}, { }, {
...@@ -289,14 +292,20 @@ export default { ...@@ -289,14 +292,20 @@ export default {
this.imageNum = 3; this.imageNum = 3;
}, },
addLabel() { addLabel() {
let currentImageId = 1; let currentImageId = this.pictureId;
const newLabel = {label: 'new label'}; const newLabel = {label: 'new label'};
for (let index = 0; index < this.imageNum; index++) { this.data[currentImageId].children.push(newLabel);
if (this.data[index].id == currentImageId) { // for (let index = 0; index < this.imageNum; index++) {
this.data[index].children.push(newLabel); // if (this.data[index].id == currentImageId) {
} // this.data[index].children.push(newLabel);
} // }
// }
}, },
deleteLabel() {
let currentLabelId = 0;
let currentImageId = this.pictureId;
this.data[currentImageId].children.splice(currentLabelId, 1);
}
} }
} }
</script> </script>
......
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