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

pref:修改翻页和应用集市

parent aa232724
...@@ -30,7 +30,12 @@ ...@@ -30,7 +30,12 @@
</a-layout-sider> </a-layout-sider>
<a-layout class="main" style="padding: 0 24px 24px"> <a-layout class="main" style="padding: 0 24px 24px">
<a-layout-content> <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-content>
</a-layout> </a-layout>
</a-layout> </a-layout>
......
...@@ -20,6 +20,18 @@ export default { ...@@ -20,6 +20,18 @@ export default {
TerminalApp, TerminalApp,
MoveApp, MoveApp,
}, },
data() {
return {};
},
// 进入路有前
beforeRouteEnter(to, from, text) {
if (from.path === "/appmarket/appdetails") {
to.meta.isBack = true;
} else {
to.meta.isBack = false;
}
text();
},
}; };
</script> </script>
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: current, current: current,
total: total, total: total,
pageSize: size,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
size: 'small', size: 'small',
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: current, current: current,
total: total, total: total,
pageSize: size,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
pageSizeOptions: pageSizeOptions, pageSizeOptions: pageSizeOptions,
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: current, current: current,
total: total, total: total,
defaultPageSize: 1000,
onChange: handleChange, onChange: handleChange,
onShowSizeChange: showSizeChange, onShowSizeChange: showSizeChange,
}" }"
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: current, current: current,
total: total, total: total,
pageSize: size,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
pageSizeOptions: pageSizeOptions, pageSizeOptions: pageSizeOptions,
...@@ -56,6 +57,10 @@ ...@@ -56,6 +57,10 @@
<template slot="summary" slot-scope="text"> <template slot="summary" slot-scope="text">
{{ text.summary ? text.summary : "--" }} {{ text.summary ? text.summary : "--" }}
</template> </template>
<!-- 简介 -->
<template slot="version" slot-scope="text">
{{ text.version ? "v" + text.version : "--" }}
</template>
<!-- 类型 --> <!-- 类型 -->
<template slot="appType" slot-scope="text"> <template slot="appType" slot-scope="text">
{{ text.appType === 1 ? "应用程序" : "URL" }} {{ text.appType === 1 ? "应用程序" : "URL" }}
...@@ -107,6 +112,54 @@ import AddApp from "../modal/AddApp.vue"; ...@@ -107,6 +112,54 @@ import AddApp from "../modal/AddApp.vue";
import CheckSite from "../modal/CheckSite.vue"; import CheckSite from "../modal/CheckSite.vue";
import { getAppList, deleteApp, saveApp } from "@/services/market"; import { getAppList, deleteApp, saveApp } from "@/services/market";
import local from "@/utils/local"; import local from "@/utils/local";
const columns = [
{
title: "序号",
dataIndex: "num",
width: "65px",
scopedSlots: {
customRender: "num",
},
},
{
title: "应用名称",
dataIndex: "appName",
},
{
title: "应用图标",
scopedSlots: { customRender: "appIconPath" },
},
{
title: "当前版本",
scopedSlots: { customRender: "version" },
},
{
title: "应用主题",
dataIndex: "appThemeName",
},
{
title: "应用简介",
width: "20%",
scopedSlots: { customRender: "summary" },
},
{
title: "应用类型",
scopedSlots: { customRender: "appType" },
},
{
title: "下发设备",
dataIndex: "downDevCount",
},
{
title: "上架/下架",
scopedSlots: { customRender: "shelves" },
},
{
title: "操作",
width: "10%",
scopedSlots: { customRender: "action" },
},
];
export default { export default {
components: { components: {
YSwitch, YSwitch,
...@@ -114,56 +167,6 @@ export default { ...@@ -114,56 +167,6 @@ export default {
CheckSite, CheckSite,
}, },
data() { data() {
const columns = [
{
title: "序号",
dataIndex: "num",
width: "65px",
scopedSlots: {
customRender: "num",
},
},
{
title: "应用名称",
dataIndex: "appName",
},
{
title: "应用图标",
scopedSlots: { customRender: "appIconPath" },
},
{
title: "当前版本",
customRender: (text) => {
return <span>{"v" + text.version}</span>;
},
},
{
title: "应用主题",
dataIndex: "appThemeName",
},
{
title: "应用简介",
width: "20%",
scopedSlots: { customRender: "summary" },
},
{
title: "应用类型",
scopedSlots: { customRender: "appType" },
},
{
title: "下发设备",
dataIndex: "downDevCount",
},
{
title: "上架/下架",
scopedSlots: { customRender: "shelves" },
},
{
title: "操作",
width: "10%",
scopedSlots: { customRender: "action" },
},
];
return { return {
api: process.env.VUE_APP_API_BASE_URL.includes("base") api: process.env.VUE_APP_API_BASE_URL.includes("base")
? process.env.VUE_APP_API_BASE_URL.replace("base", "") ? process.env.VUE_APP_API_BASE_URL.replace("base", "")
...@@ -183,9 +186,16 @@ export default { ...@@ -183,9 +186,16 @@ export default {
siteVisible: false, siteVisible: false,
}; };
}, },
created() { // 详情页返回不刷新数据
this.getAppList(); activated() {
if (!this.$route.meta.isBack) {
Object.assign(this.$data, this.$options.data());
this.getAppList();
} else {
this.$route.meta.isBack = false;
}
}, },
created() {},
methods: { methods: {
// 获取应用列表 // 获取应用列表
async getAppList() { async getAppList() {
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: leftCurrent, current: leftCurrent,
total: leftTotal, total: leftTotal,
pageSize: leftSize,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
pageSizeOptions: pageSizeOptions, pageSizeOptions: pageSizeOptions,
...@@ -97,6 +98,7 @@ ...@@ -97,6 +98,7 @@
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: rightCurrent, current: rightCurrent,
total: rightTotal, total: rightTotal,
pageSize: rightSize,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
pageSizeOptions: pageSizeOptions, pageSizeOptions: pageSizeOptions,
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: leftCurrent, current: leftCurrent,
total: leftTotal, total: leftTotal,
pageSize: leftSize,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
defaultPageSize: leftSize, defaultPageSize: leftSize,
...@@ -117,6 +118,7 @@ ...@@ -117,6 +118,7 @@
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: rightCurrent, current: rightCurrent,
total: rightTotal, total: rightTotal,
pageSize: rightSize,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
pageSizeOptions: pageSizeOptions, pageSizeOptions: pageSizeOptions,
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: leftCurrent, current: leftCurrent,
total: leftTotal, total: leftTotal,
pageSize: leftSize,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
pageSizeOptions: pageSizeOptions, pageSizeOptions: pageSizeOptions,
...@@ -85,6 +86,7 @@ ...@@ -85,6 +86,7 @@
:pagination="{ :pagination="{
current: rightCurrent, current: rightCurrent,
total: rightTotal, total: rightTotal,
pageSize: rightSize,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
pageSizeOptions: pageSizeOptions, pageSizeOptions: pageSizeOptions,
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: current, current: current,
total: total, total: total,
pageSize: size,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
pageSizeOptions: pageSizeOptions, pageSizeOptions: pageSizeOptions,
......
<template> <template>
<div class="index"> <div class="index">
<keep-alive> <router-view> </router-view>
<!-- 需要缓存的视图组件 -->
<router-view v-if="$route.meta.keepAlive"> </router-view>
</keep-alive>
<!-- 不需要缓存的视图组件 -->
<router-view v-if="!$route.meta.keepAlive"> </router-view>
</div> </div>
</template> </template>
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: Current, current: Current,
total: total, total: total,
pageSize: size,
size: 'middle', size: 'middle',
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
......
...@@ -21,49 +21,51 @@ ...@@ -21,49 +21,51 @@
</div> </div>
<!-- 部门管理 --> <!-- 部门管理 -->
<div class="department-list"> <div class="department-list">
<div v-if="department.length"> <a-spin :spinning="deptLoading">
<div <div v-if="department.length">
:class="{ department_off: true, active: active === i }" <div
v-for="(v, i) in department" :class="{ department_off: true, active: active === i }"
:key="v.id" v-for="(v, i) in department"
@click="changeDept(v.id, i)" :key="v.id"
> @click="changeDept(v.id, i)"
<div class="department-title"> >
<div class="department_a"> <div class="department-title">
<a-tooltip> <div class="department_a">
<template slot="title"> {{ v.name }} </template> <a-tooltip>
{{ v.name }} <template slot="title"> {{ v.name }} </template>
</a-tooltip> {{ v.name }}
</div> </a-tooltip>
<div class="department_icon_edit"> </div>
<a-tooltip> <div class="department_icon_edit">
<template slot="title"> 查看编辑 </template> <a-tooltip>
<a-icon <template slot="title"> 查看编辑 </template>
type="edit" <a-icon
class="department_edit" type="edit"
title="编辑" class="department_edit"
@click="showModal(v)" title="编辑"
/> @click="showModal(v)"
</a-tooltip> />
<a-tooltip> </a-tooltip>
<template slot="title"> 删除 </template> <a-tooltip>
<template slot="title"> 删除 </template>
<a-icon <a-icon
type="delete" type="delete"
@click="delDepartment(v.id)" @click="delDepartment(v.id)"
class="delete" class="delete"
department_del department_del
/> />
</a-tooltip> </a-tooltip>
</div>
</div>
<div>
<div class="department_span">简称:{{ v.deptAbb }}</div>
<div>联系电话:{{ v.deptTelphone }}</div>
</div> </div>
</div>
<div>
<div class="department_span">简称:{{ v.deptAbb }}</div>
<div>联系电话:{{ v.deptTelphone }}</div>
</div> </div>
</div> </div>
</div> <a-empty style="margin-top: 20px" :image="simpleImage" v-else />
<a-empty style="margin-top: 20px" :image="simpleImage" v-else /> </a-spin>
</div> </div>
</div> </div>
...@@ -97,6 +99,7 @@ ...@@ -97,6 +99,7 @@
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: page, current: page,
total: total, total: total,
pageSize: size,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
pageSizeOptions: pageSizeOptions, pageSizeOptions: pageSizeOptions,
...@@ -309,6 +312,7 @@ export default { ...@@ -309,6 +312,7 @@ export default {
data() { data() {
return { return {
loading: false, loading: false,
deptLoading: false,
simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
title: "新增部门", title: "新增部门",
WindowTitle: "新增窗口", WindowTitle: "新增窗口",
...@@ -377,6 +381,7 @@ export default { ...@@ -377,6 +381,7 @@ export default {
// 新增事项页面返回不刷新页面 // 新增事项页面返回不刷新页面
activated() { activated() {
if (!this.$route.meta.isBack) { if (!this.$route.meta.isBack) {
Object.assign(this.$data, this.$options.data());
this.getDeptListData(); this.getDeptListData();
this.getBusinessData(); this.getBusinessData();
this.getWindowListData(); this.getWindowListData();
...@@ -399,12 +404,14 @@ export default { ...@@ -399,12 +404,14 @@ export default {
}, },
// 获取部门列表 // 获取部门列表
async getDeptListData(obj = {}) { async getDeptListData(obj = {}) {
this.deptLoading = true;
let res = await getDeptList({ let res = await getDeptList({
siteId: this.siteId, siteId: this.siteId,
page: 1, page: 1,
size: -1, size: -1,
...obj, ...obj,
}); });
this.deptLoading = false;
let { code, data } = res.data; let { code, data } = res.data;
if (code === 1) { if (code === 1) {
this.department = data.data; this.department = data.data;
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: page, current: page,
total: total, total: total,
pageSize: size,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
pageSizeOptions: pageSizeOptions, pageSizeOptions: pageSizeOptions,
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: leftCurrent, current: leftCurrent,
total: leftTotal, total: leftTotal,
pageSize: leftSize,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
pageSizeOptions: pageSizeOptions, pageSizeOptions: pageSizeOptions,
...@@ -133,6 +134,7 @@ ...@@ -133,6 +134,7 @@
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: rightCurrent, current: rightCurrent,
total: rightTotal, total: rightTotal,
pageSize: rightSize,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
pageSizeOptions: pageSizeOptions, pageSizeOptions: pageSizeOptions,
......
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: page, current: page,
total: total, total: total,
pageSize: size,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
pageSizeOptions: pageSizeOptions, pageSizeOptions: pageSizeOptions,
......
...@@ -144,7 +144,7 @@ const options = { ...@@ -144,7 +144,7 @@ const options = {
path: "", path: "",
name: "应用集市", name: "应用集市",
component: () => import("@/pages/basicset/appmarket/AppMarket"), component: () => import("@/pages/basicset/appmarket/AppMarket"),
meta: { invisible: true }, meta: { invisible: true, keepAlive: true },
}, },
{ {
path: "appdetails", 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