Commit ae49b7a2 by qinjianhui

feat: 运维工具

parent 73d4887b
......@@ -11,15 +11,13 @@
text-color="#fff"
style="flex: 1"
background-color="#1565C0"
@click.native="onClickMenus"
active-text-color="#ffd04b"
>
@select="onClickMenus"
active-text-color="#ffd04b">
<template v-for="(nav, index) in menuList">
<el-menu-item
:key="index"
v-if="nav.children.length === 0"
:index="nav.index"
>
:index="nav.index">
<template slot="title">
<i :class="nav.icon"></i>
<span class="label">{{ nav.label }}</span>
......@@ -33,14 +31,11 @@
<el-menu-item
:index="subs.index"
v-for="(subs, index) in nav.children"
:key="index"
>
:key="index">
<template slot="title">
<i :class="subs.icon"></i>
<span class="label">{{
subs.label
}}</span></template
>
<span class="label">{{ subs.label }}</span>
</template>
</el-menu-item>
</el-submenu>
</template>
......@@ -51,18 +46,14 @@
</span>
<el-dropdown>
<div size="mini" style="color: #fff">
{{ userInfo && userInfo.realName
}}<i
class="el-icon-arrow-down el-icon--right"
></i>
{{ userInfo && userInfo.realName }}
<i class="el-icon-arrow-down el-icon--right"></i>
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="updatePassword"
>修改密码</el-dropdown-item
>
<el-dropdown-item @click.native="logout"
>退出登录</el-dropdown-item
>
<el-dropdown-item @click.native="updatePassword">
修改密码
</el-dropdown-item>
<el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
......@@ -77,56 +68,60 @@
:close-on-click-modal="false"
title="修改密码"
:visible.sync="dialogVisible"
width="400px"
>
<el-form
:inline="true"
label-width="100px"
size="small"
>
width="400px">
<el-form :inline="true" label-width="100px" size="small">
<el-form-item label="原密码">
<el-input
show-password
v-model="oldPwd"
placeholder="原密码"
></el-input>
placeholder="原密码"></el-input>
</el-form-item>
<el-form-item label="新密码">
<el-input
show-password
v-model="newPwd"
placeholder="新密码"
></el-input>
placeholder="新密码"></el-input>
</el-form-item>
<el-form-item label="确认新密码">
<el-input
show-password
v-model="confimPwd"
placeholder="确认新密码"
></el-input>
placeholder="确认新密码"></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button
size="small"
@click="dialogVisible = false"
>取 消</el-button
>
<el-button
size="small"
type="primary"
@click="resetPasswordSumbit"
>
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="resetPasswordSumbit">
确 定
</el-button>
</div>
</el-dialog>
<el-dialog
title="运维工具"
:visible.sync="omVisible"
:close-on-click-modal="false"
width="800px">
<el-form :model="editForm">
<el-form-item>
<el-input
type="textarea"
:rows="10"
placeholder="请输入内容"
v-model="editForm.content"></el-input>
</el-form-item>
</el-form>
<span slot="footer">
<el-button @click="omVisible = false">取消</el-button>
<el-button @click="submitOm" type="primary">确认</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { mapGetters, mapState } from 'vuex'
import { logout, resetPassword } from '@/common/api/login'
import { setToken, setUser } from '@/utils/auth'
import { post } from '@/common/api/axios'
export default {
name: 'navMenu',
data() {
......@@ -138,7 +133,7 @@ export default {
label: 'ERP管理',
icon: 'el-icon-menu',
index: '/saas/manage',
children: [],
children: []
},
{
id: 3,
......@@ -146,7 +141,7 @@ export default {
label: 'ERP菜单管理',
icon: 'el-icon-menu',
index: '/saas/menu',
children: [],
children: []
},
{
id: 4,
......@@ -154,7 +149,7 @@ export default {
label: '工单管理',
icon: 'el-icon-s-order',
index: '/saas/taskManage',
children: [],
children: []
},
{
id: 2,
......@@ -169,7 +164,7 @@ export default {
label: '用户管理',
icon: 'el-icon-s-order',
index: 'user',
children: [],
children: []
},
{
id: 2,
......@@ -177,7 +172,7 @@ export default {
label: '角色管理',
icon: 'el-icon-s-order',
index: 'user',
children: [],
children: []
},
{
id: 3,
......@@ -185,7 +180,7 @@ export default {
label: '定时任务',
icon: 'el-icon-message-solid',
index: '/saas/timed_task',
children: [],
children: []
},
{
id: 4,
......@@ -193,9 +188,9 @@ export default {
label: '公告管理',
icon: 'el-icon-s-promotion',
index: '/saas/announceManage',
children: [],
},
],
children: []
}
]
},
{
id: 5,
......@@ -210,7 +205,7 @@ export default {
label: '汇率币种',
icon: 'el-icon-bank-card',
index: '/saas/currency',
children: [],
children: []
},
{
id: 4,
......@@ -218,7 +213,7 @@ export default {
label: '国家代码',
icon: 'el-icon-s-flag',
index: '/saas/countryCode',
children: [],
children: []
},
{
id: 5,
......@@ -226,7 +221,7 @@ export default {
label: '州省简称',
icon: 'el-icon-s-help',
index: '/saas/abbreviation',
children: [],
children: []
},
{
id: 6,
......@@ -234,7 +229,7 @@ export default {
label: '客户管理',
icon: 'el-icon-s-custom',
index: '/saas/management',
children: [],
children: []
},
{
id: 7,
......@@ -242,7 +237,7 @@ export default {
label: '运输商列表',
icon: 'el-icon-s-operation',
index: '/saas/logistics/transporters',
children: [],
children: []
},
{
id: 8,
......@@ -250,7 +245,7 @@ export default {
label: '类别风格',
icon: 'el-icon-box',
index: '/saas/category-style',
children: [],
children: []
},
{
id: 9,
......@@ -258,7 +253,7 @@ export default {
label: '属性类别管理',
icon: 'el-icon-box',
index: '/saas/sku-sort',
children: [],
children: []
},
{
id: 10,
......@@ -266,20 +261,32 @@ export default {
label: '商品属性管理',
icon: 'el-icon-box',
index: '/saas/sku-manage',
children: [],
},
],
children: []
}
]
},
{
id: 9,
path: '',
label: '运维工具',
icon: 'el-icon-bank-card',
index: '',
children: [],
}
],
dialogVisible: false,
oldPwd: '',
newPwd: '',
confimPwd: '',
omVisible: false,
editForm: {
content: ''
}
}
},
computed: {
...mapGetters('tags', ['currentTag']),
...mapState(['userInfo']),
...mapState(['userInfo'])
},
watch: {
currentTag(v) {
......@@ -294,7 +301,7 @@ export default {
if (parent) {
this.$refs.menu.open(parent.path)
}
},
}
},
methods: {
updatePassword() {
......@@ -320,7 +327,7 @@ export default {
const res = await resetPassword({
account: this.userInfo.account,
oldPwd: this.oldPwd,
newPwd: this.newPwd,
newPwd: this.newPwd
})
if (res.code === 200) {
this.dialogVisible = false
......@@ -345,8 +352,26 @@ export default {
this.$store.commit('tags/removeAllTags')
this.$router.push('/login')
},
onClickMenus() {},
},
onClickMenus(index) {
if (!index) {
this.omVisible = true
}
},
async submitOm() {
if (!this.editForm.content) {
return this.$message.warning('请输入内容')
}
try {
const res = await post('sys/announcement/get/tool', {
...this.editForm
})
if (res.code !== 200) return
this.$message.success(res.message)
} catch (e) {
console.error(e)
}
}
}
}
</script>
<style lang="scss" scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment