diff --git a/src/assets/images/top.png b/src/assets/images/top.png new file mode 100644 index 0000000..32ffadd Binary files /dev/null and b/src/assets/images/top.png differ diff --git a/src/pages/OperationCenter/OperationSales/AdsMgm/index.scss b/src/pages/OperationCenter/OperationSales/AdsMgm/index.scss index a3798ed..96c5226 100644 --- a/src/pages/OperationCenter/OperationSales/AdsMgm/index.scss +++ b/src/pages/OperationCenter/OperationSales/AdsMgm/index.scss @@ -148,11 +148,11 @@ .r-con { flex: 1; - .row-lg { + >.row-lg { width: 100%; } - .row-sm { + >.row-sm { width: 40%; } } diff --git a/src/pages/OperationCenter/OperationSales/AdsMgm/loadable.jsx b/src/pages/OperationCenter/OperationSales/AdsMgm/loadable.jsx index 2a7f906..8516853 100644 --- a/src/pages/OperationCenter/OperationSales/AdsMgm/loadable.jsx +++ b/src/pages/OperationCenter/OperationSales/AdsMgm/loadable.jsx @@ -774,19 +774,22 @@ function AdsMgm() {
区域:
- setFormData({ ...formData, areaIds: e })} /> @@ -954,19 +957,17 @@ function AdsMgm() {
区域:
- handleForm("areaIds", e)} /> diff --git a/src/pages/OperationCenter/OperationSales/AppPushMgm/index.scss b/src/pages/OperationCenter/OperationSales/AppPushMgm/index.scss index d21d24f..c12cf2c 100644 --- a/src/pages/OperationCenter/OperationSales/AppPushMgm/index.scss +++ b/src/pages/OperationCenter/OperationSales/AppPushMgm/index.scss @@ -154,11 +154,11 @@ .r-con { flex: 1; - .row-lg { + >.row-lg { width: 100%; } - .row-sm { + >.row-sm { width: 40%; } diff --git a/src/pages/OperationCenter/OperationSales/InformationMgm/index.scss b/src/pages/OperationCenter/OperationSales/InformationMgm/index.scss index 4f630ac..0001364 100644 --- a/src/pages/OperationCenter/OperationSales/InformationMgm/index.scss +++ b/src/pages/OperationCenter/OperationSales/InformationMgm/index.scss @@ -117,6 +117,18 @@ .ant-image { margin-right: 3px; + width: 30px; + height: 30px; + } + } + + .ant-table-cell { + position: relative; + + .stick-pic { + position: absolute; + top: 0; + left: 0; } } @@ -160,11 +172,11 @@ .r-con { flex: 1; - .row-lg { + >.row-lg { width: 100%; } - .row-sm { + >.row-sm { width: 40%; } diff --git a/src/pages/OperationCenter/OperationSales/InformationMgm/loadable.jsx b/src/pages/OperationCenter/OperationSales/InformationMgm/loadable.jsx index ecbed09..7b8eae7 100644 --- a/src/pages/OperationCenter/OperationSales/InformationMgm/loadable.jsx +++ b/src/pages/OperationCenter/OperationSales/InformationMgm/loadable.jsx @@ -30,20 +30,14 @@ import { QuestionCircleFilled, } from "@ant-design/icons"; // import { useSessionStorageState, useUpdateEffect, useSize, useUpdate } from 'ahooks'; -import { - ResultPanel, - FormRangePicker, - AreaCascader, - ImgResize, - ImgZoom, -} from "@/components"; -import { dictionary, utils } from "@/config/common"; -// import ajax from "@/services"; +import ajaxCom from "@/services"; import ajax from "@/services/OperationCenter/OperationMarket"; import moment from "moment"; +import { getToken } from "@/config/cookie"; import { Editor, Toolbar } from "@wangeditor/editor-for-react"; import "./index.scss"; import errorImg from "@/assets/images/layout/error.png"; +import topImg from "@/assets/images/top.png"; // import { useLocation } from "react-router-dom"; // 资讯管理 @@ -52,19 +46,19 @@ function InformationMgm() { const [pageType, setPageType] = useState("1"); // 默认数据 const defaultData = { - moduleIds: "", // 展示模块 - areaIds: "", // 区域 - categoryIds: "", // 分类 - putStatuses: "", // 展示状态 - showTimes: "", // 展示时间 - updateTimes: "", // 最后修改时间 - advertId: "", // 广告ID + informationId: "", // 资讯ID title: "", // 标题 + isStick: "", // 是否置顶 + categoryId: [], // 分类 + status: [], // 状态 + areaId: [], // 区域 + releaseType: [], // 发布渠道 + updateTimes: "", // 最后修改时间 }; // 分页数据 const [pageInfo, setPageInfo] = useState({ pageNum: 1, - pageSize: 20, + pageSize: 15, }); // 表单数据 const [formData, setFormData] = useState(defaultData); @@ -83,14 +77,28 @@ function InformationMgm() { }); // 默认详情数据 const defRowData = { - title: "", - categoryId: "", - areaIds: [], - moduleId: "", - location: "", - imgUrl: "", - jumpUrlType: "1", - jumpUrl: "", + isReprint: "0", // 是否转载 0= 原创 1=转载 + coverType: "0", // 封面状态 0=单图模式 1=多图模式 + coverUrl: [], // 封面地址 + title: "", // 标题 + author: "", // 作者 + areaId: [], // 区域 + releaseType: [], // 发布渠道 + shareTitle: "", // 分享标题 + shareDescribe: "", // 分享描述 + shareImgUrl: "", // 分享缩略图 + introduction: "", // 简介 + isStick: "0", // 是否置顶 + categoryId: "", // 分类 + readBasics: "", // 阅读数-基础值 + userRead: "0", // 实际用户操作值 + readMultiple: "", // 放大倍数 + pointBasics: "", // 点赞数-基础值 + userPoint: "0", // 实际用户操作值 + pointMultiple: "", // 放大倍数 + jumpUrl: "", // 原文链接 + upperTime: "", // 上架时间 + lowerTime: "", // 下架时间 }; // 详情数据 const [rowData, setRowData] = useState(defRowData); @@ -108,8 +116,19 @@ function InformationMgm() { const [general, setGeneral] = useState(""); //普通文本内容 const [content, setContent] = useState("


"); //富文本内容 + //区域的下拉数据 + const [areaList, setAreaList] = useState([]); + // 所有下拉菜单 + const [allSelect, setAllSelect] = useState({ + release: [], // 发布渠道 + status: [], // 资讯状态 + isStick: [], // 置顶状态 + category: [], // 分类 + }); + // 访问接口,获取下拉 useEffect(() => { + getSelectList(); getTypeList(); }, []); @@ -131,20 +150,31 @@ function InformationMgm() { { key: "1", label: 详情 }, { key: "2", label: 编辑 }, { key: "3", label: 上架 }, - { key: "4", label: 封存 }, + { key: "4", label: 下架 }, + { key: "5", label: 封存 }, ]; // 表头 const columns = [ { title: "资讯ID", - dataIndex: "advertId", + dataIndex: "informationId", align: "center", }, { title: "标题", dataIndex: "title", align: "center", + render: (val, row, index) => { + return ( + <> + {row?.isStick == 1 ? ( + + ) : null} + {val} + + ); + }, }, { title: "分类", @@ -153,43 +183,97 @@ function InformationMgm() { }, { title: "区域", - dataIndex: "areaNames", + dataIndex: "areaName", align: "center", + render: (val, row, index) => { + return ( + + {val} + + ); + }, }, { title: "发布渠道", - dataIndex: "areaNames", + dataIndex: "releaseName", align: "center", + render: (val, row, index) => { + return ( + + {val} + + ); + }, }, { title: "阅读数", - dataIndex: "location", + dataIndex: "readNumber", align: "center", - sorter: (a, b) => parseInt(a.location) - parseInt(b.location), + sorter: (a, b) => parseInt(a.readNumber) - parseInt(b.readNumber), + render: (val, row, index) => { + return ( + + {val} + + ); + }, }, { title: "点赞数", - dataIndex: "location", + dataIndex: "pointNumber", align: "center", - sorter: (a, b) => parseInt(a.location) - parseInt(b.location), + sorter: (a, b) => parseInt(a.pointNumber) - parseInt(b.pointNumber), + render: (val, row, index) => { + return ( + + {val} + + ); + }, }, { title: "状态", - dataIndex: "putStatus", + dataIndex: "status", align: "center", + render: (val, row, index) => { + return getStatusText(row?.status); + }, }, { title: "定时计划", - dataIndex: "jumpUrl", + dataIndex: "upperTime", align: "center", render: (val, row, index) => { - return ; + return ( + + 定时上架时间:{row?.upperTime || "-"} +
+ 定时下架时间:{row?.lowerTime || "-"} + + } + > + +
+ ); }, }, { title: "最后操作人", - dataIndex: "updateUser", + dataIndex: "updateUserName", align: "center", }, { @@ -229,17 +313,31 @@ function InformationMgm() { }, ]; + // 操作 const clickDropDown = (param, record) => { console.log(param.key); setRowData(record); - if (param.key == "3") { - // 下架 + if (param.key == "1") { + // 详情 + setPageType("3"); } else if (param.key == "2") { // 编辑 setPageType("2"); + setGeneral(""); + setContent(record?.content || "


"); + } else if (param.key == "3") { + // 上架 + } else if (param.key == "4") { + // 下架 + } else if (param.key == "5") { + // 封存 } else { - // 详情 - setPageType("3"); + // 预览 + if (record?.jumpUrl) { + window.open(record?.jumpUrl); + } else { + message.warn("暂时无法预览!"); + } } }; @@ -252,7 +350,7 @@ function InformationMgm() { total: resultData?.total, showTotal: () => `共 ${resultData.total || 0} 条`, pageSize: pageInfo.pageSize, - pageSizeOptions: dictionary?.pageSizeOptions, + pageSizeOptions: [15, 30, 50, 100], onChange: (current, size) => { setPageInfo({ ...pageInfo, @@ -270,22 +368,23 @@ function InformationMgm() { } // 字段过滤 const newObj = { - moduleIds: postData?.moduleIds, - areaIds: postData?.areaIds, - categoryIds: postData?.categoryIds, - putStatuses: postData?.putStatuses, - updateStartTime: postData?.updateTimes?.length + isStick: postData?.isStick, + categoryId: postData?.categoryId, + status: postData?.status, + areaId: postData?.areaId, + releaseType: postData?.releaseType, + modifyStartTime: postData?.updateTimes?.length ? postData?.updateTimes[0].format("YYYY-MM-DD HH:mm:ss") : "", - updateEndTime: postData?.updateTimes?.length + modifyEndTime: postData?.updateTimes?.length ? postData?.updateTimes[1].format("YYYY-MM-DD HH:mm:ss") : "", - advertId: postData?.advertId, + informationId: postData?.informationId, title: postData?.title, }; // console.log(postData, newObj); setTabLoading(true); - ajax.getAdvertList({ ...newObj, ...pageInfo }).then( + ajax.getInformationList({ ...newObj, ...pageInfo }).then( (res) => { if (parseInt(res?.status) === 20000) { setResultData(res?.data || {}); @@ -310,6 +409,40 @@ function InformationMgm() { setHoldData(formData); setIsAjax(!isAjax); }; + // 下拉菜单 + const getSelectList = () => { + ajax.getInformationLabel().then( + (res) => { + if (parseInt(res?.status) === 20000) { + setAllSelect(res?.data || {}); + } else { + message.error(res?.message); + } + }, + (err) => { + console.log(err); + } + ); + // 获取区域树结构 + ajaxCom.getAreaTree().then( + (res) => { + if (parseInt(res?.status) === 20000) { + setAreaList(res?.data || []); + } else { + message.error(res?.message); + } + }, + (err) => { + console.log(err); + } + ); + }; + + // 获取状态文本 + const getStatusText = (val) => { + const obj = allSelect?.status.filter((v, i) => v.value == val); + return obj?.length ? obj[0].label : "-"; + }; // 获取列表数据 const getTypeList = () => { @@ -509,10 +642,14 @@ function InformationMgm() { return current && current < moment().subtract(1, "days"); }; - // 上架或保存 - const handleSaveAds = (flag) => { + // 保存 + const handleSaveInfo = () => { console.log(rowData); - ajax.getAdvertList({ ...rowData, flag }).then( + ajax[rowData?.informationId ? "doInformationEdit" : "doInformationInsert"]({ + ...rowData, + general, + content, + }).then( (res) => { if (parseInt(res?.status) === 20000) { message.success(res?.message); @@ -543,9 +680,9 @@ function InformationMgm() { - setFormData({ ...formData, advertId: e.target.value }) + setFormData({ ...formData, informationId: e.target.value }) } />
@@ -564,40 +701,29 @@ function InformationMgm() {
是否置顶:
setFormData({ ...formData, moduleName: e })} + value={formData?.isStick || undefined} + onChange={(e) => setFormData({ ...formData, isStick: e })} />
分类:
- setFormData({ ...formData, categoryIds: e })} + fieldNames={{ + label: "name", + value: "id", + children: "children", + }} + options={allSelect?.category || []} + value={formData?.categoryId || []} + onChange={(e) => setFormData({ ...formData, categoryId: e })} />
@@ -609,24 +735,32 @@ function InformationMgm() { mode="multiple" maxTagCount="responsive" optionFilterProp="label" - options={statusArr} + options={allSelect?.status || []} placeholder="全部" - value={formData?.putStatuses || []} - onChange={(e) => setFormData({ ...formData, putStatuses: e })} + value={formData?.status || []} + onChange={(e) => setFormData({ ...formData, status: e })} />
区域:
- setFormData({ ...formData, areaIds: e })} + // treeCheckable={true} + // showCheckedStrategy={TreeSelect.SHOW_CHILD} + fieldNames={{ + label: "name", + value: "id", + children: "children", + }} + options={areaList || []} + // treeData={areaList || []} + value={formData?.areaId || []} + onChange={(e) => setFormData({ ...formData, areaId: e })} />
@@ -638,9 +772,9 @@ function InformationMgm() { treeCheckable={true} maxTagCount="responsive" showCheckedStrategy={TreeSelect.SHOW_CHILD} - treeData={statusArr || []} - value={formData?.areaIds || []} - onChange={(e) => setFormData({ ...formData, areaIds: e })} + treeData={allSelect?.release || []} + value={formData?.releaseType || []} + onChange={(e) => setFormData({ ...formData, releaseType: e })} />
@@ -664,6 +798,8 @@ function InformationMgm() { className="green" onClick={() => { setRowData(defRowData); + setGeneral(""); + setContent("


"); setPageType("2"); }} > @@ -697,20 +833,30 @@ function InformationMgm() {
- - 原创 - 转载 + handleForm("isReprint", e.target.value)} + > + 原创 + 转载
- @@ -723,30 +869,32 @@ function InformationMgm() {
封面图片:
handleForm("jumpUrlType", e.target.value)} + value={rowData?.coverType + ""} + onChange={(e) => handleForm("coverType", e.target.value)} > - 单图模式 - 三图模式 + 单图模式 + 三图模式
handleForm("imgUrl", "")} + onClick={() => handleForm("coverUrl", "")} />
@@ -781,8 +929,8 @@ function InformationMgm() { showCount placeholder="请输入文章作者" maxLength={20} - value={rowData?.title || ""} - onChange={(e) => handleForm("title", e.target.value)} + value={rowData?.author || ""} + onChange={(e) => handleForm("author", e.target.value)} />
@@ -791,13 +939,18 @@ function InformationMgm() {
handleForm("jumpUrl", e)} + fieldNames={{ + label: "name", + value: "id", + children: "children", + }} + options={areaList || []} + value={rowData?.areaId || []} + onChange={(e) => handleForm("areaId", e)} />
@@ -810,8 +963,8 @@ function InformationMgm() { { value: "2", label: "微信小程序" }, { value: "3", label: "支付宝小程序" }, ]} - // value={rowData?.categoryId || []} - onChange={(e) => handleForm("categoryId", e)} + value={rowData?.releaseType || []} + onChange={(e) => handleForm("releaseType", e)} />
@@ -823,8 +976,8 @@ function InformationMgm() { showCount placeholder="请输入文章分享后的显示标题" maxLength={30} - value={rowData?.title || ""} - onChange={(e) => handleForm("title", e.target.value)} + value={rowData?.shareTitle || ""} + onChange={(e) => handleForm("shareTitle", e.target.value)} />
@@ -836,8 +989,10 @@ function InformationMgm() { showCount placeholder="请输入文章分享后的显示描述" maxLength={30} - value={rowData?.title || ""} - onChange={(e) => handleForm("title", e.target.value)} + value={rowData?.shareDescribe || ""} + onChange={(e) => + handleForm("shareDescribe", e.target.value) + } />
@@ -846,22 +1001,26 @@ function InformationMgm() {
handleForm("imgUrl", "")} + onClick={() => handleForm("shareImgUrl", "")} />
@@ -885,8 +1044,8 @@ function InformationMgm() { placeholder="请输入文章简介" maxLength={120} autoSize={{ minRows: 3, maxRows: 3 }} - value={rowData?.title || ""} - onChange={(e) => handleForm("title", e.target.value)} + value={rowData?.introduction || ""} + onChange={(e) => handleForm("introduction", e.target.value)} />
@@ -894,11 +1053,11 @@ function InformationMgm() {
是否置顶:
handleForm("jumpUrlType", e.target.value)} + value={rowData?.isStick + ""} + onChange={(e) => handleForm("isStick", e.target.value)} > - +
@@ -907,11 +1066,14 @@ function InformationMgm() {
handleForm("categoryId", e)} /> @@ -931,16 +1093,18 @@ function InformationMgm() {
handleForm("title", e.target.value)} + value={rowData?.readBasics || ""} + onChange={(e) => handleForm("readBasics", e.target.value)} /> + - + × handleForm("title", e.target.value)} + value={rowData?.readMultiple || ""} + onChange={(e) => + handleForm("readMultiple", e.target.value) + } />
@@ -959,16 +1123,20 @@ function InformationMgm() {
handleForm("title", e.target.value)} + value={rowData?.pointBasics || ""} + onChange={(e) => + handleForm("pointBasics", e.target.value) + } /> + - + × handleForm("title", e.target.value)} + value={rowData?.pointMultiple || ""} + onChange={(e) => + handleForm("pointMultiple", e.target.value) + } />
@@ -979,8 +1147,8 @@ function InformationMgm() { handleForm("title", e.target.value)} + value={rowData?.jumpUrl || ""} + onChange={(e) => handleForm("jumpUrl", e.target.value)} /> @@ -990,11 +1158,8 @@ function InformationMgm() { handleForm("createTime", str)} + value={parseDate(rowData?.upperTime, "YYYY-MM-DD HH:mm:ss")} + onChange={(e, str) => handleForm("upperTime", str)} />
定时下架时间:
@@ -1002,11 +1167,8 @@ function InformationMgm() { handleForm("createTime", str)} + value={parseDate(rowData?.lowerTime, "YYYY-MM-DD HH:mm:ss")} + onChange={(e, str) => handleForm("lowerTime", str)} /> @@ -1022,8 +1184,8 @@ function InformationMgm() {
handleForm("title", e.target.value)} + value={rowData?.jumpUrl || ""} + onChange={(e) => handleForm("jumpUrl", e.target.value)} />
@@ -1045,102 +1207,143 @@ function InformationMgm() { {/* 详情 */}
- +
-
-
-
-
资讯ID:
-
{rowData?.advertId || "-"}
-
-
-
状态:
-
{rowData?.putStatus || "-"}
-
-
-
图片:
-
{rowData?.imgUrl || "-"}
-
-
-
标题:
-
{rowData?.title || "-"}
-
-
-
简介:
-
{rowData?.moduleName || "-"}
-
-
-
作者:
-
{rowData?.id || "-"}
-
-
-
分类:
-
{rowData?.class || "-"}
-
-
-
区域:
-
{rowData?.areaName || "-"}
-
-
-
是否置顶:
-
{rowData?.id || "-"}
-
-
-
发布渠道:
-
{rowData?.id || "-"}
-
-
-
阅读数(3):
-
- 基础值(1)+实际用户操作值(2)*放大倍数(1) +
+
+
+
+
资讯ID:
+
{rowData?.informationId || "-"}
+
+
+
状态:
+
{getStatusText(rowData?.status)}
+
+
+
+
+ + {rowData?.imgUrl || "-"} +
+
+
+
标题:
+
{rowData?.title || "-"}
+
+
+
简介:
+
{rowData?.introduction || "-"}
+
+
+
作者:
+
{rowData?.author || "-"}
+
+
+
分类:
+
{rowData?.categoryName || "-"}
+
+
+
区域:
+
{rowData?.areaName || "-"}
+
+
+
是否置顶:
+
+ {rowData?.isStick == 1 ? "是" : "否"} +
+
+
+
发布渠道:
+
{rowData?.releaseName || "-"}
+
+
+
+ 阅读数({rowData?.readNumber || "0"}): +
+
+ 基础值({rowData?.readBasics || "0"})+实际用户操作值( + {rowData?.userRead || "0"})*放大倍数( + {rowData?.readMultiple || "0"}) +
+
+
+
+ 点赞数({rowData?.pointNumber || "0"}): +
+
+ 基础值({rowData?.pointBasics || "0"})+实际用户操作值( + {rowData?.userPoint || "0"})*放大倍数( + {rowData?.pointMultiple || "0"}) +
-
-
点赞数(1):
-
- 基础值(1)+实际用户操作值(0)*放大倍数(1) +
+
+
定时上架时间:
+
{rowData?.upperTime || "-"}
+
+
+
定时下架时间:
+
{rowData?.lowerTime || "-"}
+
+
+
分享标题:
+
{rowData?.shareTitle || "-"}
+
+
+
分享描述:
+
{rowData?.shareDescribe || "-"}
+
+
+
分享缩略图:
+
+ +
+
+
+
预览链接:
+
{rowData?.jumpUrl || "-"}
+
+
+
最后操作人:
+
{rowData?.updateUserName || "-"}
+
+
+
最后修改时间:
+
{rowData?.updateTime || "-"}
+
+
+
初始创建时间:
+
{rowData?.createTime || "-"}
-
-
-
定时上架时间:
-
{rowData?.jumpUrlType || "-"}
-
-
-
定时下架时间:
-
{rowData?.createTime || "-"}
-
-
-
分享标题:
-
{rowData?.createTime || "-"}
-
-
-
分享描述:
-
{rowData?.createTime || "-"}
-
-
-
分享缩略图:
-
{rowData?.createTime || "-"}
-
-
-
预览链接:
-
{rowData?.createTime || "-"}
-
-
-
最后操作人:
-
{rowData?.updateUser || "-"}
-
-
-
最后修改时间:
-
{rowData?.updateTime || "-"}
+ {/*
+
+
上传资源:
+
{rowData?.jumpUrl || "-"}
-
-
初始创建时间:
-
{rowData?.updateTime || "-"}
+
+
内容:
+
+
+
-
+
*/}
{/* 设置 */} diff --git a/src/services/OperationCenter/OperationMarket/information.js b/src/services/OperationCenter/OperationMarket/information.js index 82d482b..b01f9ca 100644 --- a/src/services/OperationCenter/OperationMarket/information.js +++ b/src/services/OperationCenter/OperationMarket/information.js @@ -2,19 +2,20 @@ import ajax from "@/config/ajax"; // --资讯管理-- export default { // 所有下拉 - // getPushLabel: (data) => - // ajax({ url: "/api/ope/push/get_label", type: "get", data }), + getInformationLabel: (data) => + ajax({ url: "/api/ope/information/get_label", type: "get", data }), // // 应用路径 // getPushPath: (data) => // ajax({ url: "/api/ope/push/get_path", type: "get", data }), - // // 列表 - // getPushList: (data) => - // ajax({ url: "/api/ope/push/list", type: "post", data }), - // // 新增 - // doPushInsert: (data) => - // ajax({ url: "/api/ope/push/insert", type: "post", data }), - // // 修改 - // doPushEdit: (data) => ajax({ url: "/api/ope/push/edit", type: "post", data }), + // 列表 + getInformationList: (data) => + ajax({ url: "/api/ope/information/list", type: "post", data }), + // 新增 + doInformationInsert: (data) => + ajax({ url: "/api/ope/information/insert", type: "post", data }), + // 修改 + doInformationEdit: (data) => + ajax({ url: "/api/ope/information/edit", type: "post", data }), // // 删除 // doPushDelete: (data) => // ajax({ url: "/api/ope/push/delete", type: "post", data }),