2024-07-19 18:01:59 +08:00
|
|
|
import { views } from '@/utils/constants'
|
|
|
|
|
2024-06-17 11:17:00 +08:00
|
|
|
export const $view = {
|
|
|
|
props: {
|
|
|
|
view: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
}
|
|
|
|
},
|
2024-07-19 18:01:59 +08:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
views
|
|
|
|
}
|
|
|
|
},
|
2024-06-17 11:17:00 +08:00
|
|
|
computed: {
|
|
|
|
hasView() {
|
|
|
|
return (views) => {
|
2024-07-19 18:01:59 +08:00
|
|
|
if (views == null || views.length === 0 || this.view == null) {
|
2024-06-17 11:17:00 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
let list = views;
|
|
|
|
if (views instanceof String) {
|
|
|
|
list = views.split(',');
|
|
|
|
}
|
2024-07-19 18:01:59 +08:00
|
|
|
if (!(list instanceof Array)) {
|
|
|
|
list = [list]
|
|
|
|
}
|
|
|
|
return list.includes(this.view);
|
2024-06-17 11:17:00 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
notHasView() {
|
|
|
|
return (views) => {
|
|
|
|
return !this.hasView(views);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-07-12 16:09:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 显隐列
|
|
|
|
**/
|
|
|
|
export const $showColumns = {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
columns: []
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
showColumns() {
|
|
|
|
if (this.columns == null) {
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
return this.columns.filter(item => item.visible);
|
|
|
|
},
|
|
|
|
isShow() {
|
|
|
|
return (key) => {
|
|
|
|
if (this.columns == null) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
let column = this.columns.find(item => item.key === key);
|
|
|
|
return column != null && column.visible;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
2024-07-23 17:33:51 +08:00
|
|
|
|
2024-07-29 10:33:34 +08:00
|
|
|
// 充值服务费
|
2024-07-23 17:33:51 +08:00
|
|
|
export const $serviceType = {
|
|
|
|
computed: {
|
|
|
|
// 服务费单位
|
|
|
|
serviceUnit() {
|
|
|
|
return (type) => {
|
|
|
|
return type === '2' ? '元' : '%';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-07-29 10:33:34 +08:00
|
|
|
|
|
|
|
// 提现服务费
|
|
|
|
export const $withdrawServiceType = {
|
|
|
|
computed: {
|
|
|
|
// 提现服务费单位
|
|
|
|
withdrawServiceUnit() {
|
|
|
|
return (type) => {
|
|
|
|
return type === '2' ? '元' : '%';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|