feat: 优化协作管理路径

This commit is contained in:
sudoooooo 2024-07-10 18:36:54 +08:00
parent e8e2a9ab2c
commit f82de45a03
12 changed files with 52 additions and 56 deletions

1
web/components.d.ts vendored
View File

@ -46,6 +46,7 @@ declare module 'vue' {
IEpCheck: typeof import('~icons/ep/check')['default'] IEpCheck: typeof import('~icons/ep/check')['default']
IEpCirclePlus: typeof import('~icons/ep/circle-plus')['default'] IEpCirclePlus: typeof import('~icons/ep/circle-plus')['default']
IEpClose: typeof import('~icons/ep/close')['default'] IEpClose: typeof import('~icons/ep/close')['default']
IEpConnection: typeof import('~icons/ep/connection')['default']
IEpCopyDocument: typeof import('~icons/ep/copy-document')['default'] IEpCopyDocument: typeof import('~icons/ep/copy-document')['default']
IEpDelete: typeof import('~icons/ep/delete')['default'] IEpDelete: typeof import('~icons/ep/delete')['default']
IEpIphone: typeof import('~icons/ep/iphone')['default'] IEpIphone: typeof import('~icons/ep/iphone')['default']

View File

@ -43,10 +43,13 @@
import { computed, ref, shallowRef, onMounted, watch } from 'vue' import { computed, ref, shallowRef, onMounted, watch } from 'vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import 'element-plus/theme-chalk/src/message.scss' import 'element-plus/theme-chalk/src/message.scss'
import MemberSelect from './MemberSelect.vue'
import { getPermissionList, getCollaborator, saveCollaborator } from '@/management/api/space' import { getPermissionList, getCollaborator, saveCollaborator } from '@/management/api/space'
import { type IMember, SurveyPermissions } from '@/management/utils/types/workSpace' import { type IMember, SurveyPermissions } from '@/management/utils/types/workSpace'
import { CODE_MAP } from '@/management/api/base' import { CODE_MAP } from '@/management/api/base'
import MemberSelect from './MemberSelect.vue'
const emit = defineEmits(['on-close-codify', 'onFocus', 'change', 'blur']) const emit = defineEmits(['on-close-codify', 'onFocus', 'change', 'blur'])
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{

View File

@ -1,32 +0,0 @@
<template>
<slot name="content" :onCooper="onCooper"></slot>
<CooperModify :modifyId="cooperId" :visible="cooperModify" @on-close-codify="onCooperClose" />
</template>
<script setup lang="ts">
import { ref } from 'vue'
import 'element-plus/theme-chalk/src/message.scss'
import CooperModify from '@/management/pages/list/components/CooperModify.vue';
import { useRoute } from 'vue-router';
defineSlots<{
content: (scope: { onCooper: () => void }) => any
}>();
const route = useRoute()
const surveyId = route.params?.id as string;
const cooperModify = ref<boolean>(false);
const cooperId = ref<string>('');
const onCooper = (): void => {
cooperId.value = surveyId;
cooperModify.value = true;
};
const onCooperClose = (): void => {
cooperModify.value = false;
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -8,14 +8,7 @@
<NavPanel></NavPanel> <NavPanel></NavPanel>
</div> </div>
<div class="right-group"> <div class="right-group">
<CooperationPanel> <CooperationPanel></CooperationPanel>
<template #content="{ onCooper }">
<div class="btn" @click="onCooper">
<i-ep-connection class="view-icon" :size="20" />
<span class="btn-txt">协作</span>
</div>
</template>
</CooperationPanel>
<PreviewPanel></PreviewPanel> <PreviewPanel></PreviewPanel>
<HistoryPanel></HistoryPanel> <HistoryPanel></HistoryPanel>
<SavePanel></SavePanel> <SavePanel></SavePanel>
@ -35,18 +28,12 @@ import HistoryPanel from '../modules/contentModule/HistoryPanel.vue'
import PreviewPanel from '../modules/contentModule/PreviewPanel.vue' import PreviewPanel from '../modules/contentModule/PreviewPanel.vue'
import SavePanel from '../modules/contentModule/SavePanel.vue' import SavePanel from '../modules/contentModule/SavePanel.vue'
import PublishPanel from '../modules/contentModule/PublishPanel.vue' import PublishPanel from '../modules/contentModule/PublishPanel.vue'
import CooperationPanel from './CooperationPanel.vue'; import CooperationPanel from '../modules/contentModule/CooperationPanel.vue'
const store = useStore() const store = useStore()
const title = computed(() => _get(store.state, 'edit.schema.metaData.title')) const title = computed(() => _get(store.state, 'edit.schema.metaData.title'))
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import url('@/management/styles/edit-btn.scss');
.view-icon {
font-size: 20px;
height: 29px;
line-height: 29px;
}
.nav { .nav {
width: 100%; width: 100%;
height: 56px; height: 56px;

View File

@ -0,0 +1,35 @@
<template>
<div class="btn" @click="onCooper">
<i-ep-connection class="view-icon" :size="20" />
<span class="btn-txt">协作</span>
</div>
<CooperModify :modifyId="cooperId" :visible="cooperModify" @on-close-codify="onCooperClose" />
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { useRoute } from 'vue-router'
import 'element-plus/theme-chalk/src/message.scss'
import CooperModify from '@/management/components/CooperModify/ModifyDialog.vue'
defineSlots<{
content: (scope: { onCooper: () => void }) => any
}>()
const route = useRoute()
const surveyId = route.params?.id as string
const cooperModify = ref<boolean>(false)
const cooperId = ref<string>('')
const onCooper = (): void => {
cooperId.value = surveyId
cooperModify.value = true
}
const onCooperClose = (): void => {
cooperModify.value = false
}
</script>
<style lang="scss" scoped>
@import url('@/management/styles/edit-btn.scss');
</style>

View File

@ -87,12 +87,6 @@ const closedDialog = () => {
margin-left: 75px; margin-left: 75px;
} }
.view-icon {
font-size: 20px;
height: 29px;
line-height: 29px;
}
.preview-tab { .preview-tab {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -120,6 +120,7 @@ import 'moment/locale/zh-cn'
moment.locale('zh-cn') moment.locale('zh-cn')
import EmptyIndex from '@/management/components/EmptyIndex.vue' import EmptyIndex from '@/management/components/EmptyIndex.vue'
import CooperModify from '@/management/components/CooperModify/ModifyDialog.vue'
import { CODE_MAP } from '@/management/api/base' import { CODE_MAP } from '@/management/api/base'
import { QOP_MAP } from '@/management/utils/constant.ts' import { QOP_MAP } from '@/management/utils/constant.ts'
import { deleteSurvey } from '@/management/api/survey' import { deleteSurvey } from '@/management/api/survey'
@ -130,7 +131,6 @@ import ToolBar from './ToolBar.vue'
import TextSearch from './TextSearch.vue' import TextSearch from './TextSearch.vue'
import TextSelect from './TextSelect.vue' import TextSelect from './TextSelect.vue'
import TextButton from './TextButton.vue' import TextButton from './TextButton.vue'
import CooperModify from './CooperModify.vue'
import { SurveyPermissions } from '@/management/utils/types/workSpace' import { SurveyPermissions } from '@/management/utils/types/workSpace'
import { import {

View File

@ -48,10 +48,12 @@ import { useStore } from 'vuex'
import { pick as _pick } from 'lodash-es' import { pick as _pick } from 'lodash-es'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import 'element-plus/theme-chalk/src/message.scss' import 'element-plus/theme-chalk/src/message.scss'
import { QOP_MAP } from '@/management/utils/constant' import { QOP_MAP } from '@/management/utils/constant'
import MemberSelect from './MemberSelect.vue'
import { type IMember, type IWorkspace, UserRole } from '@/management/utils/types/workSpace' import { type IMember, type IWorkspace, UserRole } from '@/management/utils/types/workSpace'
import MemberSelect from '@/management/components/CooperModify/MemberSelect.vue'
const store = useStore() const store = useStore()
const emit = defineEmits(['on-close-codify', 'onFocus', 'change', 'blur']) const emit = defineEmits(['on-close-codify', 'onFocus', 'change', 'blur'])
const props = defineProps({ const props = defineProps({

View File

@ -15,4 +15,10 @@
.btn-txt { .btn-txt {
font-size: 12px; font-size: 12px;
} }
.view-icon {
font-size: 20px;
height: 29px;
line-height: 29px;
}
} }