空间管理样式调整 (#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,7 +2,8 @@
<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">
<div class="list-wrap">
<el-table <el-table
ref="multipleListTable" ref="multipleListTable"
class="list-table" class="list-table"
@ -54,9 +55,6 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div v-else>
<EmptyIndex :data="!searchVal ? noSpaceDataConfig : noSpaceSearchDataConfig" />
</div>
<div class="list-pagination"> <div class="list-pagination">
<el-pagination <el-pagination
v-model:current-page="curPage" v-model:current-page="curPage"
@ -67,6 +65,12 @@
> >
</el-pagination> </el-pagination>
</div> </div>
</template>
<div v-else>
<EmptyIndex :data="!searchVal ? noSpaceDataConfig : noSpaceSearchDataConfig" />
</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) {