1.修复部分弹窗无法关闭,分页导致查询无效,关键字查询无效等问题,调整菜单页面布局,删除不需要的元素

fengcang
x_z 3 years ago
parent b4cf0c0760
commit ac3485ed8b

@ -25,7 +25,7 @@
<el-form-item>
<el-button-group style="margin-left: 10px;display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="search" @click="getList"></el-button>
<el-button type="primary" icon="search" @click="search"></el-button>
<el-button type="primary" icon="search" @click="handleAddClick"
:disabled="!configParms.typeScan"
>新增
@ -164,6 +164,7 @@ import axios from "axios";
import store from "@/store";
import {getLocalJoinBusType} from "@/api/basic/busLocalType";
import {findConfig} from "@/api/thrsys/spsSyncStatus";
import {isBlank} from "@/utils/strUtil";
export default {
data() {
@ -262,9 +263,10 @@ export default {
this.modifyDialogVisible = false;
this.addDialogVisible = false;
},
// handleChange() {
// this.getList();
// },
search() {
this.filterQuery.page = 1;
this.getList();
},
getList() {
this.loading = true;
getJoinBussinessType(this.filterQuery)
@ -285,6 +287,10 @@ export default {
},
onAddSubmit() {
if (isBlank(this.inputQuery.name)) {
this.$message.error("扫码单据类型名称不能为空!");
return;
}
if (this.inputQuery.enable && this.inputQuery.localAction == "") {
this.$message.error("本地单据不能为空!");
return;

@ -353,6 +353,9 @@ export default {
} else if (this.formData.roles.length === 0) {
this.$message.error("未指定角色!")
return;
} else if (this.formData.passWord !== this.formData.checkPassword) {
this.$message.error("两次输入密码不一致!")
return;
}
this.$refs["dataForm"].validate(valid => {

@ -1,108 +1,87 @@
<template>
<div>
<el-form :inline="true" :model="query" class="query-form" size="mini">
<el-form-item class="query-form-item">
<el-select v-model="query.status" placeholder="状态">
<el-option label="全部" value=""></el-option>
<el-option label="禁用" value="0"></el-option>
<el-option label="正常" value="1"></el-option>
</el-select>
</el-form-item>
<div>
<el-form :inline="true" :model="query" class="query-form" size="mini">
<el-form-item>
<el-button-group>
<el-button type="primary" @click.native="handleForm(null, null)"
>新增
</el-button
>
</el-button-group>
</el-form-item>
</el-form>
<el-form-item>
<el-button-group>
<el-button
type="primary"
icon="el-icon-refresh"
@click="onReset"
></el-button>
<el-button type="primary" icon="search" @click="onSubmit"
>查询</el-button
>
<el-button type="primary" @click.native="handleForm(null, null)"
>新增</el-button
>
</el-button-group>
</el-form-item>
</el-form>
<el-tree
:data="mergeList"
:props="defaultProps"
node-key="id"
default-expand-all
:expand-on-click-node="false"
:render-content="renderContent"
>
</el-tree>
<el-tree
:data="mergeList"
:props="defaultProps"
node-key="id"
default-expand-all
:expand-on-click-node="false"
:render-content="renderContent"
>
</el-tree>
<!--表单界面-->
<el-dialog
:title="formMap[formName]"
:visible.sync="formVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
:before-close="hideForm"
width="85%"
top="5vh"
>
<el-form :model="formData" :rules="formRules" ref="dataForm">
<el-form-item label="父ID" prop="pid">
<el-select v-model="formData.pid" placeholder="顶级">
<el-option
v-for="item in treeList"
:key="item.id"
:label="item.title"
:value="item.id"
>
<!--表单界面-->
<el-dialog
:title="formMap[formName]"
:visible.sync="formVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
:before-close="hideForm"
width="85%"
top="5vh"
>
<el-form :model="formData" :rules="formRules" ref="dataForm">
<el-form-item label="父ID" prop="pid">
<el-select v-model="formData.pid" placeholder="顶级">
<el-option
v-for="item in treeList"
:key="item.id"
:label="item.title"
:value="item.id"
>
<span style="float: left"
><span v-html="item.html"></span>{{ item.title }}</span
><span v-html="item.html"></span>{{ item.title }}</span
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="功能模块" prop="name">
<el-input
type=""
v-model="formData.name"
auto-complete="off"
></el-input>
</el-form-item>
<el-form-item label="功能名" prop="title">
<el-input
type=""
v-model="formData.title"
auto-complete="off"
></el-input>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="formData.status">
<el-radio :label="0">禁用</el-radio>
<el-radio :label="1">正常</el-radio>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label="额外的规则表达式">
<el-input type="textarea" v-model="formData.condition"></el-input>
</el-form-item> -->
<el-form-item label="排序" prop="listorder">
<el-input
type=""
v-model="formData.listorder"
auto-complete="off"
></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native="hideForm">取消</el-button>
<el-button
type="primary"
@click.native="formSubmit()"
:loading="formLoading"
>提交</el-button
>
</div>
</el-dialog>
</div>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="功能模块" prop="name">
<el-input
type=""
v-model="formData.name"
auto-complete="off"
></el-input>
</el-form-item>
<el-form-item label="功能名" prop="title">
<el-input
type=""
v-model="formData.title"
auto-complete="off"
></el-input>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="formData.status" :disabled="true">
<el-radio :label="0">禁用</el-radio>
<el-radio :label="1">正常</el-radio>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label="额外的规则表达式">
<el-input type="textarea" v-model="formData.condition"></el-input>
</el-form-item> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native="hideForm">取消</el-button>
<el-button
type="primary"
@click.native="formSubmit()"
:loading="formLoading"
>提交
</el-button
>
</div>
</el-dialog>
</div>
</template>
<script>
@ -111,6 +90,7 @@ import {
authPermissionRuleSave,
authPermissionRuleDelete
} from "../../../api/auth/authPermissionRule";
const formJson = {
id: "",
pid: "2",
@ -146,13 +126,13 @@ export default {
formData: formJson,
formRules: {
name: [
{ required: true, message: "请输入规则名", trigger: "blur" }
{required: true, message: "请输入规则名", trigger: "blur"}
],
title: [
{ required: true, message: "请输入标题", trigger: "blur" }
{required: true, message: "请输入标题", trigger: "blur"}
],
status: [
{ required: true, message: "请选择状态", trigger: "change" }
{required: true, message: "请选择状态", trigger: "change"}
]
},
pidData: {},
@ -161,197 +141,200 @@ export default {
},
methods: {
/*eslint-disable */
renderContent(h, { node, data, store }) {
return (
<span style="flex: 1; display: flex; align-items: center; justify-content: space-between; font-size: 14px; padding-right: 8px;">
renderContent(h, {node, data, store}) {
return (
<span
style="flex: 1; display: flex; align-items: center; justify-content: space-between; font-size: 14px; padding-right: 8px;">
<span>
<span title={data.name}>{node.label}</span>
</span>
<span>
<el-button
style="font-size: 12px;"
type="text"
on-click={() => this.handleForm(node, data, "add")}
style="font-size: 12px;"
type="text"
on-click={() => this.handleForm(node, data, "add")}
>
添加子菜单
</el-button>
<el-button
style="font-size: 12px;"
type="text"
on-click={() => this.handleForm(node, data, "edit")}
style="font-size: 12px;"
type="text"
on-click={() => this.handleForm(node, data, "edit")}
>
编辑
</el-button>
<el-button
style="font-size: 12px;"
type="text"
on-click={() => this.handleDel(node, data)}
style="font-size: 12px;"
type="text"
on-click={() => this.handleDel(node, data)}
>
删除
</el-button>
</span>
</span>
);
},
onReset() {
this.$router.push({
path: "",
});
this.query = {
name: "",
status: "",
};
this.getList();
},
onSubmit() {
this.getList();
},
getList() {
this.loading = true;
authPermissionRuleList(this.query)
.then((response) => {
this.loading = false;
this.mergeList = response.data.list || [];
this.treeList = response.data.tree_list || [];
})
.catch(() => {
this.loading = false;
this.mergeList = [];
this.treeList = [];
});
},
//
resetForm() {
if (this.$refs["dataForm"]) {
//
this.$refs["dataForm"].clearValidate();
);
},
onReset() {
this.$router.push({
path: "",
});
this.query = {
name: "",
status: "",
};
this.getList();
},
onSubmit() {
this.getList();
},
getList() {
this.loading = true;
authPermissionRuleList(this.query)
.then((response) => {
this.loading = false;
this.mergeList = response.data.list || [];
this.treeList = response.data.tree_list || [];
})
.catch(() => {
this.loading = false;
this.mergeList = [];
this.treeList = [];
});
},
//
this.$refs["dataForm"].resetFields();
this.getList();
}
},
//
hideForm() {
//
this.formVisible = !this.formVisible;
return true;
},
//
handleForm(node, data, formName) {
this.formVisible = true;
this.pidData = data || null;
formJson.pid = (data && parseInt(data.id)) || "";
this.formData = JSON.parse(JSON.stringify(formJson));
if (formName === "edit") {
this.formData = Object.assign({}, data);
this.node = node;
}
this.formData.pid = !this.formData.pid ? "" : this.formData.pid;
this.formName = formName;
if (data && data.id) {
this.index = this.mergeList.findIndex((d) => d.id === data.id);
}
},
formSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (valid) {
this.formLoading = true;
let data = Object.assign({}, this.formData);
authPermissionRuleSave(data, this.formName)
.then((response) => {
this.formLoading = false;
if (response.code != 20000) {
this.$message.error(response.message);
return false;
}
this.$message.success("操作成功");
this.formVisible = false;
if (this.formName !== "edit") {
if (response.data && response.data.id) {
data.id = response.data.id;
if (this.pidData) {
if (!this.pidData.children) {
this.$set(this.pidData, "children", []);
}
this.pidData.children.push(data);
} else {
this.mergeList.push(data);
}
resetForm() {
if (this.$refs["dataForm"]) {
//
this.$refs["dataForm"].clearValidate();
//
this.$refs["dataForm"].resetFields();
this.getList();
}
},
//
hideForm() {
//
this.formVisible = !this.formVisible;
return true;
},
//
handleForm(node, data, formName) {
this.resetForm();
this.formVisible = true;
this.pidData = data || null;
formJson.pid = (data && parseInt(data.id)) || "";
this.formData = JSON.parse(JSON.stringify(formJson));
if (formName === "edit") {
this.formData = Object.assign({}, data);
this.node = node;
}
this.formData.pid = !this.formData.pid ? "" : this.formData.pid;
this.formName = formName;
if (data && data.id) {
this.index = this.mergeList.findIndex((d) => d.id === data.id);
}
},
formSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (valid) {
this.formLoading = true;
let data = Object.assign({}, this.formData);
authPermissionRuleSave(data, this.formName)
.then((response) => {
this.formLoading = false;
if (response.code != 20000) {
this.$message.error(response.message);
return false;
}
this.$message.success("操作成功");
this.formVisible = false;
if (this.formName !== "edit") {
if (response.data && response.data.id) {
data.id = response.data.id;
if (this.pidData) {
if (!this.pidData.children) {
this.$set(this.pidData, "children", []);
}
this.pidData.children.push(data);
} else {
this.mergeList.push(data);
}
}
} else {
const parent = this.node.parent;
const children = parent.data.children || parent.data;
const index = children.findIndex((d) => d.id === data.id);
children.splice(index, 1, data);
}
//
this.resetForm();
})
.catch(() => {
this.formLoading = false;
});
}
} else {
const parent = this.node.parent;
const children = parent.data.children || parent.data;
const index = children.findIndex((d) => d.id === data.id);
children.splice(index, 1, data);
}
//
this.resetForm();
})
.catch(() => {
this.formLoading = false;
});
}
});
},
//
handleDel(node, data) {
if (data.children && data.children.length > 0) {
this.$alert("请先删除子节点", "提示", {
confirmButtonText: "确定",
});
return false;
}
if (data.id) {
this.$confirm("确认删除该记录吗?", "提示", {
type: "warning",
})
.then(() => {
this.deleteLoading = true;
let para = {id: data.id};
authPermissionRuleDelete(para)
.then((response) => {
this.deleteLoading = false;
if (response.code != 20000) {
this.$message.error(response.message);
return false;
}
this.$message.success("删除成功");
const parent = node.parent;
const children = parent.data.children || parent.data;
const index = children.findIndex((d) => d.id === data.id);
children.splice(index, 1);
})
.catch(() => {
this.deleteLoading = false;
});
})
.catch(() => {
this.$message.info("取消删除");
});
}
},
},
//
handleDel(node, data) {
if (data.children && data.children.length > 0) {
this.$alert("请先删除子节点", "提示", {
confirmButtonText: "确定",
});
return false;
}
if (data.id) {
this.$confirm("确认删除该记录吗?", "提示", {
type: "warning",
})
.then(() => {
this.deleteLoading = true;
let para = { id: data.id };
authPermissionRuleDelete(para)
.then((response) => {
this.deleteLoading = false;
if (response.code != 20000) {
this.$message.error(response.message);
return false;
}
this.$message.success("删除成功");
const parent = node.parent;
const children = parent.data.children || parent.data;
const index = children.findIndex((d) => d.id === data.id);
children.splice(index, 1);
})
.catch(() => {
this.deleteLoading = false;
});
})
.catch(() => {
this.$message.info("取消删除");
});
}
filters: {
statusFilterType(status) {
const statusMap = {
0: "gray",
1: "success",
};
return statusMap[status];
},
statusFilterName(status) {
const statusMap = {
0: "禁用",
1: "正常",
};
return statusMap[status];
},
},
},
filters: {
statusFilterType(status) {
const statusMap = {
0: "gray",
1: "success",
};
return statusMap[status];
mounted() {
},
statusFilterName(status) {
const statusMap = {
0: "禁用",
1: "正常",
};
return statusMap[status];
created() {
//
this.getList();
},
},
mounted() {},
created() {
//
this.getList();
},
};
</script>

@ -235,6 +235,7 @@ export default {
this.getList();
},
onSubmit() {
this.query.page = 1;
this.getList();
},
handleCurrentChange(val) {

@ -189,7 +189,7 @@
</el-col>
</el-row>
<span slot="footer" class="dialog-footer" style="margin-top: 40px">
<el-button @click="editDialogVisible = false">取消</el-button>
<el-button @click="cancelDialog"></el-button>
<el-button type="primary" @click="confirmEdit"></el-button>
</span>
</el-dialog>
@ -276,13 +276,9 @@ export default {
this.editDialogVisible = true;
},
cancelDialog() {
this.addDialogVisible = false;
},
handleCheckedChange(val) {
console.log(val);
this.editDialogVisible = false;
this.getList();
},
handleSizeChange(val) {
this.filterQuery.limit = val;
this.getList();
@ -294,10 +290,10 @@ export default {
checkRegister() {
this.loading = true;
check(this.checkQuery)
.then((response) => {
if (response.code === 20000) {
this.editDialogVisible = false;
this.getList();
this.$message({
type: "success",
@ -316,7 +312,6 @@ export default {
this.centerDialogVisible = true;
},
confirmEdit() {
this.ch
this.checkRegister();
},

@ -5,12 +5,12 @@
<el-form :inline="true" :model="query" class="query-form" size="mini">
<el-row>
<el-form-item class="query-form-item">
<el-input v-model="query.key" placeholder="参数关键字搜索"></el-input>
<el-input v-model="query.paramName" placeholder="参数关键字搜索" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" @click.native="getList"
<el-button type="primary" @click.native="search"
>搜索
</el-button
>
@ -182,6 +182,10 @@
this.query.page = val;
this.getList();
},
search() {
this.query.page = 1;
this.getList();
},
getList() {
this.loading = true;
systemParamConfigList(this.query)

Loading…
Cancel
Save