From 325aa13d3b61d1c066f8fcab107003ef36713df3 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 16 一月 2025 10:20:09 +0800 Subject: [PATCH] 2025-01-16 --- src/tabviews/custom/components/card/cardcellList/index.jsx | 136 ++++++++++++++++++++++++--------------------- 1 files changed, 73 insertions(+), 63 deletions(-) diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index 2924236..9ebf5c9 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -4,7 +4,7 @@ import { Col, Tooltip, notification, Typography, message } from 'antd' import moment from 'moment' -// import Api from '@/api' +import Api from '@/api' import asyncComponent from '@/utils/asyncComponent' import { getMark } from '@/utils/utils.js' import MkIcon from '@/components/mk-icon' @@ -110,7 +110,7 @@ } if (card.field) { - __param.$searchkey = card.field.toLowerCase() + __param.$searchkey = card.field __param.$searchval = data[card.field] || '' } @@ -162,71 +162,78 @@ } // positecgroup - // if (/^sso$/ig.test(url)) { - // if (!data.LinkUrl1) { - // notification.warning({ - // top: 92, - // message: '閾炬帴鍦板潃涓嶅瓨鍦紒', - // duration: 5 - // }) - // return - // } + if (/^sso$/ig.test(url)) { + if (!data.LinkUrl1) { + notification.warning({ + top: 92, + message: '閾炬帴鍦板潃涓嶅瓨鍦紒', + duration: 5 + }) + return + } - // let _url = data.LinkUrl1 - // if (/index\.html/ig.test(_url)) { - // _url = _url.replace(/index\.html.*/ig, '') - // } else if (!/\/$/ig.test(_url)) { - // _url = _url + '/' - // } + let _url = data.LinkUrl1 + if (/index\.html/ig.test(_url)) { + _url = _url.replace(/index\.html.*/ig, '') + } else if (!/\/$/ig.test(_url)) { + _url = _url + '/' + } - // let key = (() => { - // let uuid = [] - // let timestamp = new Date().getTime() - // let _options = '0123456789abcdefghigklmnopqrstuv' - // for (let i = 0; i < 19; i++) { - // uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1)) - // } - // uuid = timestamp + uuid.join('') - // return uuid - // })() + let key = (() => { + let uuid = [] + let timestamp = new Date().getTime() + let _options = '0123456789abcdefghigklmnopqrstuv' + for (let i = 0; i < 19; i++) { + uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1)) + } + uuid = timestamp + uuid.join('') + return uuid + })() - // let _param = { - // func: 'webapi_scan_binding_key', - // binding_type: 'mk', - // scan_type: 'toggle', - // scan_appkey: data.scan_appkey || '', - // id: key - // } + let _param = { + func: 'webapi_scan_binding_key', + binding_type: 'mk', + scan_type: 'toggle', + scan_appkey: data.scan_appkey || '', + id: key + } - // Api.getSystemConfig(_param).then(res => { - // if (!res.status) { - // notification.warning({ - // top: 92, - // message: res.message, - // duration: 5 - // }) - // } else if (res.thd_party_appid && res.thd_party_member_id && res.thd_party_openid) { - // let href = _url + 'admin/index.html#/ssologin/' + window.btoa(window.encodeURIComponent(JSON.stringify({ - // appid: res.thd_party_appid, - // memberId: res.thd_party_member_id, - // openid: res.thd_party_openid, - // key: key - // }))) - - // window.open(href) - // } else { - // notification.warning({ - // top: 92, - // message: '淇℃伅缂哄け锛岃鑱旂郴绠$悊鍛橈紒', - // duration: 5 - // }) - // } - // }) - // return - // } + Api.getSystemConfig(_param).then(res => { + if (!res.status) { + notification.warning({ + top: 92, + message: res.message, + duration: 5 + }) + } else if (res.thd_party_appid && res.thd_party_member_id && res.thd_party_openid) { + let href = _url + 'admin/index.html#/ssologin/' + window.btoa(window.encodeURIComponent(JSON.stringify({ + appid: res.thd_party_appid, + memberId: res.thd_party_member_id, + openid: res.thd_party_openid, + key: key + }))) + window.open(href) + } else { + notification.warning({ + top: 92, + message: '淇℃伅缂哄け锛岃鑱旂郴绠$悊鍛橈紒', + duration: 5 + }) + } + }) + return + } - if (/^http.+(.txt|.doc|.docx|.pdf|.xlsx|.xls|.zip|.rar|.ppt)$/i.test(url)) { - let name = url.replace(/.+\//g, '').replace(/\.{1}[^.]*$/g, '') + if (/^http.+(.txt|.doc|.docx|.pdf|.xlsx|.xls|.zip|.rar|.ppt)$/i.test(url) || card.linkType === 'download') { + let name = '' + if (card.datatype === 'static') { + name = card.value || '' + } else if (data.hasOwnProperty(card.field)) { + name = data[card.field] + '' + } + name = name.replace(/\.{1}[^.]*$/g, '') + name = name ? name + url.replace(/.+\./g, '.') : '' + let d = document.createElement('a') d.href = url d.setAttribute('download', name) @@ -728,6 +735,7 @@ } } else { url = data[card.field] || '' + url = url.replace(/@mywebsite@\//ig, window.GLOB.baseurl) } if (url === '' && card.noValue === 'hide') { // 绌哄�奸殣钘� @@ -979,6 +987,8 @@ if (key === 'children') return if (/^1949-10-01/.test(data[key])) { _data[key.toLowerCase()] = '' + } else if (/\d{4}-\d{2}-\d{2}\s00:00:00/.test(data[key])) { + _data[key.toLowerCase()] = data[key].replace(/\s00:00:00/g, '') } else { _data[key.toLowerCase()] = data[key] } @@ -1042,7 +1052,7 @@ if (val !== '') { if (val && typeof(val) === 'string') { if (!card.evalchars || card.evalchars.includes('enter')) { - val = val.replace(/\n/ig, '<br/>') + val = val.replace(/\\n|\n/ig, '<br/>') } if ((!card.evalchars || card.evalchars.includes('space')) && !/<(span|div|p|a|img)\s/g.test(val)) { val = val.replace(/\s/ig, ' ') -- Gitblit v1.8.0