初始代码
This commit is contained in:
237
pages/commonPage/allApp/allApp_apply.vue
Normal file
237
pages/commonPage/allApp/allApp_apply.vue
Normal file
@@ -0,0 +1,237 @@
|
||||
<template>
|
||||
<view class="allApp-v">
|
||||
<view class="notice-warp">
|
||||
<view class="search-box">
|
||||
<u-search :placeholder="$t('app.apply.pleaseKeyword')" v-model="keyword" height="72"
|
||||
:show-action="false" @change="search" bg-color="#f0f2f6" shape="square">
|
||||
</u-search>
|
||||
</view>
|
||||
</view>
|
||||
<view class="usualList">
|
||||
<view class="caption u-m-b-20">常用菜单</view>
|
||||
<view class="u-flex u-flex-wrap">
|
||||
<view class="item u-flex-col u-col-center" v-for="(item,i) in usualList" :key="i">
|
||||
<text class="u-font-40 item-icon" :class="item.icon"
|
||||
:style="{'background':item.iconBackground||'#008cff'}" />
|
||||
<text class="u-font-24 u-line-1 item-text">{{item.fullName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<CommonTabs :list="allList" @change="change" :current="current" ref="CommonTabs" isBoxShadow></CommonTabs>
|
||||
<view class="allList u-m-t-20" v-if="allList.length">
|
||||
<view class="u-m-t-20" v-for="(item,i) in allList" :key="i">
|
||||
<template v-if="i==current && item?.children?.length">
|
||||
<view v-for="(child,ii) in item.children" class="u-flex childList-item u-p-b-28" :key="ii">
|
||||
<text class="u-font-40 item-icon" :class="child.icon"
|
||||
:style="{'background':child.iconBackground||'#008cff'}" />
|
||||
<text class="u-font-32 item-text u-m-l-28 u-m-r-28 u-line-2">{{child.fullName}}</text>
|
||||
<view class="btnBox">
|
||||
<u-button :custom-style="customStyle" @click="handelAdd(child)" v-if="!child.isData">添加
|
||||
</u-button>
|
||||
<u-button :custom-style="customStyle" type="error" @click="handelDel(child)" v-else>移除
|
||||
</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<NoData v-else :paddingTop="450"></NoData>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import NoData from '@/components/noData'
|
||||
import {
|
||||
FlowEngineListAll
|
||||
} from '@/api/workFlow/flowEngine'
|
||||
import CommonTabs from '@/components/CommonTabs'
|
||||
import {
|
||||
getDataList,
|
||||
getUsualList,
|
||||
addUsual,
|
||||
delUsual
|
||||
} from '@/api/apply/apply.js'
|
||||
export default {
|
||||
components: {
|
||||
CommonTabs,
|
||||
NoData
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
current: 0,
|
||||
usualList: [],
|
||||
allList: [],
|
||||
customStyle: {
|
||||
width: "128rpx",
|
||||
fontSize: "24rpx",
|
||||
height: '60rpx'
|
||||
},
|
||||
type: '2',
|
||||
keyword: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
this.getUsualList()
|
||||
},
|
||||
search() {
|
||||
this.searchTimer && clearTimeout(this.searchTimer);
|
||||
this.searchTimer = setTimeout(() => {
|
||||
this.allList = [];
|
||||
this.usualList = [];
|
||||
this.current = 0
|
||||
this.getUsualList();
|
||||
}, 300);
|
||||
},
|
||||
getUsualList() {
|
||||
getUsualList().then(res => {
|
||||
this.usualList = res.data.list.map(o => {
|
||||
const objectData = o.objectData ? JSON.parse(o.objectData) : {}
|
||||
return {
|
||||
...o,
|
||||
...objectData
|
||||
}
|
||||
})
|
||||
})
|
||||
this.getAllList()
|
||||
},
|
||||
getAllList() {
|
||||
getDataList({
|
||||
keyword: this.keyword
|
||||
}).then(res => {
|
||||
uni.hideLoading()
|
||||
let list = JSON.parse(JSON.stringify(res.data.list))
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
let children = list[i].children
|
||||
if (Array.isArray(children) && children.length) {
|
||||
for (let j = 0; j < children.length; j++) {
|
||||
let iconBackground = '',
|
||||
moduleId = ''
|
||||
if (children[j].propertyJson) {
|
||||
let propertyJson = JSON.parse(children[j].propertyJson)
|
||||
iconBackground = propertyJson.iconBackgroundColor || ''
|
||||
moduleId = propertyJson.moduleId || ''
|
||||
}
|
||||
this.$set(children[j], 'iconBackground', iconBackground)
|
||||
this.$set(children[j], 'moduleId', moduleId)
|
||||
}
|
||||
}
|
||||
}
|
||||
this.allList = list.filter(o => o.children)
|
||||
})
|
||||
},
|
||||
handelAdd(item) {
|
||||
addUsual(item.id).then(res => {
|
||||
this.usualList.push(item)
|
||||
item.isData = true
|
||||
uni.$emit('updateUsualList')
|
||||
uni.showToast({
|
||||
title: res.msg
|
||||
})
|
||||
})
|
||||
},
|
||||
handelDel(item) {
|
||||
delUsual(item.id).then(res => {
|
||||
this.usualList = this.usualList.filter(o => o.id !== item.id)
|
||||
item.isData = false
|
||||
uni.$emit('updateUsualList')
|
||||
uni.showToast({
|
||||
title: res.msg
|
||||
})
|
||||
})
|
||||
},
|
||||
change(index) {
|
||||
this.current = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.allApp-v {
|
||||
.notice-warp {
|
||||
height: 114rpx;
|
||||
|
||||
.search-box {
|
||||
padding: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.caption {
|
||||
font-size: 36rpx;
|
||||
line-height: 80rpx;
|
||||
padding: 0 32rpx;
|
||||
|
||||
.tip {
|
||||
margin-left: 20rpx;
|
||||
font-size: 24rpx;
|
||||
color: #c6c6c6;
|
||||
}
|
||||
}
|
||||
|
||||
.tabs_box {
|
||||
width: 100%;
|
||||
|
||||
.sticky {
|
||||
width: 750rpx;
|
||||
height: 120rpx;
|
||||
color: #fff;
|
||||
padding-right: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.usualList {
|
||||
margin-top: 4.2rem;
|
||||
margin-bottom: 20rpx;
|
||||
background-color: #FFFFFF;
|
||||
|
||||
.item {
|
||||
margin-bottom: 32rpx;
|
||||
width: 25%;
|
||||
|
||||
.item-icon {
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
margin-bottom: 8rpx;
|
||||
line-height: 88rpx;
|
||||
text-align: center;
|
||||
border-radius: 20rpx;
|
||||
color: #fff;
|
||||
font-size: 56rpx;
|
||||
}
|
||||
|
||||
.item-text {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding: 0 16rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.allList {
|
||||
padding: 20rpx 32rpx 0;
|
||||
background-color: #FFFFFF;
|
||||
|
||||
.childList-item {
|
||||
align-items: center;
|
||||
|
||||
.item-text {
|
||||
width: calc(100% - 216rpx);
|
||||
}
|
||||
|
||||
.item-icon {
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
text-align: center;
|
||||
border-radius: 30rpx;
|
||||
color: #FFFFFF;
|
||||
flex-shrink: 0;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
286
pages/commonPage/allApp/allApp_workFlow.vue
Normal file
286
pages/commonPage/allApp/allApp_workFlow.vue
Normal file
@@ -0,0 +1,286 @@
|
||||
<template>
|
||||
<view class="allApp-v">
|
||||
<view class="notice-warp">
|
||||
<view class="search-box">
|
||||
<u-search :placeholder="$t('app.apply.pleaseKeyword')" v-model="keyword" height="72"
|
||||
:show-action="false" @change="search" bg-color="#f0f2f6" shape="square">
|
||||
</u-search>
|
||||
</view>
|
||||
</view>
|
||||
<mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption"
|
||||
:up="upOption" :bottombar="false" :sticky="false">
|
||||
<view>
|
||||
<view class="usualList">
|
||||
<view class=" caption u-m-b-20">常用流程</view>
|
||||
<view class="u-flex u-flex-wrap">
|
||||
<view class="item u-flex-col u-col-center" v-for="(item,i) in usualList" :key="i">
|
||||
<text class="u-font-40 item-icon" :class="item.icon"
|
||||
:style="{'background':item.iconBackground||'#008cff'}" @click="Jump(item)" />
|
||||
<text class="u-font-24 u-line-1 item-text">{{item.fullName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-sticky>
|
||||
<CommonTabs :list="categoryList" @change="change" :current="current" ref="CommonTabs" isBoxShadow>
|
||||
</CommonTabs>
|
||||
</u-sticky>
|
||||
<view class="allList u-m-t-20" v-if="allList.length">
|
||||
<view v-for="(item,i) in allList" :key="i">
|
||||
<view class="u-flex childList-item ">
|
||||
<text class="u-font-40 item-icon" :class="item.icon"
|
||||
:style="{'background':item.iconBackground||'#008cff'}" @click="Jump(item)" />
|
||||
<text class="item-text u-m-l-28 u-m-r-28 u-line-2">{{item.fullName}}</text>
|
||||
<view class="btnBox">
|
||||
<u-button :custom-style="customStyle" @click="handelAdd(item)"
|
||||
v-if="!item.isCommonFlow">添加
|
||||
</u-button>
|
||||
<u-button :custom-style="customStyle" type="error" @click="handelDel(item)" v-else>
|
||||
移除
|
||||
</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<NoData v-else paddingTop="100"></NoData>
|
||||
</view>
|
||||
</mescroll-uni>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
|
||||
import CommonTabs from '@/components/CommonTabs'
|
||||
import NoData from '@/components/noData'
|
||||
import {
|
||||
getFlowList,
|
||||
getDataList,
|
||||
getFlowUsualList,
|
||||
setCommonFlow,
|
||||
delUsual
|
||||
} from '@/api/apply/apply.js'
|
||||
import resources from '@/libs/resources.js'
|
||||
export default {
|
||||
mixins: [MescrollMixin], // 使用mixin
|
||||
components: {
|
||||
CommonTabs,
|
||||
NoData
|
||||
},
|
||||
props: {
|
||||
categoryList: {
|
||||
type: Array,
|
||||
default () {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
usualList: [],
|
||||
current: 0,
|
||||
customStyle: {
|
||||
width: "128rpx",
|
||||
fontSize: "24rpx",
|
||||
height: '60rpx'
|
||||
},
|
||||
downOption: {
|
||||
use: true,
|
||||
auto: true
|
||||
},
|
||||
upOption: {
|
||||
page: {
|
||||
num: 0,
|
||||
size: 20,
|
||||
time: null
|
||||
},
|
||||
empty: {
|
||||
use: false,
|
||||
icon: resources.message.nodata,
|
||||
tip: this.$t('common.noData'),
|
||||
fixed: true,
|
||||
top: "860rpx",
|
||||
},
|
||||
textNoMore: this.$t('app.apply.noMoreData'),
|
||||
},
|
||||
category: '',
|
||||
allList: [],
|
||||
type: '1',
|
||||
fullName: '',
|
||||
keyword: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.searchTimer && clearTimeout(this.searchTimer);
|
||||
this.searchTimer = setTimeout(() => {
|
||||
this.list = [];
|
||||
this.menuList = [];
|
||||
this.mescroll.resetUpScroll();
|
||||
}, 300);
|
||||
},
|
||||
init() {
|
||||
this.getFlowUsualList()
|
||||
},
|
||||
getFlowUsualList() {
|
||||
let query = {
|
||||
category: 'commonFlow',
|
||||
flowType: 0
|
||||
}
|
||||
getFlowUsualList(query).then(res => {
|
||||
this.usualList = res.data.list.map(o => {
|
||||
const objectData = o.objectData ? JSON.parse(o.objectData) : {}
|
||||
return {
|
||||
...o,
|
||||
...objectData
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
upCallback(page) {
|
||||
let query = {
|
||||
currentPage: page.num,
|
||||
pageSize: page.size,
|
||||
category: this.category == 0 ? '' : this.category,
|
||||
flowType: 0,
|
||||
keyword: this.keyword
|
||||
}
|
||||
getFlowList(query, {
|
||||
load: page.num == 1
|
||||
}).then(res => {
|
||||
this.mescroll.endSuccess(res.data.list.length);
|
||||
if (page.num == 1) this.allList = [];
|
||||
const list = res.data.list || [];
|
||||
this.allList = this.allList.concat(list);
|
||||
}).catch(() => {
|
||||
this.mescroll.endSuccess(0);
|
||||
this.mescroll.endErr();
|
||||
})
|
||||
},
|
||||
Jump(item) {
|
||||
const config = {
|
||||
id: "",
|
||||
flowId: item.id,
|
||||
opType: "-1",
|
||||
};
|
||||
uni.navigateTo({
|
||||
url: "/pages/workFlow/flowBefore/index?config=" +
|
||||
this.yunzhupaas.base64.encode(JSON.stringify(config))
|
||||
});
|
||||
},
|
||||
handelAdd(item) {
|
||||
|
||||
setCommonFlow(item.id).then(res => {
|
||||
this.usualList.push(item)
|
||||
item.isCommonFlow = true
|
||||
uni.$emit('updateUsualList')
|
||||
uni.showToast({
|
||||
title: res.msg
|
||||
})
|
||||
})
|
||||
},
|
||||
handelDel(item) {
|
||||
setCommonFlow(item.id).then(res => {
|
||||
item.isCommonFlow = false
|
||||
this.getFlowUsualList()
|
||||
uni.$emit('updateUsualList')
|
||||
uni.showToast({
|
||||
title: res.msg
|
||||
})
|
||||
})
|
||||
},
|
||||
change(index) {
|
||||
this.current = index;
|
||||
this.keyword = ""
|
||||
this.category = !this.categoryList[index].id ? '' : this.categoryList[index].id
|
||||
this.allList = [];
|
||||
this.mescroll.resetUpScroll()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.allApp-v {
|
||||
.notice-warp {
|
||||
height: 114rpx;
|
||||
|
||||
.search-box {
|
||||
padding: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.caption {
|
||||
font-size: 36rpx;
|
||||
line-height: 80rpx;
|
||||
padding: 0 32rpx;
|
||||
|
||||
.tip {
|
||||
margin-left: 20rpx;
|
||||
font-size: 24rpx;
|
||||
color: #c6c6c6;
|
||||
}
|
||||
}
|
||||
|
||||
.tabs_box {
|
||||
width: 100%;
|
||||
|
||||
.sticky {
|
||||
width: 750rpx;
|
||||
height: 120rpx;
|
||||
color: #fff;
|
||||
padding-right: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.usualList {
|
||||
margin-top: 4.2rem;
|
||||
margin-bottom: 20rpx;
|
||||
background-color: #FFFFFF;
|
||||
|
||||
.item {
|
||||
margin-bottom: 32rpx;
|
||||
width: 25%;
|
||||
|
||||
.item-icon {
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
margin-bottom: 8rpx;
|
||||
line-height: 88rpx;
|
||||
text-align: center;
|
||||
border-radius: 30rpx;
|
||||
color: #fff;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
|
||||
.item-text {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding: 0 16rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.allList {
|
||||
padding: 0rpx 32rpx 28rpx;
|
||||
background-color: #FFFFFF;
|
||||
|
||||
.childList-item {
|
||||
align-items: center;
|
||||
padding: 28rpx 0 0 0;
|
||||
|
||||
.item-text {
|
||||
width: calc(100% - 216rpx);
|
||||
}
|
||||
|
||||
.item-icon {
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
text-align: center;
|
||||
border-radius: 30rpx;
|
||||
color: #FFFFFF;
|
||||
flex-shrink: 0;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
61
pages/commonPage/allApp/index.vue
Normal file
61
pages/commonPage/allApp/index.vue
Normal file
@@ -0,0 +1,61 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="" v-if="type == 1">
|
||||
<allAppWorkFlow ref="allAppWorkFlow" :categoryList='categoryList'></allAppWorkFlow>
|
||||
</view>
|
||||
<view class="" v-if="type == 2">
|
||||
<allAppApply ref="allAppApply"></allAppApply>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import allAppWorkFlow from './allApp_workFlow.vue'
|
||||
import allAppApply from './allApp_apply.vue'
|
||||
import {
|
||||
FlowEngineListAll
|
||||
} from '@/api/workFlow/flowEngine'
|
||||
import {
|
||||
getFlowList,
|
||||
getDataList,
|
||||
getUsualList,
|
||||
addUsual,
|
||||
delUsual
|
||||
} from '@/api/apply/apply.js'
|
||||
export default {
|
||||
components: {
|
||||
allAppWorkFlow,
|
||||
allAppApply
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type: '1',
|
||||
categoryList: []
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.type = option.type || '1'
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.type == '1' ? '收藏流程' : '收藏菜单'
|
||||
})
|
||||
this.categoryList = option.categoryList ? JSON.parse(decodeURIComponent(option.categoryList)) : []
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init(option) {
|
||||
this.$nextTick(() => {
|
||||
if (this.type == 1) {
|
||||
this.$refs.allAppWorkFlow.init()
|
||||
} else {
|
||||
this.$refs.allAppApply.init()
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
page {
|
||||
background-color: #f0f2f6;
|
||||
}
|
||||
</style>
|
||||
137
pages/commonPage/morePage/allCommonFlow.vue
Normal file
137
pages/commonPage/morePage/allCommonFlow.vue
Normal file
@@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<view class="workFlow-v">
|
||||
<view class="notice-warp">
|
||||
<view class="search-box">
|
||||
<u-search :placeholder="$t('app.apply.pleaseKeyword')" v-model="keyword" height="72"
|
||||
:show-action="false" @change="search" bg-color="#f0f2f6" shape="square" @clear="clear" />
|
||||
</view>
|
||||
<view class="commonTabs-box">
|
||||
<CommonTabs :list="categoryTree" @change="change" :current="current" ref="CommonTabs"
|
||||
:isScroll="categoryTree.length >= 4 ? true : false">
|
||||
</CommonTabs>
|
||||
</view>
|
||||
</view>
|
||||
<view class="workFlow-list" style="">
|
||||
<view class="part" v-if="list.length">
|
||||
<view class="caption u-line-1">
|
||||
{{fullName }}
|
||||
</view>
|
||||
<view class="u-flex u-flex-wrap">
|
||||
<view class="item u-flex-col u-col-center" v-for="(child, ii) in list" :key="ii"
|
||||
@click="Jump(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>
|
||||
<NoData v-else></NoData>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import NoData from '@/components/noData'
|
||||
import CommonTabs from '@/components/CommonTabs'
|
||||
import {
|
||||
getCommonFlowTree
|
||||
} from "@/api/apply/apply.js";
|
||||
export default {
|
||||
components: {
|
||||
CommonTabs,
|
||||
NoData
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeFlow: {},
|
||||
keyword: "",
|
||||
category: "",
|
||||
current: 0,
|
||||
categoryTree: [],
|
||||
fullName: '',
|
||||
list: [],
|
||||
searchCategoryTree: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
uni.showLoading()
|
||||
this.getFlowUsualList();
|
||||
},
|
||||
methods: {
|
||||
getFlowUsualList() {
|
||||
this.keyword = ''
|
||||
getCommonFlowTree().then((res) => {
|
||||
this.categoryTree = res?.data?.list || [];
|
||||
this.searchCategoryTree = JSON.parse(JSON.stringify(this.categoryTree))
|
||||
this.list = []
|
||||
this.$nextTick(() => {
|
||||
this.list = this.categoryTree[this.current]?.children || []
|
||||
this.fullName = this.categoryTree[this.current]?.fullName;
|
||||
})
|
||||
uni.hideLoading()
|
||||
}).catch(() => {
|
||||
this.categoryTree = []
|
||||
this.list = []
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.searchTimer && clearTimeout(this.searchTimer);
|
||||
this.searchTimer = setTimeout(() => {
|
||||
if (!this.keyword) return this.clear()
|
||||
let children = this.searchCategoryTree[this.current].children.filter(o => o.fullName.includes(
|
||||
this.keyword))
|
||||
this.$set(this.categoryTree[this.current], 'children', children)
|
||||
this.list = this.categoryTree[this.current].children
|
||||
}, 300);
|
||||
},
|
||||
clear() {
|
||||
this.getFlowUsualList();
|
||||
},
|
||||
change(i) {
|
||||
this.list = this.categoryTree[i].children
|
||||
this.fullName = this.categoryTree[i].fullName;
|
||||
this.keyword = ''
|
||||
this.current = i
|
||||
},
|
||||
Jump(item) {
|
||||
const config = {
|
||||
id: "",
|
||||
flowId: item.id,
|
||||
opType: "-1",
|
||||
};
|
||||
this.current = 0
|
||||
this.category = ""
|
||||
uni.navigateTo({
|
||||
url: "/pages/workFlow/flowBefore/index?config=" +
|
||||
this.yunzhupaas.base64.encode(JSON.stringify(config))
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background-color: #f0f2f6;
|
||||
}
|
||||
|
||||
.workFlow-v {
|
||||
height: 100%;
|
||||
|
||||
.workFlow-list {
|
||||
margin-top: 120px;
|
||||
}
|
||||
|
||||
.notice-warp {
|
||||
height: 115rpx !important;
|
||||
|
||||
.search-box {
|
||||
padding: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.commonTabs-box {
|
||||
height: 2.8rem;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
289
pages/commonPage/morePage/allCommonMenus.vue
Normal file
289
pages/commonPage/morePage/allCommonMenus.vue
Normal file
@@ -0,0 +1,289 @@
|
||||
<template>
|
||||
<view class="all-apply-v">
|
||||
<view class="notice-warp">
|
||||
<view class="search-box">
|
||||
<u-search :placeholder="$t('app.apply.pleaseKeyword')" v-model="keyword" height="72"
|
||||
:show-action="false" @change="search" bg-color="#f0f2f6" shape="square" />
|
||||
</view>
|
||||
<view>
|
||||
<CommonTabs :list="tabsMenuList" @change="change" :current="current" ref="CommonTabs">
|
||||
</CommonTabs>
|
||||
</view>
|
||||
</view>
|
||||
<mescroll-uni @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption"
|
||||
top='220'>
|
||||
<view class="workFlow-list">
|
||||
<view class="part" v-for="(item, i) in menuList" :key="i" v-if=" menuList.length && hasChildren">
|
||||
<view class="caption u-line-1">
|
||||
{{ 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="handleClick(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>
|
||||
<NoData v-else :paddingTop="400"></NoData>
|
||||
</view>
|
||||
</mescroll-uni>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
getAppDataList
|
||||
} from "@/api/apply/apply.js";
|
||||
import NoData from '@/components/noData'
|
||||
import resources from "@/libs/resources.js";
|
||||
import CommonTabs from '@/components/CommonTabs'
|
||||
import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
|
||||
export default {
|
||||
mixins: [MescrollMixin],
|
||||
components: {
|
||||
NoData,
|
||||
CommonTabs
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showPopup: false,
|
||||
topSearch: 80,
|
||||
current: 0,
|
||||
usualList: [],
|
||||
tabsMenuList: [],
|
||||
menuList: [],
|
||||
downOption: {
|
||||
use: true,
|
||||
auto: true,
|
||||
},
|
||||
upOption: {
|
||||
page: {
|
||||
num: 0,
|
||||
size: 50,
|
||||
time: null,
|
||||
},
|
||||
empty: {
|
||||
use: false,
|
||||
icon: resources.message.nodata,
|
||||
tip: "暂无数据",
|
||||
fixed: true,
|
||||
top: "560rpx",
|
||||
},
|
||||
textNoMore: "",
|
||||
},
|
||||
keyword: "",
|
||||
userInfo: {
|
||||
systemIds: [],
|
||||
}, //CurrentUser接口中的userInfo数据
|
||||
modelId: "",
|
||||
config: {},
|
||||
key: +new Date()
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
baseURL() {
|
||||
return this.define.baseURL;
|
||||
},
|
||||
token() {
|
||||
return uni.getStorageSync('token')
|
||||
},
|
||||
report() {
|
||||
return this.define.report;
|
||||
},
|
||||
hasChildren() {
|
||||
let hasChildren = false
|
||||
for (let i = 0; i < this.menuList.length; i++) {
|
||||
if (this.menuList[i].children && this.menuList[i].children.length) {
|
||||
hasChildren = true
|
||||
break
|
||||
}
|
||||
}
|
||||
return hasChildren
|
||||
}
|
||||
},
|
||||
created() {
|
||||
uni.$on('refresh', () => {
|
||||
this.menuList = [];
|
||||
this.current = 0;
|
||||
this.mescroll.resetUpScroll();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
classifyItem(index) {
|
||||
this.showPopup = false
|
||||
this.change(index)
|
||||
},
|
||||
upCallback(keyword) {
|
||||
let query = {
|
||||
keyword: this.keyword,
|
||||
type: 2
|
||||
};
|
||||
uni.showLoading({
|
||||
title: '正在加载',
|
||||
mask: true
|
||||
})
|
||||
getAppDataList(query).then(res => {
|
||||
let list = res.data.list || [];
|
||||
if (!list.length) this.current = 0
|
||||
this.tabsMenuList = [{
|
||||
fullName: "全部功能"
|
||||
}];
|
||||
this.mescroll.endSuccess(list.length);
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
let children = list[i].children;
|
||||
let tabsMenuList = {
|
||||
fullName: list[i].fullName,
|
||||
};
|
||||
this.tabsMenuList.push(tabsMenuList);
|
||||
if (Array.isArray(children) && children.length) {
|
||||
for (let j = 0; j < children.length; j++) {
|
||||
let iconBackground = "",
|
||||
moduleId = "";
|
||||
if (children[j].propertyJson) {
|
||||
let propertyJson = JSON.parse(children[j].propertyJson);
|
||||
iconBackground = propertyJson.iconBackgroundColor || "";
|
||||
moduleId = propertyJson.moduleId || "";
|
||||
}
|
||||
this.$set(children[j], "iconBackground", iconBackground);
|
||||
this.$set(children[j], "moduleId", moduleId);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.list = JSON.parse(JSON.stringify(list));
|
||||
if (this.current === 0) {
|
||||
let allApp = [{
|
||||
fullName: '全部功能',
|
||||
children: this.yunzhupaas.treeToArray(this.list).filter(o => !o.hasChildren),
|
||||
id: 0
|
||||
}]
|
||||
this.menuList = allApp
|
||||
} else {
|
||||
this.menuList = this.list
|
||||
}
|
||||
uni.hideLoading()
|
||||
this.key = +new Date();
|
||||
this.mescroll.endSuccess(this.menuList.length, false);
|
||||
}).catch(() => {
|
||||
this.mescroll.endSuccess(0);
|
||||
this.mescroll.endErr();
|
||||
});
|
||||
},
|
||||
change(index) {
|
||||
this.current = index;
|
||||
this.menuList = this.list;
|
||||
if (this.current === 0) {
|
||||
let allApp = [{
|
||||
fullName: '全部功能',
|
||||
children: this.yunzhupaas.treeToArray(this.list).filter(o => !o.hasChildren),
|
||||
id: 0
|
||||
}]
|
||||
this.menuList = allApp
|
||||
} else {
|
||||
this.menuList = [this.list[index - 1]] || [];
|
||||
}
|
||||
},
|
||||
search() {
|
||||
this.searchTimer && clearTimeout(this.searchTimer);
|
||||
this.searchTimer = setTimeout(() => {
|
||||
this.list = [];
|
||||
this.menuList = [];
|
||||
this.tabsMenuList = [];
|
||||
this.current = 0
|
||||
this.mescroll.resetUpScroll();
|
||||
}, 300);
|
||||
},
|
||||
handleClick(item) {
|
||||
if (item.type == 2) {
|
||||
uni.navigateTo({
|
||||
url: item.urlAddress +
|
||||
"?menuId=" +
|
||||
item.id +
|
||||
"&fullName=" +
|
||||
item.fullName,
|
||||
fail: (err) => {
|
||||
this.$u.toast("暂无此页面");
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (item.type == 3) {
|
||||
this.modelId = item.moduleId;
|
||||
if (!item.moduleId) {
|
||||
this.$u.toast("暂无此页面");
|
||||
return;
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: "/pages/apply/dynamicModel/index?config=" +
|
||||
this.yunzhupaas.base64.encode(JSON.stringify(item)),
|
||||
fail: (err) => {
|
||||
this.$u.toast("暂无此页面");
|
||||
},
|
||||
});
|
||||
}
|
||||
if (item.type == 7 || item.type == 5) {
|
||||
let url =
|
||||
encodeURIComponent(item.urlAddress) + "&fullName=" + item.fullName;
|
||||
if (item.type == 5) {
|
||||
url = encodeURIComponent(
|
||||
`${this.report}/preview.html?id=${item.moduleId}&token=${this.token}&page=1&from=menu`
|
||||
);
|
||||
}
|
||||
if (!item.urlAddress && item.type == 7) {
|
||||
this.$u.toast("暂无此页面");
|
||||
return;
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: "/pages/apply/externalLink/index?url=" +
|
||||
url +
|
||||
"&fullName=" +
|
||||
item.fullName +
|
||||
"&type=" +
|
||||
item.type,
|
||||
fail: (err) => {
|
||||
this.$u.toast("暂无此页面");
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (item.type == 8) {
|
||||
if (!item.urlAddress) {
|
||||
this.$u.toast("暂无此页面");
|
||||
return;
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: "/pages/portal/scanPortal/index?id=" + item.moduleId + "&portalType=1&fullName=" +
|
||||
item.fullName,
|
||||
fail: (err) => {
|
||||
this.$u.toast("暂无此页面");
|
||||
},
|
||||
});
|
||||
return
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background-color: #f0f2f6;
|
||||
}
|
||||
|
||||
.all-apply-v {
|
||||
height: 100%;
|
||||
|
||||
.notice-warp {
|
||||
height: 3.59rem !important;
|
||||
text-align: left;
|
||||
|
||||
.search-box {
|
||||
padding: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.commonTabs-box {
|
||||
height: 2.8rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
35
pages/commonPage/morePage/index.vue
Normal file
35
pages/commonPage/morePage/index.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<view class="morePage-v">
|
||||
<allCommonFlow ref="allCommonFlow" v-if="type == 1"></allCommonFlow>
|
||||
<allCommonMenus ref="allCommonMenus" v-if="type == 2"></allCommonMenus>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import allCommonFlow from './allCommonFlow.vue'
|
||||
import allCommonMenus from './allCommonMenus.vue'
|
||||
export default {
|
||||
components: {
|
||||
allCommonFlow,
|
||||
allCommonMenus
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type: '1'
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.type = e?.type || '1'
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.type == '1' ? '常用流程' : '常用菜单'
|
||||
})
|
||||
},
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #f0f2f6;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user