mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 19:42:56 +08:00
feat(移动端): 新增我的分享
This commit is contained in:
parent
9bdd96f66f
commit
90e2fa754e
@ -1,9 +1,10 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, computed, onMounted, reactive } from 'vue'
|
import { ref, computed, onMounted, reactive } from 'vue'
|
||||||
import { interactiveStoreWithOut } from '@/store/modules/interactive'
|
import { interactiveStoreWithOut } from '@/store/modules/interactive'
|
||||||
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
import { shortcutOption } from '@/views/workbranch/ShortcutOption'
|
import { shortcutOption } from '@/views/workbranch/ShortcutOption'
|
||||||
import { XpackComponent } from '@/components/plugin'
|
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
import request from '@/config/axios'
|
||||||
import VanTabs from 'vant/es/tabs'
|
import VanTabs from 'vant/es/tabs'
|
||||||
import VanTab from 'vant/es/tab'
|
import VanTab from 'vant/es/tab'
|
||||||
import VanCell from 'vant/es/cell'
|
import VanCell from 'vant/es/cell'
|
||||||
@ -16,6 +17,7 @@ import 'vant/es/cell/style'
|
|||||||
import 'vant/es/cell-group/style'
|
import 'vant/es/cell-group/style'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const { t } = useI18n()
|
||||||
|
|
||||||
const activeTab = ref('recent')
|
const activeTab = ref('recent')
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
@ -37,18 +39,27 @@ const loadTableData = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const loadShareTableData = () => {
|
||||||
|
emits('setLoading', true)
|
||||||
|
request
|
||||||
|
.post({
|
||||||
|
url: '/share/query',
|
||||||
|
data: { type: 'panel', keyword: '', asc: false }
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
state.tableData = res.data
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
emits('setLoading', false)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const tablePaneList = ref([
|
const tablePaneList = ref([
|
||||||
{ title: '最近使用', name: 'recent', disabled: false },
|
{ title: '最近使用', name: 'recent', disabled: false },
|
||||||
{ title: '我的收藏', name: 'store', disabled: false }
|
{ title: '我的收藏', name: 'store', disabled: false },
|
||||||
|
{ title: t('visualization.share_out'), name: 'share', disabled: false }
|
||||||
])
|
])
|
||||||
|
|
||||||
const panelLoad = paneInfo => {
|
|
||||||
tablePaneList.value.push({
|
|
||||||
title: paneInfo.title,
|
|
||||||
name: paneInfo.name,
|
|
||||||
disabled: tablePaneList.value[1].disabled
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const busiDataMap = computed(() => interactiveStore.getData)
|
const busiDataMap = computed(() => interactiveStore.getData)
|
||||||
|
|
||||||
const getBusiListWithPermission = () => {
|
const getBusiListWithPermission = () => {
|
||||||
@ -73,6 +84,8 @@ const handleClick = ({ name, disabled }) => {
|
|||||||
emits('setLoading', true)
|
emits('setLoading', true)
|
||||||
shortcutOption.setBusiFlag(name)
|
shortcutOption.setBusiFlag(name)
|
||||||
loadTableData()
|
loadTableData()
|
||||||
|
} else {
|
||||||
|
loadShareTableData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@ -117,11 +130,10 @@ const formatterTime = val => {
|
|||||||
:key="ele.id"
|
:key="ele.id"
|
||||||
size="large"
|
size="large"
|
||||||
:title="ele.name"
|
:title="ele.name"
|
||||||
:value="formatterTime(ele.lastEditTime)"
|
:value="formatterTime(ele.lastEditTime || ele.time)"
|
||||||
icon="bar-chart-o"
|
icon="bar-chart-o"
|
||||||
/>
|
/>
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
<div style="width: 100%; height: 50px"></div>
|
<div style="width: 100%; height: 50px"></div>
|
||||||
<XpackComponent jsname="c2hhcmUtcGFuZWw=" @loaded="panelLoad" />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user