Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-bpm
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
鲁鑫
topsun-bpm
Commits
b384026f
Commit
b384026f
authored
Dec 28, 2023
by
覃振观
👶
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Grid 下拉框 优化
parent
99907050
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
25 deletions
+29
-25
listeningFromData.js
...xt/src/main/webapp/biz/topsun/common/listeningFromData.js
+10
-14
productDetail.js
...un-xt/src/main/webapp/biz/topsun/product/productDetail.js
+7
-7
ProductFaceColor.java
...va/com/huigou/topsun/product/domain/ProductFaceColor.java
+12
-4
No files found.
topsun-xt/src/main/webapp/biz/topsun/common/listeningFromData.js
View file @
b384026f
...
@@ -190,7 +190,6 @@ function onBeforeEdit_(options) {
...
@@ -190,7 +190,6 @@ function onBeforeEdit_(options) {
options
.
onBeforeEdit
=
function
(
editParm
,
gg
){
options
.
onBeforeEdit
=
function
(
editParm
,
gg
){
let
domIds
=
editParm
.
column
.
__domid
.
split
(
'|'
),
recordId
=
editParm
.
record
.
__id
,
colName
=
editParm
.
column
.
name
;
let
domIds
=
editParm
.
column
.
__domid
.
split
(
'|'
),
recordId
=
editParm
.
record
.
__id
,
colName
=
editParm
.
column
.
name
;
let
parentDomId
=
domIds
[
0
]
+
'|'
+
2
+
'|'
+
recordId
;
// +'|'+domIds[2];
let
parentDomId
=
domIds
[
0
]
+
'|'
+
2
+
'|'
+
recordId
;
// +'|'+domIds[2];
let
domId
=
domIds
[
0
]
+
'|'
+
2
+
'|'
+
recordId
+
'|'
+
domIds
[
2
];
let
rowDOM
;
let
rowDOM
;
if
(
!
(
rowDOM
=
document
.
getElementById
(
parentDomId
)))
{
if
(
!
(
rowDOM
=
document
.
getElementById
(
parentDomId
)))
{
parentDomId
=
domIds
[
0
]
+
'|'
+
1
+
'|'
+
recordId
;
parentDomId
=
domIds
[
0
]
+
'|'
+
1
+
'|'
+
recordId
;
...
@@ -204,8 +203,7 @@ function onBeforeEdit_(options) {
...
@@ -204,8 +203,7 @@ function onBeforeEdit_(options) {
if
(
mapperEntry
[
currentMapper
.
beanName
])
{
if
(
mapperEntry
[
currentMapper
.
beanName
])
{
mapperEntry
[
currentMapper
.
beanName
][
'rowIndex'
]
=
rowIndex
;
mapperEntry
[
currentMapper
.
beanName
][
'rowIndex'
]
=
rowIndex
;
mapperEntry
[
currentMapper
.
beanName
][
'colName'
]
=
colName
;
mapperEntry
[
currentMapper
.
beanName
][
'colName'
]
=
colName
;
mapperEntry
[
currentMapper
.
beanName
][
'domId'
]
=
domId
;
mapperEntry
[
currentMapper
.
beanName
][
rowIndex
]
=
editParm
.
rowindex
;
// input 框定位
mapperEntry
[
currentMapper
.
beanName
][
rowIndex
]
=
editParm
.
rowindex
;
}
else
{
}
else
{
// mapperEntry[currentMapper.beanName][rowIndex] = colName;
// mapperEntry[currentMapper.beanName][rowIndex] = colName;
// console.error("dataMapping 中,无法找到该 DOMId 的映射。请检查!");
// console.error("dataMapping 中,无法找到该 DOMId 的映射。请检查!");
...
@@ -222,7 +220,7 @@ function onBeforeEdit_(options) {
...
@@ -222,7 +220,7 @@ function onBeforeEdit_(options) {
*/
*/
function
listeningSearchbox
(
elId
,
options
,
gridId
)
{
function
listeningSearchbox
(
elId
,
options
,
gridId
)
{
const
originalOnChange
=
options
.
onChange
;
const
originalOnChange
=
options
.
onChange
;
options
.
onChange
=
function
(
value
,
data
,
fillInValue
)
{
options
.
onChange
=
function
(
value
,
data
,
gridManager
)
{
let
eleName
=
this
.
element
[
0
].
name
,
beanName
=
''
;
let
eleName
=
this
.
element
[
0
].
name
,
beanName
=
''
;
let
currentMapper
=
window
.
dataMapping
.
mapper
[
eleName
];
let
currentMapper
=
window
.
dataMapping
.
mapper
[
eleName
];
if
(
!
currentMapper
)
{
if
(
!
currentMapper
)
{
...
@@ -238,31 +236,30 @@ function listeningSearchbox(elId, options, gridId) {
...
@@ -238,31 +236,30 @@ function listeningSearchbox(elId, options, gridId) {
if
(
typeof
property
==
'string'
)
{
if
(
typeof
property
==
'string'
)
{
// ------------------ Form 下拉框执行此逻辑 ------------------
// ------------------ Form 下拉框执行此逻辑 ------------------
window
.
dataSet
.
newData
[
beanName
][
property
]
=
data
[
property
];
window
.
dataSet
.
newData
[
beanName
][
property
]
=
data
[
property
];
fillInValue
=
data
[
property
];
gridManager
=
window
.
dataGrid
[
gridId
];
}
else
if
(
property
instanceof
Object
)
{
}
else
if
(
property
instanceof
Object
)
{
// ------------------ Grid 下拉框执行此逻辑 ------------------
// ------------------ Grid 下拉框执行此逻辑 ------------------
debugger
;
if
(
property
.
rowIndex
)
{
if
(
property
.
rowIndex
)
{
let
rowIndex
=
property
.
rowIndex
;
let
rowIndex
=
property
.
rowIndex
;
let
propertyName
=
property
.
colName
;
let
propertyName
=
property
.
colName
;
let
domId
=
property
.
domId
;
window
.
dataSet
.
newData
[
beanName
].
compares
[
rowIndex
][
propertyName
]
=
data
[
propertyName
];
fillInValue
=
domId
;
let
gridEdit
=
window
.
dataGrid
[
'fronColorsGrid'
].
editor
;
let
gridEdit
=
window
.
dataGrid
[
'fronColorsGrid'
].
editor
;
if
(
gridEdit
.
editParm
.
column
.
editor
.
type
===
'select'
)
{
if
(
gridEdit
.
editParm
.
column
.
editor
.
type
===
'select'
)
{
let
showProperty
=
gridEdit
.
editParm
.
column
.
editor
.
showProperty
let
fillProperty
=
gridEdit
.
editParm
.
column
.
editor
.
fillProperty
window
.
dataGrid
[
gridId
].
editor
.
editParm
.
record
[
propertyName
]
=
data
[
showProperty
];
window
.
dataSet
.
newData
[
beanName
].
compares
[
rowIndex
][
fillProperty
]
=
data
[
fillProperty
];
//更新数据
window
.
dataGrid
[
gridId
].
editor
.
editParm
.
record
[
propertyName
]
=
data
[
propertyName
];
//更新显示
}
}
gridManager
=
window
.
dataGrid
[
gridId
];
property
.
rowIndex
=
null
;
property
.
rowIndex
=
null
;
property
.
colName
=
null
;
property
.
colName
=
null
;
property
.
domId
=
null
;
}
}
}
}
}
}
})
})
if
(
fillInValue
)
{
if
(
gridManager
)
{
originalOnChange
.
call
(
this
,
value
,
data
,
fillInValue
);
originalOnChange
.
call
(
this
,
value
,
data
,
gridManager
);
}
}
}
}
$
(
elId
).
searchbox
(
options
);
$
(
elId
).
searchbox
(
options
);
...
@@ -446,7 +443,6 @@ function listenerContent(event) {
...
@@ -446,7 +443,6 @@ function listenerContent(event) {
window
.
dataSet
.
newData
[
beanName
][
property
]
=
event
.
target
.
value
;
window
.
dataSet
.
newData
[
beanName
][
property
]
=
event
.
target
.
value
;
console
.
log
(
'Input value changed:'
,
event
.
target
.
value
);
console
.
log
(
'Input value changed:'
,
event
.
target
.
value
);
}
}
})
})
}
}
}
}
...
...
topsun-xt/src/main/webapp/biz/topsun/product/productDetail.js
View file @
b384026f
...
@@ -31,8 +31,8 @@ function initializateSelectC() {
...
@@ -31,8 +31,8 @@ function initializateSelectC() {
listeningSearchbox
(
'#selectedFactory'
,
{
listeningSearchbox
(
'#selectedFactory'
,
{
type
:
"product"
,
type
:
"product"
,
name
:
"productFactoryName"
,
name
:
"productFactoryName"
,
onChange
:
function
(
value
,
data
,
fillInValue
)
{
onChange
:
function
(
value
,
data
,
gridManager
)
{
console
.
log
(
'fillInValue : '
+
fillInValue
);
console
.
log
(
'fillInValue : '
);
}
}
});
});
...
@@ -59,7 +59,7 @@ function initializateSelectC() {
...
@@ -59,7 +59,7 @@ function initializateSelectC() {
function
initGridSearchbox
()
{
function
initGridSearchbox
()
{
listeningGridSearchbox
(
'fronColorsGrid_color
Id
'
,
{
listeningGridSearchbox
(
'fronColorsGrid_color
Name
'
,
{
type
:
"product"
,
type
:
"product"
,
name
:
"color"
,
name
:
"color"
,
onChange
:
function
(
value
,
data
,
fillInValue
)
{
onChange
:
function
(
value
,
data
,
fillInValue
)
{
...
@@ -179,11 +179,11 @@ var dataMapping = {
...
@@ -179,11 +179,11 @@ var dataMapping = {
},
},
fronColors
:
{
fronColors
:
{
id
:
"productFaceColorId"
,
id
:
"productFaceColorId"
,
columns
:
[
"productFaceColorId"
,
"coverageRate"
,
"productFaceId"
,
"colorId"
]
columns
:
[
"productFaceColorId"
,
"coverageRate"
,
"productFaceId"
,
"colorId"
,
"colorName"
]
},
},
backColors
:
{
backColors
:
{
id
:
"productFaceColorId"
,
id
:
"productFaceColorId"
,
columns
:
[
"productFaceColorId"
,
"coverageRate"
,
"productFaceId"
,
"colorId"
]
columns
:
[
"productFaceColorId"
,
"coverageRate"
,
"productFaceId"
,
"colorId"
,
"colorName"
]
},
},
processed
:
{
processed
:
{
id
:
"productTechnologyId"
,
id
:
"productTechnologyId"
,
...
@@ -216,8 +216,8 @@ function faceGrid(elId, data) {
...
@@ -216,8 +216,8 @@ function faceGrid(elId, data) {
});
});
var
gridManager
=
listeningGrid
(
elId
,
{
var
gridManager
=
listeningGrid
(
elId
,
{
columns
:
[
columns
:
[
{
display
:
"颜色名称"
,
name
:
"color
Id
"
,
width
:
140
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
{
display
:
"颜色名称"
,
name
:
"color
Name
"
,
width
:
140
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
type
:
'select'
,
showProperty
:
'colorName
'
type
:
'select'
,
fillProperty
:
'colorId
'
}},
}},
{
display
:
"油墨覆盖率(%)"
,
name
:
"coverageRate"
,
width
:
120
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
type
:
'text'
}
}
{
display
:
"油墨覆盖率(%)"
,
name
:
"coverageRate"
,
width
:
120
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
type
:
'text'
}
}
],
],
...
...
topsun/src/main/java/com/huigou/topsun/product/domain/ProductFaceColor.java
View file @
b384026f
...
@@ -5,10 +5,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
...
@@ -5,10 +5,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.huigou.topsun.common.NumberToStringSerializer
;
import
com.huigou.topsun.common.NumberToStringSerializer
;
import
javax.persistence.Column
;
import
javax.persistence.*
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
...
@@ -54,6 +51,9 @@ public class ProductFaceColor implements Serializable {
...
@@ -54,6 +51,9 @@ public class ProductFaceColor implements Serializable {
@Column
(
name
=
"sort_order"
,
nullable
=
true
)
@Column
(
name
=
"sort_order"
,
nullable
=
true
)
private
Integer
sortOrder
;
private
Integer
sortOrder
;
@Transient
private
String
colorName
;
public
BigDecimal
getProductFaceColorId
()
{
public
BigDecimal
getProductFaceColorId
()
{
return
this
.
productFaceColorId
;
return
this
.
productFaceColorId
;
}
}
...
@@ -93,4 +93,12 @@ public class ProductFaceColor implements Serializable {
...
@@ -93,4 +93,12 @@ public class ProductFaceColor implements Serializable {
public
void
setSortOrder
(
Integer
sortOrder
)
{
public
void
setSortOrder
(
Integer
sortOrder
)
{
this
.
sortOrder
=
sortOrder
;
this
.
sortOrder
=
sortOrder
;
}
}
public
String
getColorName
()
{
return
colorName
;
}
public
void
setColorName
(
String
colorName
)
{
this
.
colorName
=
colorName
;
}
}
}
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