123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281 |
- <template>
- <div>
- <a-modal
- centered
- :title="title"
- :width="1000"
- :visible="visible"
- @ok="handleOk"
- @cancel="handleCancel"
- cancelText="关闭">
- <!-- 查询区域 -->
- <div class="table-page-search-wrapper">
- <a-form layout="inline" @keyup.enter.native="searchQuery">
- <a-row :gutter="24">
- <a-col :span="10">
- <a-form-item label="用户账号">
- <a-input placeholder="请输入用户账号" v-model="queryParam.realname"></a-input>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
- <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
- </span>
- </a-col>
- </a-row>
- </a-form>
- </div>
- <!-- table区域-begin -->
- <div>
- <a-table
- size="small"
- bordered
- rowKey="id"
- :columns="columns2"
- :dataSource="dataSource2"
- :loading="loading"
- :scroll="{ y: 240 }"
- @change="handleTableChange"
- >
- </a-table>
- </div>
- <!-- table区域-end -->
- </a-modal>
- </div>
- </template>
- <script>
- import {filterObj} from '@/utils/util'
- import {getAction} from '@/api/manage'
- export default {
- name: "SelectUserModal",
- data() {
- return {
- title: "推送详情",
- xmid:"",
- names: [],
- keys:"",
- visible: false,
- placement: 'right',
- description: '',
- // 查询条件
- queryParam: {},
- // 表头
- columns2: [
- {
- title: '接收人',
- align: "center",
- dataIndex: 'realname',
- key: 'realname',
- },
- {
- title: '发送时间',
- align: "center",
- dataIndex: 'createTime',
- key: 'createTime',
- scopedSlots: {customRender: 'action'},
- },
- {
- title: '接收时间',
- align: "center",
- dataIndex: 'readTime',
- key: 'readTime',
- scopedSlots: {customRender: 'action'},
- },
- {
- title: '是否接受',
- align: "center",
- dataIndex: 'readFlag',
- key: 'readFlag',
- customRender: function (text) {
- if (text == '1') {
- return "已接收";
- } else {
- return "未接收";
- }
- }
- },
- ],
- //数据集
- dataSource1: [],
- dataSource2: [],
- dataSource3: [],
- // 分页参数
- ipagination: {
- current: 1,
- pageSize: 10,
- pageSizeOptions: ['10', '20', '30'],
- showTotal: (total, range) => {
- return range[0] + "-" + range[1] + " 共" + total + "条"
- },
- showQuickJumper: true,
- showSizeChanger: true,
- total: 0
- },
- isorter: {
- column: 'createTime',
- order: 'desc',
- },
- loading: false,
- selectedRowKeys: [],
- selectedRows: [],
- url: {
- list: "/sys/user/list",
- accecptList:"/engineeringpush/rmEngineeringpush/findAllUser"
- }
- }
- },
- created() {
- },
- methods: {
- searchQuery() {
- this.loadData(1);
- },
- searchReset() {
- this.queryParam = {};
- this.loadData(1);
- },
- close () {
- this.$emit('close');
- this.visible = false;
- },
- handleCancel() {
- this.close()
- },
- handleOk() {
- /* this.dataSource2 = this.selectedRowKeys;
- console.log("data:" + this.dataSource2);
- this.$emit("selectFinished", this.dataSource2);*/
- this.visible = false;
- },
- add(record) {
- this.xmid=record.id
- this.searchReset()
- this.loadData()
- this.visible = true;
- },
- loadData(arg) {
- //加载数据 若传入参数1则加载第一页的内容
- if (arg === 1) {
- this.ipagination.current = 1;
- }
- var params = this.getQueryParams();//查询条件
- params.xmid=this.xmid;
- getAction(this.url.accecptList, params).then((res) => {
- if (res.success) {
- this.dataSource2 = res.result.records;
- this.ipagination.total = Number(res.result.total);
- }
- })
- },
- getQueryParams() {
- var param = Object.assign({}, this.queryParam, this.isorter);
- param.field = this.getQueryField();
- param.pageNo = this.ipagination.current;
- param.pageSize = this.ipagination.pageSize;
- return filterObj(param);
- },
- getQueryField() {
- //TODO 字段权限控制
- },
- onSelectAll(selected, selectedRows, changeRows) {
- if (selected === true) {
- for (var a = 0; a < changeRows.length; a++) {
- this.dataSource2.push(changeRows[a]);
- }
- } else {
- for (var b = 0; b < changeRows.length; b++) {
- this.dataSource2.splice(this.dataSource2.indexOf(changeRows[b]), 1);
- }
- }
- // console.log(selected, selectedRows, changeRows);
- },
- onSelect(record, selected) {
- if (selected === true) {
- this.dataSource2.push(record);
- } else {
- var index = this.dataSource2.indexOf(record);
- //console.log();
- if (index >= 0) {
- this.dataSource2.splice(this.dataSource2.indexOf(record), 1);
- }
- }
- },
- onSelectChange(selectedRowKeys, selectedRows) {
- this.selectedRowKeys = selectedRowKeys;
- this.selectionRows = selectedRows;
- },
- onClearSelected() {
- this.selectedRowKeys = [];
- this.selectionRows = [];
- },
- handleDelete: function (record) {
- this.dataSource2.splice(this.dataSource2.indexOf(record), 1);
- },
- handleTableChange(pagination, filters, sorter) {
- //分页、排序、筛选变化时触发
- console.log(sorter);
- //TODO 筛选
- if (Object.keys(sorter).length > 0) {
- this.isorter.column = sorter.field;
- this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
- }
- this.ipagination = pagination;
- this.loadData();
- }
- }
- }
- </script>
- <style lang="less" scoped>
- .ant-card-body .table-operator {
- margin-bottom: 18px;
- }
- .ant-table-tbody .ant-table-row td {
- padding-top: 15px;
- padding-bottom: 15px;
- }
- .anty-row-operator button {
- margin: 0 5px
- }
- .ant-btn-danger {
- background-color: #ffffff
- }
- .ant-modal-cust-warp {
- height: 100%
- }
- .ant-modal-cust-warp .ant-modal-body {
- height: calc(100% - 110px) !important;
- overflow-y: auto
- }
- .ant-modal-cust-warp .ant-modal-content {
- height: 90% !important;
- overflow-y: hidden
- }
- </style>
|