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
5dfc4510
Commit
5dfc4510
authored
Dec 14, 2023
by
覃振观
👶
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
f3405fdd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
9 deletions
+30
-9
listeningFromData.js
...xt/src/main/webapp/biz/topsun/common/listeningFromData.js
+26
-6
productDetail.js
...un-xt/src/main/webapp/biz/topsun/product/productDetail.js
+2
-2
ProductApplication.java
...huigou/topsun/product/application/ProductApplication.java
+2
-1
No files found.
topsun-xt/src/main/webapp/biz/topsun/common/listeningFromData.js
View file @
5dfc4510
...
@@ -151,6 +151,17 @@ function checkUpdata() {
...
@@ -151,6 +151,17 @@ function checkUpdata() {
})
})
}
}
/**
* 若需要监听 Grid 数据,必须在此调用组件初始化,此处获取元素 ID
* @param elId
* @param options
* @returns {*}
*/
function
listeningGrid
(
elId
,
options
)
{
addObserver
(
elId
);
return
UICtrl
.
grid
(
elId
,
options
);
}
/**
/**
* 用于判断字符串是否更改
* 用于判断字符串是否更改
* @param str
* @param str
...
@@ -179,17 +190,26 @@ function getHashCode (str, caseSensitive) {
...
@@ -179,17 +190,26 @@ function getHashCode (str, caseSensitive) {
}
}
}
}
function
runObserver
(
)
{
function
addObserver
(
eleId
)
{
observer
.
observe
(
document
.
querySelector
(
'#panelContainer'
),
mutationConfig
);
observer
.
observe
(
document
.
querySelector
(
eleId
),
mutationConfig
);
}
}
// 补充方案 监听 Value 属性
// 补充方案 监听 Value 属性
const
observer
=
new
MutationObserver
((
mutations
)
=>
{
const
observer
=
new
MutationObserver
((
mutations
)
=>
{
mutations
.
forEach
((
mutation
)
=>
{
mutations
.
forEach
((
mutation
)
=>
{
if
(
mutation
.
type
===
'attributes'
&&
mutation
.
attributeName
===
'value'
)
{
if
(
mutation
.
type
===
'childList'
)
{
console
.
log
(
'属性变化节点 : '
+
mutation
.
target
);
let
addNodes
=
mutation
.
addedNodes
;
console
.
log
(
'变化属性名 : '
+
mutation
.
attributeName
);
if
(
addNodes
.
length
==
1
&&
addNodes
[
0
].
nodeName
===
'DIV'
)
{
console
.
log
(
'变化属性值 : '
+
mutation
.
target
.
value
);
let
childNodes
=
addNodes
[
0
].
childNodes
;
if
(
childNodes
.
length
==
1
&&
childNodes
[
0
].
nodeName
===
'INPUT'
)
{
let
node
=
childNodes
[
0
];
debugger
;
console
.
log
(
'属性变化节点 : '
+
mutation
.
target
);
console
.
log
(
'变化属性名 : '
+
mutation
.
attributeName
);
console
.
log
(
'变化属性值 : '
+
mutation
.
target
.
value
);
}
}
}
}
})
})
})
})
...
...
topsun-xt/src/main/webapp/biz/topsun/product/productDetail.js
View file @
5dfc4510
...
@@ -4,7 +4,7 @@ $(document).ready(function() {
...
@@ -4,7 +4,7 @@ $(document).ready(function() {
initializeToobarContainer
();
initializeToobarContainer
();
initializateSelectC
();
initializateSelectC
();
$
(
'#pageTab'
).
tab
();
$
(
'#pageTab'
).
tab
();
runObserver
();
//
runObserver();
});
});
...
@@ -40,7 +40,7 @@ function faceGrid(elId, data) {
...
@@ -40,7 +40,7 @@ function faceGrid(elId, data) {
}
}
}
}
});
});
var
gridManager
=
UICtrl
.
g
rid
(
elId
,
{
var
gridManager
=
listeningG
rid
(
elId
,
{
columns
:
[
columns
:
[
{
display
:
"颜色名称"
,
name
:
"productFaceColorId"
,
width
:
140
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
{
display
:
"颜色名称"
,
name
:
"productFaceColorId"
,
width
:
140
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
type
:
'text'
,
type
:
'text'
,
...
...
topsun/src/main/java/com/huigou/topsun/product/application/ProductApplication.java
View file @
5dfc4510
package
com
.
huigou
.
topsun
.
product
.
application
;
package
com
.
huigou
.
topsun
.
product
.
application
;
import
com.huigou.topsun.product.domain.Product
;
import
com.huigou.topsun.product.domain.Product
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -35,7 +36,7 @@ public interface ProductApplication {
...
@@ -35,7 +36,7 @@ public interface ProductApplication {
/**
/**
* description 对比所有对象,并保存更改的数据。
* description 对比所有对象,并保存更改的数据。
*
*
* @param
rawMap 原
数据
* @param
newData 更新
数据
* @return java.util.HashMap<java.lang.String, java.lang.Object>
* @return java.util.HashMap<java.lang.String, java.lang.Object>
* @author qinzhenguan
* @author qinzhenguan
* @createDate 2023/12/8 17:19
* @createDate 2023/12/8 17:19
...
...
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