Commit a2cb213b authored by renjintao's avatar renjintao

exception

parent 9d689af0
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action">
<div>
<DataGrid :columns="columns" ref="grid" :action="action" exportTitle="异常记录">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入关键字登录账号/租户编号" v-model="easySearch.keys.value" v-width="300"/>
<Input placeholder="请输入关键字登录账号/租户编号" v-model="easySearch.keys.value" v-width="300" />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
......@@ -22,8 +22,9 @@
<Modal v-model="modal" :title="title" fullscreen footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
</div>
</div>
</template>
<script>
import Api from "./api";
import Search from "./search";
......@@ -41,15 +42,17 @@ export default {
return {
action: Api.index,
easySearch: {
keys: { op: "loginName,tanentCode", value: null },
keys: {
op: "loginName,tanentCode",
value: null
},
},
end:null,
end: null,
modal: false,
title: "新增",
detail: null,
curId: 0,
columns: [
{
columns: [{
key: "id",
title: this.$t("id"),
hide: true,
......@@ -140,22 +143,30 @@ export default {
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
return h("div", {
class: "action"
}, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) },
"op", {
attrs: {
oprate: "detail"
},
on: {
click: () => this.view(params.row.id)
},
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
// h('op', { attrs: { oprate: 'edit'}, on: { click: () => this.edit(params.row.id) } }, '编辑'),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) },
"op", {
attrs: {
oprate: "delete"
},
on: {
click: () => this.remove(params.row.id)
},
},
"删除"
),
......@@ -166,12 +177,15 @@ export default {
};
},
created() {
var date=new Date().getTime()-24*60*60*1000*5;
this.end=new Date(date);
var date = new Date().getTime() - 24 * 60 * 60 * 1000 * 5;
this.end = new Date(date);
console.log(this);
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
......@@ -215,16 +229,16 @@ export default {
}
});
},
clear(){
clear() {
this.$Modal.confirm({
title:"确认",
content:"确认要删除"+this.$u.toDate(this.end) +"以前的数据吗",
onOk:()=>{
Api.deleteAll(this.end).then(r=>{
if(r.success){
title: "确认",
content: "确认要删除" + this.$u.toDate(this.end) + "以前的数据吗",
onOk: () => {
Api.deleteAll(this.end).then(r => {
if (r.success) {
this.$Message.success("删除成功")
this.$refs.grid.load();
}else{
} else {
this.$Message.error("出现异常")
}
})
......@@ -263,13 +277,14 @@ export default {
return this.$t(vkey) || key;
},
},
computed:{
dis(){
var num=(new Date().getTime()-this.end.getTime())/(1000*60*60*24);
return num<1
computed: {
dis() {
var num = (new Date().getTime() - this.end.getTime()) / (1000 * 60 * 60 * 24);
return num < 1
}
}
};
</script>
<style lang="less">
</style>
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