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

Commit 3821a229 by 张欣玥

引入math.js改

parent 00ae4d4c
...@@ -232,7 +232,7 @@ export default { ...@@ -232,7 +232,7 @@ export default {
// console.log(this.$store.state.imageData) // console.log(this.$store.state.imageData)
this.getLabelList() this.getLabelList()
console.log('input') console.log('input')
console.log(this.$store.state.imageData) console.log(this.$store.state.imageData)
this.formExchange(this.$store.state.imageData) this.formExchange(this.$store.state.imageData)
...@@ -404,7 +404,8 @@ export default { ...@@ -404,7 +404,8 @@ export default {
goBigger () { goBigger () {
var scale = this.scaleSize var scale = this.scaleSize
if (scale < 2) { if (scale < 2) {
this.scaleSize = scale + 0.1 // this.scaleSize = scale + 0.1
this.scaleSize = this.$math.add(this.$math.bignumber(scale), this.$math.bignumber(0.1))
} else { } else {
this.scaleSize = 2 this.scaleSize = 2
} }
...@@ -418,7 +419,7 @@ export default { ...@@ -418,7 +419,7 @@ export default {
goSmaller () { goSmaller () {
var scale = this.scaleSize var scale = this.scaleSize
if (scale > 0.5) { if (scale > 0.5) {
this.scaleSize = scale - 0.1 this.scaleSize = this.$math.subtract(this.$math.bignumber(scale), this.$math.bignumber(0.1))
} else { } else {
this.scaleSize = 0.5 this.scaleSize = 0.5
} }
...@@ -799,18 +800,18 @@ export default { ...@@ -799,18 +800,18 @@ export default {
} }
}, },
async getLabelList () { async getLabelList () {
/** /**
* 这是一个大致的格式转换 * 这是一个大致的格式转换
*/ */
try { try {
this.data = [] this.data = []
let params = { let params = {
"relationList" : [ "relationList" : [
123, 123,
11 11
] ]
} }
var self = this var self = this
let res = await this.axios({ let res = await this.axios({
...@@ -825,7 +826,7 @@ export default { ...@@ -825,7 +826,7 @@ export default {
self.$store.commit('setImageData', imageList.imageList) self.$store.commit('setImageData', imageList.imageList)
console.log("!!!!!!!!!!!!!!!!") console.log("!!!!!!!!!!!!!!!!")
console.log(this.$store.state.imageData) console.log(this.$store.state.imageData)
} }
} catch (err) { } catch (err) {
self.$store.commit('clearImageData') self.$store.commit('clearImageData')
console.log(err) console.log(err)
...@@ -1031,7 +1032,7 @@ export default { ...@@ -1031,7 +1032,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
......
...@@ -8,6 +8,9 @@ import ElementUI from 'element-ui' ...@@ -8,6 +8,9 @@ import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css' import 'element-ui/lib/theme-chalk/index.css'
import axios from 'axios' import axios from 'axios'
import VueAxios from 'vue-axios' import VueAxios from 'vue-axios'
import * as math from 'mathjs';
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
......
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