123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- <template>
- <a-card :bordered="false">
- <!-- 新建 -->
- <div class="add">
- <a-button type="primary" icon="plus" class="addBtn" @click="openModal()" id="editionSetting-openModal">新增</a-button>
- </div>
- <!-- table列表 -->
- <s-table
- ref="table"
- size="default"
- :rowKey="(row)=> row.id"
- :columns="columns"
- :data="loadData"
- bordered
- >
- <!-- 操作 -->
- <span slot="action" slot-scope="text, record">
- <template>
- <a-icon v-if="currentDate < new Date(record.publicDate).getTime()" type="edit" id="editionSetting-handleEdit" style="font-size: 20px;color: #1890FF;padding: 0 10px;" @click="handleEdit(record)" />
- <span v-if="currentDate > new Date(record.publicDate).getTime()">--</span>
- </template>
- </span>
- <template slot="upgradeContent" slot-scope="text, record">
- <span :title="record.upgradeContent" style="display: inline-block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">{{ record.upgradeContent }}</span>
- </template>
- <span slot="forceUpgrade" slot-scope="text">
- <template>
- <span v-if=" text == '1'">是</span>
- <span v-if=" text == '0'">否</span>
- </template>
- </span>
- </s-table>
- </a-card>
- </template>
- <script>
- import { STable } from '@/components'
- import { getEditionSettingList } from '@/api/editionSetting.js'
- export default {
- name: 'EditionSetting',
- components: { STable },
- data () {
- return {
- columns: [
- {
- title: '序号',
- dataIndex: 'no',
- width: 60,
- align: 'center'
- },
- {
- title: '创建时间',
- width: 100,
- dataIndex: 'createDate',
- align: 'center'
- },
- {
- title: '版本号',
- width: 100,
- dataIndex: 'version',
- align: 'center'
- },
- {
- title: '强制升级',
- width: 100,
- dataIndex: 'forceUpgrade',
- align: 'center',
- scopedSlots: { customRender: 'forceUpgrade' }
- },
- {
- title: '升级内容',
- width: 100,
- dataIndex: 'upgradeContent',
- align: 'center',
- ellipsis: true, // 内容超过宽度 自动出现省略号
- scopedSlots: { customRender: 'upgradeContent' }
- },
- {
- title: '下载地址',
- width: 100,
- dataIndex: 'downloadUrl',
- align: 'center',
- customRender: (text) => {
- return text || '--'
- }
- },
- {
- title: '更新时间',
- width: 100,
- dataIndex: 'publicDate',
- align: 'center'
- },
- {
- title: '操作',
- // dataIndex: 'action',
- width: 100,
- align: 'center',
- scopedSlots: { customRender: 'action' }
- }
- ],
- applyCode: 'atit',
- applyName: 'IT后台',
- currentDate: new Date().getTime(), // 当前时间
- // 获取列表数据
- loadData: parameter => {
- return getEditionSettingList(Object.assign(parameter))
- .then(res => {
- const no = (res.data.pageNo - 1) * res.data.pageSize
- for (let i = 0; i < res.data.list.length; i++) {
- const _item = res.data.list[i]
- _item.no = no + i + 1
- }
- return res.data
- })
- },
- id: ''
- }
- },
- methods: {
- // 新增
- openModal () {
- this.$router.push({ name: 'editionSetting_add' })
- },
- // 编辑
- handleEdit (row) {
- console.log(row)
- this.$router.push({ name: 'editionSetting_edit', query: { id: row.id } })
- }
- }
- }
- </script>
- <style scoped>
- .addBtn{
- margin-bottom: 20px;
- }
- </style>
|