合并分支 'ProjectThird' 到 'master'

解决多人选择组件的默认查询条件问题

查看合并请求 JeroBoot/jero-boot!2
This commit is contained in:
李雪涛
2022-02-02 13:56:41 +08:00
8 changed files with 34 additions and 55 deletions
@@ -133,7 +133,7 @@ public class LoginController {
@ApiOperation("获取验证码")
@GetMapping(value = "/randomImage/{key}")
public Result<String> randomImage(HttpServletResponse response,@PathVariable String key){
return randomImage(response,key);
return loginService.randomImage(response,key);
}
/**
@@ -15,13 +15,13 @@
<a-form layout="inline" class="j-inline-form">
<!-- 固定条件 -->
<a-form-item :label="(queryParamText||name)">
<a-input v-model="queryParam[queryParamCode||valueKey]" :placeholder="'请输入' + (queryParamText||name)" @pressEnter="searchQuery"/>
<j-input v-model="queryParam[queryParamCode||valueKey]" :placeholder="'请输入' + (queryParamText||name)" @pressEnter="searchQuery"/>
</a-form-item>
<!-- 动态生成的查询条件 -->
<j-select-biz-query-item v-if="queryConfig.length>0" v-show="showMoreQueryItems" :queryParam="queryParam" :queryConfig="queryConfig" @pressEnter="searchQuery"/>
<!-- 按钮 -->
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a-button :style="{marginBottom:'12px'}" type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button :style="{marginBottom:'12px'}" type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a v-if="queryConfig.length>0" @click="showMoreQueryItems=!showMoreQueryItems" style="margin-left: 8px">
{{ showMoreQueryItems ? '收起' : '展开' }}
<a-icon :type="showMoreQueryItems ? 'up' : 'down'"/>
@@ -36,7 +36,7 @@ export default {
} else if (dictCode) {
input = <j-dict-select-tag {...options} vModel={this.queryParam[key]} dictCode={dictCode} style="width:180px;"/>
} else {
input = <a-input {...options} vModel={this.queryParam[key]}/>
input = <j-input {...options} vModel={this.queryParam[key]}/>
}
return <a-form-item key={key} label={label}>{input}</a-form-item>
})
@@ -28,10 +28,15 @@
return {
url: { list: '/sys/user/page' },
columns: [
{ title: '姓名', align: 'center', width: '25%', widthRight: '70%', dataIndex: 'realname' },
{ title: '账号', align: 'center', width: '25%', dataIndex: 'username' },
{ title: '用户账号', align: 'center', width: '25%', dataIndex: 'username' },
{ title: '用户姓名', align: 'center', width: '25%', widthRight: '70%', dataIndex: 'realname' },
{ title: '性别', align: 'center', dataIndex: 'sex_dictText', },
{ title: '电话', align: 'center', width: '20%', dataIndex: 'phone' },
{ title: '出生日期', align: 'center', width: '20%', dataIndex: 'birthday' }
{
title: '部门',
align: 'center',
dataIndex: 'orgCodeTxt'
}
],
// 定义在这里的参数都是可以在外部传递覆盖的,可以更灵活的定制化使用的组件
default: {
@@ -43,21 +48,16 @@
},
// 多条件查询配置
queryConfigDefault: [
{
key: 'realname',
label: '姓名',
},
{
key: 'sex',
label: '性别',
// 如果包含 dictCode,那么就会显示成下拉框
dictCode: 'sex',
},
{
key: 'birthday',
label: '生日',
placeholder: '请选择出生日期',
// 如果想要使用局部注册的组件,就必须要使用箭头函数
customRender: ({key, queryParam, options}) => {
return <j-date {...options} vModel={queryParam[key]} style="width:180px;"/>
},
},
],
}
},
@@ -1,15 +1,12 @@
<template>
<j-select-biz-component
:value="value"
name="角色"
displayKey="roleName"
:returnKeys="returnKeys"
:listUrl="url.list"
:columns="columns"
queryParamText="角色编码"
v-on="$listeners"
v-bind="$attrs"
/>
@@ -28,20 +28,20 @@
</a-col>
<a-col :md="18" :sm="24">
<a-card :bordered="false">
用户账号:
<J-input
:style="{width:'150px',marginBottom:'15px'}"
placeholder="请输入账号"
v-model="queryParam.username"
></J-input>
用户姓名:
<J-input
:style="{width:'150px',marginBottom:'15px'}"
placeholder="请输入姓名"
v-model="queryParam.realname"
></J-input>
<a-button @click="onSearch(1)" style="margin-left: 20px" icon="search">查询</a-button>
<a-button @click="searchReset(1)" style="margin-left: 20px" icon="redo">重置</a-button>
<div :style="{marginBottom:'12px'}">
<label :style="{marginRight:'5px'}">用户账号:</label>
<j-input
:style="{width:'150px'}"
placeholder="请输入账号"
v-model="queryParam.username"></j-input>
<label :style="{marginRight:'5px', marginLeft: '16px'}">用户姓名:</label>
<j-input
:style="{width:'150px'}"
placeholder="请输入姓名"
v-model="queryParam.realname"></j-input>
<a-button type="primary" @click="onSearch(1)" style="margin-left: 20px" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset(1)" style="margin-left: 20px" icon="redo">重置</a-button>
</div>
<!--用户列表-->
<a-table
ref="table"
@@ -73,6 +73,7 @@
return {
queryParam: {
username: "",
realname: ""
},
columns: [
{
@@ -88,19 +89,10 @@
{
title: '性别',
align: 'center',
dataIndex: 'sex',
customRender: function (text) {
if (text === 1) {
return '男'
} else if (text === 2) {
return '女'
} else {
return text
}
}
dataIndex: 'sex_dictText'
},
{
title: '手机',
title: '电话',
align: 'center',
dataIndex: 'phone'
},
-2
View File
@@ -49,8 +49,6 @@ import '@/assets/less/JAreaLinkage.less'
import VueAreaLinkage from 'vue-area-linkage'
import '@/components/jero/JVxeTable/install'
import '@/components/JVxeCells/install'
// 输入框去除首尾空格
import '@/utils/trim'
Vue.config.productionTip = false
Vue.use(Storage, config.storageOptions)
-8
View File
@@ -1,8 +0,0 @@
/*
* 2022-1-25
* 输入框去除首尾空格
*/
document.addEventListener('input', (event) => {
event.srcElement.value=event.srcElement.value.replace(/(^\s*)|(\s*$)/g, '')
})