소스 검색

轮播,景点,文章,栏目

lchao 7 달 전
부모
커밋
7ef2d5add6

+ 13 - 5
zhjq-business/src/main/resources/mapper/ZhjqArticleMapper.xml

@@ -16,7 +16,7 @@
     </resultMap>
 
     <sql id="selectZhjqArticleVo">
-        select id, Journalism_name, Journalism_content, create_time, sort, column_id, author
+        select id, Journalism_name, Journalism_content, create_time, sort, column_id, author,release_time
         from zhjq_article
     </sql>
 
@@ -28,16 +28,23 @@
         a.create_time,
         a.sort,
         a.column_id,
-        release_time,
+        a.release_time,
         a.author,
-        GROUP_CONCAT( b.column_name ) AS columnName
+        b.column_name AS columnName
         FROM
         zhjq_article a
         LEFT JOIN zhjq_column b ON a.column_id = b.column_id
         <where>
-            <if test="journalismName != null  and journalismName != ''">and Journalism_name like concat('%',
+            <if test="journalismName != null  and journalismName != ''">and a.Journalism_name like concat('%',
                 #{journalismName}, '%')
             </if>
+            <if test="columnName != null  and columnName != ''">and b.column_name like concat('%',
+                #{columnName}, '%')
+            </if>
+            <if test="columnId != null and columnId != 0">
+                AND (a.column_id = #{columnId} OR a.column_id IN ( SELECT b.column_id FROM zhjq_column b WHERE
+                find_in_set(#{columnId},parent_id) ))
+            </if>
         </where>
     </select>
 
@@ -51,7 +58,8 @@
                a.column_id,
                a.release_time,
                a.author,
-               GROUP_CONCAT(b.column_id) AS columnId
+               b.column_id AS columnId,
+               b.column_name as columnName
         FROM zhjq_article a
                  LEFT JOIN zhjq_column b ON a.column_id = b.column_id
         where a.id = #{id}

+ 2 - 2
zhjq-business/src/main/resources/mapper/ZhjqColumnMapper.xml

@@ -39,14 +39,14 @@
         LEFT JOIN zhjq_column b ON a.column_id = b.parent_id
         <where>
             <if test="columnName != null  and columnName != ''">
-                and column_name like concat('%', #{columnName}, '%')
+                and a.column_name like concat('%', #{columnName}, '%')
             </if>
             <if test="columnId != null and columnId != 0">
                 AND (a.column_id = #{columnId} OR a.column_id IN ( SELECT t.column_id FROM zhjq_column t WHERE
                 find_in_set(#{columnId},parent_id) ))
             </if>
         </where>
-        order by parent_id
+        order by order_num
     </select>
 
     <select id="selectZhjqColumnByColumnId" parameterType="Long"

+ 262 - 167
zhjq-ui/src/views/system/article/index.vue

@@ -1,167 +1,171 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="标题" prop="journalismName">
-        <el-input
-          v-model="queryParams.journalismName"
-          placeholder="请输入标题"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="排序" prop="sort">
-        <el-input
-          v-model="queryParams.sort"
-          placeholder="请输入排序"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="栏目" prop="columnId">
-        <el-input
-          v-model="queryParams.columnId"
-          placeholder="请输入栏目"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="作者" prop="author">
-        <el-input
-          v-model="queryParams.author"
-          placeholder="请输入作者"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
-
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['system:article:add']"
-        >新增
-        </el-button>
+    <el-row :gutter="20">
+      <!--栏目数据-->
+      <el-col :span="4" :xs="24">
+        <div class="head-container">
+          <el-input
+              v-model="columnName"
+              placeholder="请输入栏目名称"
+              clearable
+              size="small"
+              prefix-icon="el-icon-search"
+              style="margin-bottom: 20px"
+          />
+        </div>
+        <div class="head-container">
+          <el-tree
+              :data="columnOptions"
+              :props="defaultProps"
+              :expand-on-click-node="false"
+              :filter-node-method="filterNode"
+              ref="tree"
+              node-key="id"
+              default-expand-all
+              highlight-current
+              @node-click="handleNodeClick"
+          />
+        </div>
       </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['system:article:edit']"
-        >修改
-        </el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['system:article:remove']"
-        >删除
-        </el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['system:article:export']"
-        >导出
-        </el-button>
-      </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
+      <!--文章数据-->
+      <el-col :span="20" :xs="24">
+        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
+                 label-width="68px">
+          <el-form-item label="标题" prop="journalismName">
+            <el-input
+                v-model="queryParams.journalismName"
+                placeholder="请输入标题"
+                clearable
+                @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+          </el-form-item>
+        </el-form>
 
-    <el-table v-loading="loading" :data="articleList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="标题" align="center" prop="journalismName"/>
-      <el-table-column label="排序" align="center" prop="sort"/>
-      <el-table-column label="栏目" align="center" prop="columnName"/>
-      <el-table-column label="作者" align="center" prop="author"/>
-      <el-table-column align="center" label="发布时间" prop="releaseTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.releaseTime, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-        <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['system:article:edit']"
-          >修改
-          </el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['system:article:remove']"
-          >删除
-          </el-button>
-        </template>
-      </el-table-column>
-    </el-table>
+        <el-row :gutter="10" class="mb8">
+          <el-col :span="1.5">
+            <el-button
+                type="primary"
+                plain
+                icon="el-icon-plus"
+                size="mini"
+                @click="handleAdd"
+                v-hasPermi="['system:article:add']"
+            >新增
+            </el-button>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button
+                type="success"
+                plain
+                icon="el-icon-edit"
+                size="mini"
+                :disabled="single"
+                @click="handleUpdate"
+                v-hasPermi="['system:article:edit']"
+            >修改
+            </el-button>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button
+                type="danger"
+                plain
+                icon="el-icon-delete"
+                size="mini"
+                :disabled="multiple"
+                @click="handleDelete"
+                v-hasPermi="['system:article:remove']"
+            >删除
+            </el-button>
+          </el-col>
+          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+        </el-row>
 
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
+        <el-table v-loading="loading" :data="articleList" @selection-change="handleSelectionChange">
+          <el-table-column type="selection" width="55" align="center"/>
+          <el-table-column label="标题" align="center" prop="journalismName"/>
+          <el-table-column label="排序" align="center" prop="sort"/>
+          <el-table-column label="栏目" align="center" prop="columnName"/>
+          <el-table-column label="作者" align="center" prop="author"/>
+          <el-table-column align="center" label="发布时间" prop="releaseTime" width="180">
+            <template slot-scope="scope">
+              <span>{{ parseTime(scope.row.releaseTime, '{y}-{m}-{d}') }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+            <template slot-scope="scope">
+              <el-button
+                  size="mini"
+                  type="text"
+                  icon="el-icon-edit"
+                  @click="handleUpdate(scope.row)"
+                  v-hasPermi="['system:article:edit']"
+              >修改
+              </el-button>
+              <el-button
+                  size="mini"
+                  type="text"
+                  icon="el-icon-delete"
+                  @click="handleDelete(scope.row)"
+                  v-hasPermi="['system:article:remove']"
+              >删除
+              </el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <pagination
+            v-show="total>0"
+            :total="total"
+            :page.sync="queryParams.pageNum"
+            :limit.sync="queryParams.pageSize"
+            @pagination="getList"
+        />
+      </el-col>
+    </el-row>
 
     <!-- 添加或修改文章管理对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
         <el-form-item label="标题" prop="journalismName">
           <el-input v-model="form.journalismName" placeholder="请输入标题"/>
         </el-form-item>
-        <el-form-item label="发布时间" prop="releaseTime">
-          <el-date-picker
-            v-model="form.releaseTime"
-            type="date"
-            placeholder="请选择发布时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="排序" prop="sort">
-          <el-input-number :min="1" v-model="value" placeholder="请输入排序"/>
-        </el-form-item>
-        <el-form-item label="栏目" prop="columnName">
-          <el-select v-model="form.columnId" filterable clearable placeholder="请选择栏目"
-                     style="width:340px"
-                     @change="onChange"
-          >
-            <el-option
-              v-for="item in columnList"
-              :key="item.index"
-              :label="item.columnName"
-              :value="item.columnId"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="作者" prop="author">
-          <el-input v-model="form.author" placeholder="请输入作者"/>
-        </el-form-item>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="发布时间" prop="releaseTime">
+              <el-date-picker
+                  v-model="form.releaseTime"
+                  type="date"
+                  placeholder="请选择发布时间">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="作者" prop="author">
+              <el-input v-model="form.author" placeholder="请输入作者"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="排序" prop="sort">
+              <el-input-number :min="1" v-model="value" placeholder="请输入排序"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+
+            <el-form-item label="栏目" prop="columnId">
+              <treeselect
+                  v-model="form.columnId"
+                  :options="menuOptions"
+                  :normalizer="normalizer"
+                  :show-count="true"
+                  placeholder="选择栏目"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
         <el-form-item label="内容" prop="journalismContent">
           <editor style="height: 300px" label="富文本控件" v-model="form.journalismContent"/>
         </el-form-item>
@@ -176,10 +180,13 @@
 
 <script>
 import {getArticle, listArticle, addArticle, updateArticle, delArticle} from "@/api/system/article";
-import {columnAllList} from "@/api/system/column";
+import {columnAllList, treeselect} from "@/api/system/column";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 
 export default {
   name: "Article",
+  components: {Treeselect},
   data() {
     return {
       // 遮罩层
@@ -200,6 +207,12 @@ export default {
       columnList: [],
       // 栏目存储数据
       tickets: [],
+      //树
+      menuOptions: [],
+      // 栏目名称
+      columnName: undefined,
+      // 栏目树选项
+      columnOptions: undefined,
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -210,7 +223,6 @@ export default {
         pageSize: 10,
         journalismName: null,
         journalismContent: null,
-        sort: 999,
         columnId: null,
         author: null,
         releaseTime: null
@@ -218,19 +230,57 @@ export default {
       value: 999,
       // 表单参数
       form: {},
+      defaultProps: {
+        children: "children",
+        label: "label"
+      },
       // 表单校验
-      rules: {}
+      rules: {
+        journalismName: [
+          {
+            required: true, message: "标题不能为空", trigger: "blur"
+          }
+        ],
+        author: [
+          {
+            required: true, message: "作者不能为空", trigger: "blur"
+          }
+        ],
+        releaseTime: [
+          {
+            required: true, message: "发布时间不能为空", trigger: "blur"
+          }
+        ],
+        columnName: [
+          {
+            required: true, message: "栏目名称不能为空", trigger: "blur"
+          }
+        ],
+      }
     };
   },
+  watch: {
+    // 根据名称筛选部门树
+    columnName(val) {
+      this.$refs.tree.filter(val);
+    }
+  },
   created() {
     this.getList();
-    this.getColumnList();
+    // this.getColumnList();
+    this.getColumnTree();
   },
   methods: {
-    onChange(e) {
-      this.form.tickets = this.columnList.filter((item) =>
-        e.includes(item.id)
-      )
+    getNowTime() {
+      var now = new Date()
+      var year = now.getFullYear() // 得到年份
+      var month = now.getMonth() // 得到月份
+      var date = now.getDate() // 得到日期
+      month = month + 1
+      month = month.toString().padStart(2, '0')
+      date = date.toString().padStart(2, '0')
+      var defaultDate = `${year}-${month}-${date}`
+      this.$set(this.form, 'releaseTime', defaultDate)
     },
     /** 查询文章管理列表 */
     getList() {
@@ -241,6 +291,44 @@ export default {
         this.loading = false;
       });
     },
+    /** 转换菜单数据结构 */
+    normalizer(node) {
+      if (node.children && !node.children.length) {
+        delete node.children;
+      }
+      return {
+        id: node.columnId,
+        label: node.columnName,
+        children: node.children
+      };
+    },
+    /** 查询栏目下拉树结构 */
+    getTreeselect() {
+      columnAllList().then(response => {
+        this.menuOptions = [];
+        const menu = {columnId: 0, columnName: '主类目', children: []};
+        menu.children = this.handleTree(response.data, "columnId");
+        this.menuOptions.push(menu);
+      });
+    },
+    /** 查询左侧下拉树结构 */
+    getColumnTree() {
+      treeselect().then(response => {
+        this.columnOptions = response.data;
+      });
+    },
+    // 筛选节点
+    filterNode(value, data) {
+      console.log("文章value",value)
+      console.log("文章data",data)
+      if (!value) return true;
+      return data.label.indexOf(value) !== -1;
+    },
+    // 节点单击事件
+    handleNodeClick(data) {
+      this.queryParams.columnId = data.id;
+      this.handleQuery();
+    },
     /** 查询文章管理全部列表 */
     getColumnList() {
       this.loading = true;
@@ -263,15 +351,17 @@ export default {
         createTime: null,
         sort: null,
         columnId: null,
-        author: null
+        author: null,
+        releaseTime: null,
       };
       this.resetForm("form");
+      this.getNowTime()
     },
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1;
       this.getList();
-      this.getColumnList();
+      // this.getColumnList();
     },
     /** 重置按钮操作 */
     resetQuery() {
@@ -287,13 +377,15 @@ export default {
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
-      this.value = 999
+      this.getTreeselect();
+      this.value = 999;
       this.open = true;
       this.title = "添加文章管理";
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
+      this.getTreeselect();
       const id = row.id || this.ids
       getArticle(id).then(response => {
         this.form = response.data;
@@ -304,6 +396,7 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      this.form.sort = this.value
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
@@ -311,14 +404,16 @@ export default {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
-              this.getColumnList();
+              // this.getColumnList();
+              this.getColumnTree();
             });
           } else {
             addArticle(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
-              this.getColumnList();
+              // this.getColumnList();
+              this.getColumnTree();
             });
           }
         }
@@ -331,7 +426,7 @@ export default {
         return delArticle(ids);
       }).then(() => {
         this.getList();
-        this.getColumnList();
+        // this.getColumnList();
         this.$modal.msgSuccess("删除成功");
       }).catch(() => {
       });

+ 11 - 11
zhjq-ui/src/views/system/carousel/index.vue

@@ -67,17 +67,17 @@
         >删除
         </el-button>
       </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['system:carousel:export']"
-        >导出
-        </el-button>
-      </el-col>
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="warning"-->
+<!--          plain-->
+<!--          icon="el-icon-download"-->
+<!--          size="mini"-->
+<!--          @click="handleExport"-->
+<!--          v-hasPermi="['system:carousel:export']"-->
+<!--        >导出-->
+<!--        </el-button>-->
+<!--      </el-col>-->
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 

+ 67 - 83
zhjq-ui/src/views/system/column/index.vue

@@ -1,97 +1,73 @@
 <template>
   <div class="app-container">
     <el-row :gutter="20">
-      <!--部门数据-->
+      <!--栏目数据-->
       <el-col :span="4" :xs="24">
         <div class="head-container">
           <el-input
-            v-model="columnName"
-            placeholder="请输入栏目名称"
-            clearable
-            size="small"
-            prefix-icon="el-icon-search"
-            style="margin-bottom: 20px"
+              v-model="columnName"
+              placeholder="请输入栏目名称"
+              clearable
+              size="small"
+              prefix-icon="el-icon-search"
+              style="margin-bottom: 20px"
           />
         </div>
         <div class="head-container">
           <el-tree
-            :data="columnOptions"
-            :props="defaultProps"
-            :expand-on-click-node="false"
-            :filter-node-method="filterNode"
-            ref="tree"
-            node-key="id"
-            default-expand-all
-            highlight-current
-            @node-click="handleNodeClick"
+              :data="columnOptions"
+              :props="defaultProps"
+              :expand-on-click-node="false"
+              :filter-node-method="filterNode"
+              ref="tree"
+              node-key="id"
+              default-expand-all
+              highlight-current
+              @node-click="handleNodeClick"
           />
         </div>
       </el-col>
-      <!--用户数据-->
+      <!--数据-->
       <el-col :span="20" :xs="24">
         <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
                  label-width="68px">
-          <el-form-item label="栏目名称" prop="columnName">
-            <el-input
-              v-model="queryParams.columnName"
-              placeholder="请输入栏目名称"
-              clearable
-              @keyup.enter.native="handleQuery"
-            />
-          </el-form-item>
-          <el-form-item>
-            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-          </el-form-item>
         </el-form>
-
         <el-row :gutter="10" class="mb8">
           <el-col :span="1.5">
             <el-button
-              type="primary"
-              plain
-              icon="el-icon-plus"
-              size="mini"
-              @click="handleAdd"
-              v-hasPermi="['system:column:add']"
+                type="primary"
+                plain
+                icon="el-icon-plus"
+                size="mini"
+                @click="handleAdd"
+                v-hasPermi="['system:column:add']"
             >新增
             </el-button>
           </el-col>
           <el-col :span="1.5">
             <el-button
-              type="success"
-              plain
-              icon="el-icon-edit"
-              size="mini"
-              :disabled="single"
-              @click="handleUpdate"
-              v-hasPermi="['system:column:edit']"
+                type="success"
+                plain
+                icon="el-icon-edit"
+                size="mini"
+                :disabled="single"
+                @click="handleUpdate"
+                v-hasPermi="['system:column:edit']"
             >修改
             </el-button>
           </el-col>
           <el-col :span="1.5">
             <el-button
-              type="danger"
-              plain
-              icon="el-icon-delete"
-              size="mini"
-              :disabled="multiple"
-              @click="handleDelete"
-              v-hasPermi="['system:column:remove']"
+                type="danger"
+                plain
+                icon="el-icon-delete"
+                size="mini"
+                :disabled="multiple"
+                @click="handleDelete"
+                v-hasPermi="['system:column:remove']"
             >删除
             </el-button>
           </el-col>
-          <el-col :span="1.5">
-            <el-button
-              type="warning"
-              plain
-              icon="el-icon-download"
-              size="mini"
-              @click="handleExport"
-              v-hasPermi="['system:column:export']"
-            >导出
-            </el-button>
-          </el-col>
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
 
@@ -103,19 +79,19 @@
           <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
             <template slot-scope="scope">
               <el-button
-                size="mini"
-                type="text"
-                icon="el-icon-edit"
-                @click="handleUpdate(scope.row)"
-                v-hasPermi="['system:column:edit']"
+                  size="mini"
+                  type="text"
+                  icon="el-icon-edit"
+                  @click="handleUpdate(scope.row)"
+                  v-hasPermi="['system:column:edit']"
               >修改
               </el-button>
               <el-button
-                size="mini"
-                type="text"
-                icon="el-icon-delete"
-                @click="handleDelete(scope.row)"
-                v-hasPermi="['system:column:remove']"
+                  size="mini"
+                  type="text"
+                  icon="el-icon-delete"
+                  @click="handleDelete(scope.row)"
+                  v-hasPermi="['system:column:remove']"
               >删除
               </el-button>
             </template>
@@ -123,11 +99,11 @@
         </el-table>
 
         <pagination
-          v-show="total>0"
-          :total="total"
-          :page.sync="queryParams.pageNum"
-          :limit.sync="queryParams.pageSize"
-          @pagination="getList"
+            v-show="total>0"
+            :total="total"
+            :page.sync="queryParams.pageNum"
+            :limit.sync="queryParams.pageSize"
+            @pagination="getList"
         />
       </el-col>
     </el-row>
@@ -140,15 +116,15 @@
         </el-form-item>
         <el-form-item label="上级菜单" prop="parentId">
           <treeselect
-            v-model="form.parentId"
-            :options="menuOptions"
-            :normalizer="normalizer"
-            :show-count="true"
-            placeholder="选择上级菜单"
+              v-model="form.parentId"
+              :options="menuOptions"
+              :normalizer="normalizer"
+              :show-count="true"
+              placeholder="选择上级菜单"
           />
         </el-form-item>
-        <el-form-item label="显示顺序" prop="orderNum">
-          <el-input v-model="form.orderNum" placeholder="请输入显示顺序"/>
+        <el-form-item label="序" prop="orderNum">
+          <el-input-number :min="1" v-model="value" placeholder="请输入排序"/>
         </el-form-item>
         <el-form-item label="备注" prop="remark">
           <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
@@ -213,6 +189,7 @@ export default {
         orderNum: null,
         managerName: null,
       },
+      value: 999,
       // 表单参数
       form: {},
       defaultProps: {
@@ -278,6 +255,8 @@ export default {
     },
     // 筛选节点
     filterNode(value, data) {
+      console.log("栏目value",value)
+      console.log("栏目data",data)
       if (!value) return true;
       return data.label.indexOf(value) !== -1;
     },
@@ -327,6 +306,7 @@ export default {
     handleAdd(row) {
       this.reset();
       this.getTreeselect();
+      this.value = 999
       this.open = true;
       this.title = "添加栏目管理";
     },
@@ -337,12 +317,14 @@ export default {
       const columnId = row.columnId || this.ids
       getColumn(columnId).then(response => {
         this.form = response.data;
+        this.value = this.form.orderNum
         this.open = true;
         this.title = "修改栏目管理";
       });
     },
     /** 提交按钮 */
     submitForm() {
+      this.form.orderNum = this.value
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.columnId != null) {
@@ -350,12 +332,14 @@ export default {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+              this.getColumnTree();
             });
           } else {
             addColumn(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
+              this.getColumnTree();
             });
           }
         }

+ 11 - 11
zhjq-ui/src/views/system/scenery/index.vue

@@ -51,17 +51,17 @@
         >删除
         </el-button>
       </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['system:scenery:export']"
-        >导出
-        </el-button>
-      </el-col>
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="warning"-->
+<!--          plain-->
+<!--          icon="el-icon-download"-->
+<!--          size="mini"-->
+<!--          @click="handleExport"-->
+<!--          v-hasPermi="['system:scenery:export']"-->
+<!--        >导出-->
+<!--        </el-button>-->
+<!--      </el-col>-->
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>