Commit ae49b7a2 by qinjianhui

feat: 运维工具

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