Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rbc-demo
Overview
Overview
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
王衍超
rbc-demo
Commits
5287edff
Commit
5287edff
authored
May 06, 2022
by
Joey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(@gms/gms-plugin-billexpand): 调整公式
parent
816a25d2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
2 deletions
+80
-2
emcon.js
develop/@gms/gms-plugin-billexpand/src/emcon.js
+32
-0
SetSubValueToMaster.js
.../gms-plugin-billexpand/src/formula/SetSubValueToMaster.js
+22
-0
SubTableSetData.js
...@gms/gms-plugin-billexpand/src/formula/SubTableSetData.js
+10
-2
UnsafeApplyFunction.js
.../gms-plugin-billexpand/src/formula/UnsafeApplyFunction.js
+12
-0
mcon.js
develop/@gms/gms-plugin-billexpand/src/mcon.js
+4
-0
No files found.
develop/@gms/gms-plugin-billexpand/src/emcon.js
View file @
5287edff
...
...
@@ -4844,6 +4844,38 @@ export default {
"discard"
:
false
,
"path"
:
"通用"
,
"extends"
:
{
"info"
:
{
"param"
:
[],
"name"
:
"SetSubValueToMaster"
,
"description"
:
"1.子表字段,2.赋值的主表字段"
,
"title"
:
"从子表一个字段选一个值赋值到主表"
,
"return"
:
0
}
},
"description"
:
"1.子表字段,2.赋值的主表字段"
,
"title"
:
"从子表一个字段选一个值赋值到主表"
,
"value"
:
"SetSubValueToMaster"
},
{
"discard"
:
false
,
"path"
:
"通用"
,
"extends"
:
{
"info"
:
{
"param"
:
[],
"name"
:
"UnsafeApplyFunction"
,
"description"
:
"1.context,2.其它参数"
,
"title"
:
"执行js函数"
,
"return"
:
0
}
},
"description"
:
"1.context,2.其它参数"
,
"title"
:
"执行js函数"
,
"value"
:
"UnsafeApplyFunction"
},
{
"discard"
:
false
,
"path"
:
"通用"
,
"extends"
:
{
"info"
:
{
"param"
:
[
...
...
develop/@gms/gms-plugin-billexpand/src/formula/SetSubValueToMaster.js
0 → 100644
View file @
5287edff
export
default
{
execute
:
async
function
([
originField
,
targetField
,
triggerFormula
],
context
)
{
console
.
log
(
"主表字段赋值"
);
const
subTable
=
context
.
getSubData
(
context
.
getTableType
(
originField
.
FieldTableCode
).
title
)
triggerFormula
=
triggerFormula
&&
triggerFormula
.
StaticValue
let
originData
=
''
if
(
subTable
instanceof
Array
&&
subTable
.
length
)
{
originData
=
subTable
[
0
].
getValue
(
originField
.
FieldCode
)
}
context
.
getMasterData
().
setValue
(
targetField
.
FieldTableCode
+
'.'
+
targetField
.
FieldCode
,
originData
,
null
,
triggerFormula
?
'all'
:
'none'
)
return
originData
},
getResultType
:
function
()
{
return
FMR
.
ConstDataTypes
.
General
;
}
}
\ No newline at end of file
develop/@gms/gms-plugin-billexpand/src/formula/SubTableSetData.js
View file @
5287edff
...
...
@@ -8,6 +8,10 @@ export default {
let
context
=
arguments
[
1
]
let
targetSubField
=
arguments
[
0
][
0
]
let
sourceValueField
=
arguments
[
0
][
1
]
let
triggerFormula
=
false
if
(
arguments
[
0
][
2
]
&&
arguments
[
0
][
2
].
StaticValue
)
{
triggerFormula
=
true
}
if
(
sourceValueField
instanceof
FunctionNode
)
{
let
funcResult
=
sourceValueField
.
getResult
()
if
(
funcResult
instanceof
AbstractData
)
{
...
...
@@ -26,8 +30,12 @@ export default {
}
let
subTableObject
=
context
.
getTableType
(
targetSubField
.
FieldTableCode
)
let
oldIndex
=
context
.
getSubFocus
()
let
focusData
=
context
.
getAllSubData
()[
subTableObject
.
title
][
oldIndex
].
getData
()
focusData
[
targetSubField
.
FieldCode
].
_field_old_value_
=
focusData
[
targetSubField
.
FieldCode
].
value
=
result
context
.
getAllSubData
()[
subTableObject
.
title
][
oldIndex
].
setValue
(
targetSubField
.
FieldTableCode
+
'.'
+
targetSubField
.
FieldCode
,
result
,
null
,
triggerFormula
?
'all'
:
'none'
)
context
.
refreshSubDataRow
(
subTableObject
.
title
);
}
return
result
...
...
develop/@gms/gms-plugin-billexpand/src/formula/UnsafeApplyFunction.js
0 → 100644
View file @
5287edff
import
*
as
util
from
'./util'
export
default
{
execute
:
function
([
functionString
,
...
args
],
context
)
{
return
Function
(
'"use strict";return ('
+
functionString
.
StaticValue
+
')'
)()(
{
context
,
util
},
...
args
)
},
getResultType
:
function
()
{
return
FMR
.
ConstDataTypes
.
General
;
}
}
develop/@gms/gms-plugin-billexpand/src/mcon.js
View file @
5287edff
...
...
@@ -169,6 +169,8 @@ import SetSubFieldsByBaseData from "./formula/SetSubFieldsByBaseData";
import
SubTableSetData
from
"./formula/SubTableSetData"
;
import
GetOwnProperty
from
"./formula/GetOwnProperty"
;
import
GetMDByObjectcode
from
"./formula/GetMDByObjectcode"
;
import
SetSubValueToMaster
from
"./formula/SetSubValueToMaster"
;
import
UnsafeApplyFunction
from
"./formula/UnsafeApplyFunction"
;
export
default
{
actions
:
{
updateFieldAction
,
...
...
@@ -338,6 +340,8 @@ export default {
SubTableSetData
,
GetMDByObjectcode
,
GetOwnProperty
,
SetSubValueToMaster
,
UnsafeApplyFunction
,
...
GeneralImportFile
,
},
routes
:
{
...
...
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