Commit b366ac27 authored by renjintao's avatar renjintao

tenantCode

parent 2ca7dbc0
<template>
<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>
<FormItem><Button type="primary" @click="search">查询</Button></FormItem>
</Form></template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="addModal=true">新增</Button>
</template>
</DataGrid>
<Modal v-model="addModal" title="新增" footer-hide>
<Add @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="editModal" title="编辑" footer-hide>
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="detailModal" title="详情">
<Detail :eid="curId" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk"
@on-cancel="cancel">
<p>确定删除?</p>
</Modal>
</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>
<FormItem><Button type="primary" @click="search">查询</Button></FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="addModal=true">新增</Button>
</template>
</DataGrid>
<Modal v-model="addModal" title="新增" footer-hide>
<Add @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="editModal" title="编辑" footer-hide>
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="detailModal" title="详情">
<Detail :eid="curId" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p>
</Modal>
</div>
</template>
<script>
import Api from './api'
import Add from './add'
......@@ -32,109 +35,195 @@ import Edit from './edit'
import Detail from './detail'
import Search from './search'
export default {
name: 'list',
components:{
Add,Edit,Detail,Search
},
data() {
return {
action: Api.index,
easySearch: {
keys:{op:"name,loginName,password,token,source,remark",value:null}
},
addModal: false,
editModal: false,
detailModal: false,
deletelModal: false,
curId: 0,
columns: [
//{ key:"id",title:this.l("id") ,hide:true ,align:"left" },
{ key:"loginName",title:this.l("loginName") ,easy:true ,high:true },
{ key:"name",title:this.l("name") ,easy:true ,high:true },
{ key:"tenantName",title:this.l("tenantName") , easy:true ,high:true },
{ key:"creationTime",title:this.l("creationTime") ,hide:true ,align:"left" },
{ key:"creatorUserId",title:this.l("creatorUserId") ,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') // 加载数据字典
name: 'list',
components: {
Add,
Edit,
Detail,
Search
},
data() {
return {
action: Api.index,
easySearch: {
keys: {
op: "name,loginName,password,token,source,remark",
value: null
}
},
addModal: false,
editModal: false,
detailModal: false,
deletelModal: false,
curId: 0,
columns: [
//{ key:"id",title:this.l("id") ,hide:true ,align:"left" },
{
key: "loginName",
title: this.l("loginName"),
easy: true,
high: true
},
{
key: "name",
title: this.l("name"),
easy: true,
high: true
},
{
key: "tenantName",
title: this.l("tenantName"),
easy: true,
high: true
},
{
key: "creationTime",
title: this.l("creationTime"),
hide: true,
align: "left"
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
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) {
this.deletelModal = true;
this.curId = id;
},
removeOk() {
Api.delete({ id: this.curId }).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.deletelModal = false;
this.$Message.success('删除成功')
}
})
},
removeCancel() {
this.deletelModal = false;
},
cancel() {
this.curId = 0;
this.addModal = false
this.detailModal = false
this.editModal = false;
this.deletedlModal = false;
},
l(key) {
/*
remove(id) {
this.deletelModal = true;
this.curId = id;
},
removeOk() {
Api.delete({
id: this.curId
}).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.deletelModal = false;
this.$Message.success('删除成功')
}
})
},
removeCancel() {
this.deletelModal = false;
},
cancel() {
this.curId = 0;
this.addModal = false
this.detailModal = false
this.editModal = false;
this.deletedlModal = false;
},
l(key) {
/*
account:{
id:'',
userId:'',
name:'',
loginName:'',
tanantCode:'',
tenantCode:'',
password:'',
token:'',
status:'',
......@@ -151,11 +240,12 @@ keys:{op:"name,loginName,password,token,source,remark",value:null}
loginTimes:'累计登录次数',
}
*/
let vkey = "account" + "." + key;
return this.$t(vkey)||key
}
}
let vkey = "account" + "." + key;
return this.$t(vkey) || key
}
}
}
</script>
<style lang="less">
</style>
\ No newline at end of file
</style>
......@@ -41,7 +41,7 @@ export const actions = {
if (res.result) {
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);
sessionStorage.setItem('token', res.result.accessToken)
// // 设置 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