page title,workbook title padding,logout func,countdown status judge and show,update

This commit is contained in:
jr719 2021-04-12 01:46:46 +08:00
parent a7aaae03d0
commit 5c65f0e0fc
10 changed files with 332 additions and 275 deletions

View File

@ -21,7 +21,7 @@
<!-- <div class="avatar-wrapper"> --> <!-- <div class="avatar-wrapper"> -->
<img :src="avatar" class="user-avatar"> <img :src="avatar" class="user-avatar">
<span>{{ name }}</span> <span>{{ name }}</span>
<el-button icon="el-icon-switch-button" type="text" style="margin-left:26px;margin-right:20px">退出登录</el-button> <el-button icon="el-icon-switch-button" type="text" style="margin-left:26px;margin-right:20px" @click.native="logout">退出登录</el-button>
<!-- <div><i ></i>退出登录</div> --> <!-- <div><i ></i>退出登录</div> -->
<!-- <i class="el-icon-caret-bottom" /> --> <!-- <i class="el-icon-caret-bottom" /> -->
<!-- </div> --> <!-- </div> -->

View File

@ -24,7 +24,7 @@ export default {
}, },
data() { data() {
return { return {
title: 'Vue Element Admin', title: '定点服务系统',
logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png' logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png'
} }
} }

View File

@ -24,7 +24,7 @@ export default {
}, },
data() { data() {
return { return {
title: 'Vue Element Admin', title: '定点服务系统',
logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png' logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png'
} }
} }

View File

