Commit 61a25949 authored by 田翔's avatar 田翔

fix: 文本多行文本富文本支持识别网址跳转

parent b767a194
{
"name": "panda-xform",
"version": "6.0.31",
"description": "6.0.31 地址控件不回显问题",
"version": "6.0.32",
"description": "6.0.32 文本多行文本富文本支持识别网址跳转",
"keywords": [
"panda-xform"
],
......
import React, { useState, useEffect, useMemo } from 'react'
import { Input } from 'antd'
import styles from './index.less'
import { urlRegExp } from '../../../../utils'
const TextArea = (props) => {
......@@ -14,11 +16,14 @@ const TextArea = (props) => {
}
}, [presetValue])
const handleChange = (e) => {
onChange(e.target.value)
}
if (disabled && urlRegExp.test(value)) {
return <div className={styles.areaUrl} onClick={() => window.open(value)}>{value}</div>
}
return (
<Input.TextArea
maxLength={maxLength}
......
.areaUrl {
color: #1890ff;
padding: 4px 11px;
background: #f8fafc;
min-height: 90px;
&:hover {
color: #0a7fec;
cursor: pointer;
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import Icon, { PlusOutlined } from '@ant-design/icons'
import * as icons from '@ant-design/icons'
import { GetFieldValueFromTable, getUserName, getGroupName } from '../../../../apis/process'
import styles from './index.less'
import { urlRegExp } from '../../../../utils'
const iconList = Object.keys(icons).filter((item) => typeof icons[item] === 'object')
const initUserInfo = {
......@@ -151,8 +152,12 @@ const TextInput = (props) => {
}
}, [otherValue])
if (disabled && urlRegExp.test(showValue)) {
return <div className={styles.textUrl} onClick={() => window.open(showValue)}>{showValue}</div>
}
return (
<div className={styles.textInput} isdisabled={JSON.stringify(disabled)}>
<div className={styles.textInput} isdisabled={JSON.stringify(disabled)} >
<Input
style={{ color: loaclPaths.includes(presetValue) ? 'blue' : '' }}
disabled={disabled}
......
......@@ -5,4 +5,14 @@
border: 1px solid #e9e9e9;
}
}
}
.textUrl {
color: #1890ff;
padding: 4px 11px;
background: #f8fafc;
&:hover {
color: #0a7fec;
cursor: pointer;
}
}
\ No newline at end of file
......@@ -321,4 +321,6 @@ export const getFieldInfo = (formJson) => {
}
}
return obj
}
\ No newline at end of file
}
export const urlRegExp = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&amp;'\*\+,;=.]+$/
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment