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
| <template>
| <a-card :bordered="false">
| <!-- 操作按钮区域 -->
| <div class="table-btn">
| <a-button @click="addVersion" type="primary" icon="plus">新增版本</a-button>
| </div>
|
| <!-- table区域-begin -->
| <div>
| <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px; height: 38px">
| <span style="float: right">
| <a @click="loadData"><a-icon type="sync" />刷新</a>
| </span>
| </div> -->
| <a-table
| ref="table"
| size="middle"
| rowKey="id"
| :pagination="ipagination"
| :columns="defaultColumns"
| :dataSource="dataSource"
| @change="handleTableChange"
| class="infoTable"
| :loading="loading"
| >
| <span slot="action" slot-scope="text, record">
| <a @click="upgraModal(record)">下发</a>
| <a-divider type="vertical" />
| <a @click="recordModal(record)">下发记录</a>
| <a-divider type="vertical" />
| <a @click="showPropsConfirm(record)">删除</a>
| </span>
| <span slot="fileSize" slot-scope="text, record">
| <div>{{ record.fileSize }} MB</div>
| </span>
| </a-table>
| </div>
| <!-- table区域-end -->
| <!-- 新增远程升级弹窗 -->
| <UpgradeAddModal ref="addModal" :visible="show" @modalClose="modalClose" />
| <!-- 下发记录弹窗 -->
| <UpgradeRecordModal :upgradeId="upgradeId" :visible="recordShow" @modalClose="recordModalClose" />
| <!-- 下发弹窗-->
| <UpgradeModal :upgradeId="upgradeId" :visible="upgraShow" @modalClose="upgraModalClose" />
| </a-card>
| </template>
|
| <script>
| import UpgradeModal from './modules/UpgradeModal'
| import { JeecgListMixin } from '@tievd/cube-block/lib/mixins/JeecgListMixin'
| import { postAction, uploadAction, deleteAction, getAction } from '@tievd/cube-block/lib/api/manage'
| import UpgradeAddModal from './modules/UpgradeAddModal.vue'
| import UpgradeRecordModal from './modules/UpgradeRecordModal.vue'
| export default {
| name: 'UpgradeList',
| mixins: [JeecgListMixin],
| components: {
| UpgradeModal,
| UpgradeAddModal,
| UpgradeRecordModal,
| },
|
| data() {
| return {
| description: '远程升级列表',
| show: false, //新增
| recordShow: false, //下发记录
| upgraShow: false, // 下发
| upgradeId: 0, //版本ID
| loading: false,
| // 表头
| columns: [],
| // 列定义
| defaultColumns: [
| {
| title: '序号',
| key: 'rowIndex',
| width: 60,
| align: 'center',
| customRender: function (t, r, index) {
| return parseInt(index) + 1
| },
| },
| {
| title: '版本名称',
| align: 'center',
| dataIndex: 'version',
| },
| // {
| // title: '文件地址',
| // align: 'center',
| // dataIndex: 'path',
| // },
| {
| title: '文件大小',
| align: 'center',
| // dataIndex: 'fileSize',
| scopedSlots: { customRender: 'fileSize' },
| },
| {
| title: '版本描述',
| align: 'center',
| dataIndex: 'description',
| },
| // {
| // title: '下发状态',
| // align: 'center',
| // dataIndex: 'type',
| // },
| {
| title: '上传时间',
| align: 'center',
| dataIndex: 'createTime',
| },
| {
| title: '操作',
| dataIndex: 'action',
| width: 250,
| align: 'center',
| scopedSlots: { customRender: 'action' },
| },
| ],
| queryForm: {
| pageNo: 1,
| pageSize: 10,
| },
| dataSource: [],
| url: {
| list: '/jyz/upgrade/list',
| delete: '/jyz/upgrade/delete',
| // upload: '/jyz/upgrade/upload',
| add: '/jyz/upgrade/add',
| // issue: '/jyz/upgrade/issue',
| // Record: '/jyz/upgradeRecord/tables',
| },
| }
| },
| methods: {
| showPropsConfirm(data) {
| let that = this
| this.$confirm({
| title: '您确定要删除吗?',
| // content: 'Some descriptions',
| okText: '是',
| okType: 'danger',
| cancelText: '否',
| onOk() {
| deleteAction(that.url.delete, { id: data.id }).then((res) => {
| if (res.code == 200) {
| that.$message.success('删除成功!')
| that.loadData()
| }
| })
| },
| onCancel() {
| that.$message.info('取消!')
| },
| })
| },
| modalFormOk() {},
| addVersion() {
| this.show = true
| },
| // 关闭弹窗
| modalClose(data) {
| if (data) {
| postAction(this.url.add, data).then((res) => {
| console.log(res)
| if (res.code == 200) {
| this.show = false
| this.loadData()
| this.$message.success(res.message)
| let childRef = this.$refs.addModal
| childRef.queryForm.path = ''
| childRef.queryForm.fileSize = ''
| childRef.$refs.ruleForm.resetFields() //重置表单
| }
| })
| } else {
| this.show = false
| }
| },
| recordModal(data) {
| this.recordShow = true
| this.upgradeId = data.id
| },
| // 下发记录弹窗
| recordModalClose() {
| this.recordShow = false
| },
| // 下发弹窗
| upgraModal(data) {
| this.upgradeId = data.id
| this.upgraShow = true
| },
| // 关闭下发弹窗
| upgraModalClose() {
| this.upgraShow = false
| },
| },
| created() {},
| }
| </script>
| <style scoped lang="less">
| .table-btn {
| margin-bottom: 15px;
| }
| </style>
|
|