Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TF-MOM-WEB
Project
Project
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
TFMOM
TF-MOM-WEB
Commits
f0fda03e
Commit
f0fda03e
authored
Apr 22, 2024
by
jingnan
👀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
架次关联站位编号组件修改
parent
f996da98
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
212 additions
and
4 deletions
+212
-4
index.vue
...ivateComponents/components/GeneralLinkageSelect/index.vue
+142
-0
config.js
.../src/privateComponents/components/StationSelect/config.js
+41
-0
index.vue
.../src/privateComponents/components/StationSelect/index.vue
+29
-4
No files found.
applications/dee-mes/src/privateComponents/components/GeneralLinkageSelect/index.vue
0 → 100644
View file @
f0fda03e
<
template
>
<div
class=
"generalLinkageSelect-select"
>
<el-select
ref=
"selectCom"
v-model=
"selVal"
placeholder=
"请选择"
size=
"mini"
:disabled=
"disabledVal"
@
change=
"changeVal"
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</div>
</
template
>
<
script
>
import
http
from
'@/utils/http'
import
config
from
'./config'
import
_get
from
'lodash.get'
export
default
{
componentName
:
'通用联动属性配置'
,
name
:
'GeneralLinkageSelectSelect'
,
// name写在组件的最前方,自定义组件为必填
components
:
{},
mixins
:
[
config
],
props
:
{
item
:
{
type
:
Object
,
default
:
()
=>
{
return
{}
}
},
form
:
{
type
:
Object
,
default
:
()
=>
{}
},
middleForm
:
{
type
:
Object
,
default
:
()
=>
{}
},
value
:
{
type
:
[
Number
,
String
,
Object
],
default
:
()
=>
''
}
},
data
()
{
return
{
options
:
[],
selVal
:
''
,
disabledVal
:
false
,
linkageValue
:
''
}
},
computed
:
{},
watch
:
{
form
:
{
immediate
:
true
,
deep
:
true
,
handler
(
val
)
{
if
(
val
)
{
if
(
!
this
.
item
.
linkageAttr
)
{
return
}
const
_val
=
_get
(
this
.
form
,
this
.
item
.
linkageAttr
)
if
(
_val
!==
this
.
linkageValue
)
{
this
.
options
=
[]
this
.
selVal
=
''
this
.
linkageValue
=
_val
this
.
getData
(
_val
)
}
}
}
},
item
:
{
immediate
:
true
,
deep
:
true
,
handler
(
v
)
{
if
(
v
.
component
.
hasOwnProperty
(
'disabled'
))
{
this
.
disabledVal
=
v
.
component
.
disabled
}
}
},
value
:
{
immediate
:
true
,
deep
:
true
,
handler
(
v
)
{
if
(
v
)
{
this
.
selVal
=
this
.
value
}
}
}
},
created
()
{
// 初始化数据
},
methods
:
{
getData
(
val
)
{
var
requestURL
=
''
var
requestParameters
=
{}
if
(
this
.
item
.
requestURL
)
{
try
{
let
fun
eval
(
`fun = function (obtainedParams, functionParams){
${
this
.
item
.
requestURL
}
}`
)
// eslint-disable-line
fun
.
apply
(
this
)
// eslint-disable-line
}
catch
(
error
)
{
console
.
error
(
error
)
}
}
if
(
this
.
item
.
requestParameters
)
{
try
{
let
fun1
eval
(
`fun1 = function (obtainedParams, functionParams){
${
this
.
item
.
requestParameters
}
}`
)
// eslint-disable-line
fun1
.
apply
(
this
)
// eslint-disable-line
}
catch
(
error
)
{
console
.
error
(
error
)
}
}
http
[
this
.
item
.
requestMethod
](
requestURL
,
requestParameters
).
then
(
res
=>
{
let
responseData
=
[]
if
(
this
.
item
.
formateResponse
)
{
try
{
let
fun2
eval
(
`fun2 = function (obtainedParams, functionParams){
${
this
.
item
.
formateResponse
}
}`
)
// eslint-disable-line
fun2
.
apply
(
this
)
// eslint-disable-line
}
catch
(
error
)
{
console
.
error
(
error
)
}
}
else
{
responseData
=
res
.
items
.
content
.
map
(
row
=>
{
return
{
value
:
row
.
id
,
label
:
row
.
name
}
})
}
this
.
options
=
responseData
})
},
changeVal
()
{
this
.
$emit
(
'input'
,
this
.
selVal
)
}
}
}
</
script
>
<
style
lang=
'scss'
>
</
style
>
applications/dee-mes/src/privateComponents/components/StationSelect/config.js
0 → 100644
View file @
f0fda03e
export
default
{
props
:
{},
layoutConfigData
:
[
{
title
:
'高级组件配置'
,
data
:
[
{
key
:
'bindKey'
,
title
:
'绑定属性'
,
disabled
:
true
,
component
:
{
defaultValue
:
'positionNumber'
,
name
:
'el-input'
}
},
{
key
:
'relatedAttribute'
,
title
:
'受关联属性'
,
disabled
:
true
,
component
:
{
defaultValue
:
''
,
name
:
'el-input'
}
}
]
}
],
data
()
{
return
{
}
},
created
()
{
},
computed
:
{
},
methods
:
{
}
}
applications/dee-mes/src/privateComponents/components/StationSelect/index.vue
View file @
f0fda03e
<
template
>
<div>
<el-select
:value=
"
value
"
:value=
"
selVal
"
:loading=
"loading"
filterable
remote
...
...
@@ -22,10 +22,11 @@
</
template
>
<
script
>
import
config
from
'./config'
export
default
{
name
:
'StationSelect'
,
componentName
:
'架次关联站位编号'
,
mixins
:
[
config
],
props
:
{
value
:
{
type
:
[
String
,
Number
],
...
...
@@ -47,20 +48,35 @@ export default {
data
()
{
return
{
loading
:
false
,
options
:
[]
options
:
[],
// linkageValue: '',
selVal
:
''
}
},
computed
:
{},
watch
:
{
'form.sorties'
:
{
immediate
:
true
,
deep
:
true
,
//
deep: true,
handler
(
val
)
{
// if (val !== this.linkageValue) {
if
(
this
.
item
.
key
!==
'position'
)
{
// this.linkageValue = val
this
.
$set
(
this
.
form
,
'positionNumber'
,
''
)
this
.
selVal
=
''
}
// }
val
&&
this
.
getOptions
()
}
},
value
:
{
immediate
:
true
,
deep
:
true
,
handler
(
v
)
{
if
(
v
)
{
this
.
selVal
=
this
.
value
}
}
}
},
methods
:
{
...
...
@@ -104,6 +120,15 @@ export default {
},
change
(
val
)
{
this
.
$emit
(
'input'
,
val
)
this
.
clearRelativeAttr
()
},
clearRelativeAttr
()
{
if
(
this
.
item
.
relatedAttribute
)
{
const
attributes
=
this
.
item
.
relatedAttribute
.
split
(
','
)
||
[]
attributes
.
forEach
(
el
=>
{
el
&&
this
.
$set
(
this
.
form
,
el
,
''
)
})
}
},
clear
()
{
this
.
$emit
(
'input'
)
...
...
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