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

Commit 46bad815 by 张欣玥

layer&image 审核改好了

parent 5d246cd6
...@@ -6699,7 +6699,7 @@ ...@@ -6699,7 +6699,7 @@
}, },
"javascript-natural-sort": { "javascript-natural-sort": {
"version": "0.7.1", "version": "0.7.1",
"resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", "resolved": "https://registry.npm.taobao.org/javascript-natural-sort/download/javascript-natural-sort-0.7.1.tgz",
"integrity": "sha1-+eIwPUUH9tdDVac2ZNFED7Wg71k=" "integrity": "sha1-+eIwPUUH9tdDVac2ZNFED7Wg71k="
}, },
"js-base64": { "js-base64": {
...@@ -11402,7 +11402,7 @@ ...@@ -11402,7 +11402,7 @@
}, },
"seed-random": { "seed-random": {
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/seed-random/-/seed-random-2.2.0.tgz", "resolved": "https://registry.npm.taobao.org/seed-random/download/seed-random-2.2.0.tgz",
"integrity": "sha1-KpsZ4lCoFwmSMaW5mk2vgLf77VQ=" "integrity": "sha1-KpsZ4lCoFwmSMaW5mk2vgLf77VQ="
}, },
"select-hose": { "select-hose": {
......
...@@ -63,24 +63,37 @@ ...@@ -63,24 +63,37 @@
<div v-for="(item, index) in data[pictureId].children" <div v-for="(item, index) in data[pictureId].children"
:key="item.id" :key="item.id"
class="listLeft" class="listLeft"
style="text-align: left" style="text-align: left;display: flex;"
@dblclick="labelInfo(index)" @dblclick="labelInfo(index)"
@mouseenter="labelEnter(index)" @mouseenter="labelEnter(index)"
@mouseleave="labelLeave()"> @mouseleave="labelLeave()">
{{index+1}}. &nbsp; {{item.labelName}} {{index+1}}. &nbsp; {{item.labelName}}
<button style="float: right" <span
v-show = "canvasAllCheck[index] == 2" style="margin-left: auto;font-size: 12px"
@click="isRightFn2(index)">取消正确</button> v-show = "canvasAllCheck[index] != 1">
标注正确
<button style="float: right" </span>
v-show = "canvasAllCheck[index] == 0" <el-checkbox
@click="isRightFn(index)">标记正确</button> v-model="value[index]"
style="margin-left: 5px;margin-right: 10px"
v-show = "canvasAllCheck[index] != 1"
@dblclick.stop.native
>
</el-checkbox>
<!-- <button style="margin-left: auto;"-->
<!-- v-show = "canvasAllCheck[index] == 2"-->
<!-- @click="isRightFn2(index)">取消正确</button>-->
<!-- <button style="margin-left: auto;"-->
<!-- v-show = "canvasAllCheck[index] == 0"-->
<!-- @click="isRightFn(index)">标记正确</button>-->
</div> </div>
<div style="position: absolute;bottom: 0;"> <div style="position: absolute;bottom: 5px;right: 5px;font-size: 15px">
<button @click="computeFn()">开始计算</button> <!-- <button @click="computeFn()">开始计算</button>-->
计算得分 = {{this.computeScore}} 计算得分 = <b style="font-size: 20px">{{this.computeScore}}</b>
</div> </div>
</div> </div>
</div> </div>
...@@ -89,34 +102,9 @@ ...@@ -89,34 +102,9 @@
</div> </div>
<!-- <el-aside class="sidebar2" style="position: absolute;width: 3vh;margin-left: 390px;margin-top:10px;margin-right: 0px">-->
<!-- <div class="tool-button-left">-->
<!-- <div>文件</div>-->
<!-- <div class = "tool-button-1"></div>-->
<!-- <div class = "tool-button-1">退</div>-->
<!-- <div class = "tool-button-1"></div>-->
<!-- <div class = "tool-button-1"></div>-->
<!-- <div style = "margin-bottom: 10px"></div>-->
<!-- <div>标注</div>-->
<!-- <div class = "tool-button-1"></div>-->
<!-- <div class = "tool-button-1"></div>-->
<!-- <div class = "tool-button-1"></div>-->
<!-- </div>-->
<!-- </el-aside>-->
<!-- 工作台--> <!-- 工作台-->
<el-main class="workbench" style="padding: 0px"> <el-main class="workbench" style="padding: 0px">
<!-- <img src="../../assets/logo.png">-->
<!-- <div style="margin-top: 50px">-->
<!-- <el-button-group id="buttonBar" style="z-index: 500">-->
<!-- <el-button class="tool-button"type="primary" >移动图层</el-button>-->
<!-- <el-button class="tool-button"type="primary" >放大</el-button>-->
<!-- <el-button class="tool-button"type="primary" >缩小</el-button>-->
<!-- <el-button class="tool-button" type="primary" icon="el-icon-arrow-left" >上一张</el-button>-->
<!-- <el-button class="tool-button" type="primary" >下一张<i class="el-icon-arrow-right el-icon&#45;&#45;right"></i></el-button>-->
<!-- </el-button-group>-->
<div id="buttonBar" <div id="buttonBar"
ref="buttonBarref" ref="buttonBarref"
@mousedown="mouseDownHandleelse($event)" @mousedown="mouseDownHandleelse($event)"
...@@ -160,6 +148,8 @@ export default { ...@@ -160,6 +148,8 @@ export default {
name: 'imageCheck', name: 'imageCheck',
data () { data () {
return { return {
addYes: true,
value: [],
computeScore: 0, computeScore: 0,
labelNow: 0, labelNow: 0,
labelName: '111', labelName: '111',
...@@ -295,6 +285,7 @@ export default { ...@@ -295,6 +285,7 @@ export default {
}) })
_this.canvasAll[indexPic].push(num) _this.canvasAll[indexPic].push(num)
_this.canvasAllCheck.push(0) _this.canvasAllCheck.push(0)
_this.value.push(false)
}) })
}) })
// 还原标注 // 还原标注
...@@ -337,6 +328,21 @@ export default { ...@@ -337,6 +328,21 @@ export default {
} }
}, },
watch: { watch: {
value: function fn() {
var tmp = this.canvasAllCheck;
this.value.forEach((e, index) => {
if (tmp[index] == 0) {
if (e == true) {
tmp[index] = 2;
}
} else if (tmp[index] == 2) {
if (e == false) {
tmp[index] = 0;
}
}
})
this.computeFn()
},
radio1: function f () { radio1: function f () {
if (this.radio1 == '矩形标注') { if (this.radio1 == '矩形标注') {
console.log('RR') console.log('RR')
...@@ -570,6 +576,7 @@ export default { ...@@ -570,6 +576,7 @@ export default {
// 从历史记录里删 // 从历史记录里删
this.canvasAll[id].splice(index, 1) this.canvasAll[id].splice(index, 1)
this.canvasAllCheck.splice(index, 1) this.canvasAllCheck.splice(index, 1)
this.value.splice(index, 1)
// 重画标注 // 重画标注
this.restoreCanvas() this.restoreCanvas()
...@@ -833,8 +840,9 @@ export default { ...@@ -833,8 +840,9 @@ export default {
}, },
// 添加标签前弹窗输入标签名字 // 添加标签前弹窗输入标签名字
addLabel () { async addLabel () {
var labelName var labelName
var _this = this
this.$prompt('请输入标注名称', '提示', { this.$prompt('请输入标注名称', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消' cancelButtonText: '取消'
...@@ -842,10 +850,14 @@ export default { ...@@ -842,10 +850,14 @@ export default {
if (value == null) { value = 'iss' } if (value == null) { value = 'iss' }
labelName = value labelName = value
this.makeLabel(labelName) this.makeLabel(labelName)
_this.addYes = true
}).catch(() => { }).catch(() => {
labelName = 'iss' labelName = 'iss'
this.makeLabel(labelName) this.makeLabel(labelName)
_this.addYes = false
}) })
return _this.addYes;
}, },
// 创建储存用的标签数据 // 创建储存用的标签数据
makeLabel (labelName) { makeLabel (labelName) {
...@@ -946,7 +958,7 @@ export default { ...@@ -946,7 +958,7 @@ export default {
_this.canvas.style.cursor = 'auto' _this.canvas.style.cursor = 'auto'
} }
} }
this.canvas.ondblclick = function (e) { this.canvas.ondblclick = async function (e) {
console.log('dblclick') console.log('dblclick')
if (_this.radio1 == '矩形标注') { if (_this.radio1 == '矩形标注') {
_this.canvas.style.cursor = 'crosshair' _this.canvas.style.cursor = 'crosshair'
...@@ -954,18 +966,26 @@ export default { ...@@ -954,18 +966,26 @@ export default {
_this.canvas.style.cursor = 'help' _this.canvas.style.cursor = 'help'
let id = _this.pictureId let id = _this.pictureId
_this.createP(e, 'end', r1, r2) _this.createP(e, 'end', r1, r2)
_this.canvasAll[id].push(_this.createPTmp)
_this.canvasAllCheck.push(1)
_this.addLabel() _this.addLabel()
_this.restoreCanvas()
_this.createPTmp = []
_this.ctx.clearRect(0, 0, _this.canvas.width, _this.canvas.height)
_this.canvasAll[id].push(_this.createPTmp)
_this.canvasAllCheck.push(1)
_this.value.push(false)
_this.restoreCanvas()
_this.createPTmp = []
} else { } else {
_this.canvas.style.cursor = 'auto' _this.canvas.style.cursor = 'auto'
} }
} }
}, },
// 画矩形 // 画矩形
createR (e, status, r1, r2) { async createR (e, status, r1, r2) {
let _this = this let _this = this
let r let r
if (status == 'begin') { if (status == 'begin') {
...@@ -1019,15 +1039,19 @@ export default { ...@@ -1019,15 +1039,19 @@ export default {
let id = _this.pictureId let id = _this.pictureId
// 存到记录里 // 存到记录里
var num = [r1, r2, _this.mathAdd(r1, rx), r2, _this.mathAdd(r1, rx), _this.mathAdd(r2, ry), r1, _this.mathAdd(r2, ry)] var num = [r1, r2, _this.mathAdd(r1, rx), r2, _this.mathAdd(r1, rx), _this.mathAdd(r2, ry), r1, _this.mathAdd(r2, ry)]
console.log('num') // console.log('num')
console.log(num) // console.log(num)
_this.canvasAll[id].push(num) _this.addLabel()
_this.canvasAllCheck.push(1)
_this.addLabel() // alert('???')
// _this.ctx.clearRect(0, 0, _this.canvas.width, _this.canvas.height)
_this.canvasAll[id].push(num)
_this.canvasAllCheck.push(1)
_this.value.push(false)
_this.restoreCanvas()
_this.restoreCanvas()
// console.log('id = ',id) // console.log('id = ',id)
// console.log(_this.canvasAll) // console.log(_this.canvasAll)
...@@ -1096,7 +1120,7 @@ export default { ...@@ -1096,7 +1120,7 @@ export default {
// 2=>标注者标对的,1=>审查者后加的,0=>标错的 // 2=>标注者标对的,1=>审查者后加的,0=>标错的
var yesAll = 0 var yesAll = 0
var yesTmp = 0 var yesTmp = 0
console.log(this.canvasAllCheck) // console.log(this.canvasAllCheck)
this.canvasAllCheck.forEach(e =>{ this.canvasAllCheck.forEach(e =>{
if(e === 2) { if(e === 2) {
yesAll++; yesAll++;
...@@ -1348,4 +1372,13 @@ export default { ...@@ -1348,4 +1372,13 @@ export default {
color: rgba(51, 135, 255, 0.76); color: rgba(51, 135, 255, 0.76);
border: 1px solid #cadcee; border: 1px solid #cadcee;
} }
/deep/ .el-switch {
line-height: 24px;
height: 24px;
}
/deep/ .el-switch {
line-height: 24px;
height: 24px;
}
</style> </style>
...@@ -122,16 +122,41 @@ ...@@ -122,16 +122,41 @@
<el-tabs v-model="activeName" type="card" @tab-click="handleClick"> <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane label="地标列表" name="first"> <el-tab-pane label="地标列表" name="first">
<div class="img-title-list-box"> <div class="img-title-list-box">
<div v-for="(item, index) in landmarkData" :key="item.id" class="listLeft" style="text-align: left" @dblclick="markInfo(index)" @mouseenter="markEnter(index)" @mouseleave="restore()"> <div v-for="(item, index) in landmarkData" :key="item.id" class="listLeft" style="text-align: left;display: flex" @dblclick="markInfo(index)" @mouseenter="markEnter(index)" @mouseleave="restore()">
{{index+1}}. &nbsp; {{item.landmarkName}} {{index+1}}. &nbsp; {{item.landmarkName}}
<span
style="margin-left: auto;font-size: 12px"
v-show = "checkLand[index] != 1">
标注正确
</span>
<el-checkbox
v-model="value[index]"
style="margin-left: 5px;margin-right: 10px"
v-show = "checkLand[index] != 1"
@dblclick.stop.native
>
</el-checkbox>
</div> </div>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="区域标注列表" name="second"> <el-tab-pane label="区域标注列表" name="second">
<div class="img-title-list-box"> <div class="img-title-list-box">
<div v-for="(item, index) in layerData" :key="item.id" class="listLeft" style="text-align: left" @dblclick="areaInfo(index)" @mouseenter="areaEnter(index)" @mouseleave="restore()"> <div v-for="(item, index) in layerData" :key="item.id" class="listLeft" style="text-align: left;display: flex" @dblclick="areaInfo(index)" @mouseenter="areaEnter(index)" @mouseleave="restore()">
{{index+1}}. &nbsp; {{item.labelName}} {{index+1}}. &nbsp; {{item.labelName}}
<span
style="margin-left: auto;font-size: 12px"
v-show = "checkLayer[index] != 1">
标注正确
</span>
<el-checkbox
v-model="value2[index]"
style="margin-left: 5px;margin-right: 10px"
v-show = "checkLayer[index] != 1"
@dblclick.stop.native
>
</el-checkbox>
</div> </div>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -150,6 +175,10 @@ ...@@ -150,6 +175,10 @@
<!-- </div>--> <!-- </div>-->
<!-- </div>--> <!-- </div>-->
</div> </div>
<div style="position: absolute;bottom: 5px;right: 5px;font-size: 15px">
<!-- <button @click="computeFn()">开始计算</button>-->
计算得分 = <b style="font-size: 20px">{{this.computeScore}}</b>
</div>
</div> </div>
<!-- 工作台--> <!-- 工作台-->
<el-main class="workbench" style="width: 60%;padding: 0"> <el-main class="workbench" style="width: 60%;padding: 0">
...@@ -179,6 +208,9 @@ export default { ...@@ -179,6 +208,9 @@ export default {
name: 'layerCheck', name: 'layerCheck',
data () { data () {
return { return {
computeScore: 0,
value: [],
value2: [],
activeName: 'first', activeName: 'first',
isPoint: true, isPoint: true,
centerX: 0, centerX: 0,
...@@ -194,6 +226,8 @@ export default { ...@@ -194,6 +226,8 @@ export default {
radio1: '地标', radio1: '地标',
activeIndex1: 1, activeIndex1: 1,
hasSaved: 1, // 保存标志 hasSaved: 1, // 保存标志
checkLayer: [],
checkLand: [],
layerData: null, // layerdata存放标注数据 layerData: null, // layerdata存放标注数据
landmarkData: null, // 存放地标数据 landmarkData: null, // 存放地标数据
relationId: null, // 当前任务的relationID relationId: null, // 当前任务的relationID
...@@ -222,10 +256,22 @@ export default { ...@@ -222,10 +256,22 @@ export default {
console.log(res) console.log(res)
// 避免第一次标注时数据库中没有内容的情况 // 避免第一次标注时数据库中没有内容的情况
if (res.layerInfo != null) { this.layerData = res.layerInfo.labelList } else { this.layerData = [] } if (res.layerInfo != null) {
this.layerData = res.layerInfo.labelList;
for (let i = 0;i < this.layerData.length;i++) {
this.checkLayer.push(0)
this.value2.push(false)
}
} else { this.layerData = [] }
console.log(this.layerData) console.log(this.layerData)
if (res.landmarkList != null) { this.landmarkData = res.landmarkList.landmarkEntityList } else { this.landmarkData = [] } if (res.landmarkList != null) {
this.landmarkData = res.landmarkList.landmarkEntityList;
for (let i = 0;i < this.landmarkData.length;i++) {
this.checkLand.push(0)
this.value.push(false)
}
} else { this.landmarkData = [] }
console.log(this.landmarkData) console.log(this.landmarkData)
this.get_height() this.get_height()
...@@ -264,6 +310,36 @@ export default { ...@@ -264,6 +310,36 @@ export default {
}, },
watch: { watch: {
value: function fn() {
var tmp = this.checkLand;
this.value.forEach((e, index) => {
if (tmp[index] == 0) {
if (e == true) {
tmp[index] = 2;
}
} else if (tmp[index] == 2) {
if (e == false) {
tmp[index] = 0;
}
}
})
this.computeFn()
},
value2: function fn() {
var tmp = this.checkLayer;
this.value.forEach((e, index) => {
if (tmp[index] == 0) {
if (e == true) {
tmp[index] = 2;
}
} else if (tmp[index] == 2) {
if (e == false) {
tmp[index] = 0;
}
}
})
this.computeFn()
},
radio1: function f () { radio1: function f () {
if (this.radio1 == '地标') { if (this.radio1 == '地标') {
this.mouseTool.close() this.mouseTool.close()
...@@ -349,8 +425,10 @@ export default { ...@@ -349,8 +425,10 @@ export default {
deleteLabelInList () { deleteLabelInList () {
if (this.isMark) { if (this.isMark) {
this.landmarkData.splice(this.labelNow, 1) this.landmarkData.splice(this.labelNow, 1)
this.checkLand.splice(this.labelNow, 1)
} else { } else {
this.layerData.splice(this.labelNow, 1) this.layerData.splice(this.labelNow, 1)
this.checkLayer.splice(this.labelNow, 1)
} }
this.restore() this.restore()
this.isInfo = false this.isInfo = false
...@@ -604,6 +682,8 @@ export default { ...@@ -604,6 +682,8 @@ export default {
landmarkName: landmarkName landmarkName: landmarkName
} }
this.landmarkData.push(newlandmark) this.landmarkData.push(newlandmark)
this.checkLand.push(1)
this.value.push(false)
console.log(this.landmarkData) console.log(this.landmarkData)
// 在图层上显示 // 在图层上显示
...@@ -690,6 +770,8 @@ export default { ...@@ -690,6 +770,8 @@ export default {
pointList: pointList pointList: pointList
} }
this.layerData.push(newLabel) this.layerData.push(newLabel)
this.checkLayer.push(1)
this.value2.push(false)
console.log(this.layerData) console.log(this.layerData)
this.restore() this.restore()
// 保存标志置为0 // 保存标志置为0
...@@ -752,11 +834,73 @@ export default { ...@@ -752,11 +834,73 @@ export default {
pointList: pointList pointList: pointList
} }
this.layerData.push(newLabel) this.layerData.push(newLabel)
this.checkLayer.push(1)
this.value2.push(false)
console.log(this.layerData) console.log(this.layerData)
this.restore() this.restore()
// 保存标志置为0 // 保存标志置为0
this.hasSaved = false this.hasSaved = false
}, },
isRightLand (index) {
var tmp = this.checkLand
// alert(tmp)
tmp[index] = 2
this.$forceUpdate()
},
isRightLand2 (index) {
var tmp = this.checkLand
// alert(tmp[id])
tmp[index] = 0
this.$forceUpdate()
},
isRightLayer (index) {
var tmp = this.checkLayer
// alert(tmp)
tmp[index] = 2
this.$forceUpdate()
},
isRightLayer2 (index) {
var tmp = this.checkLayer
// alert(tmp[id])
tmp[index] = 0
this.$forceUpdate()
},
computeFn () {
// alert("start!")
// 2=>标注者标对的,1=>审查者后加的,0=>标错的
var yesAll = 0
var yesTmp = 0
// console.log(this.canvasAllCheck)
this.checkLayer.forEach(e =>{
if(e === 2) {
yesAll++;
yesTmp++;
}
else if(e === 1) {
yesAll++;
}
})
this.checkLand.forEach(e =>{
if(e === 2) {
yesAll++;
yesTmp++;
}
else if(e === 1) {
yesAll++;
}
})
if (yesAll != 0)
var score = yesTmp / yesAll;
else
var score = 0
var tmpScore = score * 100
this.computeScore = tmpScore.toFixed(2)
},
// 保存数据用的接口 // 保存数据用的接口
save () { save () {
let outputLayerInfo = { let outputLayerInfo = {
...@@ -993,4 +1137,5 @@ export default { ...@@ -993,4 +1137,5 @@ export default {
color: rgba(51, 135, 255, 0.76); color: rgba(51, 135, 255, 0.76);
border: 1px solid #cadcee; border: 1px solid #cadcee;
} }
</style> </style>
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