From d5efc0139ee5b4c25f5adcd99f9376928608303d Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期五, 07 三月 2025 17:31:58 +0800 Subject: [PATCH] 最新版本541200007 --- admin/src/views/vehicle/category.vue | 173 ++++++++++++++++++++++++++++----------------------------- 1 files changed, 86 insertions(+), 87 deletions(-) diff --git a/admin/src/views/vehicle/category.vue b/admin/src/views/vehicle/category.vue index 5b14a1b..0c7ef76 100644 --- a/admin/src/views/vehicle/category.vue +++ b/admin/src/views/vehicle/category.vue @@ -1,18 +1,18 @@ <template> <TableLayout> <!-- 鎼滅储琛ㄥ崟 --> - <!-- <el-form ref="searchForm" slot="search-form" label-width="100px" inline> - <el-form-item label="鐘舵��" prop="status"> - <el-select v-model="filters.status" placeholder="璇烽�夋嫨"> - <el-option label="鍚敤" value="0"></el-option> - <el-option label="绂佺敤" value="1"></el-option> - </el-select> - </el-form-item> - <section> - <el-button type="primary" @click="search">鎼滅储</el-button> - <el-button @click="reset">閲嶇疆</el-button> - </section> - </el-form> --> + <!-- <el-form ref="searchForm" slot="search-form" label-width="100px" inline> + <el-form-item label="鐘舵��" prop="status"> + <el-select v-model="filters.status" placeholder="璇烽�夋嫨"> + <el-option label="鍚敤" value="0"></el-option> + <el-option label="绂佺敤" value="1"></el-option> + </el-select> + </el-form-item> + <section> + <el-button type="primary" @click="search">鎼滅储</el-button> + <el-button @click="reset">閲嶇疆</el-button> + </section> + </el-form>--> <!-- 琛ㄦ牸鍜屽垎椤� --> <template v-slot:table-wrap> <ul class="toolbar" v-permissions="['business:category:create', 'business:category:delete']"> @@ -21,7 +21,7 @@ <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" + <el-table :height="tableHeightNew" 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> @@ -58,80 +58,79 @@ import OperaCategoryWindow from './components/OperaCategoryWindow' import { fetchList, deleteById } from '@/api/business/category.js' export default { - name: 'Category', - extends: BaseTable, - components: { TableLayout, Pagination, OperaCategoryWindow }, - data() { - return { - // 鎼滅储 - filters: { - parentId: '' - }, - isShowEdit: false, - loading: false, - pagination: { - pageSize: 10, - page: 1, - total: 0, - }, - dataList: [] - } - }, - created() { - this.config({ - module: '杞﹁締淇℃伅琛�', - api: '/business/category', - 'field.id': 'id', - 'field.main': 'id' - }) - this.getList() - }, - methods: { - handleEdit(row) { - this.isShowEdit = true - let str = row && row.id ? '缂栬緫杞﹁締鍒嗙被' : '鏂板缓杞﹁締鍒嗙被' - this.$nextTick(() => { - this.$refs.operaCategoryWindow.open(str) - this.$refs.operaCategoryWindow.getList() - if (row && row.id) { - this.$refs.operaCategoryWindow.getDetail(row.id) - } - }) - }, - deleteById(row) { - this.$confirm(`鎮ㄧ‘璁よ鍒犻櫎璇ュ垎绫诲悧`, '娓╅Θ鎻愮ず', { - confirmButtonText: '纭畾', - cancelButtonText: '鍙栨秷', - type: 'warning' - }).then(() => { - deleteById(row.id).then(res => { - this.getList() - }) - }) - - }, - getList(page) { - const { pagination, filters } = this - if (page) { - pagination.page = page - } - this.loading = true - fetchList({ - model: { ...filters }, - capacity: pagination.pageSize, - page: pagination.page, - }).then(res => { - this.loading = false - this.dataList = res.records || [] - this.pagination.total = res.total || 0 - }, () => { - this.loading = false - }) - }, - handleSizeChange(val){ - this.pagination.pageSize = val - this.getList() - } + name: 'Category', + extends: BaseTable, + components: { TableLayout, Pagination, OperaCategoryWindow }, + data () { + return { + // 鎼滅储 + filters: { + parentId: '' + }, + isShowEdit: false, + loading: false, + pagination: { + pageSize: 10, + page: 1, + total: 0 + }, + dataList: [] } + }, + created () { + this.config({ + module: '杞﹁締淇℃伅琛�', + api: '/business/category', + 'field.id': 'id', + 'field.main': 'id' + }) + this.getList() + }, + methods: { + handleEdit (row) { + this.isShowEdit = true + const str = row && row.id ? '缂栬緫杞﹁締鍒嗙被' : '鏂板缓杞﹁締鍒嗙被' + this.$nextTick(() => { + this.$refs.operaCategoryWindow.open(str) + this.$refs.operaCategoryWindow.getList() + if (row && row.id) { + this.$refs.operaCategoryWindow.getDetail(row.id) + } + }) + }, + deleteById (row) { + this.$confirm('鎮ㄧ‘璁よ鍒犻櫎璇ュ垎绫诲悧', '娓╅Θ鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + deleteById(row.id).then(res => { + this.getList() + }) + }) + }, + getList (page) { + const { pagination, filters } = this + if (page) { + pagination.page = page + } + this.loading = true + fetchList({ + model: { ...filters }, + capacity: pagination.pageSize, + page: pagination.page + }).then(res => { + this.loading = false + this.dataList = res.records || [] + this.pagination.total = res.total || 0 + }, () => { + this.loading = false + }) + }, + handleSizeChange (val) { + this.pagination.pageSize = val + this.getList() + } + } } </script> -- Gitblit v1.9.3