mirror of
https://gitee.com/log4j/pig-ui.git
synced 2024-12-23 05:40:20 +08:00
💄 更新界面和样式文件:统一部分按钮大小
This commit is contained in:
parent
18b5a53bf6
commit
7069c704dd
@ -18,10 +18,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container calendar-list-container">
|
<div class="app-container calendar-list-container">
|
||||||
<div class="filter-container">
|
<div class="filter-container">
|
||||||
<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="类型" v-model="listQuery.type">
|
<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="类型" size="mini" v-model="listQuery.type">
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
|
<el-button class="filter-item" type="primary" size="mini" v-waves icon="search" @click="handleFilter">搜索</el-button>
|
||||||
<el-button v-if="sys_dict_add" class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="edit">添加
|
<el-button v-if="sys_dict_add" class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" size="mini" icon="edit">添加
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table :key='tableKey' :data="list" v-loading="listLoading" element-loading-text="给我一点时间" border fit highlight-current-row style="width: 99%">
|
<el-table :key='tableKey' :data="list" v-loading="listLoading" element-loading-text="给我一点时间" border fit highlight-current-row style="width: 99%">
|
||||||
@ -67,7 +67,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="200">
|
<el-table-column label="操作" width="200">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button v-if="sys_dict_upd" size="small" type="success" @click="handleUpdate(scope.row)">编辑
|
<el-button v-if="sys_dict_upd" size="mini" type="success" @click="handleUpdate(scope.row)">编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="sys_dict_del" size="mini" type="danger" @click="handleDelete(scope.row)">删除
|
<el-button v-if="sys_dict_del" size="mini" type="danger" @click="handleDelete(scope.row)">删除
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -112,12 +112,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { fetchList, addObj, putObj, delObj } from "@/api/dict";
|
import { fetchList, addObj, putObj, delObj } from '@/api/dict'
|
||||||
import waves from "@/directive/waves/index.js"; // 水波纹指令
|
import waves from '@/directive/waves/index.js' // 水波纹指令
|
||||||
import { mapGetters } from "vuex";
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "table_sys_dict",
|
name: 'table_sys_dict',
|
||||||
directives: {
|
directives: {
|
||||||
waves
|
waves
|
||||||
},
|
},
|
||||||
@ -134,172 +134,172 @@ export default {
|
|||||||
value: [
|
value: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "数据值",
|
message: '数据值',
|
||||||
trigger: "blur"
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
label: [
|
label: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "标签名",
|
message: '标签名',
|
||||||
trigger: "blur"
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
type: [
|
type: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "类型",
|
message: '类型',
|
||||||
trigger: "blur"
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
description: [
|
description: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "描述",
|
message: '描述',
|
||||||
trigger: "blur"
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
sort: [
|
sort: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "排序",
|
message: '排序',
|
||||||
trigger: "blur"
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
remarks: [
|
remarks: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "备注信息",
|
message: '备注信息',
|
||||||
trigger: "blur"
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
form: {},
|
form: {},
|
||||||
dialogFormVisible: false,
|
dialogFormVisible: false,
|
||||||
dialogStatus: "",
|
dialogStatus: '',
|
||||||
sys_dict_add: false,
|
sys_dict_add: false,
|
||||||
sys_dict_upd: false,
|
sys_dict_upd: false,
|
||||||
sys_dict_del: false,
|
sys_dict_del: false,
|
||||||
textMap: {
|
textMap: {
|
||||||
update: "编辑",
|
update: '编辑',
|
||||||
create: "创建"
|
create: '创建'
|
||||||
},
|
},
|
||||||
tableKey: 0
|
tableKey: 0
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(["permissions"])
|
...mapGetters(['permissions'])
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
statusFilter(status) {
|
statusFilter(status) {
|
||||||
const statusMap = {
|
const statusMap = {
|
||||||
0: "有效",
|
0: '有效',
|
||||||
1: "无效"
|
1: '无效'
|
||||||
};
|
}
|
||||||
return statusMap[status];
|
return statusMap[status]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList()
|
||||||
this.sys_dict_add = this.permissions["sys_dict_add"];
|
this.sys_dict_add = this.permissions['sys_dict_add']
|
||||||
this.sys_dict_upd = this.permissions["sys_dict_upd"];
|
this.sys_dict_upd = this.permissions['sys_dict_upd']
|
||||||
this.sys_dict_del = this.permissions["sys_dict_del"];
|
this.sys_dict_del = this.permissions['sys_dict_del']
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getList() {
|
getList() {
|
||||||
this.listLoading = true;
|
this.listLoading = true
|
||||||
this.listQuery.orderByField = "create_time";
|
this.listQuery.orderByField = 'create_time'
|
||||||
this.listQuery.isAsc = false;
|
this.listQuery.isAsc = false
|
||||||
fetchList(this.listQuery).then(response => {
|
fetchList(this.listQuery).then(response => {
|
||||||
this.list = response.data.records;
|
this.list = response.data.records
|
||||||
this.total = response.data.total;
|
this.total = response.data.total
|
||||||
this.listLoading = false;
|
this.listLoading = false
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
handleFilter() {
|
handleFilter() {
|
||||||
this.listQuery.page = 1;
|
this.listQuery.page = 1
|
||||||
this.getList();
|
this.getList()
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
this.listQuery.limit = val;
|
this.listQuery.limit = val
|
||||||
this.getList();
|
this.getList()
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.listQuery.page = val;
|
this.listQuery.page = val
|
||||||
this.getList();
|
this.getList()
|
||||||
},
|
},
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
delObj(row).then(response => {
|
delObj(row).then(response => {
|
||||||
this.dialogFormVisible = false;
|
this.dialogFormVisible = false
|
||||||
this.getList();
|
this.getList()
|
||||||
this.$notify({
|
this.$notify({
|
||||||
title: "成功",
|
title: '成功',
|
||||||
message: "删除成功",
|
message: '删除成功',
|
||||||
type: "success",
|
type: 'success',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.dialogStatus = "update";
|
this.dialogStatus = 'update'
|
||||||
this.dialogFormVisible = true;
|
this.dialogFormVisible = true
|
||||||
this.form.id = row.id;
|
this.form.id = row.id
|
||||||
this.form.type = row.type;
|
this.form.type = row.type
|
||||||
this.form.value = row.value;
|
this.form.value = row.value
|
||||||
this.form.label = row.label;
|
this.form.label = row.label
|
||||||
this.form.description = row.description;
|
this.form.description = row.description
|
||||||
this.form.sort = row.sort;
|
this.form.sort = row.sort
|
||||||
this.form.remarks = row.remarks;
|
this.form.remarks = row.remarks
|
||||||
},
|
},
|
||||||
handleCreate() {
|
handleCreate() {
|
||||||
this.dialogStatus = "create";
|
this.dialogStatus = 'create'
|
||||||
this.dialogFormVisible = true;
|
this.dialogFormVisible = true
|
||||||
},
|
},
|
||||||
create(formName) {
|
create(formName) {
|
||||||
const set = this.$refs;
|
const set = this.$refs
|
||||||
set[formName].validate(valid => {
|
set[formName].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
addObj(this.form).then(() => {
|
addObj(this.form).then(() => {
|
||||||
this.dialogFormVisible = false;
|
this.dialogFormVisible = false
|
||||||
this.getList();
|
this.getList()
|
||||||
this.$notify({
|
this.$notify({
|
||||||
title: "成功",
|
title: '成功',
|
||||||
message: "创建成功",
|
message: '创建成功',
|
||||||
type: "success",
|
type: 'success',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
cancel(formName) {
|
cancel(formName) {
|
||||||
this.dialogFormVisible = false;
|
this.dialogFormVisible = false
|
||||||
const set = this.$refs;
|
const set = this.$refs
|
||||||
set[formName].resetFields();
|
set[formName].resetFields()
|
||||||
},
|
},
|
||||||
update(formName) {
|
update(formName) {
|
||||||
const set = this.$refs;
|
const set = this.$refs
|
||||||
set[formName].validate(valid => {
|
set[formName].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.dialogFormVisible = false;
|
this.dialogFormVisible = false
|
||||||
this.form.password = undefined;
|
this.form.password = undefined
|
||||||
putObj(this.form).then(() => {
|
putObj(this.form).then(() => {
|
||||||
this.dialogFormVisible = false;
|
this.dialogFormVisible = false
|
||||||
this.getList();
|
this.getList()
|
||||||
this.$notify({
|
this.$notify({
|
||||||
title: "成功",
|
title: '成功',
|
||||||
message: "修改成功",
|
message: '修改成功',
|
||||||
type: "success",
|
type: 'success',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
<el-option v-for="item in dicts" :key="item.value" :label="item.label" :value="item.value">
|
<el-option v-for="item in dicts" :key="item.value" :label="item.label" :value="item.value">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
|
<el-button class="filter-item" type="primary" size="mini" v-waves icon="search" @click="handleFilter">搜索</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table :key='tableKey' :data="list" v-loading="listLoading" element-loading-text="给我一点时间" border fit highlight-current-row style="width: 99%">
|
<el-table :key='tableKey' :data="list" v-loading="listLoading" element-loading-text="给我一点时间" border fit highlight-current-row style="width: 99%">
|
||||||
<el-table-column align="center" label="序号">
|
<el-table-column align="center" label="序号">
|
||||||
@ -34,8 +34,8 @@
|
|||||||
<el-table-column align="center" label="类型">
|
<el-table-column align="center" label="类型">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>
|
<span>
|
||||||
<el-button type="success" v-if="scope.row.type == 0">{{ scope.row.type | typeFilter }}</el-button>
|
<el-button type="success" size="mini" v-if="scope.row.type == 0">{{ scope.row.type | typeFilter }}</el-button>
|
||||||
<el-button type="danger" v-if="scope.row.type ==9">{{ scope.row.type | typeFilter }}</el-button>
|
<el-button type="danger" size="mini" v-if="scope.row.type ==9">{{ scope.row.type | typeFilter }}</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -91,13 +91,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { delObj, fetchList } from "@/api/log";
|
import { delObj, fetchList } from '@/api/log'
|
||||||
import { remote } from "@/api/dict";
|
import { remote } from '@/api/dict'
|
||||||
import waves from "@/directive/waves/index.js"; // 水波纹指令
|
import waves from '@/directive/waves/index.js' // 水波纹指令
|
||||||
import { mapGetters } from "vuex";
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "table_log",
|
name: 'table_log',
|
||||||
directives: {
|
directives: {
|
||||||
waves
|
waves
|
||||||
},
|
},
|
||||||
@ -114,33 +114,33 @@ export default {
|
|||||||
type: undefined
|
type: undefined
|
||||||
},
|
},
|
||||||
tableKey: 0
|
tableKey: 0
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(["permissions"])
|
...mapGetters(['permissions'])
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
typeFilter(type) {
|
typeFilter(type) {
|
||||||
const typeMap = {
|
const typeMap = {
|
||||||
0: "正常",
|
0: '正常',
|
||||||
9: "异常"
|
9: '异常'
|
||||||
};
|
}
|
||||||
return typeMap[type];
|
return typeMap[type]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList()
|
||||||
this.sys_log_del = this.permissions["sys_log_del"];
|
this.sys_log_del = this.permissions['sys_log_del']
|
||||||
remote("log_type").then(response => {
|
remote('log_type').then(response => {
|
||||||
this.dicts = response.data;
|
this.dicts = response.data
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getSerialNumber(index) {
|
getSerialNumber(index) {
|
||||||
return index + 1 + (this.listQuery.page - 1) * this.listQuery.limit;
|
return index + 1 + (this.listQuery.page - 1) * this.listQuery.limit
|
||||||
},
|
},
|
||||||
getList() {
|
getList() {
|
||||||
this.listLoading = true;
|
this.listLoading = true
|
||||||
this.listQuery.orderByField = 'create_time'
|
this.listQuery.orderByField = 'create_time'
|
||||||
this.listQuery.isAsc = false
|
this.listQuery.isAsc = false
|
||||||
fetchList(this.listQuery).then(response => {
|
fetchList(this.listQuery).then(response => {
|
||||||
|
Loading…
Reference in New Issue
Block a user