单点登录

master
xy 2 years ago
parent 86e300b41c
commit 280cef7364

@ -2,6 +2,10 @@
ENV='development'
# base api
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
VUE_APP_BASE_API=http://192.168.60.78:9001/
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_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'
# base api
#VUE_APP_BASE_API=http://192.168.60.99:9005/
#VUE_APP_UPLOAD_API=http://192.168.60.99:9005/api/admin/upload-file
#VUE_APP_OA_URL=http://192.168.60.18:2021
VUE_APP_BASE_API=http://192.168.60.78:9001/
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_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
#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

@ -8,10 +8,11 @@ export function save(data) {
})
}
export function listuser() {
export function listuser(params) {
return request({
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) {
return request({
url: '/api/admin/auth/permissions',

@ -58,7 +58,19 @@ router.beforeEach(async(to, from, next) => {
}
} else {
/* 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) {
// in the free login whitelist, go directly
next()

@ -1,7 +1,8 @@
import {
login,
logout,
getInfo
getInfo,
ossLogin
} from '@/api/user'
import {
getToken,
@ -42,6 +43,36 @@ const mutations = {
}
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
login({
commit

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

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

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

@ -150,17 +150,32 @@ export default {
align: 'center',
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: "开启时间",
width: 180,
width: 100,
align: "center",
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: "结束时间",
width: 180,
width: 100,
align: "center",
key: "end_time",
render: (h,{ row }) => h('span', this.$moment(row.end_time).format('HH:mm'))
},
{
title: "调令内容",

@ -299,7 +299,7 @@
ref="elTree"
:props="{ children: 'children', label: 'name' }"
show-checkbox
@check-change="handleCheckChange">
@check="handleCheckChange">
</el-tree>
</el-col>
<el-col :span="20">
@ -452,6 +452,8 @@ export default {
handleCheckChange (data, checked, indeterminate) {
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.$refs['xyTable'].getTableData(true)
},
async getEquipments () {

@ -44,16 +44,16 @@
<span>河道处</span>
</template>
</el-table-column>
<el-table-column prop="gate" label="闸门(孔×米)" header-align="center" width="150" fixed="left">
<template>
<span>14m</span>
</template>
</el-table-column>
<el-table-column prop="gm" label="泵站规模×m3/s" header-align="center" width="150" fixed="left">
<template>
<span>3×5m3/s</span>
</template>
</el-table-column>
<!-- <el-table-column prop="gate" label="闸门(孔×米)" header-align="center" width="150" fixed="left">-->
<!-- <template>-->
<!-- <span>14m</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="gm" label="泵站规模×m3/s" header-align="center" width="150" fixed="left">-->
<!-- <template>-->
<!-- <span>3×5m3/s</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<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">
<template #default="{ row }">

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

Loading…
Cancel
Save