parent
a8e198640a
commit
752f1b4803
13 changed files with 967 additions and 567 deletions
@ -0,0 +1,234 @@ |
||||
<template> |
||||
<a-card :bordered="false"> |
||||
|
||||
<!-- table区域-begin --> |
||||
<div> |
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
||||
<i class="anticon anticon-info-circle ant-alert-icon"></i>已选择 <a |
||||
style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
||||
<a style="margin-left: 24px" @click="onClearSelected">清空</a> |
||||
</div> |
||||
|
||||
<a-table |
||||
ref="table" |
||||
bordered |
||||
size="middle" |
||||
rowKey="id" |
||||
:columns="columns" |
||||
:dataSource="dataSource" |
||||
:pagination="ipagination" |
||||
:loading="loading" |
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
||||
@change="handleTableChange"> |
||||
|
||||
</a-table> |
||||
</div> |
||||
<!-- table区域-end --> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
import UserModal from './modules/UserModal' |
||||
import PasswordModal from './modules/PasswordModal' |
||||
import {putAction, getFileAccessHttpUrl, getAction} from '@/api/manage'; |
||||
import {frozenBatch} from '@/api/api' |
||||
import {JeecgListMixin} from '@/mixins/JeecgListMixin' |
||||
import SysUserAgentModal from "./modules/SysUserAgentModal"; |
||||
import JInput from '@/components/jeecg/JInput' |
||||
import UserRecycleBinModal from './modules/UserRecycleBinModal' |
||||
import JSuperQuery from '@/components/jeecg/JSuperQuery' |
||||
import JThirdAppButton from '@/components/jeecgbiz/thirdApp/JThirdAppButton' |
||||
import UserModalDetail from './modules/UserModalDetail' |
||||
import {filterObj} from "@/utils/util"; |
||||
|
||||
export default { |
||||
name: "User2ListRef", |
||||
mixins: [JeecgListMixin], |
||||
components: { |
||||
JThirdAppButton, |
||||
SysUserAgentModal, |
||||
UserModal, |
||||
PasswordModal, |
||||
JInput, |
||||
UserRecycleBinModal, |
||||
JSuperQuery, |
||||
UserModalDetail |
||||
}, |
||||
data() { |
||||
return { |
||||
description: '这是用户管理页面', |
||||
queryParam: {}, |
||||
groupxId:'', |
||||
recycleBinVisible: false, |
||||
columns: [ |
||||
/*{ |
||||
title: '#', |
||||
dataIndex: '', |
||||
key:'rowIndex', |
||||
width:60, |
||||
align:"center", |
||||
customRender:function (t,r,index) { |
||||
return parseInt(index)+1; |
||||
} |
||||
},*/ |
||||
{ |
||||
title: '用户账号', |
||||
align: "center", |
||||
dataIndex: 'username', |
||||
width: 120, |
||||
sorter: true |
||||
}, |
||||
{ |
||||
title: '用户姓名', |
||||
align: "center", |
||||
width: 100, |
||||
dataIndex: 'realname', |
||||
}, |
||||
// { |
||||
// title: '头像', |
||||
// align: "center", |
||||
// width: 120, |
||||
// dataIndex: 'avatar', |
||||
// scopedSlots: {customRender: "avatarslot"} |
||||
// }, |
||||
|
||||
// { |
||||
// title: '性别', |
||||
// align: "center", |
||||
// width: 80, |
||||
// dataIndex: 'sex_dictText', |
||||
// sorter: true |
||||
// }, |
||||
// { |
||||
// title: '生日', |
||||
// align: "center", |
||||
// width: 100, |
||||
// dataIndex: 'birthday' |
||||
// }, |
||||
{ |
||||
title: '手机号码', |
||||
align: "center", |
||||
width: 100, |
||||
dataIndex: 'phone' |
||||
}, |
||||
// { |
||||
// title: '部门', |
||||
// align: "center", |
||||
// width: 180, |
||||
// dataIndex: 'orgCodeTxt' |
||||
// }, |
||||
// { |
||||
// title: '负责部门', |
||||
// align: "center", |
||||
// width: 180, |
||||
// dataIndex: 'departIds_dictText' |
||||
// }, |
||||
{ |
||||
title: '状态', |
||||
align: "center", |
||||
width: 80, |
||||
dataIndex: 'status_dictText' |
||||
}, |
||||
// { |
||||
// title: '操作', |
||||
// dataIndex: 'action', |
||||
// scopedSlots: {customRender: 'action'}, |
||||
// align: "center", |
||||
// width: 170 |
||||
// } |
||||
|
||||
], |
||||
// superQueryFieldList: [ |
||||
// {type: 'input', value: 'username', text: '用户账号',}, |
||||
// {type: 'input', value: 'realname', text: '用户姓名',}, |
||||
// {type: 'select', value: 'sex', text: '性别', dictCode: 'sex'}, |
||||
// ], |
||||
url: { |
||||
syncUser: "/act/process/extActProcess/doSyncUser", |
||||
listByDepartId: "/sys/user/listByDepartId", |
||||
delete: "/sys/user/delete", |
||||
deleteBatch: "/sys/user/deleteBatch", |
||||
exportXlsUrl: "/sys/user/exportXls", |
||||
importExcelUrl: "sys/user/importExcel", |
||||
}, |
||||
} |
||||
}, |
||||
computed: { |
||||
importExcelUrl: function () { |
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||
} |
||||
}, |
||||
created() { |
||||
this.loadData(); |
||||
}, |
||||
methods: { |
||||
// valueChange(value) { |
||||
// if (value) this.loadData() |
||||
// }, |
||||
//加载传递参数 |
||||
loadParameter() { |
||||
if (this.loadRouteType === false) { |
||||
this.groupxId = this.$router. |
||||
this.loadRouteType = true; |
||||
} |
||||
}, |
||||
loadData2(groupxId) { |
||||
alert("loadData groupxId:"+groupxId) |
||||
if (!this.url.listByDepartId) { |
||||
this.$message.error("请设置url.list属性!") |
||||
return |
||||
} |
||||
//加载数据 若传入参数1则加载第一页的内容 |
||||
// if (arg === 1) { |
||||
// this.ipagination.current = 1; |
||||
// } |
||||
this.loadParameter(); |
||||
var params = this.getQueryParams();//查询条件 |
||||
this.loading = true; |
||||
console.log("----------------the params:", params); |
||||
getAction(this.url.listByDepartId, params).then((res) => { |
||||
if (res.success) { |
||||
this.dataSource = res.result.records || res.result; |
||||
if (res.result.total) { |
||||
this.ipagination.total = res.result.total; |
||||
} else { |
||||
this.ipagination.total = 0; |
||||
} |
||||
} else { |
||||
this.$message.warning(res.message) |
||||
} |
||||
}).finally(() => { |
||||
this.dataSource.forEach(item => { |
||||
item['stationName'] = this.stationName; |
||||
item['stationNum'] = this.stationNum; |
||||
}) |
||||
this.loading = false |
||||
}) |
||||
}, |
||||
getQueryParams() { |
||||
//获取查询条件 |
||||
let sqp = {} |
||||
if (this.superQueryParams) { |
||||
sqp['superQueryParams'] = encodeURI(this.superQueryParams) |
||||
sqp['superQueryMatchType'] = this.superQueryMatchType |
||||
} |
||||
var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters); |
||||
param.field = this.getQueryField(); |
||||
param.pageNo = this.ipagination.current; |
||||
param.pageSize = this.ipagination.pageSize; |
||||
param.groupxId = this.groupxId; |
||||
return filterObj(param); |
||||
}, |
||||
onClearSelected() { |
||||
this.selectedRowKeys = []; |
||||
this.selectionRows = []; |
||||
this.selectedMainId = '' |
||||
}, |
||||
onSelectChange(selectedRowKeys) { |
||||
console.log('selectedRowKeys changed: ', selectedRowKeys); |
||||
this.selectedRowKeys = selectedRowKeys; |
||||
}, |
||||
} |
||||
|
||||
} |
||||
</script> |
Loading…
Reference in new issue