Commit f1a5844e authored by renjintao's avatar renjintao

bug

parent f0447fae
/*
* @Author: your name
* @Date: 2020-03-30 13:55:31
* @LastEditTime: 2020-11-30 13:54:01
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \mes-ui\api\bug.js
*/
import Api from '@/plugins/request' import Api from '@/plugins/request'
export default { export default {
index: `${bugUrl}/bugmain/paged`, index: `${bugUrl}/bugmain/paged`,
...@@ -31,4 +39,8 @@ export default { ...@@ -31,4 +39,8 @@ export default {
get(params) { get(params) {
return Api.get(`${bugUrl}/bugmain/get`,params); return Api.get(`${bugUrl}/bugmain/get`,params);
}, },
//获取当前用户的未解决bug
bugcount() {
return Api.post(`${bugUrl}/bugmain/bugcount`);
},
} }
\ No newline at end of file
<!--
* @Author: your name
* @Date: 2020-03-30 14:07:08
* @LastEditTime: 2020-11-30 15:15:43
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \mes-ui\layouts\basic-layout\header-bug\index.vue
-->
<template> <template>
<span class="i-layout-header-trigger i-layout-header-trigger-min"> <span class="i-layout-header-trigger i-layout-header-trigger-min">
<Dropdown transfer trigger="hover" @on-click="handleClickUserDropdown"> <Dropdown transfer trigger="hover" @on-click="handleClickUserDropdown">
<span @click="openModelBugAdd"> <span @click="openModelBugAdd">
<Badge :count="bugCount === 0 ? null : bugCount" :overflow-count="99" :offset="[10, 0]"> <Badge
<Icon type="ios-bug" size="18" /> :count="bugCount === 0 ? null : bugCount"
</Badge> :overflow-count="99"
</span> :offset="[10, 0]"
<Icon type="md-arrow-dropdown"></Icon> >
<DropdownMenu slot="list"> <Icon type="ios-bug" size="18" />
<DropdownItem name="bug">bug列表</DropdownItem> </Badge>
</DropdownMenu> </span>
<Icon type="md-arrow-dropdown"></Icon>
<DropdownMenu slot="list">
<DropdownItem name="bug">bug列表</DropdownItem>
</DropdownMenu>
</Dropdown> </Dropdown>
<Modal title="新增bug" v-model="bugAdd" fullscreen :z-index="999"> <Modal title="新增bug" v-model="bugAdd" fullscreen :z-index="999">
<addBugModal ref="addBug"></addBugModal> <addBugModal ref="addBug"></addBugModal>
<div slot="footer"> <div slot="footer">
<Button @click="addCancel">取消</Button> <Button @click="addCancel">取消</Button>
<Button type="primary" @click="addSave">确定</Button> <Button type="primary" @click="addSave">确定</Button>
</div> </div>
</Modal> </Modal>
</span> </span>
</template> </template>
<script> <script>
import addBugModal from "@/pages/bug/component/add"; import addBugModal from "@/pages/bug/component/add";
import { mapState } from "vuex";
export default { export default {
name: "addBug", name: "addBug",
components: { components: {
addBugModal addBugModal,
},
data() {
return {
bugAdd: false,
bugCount: this.$store.state.countBug,
};
},
computed: {},
methods: {
async handleClickUserDropdown(name) {
if (name === "bug") {
this.$router.push({
name: "bug",
});
}
}, },
data() { openModelBugAdd() {
return { this.bugAdd = true;
bugAdd: false, this.$refs.addBug.getEid();
bugCount: this.$store.state.countBug this.$refs.addBug.initial();
};
}, },
computed: {}, addCancel() {
methods: { this.$refs.addBug.resetFields();
async handleClickUserDropdown(name) { this.bugAdd = false;
if (name === "bug") {
this.$router.push({
name: "bug"
});
}
},
openModelBugAdd() {
this.bugAdd = true;
this.$refs.addBug.getEid();
this.$refs.addBug.initial();
},
addCancel() {
this.$refs.addBug.resetFields();
this.bugAdd = false;
},
addSave() {
let param = this.$refs.addBug.addBugInfo();
//alert(JSON.stringify(param))
if (param.id == null) {
//增加确定
this.$http.bug.createorupdate(param).then(res => {
if (res.result.status) {
this.$Message.success("新增成功!");
let newId = res.result.bugId;
this.$refs.addBug.updateEid(newId);
} else {
this.$Message.error("新增失败!");
}
this.$refs.addBug.resetFields();
this.bugAdd = false;
});
} else {
this.$Message.error("新增失败!");
}
}
}, },
created() {}, addSave() {
mounted() { let param = this.$refs.addBug.addBugInfo();
this.$store.commit("setCountBug", 66); //alert(JSON.stringify(param))
} if (param.id == null) {
//增加确定
this.$http.bug.createorupdate(param).then((res) => {
if (res.result.status) {
this.$Message.success("新增成功!");
let newId = res.result.bugId;
this.$refs.addBug.updateEid(newId);
} else {
this.$Message.error("新增失败!");
}
this.$refs.addBug.resetFields();
this.bugAdd = false;
});
} else {
this.$Message.error("新增失败!");
}
},
},
created() {},
mounted() {
//获取当前用户未解决bug数量
this.$http.bug.bugcount().then((res) => {
if (res.success) {
this.$store.commit("setCountBug", res.result);
this.bugCount = this.$store.state.countBug;
}
});
},
watch: {
"$store.state.countBug"(v) {
if (v >= 0) {
this.bugCount = v;
}
},
},
}; };
</script> </script>
...@@ -19,7 +19,7 @@ export default { ...@@ -19,7 +19,7 @@ export default {
components: { MainLayout }, components: { MainLayout },
data() { data() {
return { return {
menus: [] menus: [],
}; };
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
...@@ -66,11 +66,11 @@ export default { ...@@ -66,11 +66,11 @@ export default {
this.$store.commit("admin/menu/setOpenNames", openNames); this.$store.commit("admin/menu/setOpenNames", openNames);
} }
// this.appRouteChange(to, from); // this.appRouteChange(to, from);
} },
}, },
methods: { methods: {
getMenu() { getMenu() {
this.$http.sysUser.getusermenu().then(res => { this.$http.sysUser.getusermenu().then((res) => {
if (res.result) { if (res.result) {
this.menus = res.result[0].children; this.menus = res.result[0].children;
this.toMenu(this.menus); this.toMenu(this.menus);
...@@ -85,11 +85,11 @@ export default { ...@@ -85,11 +85,11 @@ export default {
// const openNames = getSiderSubmenu(path, menuSider); // const openNames = getSiderSubmenu(path, menuSider);
// this.$store.commit("admin/menu/setOpenNames", openNames); // this.$store.commit("admin/menu/setOpenNames", openNames);
} }
}); });
}, },
toMenu(list) { toMenu(list) {
list.forEach(datas => { list.forEach((datas) => {
var that = this; var that = this;
var listObj = {}; var listObj = {};
datas.path = datas.url; datas.path = datas.url;
...@@ -105,7 +105,7 @@ export default { ...@@ -105,7 +105,7 @@ export default {
datas.meta = { datas.meta = {
auth: false, auth: false,
title: datas.title, title: datas.title,
closable: true closable: true,
}; };
datas.name = name; datas.name = name;
if (datas.children != null) { if (datas.children != null) {
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
} }
}); });
this.menusNew = list; this.menusNew = list;
} },
} },
}; };
</script> </script>
\ No newline at end of file
...@@ -79,8 +79,8 @@ export default { ...@@ -79,8 +79,8 @@ export default {
// this.oidc(); // this.oidc();
}, },
mounted() { mounted() {
//正确写法 //正确写法
this.$refs.iTenantCode.focus(); this.$refs.iTenantCode.focus();
}, },
methods: { methods: {
...mapActions("admin/account", ["login"]), ...mapActions("admin/account", ["login"]),
......
This diff is collapsed.
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