From a38281e697cde9f45926a6af0c88bec14501fec0 Mon Sep 17 00:00:00 2001
From: liuyg <liuyg@qq.com>
Date: Tue, 15 Feb 2022 11:06:34 +0800
Subject: [PATCH] 68个表格在1366*768下的适配,保安单位情况智能分析中的图表的适配以及其按钮会被遮住不能点击
---
src/views/system/dict.vue | 158 +++++++++++++++++++++++++++-------------------------
1 files changed, 81 insertions(+), 77 deletions(-)
diff --git a/src/views/system/dict.vue b/src/views/system/dict.vue
index 1141204..36118e0 100644
--- a/src/views/system/dict.vue
+++ b/src/views/system/dict.vue
@@ -2,10 +2,12 @@
<basic-container
:class="[
'hasButTwo',
- $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '',
+ $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize',
+ $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : ''
]"
>
<avue-crud
+ class="tablesss"
:option="optionParent"
:table-loading="loading"
:data="dataParent"
@@ -119,7 +121,7 @@
update,
add,
getDict,
- getDictTree,
+ getDictTree
} from "@/api/system/dict";
import { optionParent, optionChild } from "@/option/system/dict";
import { mapGetters } from "vuex";
@@ -140,13 +142,13 @@
pageSize: 10,
pageSizes: [10, 30, 50, 100, 200],
currentPage: 1,
- total: 0,
+ total: 0
},
pageChild: {
pageSize: 10,
pageSizes: [10, 30, 50, 100, 200],
currentPage: 1,
- total: 0,
+ total: 0
},
dataParent: [],
dataChild: [],
@@ -175,9 +177,9 @@
{
required: true,
message: "请输入字典编号",
- trigger: "blur",
- },
- ],
+ trigger: "blur"
+ }
+ ]
},
{
label: "字典名称",
@@ -188,9 +190,9 @@
{
required: true,
message: "请输入字典名称",
- trigger: "blur",
- },
- ],
+ trigger: "blur"
+ }
+ ]
},
{
label: "字典排序",
@@ -202,9 +204,9 @@
{
required: true,
message: "请输入字典排序",
- trigger: "blur",
- },
- ],
+ trigger: "blur"
+ }
+ ]
},
{
label: "封存",
@@ -215,12 +217,12 @@
dicData: [
{
label: "否",
- value: 0,
+ value: 0
},
{
label: "是",
- value: 1,
- },
+ value: 1
+ }
],
value: 0,
slot: true,
@@ -228,16 +230,16 @@
{
required: true,
message: "请选择封存",
- trigger: "blur",
- },
- ],
+ trigger: "blur"
+ }
+ ]
},
{
label: "字典备注",
prop: "remark",
- hide: true,
- },
- ],
+ hide: true
+ }
+ ]
},
optionChild: {
height: "auto",
@@ -266,9 +268,9 @@
{
required: true,
message: "请输入字典编号",
- trigger: "blur",
- },
- ],
+ trigger: "blur"
+ }
+ ]
},
{
label: "字典名称",
@@ -279,9 +281,9 @@
{
required: true,
message: "请输入字典名称",
- trigger: "blur",
- },
- ],
+ trigger: "blur"
+ }
+ ]
},
{
label: "上级字典",
@@ -290,7 +292,7 @@
dicData: [],
hide: true,
props: {
- label: "title",
+ label: "title"
},
addDisabled: true,
editDisabled: true,
@@ -298,9 +300,9 @@
{
required: false,
message: "请选择上级字典",
- trigger: "click",
- },
- ],
+ trigger: "click"
+ }
+ ]
},
{
label: "字典键值",
@@ -310,9 +312,9 @@
{
required: true,
message: "请输入字典键值",
- trigger: "blur",
- },
- ],
+ trigger: "blur"
+ }
+ ]
},
{
label: "字典排序",
@@ -324,9 +326,9 @@
{
required: true,
message: "请输入字典排序",
- trigger: "blur",
- },
- ],
+ trigger: "blur"
+ }
+ ]
},
{
label: "封存",
@@ -337,12 +339,12 @@
dicData: [
{
label: "否",
- value: 0,
+ value: 0
},
{
label: "是",
- value: 1,
- },
+ value: 1
+ }
],
value: 0,
slot: true,
@@ -350,17 +352,17 @@
{
required: true,
message: "请选择封存",
- trigger: "blur",
- },
- ],
+ trigger: "blur"
+ }
+ ]
},
{
label: "字典备注",
prop: "remark",
- hide: true,
- },
- ],
- },
+ hide: true
+ }
+ ]
+ }
};
},
computed: {
@@ -370,23 +372,24 @@
addBtn: this.vaildData(this.permission.dict_add, false),
delBtn: this.vaildData(this.permission.dict_delete, false),
editBtn: this.vaildData(this.permission.dict_edit, false),
- viewBtn: false,
+ viewBtn: false
};
},
ids() {
let ids = [];
- this.selectionList.forEach((ele) => {
+ this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
- },
+ }
},
mounted() {
this.initData();
+ this.$store.commit("setWindowSizeHeightAdd");
},
methods: {
initData() {
- getDictTree().then((res) => {
+ getDictTree().then(res => {
const column = this.findObject(this.optionChild.column, "parentId");
column.dicData = res.data.data;
});
@@ -403,18 +406,18 @@
rowSave(row, done, loading) {
const form = {
...row,
- dictKey: -1,
+ dictKey: -1
};
add(form).then(
() => {
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
- message: "操作成功!",
+ message: "操作成功!"
});
done();
},
- (error) => {
+ error => {
window.console.log(error);
loading();
}
@@ -426,12 +429,12 @@
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
- message: "操作成功!",
+ message: "操作成功!"
});
this.onLoadChild(this.pageChild);
done();
},
- (error) => {
+ error => {
window.console.log(error);
loading();
}
@@ -441,7 +444,7 @@
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
- type: "warning",
+ type: "warning"
})
.then(() => {
return remove(row.id);
@@ -450,7 +453,7 @@
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
- message: "操作成功!",
+ message: "操作成功!"
});
});
},
@@ -492,7 +495,7 @@
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
- type: "warning",
+ type: "warning"
})
.then(() => {
return remove(this.ids);
@@ -501,14 +504,14 @@
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
- message: "操作成功!",
+ message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
- getDict(this.formParent.id).then((res) => {
+ getDict(this.formParent.id).then(res => {
this.formParent = res.data.data;
});
}
@@ -529,11 +532,11 @@
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
- message: "操作成功!",
+ message: "操作成功!"
});
done();
},
- (error) => {
+ error => {
window.console.log(error);
loading();
}
@@ -545,11 +548,11 @@
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
- message: "操作成功!",
+ message: "操作成功!"
});
done();
},
- (error) => {
+ error => {
window.console.log(error);
loading();
}
@@ -559,7 +562,7 @@
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
- type: "warning",
+ type: "warning"
})
.then(() => {
return remove(row.id);
@@ -568,7 +571,7 @@
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
- message: "操作成功!",
+ message: "操作成功!"
});
});
},
@@ -597,7 +600,7 @@
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
- type: "warning",
+ type: "warning"
})
.then(() => {
return remove(this.ids);
@@ -606,7 +609,7 @@
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
- message: "操作成功!",
+ message: "操作成功!"
});
this.$refs.crudChild.toggleSelection();
});
@@ -616,7 +619,7 @@
this.initData();
}
if (["edit", "view"].includes(type)) {
- getDict(this.formChild.id).then((res) => {
+ getDict(this.formChild.id).then(res => {
this.formChild = res.data.data;
});
}
@@ -624,7 +627,7 @@
},
beforeCloseChild(done) {
this.$refs.crudChild.value.parentId = this.parentId;
- this.$refs.crudChild.option.column.filter((item) => {
+ this.$refs.crudChild.option.column.filter(item => {
if (item.prop === "parentId") {
item.value = this.parentId;
}
@@ -646,11 +649,12 @@
page.currentPage,
page.pageSize,
Object.assign(params, this.query)
- ).then((res) => {
+ ).then(res => {
const data = res.data.data;
this.pageParent.total = data.total;
this.dataParent = data.records;
this.loading = false;
+ this.$store.commit("setWindowSizeHeightAdd");
this.selectionClear();
});
},
@@ -661,13 +665,13 @@
page.pageSize,
this.parentId,
Object.assign(params, this.query)
- ).then((res) => {
+ ).then(res => {
this.dataChild = res.data.data;
this.loadingChild = false;
+ this.$store.commit("setWindowSizeHeightAdd");
this.selectionClear();
});
- },
- },
+ }
+ }
};
</script>
-
--
Gitblit v1.9.3