mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-19 01:48:47 +08:00
43 lines
839 B
JavaScript
43 lines
839 B
JavaScript
import Vue from 'vue'
|
|
import {imageBaseUrl} from "@/settings";
|
|
import {listDept} from "@/api/system/dept";
|
|
|
|
|
|
Vue.filter('getImageForKey', val => {
|
|
return imageBaseUrl + val
|
|
})
|
|
|
|
Vue.filter('getImage200', val => {
|
|
return imageBaseUrl + val + "?imageMogr2/thumbnail/!200x200r/|imageMogr2/gravity/center/crop/200x200/interlace/0"
|
|
})
|
|
|
|
|
|
// 定义一个混入对象
|
|
export const CommonMixin = {
|
|
data() {
|
|
return {
|
|
|
|
deptOptions: []
|
|
}
|
|
},
|
|
created: function () {
|
|
listDept().then(r => {
|
|
this.deptOptions = r.data.filter(x => x.parentId === 300)
|
|
})
|
|
},
|
|
methods: {
|
|
|
|
// 商户类型字典翻译
|
|
deptFormat(row, column) {
|
|
|
|
if (this.deptOptions.length < 1) {
|
|
return ''
|
|
}
|
|
const dept = this.deptOptions.filter(x => x.deptId === row.deptId)[0]
|
|
return dept.deptName
|
|
}
|
|
|
|
}
|
|
}
|
|
|