Browse Source

flowable集成完成,采购申请流程的测试

master
djz8236 2 years ago
parent
commit
1b174ef738
  1. 2
      yxt-portal-ui/.env.development
  2. 2
      yxt-portal-ui/.env.production
  3. 0
      yxt-portal-ui/src/api/User/user.js
  4. 0
      yxt-portal-ui/src/api/permission.js
  5. 6
      yxt-portal-ui/src/api/system/dictType/dictCommon.js
  6. 2
      yxt-portal-ui/src/api/system/postManage/index.js
  7. 2
      yxt-portal-ui/src/api/system/roleAdminister/index.js
  8. 11
      yxt-portal-ui/src/api/user.js
  9. 47
      yxt-portal-ui/src/main.js
  10. 12
      yxt-portal-ui/src/permission.js
  11. 20
      yxt-portal-ui/src/store/modules/permission.js
  12. 2
      yxt-portal-ui/src/views/flow/doneList.vue
  13. 162
      yxt-portal-ui/src/views/flow/todoList.vue
  14. 2
      yxt-portal-ui/vue.config.js

2
yxt-portal-ui/.env.development

@ -5,5 +5,5 @@ ENV = 'development'
VUE_APP_BASE_API = '/api'
## 配置测试和本地开发时的 接口地址
VUE_APP_URL = "http://192.168.3.173:8112"
VUE_APP_URL = "http://127.0.0.1:8112"
##VUE_APP_URL = "http://8.130.39.13:8112"

2
yxt-portal-ui/.env.production

@ -5,5 +5,5 @@ ENV = 'production'
VUE_APP_BASE_API = '/api'
## 配置 正式接口地址
VUE_APP_URL = "http://120.46.131.15:8111"
VUE_APP_URL = "http://jianguan.yyundong.com/"

0
yxt-portal-ui/src/api/User/user.js

0
yxt-portal-ui/src/api/permission.js

6
yxt-portal-ui/src/api/system/dictType/dictCommon.js

