单点登录

master
xy 3 years ago
parent 86e300b41c
commit 280cef7364

@ -2,6 +2,10 @@
ENV='development' ENV='development'
# base api # base api
VUE_APP_BASE_API=http://diaoling-test.ali251.langye.net/ VUE_APP_BASE_API=http://192.168.60.78:9001/
VUE_APP_UPLOAD_API=http://diaoling-test.ali251.langye.net/api/admin/upload-file VUE_APP_UPLOAD_API=http://192.168.60.78:9001/api/admin/upload-file
VUE_APP_OA_URL=http://suzhouhedaooa.langye.net VUE_APP_OA_URL=http://192.168.60.18:2021
#VUE_APP_BASE_API=http://diaoling-test.ali251.langye.net/
#VUE_APP_UPLOAD_API=http://diaoling-test.ali251.langye.net/api/admin/upload-file
#VUE_APP_OA_URL=http://suzhouhedaooa.langye.net

@ -2,10 +2,10 @@
ENV = 'production' ENV = 'production'
# base api # base api
#VUE_APP_BASE_API=http://192.168.60.99:9005/ VUE_APP_BASE_API=http://192.168.60.78:9001/
#VUE_APP_UPLOAD_API=http://192.168.60.99:9005/api/admin/upload-file VUE_APP_UPLOAD_API=http://192.168.60.78:9001/api/admin/upload-file
#VUE_APP_OA_URL=http://192.168.60.18:2021 VUE_APP_OA_URL=http://192.168.60.18:2021
VUE_APP_BASE_API=http://diaoling-test.ali251.langye.net/ #VUE_APP_BASE_API=http://diaoling-test.ali251.langye.net/
VUE_APP_UPLOAD_API=http://diaoling-test.ali251.langye.net/api/admin/upload-file #VUE_APP_UPLOAD_API=http://diaoling-test.ali251.langye.net/api/admin/upload-file
VUE_APP_OA_URL=http://suzhouhedaooa.langye.net #VUE_APP_OA_URL=http://suzhouhedaooa.langye.net

@ -8,10 +8,11 @@ export function save(data) {
}) })
} }
export function listuser() { export function listuser(params) {
return request({ return request({
url: '/api/admin/admin', url: '/api/admin/admin',
method: 'get' method: 'get',
params
}) })
} }

