update user/role 's search bar
This commit is contained in:
parent
68732740c3
commit
1080660be3
@ -94,13 +94,6 @@ export default function () {
|
||||
form: {
|
||||
rows: [
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: "原料名称",
|
||||
prop: "name",
|
||||
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
||||
elparams: { placeholder: "请输入原料名称" },
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: "原料编码",
|
||||
@ -109,6 +102,13 @@ export default function () {
|
||||
elparams: { placeholder: "请输入原料编码" },
|
||||
},
|
||||
{ input: true, label: "原料描述", prop: "description", elparams: { placeholder: "原料描述" } },
|
||||
{
|
||||
input: true,
|
||||
label: "中文名称", // 即,原料名称
|
||||
prop: "name",
|
||||
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
||||
elparams: { placeholder: "请输入中文名称" },
|
||||
},
|
||||
],
|
||||
[
|
||||
// {
|
||||
|
@ -11,17 +11,18 @@ export default function () {
|
||||
// { prop: 'version', label: '配方号' },
|
||||
// { prop: "shapeCode", label: "砖型" },
|
||||
// { prop: 'status', label: '状态', subcomponent: StatusComponent }, // subcomponent
|
||||
{ prop: "description", label: "详情", subcomponent: TableTextComponent },
|
||||
// { prop: "description", label: "详情", subcomponent: TableTextComponent },
|
||||
{ prop: "remark", label: "备注" },
|
||||
{ prop: "createTime", label: "添加时间", filter: timeFilter },
|
||||
{
|
||||
prop: "operations",
|
||||
name: "操作",
|
||||
fixed: "right",
|
||||
width: 120,
|
||||
// width: 120,
|
||||
width: 90,
|
||||
subcomponent: TableOperaionComponent,
|
||||
options: [
|
||||
{ name: "copy", label: "复制", icon: "copy-document" },
|
||||
// { name: "copy", label: "复制", icon: "copy-document" },
|
||||
{ name: "edit", label: "编辑", icon: "edit-outline" },
|
||||
{ name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:packingStep:delete" },
|
||||
],
|
||||
@ -62,13 +63,13 @@ export default function () {
|
||||
name: "查询",
|
||||
},
|
||||
},
|
||||
// {
|
||||
// button: {
|
||||
// type: "plain",
|
||||
// name: "新增",
|
||||
// permission: "pms:packingStep:save",
|
||||
// },
|
||||
// },
|
||||
{
|
||||
button: {
|
||||
type: "plain",
|
||||
name: "新增",
|
||||
// permission: "pms:packingStep:save",
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const dialogConfigs = {
|
||||
@ -76,7 +77,7 @@ export default function () {
|
||||
extraIds: { wsId: 5 }, // 工艺管理里面的相关模块的 dialogWithMenu 需要额外的工序 id
|
||||
menu: [
|
||||
{ name: "包装工艺", key: "info" },
|
||||
{ name: "工艺参数", key: "attr", onlyEditMode: true },
|
||||
// { name: "工艺参数", key: "attr", onlyEditMode: true },
|
||||
],
|
||||
form: {
|
||||
rows: [
|
||||
|
@ -8,9 +8,9 @@ export default function () {
|
||||
{ type: "index", label: "序号" },
|
||||
{ prop: "name", label: "物料名称" },
|
||||
{ prop: "code", label: "物料编码" },
|
||||
{ prop: "typeDictValue", label: "物料类型", filter: dictFilter("product_type") },
|
||||
// { prop: "typeDictValue", label: "物料类型", filter: dictFilter("product_type") },
|
||||
{ prop: "specifications", label: "规格" },
|
||||
{ prop: "unitDictValue", label: "单位", filter: dictFilter("unit") },
|
||||
// { prop: "unitDictValue", label: "单位", filter: dictFilter("unit") },
|
||||
{ prop: "weight", label: "重量", filter: (val) => (val ? val + " kg" : "-") },
|
||||
{ prop: "processTime", label: "产线完成单位产品用时", width: 200, filter: (val) => val + " (分钟)" },
|
||||
{ prop: "remark", label: "备注" },
|
||||
|
@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<!-- <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> -->
|
||||
<BaseSearchForm :head-config="headConfig" @btn-click="handleBtnClick" />
|
||||
<base-table :table-props="tableProps" :page="listQuery.page" :limit="listQuery.limit" :table-data="tableData">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
@ -41,6 +42,9 @@
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import AddOrUpdate from "./role-add-or-update";
|
||||
import i18n from "@/i18n";
|
||||
import BaseSearchForm from "../../../components/BaseSearchForm.vue";
|
||||
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "name",
|
||||
@ -96,29 +100,74 @@ export default {
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
headConfig: {
|
||||
rules: null,
|
||||
fields: [
|
||||
{
|
||||
label: i18n.t("role.name"),
|
||||
prop: "name",
|
||||
input: true,
|
||||
default: { value: "" },
|
||||
bind: { placeholder: "请输入角色名称" },
|
||||
},
|
||||
{
|
||||
button: {
|
||||
type: "primary",
|
||||
name: "查询",
|
||||
},
|
||||
},
|
||||
{
|
||||
button: {
|
||||
type: "primary",
|
||||
name: "新增",
|
||||
permission: "",
|
||||
},
|
||||
bind: {
|
||||
plain: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
BaseSearchForm
|
||||
},
|
||||
methods: {
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.name = val.name;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
handleBtnClick({ btnName, payload }) {
|
||||
console.log("[search] form handleBtnClick", btnName, payload);
|
||||
switch (btnName) {
|
||||
case "新增":
|
||||
this.addOrEditTitle = "新增";
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
case "查询": {
|
||||
this.listQuery.name = payload.name;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
//search-bar点击
|
||||
// buttonClick(val) {
|
||||
// switch (val.btnName) {
|
||||
// case "search":
|
||||
// this.listQuery.name = val.name;
|
||||
// this.listQuery.page = 1;
|
||||
// this.getDataList();
|
||||
// break;
|
||||
// case "add":
|
||||
// this.addOrEditTitle = "新增";
|
||||
// this.addOrUpdateVisible = true;
|
||||
// this.addOrUpdateHandle();
|
||||
// break;
|
||||
// default:
|
||||
// console.log(val);
|
||||
// }
|
||||
// },
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<!-- <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> -->
|
||||
<BaseSearchForm :head-config="headConfig" @btn-click="handleBtnClick" />
|
||||
<base-table :table-props="tableProps" :page="listQuery.page" :limit="listQuery.limit" :table-data="tableData">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
@ -9,13 +10,16 @@
|
||||
:width="100"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="(payload) => handleClick({
|
||||
type: payload.type,
|
||||
data: {
|
||||
...payload.data,
|
||||
name: payload.data.username
|
||||
}
|
||||
})" />
|
||||
@clickBtn="
|
||||
(payload) =>
|
||||
handleClick({
|
||||
type: payload.type,
|
||||
data: {
|
||||
...payload.data,
|
||||
name: payload.data.username,
|
||||
},
|
||||
})
|
||||
" />
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
@ -29,7 +33,15 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel">
|
||||
<add-or-update ref="addOrUpdate" @refreshDataList="() => { getDataList(); addOrUpdateVisible = false; }" @successSubmit="successSubmit"></add-or-update>
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="
|
||||
() => {
|
||||
getDataList();
|
||||
addOrUpdateVisible = false;
|
||||
}
|
||||
"
|
||||
@successSubmit="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
@ -40,6 +52,8 @@ import basicPage from "@/mixins/basic-page";
|
||||
import AddOrUpdate from "./user-add-or-update";
|
||||
import i18n from "@/i18n";
|
||||
import sysFilter from "@/filters/sys-filter";
|
||||
import BaseSearchForm from "../../../components/BaseSearchForm.vue";
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "username",
|
||||
@ -83,9 +97,38 @@ const tableBtn = [
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: "UserView",
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
headConfig: {
|
||||
rules: null,
|
||||
fields: [
|
||||
{
|
||||
label: i18n.t("user.username"),
|
||||
prop: "username",
|
||||
input: true,
|
||||
default: { value: "" },
|
||||
bind: { placeholder: "请输入用户名" },
|
||||
},
|
||||
{
|
||||
button: {
|
||||
type: "primary",
|
||||
name: "查询",
|
||||
},
|
||||
},
|
||||
{
|
||||
button: {
|
||||
type: "primary",
|
||||
name: "新增",
|
||||
permission: "",
|
||||
},
|
||||
bind: {
|
||||
plain: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
urlOptions: {
|
||||
getDataListURL: "/sys/user/page",
|
||||
deleteURL: "/sys/user",
|
||||
@ -118,25 +161,42 @@ export default {
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
BaseSearchForm,
|
||||
},
|
||||
methods: {
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.username = val.username;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
handleBtnClick({ btnName, payload }) {
|
||||
console.log("[search] form handleBtnClick", btnName, payload);
|
||||
switch (btnName) {
|
||||
case "新增":
|
||||
this.addOrEditTitle = "新增";
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
case "查询": {
|
||||
this.listQuery.username = payload.username;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
//search-bar点击
|
||||
// buttonClick(val) {
|
||||
// switch (val.btnName) {
|
||||
// case "search":
|
||||
// this.listQuery.username = val.username;
|
||||
// this.listQuery.page = 1;
|
||||
// this.getDataList();
|
||||
// break;
|
||||
// case "add":
|
||||
// this.addOrEditTitle = "新增";
|
||||
// this.addOrUpdateVisible = true;
|
||||
// this.addOrUpdateHandle();
|
||||
// break;
|
||||
// default:
|
||||
// console.log(val);
|
||||
// }
|
||||
// },
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user