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

fengcang
x_z 3 years ago
parent b4cf0c0760
commit ac3485ed8b

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

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

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

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

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

@ -5,12 +5,12 @@
<el-form :inline="true" :model="query" class="query-form" size="mini"> <el-form :inline="true" :model="query" class="query-form" size="mini">
<el-row> <el-row>
<el-form-item class="query-form-item"> <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-form-item> <el-form-item>
<el-button-group> <el-button-group>
<el-button type="primary" @click.native="getList" <el-button type="primary" @click.native="search"
>搜索 >搜索
</el-button </el-button
> >
@ -182,6 +182,10 @@
this.query.page = val; this.query.page = val;
this.getList(); this.getList();
}, },
search() {
this.query.page = 1;
this.getList();
},
getList() { getList() {
this.loading = true; this.loading = true;
systemParamConfigList(this.query) systemParamConfigList(this.query)

Loading…
Cancel
Save