123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <template>
- <div class="main_root">
- <div class="search_header">
- <div class="search_left">
- <DatePicker
- v-model="searchForm.dataRange"
- @on-change="searchList()"
- :editable="false"
- :transfer="true"
- format="yyyy-MM-dd"
- type="daterange"
- placement="bottom-start"
- placeholder="请选择日期段"
- style="margin-right: 10px; width: 220px"
- ></DatePicker>
- <Input
- v-model="searchForm.name"
- placeholder="请输入登录名、事件"
- search
- @on-search="searchList()"
- style="width: 180px"
- />
- </div>
- </div>
- <div class="table_wrap">
- <Table :columns="columns" :data="searchForm.list">
- <template slot-scope="{ row }" slot="pushTypeSlot">
- <!-- 1发送消息 2解除锁定 3锁定 4更新策略 5重启设备 6恢复出厂 -->
- <div>{{ pushTypeInfo[row.pushType] }}</div>
- </template>
- </Table>
- </div>
- <div class="page_wrap">
- <Page
- :transfer="true"
- :total="searchForm.total"
- :current="searchForm.page"
- :page-size="searchForm.size"
- :page-size-opts="[10, 20, 40, 60]"
- @on-change="pageChange"
- @on-page-size-change="pageSizeChange"
- show-total
- show-sizer
- ></Page>
- </div>
- </div>
- </template>
-
- <script>
- import { dateFormat, pushTypeInfo } from "@/utils";
- import { logPush_list } from "@/api/log";
- export default {
- data() {
- return {
- pushTypeInfo,
- searchForm: {
- dataRange: [],
- name: "",
- page: 1,
- size: 10,
- list: [],
- total: 0
- },
- columns: [
- {
- title: "序号",
- align: "center",
- width: 70,
- render: (h, params) => {
- return h(
- "span",
- params.index +
- (this.searchForm.page - 1) * this.searchForm.size +
- 1
- );
- }
- },
- {
- title: "登录名",
- key: "loginname",
- align: "center"
- },
- {
- title: "姓名",
- key: "aname",
- align: "center"
- },
- {
- title: "事件",
- slot: "pushTypeSlot",
- align: "center"
- },
- {
- title: "设备号",
- key: "sn",
- align: "center"
- },
- {
- title: "时间",
- key: "createtime",
- width: 190,
- align: "center"
- }
- ]
- };
- },
- created() {
- this.searchList();
- },
- computed: {
- powerParams() {
- return this.$store.getters.powerParams;
- }
- },
- methods: {
- // 搜索
- searchList() {
- this.searchForm.page = 1;
- this.getList();
- },
- // 页码改变
- pageChange(page) {
- this.searchForm.page = page;
- this.getList();
- },
- // 每页显示数量改变
- pageSizeChange(size) {
- this.searchForm.size = size;
- this.searchForm.page = 1;
- this.getList();
- },
- // 获取列表
- getList() {
- let _begindate = this.searchForm.dataRange[0];
- _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
- let _enddate = this.searchForm.dataRange[1];
- _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
- let _regionids = this.$store.state.userPower.regionids;
- _regionids = [..._regionids];
- logPush_list({
- rtype: this.powerParams.rtype,
- objectid: this.powerParams.objectid,
- regionid: _regionids.pop(),
- schoolid: this.powerParams.objectid,
- page: this.searchForm.page,
- size: this.searchForm.size,
- begindate: _begindate,
- enddate: _enddate,
- name: this.searchForm.name
- }).then((data) => {
- if (data.code === 0) {
- this.searchForm.list = data.obj.data;
- this.searchForm.total = data.obj.total;
- } else {
- this.$Message.error(data.msg);
- }
- });
- }
- }
- };
- </script>
-
- <style lang="less" scoped>
- .search_header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin: 16px 16px;
- .search_left {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- }
- }
- </style>
|