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