leisure-core 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +223 -0
- package/le-area/index.js +7 -0
- package/le-area/src/main.vue +112 -0
- package/le-button/index.js +7 -0
- package/le-button/src/main.vue +47 -0
- package/le-button-attach/index.js +6 -0
- package/le-button-attach/src/main.vue +171 -0
- package/le-button-msg/index.js +7 -0
- package/le-button-msg/src/main.vue +65 -0
- package/le-button-qr/index.js +7 -0
- package/le-button-qr/src/main.vue +96 -0
- package/le-date-picker/index.js +7 -0
- package/le-date-picker/src/main.vue +67 -0
- package/le-date-picker-auto/index.js +6 -0
- package/le-date-picker-auto/src/main.vue +131 -0
- package/le-dialog-container/index.js +7 -0
- package/le-dialog-container/src/main.vue +80 -0
- package/le-form/index.js +7 -0
- package/le-form/src/main.vue +13 -0
- package/le-form-item/index.js +7 -0
- package/le-form-item/src/main.vue +13 -0
- package/le-home/index.js +7 -0
- package/le-home/src/LeHeaderMenu.vue +60 -0
- package/le-home/src/main.vue +1307 -0
- package/le-home/src/sub.vue +82 -0
- package/le-image/index.js +7 -0
- package/le-image/src/main.vue +53 -0
- package/le-input/index.js +7 -0
- package/le-input/src/main.vue +15 -0
- package/le-input-advanced/index.js +7 -0
- package/le-input-advanced/src/main.vue +71 -0
- package/le-input-number/index.js +7 -0
- package/le-input-number/src/main.vue +15 -0
- package/le-input-validate/index.js +6 -0
- package/le-input-validate/src/main.vue +469 -0
- package/le-libs/js/drag.js +78 -0
- package/le-libs/js/event.js +3 -0
- package/le-libs/js/hrequest.js +76 -0
- package/le-libs/js/hrequestFile.js +62 -0
- package/le-libs/js/info.js +7 -0
- package/le-libs/js/tokens.js +13 -0
- package/le-libs/mixins/main.js +48 -0
- package/le-list/index.js +7 -0
- package/le-list/src/main.vue +645 -0
- package/le-list-form/index.js +7 -0
- package/le-list-form/src/main.vue +474 -0
- package/le-login/index.js +7 -0
- package/le-login/src/ForgotPassword.vue +613 -0
- package/le-login/src/main.vue +982 -0
- package/le-media/index.js +7 -0
- package/le-media/src/main.vue +298 -0
- package/le-media-list/index.js +7 -0
- package/le-media-list/src/main.vue +178 -0
- package/le-media-upload/index.js +7 -0
- package/le-media-upload/src/main.vue +329 -0
- package/le-menu/index.js +7 -0
- package/le-menu/src/main.vue +248 -0
- package/le-report/index.js +6 -0
- package/le-report/src/main.vue +1747 -0
- package/le-report/src/rmixins.js +30 -0
- package/le-role/index.js +7 -0
- package/le-role/src/main.vue +183 -0
- package/le-role/src/sub.vue +79 -0
- package/le-role-user/index.js +7 -0
- package/le-role-user/src/main.vue +160 -0
- package/le-role-user/src/sub.vue +90 -0
- package/le-select/index.js +7 -0
- package/le-select/src/main.vue +49 -0
- package/le-select-multi/index.js +6 -0
- package/le-select-multi/src/main.vue +816 -0
- package/le-select-option/index.js +7 -0
- package/le-select-option/src/main.vue +69 -0
- package/le-select-search/index.js +7 -0
- package/le-select-search/src/main.vue +46 -0
- package/le-span/index.js +7 -0
- package/le-span/src/main.vue +29 -0
- package/le-table-edit/index.js +6 -0
- package/le-table-edit/src/main.vue +689 -0
- package/le-theme/common/vars.css +131 -0
- package/le-theme/iconfont/iconfont.css +125 -0
- package/le-theme/iconfont/iconfont.ttf +0 -0
- package/le-theme/iconfont/iconfont.woff +0 -0
- package/le-theme/iconfont/iconfont.woff2 +0 -0
- package/le-theme/index.js +189 -0
- package/le-theme/pages/index.css +15 -0
- package/le-upload/index.js +7 -0
- package/le-upload/src/main.vue +134 -0
- package/le-upload-table/index.js +6 -0
- package/le-upload-table/src/main.vue +648 -0
- package/le-url/index.js +7 -0
- package/le-url/src/main.vue +27 -0
- package/le-video/index.js +7 -0
- package/le-video/src/main.vue +42 -0
- package/package.json +1 -6
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="le-button-qr">
|
|
3
|
+
<le-button text="显示二维码" @click="qrMake(btnAttr)"></le-button>
|
|
4
|
+
<le-dialog-container
|
|
5
|
+
title="二维码"
|
|
6
|
+
width="239px"
|
|
7
|
+
:showDialog="showQrMake"
|
|
8
|
+
:showFooter="true"
|
|
9
|
+
saveBtnText="下 载"
|
|
10
|
+
@close="closeQrMake"
|
|
11
|
+
@saveData="qrDownLoad"
|
|
12
|
+
>
|
|
13
|
+
<div id="qrcodemake" v-if="showQrMake"></div>
|
|
14
|
+
</le-dialog-container>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
<script>
|
|
18
|
+
import QRCode from "qrcodejs2";
|
|
19
|
+
export default {
|
|
20
|
+
name: "le-button-qr",
|
|
21
|
+
props: {
|
|
22
|
+
qrCodeUrl: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: "",
|
|
25
|
+
},
|
|
26
|
+
fileName: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "二维码",
|
|
29
|
+
},
|
|
30
|
+
btnAttr: {
|
|
31
|
+
type: Object,
|
|
32
|
+
default: () => {
|
|
33
|
+
return {};
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
data() {
|
|
38
|
+
return {
|
|
39
|
+
showQrMake: false,
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
methods: {
|
|
43
|
+
closeQrMake() {
|
|
44
|
+
this.showQrMake = false;
|
|
45
|
+
},
|
|
46
|
+
qrMake() {
|
|
47
|
+
let temp = JSON.stringify(this.btnAttr);
|
|
48
|
+
if (!this.btnAttr || temp == "{}") {
|
|
49
|
+
this.$emit("qrMake", this.qrMakeCallBack);
|
|
50
|
+
} else {
|
|
51
|
+
this.$emit("qrMake", this.btnAttr, this.qrMakeCallBack);
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
qrMakeCallBack(res) {
|
|
55
|
+
if (res && res == "ok") {
|
|
56
|
+
this.showQrMake = true;
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
this.qrcode("qrcodemake");
|
|
59
|
+
}, 100);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
qrcode(id) {
|
|
63
|
+
return new Promise((resolve, reject) => {
|
|
64
|
+
try {
|
|
65
|
+
new QRCode(id, {
|
|
66
|
+
width: 200,
|
|
67
|
+
height: 200,
|
|
68
|
+
text: this.qrCodeUrl,
|
|
69
|
+
colorDark: "#000",
|
|
70
|
+
colorLight: "#fff",
|
|
71
|
+
});
|
|
72
|
+
resolve();
|
|
73
|
+
} catch (e) {
|
|
74
|
+
reject("二维码生成错误:" + e);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
qrDownLoad() {
|
|
79
|
+
let myCanvas = document
|
|
80
|
+
.getElementById("qrcodemake")
|
|
81
|
+
.getElementsByTagName("canvas");
|
|
82
|
+
let a = document.createElement("a");
|
|
83
|
+
a.href = myCanvas[0].toDataURL("image/png");
|
|
84
|
+
a.download = this.fileName;
|
|
85
|
+
a.click();
|
|
86
|
+
this.$message.success("正在进行下载保存");
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
</script>
|
|
91
|
+
<style lang="scss" scoped>
|
|
92
|
+
.le-button-qr {
|
|
93
|
+
margin-right: 2px;
|
|
94
|
+
margin-left: 2px;
|
|
95
|
+
}
|
|
96
|
+
</style>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-date-picker
|
|
3
|
+
v-model="internalValue"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
v-on="$listeners"
|
|
6
|
+
:class="['customClass', $attrs.class]"
|
|
7
|
+
:style="$attrs.style"
|
|
8
|
+
:type="type"
|
|
9
|
+
></el-date-picker>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
export default {
|
|
14
|
+
name: "le-date-picker",
|
|
15
|
+
props: {
|
|
16
|
+
value: {
|
|
17
|
+
type: [Number, Date, String], // 可以接收时间戳、Date 对象或日期字符串
|
|
18
|
+
default: null,
|
|
19
|
+
},
|
|
20
|
+
type: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "date",
|
|
23
|
+
},
|
|
24
|
+
translateDate: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
data() {
|
|
30
|
+
return {
|
|
31
|
+
internalValue: this.convertValueToInternal(this.value), // 初始化内部值
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
watch: {
|
|
35
|
+
// value(newVal) {
|
|
36
|
+
// this.internalValue = this.convertValueToInternal(newVal);
|
|
37
|
+
// },
|
|
38
|
+
// internalValue(newVal) {
|
|
39
|
+
// const outputValue = this.convertValueToOutput(newVal);
|
|
40
|
+
// this.$emit("input", outputValue);
|
|
41
|
+
// },
|
|
42
|
+
},
|
|
43
|
+
methods: {
|
|
44
|
+
convertValueToInternal(value) {
|
|
45
|
+
if (this.translateDate && typeof value === "number") {
|
|
46
|
+
return new Date(value * 1000);
|
|
47
|
+
} else if (value instanceof Date) {
|
|
48
|
+
return value;
|
|
49
|
+
} else if (typeof value === "string" && !isNaN(Date.parse(value))) {
|
|
50
|
+
return new Date(value);
|
|
51
|
+
} else {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
convertValueToOutput(value) {
|
|
56
|
+
if (this.translateDate && value instanceof Date) {
|
|
57
|
+
return Math.floor(value.getTime() / 1000);
|
|
58
|
+
} else {
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
mounted() {
|
|
64
|
+
// 如果需要在组件挂载后执行某些操作,可以在这里添加代码。
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
</script>
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-date-picker
|
|
3
|
+
v-model="internalValue"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
v-on="$listeners"
|
|
6
|
+
:class="['customClass', $attrs.class]"
|
|
7
|
+
:style="$attrs.style"
|
|
8
|
+
:type="type"
|
|
9
|
+
></el-date-picker>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
export default {
|
|
14
|
+
name: "le-date-picker-auto",
|
|
15
|
+
props: {
|
|
16
|
+
value: {
|
|
17
|
+
type: [Number, Date, String],
|
|
18
|
+
default: null,
|
|
19
|
+
},
|
|
20
|
+
type: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "date",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
data() {
|
|
26
|
+
return {
|
|
27
|
+
internalValue: this.convertValueToInternal(this.value),
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
watch: {
|
|
31
|
+
value(newVal) {
|
|
32
|
+
this.internalValue = this.convertValueToInternal(newVal);
|
|
33
|
+
},
|
|
34
|
+
internalValue(newVal) {
|
|
35
|
+
const outputValue = this.convertValueToOutput(newVal);
|
|
36
|
+
this.$emit("input", outputValue);
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
methods: {
|
|
40
|
+
isTimestampInSeconds(value) {
|
|
41
|
+
if (typeof value !== "number") return false;
|
|
42
|
+
|
|
43
|
+
// 秒级时间戳通常是10位数字(当前时间戳约16-17亿)
|
|
44
|
+
// 但为了更准确,我们检查时间戳是否在合理范围内
|
|
45
|
+
const currentSeconds = Math.floor(Date.now() / 1000);
|
|
46
|
+
const minReasonable = 0; // 1970-01-01
|
|
47
|
+
const maxReasonable = currentSeconds + 100 * 365 * 24 * 60 * 60; // 当前时间 + 100年
|
|
48
|
+
|
|
49
|
+
return value >= minReasonable && value <= maxReasonable;
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
isTimestampInMilliseconds(value) {
|
|
53
|
+
if (typeof value !== "number") return false;
|
|
54
|
+
|
|
55
|
+
// 毫秒级时间戳通常是13位数字
|
|
56
|
+
// 检查是否在合理的时间范围内
|
|
57
|
+
const currentMs = Date.now();
|
|
58
|
+
const minReasonable = 0; // 1970-01-01
|
|
59
|
+
const maxReasonable = currentMs + 100 * 365 * 24 * 60 * 60 * 1000; // 当前时间 + 100年
|
|
60
|
+
|
|
61
|
+
return value >= minReasonable && value <= maxReasonable;
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
convertValueToInternal(value) {
|
|
65
|
+
if (value === null || value === undefined || value === "") {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// 如果是数字时间戳
|
|
70
|
+
if (typeof value === "number") {
|
|
71
|
+
if (this.isTimestampInSeconds(value)) {
|
|
72
|
+
// 确认是秒级时间戳,转换为毫秒
|
|
73
|
+
return new Date(value * 1000);
|
|
74
|
+
} else if (this.isTimestampInMilliseconds(value)) {
|
|
75
|
+
// 如果是毫秒级时间戳,也转换为秒再处理,确保一致性
|
|
76
|
+
const seconds = Math.floor(value / 1000);
|
|
77
|
+
return new Date(seconds * 1000);
|
|
78
|
+
} else {
|
|
79
|
+
// 无法识别的数字,尝试直接作为毫秒处理
|
|
80
|
+
console.warn("无法识别的时间戳格式,将尝试作为毫秒处理:", value);
|
|
81
|
+
return new Date(value);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// 如果是 Date 对象
|
|
85
|
+
else if (value instanceof Date) {
|
|
86
|
+
return value;
|
|
87
|
+
}
|
|
88
|
+
// 如果是字符串日期
|
|
89
|
+
else if (typeof value === "string") {
|
|
90
|
+
const parsedDate = new Date(value);
|
|
91
|
+
return isNaN(parsedDate.getTime()) ? null : parsedDate;
|
|
92
|
+
}
|
|
93
|
+
// 其他情况返回 null
|
|
94
|
+
else {
|
|
95
|
+
console.warn("无法处理的值类型:", typeof value, value);
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
convertValueToOutput(value) {
|
|
101
|
+
if (value === null || value === undefined || value === "") {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// 如果是 Date 对象,转换为时间戳(秒)
|
|
106
|
+
if (value instanceof Date) {
|
|
107
|
+
return Math.floor(value.getTime() / 1000);
|
|
108
|
+
}
|
|
109
|
+
// 如果是数字,根据位数判断是否需要转换
|
|
110
|
+
else if (typeof value === "number") {
|
|
111
|
+
if (this.isTimestampInSeconds(value)) {
|
|
112
|
+
return value; // 已经是秒,直接返回
|
|
113
|
+
} else if (this.isTimestampInMilliseconds(value)) {
|
|
114
|
+
return Math.floor(value / 1000); // 毫秒转秒
|
|
115
|
+
} else {
|
|
116
|
+
console.warn("无法识别的时间戳格式,将尝试作为秒处理:", value);
|
|
117
|
+
return value;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// 其他情况返回 null
|
|
121
|
+
else {
|
|
122
|
+
console.warn("无法输出的值类型:", typeof value, value);
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
mounted() {
|
|
128
|
+
// 如果需要在组件挂载后执行某些操作,可以在这里添加代码。
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
</script>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog :width="width" :title="title" :visible.sync="dialogShow" :close-on-click-modal="closeMode"
|
|
3
|
+
:show-close="showCloseBtnTop" append-to-body @close="closeDialog" v-el-drag-dialog>
|
|
4
|
+
<slot v-if="dialogShow" />
|
|
5
|
+
<div slot="footer" v-if="showFooter" class="dialog-footer">
|
|
6
|
+
<template>
|
|
7
|
+
<slot name="le-footer"></slot>
|
|
8
|
+
<le-button type="primary" v-if="showSaveBtn" @click="saveData">{{
|
|
9
|
+
saveBtnText
|
|
10
|
+
}}</le-button>
|
|
11
|
+
<le-button type="info" v-if="showCloseBtn" @click="closeDialog">关闭</le-button>
|
|
12
|
+
</template>
|
|
13
|
+
</div>
|
|
14
|
+
</el-dialog>
|
|
15
|
+
</template>
|
|
16
|
+
<script>
|
|
17
|
+
export default {
|
|
18
|
+
name: "le-dialog-container",
|
|
19
|
+
props: {
|
|
20
|
+
showDialog: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false,
|
|
23
|
+
},
|
|
24
|
+
width: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: "60%",
|
|
27
|
+
},
|
|
28
|
+
title: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: "商品详情",
|
|
31
|
+
},
|
|
32
|
+
closeMode: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false,
|
|
35
|
+
},
|
|
36
|
+
showFooter: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false,
|
|
39
|
+
},
|
|
40
|
+
showSaveBtn: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: true,
|
|
43
|
+
},
|
|
44
|
+
showCloseBtn: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: true,
|
|
47
|
+
},
|
|
48
|
+
showCloseBtnTop: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false,
|
|
51
|
+
},
|
|
52
|
+
saveBtnText: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: "确 定",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
data() {
|
|
58
|
+
return {};
|
|
59
|
+
},
|
|
60
|
+
computed: {
|
|
61
|
+
dialogShow: {
|
|
62
|
+
get() {
|
|
63
|
+
return this.showDialog;
|
|
64
|
+
},
|
|
65
|
+
set(newValue) {
|
|
66
|
+
// this.$emit("close", newValue);
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
mounted() { },
|
|
71
|
+
methods: {
|
|
72
|
+
closeDialog(param) {
|
|
73
|
+
this.$emit("close", param);
|
|
74
|
+
},
|
|
75
|
+
saveData() {
|
|
76
|
+
this.$emit("saveData");
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
</script>
|
package/le-form/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<le-form-item v-bind="$attrs" v-on="$listeners" :style="$attrs.style">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</le-form-item>
|
|
5
|
+
</template>
|
|
6
|
+
<script>
|
|
7
|
+
export default {
|
|
8
|
+
name: "le-form-item",
|
|
9
|
+
inheritAttrs: false,
|
|
10
|
+
props: {},
|
|
11
|
+
methods: {},
|
|
12
|
+
};
|
|
13
|
+
</script>
|
package/le-home/index.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 有子项:渲染为 submenu(一级横向 / 下级下拉均支持) -->
|
|
3
|
+
<el-submenu
|
|
4
|
+
v-if="hasChildren"
|
|
5
|
+
:index="item.name"
|
|
6
|
+
popper-class="le-header-menu-popper"
|
|
7
|
+
>
|
|
8
|
+
<template slot="title">
|
|
9
|
+
<i v-if="item.icon" :class="item.icon"></i>
|
|
10
|
+
<span>{{ item.title }}</span>
|
|
11
|
+
</template>
|
|
12
|
+
<!-- 递归渲染子节点 -->
|
|
13
|
+
<le-header-menu
|
|
14
|
+
v-for="child in visibleChildren"
|
|
15
|
+
:key="child.id || child.name"
|
|
16
|
+
:item="child"
|
|
17
|
+
:level="level + 1"
|
|
18
|
+
:on-select="onSelect"
|
|
19
|
+
></le-header-menu>
|
|
20
|
+
</el-submenu>
|
|
21
|
+
<!-- 叶子节点:渲染为 menu-item -->
|
|
22
|
+
<el-menu-item v-else :index="item.name" @click="handleClick">
|
|
23
|
+
<i v-if="item.icon" :class="item.icon"></i>
|
|
24
|
+
<span>{{ item.title }}</span>
|
|
25
|
+
</el-menu-item>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
export default {
|
|
30
|
+
name: "LeHeaderMenu",
|
|
31
|
+
props: {
|
|
32
|
+
item: {
|
|
33
|
+
type: Object,
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
level: {
|
|
37
|
+
type: Number,
|
|
38
|
+
default: 0,
|
|
39
|
+
},
|
|
40
|
+
onSelect: {
|
|
41
|
+
type: Function,
|
|
42
|
+
default: () => {},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
computed: {
|
|
46
|
+
hasChildren() {
|
|
47
|
+
return Array.isArray(this.item.children) && this.item.children.length > 0;
|
|
48
|
+
},
|
|
49
|
+
visibleChildren() {
|
|
50
|
+
if (!this.item.children) return [];
|
|
51
|
+
return this.item.children.filter((child) => child.ishide !== 1);
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
methods: {
|
|
55
|
+
handleClick() {
|
|
56
|
+
this.onSelect(this.item);
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
</script>
|