feat: 新增需求

This commit is contained in:
caijun
2026-01-20 18:07:35 +08:00
parent 9f5b2a92c4
commit 4243e1213f
26 changed files with 2837 additions and 936 deletions

View File

@@ -8,28 +8,37 @@
<mescroll-body ref="mescrollRef" @down="downCallback" :down="downOption" :sticky="false" @up="upCallback"
:up="upOption" :bottombar="false" @init="mescrollInit" :top="mescrollTop">
<view class="workFlow-list">
<view class="part" v-for="(item, i) in menuList" :key="i">
<view class="caption u-line-1" v-if="item?.children?.length">
{{ item.fullName }}
</view>
<view class="u-flex u-flex-wrap">
<view class="item u-flex-col u-col-center" v-for="(child, ii) in item.children" :key="ii"
@click="handelClick(child)">
<text class="u-font-40 item-icon" :class="child.icon"
:style="{ background: child.iconBackground || '#008cff' }" />
<text class="u-font-24 u-line-1 item-text">{{child.fullName}}</text>
</view>
</view>
<view class="caption u-line-1">业务表单</view>
<view class="u-flex u-flex-wrap item-container">
<view class="item u-flex-col u-col-center"
v-for="(item, i) in menuList"
:key="item.id"
@click="handelClick(item)">
<!-- 渲染图标 -->
<view class="item-icon" :style="{ background: item.iconBackground || '#008cff' }">
<!-- 使用 iconify-icon 渲染 ep 系列图标 -->
<iconify-icon
:icon="item.icon"
color="#ffffff"
width="24"
height="24"
></iconify-icon>
</view>
</view>
<!-- 渲染名称 -->
<text class="u-font-24 u-line-1 item-text">{{item.name}}</text>
</view>
</view>
</view>
</mescroll-body>
</view>
</template>
<script>
import {
getMenuList,
getChildList
} from "@/api/apply/apply.js";
import {
getMenuData
} from "@/api/index/index";
import resources from "@/libs/resources.js";
import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
import {
@@ -91,84 +100,7 @@
},
methods: {
handelClick(item) {
if (item.type == 1) {
getChildList(item.id).then(res => {
this.listChild = res.data || []
this.handleProperty(this.listChild)
this.$nextTick(() => {
uni.navigateTo({
url: "/pages/apply/catalog/index?config=" +
this.jnpf.base64.encode(JSON.stringify(this.listChild[0])),
fail: (err) => {
this.$u.toast("暂无此页面");
},
});
})
})
return;
}
let url = ''
// 2-页面 11-回传表单
if (item.type == 2 || item.type == 11) {
if (!item.pageAddress) {
this.$u.toast("暂无此页面");
return;
}
url = item.pageAddress + "?menuId=" + item.id + "&fullName=" + item.fullName
}
// 3-在线表单 9-流程
if (item.type == 3 || item.type == 9) {
if (!item.moduleId) {
this.$u.toast("暂无此页面");
return;
}
url = "/pages/apply/dynamicModel/index?config=" + this.jnpf.base64.encode(JSON.stringify(item))
}
// 外链
if (item.type == 7) {
if (!item.pageAddress) {
this.$u.toast("暂无此页面");
return;
}
url = "/pages/apply/externalLink/index?url=" + encodeURIComponent(item.pageAddress) + "&fullName=" +
item.fullName + "&type=" + item.type
}
// 报表(原)
if (item.type == 5) {
if (!item.moduleId) {
this.$u.toast("暂无此页面");
return;
}
userInfo = uni.getStorageSync('userInfo') || {}
const appCode = userInfo.systemCode
const urlPre = encodeURIComponent(
`${this.report}/preview.html?id=${item.moduleId}&token=${this.token}}&appCode=${appCode}&page=1&from=menu`
)
url = "/pages/apply/externalLink/index?url=" + urlPre + "&fullName=" + item.fullName + "&type=" +
item.type
}
// 报表
if (item.type == 10) {
if (!item.moduleId) {
this.$u.toast("暂无此页面");
return;
}
const urlPre = encodeURIComponent(
`${this.pcURL}/reportPreview?id=${item.moduleId}&token=${this.token}&from=app`
);
url = "/pages/apply/externalLink/index?url=" + urlPre + "&fullName=" + item.fullName + "&type=" +
item.type
}
// 门户
if (item.type == 8) {
if (!item.moduleId) {
this.$u.toast("暂无此页面");
return;
}
url = "/pages/portal/scanPortal/index?id=" + item.moduleId + "&portalType=1&fullName=" +
item.fullName
}
if (!url) return;
let url = "/pages/apply/dynamicModelList/index?config=" + this.jnpf.base64.encode(JSON.stringify(item))
uni.navigateTo({
url,
fail: () => {
@@ -184,13 +116,13 @@
title: '正在加载',
mask: true
})
getMenuList(query)
getMenuData()
.then((res) => {
let list = res.data.list || [];
let list =res?.data || [];
this.mescroll.endSuccess(list.length);
this.list = list.filter(o => o.children && o.children.length)
this.menuList = this.list;
this.handleProperty(this.list)
this.menuList = list;
console.log(this.menuList,'menuList---')
// this.handleProperty(this.list)
uni.hideLoading()
this.key = +new Date();
this.mescroll.endSuccess(this.menuList.length, false);
@@ -338,4 +270,54 @@
}
}
}
.menu-v {
// 原有样式...
.workFlow-list {
background-color: #fff;
padding: 20rpx;
margin-bottom: 20rpx;
// 分类标题样式
.caption {
font-size: 32rpx;
font-weight: bold;
color: #333;
padding: 0 20rpx 20rpx;
border-bottom: 1px solid #f5f5f5;
}
// 项容器(让项横向排列)
.item-container {
padding: 20rpx;
}
// 单个项的样式
.item {
width: 25%; // 一行显示4个可根据需求调整
margin-bottom: 30rpx;
align-items: center;
// 图标样式
.item-icon {
width: 88rpx;
height: 88rpx;
border-radius: 20rpx; // 圆角更美观
color: #fff;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 10rpx;
}
// 文字样式
.item-text {
font-size: 24rpx;
color: #333;
text-align: center;
}
}
}
}
</style>