@ -26,6 +26,15 @@ export function logout(isLoading=false) {
}) })
} }
export function ossLogin(data) {
return request({
url: '/api/admin/auth/oss-login',
method: 'post',
data,
isLoading: false,
})
}
export function getAuthMenu(token,isLoading=false) { export function getAuthMenu(token,isLoading=false) {
return request({ return request({
url: '/api/admin/auth/permissions', url: '/api/admin/auth/permissions',

@ -58,7 +58,19 @@ router.beforeEach(async(to, from, next) => {
} }
} else { } else {
/* has no token*/ /* has no token*/
if (to.query.token && to.query.tp) {
try {
await store.dispatch('user/loginskip', {
token: to.query.token,
tp: to.query.tp
})
next('/')
} catch (e) {
next('/login')
}
return
}
if (whiteList.indexOf(to.path) !== -1) { if (whiteList.indexOf(to.path) !== -1) {
// in the free login whitelist, go directly // in the free login whitelist, go directly
next() next()

@ -1,7 +1,8 @@
import { import {
login, login,
logout, logout,
getInfo getInfo,
ossLogin
} from '@/api/user' } from '@/api/user'
import { import {
getToken, getToken,
@ -42,6 +43,36 @@ const mutations = {
} }
const actions = { const actions = {
loginskip({
commit
}, userInfo) {
const {
token,
tp,
loginId
} = userInfo
return new Promise((resolve, reject) => {
ossLogin({
token: token,
tp: tp,
loginId: loginId
}).then(response => {
//console.log(response)
const {
data
} = response;
console.log(response.access_token)
commit('SET_TOKEN', response.access_token)
setToken(response.access_token)
resolve()
}).catch(error => {
reject(error)
})
})
},
// user login // user login
login({ login({
commit commit

@ -1,8 +1,7 @@
import { show } from "@/api/system/customForm"; import { show } from "@/api/system/customForm";
import { listdept } from "@/api/system/department";
import { getparameter } from "@/api/system/dictionary"; import { getparameter } from "@/api/system/dictionary";
import { index as baseFormIndex } from "@/api/system/baseForm"; import { index as baseFormIndex } from "@/api/system/baseForm";
import { listCommondepartment } from "@/api/common";
export async function resolveFormInfo(customFormId,filterType = 'table') { export async function resolveFormInfo(customFormId,filterType = 'table') {
const res = await show({ id: customFormId }, false); const res = await show({ id: customFormId }, false);
@ -12,7 +11,7 @@ export async function resolveFormInfo(customFormId,filterType = 'table') {
[ [
"departments", "departments",
async () => { async () => {
const res = await listdept(); const res = await listCommondepartment();
return res; return res;
}, },
], ],

@ -35,6 +35,11 @@
<div class="list-item__name"> <div class="list-item__name">
{{ item.equipment_id_equipments_id_relation ? item.equipment_id_equipments_id_relation.name : '' }} {{ item.equipment_id_equipments_id_relation ? item.equipment_id_equipments_id_relation.name : '' }}
</div> </div>
<div class="list-item__content">
<el-tooltip class="item" effect="dark" :content="item.content" placement="top-start">
<span>{{ item.content }}</span>
</el-tooltip>
</div>
<div class="list-item__time"> <div class="list-item__time">
执行时间{{ timeFormat(item.start_time) }}{{ timeFormat(item.end_time,'HH:mm') }} 执行时间{{ timeFormat(item.start_time) }}{{ timeFormat(item.end_time,'HH:mm') }}
</div> </div>
@ -311,16 +316,22 @@ $list-height: calc(#{$container-height} - 5.33rem);
font-size: 1.34rem; font-size: 1.34rem;
flex: 1; flex: 1;
} }
&__content {
flex-basis: 14%;
word-break: keep-all;
text-overflow: ellipsis;
overflow: hidden;
}
&__time { &__time {
flex-basis: 19%; flex-basis: 19%;
text-align: center; text-align: center;
} }
&__last { &__last {
flex-basis: 7%; flex-basis: 6%;
text-align: center; text-align: center;
} }
&__operate { &__operate {
flex-basis: 31%; flex-basis: 30%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -335,6 +346,8 @@ $list-height: calc(#{$container-height} - 5.33rem);
position: relative; position: relative;
$done-color: #ec6a5e;
$doing-color: #7ccac8;
&__cir { &__cir {
width: 2.2rem; width: 2.2rem;
height: 2.2rem; height: 2.2rem;
@ -346,7 +359,7 @@ $list-height: calc(#{$container-height} - 5.33rem);
&-doing { &-doing {
cursor: pointer; cursor: pointer;
transform: scale(.9, .9); transform: scale(.9, .9);
background: #6fc0af; background: $doing-color;
position: relative; position: relative;
@ -355,7 +368,8 @@ $list-height: calc(#{$container-height} - 5.33rem);
width: 132%; width: 132%;
height: 132%; height: 132%;
border-radius: 100%; border-radius: 100%;
background: #6fc0af65; opacity: 0.4;
background: $doing-color;
transform: translate(-50%,-50%); transform: translate(-50%,-50%);
animation: scale infinite ease-out 4s; animation: scale infinite ease-out 4s;
@ -373,7 +387,7 @@ $list-height: calc(#{$container-height} - 5.33rem);
} }
} }
&-done { &-done {
background: #7ccac8; background: $done-color;
} }
} }
&__line { &__line {
@ -385,7 +399,7 @@ $list-height: calc(#{$container-height} - 5.33rem);
left: 50%; left: 50%;
&-done { &-done {
background: #7ccac8; background: $done-color;
} }
} }

@ -1,10 +1,10 @@
<template> <template>
<div> <div>
<el-drawer title=" " <el-drawer title="已完成调令"
:modal="false" :modal="false"
:visible.sync="drawer" :visible.sync="drawer"
direction="rtl" direction="rtl"
size="74%"> size="76%">
<div class="container"> <div class="container">
<div class="header"> <div class="header">
<p>已完成</p> <p>已完成</p>
@ -12,44 +12,54 @@
</div> </div>
<el-scrollbar ref="elScrollbar" class="scrollbar-wrapper"> <el-scrollbar ref="elScrollbar" class="scrollbar-wrapper">
<div class="list"> <template v-if="done && done.length > 0">
<div v-for="(item, index) in done" :key="item.id" ref="listItem" class="list-item"> <div class="list">
<!-- <div class="list-item__status">--> <div v-for="(item, index) in done" :key="item.id" ref="listItem" class="list-item">
<!-- <template v-if="timeStatusFormat(item) === 2">--> <!-- <div class="list-item__status">-->
<!-- <div class="list-item__status-2"></div>--> <!-- <template v-if="timeStatusFormat(item) === 2">-->
<!-- <p>存在执行中指令</p>--> <!-- <div class="list-item__status-2"></div>-->
<!-- </template>--> <!-- <p>存在执行中指令</p>-->
<!-- <template v-else-if="timeStatusFormat(item) === 3">--> <!-- </template>-->
<!-- <div class="list-item__status-3"></div>--> <!-- <template v-else-if="timeStatusFormat(item) === 3">-->
<!-- <p>倒计时{{ $moment(item.start_time).diff($moment(time),'minutes') }}分钟</p>--> <!-- <div class="list-item__status-3"></div>-->
<!-- </template>--> <!-- <p>倒计时{{ $moment(item.start_time).diff($moment(time),'minutes') }}分钟</p>-->
<!-- <template v-else-if="timeStatusFormat(item) === 4">--> <!-- </template>-->
<!-- <div class="list-item__status-4"></div>--> <!-- <template v-else-if="timeStatusFormat(item) === 4">-->
<!-- <p>超时未执行</p>--> <!-- <div class="list-item__status-4"></div>-->
<!-- </template>--> <!-- <p>超时未执行</p>-->
<!-- <template v-else>--> <!-- </template>-->
<!-- <template v-else>-->
<!-- </template>-->
<!-- </div>--> <!-- </template>-->
<div class="list-item__name"> <!-- </div>-->
{{ item.equipment_id_equipments_id_relation ? item.equipment_id_equipments_id_relation.name : '' }} <div class="list-item__name">
</div> {{ item.equipment_id_equipments_id_relation ? item.equipment_id_equipments_id_relation.name : '' }}
<div class="list-item__time"> </div>
实际执行时间{{ timeFormat(item.act_start_time) }}{{ timeFormat(item.act_end_time,'HH:mm') }} <div class="list-item__content">
</div> <el-tooltip class="item" effect="dark" :content="item.content" placement="top-start">
<div class="list-item__last">预计时长 {{ $moment(item.end_time).diff($moment(item.start_time),'hours') }}</div> <span>{{ item.content }}</span>
<div class="list-item__operate"> </el-tooltip>
<div v-for="(s, si) in status" class="step"> </div>
<div class="step-icon"> <div class="list-item__time">
<div class="step-icon__cir" :class="`step-icon__cir-${stepFormat(item.status,s.value)}`"></div> 实际执行时间{{ timeFormat(item.act_start_time) }}{{ timeFormat(item.act_end_time,'HH:mm') }}
<div class="step-icon__line" :class="`step-icon__line-${stepFormat(item.status,s.value)}`" v-if="si < status.length-1"></div> </div>
<div class="list-item__last">预计时长 {{ $moment(item.end_time).diff($moment(item.start_time),'hours') }}</div>
<div class="list-item__operate">
<div v-for="(s, si) in status" class="step">
<div class="step-icon">
<div class="step-icon__cir" :class="`step-icon__cir-${stepFormat(item.status,s.value)}`"></div>
<div class="step-icon__line" :class="`step-icon__line-${stepFormat(item.status,s.value)}`" v-if="si < status.length-1"></div>
</div>
<div class="step-label">{{ s.label }}</div>
</div> </div>
<div class="step-label">{{ s.label }}</div>
</div> </div>
<Button type="primary" size="small" class="list-item__btn" @click="stepClick(item,{},true)"></Button>
</div> </div>
<Button type="primary" size="small" class="list-item__btn" @click="stepClick(item,{},true)"></Button>
</div> </div>
</div> </template>
<template v-else>
<el-empty description="暂无完成调令"></el-empty>
</template>
</el-scrollbar> </el-scrollbar>
</div> </div>
</el-drawer> </el-drawer>
@ -182,7 +192,13 @@ $list-height: calc(#{$container-height} - 5.33rem);
border-radius: 0.67rem; border-radius: 0.67rem;
position: relative; position: relative;
margin: 4rem 3.62rem 0 3.62rem; margin: 3rem 3.62rem 0 3.62rem;
}
.list-item {
transition: all .4s;
}
.list-item-enter-from {
opacity: 0;
} }
.header { .header {
font-size: 1.15rem; font-size: 1.15rem;
@ -221,7 +237,7 @@ $list-height: calc(#{$container-height} - 5.33rem);
} }
} }
.list { .list {
max-height: $list-height; height: $list-height;
&-item { &-item {
font-size: 1.15rem; font-size: 1.15rem;
@ -244,7 +260,6 @@ $list-height: calc(#{$container-height} - 5.33rem);
@if $i == 3 { @if $i == 3 {
border: 1px solid #d15d52aa; border: 1px solid #d15d52aa;
border-bottom: 1px solid #d15d52aa !important; border-bottom: 1px solid #d15d52aa !important;
animation: shine 2s infinite ease-out;
& + & { & + & {
border-top: none; border-top: none;
@ -252,14 +267,6 @@ $list-height: calc(#{$container-height} - 5.33rem);
} }
} }
} }
@keyframes shine {
from {
filter: drop-shadow(0 0 1px rgba(227, 92, 79, 0.67));
}
to {
filter: drop-shadow(0 0 4px #d15d52aa);
}
}
&__status { &__status {
display: flex; display: flex;
align-items: center; align-items: center;
@ -285,22 +292,28 @@ $list-height: calc(#{$container-height} - 5.33rem);
font-size: 1.34rem; font-size: 1.34rem;
flex: 1; flex: 1;
} }
&__content {
flex-basis: 14%;
word-break: keep-all;
text-overflow: ellipsis;
overflow: hidden;
}
&__time { &__time {
flex-basis: 26%; flex-basis: 26.6%;
text-align: center; text-align: center;
} }
&__last { &__last {
flex-basis: 9%; flex-basis: 7.8%;
text-align: center; text-align: center;
} }
&__operate { &__operate {
flex-basis: 31%; flex-basis: 30%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.step { .step {
width: 6.6rem; width: 5rem;
&-icon { &-icon {
display: flex; display: flex;
@ -309,6 +322,8 @@ $list-height: calc(#{$container-height} - 5.33rem);
position: relative; position: relative;
$done-color: #ec6a5e;
$doing-color: #7ccac8;
&__cir { &__cir {
width: 2.2rem; width: 2.2rem;
height: 2.2rem; height: 2.2rem;
@ -320,7 +335,7 @@ $list-height: calc(#{$container-height} - 5.33rem);
&-doing { &-doing {
cursor: pointer; cursor: pointer;
transform: scale(.9, .9); transform: scale(.9, .9);
background: #6fc0af; background: $doing-color;
position: relative; position: relative;
@ -329,10 +344,10 @@ $list-height: calc(#{$container-height} - 5.33rem);
width: 132%; width: 132%;
height: 132%; height: 132%;
border-radius: 100%; border-radius: 100%;
background: #6fc0af65; opacity: 0.4;
background: $doing-color;
transform: translate(-50%,-50%); transform: translate(-50%,-50%);
animation: scale infinite ease-out 4s; animation: scale infinite ease-out 4s;
transform-origin: 50% 50%;
position: absolute; position: absolute;
left: 50%; left: 50%;
@ -343,12 +358,12 @@ $list-height: calc(#{$container-height} - 5.33rem);
transform: translate(-50%,-50%); transform: translate(-50%,-50%);
} }
50% { 50% {
transform: translate(-50%,-50%) scale(1.08, 1.08); transform: translate(-50%,-50%) scale(1.1,1.1);
} }
} }
} }
&-done { &-done {
background: #7ccac8; background: $done-color;
} }
} }
&__line { &__line {
@ -360,7 +375,7 @@ $list-height: calc(#{$container-height} - 5.33rem);
left: 50%; left: 50%;
&-done { &-done {
background: #7ccac8; background: $done-color;
} }
} }

@ -150,17 +150,32 @@ export default {
align: 'center', align: 'center',
render: (h,{ row }) => h('span', (this.abilities.find(i => i.value === row.leibie))?.key) render: (h,{ row }) => h('span', (this.abilities.find(i => i.value === row.leibie))?.key)
}, },
{
title: "调令日期",
width: 120,
align: 'center',
render: (h,{ row }) => h('span', this.$moment(row.start_time).format('YYYY-MM-DD'))
},
{ {
title: "开启时间", title: "开启时间",
width: 180, width: 100,
align: "center", align: "center",
key: "start_time", key: "start_time",
render: (h,{ row }) => h('span', this.$moment(row.start_time).format('HH:mm'))
},
{
title: "持续时间",
width: 100,
align: "center",
key: "last",
render: (h,{ row }) => h('span', this.$moment(row.end_time).diff(this.$moment(row.start_time),'minutes') + '分钟')
}, },
{ {
title: "结束时间", title: "结束时间",
width: 180, width: 100,
align: "center", align: "center",
key: "end_time", key: "end_time",
render: (h,{ row }) => h('span', this.$moment(row.end_time).format('HH:mm'))
}, },
{ {
title: "调令内容", title: "调令内容",

@ -299,7 +299,7 @@
ref="elTree" ref="elTree"
:props="{ children: 'children', label: 'name' }" :props="{ children: 'children', label: 'name' }"
show-checkbox show-checkbox
@check-change="handleCheckChange"> @check="handleCheckChange">
</el-tree> </el-tree>
</el-col> </el-col>
<el-col :span="20"> <el-col :span="20">
@ -452,6 +452,8 @@ export default {
handleCheckChange (data, checked, indeterminate) { handleCheckChange (data, checked, indeterminate) {
this.treeValue = this.$refs['elTree'].getCheckedNodes(true)?.filter(i => !i.children)?.map(i => i.name).toString() this.treeValue = this.$refs['elTree'].getCheckedNodes(true)?.filter(i => !i.children)?.map(i => i.name).toString()
this.select.filter[3].value = this.$refs['elTree'].getCheckedNodes(true)?.filter(i => !i.children)?.map(i => i.id) this.select.filter[3].value = this.$refs['elTree'].getCheckedNodes(true)?.filter(i => !i.children)?.map(i => i.id)
this.$refs['xyTable'].getTableData(true)
}, },
async getEquipments () { async getEquipments () {

@ -44,16 +44,16 @@
<span>河道处</span> <span>河道处</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="gate" label="闸门(孔×米)" header-align="center" width="150" fixed="left"> <!-- <el-table-column prop="gate" label="闸门(孔×米)" header-align="center" width="150" fixed="left">-->
<template> <!-- <template>-->
<span>14m</span> <!-- <span>14m</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column prop="gm" label="泵站规模×m3/s" header-align="center" width="150" fixed="left"> <!-- <el-table-column prop="gm" label="泵站规模×m3/s" header-align="center" width="150" fixed="left">-->
<template> <!-- <template>-->
<span>3×5m3/s</span> <!-- <span>3×5m3/s</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column :label="weekRange[i]" header-align="center" v-for="i in 6"> <el-table-column :label="weekRange[i]" header-align="center" v-for="i in 6">
<el-table-column prop="x1" :label="weekName[i]" min-width="220" header-align="center"> <el-table-column prop="x1" :label="weekName[i]" min-width="220" header-align="center">
<template #default="{ row }"> <template #default="{ row }">

@ -7,8 +7,8 @@
<div slot="content"></div> <div slot="content"></div>
<slot> <slot>
<div> <div>
<Input style="width: 200px; margin-right: 10px" v-model.number="searchFields.Name" placeholder="关键字搜索" /> <Input style="width: 200px; margin-right: 10px" v-model.number="searchFields.keyword" placeholder="关键字搜索" />
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button> <Button type="primary" @click="searchFields.page = 1,load()" style="margin-left: 10px">查询</Button>
<Button type="primary" @click="edit()" style="margin-left: 10px">新增用户</Button> <Button type="primary" @click="edit()" style="margin-left: 10px">新增用户</Button>
</div> </div>
</slot> </slot>
@ -47,6 +47,16 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<Page :total="total"
show-elevator
show-total
:current.sync="searchFields.page"
:page-size="searchFields.page_size"
@on-change="e => {
searchFields.page = e;
load()
}"/>
</div> </div>
<el-dialog title="用户编辑" :visible.sync="dialogFormVisible" width="30%"> <el-dialog title="用户编辑" :visible.sync="dialogFormVisible" width="30%">
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth"> <el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
@ -138,8 +148,11 @@
}, },
tableHeight: 0, tableHeight: 0,
// //
total: 0,
searchFields: { searchFields: {
KeyWord: "" keyword: "",
page: 1,
page_size: 20
}, },
tableData: [] tableData: []
} }
@ -164,8 +177,9 @@
}, },
load() { load() {
var that = this; var that = this;
listuser().then(response => { listuser(this.searchFields).then(response => {
var data = response.data; var data = response.data;
that.total = response.total;
var _rolelist = []; var _rolelist = [];
for (var m of data) { for (var m of data) {
_rolelist = that.roleList; _rolelist = that.roleList;

Loading…
Cancel
Save