From 2ccd33975abf91f9a7929ca8ed6fc03d74ee424d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 08 十月 2022 10:10:07 +0800
Subject: [PATCH] 2022-10-08
---
src/utils/utils.js | 238 +++++++++++++++++++++++++++++++----------------------------
1 files changed, 125 insertions(+), 113 deletions(-)
diff --git a/src/utils/utils.js b/src/utils/utils.js
index 91cd72f..94ac0a2 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -39,6 +39,26 @@
export default class Utils {
/**
+ * @description 鑾峰彇浼氬憳绛夌骇
+ * @return {String} level
+ */
+ static getMemberLevel () {
+ let _level = 10
+ let _Mlevel = sessionStorage.getItem('Member_Level')
+
+ if (_Mlevel) {
+ if (_Mlevel === md5('mksoft' + window.GLOB.appkey + new Date().getFullYear() + new Date().getMonth() + 10)) {
+ _level = 10
+ } else if (_Mlevel === md5('mksoft' + window.GLOB.appkey + new Date().getFullYear() + new Date().getMonth() + 20)) {
+ _level = 20
+ } else if (_Mlevel === md5('mksoft' + window.GLOB.appkey + new Date().getFullYear() + new Date().getMonth() + 30)) {
+ _level = 30
+ }
+ }
+ return _level
+ }
+
+ /**
* @description 鏁版嵁婧愬悕绉帮紝鐢ㄤ簬缁熶竴鏌ヨ
* @return {String} name
*/
@@ -74,12 +94,11 @@
static getguid () {
// 浜х敓涓�涓柊鐨凣UID鍊�
let uuid = []
- let d = new Date()
let options = '0123456789abcdefghigklmnopqrstuv'
for (let i = 0; i < 19; i++) {
uuid.push(options.substr(Math.floor(Math.random() * 0x20), 1))
}
- uuid = moment().format('YYYYMMDDHHmmss') + d.getMilliseconds() + uuid.join('')
+ uuid = moment().format('YYYYMMDDHHmmssSSS') + uuid.join('')
return uuid.toUpperCase()
}
@@ -249,9 +268,9 @@
item.required = !item.hidden && item.required === 'true'
item.advanced = item.advanced === 'true'
item.$forbid = item.query === 'false'
+ item.precision = item.precision || 'day'
if (item.type === 'date') { // 鏃堕棿鎼滅储
- item.precision = item.precision || 'day'
let format = 'YYYY-MM-DD'
if (item.precision === 'day') {
@@ -269,7 +288,6 @@
} else if (item.type === 'dateweek') {
item.initval = item.initval ? moment().subtract(item.initval * 7, 'days').format('YYYY-MM-DD') : ''
} else if (item.type === 'daterange') {
- item.precision = item.precision || 'day'
let format = 'YYYY-MM-DD'
if (item.precision === 'day') {
@@ -381,7 +399,7 @@
label: cell.label,
value: cell.initval,
required: cell.required,
- precision: cell.precision || '',
+ precision: cell.precision || 'day',
forbid: cell.$forbid
}
@@ -706,77 +724,13 @@
}
/**
- * @description 鑾峰彇鎼滅储鐢ㄤ簬姝e垯鏇挎崲
- * @param {Array} searches 鎼滅储鏉′欢
- * @return {String} searchText 鎷兼帴缁撴灉
- */
- static getRegOptions (searches) {
- if (!searches || searches.length === 0) return []
-
- let options = []
- let fieldmap = new Map()
- searches.forEach(search => {
- let item = {
- key: search.field,
- value: '0'
- }
-
- if (fieldmap.has(item.key)) {
- item.key = item.key + '1'
- }
-
- fieldmap.set(item.key, true)
-
- if (search.type === 'group') {
- options.push({
- key: search.field,
- value: '0'
- })
- options.push({
- key: search.datefield,
- value: '0'
- })
- options.push({
- key: search.datefield + '1',
- value: '0'
- })
- options.push(item)
- } else if (['datemonth', 'dateweek', 'daterange'].includes(search.type)) {
- options.push(item)
- options.push({
- key: item.key + '1',
- value: '0'
- })
- } else if (search.type === 'text' || search.type === 'select') {
- item.key.split(',').forEach(field => {
- let cell = JSON.parse(JSON.stringify(item))
- cell.key = field
-
- options.push(cell)
- })
- } else {
- options.push(item)
- }
- })
-
- return options
- }
-
- /**
* @description 鑾峰彇鍥剧墖鐪熷疄璺緞
* @return {String} url 鍥剧墖璺緞
*/
static getrealurl (url) {
if (!url) return ''
- let baseurl = ''
- if (process.env.NODE_ENV === 'production') {
- baseurl = document.location.origin + '/' + window.GLOB.service
- } else {
- baseurl = window.GLOB.location + '/' + window.GLOB.service
- }
-
- let realurl = url.match(/^http/) || url.match(/^\/\//) ? url : baseurl + url
+ let realurl = url.match(/^http/) || url.match(/^\/\//) ? url : window.GLOB.baseurl + url
return realurl
}
@@ -792,7 +746,7 @@
if (options.cloudServiceApi) {
baseurl = options.cloudServiceApi.replace(/webapi(.*)$/, '')
} else {
- baseurl = document.location.origin + '/' + window.GLOB.service
+ baseurl = window.GLOB.baseurl
}
return url.match(/^http/) || url.match(/^\/\//) ? url : baseurl + url
@@ -806,7 +760,7 @@
let arrfield = [item.valueField, item.valueText]
if (item.type === 'checkcard') {
- arrfield = item.fields.map(f => f.field)
+ arrfield = item.fields ? item.fields.map(f => f.field) : []
arrfield.push(item.cardValField)
if (item.urlField) {
arrfield.push(item.urlField)
@@ -854,6 +808,9 @@
sql = sql.replace(/@db@/ig, window.GLOB.externalDatabase)
}
+ sql = sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`)
+ sql = sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
+
if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) {
console.info(sql)
}
@@ -880,7 +837,12 @@
let RoleID = sessionStorage.getItem('role_id') || ''
let departmentcode = sessionStorage.getItem('departmentcode') || ''
let organization = sessionStorage.getItem('organization') || ''
+ let mk_user_type = sessionStorage.getItem('mk_user_type') || ''
+ let nation = sessionStorage.getItem('nation') || ''
+ let province = sessionStorage.getItem('province') || ''
let city = sessionStorage.getItem('city') || ''
+ let district = sessionStorage.getItem('district') || ''
+ let address = sessionStorage.getItem('address') || ''
let _sheet = item.sheet
if (sessionStorage.getItem('isEditState') === 'true') {
@@ -1127,9 +1089,9 @@
_sql = `
/* 绯荤粺鐢熸垚 */
declare @${sheet} table (${declarefields.join(',')},jskey nvarchar(50),BID nvarchar(50) )
- Declare @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(50),@mk_organization nvarchar(50),@login_city nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@tbid Nvarchar(512)
+ Declare @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@tbid Nvarchar(512)
- Select @ErrorCode='', @retmsg='', @UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @login_city='${city}'
+ Select @ErrorCode='', @retmsg='', @UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}'
${_initCustomScript}
`
_sqlInsert = `Insert into @${sheet} (${fields},jskey,BID)`
@@ -1162,9 +1124,9 @@
_sql = `
/* 绯荤粺鐢熸垚 */
declare @${sheet} table (jskey nvarchar(50))
- Declare @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(50),@mk_organization nvarchar(50),@login_city nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@tbid Nvarchar(512)
+ Declare @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@tbid Nvarchar(512)
- Select @ErrorCode='', @retmsg='', @UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @login_city='${city}'
+ Select @ErrorCode='', @retmsg='', @UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}'
`
}
@@ -1194,7 +1156,13 @@
let RoleID = sessionStorage.getItem('role_id') || ''
let departmentcode = sessionStorage.getItem('departmentcode') || ''
let organization = sessionStorage.getItem('organization') || ''
+ let mk_user_type = sessionStorage.getItem('mk_user_type') || ''
+ let nation = sessionStorage.getItem('nation') || ''
+ let province = sessionStorage.getItem('province') || ''
let city = sessionStorage.getItem('city') || ''
+ let district = sessionStorage.getItem('district') || ''
+ let address = sessionStorage.getItem('address') || ''
+
let _sheet = btn.sheet
let BID = data[0].$$BID || ''
@@ -1339,9 +1307,9 @@
_sql = `
/* 绯荤粺鐢熸垚 */
declare @${sheet} table (${declarefields.join(',')},jskey nvarchar(50),data_type nvarchar(50),BID nvarchar(50) )
- Declare @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(50),@mk_organization nvarchar(50),@login_city nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@tbid Nvarchar(512)
+ Declare @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@tbid Nvarchar(512)
- Select @ErrorCode='', @retmsg='', @UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @login_city='${city}'
+ Select @ErrorCode='', @retmsg='', @UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}'
${_initCustomScript}
`
_sqlInsert = `Insert into @${sheet} (${fields},jskey,data_type,BID)`
@@ -1374,9 +1342,9 @@
_sql = `
/* 绯荤粺鐢熸垚 */
declare @${sheet} table (jskey nvarchar(50))
- Declare @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(50),@mk_organization nvarchar(50),@login_city nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@tbid Nvarchar(512)
+ Declare @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@tbid Nvarchar(512)
- Select @ErrorCode='', @retmsg='', @UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @login_city='${city}'
+ Select @ErrorCode='', @retmsg='', @UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}'
`
}
@@ -1443,7 +1411,7 @@
})
// 闇�瑕佸0鏄庣殑鍙橀噺闆�
- let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode', 'roleid', 'mk_departmentcode', 'mk_organization', 'login_city', 'bid']
+ let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode', 'roleid', 'mk_departmentcode', 'mk_organization', 'mk_user_type', 'mk_nation', 'mk_province', 'mk_city', 'mk_district', 'mk_address', 'bid']
// 涓婚敭瀛楁
let primaryKey = setting.primaryKey || 'id'
@@ -1508,7 +1476,7 @@
}
// 娣诲姞鏁版嵁涓瓧娈碉紝琛ㄥ崟鍊间紭鍏�(鎸夐挳涓嶉�夎鎴栧琛屾嫾鎺ユ椂璺宠繃)
- if (data && !btn.$forbid && btn.Ot !== 'notRequired' && btn.Ot !== 'requiredOnce') {
+ if (data && btn.Ot !== 'notRequired' && btn.Ot !== 'requiredOnce') {
datavars = {...data, ...datavars}
const setField = (col) => {
@@ -1569,8 +1537,31 @@
_declarefields = ',' + _declarefields
}
_sql = `/* 绯荤粺鐢熸垚 */
- Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(50),@mk_organization nvarchar(50),@login_city nvarchar(50),@bid nvarchar(50),@ModularDetailCode nvarchar(50)${_declarefields}
+ Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50),@ModularDetailCode nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100),@bid nvarchar(50)${_declarefields}
`
+
+ let userName = sessionStorage.getItem('User_Name') || ''
+ let fullName = sessionStorage.getItem('Full_Name') || ''
+ let RoleID = sessionStorage.getItem('role_id') || ''
+ let departmentcode = sessionStorage.getItem('departmentcode') || ''
+ let organization = sessionStorage.getItem('organization') || ''
+ let mk_user_type = sessionStorage.getItem('mk_user_type') || ''
+ let nation = sessionStorage.getItem('nation') || ''
+ let province = sessionStorage.getItem('province') || ''
+ let city = sessionStorage.getItem('city') || ''
+ let district = sessionStorage.getItem('district') || ''
+ let address = sessionStorage.getItem('address') || ''
+
+ if (sessionStorage.getItem('isEditState') === 'true') {
+ userName = sessionStorage.getItem('CloudUserName') || ''
+ fullName = sessionStorage.getItem('CloudFullName') || ''
+ }
+
+ // 鍒濆鍖栧嚟璇佸強鐢ㄦ埛淇℃伅瀛楁
+ _sql += `
+ /* 鍑瘉鍙婄敤鎴蜂俊鎭垵濮嬪寲璧嬪�� */
+ select @BVoucher='',@FIBVoucherDate='',@FiYear='',@ErrorCode='',@retmsg='',@UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}', @BillCode='', @ModularDetailCode=''
+ `
// 琛ㄥ崟鍙橀噺璧嬪��
if (_initFormfields.length > 0) {
@@ -1600,24 +1591,6 @@
if (verify.billcodes) {
verify.billcodes = verify.billcodes.filter(item => item.status !== 'false')
}
-
- let userName = sessionStorage.getItem('User_Name') || ''
- let fullName = sessionStorage.getItem('Full_Name') || ''
- let RoleID = sessionStorage.getItem('role_id') || ''
- let departmentcode = sessionStorage.getItem('departmentcode') || ''
- let organization = sessionStorage.getItem('organization') || ''
- let city = sessionStorage.getItem('city') || ''
-
- if (sessionStorage.getItem('isEditState') === 'true') {
- userName = sessionStorage.getItem('CloudUserName') || ''
- fullName = sessionStorage.getItem('CloudFullName') || ''
- }
-
- // 鍒濆鍖栧嚟璇佸強鐢ㄦ埛淇℃伅瀛楁
- _sql += `
- /* 鍑瘉鍙婄敤鎴蜂俊鎭垵濮嬪寲璧嬪�� */
- select @BVoucher='',@FIBVoucherDate='',@FiYear='',@ErrorCode='',@retmsg='',@UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @login_city='${city}', @BillCode='', @ModularDetailCode=''
- `
if (retmsg) {
_callbacksql = _sql
@@ -1667,9 +1640,6 @@
}
})
regoptions.push({
- reg: new RegExp('@login_city@', 'ig'),
- value: `'${city}'`
- }, {
reg: new RegExp('@userName@', 'ig'),
value: `'${userName}'`
}, {
@@ -1989,11 +1959,14 @@
if (!_arr.includes('submitdate')) {
_form.push('submitdate=getdate()')
}
- if (!_arr.includes('submituserid')) {
- _form.push('submituserid=@userid@')
- }
if (!_arr.includes('submituser')) {
_form.push('submituser=@username')
+ }
+ if (!_arr.includes('submitstaff')) {
+ _form.push('submitstaff=@fullname')
+ }
+ if (!_arr.includes('submituserid')) {
+ _form.push('submituserid=@userid@')
}
} else {
if (!_arr.includes('modifydate')) {
@@ -2001,6 +1974,9 @@
}
if (!_arr.includes('modifyuser')) {
_form.push('modifyuser=@username')
+ }
+ if (!_arr.includes('modifystaff')) {
+ _form.push('modifystaff=@fullname')
}
if (!_arr.includes('modifyuserid')) {
_form.push('modifyuserid=@userid@')
@@ -2105,12 +2081,40 @@
aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg`
}
+ _sql = _sql.replace(/@ID@/ig, `'${primaryId || ''}'`)
+ _sql = _sql.replace(/@BID@/ig, `'${BID || ''}'`)
+ _sql = _sql.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`)
+ _sql = _sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`)
+ _sql = _sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`)
+ _sql = _sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
+
+ if (window.GLOB.breakpoint) {
+ let start = new RegExp('\\/\\*\\$breakpoint_begin_' + window.GLOB.breakpoint + '@', 'ig')
+ let end = new RegExp('@breakpoint_end_' + window.GLOB.breakpoint + '\\$\\*\\/', 'ig')
+
+ if (window.GLOB.breakpoint === 'all') {
+ start = /\/\*\$breakpoint_begin_[0-9a-z_]+@/ig
+ end = /@breakpoint_end_[0-9a-z_]+\$\*\//ig
+ }
+
+ _sql = _sql.replace(start, '').replace(end, '')
+ _sql += `
+ z_debug_end: select @ErrorCode='E',@retmsg='debug_end' goto aaa`
+ }
+
if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) {
// _sql = _sql.replace(/\n\s{8}/ig, '\n')
console.info(_sql)
}
if (retmsg) {
+ _callbacksql = _callbacksql.replace(/@ID@/ig, `'${primaryId || ''}'`)
+ _callbacksql = _callbacksql.replace(/@BID@/ig, `'${BID || ''}'`)
+ _callbacksql = _callbacksql.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`)
+ _callbacksql = _callbacksql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`)
+ _callbacksql = _callbacksql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`)
+ _callbacksql = _callbacksql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
+
return {
sql: _sql,
callbacksql: _callbacksql
@@ -2125,26 +2129,30 @@
*/
export function getMark (marks, record, style = {}) {
let icon = null
- let color = null
+ let innerStyle = null
let position = null
style = JSON.parse(JSON.stringify(style))
marks.some(mark => {
- let originVal = record[mark.field[0]] + ''
+ let originVal = record[mark.field[0]]
let contrastVal = ''
let result = false
if (mark.field[1] === 'static') {
- contrastVal = mark.contrastValue + ''
+ contrastVal = mark.contrastValue
} else {
- contrastVal = record[mark.field[2]] + ''
+ contrastVal = record[mark.field[2]]
}
+
+ if (originVal === undefined || contrastVal === undefined) return false
if (mark.match === '=') {
result = originVal === contrastVal
} else if (mark.match === '!=') {
result = originVal !== contrastVal
} else if (mark.match === 'like') {
+ originVal = originVal + ''
+ contrastVal = contrastVal + ''
result = originVal.indexOf(contrastVal) > -1
} else if (mark.match === '>') {
result = parseFloat(originVal) > parseFloat(contrastVal)
@@ -2158,20 +2166,24 @@
if (type === 'font') {
style.color = mark.color
+ innerStyle = {color: mark.color}
} else if (type === 'background') {
style.background = mark.color
if (mark.fontColor) {
style.color = mark.fontColor
+ innerStyle = {color: mark.fontColor}
}
} else if (type === 'underline') {
style.textDecoration = 'underline'
style.color = mark.color
+ innerStyle = {color: mark.color, textDecoration: 'underline'}
} else if (type === 'line-through') {
style.textDecoration = 'line-through'
style.color = mark.color
+ innerStyle = {color: mark.color, textDecoration: 'line-through'}
} else if (type.indexOf('icon') > -1) {
icon = mark.signType[mark.signType.length - 1]
- color = mark.color
+ innerStyle = {color: mark.color}
if (type === 'iconfront' || mark.signType[1] === 'front') {
position = 'front'
} else {
@@ -2185,7 +2197,7 @@
return {
style,
icon,
- color,
+ innerStyle,
position
}
}
--
Gitblit v1.8.0