From c6e34a7672b0d281cf1796e7528bb4abd3928d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E6=9C=9F=E8=80=8C=E9=81=87?= <2680643943@qq.com> Date: Sat, 22 May 2021 11:11:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=A0=8F=E7=9B=AE=E6=89=80=E5=B1=9E=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/WEB-INF/manager/cms/category/form.ftl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/webapp/WEB-INF/manager/cms/category/form.ftl b/src/main/webapp/WEB-INF/manager/cms/category/form.ftl index 58164266..030f9ef2 100644 --- a/src/main/webapp/WEB-INF/manager/cms/category/form.ftl +++ b/src/main/webapp/WEB-INF/manager/cms/category/form.ftl @@ -352,6 +352,17 @@ var _this = this; if (n == this.form.id) { + //获取当前节点的父栏目 + let parentids = _this.form.parentids; + if (parentids) { + let parentNode = parentids.split(','); + //获取最近的父节点 + _this.form.categoryId = parentNode[parentNode.length - 1]; + } + else{ + //无父栏目就恢复顶级 + _this.form.categoryId = '0'; + } this.$notify({ title: '提示', message: '所属栏目不能为自身',