|
@@ -149,6 +149,7 @@ import { GraphView } from '@/lib/GraphView'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ maxlength: 20,
|
|
|
options: [
|
|
|
{
|
|
|
id: 'None',
|
|
@@ -277,7 +278,6 @@ export default {
|
|
|
let postParams = {
|
|
|
Content: [this.ruleForm]
|
|
|
}
|
|
|
-
|
|
|
updateLegend({ postParams }).then(res => {
|
|
|
if (res.Result == 'success') {
|
|
|
this.$message.success('图例修改成功!')
|
|
@@ -392,30 +392,43 @@ export default {
|
|
|
// 把canvas图保存到图片服务器
|
|
|
saveImg() {
|
|
|
let vm = this
|
|
|
- if (this.view) {
|
|
|
- let data = this.view.canvasView.toDataURL('image/png')
|
|
|
- var formData = new FormData()
|
|
|
- if (this.ruleForm.Type == 'Zone' || this.ruleForm.Type == 'Line') {
|
|
|
- formData.append('file', this.base64ToFile(data))
|
|
|
- } else {
|
|
|
- formData.append('file', this.file)
|
|
|
+ if (!this.file) {
|
|
|
+ //修改图片的时候没有重新上传图片
|
|
|
+ if (this.title == '添加图例库') {
|
|
|
+ this.create()
|
|
|
+ this.$emit('addSuccess')
|
|
|
+ this.view.canvas.clearRect(0, 0, this.width, this.height)
|
|
|
+ } else if (this.title == '修改图例库') {
|
|
|
+ this.update()
|
|
|
+ this.$emit('updateSuccess')
|
|
|
+ this.view.canvas.clearRect(0, 0, this.width, this.height)
|
|
|
}
|
|
|
- let postParams = formData
|
|
|
- uploadImg({ postParams }).then(res => {
|
|
|
- if (res.Result == 'success') {
|
|
|
- this.$set(vm.ruleForm, 'Url', res.EntityList[0])
|
|
|
- this.$message.success('图标上传成功!')
|
|
|
- if (this.title == '添加图例库') {
|
|
|
- this.create()
|
|
|
- this.$emit('addSuccess')
|
|
|
- this.view.canvas.clearRect(0, 0, this.width, this.height)
|
|
|
- } else if (this.title == '修改图例库') {
|
|
|
- this.update()
|
|
|
- this.$emit('updateSuccess')
|
|
|
- this.view.canvas.clearRect(0, 0, this.width, this.height)
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ if (this.view) {
|
|
|
+ let data = this.view.canvasView.toDataURL('image/png')
|
|
|
+ var formData = new FormData()
|
|
|
+ if (this.ruleForm.Type == 'Zone' || this.ruleForm.Type == 'Line') {
|
|
|
+ formData.append('file', this.base64ToFile(data))
|
|
|
+ } else {
|
|
|
+ formData.append('file', this.file)
|
|
|
}
|
|
|
- })
|
|
|
+ let postParams = formData
|
|
|
+ uploadImg({ postParams }).then(res => {
|
|
|
+ if (res.Result == 'success') {
|
|
|
+ this.$set(vm.ruleForm, 'Url', res.EntityList[0])
|
|
|
+ this.$message.success('图标上传成功!')
|
|
|
+ if (this.title == '添加图例库') {
|
|
|
+ this.create()
|
|
|
+ this.$emit('addSuccess')
|
|
|
+ this.view.canvas.clearRect(0, 0, this.width, this.height)
|
|
|
+ } else if (this.title == '修改图例库') {
|
|
|
+ this.update()
|
|
|
+ this.$emit('updateSuccess')
|
|
|
+ this.view.canvas.clearRect(0, 0, this.width, this.height)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
// 铺位可视化
|