|
@@ -7,13 +7,14 @@
|
7
|
7
|
<el-table-column v-for="(item, index) in columns" :key="index" :label="item.label" :prop="item.key">
|
8
|
8
|
</el-table-column>
|
9
|
9
|
<el-table-column label="操作" width="150">
|
10
|
|
- <div slot-scope="scope">
|
11
|
|
- <el-button @click="handleDetail(scope.row)" type="primary" size="mini">详情</el-button>
|
12
|
|
- </div>
|
13
|
|
- </el-table-column>
|
|
10
|
+ <div slot-scope="scope">
|
|
11
|
+ <el-button @click="handleDetail(scope.row)" type="primary" size="mini">详情</el-button>
|
|
12
|
+ </div>
|
|
13
|
+ </el-table-column>
|
14
|
14
|
</el-table>
|
15
|
15
|
<div class="table-pagination">
|
16
|
|
- <el-pagination :background="false" layout="total, prev, pager, next" :total="total" @current-change="handlePageChange"
|
|
16
|
+ <el-pagination :background="false" layout="total, prev, pager, next" :total="total"
|
|
17
|
+ @current-change="handlePageChange"
|
17
|
18
|
:current-page.sync="pageNum" :page-size.sync="pageSize">
|
18
|
19
|
</el-pagination>
|
19
|
20
|
</div>
|
|
@@ -22,11 +23,17 @@
|
22
|
23
|
:visible.sync="dialogVisible"
|
23
|
24
|
width="50%"
|
24
|
25
|
custom-class="audit-dialog">
|
25
|
|
- <div class="form-div">
|
26
|
|
- <el-input disabled v-model="selRow.title"></el-input>
|
27
|
|
- <el-input type="textarea" disabled v-model="selRow.messageType"></el-input>
|
28
|
|
- <el-input disabled v-model="selRow.publicTime"></el-input>
|
29
|
|
- </div>
|
|
26
|
+ <el-form style="height: 120px" class="form-div" label-position="left" label-width="80px" :model="selRow">
|
|
27
|
+ <el-form-item label="标题">
|
|
28
|
+ <el-input disabled v-model="selRow.title"/>
|
|
29
|
+ </el-form-item>
|
|
30
|
+ <el-form-item label="消息类型">
|
|
31
|
+ <el-input disabled v-model="selRow.messageType"/>
|
|
32
|
+ </el-form-item>
|
|
33
|
+ <el-form-item label="发布时间">
|
|
34
|
+ <el-input disabled v-model="selRow.publicTime"/>
|
|
35
|
+ </el-form-item>
|
|
36
|
+ </el-form>
|
30
|
37
|
</el-dialog>
|
31
|
38
|
</div>
|
32
|
39
|
</template>
|
|
@@ -51,83 +58,77 @@ export default {
|
51
|
58
|
key: 'publicTime'
|
52
|
59
|
},
|
53
|
60
|
],
|
54
|
|
- tableData: [{"title":'系统升级',"messageType":'公告',"publicTime":'2023-12-29 10:00:00'},
|
55
|
|
- {"title":'预警提示',"messageType":'系统通知',"publicTime":'2023-12-25 10:00:00'},
|
56
|
|
- {"title":'故障提醒',"messageType":'系统通知',"publicTime":'2023-12-29 10:00:00'},],
|
|
61
|
+ tableData: [{"title": '系统升级', "messageType": '公告', "publicTime": '2023-12-29 10:00:00'},
|
|
62
|
+ {"title": '预警提示', "messageType": '系统通知', "publicTime": '2023-12-25 10:00:00'},
|
|
63
|
+ {"title": '故障提醒', "messageType": '系统通知', "publicTime": '2023-12-29 10:00:00'},],
|
57
|
64
|
total: 3,
|
58
|
65
|
pageSize: 10,
|
59
|
66
|
pageNum: 1,
|
60
|
|
- radio: '2',
|
61
|
67
|
dialogVisible: false,
|
62
|
68
|
selRow: {},
|
63
|
|
- searchWords: undefined
|
64
|
69
|
}
|
65
|
70
|
},
|
66
|
71
|
mounted() {
|
67
|
72
|
this.getTableData()
|
68
|
73
|
},
|
69
|
|
- watch: {
|
70
|
|
- },
|
|
74
|
+ watch: {},
|
71
|
75
|
methods: {
|
72
|
76
|
handlePageChange() {
|
73
|
77
|
this.getTableData()
|
74
|
78
|
},
|
75
|
|
- handleAudit(row) {
|
76
|
|
- this.selRow = row
|
77
|
|
- this.dialogVisible = true
|
78
|
|
- },
|
79
|
|
- handleCancelApply(row) {
|
80
|
|
- console.log('enter handle cancel apply')
|
81
|
|
- },
|
82
|
79
|
handleDetail(row) {
|
83
|
80
|
this.selRow = row
|
84
|
81
|
this.dialogVisible = true
|
85
|
82
|
},
|
86
|
|
- handleConfirm() {
|
87
|
|
- const {id} = this.selRow
|
88
|
|
- console.log('radio', this.radio)
|
89
|
|
- api.applyResource({id, applyType: this.radio}).then(res => {
|
90
|
|
- if(res.success) {
|
91
|
|
- this.dialogVisible = false
|
92
|
|
- this.$message({
|
93
|
|
- message: '审核成功!',
|
94
|
|
- type: 'success'
|
95
|
|
- })
|
96
|
|
- this.getTableData()
|
97
|
|
- }
|
98
|
|
- })
|
99
|
|
- },
|
100
|
83
|
getTableData() {
|
101
|
|
- const {pageNum, pageSize, searchWords} = this
|
102
|
|
- api.applyList({pageNum, pageSize, resourceName: searchWords}).then(res => {
|
103
|
|
- this.tableData = []
|
104
|
|
- res.data.records.map((item, index) => {
|
105
|
|
- const newItem = {...item}
|
106
|
|
- newItem.applyTypeText = this.getApplyTypeText(item.applyType)
|
107
|
|
- this.tableData.push(newItem)
|
108
|
|
- })
|
|
84
|
+ const {pageNum, pageSize} = this
|
|
85
|
+ api.messageListByPage({pageNum, pageSize}).then(res => {
|
|
86
|
+ this.tableData = res.data.records || []
|
109
|
87
|
this.total = res.data.total
|
110
|
88
|
})
|
111
|
89
|
},
|
112
|
|
- getApplyTypeText(val) {
|
113
|
|
- if (!val){
|
114
|
|
- return '未申请'
|
115
|
|
- }
|
116
|
|
- const textMap = {
|
117
|
|
- 1: '待审批',
|
118
|
|
- 2: '审批通过',
|
119
|
|
- 3: '审批驳回'
|
120
|
|
- }
|
121
|
|
- return textMap[val]
|
122
|
|
- },
|
123
|
|
- handleSearch() {
|
124
|
|
- this.pageNum = 1
|
125
|
|
- this.getTableData()
|
126
|
|
- }
|
127
|
90
|
}
|
128
|
91
|
}
|
129
|
92
|
</script>
|
130
|
|
-<style lang="scss" scoped>
|
|
93
|
+<style lang="scss" scoped>
|
|
94
|
+.form-wrapper {
|
|
95
|
+ margin-bottom: 20px;
|
|
96
|
+}
|
|
97
|
+/deep/ .el-input__inner {
|
|
98
|
+ background: #2d3744;
|
|
99
|
+ border: none;
|
|
100
|
+ border-radius: 0;
|
|
101
|
+}
|
|
102
|
+/deep/ .el-select {
|
|
103
|
+ height: 40px;
|
|
104
|
+ .el-input__inner {
|
|
105
|
+ height: 40px;
|
|
106
|
+ }
|
|
107
|
+ .el-input__prefix, .el-input__suffix {
|
|
108
|
+ height: 40px;
|
|
109
|
+ }
|
|
110
|
+
|
|
111
|
+ /* 下面设置右侧按钮居中 */
|
|
112
|
+ .el-input__suffix {
|
|
113
|
+ top: 0px;
|
|
114
|
+ display: flex;
|
|
115
|
+ justify-content: center;
|
|
116
|
+ align-items: center;
|
|
117
|
+ flex-wrap: nowrap;
|
|
118
|
+ flex-direction: row;
|
|
119
|
+ align-content: flex-start;
|
|
120
|
+ }
|
|
121
|
+ /* 输入框加上上下边是 32px + 2px =34px */
|
|
122
|
+ .el-input__icon {
|
|
123
|
+ line-height: 0px;
|
|
124
|
+ }
|
|
125
|
+}
|
|
126
|
+/deep/ .form-wrapper .el-button {
|
|
127
|
+ background: linear-gradient(90deg,#0158d9,#3c97e4);
|
|
128
|
+ width: 100px;
|
|
129
|
+ height: 40px;
|
|
130
|
+}
|
|
131
|
+
|
131
|
132
|
.body-wrapper {
|
132
|
133
|
padding: 20px;
|
133
|
134
|
background: #0c0c0c;
|
|
@@ -143,17 +144,12 @@ export default {
|
143
|
144
|
text-align: right;
|
144
|
145
|
}
|
145
|
146
|
.form-div{
|
146
|
|
- width: 90%;
|
147
|
147
|
/deep/ .el-input__inner{
|
148
|
|
- background: white;
|
149
|
148
|
height: 35px;
|
150
|
|
- color: black;
|
151
|
|
- margin-bottom: 10px;
|
152
|
|
- }
|
153
|
|
- /deep/ .el-textarea.is-disabled .el-textarea__inner {
|
154
|
|
- background: white;
|
155
|
|
- color: black;
|
156
|
|
- margin-bottom: 10px;
|
|
149
|
+ width: 90%;
|
|
150
|
+ border: 1px solid #a6a5a5;
|
|
151
|
+ color: #fff;
|
|
152
|
+ background: #2d3744;
|
157
|
153
|
}
|
158
|
154
|
}
|
159
|
155
|
}
|