From 06657480afe93b2ea93fe082add5e2877d98a209 Mon Sep 17 00:00:00 2001 From: fengxiang <361798944@qq.com> Date: Wed, 13 Sep 2023 15:48:15 +0800 Subject: [PATCH] =?UTF-8?q?fix():=20=E5=BC=80=E5=8F=91=E7=9F=AD=E4=BF=A1?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OperationSales/AdsMgm/index.scss | 31 +- .../OperationSales/AdsMgm/loadable.jsx | 12 +- .../OperationSales/AppPushMgm/index.scss | 4 +- .../OperationSales/AppPushMgm/loadable.jsx | 5 +- .../OperationSales/InformationMgm/index.scss | 41 ++- .../OperationSales/InformationMgm/loadable.jsx | 151 +++++++-- .../OperationSales/ShortMessageMgm/index.scss | 263 ++++++++++++++- .../OperationSales/ShortMessageMgm/loadable.jsx | 365 ++++++++++++++++++++- .../OperationCenter/OperationMarket/index.js | 2 + .../OperationMarket/shortMessage.js | 12 + 10 files changed, 822 insertions(+), 64 deletions(-) create mode 100644 src/services/OperationCenter/OperationMarket/shortMessage.js diff --git a/src/pages/OperationCenter/OperationSales/AdsMgm/index.scss b/src/pages/OperationCenter/OperationSales/AdsMgm/index.scss index 6bba845..e444ca4 100644 --- a/src/pages/OperationCenter/OperationSales/AdsMgm/index.scss +++ b/src/pages/OperationCenter/OperationSales/AdsMgm/index.scss @@ -14,7 +14,7 @@ display: flex; width: 100%; height: 100%; - padding: 10px 0 0 10px; + padding-top: 10px; } .full-group { @@ -28,7 +28,7 @@ .search-group { display: block; width: 375px; - padding: 10px; + padding: 10px 10px 20px 20px; .title { width: 100%; @@ -414,9 +414,32 @@ } } -.modal-set { +.modal-ads { + + .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; + } + .btn-box { margin-top: 20px; - text-align: right; + text-align: center; + + .ant-btn+.ant-btn { + margin-left: 20px; + } + + .cancel { + border: 1px solid var(--button-default-bg); + background: var(--button-default-bg); + + span { + color: #ffffff; + } + } } } \ No newline at end of file diff --git a/src/pages/OperationCenter/OperationSales/AdsMgm/loadable.jsx b/src/pages/OperationCenter/OperationSales/AdsMgm/loadable.jsx index 0e14f86..b550495 100644 --- a/src/pages/OperationCenter/OperationSales/AdsMgm/loadable.jsx +++ b/src/pages/OperationCenter/OperationSales/AdsMgm/loadable.jsx @@ -321,7 +321,7 @@ function AdsMgm() { // 分页 const paginationProps = { className: "pagination-common", - position: ["bottomCenter"], + // position: ["bottomCenter"], showQuickJumper: true, showSizeChanger: true, current: pageInfo.pageNum, @@ -888,7 +888,7 @@ function AdsMgm() { onClick={handleSearch} loading={loading} > - 搜索 + 查询 @@ -1274,7 +1274,7 @@ function AdsMgm() { footer={null} width={450} onCancel={() => setModalObj({ ...modalObj, visible: false })} - className="modal-set" + className="modal-ads" >
setModalObj({ ...modalObj, name: e.target.value })} />
+ diff --git a/src/pages/OperationCenter/OperationSales/AppPushMgm/index.scss b/src/pages/OperationCenter/OperationSales/AppPushMgm/index.scss index c2eed67..4167662 100644 --- a/src/pages/OperationCenter/OperationSales/AppPushMgm/index.scss +++ b/src/pages/OperationCenter/OperationSales/AppPushMgm/index.scss @@ -14,7 +14,7 @@ display: flex; width: 100%; height: 100%; - padding: 10px 0 0 10px; + padding-top: 10px; } .full-group { @@ -28,7 +28,7 @@ .search-group { display: block; width: 375px; - padding: 10px; + padding: 10px 10px 20px 20px; .title { width: 100%; diff --git a/src/pages/OperationCenter/OperationSales/AppPushMgm/loadable.jsx b/src/pages/OperationCenter/OperationSales/AppPushMgm/loadable.jsx index dd9dac9..f234b3a 100644 --- a/src/pages/OperationCenter/OperationSales/AppPushMgm/loadable.jsx +++ b/src/pages/OperationCenter/OperationSales/AppPushMgm/loadable.jsx @@ -233,7 +233,8 @@ function AppPushMgm() { // 分页 const paginationProps = { - position: ["bottomCenter"], + className: "pagination-common", + // position: ["bottomCenter"], showQuickJumper: true, showSizeChanger: true, current: pageInfo.pageNum, @@ -505,7 +506,7 @@ function AppPushMgm() { onClick={handleSearch} loading={loading} > - 搜索 + 查询
diff --git a/src/pages/OperationCenter/OperationSales/InformationMgm/index.scss b/src/pages/OperationCenter/OperationSales/InformationMgm/index.scss index 2c78571..5efe782 100644 --- a/src/pages/OperationCenter/OperationSales/InformationMgm/index.scss +++ b/src/pages/OperationCenter/OperationSales/InformationMgm/index.scss @@ -15,7 +15,7 @@ display: flex; width: 100%; height: 100%; - padding: 10px 0 0 10px; + padding-top: 10px; } .full-group, @@ -30,7 +30,7 @@ .search-group { display: block; width: 375px; - padding: 10px; + padding: 10px 10px 20px 20px; .title { width: 100%; @@ -276,6 +276,9 @@ .ant-input { width: 120px; + } + + .gap { margin: 0 5px; } } @@ -513,6 +516,13 @@ .r-txt { min-width: 85px; text-align: right; + + &.required::before { + margin-right: 4px; + color: #f56c6c; + font-family: SimSun, sans-serif; + content: "*"; + } } .r-con { @@ -527,9 +537,32 @@ } } -.modal-set { +.modal-info { + + .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; + } + .btn-box { margin-top: 20px; - text-align: right; + text-align: center; + + .ant-btn+.ant-btn { + margin-left: 20px; + } + + .cancel { + border: 1px solid var(--button-default-bg); + background: var(--button-default-bg); + + span { + color: #ffffff; + } + } } } \ No newline at end of file diff --git a/src/pages/OperationCenter/OperationSales/InformationMgm/loadable.jsx b/src/pages/OperationCenter/OperationSales/InformationMgm/loadable.jsx index c956479..687052d 100644 --- a/src/pages/OperationCenter/OperationSales/InformationMgm/loadable.jsx +++ b/src/pages/OperationCenter/OperationSales/InformationMgm/loadable.jsx @@ -392,7 +392,8 @@ function InformationMgm() { // 分页 const paginationProps = { - position: ["bottomCenter"], + className: "pagination-common", + // position: ["bottomCenter"], showQuickJumper: true, showSizeChanger: true, current: pageInfo.pageNum, @@ -728,7 +729,75 @@ function InformationMgm() { newObj["general"] = general; newObj["content"] = content; } - console.log(newObj); + // console.log(newObj); + if (!newObj?.coverUrl?.length) { + message.error("请上传封面图片"); + return; + } + if (rowData?.coverType == 1 && newObj?.coverUrl?.length < 3) { + message.error("请上传三张封面图片"); + return; + } + if (!newObj?.title) { + message.error("请输入文章标题"); + return; + } + if (!newObj?.author) { + message.error("请输入文章作者"); + return; + } + if (!newObj?.areaId?.length) { + message.error("请选择区域"); + return; + } + if (!newObj?.releaseType?.length) { + message.error("请选择发布渠道"); + return; + } + if (!newObj?.shareTitle) { + message.error("请输入分享标题"); + return; + } + if (!newObj?.shareDescribe) { + message.error("请输入分享描述"); + return; + } + if (!newObj?.shareImgUrl) { + message.error("请上传分享缩略图"); + return; + } + if (!newObj?.introduction) { + message.error("请输入简介"); + return; + } + if (!newObj?.categoryId) { + message.error("请选择分类"); + return; + } + if (!newObj?.readBasics) { + message.error("请输入阅读数基础值"); + return; + } + if (!newObj?.readMultiple) { + message.error("请输入阅读数放大倍数"); + return; + } + if (!newObj?.pointBasics) { + message.error("请输入点赞数基础值"); + return; + } + if (!newObj?.pointMultiple) { + message.error("请输入点赞数放大倍数"); + return; + } + if (newObj?.isReprint == 1 && !newObj?.jumpUrl) { + message.error("请输入原文链接"); + return; + } + if (newObj?.isReprint == 0 && !newObj?.general) { + message.error("请输入内容"); + return; + } ajax[newObj?.informationId ? "doInfoEdit" : "doInfoInsert"](newObj).then( (res) => { @@ -940,7 +1009,7 @@ function InformationMgm() { onClick={handleSearch} loading={loading} > - 搜索 + 查询 @@ -1030,7 +1099,7 @@ function InformationMgm() {
-
封面图片:
+
封面图片:
-
标题:
+
标题:
-
作者:
+
作者:
-
区域:
+
区域:
-
发布渠道:
+
发布渠道:
-
分享标题:
+
分享标题:
-
分享描述:
+
分享描述:
-
分享缩略图:
+
分享缩略图:
-
简介:
+
简介:
-
是否置顶:
+
是否置顶:
-
分类:
+
分类:
-
+
handleForm("readBasics", e.target.value)} /> - + - - × + + + + ×
-
+
- + - - × + + + + × {rowData?.isReprint == 1 ? (
-
原文链接:
+
原文链接:
handleForm("upperTime", str)} />
+
+
定时下架时间:
-
内容:
+
内容:
- {/*
-
-
上传资源:
-
{rowData?.attachmentPath || "-"}
-
-
-
内容:
-
-
+ {/* {rowData?.isReprint != 1 ? ( +
+
+
上传资源:
+
+ {rowData?.attachmentPath || "-"} +
+
+
+
内容:
+
+
+
-
*/} + ) : null} */}
{/* 设置 */} @@ -1569,7 +1644,7 @@ function InformationMgm() { footer={null} width={450} onCancel={() => setModalObj({ ...modalObj, visible: false })} - className="modal-set" + className="modal-info" >
setModalObj({ ...modalObj, name: e.target.value })} />
+ diff --git a/src/pages/OperationCenter/OperationSales/ShortMessageMgm/index.scss b/src/pages/OperationCenter/OperationSales/ShortMessageMgm/index.scss index 1838f71..292526e 100644 --- a/src/pages/OperationCenter/OperationSales/ShortMessageMgm/index.scss +++ b/src/pages/OperationCenter/OperationSales/ShortMessageMgm/index.scss @@ -1,5 +1,260 @@ @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); + +.short-message-mgm { + width: 100%; + height: 100%; + overflow-y: auto; + @include scrollBar(#8bb3e3, #3471c4); + + .hidden { + display: none !important; + } + + .mgm-wraper { + display: flex; + width: 100%; + height: 100%; + padding-top: 10px; + } + + .full-group { + width: 100%; + padding: 15px 15px 0; + border-radius: 6px; + background: var(--color-user-list-bg); + box-shadow: 0px 3px 8px 0px rgb(0 0 0 / 8%); + } + + .search-group { + display: block; + width: 375px; + padding: 10px 10px 20px 20px; + + .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; + } + + .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; + } + + .form-box { + width: 100%; + display: flex; + align-items: center; + margin-bottom: 20px; + + .form-txt { + color: var(--color-search-list-item-text); + flex: 0 0 25%; + max-width: 25%; + text-align: right; + padding-right: 6px; + } + + + .form-con { + flex: 1; + width: 220px; + } + + .form-long { + flex: 1; + min-width: 220px; + } + } + + .form-btn { + display: flex; + flex-flow: row nowrap; + justify-content: space-between; + margin: 40px 10px 10px; + 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; + color: #ffffff; + } + + .reset { + width: 90px; + height: 36px; + border-radius: 4px; + background: var(--button-default-bg); + } + + .submit { + width: calc(100% - 100px); + height: 36px; + border-radius: 4px; + } + } + } + + .row-operate { + display: flex; + justify-content: flex-end; + } + + .ant-btn+.ant-btn { + margin-left: 10px; + } + + .green { + background-color: #67c23a; + border-color: #67c23a; + } + + .result-group { + 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); + + + .row-head { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 12px; + + .number-wrapper { + display: inline-flex; + align-items: center; + font-size: 14px; + + .letter { + color: var(--color-text); + font-size: 14px; + } + + .total-number { + color: var(--color-primary); + font-weight: bold; + margin: 0 4px; + font-size: 14px; + } + } + } + + .cc-result-flow { + width: 100%; + height: calc(100% - 34px - 13px); + + .yisa-table { + width: 100%; + height: calc(100% - 32px - 15px); + overflow-y: auto !important; + @include scrollBar(#8bb3e3, #3471c4); + + .ant-table-thead { + th { + background: var(--color-table-header-bg) !important; + } + } + + .ant-table-tbody { + td { + background: var(--color-table-body-bg) !important; + border-bottom-color: var(--color-table-border-bottom-color); + } + + tr:nth-child(even) { + td { + background: var(--color-table-body-bg-nth-child-even) !important; + } + } + } + + .row-pic { + width: 100%; + display: flex; + align-items: center; + justify-content: flex-start; + + .ant-image { + margin-right: 3px; + } + } + } + } + } + +} + +.modal-short { + + .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; + } + + .row-box { + width: 100%; + display: flex; + margin-bottom: 16px; + + .r-txt { + padding-right: 8px; + min-width: 80px; + text-align: right; + + &.required::before { + margin-right: 4px; + color: #f56c6c; + font-family: SimSun, sans-serif; + content: "*"; + } + } + + .r-con { + flex: 1; + + .text { + margin-bottom: 8px; + } + } + } + + .btn-box { + margin-top: 20px; + text-align: center; + + .ant-btn+.ant-btn { + margin-left: 20px; + } + + .cancel { + border: 1px solid var(--button-default-bg); + background: var(--button-default-bg); + + span { + color: #ffffff; + } + } + } +} \ No newline at end of file diff --git a/src/pages/OperationCenter/OperationSales/ShortMessageMgm/loadable.jsx b/src/pages/OperationCenter/OperationSales/ShortMessageMgm/loadable.jsx index 98db05e..beba80d 100644 --- a/src/pages/OperationCenter/OperationSales/ShortMessageMgm/loadable.jsx +++ b/src/pages/OperationCenter/OperationSales/ShortMessageMgm/loadable.jsx @@ -1,15 +1,360 @@ import React, { useState, useRef, useEffect } from "react"; -// import { message, Pagination, Table, Space, Modal, } from "antd"; -// import { dictionary, utils } from "@/config/common"; -// import moment from 'moment' +import { + message, + Input, + Select, + Button, + DatePicker, + Pagination, + Table, + Modal, +} from "antd"; +import { ResultFlowResult } from "@/components"; // import { useSessionStorageState, useUpdateEffect, useSize, useUpdate } from 'ahooks'; -// import ajax from "@/services" -// import { FormInput, FormSelect, OptionPanel, ResultPanel, FormSliderPicker, AreaCascader, ImgResize, ImgZoom, } from "@/components" -// import "./index.scss"; -// import errorImg from "@/assets/images/layout/error.png" -// import { useLocation } from "react-router-dom"; +import ajax from "@/services/OperationCenter/OperationMarket"; +import { dictionary } from "@/config/common"; +import moment from "moment"; +import "./index.scss"; + +// 短信管理 function ShortMessageMgm() { - return
ShortMessageMgm
+ // 默认数据 + const defaultData = { + phoneNumber: "", // 手机号 + msgType: "", // 类型 + times: "", // 时间 + }; + // 分页数据 + const [pageInfo, setPageInfo] = useState({ + pageNum: 1, + pageSize: 15, + }); + // 表单数据 + const [formData, setFormData] = useState(defaultData); + // 搜索提交数据-存储 + const [holdData, setHoldData] = useState(formData); + // 访问接口,isAjax改变时执行 + const [isAjax, setIsAjax] = useState(false); + // 检索按钮加载状态 + const [loading, setLoading] = useState(false); + // 表格加载状态 + const [tabLoading, setTabLoading] = useState(false); + // 表格返回数据 + const [resultData, setResultData] = useState({ + total: 0, + list: [], + }); + + // 所有下拉菜单 + const [typeList, setTypeList] = useState([]); + + // 弹窗 + const [visible, setVisible] = useState(false); + const [modalObj, setModalObj] = useState({ + phoneNumber: "", //手机号 + content: "", //内容 + }); + + // 访问接口,获取下拉 + useEffect(() => { + getSelectList(); + }, []); + + // 访问接口,获取表格 + useEffect(() => { + getData(); + }, [isAjax]); + + // 表头 + const columns = [ + { + title: "手机号", + dataIndex: "phoneNumber", + align: "center", + }, + { + title: "消息类型", + dataIndex: "msgType", + align: "center", + render: (val, row, index) => { + return getTypeText(val); + }, + }, + { + title: "内容", + dataIndex: "content", + align: "center", + }, + { + title: "操作人", + dataIndex: "operatorId", + align: "center", + }, + { + title: "时间", + dataIndex: "updatedTime", + align: "center", + sorter: (a, b) => + moment(a.updatedTime).diff(moment(b.updatedTime), "seconds"), + }, + ]; + + // 获取状态文本 + const getTypeText = (val) => { + const obj = typeList.filter((v, i) => v.sms_id == val); + return obj?.length ? obj[0].sms_name : "-"; + }; + + // 分页 + const paginationProps = { + className: "pagination-common", + // position: ["bottomCenter"], + showQuickJumper: true, + showSizeChanger: true, + current: pageInfo.pageNum, + total: resultData?.total, + showTotal: () => `共 ${resultData.total || 0} 条`, + pageSize: pageInfo.pageSize, + pageSizeOptions: Array.from( + new Set([...[15], ...(dictionary?.pageSizeOptions || [])]) + ), + onChange: (current, size) => { + setPageInfo({ + ...pageInfo, + ...{ pageNum: pageInfo.pageSize == size ? current : 1, pageSize: size }, + }); + setIsAjax(!isAjax); + }, + }; + + // 获取列表数据 + const getData = () => { + let postData = { ...formData }; + if (!loading) { + postData = { ...holdData }; + } + // 字段过滤 + const newObj = { + phoneNumber: postData?.phoneNumber, + msgType: postData?.msgType, + beginTime: postData?.times?.length + ? postData?.times[0].format("YYYY-MM-DD HH:mm:ss") + : "", + endTime: postData?.times?.length + ? postData?.times[1].format("YYYY-MM-DD HH:mm:ss") + : "", + }; + // console.log(postData, newObj); + setTabLoading(true); + ajax.getSmsList({ ...newObj, ...pageInfo }).then( + (res) => { + if (parseInt(res?.status) === 20000) { + setResultData(res?.data || {}); + } else { + message.error(res?.message); + } + setLoading(false); + setTabLoading(false); + }, + (err) => { + console.log(err); + setLoading(false); + setTabLoading(false); + } + ); + }; + + // 检索数据 + const handleSearch = () => { + setLoading(true); + setPageInfo({ ...pageInfo, ...{ pageNum: 1 } }); + setHoldData(formData); + setIsAjax(!isAjax); + }; + + // 下拉菜单 + const getSelectList = () => { + ajax.getSmsMsgType().then( + (res) => { + if (parseInt(res?.status) === 20000) { + setTypeList(res?.data?.list || []); + } else { + message.error(res?.message); + } + }, + (err) => { + console.log(err); + } + ); + }; + + // 发送-确定 + const handleComfirm = () => { + if (!modalObj?.phoneNumber) { + message.error("请输入手机号"); + return; + } + if (!modalObj?.content) { + message.error("请输入内容"); + return; + } + ajax.doSmsSend(modalObj).then( + (res) => { + if (parseInt(res?.status) === 20000) { + message.success(res?.message); + setVisible(false); + setPageInfo({ ...pageInfo, ...{ pageNum: 1 } }); + setIsAjax(!isAjax); + } else { + message.error(res?.message); + } + }, + (err) => { + console.log(err); + } + ); + }; + + return ( +
+ {/* 主页 */} +
+
+
查询条件
+
+
手机号
+ + setFormData({ ...formData, phoneNumber: e.target.value }) + } + /> +
+
+
类型
+