commit
This commit is contained in:
@@ -146,10 +146,10 @@ public class SysHomeController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@SaCheckLogin
|
@SaCheckLogin
|
||||||
@ApiOperation("电脑端快速入口")
|
@ApiOperation("电脑端推荐应用")
|
||||||
@Ok("json")
|
@Ok("json")
|
||||||
public Result listQuickEntry(String platform) {
|
public Result listRecommendApp(String platform) {
|
||||||
List<Sys_menu> list = sysMenuService.query(Cnd.where(Sys_menu::getIsQuickEntry, "=", 1)
|
List<Sys_menu> list = sysMenuService.query(Cnd.where(Sys_menu::getIsRecommendApp, "=", 1)
|
||||||
.and(Sys_menu::getDisabled, "=", 0)
|
.and(Sys_menu::getDisabled, "=", 0)
|
||||||
.and(Sys_menu::getShowit, "=", 1)
|
.and(Sys_menu::getShowit, "=", 1)
|
||||||
.and(Sys_menu::getPlatform, "=", platform)
|
.and(Sys_menu::getPlatform, "=", platform)
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@IocBean
|
@IocBean
|
||||||
@At("/platform/sys/menu")
|
@At("/platform/sys/menu")
|
||||||
@@ -422,11 +423,16 @@ public class SysMenuController {
|
|||||||
@At
|
@At
|
||||||
@Ok("json")
|
@Ok("json")
|
||||||
@SaCheckPermission("sys.manager.menu")
|
@SaCheckPermission("sys.manager.menu")
|
||||||
@ApiOperation("更新快捷入口")
|
@ApiOperation("更新首页推荐应用或服务")
|
||||||
public Result updateQuickEntry(@Param("menuIds") String[] menuIds, String platform) {
|
public Result updateRecommendSetting(@Param("menuIds") String[] menuIds, String platform, String type) {
|
||||||
sysMenuService.update(Chain.make("isQuickEntry", 0), Cnd.where("id", "is not", null).and("platform", "=", platform));
|
String column = "";
|
||||||
|
switch (type) {
|
||||||
|
case "app" -> column = "isRecommendApp";
|
||||||
|
case "service" -> column = "isRecommendService";
|
||||||
|
}
|
||||||
|
sysMenuService.update(Chain.make(column, 0), Cnd.where("id", "is not", null).and("platform", "=", platform));
|
||||||
if (ArrayUtil.isNotEmpty(menuIds)) {
|
if (ArrayUtil.isNotEmpty(menuIds)) {
|
||||||
sysMenuService.update(Chain.make("isQuickEntry", 1), Cnd.where("id", "in", menuIds).and("platform", "=", platform));
|
sysMenuService.update(Chain.make(column, 1), Cnd.where("id", "in", menuIds).and("platform", "=", platform));
|
||||||
}
|
}
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,11 +121,17 @@ public class Sys_menu extends BaseModel implements Serializable {
|
|||||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||||
private String moduleId;
|
private String moduleId;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("是否是推荐应用")
|
||||||
|
@ColDefine(type = ColType.BOOLEAN)
|
||||||
|
@Default("0")
|
||||||
|
private Boolean isRecommendApp;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@Comment("是否是快捷入口")
|
@Comment("是否是推荐服务")
|
||||||
@ColDefine(type = ColType.BOOLEAN)
|
@ColDefine(type = ColType.BOOLEAN)
|
||||||
@Default("0")
|
@Default("0")
|
||||||
private Boolean isQuickEntry;
|
private Boolean isRecommendService;
|
||||||
|
|
||||||
//按钮权限
|
//按钮权限
|
||||||
private List<Sys_menu> buttons;
|
private List<Sys_menu> buttons;
|
||||||
|
|||||||
@@ -280,8 +280,8 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
listQuickEntry() {
|
listRecommendApp() {
|
||||||
this.$axios.post("/platform/home/listQuickEntry").then((res) => {
|
this.$axios.post("/platform/home/listRecommendApp").then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.quickEntries = res.data
|
this.quickEntries = res.data
|
||||||
}
|
}
|
||||||
@@ -299,7 +299,7 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.listQuickEntry()
|
this.listRecommendApp()
|
||||||
this.listActivity()
|
this.listActivity()
|
||||||
this.listProcessInstance()
|
this.listProcessInstance()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,8 +44,11 @@ layout("/layouts/platform.html"){
|
|||||||
<table-tool>
|
<table-tool>
|
||||||
<el-button @click="$refs.basicFormRef.onOpen(null,pageForm.platform)" size="small" type="primary" icon="el-icon-plus">新建菜单</el-button>
|
<el-button @click="$refs.basicFormRef.onOpen(null,pageForm.platform)" size="small" type="primary" icon="el-icon-plus">新建菜单</el-button>
|
||||||
<el-button @click="$refs.sortRef.onOpen(pageForm.platform)" size="small" type="primary" icon="el-icon-sort">排序</el-button>
|
<el-button @click="$refs.sortRef.onOpen(pageForm.platform)" size="small" type="primary" icon="el-icon-sort">排序</el-button>
|
||||||
<el-button @click="$refs.quickEntryRef.onOpen(pageForm.platform)" size="small" type="primary" icon="el-icon-monitor">
|
<el-button @click="$refs.recommendSettingRef.onOpen(pageForm.platform, 'app')" size="small" type="primary" icon="el-icon-monitor">
|
||||||
首页快速入口
|
首页推荐应用
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="$refs.recommendSettingRef.onOpen(pageForm.platform, 'service')" size="small" type="primary" icon="el-icon-monitor">
|
||||||
|
首页推荐服务
|
||||||
</el-button>
|
</el-button>
|
||||||
</table-tool>
|
</table-tool>
|
||||||
<el-table
|
<el-table
|
||||||
@@ -120,7 +123,7 @@ layout("/layouts/platform.html"){
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- 右键菜单 -->
|
<!-- 右键菜单 -->
|
||||||
<ul v-show="menuVisible" class="context-menu" :style="{left: menuLeft + 'px', top: menuTop + 'px'}">
|
<ul v-show="menuVisible" class="context-menu" :style="{left: menuLeft + 'px', top: menuTop + 'px'}">
|
||||||
<li @click="handleAddMenu(currentRow)">新建菜单</li>
|
<li @click="handleAddMenu(currentRow)">新建菜单</li>
|
||||||
@@ -128,20 +131,20 @@ layout("/layouts/platform.html"){
|
|||||||
<li @click="handleEdit(currentRow)">编辑</li>
|
<li @click="handleEdit(currentRow)">编辑</li>
|
||||||
<li @click="handleDelete(currentRow)">删除</li>
|
<li @click="handleDelete(currentRow)">删除</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
|
|
||||||
<basic-form ref="basicFormRef" @refresh="loadChildByExpandedKeys"></basic-form>
|
<basic-form ref="basicFormRef" @refresh="loadChildByExpandedKeys"></basic-form>
|
||||||
<permission-form ref="permissionFormRef" @load-child="loadChildByExpandedKeys"></permission-form>
|
<permission-form ref="permissionFormRef" @load-child="loadChildByExpandedKeys"></permission-form>
|
||||||
<sort ref="sortRef" @refresh="doSearch"></sort>
|
<sort ref="sortRef" @refresh="doSearch"></sort>
|
||||||
<quick-entry ref="quickEntryRef" @refresh="doSearch"></quick-entry>
|
<recommend-setting ref="recommendSettingRef" @refresh="doSearch"></recommend-setting>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
<!--#include("permissionForm.js"){}#-->
|
<!--#include("permissionForm.js"){}#-->
|
||||||
<!--#include("basicForm.js"){}#-->
|
<!--#include("basicForm.js"){}#-->
|
||||||
<!--#include("sort.js"){}#-->
|
<!--#include("sort.js"){}#-->
|
||||||
<!--#include("quickEntry.js"){}#-->
|
<!--#include("recommendSetting.js"){}#-->
|
||||||
new Vue({
|
new Vue({
|
||||||
el: "#app",
|
el: "#app",
|
||||||
dicts: ["SYS_MENU_PLATFORM"],
|
dicts: ["SYS_MENU_PLATFORM"],
|
||||||
@@ -149,7 +152,7 @@ layout("/layouts/platform.html"){
|
|||||||
"basic-form": SYS_MENU_BASIC_FORM_COMPONENT,
|
"basic-form": SYS_MENU_BASIC_FORM_COMPONENT,
|
||||||
"permission-form": SYS_MENU_PERMISSION_FORM_COMPONENT,
|
"permission-form": SYS_MENU_PERMISSION_FORM_COMPONENT,
|
||||||
sort: SYS_MENU_SORT_COMPONENT,
|
sort: SYS_MENU_SORT_COMPONENT,
|
||||||
"quick-entry": SYS_MENU_QUICK_ENTRY_COMPONENT
|
"recommend-setting": SYS_MENU_RECOMMEND_SETTING_COMPONENT
|
||||||
},
|
},
|
||||||
|
|
||||||
data: function () {
|
data: function () {
|
||||||
@@ -161,7 +164,7 @@ layout("/layouts/platform.html"){
|
|||||||
// 保存展开状态的数组
|
// 保存展开状态的数组
|
||||||
expandedRowKeysRenew: [],
|
expandedRowKeysRenew: [],
|
||||||
tableTreeRefreshTool: [],
|
tableTreeRefreshTool: [],
|
||||||
|
|
||||||
// 右键打开菜单相关
|
// 右键打开菜单相关
|
||||||
currentRow: null,
|
currentRow: null,
|
||||||
menuVisible: false,
|
menuVisible: false,
|
||||||
@@ -177,7 +180,7 @@ layout("/layouts/platform.html"){
|
|||||||
// 阻止浏览器默认菜单
|
// 阻止浏览器默认菜单
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.currentRow = row;
|
this.currentRow = row;
|
||||||
|
|
||||||
this.menuVisible = true;
|
this.menuVisible = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const menu = this.$el.querySelector('.context-menu');
|
const menu = this.$el.querySelector('.context-menu');
|
||||||
|
|||||||
+15
-8
@@ -1,6 +1,6 @@
|
|||||||
const SYS_MENU_QUICK_ENTRY_COMPONENT = {
|
const SYS_MENU_RECOMMEND_SETTING_COMPONENT = {
|
||||||
template: `
|
template: `
|
||||||
<el-dialog title="快速入口" :visible.sync="dialogVisible" width="50%">
|
<el-dialog title="推荐配置" :visible.sync="dialogVisible" width="50%">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-tree ref="menuTree"
|
<el-tree ref="menuTree"
|
||||||
@@ -46,12 +46,15 @@ const SYS_MENU_QUICK_ENTRY_COMPONENT = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
checkedNodes: [],
|
checkedNodes: [],
|
||||||
checkedKeys: []
|
checkedKeys: [],
|
||||||
|
|
||||||
|
type: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onOpen(platform) {
|
onOpen(platform, type) {
|
||||||
this.platform = platform
|
this.platform = platform
|
||||||
|
this.type = type
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
this.listTree()
|
this.listTree()
|
||||||
},
|
},
|
||||||
@@ -74,12 +77,15 @@ const SYS_MENU_QUICK_ENTRY_COMPONENT = {
|
|||||||
|
|
||||||
setTreeDisabled(data) {
|
setTreeDisabled(data) {
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
if (item.isQuickEntry) {
|
if ((this.type === 'service' && item.isRecommendService) || (this.type === 'app' && item.isRecommendApp)) {
|
||||||
this.checkedKeys.push(item.id)
|
this.checkedKeys.push(item.id)
|
||||||
}
|
}
|
||||||
if (!item.href && item.type === "menu") {
|
if (!item.href && item.type === "menu" && this.type === 'service') {
|
||||||
item.disabled = true
|
item.disabled = true
|
||||||
}
|
}
|
||||||
|
if (this.type === 'app') {
|
||||||
|
delete item.children
|
||||||
|
}
|
||||||
if (item.children && item.children.length) {
|
if (item.children && item.children.length) {
|
||||||
this.setTreeDisabled(item.children)
|
this.setTreeDisabled(item.children)
|
||||||
}
|
}
|
||||||
@@ -95,9 +101,10 @@ const SYS_MENU_QUICK_ENTRY_COMPONENT = {
|
|||||||
type: "warning"
|
type: "warning"
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$axios
|
this.$axios
|
||||||
.post("/platform/sys/menu/updateQuickEntry", {
|
.post("/platform/sys/menu/updateRecommendSetting", {
|
||||||
menuIds: JSON.stringify(this.checkedNodes.map((item) => item.id)),
|
menuIds: JSON.stringify(this.checkedNodes.map((item) => item.id)),
|
||||||
platform: this.platform
|
platform: this.platform,
|
||||||
|
type: this.type
|
||||||
})
|
})
|
||||||
.then((resp) => {
|
.then((resp) => {
|
||||||
if (resp.code === 0) {
|
if (resp.code === 0) {
|
||||||
@@ -67,8 +67,8 @@ const home = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
listQuickEntry() {
|
listRecommendApp() {
|
||||||
this.$axios.post("/platform/home/listQuickEntry", { platform: "H5" }).then((res) => {
|
this.$axios.post("/platform/home/listRecommendApp", { platform: "H5" }).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.quickEntries = res.data
|
this.quickEntries = res.data
|
||||||
}
|
}
|
||||||
@@ -91,7 +91,7 @@ const home = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.listQuickEntry()
|
this.listRecommendApp()
|
||||||
this.listActivity()
|
this.listActivity()
|
||||||
},
|
},
|
||||||
style: /*language=CSS*/ `
|
style: /*language=CSS*/ `
|
||||||
|
|||||||
Reference in New Issue
Block a user