From 10eaf22595e421c79aa3c9dfc4ac08c14a6e586c Mon Sep 17 00:00:00 2001 From: zsk <710162063@qq.com> Date: Thu, 19 Dec 2024 18:12:42 +0800 Subject: [PATCH] 2 --- src/App.vue | 3 + src/api/carouselConfig.js | 50 +++ src/api/contentConfig.js | 50 +++ src/layout/m-aside.vue | 3 + src/router/index.js | 10 +- src/utils/mock.js | 29 +- src/utils/request.js | 4 +- src/views/homePage/index.vue | 28 +- src/views/homePage/personData.vue | 661 ------------------------------------ src/views/homePage/projectData.vue | 356 ------------------- src/views/homePage/record.vue | 157 --------- src/views/login.vue | 29 +- src/views/message/WysiwygEditor.vue | 87 +++-- src/views/message/content.vue | 262 ++++++++++++++ src/views/message/index.vue | 198 +++++------ 15 files changed, 577 insertions(+), 1350 deletions(-) create mode 100644 src/api/carouselConfig.js create mode 100644 src/api/contentConfig.js delete mode 100644 src/views/homePage/personData.vue delete mode 100644 src/views/homePage/projectData.vue delete mode 100644 src/views/homePage/record.vue create mode 100644 src/views/message/content.vue diff --git a/src/App.vue b/src/App.vue index 90a9fb6..2c6141a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -206,4 +206,7 @@ const getInit = ($data) => { .g_family_dingding { font-family: "DingTalk_JinBuTi_Regular"; } +div[aria-hidden="true"] { + display: none !important; +} diff --git a/src/api/carouselConfig.js b/src/api/carouselConfig.js new file mode 100644 index 0000000..08b4930 --- /dev/null +++ b/src/api/carouselConfig.js @@ -0,0 +1,50 @@ +import request from "../utils/request"; + +// 获取轮播列表 +export function getCarouselListApi(page, limit = 10) { + return request({ + url: `/admin/banner/${page}/${limit}`, + method: "get", + }); +} + +// 保存轮播 +export function saveCarouselApi(data) { + return request({ + url: `/admin/banner/save`, + method: "post", + data: { img: data.img,title: data.title,status: data.status } + }); +} + +// 删除轮播 +export function deleteCarouselApi(id) { + return request({ + url: `/admin/banner/remove/${id}`, + method: "delete", + }); +} + +// 修改轮播 +export function updateCarouselApi(data) { + return request({ + url: `/admin/banner/update`, + method: "put", + data + }); +} + +// 上传图片 +export function uploadImageApi(file) { + const formData = new FormData(); + formData.append('file', file); + return request({ + url: '/admin/cms/upload', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +} + diff --git a/src/api/contentConfig.js b/src/api/contentConfig.js new file mode 100644 index 0000000..f949789 --- /dev/null +++ b/src/api/contentConfig.js @@ -0,0 +1,50 @@ +import request from "../utils/request"; + +// 获取内容列表 +export function getContentListApi(page, limit = 10,classify) { + return request({ + url: `/admin/cms/${page}/${limit}?classify=${classify}`, + method: "get", + }); +} + +// 新增内容 +export function saveContentApi(data) { + return request({ + url: `/admin/cms/save`, + method: "post", + data + }); +} + +// 更新内容 +export function updateContentApi(data) { + return request({ + url: `/admin/cms/update`, + method: "put", + data + }); +} + +// 删除内容 +export function deleteContentApi(id) { + return request({ + url: `/admin/cms/remove/${id}`, + method: "delete", + }); +} + +// 上传图片 +export function uploadImageApi(file) { + const formData = new FormData(); + formData.append('file', file); + return request({ + url: '/admin/cms/upload', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +} + diff --git a/src/layout/m-aside.vue b/src/layout/m-aside.vue index 8aa1ca8..3bdbbc8 100644 --- a/src/layout/m-aside.vue +++ b/src/layout/m-aside.vue @@ -116,6 +116,9 @@ onMounted(() => { case "message": items.push(getItem(item.title, item.id, item.component, () => h(SketchOutlined))); break; + case "content": + items.push(getItem(item.title, item.id, item.component, () => h(SettingOutlined))); + break; case "ServiceMarket": items.push(getItem(item.title, item.id, item.component, () => h(SketchOutlined))); diff --git a/src/router/index.js b/src/router/index.js index 786d05f..f7c1b7e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -52,9 +52,17 @@ const router = createRouter({ path: "/merchantManagement/message", name: "message", meta: { - title: '内容管理', + title: '轮播管理', }, component: () => import("../views/message/index.vue") + }, + { + path: "/merchantManagement/content", + name: "content", + meta: { + title: '内容管理', + }, + component: () => import("../views/message/content.vue") } // ,{ // path: "/merchantManagement/record", diff --git a/src/utils/mock.js b/src/utils/mock.js index c5a1511..c1f8285 100644 --- a/src/utils/mock.js +++ b/src/utils/mock.js @@ -63,7 +63,7 @@ export let mockMenuList = { "createTime": "", "updateTime": "", "deleted": 0, - "title": "内容管理", + "title": "轮播管理", "menuName": "message", "parentName": "", "path": "message", @@ -83,6 +83,33 @@ export let mockMenuList = { "exportTag": 0, "childrenList": [] }, + { + "id": 5, + "creator": "", + "updator": "", + "createTime": "", + "updateTime": "", + "deleted": 0, + "title": "内容管理", + "menuName": "content", + "parentName": "", + "path": "content", + "component": "/merchantManagement/content.vue", + "visible": 0, + "perms": "", + "icon": "icon-houtaishouye", + "remark": "", + "parentId": "", + "tagNames": "queryTag,addTag,updateTag,deleteTag", + "idx": 10, + "queryTag": 0, + "addTag": 0, + "deleteTag": 0, + "updateTag": 0, + "importTag": 0, + "exportTag": 0, + "childrenList": [] + }, { "id": 1, diff --git a/src/utils/request.js b/src/utils/request.js index 05cb8e4..14f926e 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -8,8 +8,8 @@ import { } from 'ant-design-vue'; import commonJS from './common.js'; const router = useRouter() -const baseURL = "http://a.matripe.com.cn/api_stock"; // 正式环境线上 -const baseURL2 = "https://a.matripe.com.cn/api_stock"; // 正式环境线上 +const baseURL = "http://192.168.1.3:8800"; // 正式环境线上 +// const baseURL2 = "https://a.matripe.com.cn/api_stock"; // 正式环境线上 let protocol = location.protocol let trueUrl = protocol == 'http:' ? baseURL : baseURL2 console.log(protocol); diff --git a/src/views/homePage/index.vue b/src/views/homePage/index.vue index a195e1f..da6583d 100644 --- a/src/views/homePage/index.vue +++ b/src/views/homePage/index.vue @@ -133,7 +133,7 @@ - + @@ -156,7 +156,7 @@ import { Modal, message } from "ant-design-vue"; import { useRouter, useRoute } from "vue-router"; import { getUserListApi, updateUserStatusApi, addUserApi, delUserApi,updateUserApi } from "../../api/userList/userList"; import { DownloadOutlined } from "@ant-design/icons-vue"; -import idCardPanel from "../components/upload/image.vue"; +import passwordPanel from "../components/upload/image.vue"; /* #################### 初始化事件 #################### */ const router = useRouter(); // 应用路由 @@ -165,7 +165,7 @@ const commonJS = getCurrentInstance().appContext.app.config.globalProperties.G; const speed = ref(0); const showAdd = ref(0); onMounted(() => { - // getTable(); + getTable(); }); /** * 搜索事件 @@ -187,7 +187,7 @@ const modalInfo = ref({ form:{ name:"", username:'', - idcard:'', + password:'', description:'' } }) @@ -198,17 +198,17 @@ const submitForm = ()=>{ params = { name:modalInfo.value.form.name, username:modalInfo.value.form.username, - idcard:modalInfo.value.form.idcard, + password:modalInfo.value.form.password, description:modalInfo.value.form.description, password:'123456', id:modalInfo.value.id } - if (!commonJS.regular(modalInfo.value.form.username, 'tel')) { - message.warning('请输入正确的手机号') - return false - } + // if (!commonJS.regular(modalInfo.value.form.username, 'tel')) { + // message.warning('请输入正确的手机号') + // return false + // } if(modalInfo.value.id){ @@ -238,7 +238,7 @@ const handleToForm = ($type, $data) => { form:{ name:$data.name, username:$data.username, - idcard:$data.idcard, + password:$data.password, description:$data.description, }, id:$data.id @@ -246,7 +246,7 @@ const handleToForm = ($type, $data) => { // updateUserApi({ // description: "测试备注", - // idcard: "123123123123123123", + // password: "123123123123123123", // name: "测试真名", // username: "13214534564", // password: 123456, @@ -309,7 +309,7 @@ const openAdd = () =>{ form:{ name:"", username:'', - idcard:'', + password:'', description:'' } } @@ -339,8 +339,8 @@ const columns = ref([ }, { title: "密码", - key: "idcard", - dataIndex: "idcard", + key: "password", + dataIndex: "password", width: "200px", ellipsis: true, }, diff --git a/src/views/homePage/personData.vue b/src/views/homePage/personData.vue deleted file mode 100644 index 754b9ee..0000000 --- a/src/views/homePage/personData.vue +++ /dev/null @@ -1,661 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - {{ "" }} - - - - {{ record.sex + " " + record.age }} - - - - - - handleStatus(e, record)" :checked="record.status == 1 ? true : false" checked-children="正常" un-checked-children="禁用" /> - - - - - - 预览 - - 编辑 - - - - - - - - - - - - - - - - - - - - - - 导出模板 - - - - 导入文件 - - - - - - - - - {{ record.rank }} - - - - - - - - - - 确定 - - - - - - - - - - {{modalInfo.form.name}} - - - - - - - - - - - - - - - - - - 关闭 - 确定 - - - - - - - - diff --git a/src/views/homePage/projectData.vue b/src/views/homePage/projectData.vue deleted file mode 100644 index 0386169..0000000 --- a/src/views/homePage/projectData.vue +++ /dev/null @@ -1,356 +0,0 @@ - - - - - 基本信息 - - 编辑 - - - - - - - 主体: - {{ showBaseInfo.name || "-" }} - - - 当前估值: - {{ showBaseInfo.appraisement || "-" }} - - - - - 当前总股本: - {{ showBaseInfo.capitalStock || "-" }} - - - 每股价格: - {{ showBaseInfo.unitPrice || "-" }} - - - - - - - - - - - 主体 - - - - - - 当前估值 - - - - - - 当前总股本 - - - - - - 每股价格 - - - - - - - 取消 - 确定 - - - - - 股权结构 - - - 导出模版 - - - 导入文件 - - - - - - - - - 姓名 - - - - - - - - 增资扩股变化 - - - 导出模版 - - - 导入文件 - - - - - - - - - - 删除 - - - - - - - - - - - diff --git a/src/views/homePage/record.vue b/src/views/homePage/record.vue deleted file mode 100644 index 25c4c08..0000000 --- a/src/views/homePage/record.vue +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/views/login.vue b/src/views/login.vue index 50c11d8..4f0b4ff 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -105,8 +105,8 @@ const loginType = ref(1); // 登录要传输的信息 const loginInfo = ref({ - username: "bocai", - password: "123456", + username: "admin", + password: "1111111", code: "", }); const loginInfoForm = ref(); @@ -119,25 +119,6 @@ const watchValidate = (e1) => { const submitInfo = (e) => { let obj = e; - - - - - router.push("/merchantManagement/homePage"); - return - - - - - - - - - - - - - // if (loginType.value == 2) { // obj.loginType = 1; // } else { @@ -156,11 +137,11 @@ const submitInfo = (e) => { infoApi({}).then((res) => { console.log("infoApi", res); // localStorage.setItem("DAOTIAN_userinfo", JSON.stringify(res.data)); - localStorage.setItem("DAOTIAN_userinfo_name", res.data.name || res.data.name); - localStorage.setItem("DAOTIAN_userinfo_avatar", res.data.avatar); + // localStorage.setItem("DAOTIAN_userinfo_name", res.data.name || res.data.name); + // localStorage.setItem("DAOTIAN_userinfo_avatar", res.data.avatar); // localStorage.setItem("DAOTIAN_userinfo_roleid", res.data.user.agencyRoleId); // localStorage.setItem("DAOTIAN_userinfo_agencyid", res.data.user.agencyId); - router.push("/merchantManagement/homePage"); + router.push("/merchantManagement/message"); message.success("登录成功"); }); }); diff --git a/src/views/message/WysiwygEditor.vue b/src/views/message/WysiwygEditor.vue index 13cd67d..043fc99 100644 --- a/src/views/message/WysiwygEditor.vue +++ b/src/views/message/WysiwygEditor.vue @@ -15,53 +15,66 @@ /> - + + diff --git a/src/views/message/index.vue b/src/views/message/index.vue index efc5f2e..3f59370 100644 --- a/src/views/message/index.vue +++ b/src/views/message/index.vue @@ -1,31 +1,23 @@ - - - - - - - - + 新增 - + - - - - +{{ record.content.length - 3 }} more - - + + + + + + {{ record.status === 1 ? '启用' : '不启用' }} + @@ -38,39 +30,32 @@ - - - 门店 - 今日推荐 - 赛事分析 - 轮播 - - - - + + - + - + 上传图片 - - + + @@ -82,12 +67,11 @@ \ No newline at end of file + +