Commit 472b21ca by liimin

lint

1 parent ee133425
Showing 36 changed files with 260 additions and 262 deletions
......@@ -7,6 +7,6 @@ app.get('/', function (req, res) {
res.send('Hello Vue')
})
app.listen(2333)
app.listen(8080)
console.log('服务已运行:\r\n localhost:2333')
console.log('服务已运行:\r\n localhost:8080')
......@@ -23,7 +23,7 @@ const request = (params = {}, method = RequestMethods.GET, noSignAttr = []) => {
return axios({
url,
method,
params: sign(params, noSignAttr),
params: sign(params, noSignAttr)
})
}
export default request
......@@ -36,7 +36,7 @@ export function Reg (data = {}) {
/**
* 修改密码
* @param {*} data
* @param {*} data
*/
export function ModifyPassword (data) {
data.method = `${user_path}password.modify`
......
......@@ -284,7 +284,7 @@
flex-direction: column;
overflow: hidden;
.d2-container-full__header {
padding: 12px 20px 0 20px;
padding: 10px 20px;
}
.d2-container-full__body {
flex-grow: 1;
......
......@@ -69,7 +69,7 @@ export default {
curBtns = $store.filter(btn => {
if (category === 'operation') {
return (btn.category === 'operation' || !btn.category) && filter(btn)
}else if(!category){ //未指定类别
} else if (!category) { // 未指定类别
return !btn.category && filter(btn)
}
return (btn.category === category) && filter(btn)
......@@ -85,7 +85,7 @@ export default {
__aBtns.push(h('el-button', {
props: {
type: btn.type || 'text',
icon: btn.icon?`el-icon-${btn.icon}`:''
icon: btn.icon ? `el-icon-${btn.icon}` : ''
},
style: {
color: btn.color
......
......@@ -14,57 +14,53 @@
</template>
<script>
import scroll from "./mixins/normal";
import {mapState} from 'vuex'
import scroll from './mixins/normal'
import { mapState } from 'vuex'
export default {
name: "d2-container-full",
name: 'd2-container-full',
mixins: [scroll],
components: {
d2HeaderSwitch: () => import("./d2-header-switch.vue")
d2HeaderSwitch: () => import('./d2-header-switch.vue')
},
data() {
data () {
return {
oHeaderStyle: {
padding: "20px 20px 0 20px"
padding: '20px 20px 0 20px'
}
};
}
},
computed: {
active() {
active () {
return this.$store.state.d2admin.tsearch.active
}
},
mounted() {
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;
}
transition: .2s linear;
&.close{
height: 0;
padding: 0 20px 0 20px !important;
padding: 0 20px !important;
form{
opacity: 0;
}
border-bottom-color:rgba(0,0,0,0) !important;
}
.el-form-item{
margin-bottom: 16px;
margin-bottom: 4px;
}
}
}
</style>
\ No newline at end of file
</style>
......@@ -24,10 +24,10 @@ export default {
}
},
mounted () {
setTimeout(() => this.isActive = true, 0)
setTimeout(() => this.isActive = true, 0)
},
methods: {
...mapMutations('d2admin/tsearch',['toggle']),
...mapMutations('d2admin/tsearch', ['toggle']),
// 点击按钮的时候跳转到源代码
handleClick () {
this.toggle()
......
......@@ -3,25 +3,25 @@
</template>
<script>
import dayjs from "dayjs";
const sFormat ="YYYY年MM月DD日"
import dayjs from 'dayjs'
const sFormat = 'YYYY年MM月DD日'
export default {
name: 'd2-header-datetime',
data () {
return {
timeInterval: null,
time: dayjs().format(sFormat),
time: dayjs().format(sFormat)
}
},
mounted () {
// this.timeInterval = setInterval(() => this.refreshTime(), 1000);
},
beforeDestroy() {
clearInterval(this.timeInterval);
beforeDestroy () {
clearInterval(this.timeInterval)
},
methods: {
refreshTime() {
this.time = dayjs().format(sFormat);
refreshTime () {
this.time = dayjs().format(sFormat)
}
}
}
......
......@@ -30,7 +30,7 @@ export default {
...mapState('d2admin/user', ['info'])
},
methods: {
...mapActions('d2admin/account', ['logout']),
...mapActions('d2admin/account', ['logout'])
}
}
</script>
......
......@@ -34,7 +34,7 @@
<div class="other-operation" @click="clear">
<div class="other-operation-item">
<i class="fa fa-eraser"></i>
清除缓存
清空本地缓存
</div>
</div>
<div class="personal-footer" @click="logOut">
......@@ -49,116 +49,116 @@
</template>
<script>
import { mapState, mapActions } from "vuex";
import { Message, MessageBox } from "element-ui";
import { mapState, mapActions } from 'vuex'
import { Message, MessageBox } from 'element-ui'
export default {
name: "PersonalPanel",
name: 'PersonalPanel',
props: {
user: Object
},
computed: {
...mapState("d2admin/user", ["info"])
...mapState('d2admin/user', ['info'])
},
data() {
data () {
return {
personalVisible: false,
passwordVisible: false
};
}
},
mounted () {
this.$event.$on('e-ps-close',is2Login =>{
this.$event.$on('e-ps-close', is2Login => {
this.passwordVisible = false
if(!is2Login) return
this.$message(`修改密码成功,2秒后退回登录页`);
if (!is2Login) return
this.$message(`修改密码成功,2秒后退回登录页`)
setTimeout(async () => {
await this.logout();
this.$router.push("/login");
},2000)
await this.logout()
this.$router.push('/login')
}, 2000)
})
this.$event.$on('e-pd-close',()=>this.personalVisible = false)
this.$event.$on('e-pd-close', () => this.personalVisible = false)
},
components: {
personalDialog: () => import("./personalDialog"),
passwordDialog: () => import("./passwordDialog")
personalDialog: () => import('./personalDialog'),
passwordDialog: () => import('./passwordDialog')
},
methods: {
...mapActions("d2admin/account", ["logout"]),
...mapActions('d2admin/account', ['logout']),
/**
* @description 登出
*/
logOut() {
this.$store.commit("d2admin/gray/set", true);
MessageBox.confirm("确定要注销当前用户吗", "注销用户", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
logOut () {
this.$store.commit('d2admin/gray/set', true)
MessageBox.confirm('确定要注销当前用户吗', '注销用户', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(async () => {
await this.$store.commit("d2admin/gray/set", false);
await this.$store.commit('d2admin/gray/set', false)
// await this.$store.dispatch('d2admin/user/set', {})
await this.logout();
this.$router.push("/login");
await this.logout()
this.$router.push('/login')
})
.catch(() => {
this.$store.commit("d2admin/gray/set", false);
this.$store.commit('d2admin/gray/set', false)
// Message({
// message: '取消注销操作'
// })
});
})
},
clear() {
this.$store.commit("d2admin/gray/set", true);
clear () {
this.$store.commit('d2admin/gray/set', true)
MessageBox.confirm(
"清空缓存将重置所有个性化设置并退出到登录界面",
"清空缓存",
'清空本地缓存将重置所有个性化设置并退出到登录界面',
'清空本地缓存',
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
)
.then(async () => {
await this.$store.commit("d2admin/gray/set", false);
localStorage.clear();
window.location.reload();
await this.$store.commit('d2admin/gray/set', false)
localStorage.clear()
window.location.reload()
})
.catch(() => {
this.$store.commit("d2admin/gray/set", false);
this.$store.commit('d2admin/gray/set', false)
// Message({
// message: '取消清除缓存操作'
// })
});
})
},
comfirm(text, title, cancleText) {
comfirm (text, title, cancleText) {
return new Promise((reject, resolve) => {
this.$store.commit("d2admin/gray/set", true);
this.$store.commit('d2admin/gray/set', true)
MessageBox.confirm(text, title, {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(async () => {
await this.$store.commit("d2admin/gray/set", false);
resolve(true);
await this.$store.commit('d2admin/gray/set', false)
resolve(true)
})
.catch(() => {
this.$store.commit("d2admin/gray/set", false);
this.$store.commit('d2admin/gray/set', false)
Message({
message: cancleText
});
reject();
});
});
})
reject()
})
})
},
// 打开个人信息弹出框
openPersonalDialog: function() {
this.personalVisible = true;
openPersonalDialog: function () {
this.personalVisible = true
},
openPasswordDialog: function() {
this.passwordVisible = true;
openPasswordDialog: function () {
this.passwordVisible = true
}
}
};
}
</script>
<style lang="scss" scoped>
......@@ -235,8 +235,7 @@ export default {
margin-right: 1px;
font-size: 14px;
text-align: center;
padding-top: 10px;
padding-bottom: 10px;
padding:2px 0;
border-color: rgba(180, 190, 190, 0.2);
border-top-width: 1px;
border-top-style: solid;
......
......@@ -31,11 +31,11 @@
</template>
<script>
import { ModifyPassword } from "@api/sys.account";
import { ModifyPassword } from '@api/sys.account'
export default {
name: "PasswordDialog",
name: 'PasswordDialog',
components: {},
data() {
data () {
return {
rules: Object.freeze({
oldPassword: [
......@@ -71,49 +71,49 @@ export default {
}
]
})
};
}
},
props: {
visible: {
type: Boolean,
default: false
},
user:Object
user: Object
},
computed: {
info(){
return this.user
info () {
return this.user
}
},
methods: {
// 修改密码
submit() {
submit () {
this.$refs.passwordForm.validate(async valid => {
if (valid) {
const { userId, oldPassword, newPassword } = this.info
const result = await ModifyPassword({ userId, oldPassword, newPassword })
console.log(result);
console.log(result)
const { operateStatus } = result
if(operateStatus){
if (operateStatus) {
this.emit(true)
return
}
this.$message.error('修改密码失败')
}
});
})
},
handleClose() {
handleClose () {
this.emit(false)
},
emit(is2Login){
this.$event.$emit("e-ps-close",is2Login);
emit (is2Login) {
this.$event.$emit('e-ps-close', is2Login)
this.$refs.passwordForm.validateField()
}
}
};
}
</script>
<style lang='scss'>
.password-detail {
}
</style>
......@@ -39,20 +39,20 @@
<script>
// import { ctMethods, request } from '@/api'
export default {
name: "personalDialog",
name: 'personalDialog',
props: {
visible: {
type: Boolean,
default: false
},
user:Object
user: Object
},
methods: {
handleClose() {
this.$event.$emit("e-pd-close");
handleClose () {
this.$event.$emit('e-pd-close')
}
}
};
}
</script>
<style>
.personal-detail {
......
......@@ -2,7 +2,7 @@
* @Author: limin
* @Date: 2019-08-27 19:16:26
* @Last Modified by: limin
* @Last Modified time: 2019-09-08 12:02:47
* @Last Modified time: 2019-09-08 20:54:05
*/
import { cloneDeep } from 'lodash'
const permision = {}
......
......@@ -18,7 +18,6 @@ function errorCreate (msg) {
throw error
}
// 记录和显示错误
function errorLog (error) {
// 添加到日志
......@@ -62,7 +61,7 @@ service.interceptors.request.use(
} = config
if (!LogExternals.some(u => u === url || (params && u === params.method))) {
const token = util.cookies.get('token')
if (!token ) { //判断是否长时间未操作
if (!token) { // 判断是否长时间未操作
await store.dispatch('d2admin/account/logout')
router.replace('/login')
}
......
......@@ -42,14 +42,14 @@ router.beforeEach(async (to, from, next) => {
await store.dispatch('d2admin/account/load')
next(to.path)
} else {
if(store.state.d2admin.user.info){
if (store.state.d2admin.user.info) {
next()
}else {
if(to.path=='/login'){ //如果是登录页面路径,就直接next()
next();
} else { //不然就跳转到登录;
} else {
if (to.path == '/login') { // 如果是登录页面路径,就直接next()
next()
} else { // 不然就跳转到登录;
await store.dispatch('d2admin/account/logout')
next('/login');
next('/login')
}
}
}
......
......@@ -35,7 +35,7 @@ export const home = {
type: 'button',
category: 'Button',
handle: 'exportFile',
icon:'download'
icon: 'download'
}]
}
export const sys = [
......@@ -97,7 +97,7 @@ export const resources = {
category: 'Button',
type: 'button',
handle: 'handleEdit',
icon:'plus'
icon: 'plus'
}]
},
'103': {
......@@ -128,7 +128,7 @@ export const resources = {
category: 'Button',
type: 'button',
handle: 'handleEdit',
icon:'plus'
icon: 'plus'
}]
},
'104': {
......@@ -159,14 +159,14 @@ export const resources = {
type: 'button',
category: 'Button',
handle: 'exportFile',
icon:'download'
icon: 'download'
}, {
authId: '10404',
parentId: '104',
label: '导入',
type: 'button',
category: 'Button',
icon:'upload2'
icon: 'upload2'
}]
},
'105': {
......@@ -221,7 +221,7 @@ export const resources = {
category: 'Button',
type: 'button',
handle: 'exportFile',
icon:'download'
icon: 'download'
}]
},
'10602': {
......@@ -247,7 +247,7 @@ export const resources = {
category: 'Button',
type: 'button',
handle: 'exportOrder',
icon:'download'
icon: 'download'
}]
},
'107': {
......@@ -309,7 +309,7 @@ export const resources = {
category: 'action',
type: 'button',
handle: 'handleRegister',
icon:'plus'
icon: 'plus'
}],
component: _import('userManage/user')
},
......@@ -329,7 +329,7 @@ export const resources = {
label: '创建角色',
handle: 'handleEdit',
type: 'button',
icon:'plus'
icon: 'plus'
}, {
authId: '1070202',
parentId: '10702',
......@@ -369,7 +369,7 @@ export const resources = {
category: 'Button',
type: 'button',
handle: 'handleExport',
icon:'download'
icon: 'download'
}]
}
}
......
......@@ -24,10 +24,10 @@ export default {
// token 代表用户当前登录状态 建议在网络请求中携带 token
// 如有必要 token 需要定时更新,默认保存一天
util.cookies.set('uuid', data.loginName)
const authes = (data.roleType == SUPPER_ADMIN)?
util.permision.flatten(Object.values(localRoutes))
.map(obj => ({ authId: obj.authId, parentId: obj.parentId }))
: cloneDeep(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 用户信息
await dispatch('d2admin/user/set', data, { root: true })
......
......@@ -68,9 +68,9 @@ export default {
resolve()
})
},
loadFromDB({ state, dispatch, commit }) {
loadFromDB ({ state, dispatch, commit }) {
return new Promise(async resolve => {
const color= await dispatch('d2admin/db/get', {
const color = await dispatch('d2admin/db/get', {
dbName: 'sys',
path: 'color.value',
defaultValue: '',
......
......@@ -67,7 +67,7 @@ export default {
user: true
}, { root: true })
}
const color = await dispatch("d2admin/color/loadFromDB",null,{root: true})
const color = await dispatch('d2admin/color/loadFromDB', null, { root: true })
// 设置ui 颜色
await dispatch('d2admin/color/set', color || __theme.color, { root: true })
// 将 vuex 中的主题应用到 dom
......
......@@ -21,7 +21,7 @@ export default {
// value: info,
// user: true
// }, { root: true })
sessionStorage.setItem('user',escape(JSON.stringify(info)))
sessionStorage.setItem('user', escape(JSON.stringify(info)))
// end
resolve()
})
......@@ -39,7 +39,7 @@ export default {
// defaultValue: {},
// user: true
// }, { root: true })
state.info=JSON.parse(unescape(sessionStorage.getItem('user')))
state.info = JSON.parse(unescape(sessionStorage.getItem('user')))
// end
resolve()
})
......
......@@ -184,7 +184,7 @@ export default {
baseData: {
station: []
},
fileInfo: { fileType: '', fileBase: '' },
fileInfo: { fileType: '', fileBase: '' }
}
},
......@@ -290,16 +290,16 @@ export default {
}
}).then(res => {
// console.log(res)
if(!res.data.data.url) {
if (!res.data.data.url) {
notice.okTips()
} else {
window.location.href = res.data.data.url
notice.errorTips()
}
document.getElementById('fileUpload').value = null;
document.getElementById('fileUpload').value = null
}).catch(err => {
notice.errorTips(err)
document.getElementById('fileUpload').value = null;
document.getElementById('fileUpload').value = null
})
// importApi(params, noSignAttr).then(res => {
// notice.okTips()
......@@ -312,10 +312,9 @@ export default {
exportFile () {
const params = this.getParams()
exportApi(params).then(res => {
console.log(res)
window.location.href = res.url
notice.okTips()
}).catch(err => {
}).catch(() => {
notice.errorTips()
})
},
......
......@@ -135,10 +135,6 @@ export default {
type: 'input',
model: 'taskCode'
}, {
label: '创建时间',
type: 'datePick',
model: 'createTime'
}, {
label: '订单类型',
type: 'select',
model: 'taskType',
......@@ -192,6 +188,10 @@ export default {
confValue: '181故障',
confCode: '4'
}]
}, {
label: '创建时间',
type: 'datePick',
model: 'createTime'
}],
// 表格
tableLoading: false,
......@@ -249,7 +249,7 @@ export default {
}, {
label: '故障描述',
prop: 'downDescription',
width:'300'
width: '300'
}, {
label: '处理方式',
prop: 'treatment',
......
......@@ -49,5 +49,5 @@ export default {
padding: 0;
background-color: #202223
}
}
}
</style>
......@@ -10,15 +10,6 @@
<el-form-item label="订单编号">
<el-input v-model="searchForm.orderCode" placeholder="请输入订单编号" clearable></el-input>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="searchForm.createTime"
type="daterange"
value-format="yyyy-MM-dd"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label="订单类型">
<el-select v-model="searchForm.orderType" placeholder="请选择订单类型" clearable filterable>
<el-option label="物料申请" value="1"></el-option>
......@@ -38,6 +29,15 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="searchForm.createTime"
type="daterange"
value-format="yyyy-MM-dd"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
</el-form-item>
......@@ -155,7 +155,7 @@ export default {
}, {
value: 6,
label: '已签收'
}, ],
} ],
// 表格
tableLoading: false,
tableData: [],
......@@ -248,6 +248,7 @@ export default {
this.$open(res.url)
// notice.okTips()
}).catch(err => {
console.log(err)
notice.errorTips()
})
},
......@@ -288,6 +289,7 @@ export default {
this.pdfUrl = res.url
this.detailVisible = !this.detailVisible
}).catch(err => {
console.log(err)
notice.errorTips()
})
},
......@@ -301,13 +303,13 @@ export default {
// console.log(row)
removeApi({
orderCode: row.orderCode
}).then(res => {
}).then(() => {
notice.okTips()
this.loadingGetList()
}).catch(err => {
notice.errorTips()
})
}).catch(err => {})
}).catch(() => {})
}
}
}
......
......@@ -128,13 +128,13 @@ export default {
}
},
mounted() {
mounted () {
this.loadingGetList()
this.loadBaseData()
},
methods: {
async loadBaseData() {
async loadBaseData () {
const data = await this.$store.dispatch('d2admin/base/get', BaseData.STATION.KEY)
this.baseData.station = data
},
......@@ -147,7 +147,7 @@ export default {
return Object.assign(
{
pageCount: this.pageSize,
pageSize: this.currentPage,
pageSize: this.currentPage
},
this.searchForm
)
......@@ -169,7 +169,7 @@ export default {
})
},
handleExport() {
handleExport () {
const params = this.getParams()
params.startTime = params.reportTime ? params.reportTime[0] + ' ' + '00:00:00 ' : ''
params.endTime = params.reportTime ? params.reportTime[1] + ' ' + '23:59:59' : ''
......@@ -178,7 +178,7 @@ export default {
console.log(res)
window.location.href = res.url
notice.okTips()
}).catch(err => {
}).catch(() => {
notice.errorTips()
})
},
......
......@@ -162,7 +162,7 @@ export default {
}, {
label: '生产厂家',
prop: 'merchantName',
width:'220'
width: '220'
}, {
label: '发送结点序列',
prop: 'sendSequence'
......@@ -193,10 +193,10 @@ export default {
methods: {
async loadBaseData() {
async loadBaseData () {
const data = await this.$store.dispatch('d2admin/base/get', BaseData.SUBSYS.KEY)
this.baseData.subsys = data
},
},
loadingGetList () {
this.tableLoading = true
......@@ -239,13 +239,13 @@ export default {
gatewayUrl: '',
gatewayPort: ''
}
if(!value.id) {
if (!value.id) {
delete params.id
} else {
delete params.subsystemCode
delete params.trafficCode
}
for(var item in params) {
for (var item in params) {
params[item] = value[item]
}
for (var i in this.baseData.subsys) {
......@@ -260,7 +260,7 @@ export default {
this.handleEditClose()
notice.okTips()
this.loadingGetList()
}).catch(err => {
}).catch(() => {
notice.errorTips()
})
},
......@@ -301,7 +301,7 @@ export default {
handleEditConfirm () {
var editParams = JSON.parse(JSON.stringify(this.editForm))
this.editSubSystem(this.editForm)
this.editSubSystem(editParams)
},
// 表格-编辑
......@@ -325,13 +325,13 @@ export default {
removeApi({
id: row.id,
usedStatus: 2
}).then(res => {
}).then(() => {
notice.okTips()
this.loadingGetList()
}).catch(err => {
}).catch(() => {
notice.errorTips()
})
}).catch(err => {})
}).catch(() => {})
}
}
}
......
......@@ -195,7 +195,7 @@ export default {
},
// 加载业务所需所有数据
async fetchData () {
const { role, company, depart, station, post } = await this.load()
const { station, post } = await this.load()
this.baseData.posts = post
this.baseData.stations = station
Object.freeze(this.baseData)
......
......@@ -81,22 +81,22 @@
</template>
<script>
import dayjs from "dayjs";
import { mapActions, mapState } from "vuex";
import { LOGIN_TYPE } from "@/common/constants";
import dayjs from 'dayjs'
import { mapActions } from 'vuex'
import { LOGIN_TYPE } from '@/common/constants'
export default {
components: {
DialogReg: () => import("./dialogReg")
DialogReg: () => import('./dialogReg')
},
data() {
data () {
return {
registerDialogVisible: false,
timeInterval: null,
time: dayjs().format("HH:mm:ss"),
time: dayjs().format('HH:mm:ss'),
// 表单
formLogin: {
loginName: 'test0001',//"limin3",
password: "123456",
loginName: 'test0001', // "limin3",
password: '123456',
loginType: LOGIN_TYPE
},
// 表单校验
......@@ -104,56 +104,56 @@ export default {
loginName: [
{
required: true,
message: "请输入用户名",
trigger: "blur"
message: '请输入用户名',
trigger: 'blur'
}
],
password: [
{
required: true,
message: "请输入密码",
trigger: "blur"
message: '请输入密码',
trigger: 'blur'
}
]
})
};
}
},
mounted() {
this.timeInterval = setInterval(() => this.refreshTime(), 1000);
this.$event.$on("e-reg-dialog", res => (this.registerDialogVisible = res));
mounted () {
this.timeInterval = setInterval(() => this.refreshTime(), 1000)
this.$event.$on('e-reg-dialog', res => (this.registerDialogVisible = res))
},
beforeDestroy() {
clearInterval(this.timeInterval);
beforeDestroy () {
clearInterval(this.timeInterval)
},
methods: {
...mapActions("d2admin/account", ["login"]),
refreshTime() {
this.time = dayjs().format("HH:mm:ss");
...mapActions('d2admin/account', ['login']),
refreshTime () {
this.time = dayjs().format('HH:mm:ss')
},
// 提交登录信息
submit() {
submit () {
// console.log(navigator.userAgent.toLocaleLowerCase())
this.$refs.loginForm.validate(valid => {
if (valid) {
const { browser, os } = this.$store.state.d2admin.ua.data;
const { browser, os } = this.$store.state.d2admin.ua.data
const _p = {
...this.formLogin,
deviceCode: `${os.name}${os.version}-${browser.name}${browser.version}`
};
}
// 登录
// 注意 这里的演示没有传验证码
// 具体需要传递的数据请自行修改代码
this.login(_p)
.then(() => this.$store.dispatch("d2admin/auth/init"))
.then(_ => this.$router.replace(this.$route.query.redirect || "/"));
.then(() => this.$store.dispatch('d2admin/auth/init'))
.then(_ => this.$router.replace(this.$route.query.redirect || '/'))
} else {
// 登录表单校验失败
this.$message.error("表单校验失败,请检查");
this.$message.error('表单校验失败,请检查')
}
});
})
}
}
};
}
</script>
<style lang="scss">
......
......@@ -269,7 +269,7 @@ export default {
const { station, subsys } = await this.load()
this.baseData.station = cloneDeep(station)
this.baseData.subsys = cloneDeep(subsys)
this.baseData.subsys.unshift({ confCode: '', confValue: '全部'})
this.baseData.subsys.unshift({ confCode: '', confValue: '全部' })
// console.log(this.baseData)
},
......@@ -321,18 +321,19 @@ export default {
// link.style.display = 'none'
// link.href = url
// link.setAttribute('download', 'excel.xlsx')
// document.body.appendChild(link)
// link.click()
}).catch(err => {
console.log(err)
notice.errorTips()
})
},
/* 接口请求-end */
/* onlineNum Int 在网数量
offlineNum int 离网数量
normalNum Int 正常数量
breakdownNum Int 故障数量 */
// /* onlineNum Int 在网数量
// offlineNum int 离网数量
// normalNum Int 正常数量
// breakdownNum Int 故障数量 */
drawPie (params) {
this.totalOptions.series[0].data[0].value = params.onlineNum
this.totalOptions.series[0].data[1].value = params.offlineNum
......
......@@ -185,7 +185,7 @@ export default {
},
methods: {
async loadBaseData() {
async loadBaseData () {
const data = await this.$store.dispatch('d2admin/base/get', BaseData.STATION.KEY)
this.baseData.station = data
},
......@@ -216,14 +216,14 @@ export default {
editTraffic (value) {
// console.log(value)
const params = {
id : '',
id: '',
trafficCode: '',
stationCode: '',
stationName: '',
merchantName: '',
openType: ''
}
for(var item in params) {
for (var item in params) {
params[item] = value[item]
}
for (var i in this.baseData.station) {
......@@ -301,9 +301,10 @@ export default {
notice.okTips()
this.loadingGetList()
}).catch(err => {
console.log(err)
notice.errorTips()
})
}).catch(err => {})
}).catch(err => { console.log(err) })
}
}
}
......
......@@ -10,6 +10,12 @@
<el-form-item label="用户">
<el-input v-model="searchForm.userName" placeholder="请输入用户名/姓名/联系电话" clearable></el-input>
</el-form-item>
<el-form-item label="登录方式">
<el-select v-model="searchForm.loginType" placeholder="请选择" clearable filterable>
<el-option label="PC" value="1"></el-option>
<el-option label="小程序" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="登录时间">
<el-date-picker
v-model="searchForm.loginTime"
......@@ -20,12 +26,6 @@
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="登录方式">
<el-select v-model="searchForm.loginType" placeholder="请选择" clearable filterable>
<el-option label="PC" value="1"></el-option>
<el-option label="小程序" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
</el-form-item>
......@@ -87,7 +87,7 @@ export default {
tableColumns: [{
label: '登录时间',
prop: 'loginTime',
width:'200px'
width: '200px'
}, {
label: '登录用户',
prop: 'loginName'
......@@ -97,14 +97,14 @@ export default {
}, {
label: '联系电话',
prop: 'mobile',
width:'180px'
width: '180px'
}, {
label: '登录方式',
prop: 'loginTypeValue'
}, {
label: '登录设备',
prop: 'deviceCode',
width:'300px'
width: '300px'
}],
// 页码
currentPage: 1,
......@@ -125,7 +125,7 @@ export default {
return Object.assign(
{
pageCount: this.pageSize,
pageSize: this.currentPage,
pageSize: this.currentPage
},
this.searchForm
)
......
......@@ -23,6 +23,7 @@
:rows="2"
placeholder="角色描述"
clearable
maxlength="50"
v-model="roleForm.description">
</el-input>
</el-form-item>
......@@ -37,7 +38,6 @@
</template>
<script>
import { RoleReg, RoleModify } from '@/api/sys.account'
import { mapActions } from 'vuex'
import notice from '@/common/notice'
import RoleTree from './roleTree'
import { localRoutes } from '@/router/routes'
......@@ -79,6 +79,7 @@ export default {
const clone = util.deepClone(Object.values(localRoutes))
const { menus } = util.permision.packMenusBtns(clone)
const all = util.permision.flatten(clone)
menus.find(o=>o.authId==='101').disabled=true
return { menus, all }
}
},
......@@ -109,8 +110,8 @@ export default {
this.$refs.roleForm.validate(vaild => {
if (vaild) {
const authIds = this.$refs.roleTree.getCheckedNodes()
if (authIds.length===0){
this.$message.error('请选择权限!');
if (authIds.length === 0) {
this.$message.error('请选择权限!')
return
}
var __p = { ...this.roleForm, authIds }
......
......@@ -43,7 +43,6 @@
<script>
import { RoleList, RoleDetail } from '@/api/sys.account'
import notice from '@/common/notice'
import util from '@/libs/util'
export default {
name: 'FimsRoles',
components: {
......@@ -95,7 +94,7 @@ export default {
RoleList()
.then(res => {
this.tableData = res
const { pagination, roles } = res
const { roles } = res
this.tableData = roles
// this.page = pagination
this.tableLoading = false
......
......@@ -29,7 +29,6 @@
</div>
</template>
<script>
import util from '@/libs/util.js'
export default {
data () {
return { checked: [] }
......@@ -40,7 +39,7 @@ export default {
default: {}
},
authIds: [],
close: false
close: Boolean
},
watch: {
close (value) {
......@@ -50,11 +49,13 @@ export default {
handler (value) {
if (!value) return
let chk = []
let treeChk = []
let treeChk = ['101']
this.$nextTick(() => {
value.forEach(v => {
v.authId += ''
const check = this.find(v.authId).hasOwnProperty('handle') ? chk : treeChk
const node = this.find(v.authId)
if(!node) return true
const check = node.hasOwnProperty('handle') ? chk : treeChk
check.push(v.authId)
})
this.$refs.tree.setCheckedKeys(treeChk)
......
......@@ -27,7 +27,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="联系方式:" prop="mobile">
<el-input v-model="regForm.mobile" placeholder="请输入联系方式" clearable></el-input>
<el-input v-model="regForm.mobile" placeholder="请输入联系方式" maxlength="11" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
......
......@@ -8,16 +8,6 @@
<el-form-item label="所属公司:">
<el-input v-model="searchForm.companyName" placeholder="请输入公司名" clearable></el-input>
</el-form-item>
<el-form-item label="注册时间:">
<el-date-picker
v-model="searchTimes"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
></el-date-picker>
</el-form-item>
<el-form-item label="角色:">
<el-select v-model="searchForm.roleId" clearable placeholder="请选择">
<el-option
......@@ -54,6 +44,16 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="注册时间:">
<el-date-picker
v-model="searchTimes"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
</el-form-item>
......@@ -148,7 +148,6 @@ export default {
searchForm: {
userName: '',
companyName: '',
postCode: '',
status: '',
stationCode: '',
postCode: ''
......@@ -184,7 +183,8 @@ export default {
...mapActions('d2admin/base', ['load']),
// 加载业务所需所有数据
fetchData () {
this.loadBaseData(), this.loadUserList()
this.loadBaseData()
this.loadUserList()
},
async loadBaseData () {
......@@ -200,8 +200,8 @@ export default {
let endTime = ''
if (this.searchTimes && this.searchTimes.length) {
[startTime, endTime] = this.searchTimes
startTime=`${startTime} 00:00:00`
endTime=`${endTime} 23:59:59`
startTime = `${startTime} 00:00:00`
endTime = `${endTime} 23:59:59`
}
return {
...this.page,
......@@ -255,10 +255,10 @@ export default {
const res = await this.apiMapping[_actionText]({ userId: row.userId })
const { operateStatus } = res
if (operateStatus) {
notice.okTips(`${_actionText}成功!`)
this.loadUserList()
notice.okTips(`${_actionText}成功!`)
this.loadUserList()
} else {
notice.errorTips(`${this.title}失败!`)
notice.errorTips(`${_actionText}失败!`)
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!