浏览代码

[FE] 报表样式统一修改模板

chenxr3 4 年之前
父节点
当前提交
5fc8c9a2a2
共有 2 个文件被更改,包括 128 次插入30 次删除
  1. 15 6
      ebc-middle-platform/src/modules/attendance/track.scss
  2. 113 24
      ebc-middle-platform/src/modules/attendance/track.vue

+ 15 - 6
ebc-middle-platform/src/modules/attendance/track.scss

5
  box-sizing: border-box;
5
  box-sizing: border-box;
6
  .search-container{
6
  .search-container{
7
    width: 100%;
7
    width: 100%;
8
    padding: 0 0 20px;
9
    .search-ctn{
8
    .search-ctn{
10
      width: 100%;
9
      width: 100%;
11
      overflow: hidden;
10
      overflow: hidden;
14
      display: flex;
13
      display: flex;
15
      position: relative;
14
      position: relative;
16
      >div{
15
      >div{
17
        display: flex; 
18
        margin: 0 20px 16px 0;    
16
        //margin: 0 20px 16px 0;
19
        line-height: 2;
17
        line-height: 2;
20
        .input-rule{
18
        .input-rule{
21
          flex: 1;
19
          flex: 1;
25
          }
23
          }
26
        }
24
        }
27
      }
25
      }
28
      .btns button{
29
        margin: 0 2px;
26
      .btns{
27
        margin-left: auto;
28
        display: block;
29
        button{
30
          margin: 0 2px;
31
        }
30
      }
32
      }
31
    }
33
    }
32
  }
34
  }
33
  .table-pager{
35
  .table-pager{
34
    margin: 20px auto;
36
    margin: 20px auto;
35
  }
37
  }
36
}
38
  .allCondition{
39
    border: 1px solid rgba(0, 0, 0, 0.09);
40
    background-color: #f8f9fa;
41
    flex-wrap: wrap;
42
    padding: 20px 20px 20px 20px;
43
    margin: 5px auto;
44
  }
45
}

+ 113 - 24
ebc-middle-platform/src/modules/attendance/track.vue

1
<template>
1
<template>
2
  <div class="track-container">
2
  <div class="track-container" @click="customVisibled = false">
3
    <div class="search-container">
3
    <div class="search-container">
4
      <div class="search-ctn">
4
      <div class="search-ctn">
5
        <div>
5
        <div>
6
          <div class="input-rule">
7
            <t-date-picker v-model="queryCondition.rangeDate"
8
                           align-right
9
                           style="width:320px;"
10
                           type="dateTimeRange"
11
                           placeholder="选择时间段"
12
                           @date-change="onChange"></t-date-picker>
6
          <div style="display: flex;">
7
            <t-input v-model="queryCondition.alarmPerson" placeholder="员工姓名/员工工号">
8
              <template slot="append">
9
                <t-button color="success" icon="search-outline" @click="onSearch">查询</t-button>
10
              </template>
11
            </t-input>
12
            <t-button icon="filter-outline" style="margin: 0 10px;" @click="slideVisible = !slideVisible"></t-button>
13
          </div>
13
          </div>
14
        </div>
14
        </div>
15
        <div>
16
          <div class="label">姓名:</div>
17
          <div class="input-rule">
18
            <t-input v-model="queryCondition.alarmPerson" placeholder="请输入..."></t-input>
19
          </div>
20
        </div>
21
        <div class="btns">
22
          <t-button color="success" icon="search-outline" @click="onSearch">查询</t-button>
23
          <t-button color="secondary" icon="loading" class="reset-btn" @click="onReset">重置</t-button>
15
        <div class="btns" >
24
          <t-button color="secondary" icon="upload-outline" @click="toExport">导出至Excel</t-button>
16
          <t-button color="secondary" icon="upload-outline" @click="toExport">导出至Excel</t-button>
17
          <t-dropdown :visibled="customVisibled" trigger-mode="custom">
18
            <t-button slot="trigger" color="secondary" icon="tile-four-outline" @click="onTriggerClick"></t-button><!--aid-table-edit-->
19
            <div slot="popper">
20
              <div style="border-radius: 5px;padding: 20px 20px 20px 20px;background-color: white;">
21
                <t-checkbox-group v-model="social" vertical @change="checkAllGroupChange">
22
                  <t-checkbox v-for="(item) in columns" :key="item.label" :value="item.label" :label="item.label">
23
                    <span>{{ item.label }}</span>
24
                  </t-checkbox>
25
                </t-checkbox-group>
26
                <div style="padding-bottom: 10px">
27
                  <t-checkbox
28
                    :indeterminate="indeterminate"
29
                    :checked.sync="checkAll"
30
                    @click.prevent.native="handleCheckAll">全选
31
                  </t-checkbox>
32
                </div>
33
                <t-button color="success" size="sm" @click="onCloseClick">确认</t-button>
34
              </div>
35
            </div>
