|
|
@ -1,8 +1,8 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="upload"> |
|
|
<view class="upload"> |
|
|
<u-icon |
|
|
<u-icon |
|
|
name="plus" |
|
|
name="plus" |
|
|
size="24px" |
|
|
size="24px" |
|
|
class="flex justify-center w-12 h-12 bg-blue-100 rounded-full shadow-md" |
|
|
class="flex justify-center w-12 h-12 bg-blue-100 rounded-full shadow-md" |
|
|
@click="handleUpload" |
|
|
@click="handleUpload" |
|
|
></u-icon> |
|
|
></u-icon> |
|
|
@ -14,11 +14,16 @@ |
|
|
import { useStore } from 'vuex'; |
|
|
import { useStore } from 'vuex'; |
|
|
import Config from '@/common/js/config.js'; |
|
|
import Config from '@/common/js/config.js'; |
|
|
|
|
|
|
|
|
const emit = defineEmits(['success', 'error']); |
|
|
|
|
|
|
|
|
|
|
|
const store = useStore(); |
|
|
const store = useStore(); |
|
|
const userId = computed(() => store.getters['user/userId']); |
|
|
const list = ref([]); |
|
|
const list = ref([]); |
|
|
const emit = defineEmits(['success', 'error']); |
|
|
|
|
|
const user = computed(() => store.state.user.user); |
|
|
|
|
|
const userJson = uni.$storage.getStorageSync('user'); |
|
|
|
|
|
|
|
|
|
|
|
if (userJson) { |
|
|
|
|
|
const user = JSON.parse(userJson); |
|
|
|
|
|
store.commit('user/setUser', user); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
getList(); |
|
|
getList(); |
|
|
|
|
|
|
|
|
@ -41,13 +46,13 @@ |
|
|
const res = await uni.$u.api.import(); |
|
|
const res = await uni.$u.api.import(); |
|
|
// 导入WBS成功后 |
|
|
// 导入WBS成功后 |
|
|
// 直接打开导入的项目 |
|
|
// 直接打开导入的项目 |
|
|
// emit('success'); |
|
|
emit('success'); |
|
|
// const { apiUrl } = Config; |
|
|
const { apiUrl } = Config; |
|
|
// const defaultwbs = `${apiUrl}/defaultwbs`; |
|
|
const defaultwbs = `${apiUrl}/defaultwbs`; |
|
|
// res.url && (defaultwbs = res.url); |
|
|
res.url && (defaultwbs = res.url); |
|
|
// setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
// uni.navigateTo({ url: `/pages/project/project?u=${userId.value}&p=${res.id}&pname=${res.pname}&url=${res.url}` }); |
|
|
uni.navigateTo({ url: `/pages/project/project?u=${user.value.id}&p=${res.id}&pname=${res.name}&url=${encodeURIComponent(res.url)}` }); |
|
|
// }, 2000); |
|
|
}, 2000); |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.error('error: ', error); |
|
|
console.error('error: ', error); |
|
|
emit('error', error); |
|
|
emit('error', error); |
|
|
|