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

Commit 1cd60047 by 李梓桢

image修改了一些遗留问题

parent 8b012439
...@@ -13,7 +13,7 @@ module.exports = { ...@@ -13,7 +13,7 @@ module.exports = {
proxyTable: {}, proxyTable: {},
// Various Dev Server settings // Various Dev Server settings
host: '47.92.1.107', // can be overwritten by process.env.HOST host: '127.0.0.1', // can be overwritten by process.env.HOST
port: 8000, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined port: 8000, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false, autoOpenBrowser: false,
errorOverlay: true, errorOverlay: true,
......
...@@ -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,7 +187,7 @@ export default { ...@@ -186,7 +187,7 @@ 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) console.log(this.baseURL)
...@@ -200,7 +201,7 @@ export default { ...@@ -200,7 +201,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 = baseURL + '/files/getImage/' + imageName var imgUrl = baseURL + '/files/getImage/' + this.imageName
console.log(imgUrl) 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'
...@@ -735,9 +736,7 @@ export default { ...@@ -735,9 +736,7 @@ export default {
} }
}, },
async getLabelList () { async getLabelList () {
/**
* 这是一个大致的格式转换
// */
try { try {
this.data = [] this.data = []
let params = { let params = {
...@@ -770,13 +769,15 @@ export default { ...@@ -770,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)
...@@ -786,11 +787,13 @@ export default { ...@@ -786,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
} }
...@@ -1038,10 +1041,11 @@ export default { ...@@ -1038,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,
...@@ -213,9 +214,11 @@ export default { ...@@ -213,9 +214,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 +228,7 @@ export default { ...@@ -225,7 +228,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 +802,8 @@ export default { ...@@ -799,8 +802,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 +813,8 @@ export default { ...@@ -810,8 +813,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)
......
...@@ -14,7 +14,7 @@ import 'default-passive-events' ...@@ -14,7 +14,7 @@ import 'default-passive-events'
Vue.prototype.$math = math Vue.prototype.$math = math
axios.defaults.baseURL = 'http://47.92.1.107:9100/api' axios.defaults.baseURL = 'http://127.0.0.1:9100/api'
axios.defaults.timeout = 8000 axios.defaults.timeout = 8000
Vue.prototype.baseURL = axios.defaults.baseURL // 图片标注接口使用 Vue.prototype.baseURL = axios.defaults.baseURL // 图片标注接口使用
......
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