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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
| <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="default">
| 全部
| </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 #time="text,record">
| <a v-if="!record.readed" style="color:red">[未读]</a>{{text}}
| </template>
| <template #level="text">
| <a-tag :color="text === '黄色' ? 'yellow' :text === '橙色'? 'orange':text === '红色'?'red':'blue'">
| {{ text }}
| </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 #receipt="text">
| <span v-if="text=='待叫应'"
| style='background-color:blue;padding:5px;color:#fff;border-radius: 5px;'>{{text}}</span>
| <span v-else-if="text=='已叫应'"
| style='background-color:limegreen;padding:5px;color:#2a2a2a;border-radius: 5px;'>{{text}}</span>
| <span v-else style='background-color:red;padding:5px;color:#fff;border-radius: 5px;'>{{text}}
| </span>
| </template>
| <template #operation="text, record, index">
| <div class="editable-row-operations">
| <div v-if="record.receipt==='待叫应'">
| <a @click="showModal" style="color:orangered"><a-icon type="notification" />
| 确认已收到</a>
| </div>
| <br />
| <router-link :to="{path:'/torelease'}">转发</router-link>
| <router-link :to="{path:'/details',query: {id: record.id}}">查看详情</router-link>
| </div>
| </template>
| </a-table>
| </div>
| <!-- 对话框 -->
| <a-modal title="回执"
| okText="确认已安排部署"
| cancelText="取消"
| :visible="visible" :confirm-loading="confirmLoading" @ok="handleOk"
| @cancel="handleCancel">
| <p>{{ ModalText }}</p>
| </a-modal>
| </div>
| </template>
|
| <script>
| const 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: 'receipt',
| width: '10%',
| scopedSlots: {
| customRender: 'receipt'
| }, //设置定制化表格数据
| },
| {
| title: '操作',
| dataIndex: 'operation',
| scopedSlots: {
| customRender: 'operation'
| },
| },
| ];
|
| const data = [{
| key: 1,
| id:1001,
| readed:false,
| time: '2023年5月3日 15:30',
| department: '自治区预警中心',
| category: '气象',
| level: '黄色',
| title: '全疆高温红色预警',
| attachment: '1',
| receipt: '待叫应'
| },
| {
| key: 2,
| readed:true,
| id:1002,
| time: '2023年5月2日 15:30',
| department: '自治区预警中心',
| category: '气象',
| level: '橙色',
| title: '全疆高温红色预警',
| attachment: '1',
| receipt: '已叫应'
| },
| {
| key: 3,
| readed:true,
| id:1003,
| time: '2023年5月1日 15:30',
| department: '自治区预警中心',
| category: '气象',
| level: '橙色',
| title: '全疆高温红色预警',
| attachment: '1',
| receipt: '已叫应'
| },
| {
| key: 4,
| readed:true,
| id:1004,
| time: '2023年5月1日 15:30',
| department: '自治区预警中心',
| category: '气象',
| level: '橙色',
| title: '全疆高温红色预警',
| attachment: '2',
| receipt: '超时未叫应'
| },
| {
| key: 5,
| readed:true,
| id:1005,
| time: '2023年4月21日 15:30',
| department: '自治区预警中心',
| category: '气象',
| level: '橙色',
| title: '全疆高温红色预警',
| attachment: '无',
| receipt: '已叫应'
| },
| {
| key: 6,
| readed:true,
| id:1006,
| time: '2023年4月21日 15:30',
| department: '自治区预警中心',
| category: '气象',
| level: '橙色',
| title: '全疆高温红色预警',
| attachment: '1',
| receipt: '已叫应'
| },
| {
| key: 7,
| readed:true,
| id:1007,
| time: '2023年1月21日 15:30',
| department: '自治区预警中心',
| category: '气象',
| level: '红色',
| title: '全疆低温红色预警',
| attachment: '1',
| receipt: '已叫应'
| },
|
| ];
|
| export default {
| data() {
| this.cacheData = data.map(item => ({
| ...item
| }));
| return {
| data,
| columns,
| editingKey: '',
| category: 'default',
| ModalText: '确认已经安排部署?',
| visible: false,
| confirmLoading: false,
| };
| },
| methods: {
| handleChange(value) {
| console.log(`Selected: ${value}`);
| },
| popupScroll() {
| console.log('popupScroll');
| },
| timeChange(date, dateString) {
| console.log(date, dateString);
| },
| timeOk(value) {
| console.log('timeOk: ', value);
| },
| //叫应回执时间
| showModal() {
| this.visible = true;
| },
| handleOk(e) {
| this.ModalText = '正在提交您的叫应状态...';
| this.confirmLoading = true;
| setTimeout(() => {
| this.visible = false;
| this.confirmLoading = false;
| }, 2000);
| },
| handleCancel(e) {
| this.visible = false;
| },
| },
| };
| </script>
|
| <style>
|
| </style>
|
|