提交 e397e1a1 authored 作者: lidongxu's avatar lidongxu

refactor(all): 新增其他报表_和报表分组功能

同上
上级 0126d477
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
"vue-cropper": "1.1.1", "vue-cropper": "1.1.1",
"vue-router": "4.4.0", "vue-router": "4.4.0",
"vue3-count-to": "^1.1.2", "vue3-count-to": "^1.1.2",
"vuedraggable": "4.1.0" "vuedraggable": "^4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "5.0.5", "@vitejs/plugin-vue": "5.0.5",
......
...@@ -3,21 +3,76 @@ ...@@ -3,21 +3,76 @@
<el-card class="container"> <el-card class="container">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span>报表列表</span> <span>常用报表</span>
<el-button class="custom"
type="primary"
link
@click="visible = true">
自定义
</el-button>
</div> </div>
</template> </template>
<div v-for="item in reportList" <div v-for="item in reportList"
class="item"> class="item">
<el-link icon="Document" <el-icon color="green"
:href="baseURL + item.previewUrl" size="16">
<Document></Document>
</el-icon>
<el-link :href="baseURL + item.previewUrl"
target="_blank">{{ item.name }}</el-link> target="_blank">{{ item.name }}</el-link>
</div> </div>
<p>尝试下面</p>
<draggable v-model="reportList" group="reports" item-key="id">
<template #item="{ element }">
<div class="item">
<el-icon color="green" size="16">
<Document></Document>
</el-icon>
<el-link :href="baseURL + element.previewUrl" target="_blank">{{ element.name }}</el-link>
</div>
</template>
</draggable>
<div class="group-container">
<el-card v-for="group in groups"
:key="group.id"
class="group">
<template #header>
<div class="card-header">
<span>{{ group.name }}</span>
</div>
</template>
<draggable v-model="group.items"
group="reports"
item-key="id">
<template #item="{ element }">
<div class="item">
<el-icon color="green"
size="16">
<Document></Document>
</el-icon>
<el-link :href="baseURL + element.previewUrl"
target="_blank">{{ element.name }}</el-link>
</div>
</template>
</draggable>
</el-card>
</div>
</el-card> </el-card>
</div> </div>
</template> </template>
<script setup> <script setup>
import { getReportListAPI } from '@/api' import { getReportListAPI } from '@/api'
import draggable from 'vuedraggable'
const groups = ref([
{ id: 1, name: '分组1', items: [] },
{ id: 2, name: '分组2', items: [] },
{ id: 3, name: '分组3', items: [] },
{ id: 4, name: '分组4', items: [] }
])
const baseURL = ref(import.meta.env.VITE_APP_REPORT_URL + '/report') const baseURL = ref(import.meta.env.VITE_APP_REPORT_URL + '/report')
const reportList = ref([]) const reportList = ref([])
const getReportList = async () => { const getReportList = async () => {
...@@ -29,7 +84,20 @@ getReportList() ...@@ -29,7 +84,20 @@ getReportList()
<style scoped <style scoped
lang="scss"> lang="scss">
.el-card__header {
.custom {
float: right;
padding: 3px 0;
}
}
.item { .item {
margin: 10px 0; margin: 10px 0;
display: flex;
align-items: center;
gap: 10px;
} }
</style> </style>
\ No newline at end of file
...@@ -18,11 +18,12 @@ export default { ...@@ -18,11 +18,12 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss"
#jimuReportFrame { scoped>
#jimuReportFrame {
width: 100%; width: 100%;
// 为了隐藏积木报表顶部的广告栏 // 为了隐藏积木报表顶部的广告栏
// min-height: calc(100vh - 30px) !important; // min-height: calc(100vh - 30px) !important;
// margin-top: -60px; // margin-top: -60px;
} }
</style> </style>
\ No newline at end of file
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="container"> <el-card class="container">
<template #header>
<div class="card-header">
<span>新增报表</span>
</div>
</template>
<el-form :model="form" <el-form :model="form"
label-width="100px"> label-width="100px">
<el-form-item label="报表名字"
prop="reportName">
<el-input v-model="form.reportName"
placeholder="请输入报表名字" />
</el-form-item>
<!-- 超链接输入 --> <!-- 超链接输入 -->
<el-form-item label="超链接" <el-form-item label="超链接"
prop="link"> prop="link">
<el-input v-model="form.link" <el-input v-model="form.link"
placeholder="请输入超链接地址" /> placeholder="请输入超链接地址" />
</el-form-item> </el-form-item>
<!-- 备注输入 -->
<el-form-item label="备注"
prop="remark">
<el-input v-model="form.remark"
type="textarea"
:rows="3"
placeholder="请输入备注信息" />
</el-form-item>
<!-- 提交按钮 --> <!-- 提交按钮 -->
<el-form-item> <el-form-item>
<el-button type="primary" <el-button type="primary"
@click="handleSubmit">提交</el-button> @click="handleSubmit">提交</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div>
</el-card>
</div> </div>
</template> </template>
...@@ -40,7 +41,6 @@ const form = ref({ ...@@ -40,7 +41,6 @@ const form = ref({
remark: '' remark: ''
}) })
// 提交处理 // 提交处理
const handleSubmit = async () => { const handleSubmit = async () => {
try { try {
......
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
<el-button type="warning" <el-button type="warning"
plain plain
icon="Download"> icon="Download">
<a href="https://link-promotion.oss-cn-shanghai.aliyuncs.com/file/%E6%96%B0%E5%A2%9E%E6%88%96%E4%BF%AE%E6%94%B9%E8%AE%A1%E5%88%92-%E6%A8%A1%E6%9D%BF3.0.xlsx?Expires=1742194336&OSSAccessKeyId=TMP.3KoXcFZHKsbDD4MPKDUMS2vu4t9DSGBccqeS4s6hbrmnwwsfvqe6Tga1119AGnJtdByNbiHXgxn9yNDn5e2xFiUFeV2Srf&Signature=y%2FTXwcrv5kJH9lPNTgZXsF0KE54%3D" <a href="https://link-promotion.oss-cn-shanghai.aliyuncs.com/file/%E6%96%B0%E5%A2%9E%E6%88%96%E4%BF%AE%E6%94%B9%E8%AE%A1%E5%88%92-%E6%A8%A1%E6%9D%BF3.0.xlsx"
download>下载计划模版</a> download>下载计划模版</a>
</el-button> </el-button>
</el-col> </el-col>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论