ll
liukangdong
2025-02-24 b94daf4ea357eafce26f37a1f0a799d55cbfa1a4
admin/src/views/vehicle/category.vue
@@ -18,8 +18,11 @@
            <ul class="toolbar" v-permissions="['business:category:create', 'business:category:delete']">
                <li><el-button type="primary" @click="handleEdit()" icon="el-icon-plus"
                        v-permissions="['business:category:create']">新建</el-button></li>
                <li v-permissions="['business:category:exportExcel']"><el-button type="primary"
                        @click="exportExcel">导出</el-button></li>
            </ul>
            <el-table row-key="id" :tree-props="{children: 'childCategoryList'}" v-loading="isWorking.search" :data="dataList" stripe @selection-change="handleSelectionChange">
            <el-table row-key="id" :tree-props="{ children: 'childCategoryList' }" v-loading="isWorking.search"
                :data="dataList" stripe @selection-change="handleSelectionChange">
                <el-table-column prop="name" label="分类名称" min-width="100px"></el-table-column>
                <el-table-column prop="remark" label="备注" min-width="100px"></el-table-column>
                <!-- <el-table-column prop="status" label="状态" min-width="100px">
@@ -27,7 +30,7 @@
                        <span v-if="row.status === 0">启用</span>
                        <span v-if="row.status === 1">禁用</span>
                    </template>
                </el-table-column> -->
</el-table-column> -->
                <el-table-column prop="createDate" label="创建时间" min-width="100px"></el-table-column>
                <el-table-column v-if="containPermissions(['business:category:update', 'business:category:delete'])"
                    label="操作" min-width="120" fixed="right">
@@ -39,11 +42,12 @@
                    </template>
                </el-table-column>
            </el-table>
            <pagination @size-change="handleSizeChange" @current-change="getList" :pagination="tableData.pagination">
            <pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination">
            </pagination>
        </template>
        <!-- 新建/修改 -->
        <OperaCategoryWindow v-if="isShowEdit" @close="isShowEdit = false" ref="operaCategoryWindow" @success="getList" />
        <OperaCategoryWindow v-if="isShowEdit" @close="isShowEdit = false" ref="operaCategoryWindow"
            @success="getList" />
    </TableLayout>
</template>
@@ -74,6 +78,12 @@
        }
    },
    created() {
        this.config({
            module: '车辆信息表',
            api: '/business/category',
            'field.id': 'id',
            'field.main': 'id'
        })
        this.getList()
    },
    methods: {
@@ -83,7 +93,7 @@
            this.$nextTick(() => {
                this.$refs.operaCategoryWindow.open(str)
                this.$refs.operaCategoryWindow.getList()
                if(row && row.id){
                if (row && row.id) {
                    this.$refs.operaCategoryWindow.getDetail(row.id)
                }
            })
@@ -100,8 +110,11 @@
            })
        },
        getList() {
        getList(page) {
            const { pagination, filters } = this
            if (page) {
                pagination.page = page
            }
            this.loading = true
            fetchList({
                model: { ...filters },
@@ -115,6 +128,10 @@
                this.loading = false
            })
        },
        handleSizeChange(val){
            this.pagination.pageSize = val
            this.getList()
        }
    }
}
</script>