空间管理样式调整 (#441)

* feat: 空间编辑保存名字同步

* feat: 团队空间空数据隐藏分页器

* feat: 问卷列表添加协作者输入为空时不发接口请求

* feat: 管理团队文字对齐向左

* feat: 团队空间编辑保存名字同步

* feat: 隐藏校验框border

* feat: 问卷列表添加协作者为空时不触发请求

* feat: 隐藏协作管理搜索框校验边框样式

---------

Co-authored-by: jiangchunfu <jiangchunfu@kaike.la>
This commit is contained in:
Jiangchunfu 2024-10-31 18:00:03 +08:00 committed by GitHub
parent f6202d4f91
commit 20f01768cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 110 additions and 66 deletions

View File

@ -3,6 +3,7 @@
<el-select-v2 <el-select-v2
v-model="value" v-model="value"
filterable filterable
class="search-name"
remote remote
:remote-method="remoteMethod" :remote-method="remoteMethod"
clearable clearable
@ -58,7 +59,8 @@ const value = ref('')
const selectOptions = ref<ListItem[]>([]) const selectOptions = ref<ListItem[]>([])
const loading = ref(false) const loading = ref(false)
const remoteMethod = async (query: string) => { const remoteMethod = async (q: string) => {
const query = q.trim()
if (query !== '') { if (query !== '') {
loading.value = true loading.value = true
const res: any = await getUserList(query) const res: any = await getUserList(query)

View File

@ -115,6 +115,9 @@ const rules = {
{ {
trigger: 'change', trigger: 'change',
validator: (rule: any, value: IMember[], callback: Function) => { validator: (rule: any, value: IMember[], callback: Function) => {
if (value.length === 0) {
callback('请添加协作者')
}
if (value.filter((item: IMember) => !item.role.length).length) { if (value.filter((item: IMember) => !item.role.length).length) {
callback('请设置协作者对应权限') callback('请设置协作者对应权限')
} }
@ -186,8 +189,18 @@ const handleMembersChange = (val: IMember[]) => {
} }
</script> </script>
<style lang="scss" rel="lang/scss" scoped> <style lang="scss" scoped>
.base-form-root { .base-form-root {
padding: 20px; padding: 20px;
:deep(.list-wrapper .el-select) {
.el-select__placeholder {
text-align: right;
}
}
}
:deep(.el-form-item.is-error .search-name .el-select__wrapper) {
box-shadow: 0 0 0 1px var(--el-border-color) inset;
} }
</style> </style>

View File

@ -125,6 +125,11 @@ const handleCheckAll = (val: CheckboxValueType) => {
:deep(.el-select__wrapper) { :deep(.el-select__wrapper) {
border: none; border: none;
box-shadow: none; box-shadow: none;
&:hover,
&:focus {
border: none;
box-shadow: none;
}
} }
:deep(.ishovering) { :deep(.ishovering) {
border: none; border: none;
@ -134,11 +139,11 @@ const handleCheckAll = (val: CheckboxValueType) => {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
} }
.operation-select { // .operation-select {
:deep(.el-select__placeholder) { // :deep(.el-select__placeholder) {
text-align: right; // text-align: right;
} // }
} // }
} }
</style> </style>
<style lang="scss"> <style lang="scss">

View File

@ -2,71 +2,75 @@
<div class="search"> <div class="search">
<TextSearch placeholder="请输入空间名称" :value="searchVal" @search="onSearchText" /> <TextSearch placeholder="请输入空间名称" :value="searchVal" @search="onSearchText" />
</div> </div>
<div class="list-wrap" v-if="props.total > 0"> <template v-if="total > 0">
<el-table <div class="list-wrap">
ref="multipleListTable" <el-table
class="list-table" ref="multipleListTable"
:data="data" class="list-table"
empty-text="暂无数据" :data="data"
row-key="_id" empty-text="暂无数据"
header-row-class-name="tableview-header" row-key="_id"
row-class-name="tableview-row" header-row-class-name="tableview-header"
cell-class-name="tableview-cell" row-class-name="tableview-row"
v-loading="loading" cell-class-name="tableview-cell"
:height="550" v-loading="loading"
style="width: 100%" :height="550"
> style="width: 100%"
<el-table-column column-key="space" width="20" />
<el-table-column
v-for="field in fieldList"
:key="(field as any)?.key"
:label="(field as any).title"
:column-key="(field as any).key"
:width="(field as any).width"
:min-width="(field as any).width || (field as any).minWidth"
class-name="link"
> >
<template #default="scope"> <el-table-column column-key="space" width="20" />
<template v-if="(field as any).comp"> <el-table-column
<component :is="(field as any).comp" type="table" :value="scope.row" /> v-for="field in fieldList"
:key="(field as any)?.key"
:label="(field as any).title"
:column-key="(field as any).key"
:width="(field as any).width"
:min-width="(field as any).width || (field as any).minWidth"
class-name="link"
>
<template #default="scope">
<template v-if="(field as any).comp">
<component :is="(field as any).comp" type="table" :value="scope.row" />
</template>
<template v-else>
<span class="cell-span">{{ scope.row[(field as any).key] }}</span>
</template>
</template> </template>
<template v-else> </el-table-column>
<span class="cell-span">{{ scope.row[(field as any).key] }}</span> <el-table-column
label="操作"
:width="200"
label-class-name="operation"
class-name="table-options"
>
<template #default="scope">
<div class="space-tool-bar">
<ToolBar
:data="scope.row"
:tool-width="50"
:tools="getTools(scope.row)"
@click="handleClick"
/>
</div>
</template> </template>
</template> </el-table-column>
</el-table-column> </el-table>
<el-table-column </div>
label="操作" <div class="list-pagination">
:width="200" <el-pagination
label-class-name="operation" v-model:current-page="curPage"
class-name="table-options" background
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="props.total"
> >
<template #default="scope"> </el-pagination>
<div class="space-tool-bar"> </div>
<ToolBar </template>
:data="scope.row"
:tool-width="50"
:tools="getTools(scope.row)"
@click="handleClick"
/>
</div>
</template>
</el-table-column>
</el-table>
</div>
<div v-else> <div v-else>
<EmptyIndex :data="!searchVal ? noSpaceDataConfig : noSpaceSearchDataConfig" /> <EmptyIndex :data="!searchVal ? noSpaceDataConfig : noSpaceSearchDataConfig" />
</div> </div>
<div class="list-pagination">
<el-pagination
v-model:current-page="curPage"
background
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="props.total"
>
</el-pagination>
</div>
<SpaceModify <SpaceModify
v-if="showSpaceModify" v-if="showSpaceModify"
:type="modifyType" :type="modifyType"

View File

@ -55,7 +55,7 @@ import { useWorkSpaceStore } from '@/management/stores/workSpace'
import MemberSelect from '@/management/components/CooperModify/MemberSelect.vue' import MemberSelect from '@/management/components/CooperModify/MemberSelect.vue'
const workSpaceStore = useWorkSpaceStore() const workSpaceStore = useWorkSpaceStore()
const emit = defineEmits(['on-close-codify', 'onFocus', 'change', 'blur']) const emit = defineEmits(['on-close-codify', 'onFocus', 'change', 'blur', 'updateData'])
const props = defineProps({ const props = defineProps({
type: String, type: String,
width: String, width: String,
@ -128,6 +128,7 @@ const onConfirm = async () => {
} else { } else {
try { try {
await handleUpdate() await handleUpdate()
emit('updateData', formModel.value)
emit('on-close-codify', 'update') emit('on-close-codify', 'update')
} catch (err) { } catch (err) {
ElMessage.error('createSpace status err' + err) ElMessage.error('createSpace status err' + err)

View File

@ -55,6 +55,7 @@
:type="modifyType" :type="modifyType"
:visible="showSpaceModify" :visible="showSpaceModify"
@on-close-codify="onCloseModify" @on-close-codify="onCloseModify"
@update-data="onCloseModifyInTeamWork"
/> />
</div> </div>
</template> </template>
@ -71,6 +72,7 @@ import TopNav from '@/management/components/TopNav.vue'
import { SpaceType } from '@/management/utils/workSpace' import { SpaceType } from '@/management/utils/workSpace'
import { useWorkSpaceStore } from '@/management/stores/workSpace' import { useWorkSpaceStore } from '@/management/stores/workSpace'
import { useSurveyListStore } from '@/management/stores/surveyList' import { useSurveyListStore } from '@/management/stores/surveyList'
import { type IWorkspace } from '@/management/utils/workSpace'
const workSpaceStore = useWorkSpaceStore() const workSpaceStore = useWorkSpaceStore()
const surveyListStore = useSurveyListStore() const surveyListStore = useSurveyListStore()
@ -149,6 +151,23 @@ const onSetGroup = async () => {
showSpaceModify.value = true showSpaceModify.value = true
} }
const onCloseModifyInTeamWork = (data: IWorkspace) => {
if (spaceType.value === SpaceType.Teamwork) {
const currentData = workSpaceList.value.find((item) => item._id === data._id)
if (currentData) {
currentData.name = data.name
currentData.memberTotal = data.members.length
currentData.description = data.description
}
const currentMenus: any = spaceMenus.value?.[1]?.children?.find(
(item: { id: string; name: string }) => item.id === data._id
)
if (currentMenus) {
currentMenus.name = data.name
}
}
}
const onCloseModify = (type: string) => { const onCloseModify = (type: string) => {
showSpaceModify.value = false showSpaceModify.value = false
if (type === 'update' && spaceListRef.value) { if (type === 'update' && spaceListRef.value) {