Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
seeta-device
/
deviceManage
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8ca80d42
authored
Aug 23, 2021
by
温丽香
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
base64校验
1 parent
a5163c49
Pipeline
#3534
passed
in 1 minute 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
34 deletions
src/components/dialog.vue
src/views/DataList/edit.vue
src/views/ParamsModel/index.vue
src/components/dialog.vue
View file @
8ca80d4
...
...
@@ -10,12 +10,13 @@
//- body
.confirm-body(slot="body")
//- span.dialog-icon.iconfont(:class="[mode, iconClass]")
.title
//-
.title
span.dialog-icon.iconfont(:class="[mode, iconClass]")
span.text
{{
title
}}
p.caption(v-if="message")
//- 支持html格式
span(v-html="message")
{{
message
}}
i.el-icon-warning(style="color: #F6AD3D;font-size: 22px;margin-right: 10px;float:left")
span(v-html="message" style="height: 22px;line-height: 22px")
{{
message
}}
.options(v-if="options && options.length")
.option(v-for="option in options")
...
...
@@ -170,7 +171,7 @@ export default {
.
caption
color
:
#4C4C4C
font-size
:
14px
margin-top
:
20px
//
margin-top
:
20px
color
:
$
--color-text-regular
.
options
margin-top
:
15px
...
...
src/views/DataList/edit.vue
View file @
8ca80d4
...
...
@@ -39,11 +39,11 @@
<span
style=
"margin-left: 12px"
>
{{
scope
.
row
.
field
}}
</span>
</
template
>
</el-table-column>
<el-table-column
v-for=
"(column, index) in tableData[0].columns"
:key=
"index"
:label=
"`列${index + 1}`"
:width=
"index + 1 === columnIndex ? '220px' : ''"
>
<el-table-column
v-for=
"(column, index) in tableData[0].columns"
:key=
"index"
:label=
"`列${index + 1}`"
:
min-
width=
"index + 1 === columnIndex ? '220px' : ''"
>
<
template
slot-scope=
"scope"
>
<!--
<div
class=
"column-box"
>
-->
<div
style=
"display: flex"
>
<pack-select
v-model=
"scope.row.columns[index].type"
@
blur=
"handleBlur"
placeholder=
"请选择"
class=
"none-display"
style=
"margin-right: 10px"
>
<pack-select
v-model=
"scope.row.columns[index].type"
@
blur=
"handleBlur"
@
change=
"value => handleTypeChange(value, scope.row.columns[index])"
placeholder=
"请选择"
class=
"none-display"
style=
"margin-right: 10px"
>
<el-option
v-for=
"item in typeOptions"
:key=
"item.value"
...
...
@@ -51,7 +51,10 @@
:value=
"item.value"
>
</el-option>
</pack-select>
<input
type=
"text"
v-model=
"scope.row.columns[index].value"
@
blur=
"handleBlur"
placeholder=
"请输入"
class=
"cell-value"
>
<input
type=
"text"
v-model=
"scope.row.columns[index].value"
@
blur=
"handleBlur"
placeholder=
"请输入"
class=
"cell-value"
:style=
"
{border: scope.row.columns[index].type === 'base64'
&&
!base64Pattern.test(scope.row.columns[index].value) ? '1px solid #F56C6C' : 'none'}"
@input="event => checkBase64(event.target, scope.row.columns[index])"
@focus="event => handleFocus(event.target, scope.row.columns[index])">
<!--
<el-select
v-model=
"scope.row.columns[index].type"
placeholder=
"请选择"
>
<el-option
v-for=
"item in typeOptions"
...
...
@@ -108,50 +111,52 @@ export default {
tableData
:
[{
field
:
'1'
,
columns
:
[
{
type
:
'base64'
,
value
:
'122'
},
{
type
:
'string'
,
value
:
'122'
},
{
type
:
'base64'
,
value
:
'122'
},
{
type
:
'string'
,
value
:
'122'
},
{
type
:
'base64'
,
value
:
'122'
},
{
type
:
'string'
,
value
:
'122'
},
{
type
:
'base64'
,
value
:
'122'
}
{
type
:
'base64'
,
value
:
'122
2
'
},
{
type
:
'string'
,
value
:
'122
2
'
},
{
type
:
'base64'
,
value
:
'122
2
'
},
{
type
:
'string'
,
value
:
'122
2
'
},
{
type
:
'base64'
,
value
:
'122
2
'
},
{
type
:
'string'
,
value
:
'122
2
'
},
{
type
:
'base64'
,
value
:
'122
2
'
}
]
},
{
field
:
'2'
,
columns
:
[
{
type
:
'base64'
,
value
:
'122'
},
{
type
:
'string'
,
value
:
'122'
},
{
type
:
'base64'
,
value
:
'122'
},
{
type
:
'string'
,
value
:
'122'
},
{
type
:
'base64'
,
value
:
'122'
},
{
type
:
'string'
,
value
:
'122'
},
{
type
:
'base64'
,
value
:
'122'
}
{
type
:
'base64'
,
value
:
'122
2
'
},
{
type
:
'string'
,
value
:
'122
2
'
},
{
type
:
'base64'
,
value
:
'122
2
'
},
{
type
:
'string'
,
value
:
'122
2
'
},
{
type
:
'base64'
,
value
:
'122
2
'
},
{
type
:
'string'
,
value
:
'122
2
'
},
{
type
:
'base64'
,
value
:
'122
2
'
}
]
},
{
field
:
'3'
,
columns
:
[
{
type
:
'base64'
,
value
:
'122'
},
{
type
:
'string'
,
value
:
'122'
},
{
type
:
'base64'
,
value
:
'122'
},
{
type
:
'string'
,
value
:
'122'
},
{
type
:
'base64'
,
value
:
'122'
},
{
type
:
'string'
,
value
:
'122'
},
{
type
:
'base64'
,
value
:
'122'
}
{
type
:
'base64'
,
value
:
'122
2
'
},
{
type
:
'string'
,
value
:
'122
2
'
},
{
type
:
'base64'
,
value
:
'122
2
'
},
{
type
:
'string'
,
value
:
'122
2
'
},
{
type
:
'base64'
,
value
:
'122
2
'
},
{
type
:
'string'
,
value
:
'122
2
'
},
{
type
:
'base64'
,
value
:
'122
2
'
}
]
},
{
field
:
'4'
,
columns
:
[
{
type
:
'base64'
,
value
:
'上海市普陀上海市普陀'
},
{
type
:
'string'
,
value
:
'上海市普陀上海市普陀'
},
{
type
:
'base64'
,
value
:
'122'
},
{
type
:
'base64'
,
value
:
'122'
},
{
type
:
'string'
,
value
:
'122'
},
{
type
:
'string'
,
value
:
'122'
},
{
type
:
'base64'
,
value
:
'上海市普陀上海市普陀'
}
{
type
:
'string'
,
value
:
'上海市普陀上海市普陀'
},
{
type
:
'base64'
,
value
:
'1222'
},
{
type
:
'base64'
,
value
:
'1222'
},
{
type
:
'string'
,
value
:
'1222'
},
{
type
:
'string'
,
value
:
'1222'
},
{
type
:
'string'
,
value
:
'上海市普陀上海市普陀'
}
]
}],
total
:
34
,
agoCell
:
null
,
currentInput
:
null
,
base64Pattern
:
/^
([
A-Za-z0-9+
/]{4})
*
([
A-Za-z0-9+
/]{4}
|
[
A-Za-z0-9+
/]{3}
=|
[
A-Za-z0-9+
/]{2}
==
)
$/
,
flexHeight
:
0
,
columnIndex
:
0
}
...
...
@@ -168,7 +173,26 @@ export default {
}
},
methods
:
{
handleTypeChange
(
value
,
param
)
{
this
.
checkBase64
(
this
.
currentInput
,
param
)
},
handleFocus
(
target
,
param
)
{
this
.
currentInput
=
target
this
.
checkBase64
(
this
.
currentInput
,
param
)
},
checkBase64
(
target
,
param
)
{
if
(
param
.
type
===
'string'
)
{
target
.
style
.
border
=
'none'
return
}
if
(
!
this
.
base64Pattern
.
test
(
param
.
value
))
{
target
.
style
.
border
=
'1px solid #F56C6C'
}
else
{
target
.
style
.
border
=
'none'
}
},
cancel
()
{
// this.getData() 取消后所有修改都撤销
this
.
clearCell
(
this
.
agoCell
)
this
.
setCurrent
()
},
...
...
src/views/ParamsModel/index.vue
View file @
8ca80d4
...
...
@@ -91,7 +91,7 @@ export default {
{
label
:
'操作'
,
type
:
'slot'
,
width
:
'
15
0px'
,
width
:
'
20
0px'
,
slotName
:
'operate'
},
],
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment