Commit b366ac27 authored by renjintao's avatar renjintao

tenantCode

parent 2ca7dbc0
<template> <template>
<div> <div>
<DataGrid :columns="columns" ref="grid" :action="action"><template slot="easySearch"><Form ref="formInline" :model="easySearch" inline><FormItem prop="keys"><Input placeholder="请输入关键字/////" v-model="easySearch.keys.value" /> </FormItem> <DataGrid :columns="columns" ref="grid" :action="action"><template slot="easySearch">
<FormItem><Button type="primary" @click="search">查询</Button></FormItem> <Form ref="formInline" :model="easySearch" inline>
</Form></template> <FormItem prop="keys"><Input placeholder="请输入关键字/////" v-model="easySearch.keys.value" /> </FormItem>
<template slot="searchForm"> <FormItem><Button type="primary" @click="search">查询</Button></FormItem>
<Search /> </Form>
</template> </template>
<template slot="buttons"> <template slot="searchForm">
<Button type="primary" @click="addModal=true">新增</Button> <Search />
</template> </template>
</DataGrid> <template slot="buttons">
<Modal v-model="addModal" title="新增" footer-hide> <Button type="primary" @click="addModal=true">新增</Button>
<Add @on-close="cancel" @on-ok="addOk" /> </template>
</Modal> </DataGrid>
<Modal v-model="editModal" title="编辑" footer-hide> <Modal v-model="addModal" title="新增" footer-hide>
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" /> <Add @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
<Modal v-model="detailModal" title="详情"> <Modal v-model="editModal" title="编辑" footer-hide>
<Detail :eid="curId" /> <Edit :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" <Modal v-model="detailModal" title="详情">
@on-cancel="cancel"> <Detail :eid="curId" />
<p>确定删除?</p> </Modal>
</Modal> <Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
</div> <p>确定删除?</p>
</Modal>
</div>
</template> </template>
<script> <script>
import Api from './api' import Api from './api'
import Add from './add' import Add from './add'
...@@ -32,109 +35,195 @@ import Edit from './edit' ...@@ -32,109 +35,195 @@ import Edit from './edit'
import Detail from './detail' import Detail from './detail'
import Search from './search' import Search from './search'
export default { export default {
name: 'list', name: 'list',
components:{ components: {
Add,Edit,Detail,Search Add,
}, Edit,
data() { Detail,
return { Search
action: Api.index, },
easySearch: { data() {
keys:{op:"name,loginName,password,token,source,remark",value:null} return {
}, action: Api.index,
addModal: false, easySearch: {
editModal: false, keys: {
detailModal: false, op: "name,loginName,password,token,source,remark",
deletelModal: false, value: null
curId: 0, }
columns: [ },
//{ key:"id",title:this.l("id") ,hide:true ,align:"left" }, addModal: false,
{ key:"loginName",title:this.l("loginName") ,easy:true ,high:true }, editModal: false,
{ key:"name",title:this.l("name") ,easy:true ,high:true }, detailModal: false,
{ key:"tenantName",title:this.l("tenantName") , easy:true ,high:true }, deletelModal: false,
{ key:"creationTime",title:this.l("creationTime") ,hide:true ,align:"left" }, curId: 0,
{ key:"creatorUserId",title:this.l("creatorUserId") ,hide:true ,align:"left" }, columns: [
{ key:"lastModificationTime",title:this.l("lastModificationTime") ,hide:true ,align:"left" }, //{ key:"id",title:this.l("id") ,hide:true ,align:"left" },
{ key:"lastModifierUserId",title:this.l("lastModifierUserId") ,hide:true ,align:"left" }, {
{ key:"isDeleted",title:this.l("isDeleted") ,hide:true ,align:"left" }, key: "loginName",
// { key:"deleterUserId",title:this.l("deleterUserId") ,hide:true ,align:"left" }, title: this.l("loginName"),
// { key:"deletionTime",title:this.l("deletionTime") ,hide:true ,align:"left" }, easy: true,
{ key:"lastLoginTime",title:this.l("lastLoginTime") ,align:"center" , width:260 ,high:true }, high: true
{ key:"loginTimes",title:this.l("loginTimes") ,align:"center" , width:160 ,high:true }, },
{ key:"status",title:this.l("status") ,align:"center" ,width:160 ,high:true ,code:'crm.customer.status' }, {
{ key: "name",
title: '操作', title: this.l("name"),
key: 'id', easy: true,
width: 140, high: true
align: 'center', },
render: (h, params) => { {
return h('div', { class: "action" }, [ key: "tenantName",
// h('op', { attrs: { oprate: 'detail' }, on: { click: () => this.detail(params.row.id) } }, '查看'), title: this.l("tenantName"),
h('op', { attrs: { oprate: 'edit'}, on: { click: () => this.edit(params.row.id) } }, '编辑'), easy: true,
h('op', { attrs: { oprate: 'remove' }, on: { click: () => this.remove(params.row.id) } }, '删除') high: true
]) },
} {
}, key: "creationTime",
] title: this.l("creationTime"),
} hide: true,
}, align: "left"
mounted(){ },
console.log(this); {
}, key: "creatorUserId",
async fetch({ store, params }) { title: this.l("creatorUserId"),
await store.dispatch('loadDictionary') // 加载数据字典 hide: true,
align: "left"
},
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
hide: true,
align: "left"
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
hide: true,
align: "left"
},
{
key: "isDeleted",
title: this.l("isDeleted"),
hide: true,
align: "left"
},
// { key:"deleterUserId",title:this.l("deleterUserId") ,hide:true ,align:"left" },
// { key:"deletionTime",title:this.l("deletionTime") ,hide:true ,align:"left" },
{
key: "lastLoginTime",
title: this.l("lastLoginTime"),
align: "center",
width: 260,
high: true
},
{
key: "loginTimes",
title: this.l("loginTimes"),
align: "center",
width: 160,
high: true
},
{
key: "status",
title: this.l("status"),
align: "center",
width: 160,
high: true,
code: 'crm.customer.status'
},
{
title: '操作',
key: 'id',
width: 140,
align: 'center',
render: (h, params) => {
return h('div', {
class: "action"
}, [
// h('op', { attrs: { oprate: 'detail' }, on: { click: () => this.detail(params.row.id) } }, '查看'),
h('op', {
attrs: {
oprate: 'edit'
},
on: {
click: () => this.edit(params.row.id)
}
}, '编辑'),
h('op', {
attrs: {
oprate: 'remove'
},
on: {
click: () => this.remove(params.row.id)
}
}, '删除')
])
}
},
]
}
},
mounted() {
console.log(this);
},
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods: {
addOk() {
this.$refs.grid.load()
this.addModal = false
this.detailModal = false
this.editModal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch)
},
detail(id) {
this.detailModal = true;
this.curId = id;
},
edit(id) {
this.editModal = true;
this.curId = id;
}, },
methods:{
addOk() {
this.$refs.grid.load()
this.addModal = false
this.detailModal = false
this.editModal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch)
},
detail(id) {
this.detailModal = true;
this.curId = id;
},
edit(id) {
this.editModal = true;
this.curId = id;
},
remove(id) { remove(id) {
this.deletelModal = true; this.deletelModal = true;
this.curId = id; this.curId = id;
}, },
removeOk() { removeOk() {
Api.delete({ id: this.curId }).then((r) => { Api.delete({
if (r.success) { id: this.curId
this.$refs.grid.load(); }).then((r) => {
this.deletelModal = false; if (r.success) {
this.$Message.success('删除成功') this.$refs.grid.load();
} this.deletelModal = false;
}) this.$Message.success('删除成功')
}, }
removeCancel() { })
this.deletelModal = false; },
}, removeCancel() {
cancel() { this.deletelModal = false;
this.curId = 0; },
this.addModal = false cancel() {
this.detailModal = false this.curId = 0;
this.editModal = false; this.addModal = false
this.deletedlModal = false; this.detailModal = false
}, this.editModal = false;
l(key) { this.deletedlModal = false;
/* },
l(key) {
/*
account:{ account:{
id:'', id:'',
userId:'', userId:'',
name:'', name:'',
loginName:'', loginName:'',
tanantCode:'', tenantCode:'',
password:'', password:'',
token:'', token:'',
status:'', status:'',
...@@ -151,11 +240,12 @@ keys:{op:"name,loginName,password,token,source,remark",value:null} ...@@ -151,11 +240,12 @@ keys:{op:"name,loginName,password,token,source,remark",value:null}
loginTimes:'累计登录次数', loginTimes:'累计登录次数',
} }
*/ */
let vkey = "account" + "." + key; let vkey = "account" + "." + key;
return this.$t(vkey)||key return this.$t(vkey) || key
} }
} }
} }
</script> </script>
<style lang="less"> <style lang="less">
</style> </style>
\ No newline at end of file
...@@ -41,7 +41,7 @@ export const actions = { ...@@ -41,7 +41,7 @@ export const actions = {
if (res.result) { if (res.result) {
util.cookies.set('uuid', res.result.userId); util.cookies.set('uuid', res.result.userId);
util.cookies.set('tanantCode', res.result.tanantCode); util.cookies.set('tenantCode', res.result.tenantCode);
util.cookies.set('token', res.result.accessToken); util.cookies.set('token', res.result.accessToken);
sessionStorage.setItem('token', res.result.accessToken) sessionStorage.setItem('token', res.result.accessToken)
// // 设置 vuex 用户信息 // // 设置 vuex 用户信息
......
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