Commit dce5d909 authored by 周远喜's avatar 周远喜

ok

parent b950e4af
<template> <template>
<div class="table-content myBug flex fd"> <div class="table-content">
<div class="table-tools" v-if="tool" ref="tools"> <div class="table-tools" v-if="tool">
<div class="table-search" v-if="easy"> <div class="table-search" v-if="easy">
<slot name="easySearch"> <slot name="easySearch">
<Input <Input
...@@ -11,30 +11,28 @@ ...@@ -11,30 +11,28 @@
v-model="keys" v-model="keys"
/> />
</slot> </slot>
</div>
<Button v-if="high" @click="modalSearch=true" type="text"> <Button v-if="high" @click="modalSearch=true" type="text">
<Icon type="md-search" />高级 <Icon type="md-search" />高级
</Button> </Button>
</div>
<div class="searchBack"> <div class="searchBack">
<slot name="searchBack"></slot> <slot name="searchBack"></slot>
</div> </div>
<div class="btns"> <div class="btns">
<slot name="buttons"></slot> <slot name="buttons"></slot>
<Button v-if="set&&type=='table'" @click="config=!config"> <Button v-if="set&&type=='table'" @click="config=!config">
<Icon type="md-build" class="table-set" size="14" title="列设置" /> <Icon type="md-build" title="列设置" />
</Button> </Button>
</div> </div>
</div> </div>
<div class="fg" ref="ftable"> <div class="table-main" ref="main">
<div v-if="type=='card'" class="table-card"> <Row v-if="type=='card'">
<Row :gutter="gutter">
<Col :span="span" v-for="(row,i) in list" :key="i"> <Col :span="span" v-for="(row,i) in list" :key="i">
<slot name="card" :row="row"> <slot name="card" :row="row">
<span>{{row.id}}</span> <span>{{row.id}}</span>
</slot> </slot>
</Col> </Col>
</Row> </Row>
</div>
<Table <Table
v-else v-else
:border="border" :border="border"
...@@ -42,25 +40,21 @@ ...@@ -42,25 +40,21 @@
:data="list" :data="list"
:height="tableHeight" :height="tableHeight"
:draggable="draggable" :draggable="draggable"
:size="size"
:row-key="rowKey"
ref="table" ref="table"
class="tableCommon fg" class="tableCommon"
@on-expand="expand" @on-expand="expand"
@on-drag-drop="onDragDrop" @on-drag-drop="onDragDrop"
@on-selection-change="selectionChange" @on-selection-change="selectionChange"
@on-select="onSelect" @on-select="onSelect"
:loading="loading"
></Table> ></Table>
<div class="table-footer" ref="footer"> </div>
<div> <div class="table-footer">
<slot name="footer"></slot> <slot name="footer"></slot>
</div>&nbsp;
<Page <Page
v-if="page" v-if="page"
:total="search.total" :total="search.total"
:current="search.page" :current="search.page"
class="mr15 mt15 fr" class="fr"
show-total show-total
size="small" size="small"
show-elevator show-elevator
...@@ -71,7 +65,6 @@ ...@@ -71,7 +65,6 @@
@on-page-size-change="pageSizeChange" @on-page-size-change="pageSizeChange"
/> />
</div> </div>
</div>
<Modal v-if="high" v-model="modalSearch" title="高级搜索" draggable width="800" ref="search"> <Modal v-if="high" v-model="modalSearch" title="高级搜索" draggable width="800" ref="search">
<slot name="searchForm"></slot> <slot name="searchForm"></slot>
<div slot="footer"> <div slot="footer">
...@@ -107,13 +100,10 @@ ...@@ -107,13 +100,10 @@
</li> </li>
</ul> </ul>
</Drawer> </Drawer>
<FooterToolbar style="height:60px" v-if="batch" v-show="footerToolbar"> <FooterToolbar v-if="batch" v-show="footerToolbar">
<div class="tip"> <div class="tip">已选{{selectItems.length}}</div>
已选{{selectItems.length}}
<slot name="batch"></slot> <slot name="batch"></slot>
</div> <Button @click="footerToolbar=false">取消</Button>
<Button @click="cancelFooterToolbar" class="btn">取消</Button>
</FooterToolbar> </FooterToolbar>
</div> </div>
</template> </template>
...@@ -141,8 +131,7 @@ export default { ...@@ -141,8 +131,7 @@ export default {
configLoad: false, configLoad: false,
userConfig: null, //用户页面配置信息。, userConfig: null, //用户页面配置信息。,
// userId: 1 // userId: 1
userId: this.$store.state.userInfo.userId, userId: this.$store.state.userInfo.userId
loading: false
}; };
}, },
props: { props: {
...@@ -165,10 +154,6 @@ export default { ...@@ -165,10 +154,6 @@ export default {
type: String, type: String,
default: "请输入关键字" default: "请输入关键字"
}, },
size: {
type: String,
default: "default"
},
height: { height: {
type: Number, type: Number,
default: 0 default: 0
...@@ -237,17 +222,9 @@ export default { ...@@ -237,17 +222,9 @@ export default {
return ["table", "card", "list"].indexOf(value) !== -1; return ["table", "card", "list"].indexOf(value) !== -1;
} }
}, },
gutter:{
type:Number,
default:0
},
span: { span: {
type: Number, type: Number,
default: 24 default: 24
},
//table控件children子数据控制功能
rowKey: {
type: [String, Number]
} }
}, },
created() { created() {
...@@ -261,28 +238,29 @@ export default { ...@@ -261,28 +238,29 @@ export default {
mounted() { mounted() {
if (this.data && this.data.length > 0) { if (this.data && this.data.length > 0) {
this.list = this.data; this.list = this.data;
//return; return;
} }
this.keys = ""; this.keys = "";
this.intY(); this.intY();
if (this.lazy == true) { if (this.lazy == true) {
return; return;
} }
if (this.userId > 0) {
this.loadUserConfig(); this.loadUserConfig();
} else {
this.easySearch();
}
if (this.height === 0) { if (this.height === 0) {
this.tableHeight = this.$refs.main.offsetHeight;
window.onresize = () => { window.onresize = () => {
///浏览器窗口大小变化 ///浏览器窗口大小变化
return (() => { return (() => {
// console.log(this.$refs.table) this.tableHeight = this.$refs.main.offsetHeight;
window.screenHeight = window.innerHeight;
this.tableHeight = window.screenHeight - this.firstY - 60;
})(); })();
}; };
} else { } else {
this.tableHeight = this.height; this.tableHeight = this.height;
} }
//注册拖拽事件。 //注册拖拽事件。
this.$dragging.$on("dragend", e => { this.$dragging.$on("dragend", e => {
// console.log("dragend",e); // console.log("dragend",e);
...@@ -296,20 +274,10 @@ export default { ...@@ -296,20 +274,10 @@ export default {
this.tableHeight = window.innerHeight - this.firstY - 60; this.tableHeight = window.innerHeight - this.firstY - 60;
} }
if (this.action) { if (this.action) {
this.loading = true; this.$api.post(this.action, this.search).then(r => {
this.$api
.post(this.action, this.search)
.then(r => {
this.list = r.result.items; this.list = r.result.items;
this.search.total = r.result.totalCount; this.search.total = r.result.totalCount || r.result.count;
this.loading = false; });
})
.catch(
function(err) {
this.loading = false;
this.$Message.error("加载失败");
}.bind(this)
);
} }
}, },
columnInit() { columnInit() {
...@@ -401,11 +369,7 @@ export default { ...@@ -401,11 +369,7 @@ export default {
this.$emit("on-drag-drop", a, b); this.$emit("on-drag-drop", a, b);
}, },
easySearch() { easySearch() {
if ( if (this.conditions && this.conditions.keys.default) {
this.conditions &&
this.conditions.keys &&
this.conditions.keys.default
) {
//判断没有传入条件的用默认的查询 //判断没有传入条件的用默认的查询
this.conditions.keys.value = this.keys; this.conditions.keys.value = this.keys;
} }
...@@ -487,10 +451,6 @@ export default { ...@@ -487,10 +451,6 @@ export default {
}, },
selectAll(status) { selectAll(status) {
this.$refs.table.selectAll(status); this.$refs.table.selectAll(status);
},
cancelFooterToolbar() {
this.$refs.table.selectAll(false);
this.footerToolbar = false;
} }
}, },
computed: { computed: {
...@@ -533,16 +493,6 @@ export default { ...@@ -533,16 +493,6 @@ export default {
}); });
}; };
} }
if (u.type == "outputTime") {
u.render = (h, params) => {
let values = u.key;
return h("OutputTime", {
props: {
value: params.row[values]
}
});
};
}
return !u.hide; return !u.hide;
}); });
return cols; return cols;
...@@ -559,69 +509,51 @@ export default { ...@@ -559,69 +509,51 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less">
.table-content { .table-content {
position: relative; position: relative;
height: 100%; height: 100%;
.table-tools { display: flex;
padding-top: 5px; flex-direction: column;
height: 50px;
overflow: hidden;
.table-search {
float: left;
line-height: 50px;
.ivu-form-item {
margin-bottom: 0;
}
}
.btns {
float: right;
text-align: right;
height: 40px;
}
}
.tableCommon {
width: 100%;
}
.tip { .tip {
display: inline; display: inline;
} }
.tableCommon tr th { form {
line-height: 30px; display: inline-block;
font-size: 14px; .ivu-form-item {
background: #f5f6fa; margin: 0;
} vertical-align: middle;
.fg {
overflow: auto;
.table-card{
overflow: hidden;
}
} }
.tableCommon tr td {
line-height: 25px;
font-size: 14px;
padding: 0 2px;
} }
.table-main {
.tableCommon tr td .ivu-table-cell {
padding: 0 5px;
}
.table-card {
width: 100%; width: 100%;
text-align: left; text-align: left;
padding: 0; padding: 0;
display: block; display: block;
overflow-y: auto; overflow-y: auto;
flex-grow: 1;
tr td .ivu-table-cell {
padding: 0 5px;
} }
.table-set {
cursor: pointer;
} }
.table-set:hover { .table-tools {
color: orange; display: flex;
line-height: 50px;
.table-search {
flex-grow: 1;
}
.btns {
min-width: 200px;
text-align: right;
}
} }
.table-footer { .table-footer {
height: 40px; line-height: 45px;
}
.ivu-footer-toolbar {
text-align: left;
background: rgba(0, 0, 0, 0.7);
color: #fff;
} }
} }
.table-columns { .table-columns {
......
...@@ -13,15 +13,15 @@ ...@@ -13,15 +13,15 @@
:height="gridHeight" :height="gridHeight"
> >
<template slot="easySearch"> <template slot="easySearch">
<Row style="line-height:32px;"> <Form inline >
<Col span="7"> <FormItem>
<dictionary <dictionary
code="Test.bug.status" code="Test.bug.status"
v-model="easySearch.status.value" v-model="easySearch.status.value"
style="width:80px;" style="width:80px;"
></dictionary> ></dictionary>
</Col> </FormItem>
<Col span="17"> <FormItem>
<Input <Input
search search
enter-button enter-button
...@@ -29,70 +29,41 @@ ...@@ -29,70 +29,41 @@
@on-search="search" @on-search="search"
v-model="easySearch.keys.value" v-model="easySearch.keys.value"
/> />
</Col> </FormItem>
</Row> </Form>
</template> </template>
<template slot="searchForm"> <template slot="searchForm">
<Search /> <Search />
</template> </template>
</DataGrid> <template slot="batch">
<FooterToolbar extra v-if="footerBar" style="height:65px"> <Form :model="formMyCheck" :label-width="5" :rules="ruleValidate" inline ref="formValidate">
<Row> <FormItem>
<dictionary <dictionary
code="Test.but.statusOper" code="Test.but.statusOper"
v-model="selectBatch" v-model="selectBatch"
type="radio" type="radio"
@on-change="statuChange" @on-change="statuChange"
ref="dicradio" ref="dicradio"
style="float:left" ></dictionary>
></dictionary </FormItem>
>&nbsp;&nbsp;&nbsp;&nbsp; <FormItem v-if="selectBatch == 5" label prop="selectAlloter">
<span style="float:left;color:yellow" v-if="selectBatch == 5" <UserSelect ref="userSelected" v-model="alloter" @on-change="changeUserSelect" />
>指派给:</span </FormItem>
> <FormItem>
<div <Button type="primary" @click="upChange">确定</Button>
style="float:left;width:240px;padding:10px;"
v-if="selectBatch == 5"
>
<Form
:model="formMyCheck"
:label-width="5"
:rules="ruleValidate"
inline
ref="formValidate"
>
<FormItem label="" prop="selectAlloter">
<UserSelect
ref="userSelected"
v-model="alloter"
@on-change="changeUserSelect"
/>
</FormItem> </FormItem>
</Form> </Form>
</div> </template>
<Button type="primary" @click="upChange">确定</Button </DataGrid>
>&nbsp;&nbsp;&nbsp;&nbsp;
<Button @click="canselFooter">取消</Button> <Modal v-model="modalEdit" fullscreen title="bug编辑" @on-cancel="canselModal(1)">
</Row>
</FooterToolbar>
<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 <Modal v-model="modalDetail" fullscreen title="bug操作" @on-cancel="canselModal(2)">
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>
...@@ -109,26 +80,26 @@ ...@@ -109,26 +80,26 @@
</div> </div>
</template> </template>
<script> <script>
import Api from '@/libs/bug' import Api from "@/libs/bug";
import edit from './component/add' 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: { op: 'title,pagePath', value: '' }, keys: { op: "title,pagePath", value: "" },
status: { op: 'Equal', value: null }, status: { op: "Equal", value: null },
creatorUserId: { creatorUserId: {
op: 'Equal', op: "Equal",
value: userInfo.userId value: userInfo.userId
} }
}, },
...@@ -136,40 +107,40 @@ export default { ...@@ -136,40 +107,40 @@ export default {
results: [], results: [],
footerBar: false, footerBar: false,
modalInfo: false, modalInfo: false,
gridHeight: '', gridHeight: "",
totals: 10, totals: 10,
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"),
key: 'title', key: "title",
width: 240, width: 240,
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);
} }
} }
}, },
...@@ -177,17 +148,17 @@ export default { ...@@ -177,17 +148,17 @@ export default {
) )
}, },
{ {
title: this.l('pagePath'), title: this.l("pagePath"),
key: 'pagePath', key: "pagePath",
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");
} }
} }
}, },
...@@ -195,98 +166,99 @@ export default { ...@@ -195,98 +166,99 @@ export default {
) )
}, },
{ {
title: this.l('status'), title: this.l("status"),
key: 'status', key: "status",
width: 100, width: 100,
render: (h, params) => { render: (h, params) => {
return h('state', { return h("state", {
props: { props: {
code: 'Test.bug.status', code: "Test.bug.status",
type: 'text', type: "text",
value: params.row.status + '' value: params.row.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
}, },
{ {
title: '操作', key:"action",
align: 'center', title: "操作",
align: "center",
width: 180, width: 180,
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: '确认', value: '1' }, { name: "确认", value: "1" },
{ name: '解决', value: '2' }, { name: "解决", value: "2" },
{ name: '冻结', value: '4' }, { name: "冻结", value: "4" },
{ name: '关闭', value: '3' } { name: "关闭", value: "3" }
], ],
modalEdit: false, modalEdit: false,
modalDetail: false, modalDetail: false,
...@@ -298,11 +270,11 @@ export default { ...@@ -298,11 +270,11 @@ export default {
listBatch: { listBatch: {
ids: [], ids: [],
statusNew: 0, statusNew: 0,
auditUser: '', auditUser: "",
workHours: 0, workHours: 0,
remark: '', remark: "",
alloter: '', alloter: "",
alloterId:null alloterId: null
}, },
selectBatch: 100, selectBatch: 100,
auditUser: null, auditUser: null,
...@@ -314,215 +286,215 @@ export default { ...@@ -314,215 +286,215 @@ export default {
selectAlloter: [ selectAlloter: [
{ {
required: true, required: true,
message: '请选择驳指派人', message: "请选择驳指派人",
type: 'number', type: "number",
trigger: 'change' trigger: "change"
} }
] ]
} }
} };
}, },
computed: {}, computed: {},
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
//选项卡切换 //选项卡切换
tab(data) { tab(data) {
if (data == '0') { if (data == "0") {
this.easySearch.creatorUserId.value = this.$store.state.userInfo.userId this.easySearch.creatorUserId.value = this.$store.state.userInfo.userId;
} else { } else {
this.easySearch.creatorUserId.value = null this.easySearch.creatorUserId.value = null;
} }
this.search() this.search();
}, },
search() { search() {
this.$refs.grid.easySearch(this.easySearch) this.$refs.grid.easySearch(this.easySearch);
}, },
//打开修改窗口 //打开修改窗口
editInfo(value) { editInfo(value) {
this.modalEdit = true this.modalEdit = true;
this.$refs.edit.editeInfo(value) this.$refs.edit.editeInfo(value);
}, },
//修改事件 //修改事件
addSave() { addSave() {
let param = this.$refs.edit.addBugInfo() let param = this.$refs.edit.addBugInfo();
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();
} else { } else {
this.$Message.error('修改失败!') this.$Message.error("修改失败!");
} }
this.modalEdit = false this.modalEdit = false;
}) });
} else { } else {
this.$Message.error('修改失败!') this.$Message.error("修改失败!");
} }
}, },
//打开确定/操作窗口 //打开确定/操作窗口
detailInfo(value) { detailInfo(value) {
this.modalDetail = true this.modalDetail = true;
this.$refs.detail.detailInfo(value) this.$refs.detail.detailInfo(value);
}, },
//确定/关闭操作 //确定/关闭操作
detailSave() { detailSave() {
let param = this.$refs.detail.addBugInfo() let param = this.$refs.detail.addBugInfo();
param.auditUser = this.$store.state.userInfo.userName param.auditUser = this.$store.state.userInfo.userName;
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();
} else { } else {
this.$Message.error('操作失败!') this.$Message.error("操作失败!");
} }
this.modalDetail = false this.modalDetail = false;
}) });
} else { } else {
this.$Message.error('操作失败!') this.$Message.error("操作失败!");
} }
}, },
//取消窗口,查看状态 //取消窗口,查看状态
canselModal(type) { canselModal(type) {
let param let param;
if (type == 1) { if (type == 1) {
param = this.$refs.edit.addBugInfo() param = this.$refs.edit.addBugInfo();
} else { } else {
param = this.$refs.detail.addBugInfo() param = this.$refs.detail.addBugInfo();
} }
param.auditUser = this.$store.state.userInfo.userName param.auditUser = this.$store.state.userInfo.userName;
param.ids = [param.id] param.ids = [param.id];
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 {
this.$Message.error('操作失败!') this.$Message.error("操作失败!");
} }
}) });
} else { } else {
this.$Message.error('操作失败!') this.$Message.error("操作失败!");
} }
this.modalDetail = false this.modalDetail = false;
this.modalEdit = false this.modalEdit = false;
}, },
selectInfo(value) { selectInfo(value) {
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);
}) });
this.results = [] this.results = [];
this.results = statueArry this.results = statueArry;
this.getListId(statueArry) this.getListId(statueArry);
}, },
//得到需要批量操作的ids //得到需要批量操作的ids
getListId(value) { getListId(value) {
this.listBatch.ids = value this.listBatch.ids = value;
if (this.listBatch.ids.length > 0) { if (this.listBatch.ids.length > 0) {
this.footerBar = true this.footerBar = true;
//this.showBt = false //this.showBt = false
this.selectBatch = 100 this.selectBatch = 100;
} else { } else {
this.footerBar = false this.footerBar = false;
//this.showBt = false //this.showBt = false
this.selectBatch = 100 this.selectBatch = 100;
} }
this.listBatch.auditUser = this.$store.state.userInfo.userName this.listBatch.auditUser = this.$store.state.userInfo.userName;
}, },
//批量操作 //批量操作
statuChange(value) { statuChange(value) {
this.listBatch.statusNew = value this.listBatch.statusNew = value;
}, },
upChange() { upChange() {
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;
this.listBatch.alloterId=alloterInfo[0].id this.listBatch.alloterId = alloterInfo[0].id;
this.modalInfo = true this.modalInfo = true;
} }
}) });
} else { } else {
this.modalInfo = true this.modalInfo = true;
} }
} else { } else {
this.$Message.error('请选择操作列表!') this.$Message.error("请选择操作列表!");
this.selectBatch = 100 this.selectBatch = 100;
} }
} else { } else {
this.$Message.error('请选择操作!') this.$Message.error("请选择操作!");
} }
}, },
changeUserSelect(val) { changeUserSelect(val) {
if (val != undefined&&val.length !=''&&val.length != 0) { if (val != undefined && val.length != "" && val.length != 0) {
this.formMyCheck.selectAlloter = 1 this.formMyCheck.selectAlloter = 1;
} else { } else {
this.formMyCheck.selectAlloter = null this.formMyCheck.selectAlloter = null;
this.listBatch.alloter = '' this.listBatch.alloter = "";
this.listBatch.alloterId=null this.listBatch.alloterId = null;
} }
}, },
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();
this.footerBar = false this.footerBar = false;
this.showBt = false this.showBt = false;
this.modalInfo = false this.modalInfo = false;
this.selectBatch = 100 this.selectBatch = 100;
} else { } else {
this.$Message.error('操作失败!') this.$Message.error("操作失败!");
} }
}) });
}, },
arry2Name(arryList, values) { arry2Name(arryList, values) {
//预警类别转换 //预警类别转换
var codes = arryList var codes = arryList;
var name = '' var name = "";
for (let i in codes) { for (let i in codes) {
if (values == codes[i].value) { if (values == codes[i].value) {
name = codes[i].name name = codes[i].name;
} }
} }
return name return name;
}, },
canselFooter() { canselFooter() {
this.footerBar = false this.footerBar = false;
this.selectBatch = 100 this.selectBatch = 100;
}, },
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;
this.gridHeight = window.screenHeight - 250 this.gridHeight = window.screenHeight - 250;
}, },
mounted() { mounted() {
// this.search(this.searchForm) // this.search(this.searchForm)
window.onresize = () => { window.onresize = () => {
return (() => { return (() => {
window.screenHeight = window.innerHeight window.screenHeight = window.innerHeight;
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