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
126a7be0
Commit
126a7be0
authored
Jul 23, 2023
by
arvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改组件
parent
cf072ca2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
149 additions
and
31 deletions
+149
-31
config.js
...-mes/src/privateComponents/components/Warehouse/config.js
+39
-0
index.vue
...-mes/src/privateComponents/components/Warehouse/index.vue
+99
-30
index.js
applications/dee-mes/src/privateComponents/index.js
+11
-1
No files found.
applications/dee-mes/src/privateComponents/components/Warehouse/config.js
0 → 100644
View file @
126a7be0
export
default
{
props
:
{},
layoutConfigData
:
[
{
title
:
'高级组件配置'
,
data
:
[
{
key
:
'linkageAttr'
,
title
:
'联动属性'
,
component
:
{
defaultValue
:
'extProductAreaId'
,
name
:
'el-input'
}
},
{
key
:
'syncOutAttr'
,
title
:
'同步输出'
,
component
:
{
defaultValue
:
'extWorkCenteName:extname'
,
name
:
'el-input'
}
}
]
}
],
data
()
{
return
{
}
},
created
()
{
},
computed
:
{
},
methods
:
{
}
}
applications/dee-mes/src/privateComponents/components/Warehouse/index.vue
View file @
126a7be0
<
template
>
<div>
<el-select
v-model=
"form.extWorkCenterId
"
>
<el-option
v-for=
"(item,i) in warehouseOptions"
:key=
"i"
:label=
"item.extname"
:value=
"item.id"
/>
</el-select>
</div>
<el-select
v-model=
"cloneValue"
@
change=
"change
"
>
<el-option
v-for=
"(item,i) in warehouseOptions"
:key=
"i"
:label=
"item.extname"
:value=
"item.id"
/>
</el-select>
</
template
>
<
script
>
import
config
from
'./config'
import
_get
from
'lodash.get'
import
_set
from
'lodash.set'
export
default
{
componentName
:
'库房'
,
name
:
'Warehouse'
,
components
:
{}
,
mixins
:
[
config
]
,
props
:
{
form
:
{}
itemObj
:
{
type
:
Object
,
default
:
null
},
form
:
{
type
:
Object
,
default
:
()
=>
{}
},
value
:
{
type
:
[
Number
,
String
,
Object
],
default
:
()
=>
''
}
},
data
()
{
return
{
warehouseOptions
:
[],
areaList
:
[],
cloneValue
:
''
,
linkageValue
:
''
,
dataType
:
'string'
,
isFirst
:
true
}
},
computed
:
{},
watch
:
{
async
'form.extProductArea.id'
()
{
this
.
$set
(
this
.
form
,
'extWorkCenterId'
,
this
.
form
.
extWorkCenterId
||
''
)
if
(
!
this
.
isFirst
)
{
this
.
$set
(
this
.
form
,
'extWorkCenterId'
,
''
)
'value'
:
{
immediate
:
true
,
handler
(
val
)
{
if
(
!
val
)
{
this
.
cloneValue
=
''
return
}
if
(
typeof
(
val
)
===
'object'
)
{
this
.
cloneValue
=
val
.
id
this
.
dataType
=
'object'
}
else
{
this
.
cloneValue
=
val
this
.
dataType
=
'string'
}
}
if
(
this
.
areaList
.
length
)
{
this
.
findWarehouse
()
}
else
{
await
this
.
searchApi
()
},
form
:
{
immediate
:
true
,
deep
:
true
,
handler
()
{
if
(
!
this
.
itemObj
.
linkageAttr
)
{
return
}
const
_val
=
_get
(
this
.
form
,
this
.
itemObj
.
linkageAttr
)
if
(
_val
!==
this
.
linkageValue
)
{
this
.
linkageValue
=
_val
this
.
linkageValue
&&
this
.
searchApi
()
if
(
this
.
linkageValue
)
{
this
.
cloneValue
=
''
this
.
update
()
}
}
}
}
},
...
...
@@ -51,17 +90,47 @@ export default {
mounted
()
{
},
methods
:
{
async
searchApi
()
{
this
.
isFirst
=
false
const
params
=
{
'openProps'
:
[{
'name'
:
'extDxProductWorkCenters'
}]
}
await
this
.
$api
.
searchApi
(
'ExtDxProductArea'
,
params
).
then
(
res
=>
{
this
.
areaList
=
res
.
items
.
content
this
.
findWarehouse
()
validate
()
{
return
!!
this
.
cloneValue
},
searchApi
()
{
const
params
=
{
'openProps'
:
[{
'name'
:
'extDxProductWorkCenters'
}],
searchItems
:
{
items
:
[{
'fieldName'
:
'id'
,
operator
:
'EQ'
,
value
:
this
.
linkageValue
}],
operator
:
'AND'
}
}
this
.
$api
.
searchApi
(
'ExtDxProductArea'
,
params
).
then
(
res
=>
{
this
.
warehouseOptions
=
res
.
items
.
content
[
0
].
extDxProductWorkCenters
})
},
update
()
{
let
item
=
null
if
(
this
.
dataType
===
'string'
)
{
this
.
$emit
(
'input'
,
this
.
cloneValue
)
this
.
$emit
(
'change'
,
this
.
cloneValue
)
}
else
{
item
=
this
.
warehouseOptions
.
find
(
r
=>
r
.
id
===
this
.
cloneValue
)
this
.
$emit
(
'input'
,
item
)
this
.
$emit
(
'change'
,
item
)
}
this
.
syncOut
(
item
)
},
syncOut
(
obj
)
{
if
(
!
this
.
itemObj
.
syncOutAttr
)
{
return
}
const
list
=
this
.
itemObj
.
syncOutAttr
.
split
(
','
)
list
.
forEach
(
r
=>
{
const
keyname
=
r
.
split
(
':'
)
if
(
keyname
.
length
===
2
)
{
const
val
=
obj
?
_get
(
obj
,
keyname
[
1
])
:
''
_set
(
this
.
form
,
keyname
[
0
],
val
)
}
})
},
findWarehouse
()
{
const
warehouse
=
this
.
areaList
.
find
(
item
=>
item
.
id
===
this
.
form
.
extProductArea
.
id
)
this
.
warehouseOptions
=
warehouse
.
extDxProductWorkCenters
change
()
{
this
.
update
()
}
}
}
...
...
applications/dee-mes/src/privateComponents/index.js
View file @
126a7be0
...
...
@@ -7,11 +7,21 @@ const privateComponents = []
requireComponent
.
keys
().
forEach
(
fileName
=>
{
const
comp
=
requireComponent
(
fileName
)
if
(
comp
.
default
.
componentName
)
{
let
layoutConfigData
=
comp
.
default
.
layoutConfigData
if
(
!
layoutConfigData
&&
comp
.
default
.
mixins
)
{
const
hasLayoutConfigData
=
comp
.
default
.
mixins
.
find
(
el
=>
{
return
el
.
layoutConfigData
})
if
(
hasLayoutConfigData
)
{
layoutConfigData
=
hasLayoutConfigData
.
layoutConfigData
}
}
privateComponents
.
push
(
{
componentName
:
comp
.
default
.
componentName
,
name
:
comp
.
default
.
name
,
path
:
fileName
.
slice
(
1
)
path
:
fileName
.
slice
(
1
),
layoutConfigData
:
layoutConfigData
||
[]
}
)
}
...
...
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