|
@@ -163,6 +163,7 @@ export default {
|
|
|
}
|
|
|
],
|
|
|
fileList: [],
|
|
|
+ file: '',
|
|
|
// this.ruleForm.Url 图标的key,/serve/topology-wanda/Picture/query/${this.ruleForm.Url}
|
|
|
value: '',
|
|
|
linepxObject: {
|
|
@@ -182,11 +183,16 @@ export default {
|
|
|
props: ['ruleForm', 'title'],
|
|
|
methods: {
|
|
|
getFile(file) {
|
|
|
+ this.file = file.file
|
|
|
+ console.log(file)
|
|
|
var formData = new FormData()
|
|
|
formData.append('file', file.file)
|
|
|
- formData.append('uid', this.ruleForm.Url)
|
|
|
+ if (this.ruleForm.Url) {
|
|
|
+ formData.append('uid', this.ruleForm.Url)
|
|
|
+ }
|
|
|
let postParams = formData
|
|
|
uploadImg({ postParams }).then(res => {
|
|
|
+ console.log(res)
|
|
|
if (res.Result == 'success') {
|
|
|
this.$set(this.ruleForm, 'Url', res.EntityList[0])
|
|
|
this.$message.success('图标上传成功!')
|
|
@@ -199,6 +205,7 @@ export default {
|
|
|
Content: [this.ruleForm]
|
|
|
}
|
|
|
createLegend({ postParams }).then(res => {
|
|
|
+ console.log(res)
|
|
|
if (res.Result == 'success') {
|
|
|
this.$message.success('添加图例成功!')
|
|
|
this.$emit('addSuccess')
|
|
@@ -316,6 +323,7 @@ export default {
|
|
|
return new File([u8arr], filename, { type: mime })
|
|
|
},
|
|
|
saveImg() {
|
|
|
+ let vm = this
|
|
|
if (this.view) {
|
|
|
let data = this.view.canvasView.toDataURL('image/png')
|
|
|
var formData = new FormData()
|
|
@@ -323,7 +331,7 @@ export default {
|
|
|
let postParams = formData
|
|
|
uploadImg({ postParams }).then(res => {
|
|
|
if (res.Result == 'success') {
|
|
|
- this.$set(this.ruleForm, 'Url', res.EntityList[0])
|
|
|
+ this.$set(vm.ruleForm, 'Url', res.EntityList[0])
|
|
|
this.$message.success('图标上传成功!')
|
|
|
if (this.title == '添加图例库') {
|
|
|
this.create()
|