feat: 后台管理页面查询条件统一改为独立卡片+按钮触发模式
业务组管理、用户管理、配置管理、应用管理页面的查询条件拆分为独立卡片, 新增查询/重置按钮,移除下拉选中即时触发查询的交互; 应用管理新增应用名称、应用编码模糊查询和业务组精确查询条件。
This commit is contained in:
@@ -24,6 +24,9 @@ type AppListRequest struct {
|
|||||||
PageNo int `form:"pageNo" binding:"required"`
|
PageNo int `form:"pageNo" binding:"required"`
|
||||||
PageSize int `form:"pageSize" binding:"required"`
|
PageSize int `form:"pageSize" binding:"required"`
|
||||||
AppType string `form:"appType"`
|
AppType string `form:"appType"`
|
||||||
|
Name string `form:"name"`
|
||||||
|
Code string `form:"code"`
|
||||||
|
GroupId string `form:"groupId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *AppHandler) List(c *gin.Context) {
|
func (h *AppHandler) List(c *gin.Context) {
|
||||||
@@ -66,6 +69,15 @@ func (h *AppHandler) List(c *gin.Context) {
|
|||||||
if req.AppType != "" {
|
if req.AppType != "" {
|
||||||
whereClause += " AND service_id = '" + req.AppType + "'"
|
whereClause += " AND service_id = '" + req.AppType + "'"
|
||||||
}
|
}
|
||||||
|
if req.Name != "" {
|
||||||
|
whereClause += " AND name LIKE '%" + req.Name + "%'"
|
||||||
|
}
|
||||||
|
if req.Code != "" {
|
||||||
|
whereClause += " AND code LIKE '%" + req.Code + "%'"
|
||||||
|
}
|
||||||
|
if req.GroupId != "" {
|
||||||
|
whereClause += " AND group_id = " + req.GroupId
|
||||||
|
}
|
||||||
|
|
||||||
total, _ := dao.Engine.Where(whereClause).Count(&model.Application{})
|
total, _ := dao.Engine.Where(whereClause).Count(&model.Application{})
|
||||||
dao.Engine.Where(whereClause).Limit(req.PageSize, (req.PageNo-1)*req.PageSize).Find(&apps)
|
dao.Engine.Where(whereClause).Limit(req.PageSize, (req.PageNo-1)*req.PageSize).Find(&apps)
|
||||||
|
|||||||
@@ -1,12 +1,30 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-card>
|
|
||||||
<div slot="header" style="display: flex; justify-content: space-between; align-items: center">
|
|
||||||
<span>应用管理</span>
|
|
||||||
<div>
|
<div>
|
||||||
|
<el-card style="margin-bottom: 16px">
|
||||||
|
<el-form :inline="true" @submit.native.prevent="handleSearch">
|
||||||
|
<el-form-item label="应用名称">
|
||||||
|
<el-input v-model="query.name" placeholder="请输入" clearable style="width: 160px"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="应用编码">
|
||||||
|
<el-input v-model="query.code" placeholder="请输入" clearable style="width: 160px"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="业务组">
|
||||||
|
<el-select v-model="query.groupId" placeholder="请选择" clearable filterable style="width: 160px">
|
||||||
|
<el-option v-for="g in groups" :key="g.value" :label="g.label" :value="parseInt(g.value)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="handleSearch">查询</el-button>
|
||||||
|
<el-button @click="handleReset">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card>
|
||||||
|
<div slot="header" style="display: flex; justify-content: flex-end">
|
||||||
<el-button type="primary" @click="showAdd">新建应用</el-button>
|
<el-button type="primary" @click="showAdd">新建应用</el-button>
|
||||||
<el-button type="primary" @click="$router.push('/config/add')">新建配置</el-button>
|
<el-button type="primary" @click="$router.push('/config/add')">新建配置</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<el-table :data="list" v-loading="loading" border stripe>
|
<el-table :data="list" v-loading="loading" border stripe>
|
||||||
<el-table-column prop="id" label="ID" width="60"></el-table-column>
|
<el-table-column prop="id" label="ID" width="60"></el-table-column>
|
||||||
<el-table-column prop="name" label="应用名称"></el-table-column>
|
<el-table-column prop="name" label="应用名称"></el-table-column>
|
||||||
@@ -75,6 +93,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -87,7 +106,7 @@ export default {
|
|||||||
list: [],
|
list: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
total: 0,
|
total: 0,
|
||||||
query: { pageNo: 1, pageSize: 20 },
|
query: { pageNo: 1, pageSize: 20, name: '', code: '', groupId: '' },
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
dialogTitle: '',
|
dialogTitle: '',
|
||||||
form: {},
|
form: {},
|
||||||
@@ -104,6 +123,14 @@ export default {
|
|||||||
this.loadOptions()
|
this.loadOptions()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleSearch() {
|
||||||
|
this.query.pageNo = 1
|
||||||
|
this.loadData()
|
||||||
|
},
|
||||||
|
handleReset() {
|
||||||
|
this.query = { pageNo: 1, pageSize: 20, name: '', code: '', groupId: '' }
|
||||||
|
this.loadData()
|
||||||
|
},
|
||||||
async loadData() {
|
async loadData() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,17 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-card>
|
|
||||||
<div slot="header" style="display: flex; justify-content: space-between; align-items: center">
|
|
||||||
<span>配置列表</span>
|
|
||||||
<div>
|
<div>
|
||||||
<el-select v-model="query.env" placeholder="环境" clearable style="width: 160px; margin-right: 10px" @change="loadData">
|
<el-card style="margin-bottom: 16px">
|
||||||
|
<el-form :inline="true" @submit.native.prevent="handleSearch">
|
||||||
|
<el-form-item label="环境">
|
||||||
|
<el-select v-model="query.env" placeholder="请选择" clearable style="width: 160px">
|
||||||
<el-option v-for="p in profiles" :key="p.value" :label="p.label" :value="p.value"></el-option>
|
<el-option v-for="p in profiles" :key="p.value" :label="p.label" :value="p.value"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-select v-model="query.appId" placeholder="应用" clearable filterable style="width: 200px; margin-right: 10px" @change="loadData">
|
</el-form-item>
|
||||||
|
<el-form-item label="应用">
|
||||||
|
<el-select v-model="query.appId" placeholder="请选择" clearable filterable style="width: 200px">
|
||||||
<el-option v-for="app in apps" :key="app.value" :label="app.label" :value="app.value"></el-option>
|
<el-option v-for="app in apps" :key="app.value" :label="app.label" :value="app.value"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="handleSearch">查询</el-button>
|
||||||
|
<el-button @click="handleReset">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card>
|
||||||
|
<div slot="header" style="display: flex; justify-content: flex-end">
|
||||||
<el-button type="primary" @click="$router.push('/config/add')">新建配置</el-button>
|
<el-button type="primary" @click="$router.push('/config/add')">新建配置</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<el-table :data="list" v-loading="loading" border stripe>
|
<el-table :data="list" v-loading="loading" border stripe>
|
||||||
<el-table-column prop="id" label="ID" width="60"></el-table-column>
|
<el-table-column prop="id" label="ID" width="60"></el-table-column>
|
||||||
<el-table-column prop="name" label="配置名"></el-table-column>
|
<el-table-column prop="name" label="配置名"></el-table-column>
|
||||||
@@ -118,6 +129,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -241,6 +253,14 @@ export default {
|
|||||||
this.loadApps()
|
this.loadApps()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleSearch() {
|
||||||
|
this.query.pageNo = 1
|
||||||
|
this.loadData()
|
||||||
|
},
|
||||||
|
handleReset() {
|
||||||
|
this.query = { pageNo: 1, pageSize: 20, env: '', appId: null }
|
||||||
|
this.loadData()
|
||||||
|
},
|
||||||
async loadData() {
|
async loadData() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,14 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-card>
|
|
||||||
<div slot="header" style="display: flex; justify-content: space-between; align-items: center">
|
|
||||||
<span>业务组管理</span>
|
|
||||||
<div>
|
<div>
|
||||||
<el-select v-model="filterName" placeholder="组名称" clearable filterable style="width: 200px; margin-right: 10px">
|
<el-card style="margin-bottom: 16px">
|
||||||
|
<el-form :inline="true" @submit.native.prevent="handleSearch">
|
||||||
|
<el-form-item label="组名称">
|
||||||
|
<el-select v-model="filterName" placeholder="请选择" clearable filterable style="width: 200px">
|
||||||
<el-option v-for="g in groupOptions" :key="g" :label="g" :value="g"></el-option>
|
<el-option v-for="g in groupOptions" :key="g" :label="g" :value="g"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="handleSearch">查询</el-button>
|
||||||
|
<el-button @click="handleReset">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card>
|
||||||
|
<div slot="header" style="display: flex; justify-content: flex-end">
|
||||||
<el-button type="primary" @click="showAdd">新建业务组</el-button>
|
<el-button type="primary" @click="showAdd">新建业务组</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<el-table :data="filteredList" v-loading="loading" border stripe>
|
<el-table :data="filteredList" v-loading="loading" border stripe>
|
||||||
<el-table-column prop="id" label="ID" width="60"></el-table-column>
|
<el-table-column prop="id" label="ID" width="60"></el-table-column>
|
||||||
<el-table-column prop="name" label="组名称"></el-table-column>
|
<el-table-column prop="name" label="组名称"></el-table-column>
|
||||||
@@ -46,6 +55,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -57,6 +67,7 @@ export default {
|
|||||||
list: [],
|
list: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
filterName: '',
|
filterName: '',
|
||||||
|
searchName: '',
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
dialogTitle: '',
|
dialogTitle: '',
|
||||||
form: {},
|
form: {},
|
||||||
@@ -72,8 +83,8 @@ export default {
|
|||||||
return [...new Set(this.list.map(g => g.name))].filter(name => name && name.trim())
|
return [...new Set(this.list.map(g => g.name))].filter(name => name && name.trim())
|
||||||
},
|
},
|
||||||
filteredList() {
|
filteredList() {
|
||||||
if (!this.filterName) return this.list
|
if (!this.searchName) return this.list
|
||||||
return this.list.filter(g => g.name === this.filterName)
|
return this.list.filter(g => g.name === this.searchName)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -81,6 +92,13 @@ export default {
|
|||||||
this.loadUsers()
|
this.loadUsers()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleSearch() {
|
||||||
|
this.searchName = this.filterName
|
||||||
|
},
|
||||||
|
handleReset() {
|
||||||
|
this.filterName = ''
|
||||||
|
this.searchName = ''
|
||||||
|
},
|
||||||
async loadData() {
|
async loadData() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header" style="display: flex; justify-content: space-between; align-items: center">
|
<div slot="header" style="display: flex; justify-content: space-between; align-items: center">
|
||||||
<span>环境管理</span>
|
<span>环境列表</span>
|
||||||
<el-button type="primary" @click="showAdd">新建环境</el-button>
|
<el-button type="primary" @click="showAdd">新建环境</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="list" v-loading="loading" border stripe>
|
<el-table :data="list" v-loading="loading" border stripe>
|
||||||
|
|||||||
@@ -1,24 +1,39 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-card>
|
|
||||||
<div slot="header" style="display: flex; justify-content: space-between; align-items: center">
|
|
||||||
<span>用户管理</span>
|
|
||||||
<div>
|
<div>
|
||||||
<el-input v-model="query.name" placeholder="用户名" clearable style="width: 140px; margin-right: 10px" @clear="loadData" @keyup.enter.native="loadData"></el-input>
|
<el-card style="margin-bottom: 16px">
|
||||||
<el-select v-model="query.type" placeholder="类型" clearable style="width: 120px; margin-right: 10px" @change="loadData">
|
<el-form :inline="true" @submit.native.prevent="loadData">
|
||||||
|
<el-form-item label="用户名">
|
||||||
|
<el-input v-model="query.name" placeholder="请输入" clearable style="width: 140px"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类型">
|
||||||
|
<el-select v-model="query.type" placeholder="请选择" clearable style="width: 120px">
|
||||||
<el-option value="user" label="普通用户"></el-option>
|
<el-option value="user" label="普通用户"></el-option>
|
||||||
<el-option value="groupAdmin" label="组管理员"></el-option>
|
<el-option value="groupAdmin" label="组管理员"></el-option>
|
||||||
<el-option value="superAdmin" label="超级管理员"></el-option>
|
<el-option value="superAdmin" label="超级管理员"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-select v-model="query.groupId" placeholder="所属组" clearable filterable style="width: 160px; margin-right: 10px" @change="loadData">
|
</el-form-item>
|
||||||
|
<el-form-item label="所属组">
|
||||||
|
<el-select v-model="query.groupId" placeholder="请选择" clearable filterable style="width: 160px">
|
||||||
<el-option v-for="g in groups" :key="g.value" :label="g.label" :value="g.value"></el-option>
|
<el-option v-for="g in groups" :key="g.value" :label="g.label" :value="g.value"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-select v-model="query.enabled" placeholder="状态" clearable style="width: 100px; margin-right: 10px" @change="loadData">
|
</el-form-item>
|
||||||
|
<el-form-item label="状态">
|
||||||
|
<el-select v-model="query.enabled" placeholder="请选择" clearable style="width: 100px">
|
||||||
<el-option :value="1" label="启用"></el-option>
|
<el-option :value="1" label="启用"></el-option>
|
||||||
<el-option :value="0" label="禁用"></el-option>
|
<el-option :value="0" label="禁用"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="loadData">查询</el-button>
|
||||||
|
<el-button @click="handleReset">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card>
|
||||||
|
<div slot="header" style="display: flex; justify-content: flex-end">
|
||||||
<el-button type="primary" @click="showAdd">新建用户</el-button>
|
<el-button type="primary" @click="showAdd">新建用户</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<el-table :data="list" v-loading="loading" border stripe>
|
<el-table :data="list" v-loading="loading" border stripe>
|
||||||
<el-table-column prop="id" label="ID" width="60"></el-table-column>
|
<el-table-column prop="id" label="ID" width="60"></el-table-column>
|
||||||
<el-table-column prop="name" label="用户名"></el-table-column>
|
<el-table-column prop="name" label="用户名"></el-table-column>
|
||||||
@@ -78,6 +93,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -110,6 +126,9 @@ export default {
|
|||||||
this.loadGroups()
|
this.loadGroups()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleReset() {
|
||||||
|
this.query = { name: '', type: '', groupId: '', enabled: '' }
|
||||||
|
},
|
||||||
async loadData() {
|
async loadData() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user