Browse Source

厂商公告通知展示页;路由设置

liuYb 4 years ago
parent
commit
41ae2b5903

+ 20 - 1
src/App.vue

@@ -129,7 +129,7 @@ export default {
     },
   },
   mounted() {},
-  created() {
+ /*  created() {
     this.loadingFlag = true;
     this.getData(); // 线上打开
     // 本地调试打开
@@ -147,6 +147,25 @@ export default {
     //   sessionStorage.setItem("userNameAccount", "L0210_MM");
     //   this.userAccount = "L0210_MM";
     // }
+  }, */
+    created() {
+    this.loadingFlag = true;
+    //this.getData(); // 线上打开
+    // 本地调试打开
+     this.loadingFlag = false;
+    // this.isManufacturer = "manufacturer";
+       this.isManufacturer = "manufacturer"
+     if (this.isManufacturer === 'manufacturer') {
+       if(this.$route.path === '/loading') this.$router.replace({ path: "/uploadInfor" });
+       localStorage.setItem("userId", 3084);
+      sessionStorage.setItem("userNameAccount", "L0M14_MM");
+      this.userAccount = "L0M14_MM";
+     } else {
+       if(this.$route.path !== '/loading') this.$router.replace({ path: "/inforList" });
+      localStorage.setItem("userId", 2002);
+       sessionStorage.setItem("userNameAccount", "L0210_MM");
+       this.userAccount = "L0210_MM";
+     }
   },
 };
 </script>

+ 20 - 8
src/config/router.js

