Commit 524601d5 authored by renjintao's avatar renjintao

import/index

parent 4466a9f2
<template>
<div class="myBug">
<div class="myBug">
<Tabs :animated="false" @on-click="tab">
<TabPane label="我的"></TabPane>
<TabPane label="所有"></TabPane>
<TabPane label="我的"></TabPane>
<TabPane label="所有"></TabPane>
</Tabs>
<DataGrid
:columns="columns"
ref="grid"
:action="action"
:conditions="easySearch"
@on-selection-change="selectInfo"
:height="gridHeight"
>
<template slot="easySearch">
<Form inline >
<FormItem>
<dictionary
code="Test.bug.status"
v-model="easySearch.status.value"
style="width:400px;"
multiple
></dictionary>
</FormItem>
<FormItem>
<Input
search
enter-button
placeholder="请输入bug标题或地址"
@on-search="search"
v-model="easySearch.keys.value"
/>
</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 :columns="columns" ref="grid" :action="action" :conditions="easySearch" @on-selection-change="selectInfo" :height="gridHeight">
<template slot="easySearch">
<Form inline>
<FormItem>
<dictionary code="Test.bug.status" v-model="easySearch.status.value" style="width:400px;" multiple></dictionary>
</FormItem>
<FormItem>
<Input search enter-button placeholder="请输入bug标题或地址" @on-search="search" v-model="easySearch.keys.value" />
</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>
<Modal v-model="modalEdit" fullscreen title="bug编辑" @on-cancel="canselModal(1)">
<edit ref="edit" />
<div slot="footer">
<Button @click="canselModal(1)">取消</Button>
<Button type="primary" @click="addSave">确定</Button>
</div>
<edit ref="edit" />
<div slot="footer">
<Button @click="canselModal(1)">取消</Button>
<Button type="primary" @click="addSave">确定</Button>
</div>
</Modal>
<Modal v-model="modalDetail" fullscreen title="bug操作" @on-cancel="canselModal(2)">
<detail ref="detail" />
<div slot="footer">
<Button @click="canselModal(2)">取消</Button>
<Button type="primary" @click="detailSave">确定</Button>
</div>
<detail ref="detail" />
<div slot="footer">
<Button @click="canselModal(2)">取消</Button>
<Button type="primary" @click="detailSave">确定</Button>
</div>
</Modal>
<Modal v-model="modalInfo" title="批量信息">
确定进行批量操作?
<div slot="footer">
<Button @click="modalInfo = false">取消</Button>
<Button type="primary" @click="upSave">确定</Button>
</div>
确定进行批量操作?
<div slot="footer">
<Button @click="modalInfo = false">取消</Button>
<Button type="primary" @click="upSave">确定</Button>
</div>
</Modal>
</div>
</div>
</template>
<script>
import Api from "@/libs/bug";
import edit from "./component/add";
import detail from "./component/detail";
import Search from "./component/search";
export default {
name: "bug",
components: {
edit,
detail,
Search
},
data() {
let userInfo = this.$store.state.admin.user.info;
return {
action: Api.index,
easySearch: {
keys: { op: "title,pagePath", 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")
name: "bug",
components: {
edit,
detail,
Search
},
data() {
let userInfo = this.$store.state.admin.user.info;
return {
action: Api.index,
easySearch: {
keys: {
op: "title,pagePath",
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();
},
{
title: this.l("level"),
key: "level",
width: 100
search() {
this.$refs.grid.easySearch(this.easySearch);
},
{
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
)
//打开修改窗口
editInfo(value) {
this.modalEdit = true;
this.$refs.edit.editeInfo(value);
},
{
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
)
//修改事件
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("修改失败!");
}
},
{
title: this.l("status"),
key: "status",
width: 100,
render: (h, params) => {
return h("state", {
props: {
code: "Test.bug.status",
type: "text",
value: params.row.status + ""
}
});
}
//打开确定/操作窗口
detailInfo(value) {
this.modalDetail = true;
this.$refs.detail.detailInfo(value);
},
{
title: this.l("creationTime"),
key: "creationTime",
align: "center",
width: 180
//确定/关闭操作
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("操作失败!");
}
},
{
title: this.l("createor"),
key: "createor",
width: 120
//取消窗口,查看状态
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;
},
{
title: this.l("alloter"),
key: "alloter",
width: 120
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);
},
{
title: this.l("lastModificationTime"),
key: "lastModificationTime",
align: "center",
width: 180
//得到需要批量操作的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;
},
{
title: this.l("auditUser"),
align: "center",
key: "auditUser",
width: 120
//批量操作
statuChange(value) {
this.listBatch.statusNew = value;
},
{
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);
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;
}
}
},
"解决"
),
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() {
this.$refs.grid.easySearch(this.easySearch);
},
//打开修改窗口
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);
},
//确定/关闭操作
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.$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("操作失败!");
}
});
} 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;
},
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;
}
}
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 (() => {
created() {
window.screenHeight = window.innerHeight;
this.gridHeight = window.screenHeight - 250;
})();
};
}
},
mounted() {
// this.search(this.searchForm)
window.onresize = () => {
return (() => {
window.screenHeight = window.innerHeight;
this.gridHeight = window.screenHeight - 250;
})();
};
}
};
</script>
......@@ -18,7 +18,7 @@
<Button type="primary" @click="add">新增</Button>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" :fullscreen="full" footer-hide>
<Modal v-model="modal" :title="title" width="1200" :fullscreen="full" :footer-hide="initBtn">
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
</div>
......@@ -48,6 +48,7 @@ export default {
},
modal: false,
full: false,
initBtn: true,
title: "新增",
detail: null,
curId: 0,
......@@ -213,6 +214,7 @@ export default {
add() {
this.curId = 0;
this.full = false;
this.initBtn = true;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
......@@ -227,6 +229,7 @@ export default {
this.curId = id;
this.title = "详情";
this.full = false;
this.initBtn = false;
this.detail = () => import("./detail");
this.modal = true;
},
......@@ -234,6 +237,7 @@ export default {
this.curId = id;
this.title = "编辑";
this.full = false;
this.initBtn = true;
this.detail = () => import("./edit");
this.modal = true;
},
......@@ -241,6 +245,7 @@ export default {
this.curId = row.id;
this.title = "处理文件:" + row.name;
this.full = true;
this.initBtn = true;
this.detail = () => import("./process");
this.modal = true;
},
......
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