Commit fd4047d5 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 544e40e7 9ce7f426
......@@ -7,7 +7,7 @@ VUE_APP_BASE_API =/basics_api
# 门户登录地址
VUE_APP_PORTAL_URL = /portal_home
VUE_APP_PORTAL_URL = http://192.168.0.98:11072
VUE_APP_PORTAL_PORT = 21080
......
html {
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
box-sizing: border-box;
}
html * {
outline: 0;
box-sizing: inherit;
-webkit-text-size-adjust: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
html,
body {
height: 100%;
min-height: 100%;
font-family: "Microsoft Yahei", "Helvetica Neue", Helvetica, STHeiTi, Arial, sans-serif;
}
body {
overflow-y: scroll;
}
body,
div,
dl,
dt,
dd,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
code,
form,
fieldset,
legend,
input,
textarea,
p,
blockquote,
th,
td,
hr,
button,
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
margin: 0;
padding: 0;
}
input,
select,
textarea,
button {
font-size: 100%;
-webkit-appearance: none;
border: 0;
outline: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
fieldset,
img {
border: 0;
}
abbr,
acronym {
border: 0;
font-variant: normal;
}
del {
text-decoration: line-through;
}
address,
caption,
cite,
code,
dfn,
em,
th,
var {
font-style: normal;
font-weight: 500;
}
ol,
ul {
list-style: none;
}
caption,
th {
text-align: left;
}
q:before,
q:after {
content: "";
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
ins,
a {
text-decoration: none;
cursor: pointer;
}
/* ============================================================
flex:定义布局为盒模型
flex-v:盒模型垂直布局
flex-1:子元素占据剩余的空间
flex-align-center:子元素垂直居中
flex-pack-center:子元素水平居中
flex-pack-justify:子元素两端对齐
兼容性:ios 4+、android 2.3+、winphone8+
============================================================ */
.flex {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.flex-v {
-webkit-box-orient: vertical;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
.flex-1 {
-webkit-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
}
.flex-align-center {
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
}
.flex-pack-center {
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
}
.flex-pack-justify {
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
-ms-flex-pack: justify;
justify-content: space-between;
}
.clearfix:after {
content: "";
display: table;
clear: both;
font-size: 0;
}
.fl {
float: left;
}
.fr {
float: right;
}
.hide {
display: none;
}
.disabled {
pointer-events: none;
}
#app,
.pages {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
height: 100%;
}
.ellipsis {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
[v-cloak] {
display: none;
}
[disabled] {
pointer-events: none;
}
.el-dialog .el-checkbox-group .el-checkbox {
margin: 5px 0;
width: 33.33%;
}
.el-dialog .el-checkbox-group .pointBox {
width: 50%;
}
.el-table th {
user-select: all;
}
.el-progress-bar {
padding-right: 70px;
margin-right: -70px;
}
#operatorUserCabinCheckBox .el-checkbox {
white-space: normal !important;
width: 100%;
}
#operatorUserCabinCheckBox .el-checkbox__label {
display: inline;
}
.page-statistics .chart {
margin-bottom: 80px;
border: 1px solid #ededed;
height: 400px;
}
.page-statistics .el-table th.color-gray,
.page-statistics .el-table tr.color-gray {
background-color: #f0f9eb;
}
@media screen and (max-width: 800px) {
.page {
margin: 5px 5px;
}
.el-dialog {
width: 98% !important;
}
.el-dialog .el-checkbox-group .el-checkbox {
margin: 5px 0;
width: 50%;
font-size: 12px;
}
.el-dialog .el-checkbox-group .el-checkbox .el-checkbox__label {
font-size: 12px;
}
}
.mobile-table-card {
margin: 10px auto;
padding: 10px;
box-shadow: 0 0 5px #ccc;
}
.mobile-table-card .mobile-table-cell {
padding: 5px 0;
border-bottom: 1px dotted #eee;
}
.mobile-table-card .mobile-table-cell .cell-title {
font-size: 13px;
color: #666;
}
.mobile-table-card .mobile-table-cell .cell-content {
padding-left: 5px;
text-align: right;
word-break: break-word;
}
.layout-menu-wrapper {
height: 64px !important;
line-height: 64px !important;
background: linear-gradient(90deg, #1845c6, #2999ff) !important;
}
.layout-menu-wrapper .layout-logo {
font-size: 20px;
font-weight: bold;
}
.layout-menu-wrapper .menu-list li a {
display: block;
padding: 0 12px;
height: 100%;
font-size: 14px !important;
color: rgba(254, 254, 254, 0.65) !important;
text-align: center !important;
}
.layout-menu-wrapper .menu-list li a i {
font-size: 14px !important;
margin-right: 10px !important;
}
.layout-menu-wrapper .menu-list li a i:first-child {
margin-right: 0px !important;
}
.layout-menu-wrapper .menu-list li a:hover {
color: #fff !important;
}
.layout-menu-wrapper .menu-list li a.router-link-active,
.layout-menu-wrapper .menu-list li a[active] {
color: #fff !important;
list-style-type: none;
border-bottom: none !important;
padding-bottom: 2px;
background-color: #1890ff !important;
}
.layout-header .layout-submenu-wrapper {
width: 95% !important;
margin: 0 auto !important;
margin-top: 20px !important;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
.page.active {
width: 95% !important;
margin: 0 auto !important;
padding: 20px !important;
padding-top: 0 !important;
}
.page {
height: 82% !important;
min-height: 82% !important;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
}
html {
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
box-sizing: border-box;
}
html * {
outline: 0;
outline: 0;
box-sizing: inherit;
-webkit-text-size-adjust: none;
-webkit-tap-highlight-color: rgba(0,0,0,0)
-webkit-text-size-adjust: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
html,body {
height: 100%;
html,
body {
height: 100%;
min-height: 100%;
font-family: "Microsoft Yahei", "Helvetica Neue", Helvetica, STHeiTi, Arial, sans-serif;
font-family: "Microsoft Yahei", "Helvetica Neue", Helvetica, STHeiTi, Arial,
sans-serif;
}
body {
overflow-y: scroll;
overflow-y: scroll;
}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td,hr,button,article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
margin: 0;
padding: 0
body,
div,
dl,
dt,
dd,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
code,
form,
fieldset,
legend,
input,
textarea,
p,
blockquote,
th,
td,
hr,
button,
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
margin: 0;
padding: 0;
}
input,select,textarea,button {
font-size: 100%;
input,
select,
textarea,
button {
font-size: 100%;
-webkit-appearance: none;
border:0;
border: 0;
outline: 0;
}
table {
border-collapse: collapse;
border-spacing: 0
border-collapse: collapse;
border-spacing: 0;
}
fieldset,img {
border: 0
fieldset,
img {
border: 0;
}
abbr,acronym {
border: 0;
font-variant: normal
abbr,
acronym {
border: 0;
font-variant: normal;
}
del {
text-decoration: line-through
text-decoration: line-through;
}
address,caption,cite,code,dfn,em,th,var {
font-style: normal;
font-weight: 500
address,
caption,
cite,
code,
dfn,
em,
th,
var {
font-style: normal;
font-weight: 500;
}
ol,ul {
list-style: none
ol,
ul {
list-style: none;
}
caption,th {
text-align: left
caption,
th {
text-align: left;
}
// h1,h2,h3,h4,h5,h6 {
......@@ -67,28 +120,31 @@ caption,th {
// font-weight: 500
// }
q:before,q:after {
content: ''
q:before,
q:after {
content: "";
}
sub,sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -.5em
top: -0.5em;
}
sub {
bottom: -.25em
bottom: -0.25em;
}
ins,a {
text-decoration: none;
cursor: pointer;
ins,
a {
text-decoration: none;
cursor: pointer;
}
/* ============================================================
flex:定义布局为盒模型
......@@ -99,36 +155,72 @@ ins,a {
flex-pack-justify:子元素两端对齐
兼容性:ios 4+、android 2.3+、winphone8+
============================================================ */
.flex{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}
.flex-v{-webkit-box-orient:vertical;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
.flex-1{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;}
.flex-align-center{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;}
.flex-pack-center{-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}
.flex-pack-justify{-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}
.clearfix{
&:after{
content: '';
.flex {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.flex-v {
-webkit-box-orient: vertical;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
.flex-1 {
-webkit-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
}
.flex-align-center {
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
}
.flex-pack-center {
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
}
.flex-pack-justify {
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
-ms-flex-pack: justify;
justify-content: space-between;
}
.clearfix {
&:after {
content: "";
display: table;
clear: both;
font-size: 0;
}
}
}
.fl{float: left};
.fr{float: right};
.hide{display: none;}
.disabled{
pointer-events: none;
.fl {
float: left;
}
#app,.pages{
.flex;
.flex-v;
height: 100%;
.fr {
float: right;
}
.hide {
display: none;
}
.disabled {
pointer-events: none;
}
#app,
.pages {
.flex;
.flex-v;
height: 100%;
}
.ellipsis{
.ellipsis {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
......@@ -137,90 +229,143 @@ ins,a {
display: none;
}
[disabled] {
pointer-events: none;
}
.el-dialog{
.el-checkbox-group{
.el-checkbox{
margin: 5px 0;
width: 33.33%;
}
.pointBox{
width: 50%;
}
}
pointer-events: none;
}
.el-dialog {
.el-checkbox-group {
.el-checkbox {
margin: 5px 0;
width: 33.33%;
}
.pointBox {
width: 50%;
}
}
}
.el-table th {
user-select: all;
user-select: all;
}
.el-progress-bar{
padding-right: 70px;
margin-right: -70px;
.el-progress-bar {
padding-right: 70px;
margin-right: -70px;
}
#operatorUserCabinCheckBox .el-checkbox{
#operatorUserCabinCheckBox .el-checkbox {
white-space: normal !important;
width: 100%
width: 100%;
}
#operatorUserCabinCheckBox .el-checkbox__label{
#operatorUserCabinCheckBox .el-checkbox__label {
display: inline;
}
// 统计页面隔日期变色
.page-statistics{
.chart{
.page-statistics {
.chart {
margin-bottom: 80px;
border: 1px solid #ededed;
height: 400px;
}
.el-table th, .el-table tr{
&.color-gray{
.el-table th,
.el-table tr {
&.color-gray {
background-color: #f0f9eb;
}
}
}
@media screen and (max-width: 800px){
.page{
margin: 5px 5px;
}
.el-dialog{
width: 98%!important;
.el-checkbox-group{
.el-checkbox{
margin: 5px 0;
width: 50%;
font-size: 12px;
.el-checkbox__label{
font-size: 12px;
}
}
}
}
@media screen and (max-width: 800px) {
.page {
margin: 5px 5px;
}
.el-dialog {
width: 98% !important;
.el-checkbox-group {
.el-checkbox {
margin: 5px 0;
width: 50%;
font-size: 12px;
.el-checkbox__label {
font-size: 12px;
}
}
}
}
}
// .is-active{
// background-color: red;
// }
.mobile-table-card{
margin: 10px auto;
padding: 10px;
box-shadow: 0 0 5px #ccc;
.mobile-table-cell{
padding: 5px 0;
border-bottom: 1px dotted #eee;
.cell-title{
font-size: 13px;
color: #666;
}
.cell-content{
padding-left: 5px;
text-align: right;
word-break: break-word;
}
}
}
\ No newline at end of file
.mobile-table-card {
margin: 10px auto;
padding: 10px;
box-shadow: 0 0 5px #ccc;
.mobile-table-cell {
padding: 5px 0;
border-bottom: 1px dotted #eee;
.cell-title {
font-size: 13px;
color: #666;
}
.cell-content {
padding-left: 5px;
text-align: right;
word-break: break-word;
}
}
}
.layout-menu-wrapper {
height: 64px !important;
line-height: 64px !important;
background: linear-gradient(90deg, #1845c6, #2999ff) !important;
}
.layout-menu-wrapper .layout-logo {
font-size: 20px;
font-weight: bold;
}
.layout-menu-wrapper .menu-list li a {
display: block;
padding: 0 12px;
height: 100%;
font-size: 14px !important;
color: rgba(254, 254, 254, 0.65) !important;
text-align: center !important;
}
.layout-menu-wrapper .menu-list li a i {
font-size: 14px !important;
margin-right: 10px !important;
}
.layout-menu-wrapper .menu-list li a i:first-child {
margin-right: 0px !important;
}
.layout-menu-wrapper .menu-list li a:hover {
color: #fff !important;
}
.layout-menu-wrapper .menu-list li a.router-link-active,
.layout-menu-wrapper .menu-list li a[active] {
color: #fff !important;
list-style-type: none;
border-bottom: none !important;
padding-bottom: 2px;
background-color: #1890ff !important;
}
.layout-header .layout-submenu-wrapper {
width: 95% !important;
margin: 0 auto !important;
margin-top: 20px !important;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
.page.active {
width: 95% !important;
margin: 0 auto !important;
padding: 20px !important;
padding-top: 0 !important;
}
.page {
height: 82% !important;
min-height: 82% !important;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
}
import axios from 'axios';
import Qs from 'qs';
const JSONbig = require('json-bigint')({"storeAsString": true});
import cookie from './cookie';
import httpErrorHandler from './httpErrorHandler';
import axios from "axios";
import Qs from "qs";
const JSONbig = require("json-bigint")({ storeAsString: true });
import cookie from "./cookie";
import httpErrorHandler from "./httpErrorHandler";
const instance = axios.create({
baseURL: '/refined',
baseURL: "/refined",
headers: {
post: {
'Content-Type': 'application/json;charset=UTF-8',
'dataType': 'json',
}
"Content-Type": "application/json;charset=UTF-8",
dataType: "json",
},
},
transformResponse: [data=>{
try {
JSON.parse(data);
return JSONbig.parse(data);
} catch (error) {
return data;
}
}],
transformResponse: [
(data) => {
try {
JSON.parse(data);
return JSONbig.parse(data);
} catch (error) {
return data;
}
},
],
});
instance.interceptors.request.use(
(config) => {
// 获取当前页面的主机名和端口号
const hostname = location.hostname;
const baseURL = config.baseURL;
//const port = location.port;
const port =
process.env.VUE_APP_PORTAL_PORT == "undefined"
? "11089"
: process.env.VUE_APP_PORTAL_PORT;
instance.interceptors.request.use(config => {
// 获取当前页面的主机名和端口号
const hostname = location.hostname;
const baseURL =config.baseURL;
//const port = location.port;
const port =process.env.VUE_APP_PORTAL_PORT=='undefined'?'11089':process.env.VUE_APP_PORTAL_PORT;
// 动态修改请求地址
// 动态修改请求地址
console.log(config.url);
console.log(config.url)
if (config.url.startsWith("/")) {
// 字符串以 / 开头
config.url = `http://112.19.80.237:11080${baseURL}${config.url}`;
// config.url = `http://${hostname}:${port}${baseURL}${config.url}`;
}
if (config.url.startsWith('/')) {
// 字符串以 / 开头
config.url = `http://${hostname}:${port}${baseURL}${config.url}`;
//config.url = `http://${hostname}:${port}${baseURL}/${config.url}`;
//config.data = Qs.stringify(config.data, {arrayFormat: 'repeat', allowDots: true});
//config.data = Qs.stringify(config.data, {arrayFormat: 'indices', allowDots: true});
//brackets
// 也可以在这里给请求添加token之类的字段
// config.headers['Content-Type'] = 'application/json;charset=UTF-8'
// config.headers.timestamp = Math.floor(new Date().getTime() / 1000)
// console.log("sessionStorage",window.sessionStorage)
config.headers.Authorization = window.sessionStorage.getItem("token") || "";
//console.log("request config and session",config,window.sessionStorage);
return config;
},
(err) => {
return Promise.reject(err);
}
);
//config.url = `http://${hostname}:${port}${baseURL}/${config.url}`;
//config.data = Qs.stringify(config.data, {arrayFormat: 'repeat', allowDots: true});
//config.data = Qs.stringify(config.data, {arrayFormat: 'indices', allowDots: true});
//brackets
// 也可以在这里给请求添加token之类的字段
// config.headers['Content-Type'] = 'application/json;charset=UTF-8'
// config.headers.timestamp = Math.floor(new Date().getTime() / 1000)
// console.log("sessionStorage",window.sessionStorage)
config.headers.Authorization = window.sessionStorage.getItem('token') || ''
//console.log("request config and session",config,window.sessionStorage);
return config;
}, err => {
return Promise.reject(err);
});
instance.interceptors.response.use(response=>{
return response.data
},httpErrorHandler);
instance.interceptors.response.use((response) => {
return response.data;
}, httpErrorHandler);
/**
* 封装后的axios post方法
......@@ -68,9 +76,9 @@ instance.interceptors.response.use(response=>{
*/
export function post(url, option, config = {}) {
const data = Object.assign({}, option, {
// __mortals_token__: cookie.getItem('__mortals_token__'),
})
return instance.post(url, data, config)
// __mortals_token__: cookie.getItem('__mortals_token__'),
});
return instance.post(url, data, config);
}
/**
......@@ -84,24 +92,23 @@ export function post(url, option, config = {}) {
export function get(url, option, config = {}) {
const data = Object.assign({}, option, {
//__mortals_token__: cookie.getItem('__mortals_token__'),
})
return instance.get(url, { params: data }, config)
});
return instance.get(url, { params: data }, config);
}
// 文件上传
const uploadInstance = axios.create({
baseURL: '/m',
baseURL: "/m",
headers: {
post: {
'Content-Type': 'multipart/form-data',
}
}
"Content-Type": "multipart/form-data",
},
},
});
uploadInstance.interceptors.response.use(response=>{
return response.data
},httpErrorHandler);
uploadInstance.interceptors.response.use((response) => {
return response.data;
}, httpErrorHandler);
/**
* 封装后的axios upload方法
......@@ -113,8 +120,8 @@ uploadInstance.interceptors.response.use(response=>{
*/
export function upload(url, option, config = {}) {
let formdata = new FormData();
Object.keys(option).forEach(key=>{
formdata.append(key, option[key])
})
return uploadInstance.post(url, formdata, config)
Object.keys(option).forEach((key) => {
formdata.append(key, option[key]);
});
return uploadInstance.post(url, formdata, config);
}
<template>
<el-table
size='small'
size="small"
:data="tableData"
:row-key="handleRowKeyMethod"
:span-method="handleSpanMethod"
......@@ -9,113 +9,111 @@
@sort-change="handleSortChange"
@row-click="handleRowClick"
:row-class-name="tableRowClassName"
:empty-text='emptyText'
:empty-text="emptyText"
border
style="width: 100%">
height="600"
style="width: 100%"
>
<el-table-column
v-for="column in columns"
:key="column.prop"
:type="column.type"
:index="handleIndexMethod"
:selectable="handleSelectableMethod"
:prop="column.prop"
:label="column.label"
:width="column.width"
:sortable="column.sortable"
:show-overflow-tooltip="column.tooltip"
:align="column.align || 'left'"
:formatter="column.formatter"
:reserve-selection="column.reserveSelection"
:subColumns="column.subColumns"
>
<el-table-column
v-for='column in columns'
:key='column.prop'
:type="column.type"
:index="handleIndexMethod"
:selectable="handleSelectableMethod"
:prop="column.prop"
:label="column.label"
:width="column.width"
:sortable="column.sortable"
:show-overflow-tooltip="column.tooltip"
:align="column.align || 'left'"
:formatter='column.formatter'
:reserve-selection='column.reserveSelection'
:subColumns='column.subColumns'
>
<el-table-column
v-for='sunColumn in column.subColumns'
:key='sunColumn.prop'
:type="sunColumn.type"
:prop="sunColumn.prop"
:label="sunColumn.label"
:width="sunColumn.width"
:sortable="sunColumn.sortable"
:align="sunColumn.align || 'left'"
:formatter='sunColumn.formatter'
/>
</el-table-column>
v-for="sunColumn in column.subColumns"
:key="sunColumn.prop"
:type="sunColumn.type"
:prop="sunColumn.prop"
:label="sunColumn.label"
:width="sunColumn.width"
:sortable="sunColumn.sortable"
:align="sunColumn.align || 'left'"
:formatter="sunColumn.formatter"
/>
</el-table-column>
</el-table>
</template>
<script>
export default {
props: {
handleRowKeyMethod: {
type: Function,
required: false,
default: row => { return row.id }
default: (row) => {
return row.id;
},
},
handleSelectableMethod: {
type: Function,
required: false,
default: () => {}
default: () => {},
},
handleIndexMethod: {
type: Function,
required: false,
default: () => {}
default: () => {},
},
handleSpanMethod: {
type: Function,
required: false,
default: () => {}
default: () => {},
},
handleSelectionChange: {
type: Function,
required: false,
default: () => {}
default: () => {},
},
handleRowClick: {
type: Function,
required: false,
default: () => {}
default: () => {},
},
handleSortChange: {
type: Function,
required: false,
default: () => {}
default: () => {},
},
tableRowClassName: {
type: Function,
required: false,
default: () => {}
default: () => {},
},
loading: {
type: Boolean,
required: false,
default: true
default: true,
},
tableData: {
type: Array,
required: false,
default: () => []
default: () => [],
},
columns: {
type: Array,
required: false,
default: ()=> [],
}
default: () => [],
},
},
computed: {
emptyText() {
return (!this.loading && !this.tableData.length) ? '暂无数据' : '加载中...'
return !this.loading && !this.tableData.length ? "暂无数据" : "加载中...";
},
},
methods:{
},
methods: {},
data() {
return {}
}
}
return {};
},
};
</script>
......@@ -6,12 +6,15 @@
<div class="layout-menu flex flex-1">
<!-- logo -->
<div class="layout-logo flex">
<i class="el-icon-menu" @click='showMobileMenu=!showMobileMenu'> </i>
<i class="el-icon-menu" @click="showMobileMenu = !showMobileMenu">
</i>
<router-link to="/">
<img src="../assets/images/logo.png" style="margin-bottom:5px" height="40" alt="">
<b style="color:white;font-size:18px;">&nbsp;&nbsp;&nbsp; 智慧大厅精细化管理系统 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
<img :src="sysLogo" style="margin-bottom:5px" height="40" alt="" />
<b style="color:white;font-size:18px;"
>&nbsp;&nbsp;&nbsp;
{{ title }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b
>
</router-link>
</div>
<!-- 站点选择 -->
<div>
......@@ -19,60 +22,83 @@
</div>
<!-- 一级菜单 -->
<ul class="menu-list flex">
<li v-for='item in menu' :key='item.id'>
<router-link :to="item.path" :active='submenu.path === item.path' :title="item.name">
<i :class="'el-icon-'+item.icon"></i>
{{item.name}}
<li v-for="item in menu" :key="item.id">
<router-link
:to="item.path"
:active="submenu.path === item.path"
:title="item.name"
>
<i :class="'el-icon-' + item.icon"></i>
{{ item.name }}
</router-link>
</li>
</ul>
</div>
<div class="layout-profile">
<!-- <span class="el-dropdown-link">
<!-- <span class="el-dropdown-link">
{{userData.currUserName}}
<i class="el-icon-arrow-down el-icon--right"></i>
</span> -->
<!--
<!--
<i class="el-icon-s-home" style="font-size: 15px;margin-right: 10px" > 返回门户</i>
-->
<!--
<!--
<el-link class="el-icon-s-home" style="font-size: 15px;margin-right: 10px" @click="returnHome" > 返回门户</el-link>
-->
<el-tooltip
effect="dark"
content="返回门户"
placement="bottom"
style="margin-right: 20px;"
>
<a style="color: #fff;" :href="portal">
<i class="el-icon-s-home"></i> 返回门户
</a>
</el-tooltip>
<el-dropdown @command="handleCommand">
<el-dropdown @command="handleCommand">
<span class="el-dropdown-link" style="color:white">
{{userData.currUserName}}
{{ userData.currUserName }}
<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="update">修改密码</el-dropdown-item>
<el-dropdown-item command="logout">退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
<!-- 一级菜单 -->
<ul class="mobile-menu-list flex flex-pack-justify" v-if='showMobileMenu'>
<li v-for='item in menu' :key='item.id'>
<router-link :to="item.path" :active='submenu.path === item.path' :title="item.name">
<i :class="'el-icon-'+item.icon"></i>
{{item.name}}
<ul class="mobile-menu-list flex flex-pack-justify" v-if="showMobileMenu">
<li v-for="item in menu" :key="item.id">
<router-link
:to="item.path"
:active="submenu.path === item.path"
:title="item.name"
>
<i :class="'el-icon-' + item.icon"></i>
{{ item.name }}
</router-link>
</li>
</ul>
<!-- 二级菜单 -->
<div class="layout-submenu-wrapper flex" v-if='submenu.children && submenu.children.length'>
<div
class="layout-submenu-wrapper flex"
v-if="submenu.children && submenu.children.length"
>
<div class="layout-submenu">
<ul class="submenu-list flex">
<li v-for='item in submenu.children' :key='item.id'>
<a :href="item.path" target="blank" v-if='item.isOut'>{{item.name}}</a>
<router-link :to="item.path" :active='group === item.path' v-else>{{item.name}}</router-link>
<li v-for="item in submenu.children" :key="item.id">
<a :href="item.path" target="blank" v-if="item.isOut">{{
item.name
}}</a>
<router-link :to="item.path" :active="group === item.path" v-else>{{
item.name
}}</router-link>
</li>
</ul>
</div>
......@@ -88,31 +114,40 @@ export default {
HeaderSite,
},
methods: {
returnHome(){
returnHome() {
window.close();
},
handleCommand(key) {
if(key === 'update'){
this.$router.push('/login/updatePwd')
if (key === "update") {
this.$router.push("/login/updatePwd");
}
if(key === 'logout'){
this.logout()
if (key === "logout") {
this.logout();
}
},
// 退出登录
logout() {
this.$post('/login/logout').then(data=>{}).catch(error=>{}).then(()=>{
this.$message.success('已退出登录');
this.$store.commit('logout');
this.$router.replace('/login');
})
}
this.$post("/login/logout")
.then((data) => {})
.catch((error) => {})
.then(() => {
this.$message.success("已退出登录");
this.$store.commit("logout");
this.$router.replace("/login");
});
},
},
beforeDestroy() {
console.log("beforeDestroy");
//window.removeEventListener("message", this.getsocketData, false);
},
mounted() {
created() {
localStorage.getItem("sysName")
? (this.title = localStorage.getItem("sysName"))
: "";
localStorage.getItem("sysLogo")
? (this.sysLogo = location.origin + "/" + localStorage.getItem("sysLogo"))
: (this.sysLogo = require("../assets/images/logo.png"));
// console.log("mounted");
// this.$nextTick(function () {
// console.log("login websocket:"+"ws://"+process.env.VUE_APP_WEBSOCKET_API +"/ws?accessToken="+ this.$store.state.userData.id)
......@@ -123,12 +158,10 @@ export default {
// this.$store.state.userData.id
// );
// });
// let _this = this;
// const getsocketData = (e) => {i
// // 创建接收消息函数
// const data = e && e.detail.data;
// let obj = JSON.parse(data);
// if (obj.type == "SEND_TO_ALL_REQUEST") {
// vm.refreshData();
......@@ -139,147 +172,161 @@ export default {
// type: "warning",
// duration: 8000,
// });
// }
// };
// this.getsocketData = getsocketData;
// // 注册监听事件
// window.addEventListener("onmessageWS", getsocketData,false);
},
},
computed: {
group() {
const relativeGroup = this.$store.state.group;
if(relativeGroup) {
if (relativeGroup) {
return relativeGroup;
}
let groupArray = this.$route.path.split('/');
let groupArray = this.$route.path.split("/");
let group = this.$route.path;
let type = groupArray.pop();
if(['add', 'edit', 'view', 'new','importView','resetPwdView'].indexOf(type) > -1){
groupArray.push('list');
group = groupArray.join('/')
if (
["add", "edit", "view", "new", "importView", "resetPwdView"].indexOf(
type
) > -1
) {
groupArray.push("list");
group = groupArray.join("/");
}
return group;
},
relativeGroup() {
return this.$store.state.group
return this.$store.state.group;
},
flat() {
return this.userData.flat
return this.userData.flat;
},
menu() {
if(!this.userData.barList) return [];
return this.userData.barList.map(item=>{
const url = item.url ? item.url : (item.childList[0] ? (item.childList[0].url || '') : '');
if (!this.userData.barList) return [];
return this.userData.barList.map((item) => {
const url = item.url
? item.url
: item.childList[0]
? item.childList[0].url || ""
: "";
return {
name: item.name,
path: url,
id: item.id,
icon: item.imgPath,
children: item.childList.map(sub=>{
children: item.childList.map((sub) => {
return {
name: sub.name,
path: sub.url ? sub.url : (sub.childList[0] ? (sub.childList[0].url || 0) : ''),
path: sub.url
? sub.url
: sub.childList[0]
? sub.childList[0].url || 0
: "",
id: sub.id,
parentId: sub.parentId,
icon: sub.imgPath,
isOut: /^https?\:\/\//.test(sub.url)
}
})
}
})
isOut: /^https?\:\/\//.test(sub.url),
};
}),
};
});
},
submenu() {
if(!this.menu.length) return {};
if (!this.menu.length) return {};
let matchMenu = {};
this.menu.forEach(item=>{
this.menu.forEach((item) => {
const menu = item;
item.children.forEach(item=>{
if(item.path === this.group) {
item.children.forEach((item) => {
if (item.path === this.group) {
matchMenu = menu;
return;
}
})
})
return matchMenu
});
});
return matchMenu;
},
userData() {
return this.$store.state.userData;
}
},
},
data() {
return {
showMobileMenu: false,
}
}
}
portal: process.env.VUE_APP_PORTAL_URL + "/#/home/siteArrange",
title: "智慧大厅精细化管理系统",
sysLogo: "",
};
},
};
</script>
<style lang="less">
.layout-header{
.mobile-menu-list{display: none}
.layout-menu-wrapper{
.layout-header {
.mobile-menu-list {
display: none;
}
.layout-menu-wrapper {
height: 50px;
line-height: 50px;
font-size: 14px;
color: #eee;
background: #1848c8;
.layout-logo{
.layout-logo {
height: 50px;
.el-icon-menu{display: none}
a{
.el-icon-menu {
display: none;
}
a {
margin: auto;
}
img{
img {
vertical-align: middle;
}
}
.menu-list{
li{
a{
.menu-list {
li {
a {
display: block;
padding: 0 12px;
height: 100%;
color: #eee;
&.router-link-active,
&[active]{
&[active] {
//background: #1890ff;
color: #fff;
list-style-type:none;
border-bottom:3px solid #fff;
list-style-type: none;
border-bottom: 3px solid #fff;
padding-bottom: 2px;
}
}
}
}
.layout-profile{
.layout-profile {
padding-right: 30px;
cursor: pointer;
}
}
.layout-submenu-wrapper{
.layout-submenu-wrapper {
padding-left: 20px;
background: #fff;
height: 42px;
border-bottom: 1px solid #ededed;
.layout-title{
.layout-title {
font-size: 18px;
height: 40px;
line-height: 40px;
color: #333;
}
.layout-submenu{
.layout-submenu {
margin-left: 15px;
white-space: nowrap;
overflow: auto;
li{
a{
li {
a {
display: block;
padding: 0 10px;
height: 40px;
......@@ -287,7 +334,7 @@ export default {
font-size: 14px;
color: #666;
&.router-link-active,
&[active]{
&[active] {
color: #1890ff;
border-bottom: 2px solid #1890ff;
}
......@@ -297,48 +344,48 @@ export default {
}
}
@media screen and (max-width: 800px){
@media screen and (max-width: 800px) {
.layout-header {
.mobile-menu-list{
.mobile-menu-list {
display: flex;
background: #222333;
padding: 0 10px;
li{
li {
padding: 8px 5px;
a{
a {
width: 1em;
display: block;
color: #eee;
font-size: 14px;
word-break: break-all;
&.router-link-active,
&[active]{
&[active] {
color: #1890ff;
}
}
}
}
.layout-submenu-wrapper{
.layout-submenu-wrapper {
padding-left: 0;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
.layout-menu-wrapper {
width: 100%;
.layout-logo{
.layout-logo {
width: 40px;
.el-icon-menu{
.el-icon-menu {
margin: auto;
display: inline-block;
}
a{
a {
display: none;
}
}
.menu-list{
.menu-list {
display: none;
}
li{
li {
width: 100%;
}
}
......
<template>
<div>
<div class="profile" :class="{close: isOpen}">
<p class="menu-switch">
<i @click="toogle" :class="`el-icon-s-${isOpen?'unfold':'fold'}`" />
</p>
<el-dropdown @command="handleCommand">
<span class="el-dropdown-link">
{{currentUserName}}
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="update">修改密码</el-dropdown-item>
<el-dropdown-item command="logout">退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div class="sidebar" :class="{close: isOpen}">
<div class="logo">
<router-link to="/">
<img src="../assets/images/logo.png" height="20" alt />
{{isOpen ? '' : 'xxx系统' }}
</router-link>
</div>
<el-menu :default-active="defaultActive" background-color="#222333" text-color="#fff" active-text-color="#409eff" :collapse="isOpen" :collapse-transition="false" router unique-opened>
<el-menu-item index="/index" key="home">
<i class="el-icon-s-home"></i>
<span>首页</span>
</el-menu-item>
<div>
<div class="profile" :class="{ close: isOpen }">
<p class="menu-switch">
<i @click="toogle" :class="`el-icon-s-${isOpen ? 'unfold' : 'fold'}`" />
</p>
<el-dropdown @command="handleCommand">
<span class="el-dropdown-link">
{{ currentUserName }}
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="update">修改密码</el-dropdown-item>
<el-dropdown-item command="logout">退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div class="sidebar" :class="{ close: isOpen }">
<div class="logo">
<router-link to="/">
<img src="../assets/images/logo.png" height="20" alt />
{{ isOpen ? "" : "xxx系统" }}
</router-link>
</div>
<el-menu
:default-active="defaultActive"
background-color="#222333"
text-color="#fff"
active-text-color="#409eff"
:collapse="isOpen"
:collapse-transition="false"
router
unique-opened
>
<el-menu-item index="/index" key="home">
<i class="el-icon-s-home"></i>
<span>首页</span>
</el-menu-item>
<el-submenu v-for="item in menu" :key="item.id" :index="item.name">
<template slot="title">
<i :class="`el-icon-${item.icon}`"></i>
<span slot="title">{{item.name}}</span>
</template>
<el-menu-item v-for="val in item.children" :index="val.path" :key="val.id">
<i :class="`el-icon-${val.icon}`"></i>
<span>{{val.name}}</span>
</el-menu-item>
</el-submenu>
</el-menu>
</div>
<el-submenu v-for="item in menu" :key="item.id" :index="item.name">
<template slot="title">
<i :class="`el-icon-${item.icon}`"></i>
<span slot="title">{{ item.name }}</span>
</template>
<el-menu-item
v-for="val in item.children"
:index="val.path"
:key="val.id"
>
<i :class="`el-icon-${val.icon}`"></i>
<span>{{ val.name }}</span>
</el-menu-item>
</el-submenu>
</el-menu>
</div>
</div>
</template>
<script>
export default {
props: {
isOpen: {
type: Boolean,
default: false,
},
props: {
isOpen: {
type: Boolean,
default: false,
},
},
methods: {
handleCommand(key) {
if (key === "update") {
this.$router.push("/login/updatePwd");
}
if (key === "logout") {
this.logout();
}
},
toogle() {
this.$emit("toggle");
},
// 退出登录
logout() {
this.$post("/login/logout")
.then((data) => {})
.catch((error) => {})
.then(() => {
this.$message.success("已退出登录");
this.$store.commit("logout");
this.$router.replace("/login");
});
},
},
computed: {
currentUserName() {
const { currUserName } = this.$store.state.userData;
return currUserName;
},
group() {
const relativeGroup = this.$store.state.group;
if (relativeGroup) {
return relativeGroup;
}
let groupArray = this.$route.path.split("/");
let group = this.$route.path;
let type = groupArray.pop();
if (["add", "edit", "view", "new"].indexOf(type) > -1) {
groupArray.push("list");
group = groupArray.join("/");
}
return group;
},
methods: {
handleCommand(key) {
if (key === "update") {
this.$router.push("/login/updatePwd");
}
if (key === "logout") {
this.logout();
}
},
toogle() {
this.$emit("toggle");
},
// 退出登录
logout() {
this.$post("/login/logout")
.then((data) => {})
.catch((error) => {})
.then(() => {
this.$message.success("已退出登录");
this.$store.commit("logout");
this.$router.replace("/login");
});
},
relativeGroup() {
return this.$store.state.group;
},
computed: {
currentUserName() {
const { currUserName } = this.$store.state.userData;
return currUserName;
},
group() {
const relativeGroup = this.$store.state.group;
if (relativeGroup) {
return relativeGroup;
}
let groupArray = this.$route.path.split("/");
let group = this.$route.path;
let type = groupArray.pop();
if (["add", "edit", "view", "new"].indexOf(type) > -1) {
groupArray.push("list");
group = groupArray.join("/");
}
return group;
},
relativeGroup() {
return this.$store.state.group;
},
flat() {
return this.userData.flat;
},
menu() {
if (!this.userData.barList) return [];
return this.userData.barList.map((item) => {
const url = item.url
? item.url
: item.childList[0]
? item.childList[0].url || ""
: "";
return {
name: item.name,
path: url,
id: item.id,
icon: item.imgPath,
children: item.childList.map((sub) => {
return {
name: sub.name,
path: sub.url
? sub.url
: sub.childList[0]
? sub.childList[0].url || 0
: "",
id: sub.id,
parentId: sub.parentId,
icon: sub.imgPath,
isOut: /^https?\:\/\//.test(sub.url),
};
}),
};
});
},
defaultActive() {
this.search = "";
// this.$route.path;
return this.group;
},
submenu() {
if (!this.menu.length) return {};
let matchMenu = {};
this.menu.forEach((item) => {
const menu = item;
item.children.forEach((item) => {
if (item.path === this.group) {
matchMenu = menu;
return;
}
});
});
return matchMenu;
},
userData() {
return this.$store.state.userData;
},
flat() {
return this.userData.flat;
},
data() {
return {};
menu() {
if (!this.userData.barList) return [];
return this.userData.barList.map((item) => {
const url = item.url
? item.url
: item.childList[0]
? item.childList[0].url || ""
: "";
return {
name: item.name,
path: url,
id: item.id,
icon: item.imgPath,
children: item.childList.map((sub) => {
return {
name: sub.name,
path: sub.url
? sub.url
: sub.childList[0]
? sub.childList[0].url || 0
: "",
id: sub.id,
parentId: sub.parentId,
icon: sub.imgPath,
isOut: /^https?\:\/\//.test(sub.url),
};
}),
};
});
},
defaultActive() {
this.search = "";
// this.$route.path;
return this.group;
},
submenu() {
if (!this.menu.length) return {};
let matchMenu = {};
this.menu.forEach((item) => {
const menu = item;
item.children.forEach((item) => {
if (item.path === this.group) {
matchMenu = menu;
return;
}
});
});
return matchMenu;
},
userData() {
return this.$store.state.userData;
},
},
data() {
return {};
},
};
</script>
<style lang="less">
.profile {
height: 50px;
background-color: #222333;
text-align: right;
position: fixed;
right: 0;
width: calc(100% - 200px);
z-index: 999;
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
&.close {
width: calc(100% - 64px);
}
.menu-switch {
cursor: pointer;
i {
font-size: 20px;
color: #999;
font-weight: normal;
}
height: 50px;
background-color: #222333;
text-align: right;
position: fixed;
right: 0;
width: calc(100% - 200px);
z-index: 999;
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
&.close {
width: calc(100% - 64px);
}
.menu-switch {
cursor: pointer;
i {
font-size: 20px;
color: #999;
font-weight: normal;
}
}
}
.sidebar {
width: 200px;
height: 100%;
background-color: #222333;
position: fixed;
top: 0;
z-index: 1000;
.el-menu {
border-right: 0 none;
height: calc(100% - 50px);
overflow-y: auto;
overflow-x: hidden;
&::-webkit-scrollbar {
width: 17px;
height: 17px;
background-color: transparent;
border-radius: 9px;
}
&::-webkit-scrollbar-thumb {
background-color: #40425a;
border-radius: 9px;
background-clip: content-box;
border: 5px solid transparent;
}
i {
&.el-icon-folder {
font-size: 18px;
margin-right: 3px;
}
&.el-icon-tickets {
font-size: 16px;
margin-right: 0;
}
}
width: 200px;
height: 100%;
background-color: #222333;
position: fixed;
top: 0;
z-index: 1000;
.el-menu {
border-right: 0 none;
height: calc(100% - 50px);
overflow-y: auto;
overflow-x: hidden;
&::-webkit-scrollbar {
width: 17px;
height: 17px;
background-color: transparent;
border-radius: 9px;
}
&.close {
width: 64px;
.logo {
img {
margin-right: 0;
}
a {
padding: 0;
}
}
&::-webkit-scrollbar-thumb {
background-color: #40425a;
border-radius: 9px;
background-clip: content-box;
border: 5px solid transparent;
}
i {
&.el-icon-folder {
font-size: 18px;
margin-right: 3px;
}
&.el-icon-tickets {
font-size: 16px;
margin-right: 0;
}
}
}
&.close {
width: 64px;
.logo {
height: 50px;
line-height: 50px;
text-align: center;
background-color: #222333;
display: flex;
align-items: center;
justify-content: center;
.el-icon-menu {
display: none;
}
a {
margin: auto;
color: #fff;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
padding-left: 20px;
}
img {
margin-right: 5px;
}
img {
margin-right: 0;
}
a {
padding: 0;
}
}
}
.logo {
height: 50px;
line-height: 50px;
text-align: center;
background-color: #222333;
display: flex;
align-items: center;
justify-content: center;
.el-icon-menu {
display: none;
}
a {
margin: auto;
color: #fff;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
padding-left: 20px;
}
img {
margin-right: 5px;
}
}
}
</style>
\ No newline at end of file
</style>
......@@ -4,33 +4,34 @@
<div class="layout-table" :loading="data.loading">
<div class="table-head flex flex-pack-justify">
<div class="table-head-left flex flex-align-center">
<slot name="breadcrumb">
<slot name="breadcrumb">
<Breadcrumb style="margin-left: 10px" />
</slot>
<div class="buttons">
<el-row>
<slot name="table-head-left"></slot>
<slot name="table-head-center">
<el-button
v-if="isShowButton('notAdd')"
type="primary"
icon="el-icon-plus"
plain
size="mini"
@click="config.methods.add"
title="新增"
>新增</el-button
>
<el-button
v-if="isShowBtn('import')"
size="mini"
plain
@click="config.methods.importView"
class="el-icon-upload2"
title="导入"
>导入</el-button>
<slot name="table-head-left"></slot>
<slot name="table-head-center">
<el-button
v-if="isShowButton('notAdd')"
type="primary"
icon="el-icon-plus"
plain
size="mini"
@click="config.methods.add"
title="新增"
>新增</el-button
>
<el-button
v-if="isShowBtn('import')"
size="mini"
plain
@click="config.methods.importView"
class="el-icon-upload2"
title="导入"
>导入</el-button
>
<!-- <el-button
<!-- <el-button
v-if="isShowButton('notDel')"
icon="el-icon-delete"
type="danger"
......@@ -40,36 +41,47 @@
title="批量删除"
>删除</el-button
> -->
<Confirm v-if='isShowButton("notDel")' @confirm='config.methods.del' message='确定要删除选中的多条记录吗?'>
<el-button icon="el-icon-delete" type="danger" size='mini' plain title="批量删除">批量删除</el-button>
</Confirm>
<el-button
@click="item.method"
size="mini"
:key="item.label"
:icon="item.icon"
:type="item.type"
:loading="item.loading"
v-if="item.isShow"
v-for="item in config.buttons"
circle
:title="item.label"
></el-button>
<el-button
v-if="isShowBtn('back')"
@click="config.methods.back"
size="mini"
icon="el-icon-back"
circle
title="返回"
></el-button>
</slot>
<slot name="table-head-left2"></slot>
<Confirm
v-if="isShowButton('notDel')"
@confirm="config.methods.del"
message="确定要删除选中的多条记录吗?"
>
<el-button
icon="el-icon-delete"
type="danger"
size="mini"
plain
title="批量删除"
>批量删除</el-button
>
</Confirm>
<el-button
@click="item.method"
size="mini"
:key="item.label"
:icon="item.icon"
:type="item.type"
:loading="item.loading"
v-if="item.isShow"
v-for="item in config.buttons"
circle
:title="item.label"
></el-button>
<el-button
v-if="isShowBtn('back')"
@click="config.methods.back"
size="mini"
icon="el-icon-back"
circle
title="返回"
></el-button>
</slot>
<slot name="table-head-left2"></slot>
</el-row>
<el-row>
<slot name="table-head-row2-left"></slot>
</el-row>
<el-row>
<slot name="table-head-row2-left"></slot>
</el-row>
</div>
</div>
......
<template>
<div class="page page-home" style="min-height: 100vh;">
欢迎你,{{userData}}
</div>
<div class="page page-home" style="min-height: 100vh;">
欢迎你,{{ userData }}
</div>
</template>
<script>
export default {
computed: {
userData() {
return this.$store.state.userData.currUserName;
},
computed: {
userData() {
return this.$store.state.userData.currUserName;
},
},
};
</script>
\ No newline at end of file
</script>
<style lang="less" scoped>
.page-home {
margin-top: 20px !important;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
</style>
......@@ -12,13 +12,23 @@ export default {
if (token) {
window.sessionStorage.setItem("token", token);
window.sessionStorage.setItem("siteid", siteid);
this.$route.query.sysName
? localStorage.setItem("sysName", this.$route.query.sysName)
: "";
this.$route.query.sysName
? (document.title = this.$route.query.sysName)
: "";
this.$route.query.sysLogo
? localStorage.setItem("sysLogo", this.$route.query.sysLogo)
: "";
this.$router.push("/index"); // 有token直接跳转首页
} else {
this.$message({
message: "没有权限,正在跳转登录页面...",
center: true,
});
setTimeout(function () {
setTimeout(function() {
window.location.href =
process.env.VUE_APP_PORTAL_URL == "undefined"
? "http://192.168.0.98:11072"
......@@ -35,4 +45,4 @@ export default {
width: 300px;
height: 100px;
}
</style>
\ No newline at end of file
</style>
<template>
<div class="page">
<LayoutTable notAdd notDel :data="tableData" :config="tableConfig">
<div class="page">
<LayoutTable notAdd notDel :data="tableData" :config="tableConfig">
<el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
type="danger"
@click="monitorWarn"
>监测预警</el-button
>
</LayoutTable>
<drawer-show ref="dataDrawerShow" />
<dialog-show ref="dialogform" @ok="getData" />
</div>
</template>
<el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
type="danger"
@click="monitorWarn"
>监测预警</el-button
>
<script>
/** 表单弹出框模式需引入 */
import dialogShow from "./dialogshow";
import drawerShow from "./dataDrawerShow";
import table from "@/assets/mixins/table";
export default {
name: "AppointmentRecordsList",
components: {
dialogShow,
drawerShow,
},
mixins: [table],
created() {},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.dialogform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.dialogform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.dialogform.view(row);
},
/** 监测预警 */
monitorWarn(row) {
this.$refs.dataDrawerShow.view(row);
},
</LayoutTable>
serviceConstraint(row) {
let _this = this;
this.$confirm(
"服务约束后,系统将停止向该群众推送此项服务,是否确认?",
"系统服务",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function() {
//todo
_this
.$post("/appointment/records", { id: [row.id] })
.then((res) => {
if (res && res.code && res.code == 1) {
_this.getList();
_this.$message.success("停止服务成功");
}
})
.catch((error) => {
_this.$message.error(error.message);
});
})
.then((response) => {});
},
},
data() {
return {
config: {
search: [
{
name: "device",
type: "select",
label: "监测设备",
},
<drawer-show ref="dataDrawerShow" />
{
name: "detectTimeStart",
type: "datetime",
label: "开始时间",
},
<dialog-show ref="dialogform" @ok="getData" />
</div>
</template>
{
name: "detectTimeEnd",
type: "datetime",
label: "结束时间",
},
<script>
/** 表单弹出框模式需引入 */
import dialogShow from "./dialogshow";
import drawerShow from "./dataDrawerShow";
import table from "@/assets/mixins/table";
export default {
name: "AppointmentRecordsList",
components: {
dialogShow,drawerShow
},
mixins: [table],
created() {
},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.dialogform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.dialogform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.dialogform.view(row);
},
/** 监测预警 */
monitorWarn(row) {
this.$refs.dataDrawerShow.view(row);
{
name: "name",
type: "text",
label: "姓名",
fuzzy: true,
},
],
columns: [
{ type: "index", label: "序号", width: 50 },
serviceConstraint(row) {
let _this=this
this.$confirm('服务约束后,系统将停止向该群众推送此项服务,是否确认?', "系统服务", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
//todo
_this.$post("/appointment/records", { id: [row.id] })
.then((res) => {
if (res && res.code && res.code == 1) {
_this.getList();
_this.$message.success("停止服务成功");
}
})
.catch((error) => {
_this.$message.error(error.message);
});
}).then(response => {
{ label: "姓名", prop: "name" },
})
}
},
data() {
return {
config: {
search: [
{
name: "device",
type: "select",
label: "监测设备",
},
{
name: "detectTimeStart",
type: "datetime",
label: "开始时间",
},
{
name: "detectTimeEnd",
type: "datetime",
label: "结束时间",
},
{
name: "name",
type: "text",
label: "姓名",
fuzzy: true,
},
],
columns: [
{type: "index",label: "序号",width: 50},
{label: "姓名", prop: "name"},
{label: "联系方式", prop: "contactInfo"},
{label: "身份证号码", prop: "idNumber"},
{label: "预约业务", prop: "reservationService"},
{label: "预约编号", prop: "reservationNumber"},
{label: "监测时间", prop: "monitorTime", formatter: this.formatterDate},
{label: "监测设备", prop: "monitorDevice"},
{label: "签到方式", prop: "checkInMethod",formatter: this.formatter},
{label: "监测凭证", prop: "monitorCertificate",formatter: (row) => {
return row.monitorCertificate != "" ? (
<el-image
style="width: 70px; height: 70px"
src={row.monitorCertificate}
preview-src-list={[row.monitorCertificate]}
></el-image>
) : (
"--"
);
},},
{
label: "操作",
width: 240,
formatter: row => {
return (
<div>
<el-button
size="mini"
type="text"
icon="el-icon-open"
onClick={() => {
this.serviceConstraint(row);
}}
>
服务约束
</el-button>
</div>
);
}
}
]
}
};
}
{ label: "联系方式", prop: "contactInfo" },
{ label: "身份证号码", prop: "idNumber" },
{ label: "预约业务", prop: "reservationService" },
{ label: "预约编号", prop: "reservationNumber" },
{
label: "监测时间",
prop: "monitorTime",
formatter: this.formatterDate,
},
{ label: "监测设备", prop: "monitorDevice" },
{
label: "签到方式",
prop: "checkInMethod",
formatter: this.formatter,
},
{
label: "监测凭证",
prop: "monitorCertificate",
formatter: (row) => {
return row.monitorCertificate != "" ? (
<el-image
style="width: 70px; height: 70px"
src={row.monitorCertificate}
preview-src-list={[row.monitorCertificate]}
></el-image>
) : (
"--"
);
},
},
{
label: "操作",
width: 240,
formatter: (row) => {
return (
<div>
<el-button
size="mini"
type="text"
icon="el-icon-open"
onClick={() => {
this.serviceConstraint(row);
}}
>
服务约束
</el-button>
</div>
);
},
},
],
},
};
},
};
</script>
<template>
<div class="page">
<LayoutTable :data="tableData" :config="tableConfig">
</LayoutTable>
<div class="page">
<LayoutTable :data="tableData" :config="tableConfig"> </LayoutTable>
<dialog-show ref="dialogform" @ok="getData" />
</div>
<dialog-show ref="dialogform" @ok="getData" />
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import dialogShow from "./dialogshow";
import table from "@/assets/mixins/table";
export default {
name: "DeviceList",
components: {
dialogShow
},
mixins: [table],
created() {
},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.dialogform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.dialogform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.dialogform.view(row);
},
},
data() {
return {
config: {
search: [
],
columns: [
{type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
{label: "设备名称", prop: "deviceName"},
{label: "设备编码", prop: "deviceCode"},
{label: "设备位置", prop: "deviceLocation"},
{label: "经度", prop: "lon"},
{label: "纬度", prop: "lati"},
{label: "楼层", prop: "floor",formatter: this.formatter},
{label: "楼栋", prop: "build",formatter: this.formatter},
/* {label: "超时时间", prop: "timeOutPeriod",formatter: this.formatter},
/** 表单弹出框模式需引入 */
import dialogShow from "./dialogshow";
import table from "@/assets/mixins/table";
export default {
name: "DeviceList",
components: {
dialogShow,
},
mixins: [table],
created() {},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.dialogform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.dialogform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.dialogform.view(row);
},
},
data() {
return {
config: {
search: [
{
name: "deviceName",
type: "text",
label: "设备名称",
fuzzy: true,
},
{
name: "deviceStatus",
type: "select",
label: "设备状态",
},
],
columns: [
{ type: "selection", width: 60 },
{ type: "index", label: "序号", width: 50 },
{ label: "设备名称", prop: "deviceName" },
{ label: "设备编码", prop: "deviceCode" },
{ label: "设备位置", prop: "deviceLocation" },
{ label: "经度", prop: "lon" },
{ label: "纬度", prop: "lati" },
{ label: "楼层", prop: "floor", formatter: this.formatter },
{ label: "楼栋", prop: "build", formatter: this.formatter },
/* {label: "超时时间", prop: "timeOutPeriod",formatter: this.formatter},
{label: "临近时间", prop: "nearTime",formatter: this.formatter},*/
{label: "设备状态 ", prop: "deviceStatus",formatter: this.formatter},
{label: "备注", prop: "deviceRemark"},
{
label: "操作",
width: 240,
formatter: row => {
return (
<table-buttons noAdd noEdit noDel row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
);
}
}
]
}
};
}
{
label: "设备状态 ",
prop: "deviceStatus",
formatter: this.formatter,
},
{ label: "备注", prop: "deviceRemark" },
{
label: "操作",
width: 240,
formatter: (row) => {
return (
<table-buttons
noAdd
noEdit
noDel
row={row}
onEdit={this.toEdit}
onView={this.toView}
onDel={this.toDel}
/>
);
},
},
],
},
};
},
};
</script>
......@@ -3,23 +3,33 @@
<template>
<div class="page page-login flex flex-v">
<div class="form-wrap flex flex-1">
<el-form @submit.prevent='onSubmit' ref="form" :model="form" label-width="80px" size="small">
<h1>智慧大厅精细化管理平台</h1>
<el-form
@submit.prevent="onSubmit"
ref="form"
:model="form"
label-width="80px"
size="small"
>
<h1>{{ title }}</h1>
<el-form-item label="用户名">
<el-input v-model="form.loginName"></el-input>
</el-form-item>
<el-form-item label="密码">
<el-input v-model="form.password" type='password'></el-input>
<el-input v-model="form.password" type="password"></el-input>
</el-form-item>
<el-form-item size="large">
<el-button type="primary" native-type='submit' :loading='loading' @click='onSubmit'>登录</el-button>
<el-button
type="primary"
native-type="submit"
:loading="loading"
@click="onSubmit"
>登录</el-button
>
</el-form-item>
</el-form>
</div>
<div class="footer">
</div>
<div class="footer"></div>
</div>
</template>
......@@ -41,6 +51,9 @@ export default {
// });
// window.location.href=process.env.VUE_APP_PORTAL_URL=='undefined'?'http://192.168.0.98:11072':process.env.VUE_APP_PORTAL_URL
localStorage.getItem("sysName")
? (this.title = localStorage.getItem("sysName"))
: (this.title = "智慧大厅精细化管理平台");
},
methods: {
login() {
......@@ -51,7 +64,7 @@ export default {
},
loginSuccess({ data }) {
console.log("userData", data);
console.log("redirect",this.redirect)
console.log("redirect", this.redirect);
this.$store.commit("setUserData", data);
this.$router.replace({
path: this.redirect,
......@@ -92,6 +105,7 @@ export default {
loginName: "",
password: "",
},
title: "",
};
},
};
......@@ -140,4 +154,3 @@ export default {
}
}
</style>
<template>
<div class="page">
<LayoutTable notAdd notDel :data="tableData" :config="tableConfig">
<el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
type="danger"
@click="monitorWarn"
>监测预警</el-button
>
</LayoutTable>
<drawer-show ref="dataDrawerShow" />
<dialog-show ref="dialogform" @ok="getData" />
</div>
<div class="page">
<LayoutTable notAdd notDel :data="tableData" :config="tableConfig">
<el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
type="danger"
@click="monitorWarn"
>监测预警</el-button
>
</LayoutTable>
<drawer-show ref="dataDrawerShow" />
<dialog-show ref="dialogform" @ok="getData" />
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import dialogShow from "./dialogshow";
import drawerShow from "./dataDrawerShow";
import table from "@/assets/mixins/table";
export default {
name: "RealtimeDataflowList",
components: {
dialogShow,drawerShow
},
mixins: [table],
created() {
},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.dialogform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.dialogform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.dialogform.view(row);
},
monitorWarn(row) {
this.$refs.dataDrawerShow.view(row);
/** 表单弹出框模式需引入 */
import dialogShow from "./dialogshow";
import drawerShow from "./dataDrawerShow";
import table from "@/assets/mixins/table";
export default {
name: "RealtimeDataflowList",
components: {
dialogShow,
drawerShow,
},
mixins: [table],
created() {},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.dialogform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.dialogform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.dialogform.view(row);
},
monitorWarn(row) {
this.$refs.dataDrawerShow.view(row);
},
},
data() {
return {
config: {
search: [
{
name: "device",
type: "select",
label: "监测设备",
},
},
data() {
return {
config: {
search: [
{
name: "device",
type: "select",
label: "监测设备",
},
{
name: "detectTimeStart",
type: "datetime",
label: "开始时间",
},
{
name: "detectTimeStart",
type: "datetime",
label: "开始时间",
},
{
name: "detectTimeEnd",
type: "datetime",
label: "结束时间",
},
],
columns: [
/* {type: "selection", width: 60},*/
{type: "index",label: "序号",width: 50},
{
name: "detectTimeEnd",
type: "datetime",
label: "结束时间",
},
],
columns: [
/* {type: "selection", width: 60},*/
{ type: "index", label: "序号", width: 50 },
{label: "姓名", prop: "name"},
{ label: "姓名", prop: "name" },
{label: "监测设备", prop: "device"},
{ label: "监测设备", prop: "device" },
{label: "监测时间", prop: "detectTime", formatter: this.formatterDate},
{
label: "监测时间",
prop: "detectTime",
formatter: this.formatterDate,
},
{label: "联系方式", prop: "contact"},
{ label: "联系方式", prop: "contact" },
{label: "身份证号码", prop: "idNumber"},
{ label: "身份证号码", prop: "idNumber" },
{label: "是否预约", prop: "isBooking",formatter: this.formatter},
{ label: "是否预约", prop: "isBooking", formatter: this.formatter },
{label: "排队编码", prop: "queueNum"},
{ label: "排队编码", prop: "queueNum" },
{label: "办理位置", prop: "location"},
{ label: "办理位置", prop: "location" },
{label: "识别截图", prop: "picture",formatter: (row) => {
return row.picture != "" ? (
<el-image
style="width: 70px; height: 70px"
src={row.picture}
preview-src-list={[row.picture]}
></el-image>
) : (
"--"
);
},},
{
label: "识别截图",
prop: "picture",
formatter: (row) => {
return row.picture != "" ? (
<el-image
style="width: 70px; height: 70px"
src={row.picture}
preview-src-list={[row.picture]}
></el-image>
) : (
"--"
);
},
},
{
label: "操作",
width: 240,
formatter: row => {
return (
<table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
);
}
}
]
}
};
}
{
label: "操作",
width: 240,
formatter: (row) => {
return (
<table-buttons
noAdd
row={row}
onEdit={this.toEdit}
onView={this.toView}
onDel={this.toDel}
/>
);
},
},
],
},
};
},
};
</script>
......@@ -6,25 +6,50 @@
<el-col :span="24" v-if="form.parentId !== 0">
<el-form-item label="上级节点" prop="parentId">
<treeselect
v-model="form.parentId"
:options="menuOptions"
:normalizer="normalizer"
placeholder="选择上级菜单信息"
v-model="form.parentId"
:options="menuOptions"
:normalizer="normalizer"
placeholder="选择上级菜单信息"
/>
</el-form-item>
</el-col>
<!-- <Field label="ID" prop="id" v-model="form.id" v-if='pageInfo.type !== "add"' disabled />
--> <Field label="名称" prop="name" v-model="form.name"/>
<Field label="权限类型" prop="authType" v-model="form.authType" :enumData='dict.authType' type='select' />
<Field label="访问地址" prop="url" v-model="form.url" />
<Field label="状态" prop="status" v-model="form.status" :enumData='dict.status' type='radio' />
<Field class="radio-group-container" label="图标" prop="imgPath" :span='24'>
<el-radio-group v-model="form.imgPath" class='form-el-radio-group'>
<el-radio-button style="width: 180px" label="">不需要图标</el-radio-button>
<el-radio-button style="width: 180px" v-for='(icon, index) in icons' :key='index' :label="icon">
<i :class="'el-icon-'+icon" style="font-size: 20px"></i>
{{icon}}
<!-- <Field label="ID" prop="id" v-model="form.id" v-if='pageInfo.type !== "add"' disabled />
-->
<Field label="名称" prop="name" v-model="form.name" />
<Field
label="权限类型"
prop="authType"
v-model="form.authType"
:enumData="dict.authType"
type="select"
/>
<Field label="访问地址" prop="url" v-model="form.url" />
<Field
label="状态"
prop="status"
v-model="form.status"
:enumData="dict.status"
type="radio"
/>
<Field
class="radio-group-container"
label="图标"
prop="imgPath"
:span="24"
>
<el-radio-group v-model="form.imgPath" class="form-el-radio-group">
<el-radio-button style="width: 180px" label=""
>不需要图标</el-radio-button
>
<el-radio-button
style="width: 180px"
v-for="(icon, index) in icons"
:key="index"
:label="icon"
>
<i :class="'el-icon-' + icon" style="font-size: 20px"></i>
{{ icon }}
</el-radio-button>
</el-radio-group>
</Field>
......@@ -41,7 +66,7 @@
import form from "@/assets/mixins/formdialog";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import axios from 'axios'
import axios from "axios";
export default {
mixins: [form],
components: {
......@@ -49,15 +74,42 @@ export default {
},
data() {
return {
fileContent:"",
fileContent: "",
icons: [
'info', 'error', 'success', 'warning', 'question',
'tickets', 'document', 'goods', 'sold-out', 'news',
'message', 'date', 'printer', 'time', 'bell',
'mobile-phone', 'service', 'view', 'menu', 'star-on',
'location', 'phone', 'picture', 'delete', 'search',
'edit', 'rank', 'refresh', 'share', 'setting',
'upload', 'upload2', 'download', 'loading',
"info",
"error",
"success",
"warning",
"question",
"tickets",
"document",
"goods",
"sold-out",
"news",
"message",
"date",
"printer",
"time",
"bell",
"mobile-phone",
"service",
"view",
"menu",
"star-on",
"location",
"phone",
"picture",
"delete",
"search",
"edit",
"rank",
"refresh",
"share",
"setting",
"upload",
"upload2",
"download",
"loading",
],
menuOptions: [],
// 遮罩层
......@@ -66,46 +118,38 @@ export default {
title: "菜单信息",
// 是否显示弹出层
open: false,
id:null,
toString:[
"status",
"linkType",
"commMenu",
"menuType",
"authType",
],
id: null,
toString: ["status", "linkType", "commMenu", "menuType", "authType"],
// 表单校验
rules: {
}
rules: {},
};
},
created() {
axios.get('/icon.txt')
.then(response => {
this.fileContent = response.data
this.icons = this.fileContent.split('\n')
})
axios.get("/icon.txt").then((response) => {
this.fileContent = response.data;
this.icons = this.fileContent.split("\n");
});
},
methods: {
/** 编辑 */
edit(row, menuOptions) {
this.reset()
this.reset();
this.query = { id: row.id };
this.urls.currUrl =this.pageInfo.editUrl;;
this.urls.currUrl = this.pageInfo.editUrl;
this.getData();
this.menuOptions = menuOptions;
this.title = "修改菜单信息";
},
/** 新增 */
async add(row, menuOptions) {
this.reset()
this.reset();
this.query = { id: row.id };
this.urls.currUrl = this.pageInfo.addUrl;
this.getData();
if(row.id){
this.id=row.id
this.form.parentId=row.id
if (row.id) {
this.id = row.id;
this.form.parentId = row.id;
}
this.menuOptions = menuOptions;
this.title = "新增菜单信息";
......@@ -113,7 +157,7 @@ export default {
/** 查看*/
view(row, menuOptions) {
this.query = { id: row.id };
this.urls.currUrl =this.pageInfo.viewUrl;;
this.urls.currUrl = this.pageInfo.viewUrl;
this.getData();
this.menuOptions = menuOptions;
this.title = "菜单信息详细";
......@@ -124,8 +168,8 @@ export default {
},
/**获取数据后弹框 */
afterRender(data) {
if(this.id){
this.form.parentId=this.id
if (this.id) {
this.form.parentId = this.id;
}
this.open = true;
},
......@@ -148,21 +192,21 @@ export default {
// 表单重置
reset() {
this.form = {
name : '',
url : '',
ancestors : '',
parentId : 0,
orderId : 1,
status : 1,
linkType : 0,
groupId : 1,
groupName : '',
imgPath : '',
buttonImgPath : '',
imgCommPath : '',
commMenu : 0,
menuType : 0,
authType : 3,
name: "",
url: "",
ancestors: "",
parentId: 0,
orderId: 1,
status: 1,
linkType: 0,
groupId: 1,
groupName: "",
imgPath: "",
buttonImgPath: "",
imgCommPath: "",
commMenu: 0,
menuType: 0,
authType: 3,
};
this.resetForm("form");
},
......@@ -195,10 +239,10 @@ export default {
box-shadow: none;
}
.el-radio-button__orig-radio:checked+.el-radio-button__inner {
.el-radio-button__orig-radio:checked + .el-radio-button__inner {
background: rgba(0, 0, 0, 0);
border: 1px solid #3E7BFA !important;
color: #3E7BFA;
border: 1px solid #3e7bfa !important;
color: #3e7bfa;
line-height: 14px;
outline: none;
box-shadow: none;
......
<template>
<div className="page">
<LayoutTable notPagination ref="layoutTable" :data="tableData" :config="tableConfig"/>
<dialog-show ref="dialogform" @ok="getData"/>
<div class="page">
<LayoutTable
notPagination
ref="layoutTable"
:data="tableData"
:config="tableConfig"
/>
<dialog-show ref="dialogform" @ok="getData" />
</div>
</template>
<script>
import {handleTree} from "@/assets/utils/table";
import { handleTree } from "@/assets/utils/table";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import table from "@/assets/mixins/table";
......@@ -16,17 +20,17 @@ import dialogShow from "./dialogshow";
export default {
name: "Menu",
mixins: [table],
components: {Treeselect, dialogShow},
components: { Treeselect, dialogShow },
created() {
this.query={"page":1,"size":-1}
this.query = { page: 1, size: -1 };
},
methods: {
afterRender(data) {
console.log(data)
console.log(data);
data.data = handleTree(data.data, "id", "parentId");
console.log("tree data:",data.data)
console.log("tree data:", data.data);
this.menuOptions = data.data;
this.$refs.layoutTable.showType = "treetable"
this.$refs.layoutTable.showType = "treetable";
},
handleUp(data) {
......@@ -47,25 +51,25 @@ export default {
id: id,
type: type,
})
.then((res) => {
if (res && res.code && res.code == 1) {
this.getData()
this.loading = false;
this.$message.success("更新排序成功!");
}
})
.catch((error) => {
.then((res) => {
if (res && res.code && res.code == 1) {
this.getData();
this.loading = false;
this.$message.error(error.message);
});
this.$message.success("更新排序成功!");
}
})
.catch((error) => {
this.loading = false;
this.$message.error(error.message);
});
},
handleAdd(row) {
this.$refs.dialogform.add(row, this.menuOptions);
},
handleRowClick(row){
console.log(row)
handleRowClick(row) {
console.log(row);
//if(row.children || row.children.length === 0) return ;
//this.$refs.layoutTable.toggleRowExpansion(row,true)
},
......@@ -77,17 +81,17 @@ export default {
/** 重写编辑方法 */
toEdit(row) {
this.loading = true;
this.$post(this.pageInfo.exclude, {id: row.id})
.then((res) => {
if (res && res.code && res.code == 1) {
this.menuOptions = handleTree(res.data.data);
this.$refs.dialogform.edit(row, this.menuOptions);
this.loading = false;
}
})
.catch((error) => {
this.$message.error(error.message);
});
this.$post(this.pageInfo.exclude, { id: row.id })
.then((res) => {
if (res && res.code && res.code == 1) {
this.menuOptions = handleTree(res.data.data);
this.$refs.dialogform.edit(row, this.menuOptions);
this.loading = false;
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
/** 重写查看方法 */
toView(row) {
......@@ -96,24 +100,25 @@ export default {
// 展示菜单图标
showIcon(row, column) {
return <i class={'el-icon-'+row.imgPath}></i>
return <i class={"el-icon-" + row.imgPath}></i>;
},
// 操作菜单状态
changeStatus(row, column) {
return (
<my-switch
confirm
url='/menu/save'
row={row}
onChange={this.statusChange}
value={this.tableData.data}
onInput={(data)=>{
this.tableData.data = data;
}}/>
)
<my-switch
confirm
url="/menu/save"
row={row}
onChange={this.statusChange}
value={this.tableData.data}
onInput={(data) => {
this.tableData.data = data;
}}
/>
);
},
statusChange() {
this.$store.dispatch('login');
this.$store.dispatch("login");
},
},
data() {
......@@ -125,41 +130,41 @@ export default {
search: [],
columns: [
{
type: 'selection',
type: "selection",
width: 60,
},
{
prop: 'id',
label: 'ID',
prop: "id",
label: "ID",
width: 120,
},
{
prop: 'name',
label: '名称',
prop: "name",
label: "名称",
width: 160,
},
{
prop: 'imgPath',
label: '图标',
prop: "imgPath",
label: "图标",
width: 50,
formatter: this.showIcon,
},
{
prop: 'authType',
label: '权限类型',
prop: "authType",
label: "权限类型",
formatter: this.formatter,
},
{
prop: 'parentId',
label: '父ID',
prop: "parentId",
label: "父ID",
},
{
prop: 'url',
label: '地址',
prop: "url",
label: "地址",
},
{
prop: 'status',
label: '状态',
prop: "status",
label: "状态",
width: 100,
formatter: this.changeStatus,
},
......@@ -183,51 +188,50 @@ export default {
{
label: "操作",
width: 280,
formatter: row => {
formatter: (row) => {
return (
<div>
<el-link
style="margin-right:5px;margin-left:5px"
icon="el-icon-top"
onClick={() => {
this.handleUp(row);
}}
></el-link>
<div>
<el-link
style="margin-right:5px;margin-left:5px"
icon="el-icon-top"
onClick={() => {
this.handleUp(row);
}}
></el-link>
<el-link
style="margin-right:5px;margin-left:5px"
icon="el-icon-bottom"
onClick={() => {
this.handleDown(row);
}}
<el-link
style="margin-right:5px;margin-left:5px"
icon="el-icon-bottom"
onClick={() => {
this.handleDown(row);
}}
></el-link>
></el-link>
<el-button
size="mini"
type="text"
icon="el-icon-edit-outline"
onClick={() => {
this.handleAdd(row);
}}
>
新增
</el-button>
<table-buttons
noAdd
noView
row={row}
onEdit={this.toEdit}
onView={this.toView}
onDel={this.toDel}
/>
</div>
<el-button
size="mini"
type="text"
icon="el-icon-edit-outline"
onClick={() => {
this.handleAdd(row);
}}
>
新增
</el-button>
<table-buttons
noAdd
noView
row={row}
onEdit={this.toEdit}
onView={this.toView}
onDel={this.toDel}
/>
</div>
);
}
}
]
}
},
},
],
},
};
}
},
};
</script>
......@@ -17,7 +17,8 @@ module.exports = {
hot: true,//自动保存
proxy: {
'/refined': {
target: 'http://127.0.0.1:21080',
target: 'http://112.19.80.237:11080/',
// target: 'http://127.0.0.1:21080',
changeOrigin: true,
secure: false,
cookieDomainRewrite: 'localhost',
......
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