Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
emport-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘泽志
emport-web
Commits
88fca213
Commit
88fca213
authored
Feb 13, 2023
by
刘泽志
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
最终版本
parent
a9c80479
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
187 additions
and
0 deletions
+187
-0
Emport.js
src/api/emport/Emport.js
+41
-0
StringUtil.js
src/utils/document/StringUtil.js
+4
-0
index.vue
src/views/emport/emport/index.vue
+0
-0
ArraySelect.vue
src/views/emport/rule/ArraySelect.vue
+142
-0
No files found.
src/api/emport/Emport.js
View file @
88fca213
...
...
@@ -462,3 +462,44 @@ export function getAllTemplateRule(templateId) {
params
:{
templateId
}
})
}
/**
* 新增规则
* @param data
* @returns {*}
*/
export
function
addRuleByTemplate
(
data
)
{
return
request
({
url
:
`
${
prefix
}
/rule/template`
,
method
:
'post'
,
data
})
}
/**
* 修改规则
* @param data
* @returns {*}
*/
export
function
updateRuleByTemplate
(
data
)
{
return
request
({
url
:
`
${
prefix
}
/rule/template`
,
method
:
'put'
,
data
})
}
/**
* 删除规则
* @param ruleId
* @param templateId
* @returns {*}
*/
export
function
deleteRuleByTemplate
(
ruleId
,
templateId
)
{
return
request
({
url
:
`
${
prefix
}
/rule/template`
,
method
:
'delete'
,
params
:{
ruleId
,
templateId
}
})
}
src/utils/document/StringUtil.js
View file @
88fca213
...
...
@@ -31,4 +31,8 @@ export default class StringUtil {
return
!
this
.
isEmpty
(
item
)
}).
join
(
" - "
)
}
static
mergeRule
(
code
,
title
){
return
`
${
code
}
(
${
title
?
title
:
''
}
)`
}
}
src/views/emport/emport/index.vue
View file @
88fca213
This diff is collapsed.
Click to expand it.
src/views/emport/rule/ArraySelect.vue
0 → 100644
View file @
88fca213
<
template
>
<div>
<i
class=
"el-icon-circle-plus-outline"
style=
"cursor: pointer"
@
click=
"addFirst"
></i>
<div
v-for=
"(item,index) in arr1"
>
<el-select
:value=
"item"
:value-key=
"config.value"
filterable
size=
"small"
@
change=
"(v)=>doSelectFirst(v,index)"
>
<el-option
v-for=
"item in data"
:key=
"item[config.value]"
:label=
"item[config.label]"
:value=
"item[config.value]+''"
>
<el-tooltip
:disabled=
"item[config.label].length
<
17
"
placement=
"top"
>
<div
slot=
"content"
>
<span>
{{
item
[
config
.
label
]
}}
</span>
</div>
<div
style=
"max-width: 500px;"
>
{{
item
[
config
.
label
]
}}
</div>
</el-tooltip>
</el-option>
</el-select>
<i
class=
"el-icon-remove-outline"
style=
"cursor: pointer;margin-left: 4px"
@
click=
"removeFirst(index)"
></i>
</div>
<el-divider
class=
"divider"
/>
<i
class=
"el-icon-circle-plus-outline"
style=
"cursor: pointer"
@
click=
"addSecond"
></i>
<div
v-for=
"(item,index) in arr2"
>
<el-select
:key=
"item"
:value=
"item"
:value-key=
"config.value"
filterable
size=
"small"
@
change=
"(v)=>doSelectSecond(v,index)"
>
<el-option
v-for=
"item in data"
:key=
"item[config.value]"
:label=
"item[config.label]"
:value=
"item[config.value]+''"
>
<el-tooltip
:disabled=
"item[config.label].length
<
17
"
placement=
"top"
>
<div
slot=
"content"
>
<span>
{{
item
[
config
.
label
]
}}
</span>
</div>
<div
style=
"max-width: 500px;"
>
{{
item
[
config
.
label
]
}}
</div>
</el-tooltip>
</el-option>
</el-select>
<i
class=
"el-icon-remove-outline"
style=
"cursor: pointer;margin-left: 4px"
@
click=
"removeSecond(index)"
></i>
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
'ArraySelect'
,
props
:
{
data
:
{
type
:
Array
,
default
:
()
=>
[]
},
value
:
{
type
:
String
,
default
:
''
},
config
:
{
type
:
Object
,
default
:
()
=>
{
return
{
label
:
'label'
,
value
:
'value'
}
}
}
},
model
:
{
prop
:
'value'
,
event
:
'changeValue'
},
computed
:
{
arr1
()
{
let
split
=
this
.
value
.
split
(
'='
)
if
(
split
&&
split
.
length
>
0
)
{
return
split
[
0
].
split
(
','
)
}
return
[]
},
arr2
()
{
let
split
=
this
.
value
.
split
(
'='
)
if
(
split
&&
split
.
length
>
1
)
{
return
split
[
1
].
split
(
','
)
}
return
[]
}
},
methods
:
{
addFirst
()
{
let
split
=
this
.
value
.
split
(
'='
)
if
(
split
.
length
===
1
)
{
this
.
$emit
(
'changeValue'
,
split
[
0
]
+
',='
)
}
else
if
(
split
.
length
===
2
)
{
this
.
$emit
(
'changeValue'
,
split
[
0
]
+
',='
+
split
[
1
])
}
this
.
$forceUpdate
()
},
addSecond
()
{
let
split
=
this
.
value
.
split
(
'='
)
if
(
split
.
length
===
1
)
{
this
.
$emit
(
'changeValue'
,
split
[
0
]
+
'='
)
}
else
if
(
split
.
length
===
2
)
{
this
.
$emit
(
'changeValue'
,
split
[
0
]
+
'='
+
split
[
1
]
+
','
)
}
this
.
$forceUpdate
()
},
doSelectFirst
(
value
,
index
)
{
let
split
=
this
.
value
.
split
(
'='
)
let
arr
=
split
[
0
].
split
(
','
)
arr
[
index
]
=
value
this
.
$emit
(
'changeValue'
,
arr
.
join
(
','
)
+
'='
+
split
[
1
]
)
this
.
$forceUpdate
()
},
doSelectSecond
(
value
,
index
)
{
let
split
=
this
.
value
.
split
(
'='
)
let
arr
=
split
[
1
].
split
(
','
)
arr
[
index
]
=
value
this
.
$emit
(
'changeValue'
,
split
[
0
]
+
'='
+
arr
.
join
(
','
))
this
.
$forceUpdate
()
},
removeFirst
(
index
){
let
split
=
this
.
value
.
split
(
'='
)
let
arr
=
split
[
0
].
split
(
','
)
arr
.
splice
(
index
,
1
)
this
.
$emit
(
'changeValue'
,
arr
.
join
(
','
)
+
'='
+
split
[
1
]
)
this
.
$forceUpdate
()
},
removeSecond
(
index
){
let
split
=
this
.
value
.
split
(
'='
)
let
arr
=
split
[
1
].
split
(
','
)
arr
.
splice
(
index
,
1
)
this
.
$emit
(
'changeValue'
,
split
[
0
]
+
'='
+
arr
.
join
(
','
))
this
.
$forceUpdate
()
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.divider
{
margin
:
8px
;
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment