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>
<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>
......@@ -19,12 +22,12 @@
<Modal v-model="detailModal" title="详情">
<Detail :eid="curId" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk"
@on-cancel="cancel">
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p>
</Modal>
</div>
</div>
</template>
<script>
import Api from './api'
import Add from './add'
......@@ -33,15 +36,21 @@ import Detail from './detail'
import Search from './search'
export default {
name: 'list',
components:{
Add,Edit,Detail,Search
components: {
Add,
Edit,
Detail,
Search
},
data() {
return {
action: Api.index,
easySearch: {
keys:{op:"name,loginName,password,token,source,remark",value:null}
},
keys: {
op: "name,loginName,password,token,source,remark",
value: null
}
},
addModal: false,
editModal: false,
detailModal: false,
......@@ -49,42 +58,120 @@ keys:{op:"name,loginName,password,token,source,remark",value:null}
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: "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' },
{
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" }, [
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) } }, '删除')
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(){
mounted() {
console.log(this);
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods:{
methods: {
addOk() {
this.$refs.grid.load()
this.addModal = false
......@@ -109,7 +196,9 @@ keys:{op:"name,loginName,password,token,source,remark",value:null}
this.curId = id;
},
removeOk() {
Api.delete({ id: this.curId }).then((r) => {
Api.delete({
id: this.curId
}).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.deletelModal = false;
......@@ -134,7 +223,7 @@ keys:{op:"name,loginName,password,token,source,remark",value:null}
userId:'',
name:'',
loginName:'',
tanantCode:'',
tenantCode:'',
password:'',
token:'',
status:'',
......@@ -152,10 +241,11 @@ keys:{op:"name,loginName,password,token,source,remark",value:null}
}
*/
let vkey = "account" + "." + key;
return this.$t(vkey)||key
return this.$t(vkey) || key
}
}
}
</script>
<style lang="less">
</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