Browse Source

feat: 表格修改

master
betaqi 1 week ago
parent
commit
bcf028f2db
  1. 1
      .env.development
  2. 1
      .env.production
  3. 46
      src/pages/fileDoc/index.vue
  4. 3
      src/pages/layout.vue

1
.env.development

@ -1,2 +1,3 @@ @@ -1,2 +1,3 @@
VITE_BASE_URL = 'http://192.168.1.3:48081'
VITE_SOCKET_SERVER = 'http://192.168.1.3:48081'
VITE_DOC_URL = 'http://192.168.1.3:5181'

1
.env.production

@ -1,2 +1,3 @@ @@ -1,2 +1,3 @@
VITE_BASE_URL = 'http://192.168.1.3:48081'
VITE_SOCKET_SERVER = 'http://192.168.1.3:48081'
VITE_DOC_URL = 'http://62.234.18.176:5181'

46
src/pages/fileDoc/index.vue

@ -129,8 +129,9 @@ @@ -129,8 +129,9 @@
v-if="listLayout === 'list'"
:data="dataList"
@row-click="onFileOpen"
:usePaging="false"
>
<template v-for="(col, idx) in folderCol" :key="idx">
<template v-for="(col, idx) in tabColumn" :key="idx">
<el-table-column :label="col.label" :prop="col.prop" v-if="col.prop === 'name'">
<template #default="scope">
<template v-if="scope.row.isEdit">
@ -152,12 +153,43 @@ @@ -152,12 +153,43 @@
</div>
</template>
</el-table-column>
<el-table-column
:label="col.label"
:prop="col.prop"
v-else-if="col.prop === 'type'"
>
<template #default="scope">
<div style="display: flex; align-items: center">
<img
:src="
scope.row.type === floeType.folder
? Folder
: scope.row.isDraft === 0
? Document
: Document2
"
width="18"
height="18"
/>
{{ scope.row.type === floeType.folder ? '文件夹' : '文档' }}
</div>
</template>
</el-table-column>
<el-table-column
:label="col.label"
:prop="col.prop"
v-else-if="col.prop === 'isDraft'"
>
<template #default="scope">
{{ scope.row[col.prop] === 0 ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column :label="col.label" :prop="col.prop" v-else />
</template>
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button
v-if="!(isRootMd && scope.row.type === floeType.file)"
v-if="!(currentFolderId === 0 && scope.row.type === floeType.file)"
type="danger"
link
@click.stop="onCommand('delete', scope.row)"
@ -218,6 +250,7 @@ import { Icon } from '@/components/dashboard/Icon' @@ -218,6 +250,7 @@ import { Icon } from '@/components/dashboard/Icon'
import EdfsContextMenu from '@/components/dashboard/Edfs-context-menu/index.vue'
import markdownDrawer from './components/markdownDrawer.vue'
import { useIcon } from '@/utils/useIcon'
import { cloneDeep } from 'lodash'
const listIcons = useIcon({ icon: 'gravity-ui:layout-list' })
const cardIcons = useIcon({ icon: 'gravity-ui:credit-card' })
@ -248,6 +281,15 @@ watch( @@ -248,6 +281,15 @@ watch(
}
)
const tabColumn = computed(() => {
const col = cloneDeep(folderCol)
if (currentFolderId.value === 0 && listLayout.value === 'list') {
debugger
return col.filter(v => v.prop !== 'isDraft')
}
return col
})
const isRootMd = computed(
() => currentMenu.value?.type === floeType.file && currentFolderId.value === 0
)

3
src/pages/layout.vue

@ -130,6 +130,7 @@ provide(THEME_KEY, theme) @@ -130,6 +130,7 @@ provide(THEME_KEY, theme)
provide(INIT_OPTIONS_KEY, {
devicePixelRatio: 2,
})
const VITE_DOC_URL = import.meta.env.VITE_DOC_URL
const Sunny = useIcon({
icon: 'line-md:moon-filled-to-sunny-filled-loop-transition',
@ -228,7 +229,7 @@ const menuSwitch = () => { @@ -228,7 +229,7 @@ const menuSwitch = () => {
}
const menuClick = (index: string) => {
if (index === '/OnlineDocument') {
window.open('http://192.168.1.3:5181/', '_blank')
window.open(VITE_DOC_URL, '_blank')
return
}
activeIndex.value = index

Loading…
Cancel
Save