From 365f077da447999e22ed0c7ad08c89b13d6e0eb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AE=8F=E6=9D=B0?= <1943105267@qq.com> Date: Tue, 21 Nov 2023 15:49:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90=E5=9F=BA=E6=9C=AC=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/netEwm/net.js | 44 + src/api/netEwm/netHistory.js | 44 + src/api/netEwm/poster.js | 44 + src/api/netEwm/posterHistory.js | 44 + src/api/netEwm/shanghu.js | 44 + src/assets/styles/general.scss | 6 +- src/router/index.js | 177 ++-- src/store/modules/permission.js | 139 +-- src/store/modules/tagsView.js | 238 ++--- src/views/index.vue | 1030 +--------------------- src/views/netEwm/net/index.vue | 299 +++++++ src/views/netEwm/netHistory/index.vue | 305 +++++++ src/views/netEwm/poster/index.vue | 368 ++++++++ src/views/netEwm/posterHistory/index.vue | 323 +++++++ src/views/netEwm/shanghu/index.vue | 355 ++++++++ 15 files changed, 2161 insertions(+), 1299 deletions(-) create mode 100644 src/api/netEwm/net.js create mode 100644 src/api/netEwm/netHistory.js create mode 100644 src/api/netEwm/poster.js create mode 100644 src/api/netEwm/posterHistory.js create mode 100644 src/api/netEwm/shanghu.js create mode 100644 src/views/netEwm/net/index.vue create mode 100644 src/views/netEwm/netHistory/index.vue create mode 100644 src/views/netEwm/poster/index.vue create mode 100644 src/views/netEwm/posterHistory/index.vue create mode 100644 src/views/netEwm/shanghu/index.vue diff --git a/src/api/netEwm/net.js b/src/api/netEwm/net.js new file mode 100644 index 0000000..3f0a92d --- /dev/null +++ b/src/api/netEwm/net.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询网络列表 +export function listNet(query) { + return request({ + url: '/netEwm/net/list', + method: 'get', + params: query + }) +} + +// 查询网络详细 +export function getNet(id) { + return request({ + url: '/netEwm/net/' + id, + method: 'get' + }) +} + +// 新增网络 +export function addNet(data) { + return request({ + url: '/netEwm/net', + method: 'post', + data: data + }) +} + +// 修改网络 +export function updateNet(data) { + return request({ + url: '/netEwm/net', + method: 'put', + data: data + }) +} + +// 删除网络 +export function delNet(id) { + return request({ + url: '/netEwm/net/' + id, + method: 'delete' + }) +} diff --git a/src/api/netEwm/netHistory.js b/src/api/netEwm/netHistory.js new file mode 100644 index 0000000..d2c980d --- /dev/null +++ b/src/api/netEwm/netHistory.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询连网历史列表 +export function listNetHistory(query) { + return request({ + url: '/netEwm/netHistory/list', + method: 'get', + params: query + }) +} + +// 查询连网历史详细 +export function getNetHistory(id) { + return request({ + url: '/netEwm/netHistory/' + id, + method: 'get' + }) +} + +// 新增连网历史 +export function addNetHistory(data) { + return request({ + url: '/netEwm/netHistory', + method: 'post', + data: data + }) +} + +// 修改连网历史 +export function updateNetHistory(data) { + return request({ + url: '/netEwm/netHistory', + method: 'put', + data: data + }) +} + +// 删除连网历史 +export function delNetHistory(id) { + return request({ + url: '/netEwm/netHistory/' + id, + method: 'delete' + }) +} diff --git a/src/api/netEwm/poster.js b/src/api/netEwm/poster.js new file mode 100644 index 0000000..9f3a3b9 --- /dev/null +++ b/src/api/netEwm/poster.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询广告列表 +export function listPoster(query) { + return request({ + url: '/netEwm/poster/list', + method: 'get', + params: query + }) +} + +// 查询广告详细 +export function getPoster(id) { + return request({ + url: '/netEwm/poster/' + id, + method: 'get' + }) +} + +// 新增广告 +export function addPoster(data) { + return request({ + url: '/netEwm/poster', + method: 'post', + data: data + }) +} + +// 修改广告 +export function updatePoster(data) { + return request({ + url: '/netEwm/poster', + method: 'put', + data: data + }) +} + +// 删除广告 +export function delPoster(id) { + return request({ + url: '/netEwm/poster/' + id, + method: 'delete' + }) +} diff --git a/src/api/netEwm/posterHistory.js b/src/api/netEwm/posterHistory.js new file mode 100644 index 0000000..e34ccbc --- /dev/null +++ b/src/api/netEwm/posterHistory.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询广告历史列表 +export function listPosterHistory(query) { + return request({ + url: '/netEwm/posterHistory/list', + method: 'get', + params: query + }) +} + +// 查询广告历史详细 +export function getPosterHistory(id) { + return request({ + url: '/netEwm/posterHistory/' + id, + method: 'get' + }) +} + +// 新增广告历史 +export function addPosterHistory(data) { + return request({ + url: '/netEwm/posterHistory', + method: 'post', + data: data + }) +} + +// 修改广告历史 +export function updatePosterHistory(data) { + return request({ + url: '/netEwm/posterHistory', + method: 'put', + data: data + }) +} + +// 删除广告历史 +export function delPosterHistory(id) { + return request({ + url: '/netEwm/posterHistory/' + id, + method: 'delete' + }) +} diff --git a/src/api/netEwm/shanghu.js b/src/api/netEwm/shanghu.js new file mode 100644 index 0000000..d375b17 --- /dev/null +++ b/src/api/netEwm/shanghu.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询商户列表 +export function listShanghu(query) { + return request({ + url: '/netEwm/shanghu/list', + method: 'get', + params: query + }) +} + +// 查询商户详细 +export function getShanghu(id) { + return request({ + url: '/netEwm/shanghu/' + id, + method: 'get' + }) +} + +// 新增商户 +export function addShanghu(data) { + return request({ + url: '/netEwm/shanghu', + method: 'post', + data: data + }) +} + +// 修改商户 +export function updateShanghu(data) { + return request({ + url: '/netEwm/shanghu', + method: 'put', + data: data + }) +} + +// 删除商户 +export function delShanghu(id) { + return request({ + url: '/netEwm/shanghu/' + id, + method: 'delete' + }) +} diff --git a/src/assets/styles/general.scss b/src/assets/styles/general.scss index 33de0f8..a83477c 100644 --- a/src/assets/styles/general.scss +++ b/src/assets/styles/general.scss @@ -1,6 +1,10 @@ .fixed-header { padding-right: 0 !important; } -.el-button { +.el-button, +.el-input__inner, +.el-textarea__inner, +.el-message-box, +.el-dialog { border-radius: 0 !important; } diff --git a/src/router/index.js b/src/router/index.js index 71907b6..ad44f15 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,10 +1,10 @@ -import Vue from 'vue' -import Router from 'vue-router' +import Vue from "vue"; +import Router from "vue-router"; -Vue.use(Router) +Vue.use(Router); /* Layout */ -import Layout from '@/layout' +import Layout from "@/layout"; /** * Note: 路由配置项 @@ -31,153 +31,154 @@ import Layout from '@/layout' // 公共路由 export const constantRoutes = [ { - path: '/redirect', + path: "/redirect", component: Layout, hidden: true, children: [ { - path: '/redirect/:path(.*)', - component: () => import('@/views/redirect') - } - ] + path: "/redirect/:path(.*)", + component: () => import("@/views/redirect"), + }, + ], }, { - path: '/login', - component: () => import('@/views/login'), - hidden: true + path: "/login", + component: () => import("@/views/login"), + hidden: true, }, { - path: '/register', - component: () => import('@/views/register'), - hidden: true + path: "/register", + component: () => import("@/views/register"), + hidden: true, }, { - path: '/404', - component: () => import('@/views/error/404'), - hidden: true + path: "/404", + component: () => import("@/views/error/404"), + hidden: true, }, { - path: '/401', - component: () => import('@/views/error/401'), - hidden: true + path: "/401", + component: () => import("@/views/error/401"), + hidden: true, }, { - path: '', + path: "", component: Layout, - redirect: 'index', + redirect: "index", children: [ { - path: 'index', - component: () => import('@/views/index'), - name: 'Index', - meta: { title: '首页', icon: 'dashboard', affix: true } - } - ] + path: "index", + component: () => import("@/views/index"), + name: "Index", + // meta: { title: "首页", icon: "dashboard", affix: true }, + hidden: true, + }, + ], }, { - path: '/user', + path: "/user", component: Layout, hidden: true, - redirect: 'noredirect', + redirect: "noredirect", children: [ { - path: 'profile', - component: () => import('@/views/system/user/profile/index'), - name: 'Profile', - meta: { title: '个人中心', icon: 'user' } - } - ] - } -] + path: "profile", + component: () => import("@/views/system/user/profile/index"), + name: "Profile", + meta: { title: "个人中心", icon: "user" }, + }, + ], + }, +]; // 动态路由,基于用户权限动态去加载 export const dynamicRoutes = [ { - path: '/system/user-auth', + path: "/system/user-auth", component: Layout, hidden: true, - permissions: ['system:user:edit'], + permissions: ["system:user:edit"], children: [ { - path: 'role/:userId(\\d+)', - component: () => import('@/views/system/user/authRole'), - name: 'AuthRole', - meta: { title: '分配角色', activeMenu: '/system/user' } - } - ] + path: "role/:userId(\\d+)", + component: () => import("@/views/system/user/authRole"), + name: "AuthRole", + meta: { title: "分配角色", activeMenu: "/system/user" }, + }, + ], }, { - path: '/system/role-auth', + path: "/system/role-auth", component: Layout, hidden: true, - permissions: ['system:role:edit'], + permissions: ["system:role:edit"], children: [ { - path: 'user/:roleId(\\d+)', - component: () => import('@/views/system/role/authUser'), - name: 'AuthUser', - meta: { title: '分配用户', activeMenu: '/system/role' } - } - ] + path: "user/:roleId(\\d+)", + component: () => import("@/views/system/role/authUser"), + name: "AuthUser", + meta: { title: "分配用户", activeMenu: "/system/role" }, + }, + ], }, { - path: '/system/dict-data', + path: "/system/dict-data", component: Layout, hidden: true, - permissions: ['system:dict:list'], + permissions: ["system:dict:list"], children: [ { - path: 'index/:dictId(\\d+)', - component: () => import('@/views/system/dict/data'), - name: 'Data', - meta: { title: '字典数据', activeMenu: '/system/dict' } - } - ] + path: "index/:dictId(\\d+)", + component: () => import("@/views/system/dict/data"), + name: "Data", + meta: { title: "字典数据", activeMenu: "/system/dict" }, + }, + ], }, { - path: '/monitor/job-log', + path: "/monitor/job-log", component: Layout, hidden: true, - permissions: ['monitor:job:list'], + permissions: ["monitor:job:list"], children: [ { - path: 'index/:jobId(\\d+)', - component: () => import('@/views/monitor/job/log'), - name: 'JobLog', - meta: { title: '调度日志', activeMenu: '/monitor/job' } - } - ] + path: "index/:jobId(\\d+)", + component: () => import("@/views/monitor/job/log"), + name: "JobLog", + meta: { title: "调度日志", activeMenu: "/monitor/job" }, + }, + ], }, { - path: '/tool/gen-edit', + path: "/tool/gen-edit", component: Layout, hidden: true, - permissions: ['tool:gen:edit'], + permissions: ["tool:gen:edit"], children: [ { - path: 'index/:tableId(\\d+)', - component: () => import('@/views/tool/gen/editTable'), - name: 'GenEdit', - meta: { title: '修改生成配置', activeMenu: '/tool/gen' } - } - ] - } -] + path: "index/:tableId(\\d+)", + component: () => import("@/views/tool/gen/editTable"), + name: "GenEdit", + meta: { title: "修改生成配置", activeMenu: "/tool/gen" }, + }, + ], + }, +]; // 防止连续点击多次路由报错 let routerPush = Router.prototype.push; let routerReplace = Router.prototype.replace; // push Router.prototype.push = function push(location) { - return routerPush.call(this, location).catch(err => err) -} + return routerPush.call(this, location).catch((err) => err); +}; // replace Router.prototype.replace = function push(location) { - return routerReplace.call(this, location).catch(err => err) -} + return routerReplace.call(this, location).catch((err) => err); +}; export default new Router({ - mode: 'history', // 去掉url中的# + mode: "history", // 去掉url中的# scrollBehavior: () => ({ y: 0 }), - routes: constantRoutes -}) + routes: constantRoutes, +}); diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index b3c216a..a3cb558 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -1,9 +1,9 @@ -import auth from '@/plugins/auth' -import router, { constantRoutes, dynamicRoutes } from '@/router' -import { getRouters } from '@/api/menu' -import Layout from '@/layout/index' -import ParentView from '@/components/ParentView' -import InnerLink from '@/layout/components/InnerLink' +import auth from "@/plugins/auth"; +import router, { constantRoutes, dynamicRoutes } from "@/router"; +import { getRouters } from "@/api/menu"; +import Layout from "@/layout/index"; +import ParentView from "@/components/ParentView"; +import InnerLink from "@/layout/components/InnerLink"; const permission = { state: { @@ -11,127 +11,128 @@ const permission = { addRoutes: [], defaultRoutes: [], topbarRouters: [], - sidebarRouters: [] + sidebarRouters: [], }, mutations: { SET_ROUTES: (state, routes) => { - state.addRoutes = routes - state.routes = constantRoutes.concat(routes) + state.addRoutes = routes; + state.routes = constantRoutes.concat(routes); }, SET_DEFAULT_ROUTES: (state, routes) => { - state.defaultRoutes = constantRoutes.concat(routes) + state.defaultRoutes = constantRoutes.concat(routes); }, SET_TOPBAR_ROUTES: (state, routes) => { - state.topbarRouters = routes + state.topbarRouters = routes; }, SET_SIDEBAR_ROUTERS: (state, routes) => { - state.sidebarRouters = routes + state.sidebarRouters = routes; }, }, actions: { // 生成路由 GenerateRoutes({ commit }) { - return new Promise(resolve => { + return new Promise((resolve) => { // 向后端请求路由数据 - getRouters().then(res => { - const sdata = JSON.parse(JSON.stringify(res.data)) - const rdata = JSON.parse(JSON.stringify(res.data)) - const sidebarRoutes = filterAsyncRouter(sdata) - const rewriteRoutes = filterAsyncRouter(rdata, false, true) + getRouters().then((res) => { + const sdata = JSON.parse(JSON.stringify(res.data)); + const rdata = JSON.parse(JSON.stringify(res.data)); + const sidebarRoutes = filterAsyncRouter(sdata); + const rewriteRoutes = filterAsyncRouter(rdata, false, true); const asyncRoutes = filterDynamicRoutes(dynamicRoutes); - rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true }) + rewriteRoutes.push({ path: "*", redirect: "/404", hidden: true }); router.addRoutes(asyncRoutes); - commit('SET_ROUTES', rewriteRoutes) - commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes)) - commit('SET_DEFAULT_ROUTES', sidebarRoutes) - commit('SET_TOPBAR_ROUTES', sidebarRoutes) - resolve(rewriteRoutes) - }) - }) - } - } -} + commit("SET_ROUTES", rewriteRoutes); + commit("SET_SIDEBAR_ROUTERS", constantRoutes.concat(sidebarRoutes)); + commit("SET_DEFAULT_ROUTES", sidebarRoutes); + commit("SET_TOPBAR_ROUTES", sidebarRoutes); + rewriteRoutes[0].children[0].meta.affix = true; //手动给第一个页面添加affix不允许关闭 + resolve(rewriteRoutes); + }); + }); + }, + }, +}; // 遍历后台传来的路由字符串,转换为组件对象 function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { - return asyncRouterMap.filter(route => { + return asyncRouterMap.filter((route) => { if (type && route.children) { - route.children = filterChildren(route.children) + route.children = filterChildren(route.children); } if (route.component) { // Layout ParentView 组件特殊处理 - if (route.component === 'Layout') { - route.component = Layout - } else if (route.component === 'ParentView') { - route.component = ParentView - } else if (route.component === 'InnerLink') { - route.component = InnerLink + if (route.component === "Layout") { + route.component = Layout; + } else if (route.component === "ParentView") { + route.component = ParentView; + } else if (route.component === "InnerLink") { + route.component = InnerLink; } else { - route.component = loadView(route.component) + route.component = loadView(route.component); } } if (route.children != null && route.children && route.children.length) { - route.children = filterAsyncRouter(route.children, route, type) + route.children = filterAsyncRouter(route.children, route, type); } else { - delete route['children'] - delete route['redirect'] + delete route["children"]; + delete route["redirect"]; } - return true - }) + return true; + }); } function filterChildren(childrenMap, lastRouter = false) { - var children = [] + var children = []; childrenMap.forEach((el, index) => { if (el.children && el.children.length) { - if (el.component === 'ParentView' && !lastRouter) { - el.children.forEach(c => { - c.path = el.path + '/' + c.path + if (el.component === "ParentView" && !lastRouter) { + el.children.forEach((c) => { + c.path = el.path + "/" + c.path; if (c.children && c.children.length) { - children = children.concat(filterChildren(c.children, c)) - return + children = children.concat(filterChildren(c.children, c)); + return; } - children.push(c) - }) - return + children.push(c); + }); + return; } } if (lastRouter) { - el.path = lastRouter.path + '/' + el.path + el.path = lastRouter.path + "/" + el.path; if (el.children && el.children.length) { - children = children.concat(filterChildren(el.children, el)) - return + children = children.concat(filterChildren(el.children, el)); + return; } } - children = children.concat(el) - }) - return children + children = children.concat(el); + }); + return children; } // 动态路由遍历,验证是否具备权限 export function filterDynamicRoutes(routes) { - const res = [] - routes.forEach(route => { + const res = []; + routes.forEach((route) => { if (route.permissions) { if (auth.hasPermiOr(route.permissions)) { - res.push(route) + res.push(route); } } else if (route.roles) { if (auth.hasRoleOr(route.roles)) { - res.push(route) + res.push(route); } } - }) - return res + }); + return res; } export const loadView = (view) => { - if (process.env.NODE_ENV === 'development') { - return (resolve) => require([`@/views/${view}`], resolve) + if (process.env.NODE_ENV === "development") { + return (resolve) => require([`@/views/${view}`], resolve); } else { // 使用 import 实现生产环境的路由懒加载 - return () => import(`@/views/${view}`) + return () => import(`@/views/${view}`); } -} +}; -export default permission +export default permission; diff --git a/src/store/modules/tagsView.js b/src/store/modules/tagsView.js index 5fc011c..b4e4e55 100644 --- a/src/store/modules/tagsView.js +++ b/src/store/modules/tagsView.js @@ -1,228 +1,234 @@ const state = { visitedViews: [], cachedViews: [], - iframeViews: [] -} + iframeViews: [], +}; const mutations = { ADD_IFRAME_VIEW: (state, view) => { - if (state.iframeViews.some(v => v.path === view.path)) return + if (state.iframeViews.some((v) => v.path === view.path)) return; state.iframeViews.push( Object.assign({}, view, { - title: view.meta.title || 'no-name' + title: view.meta.title || "no-name", }) - ) + ); }, ADD_VISITED_VIEW: (state, view) => { - if (state.visitedViews.some(v => v.path === view.path)) return + if (state.visitedViews.some((v) => v.path === view.path)) return; state.visitedViews.push( Object.assign({}, view, { - title: view.meta.title || 'no-name' + title: view.meta.title || "no-name", }) - ) + ); }, ADD_CACHED_VIEW: (state, view) => { - if (state.cachedViews.includes(view.name)) return + if (state.cachedViews.includes(view.name)) return; if (view.meta && !view.meta.noCache) { - state.cachedViews.push(view.name) + state.cachedViews.push(view.name); } }, DEL_VISITED_VIEW: (state, view) => { for (const [i, v] of state.visitedViews.entries()) { if (v.path === view.path) { - state.visitedViews.splice(i, 1) - break + state.visitedViews.splice(i, 1); + break; } } - state.iframeViews = state.iframeViews.filter(item => item.path !== view.path) + state.iframeViews = state.iframeViews.filter( + (item) => item.path !== view.path + ); }, DEL_IFRAME_VIEW: (state, view) => { - state.iframeViews = state.iframeViews.filter(item => item.path !== view.path) + state.iframeViews = state.iframeViews.filter( + (item) => item.path !== view.path + ); }, DEL_CACHED_VIEW: (state, view) => { - const index = state.cachedViews.indexOf(view.name) - index > -1 && state.cachedViews.splice(index, 1) + const index = state.cachedViews.indexOf(view.name); + index > -1 && state.cachedViews.splice(index, 1); }, DEL_OTHERS_VISITED_VIEWS: (state, view) => { - state.visitedViews = state.visitedViews.filter(v => { - return v.meta.affix || v.path === view.path - }) - state.iframeViews = state.iframeViews.filter(item => item.path === view.path) + state.visitedViews = state.visitedViews.filter((v) => { + return v.meta.affix || v.path === view.path; + }); + state.iframeViews = state.iframeViews.filter( + (item) => item.path === view.path + ); }, DEL_OTHERS_CACHED_VIEWS: (state, view) => { - const index = state.cachedViews.indexOf(view.name) + const index = state.cachedViews.indexOf(view.name); if (index > -1) { - state.cachedViews = state.cachedViews.slice(index, index + 1) + state.cachedViews = state.cachedViews.slice(index, index + 1); } else { - state.cachedViews = [] + state.cachedViews = []; } }, - DEL_ALL_VISITED_VIEWS: state => { + DEL_ALL_VISITED_VIEWS: (state) => { // keep affix tags - const affixTags = state.visitedViews.filter(tag => tag.meta.affix) - state.visitedViews = affixTags - state.iframeViews = [] + const affixTags = state.visitedViews.filter((tag) => tag.meta.affix); + state.visitedViews = affixTags; + state.iframeViews = []; }, - DEL_ALL_CACHED_VIEWS: state => { - state.cachedViews = [] + DEL_ALL_CACHED_VIEWS: (state) => { + state.cachedViews = []; }, UPDATE_VISITED_VIEW: (state, view) => { for (let v of state.visitedViews) { if (v.path === view.path) { - v = Object.assign(v, view) - break + v = Object.assign(v, view); + break; } } }, DEL_RIGHT_VIEWS: (state, view) => { - const index = state.visitedViews.findIndex(v => v.path === view.path) + const index = state.visitedViews.findIndex((v) => v.path === view.path); if (index === -1) { - return + return; } state.visitedViews = state.visitedViews.filter((item, idx) => { if (idx <= index || (item.meta && item.meta.affix)) { - return true + return true; } - const i = state.cachedViews.indexOf(item.name) + const i = state.cachedViews.indexOf(item.name); if (i > -1) { - state.cachedViews.splice(i, 1) + state.cachedViews.splice(i, 1); } - if(item.meta.link) { - const fi = state.iframeViews.findIndex(v => v.path === item.path) - state.iframeViews.splice(fi, 1) + if (item.meta.link) { + const fi = state.iframeViews.findIndex((v) => v.path === item.path); + state.iframeViews.splice(fi, 1); } - return false - }) + return false; + }); }, DEL_LEFT_VIEWS: (state, view) => { - const index = state.visitedViews.findIndex(v => v.path === view.path) + const index = state.visitedViews.findIndex((v) => v.path === view.path); if (index === -1) { - return + return; } state.visitedViews = state.visitedViews.filter((item, idx) => { if (idx >= index || (item.meta && item.meta.affix)) { - return true + return true; } - const i = state.cachedViews.indexOf(item.name) + const i = state.cachedViews.indexOf(item.name); if (i > -1) { - state.cachedViews.splice(i, 1) + state.cachedViews.splice(i, 1); } - if(item.meta.link) { - const fi = state.iframeViews.findIndex(v => v.path === item.path) - state.iframeViews.splice(fi, 1) + if (item.meta.link) { + const fi = state.iframeViews.findIndex((v) => v.path === item.path); + state.iframeViews.splice(fi, 1); } - return false - }) - } -} + return false; + }); + }, +}; const actions = { addView({ dispatch }, view) { - dispatch('addVisitedView', view) - dispatch('addCachedView', view) + dispatch("addVisitedView", view); + dispatch("addCachedView", view); }, addIframeView({ commit }, view) { - commit('ADD_IFRAME_VIEW', view) + commit("ADD_IFRAME_VIEW", view); }, addVisitedView({ commit }, view) { - commit('ADD_VISITED_VIEW', view) + commit("ADD_VISITED_VIEW", view); }, addCachedView({ commit }, view) { - commit('ADD_CACHED_VIEW', view) + commit("ADD_CACHED_VIEW", view); }, delView({ dispatch, state }, view) { - return new Promise(resolve => { - dispatch('delVisitedView', view) - dispatch('delCachedView', view) + return new Promise((resolve) => { + dispatch("delVisitedView", view); + dispatch("delCachedView", view); resolve({ visitedViews: [...state.visitedViews], - cachedViews: [...state.cachedViews] - }) - }) + cachedViews: [...state.cachedViews], + }); + }); }, delVisitedView({ commit, state }, view) { - return new Promise(resolve => { - commit('DEL_VISITED_VIEW', view) - resolve([...state.visitedViews]) - }) + return new Promise((resolve) => { + commit("DEL_VISITED_VIEW", view); + resolve([...state.visitedViews]); + }); }, delIframeView({ commit, state }, view) { - return new Promise(resolve => { - commit('DEL_IFRAME_VIEW', view) - resolve([...state.iframeViews]) - }) + return new Promise((resolve) => { + commit("DEL_IFRAME_VIEW", view); + resolve([...state.iframeViews]); + }); }, delCachedView({ commit, state }, view) { - return new Promise(resolve => { - commit('DEL_CACHED_VIEW', view) - resolve([...state.cachedViews]) - }) + return new Promise((resolve) => { + commit("DEL_CACHED_VIEW", view); + resolve([...state.cachedViews]); + }); }, delOthersViews({ dispatch, state }, view) { - return new Promise(resolve => { - dispatch('delOthersVisitedViews', view) - dispatch('delOthersCachedViews', view) + return new Promise((resolve) => { + dispatch("delOthersVisitedViews", view); + dispatch("delOthersCachedViews", view); resolve({ visitedViews: [...state.visitedViews], - cachedViews: [...state.cachedViews] - }) - }) + cachedViews: [...state.cachedViews], + }); + }); }, delOthersVisitedViews({ commit, state }, view) { - return new Promise(resolve => { - commit('DEL_OTHERS_VISITED_VIEWS', view) - resolve([...state.visitedViews]) - }) + return new Promise((resolve) => { + commit("DEL_OTHERS_VISITED_VIEWS", view); + resolve([...state.visitedViews]); + }); }, delOthersCachedViews({ commit, state }, view) { - return new Promise(resolve => { - commit('DEL_OTHERS_CACHED_VIEWS', view) - resolve([...state.cachedViews]) - }) + return new Promise((resolve) => { + commit("DEL_OTHERS_CACHED_VIEWS", view); + resolve([...state.cachedViews]); + }); }, delAllViews({ dispatch, state }, view) { - return new Promise(resolve => { - dispatch('delAllVisitedViews', view) - dispatch('delAllCachedViews', view) + return new Promise((resolve) => { + dispatch("delAllVisitedViews", view); + dispatch("delAllCachedViews", view); resolve({ visitedViews: [...state.visitedViews], - cachedViews: [...state.cachedViews] - }) - }) + cachedViews: [...state.cachedViews], + }); + }); }, delAllVisitedViews({ commit, state }) { - return new Promise(resolve => { - commit('DEL_ALL_VISITED_VIEWS') - resolve([...state.visitedViews]) - }) + return new Promise((resolve) => { + commit("DEL_ALL_VISITED_VIEWS"); + resolve([...state.visitedViews]); + }); }, delAllCachedViews({ commit, state }) { - return new Promise(resolve => { - commit('DEL_ALL_CACHED_VIEWS') - resolve([...state.cachedViews]) - }) + return new Promise((resolve) => { + commit("DEL_ALL_CACHED_VIEWS"); + resolve([...state.cachedViews]); + }); }, updateVisitedView({ commit }, view) { - commit('UPDATE_VISITED_VIEW', view) + commit("UPDATE_VISITED_VIEW", view); }, delRightTags({ commit }, view) { - return new Promise(resolve => { - commit('DEL_RIGHT_VIEWS', view) - resolve([...state.visitedViews]) - }) + return new Promise((resolve) => { + commit("DEL_RIGHT_VIEWS", view); + resolve([...state.visitedViews]); + }); }, delLeftTags({ commit }, view) { - return new Promise(resolve => { - commit('DEL_LEFT_VIEWS', view) - resolve([...state.visitedViews]) - }) + return new Promise((resolve) => { + commit("DEL_LEFT_VIEWS", view); + resolve([...state.visitedViews]); + }); }, -} +}; export default { namespaced: true, state, mutations, - actions -} + actions, +}; diff --git a/src/views/index.vue b/src/views/index.vue index 282e7e5..eaf971c 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -1,1037 +1,17 @@ - + diff --git a/src/views/netEwm/net/index.vue b/src/views/netEwm/net/index.vue new file mode 100644 index 0000000..0c4167d --- /dev/null +++ b/src/views/netEwm/net/index.vue @@ -0,0 +1,299 @@ + + + diff --git a/src/views/netEwm/netHistory/index.vue b/src/views/netEwm/netHistory/index.vue new file mode 100644 index 0000000..67fd4f8 --- /dev/null +++ b/src/views/netEwm/netHistory/index.vue @@ -0,0 +1,305 @@ + + + diff --git a/src/views/netEwm/poster/index.vue b/src/views/netEwm/poster/index.vue new file mode 100644 index 0000000..9525071 --- /dev/null +++ b/src/views/netEwm/poster/index.vue @@ -0,0 +1,368 @@ + + + diff --git a/src/views/netEwm/posterHistory/index.vue b/src/views/netEwm/posterHistory/index.vue new file mode 100644 index 0000000..d971c32 --- /dev/null +++ b/src/views/netEwm/posterHistory/index.vue @@ -0,0 +1,323 @@ + + + diff --git a/src/views/netEwm/shanghu/index.vue b/src/views/netEwm/shanghu/index.vue new file mode 100644 index 0000000..1dacc57 --- /dev/null +++ b/src/views/netEwm/shanghu/index.vue @@ -0,0 +1,355 @@ + + +