|
@@ -5,7 +5,8 @@ import { SheetApi } from '@/request/api';
|
|
|
import sheet from '@/components/sheet.vue'
|
|
|
import { isMobile } from '@/utils/utils';
|
|
|
import { IUnknowObject } from '@/types';
|
|
|
-import { ElMessage } from 'element-plus';
|
|
|
+import { ElMessage, valueEquals } from 'element-plus';
|
|
|
+import NoAuth from '@/components/noAuth.vue';
|
|
|
|
|
|
const route = useRoute();
|
|
|
const code = ref(route.query.code || '')
|
|
@@ -33,23 +34,28 @@ const setDefaultSource=(sourceText:string)=>{
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+const haveAuth = ref(true)
|
|
|
const getInfo = async(type='') => {
|
|
|
loading.value = true;
|
|
|
const { Data,Ret } = await SheetApi.getInfo({
|
|
|
UniqueCode: code.value,
|
|
|
FromScene: Number(route.query.fromScene||''),
|
|
|
ReferencedId: Number(route.query.sourceId||''),
|
|
|
- Uuid: (route.query.uid as string)||""
|
|
|
+ Uuid: (route.query.uid as string)||"",
|
|
|
+ AuthToken: route.query?.authToken as string || ''
|
|
|
});
|
|
|
|
|
|
loading.value = false;
|
|
|
if(Ret !== 200) return
|
|
|
|
|
|
info.value = Data;
|
|
|
+ haveAuth.value = Data.IsAuth;
|
|
|
+ showData.value = true;
|
|
|
+
|
|
|
+ if(!Data.IsAuth) return
|
|
|
if(!info.value.SourcesFrom){
|
|
|
info.value.SourcesFrom = Data.ExcelSource?setDefaultSource(Data.ExcelSource):''
|
|
|
}
|
|
|
- showData.value = true;
|
|
|
type==='refresh'&&ElMessage.success('刷新成功')
|
|
|
type!=='refresh'&&nextTick(() => {
|
|
|
updateToHeight()
|
|
@@ -90,29 +96,31 @@ const refreshSheet = async()=>{
|
|
|
element-loading-text="加载中..."
|
|
|
>
|
|
|
<!-- <h3 class="title">{{info.ExcelName}}</h3> -->
|
|
|
-
|
|
|
- <sheet
|
|
|
- :data="info.TableInfo.TableDataList"
|
|
|
- :config="info.Config"
|
|
|
- :sceneConfig="info.ReferencedExcelConfig"
|
|
|
- />
|
|
|
- <div class="tool sheet-bottom">
|
|
|
- <div class="sheet-source"
|
|
|
- v-if="info.SourcesFrom&&JSON.parse(info.SourcesFrom).isShow"
|
|
|
- :style="`
|
|
|
- color: ${ JSON.parse(info.SourcesFrom).color };
|
|
|
- font-size: ${ JSON.parse(info.SourcesFrom).fontSize }px;
|
|
|
- `"
|
|
|
- >
|
|
|
- source:<em>{{ JSON.parse(info.SourcesFrom).text}}</em>
|
|
|
- </div>
|
|
|
- <!-- 占位 -->
|
|
|
- <div v-else></div>
|
|
|
- <div class="right-btns">
|
|
|
- <span @click="updateToHeight('update')" v-if="route.query.sourceId&&!isMobile()">更新样式</span>
|
|
|
- <span @click="refreshSheet">刷新</span>
|
|
|
+ <template v-if="haveAuth">
|
|
|
+ <sheet
|
|
|
+ :data="info.TableInfo.TableDataList"
|
|
|
+ :config="info.Config"
|
|
|
+ :sceneConfig="info.ReferencedExcelConfig"
|
|
|
+ />
|
|
|
+ <div class="tool sheet-bottom">
|
|
|
+ <div class="sheet-source"
|
|
|
+ v-if="info.SourcesFrom&&JSON.parse(info.SourcesFrom).isShow"
|
|
|
+ :style="`
|
|
|
+ color: ${ JSON.parse(info.SourcesFrom).color };
|
|
|
+ font-size: ${ JSON.parse(info.SourcesFrom).fontSize }px;
|
|
|
+ `"
|
|
|
+ >
|
|
|
+ source:<em>{{ JSON.parse(info.SourcesFrom).text}}</em>
|
|
|
+ </div>
|
|
|
+ <!-- 占位 -->
|
|
|
+ <div v-else></div>
|
|
|
+ <div class="right-btns">
|
|
|
+ <span @click="updateToHeight('update')" v-if="route.query.sourceId&&!isMobile()">更新样式</span>
|
|
|
+ <span @click="refreshSheet">刷新</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </template>
|
|
|
+ <NoAuth v-else/>
|
|
|
</div>
|
|
|
</template>
|
|
|
|