Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue-gjjs
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
zhouqian
vue-gjjs
Commits
b17a39f6
Commit
b17a39f6
authored
Dec 29, 2021
by
fukai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善码表系列处理
parent
5fae7a01
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
154 additions
and
1 deletions
+154
-1
CodeLabel.vue
src/components/CodeLabel.vue
+138
-0
Select.vue
src/components/Select.vue
+13
-1
index.js
src/components/index.js
+3
-0
No files found.
src/components/CodeLabel.vue
0 → 100644
View file @
b17a39f6
<
template
>
<span
:id=
"id"
v-bind=
"$attrs"
v-on=
"$listeners"
v-html=
"label"
>
</span>
</
template
>
<
script
>
import
Api
from
"~/service/Api"
export
default
{
props
:
{
value
:
{
type
:
[
String
,
Array
,
Number
],
default
:
undefined
,
},
id
:
{
type
:
String
,
default
:
undefined
,
},
code
:
{
type
:
Array
,
default
:
function
()
{
return
[];
},
},
dbCode
:
{
type
:
String
,
default
:
undefined
,
},
},
data
(){
return
{
dbCodeList
:[],
}
},
watch
:{
//动态从服务器上渲染码表
dbCode
(){
if
(
!
this
.
dbCode
){
this
.
dbCodeList
=
[]
return
}
getDBCode
()
}
},
computed
:
{
mode
()
{
return
this
.
$store
.
state
.
Status
.
mode
;
},
isDisable
:
{
get
()
{
return
this
.
mode
===
"display"
||
this
.
disabled
;
},
},
highlight
()
{
return
this
.
$store
.
state
.
Status
.
highlights
.
indexOf
(
this
.
id
)
!==
-
1
;
},
attrs
()
{
if
(
this
.
mode
===
"display"
||
this
.
disabled
)
{
let
{
placeholder
,
...
rest
}
=
this
.
$attrs
;
rest
=
{
placeholder
:
" "
,
...
rest
};
return
rest
;
}
return
this
.
$attrs
;
},
combinCodes
(){
//取dbcode,和 setvalues的合集
if
(
!
this
.
dbCodeList
||
this
.
dbCodeList
.
length
==
0
){
return
[]
}
return
this
.
dbCodeList
.
filter
(
item
=>
{
if
(
this
.
code
&&
this
.
code
.
length
){
return
this
.
code
.
findIndex
(
item2
=>
item
.
value
==
item2
.
value
)
>-
1
}
return
true
})
},
label
(){
if
(
!
this
.
value
){
return
""
}
if
(
this
.
dbCode
&&
this
.
dbCodeList
&&
this
.
dbCodeList
.
length
>
0
){
let
em
=
this
.
combinCodes
.
find
(
item
=>
item
.
value
==
this
.
value
)
if
(
em
){
return
em
.
label
}
else
{
return
this
.
value
}
}
if
(
this
.
code
&&
this
.
code
.
length
){
let
em
=
this
.
code
.
find
(
item
=>
item
.
value
==
this
.
value
)
if
(
em
){
return
em
.
label
}
else
{
return
this
.
value
}
}
return
this
.
value
}
},
methods
:
{
handleClick
:
function
(
e
)
{
let
ev
=
new
Event
(
"click"
,
{
bubbles
:
true
});
let
node
=
e
.
target
;
if
(
node
.
parentElement
)
{
node
.
parentElement
.
dispatchEvent
(
ev
);
}
},
getDBCode
(){
let
args
=
{
tbl
:
this
.
dbCode
,
lang
:
this
.
$store
.
state
.
I18n
.
lang
.
toUpperCase
()}
if
(
args
.
lang
==
"ZH"
){
args
.
lang
=
"CN"
;
}
Api
.
post
(
"getCodetable"
,
args
).
then
(
rtnmsg
=>
{
if
(
rtnmsg
.
respCode
==
SUCCESS
){
this
.
dbCodeList
=
rtnmsg
.
data
}
})
}
},
mounted
(){
if
(
this
.
dbCode
){
this
.
getDBCode
()
}
}
};
</
script
>
<
style
>
/* .el-select.highlight .el-input .el-input__inner {
border-color: red;
} */
</
style
>
\ No newline at end of file
src/components/Select.vue
View file @
b17a39f6
...
...
@@ -10,7 +10,7 @@
>
<template
v-if=
"dbCodeList && dbCodeList.length > 0"
>
<el-option
v-for=
"item in
dbCodeList
"
v-for=
"item in
combinCodes
"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
...
...
@@ -106,6 +106,18 @@ export default {
}
return
this
.
$attrs
;
},
combinCodes
(){
//取dbcode,和 setvalues的合集
if
(
!
this
.
dbCodeList
||
this
.
dbCodeList
.
length
==
0
){
return
[]
}
return
this
.
dbCodeList
.
filter
(
item
=>
{
if
(
this
.
code
&&
this
.
code
.
length
){
return
this
.
code
.
findIndex
(
item2
=>
item
.
value
==
item2
.
value
)
>-
1
}
return
true
})
}
},
methods
:
{
handleClick
:
function
(
e
)
{
...
...
src/components/index.js
View file @
b17a39f6
...
...
@@ -32,6 +32,7 @@ import HighlightContent from "./HighlightContent"
import
SearchInput
from
"./SearchInput.vue"
import
FormItem
from
"./FormItem.vue"
import
TableColumnItem
from
"./TableColumnItem.vue"
import
CodeLabel
from
"./CodeLabel"
// 循环组件
import
MessageArea
from
'~/widget/SwfMessage/MessageArea'
import
CycList
from
'~/widget/SwfMessage/CycList'
...
...
@@ -93,5 +94,6 @@ export default {
Vue
.
component
(
"c-function-btn"
,
FunctionBtn
)
Vue
.
component
(
"c-bus-button"
,
BusinessButon
)
Vue
.
component
(
"c-infsearch-group"
,
InfSearchGroup
)
Vue
.
component
(
"c-codelabel"
,
CodeLabel
)
}
}
\ No newline at end of file
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