生成基本完成

master
许宏杰 2 years ago
parent ab2a3def0f
commit 365f077da4

@ -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'
})
}

@ -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'
})
}

@ -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'
})
}

@ -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'
})
}

@ -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'
})
}

@ -1,6 +1,10 @@
.fixed-header { .fixed-header {
padding-right: 0 !important; padding-right: 0 !important;
} }
.el-button { .el-button,
.el-input__inner,
.el-textarea__inner,
.el-message-box,
.el-dialog {
border-radius: 0 !important; border-radius: 0 !important;
} }

@ -1,10 +1,10 @@
import Vue from 'vue' import Vue from "vue";
import Router from 'vue-router' import Router from "vue-router";
Vue.use(Router) Vue.use(Router);
/* Layout */ /* Layout */
import Layout from '@/layout' import Layout from "@/layout";
/** /**
* Note: 路由配置项 * Note: 路由配置项
@ -31,153 +31,154 @@ import Layout from '@/layout'
// 公共路由 // 公共路由
export const constantRoutes = [ export const constantRoutes = [
{ {
path: '/redirect', path: "/redirect",
component: Layout, component: Layout,
hidden: true, hidden: true,
children: [ children: [
{ {
path: '/redirect/:path(.*)', path: "/redirect/:path(.*)",
component: () => import('@/views/redirect') component: () => import("@/views/redirect"),
} },
] ],
}, },
{ {
path: '/login', path: "/login",
component: () => import('@/views/login'), component: () => import("@/views/login"),
hidden: true hidden: true,
}, },
{ {
path: '/register', path: "/register",
component: () => import('@/views/register'), component: () => import("@/views/register"),
hidden: true hidden: true,
}, },
{ {
path: '/404', path: "/404",
component: () => import('@/views/error/404'), component: () => import("@/views/error/404"),
hidden: true hidden: true,
}, },
{ {
path: '/401', path: "/401",
component: () => import('@/views/error/401'), component: () => import("@/views/error/401"),
hidden: true hidden: true,
}, },
{ {
path: '', path: "",
component: Layout, component: Layout,
redirect: 'index', redirect: "index",
children: [ children: [
{ {
path: 'index', path: "index",
component: () => import('@/views/index'), component: () => import("@/views/index"),
name: 'Index', name: "Index",
meta: { title: '首页', icon: 'dashboard', affix: true } // meta: { title: "首页", icon: "dashboard", affix: true },
} hidden: true,
] },
],
}, },
{ {
path: '/user', path: "/user",
component: Layout, component: Layout,
hidden: true, hidden: true,
redirect: 'noredirect', redirect: "noredirect",
children: [ children: [
{ {
path: 'profile', path: "profile",
component: () => import('@/views/system/user/profile/index'), component: () => import("@/views/system/user/profile/index"),
name: 'Profile', name: "Profile",
meta: { title: '个人中心', icon: 'user' } meta: { title: "个人中心", icon: "user" },
} },
] ],
} },
] ];
// 动态路由,基于用户权限动态去加载 // 动态路由,基于用户权限动态去加载
export const dynamicRoutes = [ export const dynamicRoutes = [
{ {
path: '/system/user-auth', path: "/system/user-auth",
component: Layout, component: Layout,
hidden: true, hidden: true,
permissions: ['system:user:edit'], permissions: ["system:user:edit"],
children: [ children: [
{ {
path: 'role/:userId(\\d+)', path: "role/:userId(\\d+)",
component: () => import('@/views/system/user/authRole'), component: () => import("@/views/system/user/authRole"),
name: 'AuthRole', name: "AuthRole",
meta: { title: '分配角色', activeMenu: '/system/user' } meta: { title: "分配角色", activeMenu: "/system/user" },
} },
] ],
}, },
{ {
path: '/system/role-auth', path: "/system/role-auth",
component: Layout, component: Layout,
hidden: true, hidden: true,
permissions: ['system:role:edit'], permissions: ["system:role:edit"],
children: [ children: [
{ {
path: 'user/:roleId(\\d+)', path: "user/:roleId(\\d+)",
component: () => import('@/views/system/role/authUser'), component: () => import("@/views/system/role/authUser"),
name: 'AuthUser', name: "AuthUser",
meta: { title: '分配用户', activeMenu: '/system/role' } meta: { title: "分配用户", activeMenu: "/system/role" },
} },
] ],
}, },
{ {
path: '/system/dict-data', path: "/system/dict-data",
component: Layout, component: Layout,
hidden: true, hidden: true,
permissions: ['system:dict:list'], permissions: ["system:dict:list"],
children: [ children: [
{ {
path: 'index/:dictId(\\d+)', path: "index/:dictId(\\d+)",
component: () => import('@/views/system/dict/data'), component: () => import("@/views/system/dict/data"),
name: 'Data', name: "Data",
meta: { title: '字典数据', activeMenu: '/system/dict' } meta: { title: "字典数据", activeMenu: "/system/dict" },
} },
] ],
}, },
{ {
path: '/monitor/job-log', path: "/monitor/job-log",
component: Layout, component: Layout,
hidden: true, hidden: true,
permissions: ['monitor:job:list'], permissions: ["monitor:job:list"],
children: [ children: [
{ {
path: 'index/:jobId(\\d+)', path: "index/:jobId(\\d+)",
component: () => import('@/views/monitor/job/log'), component: () => import("@/views/monitor/job/log"),
name: 'JobLog', name: "JobLog",
meta: { title: '调度日志', activeMenu: '/monitor/job' } meta: { title: "调度日志", activeMenu: "/monitor/job" },
} },
] ],
}, },
{ {
path: '/tool/gen-edit', path: "/tool/gen-edit",
component: Layout, component: Layout,
hidden: true, hidden: true,
permissions: ['tool:gen:edit'], permissions: ["tool:gen:edit"],
children: [ children: [
{ {
path: 'index/:tableId(\\d+)', path: "index/:tableId(\\d+)",
component: () => import('@/views/tool/gen/editTable'), component: () => import("@/views/tool/gen/editTable"),
name: 'GenEdit', name: "GenEdit",
meta: { title: '修改生成配置', activeMenu: '/tool/gen' } meta: { title: "修改生成配置", activeMenu: "/tool/gen" },
} },
] ],
} },
] ];
// 防止连续点击多次路由报错 // 防止连续点击多次路由报错
let routerPush = Router.prototype.push; let routerPush = Router.prototype.push;
let routerReplace = Router.prototype.replace; let routerReplace = Router.prototype.replace;
// push // push
Router.prototype.push = function push(location) { Router.prototype.push = function push(location) {
return routerPush.call(this, location).catch(err => err) return routerPush.call(this, location).catch((err) => err);
} };
// replace // replace
Router.prototype.replace = function push(location) { 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({ export default new Router({
mode: 'history', // 去掉url中的# mode: "history", // 去掉url中的#
scrollBehavior: () => ({ y: 0 }), scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes routes: constantRoutes,
}) });

@ -1,9 +1,9 @@
import auth from '@/plugins/auth' import auth from "@/plugins/auth";
import router, { constantRoutes, dynamicRoutes } from '@/router' import router, { constantRoutes, dynamicRoutes } from "@/router";
import { getRouters } from '@/api/menu' import { getRouters } from "@/api/menu";
import Layout from '@/layout/index' import Layout from "@/layout/index";
import ParentView from '@/components/ParentView' import ParentView from "@/components/ParentView";
import InnerLink from '@/layout/components/InnerLink' import InnerLink from "@/layout/components/InnerLink";
const permission = { const permission = {
state: { state: {
@ -11,127 +11,128 @@ const permission = {
addRoutes: [], addRoutes: [],
defaultRoutes: [], defaultRoutes: [],
topbarRouters: [], topbarRouters: [],
sidebarRouters: [] sidebarRouters: [],
}, },
mutations: { mutations: {
SET_ROUTES: (state, routes) => { SET_ROUTES: (state, routes) => {
state.addRoutes = routes state.addRoutes = routes;
state.routes = constantRoutes.concat(routes) state.routes = constantRoutes.concat(routes);
}, },
SET_DEFAULT_ROUTES: (state, routes) => { SET_DEFAULT_ROUTES: (state, routes) => {
state.defaultRoutes = constantRoutes.concat(routes) state.defaultRoutes = constantRoutes.concat(routes);
}, },
SET_TOPBAR_ROUTES: (state, routes) => { SET_TOPBAR_ROUTES: (state, routes) => {
state.topbarRouters = routes state.topbarRouters = routes;
}, },
SET_SIDEBAR_ROUTERS: (state, routes) => { SET_SIDEBAR_ROUTERS: (state, routes) => {
state.sidebarRouters = routes state.sidebarRouters = routes;
}, },
}, },
actions: { actions: {
// 生成路由 // 生成路由
GenerateRoutes({ commit }) { GenerateRoutes({ commit }) {
return new Promise(resolve => { return new Promise((resolve) => {
// 向后端请求路由数据 // 向后端请求路由数据
getRouters().then(res => { getRouters().then((res) => {
const sdata = JSON.parse(JSON.stringify(res.data)) const sdata = JSON.parse(JSON.stringify(res.data));
const rdata = JSON.parse(JSON.stringify(res.data)) const rdata = JSON.parse(JSON.stringify(res.data));
const sidebarRoutes = filterAsyncRouter(sdata) const sidebarRoutes = filterAsyncRouter(sdata);
const rewriteRoutes = filterAsyncRouter(rdata, false, true) const rewriteRoutes = filterAsyncRouter(rdata, false, true);
const asyncRoutes = filterDynamicRoutes(dynamicRoutes); const asyncRoutes = filterDynamicRoutes(dynamicRoutes);
rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true }) rewriteRoutes.push({ path: "*", redirect: "/404", hidden: true });
router.addRoutes(asyncRoutes); router.addRoutes(asyncRoutes);
commit('SET_ROUTES', rewriteRoutes) commit("SET_ROUTES", rewriteRoutes);
commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes)) commit("SET_SIDEBAR_ROUTERS", constantRoutes.concat(sidebarRoutes));
commit('SET_DEFAULT_ROUTES', sidebarRoutes) commit("SET_DEFAULT_ROUTES", sidebarRoutes);
commit('SET_TOPBAR_ROUTES', sidebarRoutes) commit("SET_TOPBAR_ROUTES", sidebarRoutes);
resolve(rewriteRoutes) rewriteRoutes[0].children[0].meta.affix = true; //手动给第一个页面添加affix不允许关闭
}) resolve(rewriteRoutes);
}) });
} });
} },
} },
};
// 遍历后台传来的路由字符串,转换为组件对象 // 遍历后台传来的路由字符串,转换为组件对象
function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
return asyncRouterMap.filter(route => { return asyncRouterMap.filter((route) => {
if (type && route.children) { if (type && route.children) {
route.children = filterChildren(route.children) route.children = filterChildren(route.children);
} }
if (route.component) { if (route.component) {
// Layout ParentView 组件特殊处理 // Layout ParentView 组件特殊处理
if (route.component === 'Layout') { if (route.component === "Layout") {
route.component = Layout route.component = Layout;
} else if (route.component === 'ParentView') { } else if (route.component === "ParentView") {
route.component = ParentView route.component = ParentView;
} else if (route.component === 'InnerLink') { } else if (route.component === "InnerLink") {
route.component = InnerLink route.component = InnerLink;
} else { } else {
route.component = loadView(route.component) route.component = loadView(route.component);
} }
} }
if (route.children != null && route.children && route.children.length) { if (route.children != null && route.children && route.children.length) {
route.children = filterAsyncRouter(route.children, route, type) route.children = filterAsyncRouter(route.children, route, type);
} else { } else {
delete route['children'] delete route["children"];
delete route['redirect'] delete route["redirect"];
} }
return true return true;
}) });
} }
function filterChildren(childrenMap, lastRouter = false) { function filterChildren(childrenMap, lastRouter = false) {
var children = [] var children = [];
childrenMap.forEach((el, index) => { childrenMap.forEach((el, index) => {
if (el.children && el.children.length) { if (el.children && el.children.length) {
if (el.component === 'ParentView' && !lastRouter) { if (el.component === "ParentView" && !lastRouter) {
el.children.forEach(c => { el.children.forEach((c) => {
c.path = el.path + '/' + c.path c.path = el.path + "/" + c.path;
if (c.children && c.children.length) { if (c.children && c.children.length) {
children = children.concat(filterChildren(c.children, c)) children = children.concat(filterChildren(c.children, c));
return return;
} }
children.push(c) children.push(c);
}) });
return return;
} }
} }
if (lastRouter) { if (lastRouter) {
el.path = lastRouter.path + '/' + el.path el.path = lastRouter.path + "/" + el.path;
if (el.children && el.children.length) { if (el.children && el.children.length) {
children = children.concat(filterChildren(el.children, el)) children = children.concat(filterChildren(el.children, el));
return return;
} }
} }
children = children.concat(el) children = children.concat(el);
}) });
return children return children;
} }
// 动态路由遍历,验证是否具备权限 // 动态路由遍历,验证是否具备权限
export function filterDynamicRoutes(routes) { export function filterDynamicRoutes(routes) {
const res = [] const res = [];
routes.forEach(route => { routes.forEach((route) => {
if (route.permissions) { if (route.permissions) {
if (auth.hasPermiOr(route.permissions)) { if (auth.hasPermiOr(route.permissions)) {
res.push(route) res.push(route);
} }
} else if (route.roles) { } else if (route.roles) {
if (auth.hasRoleOr(route.roles)) { if (auth.hasRoleOr(route.roles)) {
res.push(route) res.push(route);
} }
} }
}) });
return res return res;
} }
export const loadView = (view) => { export const loadView = (view) => {
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === "development") {
return (resolve) => require([`@/views/${view}`], resolve) return (resolve) => require([`@/views/${view}`], resolve);
} else { } else {
// 使用 import 实现生产环境的路由懒加载 // 使用 import 实现生产环境的路由懒加载
return () => import(`@/views/${view}`) return () => import(`@/views/${view}`);
}
} }
};
export default permission export default permission;

@ -1,228 +1,234 @@
const state = { const state = {
visitedViews: [], visitedViews: [],
cachedViews: [], cachedViews: [],
iframeViews: [] iframeViews: [],
} };
const mutations = { const mutations = {
ADD_IFRAME_VIEW: (state, view) => { 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( state.iframeViews.push(
Object.assign({}, view, { Object.assign({}, view, {
title: view.meta.title || 'no-name' title: view.meta.title || "no-name",
}) })
) );
}, },
ADD_VISITED_VIEW: (state, view) => { 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( state.visitedViews.push(
Object.assign({}, view, { Object.assign({}, view, {
title: view.meta.title || 'no-name' title: view.meta.title || "no-name",
}) })
) );
}, },
ADD_CACHED_VIEW: (state, view) => { 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) { if (view.meta && !view.meta.noCache) {
state.cachedViews.push(view.name) state.cachedViews.push(view.name);
} }
}, },
DEL_VISITED_VIEW: (state, view) => { DEL_VISITED_VIEW: (state, view) => {
for (const [i, v] of state.visitedViews.entries()) { for (const [i, v] of state.visitedViews.entries()) {
if (v.path === view.path) { if (v.path === view.path) {
state.visitedViews.splice(i, 1) state.visitedViews.splice(i, 1);
break 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) => { 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) => { DEL_CACHED_VIEW: (state, view) => {
const index = state.cachedViews.indexOf(view.name) const index = state.cachedViews.indexOf(view.name);
index > -1 && state.cachedViews.splice(index, 1) index > -1 && state.cachedViews.splice(index, 1);
}, },
DEL_OTHERS_VISITED_VIEWS: (state, view) => { DEL_OTHERS_VISITED_VIEWS: (state, view) => {
state.visitedViews = state.visitedViews.filter(v => { state.visitedViews = state.visitedViews.filter((v) => {
return v.meta.affix || v.path === view.path return v.meta.affix || v.path === view.path;
}) });
state.iframeViews = state.iframeViews.filter(item => item.path === view.path) state.iframeViews = state.iframeViews.filter(
(item) => item.path === view.path
);
}, },
DEL_OTHERS_CACHED_VIEWS: (state, view) => { DEL_OTHERS_CACHED_VIEWS: (state, view) => {
const index = state.cachedViews.indexOf(view.name) const index = state.cachedViews.indexOf(view.name);
if (index > -1) { if (index > -1) {
state.cachedViews = state.cachedViews.slice(index, index + 1) state.cachedViews = state.cachedViews.slice(index, index + 1);
} else { } else {
state.cachedViews = [] state.cachedViews = [];
} }
}, },
DEL_ALL_VISITED_VIEWS: state => { DEL_ALL_VISITED_VIEWS: (state) => {
// keep affix tags // keep affix tags
const affixTags = state.visitedViews.filter(tag => tag.meta.affix) const affixTags = state.visitedViews.filter((tag) => tag.meta.affix);
state.visitedViews = affixTags state.visitedViews = affixTags;
state.iframeViews = [] state.iframeViews = [];
}, },
DEL_ALL_CACHED_VIEWS: state => { DEL_ALL_CACHED_VIEWS: (state) => {
state.cachedViews = [] state.cachedViews = [];
}, },
UPDATE_VISITED_VIEW: (state, view) => { UPDATE_VISITED_VIEW: (state, view) => {
for (let v of state.visitedViews) { for (let v of state.visitedViews) {
if (v.path === view.path) { if (v.path === view.path) {
v = Object.assign(v, view) v = Object.assign(v, view);
break break;
} }
} }
}, },
DEL_RIGHT_VIEWS: (state, view) => { 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) { if (index === -1) {
return return;
} }
state.visitedViews = state.visitedViews.filter((item, idx) => { state.visitedViews = state.visitedViews.filter((item, idx) => {
if (idx <= index || (item.meta && item.meta.affix)) { 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) { if (i > -1) {
state.cachedViews.splice(i, 1) state.cachedViews.splice(i, 1);
} }
if (item.meta.link) { if (item.meta.link) {
const fi = state.iframeViews.findIndex(v => v.path === item.path) const fi = state.iframeViews.findIndex((v) => v.path === item.path);
state.iframeViews.splice(fi, 1) state.iframeViews.splice(fi, 1);
} }
return false return false;
}) });
}, },
DEL_LEFT_VIEWS: (state, view) => { 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) { if (index === -1) {
return return;
} }
state.visitedViews = state.visitedViews.filter((item, idx) => { state.visitedViews = state.visitedViews.filter((item, idx) => {
if (idx >= index || (item.meta && item.meta.affix)) { 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) { if (i > -1) {
state.cachedViews.splice(i, 1) state.cachedViews.splice(i, 1);
} }
if (item.meta.link) { if (item.meta.link) {
const fi = state.iframeViews.findIndex(v => v.path === item.path) const fi = state.iframeViews.findIndex((v) => v.path === item.path);
state.iframeViews.splice(fi, 1) state.iframeViews.splice(fi, 1);
}
return false
})
}
} }
return false;
});
},
};
const actions = { const actions = {
addView({ dispatch }, view) { addView({ dispatch }, view) {
dispatch('addVisitedView', view) dispatch("addVisitedView", view);
dispatch('addCachedView', view) dispatch("addCachedView", view);
}, },
addIframeView({ commit }, view) { addIframeView({ commit }, view) {
commit('ADD_IFRAME_VIEW', view) commit("ADD_IFRAME_VIEW", view);
}, },
addVisitedView({ commit }, view) { addVisitedView({ commit }, view) {
commit('ADD_VISITED_VIEW', view) commit("ADD_VISITED_VIEW", view);
}, },
addCachedView({ commit }, view) { addCachedView({ commit }, view) {
commit('ADD_CACHED_VIEW', view) commit("ADD_CACHED_VIEW", view);
}, },
delView({ dispatch, state }, view) { delView({ dispatch, state }, view) {
return new Promise(resolve => { return new Promise((resolve) => {
dispatch('delVisitedView', view) dispatch("delVisitedView", view);
dispatch('delCachedView', view) dispatch("delCachedView", view);
resolve({ resolve({
visitedViews: [...state.visitedViews], visitedViews: [...state.visitedViews],
cachedViews: [...state.cachedViews] cachedViews: [...state.cachedViews],
}) });
}) });
}, },
delVisitedView({ commit, state }, view) { delVisitedView({ commit, state }, view) {
return new Promise(resolve => { return new Promise((resolve) => {
commit('DEL_VISITED_VIEW', view) commit("DEL_VISITED_VIEW", view);
resolve([...state.visitedViews]) resolve([...state.visitedViews]);
}) });
}, },
delIframeView({ commit, state }, view) { delIframeView({ commit, state }, view) {
return new Promise(resolve => { return new Promise((resolve) => {
commit('DEL_IFRAME_VIEW', view) commit("DEL_IFRAME_VIEW", view);
resolve([...state.iframeViews]) resolve([...state.iframeViews]);
}) });
}, },
delCachedView({ commit, state }, view) { delCachedView({ commit, state }, view) {
return new Promise(resolve => { return new Promise((resolve) => {
commit('DEL_CACHED_VIEW', view) commit("DEL_CACHED_VIEW", view);
resolve([...state.cachedViews]) resolve([...state.cachedViews]);
}) });
}, },
delOthersViews({ dispatch, state }, view) { delOthersViews({ dispatch, state }, view) {
return new Promise(resolve => { return new Promise((resolve) => {
dispatch('delOthersVisitedViews', view) dispatch("delOthersVisitedViews", view);
dispatch('delOthersCachedViews', view) dispatch("delOthersCachedViews", view);
resolve({ resolve({
visitedViews: [...state.visitedViews], visitedViews: [...state.visitedViews],
cachedViews: [...state.cachedViews] cachedViews: [...state.cachedViews],
}) });
}) });
}, },
delOthersVisitedViews({ commit, state }, view) { delOthersVisitedViews({ commit, state }, view) {
return new Promise(resolve => { return new Promise((resolve) => {
commit('DEL_OTHERS_VISITED_VIEWS', view) commit("DEL_OTHERS_VISITED_VIEWS", view);
resolve([...state.visitedViews]) resolve([...state.visitedViews]);
}) });
}, },
delOthersCachedViews({ commit, state }, view) { delOthersCachedViews({ commit, state }, view) {
return new Promise(resolve => { return new Promise((resolve) => {
commit('DEL_OTHERS_CACHED_VIEWS', view) commit("DEL_OTHERS_CACHED_VIEWS", view);
resolve([...state.cachedViews]) resolve([...state.cachedViews]);
}) });
}, },
delAllViews({ dispatch, state }, view) { delAllViews({ dispatch, state }, view) {
return new Promise(resolve => { return new Promise((resolve) => {
dispatch('delAllVisitedViews', view) dispatch("delAllVisitedViews", view);
dispatch('delAllCachedViews', view) dispatch("delAllCachedViews", view);
resolve({ resolve({
visitedViews: [...state.visitedViews], visitedViews: [...state.visitedViews],
cachedViews: [...state.cachedViews] cachedViews: [...state.cachedViews],
}) });
}) });
}, },
delAllVisitedViews({ commit, state }) { delAllVisitedViews({ commit, state }) {
return new Promise(resolve => { return new Promise((resolve) => {
commit('DEL_ALL_VISITED_VIEWS') commit("DEL_ALL_VISITED_VIEWS");
resolve([...state.visitedViews]) resolve([...state.visitedViews]);
}) });
}, },
delAllCachedViews({ commit, state }) { delAllCachedViews({ commit, state }) {
return new Promise(resolve => { return new Promise((resolve) => {
commit('DEL_ALL_CACHED_VIEWS') commit("DEL_ALL_CACHED_VIEWS");
resolve([...state.cachedViews]) resolve([...state.cachedViews]);
}) });
}, },
updateVisitedView({ commit }, view) { updateVisitedView({ commit }, view) {
commit('UPDATE_VISITED_VIEW', view) commit("UPDATE_VISITED_VIEW", view);
}, },
delRightTags({ commit }, view) { delRightTags({ commit }, view) {
return new Promise(resolve => { return new Promise((resolve) => {
commit('DEL_RIGHT_VIEWS', view) commit("DEL_RIGHT_VIEWS", view);
resolve([...state.visitedViews]) resolve([...state.visitedViews]);
}) });
}, },
delLeftTags({ commit }, view) { delLeftTags({ commit }, view) {
return new Promise(resolve => { return new Promise((resolve) => {
commit('DEL_LEFT_VIEWS', view) commit("DEL_LEFT_VIEWS", view);
resolve([...state.visitedViews]) resolve([...state.visitedViews]);
}) });
}, },
} };
export default { export default {
namespaced: true, namespaced: true,
state, state,
mutations, mutations,
actions actions,
} };

File diff suppressed because it is too large Load Diff

@ -0,0 +1,299 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="网络名称" prop="netName">
<el-input
v-model="queryParams.netName"
placeholder="请输入网络名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['netEwm:net:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['netEwm:net:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['netEwm:net:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['netEwm:net:export']"
>导出</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="netList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="网络名称" align="center" prop="netName" />
<el-table-column label="wifi名称" align="center" prop="wifiName" />
<el-table-column label="wifi密码" align="center" prop="wifiPass" />
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['netEwm:net:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['netEwm:net:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改网络对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="网络名称" prop="netName">
<el-input v-model="form.netName" placeholder="请输入网络名称" />
</el-form-item>
<el-form-item label="wifi名称" prop="wifiName">
<el-input v-model="form.wifiName" placeholder="请输入wifi名称" />
</el-form-item>
<el-form-item label="wifi密码" prop="wifiPass">
<el-input v-model="form.wifiPass" placeholder="请输入wifi密码" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listNet, getNet, delNet, addNet, updateNet } from "@/api/netEwm/net";
export default {
name: "Net",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
netList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
netName: null,
},
//
form: {},
//
rules: {},
};
},
created() {
this.getList();
},
methods: {
/** 查询网络列表 */
getList() {
this.loading = true;
listNet(this.queryParams).then((response) => {
this.netList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
netName: null,
wifiName: null,
wifiPass: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加网络";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getNet(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改网络";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateNet(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addNet(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除网络编号为"' + ids + '"的数据项?')
.then(function () {
return delNet(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"netEwm/net/export",
{
...this.queryParams,
},
`net_${new Date().getTime()}.xlsx`
);
},
},
};
</script>

@ -0,0 +1,305 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="是否连接成功" prop="isTrue">
<el-select v-model="queryParams.isTrue" placeholder="请选择是否连接成功" clearable>
<el-option
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="网络名称" prop="netName">
<el-input
v-model="queryParams.netName"
placeholder="请输入网络名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['netEwm:netHistory:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['netEwm:netHistory:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['netEwm:netHistory:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['netEwm:netHistory:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="netHistoryList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="${comment}" align="center" prop="id" />
<el-table-column label="是否连接成功" align="center" prop="isTrue">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isTrue"/>
</template>
</el-table-column>
<el-table-column label="网络id" align="center" prop="netId" />
<el-table-column label="网络名称" align="center" prop="netName" />
<el-table-column label="wifi名称" align="center" prop="wifiName" />
<el-table-column label="wifi密码" align="center" prop="wifiPass" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['netEwm:netHistory:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['netEwm:netHistory:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改连网历史对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="是否连接成功" prop="isTrue">
<el-select v-model="form.isTrue" placeholder="请选择是否连接成功">
<el-option
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="网络id" prop="netId">
<el-input v-model="form.netId" placeholder="请输入网络id" />
</el-form-item>
<el-form-item label="网络名称" prop="netName">
<el-input v-model="form.netName" placeholder="请输入网络名称" />
</el-form-item>
<el-form-item label="wifi名称" prop="wifiName">
<el-input v-model="form.wifiName" placeholder="请输入wifi名称" />
</el-form-item>
<el-form-item label="wifi密码" prop="wifiPass">
<el-input v-model="form.wifiPass" placeholder="请输入wifi密码" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listNetHistory, getNetHistory, delNetHistory, addNetHistory, updateNetHistory } from "@/api/netEwm/netHistory";
export default {
name: "NetHistory",
dicts: ['sys_yes_no'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
netHistoryList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
isTrue: null,
netName: null,
},
//
form: {},
//
rules: {
isTrue: [
{ required: true, message: "是否连接成功不能为空", trigger: "change" }
],
netName: [
{ required: true, message: "网络名称不能为空", trigger: "blur" }
],
wifiName: [
{ required: true, message: "wifi名称不能为空", trigger: "blur" }
],
wifiPass: [
{ required: true, message: "wifi密码不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询连网历史列表 */
getList() {
this.loading = true;
listNetHistory(this.queryParams).then(response => {
this.netHistoryList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
isTrue: null,
netId: null,
netName: null,
wifiName: null,
wifiPass: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加连网历史";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getNetHistory(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改连网历史";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateNetHistory(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addNetHistory(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除连网历史编号为"' + ids + '"的数据项?').then(function() {
return delNetHistory(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('netEwm/netHistory/export', {
...this.queryParams
}, `netHistory_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -0,0 +1,368 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-form-item label="广告名称" prop="posterName">
<el-input
v-model="queryParams.posterName"
placeholder="请输入广告名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="有效起始时间" prop="startTime">
<el-date-picker
clearable
v-model="queryParams.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择有效起始时间"
>
</el-date-picker>
</el-form-item>
<el-form-item label="有效结束时间" prop="endTime">
<el-date-picker
clearable
v-model="queryParams.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择有效结束时间"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['netEwm:poster:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['netEwm:poster:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['netEwm:poster:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['netEwm:poster:export']"
>导出</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="posterList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="广告名称" align="center" prop="posterName" />
<el-table-column
label="有效起始时间"
align="center"
prop="startTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column
label="有效结束时间"
align="center"
prop="endTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column label="视频封面" align="center" prop="videoLogo" />
<el-table-column label="视频路径" align="center" prop="videoPath" />
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['netEwm:poster:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['netEwm:poster:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改广告对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="广告名称" prop="posterName">
<el-input v-model="form.posterName" placeholder="请输入广告名称" />
</el-form-item>
<el-form-item label="有效起始时间" prop="startTime">
<el-date-picker
clearable
v-model="form.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择有效起始时间"
>
</el-date-picker>
</el-form-item>
<el-form-item label="有效结束时间" prop="endTime">
<el-date-picker
clearable
v-model="form.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择有效结束时间"
>
</el-date-picker>
</el-form-item>
<el-form-item label="视频封面" prop="videoLogo">
<el-input v-model="form.videoLogo" placeholder="请输入视频封面" />
</el-form-item>
<el-form-item label="视频路径" prop="videoPath">
<el-input v-model="form.videoPath" placeholder="请输入视频路径" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listPoster,
getPoster,
delPoster,
addPoster,
updatePoster,
} from "@/api/netEwm/poster";
export default {
name: "Poster",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// 广
posterList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
posterName: null,
startTime: null,
endTime: null,
},
//
form: {},
//
rules: {},
};
},
created() {
this.getList();
},
methods: {
/** 查询广告列表 */
getList() {
this.loading = true;
listPoster(this.queryParams).then((response) => {
this.posterList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
posterName: null,
startTime: null,
endTime: null,
videoLogo: null,
videoPath: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加广告";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getPoster(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改广告";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updatePoster(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addPoster(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除广告编号为"' + ids + '"的数据项?')
.then(function () {
return delPoster(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"netEwm/poster/export",
{
...this.queryParams,
},
`poster_${new Date().getTime()}.xlsx`
);
},
},
};
</script>

@ -0,0 +1,323 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="广告名称" prop="posterName">
<el-input
v-model="queryParams.posterName"
placeholder="请输入广告名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="有效起始时间" prop="startTime">
<el-date-picker clearable
v-model="queryParams.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择有效起始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="有效结束时间" prop="endTime">
<el-date-picker clearable
v-model="queryParams.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择有效结束时间">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['netEwm:posterHistory:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['netEwm:posterHistory:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['netEwm:posterHistory:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['netEwm:posterHistory:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="posterHistoryList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="${comment}" align="center" prop="id" />
<el-table-column label="广告id" align="center" prop="posterId" />
<el-table-column label="广告名称" align="center" prop="posterName" />
<el-table-column label="有效起始时间" align="center" prop="startTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="有效结束时间" align="center" prop="endTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="视频路径" align="center" prop="videoPath" />
<el-table-column label="视频封面" align="center" prop="videoLogo" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['netEwm:posterHistory:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['netEwm:posterHistory:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改广告历史对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="广告id" prop="posterId">
<el-input v-model="form.posterId" placeholder="请输入广告id" />
</el-form-item>
<el-form-item label="广告名称" prop="posterName">
<el-input v-model="form.posterName" placeholder="请输入广告名称" />
</el-form-item>
<el-form-item label="有效起始时间" prop="startTime">
<el-date-picker clearable
v-model="form.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择有效起始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="有效结束时间" prop="endTime">
<el-date-picker clearable
v-model="form.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择有效结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="视频路径" prop="videoPath">
<el-input v-model="form.videoPath" placeholder="请输入视频路径" />
</el-form-item>
<el-form-item label="视频封面" prop="videoLogo">
<el-input v-model="form.videoLogo" placeholder="请输入视频封面" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listPosterHistory, getPosterHistory, delPosterHistory, addPosterHistory, updatePosterHistory } from "@/api/netEwm/posterHistory";
export default {
name: "PosterHistory",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// 广
posterHistoryList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
posterName: null,
startTime: null,
endTime: null,
},
//
form: {},
//
rules: {
posterName: [
{ required: true, message: "广告名称不能为空", trigger: "blur" }
],
startTime: [
{ required: true, message: "有效起始时间不能为空", trigger: "blur" }
],
endTime: [
{ required: true, message: "有效结束时间不能为空", trigger: "blur" }
],
videoLogo: [
{ required: true, message: "视频封面不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询广告历史列表 */
getList() {
this.loading = true;
listPosterHistory(this.queryParams).then(response => {
this.posterHistoryList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
posterId: null,
posterName: null,
startTime: null,
endTime: null,
videoPath: null,
videoLogo: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加广告历史";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getPosterHistory(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改广告历史";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updatePosterHistory(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addPosterHistory(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除广告历史编号为"' + ids + '"的数据项?').then(function() {
return delPosterHistory(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('netEwm/posterHistory/export', {
...this.queryParams
}, `posterHistory_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -0,0 +1,355 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="商户名称" prop="posName">
<el-input
v-model="queryParams.posName"
placeholder="请输入商户名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系人" prop="linkMan">
<el-input
v-model="queryParams.linkMan"
placeholder="请输入联系人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="城市" prop="city">
<el-input
v-model="queryParams.city"
placeholder="请输入城市"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['netEwm:shanghu:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['netEwm:shanghu:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['netEwm:shanghu:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['netEwm:shanghu:export']"
>导出</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="shanghuList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="商户名称" align="center" prop="posName" />
<el-table-column label="手机号" align="center" prop="phoneNumber" />
<el-table-column label="联系人" align="center" prop="linkMan" />
<el-table-column label="城市" align="center" prop="city" />
<el-table-column label="地址信息" align="center" prop="address" />
<el-table-column label="广告标识" align="center" prop="posterId" />
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['netEwm:shanghu:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['netEwm:shanghu:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改商户对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="商户名称" prop="posName">
<el-input v-model="form.posName" placeholder="请输入商户名称" />
</el-form-item>
<el-form-item label="手机号" prop="phoneNumber">
<el-input v-model="form.phoneNumber" placeholder="请输入手机号" />
</el-form-item>
<el-form-item label="联系人" prop="linkMan">
<el-input v-model="form.linkMan" placeholder="请输入联系人" />
</el-form-item>
<el-form-item label="城市" prop="city">
<el-input v-model="form.city" placeholder="请输入城市" />
</el-form-item>
<el-form-item label="地址信息" prop="address">
<el-input
type="textarea"
v-model="form.address"
placeholder="请输入地址信息"
/>
</el-form-item>
<el-form-item label="广告标识" prop="posterId">
<el-input v-model="form.posterId" placeholder="请输入广告标识" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listShanghu,
getShanghu,
delShanghu,
addShanghu,
updateShanghu,
} from "@/api/netEwm/shanghu";
export default {
name: "Shanghu",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
shanghuList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
posName: null,
linkMan: null,
city: null,
},
//
form: {},
//
rules: {
posName: [
{ required: true, message: "商户名称不能为空", trigger: "blur" },
],
phoneNumber: [
{ required: true, message: "手机号不能为空", trigger: "blur" },
],
linkMan: [
{ required: true, message: "联系人不能为空", trigger: "blur" },
],
city: [{ required: true, message: "城市不能为空", trigger: "blur" }],
address: [
{ required: true, message: "地址信息不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询商户列表 */
getList() {
this.loading = true;
listShanghu(this.queryParams).then((response) => {
this.shanghuList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
posName: null,
phoneNumber: null,
linkMan: null,
city: null,
address: null,
posterId: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加商户";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getShanghu(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改商户";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateShanghu(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addShanghu(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除商户编号为"' + ids + '"的数据项?')
.then(function () {
return delShanghu(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"netEwm/shanghu/export",
{
...this.queryParams,
},
`shanghu_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
Loading…
Cancel
Save