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
:count="bugCount === 0 ? null : bugCount"
:overflow-count="99"
:offset="[10, 0]"
>
<Icon type="ios-bug" size="18" /> <Icon type="ios-bug" size="18" />
</Badge> </Badge>
</span> </span>
...@@ -18,20 +30,21 @@ ...@@ -18,20 +30,21 @@
<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() { data() {
return { return {
bugAdd: false, bugAdd: false,
bugCount: this.$store.state.countBug bugCount: this.$store.state.countBug,
}; };
}, },
computed: {}, computed: {},
...@@ -39,7 +52,7 @@ export default { ...@@ -39,7 +52,7 @@ export default {
async handleClickUserDropdown(name) { async handleClickUserDropdown(name) {
if (name === "bug") { if (name === "bug") {
this.$router.push({ this.$router.push({
name: "bug" name: "bug",
}); });
} }
}, },
...@@ -57,7 +70,7 @@ export default { ...@@ -57,7 +70,7 @@ export default {
//alert(JSON.stringify(param)) //alert(JSON.stringify(param))
if (param.id == null) { if (param.id == null) {
//增加确定 //增加确定
this.$http.bug.createorupdate(param).then(res => { this.$http.bug.createorupdate(param).then((res) => {
if (res.result.status) { if (res.result.status) {
this.$Message.success("新增成功!"); this.$Message.success("新增成功!");
let newId = res.result.bugId; let newId = res.result.bugId;
...@@ -71,11 +84,24 @@ export default { ...@@ -71,11 +84,24 @@ export default {
} else { } else {
this.$Message.error("新增失败!"); this.$Message.error("新增失败!");
} }
} },
}, },
created() {}, created() {},
mounted() { mounted() {
this.$store.commit("setCountBug", 66); //获取当前用户未解决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);
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
}); });
}, },
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
<template> <template>
<div class="myBug"> <div class="myBug">
<Tabs :animated="false" @on-click="tab"> <Tabs :animated="false" @on-click="tab">
<TabPane label="我的"></TabPane> <TabPane label="我的"></TabPane>
<TabPane label="所有"></TabPane> <TabPane label="所有"></TabPane>
</Tabs> </Tabs>
<DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch" @on-selection-change="selectInfo" :height="gridHeight"> <DataGrid
:columns="columns"
ref="grid"
:action="action"
:conditions="easySearch"
@on-selection-change="selectInfo"
:height="gridHeight"
>
<template slot="easySearch"> <template slot="easySearch">
<Form inline> <Form inline>
<FormItem> <FormItem>
<dictionary code="Test.bug.status" v-model="easySearch.status.value" style="width:400px;" multiple></dictionary> <dictionary
code="Test.bug.status"
v-model="easySearch.status.value"
style="width: 400px"
multiple
></dictionary>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Input search enter-button placeholder="请输入bug标题或地址" @on-search="search" v-model="easySearch.keys.value" /> <Input
search
enter-button
placeholder="请输入bug标题或地址"
@on-search="search"
v-model="easySearch.keys.value"
/>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
...@@ -19,12 +37,28 @@ ...@@ -19,12 +37,28 @@
<Search /> <Search />
</template> </template>
<template slot="batch"> <template slot="batch">
<Form :model="formMyCheck" :label-width="5" :rules="ruleValidate" inline ref="formValidate"> <Form
:model="formMyCheck"
:label-width="5"
:rules="ruleValidate"
inline
ref="formValidate"
>
<FormItem> <FormItem>
<dictionary code="Test.but.statusOper" v-model="selectBatch" type="radio" @on-change="statuChange" ref="dicradio"></dictionary> <dictionary
code="Test.but.statusOper"
v-model="selectBatch"
type="radio"
@on-change="statuChange"
ref="dicradio"
></dictionary>
</FormItem> </FormItem>
<FormItem v-if="selectBatch == 5" label prop="selectAlloter"> <FormItem v-if="selectBatch == 5" label prop="selectAlloter">
<UserSelect ref="userSelected" v-model="alloter" @on-change="changeUserSelect" /> <UserSelect
ref="userSelected"
v-model="alloter"
@on-change="changeUserSelect"
/>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button type="primary" @click="upChange">确定</Button> <Button type="primary" @click="upChange">确定</Button>
...@@ -33,14 +67,24 @@ ...@@ -33,14 +67,24 @@
</template> </template>
</DataGrid> </DataGrid>
<Modal v-model="modalEdit" fullscreen title="bug编辑" @on-cancel="canselModal(1)"> <Modal
v-model="modalEdit"
fullscreen
title="bug编辑"
@on-cancel="canselModal(1)"
>
<edit ref="edit" /> <edit ref="edit" />
<div slot="footer"> <div slot="footer">
<Button @click="canselModal(1)">取消</Button> <Button @click="canselModal(1)">取消</Button>
<Button type="primary" @click="addSave">确定</Button> <Button type="primary" @click="addSave">确定</Button>
</div> </div>
</Modal> </Modal>
<Modal v-model="modalDetail" fullscreen title="bug操作" @on-cancel="canselModal(2)"> <Modal
v-model="modalDetail"
fullscreen
title="bug操作"
@on-cancel="canselModal(2)"
>
<detail ref="detail" /> <detail ref="detail" />
<div slot="footer"> <div slot="footer">
<Button @click="canselModal(2)">取消</Button> <Button @click="canselModal(2)">取消</Button>
...@@ -54,7 +98,7 @@ ...@@ -54,7 +98,7 @@
<Button type="primary" @click="upSave">确定</Button> <Button type="primary" @click="upSave">确定</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
...@@ -67,7 +111,7 @@ export default { ...@@ -67,7 +111,7 @@ export default {
components: { components: {
edit, edit,
detail, detail,
Search Search,
}, },
data() { data() {
let userInfo = this.$store.state.admin.user.info; let userInfo = this.$store.state.admin.user.info;
...@@ -76,16 +120,16 @@ export default { ...@@ -76,16 +120,16 @@ export default {
easySearch: { easySearch: {
keys: { keys: {
op: "title,pagePath", op: "title,pagePath",
value: "" value: "",
}, },
status: { status: {
op: "In", op: "In",
value: [1, 5, 0] value: [1, 5, 0],
}, },
creatorUserId: { creatorUserId: {
op: "Equal", op: "Equal",
value: userInfo.userId value: userInfo.userId,
} },
}, },
selectList: [], selectList: [],
results: [], results: [],
...@@ -96,20 +140,21 @@ export default { ...@@ -96,20 +140,21 @@ export default {
pageSizeOpts: [20, 50, 100], pageSizeOpts: [20, 50, 100],
pageSize: 20, pageSize: 20,
tabIndex: 1, tabIndex: 1,
columns: [{ columns: [
{
type: "selection", type: "selection",
width: 60, width: 60,
align: "center" align: "center",
}, },
{ {
key: "id", key: "id",
width: 80, width: 80,
title: this.l("id") title: this.l("id"),
}, },
{ {
title: this.l("level"), title: this.l("level"),
key: "level", key: "level",
width: 100 width: 100,
}, },
{ {
title: this.l("title"), title: this.l("title"),
...@@ -118,16 +163,17 @@ export default { ...@@ -118,16 +163,17 @@ export default {
tooltip: true, tooltip: true,
render: (h, params) => render: (h, params) =>
h( h(
"a", { "a",
{
style: {}, style: {},
on: { on: {
click: () => { click: () => {
this.detailInfo(params.row); this.detailInfo(params.row);
} },
} },
}, },
params.row.title params.row.title
) ),
}, },
{ {
title: this.l("pagePath"), title: this.l("pagePath"),
...@@ -135,50 +181,51 @@ export default { ...@@ -135,50 +181,51 @@ export default {
tooltip: true, tooltip: true,
render: (h, params) => render: (h, params) =>
h( h(
"a", { "a",
{
style: {}, style: {},
on: { on: {
click: () => { click: () => {
window.open(params.row.pagePath, "_blank"); window.open(params.row.pagePath, "_blank");
} },
} },
}, },
params.row.pagePath params.row.pagePath
) ),
}, },
{ {
title: this.l("status"), title: this.l("status"),
key: "status", key: "status",
width: 100, width: 100,
code: 'Test.bug.status', code: "Test.bug.status",
}, },
{ {
title: this.l("creationTime"), title: this.l("creationTime"),
key: "creationTime", key: "creationTime",
align: "center", align: "center",
width: 180 width: 180,
}, },
{ {
title: this.l("createor"), title: this.l("createor"),
key: "createor", key: "createor",
width: 120 width: 120,
}, },
{ {
title: this.l("alloter"), title: this.l("alloter"),
key: "alloter", key: "alloter",
width: 120 width: 120,
}, },
{ {
title: this.l("lastModificationTime"), title: this.l("lastModificationTime"),
key: "lastModificationTime", key: "lastModificationTime",
align: "center", align: "center",
width: 180 width: 180,
}, },
{ {
title: this.l("auditUser"), title: this.l("auditUser"),
align: "center", align: "center",
key: "auditUser", key: "auditUser",
width: 120 width: 120,
}, },
{ {
key: "action", key: "action",
...@@ -188,66 +235,69 @@ export default { ...@@ -188,66 +235,69 @@ export default {
render: (h, params) => render: (h, params) =>
h("div", [ h("div", [
h( h(
"Button", { "Button",
{
props: { props: {
type: "text", type: "text",
size: "small" size: "small",
}, },
style: { style: {
color: "green" color: "green",
}, },
on: { on: {
click: () => { click: () => {
this.detailInfo(params.row); this.detailInfo(params.row);
} },
} },
}, },
"解决" "解决"
), ),
h( h(
"Button", { "Button",
{
props: { props: {
type: "text", type: "text",
size: "small" size: "small",
}, },
style: { style: {
color: "green" color: "green",
}, },
on: { on: {
click: () => { click: () => {
this.editInfo(params.row); this.editInfo(params.row);
} },
} },
}, },
"编辑" "编辑"
) ),
]) ]),
} },
], ],
statusList: [{ statusList: [
{
name: "确认", name: "确认",
value: "1" value: "1",
}, },
{ {
name: "解决", name: "解决",
value: "2" value: "2",
}, },
{ {
name: "冻结", name: "冻结",
value: "4" value: "4",
}, },
{ {
name: "关闭", name: "关闭",
value: "3" value: "3",
} },
], ],
modalEdit: false, modalEdit: false,
modalDetail: false, modalDetail: false,
searchForm: { searchForm: {
Status: 0, Status: 0,
PageSize: 20, PageSize: 20,
Current: 1 Current: 1,
}, },
listBatch: { listBatch: {
ids: [], ids: [],
...@@ -256,29 +306,28 @@ export default { ...@@ -256,29 +306,28 @@ export default {
workHours: 0, workHours: 0,
remark: "", remark: "",
alloter: "", alloter: "",
alloterId: null alloterId: null,
}, },
selectBatch: 100, selectBatch: 100,
auditUser: null, auditUser: null,
alloter: {}, alloter: {},
formMyCheck: { formMyCheck: {
selectAlloter: null selectAlloter: null,
}, },
ruleValidate: { ruleValidate: {
selectAlloter: [{ selectAlloter: [
{
required: true, required: true,
message: "请选择驳指派人", message: "请选择驳指派人",
type: "number", type: "number",
trigger: "change" trigger: "change",
}] },
} ],
},
}; };
}, },
computed: {}, computed: {},
async fetch({ async fetch({ store, params }) {
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
...@@ -293,7 +342,15 @@ export default { ...@@ -293,7 +342,15 @@ export default {
}, },
search() { search() {
this.$refs.grid.easySearch(this.easySearch); this.$refs.grid.easySearch(this.easySearch);
this.Api this.getBugCount();
},
//获取用户未解决bug数量
getBugCount() {
this.$http.bug.bugcount().then((res) => {
if (res.success) {
this.$store.commit("setCountBug", res.result);
}
});
}, },
//打开修改窗口 //打开修改窗口
editInfo(value) { editInfo(value) {
...@@ -306,7 +363,7 @@ export default { ...@@ -306,7 +363,7 @@ export default {
param.auditUser = this.$store.state.userInfo.userName; param.auditUser = this.$store.state.userInfo.userName;
if (param.id != null) { if (param.id != null) {
//增加确定 //增加确定
this.$http.bug.createorupdate(param).then(res => { this.$http.bug.createorupdate(param).then((res) => {
if (res.result.status) { if (res.result.status) {
this.$Message.success("修改成功!"); this.$Message.success("修改成功!");
this.search(); this.search();
...@@ -331,7 +388,7 @@ export default { ...@@ -331,7 +388,7 @@ export default {
param.ids = [param.id]; param.ids = [param.id];
if (param.id != null) { if (param.id != null) {
//增加确定 //增加确定
this.$http.bug.doaction(param).then(res => { this.$http.bug.doaction(param).then((res) => {
if (res.result) { if (res.result) {
this.$Message.success("操作成功!"); this.$Message.success("操作成功!");
this.search(); this.search();
...@@ -357,7 +414,7 @@ export default { ...@@ -357,7 +414,7 @@ export default {
param.statusNew = 6; param.statusNew = 6;
if (param.id != null) { if (param.id != null) {
//增加改变状态为6/查看 //增加改变状态为6/查看
this.$http.bug.doaction(param).then(res => { this.$http.bug.doaction(param).then((res) => {
if (res.result) { if (res.result) {
//this.search(this.searchForm) //this.search(this.searchForm)
} else { } else {
...@@ -374,7 +431,7 @@ export default { ...@@ -374,7 +431,7 @@ export default {
this.selectList = []; this.selectList = [];
this.selectList = value; this.selectList = value;
let statueArry = []; let statueArry = [];
value.forEach(data => { value.forEach((data) => {
var that = this; var that = this;
statueArry.push(data.id); statueArry.push(data.id);
}); });
...@@ -404,7 +461,7 @@ export default { ...@@ -404,7 +461,7 @@ export default {
if (this.selectBatch != 100) { if (this.selectBatch != 100) {
if (this.listBatch.ids.length != 0) { if (this.listBatch.ids.length != 0) {
if (this.selectBatch == 5) { if (this.selectBatch == 5) {
this.$refs["formValidate"].validate(valid => { this.$refs["formValidate"].validate((valid) => {
if (valid) { if (valid) {
let alloterInfo = this.$refs["userSelected"].getSelectItems(); let alloterInfo = this.$refs["userSelected"].getSelectItems();
this.listBatch.alloter = alloterInfo[0].userName; this.listBatch.alloter = alloterInfo[0].userName;
...@@ -434,7 +491,7 @@ export default { ...@@ -434,7 +491,7 @@ export default {
}, },
upSave() { upSave() {
//增加确定 //增加确定
this.$http.bug.doaction(this.listBatch).then(res => { this.$http.bug.doaction(this.listBatch).then((res) => {
if (res.result) { if (res.result) {
this.$Message.success("操作成功!"); this.$Message.success("操作成功!");
this.search(); this.search();
...@@ -465,7 +522,7 @@ export default { ...@@ -465,7 +522,7 @@ export default {
l(key) { l(key) {
let vkey = "bug" + "." + key; let vkey = "bug" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
} },
}, },
created() { created() {
window.screenHeight = window.innerHeight; window.screenHeight = window.innerHeight;
...@@ -479,6 +536,6 @@ export default { ...@@ -479,6 +536,6 @@ export default {
this.gridHeight = window.screenHeight - 250; this.gridHeight = window.screenHeight - 250;
})(); })();
}; };
} },
}; };
</script> </script>
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