diff --git a/src/pages/SystemMgm/MessageMgm/ConfMes/ConfInfoModal/index.jsx b/src/pages/SystemMgm/MessageMgm/ConfMes/ConfInfoModal/index.jsx new file mode 100644 index 0000000..2b24da8 --- /dev/null +++ b/src/pages/SystemMgm/MessageMgm/ConfMes/ConfInfoModal/index.jsx @@ -0,0 +1,121 @@ +import React, {useState, useEffect} from 'react' +import { Modal, Form, Input, DatePicker, TreeSelect, Button } from 'antd' +import moment from 'moment' +import './index.scss' + +function ConfInfoModal (props) { + const { + visible, + isEdit=false, + isDetail=false, + onCancel, + userListData=[], + data={}, + onOk + } = props + + const [baseForm] = Form.useForm() + + const rules = [ + { + required: true, + message: "此为必填字段", + }, + ] + + const handleSave = () => { + baseForm.validateFields().then((data) => { + onOk({...data, push_time: data.push_time.format('YYYY-MM-DD HH:mm:ss'), reciverId: data.reciverId.join(',')}) + }).catch(err => { + console.error(err) + }) + } + + useEffect(() => { + if (visible) { + baseForm.setFieldsValue({...data, push_time: moment(data.push_time), reciverId: data.reciverId ? data.reciverId.split(",") : undefined}) + } else { + baseForm.resetFields() + } + }, [visible]) + + return ( + +
+
+ + + { + !isDetail ? ( + + ) : ( +
{data.title}
+ ) + } +
+ + { + !isDetail ? ( + + ) : ( +
{data.content}
+ ) + } +
+ + { + !isDetail ? ( + + ) : ( +
{data.push_time}
+ ) + } +
+ + { + !isDetail ? ( + + ) : ( +
{data.reciver}
+ ) + } +
+
+
+ +
+ { + isDetail ? ( + + ) : ( + <> + + { + (data.infoId) ? ( + + ) : ( + + ) + } + + ) + } +
+
+ ) +} + +export default ConfInfoModal \ No newline at end of file diff --git a/src/pages/SystemMgm/MessageMgm/ConfMes/ConfInfoModal/index.scss b/src/pages/SystemMgm/MessageMgm/ConfMes/ConfInfoModal/index.scss new file mode 100644 index 0000000..e9b9762 --- /dev/null +++ b/src/pages/SystemMgm/MessageMgm/ConfMes/ConfInfoModal/index.scss @@ -0,0 +1,22 @@ +.modal-conf { + .conf-form-btn { + display: flex; + justify-content: center; + button { + margin: 0 10px; + &:first-child { + background: var(--button-default-bg); + } + } + } + .conf-detail-title { + font-size: 18px; + font-weight: 700; + } + .conf-detail-textarea { + min-height: 200px; + border: 1px solid #666d7d; + padding: 10px; + border-radius: 4px; + } +} \ No newline at end of file diff --git a/src/pages/SystemMgm/MessageMgm/ConfMes/index.scss b/src/pages/SystemMgm/MessageMgm/ConfMes/index.scss index 733a44a..ae1a205 100644 --- a/src/pages/SystemMgm/MessageMgm/ConfMes/index.scss +++ b/src/pages/SystemMgm/MessageMgm/ConfMes/index.scss @@ -1,105 +1,223 @@ @import "@/assets/css/mixin.scss"; -$color-container-bg: var(--color-container-bg); -$color-user-list-bg: var(--color-user-list-bg); -$color-text: var(--color-text); -$color-primary: var(--color-primary); -.ltc-box { - width: 100%; - .ltc-box-title { - font-size: 18px; - font-weight: bolder; - width: 100%; - white-space: nowrap; - overflow: hidden; - .text { - display: inline-block; - } - .line { - display: inline-block; - border: 1px dotted #607092; - width: inherit; - margin-bottom: 6px; - } - .ltc-icon { - width: 5px; - background: #0080db; - height: 19px; - display: inline-block; - margin-right: 10px; - } - .ltc-btn { - display: inline-block; - border: 1px solid; - border-radius: 5px; - margin: 0 10px; - width: 60px; - height: 35px; - line-height: 35px; +$color-container-bg : var(--color-container-bg); +$color-user-list-bg : var(--color-user-list-bg); +$color-text : var(--color-text); +$color-primary : var(--color-primary); + +.sys-container { + display: flex; + padding-top: 10px; + height: 100%; + .sys-container-left { + display: block; + width: 375px; + padding: 10px 10px 20px 20px; + } + .sys-container-right { + width: calc(100% - 375px); + padding-bottom: 15px; + padding: 20px; + background: var(--color-user-list-bg); + border-top-left-radius: 20px; + box-shadow: 0px 3px 8px 0px rgba(0, 0, 0, 0.08); + .ant-tabs .ant-tabs-nav-wrap .ant-tabs-nav-list { + width: unset; + } + .ant-tabs-tab { + padding: unset; + } + + .sys-content { + height: 100%; + display: flex; + flex-direction: column; + .sys-tabs { + margin-bottom: 10px; + } + .sys-wrapper { + flex: 1; + } + } + } +} +.sys-container { + .yisa-search { + width: 100%; + display: flex; + align-items: center; + margin-bottom: 24px; + + label { + color: var(--color-search-list-item-text); + flex: 0 0 27% !important; + max-width: 27% !important; + text-align: right; + padding-right: 8px; + } + + .form-con { + flex: 1; + width: 220px; + } + } + .form-btn { + display: flex; + flex-flow: row nowrap; + justify-content: space-between; + // margin: 40px 0px 0px; + padding: 0 3px; + + .ant-btn+.ant-btn { + margin-left: 10px; + } + + .ant-btn span { + font-size: 16px; + font-family: Microsoft YaHei, Microsoft YaHei-Regular; + font-weight: 400; text-align: center; - background: #409eff; - color: #fff; - font-weight: 100; - cursor: pointer; - } - .ltc-cancel { - background: #fff; - color: #000; - } - } - .ltc-box-line { - border: 1px solid #e7e7e7; - margin: 8px 0; - } - .ltc-box-in { - margin-left: 20px; - .ant-descriptions { - margin-left: 20px; + color: #ffffff; + } + + .reset { + width: 90px; + height: 36px; + background: var(--button-default-bg); + } + + .btn-export { + width: 90px; + height: 36px; + } + + .add-btn { + width: 90px; + height: 36px; + } + + .submit { + width: 90px; + height: 36px; + } } - } - .ltc-title { - margin: auto; - width: 50%; - text-align: center; - font-size: 18px; - font-weight: 600; - } - .ltc-content { - margin: auto; - padding: 20px; - .ltc-item { - font-size: 14px; - margin: 6px 12px 6px 0; - display: inline-flex; - //width: 470px; - .new-item { - display: inline-block; - width: 120px; - height: 32px; - line-height: 32px; - background: rgba(150,161,192,0.24); - text-align: center; - span { - color: red; + .ant-select-selector, + .ant-picker, + .ant-input { + background-color: var(--color-search-list-item-bg) !important; + box-shadow: none !important; + color: var(--color-search-list-item-value); + border-color: var(--color-search-list-item-bd) !important; + } + .ant-picker { + width: 100%; + } + .sys-search { + .title { + width: 100%; + font-size: 16px; + font-family: Microsoft YaHei, Microsoft YaHei-Bold; + font-weight: 700; + text-align: left; + color: var(--color-text); + margin-bottom: 20px; + } + } + .form-Wrap { + display: flex; + flex-direction: column; + } +} +.ant-cascader-menu { + width: 260px; +} + + +.sys-container-right { + .export-container { + margin-bottom: 10px; + text-align: right; + } + .sys-item { + height: 350px; + } + .sys-table-content { + margin-top: 20px; + .sys-table { + flex: 1; + .ant-table-body { + @include scrollBar(var(--color-user-list-bg), #3B97FF); + } + .ant-table-fixed-header .ant-table-tbody tr:nth-child(2n+1) > td { + background: unset !important; + background-color: #3e4557 !important; + } + .msg-item { + text-align: left; + .msg-title { + font-size: 18px; + font-weight: 700; + } + .msg-content { + display: inline-block; + font-size: 16px; + text-wrap: nowrap; + text-overflow: ellipsis; + overflow: hidden; + max-width: 100%; + } } - } - .new-value { - display: inline-block; - width: 320px; - height: 32px; - line-height: 32px; - text-align: center; - background: #3E4557; - box-shadow: 0px 3px 8px 0px rgba(0,0,0,0.12); - } - .ltc-item-input { - display: inline-block; - width: 200px; - } - div { - width: 150px; - } - } + } + } +} + +.action-btn { + // background: #409eff; + // border: none; + // width: 50px; + // border-radius: 4px; + cursor: pointer; + } + .action-wrapper { + div { + cursor: pointer; + margin-top: 5px; + } } -} +.sys-item { + color: #fff; + background: #3e4557; + border-radius: 4px; + display: flex; + flex-direction: column; + padding: 20px; + &-title { + height: 18px; + display: flex; + align-items: center; + position: relative; + text-indent: .5rem; + font-size: 16px; + font-weight: 700; + user-select: none; + .time { + font-size: 12px; + } + &::before { + position: absolute; + content: ""; + height: 100%; + width: 4px; + left: -2px; + background: var(--color-menu-selected-text-item); + } + } + &-content { + flex: 1; + .echarts-for-react { + height: 100% !important; + } + } +} + diff --git a/src/pages/SystemMgm/MessageMgm/ConfMes/index2.scss b/src/pages/SystemMgm/MessageMgm/ConfMes/index2.scss new file mode 100644 index 0000000..733a44a --- /dev/null +++ b/src/pages/SystemMgm/MessageMgm/ConfMes/index2.scss @@ -0,0 +1,105 @@ +@import "@/assets/css/mixin.scss"; +$color-container-bg: var(--color-container-bg); +$color-user-list-bg: var(--color-user-list-bg); +$color-text: var(--color-text); +$color-primary: var(--color-primary); + +.ltc-box { + width: 100%; + .ltc-box-title { + font-size: 18px; + font-weight: bolder; + width: 100%; + white-space: nowrap; + overflow: hidden; + .text { + display: inline-block; + } + .line { + display: inline-block; + border: 1px dotted #607092; + width: inherit; + margin-bottom: 6px; + } + .ltc-icon { + width: 5px; + background: #0080db; + height: 19px; + display: inline-block; + margin-right: 10px; + } + .ltc-btn { + display: inline-block; + border: 1px solid; + border-radius: 5px; + margin: 0 10px; + width: 60px; + height: 35px; + line-height: 35px; + text-align: center; + background: #409eff; + color: #fff; + font-weight: 100; + cursor: pointer; + } + .ltc-cancel { + background: #fff; + color: #000; + } + } + .ltc-box-line { + border: 1px solid #e7e7e7; + margin: 8px 0; + } + .ltc-box-in { + margin-left: 20px; + .ant-descriptions { + margin-left: 20px; + } + } + .ltc-title { + margin: auto; + width: 50%; + text-align: center; + font-size: 18px; + font-weight: 600; + } + .ltc-content { + margin: auto; + padding: 20px; + .ltc-item { + font-size: 14px; + margin: 6px 12px 6px 0; + display: inline-flex; + //width: 470px; + .new-item { + display: inline-block; + width: 120px; + height: 32px; + line-height: 32px; + background: rgba(150,161,192,0.24); + text-align: center; + span { + color: red; + } + } + .new-value { + display: inline-block; + width: 320px; + height: 32px; + line-height: 32px; + text-align: center; + background: #3E4557; + box-shadow: 0px 3px 8px 0px rgba(0,0,0,0.12); + } + .ltc-item-input { + display: inline-block; + width: 200px; + } + div { + width: 150px; + } + } + } + +} diff --git a/src/pages/SystemMgm/MessageMgm/ConfMes/loadable.jsx b/src/pages/SystemMgm/MessageMgm/ConfMes/loadable.jsx index feea232..f89e043 100644 --- a/src/pages/SystemMgm/MessageMgm/ConfMes/loadable.jsx +++ b/src/pages/SystemMgm/MessageMgm/ConfMes/loadable.jsx @@ -1,284 +1,406 @@ -import React, { useState, useRef, useEffect } from "react"; -import { - message, - Pagination, - Table, - Input, - Space, - Modal, - Button, - Select, - Tabs, - Descriptions, - Transfer, -} from "antd"; -import moment from "moment"; -import ajax from '@/services' -import { TableModule } from "@/components"; -import { dictionary } from "@/config/common.js"; -import "./index.scss"; -//import ReactQuill, { Quill } from 'react-quill'; -//import "react-quill/dist/quill.snow.css"; +import React, { useState, useRef, useEffect } from "react" +import { Select, Input, Button, Table, message, Pagination, DatePicker, Cascader, Tooltip, Popover, Modal } from "antd" +import { DeleteOutlined } from '@ant-design/icons' +import { ResultFlowResult, QuickMenu } from '@/components' +import { dictionary } from "@/config/common" +import ConfInfoModal from './ConfInfoModal' +import ajax from "@/services" +import moment from "moment" +import './index.scss' -function ConfMes() { - const [resultData, setResultData] = useState([]) - const [sendData, setSendData] = useState({}) - const [total, setTotal] = useState(0); - const [detailVisible, setDetailVisible] = useState(true); - const [tabKey, setTabKey] = useState("1"); - // 已选择平台商户 - const [targetKeys, setTargetKeys] = useState([]); - // 勾选平台商户 - const [selectedKeys, setSelectedKeys] = useState([]); - // 选项在两栏之间转移时的回调 - const onTransferChange = (nextTargetKeys) => { - setTargetKeys(nextTargetKeys); - }; +function ConfMes(props) { + const { - // 选中项发生改变时的回调 - const onTransferSelectChange = (sourceSelectedKeys, targetSelectedKeys) => { - setSelectedKeys([...sourceSelectedKeys, ...targetSelectedKeys]); - }; - const columns = [ + } = props + + const [loading, setLoading] = useState(false) + const defaultFormData = { + keyword: '', + // start_time: moment().startOf("day").format('YYYY-MM-DD'), + // end_time: moment().format('YYYY-MM-DD'), + start_time: '', + end_time: '' + } + const [formData, setFormData] = useState({ + ...defaultFormData + }) + const [pageInfo, setPageInfo] = useState({ + pn: 1, + length: 10 + }) + const [resultData, setResultDate] = useState({ + list: [], + totalRecords: 0 + }) + const [infoModalVisible, setInfoModalVisible] = useState(false) + const [isEdit, setIsEdit] = useState(false) + const [isDetail, setIsDetail] = useState(false) + const [activeInfo, setActiveInfo] = useState({}) + const [userTreeList, setUserTreeList] = useState([]) + const tableColumns = [ { title: "序号", - dataIndex: "index", - key: "index", - align: "center", - render: (_, record, index) => { - return index + 1; - }, + width: 60, + align: 'center', + render: (text, record, index) => (pageInfo.pn - 1) * pageInfo.length + index + 1 }, { - title: "标题", - dataIndex: "a", - key: "a", - align: "center", - fixed: "right", - }, - { - title: "操作人", - dataIndex: "me", - key: "me", - align: "center", - fixed: "right", - }, - { - title: "所属路段", - dataIndex: "s", - key: "s", - align: "center", - fixed: "right", + title: "消息详情", + align: 'center', + render: (text, record) => { + return ( +
+
{record.title}
+ +
{record.content}
+
+
+ ) + } }, { - title: "发送时间", - dataIndex: "d", - key: "de", - align: "center", - fixed: "right", + title: "接收人", + width: 200, + align: 'center', + dataIndex: "reciver", }, { - title: "状态", - dataIndex: "d", - key: "r", - align: "center", - fixed: "right", + title: "推送时间", + width: 200, + align: 'center', + dataIndex: "push_time", }, { - title: "操作", - dataIndex: "operation", - key: "operation", - align: "center", - fixed: "right", - render: (_, record) => { - return ( - + + + } + } + ] + const paginationProps = { + className: "pagination-common", + showQuickJumper: true, + showSizeChanger: true, + current: pageInfo.pn, + total: resultData?.totalRecords, + pageSize: pageInfo.length, + pageSizeOptions: Array.from( + new Set([...[15], ...(dictionary?.pageSizeOptions || [])]) + ), + onChange: (current, size) => { + setPageInfo({ + ...pageInfo, + ...{ pn: current, length: size } + }); + } + } + const toDeftime = (v) => { + setFormData({ + ...formData, + start_time: moment(v.startDateTime), + end_time: moment(v.endDateTime) + }) + } + const ajaxGetListData = () => { + setLoading(true) + ajax.getMsgConfList({...formData, ...pageInfo}).then(res => { + if (res.status == 20000) { + setResultDate({ + list: res.data, + totalRecords: res.totalRecords || 0 + }) + } + setLoading(false) + }) + } - }} - > - 操作 - - ); - }, - }, - ]; - //检索条件 - const formSearch = [ - { - name: "status", - type: "Select", - label: "状态", - options: [ - { - label: "全部", - value: -1, - }, - { - label: "已发送", - value: 0, - }, - { - label: "未发送", - value: 1, - }, - ], - }, + const ajaxGetUserListData = () => { + ajax.getUserTreeData().then(res => { + if (res.status == 20000) { + setUserTreeList(res.data) + } + }) + } - ]; + const TimeChange = () => { + let e = formData.date_type; + let str = "date"; + let mat = "YYYY-MM-DD"; + if (e == "year") { + str = "year"; + mat = "YYYY"; + } else if (e == "month") { + str = "month"; + mat = "YYYY-MM"; + } else if (e == "week") { + str = "week"; + mat = "YYYY-MM-DD"; + } + return { str, mat }; + } - //列表数据 - function search(e) { - console.log(e) - ajax.getConfMesList(e).then((res) => { - let { status, data, total } = res - if (status == 20000) { - if (data.list) { - setResultData(data.list) - setTotal(data.total) + const ajaxMsgInfoUpdate = (data) => { + return new Promise((resolve, rejected) => { + ajax.msgConfUpdate(data).then((res) => { + if (res.status == 20000) { + resolve(res.messgae) } else { - setResultData(data) - setTotal(total) + rejected(res.message) } - } else { - setResultData([]) - message.error(res.message) + }).catch((err) => { + rejected(err) + }) + }) + } + + const handleInfoUpdate = (data) => { + ajaxMsgInfoUpdate(data).then(msg => { + message.success(msg) + setInfoModalVisible(false) + handleSearch() + }).catch(err => { + console.log(err) + }) + } + + const handleAdd = () => { + setIsEdit(true) + setIsDetail(false) + setActiveInfo({}) + setInfoModalVisible(true) + } + + const handleDel = (data) => { + Modal.confirm({ + title: '确认删除', + content: `是否删除此消息?`, + icon: , + onOk: () => { + ajaxMsgDel(data).then(msg => { + message.success(msg) + handleSearch() + }).catch(err => { + console.error(err) + }) } }) } - const textModules = { - toolbar: { - container: [ - [{ 'size': ['small', false, 'large', 'huge'] }], //字体设置 - // [{ 'header': [1, 2, 3, 4, 5, 6, false] }], //标题字号,不能设置单个字大小 - ['bold', 'italic', 'underline', 'strike'], - [{ 'list': 'ordered' }, { 'list': 'bullet' }, { 'indent': '-1' }, { 'indent': '+1' }], - ['link', 'image'], // a链接和图片的显示 - [{ 'align': [] }], - [{ - 'background': ['rgb( 0, 0, 0)', 'rgb(230, 0, 0)', 'rgb(255, 153, 0)', - 'rgb(255, 255, 0)', 'rgb( 0, 138, 0)', 'rgb( 0, 102, 204)', - 'rgb(153, 51, 255)', 'rgb(255, 255, 255)', 'rgb(250, 204, 204)', - 'rgb(255, 235, 204)', 'rgb(255, 255, 204)', 'rgb(204, 232, 204)', - 'rgb(204, 224, 245)', 'rgb(235, 214, 255)', 'rgb(187, 187, 187)', - 'rgb(240, 102, 102)', 'rgb(255, 194, 102)', 'rgb(255, 255, 102)', - 'rgb(102, 185, 102)', 'rgb(102, 163, 224)', 'rgb(194, 133, 255)', - 'rgb(136, 136, 136)', 'rgb(161, 0, 0)', 'rgb(178, 107, 0)', - 'rgb(178, 178, 0)', 'rgb( 0, 97, 0)', 'rgb( 0, 71, 178)', - 'rgb(107, 36, 178)', 'rgb( 68, 68, 68)', 'rgb( 92, 0, 0)', - 'rgb(102, 61, 0)', 'rgb(102, 102, 0)', 'rgb( 0, 55, 0)', - 'rgb( 0, 41, 102)', 'rgb( 61, 20, 10)'] - }], - [{ - 'color': ['rgb( 0, 0, 0)', 'rgb(230, 0, 0)', 'rgb(255, 153, 0)', - 'rgb(255, 255, 0)', 'rgb( 0, 138, 0)', 'rgb( 0, 102, 204)', - 'rgb(153, 51, 255)', 'rgb(255, 255, 255)', 'rgb(250, 204, 204)', - 'rgb(255, 235, 204)', 'rgb(255, 255, 204)', 'rgb(204, 232, 204)', - 'rgb(204, 224, 245)', 'rgb(235, 214, 255)', 'rgb(187, 187, 187)', - 'rgb(240, 102, 102)', 'rgb(255, 194, 102)', 'rgb(255, 255, 102)', - 'rgb(102, 185, 102)', 'rgb(102, 163, 224)', 'rgb(194, 133, 255)', - 'rgb(136, 136, 136)', 'rgb(161, 0, 0)', 'rgb(178, 107, 0)', - 'rgb(178, 178, 0)', 'rgb( 0, 97, 0)', 'rgb( 0, 71, 178)', - 'rgb(107, 36, 178)', 'rgb( 68, 68, 68)', 'rgb( 92, 0, 0)', - 'rgb(102, 61, 0)', 'rgb(102, 102, 0)', 'rgb( 0, 55, 0)', - 'rgb( 0, 41, 102)', 'rgb( 61, 20, 10)'] - }], - ['clean'], //清空 - ['emoji'], //emoji表情,设置了才能显示 - ['video2'], //我自定义的视频图标,和插件提供的不一样,所以设置为video2 - ], - // handlers: { - // 'image': this.imageHandler.bind(this), //点击图片标志会调用的方法 - // 'video2': this.showVideoModal.bind(this), - // }, - }, - // ImageExtend: { - // loading: true, - // name: 'img', - // action: RES_URL + "connector?isRelativePath=true", - // response: res => FILE_URL + res.info.url - // }, - ImageDrop: true, - 'emoji-toolbar': true, //是否展示出来 - "emoji-textarea": false, //我不需要emoji展示在文本框所以设置为false - "emoji-shortname": true, - } - return ( - <> - { setDetailVisible(true) }} - style={{ width: '100px' }} - > - 配置消息 - + + const ajaxMsgDel = (data) => { + return new Promise((resolved, rejected) => { + ajax.msgConfDel({infoId: data.infoId}).then(res => { + if (res.status == 20000) { + resolved(res.message) } - isExport={false} //是否显示导出按钮 - //initFormData={initFormData} - //pageName={'geomagneticSignalMgm'} - //exportUrl="" - /> - { - setDetailVisible(false); - }} - footer={[ - ]} - > -
-
-
-
*消息标题:
-
- { console.log(e.target.value) }} /> -
+ }).catch(err => { + rejected(err) + }) + }) + } + + const handleEdit = (data) => { + setIsEdit(true) + setIsDetail(false) + setActiveInfo({...data}) + setInfoModalVisible(true) + } + + const handleDetail = (data) => { + setIsEdit(false) + setIsDetail(true) + setActiveInfo({...data}) + setInfoModalVisible(true) + } + + const handleInfoModalCancel = () => { + setInfoModalVisible(false) + } + + const handleReset = () => { + setFormData({ + ...defaultFormData + }) + setPageInfo({ + pn: 1, + length: 10 + }) + } + + const handleSearch = () => { + ajaxGetListData() + } + + useEffect(() => { + ajaxGetListData() + }, [JSON.stringify(pageInfo)]) + + useEffect(() => { + ajaxGetUserListData() + }, []) + + return ( +
+
+
+
查询条件
+
+
+ + setFormData({...formData, keyword: v.target.value})} + />
-
-
-
-
*接收人群:
- item.text} +
+ + { + if (TimeChange().str == "week") { + setFormData({ + ...formData, + start_time: date + ? moment(date).day(1).format("YYYY-MM-DD") + : null, + }); + } else if (TimeChange().str == "day") { + if (date > moment(formData.end_time)) { + setFormData({ + ...formData, + end_time: dateString, + start_time: formData.end_time, + }); + } else { + setFormData({ + ...formData, + start_time: dateString, + }); + } + } else { + setFormData({ ...formData, start_time: dateString }); + } + }} + disabledDate={(current) => current > moment(formData.end_time)} /> +
-
-
-
-
*消息内容:
- {/* { this.reactQuillRef = el }} - //defaultValue={postRichText} - key="1" - id="textDiv1" theme="snow" - // modules={textModules} - /> */} +
+ + { + if (TimeChange().str == "week") { + setFormData({ + ...formData, + end_time: date + ? moment(date).day(7).format("YYYY-MM-DD") + : null, + }); + } else if (TimeChange().str == "day") { + if (date < moment(formData.start_time)) { + setFormData({ + ...formData, + start_time: dateString, + end_time: formData.start_time, + }); + } else { + setFormData({ + ...formData, + end_time: dateString, + }); + } + } else { + setFormData({ ...formData, end_time: dateString }); + } + }} + disabledDate={(current) => + current < moment(formData.start_time) + } + /> +
+
+ toDeftime(v)} /> +
+
+ + +
- - - ); +
+
+
+ + + + + + + + + ) } export default ConfMes; \ No newline at end of file diff --git a/src/pages/SystemMgm/MessageMgm/ConfMes/loadable2.jsx b/src/pages/SystemMgm/MessageMgm/ConfMes/loadable2.jsx new file mode 100644 index 0000000..feea232 --- /dev/null +++ b/src/pages/SystemMgm/MessageMgm/ConfMes/loadable2.jsx @@ -0,0 +1,284 @@ +import React, { useState, useRef, useEffect } from "react"; +import { + message, + Pagination, + Table, + Input, + Space, + Modal, + Button, + Select, + Tabs, + Descriptions, + Transfer, +} from "antd"; +import moment from "moment"; +import ajax from '@/services' +import { TableModule } from "@/components"; +import { dictionary } from "@/config/common.js"; +import "./index.scss"; +//import ReactQuill, { Quill } from 'react-quill'; +//import "react-quill/dist/quill.snow.css"; + +function ConfMes() { + const [resultData, setResultData] = useState([]) + const [sendData, setSendData] = useState({}) + const [total, setTotal] = useState(0); + const [detailVisible, setDetailVisible] = useState(true); + const [tabKey, setTabKey] = useState("1"); + // 已选择平台商户 + const [targetKeys, setTargetKeys] = useState([]); + // 勾选平台商户 + const [selectedKeys, setSelectedKeys] = useState([]); + // 选项在两栏之间转移时的回调 + const onTransferChange = (nextTargetKeys) => { + setTargetKeys(nextTargetKeys); + }; + + // 选中项发生改变时的回调 + const onTransferSelectChange = (sourceSelectedKeys, targetSelectedKeys) => { + setSelectedKeys([...sourceSelectedKeys, ...targetSelectedKeys]); + }; + const columns = [ + { + title: "序号", + dataIndex: "index", + key: "index", + align: "center", + render: (_, record, index) => { + return index + 1; + }, + }, + { + title: "标题", + dataIndex: "a", + key: "a", + align: "center", + fixed: "right", + }, + { + title: "操作人", + dataIndex: "me", + key: "me", + align: "center", + fixed: "right", + }, + { + title: "所属路段", + dataIndex: "s", + key: "s", + align: "center", + fixed: "right", + }, + { + title: "发送时间", + dataIndex: "d", + key: "de", + align: "center", + fixed: "right", + }, + { + title: "状态", + dataIndex: "d", + key: "r", + align: "center", + fixed: "right", + }, + { + title: "操作", + dataIndex: "operation", + key: "operation", + align: "center", + fixed: "right", + render: (_, record) => { + return ( + + ); + }, + }, + ]; + //检索条件 + const formSearch = [ + { + name: "status", + type: "Select", + label: "状态", + options: [ + { + label: "全部", + value: -1, + }, + { + label: "已发送", + value: 0, + }, + { + label: "未发送", + value: 1, + }, + ], + }, + + ]; + + //列表数据 + function search(e) { + console.log(e) + ajax.getConfMesList(e).then((res) => { + let { status, data, total } = res + if (status == 20000) { + if (data.list) { + setResultData(data.list) + setTotal(data.total) + } else { + setResultData(data) + setTotal(total) + } + } else { + setResultData([]) + message.error(res.message) + } + }) + } + const textModules = { + toolbar: { + container: [ + [{ 'size': ['small', false, 'large', 'huge'] }], //字体设置 + // [{ 'header': [1, 2, 3, 4, 5, 6, false] }], //标题字号,不能设置单个字大小 + ['bold', 'italic', 'underline', 'strike'], + [{ 'list': 'ordered' }, { 'list': 'bullet' }, { 'indent': '-1' }, { 'indent': '+1' }], + ['link', 'image'], // a链接和图片的显示 + [{ 'align': [] }], + [{ + 'background': ['rgb( 0, 0, 0)', 'rgb(230, 0, 0)', 'rgb(255, 153, 0)', + 'rgb(255, 255, 0)', 'rgb( 0, 138, 0)', 'rgb( 0, 102, 204)', + 'rgb(153, 51, 255)', 'rgb(255, 255, 255)', 'rgb(250, 204, 204)', + 'rgb(255, 235, 204)', 'rgb(255, 255, 204)', 'rgb(204, 232, 204)', + 'rgb(204, 224, 245)', 'rgb(235, 214, 255)', 'rgb(187, 187, 187)', + 'rgb(240, 102, 102)', 'rgb(255, 194, 102)', 'rgb(255, 255, 102)', + 'rgb(102, 185, 102)', 'rgb(102, 163, 224)', 'rgb(194, 133, 255)', + 'rgb(136, 136, 136)', 'rgb(161, 0, 0)', 'rgb(178, 107, 0)', + 'rgb(178, 178, 0)', 'rgb( 0, 97, 0)', 'rgb( 0, 71, 178)', + 'rgb(107, 36, 178)', 'rgb( 68, 68, 68)', 'rgb( 92, 0, 0)', + 'rgb(102, 61, 0)', 'rgb(102, 102, 0)', 'rgb( 0, 55, 0)', + 'rgb( 0, 41, 102)', 'rgb( 61, 20, 10)'] + }], + [{ + 'color': ['rgb( 0, 0, 0)', 'rgb(230, 0, 0)', 'rgb(255, 153, 0)', + 'rgb(255, 255, 0)', 'rgb( 0, 138, 0)', 'rgb( 0, 102, 204)', + 'rgb(153, 51, 255)', 'rgb(255, 255, 255)', 'rgb(250, 204, 204)', + 'rgb(255, 235, 204)', 'rgb(255, 255, 204)', 'rgb(204, 232, 204)', + 'rgb(204, 224, 245)', 'rgb(235, 214, 255)', 'rgb(187, 187, 187)', + 'rgb(240, 102, 102)', 'rgb(255, 194, 102)', 'rgb(255, 255, 102)', + 'rgb(102, 185, 102)', 'rgb(102, 163, 224)', 'rgb(194, 133, 255)', + 'rgb(136, 136, 136)', 'rgb(161, 0, 0)', 'rgb(178, 107, 0)', + 'rgb(178, 178, 0)', 'rgb( 0, 97, 0)', 'rgb( 0, 71, 178)', + 'rgb(107, 36, 178)', 'rgb( 68, 68, 68)', 'rgb( 92, 0, 0)', + 'rgb(102, 61, 0)', 'rgb(102, 102, 0)', 'rgb( 0, 55, 0)', + 'rgb( 0, 41, 102)', 'rgb( 61, 20, 10)'] + }], + ['clean'], //清空 + ['emoji'], //emoji表情,设置了才能显示 + ['video2'], //我自定义的视频图标,和插件提供的不一样,所以设置为video2 + ], + // handlers: { + // 'image': this.imageHandler.bind(this), //点击图片标志会调用的方法 + // 'video2': this.showVideoModal.bind(this), + // }, + }, + // ImageExtend: { + // loading: true, + // name: 'img', + // action: RES_URL + "connector?isRelativePath=true", + // response: res => FILE_URL + res.info.url + // }, + ImageDrop: true, + 'emoji-toolbar': true, //是否展示出来 + "emoji-textarea": false, //我不需要emoji展示在文本框所以设置为false + "emoji-shortname": true, + } + return ( + <> + { setDetailVisible(true) }} + style={{ width: '100px' }} + > + 配置消息 + + } + isExport={false} //是否显示导出按钮 + //initFormData={initFormData} + //pageName={'geomagneticSignalMgm'} + //exportUrl="" + /> + { + setDetailVisible(false); + }} + footer={[ + ]} + > +
+
+
+
*消息标题:
+
+ { console.log(e.target.value) }} /> +
+
+
+
+
+
*接收人群:
+ item.text} + /> +
+
+
+
+
*消息内容:
+ {/* { this.reactQuillRef = el }} + //defaultValue={postRichText} + key="1" + id="textDiv1" theme="snow" + // modules={textModules} + /> */} +
+
+
+
+ + ); +} + +export default ConfMes; \ No newline at end of file diff --git a/src/pages/SystemMgm/OrgnizationMgm/loadable.jsx b/src/pages/SystemMgm/OrgnizationMgm/loadable.jsx index 51fb193..32db69b 100644 --- a/src/pages/SystemMgm/OrgnizationMgm/loadable.jsx +++ b/src/pages/SystemMgm/OrgnizationMgm/loadable.jsx @@ -101,6 +101,7 @@ function OrgnizationMgm() { name: '', level: Number(level) + 1 }) + getDepartTree() setOrgModalVisible(true) setOrgEditStatus(false) @@ -329,7 +330,7 @@ function OrgnizationMgm() { ajaxOrgDetailSave(Object.assign({}, baseForm.getFieldsValue(), { id: activeOrg.id, role: roleCheckedKeys.join(','), - control_area: baseForm.getFieldValue('control_area').join(',') + control_area: baseForm.getFieldValue('control_area') })).then((msg) => { message.success(msg) setEditStatus(false) @@ -434,7 +435,7 @@ function OrgnizationMgm() { { + return ajax({ + url: "/api/msg/conf/list", + type: "get", + data: params, + }) +}; + +const getUserTreeData = (data) => { + return ajax({ + url: '/api/v1/admin/user/get_user_tree_list', + type: 'get' + }) +} + +const msgConfUpdate = (data) => { + return ajax({ + url: "/api/msg/conf/update", + type: "post", + data: data, + }) +} + +const msgConfDel = (data) => { + return ajax({ + url: "/api/msg/conf/del", + type: "post", + data: data, + }) +} + + +export default { + getMsgConfList, + getUserTreeData, + msgConfUpdate, + msgConfDel +} \ No newline at end of file diff --git a/src/services/SystemMgm/index.js b/src/services/SystemMgm/index.js index 7b3813f..c667515 100644 --- a/src/services/SystemMgm/index.js +++ b/src/services/SystemMgm/index.js @@ -2,9 +2,11 @@ import AdminMgm from "./AdminMgm"; import RoleMgm from "./RoleMgm"; import BusinessConf from "./BusinessConf"; import SystemLog from "./SystemLog"; +import MsgMgm from "./MsgMgm"; export default { ...AdminMgm, ...RoleMgm, ...BusinessConf, ...SystemLog, + ...MsgMgm };