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>
<FormItem><Button type="primary" @click="search">查询</Button></FormItem>
</Form>
</template>
<template slot="searchForm"> <template slot="searchForm">
<Search /> <Search />
</template> </template>
...@@ -19,12 +22,12 @@ ...@@ -19,12 +22,12 @@
<Modal v-model="detailModal" title="详情"> <Modal v-model="detailModal" title="详情">
<Detail :eid="curId" /> <Detail :eid="curId" />
</Modal> </Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" <Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
@on-cancel="cancel">
<p>确定删除?</p> <p>确定删除?</p>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from './api' import Api from './api'
import Add from './add' import Add from './add'
...@@ -33,15 +36,21 @@ import Detail from './detail' ...@@ -33,15 +36,21 @@ 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,
Detail,
Search
}, },
data() { data() {
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys:{op:"name,loginName,password,token,source,remark",value:null} keys: {
}, op: "name,loginName,password,token,source,remark",
value: null
}
},
addModal: false, addModal: false,
editModal: false, editModal: false,
detailModal: false, detailModal: false,
...@@ -49,42 +58,120 @@ keys:{op:"name,loginName,password,token,source,remark",value:null} ...@@ -49,42 +58,120 @@ keys:{op:"name,loginName,password,token,source,remark",value:null}
curId: 0, curId: 0,
columns: [ columns: [
//{ key:"id",title:this.l("id") ,hide:true ,align:"left" }, //{ 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: "loginName",
{ key:"tenantName",title:this.l("tenantName") , easy:true ,high:true }, title: this.l("loginName"),
{ key:"creationTime",title:this.l("creationTime") ,hide:true ,align:"left" }, easy: true,
{ key:"creatorUserId",title:this.l("creatorUserId") ,hide:true ,align:"left" }, high: true
{ 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: "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:"deleterUserId",title:this.l("deleterUserId") ,hide:true ,align:"left" },
// { key:"deletionTime",title:this.l("deletionTime") ,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: "lastLoginTime",
{ key:"status",title:this.l("status") ,align:"center" ,width:160 ,high:true ,code:'crm.customer.status' }, 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: '操作', title: '操作',
key: 'id', key: 'id',
width: 140, width: 140,
align: 'center', align: 'center',
render: (h, params) => { render: (h, params) => {
return h('div', { class: "action" }, [ return h('div', {
class: "action"
}, [
// h('op', { attrs: { oprate: 'detail' }, on: { click: () => this.detail(params.row.id) } }, '查看'), // 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', {
h('op', { attrs: { oprate: 'remove' }, on: { click: () => this.remove(params.row.id) } }, '删除') attrs: {
oprate: 'edit'
},
on: {
click: () => this.edit(params.row.id)
}
}, '编辑'),
h('op', {
attrs: {
oprate: 'remove'
},
on: {
click: () => this.remove(params.row.id)
}
}, '删除')
]) ])
} }
}, },
] ]
} }
}, },
mounted(){ mounted() {
console.log(this); console.log(this);
}, },
async fetch({ store, params }) { async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch('loadDictionary') // 加载数据字典
}, },
methods:{ methods: {
addOk() { addOk() {
this.$refs.grid.load() this.$refs.grid.load()
this.addModal = false this.addModal = false
...@@ -109,7 +196,9 @@ keys:{op:"name,loginName,password,token,source,remark",value:null} ...@@ -109,7 +196,9 @@ keys:{op:"name,loginName,password,token,source,remark",value:null}
this.curId = id; this.curId = id;
}, },
removeOk() { removeOk() {
Api.delete({ id: this.curId }).then((r) => { Api.delete({
id: this.curId
}).then((r) => {
if (r.success) { if (r.success) {
this.$refs.grid.load(); this.$refs.grid.load();
this.deletelModal = false; this.deletelModal = false;
...@@ -134,7 +223,7 @@ keys:{op:"name,loginName,password,token,source,remark",value:null} ...@@ -134,7 +223,7 @@ keys:{op:"name,loginName,password,token,source,remark",value:null}
userId:'', userId:'',
name:'', name:'',
loginName:'', loginName:'',
tanantCode:'', tenantCode:'',
password:'', password:'',
token:'', token:'',
status:'', status:'',
...@@ -152,10 +241,11 @@ keys:{op:"name,loginName,password,token,source,remark",value:null} ...@@ -152,10 +241,11 @@ keys:{op:"name,loginName,password,token,source,remark",value:null}
} }
*/ */
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>
...@@ -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