马宇豪
2023-06-08 d081cdaabcb942298f1df374f6a1cd626741098f
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
<template>
  <div class="inner">
    <a-row type="flex" justify="space-between" style="margin-bottom: 20px">
      <a-col :span="8">
        <a-radio-group v-model="category">
          <a-radio-button :value="0">
            全部
          </a-radio-button>
          <a-radio-button :value="1">
            审核通过
          </a-radio-button>
          <a-radio-button :value="2">
            未审核
          </a-radio-button>
          <a-radio-button :value="3">
            审核驳回
          </a-radio-button>
        </a-radio-group>
      </a-col>
      <a-col :span="16">
        <a-row type="flex" justify="end" :gutter="12">
          <a-col :span="8">
            <a-range-picker
                format="YYYY-MM-DD"
                :placeholder="['开始时间', '结束时间']"
                @change="timeChange"
                @ok="timeOk"
                style="width: 100%"
            />
          </a-col>
          <a-col :span="4">
            <a-button type="primary">查询</a-button>
            <a-button style="margin-left: 12px">重置</a-button>
          </a-col>
        </a-row>
      </a-col>
    </a-row>
 
    <div class="table-cont">
      <a-table :columns="columns" :data-source="data" bordered>
        <template #level="level">
          <a-tag :color="level === '黄色' ? 'yellow' :level === '橙色'? 'orange':level === '红色'?'red':'blue'">
            {{ level }}
          </a-tag>
        </template>
        <template #attachment="text">
          <span v-if="text==='无'">无</span>
          <a v-else><b><a-icon type="paper-clip" /> {{text}}</b></a>
        </template >
        <template #status="status">
          <a-tag
              :color="status === 1 ? 'green' : status === 2 ? 'blue' : 'red'"
          >
            {{ status==1?'审核通过':status==2?'未审核':'审核驳回' }}
          </a-tag>
        </template>
        <template #operation="text, record, index">
          <a-button type="link" v-if="record.status == 1 || record.status == 3">查看信息详情</a-button>
          <a-button type="primary" v-if="record.status == 2">查看并审核</a-button>
        </template>
      </a-table>
    </div>
 
  </div>
</template>
 
<script>
 
export default {
  name: 'msgReview',
  components: {},
  data () {
    return {
      category: 0,
      columns: [
        {
          title: '序号',
          dataIndex: 'key',
          width: '5%',
        },
        {
          title: '提交审核时间',
          dataIndex: 'time',
          width: '15%',
          scopedSlots: {
            customRender: 'time'
          }, //设置定制化表格数据
        },
        {
          title: '发布单位',
          dataIndex: 'department',
          width: '12%',
        },
        {
          title: '类别',
          dataIndex: 'category',
          width: '8%',
        },
        {
          title: '级别',
          dataIndex: 'level',
          scopedSlots: {
            customRender: 'level'
          }, //设置定制化表格数据
          width: '8%',
        },
        {
          title: '信息标题',
          dataIndex: 'title',
          width: '16%',
        },
        {
          title: '附件',
          dataIndex: 'attachment',
          width: '6%',
          scopedSlots: {
            customRender: 'attachment'
          },
        },
        {
          title: '审核情况',
          dataIndex: 'status',
          width: '10%',
          scopedSlots: {
            customRender: 'status'
          }, //设置定制化表格数据
        },
        {
          title: '操作',
          dataIndex: 'operation',
          scopedSlots: {
            customRender: 'operation'
          },
        },
      ],
      data: [
        {
          key: 1,
          id:1001,
          time: '2023-05-02 15:30',
          department: '自治区预警中心',
          category: '气象',
          level: '黄色',
          title: '全疆高温红色预警',
          attachment: '1',
          status: 1
        },
        {
          key: 2,
          id:1002,
          time: '2023-05-02 15:30',
          department: '自治区预警中心',
          category: '气象',
          level: '橙色',
          title: '全疆高温红色预警',
          attachment: '1',
          status: 2
        },
        {
          key: 3,
          id:1003,
          time: '2023-05-02 15:30',
          department: '自治区预警中心',
          category: '气象',
          level: '橙色',
          title: '全疆高温红色预警',
          attachment: '1',
          status: 3
        }
      ]
    }
  },
  created() {
    const t = this
  },
  methods:{
    timeChange(date, dateString) {
      console.log(date, dateString);
    },
    timeOk(value) {
      console.log('timeOk: ', value);
    },
  }
}
</script>
 
<style lang="less" scoped>
 
</style>