| | |
| | | <el-table border :data="tableData" :height="height"> |
| | | <slot></slot> |
| | | </el-table> |
| | | <div> |
| | | <div v-if="total > 0"> |
| | | <el-pagination layout="slot, prev, pager, next, sizes, jumper" :page-size="queryForm.pageSize" |
| | | :current-page="queryForm.pageNum" :total="total" class="pagination"> |
| | | :current-page="queryForm.pageNum" :total="total" @current-change="handleCurrentChange" |
| | | @size-change="handleSizeChange" class="pagination"> |
| | | <div class="pagination-info">第 {{ (queryForm.pageNum == 1) ? 1 : (queryForm.pageNum - 1) * |
| | | queryForm.pageSize + 1 }}-{{ |
| | | queryForm.pageNum * queryForm.pageSize }} 条/总共 {{ total }} 条</div> |
| | |
| | | return this.$baseTableHeight() |
| | | }, |
| | | }, |
| | | methods: { |
| | | handleCurrentChange(page) { |
| | | this.$emit('handleCurrentChange', page) |
| | | }, |
| | | handleSizeChange(size) { |
| | | this.$emit('handleSizeChange', size) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | </div> |
| | | <div class="table"> |
| | | <slot name="setting"></slot> |
| | | <Table :tableData="tableData"> |
| | | <Table :tableData="tableData" :total="total" :queryForm="queryForm" @currentChange="handleCurrentChange" @sizeChange="handleSizeChange"> |
| | | <slot name="table"></slot> |
| | | </Table> |
| | | </div> |
| | |
| | | tableData: { |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | total: { |
| | | type: Number, |
| | | default: 0 |
| | | }, |
| | | queryForm: { |
| | | type: Object, |
| | | default: () => { |
| | | return { |
| | | pageSize: 10, |
| | | pageNum: 1 |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | handleCurrentChange(page) { |
| | | this.$emit('handleCurrentChange', page) |
| | | }, |
| | | handleSizeChange(size) { |
| | | this.$emit('handleSizeChange', size) |
| | | } |
| | | } |
| | | } |
| | |
| | | :close-on-click-modal="false" width="433px"> |
| | | <div class="top-con a-center" slot="title"> |
| | | <div class="left"> |
| | | <img src="@/assets/notice@2x.png" style="width: 24px;height: 24px;margin-right: 14px;" /> |
| | | <img src="@/assets/public/notice@2x.png" style="width: 24px;height: 24px;margin-right: 14px;" /> |
| | | <div class="title">{{ title }}</div> |
| | | </div> |
| | | </div> |
| | |
| | | import router from "./router"; |
| | | import store from './store' |
| | | import TableCustom from '@/components/TableSlot/index.vue' |
| | | import ShowDelConfirm from '@/components/showDelConfirm/index.vue' |
| | | |
| | | Vue.config.productionTip = false; |
| | | Vue.use(ElementUI, { size: 'small' }) |
| | | Vue.component('TableCustom', TableCustom) |
| | | Vue.component('ShowDelConfirm', ShowDelConfirm) |
| | | |
| | | Vue.prototype.msgsuccess = function (msg) { |
| | | this.$message({ |
| | |
| | | <template> |
| | | <div class="list"> |
| | | <TableCustom> |
| | | <TableCustom :queryForm="queryForm" :total="total" @currentChange="handleCurrentChange" @sizeChange="handleSizeChange"> |
| | | <template #search> |
| | | <el-form :model="form" label-width="140px" inline> |
| | | <el-form-item label="项目组名称:"> |
| | |
| | | <el-button class="el-icon-plus" style="margin-bottom: 20px;" type="primary"> 新增项目组</el-button> |
| | | </template> |
| | | <template #table> |
| | | <el-table-column prop="name" label="项目组名称"></el-table-column> |
| | | <el-table-column prop="age" label="项目负责人"></el-table-column> |
| | | <el-table-column prop="age" label="项目组成员"></el-table-column> |
| | | <el-table-column prop="age" label="项目创建时间"></el-table-column> |
| | | <el-table-column prop="age" label="状态"></el-table-column> |
| | | <el-table-column prop="age" label="操作"></el-table-column> |
| | | <el-table-column prop="name" label="项目组名称" /> |
| | | <el-table-column prop="age" label="项目负责人" /> |
| | | <el-table-column prop="age" label="项目组成员" /> |
| | | <el-table-column prop="age" label="项目创建时间" /> |
| | | <el-table-column prop="age" label="状态"> |
| | | <template #default="{ row }"> |
| | | <el-tag v-if="row.status == 1" type="success">正常运作</el-tag> |
| | | <el-tag v-else type="danger">已封存</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="age" label="操作"> |
| | | <template #default="{ row }"> |
| | | <el-button type="text" @click="handleChangeStatus(row, 1)">封存</el-button> |
| | | <el-button type="text" @click="handleChangeStatus(row, 0)">解封</el-button> |
| | | <el-button type="text">编辑</el-button> |
| | | <el-button type="text">详情</el-button> |
| | | <el-button type="text" @click="handleDel(row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </TableCustom> |
| | | <ShowDelConfirm :show="showDelConfirm" @close="showDelConfirm = false" @confirm="handleDelConfirm" /> |
| | | <ShowDelConfirm :title="changeStatusTitle" :tip="changeStatusTip" :show="changeStatus" @close="changeStatus = false" @confirm="handleChangeStatus" /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | return { |
| | | form: { |
| | | name: '' |
| | | } |
| | | }, |
| | | showDelConfirm: false, |
| | | rowId: '', |
| | | changeStatus: false, |
| | | changeStatusTitle: '', |
| | | changeStatusTip: '', |
| | | queryForm: { |
| | | pageSize: 10, |
| | | pageNum: 1 |
| | | }, |
| | | total: 0 |
| | | } |
| | | }, |
| | | methods: { |
| | | handleDel(row) { |
| | | this.showDelConfirm = true |
| | | this.rowId = row.id |
| | | }, |
| | | handleDelConfirm() { |
| | | this.showDelConfirm = false |
| | | this.msgsuccess('删除成功') |
| | | }, |
| | | handleChangeStatus(row, status) { |
| | | this.changeStatus = true |
| | | this.rowId = row.id |
| | | this.changeStatusTitle = status == 1 ? '确认要封存这个项目组吗?' : '确认要解封该项目组吗?' |
| | | this.changeStatusTip = status == 1 ? '封存后项目组内人员看不到数据,审批人仍然可见数据。' : '解封后项目组内人员数据恢复。' |
| | | }, |
| | | handleCurrentChange(page) { |
| | | this.queryForm.pageNum = page |
| | | }, |
| | | handleSizeChange(size) { |
| | | this.queryForm.pageSize = size |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |