Fixiaobai
2023-09-07 efcf450e8e7e375ef4ffe9f421ec0d34c5378180
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<template>
    <div class="content-main">
        <div class="top-bar">
            <el-form ref="form" :inline="true" :model="searchData" style="margin-top: 10px;">
              <el-form-item label="录入日期:" style="margin-right: 20px;">
                <el-date-picker
                    size="small"
                    v-model="searchData.entry_date"
                    type="date"
                    placeholder="请选择录入日期">
                </el-date-picker>
              </el-form-item>
              <el-form-item label="审核日期:" style="margin-right: 20px;">
                <el-date-picker
                    size="small"
                    v-model="searchData.check_date"
                    type="date"
                    placeholder="请选择审核日期">
                </el-date-picker>
              </el-form-item>
              <el-form-item label="状态:" style="margin-right: 20px;">
                <el-select size="small" v-model="searchData.state" placeholder="全部" style="width: 100px;">
                  <el-option
                    v-for="item in stateoptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="部门:" style="margin-right: 20px;">
                <el-input size="small" v-model="searchData.department" placeholder="请输入部门">
                </el-input>
              </el-form-item>
              <el-form-item>
                <el-button size="small" type="primary" @click="searchInspections">查询</el-button>
                <el-button size="small" type="primary" plain @click="reset">重置</el-button>
              </el-form-item>
            </el-form>
            <el-form class="rightBtn" style="margin-top: 10px;">
              <el-form-item class="createBtn">
                <el-button size="small" type="primary" icon="el-icon-plus" style="margin-right: 10px;">新增记录</el-button>
              </el-form-item>
              <el-form-item class="getDataBtn">
                <el-button size="small" type="primary" icon="el-icon-download">导出</el-button>
              </el-form-item>
            </el-form>
        </div>
        <div class="library-table">
      <div class="table-header">
        <el-radio-group v-model="radioValue" @change="radioclick">
          <el-radio-button v-for="item in conditionsOptions" :key="item.value" :label="item.value">
            {{ item.label }}
          </el-radio-button>
        </el-radio-group>
      </div>
      <div class="table-box">
        <el-table
                ref="recordTable"
                :max-height="800"
                :cell-style="{textAlign: 'left'}"
                :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'left'}"
                :data="recordTable"
                style="width: 100%"
              >
                <el-table-column
                  label="序号"
                  min-width="10%">
                  <template slot-scope="scope">
                    <el-checkbox v-model="checked"></el-checkbox>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="title"
                  label="标题"
                  min-width="12%"
                />
                <el-table-column
                  prop="content"
                  label="内容"
                  min-width="12%"
                />
                <el-table-column
                  prop="level"
                  label="等级"
                  min-width="12%"
                />
                <el-table-column
                  prop="type"
                  label="类型"
                  min-width="8%"
                />
                <el-table-column
                  prop="state"
                  label="状态"
                  min-width="12%">
                  <template slot-scope="scope">
                    <span v-if="scope.row.state === 1" style="color: red;">未读</span>
                    <span v-if="scope.row.state === 2" style="color: green;">已读</span>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="sender"
                  label="发件人"
                  min-width="8%"
                />
                <el-table-column
                  prop="create_time"
                  label="创建时间"
                  min-width="12%"
                />
                <el-table-column
                  label="操作"
                  min-width="10%"
                >
                  <template slot-scope="scope">
                    <el-button type="text" size="small" @click="deleteRow(scope.row)">删除</el-button>
                    <el-button type="text" size="small" @click="readRow(scope.row)">标为已读</el-button>
                  </template>
                </el-table-column>
              </el-table>
              <!-- 分页器 -->
              <div>
                <el-pagination
                  @size-change="handleSizeChange"
                  @current-change="handleCurrentChange"
                  :current-page="currentPage"
                  :page-sizes="[5, 10, 15, 20]"
                  :page-size="pageSize"
                  layout="total, sizes, prev, pager, next, jumper"
                  :total="total">
                </el-pagination>
              </div>
      </div>
    </div>
    </div>
</template>
 
<script>
export default {
    data(){
        return {
            searchData:{
                entry_date: '',
                check_date: '',
                state: 0,
                department: ''
            },
            stateoptions:[{
                value: 0,
                label: '已关闭'
            },{
                value: 1,
                label: '待关闭'
            }],
            recordTable:[],
            currentPage: 0,
            pageSize:5,
            total: 20
        }
    }
}
</script>
 
<style lang="scss" scoped>
.content-main{
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: column;
    .top-bar{
      margin: -25px -15px;
      background: #fff;
      display: flex;
      justify-content: space-between;
      padding: 5px 24px 0px 24px;
      .rightBtn{
        display: flex;
        justify-content: space-between;
      }
    }
    .library-table{
      background-color: #fff;
      flex: 1;
      margin: 0px -15px;
      margin-top: 40px;
      display: flex;
      flex-direction: column;
      .table-header{
        padding: 20px;
        display: flex;
        justify-content: space-between;
        .el-form-item{
          margin-bottom: 30px !important;
        }
      }
      .table-box{
          padding: 0px 20px;
          margin-top: 0px;
          flex: 1;
          background: #fff;
          /* padding: 20px 20px 10px 20px; */
          display: flex;
          flex-direction: column;
          .el-table {
            flex: 1;
          }
          >div:nth-child(2){
            display: flex;
            justify-content: end;
            margin: 10px 0;
          }
      }
    }
}
</style>