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
2 years ago
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11
parent
c69946df
Changes
4
Hide 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
>
);
}
...
...
This diff is collapsed.
Click to expand it.
src/global.less
View file @
36c434a1
...
...
@@ -485,4 +485,11 @@ ol {
aside {
z-index: 998;
}
}
#pushSettingBtn {
position: relative;
top: -162px;
left: 74px;
color: #1890ff;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/pages/system/pushsetting/columns.js
View file @
36c434a1
function
getcolumns
(
setdrawer
)
{
return
{
"columns"
:
[
{
"title"
:
"推送场景"
,
"dataIndex"
:
"businessMsgSceneId"
,
"key"
:
"businessMsgSceneId"
},
{
"title"
:
"推送方式"
,
"dataIndex"
:
"sendMethodType"
,
"key"
:
"sendMethodType"
},
{
"title"
:
"适用类型"
,
"dataIndex"
:
"fitField"
,
"key"
:
"fitField"
,
"valueType"
:
"select"
,
"mode"
:
"radio"
,
"options"
:
[
{
"label"
:
"全部"
,
"value"
:
"1"
return
{
columns
:
[
{
title
:
'推送场景'
,
dataIndex
:
'msgSceneName'
,
key
:
'businessMsgSceneId'
,
valueType
:
'select'
,
options
:
{
path
:
'/base/paBusinessMsgScene/queryAllForSelect'
,
params
:
{},
},
},
{
title
:
'推送方式'
,
dataIndex
:
'sendMethodName'
,
key
:
'sendMethodType'
,
valueType
:
'select'
,
options
:
[
{
value
:
'4'
,
label
:
'邮件'
,
},
],
},
{
title
:
'适用类型'
,
dataIndex
:
'fitFieldName'
,
key
:
'fitField'
,
valueType
:
'select'
,
mode
:
'radio'
,
options
:
[
{
label
:
'全部'
,
value
:
'1'
,
},
{
label
:
'公司'
,
value
:
'2'
,
},
{
label
:
'部门'
,
value
:
'3'
,
},
{
label
:
'工厂'
,
value
:
'4'
,
},
{
label
:
'车间'
,
value
:
'5'
,
},
{
label
:
'工段'
,
value
:
'6'
,
},
{
label
:
'产线'
,
value
:
'7'
,
},
],
},
{
title
:
'类型名称'
,
dataIndex
:
'fieldName'
,
key
:
'fieldId'
,
},
{
title
:
'推送内容'
,
dataIndex
:
'sendContent'
,
key
:
'sendContent'
,
valueType
:
'textarea'
,
},
],
pathconfig
:
{
enableadd
:
true
,
enableedit
:
true
,
enabledelete
:
true
,
enabledetail
:
true
,
add
:
''
,
edit
:
''
,
list
:
'/base/paBusinessMsgOption/queryList'
,
delete
:
'/base/paBusinessMsgOption/deleteById'
,
detail
:
''
,
},
{
"label"
:
"公司"
,
"value"
:
"2"
},
{
"label"
:
"部门"
,
"value"
:
"3"
},
{
"label"
:
"工厂"
,
"value"
:
"4"
},
{
"label"
:
"车间"
,
"value"
:
"5"
},
{
"label"
:
"工段"
,
"value"
:
"6"
},
{
"label"
:
"产线"
,
"value"
:
"7"
}
]
},
{
"title"
:
"适用选择"
,
"dataIndex"
:
"fieldId"
,
"key"
:
"fieldId"
},
{
"title"
:
"推送标题"
,
"dataIndex"
:
"sendTitle"
,
"key"
:
"sendTitle"
},
{
"title"
:
"推送内容"
,
"dataIndex"
:
"sendContent"
,
"key"
:
"sendContent"
}
],
"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
};
}
export
default
getcolumns
;
This diff is collapsed.
Click to expand it.
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
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
open
:
false
,
});
const
pathconfig
=
useMemo
(()
=>
{
let
pathconf
=
getcolumns
(
setdrawer
)?.
pathconfig
??
{};
return
pathconf
;
},
[]);
const
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
onSuccess
:
(
res
,
params
)
=>
{
if
(
res
?.
code
==
'0000'
)
{
actionRef
?.
current
?.
reload
();
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
}
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
;
},
[]);
const
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
onSuccess
:
(
res
,
params
)
=>
{
if
(
res
?.
code
==
'0000'
)
{
actionRef
?.
current
?.
reload
();
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
}
},
});
const
news
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'详情'
,
val
:
'detail'
,
title
:
'详细信息'
,
}));
},
}
}
>
新增通知
</
PremButton
>
);
};
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'编辑'
,
val
:
'edit'
,
}));
},
}
}
>
编辑
</
PremButton
>
);
};
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
pop=
{
{
title
:
'是否删除?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
run
({
url
:
pathconfig
?.
delete
||
'/delete'
,
params
:
{
id
:
row
?.
id
}
});
},
}
}
btn=
{
{
size
:
'small'
,
type
:
'danger'
,
}
}
>
删除
</
PremButton
>
);
};
// 查看变量
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
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
news
(
text
,
row
,
_
,
action
),
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
],
});
},
[]);
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
type
:
'link'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'详情'
,
val
:
'detail'
,
title
:
'详细信息'
,
}));
},
}
}
>
详情
</
PremButton
>
);
};
const
selectValueType
=
{
1
:
'全部'
,
2
:
'公司'
,
3
:
'部门'
,
4
:
'工厂'
,
5
:
'车间'
,
6
:
'工段'
,
7
:
'产线'
,
};
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
pagetitle=
"推送配置"
columns=
{
columns
}
actionRef=
{
actionRef
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
resizeable=
{
true
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
disabled
:
false
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
pushSettingFlag
:
true
,
open
:
true
,
item
:
row
,
title
:
'
编辑
'
,
val
:
'
edit
'
,
item
:
null
,
title
:
'
新增
'
,
val
:
'
add
'
,
}));
},
}
}
>
编辑
</
PremButton
>
);
};
},
}
}
/>
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
pop=
{
{
title
:
'是否删除?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
run
({
url
:
pathconfig
?.
delete
||
'/delete'
,
params
:
{
id
:
row
?.
id
}
});
},
}
}
btn=
{
{
size
:
'small'
,
type
:
'danger'
,
}
}
>
删除
</
PremButton
>
);
};
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
)?.
columns
;
return
defcolumn
.
concat
({
title
:
'操作'
,
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
),
],
});
},
[]);
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
pagetitle=
"推送配置"
columns=
{
columns
}
actionRef=
{
actionRef
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
resizeable=
{
true
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
disabled
:
false
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
}));
},
},
}
}
/>
<
DrawerPro
fields=
{
columns
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
formRef=
{
formRef
}
placement=
"right"
detailpath=
{
pathconfig
?.
detail
||
null
}
detailData=
{
drawer
?.
item
}
defaultFormValue=
{
drawer
?.
item
}
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
}
}
{
...
drawer
}
onFinish=
{
(
vals
)
=>
{
if
(
drawer
?.
val
==
'add'
)
{
run
({
url
:
pathconfig
?.
add
||
'/add'
,
params
:
{
...
vals
}
});
}
else
if
(
drawer
?.
val
==
'edit'
)
{
run
({
url
:
pathconfig
?.
edit
||
'/edit'
,
params
:
{
...
vals
,
id
:
drawer
?.
item
?.
id
}
});
}
}
}
/>
</
div
>
);
}
<
DrawerPro
fields=
{
columns
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
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
,
open
:
false
,
}));
}
}
{
...
drawer
}
onFinish=
{
(
vals
)
=>
{
if
(
drawer
?.
val
==
'add'
)
{
run
({
url
:
pathconfig
?.
add
||
'/add'
,
params
:
{
...
vals
}
});
}
else
if
(
drawer
?.
val
==
'edit'
)
{
run
({
url
:
pathconfig
?.
edit
||
'/edit'
,
params
:
{
...
vals
,
id
:
drawer
?.
item
?.
id
}
});
}
}
}
/>
<
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
;
This diff is collapsed.
Click to expand it.
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