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,6 +112,54 @@ import AddApp from "../modal/AddApp.vue";
import CheckSite from "../modal/CheckSite.vue";
import { getAppList, deleteApp, saveApp } from "@/services/market";
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 {
components: {
YSwitch,
......@@ -114,56 +167,6 @@ export default {
CheckSite,
},
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 {
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() {
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: {
// 获取应用列表
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,49 +21,51 @@
</div>
<!-- 部门管理 -->
<div class="department-list">
<div v-if="department.length">
<div
:class="{ department_off: true, active: active === i }"
v-for="(v, i) in department"
:key="v.id"
@click="changeDept(v.id, i)"
>
<div class="department-title">
<div class="department_a">
<a-tooltip>
<template slot="title"> {{ v.name }} </template>
{{ v.name }}
</a-tooltip>
</div>
<div class="department_icon_edit">
<a-tooltip>
<template slot="title"> 查看编辑 </template>
<a-icon
type="edit"
class="department_edit"
title="编辑"
@click="showModal(v)"
/>
</a-tooltip>
<a-tooltip>
<template slot="title"> 删除 </template>
<a-spin :spinning="deptLoading">
<div v-if="department.length">
<div
:class="{ department_off: true, active: active === i }"
v-for="(v, i) in department"
:key="v.id"
@click="changeDept(v.id, i)"
>
<div class="department-title">
<div class="department_a">
<a-tooltip>
<template slot="title"> {{ v.name }} </template>
{{ v.name }}
</a-tooltip>
</div>
<div class="department_icon_edit">
<a-tooltip>
<template slot="title"> 查看编辑 </template>
<a-icon
type="edit"
class="department_edit"
title="编辑"
@click="showModal(v)"
/>
</a-tooltip>
<a-tooltip>
<template slot="title"> 删除 </template>
<a-icon
type="delete"
@click="delDepartment(v.id)"
class="delete"
department_del
/>
</a-tooltip>
<a-icon
type="delete"
@click="delDepartment(v.id)"
class="delete"
department_del
/>
</a-tooltip>
</div>
</div>
<div>
<div class="department_span">简称:{{ v.deptAbb }}</div>
<div>联系电话:{{ v.deptTelphone }}</div>
</div>
</div>
<div>
<div class="department_span">简称:{{ v.deptAbb }}</div>
<div>联系电话:{{ v.deptTelphone }}</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>
......@@ -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