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

Commit 67f1170f by 李景熙

resolve conflict

parents 04f6c6e1 70f2b754
...@@ -154,6 +154,7 @@ export default { ...@@ -154,6 +154,7 @@ export default {
pictureId: 1, pictureId: 1,
relationId: null, relationId: null,
imageUrl: '', imageUrl: '',
imageName: '',
scaleSize: 1, scaleSize: 1,
height_res: 0, height_res: 0,
activeIndex1: 1, activeIndex1: 1,
...@@ -186,10 +187,11 @@ export default { ...@@ -186,10 +187,11 @@ export default {
let routeParams = this.$route.params let routeParams = this.$route.params
console.log("routeParams") console.log("routeParams")
console.log(routeParams) console.log(routeParams)
let imageName = routeParams.file.url this.imageName = routeParams.file.url
this.relationId = routeParams.relationId this.relationId = routeParams.relationId
this.description = routeParams.piece.template this.description = routeParams.piece.template
console.log(this.baseURL)
let baseURL = this.baseURL
// 获取图片列表并转换格式 // 获取图片列表并转换格式
let imageList = await this.getLabelList() let imageList = await this.getLabelList()
console.log(imageList) console.log(imageList)
...@@ -199,7 +201,8 @@ export default { ...@@ -199,7 +201,8 @@ export default {
// 这个是原来的代码 // 这个是原来的代码
// var imgUrl = this.data.length ? this.data[0].imageUrl : 'https://juanmdbucket.oss-cn-beijing.aliyuncs.com/20200627155321.png' // var imgUrl = this.data.length ? this.data[0].imageUrl : 'https://juanmdbucket.oss-cn-beijing.aliyuncs.com/20200627155321.png'
// 这个是现在使用的代码 // 这个是现在使用的代码
var imgUrl = 'http://127.0.0.1:9100/api/files/getImage/' + imageName var imgUrl = baseURL + '/files/getImage/' + this.imageName
console.log(imgUrl)
// 如果不使用后端可以用这个模拟 // 如果不使用后端可以用这个模拟
// var imgUrl = 'https://juanmdbucket.oss-cn-beijing.aliyuncs.com/20200301231737.png' // var imgUrl = 'https://juanmdbucket.oss-cn-beijing.aliyuncs.com/20200301231737.png'
this.imageUrl = imgUrl this.imageUrl = imgUrl
...@@ -733,9 +736,7 @@ export default { ...@@ -733,9 +736,7 @@ export default {
} }
}, },
async getLabelList () { async getLabelList () {
/**
* 这是一个大致的格式转换
// */
try { try {
this.data = [] this.data = []
let params = { let params = {
...@@ -768,13 +769,15 @@ export default { ...@@ -768,13 +769,15 @@ export default {
}, },
// 将数据库保存的数据格式转换为前端可以直接使用的格式,同时如果第一次标注该图片,会生成新数据 // 将数据库保存的数据格式转换为前端可以直接使用的格式,同时如果第一次标注该图片,会生成新数据
formExchange (inputData) { formExchange (inputData) {
console.log('formexchange')
console.log(inputData)
if (inputData.length > 0) { if (inputData.length > 0) {
var index = 0 var index = 0
inputData.forEach(element => { inputData.forEach(element => {
let newData = { let newData = {
relationId: element.relationId, relationId: element.relationId,
imageUrl: element.imageUrl, imageName: element.imageName,
label: this.getImageName(element.imageUrl), label: element.imageName,
children: element.labelList children: element.labelList
} }
this.data.push(newData) this.data.push(newData)
...@@ -784,11 +787,13 @@ export default { ...@@ -784,11 +787,13 @@ export default {
} else { } else {
let newData = { let newData = {
relationId: this.relationId, relationId: this.relationId,
imageUrl: this.imageUrl, imageName: this.imageName,
label: this.getImageName(this.imageUrl), label: this.imageName,
children: [] children: []
} }
this.data.push(newData) this.data.push(newData)
console.log('formexchange')
console.log(this.data)
//imageNum这个虽然没啥用,但是先放着吧 //imageNum这个虽然没啥用,但是先放着吧
this.imageNum = 1 this.imageNum = 1
} }
...@@ -1036,10 +1041,11 @@ export default { ...@@ -1036,10 +1041,11 @@ export default {
save () { save () {
// 先把格式转换回去 // 先把格式转换回去
var outputData = [] var outputData = []
console.log(this.data)
this.data.forEach(element => { this.data.forEach(element => {
let newData = { let newData = {
relationId: element.relationId, relationId: element.relationId,
imageUrl: element.imageUrl, imageName: element.imageName,
labelList: element.children labelList: element.children
} }
outputData.push(newData) outputData.push(newData)
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<!-- </el-radio-group>--> <!-- </el-radio-group>-->
<el-row :gutter="20"> <el-row :gutter="20">
<el-col span="6"> <el-col span="6">
<el-button @click="save()">保存</el-button> <!-- <el-button @click="save()">保存</el-button> -->
</el-col> </el-col>
<el-col span="14" v-if="this.$route.params.operationSign == 1"> <el-col span="14" v-if="this.$route.params.operationSign == 1">
<!-- 看注释,打分按钮和提交按钮是对审核结果提交--> <!-- 看注释,打分按钮和提交按钮是对审核结果提交-->
...@@ -178,6 +178,7 @@ export default { ...@@ -178,6 +178,7 @@ export default {
pictureId: 1, pictureId: 1,
relationId: null, relationId: null,
imageUrl: '', imageUrl: '',
imageName: '',
scaleSize: 1, scaleSize: 1,
height_res: 0, height_res: 0,
activeIndex1: 1, activeIndex1: 1,
...@@ -198,6 +199,8 @@ export default { ...@@ -198,6 +199,8 @@ export default {
imageNum: -1, imageNum: -1,
data: [], data: [],
imageList: [], imageList: [],
// 分片描述
description: null,
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
...@@ -213,9 +216,11 @@ export default { ...@@ -213,9 +216,11 @@ export default {
let routeParams = this.$route.params let routeParams = this.$route.params
console.log("routeParams") console.log("routeParams")
console.log(routeParams) console.log(routeParams)
let imageName = routeParams.file.url this.imageName = routeParams.file.url
this.relationId = routeParams.relationId this.relationId = routeParams.relationId
// let src = this.getimageUrl(imageName) this.description = routeParams.piece.template
console.log(this.baseURL)
let baseURL = this.baseURL
// 获取图片列表并转换格式 // 获取图片列表并转换格式
let imageList = await this.getLabelList() let imageList = await this.getLabelList()
console.log(imageList) console.log(imageList)
...@@ -225,7 +230,7 @@ export default { ...@@ -225,7 +230,7 @@ export default {
// 这个是原来的代码 // 这个是原来的代码
// var imgUrl = this.data.length ? this.data[0].imageUrl : 'https://juanmdbucket.oss-cn-beijing.aliyuncs.com/20200627155321.png' // var imgUrl = this.data.length ? this.data[0].imageUrl : 'https://juanmdbucket.oss-cn-beijing.aliyuncs.com/20200627155321.png'
// 这个是现在使用的代码 // 这个是现在使用的代码
var imgUrl = 'http://127.0.0.1:9100/api/files/getImage/' + imageName var imgUrl = baseURL + '/files/getImage/' + this.imageName
// 如果不使用后端可以用这个模拟 // 如果不使用后端可以用这个模拟
// var imgUrl = 'https://juanmdbucket.oss-cn-beijing.aliyuncs.com/20200301231737.png' // var imgUrl = 'https://juanmdbucket.oss-cn-beijing.aliyuncs.com/20200301231737.png'
this.imageUrl = imgUrl this.imageUrl = imgUrl
...@@ -799,8 +804,8 @@ export default { ...@@ -799,8 +804,8 @@ export default {
inputData.forEach(element => { inputData.forEach(element => {
let newData = { let newData = {
relationId: element.relationId, relationId: element.relationId,
imageUrl: element.imageUrl, imageName: element.imageName,
label: this.getImageName(element.imageUrl), label: element.imageName,
children: element.labelList children: element.labelList
} }
this.data.push(newData) this.data.push(newData)
...@@ -810,8 +815,8 @@ export default { ...@@ -810,8 +815,8 @@ export default {
} else { } else {
let newData = { let newData = {
relationId: this.relationId, relationId: this.relationId,
imageUrl: this.imageUrl, imageName: this.imageName,
label: this.getImageName(this.imageUrl), label: this.imageName,
children: [] children: []
} }
this.data.push(newData) this.data.push(newData)
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<el-aside class="sidebar" style="position: absolute;margin-top: 350px;height: calc(100vh - 71px - 400px);"> <el-aside class="sidebar" style="position: absolute;margin-top: 350px;height: calc(100vh - 71px - 400px);">
<div class="sidebar-box"> <div class="sidebar-box">
<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" style="height: 205px"> <div class="img-title-list-box" style="height: 205px">
<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" @dblclick="markInfo(index)" @mouseenter="markEnter(index)" @mouseleave="restore()">
{{index+1}}. &nbsp; {{item.landmarkName}} {{index+1}}. &nbsp; {{item.landmarkName}}
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<!-- 工具栏--> <!-- 工具栏-->
<div class="toolBar"> <div class="toolBar">
<el-button-group id="start"> <el-button-group id="start">
<el-button class="tool-button" type="primary" @click="save()" >保存</el-button> <!-- <el-button class="tool-button" type="primary" @click="save()" >保存</el-button> -->
<el-button class="tool-button" type="primary" >退出</el-button> <el-button class="tool-button" type="primary" >退出</el-button>
<el-button v-if="this.$route.params.operationSign == 1" type="primary" @click="commentScore = true">打分</el-button> <el-button v-if="this.$route.params.operationSign == 1" type="primary" @click="commentScore = true">打分</el-button>
<el-button v-if="this.$route.params.operationSign == 1" type="primary" @click="submit()">提交</el-button> <el-button v-if="this.$route.params.operationSign == 1" type="primary" @click="submit()">提交</el-button>
...@@ -136,6 +136,7 @@ ...@@ -136,6 +136,7 @@
clickedPosition: null,//保存最新一次点击的结果,没有使用 clickedPosition: null,//保存最新一次点击的结果,没有使用
map: null, map: null,
mouseTool: null, mouseTool: null,
description: null,// 分片描述
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
...@@ -156,6 +157,7 @@ ...@@ -156,6 +157,7 @@
console.log("routeParams") console.log("routeParams")
console.log(routeParams) console.log(routeParams)
this.relationId = routeParams.relationId this.relationId = routeParams.relationId
this.description = routeParams.piece.template
let res = await this.getLayerList() let res = await this.getLayerList()
console.log(res) console.log(res)
......
...@@ -17,6 +17,8 @@ Vue.prototype.$math = math ...@@ -17,6 +17,8 @@ Vue.prototype.$math = math
axios.defaults.baseURL = 'http://localhost:9100/api' axios.defaults.baseURL = 'http://localhost:9100/api'
axios.defaults.timeout = 8000 axios.defaults.timeout = 8000
Vue.prototype.baseURL = axios.defaults.baseURL // 图片标注接口使用
Vue.use(VueAxios, axios) Vue.use(VueAxios, axios)
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.config.productionTip = false Vue.config.productionTip = false
......
...@@ -27,7 +27,7 @@ app.register_blueprint(data) ...@@ -27,7 +27,7 @@ app.register_blueprint(data)
app.register_blueprint(image) app.register_blueprint(image)
if __name__ == '__main__': if __name__ == '__main__':
app.run(debug=True, host='47.92.1.107', port=9100) app.run(debug=True, host='127.0.0.1', port=9100)
@app.route('/') @app.route('/')
......
...@@ -52,12 +52,12 @@ class Label(db.EmbeddedDocument): ...@@ -52,12 +52,12 @@ class Label(db.EmbeddedDocument):
class Image(db.Document): class Image(db.Document):
relationId = db.IntField(required=True, unique=True) relationId = db.IntField(required=True, unique=True)
# photo = db.FileField() # photo = db.FileField()
imageUrl = db.StringField(required=True) imageName = db.StringField(required=True)
labelList = db.ListField(db.EmbeddedDocumentField(Label)) labelList = db.ListField(db.EmbeddedDocumentField(Label))
def to_json(self): def to_json(self):
return {'relationId': self.relationId, return {'relationId': self.relationId,
'imageUrl': self.imageUrl, 'imageName': self.imageName,
'labelList': [i.to_json() for i in self.labelList] 'labelList': [i.to_json() for i in self.labelList]
} }
...@@ -99,7 +99,7 @@ def create_images(image_list): ...@@ -99,7 +99,7 @@ def create_images(image_list):
delete_image(rid) delete_image(rid)
image = Image( image = Image(
relationId=i['relationId'], relationId=i['relationId'],
imageUrl=i['imageUrl'], imageName=i['imageName'],
labelList=create_labels(i['labelList']) labelList=create_labels(i['labelList'])
) )
image.save() image.save()
...@@ -112,7 +112,7 @@ def get_img_name(relation_id): ...@@ -112,7 +112,7 @@ def get_img_name(relation_id):
img = Image.objects(relationId=relation_id).first() img = Image.objects(relationId=relation_id).first()
if img is None: if img is None:
raise Exception("relation id = {} 的图片不存在".format(relation_id)) raise Exception("relation id = {} 的图片不存在".format(relation_id))
return img['imageUrl'].split('/')[-1] return img['imageName'].split('/')[-1]
# 根据 relationId 删除图片 # 根据 relationId 删除图片
......
...@@ -202,7 +202,7 @@ def export_kml(relationId): ...@@ -202,7 +202,7 @@ def export_kml(relationId):
# "imageList": [ # "imageList": [
# { # {
# "relationId": 123, # "relationId": 123,
# "imageUrl": "tom@qq.com", # "imageName": "tom@qq.com",
# "labelList": [ # "labelList": [
# { # {
# "labelId": 123, # "labelId": 123,
...@@ -219,7 +219,7 @@ def export_kml(relationId): ...@@ -219,7 +219,7 @@ def export_kml(relationId):
# }, # },
# { # {
# "relationId": 156, # "relationId": 156,
# "imageUrl": "jerry@qq.com", # "imageName": "jerry@qq.com",
# "labelList": [ # "labelList": [
# { # {
# "labelId": 13, # "labelId": 13,
......
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