123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- export default {
- data() {
- return {
- currentPage: 1, // 当前页码
- pageSize: 10, // 每页数量
- listTotal: 0, // 列表总数
- listLoading: false, // 加载
- screenForm: {}, // 筛选表单数据
- dataList: [], // 表格数据
- ids: [], // 多选数据id
- dialogVisible: false, // 弹框
- }
- },
- created() {
- this.getList();
- },
- methods: {
- // 提交筛选表单
- submitScreenForm() {
- this.currentPage = 1;
- this.getList();
- },
- // 重置筛选表单
- resetScreenForm() {
- this.$refs.screenForm.resetFields();
- this.currentPage = 1;
- this.getList();
- },
- // 更改每页数量
- handleSizeChange(val) {
- this.pageSize = val;
- this.currentPage = 1;
- this.getList();
- },
- // 更改当前页
- handleCurrentChange(val) {
- this.currentPage = val;
- this.getList();
- },
- // Windows全局打印
- hanlePrint() {
- window.print()
- },
- // 筛选全部数据
- hanleSelectAll(selection) {
- this.ids = selection.map((k) => {
- return k.id;
- });
- console.log(this.ids);
- },
- /**
- * @description 单条数据删除 或者 全部数据删除
- * @author zhou
- * @param {*} id 删除单条数据传
- * @return {*} Promise.resolve(ids)
- */
- hanleDeleteAllPromise(id) {
- return new Promise((resolve, reject) => {
- const ids = id ? [id] : this.ids
- if (!ids.length) {
- this.$errorMsg("请选择删除内容");
- return;
- }
- resolve(ids)
- })
- }
- }
- }
|