|
|
@@ -1,11 +1,11 @@
|
|
|
import type { RouteLocationNormalized, RouteRecordNormalized } from 'vue-router';
|
|
|
import type { App, Plugin } from 'vue';
|
|
|
-import type { FormSchema, FormActionType } from "@/components/Form";
|
|
|
+import type { FormSchema, FormActionType } from '@/components/Form';
|
|
|
|
|
|
import { unref } from 'vue';
|
|
|
import { isObject, isFunction, isString } from '/@/utils/is';
|
|
|
import Big from 'big.js';
|
|
|
-import dayjs from "dayjs";
|
|
|
+import dayjs from 'dayjs';
|
|
|
// 代码逻辑说明: 【VUEN-656】配置外部网址打不开,原因是带了#号,需要替换一下
|
|
|
export const URL_HASH_TAB = `__AGWE4H__HASH__TAG__PWHRG__`;
|
|
|
|
|
|
@@ -95,7 +95,7 @@ export function getDynamicProps<T, U>(props: T): Partial<U> {
|
|
|
* @updateBy:zyf
|
|
|
*/
|
|
|
export function getValueType(props, field) {
|
|
|
- const formSchema = unref(unref(props)?.schemas)
|
|
|
+ const formSchema = unref(unref(props)?.schemas);
|
|
|
let valueType = 'string';
|
|
|
if (formSchema) {
|
|
|
const schema = formSchema.filter((item) => item.field === field)[0];
|
|
|
@@ -265,7 +265,7 @@ export function getQueryVariable(url) {
|
|
|
r,
|
|
|
i = url.split('?')[1],
|
|
|
s = {};
|
|
|
- (t = i.split('&')), (r = null), (n = null);
|
|
|
+ ((t = i.split('&')), (r = null), (n = null));
|
|
|
for (const o in t) {
|
|
|
const u = t[o].indexOf('=');
|
|
|
u !== -1 && ((r = t[o].substr(0, u)), (n = t[o].substr(u + 1)), (s[r] = n));
|
|
|
@@ -376,7 +376,6 @@ export function importViewsFile(path): Promise<any> {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 跳转至积木报表的 预览页面
|
|
|
* @param url
|
|
|
@@ -385,22 +384,21 @@ export function importViewsFile(path): Promise<any> {
|
|
|
*/
|
|
|
export function goJmReportViewPage(url, id, token) {
|
|
|
// URL支持{{ window.xxx }}占位符变量
|
|
|
- url = url.replace(/{{([^}]+)?}}/g, (_s1, s2) => _eval(s2))
|
|
|
+ url = url.replace(/{{([^}]+)?}}/g, (_s1, s2) => _eval(s2));
|
|
|
if (url.includes('?')) {
|
|
|
- url += '&'
|
|
|
+ url += '&';
|
|
|
} else {
|
|
|
- url += '?'
|
|
|
+ url += '?';
|
|
|
}
|
|
|
- url += `id=${id}`
|
|
|
- url += `&token=${token}`
|
|
|
- window.open(url)
|
|
|
+ url += `id=${id}`;
|
|
|
+ url += `&token=${token}`;
|
|
|
+ window.open(url);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取随机颜色
|
|
|
*/
|
|
|
export function getRandomColor(index?) {
|
|
|
-
|
|
|
const colors = [
|
|
|
'rgb(100, 181, 246)',
|
|
|
'rgb(77, 182, 172)',
|
|
|
@@ -423,7 +421,7 @@ export function getRandomColor(index?) {
|
|
|
'rgb(254, 161, 172)',
|
|
|
'rgb(194, 163, 205)',
|
|
|
];
|
|
|
- return index && index < 19 ? colors[index] : colors[Math.floor((Math.random()*(colors.length-1)))];
|
|
|
+ return index && index < 19 ? colors[index] : colors[Math.floor(Math.random() * (colors.length - 1))];
|
|
|
}
|
|
|
|
|
|
export function getRefPromise(componentRef) {
|
|
|
@@ -447,7 +445,7 @@ export function getRefPromise(componentRef) {
|
|
|
* 用new Function替换eval
|
|
|
*/
|
|
|
export function _eval(str: string) {
|
|
|
- return new Function(`return ${str}`)();
|
|
|
+ return new Function(`return ${str}`)();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -492,7 +490,7 @@ export const setPopContainer = (node, selector) => {
|
|
|
const retrospect = (node, elems) => {
|
|
|
let ele = node.parentNode;
|
|
|
while (ele) {
|
|
|
- const findParentNode = elems.find(item => item === ele);
|
|
|
+ const findParentNode = elems.find((item) => item === ele);
|
|
|
if (findParentNode) {
|
|
|
ele = null;
|
|
|
return findParentNode;
|
|
|
@@ -523,12 +521,11 @@ export const setPopContainer = (node, selector) => {
|
|
|
* label、value通用,title、val给权限管理用的
|
|
|
*/
|
|
|
export function useConditionFilter() {
|
|
|
-
|
|
|
// 通用条件
|
|
|
const commonConditionOptions = [
|
|
|
- {label: '为空', value: 'empty', val: 'EMPTY'},
|
|
|
- {label: '不为空', value: 'not_empty', val: 'NOT_EMPTY'},
|
|
|
- ]
|
|
|
+ { label: '为空', value: 'empty', val: 'EMPTY' },
|
|
|
+ { label: '不为空', value: 'not_empty', val: 'NOT_EMPTY' },
|
|
|
+ ];
|
|
|
|
|
|
// 数值、日期
|
|
|
const numberConditionOptions = [
|
|
|
@@ -669,24 +666,3 @@ export const split = (str) => {
|
|
|
}
|
|
|
return str;
|
|
|
};
|
|
|
-
|
|
|
-// 防抖截流
|
|
|
-export function debounce(delay, callback) {
|
|
|
- let task;
|
|
|
- return function () {
|
|
|
- clearTimeout(task);
|
|
|
- task = setTimeout(() => {
|
|
|
- callback.apply(this, arguments);
|
|
|
- }, delay);
|
|
|
- };
|
|
|
-}
|
|
|
-
|
|
|
-export function setRem() {
|
|
|
- // 默认使用100px作为基准大小
|
|
|
- const baseSize = 100;
|
|
|
- const baseVal = baseSize / 1920;
|
|
|
- const vW = window.innerWidth; // 当前窗口的宽度
|
|
|
- const rem = vW * baseVal; // 以默认比例值乘以当前窗口宽度,得到该宽度下的相应font-size值
|
|
|
- window.$size = rem / 100;
|
|
|
- document.documentElement.style.fontSize = rem + 'px';
|
|
|
-}
|