36
          </t-dropdown>
37
          <t-button color="secondary" icon="loading" class="reset-btn" @click="onReset"></t-button>
25
        </div>
38
        </div>
26
      </div>
39
      </div>
40
      <div class="animate-demo-wrapper">
41
        <transition name="slide-up">
42
          <div v-show="slideVisible" class="transition-box allCondition">
43
            <div class="input-rule" style="display: flex;">
44
              <div class="label" style="display: flex;align-items: center;">时间:</div>
45
              <t-date-picker v-model="queryCondition.rangeDate"
46
                             align-right
47
                             style="width:320px;"
48
                             type="dateTimeRange"
49
                             placeholder="选择时间段"
50
                             @date-change="onChange"></t-date-picker>
51
            </div>
52
          </div>
53
        </transition>
54
      </div>
27
    </div>
55
    </div>
28
    <div>
56
    <div style="padding-top: 5px">
29
      <t-table :data="table.data" :loading="tableLoading" >
57
      <t-table :data="table.data" :loading="tableLoading" >
30
        <t-table-column type="selection" width="70"></t-table-column>
58
        <t-table-column type="selection" width="70"></t-table-column>
31
        <t-table-column prop="entityName" label="姓名"></t-table-column>
32
        <t-table-column prop="entityPosition" label="职务"></t-table-column>
33
        <t-table-column prop="mapAreaName" label="位置区域"></t-table-column>
34
        <t-table-column prop="durationTime" label="停留时长"></t-table-column>
35
        <t-table-column prop="inTime" :formatter="timestampToTime" label="进入时间"></t-table-column>
36
        <t-table-column prop="outTime" :formatter="timestampToTime" label="离开时间"></t-table-column>
59
        <t-table-column v-if="columns[0].show" prop="entityName" label="姓名"></t-table-column>
60
        <t-table-column v-if="columns[1].show" prop="entityPosition" label="职务"></t-table-column>
61
        <t-table-column v-if="columns[2].show" prop="mapAreaName" label="位置区域"></t-table-column>
62
        <t-table-column v-if="columns[3].show" prop="durationTime" label="停留时长"></t-table-column>
63
        <t-table-column v-if="columns[4].show" :formatter="timestampToTime" prop="inTime" label="进入时间"></t-table-column>
64
        <t-table-column v-if="columns[5].show" :formatter="timestampToTime" prop="outTime" label="离开时间"></t-table-column>
37
      </t-table>
65
      </t-table>
38
      <t-pager :total="table.pager.total" :current.sync="table.pager.currentPage"
66
      <t-pager :total="table.pager.total" :current.sync="table.pager.currentPage"
39
               :page-size.sync="table.pager.size"
67
               :page-size.sync="table.pager.size"
52
export default {
80
export default {
53
  data() {
81
  data() {
54
    return {
82
    return {
83
      slideVisible: false,
84
      indeterminate: true,
85
      checkAll: true,
86
      social: ['姓名', '职务', '位置区域', '停留时长', '进入时间', '离开时间'],
87
      columns: [
88
        {
89
          label: '姓名',
90
          show: true
91
        }, {
92
          label: '职务',
93
          show: true
94
        }, {
95
          label: '位置区域',
96
          show: true
97
        }, {
98
          label: '停留时长',
99
          show: true
100
        }, {
101
          label: '进入时间',
102
          show: true
103
        }, {
104
          label: '离开时间',
105
          show: true
106
        }
107
      ],
108
      customVisibled: false,
55
      table: {
109
      table: {
56
        data: [],
110
        data: [],
57
        pager: {
111
        pager: {
72
    this.getList()
126
    this.getList()
73
  },
127
  },
74
  methods: {
128
  methods: {
129
    checkAllGroupChange () {
130
      if (this.social.length === 6) {
131
        this.indeterminate = false
132
        this.checkAll = true
133
      } else if (this.social.length > 0) {
134
        this.indeterminate = true
135
        this.checkAll = false
136
      } else {
137
        this.indeterminate = false
138
        this.checkAll = false
139
      }
140
    },
141
    handleCheckAll () {
142
      debugger
143
      if (this.indeterminate) {
144
        this.checkAll = false
145
      } else {
146
        this.checkAll = !this.checkAll
147
      }
148
      this.indeterminate = false
149
      if (this.checkAll) {
150
        this.social = ['姓名', '职务', '位置区域', '停留时长', '进入时间', '离开时间']
151
      } else {
152
        this.social = []
153
      }
154
    },
155
    onTriggerClick() {
156
      this.customVisibled = true
157
    },
158
    onCloseClick() {
159
      this.columns.forEach(e => {
160
        e.show = this.social.indexOf(e.label) >= 0
161
      })
162
      this.customVisibled = false
163
    },
75
    getList() {
164
    getList() {
76
      this.tableLoading = true
165
      this.tableLoading = true
77
      var start = ''
166
      var start = ''