@ -1,5 +1,5 @@
module.exports = { module.exports = {
title: 'Vue Element Admin', title: '定点服务系统',
/** /**
* @type {boolean} true | false * @type {boolean} true | false

View File

@ -72,9 +72,9 @@ const actions = {
// user logout // user logout
logout({ commit, state, dispatch }) { logout({ commit, state, dispatch }) {
return new Promise((resolve, reject) => { // return new Promise((resolve, reject) => {
logout(state.token) // logout(state.token)
.then(() => { // .then(() => {
commit('SET_TOKEN', '') commit('SET_TOKEN', '')
commit('SET_ROLES', []) commit('SET_ROLES', [])
removeToken() removeToken()
@ -84,12 +84,12 @@ const actions = {
// to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485 // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485
dispatch('tagsView/delAllViews', null, { root: true }) dispatch('tagsView/delAllViews', null, { root: true })
resolve() // resolve()
}) // })
.catch(error => { // .catch(error => {
reject(error) // reject(error)
}) // })
}) // })
}, },
// remove token // remove token

View File

@ -1,6 +1,6 @@
import defaultSettings from '@/settings' import defaultSettings from '@/settings'
const title = defaultSettings.title || 'Vue Element Admin' const title = defaultSettings.title || '定点服务系统'
export default function getPageTitle(pageTitle) { export default function getPageTitle(pageTitle) {
if (pageTitle) { if (pageTitle) {

View File

@ -5,7 +5,8 @@
type="primary" type="primary"
style="position:absolute;right:50px;top:120px" style="position:absolute;right:50px;top:120px"
@click="$router.push('/convenience/add')" @click="$router.push('/convenience/add')"
><i class="el-icon-plus" /> 直接建立工单</el-button> ><i class="el-icon-plus" /> 直接建立工单</el-button
>
<div class="title">工单列表</div> <div class="title">工单列表</div>
<div style="margin-bottom:15px;margin-top:15px" /> <div style="margin-bottom:15px;margin-top:15px" />
<el-radio-group v-model="listQuery.phase"> <el-radio-group v-model="listQuery.phase">
@ -15,20 +16,20 @@
<el-radio-button label="PROCESSING">办理中</el-radio-button> <el-radio-button label="PROCESSING">办理中</el-radio-button>
<el-radio-button label="FINISH">已办结</el-radio-button> <el-radio-button label="FINISH">已办结</el-radio-button>
</el-radio-group> </el-radio-group>
<br> <br />
<br> <br />
<el-radio-group v-model="listQuery.status"> <el-radio-group v-model="listQuery.status">
<el-radio-button :label="undefined">全部状态</el-radio-button> <el-radio-button :label="undefined">全部状态</el-radio-button>
<el-radio-button label="MINE">我处理</el-radio-button> <el-radio-button label="MINE">我处理</el-radio-button>
<el-radio-button label="FORWARDED">已转交</el-radio-button> <el-radio-button label="FORWARDED">已转交</el-radio-button>
<el-radio-button <el-radio-button label="FORWARDED_APPLY"
label="FORWARDED_APPLY" >转交超限审批中</el-radio-button
>转交超限审批中</el-radio-button> >
<el-radio-button label="SUBMIT_APPLY">已提交审批</el-radio-button> <el-radio-button label="SUBMIT_APPLY">已提交审批</el-radio-button>
<el-radio-button label="WAIT_APPLY">待我审批</el-radio-button> <el-radio-button label="WAIT_APPLY">待我审批</el-radio-button>
</el-radio-group> </el-radio-group>
<br> <br />
<br> <br />
</div> </div>
<div class="convenienceList"> <div class="convenienceList">
@ -54,7 +55,17 @@
<div style="display:flex;flex:2;font-size:14px;color:#787878"> <div style="display:flex;flex:2;font-size:14px;color:#787878">
<div style="flex:1"> <div style="flex:1">
<p>流水号{{ item.serialNumber }}</p> <p>流水号{{ item.serialNumber }}</p>
<p>阶段{{ item.phase | phaseFilter }}</p> <p>
阶段{{ item.phase | phaseFilter }}
<i class="icon_timeout" v-if="timers&&timers[index].status !== null"></i>
<span style="color:#ff3000">{{
timers && timers[index].status === null
? ""
: timers&&timers[index].status
? "已超时"
: "即将超时"
}}</span>
</p>
</div> </div>
<div style="flex:1"> <div style="flex:1">
<p>申办人{{ item.residentInformation.name }}</p> <p>申办人{{ item.residentInformation.name }}</p>
@ -62,6 +73,7 @@
状态<span style="color:#ff5a00">{{ 状态<span style="color:#ff5a00">{{
item.statusList[0].status | statusFilter item.statusList[0].status | statusFilter
}}</span> }}</span>
<!-- <span v-html="timeoutType(item,index)"></span> -->
</p> </p>
</div> </div>
<div style="flex:1"> <div style="flex:1">
@ -80,7 +92,8 @@
type="primary" type="primary"
size="mini" size="mini"
@click="handleUpdate(item, 5)" @click="handleUpdate(item, 5)"
>接单</el-button> >接单</el-button
>
</p> </p>
</div> </div>
</div> </div>
@ -174,10 +187,10 @@
<script> <script>
// import Pagination from "@/components/Pagination"; // import Pagination from "@/components/Pagination";
import { list, typeList, update } from '@/api/convenience' import { list, typeList, update } from "@/api/convenience";
import { parseTime } from '@/utils' import { parseTime } from "@/utils";
import { staffList } from '@/api/staff' import { staffList } from "@/api/staff";
import AliOss from '@/components/AliOSS/index.vue' import AliOss from "@/components/AliOSS/index.vue";
export default { export default {
components: { components: {
@ -187,48 +200,48 @@ export default {
filters: { filters: {
sponsorFilter(status) { sponsorFilter(status) {
const statusMap = { const statusMap = {
SELF: '居民', SELF: "居民",
STAFF: '工作人员' STAFF: "工作人员"
} };
return statusMap[status] return statusMap[status];
}, },
phaseFilter(status) { phaseFilter(status) {
const statusMap = { const statusMap = {
PENDING_ORDER: '待接单', PENDING_ORDER: "待接单",
PREREQUISITES: '要件准备中', PREREQUISITES: "要件准备中",
PROCESSING: '办理中', PROCESSING: "办理中",
FINISH: '办结' FINISH: "办结"
} };
return statusMap[status] return statusMap[status];
}, },
statusFilter(status) { statusFilter(status) {
const statusMap = { const statusMap = {
MINE: '待我处理', MINE: "待我处理",
FORWARDED: '已转交', FORWARDED: "已转交",
FORWARDED_APPLY: '转交超限审批中', FORWARDED_APPLY: "转交超限审批中",
SUBMIT_APPLY: '提交申请', SUBMIT_APPLY: "提交申请",
WAIT_APPLY: '待审核' WAIT_APPLY: "待审核"
} };
return statusMap[status] return statusMap[status];
}, },
typeFilter(status) { typeFilter(status) {
const statusMap = { const statusMap = {
1: '建立工单', 1: "建立工单",
2: '撤销工单', 2: "撤销工单",
3: '沟通', 3: "沟通",
4: '调整工单类别', 4: "调整工单类别",
5: '接单', 5: "接单",
6: '要件齐备', 6: "要件齐备",
7: '办结', 7: "办结",
8: '转交超限审批提交', 8: "转交超限审批提交",
9: '转交超限审批撤销', 9: "转交超限审批撤销",
10: '转交超限审批', 10: "转交超限审批",
11: '发起审批', 11: "发起审批",
12: '撤销审批', 12: "撤销审批",
13: '审批操作', 13: "审批操作",
14: '转交' 14: "转交"
} };
return statusMap[status] return statusMap[status];
} }
}, },
data() { data() {
@ -259,126 +272,140 @@ export default {
}, },
msec: 0, msec: 0,
rules: { rules: {
ids: [{ required: true, message: '请选择操作对象', trigger: 'change' }] ids: [{ required: true, message: "请选择操作对象", trigger: "change" }]
}, },
timers: undefined, timers: undefined,
timersInterval: undefined timersInterval: undefined
} };
}, },
watch: { watch: {
'listQuery.phase': { "listQuery.phase": {
// //
handler(val) { handler(val) {
this.listQuery.phase = val this.listQuery.phase = val;
this.getList() this.getList();
}, },
deep: true // true deep: true // true
}, },
'listQuery.status': { "listQuery.status": {
// //
handler(val) { handler(val) {
this.listQuery.status = val this.listQuery.status = val;
this.getList() this.getList();
}, },
deep: true // true deep: true // true
} }
}, },
created() { created() {
this.getList() this.getList();
this.getStaffList() this.getStaffList();
}, },
methods: { methods: {
getList() { getList() {
this.listLoading = true this.listLoading = true;
list(this.listQuery).then(res => { list(this.listQuery).then(res => {
this.list = res.d.records this.list = res.d.records;
this.listLoading = false this.listLoading = false;
clearInterval(this.timersInterval) clearInterval(this.timersInterval);
const tempData = res.d.records const tempData = res.d.records;
const now = Date.parse(new Date()).toString() / 1000 const now = Date.parse(new Date()).toString() / 1000;
const arr = [] const arr = [];
tempData.map((item, index) => { tempData.map((item, index) => {
// console.log(item); let msec = [];
// PREREQUISITES: "", let obj = {};
// PROCESSING: "",
// FINISH: ""
let msec = []
let obj = {}
switch (item.phase) { switch (item.phase) {
case 'PENDING_ORDER': case "PENDING_ORDER":
// //
// console.log(item.createDate) msec = now - item.createDate;
// this.timers[index]++;
msec = now - item.createDate
// msec++;
// console.log(msec);
obj = { obj = {
time: msec, time: msec,
phase: item.phase phase: item.phase,
} status: null
};
arr.push(obj) arr.push(obj);
break break;
case 'PREREQUISITES': case "PREREQUISITES":
// //
// console.log(index); msec = now - item.createDate - item.acceptanceTime;
// console.log(now);
// console.log(item.createDate);
// console.log(item.acceptanceTime);
// console.log(now - item.createDate - item.acceptanceTime);
msec = now - item.createDate - item.acceptanceTime
obj = { obj = {
time: msec, time: msec,
phase: item.phase phase: item.phase,
} status: null
arr.push(obj) };
break arr.push(obj);
case 'PROCESSING': break;
case "PROCESSING":
// //
msec = msec =
now - now -
item.createDate - item.createDate -
item.acceptanceTime - item.acceptanceTime -
item.prerequisitesTime item.prerequisitesTime;
obj = { obj = {
time: msec, time: msec,
phase: item.phase phase: item.phase,
} status: null
arr.push(obj) };
break arr.push(obj);
case 'FINISH': break;
case "FINISH":
msec = msec =
item.acceptanceTime + item.prerequisitesTime + item.finishTime item.acceptanceTime + item.prerequisitesTime + item.finishTime;
obj = { obj = {
time: msec, time: msec,
phase: item.phase phase: item.phase,
} status: null
arr.push(obj) };
arr.push(obj);
// //
break break;
default: default:
// console.log("default"); break;
break
} }
}) });
// console.log(arr);
this.timersInterval = setInterval(() => { this.timersInterval = setInterval(() => {
// console.log(arr);
if (arr.length > 0) { if (arr.length > 0) {
arr.map(item => { arr.map((item, index) => {
if (item.phase !== 'FINISH') { if (item.phase !== "FINISH") {
item.time++ item.time++;
if (this.list[index].phase === "PENDING_ORDER") {
if (item.status == null) {
if (item.time > 57600) {
item.status = false;
if (item.time >= 86400) {
item.status = true;
}
}
}
}
if (this.list[index].phase === "PROCESSING") {
if (item.status == null) {
// &&item.time<this.list[index].eventType.commitmentTimeLimit
if (
item.time >
this.list[index].eventType.timeoutReminder * 3600
) {
item.status = false;
if (
item.time >=
this.list[index].eventType.commitmentTimeLimit * 3600
) {
item.status = true;
}
}
}
}
} }
}) });
} }
this.timers = arr this.timers = arr;
}, 1000) }, 1000);
}) });
}, },
getTypeList() { getTypeList() {
typeList().then(res => { typeList().then(res => {
// console.log(res); // console.log(res);
}) });
}, },
getStaffList() { getStaffList() {
staffList().then(res => { staffList().then(res => {
@ -386,10 +413,10 @@ export default {
const obj = { const obj = {
label: item.name, label: item.name,
value: item.id value: item.id
} };
this.staffOptions.push(obj) this.staffOptions.push(obj);
}) });
}) });
}, },
handleTypeChange() {}, handleTypeChange() {},
resetPayload() { resetPayload() {
@ -401,79 +428,79 @@ export default {
attachmentList: undefined, attachmentList: undefined,
approve: undefined, approve: undefined,
evaluation: undefined evaluation: undefined
} };
}, },
handleUpdate(row, type) { handleUpdate(row, type) {
this.resetPayload() this.resetPayload();
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.applyForm.clearValidate() this.$refs.applyForm.clearValidate();
}) });
this.updateType = type this.updateType = type;
this.payload.id = row.id this.payload.id = row.id;
this.payload.version = row.version this.payload.version = row.version;
this.payload.type = type this.payload.type = type;
switch (type) { switch (type) {
case 5: case 5:
this.applyDialog = true this.applyDialog = true;
break break;
case 6: case 6:
this.applyDialog = true this.applyDialog = true;
break break;
case 11: case 11:
this.applyDialog = true this.applyDialog = true;
break break;
case 13: case 13:
this.applyDialog = true this.applyDialog = true;
break break;
case 14: case 14:
this.applyDialog = true this.applyDialog = true;
break break;
default: default:
this.updateData() this.updateData();
break break;
} }
}, },
updateData() { updateData() {
update(this.payload).then(res => { update(this.payload).then(res => {
if (res.c === 200) { if (res.c === 200) {
this.$notify.success('操作成功') this.$notify.success("操作成功");
this.getList() this.getList();
} }
}) });
}, },
apply() { apply() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.applyForm.validate(valid => { this.$refs.applyForm.validate(valid => {
if (valid) { if (valid) {
this.updateData() this.updateData();
this.applyDialog = false this.applyDialog = false;
} }
}) });
}, 100) }, 100);
}, },
handleFilterPhase(phase, event) { handleFilterPhase(phase, event) {
// console.log(event.target.tagName==='SPAN'); // console.log(event.target.tagName==='SPAN');
if (event.target.tagName === 'SPAN') { if (event.target.tagName === "SPAN") {
event.target.parentElement.setAttribute( event.target.parentElement.setAttribute(
'class', "class",
'el-button el-button--' + "el-button el-button--" +
(phase === undefined ? 'primary' : 'default') + (phase === undefined ? "primary" : "default") +
' el-button--medium is-round' " el-button--medium is-round"
) );
} else { } else {
event.target.setAttribute( event.target.setAttribute(
'class', "class",
'el-button el-button--' + "el-button el-button--" +
(phase === undefined ? 'primary' : 'default') + (phase === undefined ? "primary" : "default") +
' el-button--medium is-round' " el-button--medium is-round"
) );
} }
this.listQuery.phase = phase this.listQuery.phase = phase;
this.getList() this.getList();
}, },
handleFilterStatus(status) { handleFilterStatus(status) {
this.listQuery.status = status this.listQuery.status = status;
this.getList() this.getList();
}, },
handlePreview() {}, handlePreview() {},
handleRemove() {}, handleRemove() {},
@ -482,24 +509,36 @@ export default {
timeFormat(timeStamp) { timeFormat(timeStamp) {
const timeStr = `${ const timeStr = `${
Math.floor(timeStamp / 3600) < 9 Math.floor(timeStamp / 3600) < 9
? '0' + Math.floor(timeStamp / 3600) ? "0" + Math.floor(timeStamp / 3600)
: Math.floor(timeStamp / 3600) : Math.floor(timeStamp / 3600)
}:${ }:${
Math.floor(((timeStamp % 86400) % 3600) / 60) < 9 Math.floor(((timeStamp % 86400) % 3600) / 60) < 9
? '0' + Math.floor(((timeStamp % 86400) % 3600) / 60) ? "0" + Math.floor(((timeStamp % 86400) % 3600) / 60)
: Math.floor(((timeStamp % 86400) % 3600) / 60) : Math.floor(((timeStamp % 86400) % 3600) / 60)
}:${ }:${
Math.floor(((timeStamp % 86400) % 3600) % 60) < 9 Math.floor(((timeStamp % 86400) % 3600) % 60) < 9
? '0' + Math.floor(((timeStamp % 86400) % 3600) % 60) ? "0" + Math.floor(((timeStamp % 86400) % 3600) % 60)
: Math.floor(((timeStamp % 86400) % 3600) % 60) : Math.floor(((timeStamp % 86400) % 3600) % 60)
}` }`;
return timeStr return timeStr;
}, },
countdown(index, status) { countdown(index, status) {
// //
} }
// timeoutType(row,index) {
// let tempData = Object.assign({}, row);
// switch (tempData.phase) {
// case "PENDING_ORDER":
// // tempData.acceptanceTime
// this.timers[index]
// break;
// }
// let statusEl = '<i class="icon_timeout"></i>'; //'<i class="icon_timeoutYet"></i>'
// return statusEl;
// }
} }
} };
</script> </script>
<style scope> <style scope>
@ -519,7 +558,7 @@ export default {
background-color: #f5f7fa; background-color: #f5f7fa;
border-left: 5px solid #1890ff !important; border-left: 5px solid #1890ff !important;
} */ } */
.title { .app-container .title {
border-left: 5px solid #1890ff; border-left: 5px solid #1890ff;
padding-left: 8px; padding-left: 8px;
font-size: 18px; font-size: 18px;
@ -579,4 +618,12 @@ export default {
.el-radio-button:last-child .el-radio-button__inner { .el-radio-button:last-child .el-radio-button__inner {
border-radius: 17px; border-radius: 17px;
} }
.icon_timeout {
background: url("./img/icon_timeout.png") no-repeat;
background-size: cover;
width: 12px;
height: 11px;
display: inline-block;
margin-right: 5px;
}
</style> </style>

View File

@ -11,13 +11,13 @@
margin: 0 auto;" margin: 0 auto;"
> >
<el-row> <el-row>
<el-col <el-col :span="12"
:span="12" ><img
><img src="./img/loginImg.png"
src="./img/loginImg.png" style="padding: 70px 0px 70px 72px;width:100%"
style="padding: 70px 0px 70px 72px;width:100%" alt=""
alt="" /></el-col>
></el-col>
<el-col :span="12"> <el-col :span="12">
<el-form <el-form
ref="loginForm" ref="loginForm"
@ -38,7 +38,7 @@
<el-input <el-input
ref="username" ref="username"
v-model="loginForm.username" v-model="loginForm.username"
placeholder="Username" placeholder="请输入用户名"
name="username" name="username"
type="text" type="text"
tabindex="1" tabindex="1"
@ -60,7 +60,12 @@
/> />
<!-- style="width:290px" --> <!-- style="width:290px" -->
<!-- <el-button @click="handleSms">获取验证码</el-button> --> <!-- <el-button @click="handleSms">获取验证码</el-button> -->
<button class="btn_getCode" type="button" :disabled="getCodeDisabled" @click="handleSms"> <button
class="btn_getCode"
type="button"
:disabled="getCodeDisabled"
@click="handleSms"
>
{{ codeText }} {{ codeText }}
</button> </button>
</el-form-item> </el-form-item>
@ -70,7 +75,8 @@
type="primary" type="primary"
style="width:100%;margin-bottom:30px;border-radius:10px;height:54px" style="width:100%;margin-bottom:30px;border-radius:10px;height:54px"
@click.native.prevent="handleLogin" @click.native.prevent="handleLogin"
>登录</el-button> >登录</el-button
>
</el-form> </el-form>
</el-col> </el-col>
</el-row> </el-row>
@ -79,12 +85,12 @@
</template> </template>
<script> <script>
import { validUsername } from '@/utils/validate' import { validUsername } from "@/utils/validate";
import { getGuestToken, getSms } from '@/api/user' import { getGuestToken, getSms } from "@/api/user";
import Axios from 'axios' import Axios from "axios";
export default { export default {
name: 'Login', name: "Login",
// components: { SocialSign }, // components: { SocialSign },
data() { data() {
const validateUsername = (rule, value, callback) => { const validateUsername = (rule, value, callback) => {
@ -94,57 +100,57 @@ export default {
// callback() // callback()
// } // }
if (value.length < 4) { if (value.length < 4) {
callback(new Error('账号格式错误不能为空或小于4位')) callback(new Error("账号格式错误不能为空或小于11位"));
} else { } else {
callback() callback();
} }
} };
const validateCaptcha = (rule, value, callback) => { const validateCaptcha = (rule, value, callback) => {
if (value.length < 6) { if (value.length < 6) {
callback(new Error('验证码格式错误不能为空或小于6位')) callback(new Error("验证码格式错误不能为空或小于6位"));
} else { } else {
callback() callback();
} }
} };
return { return {
// loginForm: { // loginForm: {
// username: 'admin', // username: 'admin',
// password: '111111' // password: '111111'
// }, // },
loginForm: { loginForm: {
username: '18882564006', username: "18882564006",
captcha: '111111', captcha: "111111",
appVersion: '1.0.0', appVersion: "1.0.0",
system: 'IOS', system: "IOS",
device: navigator.userAgent, device: navigator.userAgent,
extra: '' extra: ""
}, },
loginRules: { loginRules: {
username: [ username: [
{ required: true, trigger: 'blur', validator: validateUsername } { required: true, trigger: "blur", validator: validateUsername }
], ],
password: [ captcha: [
{ required: true, trigger: 'blur', validator: validateCaptcha } { required: true, trigger: "blur", validator: validateCaptcha }
] ]
}, },
passwordType: 'password', passwordType: "password",
capsTooltip: false, capsTooltip: false,
loading: false, loading: false,
showDialog: false, showDialog: false,
redirect: undefined, redirect: undefined,
otherQuery: {}, otherQuery: {},
codeText: '获取验证码', codeText: "获取验证码",
time: 5, time: 5,
getCodeDisabled: false getCodeDisabled: false
} };
}, },
watch: { watch: {
$route: { $route: {
handler: function(route) { handler: function(route) {
const query = route.query const query = route.query;
if (query) { if (query) {
this.redirect = query.redirect this.redirect = query.redirect;
this.otherQuery = this.getOtherQuery(query) this.otherQuery = this.getOtherQuery(query);
} }
}, },
immediate: true immediate: true
@ -152,30 +158,30 @@ export default {
}, },
created() { created() {
// window.addEventListener('storage', this.afterQRScan) // window.addEventListener('storage', this.afterQRScan)
const { appVersion, system, device, extra } = this.loginForm const { appVersion, system, device, extra } = this.loginForm;
const payload = { const payload = {
appVersion, appVersion,
system, system,
device, device,
extra extra
} };
Axios({ Axios({
method: 'POST', method: "POST",
url: `${process.env.VUE_APP_BASE_API}api/auth/guest`, url: `${process.env.VUE_APP_BASE_API}api/auth/guest`,
data: payload, data: payload,
headers: { headers: {
Authorization: 'basic YW5kcm9pZC1jbGllbnQ6YW5kcm9pZC1zZWNyZXQtMjAyMA==' Authorization: "basic YW5kcm9pZC1jbGllbnQ6YW5kcm9pZC1zZWNyZXQtMjAyMA=="
} }
}).then(res => { }).then(res => {
// console.log(res); // console.log(res);
sessionStorage.setItem('token', res.data.d.access_token) sessionStorage.setItem("token", res.data.d.access_token);
}) });
}, },
mounted() { mounted() {
if (this.loginForm.username === '') { if (this.loginForm.username === "") {
this.$refs.username.focus() this.$refs.username.focus();
} else if (this.loginForm.captcha === '') { } else if (this.loginForm.captcha === "") {
this.$refs.password.focus() this.$refs.password.focus();
} }
}, },
destroyed() { destroyed() {
@ -183,8 +189,8 @@ export default {
}, },
methods: { methods: {
checkCapslock(e) { checkCapslock(e) {
const { key } = e const { key } = e;
this.capsTooltip = key && key.length === 1 && key >= 'A' && key <= 'Z' this.capsTooltip = key && key.length === 1 && key >= "A" && key <= "Z";
}, },
// showPwd() { // showPwd() {
// if (this.passwordType === 'password') { // if (this.passwordType === 'password') {
@ -200,34 +206,37 @@ export default {
this.$refs.loginForm.validate(valid => { this.$refs.loginForm.validate(valid => {
if (valid) { if (valid) {
Axios({ Axios({
method: 'POST', method: "POST",
url: `${process.env.VUE_APP_BASE_API}api/auth/sms`, url: `${process.env.VUE_APP_BASE_API}api/auth/sms`,
data: this.loginForm, data: this.loginForm,
headers: { headers: {
Authorization: Authorization:
'basic YW5kcm9pZC1jbGllbnQ6YW5kcm9pZC1zZWNyZXQtMjAyMA==' "basic YW5kcm9pZC1jbGllbnQ6YW5kcm9pZC1zZWNyZXQtMjAyMA=="
} }
}).then(res => { }).then(res => {
console.log(res) console.log(res);
if (res.data.c === 200) { if (res.data.c === 200) {
this.$store.dispatch('user/setToken', res.data.d.access_token) this.$store.dispatch("user/setToken", res.data.d.access_token);
this.$router.push({ this.$router.push({
path: this.redirect || '/', path: this.redirect || "/",
query: this.otherQuery query: this.otherQuery
}) });
this.$notify({ this.$notify({
title: '成功', title: "成功",
message: '登录成功', message: "登录成功",
type: 'success', type: "success",
duration: 2000 duration: 2000
}) });
} else {
this.$notify.error(res.data.m);
} }
}) });
} else { } else {
console.log('error submit!!') console.log("error submit!!");
return false
return false;
} }
}) });
// this.$refs.loginForm.validate(valid => { // this.$refs.loginForm.validate(valid => {
// if (valid) { // if (valid) {
// this.loading = true // this.loading = true
@ -247,53 +256,53 @@ export default {
}, },
getOtherQuery(query) { getOtherQuery(query) {
return Object.keys(query).reduce((acc, cur) => { return Object.keys(query).reduce((acc, cur) => {
if (cur !== 'redirect') { if (cur !== "redirect") {
acc[cur] = query[cur] acc[cur] = query[cur];
} }
return acc return acc;
}, {}) }, {});
}, },
handleSms() { handleSms() {
this.getCodeDisabled = false this.getCodeDisabled = false;
const payload = { const payload = {
phone: this.loginForm.username, phone: this.loginForm.username,
category: 'SIGNIN' category: "SIGNIN"
} };
Axios({ Axios({
method: 'GET', method: "GET",
url: `${process.env.VUE_APP_BASE_API}api/common/sms/send`, url: `${process.env.VUE_APP_BASE_API}api/common/sms/send`,
params: payload, params: payload,
headers: { headers: {
Authorization: 'Bearer ' + sessionStorage.getItem('token') Authorization: "Bearer " + sessionStorage.getItem("token")
} }
}).then(res => { }).then(res => {
if (res.data.c === 200) { if (res.data.c === 200) {
this.getCodeDisabled = true this.getCodeDisabled = true;
this.timer() this.timer();
this.$notify({ this.$notify({
title: '成功', title: "成功",
message: '获取验证码成功', message: "获取验证码成功",
type: 'success', type: "success",
duration: 2000 duration: 2000
}) });
} }
}) });
}, },
timer() { timer() {
this.codeText = `${this.time}s 后重新获取` this.codeText = `${this.time}s 后重新获取`;
var interval = setInterval(() => { var interval = setInterval(() => {
this.time-- this.time--;
this.codeText = `${this.time}s 后重新获取` this.codeText = `${this.time}s 后重新获取`;
if (this.time === 0) { if (this.time === 0) {
this.time = 5 this.time = 5;
this.codeText = '获取验证码' this.codeText = "获取验证码";
this.getCodeDisabled = false this.getCodeDisabled = false;
clearInterval(interval) clearInterval(interval);
} }
}, 1000) }, 1000);
} }
} }
} };
</script> </script>
<style lang="scss"> <style lang="scss">
@ -309,7 +318,7 @@ $cursor: #fff;
color: $cursor; color: $cursor;
} }
} }
button:focus{ button:focus {
outline: none; outline: none;
} }

View File

@ -1,9 +1,9 @@
<template> <template>
<div class="app-container"> <div class="app-container" style="padding-top:15px">
<!-- <div class="filter-container" /> --> <!-- <div class="filter-container" /> -->
<div class="workBookLayout"> <div class="workBookLayout">
<div class="title">工作手册管理</div> <div class="title">工作手册管理</div>
<div class="text-center"style="padding:10% 0"> <div class="text-center" style="padding:10% 0">
<img class="img" src="./img/comingSoon.png" alt=""> <img class="img" src="./img/comingSoon.png" alt="">
<h2>业务正在努力开发中...</h2> <h2>业务正在努力开发中...</h2>
<div style="color:#787878">该功能即将上线请稍等</div> <div style="color:#787878">该功能即将上线请稍等</div>
@ -81,7 +81,7 @@ export default {
methods: { methods: {
getList() { getList() {
workBookList(this.listQuery).then(res => { workBookList(this.listQuery).then(res => {
console.log(res) // console.log(res)
this.list = res.d.records this.list = res.d.records
}) })
} }
@ -91,10 +91,11 @@ export default {
<style scoped> <style scoped>
.workBookLayout { .workBookLayout {
padding-top: 20px;
background: #fff; background: #fff;
height: 100%; height: 100%;
} }
.title { .app-container .title {
border-left: 5px solid #1890ff; border-left: 5px solid #1890ff;
padding-left: 8px; padding-left: 8px;
font-size: 18px; font-size: 18px;

View File

@ -6,7 +6,7 @@ function resolve(dir) {
return path.join(__dirname, dir) return path.join(__dirname, dir)
} }
const name = defaultSettings.title || 'vue Element Admin' // page title const name = defaultSettings.title || '定点服务系统' // page title
// If your port is set to 80, // If your port is set to 80,
// use administrator privileges to execute the command line. // use administrator privileges to execute the command line.