【fix ESLint】src/components、src/utils
This commit is contained in:
@@ -819,7 +819,8 @@ export default {
|
||||
/** 获取表格表单里的值 */
|
||||
getValues (callback, rowIds) {
|
||||
const tableData = this.getTableData({ rowIds: rowIds })
|
||||
callback('', tableData)
|
||||
const msg = ''
|
||||
callback(msg, tableData)
|
||||
},
|
||||
/** 获取表格数据 */
|
||||
getTableData (options = {}) {
|
||||
|
||||
@@ -34416,7 +34416,7 @@
|
||||
function r(e) {
|
||||
return e || (e = "朝阳区"), "北京市 ".concat(e)
|
||||
}
|
||||
n.r(t), n.d(t, "demoFieldDefVal_getAddress", (function() {
|
||||
n.r(t), n.d(t, "demoFieldDefValGetAddress", (function() {
|
||||
return r
|
||||
}))
|
||||
},
|
||||
|
||||
@@ -137,7 +137,7 @@ export default {
|
||||
const form = this.form
|
||||
if (value && value !== form.getFieldValue('password')) {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('两次输入的密码不一样!')
|
||||
callback(new Error('两次输入的密码不一样!'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ const FormTypes = {
|
||||
slot: 'slot',
|
||||
hidden: 'hidden'
|
||||
}
|
||||
const VALIDATE_NO_PASSED = Symbol()
|
||||
const VALIDATE_NO_PASSED = Symbol('')
|
||||
export { FormTypes, VALIDATE_NO_PASSED }
|
||||
|
||||
/**
|
||||
@@ -56,7 +56,7 @@ export function getRefPromise (vm, name) {
|
||||
*/
|
||||
export function validateFormAndTables (form, cases) {
|
||||
if (!(form && typeof form.validateFields === 'function')) {
|
||||
throw `form 参数需要的是一个form对象,而传入的却是${typeof form}`
|
||||
throw new Error(`form 参数需要的是一个form对象,而传入的却是${typeof form}`)
|
||||
}
|
||||
|
||||
const options = {}
|
||||
@@ -80,18 +80,19 @@ export function validateFormAndTables (form, cases) {
|
||||
/**
|
||||
* 一次性验证主表单和所有的次表单(新版本)
|
||||
* @param form 主表单 form 对象
|
||||
* @param values
|
||||
* @param cases 接收一个数组,每项都是一个JEditableTable实例
|
||||
* @returns {Promise<any>}
|
||||
* @author sunjianlei
|
||||
*/
|
||||
export function validateFormModelAndTables (form, values, cases) {
|
||||
if (!(form && typeof form.validate === 'function')) {
|
||||
throw `form 参数需要的是一个form对象,而传入的却是${typeof form}`
|
||||
throw new Error(`form 参数需要的是一个form对象,而传入的却是${typeof form}`)
|
||||
}
|
||||
const options = {}
|
||||
return new Promise((resolve, reject) => {
|
||||
// 验证主表表单
|
||||
form.validate((valid, obj) => {
|
||||
form.validate((valid) => {
|
||||
valid ? resolve(values) : reject({ error: VALIDATE_NO_PASSED })
|
||||
})
|
||||
}).then(values => {
|
||||
@@ -114,7 +115,7 @@ export function validateFormModelAndTables (form, values, cases) {
|
||||
*/
|
||||
export function validateTables (cases, deleteTempId) {
|
||||
if (!(cases instanceof Array)) {
|
||||
throw `'validateTables'函数的'cases'参数需要的是一个数组,而传入的却是${typeof cases}`
|
||||
throw new Error(`'validateTables'函数的'cases'参数需要的是一个数组,而传入的却是${typeof cases}`)
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
const tables = []
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { USER_AUTH, SYS_BUTTON_AUTH } from '@/store/mutation-types'
|
||||
import { SYS_BUTTON_AUTH, USER_AUTH } from '@/store/mutation-types'
|
||||
|
||||
export function disabledAuthFilter (code, formData) {
|
||||
if (nodeDisabledAuth(code, formData)) {
|
||||
@@ -13,7 +13,7 @@ function nodeDisabledAuth (code, formData) {
|
||||
try {
|
||||
if (formData) {
|
||||
const bpmList = formData.permissionList
|
||||
permissionList = bpmList.filter(item => item.type == '2')
|
||||
permissionList = bpmList.filter(item => item.type + '' === '2')
|
||||
// for (let bpm of bpmList) {
|
||||
// if(bpm.type == '2') {
|
||||
// permissionList.push(bpm);
|
||||
@@ -25,14 +25,14 @@ function nodeDisabledAuth (code, formData) {
|
||||
} catch (e) {
|
||||
// console.log("页面权限异常----", e);
|
||||
}
|
||||
if (permissionList.length == 0) {
|
||||
if (permissionList.length === 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
console.log('流程节点页面权限禁用--NODE--开始')
|
||||
const permissions = []
|
||||
for (const item of permissionList) {
|
||||
if (item.type == '2') {
|
||||
if (item.type + '' === '2') {
|
||||
permissions.push(item.action)
|
||||
}
|
||||
}
|
||||
@@ -57,24 +57,24 @@ function globalDisabledAuth (code) {
|
||||
// let authList = Vue.ls.get(USER_AUTH);
|
||||
const authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || '[]')
|
||||
for (const auth of authList) {
|
||||
if (auth.type == '2') {
|
||||
if (auth.type + '' === '2') {
|
||||
permissionList.push(auth)
|
||||
}
|
||||
}
|
||||
// console.log("页面禁用权限--Global--",sessionStorage.getItem(SYS_BUTTON_AUTH));
|
||||
const allAuthList = JSON.parse(sessionStorage.getItem(SYS_BUTTON_AUTH) || '[]')
|
||||
for (const gauth of allAuthList) {
|
||||
if (gauth.type == '2') {
|
||||
if (gauth.type + '' === '2') {
|
||||
allPermissionList.push(gauth)
|
||||
}
|
||||
}
|
||||
// 设置全局配置是否有命中
|
||||
let gFlag = false// 禁用命中
|
||||
let invalidFlag = false// 无效命中
|
||||
if (allPermissionList != null && allPermissionList != '' && allPermissionList != undefined && allPermissionList.length > 0) {
|
||||
if (allPermissionList != null && allPermissionList !== '' && allPermissionList !== undefined && allPermissionList.length > 0) {
|
||||
for (const itemG of allPermissionList) {
|
||||
if (code === itemG.action) {
|
||||
if (itemG.status == '0') {
|
||||
if (itemG.status + '' === '0') {
|
||||
invalidFlag = true
|
||||
break
|
||||
} else {
|
||||
@@ -92,7 +92,7 @@ function globalDisabledAuth (code) {
|
||||
}
|
||||
const permissions = []
|
||||
for (const item of permissionList) {
|
||||
if (item.type == '2') {
|
||||
if (item.type + '' === '2') {
|
||||
permissions.push(item.action)
|
||||
}
|
||||
}
|
||||
@@ -111,13 +111,9 @@ function globalDisabledAuth (code) {
|
||||
|
||||
export function colAuthFilter (columns, pre) {
|
||||
const authList = getNoAuthCols(pre)
|
||||
const cols = columns.filter(item => {
|
||||
if (hasColoum(item, authList)) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
return columns.filter(item => {
|
||||
return hasColoum(item, authList)
|
||||
})
|
||||
return cols
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -130,7 +126,7 @@ export function colAuthFilter (columns, pre) {
|
||||
*/
|
||||
export function colAuthFilterJEditableTable (columns, pre) {
|
||||
const authList = getAllShowAndDisabledAuthCols(pre)
|
||||
const cols = columns.filter(item => {
|
||||
return columns.filter(item => {
|
||||
let oneAuth = authList.find(auth => {
|
||||
return auth.action === pre + item.key
|
||||
})
|
||||
@@ -144,30 +140,23 @@ export function colAuthFilterJEditableTable (columns, pre) {
|
||||
}
|
||||
|
||||
// 禁用逻辑
|
||||
if (oneAuth.type == '2' && !oneAuth.isAuth) {
|
||||
if (oneAuth.type + '' === '2' && !oneAuth.isAuth) {
|
||||
item.disabled = true
|
||||
return true
|
||||
}
|
||||
// 隐藏逻辑逻辑
|
||||
if (oneAuth.type == '1' && !oneAuth.isAuth) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return !(oneAuth.type + '' === '1' && !oneAuth.isAuth)
|
||||
})
|
||||
return cols
|
||||
}
|
||||
|
||||
function hasColoum (item, authList) {
|
||||
if (authList.includes(item.dataIndex)) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return !authList.includes(item.dataIndex)
|
||||
}
|
||||
|
||||
// 权限无效时不做控制,有效时控制,只能控制 显示不显示
|
||||
// 根据授权码前缀获取未授权的列信息
|
||||
export function getNoAuthCols (pre) {
|
||||
if (!pre || pre.length == 0) {
|
||||
if (!pre || pre.length === 0) {
|
||||
return []
|
||||
}
|
||||
const permissionList = []
|
||||
@@ -177,7 +166,7 @@ export function getNoAuthCols (pre) {
|
||||
const authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || '[]')
|
||||
for (const auth of authList) {
|
||||
// 显示策略,有效状态
|
||||
if (auth.type == '1' && startWith(auth.action, pre)) {
|
||||
if (auth.type + '' === '1' && startWith(auth.action, pre)) {
|
||||
permissionList.push(substrPre(auth.action, pre))
|
||||
}
|
||||
}
|
||||
@@ -185,17 +174,13 @@ export function getNoAuthCols (pre) {
|
||||
const allAuthList = JSON.parse(sessionStorage.getItem(SYS_BUTTON_AUTH) || '[]')
|
||||
for (const gauth of allAuthList) {
|
||||
// 显示策略,有效状态
|
||||
if (gauth.type == '1' && gauth.status == '1' && startWith(gauth.action, pre)) {
|
||||
if (gauth.type + '' === '1' && gauth.status + '' === '1' && startWith(gauth.action, pre)) {
|
||||
allPermissionList.push(substrPre(gauth.action, pre))
|
||||
}
|
||||
}
|
||||
const cols = allPermissionList.filter(item => {
|
||||
if (permissionList.includes(item)) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return allPermissionList.filter(item => {
|
||||
return !permissionList.includes(item)
|
||||
})
|
||||
return cols
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -242,20 +227,20 @@ function getAllShowAndDisabledAuthCols (pre) {
|
||||
// 全部权限配置
|
||||
const allAuthList = JSON.parse(sessionStorage.getItem(SYS_BUTTON_AUTH) || '[]')
|
||||
|
||||
const newAllAuthList = allAuthList.map(function (item, index) {
|
||||
return allAuthList.map(function (item) {
|
||||
const hasAuthArray = userAuthList.filter(u => u.action === item.action)
|
||||
if (hasAuthArray && hasAuthArray.length > 0) {
|
||||
item.isAuth = true
|
||||
}
|
||||
return item
|
||||
})
|
||||
|
||||
return newAllAuthList
|
||||
}
|
||||
|
||||
function startWith (str, pre) {
|
||||
if (pre == null || pre == '' || str == null || str == '' || str.length == 0 || pre.length > str.length) { return false }
|
||||
if (str.substr(0, pre.length) == pre) { return true } else { return false }
|
||||
if (pre == null || pre + '' === '' || str == null || str + '' === '' || str.length === 0 || pre.length > str.length) {
|
||||
return false
|
||||
}
|
||||
return str.substr(0, pre.length) + '' === pre + ''
|
||||
}
|
||||
|
||||
function substrPre (str, pre) {
|
||||
|
||||
@@ -14,11 +14,11 @@ export function isEdge () {
|
||||
|
||||
export function getIEVersion () {
|
||||
const userAgent = navigator.userAgent // 取得浏览器的userAgent字符串
|
||||
const isIE = isIE()
|
||||
const isIE11 = isIE11()
|
||||
const isEdge = isEdge()
|
||||
const isIEFlag = isIE()
|
||||
const isIE11Flag = isIE11()
|
||||
const isEdgeFlag = isEdge()
|
||||
|
||||
if (isIE) {
|
||||
if (isIEFlag) {
|
||||
const reIE = new RegExp('MSIE (\\d+\\.\\d+);')
|
||||
reIE.test(userAgent)
|
||||
const fIEVersion = parseFloat(RegExp.$1)
|
||||
@@ -27,9 +27,9 @@ export function getIEVersion () {
|
||||
} else {
|
||||
return 6// IE版本<7
|
||||
}
|
||||
} else if (isEdge) {
|
||||
} else if (isEdgeFlag) {
|
||||
return 'edge'
|
||||
} else if (isIE11) {
|
||||
} else if (isIE11Flag) {
|
||||
return 11
|
||||
} else {
|
||||
return -1
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
/** 字段默认值官方示例:获取地址 */
|
||||
export function demoFieldDefVal_getAddress (arg) {
|
||||
export function demoFieldDefValGetAddress (arg) {
|
||||
if (!arg) {
|
||||
arg = '朝阳区'
|
||||
}
|
||||
|
||||
@@ -34,10 +34,11 @@ export function encryption (word, keyStr, ivStr) {
|
||||
|
||||
var CryptoJS = CryptoJS || (function (Math, undefined) {
|
||||
/*
|
||||
* Local polyfil of Object.create
|
||||
*/
|
||||
* Local polyfil of Object.create
|
||||
* */
|
||||
var create = Object.create || (function () {
|
||||
function F () {};
|
||||
function F () {
|
||||
}
|
||||
|
||||
return function (obj) {
|
||||
var subtype
|
||||
@@ -79,11 +80,11 @@ var CryptoJS = CryptoJS || (function (Math, undefined) {
|
||||
* @example
|
||||
*
|
||||
* var MyType = CryptoJS.lib.Base.extend({
|
||||
* field: 'value',
|
||||
*
|
||||
* method: function () {
|
||||
* }
|
||||
* });
|
||||
* field: 'value',
|
||||
*
|
||||
* method: function () {
|
||||
* }
|
||||
* });
|
||||
*/
|
||||
extend: function (overrides) {
|
||||
// Spawn
|
||||
@@ -136,10 +137,10 @@ var CryptoJS = CryptoJS || (function (Math, undefined) {
|
||||
* @example
|
||||
*
|
||||
* var MyType = CryptoJS.lib.Base.extend({
|
||||
* init: function () {
|
||||
* // ...
|
||||
* }
|
||||
* });
|
||||
* init: function () {
|
||||
* // ...
|
||||
* }
|
||||
* });
|
||||
*/
|
||||
init: function () {
|
||||
},
|
||||
@@ -152,8 +153,8 @@ var CryptoJS = CryptoJS || (function (Math, undefined) {
|
||||
* @example
|
||||
*
|
||||
* MyType.mixIn({
|
||||
* field: 'value'
|
||||
* });
|
||||
* field: 'value'
|
||||
* });
|
||||
*/
|
||||
mixIn: function (properties) {
|
||||
for (var propertyName in properties) {
|
||||
@@ -2602,7 +2603,8 @@ var CryptoJS = CryptoJS || (function (Math, undefined) {
|
||||
// Compute Constants
|
||||
(function () {
|
||||
// Compute rho offset constants
|
||||
var x = 1; var y = 0
|
||||
var x = 1
|
||||
var y = 0
|
||||
for (var t = 0; t < 24; t++) {
|
||||
RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64
|
||||
|
||||
@@ -2713,7 +2715,8 @@ var CryptoJS = CryptoJS || (function (Math, undefined) {
|
||||
// Theta
|
||||
for (var x = 0; x < 5; x++) {
|
||||
// Mix column lanes
|
||||
var tMsw = 0; var tLsw = 0
|
||||
var tMsw = 0
|
||||
var tLsw = 0
|
||||
for (var y = 0; y < 5; y++) {
|
||||
var lane = state[x + 5 * y]
|
||||
tMsw ^= lane.high
|
||||
@@ -3772,16 +3775,16 @@ CryptoJS.lib.Cipher || (function (undefined) {
|
||||
* @example
|
||||
*
|
||||
* var cipherParams = CryptoJS.lib.CipherParams.create({
|
||||
* ciphertext: ciphertextWordArray,
|
||||
* key: keyWordArray,
|
||||
* iv: ivWordArray,
|
||||
* salt: saltWordArray,
|
||||
* algorithm: CryptoJS.algo.AES,
|
||||
* mode: CryptoJS.mode.CBC,
|
||||
* padding: CryptoJS.pad.PKCS7,
|
||||
* blockSize: 4,
|
||||
* formatter: CryptoJS.format.OpenSSL
|
||||
* });
|
||||
* ciphertext: ciphertextWordArray,
|
||||
* key: keyWordArray,
|
||||
* iv: ivWordArray,
|
||||
* salt: saltWordArray,
|
||||
* algorithm: CryptoJS.algo.AES,
|
||||
* mode: CryptoJS.mode.CBC,
|
||||
* padding: CryptoJS.pad.PKCS7,
|
||||
* blockSize: 4,
|
||||
* formatter: CryptoJS.format.OpenSSL
|
||||
* });
|
||||
*/
|
||||
init: function (cipherParams) {
|
||||
this.mixIn(cipherParams)
|
||||
|
||||
@@ -5,8 +5,8 @@ Vue.filter('NumberFormat', function (value) {
|
||||
if (!value) {
|
||||
return '0'
|
||||
}
|
||||
const intPartFormat = value.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') // 将整数部分逢三一断
|
||||
return intPartFormat
|
||||
// 将整数部分逢三一断
|
||||
return value.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
|
||||
})
|
||||
|
||||
Vue.filter('dayjs', function (dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { USER_AUTH, SYS_BUTTON_AUTH } from '@/store/mutation-types'
|
||||
|
||||
const hasPermission = {
|
||||
install (Vue, options) {
|
||||
install (Vue) {
|
||||
Vue.directive('has', {
|
||||
inserted: (el, binding, vnode) => {
|
||||
// console.time()
|
||||
@@ -24,7 +24,7 @@ export function filterNodePermission (el, binding, vnode) {
|
||||
if (obj) {
|
||||
const bpmList = obj.permissionList
|
||||
for (const bpm of bpmList) {
|
||||
if (bpm.type != '2') {
|
||||
if (bpm.type + '' !== '2') {
|
||||
permissionList.push(bpm)
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ export function filterNodePermission (el, binding, vnode) {
|
||||
console.log('流程节点页面权限--NODE--')
|
||||
const permissions = []
|
||||
for (const item of permissionList) {
|
||||
if (item.type != '2') {
|
||||
if (item.type + '' !== '2') {
|
||||
permissions.push(item.action)
|
||||
}
|
||||
}
|
||||
@@ -64,30 +64,30 @@ export function filterNodePermission (el, binding, vnode) {
|
||||
/**
|
||||
* 全局权限控制
|
||||
*/
|
||||
export function filterGlobalPermission (el, binding, vnode) {
|
||||
export function filterGlobalPermission (el, binding) {
|
||||
const permissionList = []
|
||||
const allPermissionList = []
|
||||
|
||||
// let authList = Vue.ls.get(USER_AUTH);
|
||||
const authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || '[]')
|
||||
for (const auth of authList) {
|
||||
if (auth.type != '2') {
|
||||
if (auth.type + '' !== '2') {
|
||||
permissionList.push(auth)
|
||||
}
|
||||
}
|
||||
// console.log("页面权限--Global--",sessionStorage.getItem(SYS_BUTTON_AUTH));
|
||||
const allAuthList = JSON.parse(sessionStorage.getItem(SYS_BUTTON_AUTH) || '[]')
|
||||
for (const gauth of allAuthList) {
|
||||
if (gauth.type != '2') {
|
||||
if (gauth.type + '' !== '2') {
|
||||
allPermissionList.push(gauth)
|
||||
}
|
||||
}
|
||||
// 设置全局配置是否有命中
|
||||
let invalidFlag = false// 无效命中
|
||||
if (allPermissionList != null && allPermissionList != '' && allPermissionList != undefined && allPermissionList.length > 0) {
|
||||
if (allPermissionList != null && allPermissionList !== '' && allPermissionList !== undefined && allPermissionList.length > 0) {
|
||||
for (const itemG of allPermissionList) {
|
||||
if (binding.value === itemG.action) {
|
||||
if (itemG.status == '0') {
|
||||
if (itemG.status + '' !== '0') {
|
||||
invalidFlag = true
|
||||
break
|
||||
}
|
||||
@@ -104,13 +104,13 @@ export function filterGlobalPermission (el, binding, vnode) {
|
||||
const permissions = []
|
||||
for (const item of permissionList) {
|
||||
// 权限策略1显示2禁用
|
||||
if (item.type != '2') {
|
||||
if (item.type + '' !== '2') {
|
||||
// update--begin--autor:wangshuai-----date:20200729------for:按钮权限,授权标识的提示信息是多个用逗号分隔逻辑处理 gitee#I1OUGU-------
|
||||
if (item.action) {
|
||||
if (item.action.includes(',')) {
|
||||
const split = item.action.split(',')
|
||||
for (let i = 0; i < split.length; i++) {
|
||||
if (!split[i] || split[i].length == 0) {
|
||||
if (!split[i] || split[i].length === 0) {
|
||||
continue
|
||||
}
|
||||
permissions.push(split[i])
|
||||
|
||||
@@ -4,6 +4,7 @@ import store from '@/store'
|
||||
import { VueAxios } from './axios'
|
||||
import router from '@/router/index'
|
||||
import { ACCESS_TOKEN, TENANT_ID } from '@/store/mutation-types'
|
||||
import { Modal } from 'ant-design-vue'
|
||||
|
||||
/**
|
||||
* 【指定 axios的 baseURL】
|
||||
@@ -33,8 +34,7 @@ const err = (error) => {
|
||||
case 500:
|
||||
console.log('------error.response------', error.response)
|
||||
// update-begin- --- author:liusq ------ date:20200910 ---- for:处理Blob情况----
|
||||
const type = error.response.request.responseType
|
||||
if (type === 'blob') {
|
||||
if (error.response.request.responseType === 'blob') {
|
||||
blobToJson(data)
|
||||
break
|
||||
}
|
||||
@@ -112,7 +112,7 @@ service.interceptors.request.use(config => {
|
||||
}
|
||||
config.headers['tenant-id'] = tenantid
|
||||
// update-end-author:taoyan date:2020707 for:多租户
|
||||
if (config.method == 'get') {
|
||||
if (config.method === 'get') {
|
||||
if (config.url.indexOf('sys/dict/getDictItems') < 0) {
|
||||
config.params = {
|
||||
_t: Date.parse(new Date()) / 1000,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const validateMobile = (rule, value, callback) => {
|
||||
const reg = /^1(3|4|5|7|8)\d{9}$/
|
||||
if (!reg.test(value)) {
|
||||
callback('请输入正确手机号')
|
||||
callback(new Error('请输入正确手机号'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
@@ -11,9 +11,9 @@ const validateEn = (rule, value, callback) => {
|
||||
const reg2 = /^.{4,18}$/
|
||||
// 长度为6到18个字符
|
||||
if (value !== '' && !reg.test(value)) {
|
||||
callback('只允许字母、数字、下划线')
|
||||
callback(new Error('只允许字母、数字、下划线'))
|
||||
} else if (value !== '' && !reg2.test(value)) {
|
||||
callback('长度6到18个字符')
|
||||
callback(new Error('长度6到18个字符'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
@@ -79,8 +79,7 @@ export const rules = {
|
||||
return rule
|
||||
},
|
||||
select: function () {
|
||||
const rule = [{ required: true, message: '', trigger: 'change' }]
|
||||
return rule
|
||||
return [{ required: true, message: '', trigger: 'change' }]
|
||||
},
|
||||
checked: function (min, max) {
|
||||
const rule = [{ required: true, type: 'array', message: '', trigger: 'change' }]
|
||||
|
||||
+16
-20
@@ -38,7 +38,7 @@ export function filterObj (obj) {
|
||||
|
||||
for (const key in obj) {
|
||||
if (obj.hasOwnProperty(key) &&
|
||||
(obj[key] == null || obj[key] == undefined || obj[key] === '')) {
|
||||
(obj[key] == null || obj[key] === undefined || obj[key] === '')) {
|
||||
delete obj[key]
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,7 @@ export function formatDate (value, fmt) {
|
||||
// 生成首页路由
|
||||
export function generateIndexRouter (data) {
|
||||
const redirectPath = findFirstRoute(data)
|
||||
const indexRouter = [{
|
||||
return [{
|
||||
path: '/',
|
||||
name: 'dashboard',
|
||||
// component: () => import('@/components/layouts/BasicLayout'),
|
||||
@@ -97,7 +97,6 @@ export function generateIndexRouter (data) {
|
||||
}, {
|
||||
path: '*', redirect: '/404', hidden: true
|
||||
}]
|
||||
return indexRouter
|
||||
}
|
||||
|
||||
// 生成嵌套路由(子路由)
|
||||
@@ -113,28 +112,28 @@ function generateChildRouters (data) {
|
||||
}
|
||||
// eslint-disable-next-line
|
||||
let URL = (item.meta.url|| '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量
|
||||
if (isURL(URL) || (item.meta.url && item.meta.url.indexOf('{{') == 0)) {
|
||||
if (isURL(URL) || (item.meta.url && item.meta.url.indexOf('{{') === 0)) {
|
||||
item.meta.url = URL
|
||||
}
|
||||
|
||||
let componentPath
|
||||
if (item.component == 'modules/online/cgform/OnlCgformHeadList') {
|
||||
if (item.component === 'modules/online/cgform/OnlCgformHeadList') {
|
||||
componentPath = onlineCommons.OnlCgformHeadList
|
||||
} else if (item.component == 'modules/online/cgform/OnlCgformCopyList') {
|
||||
} else if (item.component + '' === 'modules/online/cgform/OnlCgformCopyList') {
|
||||
componentPath = onlineCommons.OnlCgformCopyList
|
||||
} else if (item.component == 'modules/online/cgform/auto/OnlCgformAutoList') {
|
||||
} else if (item.component + '' === 'modules/online/cgform/auto/OnlCgformAutoList') {
|
||||
componentPath = onlineCommons.OnlCgformAutoList
|
||||
} else if (item.component == 'modules/online/cgform/auto/OnlCgformTreeList') {
|
||||
} else if (item.component + '' === 'modules/online/cgform/auto/OnlCgformTreeList') {
|
||||
componentPath = onlineCommons.OnlCgformTreeList
|
||||
} else if (item.component == 'modules/online/cgform/auto/erp/OnlCgformErpList') {
|
||||
} else if (item.component + '' === 'modules/online/cgform/auto/erp/OnlCgformErpList') {
|
||||
componentPath = onlineCommons.OnlCgformErpList
|
||||
} else if (item.component == 'modules/online/cgform/auto/tab/OnlCgformTabList') {
|
||||
} else if (item.component + '' === 'modules/online/cgform/auto/tab/OnlCgformTabList') {
|
||||
componentPath = onlineCommons.OnlCgformTabList
|
||||
} else if (item.component == 'modules/online/cgform/auto/innerTable/OnlCgformInnerTableList') {
|
||||
} else if (item.component + '' === 'modules/online/cgform/auto/innerTable/OnlCgformInnerTableList') {
|
||||
componentPath = onlineCommons.OnlCgformInnerTableList
|
||||
} else if (item.component == 'modules/online/cgreport/OnlCgreportHeadList') {
|
||||
} else if (item.component + '' === 'modules/online/cgreport/OnlCgreportHeadList') {
|
||||
componentPath = onlineCommons.OnlCgreportHeadList
|
||||
} else if (item.component == 'modules/online/cgreport/auto/OnlCgreportAutoList') {
|
||||
} else if (item.component + '' === 'modules/online/cgreport/auto/OnlCgreportAutoList') {
|
||||
componentPath = onlineCommons.OnlCgreportAutoList
|
||||
} else {
|
||||
componentPath = resolve => require(['@/' + component + '.vue'], resolve)
|
||||
@@ -259,10 +258,7 @@ export function underLine2CamelCase (string) {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function showDealBtn (bpmStatus) {
|
||||
if (bpmStatus != '1' && bpmStatus != '3' && bpmStatus != '4') {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
return bpmStatus + '' !== '1' && bpmStatus + '' !== '3' && bpmStatus + '' !== '4'
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -408,12 +404,12 @@ export function pushIfNotExist (array, value, key) {
|
||||
* 可用于判断是否成功
|
||||
* @type {symbol}
|
||||
*/
|
||||
export const succeedSymbol = Symbol()
|
||||
export const succeedSymbol = Symbol('')
|
||||
/**
|
||||
* 可用于判断是否失败
|
||||
* @type {symbol}
|
||||
*/
|
||||
export const failedSymbol = Symbol()
|
||||
export const failedSymbol = Symbol('')
|
||||
|
||||
/**
|
||||
* 使 promise 无论如何都会 resolve,除非传入的参数不是一个Promise对象或返回Promise对象的方法
|
||||
@@ -550,7 +546,7 @@ export function neverNull (value, def) {
|
||||
export function removeArrayElement (array, prod, value) {
|
||||
let index = -1
|
||||
for (let i = 0; i < array.length; i++) {
|
||||
if (array[i][prod] == value) {
|
||||
if (array[i][prod] + '' === value + '') {
|
||||
index = i
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user