|
@@ -47,6 +47,14 @@ export function parseTime(time: Date | string | number, pattern: string) {
|
|
|
return time_str
|
|
return time_str
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+export function toBoolean(val: any) {
|
|
|
|
|
+ val = val.toString()
|
|
|
|
|
+ if (val == "1" || val.toUpperCase() == "Y" || val.toUpperCase() == "TRUE") {
|
|
|
|
|
+ return true
|
|
|
|
|
+ }
|
|
|
|
|
+ return false
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 表单重置
|
|
// 表单重置
|
|
|
export function resetForm(this: any, refName: string) {
|
|
export function resetForm(this: any, refName: string) {
|
|
|
if (this.$refs[refName]) {
|
|
if (this.$refs[refName]) {
|