feat:优化点九图

main
liu.tao3 1 year ago
parent 10b2347958
commit 3e8132b101

@ -96,7 +96,7 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { right } from '@antv/g2plot/lib/plots/sankey/sankey' import { getFileUrl } from 'data-room-ui/js/utils/file'
export default { export default {
name: 'SourceDialog', name: 'SourceDialog',
@ -182,7 +182,11 @@ export default {
a.style.left=val+"px" a.style.left=val+"px"
}, },
init (val,array) { init (val,array) {
this.imgUrl=val if(!val.startsWith('http')){
this.imgUrl=getFileUrl(val)
}else{
this.imgUrl=val
}
if(array){ if(array){
[this.top,this.right,this.bottom,this.left]=array [this.top,this.right,this.bottom,this.left]=array
this.$nextTick(()=>{ this.$nextTick(()=>{

@ -12,6 +12,7 @@
</template> </template>
<script> <script>
import { refreshComponentMixin } from 'data-room-ui/js/mixins/refreshComponent' import { refreshComponentMixin } from 'data-room-ui/js/mixins/refreshComponent'
import { getFileUrl } from 'data-room-ui/js/utils/file'
export default { export default {
name: 'Border14', name: 'Border14',
components: { components: {
@ -45,8 +46,12 @@ export default {
'config.border.imgUrl': { 'config.border.imgUrl': {
handler (val) { handler (val) {
if(val){ if(val){
let ur=val
if(!val.startsWith('http')){
ur = getFileUrl(val)
}
const a =document.getElementById('border'+ this.config.code) const a =document.getElementById('border'+ this.config.code)
a.style['border-image-source']=`url(${val})` a.style['border-image-source']=`url(${ur})`
}else{ }else{
const a =document.getElementById('border'+ this.config.code) const a =document.getElementById('border'+ this.config.code)
a.style['border-image-source']=`url(${this.url})` a.style['border-image-source']=`url(${this.url})`
@ -56,8 +61,12 @@ export default {
}, },
mounted () { mounted () {
if(this.config.border.imgUrl){ if(this.config.border.imgUrl){
let ur=this.config.border.imgUrl
if(!this.config.border.imgUrl.startsWith('http')){
ur = getFileUrl(this.config.border.imgUrl)
}
const a =document.getElementById('border'+ this.config.code) const a =document.getElementById('border'+ this.config.code)
a.style['border-image-source']=`url(${this.config.border.imgUrl})` a.style['border-image-source']=`url(${ur})`
}else{ }else{
const a =document.getElementById('border'+ this.config.code) const a =document.getElementById('border'+ this.config.code)
a.style['border-image-source']=`url(${this.url})` a.style['border-image-source']=`url(${this.url})`

Loading…
Cancel
Save