@@ -1,12 +1,26 @@
-const ROUTER = [
+const ROUTER = [{
+        title: "通知公告", // 厂商的通知公告
+        path: "/changShang",
+        img1: require("../img/notice1.png"),
+        img2: require("../img/notice2.png"),
+        list: [],
+        role: "manufacturer", // 厂商有权限
+    },
+    {
+        title: "通知公告", // 经销商的通知公告
+        path: "/jingXiaoshang",
+        img1: require("../img/notice1.png"),
+        img2: require("../img/notice2.png"),
+        list: [],
+        role: "distributor", // 经销商有权限
+    },
     {
         title: "数据管理", // 厂商数据管理
         path: "/uploadRecord", // 点击数据管理展示的路由
         img1: require("../img/edit-manage1.png"), // 没点击的背景图
         img2: require("../img/edit-manage2.png"), // 点击了的背景图
         role: "manufacturer", // 厂商权限
-        list: [
-            {
+        list: [{
                 title: "传播项目",
                 path: "/uploadRecord",
             },
@@ -27,8 +41,7 @@ const ROUTER = [
         img1: require("../img/edit-manage1.png"), // 没点击的背景图
         img2: require("../img/edit-manage2.png"), // 点击了的背景图
         role: "distributor", // 厂商和经销商都有权限
-        list: [
-            {
+        list: [{
                 title: "资料下载",
                 path: "/inforList",
             },
@@ -64,8 +77,7 @@ const ROUTER = [
         role: "manufacturer", // 厂商有权限
     },
 ];
-const TAG = [
-    {
+const TAG = [{
         num: 1,
         title: '车系车型',
         path: '/carSeries'
@@ -110,4 +122,4 @@ const TAG = [
 module.exports = {
     ROUTER,
     TAG
-}
+}

BIN
src/img/notice1.png


BIN
src/img/notice2.png


+ 124 - 143
src/router/index.js

@@ -46,10 +46,16 @@ import LinkUpload from '../views/parameter/LinkUpload'
 // 常用参数
 import CommonParam from '../views/parameter/CommonParam'
 
+
+// 厂商通知公告
+import NoticeChangShang from '../views/notification/changShang.vue'
+// 经销商账号管理
+import NoticeJingXiaoshang from '../views/notification/jingXiaoshang.vue'
+
+
 Vue.use(VueRouter)
 
-const routes = [
-    {
+const routes = [{
         path: '/',
         component: Loading,
         redirect: '/loading'
@@ -62,8 +68,7 @@ const routes = [
         path: '/uploadRecord',
         component: UploadRecord,
         // meta用于面包屑
-        meta: [
-            {
+        meta: [{
                 name: "数据管理",
                 url: ''
             },
@@ -72,32 +77,28 @@ const routes = [
                 url: '/uploadRecord'
             }
         ],
-        children: [
-            {
-                path: 'detail',
-                component: UploadRecordDetail,
-                meta: [
-                    {
-                        name: "数据管理",
-                        url: ''
-                    },
-                    {
-                        name: "传播项目",
-                        url: '/uploadRecord'
-                    },
-                    {
-                        name: "内容详情",
-                        url: ''
-                    }
-                ],
-            }
-        ]
+        children: [{
+            path: 'detail',
+            component: UploadRecordDetail,
+            meta: [{
+                    name: "数据管理",
+                    url: ''
+                },
+                {
+                    name: "传播项目",
+                    url: '/uploadRecord'
+                },
+                {
+                    name: "内容详情",
+                    url: ''
+                }
+            ],
+        }]
     },
     {
         path: '/uploadLink',
         component: UploadLink,
-        meta: [
-            {
+        meta: [{
                 name: "传播项目",
                 url: ''
             },
@@ -106,32 +107,28 @@ const routes = [
                 url: "/uploadLink"
             }
         ],
-        children: [
-            {
-                path: '/uploadLink/sonUploadLink',
-                component: sonUploadLink,
-                meta: [
-                    {
-                        name: "传播项目",
-                        url: ''
-                    },
-                    {
-                        name: "传播反馈",
-                        url: "/uploadLink"
-                    },
-                    {
-                        name: "详情",
-                        url: "/uploadLink/sonUploadLink"
-                    }
-                ],
-            }
-        ]
+        children: [{
+            path: '/uploadLink/sonUploadLink',
+            component: sonUploadLink,
+            meta: [{
+                    name: "传播项目",
+                    url: ''
+                },
+                {
+                    name: "传播反馈",
+                    url: "/uploadLink"
+                },
+                {
+                    name: "详情",
+                    url: "/uploadLink/sonUploadLink"
+                }
+            ],
+        }]
     },
     {
         path: '/uploadLinks',
         component: UploadLinks,
-        meta: [
-            {
+        meta: [{
                 name: "数据管理",
                 url: ''
             },
@@ -144,8 +141,7 @@ const routes = [
     {
         path: '/uploadInfor',
         component: UploadInfor,
-        meta: [
-            {
+        meta: [{
                 name: "数据管理",
                 url: ''
             },
@@ -158,8 +154,7 @@ const routes = [
     {
         path: '/inforList',
         component: InforList,
-        meta: [
-            {
+        meta: [{
                 name: "传播项目",
                 url: ''
             },
@@ -168,52 +163,52 @@ const routes = [
                 url: "/inforList"
             }
         ],
-        children: [
-            {
-                path: 'detail',
-                component: InforListDetail,
-                meta: [
-                    {
-                        name: "传播项目",
-                        url: ''
-                    },
-                    {
-                        name: "资料下载",
-                        url: "/inforList"
-                    },
-                    {
-                        name: "资料详情",
-                        url: ""
-                    }
-                ],
-            }
-        ],
+        children: [{
+            path: 'detail',
+            component: InforListDetail,
+            meta: [{
+                    name: "传播项目",
+                    url: ''
+                },
+                {
+                    name: "资料下载",
+                    url: "/inforList"
+                },
+                {
+                    name: "资料详情",
+                    url: ""
+                }
+            ],
+        }],
     },
     {
         path: '/accountIndex',
         component: AccountIndex,
-        meta: [
-            {
-                name: "账号管理",
-                url: '/accountIndex'
-            }
-        ],
+        meta: [{
+            name: "账号管理",
+            url: '/accountIndex'
+        }],
+    },
+    {
+        path: '/changShang',
+        component: NoticeChangShang,
+    },
+    {
+        path: '/jingXiaoshang',
+        component: NoticeJingXiaoshang,
     },
     {
         path: '/accountManage',
         component: AccountManage,
-        meta: [
-            {
-                name: "账号管理",
-                url: '/accountManage'
-            }
-        ],
+        meta: [{
+            name: "账号管理",
+            url: '/accountManage'
+        }],
     },
     {
         path: '/parameterIndex',
         component: ParameterIndex,
-        children: [
-            {
+        children: [{
                 path: '',
                 component: CarSeries,
                 redirect: 'carSeries'
@@ -221,8 +216,7 @@ const routes = [
             {
                 path: 'carSeries',
                 component: CarSeries,
-                meta: [
-                    {
+                meta: [{
                         name: "参数设置",
                         url: ''
                     },
@@ -231,32 +225,28 @@ const routes = [
                         url: '/parameterIndex/carSeries'
                     }
                 ],
-                children: [
-                    {
-                        path: 'carType',
-                        component: CarType,
-                        meta: [
-                            {
-                                name: "参数设置",
-                                url: ''
-                            },
-                            {
-                                name: "车系车型",
-                                url: '/parameterIndex/carSeries'
-                            },
-                            {
-                                name: "车型管理",
-                                url: ''
-                            }
-                        ]
-                    }
-                ]
+                children: [{
+                    path: 'carType',
+                    component: CarType,
+                    meta: [{
+                            name: "参数设置",
+                            url: ''
+                        },
+                        {
+                            name: "车系车型",
+                            url: '/parameterIndex/carSeries'
+                        },
+                        {
+                            name: "车型管理",
+                            url: ''
+                        }
+                    ]
+                }]
             },
             {
                 path: 'platformModule',
                 component: PlatformModule,
-                meta: [
-                    {
+                meta: [{
                         name: "参数设置",
                         url: ''
                     },
@@ -265,32 +255,28 @@ const routes = [
                         url: '/parameterIndex/platformModule'
                     }
                 ],
-                children: [
-                    {
-                        path: 'section',
-                        component: PlatformSection,
-                        meta: [
-                            {
-                                name: "参数设置",
-                                url: ''
-                            },
-                            {
-                                name: "平台版块",
-                                url: '/parameterIndex/platformModule'
-                            },
-                            {
-                                name: "版块管理",
-                                url: ''
-                            }
-                        ]
-                    }
-                ]
+                children: [{
+                    path: 'section',
+                    component: PlatformSection,
+                    meta: [{
+                            name: "参数设置",
+                            url: ''
+                        },
+                        {
+                            name: "平台版块",
+                            url: '/parameterIndex/platformModule'
+                        },
+                        {
+                            name: "版块管理",
+                            url: ''
+                        }
+                    ]
+                }]
             },
             {
                 path: 'contentCategory1',
                 component: ContentCategory1,
-                meta: [
-                    {
+                meta: [{
                         name: "参数设置",
                         url: ''
                     },
@@ -303,8 +289,7 @@ const routes = [
             {
                 path: 'contentCategory2',
                 component: ContentCategory2,
-                meta: [
-                    {
+                meta: [{
                         name: "参数设置",
                         url: ''
                     },
@@ -317,8 +302,7 @@ const routes = [
             {
                 path: 'mediaPlatform',
                 component: MediaPlatform,
-                meta: [
-                    {
+                meta: [{
                         name: "参数设置",
                         url: ''
                     },
@@ -331,8 +315,7 @@ const routes = [
             {
                 path: 'grouping',
                 component: Grouping,
-                meta: [
-                    {
+                meta: [{
                         name: "参数设置",
                         url: ''
                     },
@@ -345,8 +328,7 @@ const routes = [
             {
                 path: 'linkUpload',
                 component: LinkUpload,
-                meta: [
-                    {
+                meta: [{
                         name: "参数设置",
                         url: ''
                     },
@@ -359,8 +341,7 @@ const routes = [
             {
                 path: 'commonParam',
                 component: CommonParam,
-                meta: [
-                    {
+                meta: [{
                         name: "参数设置",
                         url: ''
                     },
@@ -378,4 +359,4 @@ const router = new VueRouter({
     routes
 })
 
-export default router
+export default router

+ 2 - 2
src/views/data/InforList.vue

@@ -165,8 +165,8 @@ export default {
         },
         {
           name: "查看详情>",
-          function: (obj, i) => {
-            this.showDetail(obj, i);
+          function: (obj) => {
+            this.showDetail(obj);
           },
         },
       ],

+ 0 - 15
src/views/data/UploadLink.vue

@@ -3,18 +3,6 @@
     <div v-if="isFather()">
       <!--  <span><b>经销商</b></span> -->
       <div class="topLeftTitle">针对论坛及其他平台链接上传</div>
-      <!--    <div class="contentHead">
-      <span>上传平台</span>
-      <select name="" id="" v-model="platformVal" @change="choosePlatform">
-        <option
-          v-for="(item, index) in platform"
-          :key="index"
-          :value="item.platformName"
-        >
-          {{ item.platformName }}
-        </option>
-      </select>
-    </div> -->
       <div class="tableBox">
         <table class="feedbackTable">
           <thead class="theadStyle">
@@ -83,9 +71,6 @@
               <!-- 链接 -->
 
               <td class="operationStyle" style="cursor: pointer">
-                <!-- <span @click="toggleModal(index)" :class="showItemOperation"
-                  >编辑</span
-                > -->
                 <span
                   @click="toggleModal(index)"
                   v-if="+(obj.endDate || '').replace(RegExp('-', 'g'), '') - nowDate >= 0"

+ 223 - 0
src/views/notification/changShang.vue

@@ -0,0 +1,223 @@
+<template>
+  <div class="notice_changShang">
+    <div style="color: #80808059;border: 1px solid;"></div>
+    <button @click="announce()">发布公告</button>
+    <div class="tableD">
+      <div class="table_template">
+        <table class="table">
+          <thead>
+            <tr :style="tableHeadStyle">
+              <td
+                v-for="(item, index) in tableHeaderD"
+                :key="index"
+                :style="tableHeadStyle"
+              >
+                {{ item }}
+              </td>
+            </tr>
+          </thead>
+          <tbody>
+            <tr
+              v-for="(obj, index) in tableData"
+              :key="index"
+              :class="{ table_gray: !discolor && index % 2 === 0 }"
+            >
+              <td>{{ obj.informationName || "标题" }}</td>
+              <td>{{ obj.accountScope || "重要通知" }}</td>
+              <td>
+                {{
+                  (obj.fileUploadDate || "")
+                    .replace("T", " ")
+                    .slice(0, -4)
+                    .replace(RegExp("-", "g"), "/")
+                }}
+              </td>
+
+              <td v-if="operation" :style="trStyle" class="operationStyle">
+                <div class="operationBox">
+                  <span
+                    style="cursor: pointer"
+                    v-for="(operationObj, i) in operation"
+                    :key="i"
+                    @click="operationObj.function(obj, index)"
+                    >{{ operationObj.name }}
+                  </span>
+                </div>
+              </td>
+            </tr>
+          </tbody>
+        </table>
+      </div>
+    </div>
+    <div class="pageD">
+      <TablePage
+        :totalPage="totalPage"
+        :currentPage="currentPage"
+        @change_page="changePage"
+        @jump_page="jumpPage"
+      />
+      <p>共{{ totalPage }}页,共{{ sum }}条数据</p>
+    </div>
+  </div>
+</template>
+
+<script>
+import TablePage from "../../components/TablePage";
+import { env_url } from "../../config/env";
+export default {
+  components: {
+    TablePage,
+  },
+  data() {
+    return {
+      tableHeaderD: ["标题", "信息类型", "创建时间", "操作"],
+      operation: [
+        {
+          name: "编辑",
+          function: (obj) => {
+            this.edit(obj);
+          },
+        },
+        {
+          name: "删除",
+          function: (obj) => {
+            console.log(obj);
+          },
+        },
+      ],
+      // 表格配置
+      sum: 0, // 一共有多少条数据
+      pageSize: 20, // 每页展示的数据
+      discolor: false, // flase是隔行变色
+      currentPage: 1,
+      tableData: [
+        { title: "title" },
+        { title: "title" },
+        { title: "title" },
+        { title: "title" },
+        { title: "title" },
+        { title: "title" },
+      ],
+      tableFileData: [],
+      tableHeadStyle: {
+        background: "#848484",
+        height: "36px",
+        color: "white",
+      },
+      trStyle: {
+        minwidth: "150px",
+        overflow: "hidden",
+      },
+      onlineUrl: env_url, //'http://8.140.188.129:8080'线上 //http://8.136.230.133:8080 //测试
+      userId: localStorage.getItem("userId") || "",
+    
+    };
+  },
+  computed: {
+    // 表格总页数
+    totalPage() {
+      return Math.ceil(this.sum / this.pageSize);
+    },
+  },
+  methods: {
+    // 获取某一页面的数据,展示在表格
+    changePage: function (page) {
+      this.currentPage = page;
+    },
+    // 点击上一页,下一页,首页,尾页
+    jumpPage: function (item) {
+      switch (item) {
+        case 1:
+          this.currentPage = 1;
+          break;
+        case 2:
+          this.currentPage = this.currentPage - 1;
+          break;
+        case 3:
+          this.currentPage = this.currentPage + 1;
+          break;
+        case 4:
+          this.currentPage = this.totalPage;
+          break;
+      }
+    },
+    //编辑
+    edit: function (config) {
+      console.log(config)
+    },
+  },
+  created() {},
+};
+</script>
+
+<style scoped lang="less">
+/* 查看详情样式 */
+.table_template {
+  text-align: center;
+  .table {
+    background-color: #fff;
+    border-collapse: collapse;
+    border: none;
+    width: 100%;
+    td {
+      border: 1px solid #ccc;
+      height: 36px;
+      width: 25%;
+    }
+    span {
+      &:hover {
+        cursor: pointer;
+      }
+    }
+  }
+}
+.table_gray {
+  background-color: #eeeeee;
+}
+.operationStyle span {
+  color: #0000ff;
+}
+.operationBox {
+  width: 100%;
+  display: flex;
+  justify-content: space-around;
+}
+
+.HeadLeft {
+  border: 1px solid #ccc;
+}
+.pageD {
+  display: flex;
+  justify-content: flex-end;
+  align-items: center;
+  margin-top: 10px;
+}
+.pageD p {
+  margin-left: 16px;
+}
+.reportStyle {
+  text-decoration: underline;
+  cursor: pointer;
+}
+.showItemOperationStyle {
+  display: none;
+}
+.noJump {
+  color: rgb(173, 162, 162);
+  cursor: text !important;
+  text-decoration: underline;
+}
+.canJump {
+  text-decoration: underline;
+}
+.notice_changShang button:nth-of-type(1) {
+  position: relative;
+  float: right;
+  margin: 8px 8px;
+  padding: 8px 16px;
+  width: 100px;
+  height: 35px;
+  border-radius: 5px;
+}
+</style>
+

+ 27 - 0
src/views/notification/jingXiaoshang.vue

@@ -0,0 +1,27 @@
+<template>
+  <div class="upload_links">
+   
+  </div>
+</template>
+
+<script>
+
+export default {
+  components: {
+
+  },
+  data() {
+    return {
+      
+    };
+  },
+  computed: {
+  },
+  methods: {},
+  created() {},
+};
+</script>
+
+<style scoped lang="less">
+
+</style>