ccf преди 4 години
родител
ревизия
7c0d11d05f
променени са 3 файла, в които са добавени 75 реда и са изтрити 0 реда
  1. 3 0
      components/menu/data.js
  2. 42 0
      pages/main/index/js/nav_list.js
  3. 30 0
      pages/main/index/nav_list.vue

+ 3 - 0
components/menu/data.js

@@ -349,6 +349,9 @@ export default [{
     subs: [{
       title: "职业技能配置",
       path: baseUrl + "occupation_setting"
+    },{
+      title: "导航二级配置",
+      path: baseUrl + "nav_list"
     }]
   },
   {

+ 42 - 0
pages/main/index/js/nav_list.js

@@ -0,0 +1,42 @@
+export default {
+  data() {
+    return {
+      list: [],
+    }
+  },
+  mounted() {
+    this.getList();
+  },
+  methods: {
+    async getList() {
+      let res = await this.$post("/api/admin/nav/list");
+      if (res && res.status === 1) {
+        this.list = res.data.list || [];
+      }
+    },
+    async del(id) {
+      let res = await this.$post("/api/admin/nav/del",{id:id});
+      if (res && res.status === 1) {
+        this.$message({
+          type: 'success',
+          message: '操作成功!'
+        });
+        this.getList();
+      }
+    },
+    async status(id,status) {
+      let res = await this.$post("/api/admin/nav/status",{status:status,id:id});
+      if (res && res.status === 1) {
+        this.$message({
+          type: 'success',
+          message: '操作成功!'
+        });
+        this.getList();
+      }
+    },
+    async add() {
+
+    },
+  }
+
+}

+ 30 - 0
pages/main/index/nav_list.vue

@@ -0,0 +1,30 @@
+<template>
+  <div>
+
+    <el-button type="primary" @click="add()" style="margin-top: 15px;margin-right: 30px;float: left">添加二级页</el-button>
+    <div style="clear: both;"></div>
+    <div style="margin-bottom: 15px"></div>
+    <div>
+      <el-table :data="list" border style="width: 100%" >
+        <el-table-column prop="title" label="标题"></el-table-column>
+        <el-table-column prop="order" label="排序" ></el-table-column>
+        <el-table-column prop="status" label="状态" >
+          <template slot-scope="scope">
+            <span v-if="scope.row.status == 1">已启用</span>
+            <span v-if="scope.row.status == 2" style="color:red">已禁用</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="addtime" label="添加时间" ></el-table-column>
+        <el-table-column prop="ctrontorl" label="操作" width="320px">
+          <template slot-scope="scope">
+            <el-button type="text" @click="del(scope.row.id)">删除</el-button>
+            <el-button type="text" @click="editGroup(scope.row)">编辑</el-button>
+            <el-button type="text" v-if="scope.row.status == 1" @click="status(scope.row.id,scope.row.status)">下架</el-button>
+            <el-button type="text" v-if="scope.row.status == 2" @click="status(scope.row.id,scope.row.status)">上架</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+  </div>
+</template>
+<script src="./js/nav_list.js"></script>