mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: Application list search criteria support querying by status (#3803)
This commit is contained in:
parent
b5fe64d619
commit
f7623dcfdc
|
|
@ -88,6 +88,13 @@ class ApplicationQueryAPI(APIMixin):
|
|||
type=OpenApiTypes.STR,
|
||||
location='query',
|
||||
required=False,
|
||||
),
|
||||
OpenApiParameter(
|
||||
name="publish_status",
|
||||
description=_("Publish status") + '(published|unpublished)',
|
||||
type=OpenApiTypes.STR,
|
||||
location='query',
|
||||
required=False,
|
||||
)
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -284,6 +284,9 @@ class ApplicationQueryRequest(serializers.Serializer):
|
|||
folder_id = serializers.CharField(required=False, label=_("folder id"))
|
||||
name = serializers.CharField(required=False, label=_('Application Name'))
|
||||
desc = serializers.CharField(required=False, label=_("Application Description"))
|
||||
publish_status = serializers.ChoiceField(required=False, label=_("Publish status"),
|
||||
choices=[('published', _("Published")),
|
||||
('unpublished', _("Unpublished"))])
|
||||
user_id = serializers.UUIDField(required=False, label=_("User ID"))
|
||||
|
||||
|
||||
|
|
@ -311,7 +314,11 @@ class Query(serializers.Serializer):
|
|||
user_id = self.data.get('user_id')
|
||||
desc = instance.get('desc')
|
||||
name = instance.get('name')
|
||||
publish_status = instance.get("publish_status")
|
||||
create_user = instance.get('create_user')
|
||||
if publish_status is not None:
|
||||
is_publish = True if publish_status == "published" else False
|
||||
application_query_set = application_query_set.filter(is_publish=is_publish)
|
||||
if workspace_id is not None:
|
||||
folder_query_set = folder_query_set.filter(workspace_id=workspace_id)
|
||||
application_query_set = application_query_set.filter(workspace_id=workspace_id)
|
||||
|
|
|
|||
|
|
@ -8549,4 +8549,13 @@ msgid "Failed to get WeCom department users"
|
|||
msgstr ""
|
||||
|
||||
msgid "Failed to get WeCom user info"
|
||||
msgstr ""
|
||||
|
||||
msgid "Publish status"
|
||||
msgstr ""
|
||||
|
||||
msgid "Unpublished"
|
||||
msgstr ""
|
||||
|
||||
msgid "Published"
|
||||
msgstr ""
|
||||
|
|
@ -8675,4 +8675,13 @@ msgid "Failed to get WeCom department users"
|
|||
msgstr "获取企业微信部门用户失败"
|
||||
|
||||
msgid "Failed to get WeCom user info"
|
||||
msgstr "获取企业微信用户信息失败"
|
||||
msgstr "获取企业微信用户信息失败"
|
||||
|
||||
msgid "Publish status"
|
||||
msgstr "发布状态"
|
||||
|
||||
msgid "Unpublished"
|
||||
msgstr "未发布"
|
||||
|
||||
msgid "Published"
|
||||
msgstr "已发布"
|
||||
|
|
@ -8676,3 +8676,12 @@ msgstr "獲取 WeCom 部門用戶失敗"
|
|||
|
||||
msgid "Failed to get WeCom user info"
|
||||
msgstr "獲取 WeCom 用戶詳情失敗"
|
||||
|
||||
msgid "Publish status"
|
||||
msgstr "發佈狀態"
|
||||
|
||||
msgid "Unpublished"
|
||||
msgstr "未發佈"
|
||||
|
||||
msgid "Published"
|
||||
msgstr "已發佈"
|
||||
|
|
@ -4,6 +4,9 @@ export default {
|
|||
createSuccess: 'Successful',
|
||||
copy: 'Copy',
|
||||
copySuccess: 'Successful',
|
||||
publishStatus: 'Publish Status',
|
||||
published: 'Published',
|
||||
unpublished: 'Unpublished',
|
||||
copyError: 'Copy Failed',
|
||||
save: 'Save',
|
||||
saveSuccess: 'Successful',
|
||||
|
|
@ -93,7 +96,8 @@ export default {
|
|||
notFound: {
|
||||
title: '404',
|
||||
NoService: 'Currently unable to access services',
|
||||
NoPermission: 'The current user does not have permission to access, please contact the administrator',
|
||||
NoPermission:
|
||||
'The current user does not have permission to access, please contact the administrator',
|
||||
operate: 'Back to Home',
|
||||
},
|
||||
custom: 'Custom',
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ export default {
|
|||
createSuccess: '创建成功',
|
||||
copy: '复制',
|
||||
copySuccess: '复制成功',
|
||||
publishStatus: '发布状态',
|
||||
published: '已发布',
|
||||
unpublished: '未发布',
|
||||
copyError: '复制失败',
|
||||
save: '保存',
|
||||
saveSuccess: '保存成功',
|
||||
|
|
@ -97,7 +100,7 @@ export default {
|
|||
notFound: {
|
||||
title: '404',
|
||||
NoService: '暂时无法访问服务',
|
||||
NoPermission:'当前用户暂无权限访问,请联系管理员',
|
||||
NoPermission: '当前用户暂无权限访问,请联系管理员',
|
||||
operate: '返回首页',
|
||||
},
|
||||
custom: '自定义',
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ export default {
|
|||
createSuccess: '創建成功',
|
||||
copy: '複製',
|
||||
copySuccess: '複製成功',
|
||||
publishStatus: '發佈狀態',
|
||||
published: '已發佈',
|
||||
unpublished: '未發佈',
|
||||
copyError: '複製失敗',
|
||||
save: '儲存',
|
||||
saveSuccess: '儲存成功',
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@
|
|||
<el-option :label="$t('common.creator')" value="create_user" />
|
||||
|
||||
<el-option :label="$t('common.name')" value="name" />
|
||||
|
||||
<el-option :label="$t('common.publishStatus')" value="publish_status" />
|
||||
</el-select>
|
||||
<el-input
|
||||
v-if="search_type === 'name'"
|
||||
|
|
@ -47,6 +49,17 @@
|
|||
>
|
||||
<el-option v-for="u in user_options" :key="u.id" :value="u.id" :label="u.nick_name" />
|
||||
</el-select>
|
||||
<el-select
|
||||
v-else-if="search_type === 'publish_status'"
|
||||
v-model="search_form.publish_status"
|
||||
@change="searchHandle"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 220px"
|
||||
>
|
||||
<el-option :label="$t('common.published')" value="published" />
|
||||
<el-option :label="$t('common.unpublished')" value="unpublished" />
|
||||
</el-select>
|
||||
</div>
|
||||
<el-dropdown trigger="click" v-if="permissionPrecise.create()">
|
||||
<el-button type="primary" class="ml-8">
|
||||
|
|
@ -333,6 +346,7 @@ const search_type = ref('name')
|
|||
const search_form = ref<any>({
|
||||
name: '',
|
||||
create_user: '',
|
||||
publish_status: undefined,
|
||||
})
|
||||
|
||||
const user_options = ref<any[]>([])
|
||||
|
|
|
|||
Loading…
Reference in New Issue