文档服务地址: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 {
changeToolBar (val) {
this.activeIndex1 = val
},
deleteAnnotation: function () {
this.$confirm('确定删除此标注', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.deleteLabel()
this.$message({
type: 'success',
message: '删除成功!'
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// deleteAnnotation: function () {
// this.$confirm('确定删除此标注', '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
// this.deleteLabel()
// this.$message({
// type: 'success',
// message: '删除成功!'
// })
// }).catch(() => {
// this.$message({
// type: 'info',
// message: '已取消删除'
// })
// })
// },
loadPicture () {
var len = this.data.length
var count = this.pictureId
......@@ -858,9 +858,7 @@ export default {
if (value == null)
value = 'iss'
labelName = value
let currentImageId = this.pictureId
const newLabel = {labelName: labelName}
this.data[currentImageId].children.push(newLabel)
this.makeLabel(labelName)
}).catch(() => {
labelName = 'iss'
let currentImageId = this.pictureId
......@@ -868,11 +866,36 @@ export default {
this.data[currentImageId].children.push(newLabel)
})
},
deleteLabel () {
let currentLabelId = 0
//创建储存用的标签数据
makeLabel(labelName) {
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中拿到图片名
*/
......@@ -1008,9 +1031,7 @@ export default {
}
outputData.push(newData)
})
/**
* 这里还有问题,再添加标签时只有标签名
*/
console.log("outputdata")
console.log(outputData)
this.imageNum = this.data.len
......
......@@ -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,
// data: [{
// relationId: 123,
// imageUrl: 'https://juanmdbucket.oss-cn-beijing.aliyuncs.com/20200301231737.png',
// labelList: [{
// labelId: 0,
// labelName: 'label24',
// pointList: [{
// pointId: '1-1',
// X: 500,
// Y: 300
// data: {
// "imageList": [{
// "relationId": 123,
// "imageUrl": "https://juanmdbucket.oss-cn-beijing.aliyuncs.com/20200301231737.png",
// "labelList": [{
// "labelId": 0,
// "labelName": "label1",
// "pointList": [{
// "pointId": 0,
// "X": 500,
// "Y": 300
// }, {
// pointId: '1-2',
// X: 600,
// Y: 300
// "pointId": 1,
// "X": 600,
// "Y": 300
// }, {
// pointId: '1-3',
// X: 700,
// Y: 350
// "pointId": 2,
// "X": 700,
// "Y": 350
// }, {
// pointId: '1-4',
// X: 600,
// Y: 400
// "pointId": 3,
// "X": 600,
// "Y": 400
// }, {
// pointId: '1-5',
// 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
// "pointId": 4,
// "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
// }, {
// 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,
// "X": 600,
// "Y": 300
// }, {
// pointId: '1-2',
// X: 300,
// Y: 100
// "pointId": 2,
// "X": 700,
// "Y": 350
// }, {
// pointId: '1-2',
// X: 300,
// Y: 300
// "pointId": 3,
// "X": 600,
// "Y": 400
// }, {
// pointId: '1-2',
// X: 100,
// Y: 300
// "pointId": 4,
// "X": 450,
// "Y": 350
// }]
// }]
// }]
// }
// })
// 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