feat: add type search option and improve select input formatting
parent
71cec2fca4
commit
15c4274294
|
|
@ -15,9 +15,10 @@
|
||||||
style="width: 120px"
|
style="width: 120px"
|
||||||
@change="search_type_change"
|
@change="search_type_change"
|
||||||
>
|
>
|
||||||
<el-option :label="$t('common.creator')" value="create_user" />
|
<el-option :label="$t('common.creator')" value="create_user"/>
|
||||||
|
|
||||||
<el-option :label="$t('common.name')" value="name" />
|
<el-option :label="$t('common.name')" value="name"/>
|
||||||
|
<el-option :label="$t('views.system.resource_management.type')" value="type"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-input
|
<el-input
|
||||||
v-if="search_type === 'name'"
|
v-if="search_type === 'name'"
|
||||||
|
|
@ -35,7 +36,17 @@
|
||||||
filterable
|
filterable
|
||||||
style="width: 220px"
|
style="width: 220px"
|
||||||
>
|
>
|
||||||
<el-option v-for="u in user_options" :key="u.id" :value="u.id" :label="u.nick_name" />
|
<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 === 'type'"
|
||||||
|
v-model="search_form.type"
|
||||||
|
@change="getList"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
style="width: 220px"
|
||||||
|
>
|
||||||
|
<el-option v-for="u in type_options" :value="u.value" :label="u.label"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -53,7 +64,7 @@
|
||||||
<div class="table-name flex align-center">
|
<div class="table-name flex align-center">
|
||||||
<el-icon size="24" class="mr-8">
|
<el-icon size="24" class="mr-8">
|
||||||
<el-avatar shape="square" :size="24" style="background: none" class="mr-8">
|
<el-avatar shape="square" :size="24" style="background: none" class="mr-8">
|
||||||
<img :src="resetUrl(scope.row?.icon)" alt="" />
|
<img :src="resetUrl(scope.row?.icon)" alt=""/>
|
||||||
</el-avatar>
|
</el-avatar>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
{{ scope.row.name }}
|
{{ scope.row.name }}
|
||||||
|
|
@ -93,7 +104,7 @@
|
||||||
@click="statusVisible = !statusVisible"
|
@click="statusVisible = !statusVisible"
|
||||||
>
|
>
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<Filter />
|
<Filter/>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -116,10 +127,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
<el-button size="small" @click="filterStatusChange('clear')"
|
<el-button size="small" @click="filterStatusChange('clear')"
|
||||||
>{{ $t('common.clear') }}
|
>{{ $t('common.clear') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" @click="filterStatusChange" size="small"
|
<el-button type="primary" @click="filterStatusChange" size="small"
|
||||||
>{{ $t('common.confirm') }}
|
>{{ $t('common.confirm') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
|
|
@ -128,7 +139,7 @@
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div v-if="scope.row.is_publish" class="flex align-center">
|
<div v-if="scope.row.is_publish" class="flex align-center">
|
||||||
<el-icon class="color-success mr-8" style="font-size: 16px">
|
<el-icon class="color-success mr-8" style="font-size: 16px">
|
||||||
<SuccessFilled />
|
<SuccessFilled/>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<span class="color-text-primary">
|
<span class="color-text-primary">
|
||||||
{{ $t('views.application.status.published') }}
|
{{ $t('views.application.status.published') }}
|
||||||
|
|
@ -161,7 +172,7 @@
|
||||||
@click="workspaceVisible = !workspaceVisible"
|
@click="workspaceVisible = !workspaceVisible"
|
||||||
>
|
>
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<Filter />
|
<Filter/>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -187,16 +198,16 @@
|
||||||
/>
|
/>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
<el-empty v-else :description="$t('common.noData')" />
|
<el-empty v-else :description="$t('common.noData')"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
<el-button size="small" @click="filterWorkspaceChange('clear')"
|
<el-button size="small" @click="filterWorkspaceChange('clear')"
|
||||||
>{{ $t('common.clear') }}
|
>{{ $t('common.clear') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" @click="filterWorkspaceChange" size="small"
|
<el-button type="primary" @click="filterWorkspaceChange" size="small"
|
||||||
>{{ $t('common.confirm') }}
|
>{{ $t('common.confirm') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
|
|
@ -204,7 +215,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column prop="nick_name" :label="$t('common.creator')" show-overflow-tooltip />
|
<el-table-column prop="nick_name" :label="$t('common.creator')" show-overflow-tooltip/>
|
||||||
<el-table-column :label="$t('views.application.publishTime')" width="180">
|
<el-table-column :label="$t('views.application.publishTime')" width="180">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ datetimeFormat(row.update_time) }}
|
{{ datetimeFormat(row.update_time) }}
|
||||||
|
|
@ -299,23 +310,24 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref, reactive, computed, watch } from 'vue'
|
import {onMounted, ref, reactive, computed, watch} from 'vue'
|
||||||
import { useRouter, useRoute } from 'vue-router'
|
import {useRouter, useRoute} from 'vue-router'
|
||||||
import ApplicationResourceApi from '@/api/system-resource-management/application'
|
import ApplicationResourceApi from '@/api/system-resource-management/application'
|
||||||
import ResourceAuthorizationDrawer from '@/components/resource-authorization-drawer/index.vue'
|
import ResourceAuthorizationDrawer from '@/components/resource-authorization-drawer/index.vue'
|
||||||
import { t } from '@/locales'
|
import {t} from '@/locales'
|
||||||
import { isAppIcon, resetUrl } from '@/utils/common'
|
import {isAppIcon, resetUrl} from '@/utils/common'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
import { datetimeFormat } from '@/utils/time'
|
import {datetimeFormat} from '@/utils/time'
|
||||||
import { loadPermissionApi } from '@/utils/dynamics-api/permission-api.ts'
|
import {loadPermissionApi} from '@/utils/dynamics-api/permission-api.ts'
|
||||||
import { isWorkFlow } from '@/utils/application.ts'
|
import {isWorkFlow} from '@/utils/application.ts'
|
||||||
import UserApi from '@/api/user/user.ts'
|
import UserApi from '@/api/user/user.ts'
|
||||||
import permissionMap from '@/permission'
|
import permissionMap from '@/permission'
|
||||||
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'
|
import {MsgSuccess, MsgConfirm, MsgError} from '@/utils/message'
|
||||||
import { SourceTypeEnum } from '@/enums/common'
|
import {SourceTypeEnum} from '@/enums/common'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const { user, application } = useStore()
|
const {user, application} = useStore()
|
||||||
|
|
||||||
const permissionPrecise = computed(() => {
|
const permissionPrecise = computed(() => {
|
||||||
return permissionMap['application']['systemManage']
|
return permissionMap['application']['systemManage']
|
||||||
|
|
@ -340,31 +352,33 @@ const MoreFilledPermission = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const ResourceAuthorizationDrawerRef = ref()
|
const ResourceAuthorizationDrawerRef = ref()
|
||||||
|
|
||||||
function openAuthorization(item: any) {
|
function openAuthorization(item: any) {
|
||||||
ResourceAuthorizationDrawerRef.value.open(item.id)
|
ResourceAuthorizationDrawerRef.value.open(item.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
const apiInputParams = ref([])
|
const apiInputParams = ref([])
|
||||||
|
|
||||||
function toChat(row: any) {
|
function toChat(row: any) {
|
||||||
row?.work_flow?.nodes
|
row?.work_flow?.nodes
|
||||||
?.filter((v: any) => v.id === 'base-node')
|
?.filter((v: any) => v.id === 'base-node')
|
||||||
.map((v: any) => {
|
.map((v: any) => {
|
||||||
apiInputParams.value = v.properties.api_input_field_list
|
apiInputParams.value = v.properties.api_input_field_list
|
||||||
? v.properties.api_input_field_list.map((v: any) => {
|
? v.properties.api_input_field_list.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
name: v.variable,
|
name: v.variable,
|
||||||
value: v.default_value,
|
value: v.default_value,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
: v.properties.input_field_list
|
: v.properties.input_field_list
|
||||||
? v.properties.input_field_list
|
? v.properties.input_field_list
|
||||||
.filter((v: any) => v.assignment_method === 'api_input')
|
.filter((v: any) => v.assignment_method === 'api_input')
|
||||||
.map((v: any) => {
|
.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
name: v.variable,
|
name: v.variable,
|
||||||
value: v.default_value,
|
value: v.default_value,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
: []
|
: []
|
||||||
})
|
})
|
||||||
const apiParams = mapToUrlParams(apiInputParams.value)
|
const apiParams = mapToUrlParams(apiInputParams.value)
|
||||||
|
|
@ -402,7 +416,8 @@ function deleteApplication(row: any) {
|
||||||
MsgSuccess(t('common.deleteSuccess'))
|
MsgSuccess(t('common.deleteSuccess'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportApplication = (application: any) => {
|
const exportApplication = (application: any) => {
|
||||||
|
|
@ -419,9 +434,19 @@ const search_type = ref('name')
|
||||||
const search_form = ref<any>({
|
const search_form = ref<any>({
|
||||||
name: '',
|
name: '',
|
||||||
create_user: '',
|
create_user: '',
|
||||||
|
type: '',
|
||||||
})
|
})
|
||||||
const user_options = ref<any[]>([])
|
const user_options = ref<any[]>([])
|
||||||
|
const type_options = ref<any[]>([
|
||||||
|
{
|
||||||
|
label: t('views.application.workflow'),
|
||||||
|
value: 'WORK_FLOW',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('views.application.simple'),
|
||||||
|
value: 'SIMPLE',
|
||||||
|
},
|
||||||
|
])
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const applicationList = ref<any[]>([])
|
const applicationList = ref<any[]>([])
|
||||||
const paginationConfig = reactive({
|
const paginationConfig = reactive({
|
||||||
|
|
@ -459,7 +484,7 @@ watch(
|
||||||
v.label.toLowerCase().includes(filterText.value.toLowerCase()),
|
v.label.toLowerCase().includes(filterText.value.toLowerCase()),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
{ immediate: true },
|
{immediate: true},
|
||||||
)
|
)
|
||||||
|
|
||||||
function filterWorkspaceChange(val: string) {
|
function filterWorkspaceChange(val: string) {
|
||||||
|
|
@ -490,7 +515,7 @@ async function getWorkspaceList() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const search_type_change = () => {
|
const search_type_change = () => {
|
||||||
search_form.value = { name: '', create_user: '' }
|
search_form.value = {name: '', create_user: '', type: ''}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getList() {
|
function getList() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue