|
@@ -5,6 +5,7 @@ import apiSheet from '@/api/sheet'
|
|
|
import { useWindowSize } from '@vueuse/core'
|
|
|
import { showToast, showDialog } from "vant";
|
|
|
import {usePublicSettingStore} from '@/store/modules/publicSetting'
|
|
|
+import {getStaticImg} from '@/hooks/common.js'
|
|
|
const publicSettingStore = usePublicSettingStore()
|
|
|
// import { useDownLoadFile } from '@/hooks/useDownLoadFile'
|
|
|
const { appContext : { config: { globalProperties } } } = getCurrentInstance();
|
|
@@ -17,15 +18,24 @@ const link = ref(publicSettingStore.publicSetting.ChartViewUrl);
|
|
|
let showMoreAction = ref(false)
|
|
|
let showPicker = ref(false)
|
|
|
let showVersionPicker = ref(false)
|
|
|
+const chartList = ref([])
|
|
|
const sheetActions = computed(() => {
|
|
|
- return [
|
|
|
- { label: globalProperties.$t('shared_table.refresh'), types:'flushed'},
|
|
|
- { label: globalProperties.$t('shared_table.download'), types:'download'},
|
|
|
- { label: globalProperties.$t('shared_table.delete'), types:'delete'},
|
|
|
- { label: globalProperties.$t('shared_table.cancel'), types:'cancel'},
|
|
|
+ const list = [
|
|
|
+ { label: globalProperties.$t('shared_table.refresh'), types:'flushed', src: getStaticImg('table/flushed.png') },
|
|
|
+ { label: globalProperties.$t('shared_table.download'), types:'download', src: getStaticImg('table/download.png')},
|
|
|
+ { label: globalProperties.$t('shared_table.delete'), types:'delete', src: getStaticImg('table/delete.png')},
|
|
|
]
|
|
|
+ if (chartList.value && chartList.value.length > 0) list.unshift({ label: globalProperties.$t('shared_table.chart'), types:'chart', src: getStaticImg('table/chart.png')})
|
|
|
+ return list
|
|
|
})
|
|
|
-
|
|
|
+const customFieldName = {
|
|
|
+ text: 'ExcelName',
|
|
|
+ value: 'ExcelInfoId',
|
|
|
+};
|
|
|
+const customVersionFieldName = {
|
|
|
+ text: 'VersionName',
|
|
|
+ value: 'UniqueCode',
|
|
|
+};
|
|
|
const downExcelFileUrl = computed(() => {
|
|
|
let url = `${
|
|
|
import.meta.env.VITE_APP_API_URL
|
|
@@ -34,14 +44,13 @@ const downExcelFileUrl = computed(() => {
|
|
|
})
|
|
|
|
|
|
onMounted(() => {
|
|
|
- getExcelDetail( 'load' )
|
|
|
getVersionList()
|
|
|
getChildTable()
|
|
|
})
|
|
|
//获取表格列表
|
|
|
async function getExcelDetail( source = 'refresh', ExcelInfoId = '' ){
|
|
|
const detailReq = {
|
|
|
- ExcelInfoId: route.query.id,
|
|
|
+ ExcelInfoId: ExcelInfoId,
|
|
|
}
|
|
|
if(source==='delete') detailReq.ExcelInfoId = ExcelInfoId
|
|
|
const res = await apiSheet.excelDetail(detailReq)
|
|
@@ -50,11 +59,21 @@ async function getExcelDetail( source = 'refresh', ExcelInfoId = '' ){
|
|
|
queryData.value = res.Data
|
|
|
}
|
|
|
|
|
|
+// 获取关联图库列表
|
|
|
+
|
|
|
+async function getChartList(ExcelInfoId){
|
|
|
+ const res = await apiSheet.getBalanceChartData({
|
|
|
+ ExcelInfoId
|
|
|
+ })
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ chartList.value = res.Data.List||[]
|
|
|
+}
|
|
|
+
|
|
|
//更多操作
|
|
|
function handleActionClick(item){
|
|
|
switch(item.types){
|
|
|
case 'flushed':
|
|
|
- getExcelDetail( 'refresh' )
|
|
|
+ getChildTable()
|
|
|
showMoreAction.value = false
|
|
|
break;
|
|
|
case 'download':
|
|
@@ -79,8 +98,8 @@ function handleActionClick(item){
|
|
|
})
|
|
|
}).catch(()=>{})
|
|
|
break;
|
|
|
- case 'cancel':
|
|
|
- showMoreAction.value = false
|
|
|
+ case 'chart':
|
|
|
+ goChart()
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -201,8 +220,8 @@ const columns = [
|
|
|
];
|
|
|
const versionOpts = ref([])
|
|
|
const childTableOpts = ref([])
|
|
|
-const fieldValue = ref('平衡表');
|
|
|
-const fieldValueVersion = ref('平衡表');
|
|
|
+const fieldValue = ref('表格名');
|
|
|
+const fieldValueVersion = ref('版本');
|
|
|
|
|
|
// 平衡表获取版本列表
|
|
|
function getVersionList(){
|
|
@@ -220,6 +239,8 @@ function getChildTable(){
|
|
|
if(res.Ret === 200){
|
|
|
const arr = res.Data.List || []
|
|
|
childTableOpts.value = arr
|
|
|
+ getExcelDetail( 'load', arr[0] ? arr[0].ExcelInfoId : route.query.id)
|
|
|
+ getChartList(arr[0] ? arr[0].ExcelInfoId : route.query.id)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -227,13 +248,15 @@ function getChildTable(){
|
|
|
// 平衡表选择器
|
|
|
const onConfirm = ({ selectedOptions }) => {
|
|
|
showPicker.value = false;
|
|
|
- fieldValue.value = selectedOptions[0].text;
|
|
|
+ fieldValue.value = selectedOptions[0].ExcelName;
|
|
|
+ getExcelDetail( 'load', selectedOptions[0].ExcelInfoId)
|
|
|
};
|
|
|
|
|
|
// 版本选择器
|
|
|
const onConfirmVersion = ({ selectedOptions }) => {
|
|
|
showVersionPicker.value = false;
|
|
|
- fieldValueVersion.value = selectedOptions[0].text;
|
|
|
+ fieldValueVersion.value = selectedOptions[0].VersionName;
|
|
|
+ getExcelDetail( 'load', selectedOptions[0].ExcelInfoId)
|
|
|
};
|
|
|
|
|
|
// 关联图表页
|
|
@@ -244,25 +267,44 @@ function goChart () {
|
|
|
|
|
|
<template>
|
|
|
<div class="page">
|
|
|
+ <div class="table-title">
|
|
|
+ <div class="table-name">{{ queryData.ExcelName }}</div>
|
|
|
+ <div class="top-box">
|
|
|
+ <div class="top-item">{{ $t('shared_table.author') }}:{{ queryData.SysUserRealName }}</div>
|
|
|
+ <div class="top-item">{{ $t('shared_table.recent_save_time') }}:{{ queryData.CreateTime?.slice(0,10) }} </div>
|
|
|
+ <!-- <div class="top-item"></div> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<div class="filter-box">
|
|
|
<div class="filter-item">
|
|
|
- <div class="filter-label">平衡表</div>
|
|
|
- <div class="filter-select" @click.stop="showPicker=true">{{ fieldValue }} <van-icon name="arrow-down"/></div>
|
|
|
+ <div class="filter-select" @click.stop="showPicker=true">
|
|
|
+ <div class="filter-value">
|
|
|
+ {{ fieldValue }}
|
|
|
+ </div>
|
|
|
+ <van-icon name="arrow"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="filter-item">
|
|
|
- <div class="filter-label version">版本</div>
|
|
|
- <div class="filter-select" @click.stop="showVersionPicker=true">{{ fieldValueVersion }} <van-icon name="arrow-down"/></div>
|
|
|
+ <div class="filter-select" @click.stop="showVersionPicker=true">
|
|
|
+ <div class="filter-value">
|
|
|
+ {{ fieldValueVersion }}
|
|
|
+ </div>
|
|
|
+ <van-icon name="arrow"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="top-item"><van-icon name="chart-trending-o" size="22" @click.stop="goChart"v-if="queryData.Source === 5" /> <van-icon name="more-o" size="22" @click.stop="showMoreAction=true"/></div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="top-box">
|
|
|
- <div class="top-item">{{ $t('shared_table.author') }}:{{ queryData.SysUserRealName }}</div>
|
|
|
- <div class="top-item">{{ $t('shared_table.recent_save_time') }}:{{ queryData.CreateTime?.slice(0,10) }}</div>
|
|
|
+ <!-- <div class="top-item"><van-icon name="chart-trending-o" size="22" @click.stop="goChart"v-if="queryData.Source === 5" /> <van-icon name="more-o" size="22" @click.stop="showMoreAction=true"/></div> -->
|
|
|
</div>
|
|
|
<div class="sheet-box" v-if="queryData.UniqueCode">
|
|
|
<iframe :src="link + '/sheetshow?code=' + queryData.UniqueCode" frameborder="0" width="100%" height="100%"></iframe>
|
|
|
</div>
|
|
|
+ <div class="bottom">
|
|
|
+ <div v-for="item in sheetActions" :key="item.types">
|
|
|
+ <div class="bottom-item" @click="handleActionClick(item)">
|
|
|
+ <img :src="item.src" alt="">
|
|
|
+ <div>{{item.label}}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<!-- 更多设置弹窗 -->
|
|
|
<van-popup
|
|
|
v-model:show="showMoreAction"
|
|
@@ -291,6 +333,7 @@ function goChart () {
|
|
|
:columns="childTableOpts"
|
|
|
@cancel="showPicker = false"
|
|
|
@confirm="onConfirm"
|
|
|
+ :columns-field-names="customFieldName"
|
|
|
/>
|
|
|
</van-popup>
|
|
|
<!-- 版本选择器 -->
|
|
@@ -299,6 +342,7 @@ function goChart () {
|
|
|
:columns="versionOpts"
|
|
|
@cancel="showVersionPicker = false"
|
|
|
@confirm="onConfirmVersion"
|
|
|
+ :columns-field-names="customVersionFieldName"
|
|
|
/>
|
|
|
</van-popup>
|
|
|
</div>
|
|
@@ -309,38 +353,45 @@ function goChart () {
|
|
|
width: 100%;
|
|
|
height: 100vh;
|
|
|
padding: 24px;
|
|
|
+ .table-name {
|
|
|
+ max-height: 100px;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-size: 36px;
|
|
|
+ font-weight: 400;
|
|
|
+ line-height: 52px;
|
|
|
+ // text-align: left;
|
|
|
+ }
|
|
|
.filter-box {
|
|
|
font-size: 28px;
|
|
|
width: 100%;
|
|
|
- height: 60px;
|
|
|
+ height: 84px;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
.filter-item {
|
|
|
- width: 42%;
|
|
|
- height: 60px;
|
|
|
+ margin: 10px 0;
|
|
|
+ width: 49%;
|
|
|
+ height: 84px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
+ border-radius: 12px;
|
|
|
justify-content: space-between;
|
|
|
- .filter-label {
|
|
|
- width: 30%;
|
|
|
- height: 60px;
|
|
|
- line-height: 60px;
|
|
|
- color: #303133;
|
|
|
- }
|
|
|
- .version {
|
|
|
- width: 20%;
|
|
|
- }
|
|
|
.filter-select {
|
|
|
- width: 70%;
|
|
|
- height: 60px;
|
|
|
- line-height: 60px;
|
|
|
+ width: 100%;
|
|
|
+ height: 72px;
|
|
|
+ border-radius: 12px;
|
|
|
+ font-size: 28px;
|
|
|
+ font-weight: 400;
|
|
|
+ padding: 0 16px;
|
|
|
display: flex;
|
|
|
- justify-content: space-between;
|
|
|
align-items: center;
|
|
|
- border-radius: 4px;
|
|
|
- padding: 0 12px;
|
|
|
- // border: #303133 1px solid;
|
|
|
- border: 1px solid rgba(200, 205, 217, 1)
|
|
|
+ justify-content: space-between;
|
|
|
+ color: rgba(0, 82, 217, 1);
|
|
|
+ background: rgba(242, 243, 255, 1);
|
|
|
+ .filter-value {
|
|
|
+ line-height: 72px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.top-item {
|
|
@@ -356,14 +407,19 @@ function goChart () {
|
|
|
height: 60px;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-size: 24px;
|
|
|
+ font-weight: 400;
|
|
|
+ line-height: 32px;
|
|
|
+ text-align: center;
|
|
|
+ color: rgba(102, 102, 102, 1);
|
|
|
.top-item {
|
|
|
line-height: 60px;
|
|
|
}
|
|
|
}
|
|
|
.sheet-box{
|
|
|
width: 100%;
|
|
|
- height: calc(100% - 60px);
|
|
|
- // background-color: pink;
|
|
|
+ height: calc(100% - 270px);
|
|
|
}
|
|
|
.sheet-more-action-wrap{
|
|
|
.head-box{
|
|
@@ -387,18 +443,36 @@ function goChart () {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .bottom {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ .bottom-item {
|
|
|
+ color: rgba(51, 51, 51, 1);
|
|
|
+ font-size: 20px;
|
|
|
+ font-weight: 400;
|
|
|
+ line-height: 32px;
|
|
|
+ text-align: center;
|
|
|
+ img {
|
|
|
+ width: 40px;
|
|
|
+ height: 40px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
@media screen and (min-width: 650px) {
|
|
|
.filter-box {
|
|
|
+ width: 50%;
|
|
|
font-size: 16px;
|
|
|
height: 30px;
|
|
|
+ position: absolute;
|
|
|
+ left: 12px;
|
|
|
+ bottom: 18px;
|
|
|
.filter-item {
|
|
|
+ width: 49%;
|
|
|
height: 30px;
|
|
|
- .filter-label {
|
|
|
- height: 30px;
|
|
|
- line-height: 30px;
|
|
|
- }
|
|
|
.filter-select {
|
|
|
height: 30px;
|
|
|
+ border-radius: 6px;
|
|
|
+ font-size: 14px;
|
|
|
}
|
|
|
}
|
|
|
.top-item {
|
|
@@ -407,4 +481,62 @@ function goChart () {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+@media screen and (min-width: 650px) {
|
|
|
+ .page{
|
|
|
+ width: 100%;
|
|
|
+ height: 100vh;
|
|
|
+ padding: 12px;
|
|
|
+ .table-title {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ .table-name {
|
|
|
+ width: 50%;
|
|
|
+ height: 50px;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: 400;
|
|
|
+ line-height: 25px;
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+ .top-box {
|
|
|
+ width: 50%;
|
|
|
+ height: 50px;
|
|
|
+ display:block;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-size: 12px;
|
|
|
+ font-weight: 400;
|
|
|
+ text-align: right;
|
|
|
+ color: rgba(102, 102, 102, 1);
|
|
|
+ .top-item {
|
|
|
+ line-height: 25px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .sheet-box{
|
|
|
+ margin-top: 10px;
|
|
|
+ width: 100%;
|
|
|
+ height: calc(100% - 110px);
|
|
|
+ }
|
|
|
+ .bottom {
|
|
|
+ width: 30%;
|
|
|
+ position: absolute;
|
|
|
+ right: 12px;
|
|
|
+ bottom: 12px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ .bottom-item {
|
|
|
+ color: rgba(51, 51, 51, 1);
|
|
|
+ font-size: 10px;
|
|
|
+ font-weight: 400;
|
|
|
+ line-height: 16px;
|
|
|
+ text-align: center;
|
|
|
+ img {
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|