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
>
<
template
>
<div>
<el-select
v-model=
"form.extWorkCenterId
"
>
<el-select
v-model=
"cloneValue"
@
change=
"change
"
>
<el-option
<el-option
v-for=
"(item,i) in warehouseOptions"
v-for=
"(item,i) in warehouseOptions"
:key=
"i"
:key=
"i"
:label=
"item.extname"
:label=
"item.extname"
:value=
"item.id"
:value=
"item.id"
/>
/>
</el-select>
</el-select>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
config
from
'./config'
import
_get
from
'lodash.get'
import
_set
from
'lodash.set'
export
default
{
export
default
{
componentName
:
'库房'
,
componentName
:
'库房'
,
name
:
'Warehouse'
,
name
:
'Warehouse'
,
components
:
{}
,
mixins
:
[
config
]
,
props
:
{
props
:
{
form
:
{}
itemObj
:
{
type
:
Object
,
default
:
null
},
form
:
{
type
:
Object
,
default
:
()
=>
{}
},
value
:
{
type
:
[
Number
,
String
,
Object
],
default
:
()
=>
''
}
},
},
data
()
{
data
()
{
return
{
return
{
warehouseOptions
:
[],
warehouseOptions
:
[],
areaList
:
[],
areaList
:
[],
cloneValue
:
''
,
linkageValue
:
''
,
dataType
:
'string'
,
isFirst
:
true
isFirst
:
true
}
}
},
},
computed
:
{},
computed
:
{},
watch
:
{
watch
:
{
async
'form.extProductArea.id'
()
{
'value'
:
{
this
.
$set
(
this
.
form
,
'extWorkCenterId'
,
this
.
form
.
extWorkCenterId
||
''
)
immediate
:
true
,
if
(
!
this
.
isFirst
)
{
handler
(
val
)
{
this
.
$set
(
this
.
form
,
'extWorkCenterId'
,
''
)
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
()
form
:
{
}
else
{
immediate
:
true
,
await
this
.
searchApi
()
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 {
...
@@ -51,17 +90,47 @@ export default {
mounted
()
{
mounted
()
{
},
},
methods
:
{
methods
:
{
async
searchApi
()
{
validate
()
{
this
.
isFirst
=
false
return
!!
this
.
cloneValue
const
params
=
{
'openProps'
:
[{
'name'
:
'extDxProductWorkCenters'
}]
}
},
await
this
.
$api
.
searchApi
(
'ExtDxProductArea'
,
params
).
then
(
res
=>
{
searchApi
()
{
this
.
areaList
=
res
.
items
.
content
const
params
=
{
'openProps'
:
[{
'name'
:
'extDxProductWorkCenters'
}],
this
.
findWarehouse
()
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
()
{
change
()
{
const
warehouse
=
this
.
areaList
.
find
(
item
=>
item
.
id
===
this
.
form
.
extProductArea
.
id
)
this
.
update
()
this
.
warehouseOptions
=
warehouse
.
extDxProductWorkCenters
}
}
}
}
}
}
...
...
applications/dee-mes/src/privateComponents/index.js
View file @
126a7be0
...
@@ -7,11 +7,21 @@ const privateComponents = []
...
@@ -7,11 +7,21 @@ const privateComponents = []
requireComponent
.
keys
().
forEach
(
fileName
=>
{
requireComponent
.
keys
().
forEach
(
fileName
=>
{
const
comp
=
requireComponent
(
fileName
)
const
comp
=
requireComponent
(
fileName
)
if
(
comp
.
default
.
componentName
)
{
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
(
privateComponents
.
push
(
{
{
componentName
:
comp
.
default
.
componentName
,
componentName
:
comp
.
default
.
componentName
,
name
:
comp
.
default
.
name
,
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