src/views/grid/index.vue
@@ -19,6 +19,18 @@
// import website from '@/config/website'
export default {
    data () {
        //手机号格式校验
        let validatorPhone = function (rule, value, callback) {
            if (value) {
                if (!/^1[3456789]\d{9}$/.test(value)) {
                    callback(new Error('手机号格式有误!'))
                } else {
                    callback()
                }
            }
            callback()
        }
        return {
            form: {},
            query: {},
@@ -31,13 +43,16 @@
            datetime: "",
            selectionList: [],
            option: {
                labelWidth: 96,
                searchLabelWidth: 96,
                searchShow: true,
                searchMenuSpan: 3,
                menuWidth: 210,
                height: "auto",
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                searchShow: true,
                searchMenuSpan: 3,
                menuWidth: 280,
                border: true,
                //stripe:true,
                index: true,
@@ -46,7 +61,6 @@
                dialogClickModal: false,
                column: [
                    {
                        width: 156,
                        overHidden: true,
                        label: "所属社区",
                        addDisplay: false,
@@ -84,7 +98,6 @@
                    },
                    {
                        width: 110,
                        overHidden: true,
                        label: "网格名称",
                        prop: "gridName",
@@ -98,7 +111,9 @@
                            },
                        ],
                    },
                    {
                        width: 110,
                        label: "负责人",
                        prop: "principal",
                        searchSpan: 4,
@@ -112,6 +127,7 @@
                        ],
                    },
                    {
                        width: 120,
                        label: "联系电话",
                        prop: "principalPhone",
                        searchSpan: 4,
@@ -122,6 +138,11 @@
                                message: "请输入联系电话",
                                trigger: "blur",
                            },
                            {
                                validator: validatorPhone,
                                trigger: 'blur'
                            }
                        ],
                    },
                    {
@@ -301,21 +322,9 @@
            this.onLoad(this.page, this.query)
        },
        onLoad (page, params = {}) {
            const { dateTime } = this.query
            let values = {
                ...params,
            }
            if (dateTime) {
                values = {
                    ...params,
                    startTime: dateTime[0],
                    endTime: dateTime[1],
                    ...this.query,
                }
                values.dateTime = null
            }
            this.loading = true
            getList(page.currentPage, page.pageSize, values).then((res) => {
            getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then((res) => {
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records