Commit ee133425 by liimin

接口联调

1 parent 9f65342f
......@@ -117,6 +117,7 @@
// [布局] 顶栏
.d2-theme-header {
transition: .1s ease;
// logo区域
.logo-group {
transition: width .3s;
......@@ -283,7 +284,7 @@
flex-direction: column;
overflow: hidden;
.d2-container-full__header {
padding: 20px;
padding: 12px 20px 0 20px;
}
.d2-container-full__body {
flex-grow: 1;
......
......@@ -66,6 +66,9 @@
.d2-theme-header-logo{
background-color: $theme-header-logo-background-color
}
.header-datetime{
color:$theme-header-item-color
}
// 顶栏菜单空间不足时显示的滚动控件
.d2-theme-header-menu {
.d2-theme-header-menu__prev, .d2-theme-header-menu__next {
......
......@@ -84,7 +84,8 @@ export default {
curBtns.forEach(btn =>
__aBtns.push(h('el-button', {
props: {
type: btn.type || 'text'
type: btn.type || 'text',
icon: btn.icon?`el-icon-${btn.icon}`:''
},
style: {
color: btn.color
......
<template>
<div class="d2-container-full">
<div v-if="$slots.header" class="d2-container-full__header" ref="header">
<slot name="header"/>
<div v-if="$slots.header" class="d2-container-full__header" ref="header" :class="this.active?'active':'close'">
<slot name="header" />
<d2-header-switch />
</div>
<div class="d2-container-full__body" ref="body">
<slot/>
<slot />
</div>
<div v-if="$slots.footer" class="d2-container-full__footer" ref="footer">
<slot name="footer"/>
<slot name="footer" />
</div>
</div>
</template>
<script>
import scroll from './mixins/normal'
import scroll from "./mixins/normal";
import {mapState} from 'vuex'
export default {
name: 'd2-container-full',
mixins: [
scroll
],
mounted () {
name: "d2-container-full",
mixins: [scroll],
components: {
d2HeaderSwitch: () => import("./d2-header-switch.vue")
},
data() {
return {
oHeaderStyle: {
padding: "20px 20px 0 20px"
}
};
},
computed: {
active() {
return this.$store.state.d2admin.tsearch.active
}
},
mounted() {
// 增加滚动事件监听
this.addScrollListener()
this.addScrollListener();
},
beforeDestroy () {
beforeDestroy() {
// 移除滚动事件监听
this.removeScrollListener()
this.removeScrollListener();
}
}
};
</script>
<style lang="scss">
.d2-container-full {
.d2-container-full__header {
position: relative;
transition: .1s linear;
&.active{
// border-bottom: '1px solid #DCDFE6';
// height: auto;
}
&.close{
height: 0;
padding: 0 20px 0 20px !important;
form{
opacity: 0;
}
border-bottom-color:rgba(0,0,0,0) !important;
}
.el-form-item{
margin-bottom: 16px;
}
}
}
</style>
\ No newline at end of file
<template>
<div
v-if="show"
class="d2-header-switch"
:class="{ 'd2-header-switch--active': isActive }"
@click="handleClick">
<li :class="$store.state.d2admin.tsearch.active?'fa fa-compress':'fa fa-expand'"></li>
</div>
</template>
<script>
import { last, get } from 'lodash'
import { mapMutations } from 'vuex'
export default {
data () {
return {
isActive: false,
path: ''
}
},
computed: {
show () {
return true
}
},
mounted () {
setTimeout(() => this.isActive = true, 0)
},
methods: {
...mapMutations('d2admin/tsearch',['toggle']),
// 点击按钮的时候跳转到源代码
handleClick () {
this.toggle()
}
}
}
</script>
<style lang="scss" scoped>
.d2-header-switch {
$borderRadius: 30px;
$paddingLR: 30px;
$paddingTB: 2px;
$fontSize: 12px;
$rightOuter: $paddingLR / 2;
opacity: 0;
position: absolute;
z-index: 2019;
right: 20%;
bottom: -17px;
font-size: $fontSize;
line-height: $fontSize;
font-weight: bold;
border-radius: 0 0 $borderRadius $borderRadius;
padding: $paddingTB $paddingLR;
background-color: rgba(#fff, 1);
border: 1px solid #DCDFE6;
border-top: none;
color: #606266;
transition: all .3s;
@extend %unable-select;
&.d2-header-switch--active {
opacity: 1;
}
&:hover {
// right: - $borderRadius;
// background-color: rgba(#000, .1);
}
}
</style>
<template>
<i class="fa" :class="`fa-${name}`" aria-hidden="true"></i>
<div>
<i class="fa" v-if="isFa" :class="`fa-${name}`" aria-hidden="true"></i>
<i v-else :class="`el-icon-${name}`" aria-hidden="true"></i>
</div>
</template>
<script>
......@@ -11,6 +14,11 @@ export default {
type: String,
required: false,
default: 'font-awesome'
},
isFa: {
type: Boolean,
required: false,
default: true
}
}
}
......
......@@ -2,7 +2,7 @@
* @Author: limin
* @Date: 2019-09-06 10:11:24
* @Last Modified by: limin
* @Last Modified time: 2019-09-06 13:30:14
* @Last Modified time: 2019-09-08 19:26:56
*/
const dateFormat = (dateStr, time) => {
// 得到特定的时间
......@@ -20,7 +20,6 @@ const dateFormat = (dateStr, time) => {
} else if (time && time.toLowerCase() === 'hh:mm:ss') {
return `${hh}:${mm}:${ss}`
} else {
console.log(1)
return `${year}-${month}-${day} ${hh}:${mm}:${ss}`
}
}
......
<template>
<div class="header-datetime">{{time}}</div>
</template>
<script>
import dayjs from "dayjs";
const sFormat ="YYYY年MM月DD日"
export default {
name: 'd2-header-datetime',
data () {
return {
timeInterval: null,
time: dayjs().format(sFormat),
}
},
mounted () {
// this.timeInterval = setInterval(() => this.refreshTime(), 1000);
},
beforeDestroy() {
clearInterval(this.timeInterval);
},
methods: {
refreshTime() {
this.time = dayjs().format(sFormat);
}
}
}
</script>
<style lang="scss">
.header-datetime{
font-weight: bold;
transform: translateX(-30px);
}
</style>
......@@ -11,7 +11,7 @@
</el-dropdown-menu>
</el-dropdown>-->
<div v-popover:popover-personal class="d2-mr personal-wrap">
<span class="btn-text">{{info.userName ? `${info.userName}` : '未登录'}}</span>
<span class="btn-text">{{info && info.userName ? `${info.userName}` : '未登录'}}</span>
<el-popover ref="popover-personal" placement="bottom-end" trigger="hover">
<personal-panel :user="info"></personal-panel>
</el-popover>
......
......@@ -2,7 +2,7 @@
export function elMenuItem (createElement, menu) {
return createElement('el-menu-item', { props: { index: menu.path } }, [
...menu.icon ? [
createElement('i', { attrs: { class: `fa fa-${menu.icon}` } })
createElement('i', { attrs: { class: `el-icon-${menu.icon}` } })
] : [],
...menu.icon === undefined & !menu.iconSvg ? [
createElement('i', { attrs: { class: 'fa fa-file-o' } })
......@@ -18,7 +18,7 @@ export function elMenuItem (createElement, menu) {
export function elSubmenu (createElement, menu) {
return createElement('el-submenu', { props: { index: menu.path } }, [
...menu.icon ? [
createElement('i', { slot: 'title', attrs: { class: `fa fa-${menu.icon}` } })
createElement('i', { slot: 'title', attrs: { class: `el-icon-${menu.icon}` } })
] : [],
...menu.icon === undefined & !menu.iconSvg ? [
createElement('i', { slot: 'title', attrs: { class: 'fa fa-file-o' } })
......
<template>
<div class="personal">
<div class="personal-panel">
<div class="personal-desc">
<div class="personal-desc" v-if="user">
<div class="avatar-container">
<el-avatar
:size="'large'"
......@@ -9,7 +9,7 @@
></el-avatar>
</div>
<div class="name-role">
<span class="sender">{{ user.userName }} - {{ ['超级管理员','管理员'][user.roleType] }}</span>
<span class="sender">{{ user.userName }} - {{ ['超级管理员','管理员'][+user.roleType] }}</span>
</div>
<div class="registe-info">
<span class="registe-info">
......
......@@ -8,7 +8,7 @@
:append-to-body="true"
width="600px"
>
<el-form label-width="120px" :model="user">
<el-form v-if="user" label-width="120px" :model="user">
<el-form-item label="用户名:" prop="loginName">
<el-input disabled v-model="user.loginName"></el-input>
</el-form-item>
......
......@@ -23,12 +23,13 @@
<d2-menu-header flex-box="1"/>
<!-- 顶栏右侧 -->
<div class="d2-header-right" flex-box="0">
<d2-header-datetime />
<!-- 如果你只想在开发环境显示这个按钮请添加 v-if="$env === 'development'" -->
<d2-header-search @click="handleSearchClick"/>
<d2-header-log v-if="$env === 'development'"/>
<d2-header-size/>
<!-- <d2-header-log v-if="$env === 'development'"/> -->
<!-- <d2-header-size/> -->
<d2-header-fullscreen/>
<d2-header-locales v-if="$env === 'development'"/>
<!-- <d2-header-locales v-if="$env === 'development'"/> -->
<d2-header-theme/>
<d2-header-color/>
<d2-header-user/>
......@@ -93,6 +94,7 @@ import d2HeaderUser from './components/header-user'
import d2HeaderLog from './components/header-log'
import d2HeaderColor from './components/header-color'
import hamburger from './components/hamburger'
import d2HeaderDatetime from './components/header-datetime'
import { mapState, mapGetters, mapActions } from 'vuex'
import mixinSearch from './mixins/search'
export default {
......@@ -112,7 +114,8 @@ export default {
d2HeaderUser,
d2HeaderLog,
d2HeaderColor,
hamburger
hamburger,
d2HeaderDatetime
},
data () {
return {
......@@ -162,8 +165,17 @@ export default {
<style lang="scss">
// 注册主题
@import '~@/assets/style/theme/register.scss';
@keyframes lightflow {
90% {
left: -300px; /*起始位置*/
}
100% {
left: 300px; /*结束位置*/
}
}
.d2-theme-header-logo{
}
.logo-all{
width: 200px;
img{
......
......@@ -2,7 +2,7 @@
* @Author: limin
* @Date: 2019-08-27 19:16:26
* @Last Modified by: limin
* @Last Modified time: 2019-09-06 13:48:13
* @Last Modified time: 2019-09-08 12:02:47
*/
import { cloneDeep } from 'lodash'
const permision = {}
......@@ -26,7 +26,7 @@ permision.packRoutesBtns = function (resources, idsInPermision) {
} else { // 如果取不到 判断是否有父节点 并且父节点是否有auth属性 有 则视为按钮 (同样可以定义标识变量)
__objResource = resources[obj.parentId]
if (__objResource && __objResource.auth) {
__obj = __objResource.auth.find(o => o.authId === obj.authId)
__obj = __objResource.auth.find(o => o.authId == obj.authId)
if (__oBtnInPermision[obj.parentId] && __oBtnInPermision[obj.parentId].length) {
__oBtnInPermision[obj.parentId].push(__obj)
} else {
......@@ -62,7 +62,7 @@ permision.packAsideMenus = function (resources, idsInPermision) {
if (!__oMenu) { // 不存在 可能是 按钮 直接继续循环
return true
}
if (obj.parentId === '0') { // 取出1级菜单
if (obj.parentId == '0') { // 取出1级菜单
__aMenusInPermision.push(__oMenu)
} else { // 取出子菜单
__aSub.push(__oMenu)
......@@ -73,7 +73,7 @@ permision.packAsideMenus = function (resources, idsInPermision) {
*/
let __parent = null
__aSub.forEach(obj => {
__parent = __aMenusInPermision.find(menu => menu.authId === obj.parentId)
__parent = __aMenusInPermision.find(menu => menu.authId == obj.parentId)
if (__parent.children) {
__parent.children.push(obj)
} else {
......
......@@ -18,6 +18,7 @@ function errorCreate (msg) {
throw error
}
// 记录和显示错误
function errorLog (error) {
// 添加到日志
......@@ -79,16 +80,13 @@ service.interceptors.request.use(
Promise.reject(error)
}
)
// 响应拦截器
service.interceptors.response.use(
response => {
// dataAxios 是 axios 返回数据中的 data
const dataAxios = response.data
// 这个状态码是和后端约定的
const {
code, data
} = dataAxios
const { code, data } = dataAxios
// 有 code 代表这是一个后端接口 可以进行进一步的判断
switch (+code) {
case 0:
......@@ -100,6 +98,7 @@ service.interceptors.response.use(
break
}
},
error => {
if (error && error.response) {
switch (error.response.status) {
......
......@@ -20,7 +20,7 @@ const frameIn = [{
export const home = {
path: 'index',
name: 'index',
icon: 'desktop',
icon: 'monitor',
meta: {
auth: true,
title: '系统监控',
......@@ -34,7 +34,8 @@ export const home = {
label: '导出',
type: 'button',
category: 'Button',
handle: 'exportFile'
handle: 'exportFile',
icon:'download'
}]
}
export const sys = [
......@@ -70,7 +71,7 @@ export const sys = [
export const resources = {
'102': {
path: '/trafficManagement',
icon: 'train',
icon: 'truck',
name: '车辆管理',
meta: {
auth: true,
......@@ -95,12 +96,13 @@ export const resources = {
label: '添加车辆',
category: 'Button',
type: 'button',
handle: 'handleEdit'
handle: 'handleEdit',
icon:'plus'
}]
},
'103': {
path: '/subSysManagement',
icon: 'th-list',
icon: 'cpu',
name: '子系统管理',
meta: {
auth: true,
......@@ -125,12 +127,13 @@ export const resources = {
label: '添加子系统',
category: 'Button',
type: 'button',
handle: 'handleEdit'
handle: 'handleEdit',
icon:'plus'
}]
},
'104': {
path: '/deviceManagement',
icon: 'train',
icon: 'takeaway-box',
name: '物料管理',
meta: {
auth: true,
......@@ -155,19 +158,21 @@ export const resources = {
label: '导出',
type: 'button',
category: 'Button',
handle: 'exportFile'
handle: 'exportFile',
icon:'download'
}, {
authId: '10404',
parentId: '104',
label: '导入',
type: 'button',
category: 'Button'
category: 'Button',
icon:'upload2'
}]
},
'105': {
path: 'materialList',
icon: 'folder-o',
icon: 'file-text-o',
icon: 'tickets',
name: '物料列表',
meta: {
auth: true,
......@@ -179,7 +184,7 @@ export const resources = {
},
'106': {
path: '/bb',
icon: 'file-text-o',
icon: 'document',
name: '单据管理',
meta: {
auth: true,
......@@ -190,7 +195,7 @@ export const resources = {
},
'10601': {
path: '/materiaOrderManagement',
icon: 'archive',
icon: 'document-copy',
name: '物料订单管理',
meta: {
auth: true,
......@@ -215,12 +220,13 @@ export const resources = {
label: '订单下载',
category: 'Button',
type: 'button',
handle: 'exportFile'
handle: 'exportFile',
icon:'download'
}]
},
'10602': {
path: '/maintainManagement',
icon: 'list-ol',
icon: 'finished',
name: '作业单管理',
meta: {
auth: true,
......@@ -240,12 +246,13 @@ export const resources = {
label: '导出订单',
category: 'Button',
type: 'button',
handle: 'exportOrder'
handle: 'exportOrder',
icon:'download'
}]
},
'107': {
path: '/users',
icon: 'users',
icon: 'user',
name: '帐号管理',
meta: {
auth: true,
......@@ -257,7 +264,7 @@ export const resources = {
'10701': {
path: '/user',
name: '用户管理',
icon: 'user',
icon: 'user-solid',
meta: {
auth: true,
title: '用户管理',
......@@ -301,14 +308,15 @@ export const resources = {
label: '创建用户',
category: 'action',
type: 'button',
handle: 'handleRegister'
handle: 'handleRegister',
icon:'plus'
}],
component: _import('userManage/user')
},
'10702': {
path: '/role',
name: '权限管理',
icon: 'sitemap',
icon: 'open',
meta: {
auth: true,
title: '权限管理',
......@@ -320,7 +328,8 @@ export const resources = {
parentId: '10702',
label: '创建角色',
handle: 'handleEdit',
type: 'button'
type: 'button',
icon:'plus'
}, {
authId: '1070202',
parentId: '10702',
......@@ -333,7 +342,7 @@ export const resources = {
'10703': {
path: '/loginLogs',
name: '登录日志',
icon: 'file-text',
icon: 'tickets',
meta: {
auth: true,
title: '登录日志',
......@@ -344,7 +353,7 @@ export const resources = {
},
'108': {
path: '/reportingLogs',
icon: 'upload',
icon: 'upload2',
name: '上报日志',
meta: {
auth: true,
......@@ -359,7 +368,8 @@ export const resources = {
label: '导出',
category: 'Button',
type: 'button',
handle: 'handleExport'
handle: 'handleExport',
icon:'download'
}]
}
}
......
......@@ -2,7 +2,7 @@ import util from '@/libs/util.js'
import { cloneDeep } from 'lodash'
import { AccountLogin } from '@api/sys.account'
import { SUPPER_ADMIN } from '@/common/constants'
import { resources as sources, home } from '@/router/routes'
import { localRoutes } from '@/router/routes'
export default {
namespaced: true,
actions: {
......@@ -24,16 +24,16 @@ export default {
// token 代表用户当前登录状态 建议在网络请求中携带 token
// 如有必要 token 需要定时更新,默认保存一天
util.cookies.set('uuid', data.loginName)
const authes = data.roleType === SUPPER_ADMIN
? util.permision.flatten(Object.values({ ...sources, [home.meta.authId]: home }))
.map(obj => ({ authId: obj.authId, parentId: obj.parentId }))
: cloneDeep(data.authes) && delete data.authes
const authes = (data.roleType == SUPPER_ADMIN)?
util.permision.flatten(Object.values(localRoutes))
.map(obj => ({ authId: obj.authId, parentId: obj.parentId }))
: cloneDeep(data.authes)
await dispatch('d2admin/auth/set', authes, { root: true })
// 设置 vuex 用户信息
// // 设置 vuex 用户信息
await dispatch('d2admin/user/set', data, { root: true })
// 强制初始化基础数据
// // 强制初始化基础数据
dispatch('d2admin/base/init', null, { root: true })
// 用户登录后从持久化数据加载一系列的设置
// // 用户登录后从持久化数据加载一系列的设置
await dispatch('load')
// 结束
resolve()
......
......@@ -2,11 +2,11 @@
* @Author: limin
* @Date: 2019-08-27 17:25:12
* @Last Modified by: limin
* @Last Modified time: 2019-09-06 13:12:51
* @Last Modified time: 2019-09-08 12:48:44
*/
import util from '@/libs/util.js'
import router from '@/router'
import { localRoutes, home, frameInRoutes, sys } from '@/router/routes'
import { localRoutes, frameInRoutes, sys } from '@/router/routes'
export default {
namespaced: true,
state: {
......@@ -119,7 +119,7 @@ export default {
const __source = await dispatch('load')
// 过滤资源点 并动态添加到路由
const { route, btn } = util.permision.packRoutesBtns(localRoutes, __source)
frameInRoutes[0].children = [home, ...route, ...sys]
frameInRoutes[0].children = [...route, ...sys]
router.addRoutes(frameInRoutes)
state.btns = btn
await commit('d2admin/page/init', frameInRoutes, { root: true })
......
export default {
namespaced: true,
state: {
// 列表搜索框状态
active: true
},
mutations: {
/**
* @description 切换状态
* @param {Object} state state
*/
toggle (state) {
state.active = !state.active
},
/**
* @description 设置搜索框状态
* @param {Object} state state
* @param {Boolean} active active
*/
set (state, active) {
state.active = active
}
}
}
......@@ -5,6 +5,7 @@
:inline="true"
:model="searchForm"
label-width="85px"
slot="header"
>
<el-form-item label="物料">
<el-input v-model="searchForm.keyWord" placeholder="请输入物料代码/编码/名称" clearable></el-input>
......@@ -20,7 +21,7 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<el-row style="height: 40px; line-height: 40px">
......
......@@ -5,6 +5,7 @@
:inline="true"
:model="searchForm"
label-width="100px"
slot="header"
>
<el-form-item
v-for="(item, index) in searchFormArr"
......@@ -40,7 +41,7 @@
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<el-row style="height: 40px; line-height: 40px">
......@@ -67,7 +68,7 @@
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
:width="item.width||200"
align="center"
>
<template slot-scope="scope">
......@@ -82,6 +83,8 @@
<el-table-column
align="center"
label="操作"
fixed="right"
width="100"
>
<template slot-scope="scope">
<auth-button
......@@ -245,7 +248,8 @@ export default {
}
}, {
label: '故障描述',
prop: 'downDescription'
prop: 'downDescription',
width:'300'
}, {
label: '处理方式',
prop: 'treatment',
......@@ -352,8 +356,7 @@ export default {
params.selectEndTime = params.createTime[1] ? params.createTime[1] + ' ' + '23:59:59' : ''
delete params.createTime
exportApi(params).then(res => {
console.log(res)
window.location.href = res.url
this.$open(res.url)
notice.okTips()
}).catch(err => {
notice.errorTips()
......@@ -368,14 +371,12 @@ export default {
// 页码
handleSizeChange (value) {
console.log(value)
this.pageSize = value
// 调接口
this.loadingGetList()
},
handleCurrentChange (value) {
console.log(value)
this.currentPage = value
// 调接口
this.loadingGetList()
......
......@@ -6,9 +6,9 @@
:title="title"
:before-close="handleClose"
width="800px"
>
>
<!-- <embed src="file:///D:/project需求/高铁/物料申请单_20190830150550.pdf" width="100%" height="800px"></embed> -->
<iframe width="100%" height="800px" scrolling="yes" frameborder="0" :src="pdfUrl"></iframe>
<iframe width="100%" height="680px" scrolling="yes" frameborder="0" :src="pdfUrl"></iframe>
<!-- <iframe width="100%" height="550px" scrolling="yes" frameborder="0" src="https://pan.baidu.com/s/1Juauwf2c5nkNZuj6rc0W0Q"></iframe> -->
<!-- <embed width="100%" height="800px" src="https://web.stanford.edu/~xgzhou/zhou_book2017.pdf"> -->
</el-dialog>
......@@ -41,8 +41,13 @@ export default {
}
</script>
<style>
.detailDialog .el-dialog__body {
padding: 0 20px;
}
<style lang="scss">
.detailDialog{
.el-dialog__header,
.el-dialog__body {
padding: 0;
padding: 0;
background-color: #202223
}
}
</style>
......@@ -5,6 +5,7 @@
:inline="true"
:model="searchForm"
label-width="85px"
slot="header"
>
<el-form-item label="订单编号">
<el-input v-model="searchForm.orderCode" placeholder="请输入订单编号" clearable></el-input>
......@@ -38,7 +39,7 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<el-row style="height: 40px; line-height: 40px">
......@@ -244,9 +245,8 @@ export default {
params.endTime = params.createTime ? params.createTime[1] + ' ' + '23:59:59' : ''
delete params.createTime
exportApi(params).then(res => {
console.log(res)
window.location.href = res.url
notice.okTips()
this.$open(res.url)
// notice.okTips()
}).catch(err => {
notice.errorTips()
})
......@@ -280,12 +280,12 @@ export default {
// 表格-查看详情
handleDetail (row) {
console.log(row)
detailApi({
downloadApi({
orderCode: row.orderCode
}).then(res => {
console.log(res)
this.dialogTitle = row.orderType
this.pdfUrl = res.signatureUrl
this.pdfUrl = res.url
this.detailVisible = !this.detailVisible
}).catch(err => {
notice.errorTips()
......
......@@ -5,12 +5,13 @@
:inline="true"
:model="searchForm"
label-width="85px"
slot="header"
>
<el-form-item label="物料">
<el-input v-model="searchForm.keyWord" placeholder="请输入物料代码/编码/名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<el-row style="height: 40px; line-height: 40px">
......
......@@ -5,6 +5,7 @@
:inline="true"
:model="searchForm"
label-width="85px"
slot="header"
>
<el-form-item label="上报时间">
<el-date-picker
......@@ -32,7 +33,7 @@
<el-input v-model="searchForm.subSystemCode" placeholder="请输入子系统编号" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<el-row style="height: 40px; line-height: 40px">
......
......@@ -5,6 +5,7 @@
:inline="true"
:model="searchForm"
label-width="85px"
slot="header"
>
<el-form-item label="子系统编号">
<el-input v-model="searchForm.subsystemCode" placeholder="请输入子系统编号" clearable></el-input>
......@@ -25,7 +26,7 @@
<el-input v-model="searchForm.merchantName" placeholder="请输入生产厂家" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<el-row style="height: 40px; line-height: 40px">
......@@ -53,7 +54,7 @@
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
:width="item.width||160"
align="center"
>
<template slot-scope="scope">
......@@ -68,6 +69,7 @@
<el-table-column
align="center"
label="操作"
fix="right"
>
<template slot-scope="scope">
<auth-button
......@@ -159,7 +161,8 @@ export default {
prop: 'trafficCode'
}, {
label: '生产厂家',
prop: 'merchantName'
prop: 'merchantName',
width:'220'
}, {
label: '发送结点序列',
prop: 'sendSequence'
......@@ -264,20 +267,17 @@ export default {
/* 接口请求-end */
// 搜索
handleSearch () {
console.log(this.searchForm)
this.loadingGetList()
},
// 页码
handleSizeChange (value) {
console.log(value)
this.pageSize = value
// 调接口
this.loadingGetList()
},
handleCurrentChange (value) {
console.log(value)
this.currentPage = value
// 调接口
this.loadingGetList()
......@@ -300,7 +300,6 @@ export default {
},
handleEditConfirm () {
console.log(JSON.parse(JSON.stringify(this.editForm)))
var editParams = JSON.parse(JSON.stringify(this.editForm))
this.editSubSystem(this.editForm)
},
......
......@@ -95,7 +95,7 @@ export default {
time: dayjs().format("HH:mm:ss"),
// 表单
formLogin: {
loginName: "test0001",
loginName: 'test0001',//"limin3",
password: "123456",
loginType: LOGIN_TYPE
},
......
......@@ -60,7 +60,7 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<el-row style="height: 40px; line-height: 40px">
......
......@@ -5,6 +5,7 @@
:inline="true"
:model="searchForm"
label-width="85px"
slot="header"
>
<el-form-item label="车辆编号">
<el-input v-model="searchForm.trafficCode" placeholder="请输入车辆编号" clearable></el-input>
......@@ -30,7 +31,7 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<el-row style="height: 40px; line-height: 40px">
......@@ -233,7 +234,6 @@ export default {
}
!value.id ? delete params.id : delete params.trafficCode
params.method = value.id ? methods.Edit : methods.Add
// console.log(params)
editApi(params).then(res => {
this.handleEditClose()
notice.okTips()
......@@ -245,7 +245,6 @@ export default {
/* 接口请求-end */
// 搜索
handleSearch () {
console.log(this.searchForm)
this.loadingGetList()
},
......
......@@ -5,6 +5,7 @@
:inline="true"
:model="searchForm"
label-width="85px"
slot="header"
>
<el-form-item label="用户">
<el-input v-model="searchForm.userName" placeholder="请输入用户名/姓名/联系电话" clearable></el-input>
......@@ -26,7 +27,7 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<el-row style="height: 40px; line-height: 40px">
......@@ -85,7 +86,8 @@ export default {
tableData: [],
tableColumns: [{
label: '登录时间',
prop: 'loginTime'
prop: 'loginTime',
width:'200px'
}, {
label: '登录用户',
prop: 'loginName'
......@@ -94,13 +96,15 @@ export default {
prop: 'userName'
}, {
label: '联系电话',
prop: 'mobile'
prop: 'mobile',
width:'180px'
}, {
label: '登录方式',
prop: 'loginTypeValue'
}, {
label: '登录设备',
prop: 'deviceCode'
prop: 'deviceCode',
width:'300px'
}],
// 页码
currentPage: 1,
......
......@@ -88,7 +88,7 @@
</el-dialog>
</template>
<script>
import { Reg } from '@/api/sys.account'
import { Reg, AccountModify } from '@/api/sys.account'
import { mapActions } from 'vuex'
import notice from '@/common/notice'
import { RegistType } from '@/common/constants'
......@@ -108,7 +108,7 @@ export default {
watch: {
editData: {
handler: function (value) {
this.title = value && value.id ? '编辑用户信息' : '创建用户'
this.title = value && value.userId ? '编辑用户信息' : '创建用户'
Object.assign(this.regForm, value)
},
immediate: true
......@@ -182,7 +182,8 @@ export default {
if (vaild) {
var __p = this.regForm
__p.createType = RegistType.BY_ADMIN
Reg(__p).then(res => {
const fMethod = __p.userId ? AccountModify : Reg
fMethod(__p).then(res => {
const { operateStatus } = res
if (operateStatus) {
notice.okTips(`${this.title}成功!`)
......
<!-- 车辆管理 -->
<template>
<d2-container class="user">
<el-form :inline="true" :model="searchForm" label-width="85px">
<el-form :inline="true" :model="searchForm" label-width="85px" slot="header">
<el-form-item label="用户:">
<el-input v-model="searchForm.userName" placeholder="请输入用户名/姓名/联系电话" clearable></el-input>
</el-form-item>
......@@ -55,7 +55,7 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<el-row style="height: 40px; line-height: 40px">
......@@ -64,7 +64,7 @@
<auth-button category="action" label="创建用户"></auth-button>
</el-col>
</el-row>
<el-table :data="tableData" v-loading="tableLoading" border>
<el-table :data="tableData" v-loading="tableLoading" border >
<el-table-column align="center" width="60px" label="序号" type="index"></el-table-column>
<el-table-column label="用户名" prop="loginName" width="200" align="center" ></el-table-column>
<el-table-column label="角色" prop="roleName" width="140" align="center" ></el-table-column>
......@@ -252,7 +252,7 @@ export default {
// 列表各种操作
async handleOperation (row, e) {
const _actionText = e.target.innerText
const res = await this.apiMapping[_actionText]({ userId: row.id })
const res = await this.apiMapping[_actionText]({ userId: row.userId })
const { operateStatus } = res
if (operateStatus) {
notice.okTips(`${_actionText}成功!`)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!