Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ems3.3
Project
Project
Details
Activity
Releases
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
wuhao
ems3.3
Commits
36c434a1
Commit
36c434a1
authored
Dec 21, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11
parent
c69946df
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
333 additions
and
230 deletions
+333
-230
index.jsx
src/components/DrawerPro/index.jsx
+11
-0
global.less
src/global.less
+7
-0
columns.js
src/pages/system/pushsetting/columns.js
+86
-79
index.jsx
src/pages/system/pushsetting/index.jsx
+229
-151
No files found.
src/components/DrawerPro/index.jsx
View file @
36c434a1
...
...
@@ -5,6 +5,7 @@ import DetailPro from '../DetailPro';
import
PropTypes
from
'prop-types'
;
function
DrawerPro
(
props
)
{
let
pushSettingFlag
=
props
.
pushSettingFlag
;
let
newProps
=
{
...
props
};
delete
newProps
.
children
;
const
detailprops
=
{
...
...
@@ -30,6 +31,16 @@ function DrawerPro(props) {
)
:
(
<
InitForm
{
...
newProps
}
/>
)
}
{
pushSettingFlag
?
(
<
a
id=
"pushSettingBtn"
onClick=
{
()
=>
{
props
.
checkVariableOpen
();
}
}
>
查看变量
</
a
>
)
:
null
}
</
Drawer
>
);
}
...
...
src/global.less
View file @
36c434a1
...
...
@@ -486,3 +486,10 @@ ol {
z-index: 998;
}
}
#pushSettingBtn {
position: relative;
top: -162px;
left: 74px;
color: #1890ff;
}
\ No newline at end of file
src/pages/system/pushsetting/columns.js
View file @
36c434a1
function
getcolumns
(
setdrawer
)
{
return
{
"columns"
:
[
columns
:
[
{
"title"
:
"推送场景"
,
"dataIndex"
:
"businessMsgSceneId"
,
"key"
:
"businessMsgSceneId"
title
:
'推送场景'
,
dataIndex
:
'msgSceneName'
,
key
:
'businessMsgSceneId'
,
valueType
:
'select'
,
options
:
{
path
:
'/base/paBusinessMsgScene/queryAllForSelect'
,
params
:
{},
},
{
"title"
:
"推送方式"
,
"dataIndex"
:
"sendMethodType"
,
"key"
:
"sendMethodType"
},
{
"title"
:
"适用类型"
,
"dataIndex"
:
"fitField"
,
"key"
:
"fitField"
,
"valueType"
:
"select"
,
"mode"
:
"radio"
,
"options"
:
[
title
:
'推送方式'
,
dataIndex
:
'sendMethodName'
,
key
:
'sendMethodType'
,
valueType
:
'select'
,
options
:
[
{
"label"
:
"全部"
,
"value"
:
"1"
value
:
'4'
,
label
:
'邮件'
,
},
],
},
{
"label"
:
"公司"
,
"value"
:
"2"
title
:
'适用类型'
,
dataIndex
:
'fitFieldName'
,
key
:
'fitField'
,
valueType
:
'select'
,
mode
:
'radio'
,
options
:
[
{
label
:
'全部'
,
value
:
'1'
,
},
{
"label"
:
"部门"
,
"value"
:
"3"
label
:
'公司'
,
value
:
'2'
,
},
{
"label"
:
"工厂"
,
"value"
:
"4"
label
:
'部门'
,
value
:
'3'
,
},
{
"label"
:
"车间"
,
"value"
:
"5"
label
:
'工厂'
,
value
:
'4'
,
},
{
"label"
:
"工段"
,
"value"
:
"6"
label
:
'车间'
,
value
:
'5'
,
},
{
"label"
:
"产线"
,
"value"
:
"7"
}
]
label
:
'工段'
,
value
:
'6'
,
},
{
"title"
:
"适用选择"
,
"dataIndex"
:
"fieldId"
,
"key"
:
"fieldId"
label
:
'产线'
,
value
:
'7'
,
},
],
},
{
"title"
:
"推送标题"
,
"dataIndex"
:
"sendTitle"
,
"key"
:
"sendTitle"
title
:
'类型名称'
,
dataIndex
:
'fieldName'
,
key
:
'fieldId'
,
},
{
"title"
:
"推送内容"
,
"dataIndex"
:
"sendContent"
,
"key"
:
"sendContent"
}
title
:
'推送内容'
,
dataIndex
:
'sendContent'
,
key
:
'sendContent'
,
valueType
:
'textarea'
,
},
],
"pathconfig"
:
{
"enableadd"
:
false
,
"enableedit"
:
false
,
"enabledelete"
:
false
,
"enabledetail"
:
false
,
"add"
:
""
,
"edit"
:
""
,
"list"
:
"/repair/umRepairOrder/queryRepairOrderList"
,
"delete"
:
""
,
"detail"
:
""
}
};
}
export
default
getcolumns
;
\ No newline at end of file
pathconfig
:
{
enableadd
:
true
,
enableedit
:
true
,
enabledelete
:
true
,
enabledetail
:
true
,
add
:
''
,
edit
:
''
,
list
:
'/base/paBusinessMsgOption/queryList'
,
delete
:
'/base/paBusinessMsgOption/deleteById'
,
detail
:
''
,
},
};
}
export
default
getcolumns
;
src/pages/system/pushsetting/index.jsx
View file @
36c434a1
import
*
as
React
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
useState
,
useMemo
,
useRef
,
useEffect
}
from
'react'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
Drawer
,
Space
,
Table
,
message
}
from
'antd'
;
import
InitForm
from
'@/components/InitForm'
;
import
copy
from
'copy-to-clipboard'
;
function
Pushsetting
(
props
)
{
function
Pushsetting
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
open
:
false
,
});
const
[
checkVariableDraw
,
setCheckVariableDraw
]
=
useState
(
false
);
const
pathconfig
=
useMemo
(()
=>
{
let
pathconf
=
getcolumns
(
setdrawer
)?.
pathconfig
??
{};
return
pathconf
;
...
...
@@ -30,12 +35,11 @@ import * as React from 'react';
},
});
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
const
news
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
type
:
'link'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
...
...
@@ -48,7 +52,7 @@ import * as React from 'react';
},
}
}
>
详情
新增通知
</
PremButton
>
);
};
...
...
@@ -95,6 +99,50 @@ import * as React from 'react';
);
};
// 查看变量
const
checkVariableOpen
=
()
=>
{
setCheckVariableDraw
(
true
);
};
const
CheckVariable
=
()
=>
{
const
columns
=
[
{
title
:
'变量名称'
,
dataIndex
:
'variableName'
,
key
:
'variableName'
,
},
{
title
:
'变量编号'
,
dataIndex
:
'variableCode'
,
key
:
'variableCode'
,
},
{
title
:
'操作'
,
key
:
'action'
,
render
:
(
_
,
record
)
=>
(
<
Space
size=
"middle"
>
<
a
onClick=
{
()
=>
{
console
.
log
(
record
,
_
);
copy
(
record
.
variableCode
);
message
.
success
(
'已成功复制到剪切板!'
);
}
}
>
复制
</
a
>
</
Space
>
),
},
];
return
(
<
AutoTable
columns=
{
columns
}
path=
"/base/paBusinessMsgSceneVariable/queryPageBySceneId"
pagination=
{
false
}
/>
);
};
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
)?.
columns
;
return
defcolumn
.
concat
({
...
...
@@ -102,13 +150,23 @@ import * as React from 'react';
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
pathconfig
?.
enabledetail
&&
detail
(
text
,
row
,
_
,
action
),
pathconfig
?.
enableedit
&&
edit
(
text
,
row
,
_
,
action
),
pathconfig
?.
enabledelete
&&
remove
(
text
,
row
,
_
,
action
),
news
(
text
,
row
,
_
,
action
),
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
],
});
},
[]);
const
selectValueType
=
{
1
:
'全部'
,
2
:
'公司'
,
3
:
'部门'
,
4
:
'工厂'
,
5
:
'车间'
,
6
:
'工段'
,
7
:
'产线'
,
};
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
...
...
@@ -125,6 +183,7 @@ import * as React from 'react';
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
pushSettingFlag
:
true
,
open
:
true
,
item
:
null
,
title
:
'新增'
,
...
...
@@ -141,8 +200,16 @@ import * as React from 'react';
formRef=
{
formRef
}
placement=
"right"
detailpath=
{
pathconfig
?.
detail
||
null
}
checkVariableOpen=
{
checkVariableOpen
}
detailData=
{
drawer
?.
item
}
defaultFormValue=
{
drawer
?.
item
}
onValuesChange=
{
async
(
a
,
b
)
=>
{
if
(
a
?.
fitField
)
{
console
.
log
(
a
,
b
);
const
res
=
doFetch
({
url
:
selectValueType
[
a
?.
fitField
]
});
console
.
log
(
formRef
);
}
}
}
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
...
...
@@ -158,8 +225,19 @@ import * as React from 'react';
}
}
}
/>
<
Drawer
title=
"查看变量"
width=
{
700
}
placement=
"right"
onClose=
{
()
=>
{
setCheckVariableDraw
(
false
);
}
}
open=
{
checkVariableDraw
}
>
<
CheckVariable
/>
</
Drawer
>
</
div
>
);
}
}
export
default
Pushsetting
;
\ No newline at end of file
export
default
Pushsetting
;
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