Commit 6d9f2c01 authored by “yiyousong”'s avatar “yiyousong”

pref:修改翻页和应用集市

parent aa232724
......@@ -30,7 +30,12 @@
</a-layout-sider>
<a-layout class="main" style="padding: 0 24px 24px">
<a-layout-content>
<router-view></router-view>
<keep-alive>
<!-- 需要缓存的视图组件 -->
<router-view v-if="$route.meta.keepAlive"> </router-view>
</keep-alive>
<!-- 不需要缓存的视图组件 -->
<router-view v-if="!$route.meta.keepAlive"> </router-view>
</a-layout-content>
</a-layout>
</a-layout>
......
......@@ -20,6 +20,18 @@ export default {
TerminalApp,
MoveApp,
},
data() {
return {};
},
// 进入路有前
beforeRouteEnter(to, from, text) {
if (from.path === "/appmarket/appdetails") {
to.meta.isBack = true;
} else {
to.meta.isBack = false;
}
text();
},
};
</script>
......
......@@ -55,6 +55,7 @@
showTotal: (total) => `共 ${total} 条`,
current: current,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
size: 'small',
......
......@@ -46,6 +46,7 @@
showTotal: (total) => `共 ${total} 条`,
current: current,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
......
......@@ -23,6 +23,7 @@
showTotal: (total) => `共 ${total} 条`,
current: current,
total: total,
defaultPageSize: 1000,
onChange: handleChange,
onShowSizeChange: showSizeChange,
}"
......
......@@ -29,6 +29,7 @@
showTotal: (total) => `共 ${total} 条`,
current: current,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
......@@ -56,6 +57,10 @@
<template slot="summary" slot-scope="text">
{{ text.summary ? text.summary : "--" }}
</template>
<!-- 简介 -->
<template slot="version" slot-scope="text">
{{ text.version ? "v" + text.version : "--" }}
</template>
<!-- 类型 -->
<template slot="appType" slot-scope="text">
{{ text.appType === 1 ? "应用程序" : "URL" }}
......@@ -107,14 +112,7 @@ import AddApp from "../modal/AddApp.vue";
import CheckSite from "../modal/CheckSite.vue";
import { getAppList, deleteApp, saveApp } from "@/services/market";
import local from "@/utils/local";
export default {
components: {
YSwitch,
AddApp,
CheckSite,
},
data() {
const columns = [
const columns = [
{
title: "序号",
dataIndex: "num",
......@@ -133,9 +131,7 @@ export default {
},
{
title: "当前版本",
customRender: (text) => {
return <span>{"v" + text.version}</span>;
},
scopedSlots: { customRender: "version" },
},
{
title: "应用主题",
......@@ -163,7 +159,14 @@ export default {
width: "10%",
scopedSlots: { customRender: "action" },
},
];
];
export default {
components: {
YSwitch,
AddApp,
CheckSite,
},
data() {
return {
api: process.env.VUE_APP_API_BASE_URL.includes("base")
? process.env.VUE_APP_API_BASE_URL.replace("base", "")
......@@ -183,9 +186,16 @@ export default {
siteVisible: false,
};
},
created() {
// 详情页返回不刷新数据
activated() {
if (!this.$route.meta.isBack) {
Object.assign(this.$data, this.$options.data());
this.getAppList();
} else {
this.$route.meta.isBack = false;
}
},
created() {},
methods: {
// 获取应用列表
async getAppList() {
......
......@@ -30,6 +30,7 @@
showTotal: (total) => `共 ${total} 条`,
current: leftCurrent,
total: leftTotal,
pageSize: leftSize,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
......@@ -97,6 +98,7 @@
showTotal: (total) => `共 ${total} 条`,
current: rightCurrent,
total: rightTotal,
pageSize: rightSize,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
......
......@@ -44,6 +44,7 @@
showTotal: (total) => `共 ${total} 条`,
current: leftCurrent,
total: leftTotal,
pageSize: leftSize,
showSizeChanger: true,
showQuickJumper: true,
defaultPageSize: leftSize,
......@@ -117,6 +118,7 @@
showTotal: (total) => `共 ${total} 条`,
current: rightCurrent,
total: rightTotal,
pageSize: rightSize,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
......
......@@ -28,6 +28,7 @@
showTotal: (total) => `共 ${total} 条`,
current: leftCurrent,
total: leftTotal,
pageSize: leftSize,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
......@@ -85,6 +86,7 @@
:pagination="{
current: rightCurrent,
total: rightTotal,
pageSize: rightSize,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
......
......@@ -33,6 +33,7 @@
showTotal: (total) => `共 ${total} 条`,
current: current,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
......
<template>
<div class="index">
<keep-alive>
<!-- 需要缓存的视图组件 -->
<router-view v-if="$route.meta.keepAlive"> </router-view>
</keep-alive>
<!-- 不需要缓存的视图组件 -->
<router-view v-if="!$route.meta.keepAlive"> </router-view>
<router-view> </router-view>
</div>
</template>
......
......@@ -41,6 +41,7 @@
showTotal: (total) => `共 ${total} 条`,
current: Current,
total: total,
pageSize: size,
size: 'middle',
showSizeChanger: true,
showQuickJumper: true,
......
......@@ -21,6 +21,7 @@
</div>
<!-- 部门管理 -->
<div class="department-list">
<a-spin :spinning="deptLoading">
<div v-if="department.length">
<div
:class="{ department_off: true, active: active === i }"
......@@ -64,6 +65,7 @@
</div>
</div>
<a-empty style="margin-top: 20px" :image="simpleImage" v-else />
</a-spin>
</div>
</div>
......@@ -97,6 +99,7 @@
showTotal: (total) => `共 ${total} 条`,
current: page,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
......@@ -309,6 +312,7 @@ export default {
data() {
return {
loading: false,
deptLoading: false,
simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
title: "新增部门",
WindowTitle: "新增窗口",
......@@ -377,6 +381,7 @@ export default {
// 新增事项页面返回不刷新页面
activated() {
if (!this.$route.meta.isBack) {
Object.assign(this.$data, this.$options.data());
this.getDeptListData();
this.getBusinessData();
this.getWindowListData();
......@@ -399,12 +404,14 @@ export default {
},
// 获取部门列表
async getDeptListData(obj = {}) {
this.deptLoading = true;
let res = await getDeptList({
siteId: this.siteId,
page: 1,
size: -1,
...obj,
});
this.deptLoading = false;
let { code, data } = res.data;
if (code === 1) {
this.department = data.data;
......
......@@ -27,6 +27,7 @@
showTotal: (total) => `共 ${total} 条`,
current: page,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
......
......@@ -40,6 +40,7 @@
showTotal: (total) => `共 ${total} 条`,
current: leftCurrent,
total: leftTotal,
pageSize: leftSize,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
......@@ -133,6 +134,7 @@
showTotal: (total) => `共 ${total} 条`,
current: rightCurrent,
total: rightTotal,
pageSize: rightSize,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
......
......@@ -69,6 +69,7 @@
showTotal: (total) => `共 ${total} 条`,
current: page,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
......
......@@ -144,7 +144,7 @@ const options = {
path: "",
name: "应用集市",
component: () => import("@/pages/basicset/appmarket/AppMarket"),
meta: { invisible: true },
meta: { invisible: true, keepAlive: true },
},
{
path: "appdetails",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment