Commit e6e5a18d authored by xioln's avatar xioln

项目功能修改

parent 60cb809c
......@@ -8157,6 +8157,11 @@
"integrity": "sha512-3j8wdDzYuWO3lM3Reg03MuQR957t287Rpcxp1njpEa8oDrikb+FwGdW3n+FELh/A6qib6yPit0j/pv9G/yeAqA==",
"dev": true
},
"lodash.get": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
"integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ=="
},
"lodash.kebabcase": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz",
......@@ -8175,6 +8180,11 @@
"integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=",
"dev": true
},
"lodash.set": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz",
"integrity": "sha512-4hNPN5jlm/N/HLMCO43v8BXKq9Z7QdAGc/VGrRD61w8gN9g/6jF9A4L1pbUgBLCffi0w9VsXfTOij5x8iTyFvg=="
},
"lodash.transform": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/lodash.transform/-/lodash.transform-4.6.0.tgz",
......
......@@ -13,6 +13,8 @@
"crypto-js": "^4.0.0",
"element-ui": "^2.15.6",
"js-cookie": "^2.2.1",
"lodash.get": "^4.4.2",
"lodash.set": "^4.3.2",
"moment": "^2.29.1",
"pdfh5": "^1.4.2",
"pdfjs-dist": "^2.5.207",
......@@ -69,4 +71,4 @@
"last 2 versions",
"not dead"
]
}
\ No newline at end of file
}
......@@ -9,7 +9,7 @@ module.exports = {
propList: ['*'], // 能转化为vw的属性列表
viewportUnit: 'vw', // 指定需要转换成的视窗单位,建议使用vw
fontViewportUnit: 'vw', // 字体使用的视口单位
selectorBlackList: ['.ignore-', '.hairlines'], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名
selectorBlackList: ['.ignore-', '.hairlines', 'keep-px'], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名
minPixelValue: 1, // 小于或等于`1px`不转换为视窗单位,你也可以设置为你想要的值
mediaQuery: false, // 允许在媒体查询中转换`px`
replace: true, // 是否直接更换属性值,而不添加备用属性
......
// 测试环境
// const VUE_APP_BASE_API = 'http://192.168.1.248:9100' // eslint-disable-line
const VUE_APP_BASE_API = 'http://119.91.70.186:9002' // eslint-disable-line
// 开发环境
const VUE_APP_BASE_API = '' // eslint-disable-line
// const VUE_APP_BASE_API = '' // eslint-disable-line
// 供应商PC端地址&通飞PC端地址
// 生产
// const SUPPLIER_BASE_IP = 'http://10.19.5.12:9300/#/home' // eslint-disable-line
......
......@@ -2,34 +2,40 @@
<div id="app">
<!-- <router-view class="main"></router-view> -->
<keep-alive>
<router-view v-if="$route.meta.keepAlive" class="main"></router-view>
<router-view
v-if="$route.meta.keepAlive"
class="main"
></router-view>
</keep-alive>
<router-view v-if="!$route.meta.keepAlive" class="main"></router-view>
<tabbar v-if="$route.path!=='/login'"/>
<router-view
v-if="!$route.meta.keepAlive"
class="main"
></router-view>
<tabbar v-if="$route.path!=='/login'" />
</div>
</template>
<script>
import configure from '@/mixins/configure.js'
// import configure from '@/mixins/configure.js'
import Tabbar from '@/views/tabbar/index.vue'
export default {
name: 'app',
components: { Tabbar },
mixins: [configure],
// mixins: [configure],
// 数据源 给组件分发数据用
data () {
data() {
return {
title: '登录',
transitionName: 'fade'
}
},
mounted () {
mounted() {
this.title = this.$route.name
},
// 基于路由变化的动态 设置路由切换动画
watch: {
$route (to, from) {
$route(to, from) {
// 仅登录时导航不显示返回按钮 其他都显示
this.title = to.name
// 网页标题更改
......
import { get, post } from '../utils/http'
import { setSearchParams } from '@/utils/util'
// import store from '../store'
export function getUserReceiveItem(params) {
......@@ -28,3 +30,39 @@ export function getStatistics(params) {
export function getInstStatistics(params) {
return post('/workflow/inst/statistics', params)
}
// 获取待办任务列表
export function getUnfinishedTask(params) {
if (typeof (params) === 'string') {
return get(`/workflow/task/todo?${params}`)
} else {
return get('/workflow/task/todo', params)
}
}
// 获取已办任务列表
export function getFinishedTask(params) {
return get('/workflow/task/finished', params)
}
// 获取我发起的任务
export function getWFInsts(params) {
return post('/workflow/inst', params)
}
export function getDictListByCode(code, parentKey, attr) {
const params = {
searchParams: { dictState: 'ENABLE' },
sort: { dictSeq: 'asc' }
}
params.searchParams.dictCode = code
if (parentKey !== 'default') {
params.searchParams[attr] = parentKey
}
return post('/DictData/search', setSearchParams(params))
}
// 查询我的消息
export function searchMsg(params) {
return post('/Notify/searchNotify', params, true)
}
......@@ -36,9 +36,9 @@ export function isDisplayTopImport() {
return get(`${store.state.user.urlBaseApi}/extRest/common/isDisplayTopImport`)
}
export function current() {
return get(`/api/users/current`)
}
// export function current() {
// return get(`/api/users/current`)
// }
export function extUserPwd(parmas) {
return post(`${store.state.user.urlBaseApi}/extRest/extUserPwd/change`, parmas)
......
<template>
<div class="form">
<van-form v-model="form" ref="form" v-on="$listeners" @submit="onSubmit">
<van-form
v-model="form"
ref="form"
v-on="$listeners"
@submit="onSubmit"
>
<template v-if="formData.length">
<div v-for="(item, index) in formData" :key="index">
<div v-if="item.title" class="van-cell van-field sub-title">
<div
v-for="(item, index) in formData"
:key="index"
>
<div
v-if="item.title"
class="van-cell van-field sub-title"
>
{{ item.title }}
</div>
<!-- <div v-if="item?.component && item?.component?.name === 'vanTitle'" class="sub-title">{{item?.component.label}}</div> -->
<template v-if="item.data && item.data.length">
<div v-for="(formItem, itemIndex) in item.data" :key="itemIndex">
<div
v-for="(formItem, itemIndex) in item.data"
:key="itemIndex"
>
<van-field
v-if="
formItem.component && formItem.component.name === 'custom'
......@@ -57,31 +71,31 @@ export default {
},
rules: {
type: Object,
default: () => {}
default: () => { }
}
},
components: {},
// 数据源 给组件分发数据用
data () {
data() {
return {}
},
created () {
created() {
},
mounted () {},
mounted() { },
watch: {
formData: {
deep: true,
immediate: true,
handler (oldVal, newVal) {
handler(oldVal, newVal) {
this.init()
}
}
},
methods: {
handleSubmit (params) {
handleSubmit(params) {
this.$emit('handleSubmit', params)
},
init () {
init() {
if (this.formData.length) {
// 获取表单
let formItemData = []
......@@ -126,6 +140,10 @@ export default {
Vue.component(item?.component?.name, (resolve) => {
require(['./vanCheckboxContent.vue'], resolve)
})
} else if (item?.component?.name === 'el-selectDate') {
Vue.component(item?.component?.name, (resolve) => {
require(['./vanSelectDate.vue'], resolve)
})
} else if (item?.component?.name === 'customTable') {
Vue.component(item?.component?.name, (resolve) => {
require(['./vanList.vue'], resolve)
......@@ -140,14 +158,14 @@ export default {
}
},
// 表单校验
validate () {
validate() {
return this.$refs.form.validate()
},
// 提交表单
submit () {
submit() {
this.$refs.form.submit()
},
onSubmit (values) {
onSubmit(values) {
console.log('submit', values)
}
}
......@@ -187,5 +205,12 @@ export default {
.van-cell__title.van-field__label {
font-size: 14px;
}
.van-cell::after {
border-bottom: none !important;
}
.van-hairline--top-bottom::after,
.van-hairline-unset--top-bottom::after {
border-width: 0;
}
}
</style>
<template>
<div v-if="itemObj" class="select-input">
<van-field
v-model="selectLabel"
readonly
clickable
:name="name"
:label="label"
@click="showPicker = true"
<div
v-if="itemObj"
class="select-input"
>
<van-field
v-model="selectLabel"
readonly
clickable
:name="name"
:label="label"
@click="showPicker = true"
/>
<van-popup
v-model="showPicker"
position="bottom"
>
<van-picker
v-show="showPicker"
show-toolbar
value-key="label"
:columns="getOptions()"
@confirm="onConfirm"
@cancel="showPicker = false"
/>
<van-picker
v-show="showPicker"
show-toolbar
value-key="label"
:columns="getOptions()"
@confirm="onConfirm"
@cancel="showPicker = false"
/>
</van-popup>
</div>
</template>
<script>
......@@ -46,7 +54,7 @@ export default {
components: {
},
// 数据源 给组件分发数据用
data () {
data() {
return {
selectValue: this.value,
showPicker: false,
......@@ -54,26 +62,26 @@ export default {
multipleVal: []
}
},
mounted () {
mounted() {
},
watch: {
value: {
immediate: true,
deep: true,
handler (val) {
handler(val) {
this.selectValue = val
}
},
selectValue: {
deep: true,
handler (val) {
handler(val) {
this.$emit('input', val)
}
}
},
computed: {
selectLabel: {
get () {
get() {
let label = ''
if (this.selectValue instanceof Array) {
label = this.itemObj.options && this.itemObj.options.filter(item => {
......@@ -84,10 +92,10 @@ export default {
}
return label
},
set () {}
set() { }
},
multipleLable: {
get () {
get() {
let label = ''
if (this.selectValue instanceof Array) {
label = this.itemObj.options && this.itemObj.options.filter(item => {
......@@ -96,11 +104,11 @@ export default {
}
return label
},
set () {}
set() { }
}
},
methods: {
onConfirm (value) {
onConfirm(value) {
if (this.itemObj.multiple) {
if (value.value) {
this.selectValue = [value.value]
......@@ -112,7 +120,7 @@ export default {
}
this.showPicker = false
},
getOptions () {
getOptions() {
return this.itemObj.options || []
}
}
......
<template>
<div
v-if="itemObj"
class="select-date"
>
<van-cell-group border>
<van-cell
is-link
title="日期"
:value="date"
@click="show = true"
center
/>
</van-cell-group>
<van-calendar
v-model="show"
type="range"
color="#4187f2"
:min-date="minDate"
:max-date="maxDate"
@confirm="onConfirm"
:allow-same-day="true"
/>
</div>
</template>
<script>
export default {
props: {
itemObj: {
type: Object,
default: () => null
},
value: {
type: [String, Array],
default: ''
},
name: {
type: String,
default: ''
},
label: {
type: String,
default: ''
},
form: {
type: Object,
require: true
}
},
components: {
},
// 数据源 给组件分发数据用
data() {
return {
date: null,
show: false,
minDate: new Date(2010, 0, 1),
maxDate: new Date(2050, 0, 31),
}
},
mounted() {
},
watch: {
},
computed: {
},
methods: {
onConfirm(val) {
const [start, end] = val;
this.date = `${this.formatDate(start)}${this.formatDate(end)}`;
this.$emit('input', this.date)
this.show = false
},
formatDate(date) {
return `${date.getFullYear()}-${this.addZero(date.getMonth() + 1)}-${date.getDate()}`;
},
addZero(num) {
return num < 10 ? '0' + num : num;
}
}
}
</script>
<style lang="scss" scoped>
.select-date {
box-sizing: border-box;
}
</style>
<template>
<van-nav-bar class="headerNavBar" fixed :border="false" :left-arrow="$attrs.hasOwnProperty('left-arrow') ? $attrs['left-arrow'] : true" v-on="$listeners" v-bind="$attrs">
<van-nav-bar
class="headerNavBar"
fixed
:border="false"
:left-arrow="$attrs.hasOwnProperty('left-arrow') ? $attrs['left-arrow'] : true"
v-on="$listeners"
v-bind="$attrs"
>
<slot slot="left"></slot>
<slot slot="title"></slot>
<slot slot="right"></slot>
......@@ -12,26 +19,27 @@ export default {
props: {
},
components: {},
data () {
data() {
return {
}
},
created () {
created() {
},
mounted () {
mounted() {
},
computed: {
},
methods: {
onClickLeft () {},
goHome () {}
onClickLeft() { },
goHome() { }
}
}
</script>
<style lang="scss">
.headerNavBar, .van-nav-bar {
background: linear-gradient(197deg, #2AB1F4 0%, #3693E6 100%);
.headerNavBar,
.van-nav-bar {
background: linear-gradient(197deg, #2ab1f4 0%, #3693e6 100%);
line-height: 60px;
.van-icon {
color: #000;
......
import { getConfigure, saveConfigure } from '../api/configure.js'
import $store from '@/store'
export default {
data () {
data() {
return {
Timer: null,
loading: false,
......@@ -11,24 +11,24 @@ export default {
}
},
computed: {
configureFont () {
configureFont() {
return this.$store.state.theme.fontSize
},
configureCards () {
configureCards() {
},
configureTags () {
configureTags() {
return this.$store.state.tagsView.visitedViews
},
configureThemeName () {
configureThemeName() {
return this.$store.state.theme.themeName
},
configureFamily () {
configureFamily() {
return this.$store.state.theme.family
}
},
watch: {
'$route.path' (path) {
'$route.path'(path) {
if (path === '/login' || path === '/') {
this.loading = false
this.loaded = false
......@@ -43,7 +43,7 @@ export default {
// configureThemeName () {
// this.delayed('theme')
// },
configureCards () {
configureCards() {
this.delayed('card')
}
// configureTags () {
......@@ -53,7 +53,7 @@ export default {
// this.delayed('family')
// }
},
created () {
created() {
if (this.$route.path !== '/login' && this.$route.path !== '/') {
this.getConfigure()
}
......@@ -63,7 +63,7 @@ export default {
window.removeEventListener('beforeunload', this.uploadConfig)
},
methods: {
async getConfigure () {
async getConfigure() {
if (this.loading || this.loaded) {
return
}
......@@ -81,7 +81,7 @@ export default {
this.loading = false
})
},
handlerConfigure (items) {
handlerConfigure(items) {
try {
var params = items.content
params = JSON.parse(params)
......@@ -92,7 +92,7 @@ export default {
console.log(err)
}
},
writeConfigure (params) {
writeConfigure(params) {
// theme
this.$store.state.theme.fontSize = params.font
this.$store.state.theme.family = params.family || 'default-family'
......@@ -106,7 +106,7 @@ export default {
// tags
$store.dispatch('tagsView/addTags', params.tags)
},
saveConfigure () {
saveConfigure() {
clearTimeout(this.Timer)
this.Timer = null
// 没有登入不保存 配置
......@@ -117,13 +117,13 @@ export default {
this.fixTagsList.forEach(item => { item = null })
})
},
uploadConfig () {
uploadConfig() {
if (this.Timer) {
event.returnValue = '有配置没有保存'
this.saveConfigure()
}
},
fixTagsParams () {
fixTagsParams() {
this.fixTagsList = []
this.configureTags.forEach(item => {
const { fullPath, title, path, meta, query } = item
......@@ -135,7 +135,7 @@ export default {
})
return this.fixTagsList
},
getParams () {
getParams() {
const a = {
cards: this.configureCards
// tags: this.fixTagsParams(this.configureTags),
......@@ -145,7 +145,7 @@ export default {
}
return JSON.stringify(a)
},
delayed (type) {
delayed(type) {
if (this.writeConfigFlag) {
return
}
......
import router from './router'
import { getToken } from './utils/auth' // get token from cookie
import store from './store'
import { current } from './api/user/users'
import util from './utils/util.js'
import Cookies from 'js-cookie'
import { setCookie, getCookie, delCookie } from './utils/cookies.js'
......@@ -10,11 +9,6 @@ let path = ''
router.beforeEach(async (to, from, next) => {
const hasToken = getToken()
if (hasToken) {
if (to.path !== '/login') {
current().then(res => {
store.dispatch('tagsView/setOverflow')
})
}
if (!to.matched.length) {
from.name ? next({ name: from.name }) : next('/home')
} else {
......@@ -53,7 +47,7 @@ router.beforeEach(async (to, from, next) => {
}
}
})
function singleLogin (state) {
function singleLogin(state) {
const params = {}
console.log('util.getCookie', util.getCookie('url'))
if (util.getCookie('url')) {
......
......@@ -51,9 +51,9 @@ const routes = [
}
},
{
path: '/EbomStructure',
name: 'EBOM结构',
component: () => import('@/views/EbomStructure/index.vue'),
path: '/msgList',
name: '消息',
component: () => import('@/views/MsgList/index.vue'),
meta: {
keepAlive: true
}
......@@ -155,13 +155,13 @@ const createRouter = () => new VueRouter({
})
const router = createRouter()
export function resetRouter () {
export function resetRouter() {
const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router
}
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location, onResolve, onReject) {
VueRouter.prototype.push = function push(location, onResolve, onReject) {
if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
return originalPush.call(this, location).catch(err => err)
......
const getters = {
token: (state) => state.user.token,
urlBaseApi: (state) => state.user.urlBaseApi
urlBaseApi: (state) => state.user.urlBaseApi,
dictionaries: state => state.dictionaries.list || []
}
export default getters
import { getDictListByCode } from '@/api/home'
import _get from 'lodash.get'
import _set from 'lodash.set'
const state = {
list: [],
dict: {},
loading: {}
}
const mutations = {
UPDATE_DICT: (state, dict) => {
state.list = []
state.list.push(...dict)
},
SET_DICT: (state, dict) => {
for (const a in dict) {
if (state.dict[a]) {
state.dict[a] = Object.assign(state.dict[a], dict[a])
} else {
state.dict[a] = dict[a]
}
}
}
}
const actions = {
updateDict({ commit }, dict) {
commit('UPDATE_DICT', dict)
},
getDictByCode({ commit, state }, { dictCode, isReset, parentCode, attr }) {
return new Promise(async (resolve, reject) => {
if (!isReset && _get(state.dict, `${dictCode}.${parentCode}`)) {
resolve(_get(state.dict, `${dictCode}.${parentCode}`))
return
}
// 正在加载同类字典项 等待
if (_get(state.loading, `${dictCode}.${parentCode}`)) {
let count = 0
const timer = setInterval(() => {
count++
if (_get(state.dict, `${dictCode}.${parentCode}`) || count > 1000) {
clearInterval(timer)
resolve(_get(state.dict, `${dictCode}.${parentCode}`) || [])
}
}, 100)
return
}
_set(state.loading, `${dictCode}.${parentCode}`, true)
await getDictListByCode(dictCode, parentCode, attr).then(async res => {
_set(state.loading, `${dictCode}.${parentCode}`, false)
if (!res || !res.items) {
return []
}
const list = res.items.content.map(row => {
return {
label: row.dictValue,
value: row.dictKey,
id: row.id,
parentId: row.parentId
}
})
const dict = {}
_set(dict, `${dictCode}.${parentCode}`, list)
commit('SET_DICT', dict)
resolve(list)
}).catch(() => {
_set(state.loading, `${dictCode}.${parentCode}`, false)
resolve([])
})
})
},
setDictList({ commit }, dict) {
commit('SET_DICT', dict)
}
}
export default {
namespaced: true,
state,
mutations,
actions
}
......@@ -55,7 +55,7 @@ const state = {
{ key: 'setParticipantWithRole', title: '签审人员' },
{ key: 'templeteNumberWriteTable', title: '传阅' },
{ key: 'taskHistory', title: '签审历史' }
]
],
}
export default {
......
// import store from '../../store'
import { Notify } from 'vant'
import { getToken, setToken } from '../../utils/auth'
import { getToken, setToken, removeToken } from '../../utils/auth'
import { captchaLogin } from '../../api/user'
import router, { resetRouter } from '../../router'
const state = {
token: getToken(),
......@@ -45,38 +46,24 @@ const actions = {
reject(error)
})
})
},
logout({ commit }) {
return new Promise((resolve, reject) => {
commit('SET_TOKEN', '')
removeToken()
resetRouter()
Notify({ type: 'success', message: '已注销' })
router.push({ path: '/login' })
resolve()
})
},
resetToken({ commit }) {
return new Promise((resolve) => {
commit('SET_TOKEN', 'undefined')
removeToken()
resolve()
})
}
// logout({ commit }) {
// return new Promise((resolve, reject) => {
// logout().then((response) => {
// commit('SET_TOKEN', '')
// removeToken()
// resetRouter()
// Notify({ type: 'success', message: '已注销' })
// router.push({ path: '/login' })
// resolve()
// }).catch((error) => {
// Notify({ type: 'danger', message: '注销失败,请联系系统管理员!' })
// reject(error)
// })
// })
// },
// resetToken({ commit }) {
// return new Promise((resolve) => {
// commit('SET_TOKEN', 'undefined')
// removeToken()
// resolve()
// })
// },
// loginCount() {
// loginCount()
// .then((res) => {
// console.log('loginCount', res)
// })
// .catch((e) => {
// console.log(e)
// })
// }
}
export default {
namespaced: true,
......
......@@ -8,6 +8,8 @@ import { getToken } from './auth'
axios.defaults.baseURL = VUE_APP_BASE_API || process.env.VUE_APP_BASE_API // eslint-disable-line
// axios.defaults.withCredentials = true
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
axios.defaults.headers.post['Cache-Control'] = 'no-cache'
axios.defaults.timeout = process.env.NODE_ENV === 'development' ? 7200000 : 720000000
axios.interceptors.request.use(
(config) => {
if (store.getters.token) {
......@@ -22,6 +24,19 @@ axios.interceptors.request.use(
config.headers.toValidateKeys = config.data.toValidateKeys
delete config.data.toValidateKeys
}
if (!config.headers['X-User-Action'] && config.data && config.data.userAction) {
config.headers['X-User-Action'] = 'user-action'
delete config.data.userAction
}
if (store.getters.token) {
config.headers.authorization = getToken()
config.headers['Dex-Token'] = getToken()
config.headers['Dex-Auth-Type'] = 'Token'
if (!getToken()) {
delete config.headers.authorization
delete config.headers['Dex-Token']
}
}
return config
},
(error) => {
......@@ -64,7 +79,7 @@ axios.interceptors.response.use(
}
)
function get (url, params, responseType = null) {
function get(url, params, responseType = null) {
return new Promise((resolve, reject) => {
axios.get(url, {
params: Object.assign({ monmentDataTime: Date.parse(new Date()) }, params)
......@@ -81,7 +96,7 @@ function get (url, params, responseType = null) {
})
}
function downloadFile (url, params = null) {
function downloadFile(url, params = null) {
return new Promise((resolve, reject) => {
axios({
method: 'get',
......@@ -99,7 +114,7 @@ function downloadFile (url, params = null) {
})
}
function downloadFilePost (url, params = null) {
function downloadFilePost(url, params = null) {
return new Promise((resolve, reject) => {
axios({
method: 'post',
......@@ -117,19 +132,19 @@ function downloadFilePost (url, params = null) {
})
}
function post (url, params, responseType = null) {
function post(url, params, userAction = false) {
return new Promise((resolve, reject) => {
axios.post(url, params, responseType)
.then((res) => {
axios.post(url, params, userAction ? { headers: { 'X-User-Action': 'user-action' } } : null)
.then(res => {
resolve(res.data)
})
.catch((err) => {
.catch(err => {
reject(err.data)
})
})
}
function put (url, params) {
function put(url, params) {
return new Promise((resolve, reject) => {
axios.put(url, params)
.then((res) => {
......@@ -141,7 +156,7 @@ function put (url, params) {
})
}
function del (url, params) {
function del(url, params) {
return new Promise((resolve, reject) => {
axios.delete(url, { data: params })
.then((res) => {
......
......@@ -463,4 +463,13 @@ export function showMessage(msg, type) {
Notify({ type: t, message: msg })
}
// json数据转成query拼接
export function filterParams(params) {
const str = []
for (const attr in params) {
str.push(`${attr}=${params[attr]}`)
}
return str.join('&')
}
export default { getCookie, showMessage }
<template>
<div class="pbomStructure">
<header-nav-bar
:title="title"
left-arrow
@click-left="onClickLeft"
/>
<div class="pbom-container">
<div
class="searchModel"
ref="searchModel"
>
<dee-form
class="searchForm"
:form="form"
:form-data="formData"
@handleSubmit="handleSubmit"
/>
<div class="searchButton">
<van-button
type="info"
size="small"
@click="search"
>查询</van-button>
<van-button
plain
hairline
type="info"
size="small"
@click="hiddenTop"
:icon="iconButton"
></van-button>
</div>
</div>
<div
ref="searchList"
class="search-list"
>
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad"
>
<div
class="taskItem"
v-for="item in list"
:key="item.oid"
@click="goDetailsInfo(item)"
>
<div class="itemTitle">
<!-- <van-image :src="require('@/assets/home/new@2x.png')" /> -->
<div
v-if="item.state === 1"
class="message-keep-px unread"
>
<span>未读</span>
</div>
<div
v-else
class="message-keep-px read"
>
<span>已读</span>
</div>
<span class="text">{{ item.title }}</span>
<span class="itemTitle-time">{{ item.sender }}</span>
</div>
<div class="content">
<span class="title"> {{ item.sendTime }} </span>
<div class="time">
<van-icon name="arrow" />
</div>
</div>
</div>
</van-list>
</div>
</div>
</div>
</template>
<script>
import HeaderNavBar from '../../components/headerNavBar/index.vue'
import DeeForm from '../../components/form/form'
import moment from 'moment'
import { searchMsg } from '@/api/home'
export default {
props: {},
components: { HeaderNavBar, DeeForm },
data() {
return {
iconButton: 'arrow-up',
form: {},
formData: [
{
data: [
{
title: '标题',
key: 'title',
component: {
name: 'el-input',
placeholder: '请输入标题',
clearable: true,
border: true
}
},
{
title: '状态',
key: 'state',
component: {
name: 'el-select',
placeholder: '请输入状态',
clearable: true,
// border: true,
options: [
{
label: '未读',
value: 1
},
{
label: '已读',
value: 0
}
]
}
},
{
title: '发送时间',
key: 'time',
component: {
name: 'el-selectDate',
placeholder: '请输入发送时间',
clearable: true,
border: true
}
}
]
}
],
list: [],
loading: false,
finished: false,
curr: 1,
date: null,
show: false,
}
},
created() {
},
mounted() { },
computed: {
title() {
return this.$route.query.title || ''
}
},
methods: {
onConfirm() { },
onClickLeft() {
history.back(-1)
},
search() {
this.list = []
this.curr = 1
this.loading = true
this.onLoad()
},
handleSubmit(params) {
this.form = Object.assign(this.form, params)
},
onLoad() {
const searchParams = {
'operator': 'AND',
'items': [
{
fieldName: 'receiver',
operator: 'EQ',
value: localStorage.getItem('userId')
},
// {
// fieldName: 'type',
// operator: 'EQ',
// value: 'MESSAGE'
// }
]
}
this.form.title && searchParams.items.push({
'fieldName': 'title',
'operator': 'LIKE',
'value': this.form.title
})
typeof this.form.state === 'number' && !isNaN(this.form.state) && searchParams.items.push({
'fieldName': 'state',
'operator': 'EQ',
'value': this.form.state
})
this.form.time && searchParams.items.push({
'fieldName': 'sendTime',
'operator': 'BTWN',
'value': this.form.time.split(' 至 ')[0] + ' 00:00:00',
'value1': this.form.time.split(' 至 ')[1] + ' 00:00:00'
})
const params = {
pageFrom: this.curr,
pageSize: 10,
'sortItem': [{ 'fieldName': 'sendTime', 'sortOrder': 'desc' }],
'searchItems': searchParams
}
searchMsg(params).then(res => {
const items = res.items
this.list = [...this.list, ...items.content];
this.loading = false
if (items.totalPages === this.curr || items.totalElements === 0) {
this.finished = true
}
this.curr++
})
},
hiddenTop() {
if (this.iconButton === 'arrow-down') {
this.$refs.searchModel.style.height = '90px'
this.$refs.searchModel.style.transitionDuration = '.5s'
this.$refs.searchList.style.height = 'calc(100vh - 260px)'
this.iconButton = 'arrow-up'
return
}
this.$refs.searchModel.style.height = '23px'
this.$refs.searchList.style.height = 'calc(100vh - 190px)'
this.$refs.searchModel.style.transitionDuration = '.5s'
this.iconButton = 'arrow-down'
},
}
}
</script>
<style lang="scss">
.pbomStructure {
overflow: hidden;
.pbom-container {
height: calc(100vh - 75px);
overflow: hidden;
}
.searchModel {
padding: 20% 0.625rem 1rem 0.625rem;
display: flex;
overflow: hidden;
.searchForm {
flex: 1;
}
.searchButton {
padding: 0 10px;
.van-button {
margin-right: 10px;
}
}
}
.van-input-select .van-cell__title {
width: 70px;
}
.search-list {
padding: 0 30px;
overflow-y: auto;
height: calc(100vh - 260px);
.taskItem {
font-size: 16px;
color: #000000;
box-sizing: border-box;
border-bottom: 1px solid #e1e1e1;
margin-top: 10px;
.itemTitle {
display: flex;
align-items: center;
.message-keep-px {
flex-shrink: 0;
width: 35px;
height: 15px;
font-size: 10px;
font-weight: 800;
display: inline-flex;
justify-content: center;
align-items: center;
border-radius: 10px;
}
.unread {
background-color: #de6e69; /* 未读状态背景色 */
color: #fdfdfd; /* 文字颜色 */
}
.read {
background-color: #aaaaaa; /* 已读状态背景色 */
color: #fff; /* 文字颜色 */
}
.van-image__img {
width: 30px;
height: 15px;
}
.text {
margin-left: 0.625rem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.itemTitle-time {
text-align: right;
flex: auto;
margin-right: 10px;
font-size: 10px;
}
}
.content {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 12px;
color: #797979;
.title {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
flex: 30;
margin: 5px 0;
text-align: left;
}
.time {
flex: 2;
text-align: right;
margin-right: 10px;
}
}
}
}
}
</style>
\ No newline at end of file
......@@ -5,9 +5,17 @@
* @FilePath: src/views/home/components/loadTableCell.vue
*/
<template>
<div class="load-table-cell" ref="loadTableCell">
<div
class="load-table-cell"
ref="loadTableCell"
>
<!-- <div class="load-table-cell" @scroll="isScrollBottom" ref="loadTableCell"> -->
<van-loading v-if="showLoading" type="spinner" size="24px" vertical />
<van-loading
v-if="showLoading"
type="spinner"
size="24px"
vertical
/>
<div
class="taskItem"
v-for="item in list"
......@@ -16,11 +24,11 @@
>
<div class="itemTitle">
<van-image :src="require('@/assets/home/new@2x.png')" />
<span class="text">{{ item.wiName }}</span>
<span class="itemTitle-time">{{ item.wiCreaetime }}</span>
<span class="text">{{ item.title }}</span>
<span class="itemTitle-time">{{ item.sender }}</span>
</div>
<div class="content">
<span class="title"> {{ item.pboInfo }}|{{ item.pboState }} </span>
<span class="title"> {{ item.sendTime }} </span>
<div class="time">
<van-icon name="arrow" />
</div>
......@@ -29,29 +37,28 @@
</div>
</template>
<script>
import { getLatestTask } from '@/api/taskDetail'
import { searchMsg } from '@/api/home'
export default {
name: 'LoadTableCell', // name写在组件的最前方,自定义组件为必填
components: {},
data () {
data() {
return {
allList: [],
list: [],
list1: [],
curr: 2,
prevY: 0,
showLoading: true
}
},
computed: {},
created () {
created() {
// 初始化数据
this.getLatestTask()
},
methods: {
// 跳转详情页面
goDetailsInfo (item) {
goDetailsInfo(item) {
this.$router.push({
path: `/taskDetails-${item.oid}`,
query: {
......@@ -61,23 +68,34 @@ export default {
}
})
},
getLatestTask () {
getLatestTask().then((res) => {
if (res.items) {
// const todotitle = this.$store.state.list.TODOTITLE
// const todolist = this.$store.state.list.TODOLIST
// res.items = res.items.filter(
// (item) =>
// !todotitle.includes(item.classifyName) &&
// todolist.includes(item.subTypeName.split('___')[1])
// )
this.allList = res.items
this.dealWithtaskData()
this.showLoading = false
getLatestTask() {
const items = [
{
fieldName: 'receiver',
operator: 'EQ',
value: localStorage.getItem('userId')
},
{
fieldName: 'type',
operator: 'EQ',
value: 'MESSAGE'
}
]
const params = {
pageFrom: 1,
pageSize: 10,
'sortItem': [{ 'fieldName': 'sendTime', 'sortOrder': 'desc' }],
searchItems: {
items: items,
operator: 'AND'
}
}
searchMsg(params).then(res => {
this.list = res.items.content
this.showLoading = false
})
},
dealWithtaskData () {
dealWithtaskData() {
if (this.allList.length > 10 * this.curr) {
this.list = this.allList.slice(0, 10 * this.curr)
} else {
......@@ -85,7 +103,7 @@ export default {
}
},
// 暂时不用
isScrollBottom () {
isScrollBottom() {
// 是否滚动到了底部
this.box = this.$refs.loadTableCell
var clientHeight = this.box.clientHeight
......@@ -98,7 +116,7 @@ export default {
}
},
// 防抖
debounce (fn, delay = 50) {
debounce(fn, delay = 50) {
let timer = 0
return function () {
// 如果这个函数已经被触发了
......@@ -110,7 +128,7 @@ export default {
timer = 0
}, delay)
}
}
},
}
}
</script>
......
......@@ -2,8 +2,14 @@
<div class="home">
<div class="header">
<van-swipe :autoplay="3000">
<van-swipe-item v-for="(image, index) in images" :key="index">
<img class="swipeImage" v-lazy="image" />
<van-swipe-item
v-for="(image, index) in images"
:key="index"
>
<img
class="swipeImage"
v-lazy="image"
/>
</van-swipe-item>
</van-swipe>
<div class="logo">
......@@ -15,19 +21,36 @@
</div>
</div>
<!-- 快速入口 -->
<van-grid class="modelArr" :column-num="3" :border="false">
<van-grid-item v-for="item in modelArr" :key="item.key" :icon="item.icon" :text="item.title"
:to="{ path: item.path, query: { title: `${item.title}任务` } }" />
<van-grid
class="modelArr"
:column-num="3"
:border="false"
>
<van-grid-item
v-for="item in modelArr"
:key="item.key"
:icon="item.icon"
:text="item.title"
:to="{ path: item.path, query: { title: `${item.title}任务` } }"
/>
</van-grid>
<div class="task">
<van-notice-bar color="#3D3D3D" background="#FFF4F0" :left-icon="noticeIcon" @click="toNotice">
<van-notice-bar
color="#3D3D3D"
background="#FFF4F0"
:left-icon="noticeIcon"
@click="toNotice"
>
《5G移动端数字样机审查环境项目上线公告》
</van-notice-bar>
<div class="taskList">
<div class="taskTitle">
<span>最新任务</span>
<span class="more" @click="goTodoList">更多 ></span>
<span>我的消息</span>
<span
class="more"
@click="goTodoList"
>更多 ></span>
</div>
<div class="list">
<Load-table-cell></Load-table-cell>
......@@ -77,7 +100,7 @@ export default {
loading: false,
finished: false,
refreshing: false,
curr: 0
curr: 0,
}
},
computed: {},
......@@ -111,9 +134,10 @@ export default {
},
goTodoList() {
this.$router.push({
path: '/taskSearch',
path: '/msgList',
query: {
title: '任务搜索'
title: '消息',
key: 'msgList'
}
})
},
......
......@@ -6,38 +6,70 @@
*/
<template>
<div class="tabbar">
<van-tabbar class="menu" v-model="activeMenu" active-color="#1077CE" inactive-color="#6F7277">
<van-tabbar-item v-for="item in menu" :class="item.key" :key="item.key" :name="item.key"
@click="changeMenu(item)">
<van-tabbar
class="menu"
v-model="activeMenu"
active-color="#1077CE"
inactive-color="#6F7277"
>
<van-tabbar-item
v-for="item in menu"
:class="item.key"
:key="item.key"
:name="item.key"
@click="changeMenu(item)"
>
<span>{{ item.title }}</span>
<template #icon="props">
<img :src="props.active ? item.iconActive : item.iconInactive" />
</template>
</van-tabbar-item>
</van-tabbar>
<van-popup round v-if="actions.length !== 0" v-model="showPopover" position="bottom" closeable close-icon="close"
:style="{ height: '35%' }" :get-container="getContainer" @close="closePopup()">
<van-cell-group inset v-for="component in actions" :key="component.text" :name="component.text">
<van-cell is-link @click="toDetail(component)">
<van-popup
round
v-if="actions.length !== 0"
v-model="showPopover"
position="bottom"
closeable
close-icon="close"
:style="{ height: '35%' }"
:get-container="getContainer"
@close="closePopup()"
>
<van-cell-group
inset
v-for="component in actions"
:key="component.text"
:name="component.text"
>
<van-cell
is-link
@click="toDetail(component)"
>
<template #title>
<van-tag plain type="primary" size="large">{{
<van-tag
plain
type="primary"
size="large"
>{{
component.text
}}</van-tag>
</template>
</van-cell>
</van-cell-group>
</van-popup>
<ChangePassword ref="changePsw"></ChangePassword>
</div>
</template>
<script>
import { Dialog } from 'vant'
import ChangePassword from './changePassword.vue'
export default {
name: 'Tabbar', // name写在组件的最前方,自定义组件为必填
components: { [Dialog.Component.name]: Dialog.Component },
components: { [Dialog.Component.name]: Dialog.Component, ChangePassword },
data() {
return {
activeMenu: 'home',
activeMenu: null,
showPopover: false,
menu: [
{
......@@ -55,12 +87,12 @@ export default {
},
{
title: '消息',
key: 'design',
key: 'msgList',
route: {
path: '/EbomStructure',
path: '/msgList',
query: {
title: '消息',
key: 'design'
key: 'msgList'
}
},
iconActive: require('../../assets/home/menu/消息active.png'),
......@@ -75,26 +107,26 @@ export default {
{
text: '更改密码',
route: {
path: '/PbomStructure',
path: 'changePsd',
query: {
title: '更改密码',
key: 'craft'
key: 'changePsd'
}
}
},
{
text: '退出登陆',
route: {
path: '/MbomStructure',
path: '/login',
query: {
title: '退出登陆',
key: 'craft'
key: 'quitLogin'
}
}
}
]
}
]
],
}
},
computed: {
......@@ -103,8 +135,18 @@ export default {
return action?.components ? action.components : []
}
},
watch: {
'$route.query.key': {
handler(val) {
this.activeMenu = val || 'home'
},
immediate: true
}
},
created() {
},
mounted() {
},
methods: {
getContainer() {
return document.querySelector(this.activeMenu)
......@@ -116,6 +158,7 @@ export default {
}
},
changeMenu(item) {
console.log('item', item)
if (item.route) {
this.$router.push(item.route)
} else {
......@@ -124,7 +167,7 @@ export default {
},
toDetail(component) {
this.showPopover = false
if (component.text === '退出') {
if (component.text === '退出登陆') {
Dialog.confirm({
title: '是否退出?'
})
......@@ -134,30 +177,13 @@ export default {
.catch(() => {
// on cancel
})
} else if (component.text === '转PC版') {
window.open(component.route.path)
} else if (component.text === '登录统计下载') {
const url = 'Windchill/extRest/extUserPwd/exportLoginCount'
const name = '登录统计.xlsx'
this.$utils.downLoad(url, name)
} else if (component.text === '更改密码') {
this.$refs.changePsw.show = true
} else {
this.$router.push(component.route)
}
}
// isSupplierAccount () {
// isSupplierAccount({ account: this.loginForm.account }).then(res => {
// if (res.items) {
// this.loading = false
// this.$utils.showNotification(`当前登录账户[${this.loginForm.account}]为供应商账户,请访问供应商门户!`)
// } else {
// this.$store.dispatch('user/login', { form: this.loginForm }).then(x => {
// this.loading = false
// }).catch(e => {
// this.loading = false
// })
// }
// })
// }
},
}
}
</script>
......
/**
* @Description: 滚动加载表格
* @Description: 滚动加载表格
* @author xioln
* @date 2022-07-03
* @FilePath: src/views/home/components/todoListLazyCell.vue
*/
<template>
<div
class="todoList-lazyCell"
@scroll="isScrollBottom"
ref="todoListLazyCell"
>
<div class="todoList-lazyCell" @scroll="isScrollBottom" ref="todoListLazyCell">
<!-- <van-loading class="loading" v-if="loading" vertical /> -->
<van-empty v-if="list.length === 0" description="数据为空" />
<div
class="taskItem"
v-for="item in list"
:key="item.oid"
@click="goDetailsInfo(item)"
>
<div class="taskItem" v-for="item in list" :key="item.id" @click="goDetailsInfo(item)">
<div class="itemTitle">
{{ item.wiName }}
{{ item.name }}
<span class="time">
<span>{{ item.wiCreaetime }}</span>
<span>{{ item.time }}</span>
<van-icon name="arrow" />
</span>
</div>
<div class="content">
<span class="title"> {{ item.pboInfo }}|{{ item.pboState }} </span>
<span v-for="(attr, i) in item.showTitle" :key="`attr_${i}`">
{{ attr.title }}
</span>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'TodoListLazyCell', // name写在组件的最前方,自定义组件为必填
props: {
allList: {
type: Array,
require: true
default: () => []
}
},
components: {},
data () {
components: {
},
data() {
return {
curr: 1,
list: [],
curr: 1
loading: false
}
},
computed: {},
created () {
computed: {
},
created() {
// 初始化数据
this.dealWithtaskData()
},
methods: {
// 跳转详情页面
goDetailsInfo (item) {
goDetailsInfo(item) {
this.$router.push({
path: `/taskDetails-${item.oid}`,
query: {
......@@ -64,14 +63,14 @@ export default {
}
})
},
dealWithtaskData () {
dealWithtaskData() {
if (this.allList.length > 10 * this.curr) {
this.list = this.allList.slice(0, 10 * this.curr)
} else {
this.list = this.allList.slice(0, this.allList.length)
}
},
isScrollBottom () {
isScrollBottom() {
// 是否滚动到了底部
this.box = this.$refs.todoListLazyCell
var clientHeight = this.box.clientHeight
......@@ -84,7 +83,7 @@ export default {
}
},
// 防抖
debounce (fn, delay = 50) {
debounce(fn, delay = 50) {
let timer = 0
return function () {
// 如果这个函数已经被触发了
......@@ -104,38 +103,45 @@ export default {
.todoList-lazyCell {
overflow: scroll;
max-height: calc(100vh - 200px);
.taskItem {
font-size: 16px;
color: #000000;
box-sizing: border-box;
border-bottom: 1px solid #e1e1e1;
margin-top: 10px;
.itemTitle {
text-align: left;
display: flex;
align-items: center;
.van-image__img {
width: 30px;
height: 15px;
}
.text {
margin-left: 0.625rem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.time {
text-align: right;
flex: auto;
margin-right: 10px;
}
}
.content {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 12px;
color: #797979;
.title {
overflow: hidden;
white-space: nowrap;
......
<template>
<div class="todoList">
<header-nav-bar :title="title" left-arrow @click-left="onClickLeft" />
<van-loading v-if="showLoading" type="spinner" size="24px" vertical />
<div class="todoList-content" v-else>
<header-nav-bar
:title="title"
left-arrow
@click-left="onClickLeft"
/>
<van-loading
class="home-loading"
v-if="showLoading"
type="spinner"
size="24px"
vertical
/>
<div
class="todoList-content"
v-else
>
<!-- 任务列表 -->
<van-collapse v-model="name" accordion lazy-render="true" @change="tabChange">
<van-collapse-item v-for="itemName in listName" :key="itemName.classifId" :name="itemName.classifId"
class="list" ref="listRef">
<van-collapse
v-model="name"
accordion
lazy-render="false"
@change="tabChange"
>
<van-collapse-item
v-for="itemName in listName"
:key="itemName.processDefKey"
:name="itemName.processDefKey + '+' + itemName.count"
class="list"
ref="listRef"
>
<template #title>
<van-badge :content="itemName.count" color="rgb(54,149,231)">
<van-badge
:content="itemName.count"
color="rgb(54,149,231)"
>
<div class="child">
<b class="textScroll">
<van-icon name="certificate" />&ensp;{{
itemName.classifyName
}}</b>
<van-icon name="certificate" />
&ensp;
{{ itemName.modelName }}
</b>
</div>
</van-badge>
</template>
<div class="lazy-list">
<todo-list-lazy-cell :allList="list"></todo-list-lazy-cell>
<van-loading
class="loading"
v-if="loading"
vertical
/>
<todo-list-lazy-cell
v-else
ref="lazyListRef"
:allList="listObj[itemName.processDefKey]"
></todo-list-lazy-cell>
</div>
</van-collapse-item>
</van-collapse>
......@@ -27,8 +63,7 @@
</template>
<script>
import { getUserReceiveItem, getUserCreateProcess, getStatistics, getInstStatistics } from '@/api/home'
import { getDoneTask } from '@/api/taskDetail'
import { getStatistics, getInstStatistics, getUnfinishedTask, getFinishedTask, getWFInsts } from '@/api/home'
import HeaderNavBar from '@/components/headerNavBar/index.vue'
import TodoListLazyCell from '@/views/todoList/components/todoListLazyCell'
......@@ -39,7 +74,19 @@ export default {
list: [],
listName: [],
name: '',
showLoading: true
showLoading: true,
taskType: null,
classKey: null,
pagination: {
currentPage: 1,
pageSize: 10,
pageSizes: [5],
total: 10
},
stateDictName: 'ObjStatus',
dict: {},
listObj: {},
loading: false
}
},
computed: {
......@@ -67,37 +114,47 @@ export default {
this.showLoading = true
if (this.title.includes('待办')) {
this.getMyLaunchList()
this.taskType = 'TODOTASK'
} else if (this.title.includes('已办')) {
this.getDoneTask()
this.taskType = 'FINISHEDTASK'
} else if (this.title.includes('我发起')) {
this.getTaskList()
this.taskType = 'CREATETASK'
}
},
getTaskList() {
getStatistics().then((res) => {
const params = {
startedUserId: localStorage.getItem('userId'),
groupBys: ['processDefKey', 'modelName']
}
getInstStatistics(params).then((res) => {
this.handleListData(res)
})
},
getDoneTask() {
getDoneTask().then((res) => {
const params = {
assignee: localStorage.getItem('userId'),
taskQueryType: 'FINISHEDTASK',
groupBys: ['processDefKey', 'modelName']
}
getStatistics(params).then((res) => {
this.handleListData(res)
})
},
getMyLaunchList() {
getUserReceiveItem().then((res) => {
const params = {
assignee: localStorage.getItem('userId'),
taskQueryType: 'TODOTASK',
groupBys: ['processDefKey', 'modelName']
}
getStatistics(params).then((res) => {
this.handleListData(res)
})
},
handleListData(res) {
const todotitle = this.$store.state.list.TODOTITLE
const todolist = this.$store.state.list.TODOLIST
res.items.childClassify = res.items?.childClassify.filter(item => !todotitle.includes(item.classifyName))
if (res.items && res.items.childClassify) {
res.items.childClassify.map(item => {
// item.workItems = item.workItems.filter(i => todolist.includes(i.subTypeName.split('___')[1]))
item.count = item.workItems?.length
})
this.listName = res.items.childClassify
if (res.items && res.items.statistics) {
this.listName = res.items.statistics
}
this.showLoading = false
},
......@@ -113,16 +170,99 @@ export default {
})
},
tabChange(val) {
if (val) {
let list = this.list
list = this.listName.filter((item) => item.classifId === val)[0]
.workItems
if (list === null) {
list = []
}
this.list = list
// eslint-disable-next-line no-prototype-builtins
if (val && !(this.listObj.hasOwnProperty(val.split('+')[0]))) {
this.getTasks(val.split('+')[0], val.split('+')[1])
}
this.classKey = val.split('+')[0]
this.showLoading = false
},
// 获取待办任务列表
getTasks(classKey, size) {
this.loading = true
const params = {
page: 1,
size: size,
processDefKey: classKey,
assignee: localStorage.getItem('userId')
}
// eslint-disable-next-line no-prototype-builtins
if (!(this.listObj.hasOwnProperty(classKey))) {
this.listObj[classKey] = []
}
if (this.taskType === 'TODOTASK') {
getUnfinishedTask(this.$utils.filterParams(params)).then(res => {
this.reponseData(res, classKey)
})
} else if (this.taskType === 'FINISHEDTASK') {
getFinishedTask(params).then(res => {
this.reponseData(res, classKey)
})
} else if (this.taskType === 'CREATETASK') {
const instParams = {
checkOwnerSignAddFlag: true,
startedUserId: parseInt(localStorage.getItem('userId')),
processDefKey: classKey,
}
getWFInsts(instParams).then(res => {
res.items.content.forEach((item) => {
this.listObj[classKey].push({
id: item.id,
name: item.taskName || '完成',
showTitle: [{ title: item.name }],
title: item.name,
theme: '',
time: item.gmtCreate,
status: item.status,
proxyUserName: '',
expireTimeInMillis: '',
unClaimedFlag: '',
instItem: item
})
})
this.loading = false
// this.goInfo(this.taskList.length ? this.taskList[0] : null)
})
}
},
// 处理返回数据
reponseData(res, classKey) {
res.items.content.forEach((item) => {
let showTitle = []
if (item.bizExtInfo && item.bizExtInfo.bizAttrValues &&
item.bizExtInfo && item.bizExtInfo.bizConfig) {
const bizConfig = JSON.parse(item.bizExtInfo.bizConfig)
showTitle = this.showTitleParams(item.bizExtInfo.bizAttrValues, bizConfig[0].pending, (item.bizExtInfo && item.bizExtInfo.taskTitle) || '')
} else {
showTitle = [{ title: (item.bizExtInfo && item.bizExtInfo.taskTitle) || (item.bizExtInfo && item.bizExtInfo.processTitle) || '' }]
}
this.listObj[classKey].push({
id: item.id,
processInstanceId: item.processInstanceId,
name: item.aliasName || item.name,
showTitle,
theme: '',
// theme: theme,
title: item.bizExtInfo && item.bizExtInfo.taskTitle ? item.bizExtInfo.taskTitle : item.name,
time: item.startTime,
status: this.getStateDisplayName(item),
proxyUserName: item.proxyUserName || '',
expireTimeInMillis: item.expireTimeInMillis,
unClaimedFlag: item.unClaimedFlag
})
})
this.loading = false
},
getStateDisplayName(item) {
if (!item.bizExtInfo || !item.bizExtInfo.bizObjectState) {
return ''
}
const code = item.bizExtInfo.bizObjectState
return this.$utils.getParamsFromLists(this.dict[this.stateDictName], 'value', code, 'label') || code
},
async getDict(flag) {
const list = await this.$utils.getDicListByCode(this.stateDictName)
this.$set(this.dict, this.stateDictName, list)
}
}
}
......@@ -138,7 +278,7 @@ export default {
height: 60px;
}
.van-loading {
.home-loading {
margin-top: calc(60% + 60px);
}
......@@ -205,6 +345,10 @@ export default {
.lazy-list {
height: calc(100vh - 120px);
.loading {
margin-top: 10px !important;
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment