From 0d5f70bbcf830f6c3aebf92a0b865a04c9d7f263 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 27 Jun 2025 11:28:12 +0800
Subject: [PATCH] feat:系统管理---二级页面样式调整
---
src/views/system/client.vue | 180 +++++++++++++++++++++++++++---------------------------------
1 files changed, 81 insertions(+), 99 deletions(-)
diff --git a/src/views/system/client.vue b/src/views/system/client.vue
index 9840d26..49a6cf0 100644
--- a/src/views/system/client.vue
+++ b/src/views/system/client.vue
@@ -1,33 +1,12 @@
<template>
<basic-container>
- <avue-crud
- :option="option"
- :table-loading="loading"
- :data="data"
- v-model:page="page"
- @row-del="rowDel"
- v-model="form"
- ref="crud"
- :permission="permissionList"
- @row-update="rowUpdate"
- @row-save="rowSave"
- :before-open="beforeOpen"
- @search-change="searchChange"
- @search-reset="searchReset"
- @selection-change="selectionChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- @on-load="onLoad"
- >
+ <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" @row-del="rowDel"
+ v-model="form" ref="crud" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
+ :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
+ @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
+ @refresh-change="refreshChange" @on-load="onLoad">
<template #menu-left>
- <el-button
- type="danger"
- icon="el-icon-delete"
- plain
- v-if="permission.client_delete"
- @click="handleDelete"
- >删 除
+ <el-button type="danger" icon="el-icon-delete" plain v-if="permission.client_delete" @click="handleDelete">删 除
</el-button>
</template>
</avue-crud>
@@ -35,11 +14,11 @@
</template>
<script>
-import { getList, getDetail, add, update, remove } from '@/api/system/client';
-import { mapGetters } from 'vuex';
+import { getList, getDetail, add, update, remove } from '@/api/system/client'
+import { mapGetters } from 'vuex'
export default {
- data() {
+ data () {
return {
form: {},
query: {},
@@ -60,6 +39,10 @@
grid: true,
selection: true,
dialogClickModal: false,
+
+ height: 'auto',
+ calcHeight: 20,
+
column: [
{
label: '应用id',
@@ -240,97 +223,97 @@
],
},
data: [],
- };
+ }
},
computed: {
...mapGetters(['permission']),
- permissionList() {
+ permissionList () {
return {
addBtn: this.validData(this.permission.client_add),
viewBtn: this.validData(this.permission.client_view),
delBtn: this.validData(this.permission.client_delete),
editBtn: this.validData(this.permission.client_edit),
- };
+ }
},
- ids() {
- let ids = [];
+ ids () {
+ let ids = []
this.selectionList.forEach(ele => {
- ids.push(ele.id);
- });
- return ids.join(',');
+ ids.push(ele.id)
+ })
+ return ids.join(',')
},
},
methods: {
- rowSave(row, done, loading) {
+ rowSave (row, done, loading) {
add(row).then(
() => {
- this.onLoad(this.page);
+ this.onLoad(this.page)
this.$message({
type: 'success',
message: '操作成功!',
- });
- done();
+ })
+ done()
},
error => {
- window.console.log(error);
- loading();
+ window.console.log(error)
+ loading()
}
- );
+ )
},
- rowUpdate(row, index, done, loading) {
+ rowUpdate (row, index, done, loading) {
update(row).then(
() => {
- this.onLoad(this.page);
+ this.onLoad(this.page)
this.$message({
type: 'success',
message: '操作成功!',
- });
- done();
+ })
+ done()
},
error => {
- window.console.log(error);
- loading();
+ window.console.log(error)
+ loading()
}
- );
+ )
},
- rowDel(row) {
+ rowDel (row) {
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
- return remove(row.id);
+ return remove(row.id)
})
.then(() => {
- this.onLoad(this.page);
+ this.onLoad(this.page)
this.$message({
type: 'success',
message: '操作成功!',
- });
- });
+ })
+ })
},
- searchReset() {
- this.query = {};
- this.onLoad(this.page);
+ searchReset () {
+ this.query = {}
+ this.onLoad(this.page)
},
- searchChange(params, done) {
- this.query = params;
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
+ searchChange (params, done) {
+ this.query = params
+ this.page.currentPage = 1
+ this.onLoad(this.page, params)
+ done()
},
- selectionChange(list) {
- this.selectionList = list;
+ selectionChange (list) {
+ this.selectionList = list
},
- selectionClear() {
- this.selectionList = [];
- this.$refs.crud.toggleSelection();
+ selectionClear () {
+ this.selectionList = []
+ this.$refs.crud.toggleSelection()
},
- handleDelete() {
+ handleDelete () {
if (this.selectionList.length === 0) {
- this.$message.warning('请选择至少一条数据');
- return;
+ this.$message.warning('请选择至少一条数据')
+ return
}
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
@@ -338,47 +321,46 @@
type: 'warning',
})
.then(() => {
- return remove(this.ids);
+ return remove(this.ids)
})
.then(() => {
- this.onLoad(this.page);
+ this.onLoad(this.page)
this.$message({
type: 'success',
message: '操作成功!',
- });
- this.$refs.crud.toggleSelection();
- });
+ })
+ this.$refs.crud.toggleSelection()
+ })
},
- beforeOpen(done, type) {
+ beforeOpen (done, type) {
if (['edit', 'view'].includes(type)) {
getDetail(this.form.id).then(res => {
- this.form = res.data.data;
- });
+ this.form = res.data.data
+ })
}
- done();
+ done()
},
- currentChange(currentPage) {
- this.page.currentPage = currentPage;
+ currentChange (currentPage) {
+ this.page.currentPage = currentPage
},
- sizeChange(pageSize) {
- this.page.pageSize = pageSize;
+ sizeChange (pageSize) {
+ this.page.pageSize = pageSize
},
- refreshChange() {
- this.onLoad(this.page, this.query);
+ refreshChange () {
+ this.onLoad(this.page, this.query)
},
- onLoad(page, params = {}) {
- this.loading = true;
+ onLoad (page, params = {}) {
+ this.loading = true
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;
- this.loading = false;
- this.selectionClear();
- });
+ const data = res.data.data
+ this.page.total = data.total
+ this.data = data.records
+ this.loading = false
+ this.selectionClear()
+ })
},
},
-};
+}
</script>
-<style scoped lang="scss">
-</style>
\ No newline at end of file
+<style scoped lang="scss"></style>
\ No newline at end of file
--
Gitblit v1.9.3