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

Commit 536b6333 by 李梓桢

image前后端接口完成

parent 3f0c3456
...@@ -621,24 +621,24 @@ export default { ...@@ -621,24 +621,24 @@ export default {
changeToolBar (val) { changeToolBar (val) {
this.activeIndex1 = val this.activeIndex1 = val
}, },
deleteAnnotation: function () { // deleteAnnotation: function () {
this.$confirm('确定删除此标注', '提示', { // this.$confirm('确定删除此标注', '提示', {
confirmButtonText: '确定', // confirmButtonText: '确定',
cancelButtonText: '取消', // cancelButtonText: '取消',
type: 'warning' // type: 'warning'
}).then(() => { // }).then(() => {
this.deleteLabel() // this.deleteLabel()
this.$message({ // this.$message({
type: 'success', // type: 'success',
message: '删除成功!' // message: '删除成功!'
}) // })
}).catch(() => { // }).catch(() => {
this.$message({ // this.$message({
type: 'info', // type: 'info',
message: '已取消删除' // message: '已取消删除'
}) // })
}) // })
}, // },
loadPicture () { loadPicture () {
var len = this.data.length var len = this.data.length
var count = this.pictureId var count = this.pictureId
...@@ -858,9 +858,7 @@ export default { ...@@ -858,9 +858,7 @@ export default {
if (value == null) if (value == null)
value = 'iss' value = 'iss'
labelName = value labelName = value
let currentImageId = this.pictureId this.makeLabel(labelName)
const newLabel = {labelName: labelName}
this.data[currentImageId].children.push(newLabel)
}).catch(() => { }).catch(() => {
labelName = 'iss' labelName = 'iss'
let currentImageId = this.pictureId let currentImageId = this.pictureId
...@@ -868,11 +866,36 @@ export default { ...@@ -868,11 +866,36 @@ export default {
this.data[currentImageId].children.push(newLabel) this.data[currentImageId].children.push(newLabel)
}) })
}, },
deleteLabel () { //创建储存用的标签数据
let currentLabelId = 0 makeLabel(labelName) {
let currentImageId = this.pictureId let currentImageId = this.pictureId
this.data[currentImageId].children.splice(currentLabelId, 1) let currentLabelId = this.data[currentImageId].children.length
//以下部分创建PointList
var tmpPointList = this.canvasAll[currentImageId]
var lenTmp = tmpPointList[currentLabelId].length / 2
let pointList = []
for (var i = 0; i < lenTmp; i ++) {
let tmp = {
pointId : i,
X : tmpPointList[currentLabelId][2*i],
Y : tmpPointList[currentLabelId][2*i + 1]
}
pointList.push(tmp)
}
//pointList完成
const newLabel = {
labelId: currentLabelId,
labelName: labelName,
pointList: pointList
}
this.data[currentImageId].children.push(newLabel)
console.log(this.data[currentImageId])
}, },
// deleteLabel () {
// let currentLabelId = 0
// let currentImageId = this.pictureId
// this.data[currentImageId].children.splice(currentLabelId, 1)
// },
/** /**
* 从图片url中拿到图片名 * 从图片url中拿到图片名
*/ */
...@@ -1008,9 +1031,7 @@ export default { ...@@ -1008,9 +1031,7 @@ export default {
} }
outputData.push(newData) outputData.push(newData)
}) })
/**
* 这里还有问题,再添加标签时只有标签名
*/
console.log("outputdata") console.log("outputdata")
console.log(outputData) console.log(outputData)
this.imageNum = this.data.len this.imageNum = this.data.len
......
...@@ -9,81 +9,67 @@ import Mock from 'mockjs' ...@@ -9,81 +9,67 @@ import Mock from 'mockjs'
// }] // }]
// }) // })
// Mock.mock('http://localhost:9100/api/image', { // Mock.mock('http://localhost:9100/api/image/getImage', {
// code: 1, // code: 1,
// data: [{ // data: {
// relationId: 123, // "imageList": [{
// imageUrl: 'https://juanmdbucket.oss-cn-beijing.aliyuncs.com/20200301231737.png', // "relationId": 123,
// labelList: [{ // "imageUrl": "https://juanmdbucket.oss-cn-beijing.aliyuncs.com/20200301231737.png",
// labelId: 0, // "labelList": [{
// labelName: 'label24', // "labelId": 0,
// pointList: [{ // "labelName": "label1",
// pointId: '1-1', // "pointList": [{
// X: 500, // "pointId": 0,
// Y: 300 // "X": 500,
// }, { // "Y": 300
// pointId: '1-2', // }, {
// X: 600, // "pointId": 1,
// Y: 300 // "X": 600,
// }, { // "Y": 300
// pointId: '1-3', // }, {
// X: 700, // "pointId": 2,
// Y: 350 // "X": 700,
// }, { // "Y": 350
// pointId: '1-4', // }, {
// X: 600, // "pointId": 3,
// Y: 400 // "X": 600,
// }, { // "Y": 400
// pointId: '1-5', // }, {
// X: 450, // "pointId": 4,
// Y: 350 // "X": 450,
// "Y": 350
// }]
// }]
// },{
// "relationId": 11,
// "imageUrl": "https://juanmdbucket.oss-cn-beijing.aliyuncs.com/20200526170357.jpg",
// "labelList": [{
// "labelId": 0,
// "labelName": "label1",
// "pointList": [{
// "pointId": 0,
// "X": 500,
// "Y": 300
// }, {
// "pointId": 1,
// "X": 600,
// "Y": 300
// }, {
// "pointId": 2,
// "X": 700,
// "Y": 350
// }, {
// "pointId": 3,
// "X": 600,
// "Y": 400
// }, {
// "pointId": 4,
// "X": 450,
// "Y": 350
// }]
// }] // }]
// }, {
// labelId: 1,
// labelName: 'label2',
// pointList: [{
// pointId: '2-1',
// X: 100,
// Y: 100
// }, {
// pointId: '2-2',
// X: 200,
// Y: 100
// }, {
// pointId: '2-2',
// X: 200,
// Y: 200
// }, {
// pointId: '2-2',
// X: 100,
// Y: 200
// }]
// }]
// }, {
// relationId: 233,
// imageUrl: 'https://juanmdbucket.oss-cn-beijing.aliyuncs.com/20200526170357.jpg',
// labelList: [{
// labelId: 0,
// labelName: 'label1',
// pointList: [{
// pointId: '1-1',
// X: 100,
// Y: 100
// }, {
// pointId: '1-2',
// X: 300,
// Y: 100
// }, {
// pointId: '1-2',
// X: 300,
// Y: 300
// }, {
// pointId: '1-2',
// X: 100,
// Y: 300
// }]
// }]
// }] // }]
// }
// }) // })
// Mock.mock(/http:\/\/localhost:9100\/api\/getPieces\?id=[0-9]+/, { // Mock.mock(/http:\/\/localhost:9100\/api\/getPieces\?id=[0-9]+/, {
......
{
"lockfileVersion": 1
}
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