mitao
2025-04-11 8afc5bfc1e5df1e2f0a8872a344da3b3fd5d63b9
cloud-server-management/src/main/webapp/static/modular/system/tHuiminCard/tHuiminCard2.js
@@ -3,11 +3,13 @@
    data() {
        return {
            query: {
                name: '',
                type: '',
                huiMinName: '',
                huiMinType: '',
                dateRange: [],
                status: ''
                status: '',
                huiMinStatus: '',
            },
            loading: false,
            currentPage: 1,
            pageSize: 10,
            total: 800,
@@ -19,11 +21,12 @@
    methods: {
        handleSearch() {
            console.log('搜索条件:', this.query)
            // 修复方案:使用箭头函数 + 字段校验
            this.loading = true;
            const vm = this; // 保留Vue实例引用
            let ajax = new $ax(Feng.ctxPath + "/tHuiminCard/list",
                (data) => { // 改用箭头函数
                    console.log('原始数据:', data);
                    this.loading = false;
                    if(data.rows && Array.isArray(data.rows)){
                        vm.tableData = data.rows;
                        vm.total = data.total;
@@ -33,13 +36,17 @@
                    }
                },
                (data) => {
                    this.loading = false;
                    Feng.error("搜索失败: " + (data.responseJSON?.message || '服务器异常')); // 错误提示优化
                });
            console.log('请求参数222:', this.query.dateRange)
            // 添加请求参数
            ajax.set({
                pageNum: this.currentPage,
                pageSize: this.pageSize,
                current: this.currentPage,
                size: this.pageSize,
                startTime: this.query.dateRange !=null && this.query.dateRange.length > 0 ? this.query.dateRange[0] : null,
                endTime: this.query.dateRange !=null && this.query.dateRange.length > 0 ? this.query.dateRange[1] : null,
                ...this.query
            });
            ajax.start();
@@ -108,9 +115,11 @@
        },
        handleSizeChange(val) {
            this.pageSize = val
            this.handleSearch()
        },
        handleCurrentChange(val) {
            this.currentPage = val
            this.handleSearch()
        },
        handleSelectionChange(selection) {
            // 多选处理