@ -15,7 +15,7 @@ export function dictCommonList(data) {
//保存 字典子级
export function savedictCommon(data) {
return request({
url: '/portal/v1/dictcommons/save',
url: '/portal/v1/dictcommon/save',
method: 'POST',
data: data ,
headers: {'Content-Type': 'application/json',
@ -36,7 +36,7 @@ export function getRoleInfo(data) {
//根据sid 修改 数据字典
export function putdictCommon(data) {
return request({
url: '/portal/v1/dictcommons/update/' + data.sid,
url: '/portal/v1/dictcommon/update/' + data.sid,
method: 'POST',
data: data ,
headers: {'Content-Type': 'application/json',
@ -48,7 +48,7 @@ export function putdictCommon(data) {
//根据sid 删除菜单 信息
export function deldictCommon(data) {
return request({
url: '/portal/v1/dictcommons/delete/' + data.sid,
url: '/portal/v1/dictcommon/delete/' + data.sid,
method: 'DELETE',
data: data,
headers: {'Content-Type': 'application/json',

2
yxt-portal-ui/src/api/system/postManage/index.js

@ -62,7 +62,7 @@ export function delOrgroles(data){
export function pullDown(data){
return request({
url: '/portal/v1/dictcommons/typeValues',
url: '/portal/v1/dictcommon/typeValues',
method: 'get',
params: data
})

2
yxt-portal-ui/src/api/system/roleAdminister/index.js

@ -26,7 +26,7 @@ export function postList(data){
// 获取数据字典下拉列表
export function typeValues(data) {
return request({
url: '/portal/v1/dictcommons/typeValues',
url: '/portal/v1/dictcommon/typeValues',
method: 'get',
params: data
})

11
yxt-portal-ui/src/api/user.js

@ -1,12 +1,10 @@
import request from '@/utils/request'
import qs from 'qs'
//登录
export function login(data) {
return request({
url: '/portal/v1/sysuser/login',
method: 'post',
data: data,
headers: {'Content-Type': 'application/json'}
headers: { 'Content-Type': 'application/json' }
})
}
// 用户注册
@ -15,8 +13,11 @@ export function registUser(data) {
url: '/system/user/save',
method: 'post',
data,
headers:{'Content-Type':'application/x-www-form-urlencoded;'}
headers: { 'Content-Type': 'application/x-www-form-urlencoded;' }
})
}
export function logout() {
}
// 获取手机验证码
export function getVerificationCode(data) {
@ -39,7 +40,7 @@ export function imgCode() {
export function getInfo(token) {
return request({
url: '/system/user/loginDetails',
method: 'post',
method: 'post'
})
}

47
yxt-portal-ui/src/main.js

@ -14,23 +14,22 @@ import store from './store'
import router from './router'
import '@/icons' // icon
//import '@/permission' //权限控制
Vue.prototype.$userInfo = null // 用户信息
Vue.prototype.msgSuccess = function (msg) {
alert(msg);
Vue.prototype.msgSuccess = function(msg) {
alert(msg)
}
// 全局自定义组件
import Pagination from '@/components/pagination/index.vue'
Vue.component("Pagination", Pagination)
Vue.component('Pagination', Pagination)
import tabsearch from '@/components/tab-search/index.vue'
Vue.component("tab-search", tabsearch)
import eimage from "@/components/E-image/index.vue"
Vue.component('tab-search', tabsearch)
import eimage from '@/components/E-image/index.vue'
Vue.component("eimage", eimage);
Vue.component('eimage', eimage)
// 全局组件挂载
Vue.component('Pagination', Pagination)
@ -38,31 +37,29 @@ Vue.component('Pagination', Pagination)
import Print from '@/utils/print' // 引入附件的js文件
Vue.use(Print) // 注册
import {setStorage, getStorage} from "./utils/auth.js"
let token = null;
token = GetQueryString("token")
// let token = null
// token = GetQueryString('token')
//if (token) {
//setStorage(token)
//let href = window.location.href;
//href = href.split(`token=${token}`)[0];
//window.location.href = href.slice(0, href.length - 1);
//}
// if (token) {
// setStorage(token)
// let href = window.location.href;
// href = href.split(`token=${token}`)[0];
// window.location.href = href.slice(0, href.length - 1);
// }
function GetQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
// function GetQueryString(name) {
// var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
// var r = window.location.search.substr(1).match(reg)
// if (r != null) return unescape(r[2])
// return null
// }
import VueAMap from 'vue-amap'
Vue.use(VueAMap)
VueAMap.initAMapApiLoader({
key: 'ccda12d8bffc72e9f1a32c599323a876',//此处的key,在高德开放平台申请
plugin: ['AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PlaceSearch', 'AMap.Geolocation', 'AMap.Geocoder'],//此处的插件按需添加
key: 'ccda12d8bffc72e9f1a32c599323a876', // 此处的key,在高德开放平台申请
plugin: ['AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PlaceSearch', 'AMap.Geolocation', 'AMap.Geocoder'], // 此处的插件按需添加
v: '1.4.4',
uiVersion: '1.0'
})

12
yxt-portal-ui/src/permission.js

@ -7,11 +7,9 @@ import 'nprogress/nprogress.css' // progress bar style
import getPageTitle from '@/utils/get-page-title'
NProgress.configure({ showSpinner: false }) // NProgress Configuration
import { getStorage } from '@/utils/auth' // get token from cookie
// get token from cookie
import { getRoleRouter } from '@/router/modules/components.js'
const whiteList = ['/login', '/registUser', '/registOrg'] // no redirect whitelist
router.beforeEach(async(to, from, next) => {
// start progress bar
NProgress.start()
@ -20,9 +18,8 @@ router.beforeEach(async(to, from, next) => {
document.title = getPageTitle(to.meta.title)
// determine whether the user has logged in
//const hasToken = getStorage()
// const hasToken = getStorage()
const hasToken = window.sessionStorage.getItem('token')
console.log(hasToken)
if (hasToken) {
const userInfo = store.getters.userInfo
if (userInfo) {
@ -33,18 +30,15 @@ router.beforeEach(async(to, from, next) => {
} else {
console.log('无 userInfo')
await store.dispatch('user/getInfo')
let userRoles = await getRoleRouter(store.getters.userInfo.userSid)
console.log("userRoles",userRoles)
const userRoles = await getRoleRouter(store.getters.userInfo.userSid)
router.options.routes = userRoles
router.addRoutes(userRoles) // 动态添加可访问路由表
console.log(to)
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace:
}
} else {
console.log('222')
window.location.href = process.env.VUE_APP_URL
}
})
router.afterEach(() => {

20
yxt-portal-ui/src/store/modules/permission.js

@ -1,4 +1,4 @@
import { asyncRoutes, constantRoutes } from '@/router'
import { constantRoutes } from '@/router'
/**
* Use meta.role to determine if the current user has permission
@ -46,24 +46,8 @@ const mutations = {
}
}
const actions = {
generateRoutes({ commit }, roles) {
return new Promise(resolve => {
let accessedRoutes
if (roles.includes('admin')) {
accessedRoutes = asyncRoutes || []
} else {
accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
}
commit('SET_ROUTES', accessedRoutes)
resolve(accessedRoutes)
})
}
}
export default {
namespaced: true,
state,
mutations,
actions
mutations
}

2
yxt-portal-ui/src/views/flow/doneList.vue

@ -273,7 +273,7 @@ import flowRecords from '@/components/flow/flowRecord'
selectUrl(this.selectUrl_list).then((response) => {
if (response.success && response.data.url !== '') {
// this.url = 'http://127.0.0.1:9531' + response.data.url + '?token=' + getStorage() + '&data=' + encodeURI((JSON.stringify(parameter_list)))
this.url = 'http://anrui.yyundong.com' + response.data.url + '?token=' + getStorage() + '&data=' + encodeURI((JSON.stringify(parameter_list)))
this.url = "http://jianguan.yyundong.com"+ response.data.url + '?token=' + getStorage() + '&data=' + encodeURI((JSON.stringify(parameter_list)))
// this.url = 'http://120.46.172.184' + response.data.url + '?token=' + getStorage() + '&data=' + encodeURI((JSON.stringify(parameter_list)))
} else if (response.success && response.data.url === '') {
this.$notify({

162
yxt-portal-ui/src/views/flow/todoList.vue

@ -2,7 +2,7 @@
<div class="app-container">
<div class="tab-header webtop">
<div style="text-align: right">
<!-- <router-link tag='a' :to="'/home'">&nbsp;返回首页</router-link>-->
<!-- <router-link tag='a' :to="'/home'">&nbsp;返回首页</router-link>-->
<a href="javascript:window.opener=null;window.open('','_self');window.close();" class="text-center">关闭</a>
</div>
</div>
@ -10,16 +10,24 @@
<div class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header">
<el-form-item label="流程名称">
<el-input v-model="listQuery.params.proDefName" placeholder="流程名称" clearable></el-input>
<el-input v-model="listQuery.params.proDefName" placeholder="流程名称" clearable />
</el-form-item>
<el-form-item label="申请日期">
<el-date-picker v-model="listQuery.params.startDate" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"></el-date-picker>
<el-date-picker
v-model="listQuery.params.startDate"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
/>
<label></label>
<el-date-picker v-model="listQuery.params.endDate" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"></el-date-picker>
<el-date-picker
v-model="listQuery.params.endDate"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
/>
</el-form-item>
<el-button type="primary" @click="handleFilter">查询</el-button>
</el-form>
@ -27,13 +35,25 @@
</div>
<div class="listtop">
<div class="tit">待办任务列表</div>
<pageye v-show="total>0" :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size"
class="pagination" @pagination="getList"/>
<pageye
v-show="total>0"
:total="total"
:page.sync="listQuery.current"
:limit.sync="listQuery.size"
class="pagination"
@pagination="getList"
/>
</div>
<div class="listcon">
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width:100%"
@selection-change="handleSelectionChange">
<el-table-column width="60px" label="序号" type="index" :index="tableKey+1" align="center"/>
<el-table
:key="tableKey"
v-loading="listLoading"
:data="list"
border
style="width:100%"
@selection-change="handleSelectionChange"
>
<el-table-column width="60px" label="序号" type="index" :index="tableKey+1" align="center" />
<el-table-column width="100px" label="操作" align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="handleCheck(scope.row)">办理</el-button>
@ -47,46 +67,51 @@
<!-- </el-table-column>-->
<el-table-column label="工作名称" align="center">
<template slot-scope="scope">
<span>{{scope.row.procDefName}}</span>
<span>{{ scope.row.procDefName }}</span>
</template>
</el-table-column>
<el-table-column width="100px" label="发起人" align="center">
<template slot-scope="scope">
<span>{{scope.row.startUserName}}</span>
<span>{{ scope.row.startUserName }}</span>
</template>
</el-table-column>
<el-table-column width="100px" label="发起日期" align="center">
<template slot-scope="scope">
<span>{{scope.row.createTime|formatTimer}}</span>
<span>{{ scope.row.createTime|formatTimer }}</span>
</template>
</el-table-column>
<el-table-column label="发起部门" align="center">
<template slot-scope="scope">
<span>{{scope.row.startDeptName}}</span>
<span>{{ scope.row.startDeptName }}</span>
</template>
</el-table-column>
<el-table-column width="100px" label="提交日期" align="center">
<template slot-scope="scope">
<span>{{scope.row.processCreateTime|formatTimer}}</span>
<span>{{ scope.row.processCreateTime|formatTimer }}</span>
</template>
</el-table-column>
<el-table-column label="当前环节" align="center">
<template slot-scope="scope">
<span class="bluezi" @click="handleFlowRecord(scope.row)">{{scope.row.taskName}}</span>
<span class="bluezi" @click="handleFlowRecord(scope.row)">{{ scope.row.taskName }}</span>
</template>
</el-table-column>
<!-- <el-table-column width="80px" label="审批记录" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button type="primary" size="small" @click="handleFlowRecord(scope.row)">查看</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column width="80px" label="审批记录" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button type="primary" size="small" @click="handleFlowRecord(scope.row)">查看</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</div>
<div class="pages">
<div class="tit"/>
<pagination v-show="total>0" :total="total"
:page.sync="listQuery.current" :limit.sync="listQuery.size"
class="pagination" @pagination="getList"/>
<div class="tit" />
<pagination
v-show="total>0"
:total="total"
:page.sync="listQuery.current"
:limit.sync="listQuery.size"
class="pagination"
@pagination="getList"
/>
</div>
<!-- Start办理页面 -->
@ -96,14 +121,15 @@
width="78%"
height="1%"
:before-close="closeIt"
center>
<iframe frameborder="0" id="iframe" style="width:100%;" :src="this.centerDialogVisible === true ? url :''"></iframe>
center
>
<iframe id="iframe" frameborder="0" style="width:100%;" :src= " this.centerDialogVisible === true ? url :''" />
</el-dialog>
<!-- End办理页面-->
<!-- 编辑信息页面 -->
<el-dialog title="审批记录" :visible.sync="editDialog" width="80%" style="overflow: hidden">
<flow-records :xmlData="xmlData" :taskData="taskList" :flowRecordList="flowRecordList"></flow-records>
<flow-records :xml-data="xmlData" :task-data="taskList" :flow-record-list="flowRecordList" />
</el-dialog>
</div>
@ -122,6 +148,26 @@ export default {
components: {
pageye, Pagination, flowRecords
},
filters: {
formatTimer: function(value) {
const date = new Date(value)
const y = date.getFullYear()
let MM = date.getMonth() + 1
MM = MM < 10 ? '0' + MM : MM
let d = date.getDate()
d = d < 10 ? '0' + d : d
// eslint-disable-next-line no-unused-vars
let h = date.getHours()
h = h < 10 ? '0' + h : h
// eslint-disable-next-line no-unused-vars
let m = date.getMinutes()
m = m < 10 ? '0' + m : m
// eslint-disable-next-line no-unused-vars
let s = date.getSeconds()
s = s < 10 ? '0' + s : s
return y + '-' + MM + '-' + d // + " " + h + ":" + m;
}
},
data() {
return {
taskList: [],
@ -189,23 +235,6 @@ export default {
this.init()
//
},
filters: {
formatTimer: function(value) {
let date = new Date(value)
let y = date.getFullYear()
let MM = date.getMonth() + 1
MM = MM < 10 ? '0' + MM : MM
let d = date.getDate()
d = d < 10 ? '0' + d : d
let h = date.getHours()
h = h < 10 ? '0' + h : h
let m = date.getMinutes()
m = m < 10 ? '0' + m : m
let s = date.getSeconds()
s = s < 10 ? '0' + s : s
return y + '-' + MM + '-' + d // + " " + h + ":" + m;
}
},
methods: {
/** xml 文件 */
@ -219,7 +248,7 @@ export default {
//
getFlowViewer(procInsId) {
var token = getStorage()
getFlowViewer(procInsId,token).then(res => {
getFlowViewer(procInsId, token).then(res => {
this.taskList = res.data
})
},
@ -227,13 +256,16 @@ export default {
iframe.height = this.dialogHeight // iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;
},
async handleMessage(event) {
var code = event.data.params.code
if (code == 1) {
this.init()
this.centerDialogVisible = false
} else if (code == 2) {
this.dialogHeight = event.data.params.data
this.setIframeHeight(document.getElementById('iframe'))
if (event !== undefined) {
var code = event.data.params.code
if (code === 1) {
this.init()
this.centerDialogVisible = false
} else if (code === 2) {
this.dialogHeight = event.data.params.data
this.setIframeHeight(document.getElementById('iframe'))
}
}
},
init() {
@ -280,8 +312,8 @@ export default {
}
selectUrl(this.selectUrl_list).then((response) => {
if (response.success && response.data.url !== '') {
// this.url = 'http://127.0.0.1:9531' + response.data.url + '?token=' + getStorage() + '&data=' + encodeURI((JSON.stringify(parameter_list)))
this.url = 'http://anrui.yyundong.com' + response.data.url + '?token=' + getStorage() + '&data=' + encodeURI((JSON.stringify(parameter_list)))
//this.url = 'http://127.0.0.1:9531' + response.data.url + '?token=' + getStorage() + '&data=' + encodeURI((JSON.stringify(parameter_list)))
this.url = "http://jianguan.yyundong.com" + response.data.url + '?token=' + getStorage() + '&data=' + encodeURI((JSON.stringify(parameter_list)))
// this.url = 'http://120.46.172.184' + response.data.url + '?token=' + getStorage() + '&data=' + encodeURI((JSON.stringify(parameter_list)))
console.log('已办拼接url:', this.url)
} else if (response.success && response.data.url === '') {
@ -422,13 +454,13 @@ export default {
handleFlowRecord(row) {
this.getModelDetail(row.deployId)
this.getFlowViewer(row.procInsId)
this.getFlowRecordList(row.procInsId,row.deployId)
this.getFlowRecordList(row.procInsId, row.deployId)
this.editDialog = true
},
/** 流程流转记录 */
getFlowRecordList(procInsId, deployId) {
var token = getStorage()
const params = {procInsId: procInsId, deployId: deployId,token: token }
const params = { procInsId: procInsId, deployId: deployId, token: token }
flowRecord(params).then(res => {
this.flowRecordList = res.data.flowList
//
@ -465,20 +497,20 @@ export default {
},
indexMethod() {
return 0;
return 0
},
setIcon(val) {
if (val) {
return "el-icon-check";
return 'el-icon-check'
} else {
return "el-icon-time";
return 'el-icon-time'
}
},
setColor(val) {
if (val) {
return "#2bc418";
return '#2bc418'
} else {
return "#b3bdbb";
return '#b3bdbb'
}
}
}

2
yxt-portal-ui/vue.config.js

@ -27,7 +27,7 @@ module.exports = {
publicPath: '/',
outputDir: 'portal-ui',
assetsDir: 'static',
lintOnSave: process.env.NODE_ENV === 'development',
lintOnSave: false ,
productionSourceMap: false,
devServer: {
hot: true, // 自动保存

Loading…
Cancel
Save