Browse Source

fix():修复路内bug

tags/PMS_Frontend_v1.0.6-develop
guoxin 1 year ago
parent
commit
7ea4e250ff
  1. 0
      src/pages/InRoadMgm/PersonMgm/MesNotification/demon.jsx
  2. 0
      src/pages/InRoadMgm/PersonMgm/MesNotification/demon.scss
  3. 208
      src/pages/InRoadMgm/PersonMgm/MesNotification/index.scss
  4. 573
      src/pages/InRoadMgm/PersonMgm/MesNotification/loadable.jsx
  5. 10
      src/services/search.js

0
src/pages/InRoadMgm/PersonMgm/MesNotification/demon.jsx

0
src/pages/InRoadMgm/PersonMgm/MesNotification/demon.scss

208
src/pages/InRoadMgm/PersonMgm/MesNotification/index.scss

@ -4,24 +4,7 @@ $color-user-list-bg : var(--color-user-list-bg);
$color-text : var(--color-text);
$color-primary : var(--color-primary);
.push-box {
width: calc(100% - 375px);
padding: 20px;
background: var(--color-user-list-bg);
border-top-left-radius: 20px;
box-shadow: 0px 3px 8px 0px rgb(0 0 0 / 8%);
margin-top: 10px;
.push-item {
display: flex;
margin: 14px 0;
.title {
width: 100px;
}
.ant-input-textarea {
width: 400px;
}
}
}
.colorBtn {
width: 90px;
height: 36px;
@ -54,70 +37,161 @@ $color-primary : var(--color-primary);
border-radius: 4px;
}
}
.search-box {
.paid-MesNotification{
display: flex;
padding: 15px;
width: 100%;
padding: 20px;
height: calc(100% - 10px);
background: var(--color-user-list-bg);
border-top-left-radius: 20px;
box-shadow: 0px 3px 8px 0px rgb(0 0 0 / 8%);
.paid-search{
.search{
font-size: 16px;
font-family: Microsoft YaHei, Microsoft YaHei-Bold;
font-weight: 700;
text-align: left;
color: #eeeff1;
}
label{
margin:0 10px;
}
.yisa-search{
margin-top: 10px;
.time {
display: inline-block;
}
.btn-box {
display: inline-block;
.search-btn {
margin: 0 10px ;
display: flex;
label{
line-height: 31px;
}
}
.ant-select:not(.ant-select-customize-input) .ant-select-selector{
background-color: #50586c !important;
}
.ant-select-arrow .anticon{
background-color: #50586c !important;
}
.ant-input:placeholder-shown{
background-color: #50586c !important;
}
.timePicker{
width: 350px;
margin-top: 22px;
.btnBox{
display:flex ;
margin-top: 20px;
.yisa-btn{
margin-left: 20px;
width: 130px;
}
.root_gfkk{
margin-left: 20px;
.export-content{
width: 130px;
height: 33px;
display: flex;
align-items: center;
justify-content: center;
background: #3b97ff;
border-radius: 3px;
cursor: pointer;
color: #fff;
margin-right: 10px;
}
}
}
.result-box {
width: 100%;
height: 600px;
.table-wrap {
height: calc(100% - 32px - 65px);
}
.ant-tabs {
margin-bottom: 16px;
.ant-tabs-nav {
margin-bottom: 0 !important;
&::before {
border-bottom: 1px solid var(--color-card-line) !important;
}
}
.ant-tabs-nav-wrap {
.paid-result{
width: 100%;
box-sizing: content-box;
.ant-tabs-nav-list {
width: 340px;
.ant-tabs-ink-bar {
height: 3px;
background-color: #00ccff;
}
.ant-tabs-tab {
flex: 1;
width: 100%;
display: flex;
justify-content: center;
padding-bottom: 10px;
text-align: center;
cursor: pointer;
font-size: 14px !important;
font-family: MicrosoftYaHei;
height: 800px;
background: #505a6f;
border-radius: 20px;
margin-left: 17px;
.result{
padding: 25px;
.font{
font-family: Microsoft YaHei, Microsoft YaHei-Regular;
font-weight: 400;
text-align: left;
color: #eeeff1;
margin-bottom: 10px;
display: inline-block;
em{
color: #3aa8fe;
margin: 0 5px;
}
}
.yisa-table .ant-table-thead .ant-table-cell{
background-color: #616b83 !important;
color: #ffffff !important;
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-Bold;
font-weight: 700;
text-align: center;
letter-spacing: 0.7px;
border-right: none !important;
border-top-color: #888f9d !important;
border-color: #888f9d !important;
}
.ant-tabs-tab-active {
div {
color: #00ccff;
.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table, .ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table{
border-top: none !important;
border-left: none !important;
}
.ant-table-tbody .ant-table-row .ant-table-cell{
background-color: #3e4557 !important;
color: #ffffff !important;
text-align: center;
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-Regular;
font-weight: 400;
border-right: none !important;
border-left: none !important;
border-bottom-color: #626b7e !important;
}
}
}
}
.revenue{
.tab-title{
text-align: center;
font-size: 18px;
font-weight: 400;
font-family: Microsoft YaHei, Microsoft YaHei-Regular;
}
.pop-card {
width: 700px !important;
.tab-index{
.tab-top{
display: flex;
flex-direction: row;
margin-top: 10px;
height: 30px;
line-height: 30px;
white-space: nowrap;
overflow: hidden;
border-bottom: 1px solid #e4e7ed;
.tab-li{
margin-left: 20px;
cursor: pointer;
}
.active{
color:#409eff ;
cursor: pointer;
margin-left: 20px;
border-bottom: 1px solid #409eff !important;
margin-bottom: -1px !important;
}
}
.tab-bottom{
.yisa-tab{
.ant-table-cell{
background-color: #616b83 !important;
color: #ffffff !important;
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-Bold;
font-weight: 700;
text-align: center;
border-right: none !important;
border-left: none !important;
border-bottom-color: #868d9d !important;
}
}
}
}
}

573
src/pages/InRoadMgm/PersonMgm/MesNotification/loadable.jsx

@ -1,389 +1,272 @@
import React, { useState, useRef, useEffect } from "react";
import { ResultFlowResult } from "@/components"
import { Select, Button, Table, message, Pagination } from 'antd'
import {
message,
Pagination,
Table,
Form,
Space,
Modal,
DatePicker,
Input,
Button,
Select,
Tabs,
Descriptions,
Transfer
} from "antd";
const { RangePicker } = DatePicker;
import moment from "moment";
const { TextArea } = Input;
import ajax from '@/config/ajax.js'
import { TableModule, ResultFlow, } from "@/components";
import { dictionary, utils } from "@/config/common";
pageSizeOptions
} from '@/config/character.config.js'
import "./index.scss";
import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
import ajax from '@/services'
import { useSessionStorageState } from "ahooks"
function MesNotification(props) {
const [ajaxLoading, setAjaxLoading] = useState(false)
const [resultData, setResultData] = useState({
data: [],
total_records: 0,
export_url: '',
process_url: ""
})
const parameter={
operatorid: '',
brand_id: '',
model_id: '',
pn: 1,
page_size: Number(pageSizeOptions[0]), //
}
const [formData, setFormData] = useState(parameter)
const [lastFormData, setLastFormData] = useState(formData)
//
const handleJobStatus = (value) => {
setFormData({ ...formData, model_id: value })
}
//
const [getBrandId, setGetBrandId] = useState({})
const handleOperator = (v) => {
setGetBrandId(v)
setFormData({ ...formData, brand_id: v })
}
//
const handleDeployType = (value) => {
setFormData({ ...formData, operatorid: value })
}
//
const handleColumns = (tab) => {
let result = [...deployListColumns];
switch (tab) {
case '1':
result.splice(5, 1)
break;
function loadable() {
const columns = [
}
return result;
}
//
const getResetData = () => {
setFormData({
...parameter
})
getData({ ...parameter })
}
//
const deployListColumns = [
{
title: "序号",
dataIndex: "index",
key: "index",
align: "center",
fixed: "left",
render: (text, record, index) => index + 1,
width: 100,
title: '序号',
render: (_, record, index) => {
return index + 1
}
},
{
title: "接收人类型",
dataIndex: "receiver_type",
key: "receiver_type",
width: 100,
align: "center",
title: '接收人类型',
dataIndex: 'receiver_type',
key: 'receiver_type',
},
{
title: "接收人",
dataIndex: "receiver",
key: "receiver",
width: 100,
align: "center",
title: '接收人',
dataIndex: 'receiver',
key: 'receiver',
},
{
title: "发送内容",
dataIndex: "content",
key: "content",
width: 100,
align: "center",
title: '发送内容',
dataIndex: 'content',
key: 'content',
},
{
title: "发送人",
dataIndex: "sender",
key: "sender",
width: 100,
align: "center",
title: '发送人',
dataIndex: 'sender',
key: 'sender',
},
{
title: "发送时间",
dataIndex: "send_time",
key: "send_time",
width: 100,
align: "center",
},
];
const [loading, setLoading] = useState(false);
const [tag, setTag] = useState('1');
const [sfyVisible, setSfyVisible] = useState(false);
const [pageData, setPageData] = useState({
//
pn: 1,
page_size: 15,
});
const [resultData, setResultData] = useState([])
const [sendData, setSendData] = useState({
receiver_type: 1,//1,2,PDA3
receiver: '',//
receiver_id: '',//id
content: '',//
})
function onShowSizeChange(pn, page_size) {
setPageData({
pn,
page_size,
});
}
const handleChange = (value) => {
console.log(`selected ${value}`);
setSendData({ ...sendData, receiver_type: value })
};
const inputParams = {
maxLength: 50,
showCount: true,
};
const [total, setTotal] = useState([]);
const [mockData, setMockData] = useState([]);
const [formData, setFormData] = useState({
//start: moment().subtract(1, "month").format("YYYY-MM-DD HH:mm:ss"),
//end: moment().format("YYYY-MM-DD HH:mm:ss"),
start: '',
end: '',
});
const [targetKeys, setTargetKeys] = useState([]);
const [selectedKeys, setSelectedKeys] = useState([]);
const onChange = (nextTargetKeys, direction, moveKeys) => {
console.log('targetKeys:', nextTargetKeys);
console.log('direction:', direction);
console.log('moveKeys:', moveKeys);
setTargetKeys(nextTargetKeys);
//setSendData({ ...sendData, receiver_id: nextTargetKeys })
};
const onChangeText = (e) => {
setSendData({ ...sendData, content: e.target.value })
};
const onSelectChange = (sourceSelectedKeys, targetSelectedKeys) => {
// console.log('sourceSelectedKeys:', sourceSelectedKeys);
//console.log('targetSelectedKeys:', targetSelectedKeys);
setSendData({ ...sendData, receiver_id: targetSelectedKeys })
setSelectedKeys([...sourceSelectedKeys, ...targetSelectedKeys]);
};
const onScroll = (direction, e) => {
console.log('direction:', direction);
console.log('target:', e.target);
};
const handleSearch = (dir, value) => {
console.log('search:', dir, value);
};
function onChangeTime(value, dateString) {
console.log('Selected Time: ', value);
console.log('Formatted Selected Time: ', dateString);
setFormData({ start: dateString[0], end: dateString[1] })
};
//退
const formSearch = [
{//13
name: "timePeriod",
type: "RangePicker",
label: "时间段",
defaultValue: [moment().startOf("day"), moment()],
defaultTitle: ['发送时间', '至']
},
];
function send() {
var arr = []
mockData.map((e) => {
if (sendData.receiver_id) {
sendData.receiver_id?.map((d) => {
if (d == e.key) {
arr.push(e.title)
}
title: '发送时间',
dataIndex: 'send_time',
key: 'send_time',
}]
//
const getData = (data = formData) => {
setAjaxLoading(true)
ajax.MesNotificationData(data).then(res => {
setAjaxLoading(false)
if (res.status === 20000) {
let resDataArr = res.data.list.map((item) => {
item.key = item.id
return item
})
}
setResultData({
...resultData,
data: resDataArr,
total_records: res.data.total_records
})
if ((sendData.receiver_type > 1) && sendData.receiver_id.length == 0) {
message.error("请勾选接收人")
return
}
//console.log(arr)
ajax({
url: "/api/bpm/message/send",
type: "post",
data: { ...sendData, receiver: arr },
}).then((res) => {
console.log(res)
let { status, data } = res
if (status == 20000) {
// console.log(data.list)
message.success(res.message)
setTag('1');
} else {
setResultData({
data: [],
total_records: 0,
export_url: '',
process_url: ""
})
message.error(res.message)
}
}, err => {
console.log(err)
})
}
function getpad() {
ajax({
url: sendData.receiver_type == 2 ? "/api/bpm/operator/get_all_worker" : "/api/bpm/operator/get_all_operator",
type: "get",
data: { type: "message" }
}).then((res) => {
let { status, data } = res
if (status == 20000) {
let arr = []
data.map((e) => {
let obj = {
key: e.value,
title: e.label
//
const changePn = (pn, length) => {
if (formData.page_size === length) {
setFormData(Object.assign({}, formData, { pn: pn, page_size: length }))
setLastFormData(Object.assign({}, lastFormData, { pn: pn, page_size: length }))
getData(Object.assign({}, formData, { pn: pn, page_size: length }))
}
}
//
const changeLength = (pn, length) => {
setFormData(Object.assign({}, formData, { pn: 1, page_size: length }))
setLastFormData(Object.assign({}, lastFormData, { pn: 1, page_size: length }))
getData(Object.assign({}, formData, { pn: 1, page_size: length }))
}
//
const getSearchData = (data = formData) => {
getData(data)
}
arr.push(obj)
const [getOperationName, setGetOperationName] = useState([])
const operationName = () => {
ajax.assetsType().then(res => {
setGetOperationName(res.data)
})
setMockData(arr)
} else {
message.error(res.message)
}
const [getMerchantDataName, setGetMerchantDataName] = useState([])
const merchantDataName = () => {
ajax.getOperator().then(res => {
setGetMerchantDataName(res.data)
})
}
function search(e) {
console.log(e)
ajax({
url: "/api/bpm/message/list",
type: "post",
data: { ...e },
}).then((res) => {
let { status, data } = res
if (status == 20000) {
setResultData(data.list)
setTotal(data.total)
} else {
message.error(res.message)
const [getAssetsModel, setGetAssetsModel] = useState([])
const assetsModelName = () => {
let data = {
brand_id: getBrandId
}
ajax.assetsModel(data).then(res => {
setGetAssetsModel(res.data)
})
}
// useEffect(() => {
// search()
// }, [pageData]);
useEffect(() => {
getpad()
}, [sendData.receiver_type])
return (
<>
{
tag == 2 ?
<div className="push-box">
<div><a onClick={() => { setTag('1') }}>返回</a></div>
<div className="push-item">
<div className="title">接收人类型</div>
assetsModelName()
}, [getBrandId])
const [sessionTabList, setSessionTabList] = useSessionStorageState('MesNotification', {
value: {
}
})
useEffect(() => {
console.log(location)
if (sessionTabList && Object.values(sessionTabList).length > 0) {
setFormData({
brand_id: sessionTabList?.brand_id,
model_id: sessionTabList?.model_id,
operatorid: sessionTabList?.operatorid,
pn: sessionTabList?.pn,
page_size: sessionTabList?.page_size,
})
}
}, [])
console.log(formData);
useEffect(() => {
setSessionTabList({
...formData
})
}, [formData])
useEffect(() => {
getData()
merchantDataName()
operationName()
}, [])
return <>
<div className="paid-MesNotification">
<div className="paid-search">
<label className="search">查询条件</label>
<div className="yisa-search">
<label>商户名称</label>
<Select
defaultValue="1"
style={{
width: 120,
}}
onChange={handleChange}
options={[
{
value: '1',
label: '全平台',
},
{
value: '2',
label: 'PDA账号',
},
{
value: '3',
label: '运营商',
},
]}
style={{ width: 220 }}
// allowClear
value={formData.operatorid}
options={getMerchantDataName}
onChange={handleDeployType}
/>
</div>
{
sendData.receiver_type == 1 ? null :
<div className="push-item">
<div className="title">接收人 </div>
<Transfer
dataSource={mockData}
titles={['未选择', '已选择']}
targetKeys={targetKeys}
selectedKeys={selectedKeys}
onChange={onChange}
showSearch={true}
onSelectChange={onSelectChange}
//onSearch={handleSearch}
//onScroll={onScroll}
render={(item) => item.title}
<div className="yisa-search">
<label>物品类型</label>
<Select
style={{ width: 220 }}
value={formData.brand_id}
options={getOperationName}
onChange={handleOperator}
/>
</div>
}
<div className="push-item">
<div className="title">发送内容</div>
<TextArea rows={4} onChange={onChangeText} placeholder="" maxLength={200} showCount />
<div className="yisa-search">
<label>物品型号</label>
<Select
style={{ width: 220 }}
placeholder="请选择"
value={formData.model_id}
options={getAssetsModel}
onChange={handleJobStatus}
/>
</div>
<div className="btn-box">
<Button
type="primary"
className="submit search-btn colorBtn"
onClick={() => send()}
>
发送
<div className="timePicker ">
<div className="btnBox">
<Button type="primary" className="yisa-btn colorBtn" icon={<SearchOutlined />} onClick={() => { getSearchData() }}>
搜索
</Button>
<Button type="primary" className="yisa-btn colorReset" icon={<DeleteOutlined />} onClick={() => { getResetData() }}>
清空
</Button>
<Button className="push search-btn colorReset" onClick={() => { setTag('1'); }}>取消</Button>
</div>
</div> :
// <div>
// <div className="search-box">
// <div className="time">:
// <div style={{ width: "400px", display: "inline-block" }}>
// <RangePicker
// showTime={{
// format: "HH:mm:ss",
// }}
// defaultValue={[moment().subtract(1, "month"), moment()]}
// format="YYYY-MM-DD HH:mm:ss"
// onChange={onChangeTime}
// />
// </div>
// </div>
// <div className="btn-box">
// <Button
// type="primary"
// className="submit search-btn colorBtn"
// onClick={() => search()}
// >
//
// </Button>
// <Button className="push search-btn colorReset" onClick={() => {
// setTag('2');
// setSendData({
// receiver_type: 1,//1,2,PDA3
// receiver: '',//
// receiver_id: '',//id
// content: '',//
// })
// setSelectedKeys([])
// setTargetKeys([])
// }}></Button>
// </div>
// </div>
// <div className="result-box right-list">
// <ResultFlow
// hasLoad={true}
// loading={loading}
// resultData={resultData}
// message={""}
// >
// <div className="table-wrap">
// <Table
// // className="yisa-table"
// columns={columns}
// dataSource={resultData}
// pagination={false}
// // scroll={{ x: 1500 }}
// />
// </div>
// <div>
// <Pagination
// className="pagination-common"
// showSizeChanger={true}
// showQuickJumper={true}
// // showTotal={() => ` ${total_records} `}
// total={0}
// current={pageData.pn}
// pageSize={pageData.page_size}
// pageSizeOptions={dictionary?.pageSizeOptions}
// onChange={onShowSizeChange}
// onShowSizeChange={onShowSizeChange}
// />
// </div>
// </ResultFlow>
// </div>
// </div>
<TableModule
columns={columns}
tableData={resultData}
formSearch={formSearch}
total={total}
isExport={false}
search={search}
pageName={'mesNotification'}
//exportUrl={exportUrl}
rowKey={'id'}
/>
</div>
</div>
<div className="paid-result">
<div className="result">
<span className="font">共检索到<em>{resultData.total_records}</em>条结果</span>
<ResultFlowResult ajaxLoad={ajaxLoading} resultData={resultData.data ? resultData.data : []}>
<Table
bordered
// className='yisa-table'
dataSource={resultData.data}
columns={
handleColumns()
}
<Modal
open={sfyVisible}
width={800}
title={'收费员选择'}
onCancel={() => {
setSfyVisible(false);
}}
onOk={() => {
setSfyVisible(false);
}}
>
<div>
<div>残疾人证</div>
pagination={false}
loading={ajaxLoading}
/>
<Pagination
className="pagination-common"
showSizeChanger
showQuickJumper
showTotal={() => `${resultData.total_records}`}
total={resultData.total_records}
current={formData.pn}
pageSize={formData.page_size}
pageSizeOptions={pageSizeOptions}
onChange={changePn}
onShowSizeChange={changeLength}
/>
</ResultFlowResult>
</div>
</div>
</div>
</Modal>
</>
);
}
export default loadable;
export default MesNotification;

10
src/services/search.js

@ -279,6 +279,7 @@ const getPoleTemplateData = (params) => {
return ajax({
url: "/api/bpm/device/pole_position_import_template",
type: "post",
data: params,
});
};
@ -387,6 +388,14 @@ const attendanceData = (params) => {
data: params,
});
};
//消息通知
const MesNotificationData=(params)=>{
return ajax({
url: "/api/bpm/message/list",
type: "post",
data: params,
});
}
// 人员考勤-导出
const attendanceExport = (params) => {
return ajax({
@ -1170,6 +1179,7 @@ export default {
getAddAbnormal,
getAddDeleteData,
specialExport,
MesNotificationData,
attendanceExport,
salesExport,
statExport,

Loading…
Cancel
Save