Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
T
TrainSys
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
苏州培训方案
TrainSys
提交
e46f2924
提交
e46f2924
编写于
3月 17, 2025
作者:
张平川
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 新增输入框xss文本过滤功能
上级
c31751e6
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
18 行增加
和
3 行删除
+18
-3
package.json
app_Web/package.json
+2
-1
ibiz-input.tsx
.../src/components/editor/text-box/ibiz-input/ibiz-input.tsx
+16
-2
未找到文件。
app_Web/package.json
浏览文件 @
e46f2924
...
@@ -35,7 +35,8 @@
...
@@ -35,7 +35,8 @@
"vite-plugin-style-import"
:
"1.4.1"
,
"vite-plugin-style-import"
:
"1.4.1"
,
"vue"
:
"^2.7.15"
,
"vue"
:
"^2.7.15"
,
"vue-router"
:
"^3.6.5"
,
"vue-router"
:
"^3.6.5"
,
"vue-text-format"
:
"^3.1.2"
"vue-text-format"
:
"^3.1.2"
,
"xss"
:
"^1.0.15"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"@commitlint/cli"
:
"^17.3.0"
,
"@commitlint/cli"
:
"^17.3.0"
,
...
...
app_Web/src/components/editor/text-box/ibiz-input/ibiz-input.tsx
浏览文件 @
e46f2924
...
@@ -6,6 +6,7 @@ import {
...
@@ -6,6 +6,7 @@ import {
useNamespace
,
useNamespace
,
}
from
'@ibiz-template/vue-util'
;
}
from
'@ibiz-template/vue-util'
;
import
'@ibiz-template/theme/style/components/editor/ibiz-input/ibiz-input.scss'
;
import
'@ibiz-template/theme/style/components/editor/ibiz-input/ibiz-input.scss'
;
import
xss
from
'xss'
;
const
fomatFloat
=
function
(
value
:
number
,
n
:
number
)
{
const
fomatFloat
=
function
(
value
:
number
,
n
:
number
)
{
const
f
=
value
;
const
f
=
value
;
...
@@ -74,6 +75,19 @@ export const IBizInput = defineComponent({
...
@@ -74,6 +75,19 @@ export const IBizInput = defineComponent({
}
}
const
currentVal
=
ref
<
string
>
(
''
);
const
currentVal
=
ref
<
string
>
(
''
);
const
getInputValue
=
(
value
:
string
|
number
)
=>
{
if
(
type
.
value
===
'number'
||
!
ibiz
.
config
.
enableXSS
)
{
return
value
;
}
const
result
=
xss
(
value
as
string
);
if
(
result
!==
value
)
{
currentVal
.
value
=
result
;
inputRef
.
value
?.
setCurrentValue
?.(
result
);
ibiz
.
message
.
warning
(
'输入值存在不规范格式,已自动调整!'
);
}
return
result
;
};
watch
(
watch
(
()
=>
props
.
value
,
()
=>
props
.
value
,
(
newVal
,
oldVal
)
=>
{
(
newVal
,
oldVal
)
=>
{
...
@@ -96,7 +110,7 @@ export const IBizInput = defineComponent({
...
@@ -96,7 +110,7 @@ export const IBizInput = defineComponent({
(
e
:
IData
)
=>
{
(
e
:
IData
)
=>
{
// 拦截掉blur触发后change
// 拦截掉blur触发后change
if
(
blurCacheValue
!==
e
.
target
.
value
)
{
if
(
blurCacheValue
!==
e
.
target
.
value
)
{
emit
(
'change'
,
e
.
target
.
value
);
emit
(
'change'
,
getInputValue
(
e
.
target
.
value
)
);
}
}
blurCacheValue
=
undefined
;
blurCacheValue
=
undefined
;
isDebounce
=
false
;
isDebounce
=
false
;
...
@@ -156,7 +170,7 @@ export const IBizInput = defineComponent({
...
@@ -156,7 +170,7 @@ export const IBizInput = defineComponent({
inputRef
.
value
?.
setCurrentValue
?.(
number
);
inputRef
.
value
?.
setCurrentValue
?.(
number
);
emit
(
'change'
,
number
);
emit
(
'change'
,
number
);
}
else
{
}
else
{
emit
(
'change'
,
blurCacheValue
);
emit
(
'change'
,
getInputValue
(
blurCacheValue
as
string
)
);
}
}
};
};
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录