eslint; 收入合同
This commit is contained in:
+35
-35
@@ -1,6 +1,6 @@
|
||||
import * as api from '@/api/api'
|
||||
import { isURL } from '@/utils/validate'
|
||||
import { JSEncrypt } from "jsencrypt";
|
||||
import { JSEncrypt } from 'jsencrypt'
|
||||
// import onlineCommons from '@/components/onlineForm/onlineForm'
|
||||
//
|
||||
export function timeFix() {
|
||||
@@ -32,16 +32,16 @@ export function triggerWindowResizeEvent() {
|
||||
*/
|
||||
export function filterObj(obj) {
|
||||
if (!(typeof obj == 'object')) {
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
for ( let key in obj) {
|
||||
if (obj.hasOwnProperty(key)
|
||||
&& (obj[key] == null || obj[key] == undefined || obj[key] === '')) {
|
||||
delete obj[key];
|
||||
delete obj[key]
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
return obj
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -51,10 +51,10 @@ export function filterObj(obj) {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function formatDate(value, fmt) {
|
||||
let regPos = /^\d+(\.\d+)?$/;
|
||||
let regPos = /^\d+(\.\d+)?$/
|
||||
if(regPos.test(value)){
|
||||
//如果是数字
|
||||
let getDate = new Date(value);
|
||||
let getDate = new Date(value)
|
||||
let o = {
|
||||
'M+': getDate.getMonth() + 1,
|
||||
'd+': getDate.getDate(),
|
||||
@@ -63,7 +63,7 @@ export function formatDate(value, fmt) {
|
||||
's+': getDate.getSeconds(),
|
||||
'q+': Math.floor((getDate.getMonth() + 3) / 3),
|
||||
'S': getDate.getMilliseconds()
|
||||
};
|
||||
}
|
||||
if (/(y+)/.test(fmt)) {
|
||||
fmt = fmt.replace(RegExp.$1, (getDate.getFullYear() + '').substr(4 - RegExp.$1.length))
|
||||
}
|
||||
@@ -72,11 +72,11 @@ export function formatDate(value, fmt) {
|
||||
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
|
||||
}
|
||||
}
|
||||
return fmt;
|
||||
return fmt
|
||||
}else{
|
||||
//TODO
|
||||
value = value.trim();
|
||||
return value.substr(0,fmt.length);
|
||||
value = value.trim()
|
||||
return value.substr(0,fmt.length)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,27 +93,27 @@ let indexRouter = [{
|
||||
...generateChildRouters(data)
|
||||
]
|
||||
},{
|
||||
"path": "*", "redirect": "/404", "hidden": true
|
||||
'path': '*', 'redirect': '/404', 'hidden': true
|
||||
}]
|
||||
return indexRouter;
|
||||
return indexRouter
|
||||
}
|
||||
|
||||
// 生成嵌套路由(子路由)
|
||||
|
||||
function generateChildRouters (data) {
|
||||
const routers = [];
|
||||
const routers = []
|
||||
for (let item of data) {
|
||||
let component = "";
|
||||
if(item.component.indexOf("layouts")>=0){
|
||||
component = "components/"+item.component;
|
||||
let component = ''
|
||||
if(item.component.indexOf('layouts')>=0){
|
||||
component = 'components/'+item.component
|
||||
}else{
|
||||
component = "views/"+item.component;
|
||||
component = 'views/'+item.component
|
||||
}
|
||||
|
||||
// eslint-disable-next-line
|
||||
let URL = (item.meta.url|| '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量
|
||||
if (isURL(URL)) {
|
||||
item.meta.url = URL;
|
||||
item.meta.url = URL
|
||||
}
|
||||
|
||||
let componentPath
|
||||
@@ -160,11 +160,11 @@ function generateChildRouters (data) {
|
||||
}
|
||||
}
|
||||
if(item.alwaysShow){
|
||||
menu.alwaysShow = true;
|
||||
menu.redirect = menu.path;
|
||||
menu.alwaysShow = true
|
||||
menu.redirect = menu.path
|
||||
}
|
||||
if (item.children && item.children.length > 0) {
|
||||
menu.children = [...generateChildRouters( item.children)];
|
||||
menu.children = [...generateChildRouters( item.children)]
|
||||
}
|
||||
//--update-begin----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
|
||||
//判断是否生成路由
|
||||
@@ -172,7 +172,7 @@ function generateChildRouters (data) {
|
||||
//console.log(' 不生成路由 item.route: '+item.route);
|
||||
//console.log(' 不生成路由 item.path: '+item.path);
|
||||
}else{
|
||||
routers.push(menu);
|
||||
routers.push(menu)
|
||||
}
|
||||
//--update-end----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
|
||||
}
|
||||
@@ -249,8 +249,8 @@ export function randomUUID() {
|
||||
*/
|
||||
export function underLine2CamelCase(string){
|
||||
return string.replace( /_([a-z])/g, function( all, letter ) {
|
||||
return letter.toUpperCase();
|
||||
});
|
||||
return letter.toUpperCase()
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -259,10 +259,10 @@ export function underLine2CamelCase(string){
|
||||
* @returns {*}
|
||||
*/
|
||||
export function showDealBtn(bpmStatus){
|
||||
if(bpmStatus!="1"&&bpmStatus!="3"&&bpmStatus!="4"){
|
||||
return true;
|
||||
if(bpmStatus!='1'&&bpmStatus!='3'&&bpmStatus!='4'){
|
||||
return true
|
||||
}
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -272,7 +272,7 @@ export function showDealBtn(bpmStatus){
|
||||
*/
|
||||
export function cssExpand(css, id) {
|
||||
let style = document.createElement('style')
|
||||
style.type = "text/css"
|
||||
style.type = 'text/css'
|
||||
style.innerHTML = `@charset "UTF-8"; ${css}`
|
||||
// 清除旧样式
|
||||
if (id) {
|
||||
@@ -554,12 +554,12 @@ export function removeArrayElement(array, prod, value) {
|
||||
let index = -1
|
||||
for(let i = 0;i<array.length;i++){
|
||||
if(array[i][prod] == value){
|
||||
index = i;
|
||||
break;
|
||||
index = i
|
||||
break
|
||||
}
|
||||
}
|
||||
if(index>=0){
|
||||
array.splice(index, 1);
|
||||
array.splice(index, 1)
|
||||
}
|
||||
}
|
||||
/**
|
||||
@@ -577,13 +577,13 @@ export function encrypt(publicKey, message) {
|
||||
* 校验数组是否有重复的元素
|
||||
* */
|
||||
export function isRepeat(arr) {
|
||||
var hash = {};
|
||||
var hash = {}
|
||||
for(var i in arr) {
|
||||
if(hash[arr[i]]) {
|
||||
return true;
|
||||
return true
|
||||
}
|
||||
// 不存在该元素,则赋值为true,可以赋任意值,相应的修改if判断条件即可
|
||||
hash[arr[i]] = true;
|
||||
hash[arr[i]] = true
|
||||
}
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user