Browse Source

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

chenxr3 4 years ago
parent
commit
5fc8c9a2a2

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

@ -5,7 +5,6 @@
5 5
  box-sizing: border-box;
6 6
  .search-container{
7 7
    width: 100%;
8
    padding: 0 0 20px;
9 8
    .search-ctn{
10 9
      width: 100%;
11 10
      overflow: hidden;
@ -14,8 +13,7 @@
14 13
      display: flex;
15 14
      position: relative;
16 15
      >div{
17
        display: flex; 
18
        margin: 0 20px 16px 0;    
16
        //margin: 0 20px 16px 0;
19 17
        line-height: 2;
20 18
        .input-rule{
21 19
          flex: 1;
@ -25,12 +23,23 @@
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 35
  .table-pager{
34 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,39 +1,67 @@
1 1
<template>
2
  <div class="track-container">
2
  <div class="track-container" @click="customVisibled = false">
3 3
    <div class="search-container">
4 4
      <div class="search-ctn">
5 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 13
          </div>
14 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 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 38
        </div>
26 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 55
    </div>
28
    <div>
56
    <div style="padding-top: 5px">
29 57
      <t-table :data="table.data" :loading="tableLoading" >
30 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 65
      </t-table>
38 66
      <t-pager :total="table.pager.total" :current.sync="table.pager.currentPage"
39 67
               :page-size.sync="table.pager.size"
@ -52,6 +80,32 @@ import services from '../../conf/services'
52 80
export default {
53 81
  data() {
54 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 109
      table: {
56 110
        data: [],
57 111
        pager: {
@ -72,6 +126,41 @@ export default {
72 126
    this.getList()
73 127
  },
74 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 164
    getList() {
76 165
      this.tableLoading = true
77 166
      var start = ''