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"]),
......
<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
<template slot="easySearch"> :columns="columns"
<Form inline> ref="grid"
<FormItem> :action="action"
<dictionary code="Test.bug.status" v-model="easySearch.status.value" style="width:400px;" multiple></dictionary> :conditions="easySearch"
</FormItem> @on-selection-change="selectInfo"
<FormItem> :height="gridHeight"
<Input search enter-button placeholder="请输入bug标题或地址" @on-search="search" v-model="easySearch.keys.value" /> >
</FormItem> <template slot="easySearch">
</Form> <Form inline>
</template> <FormItem>
<template slot="searchForm"> <dictionary
<Search /> code="Test.bug.status"
</template> v-model="easySearch.status.value"
<template slot="batch"> style="width: 400px"
<Form :model="formMyCheck" :label-width="5" :rules="ruleValidate" inline ref="formValidate"> multiple
<FormItem> ></dictionary>
<dictionary code="Test.but.statusOper" v-model="selectBatch" type="radio" @on-change="statuChange" ref="dicradio"></dictionary> </FormItem>
</FormItem> <FormItem>
<FormItem v-if="selectBatch == 5" label prop="selectAlloter"> <Input
<UserSelect ref="userSelected" v-model="alloter" @on-change="changeUserSelect" /> search
</FormItem> enter-button
<FormItem> placeholder="请输入bug标题或地址"
<Button type="primary" @click="upChange">确定</Button> @on-search="search"
</FormItem> v-model="easySearch.keys.value"
</Form> />
</template> </FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="batch">
<Form
:model="formMyCheck"
:label-width="5"
:rules="ruleValidate"
inline
ref="formValidate"
>
<FormItem>
<dictionary
code="Test.but.statusOper"
v-model="selectBatch"
type="radio"
@on-change="statuChange"
ref="dicradio"
></dictionary>
</FormItem>
<FormItem v-if="selectBatch == 5" label prop="selectAlloter">
<UserSelect
ref="userSelected"
v-model="alloter"
@on-change="changeUserSelect"
/>
</FormItem>
<FormItem>
<Button type="primary" @click="upChange">确定</Button>
</FormItem>
</Form>
</template>
</DataGrid> </DataGrid>
<Modal v-model="modalEdit" fullscreen title="bug编辑" @on-cancel="canselModal(1)"> <Modal
<edit ref="edit" /> v-model="modalEdit"
<div slot="footer"> fullscreen
<Button @click="canselModal(1)">取消</Button> title="bug编辑"
<Button type="primary" @click="addSave">确定</Button> @on-cancel="canselModal(1)"
</div> >
<edit ref="edit" />
<div slot="footer">
<Button @click="canselModal(1)">取消</Button>
<Button type="primary" @click="addSave">确定</Button>
</div>
</Modal> </Modal>
<Modal v-model="modalDetail" fullscreen title="bug操作" @on-cancel="canselModal(2)"> <Modal
<detail ref="detail" /> v-model="modalDetail"
<div slot="footer"> fullscreen
<Button @click="canselModal(2)">取消</Button> title="bug操作"
<Button type="primary" @click="detailSave">确定</Button> @on-cancel="canselModal(2)"
</div> >
<detail ref="detail" />
<div slot="footer">
<Button @click="canselModal(2)">取消</Button>
<Button type="primary" @click="detailSave">确定</Button>
</div>
</Modal> </Modal>
<Modal v-model="modalInfo" title="批量信息"> <Modal v-model="modalInfo" title="批量信息">
确定进行批量操作? 确定进行批量操作?
<div slot="footer"> <div slot="footer">
<Button @click="modalInfo = false">取消</Button> <Button @click="modalInfo = false">取消</Button>
<Button type="primary" @click="upSave">确定</Button> <Button type="primary" @click="upSave">确定</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
...@@ -63,422 +107,435 @@ import edit from "./component/add"; ...@@ -63,422 +107,435 @@ import edit from "./component/add";
import detail from "./component/detail"; import detail from "./component/detail";
import Search from "./component/search"; import Search from "./component/search";
export default { export default {
name: "bug", name: "bug",
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;
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { keys: {
op: "title,pagePath", op: "title,pagePath",
value: "" value: "",
},
status: {
op: "In",
value: [1, 5, 0]
},
creatorUserId: {
op: "Equal",
value: userInfo.userId
}
},
selectList: [],
results: [],
footerBar: false,
modalInfo: false,
gridHeight: "",
totals: 10,
pageSizeOpts: [20, 50, 100],
pageSize: 20,
tabIndex: 1,
columns: [{
type: "selection",
width: 60,
align: "center"
},
{
key: "id",
width: 80,
title: this.l("id")
},
{
title: this.l("level"),
key: "level",
width: 100
},
{
title: this.l("title"),
key: "title",
width: 240,
tooltip: true,
render: (h, params) =>
h(
"a", {
style: {},
on: {
click: () => {
this.detailInfo(params.row);
}
}
},
params.row.title
)
},
{
title: this.l("pagePath"),
key: "pagePath",
tooltip: true,
render: (h, params) =>
h(
"a", {
style: {},
on: {
click: () => {
window.open(params.row.pagePath, "_blank");
}
}
},
params.row.pagePath
)
},
{
title: this.l("status"),
key: "status",
width: 100,
code: 'Test.bug.status',
},
{
title: this.l("creationTime"),
key: "creationTime",
align: "center",
width: 180
},
{
title: this.l("createor"),
key: "createor",
width: 120
},
{
title: this.l("alloter"),
key: "alloter",
width: 120
},
{
title: this.l("lastModificationTime"),
key: "lastModificationTime",
align: "center",
width: 180
},
{
title: this.l("auditUser"),
align: "center",
key: "auditUser",
width: 120
},
{
key: "action",
title: "操作",
align: "center",
width: 180,
render: (h, params) =>
h("div", [
h(
"Button", {
props: {
type: "text",
size: "small"
},
style: {
color: "green"
},
on: {
click: () => {
this.detailInfo(params.row);
}
}
},
"解决"
),
h(
"Button", {
props: {
type: "text",
size: "small"
},
style: {
color: "green"
},
on: {
click: () => {
this.editInfo(params.row);
}
}
},
"编辑"
)
])
}
],
statusList: [{
name: "确认",
value: "1"
},
{
name: "解决",
value: "2"
},
{
name: "冻结",
value: "4"
},
{
name: "关闭",
value: "3"
}
],
modalEdit: false,
modalDetail: false,
searchForm: {
Status: 0,
PageSize: 20,
Current: 1
},
listBatch: {
ids: [],
statusNew: 0,
auditUser: "",
workHours: 0,
remark: "",
alloter: "",
alloterId: null
},
selectBatch: 100,
auditUser: null,
alloter: {},
formMyCheck: {
selectAlloter: null
},
ruleValidate: {
selectAlloter: [{
required: true,
message: "请选择驳指派人",
type: "number",
trigger: "change"
}]
}
};
},
computed: {},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
//选项卡切换
tab(data) {
if (data == "0") {
this.easySearch.creatorUserId.value = this.$store.state.userInfo.userId;
} else {
this.easySearch.creatorUserId.value = null;
}
this.search();
}, },
search() { status: {
this.$refs.grid.easySearch(this.easySearch); op: "In",
this.Api value: [1, 5, 0],
}, },
//打开修改窗口 creatorUserId: {
editInfo(value) { op: "Equal",
this.modalEdit = true; value: userInfo.userId,
this.$refs.edit.editeInfo(value);
}, },
//修改事件 },
addSave() { selectList: [],
let param = this.$refs.edit.addBugInfo(); results: [],
param.auditUser = this.$store.state.userInfo.userName; footerBar: false,
if (param.id != null) { modalInfo: false,
//增加确定 gridHeight: "",
this.$http.bug.createorupdate(param).then(res => { totals: 10,
if (res.result.status) { pageSizeOpts: [20, 50, 100],
this.$Message.success("修改成功!"); pageSize: 20,
this.search(); tabIndex: 1,
} else { columns: [
this.$Message.error("修改失败!"); {
} type: "selection",
this.modalEdit = false; width: 60,
}); align: "center",
} else {
this.$Message.error("修改失败!");
}
}, },
//打开确定/操作窗口 {
detailInfo(value) { key: "id",
this.modalDetail = true; width: 80,
this.$refs.detail.detailInfo(value); title: this.l("id"),
}, },
//确定/关闭操作 {
detailSave() { title: this.l("level"),
let param = this.$refs.detail.addBugInfo(); key: "level",
param.auditUser = this.$store.state.userInfo.userName; width: 100,
param.ids = [param.id];
if (param.id != null) {
//增加确定
this.$http.bug.doaction(param).then(res => {
if (res.result) {
this.$Message.success("操作成功!");
this.search();
} else {
this.$Message.error("操作失败!");
}
this.modalDetail = false;
});
} else {
this.$Message.error("操作失败!");
}
}, },
//取消窗口,查看状态 {
canselModal(type) { title: this.l("title"),
let param; key: "title",
if (type == 1) { width: 240,
param = this.$refs.edit.addBugInfo(); tooltip: true,
} else { render: (h, params) =>
param = this.$refs.detail.addBugInfo(); h(
} "a",
param.auditUser = this.$store.state.userInfo.userName; {
param.ids = [param.id]; style: {},
param.statusNew = 6; on: {
if (param.id != null) { click: () => {
//增加改变状态为6/查看 this.detailInfo(params.row);
this.$http.bug.doaction(param).then(res => { },
if (res.result) { },
//this.search(this.searchForm) },
} else { params.row.title
this.$Message.error("操作失败!"); ),
}
});
} else {
this.$Message.error("操作失败!");
}
this.modalDetail = false;
this.modalEdit = false;
}, },
selectInfo(value) { {
this.selectList = []; title: this.l("pagePath"),
this.selectList = value; key: "pagePath",
let statueArry = []; tooltip: true,
value.forEach(data => { render: (h, params) =>
var that = this; h(
statueArry.push(data.id); "a",
}); {
this.results = []; style: {},
this.results = statueArry; on: {
this.getListId(statueArry); click: () => {
window.open(params.row.pagePath, "_blank");
},
},
},
params.row.pagePath
),
}, },
//得到需要批量操作的ids {
getListId(value) { title: this.l("status"),
this.listBatch.ids = value; key: "status",
if (this.listBatch.ids.length > 0) { width: 100,
this.footerBar = true; code: "Test.bug.status",
//this.showBt = false
this.selectBatch = 100;
} else {
this.footerBar = false;
//this.showBt = false
this.selectBatch = 100;
}
this.listBatch.auditUser = this.$store.state.userInfo.userName;
}, },
//批量操作 {
statuChange(value) { title: this.l("creationTime"),
this.listBatch.statusNew = value; key: "creationTime",
align: "center",
width: 180,
}, },
upChange() { {
if (this.selectBatch != 100) { title: this.l("createor"),
if (this.listBatch.ids.length != 0) { key: "createor",
if (this.selectBatch == 5) { width: 120,
this.$refs["formValidate"].validate(valid => {
if (valid) {
let alloterInfo = this.$refs["userSelected"].getSelectItems();
this.listBatch.alloter = alloterInfo[0].userName;
this.listBatch.alloterId = alloterInfo[0].id;
this.modalInfo = true;
}
});
} else {
this.modalInfo = true;
}
} else {
this.$Message.error("请选择操作列表!");
this.selectBatch = 100;
}
} else {
this.$Message.error("请选择操作!");
}
}, },
changeUserSelect(val) { {
if (val != undefined && val.length != "" && val.length != 0) { title: this.l("alloter"),
this.formMyCheck.selectAlloter = 1; key: "alloter",
} else { width: 120,
this.formMyCheck.selectAlloter = null;
this.listBatch.alloter = "";
this.listBatch.alloterId = null;
}
}, },
upSave() { {
//增加确定 title: this.l("lastModificationTime"),
this.$http.bug.doaction(this.listBatch).then(res => { key: "lastModificationTime",
if (res.result) { align: "center",
this.$Message.success("操作成功!"); width: 180,
this.search(); },
this.footerBar = false; {
this.showBt = false; title: this.l("auditUser"),
this.modalInfo = false; align: "center",
this.selectBatch = 100; key: "auditUser",
} else { width: 120,
this.$Message.error("操作失败!"); },
} {
}); key: "action",
title: "操作",
align: "center",
width: 180,
render: (h, params) =>
h("div", [
h(
"Button",
{
props: {
type: "text",
size: "small",
},
style: {
color: "green",
},
on: {
click: () => {
this.detailInfo(params.row);
},
},
},
"解决"
),
h(
"Button",
{
props: {
type: "text",
size: "small",
},
style: {
color: "green",
},
on: {
click: () => {
this.editInfo(params.row);
},
},
},
"编辑"
),
]),
}, },
arry2Name(arryList, values) { ],
//预警类别转换
var codes = arryList; statusList: [
var name = ""; {
for (let i in codes) { name: "确认",
if (values == codes[i].value) { value: "1",
name = codes[i].name; },
} {
} name: "解决",
return name; value: "2",
},
{
name: "冻结",
value: "4",
}, },
canselFooter() { {
this.footerBar = false; name: "关闭",
this.selectBatch = 100; value: "3",
}, },
l(key) { ],
let vkey = "bug" + "." + key; modalEdit: false,
return this.$t(vkey) || key; modalDetail: false,
searchForm: {
Status: 0,
PageSize: 20,
Current: 1,
},
listBatch: {
ids: [],
statusNew: 0,
auditUser: "",
workHours: 0,
remark: "",
alloter: "",
alloterId: null,
},
selectBatch: 100,
auditUser: null,
alloter: {},
formMyCheck: {
selectAlloter: null,
},
ruleValidate: {
selectAlloter: [
{
required: true,
message: "请选择驳指派人",
type: "number",
trigger: "change",
},
],
},
};
},
computed: {},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
//选项卡切换
tab(data) {
if (data == "0") {
this.easySearch.creatorUserId.value = this.$store.state.userInfo.userId;
} else {
this.easySearch.creatorUserId.value = null;
}
this.search();
},
search() {
this.$refs.grid.easySearch(this.easySearch);
this.getBugCount();
},
//获取用户未解决bug数量
getBugCount() {
this.$http.bug.bugcount().then((res) => {
if (res.success) {
this.$store.commit("setCountBug", res.result);
} }
});
},
//打开修改窗口
editInfo(value) {
this.modalEdit = true;
this.$refs.edit.editeInfo(value);
},
//修改事件
addSave() {
let param = this.$refs.edit.addBugInfo();
param.auditUser = this.$store.state.userInfo.userName;
if (param.id != null) {
//增加确定
this.$http.bug.createorupdate(param).then((res) => {
if (res.result.status) {
this.$Message.success("修改成功!");
this.search();
} else {
this.$Message.error("修改失败!");
}
this.modalEdit = false;
});
} else {
this.$Message.error("修改失败!");
}
},
//打开确定/操作窗口
detailInfo(value) {
this.modalDetail = true;
this.$refs.detail.detailInfo(value);
}, },
created() { //确定/关闭操作
detailSave() {
let param = this.$refs.detail.addBugInfo();
param.auditUser = this.$store.state.userInfo.userName;
param.ids = [param.id];
if (param.id != null) {
//增加确定
this.$http.bug.doaction(param).then((res) => {
if (res.result) {
this.$Message.success("操作成功!");
this.search();
} else {
this.$Message.error("操作失败!");
}
this.modalDetail = false;
});
} else {
this.$Message.error("操作失败!");
}
},
//取消窗口,查看状态
canselModal(type) {
let param;
if (type == 1) {
param = this.$refs.edit.addBugInfo();
} else {
param = this.$refs.detail.addBugInfo();
}
param.auditUser = this.$store.state.userInfo.userName;
param.ids = [param.id];
param.statusNew = 6;
if (param.id != null) {
//增加改变状态为6/查看
this.$http.bug.doaction(param).then((res) => {
if (res.result) {
//this.search(this.searchForm)
} else {
this.$Message.error("操作失败!");
}
});
} else {
this.$Message.error("操作失败!");
}
this.modalDetail = false;
this.modalEdit = false;
},
selectInfo(value) {
this.selectList = [];
this.selectList = value;
let statueArry = [];
value.forEach((data) => {
var that = this;
statueArry.push(data.id);
});
this.results = [];
this.results = statueArry;
this.getListId(statueArry);
},
//得到需要批量操作的ids
getListId(value) {
this.listBatch.ids = value;
if (this.listBatch.ids.length > 0) {
this.footerBar = true;
//this.showBt = false
this.selectBatch = 100;
} else {
this.footerBar = false;
//this.showBt = false
this.selectBatch = 100;
}
this.listBatch.auditUser = this.$store.state.userInfo.userName;
},
//批量操作
statuChange(value) {
this.listBatch.statusNew = value;
},
upChange() {
if (this.selectBatch != 100) {
if (this.listBatch.ids.length != 0) {
if (this.selectBatch == 5) {
this.$refs["formValidate"].validate((valid) => {
if (valid) {
let alloterInfo = this.$refs["userSelected"].getSelectItems();
this.listBatch.alloter = alloterInfo[0].userName;
this.listBatch.alloterId = alloterInfo[0].id;
this.modalInfo = true;
}
});
} else {
this.modalInfo = true;
}
} else {
this.$Message.error("请选择操作列表!");
this.selectBatch = 100;
}
} else {
this.$Message.error("请选择操作!");
}
},
changeUserSelect(val) {
if (val != undefined && val.length != "" && val.length != 0) {
this.formMyCheck.selectAlloter = 1;
} else {
this.formMyCheck.selectAlloter = null;
this.listBatch.alloter = "";
this.listBatch.alloterId = null;
}
},
upSave() {
//增加确定
this.$http.bug.doaction(this.listBatch).then((res) => {
if (res.result) {
this.$Message.success("操作成功!");
this.search();
this.footerBar = false;
this.showBt = false;
this.modalInfo = false;
this.selectBatch = 100;
} else {
this.$Message.error("操作失败!");
}
});
},
arry2Name(arryList, values) {
//预警类别转换
var codes = arryList;
var name = "";
for (let i in codes) {
if (values == codes[i].value) {
name = codes[i].name;
}
}
return name;
},
canselFooter() {
this.footerBar = false;
this.selectBatch = 100;
},
l(key) {
let vkey = "bug" + "." + key;
return this.$t(vkey) || key;
},
},
created() {
window.screenHeight = window.innerHeight;
this.gridHeight = window.screenHeight - 250;
},
mounted() {
// this.search(this.searchForm)
window.onresize = () => {
return (() => {
window.screenHeight = window.innerHeight; window.screenHeight = window.innerHeight;
this.gridHeight = window.screenHeight - 250; this.gridHeight = window.screenHeight - 250;
}, })();
mounted() { };
// this.search(this.searchForm) },
window.onresize = () => {
return (() => {
window.screenHeight = window.innerHeight;
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