Commit 40114f1a by yuwei

项目初始化

parent a9ce480c
...@@ -5,6 +5,7 @@ import cn.datax.common.utils.ThrowableUtil; ...@@ -5,6 +5,7 @@ import cn.datax.common.utils.ThrowableUtil;
import cn.datax.service.data.masterdata.api.entity.ModelEntity; import cn.datax.service.data.masterdata.api.entity.ModelEntity;
import cn.datax.service.data.masterdata.dao.ModelDao; import cn.datax.service.data.masterdata.dao.ModelDao;
import cn.datax.service.workflow.api.enums.VariablesEnum; import cn.datax.service.workflow.api.enums.VariablesEnum;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.rabbitmq.client.Channel; import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message; import org.springframework.amqp.core.Message;
...@@ -41,10 +42,10 @@ public class RabbitMqListenerConfig { ...@@ -41,10 +42,10 @@ public class RabbitMqListenerConfig {
String businessKey = (String) map.get(VariablesEnum.businessKey.toString()); String businessKey = (String) map.get(VariablesEnum.businessKey.toString());
String businessCode = (String) map.get(VariablesEnum.businessCode.toString()); String businessCode = (String) map.get(VariablesEnum.businessCode.toString());
String flowStatus = (String) map.get("flowStatus"); String flowStatus = (String) map.get("flowStatus");
ModelEntity model = new ModelEntity(); LambdaUpdateWrapper<ModelEntity> updateWrapper = new LambdaUpdateWrapper<>();
model.setId(businessKey); updateWrapper.set(ModelEntity::getFlowStatus, flowStatus);
model.setFlowStatus(flowStatus); updateWrapper.eq(ModelEntity::getId, businessKey);
modelDao.updateById(model); modelDao.update(null, updateWrapper);
} catch (Exception e) { } catch (Exception e) {
log.error("全局异常信息ex={}, StackTrace={}", e.getMessage(), ThrowableUtil.getStackTrace(e)); log.error("全局异常信息ex={}, StackTrace={}", e.getMessage(), ThrowableUtil.getStackTrace(e));
if (message.getMessageProperties().getRedelivered()){ if (message.getMessageProperties().getRedelivered()){
......
...@@ -178,7 +178,8 @@ export default { ...@@ -178,7 +178,8 @@ export default {
}, },
async logout() { async logout() {
await this.$store.dispatch('user/logout') await this.$store.dispatch('user/logout')
this.$router.push(`/login?redirect=${this.$route.fullPath}`) // this.$router.push(`/login?redirect=${this.$route.fullPath}`)
this.$router.push('/login')
}, },
handlePassword() { handlePassword() {
this.dialogHandlePasswordVisible = true this.dialogHandlePasswordVisible = true
......
...@@ -115,3 +115,12 @@ export function param2Obj(url) { ...@@ -115,3 +115,12 @@ export function param2Obj(url) {
}) })
return obj return obj
} }
export function formatDuration(mss) {
const days = Math.floor(mss / (1000 * 60 * 60 * 24))
const hours = Math.floor((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
const minutes = Math.floor((mss % (1000 * 60 * 60)) / (1000 * 60))
const seconds = Math.round((mss % (1000 * 60)) / 1000)
return ((days > 0) ? days + '天' : '') + ((hours > 0) ? hours + '小时' : '') +
((minutes > 0) ? minutes + '分钟' : '') + ((seconds > 0) ? seconds + '秒' : '')
}
...@@ -43,8 +43,8 @@ export default { ...@@ -43,8 +43,8 @@ export default {
return { return {
background: background, background: background,
loginForm: { loginForm: {
username: 'admin', username: '',
password: '123456' password: ''
}, },
loginRules: { loginRules: {
username: [{ required: true, trigger: 'blur', validator: validateUsername }], username: [{ required: true, trigger: 'blur', validator: validateUsername }],
......
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
<script> <script>
import { pageMyInvolvedInstance } from '@/api/workflow/instance' import { pageMyInvolvedInstance } from '@/api/workflow/instance'
import FlowImage from '../components/FlowImage' import FlowImage from '../components/FlowImage'
import { formatDuration } from '@/utils'
export default { export default {
name: 'MyInvolvedInstanceList', name: 'MyInvolvedInstanceList',
...@@ -98,7 +99,7 @@ export default { ...@@ -98,7 +99,7 @@ export default {
{ prop: 'name', label: '流程实列名称', show: true }, { prop: 'name', label: '流程实列名称', show: true },
{ prop: 'startTime', label: '开始时间', show: true }, { prop: 'startTime', label: '开始时间', show: true },
{ prop: 'endTime', label: '结束时间', show: true }, { prop: 'endTime', label: '结束时间', show: true },
{ prop: 'durationInMillis', label: '耗时', show: true } { prop: 'durationInMillis', label: '耗时', show: true, formatter: this.durationFormatter }
], ],
// 表格数据 // 表格数据
tableDataList: [], tableDataList: [],
...@@ -159,6 +160,9 @@ export default { ...@@ -159,6 +160,9 @@ export default {
console.log(`当前页: ${val}`) console.log(`当前页: ${val}`)
this.queryParams.pageNum = val this.queryParams.pageNum = val
this.getList() this.getList()
},
durationFormatter(row, column, cellValue, index) {
return formatDuration(cellValue)
} }
} }
} }
......
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
<script> <script>
import { pageMyStartedInstance } from '@/api/workflow/instance' import { pageMyStartedInstance } from '@/api/workflow/instance'
import FlowImage from '../components/FlowImage' import FlowImage from '../components/FlowImage'
import { formatDuration } from '@/utils'
export default { export default {
name: 'MyStartedInstanceList', name: 'MyStartedInstanceList',
...@@ -98,7 +99,7 @@ export default { ...@@ -98,7 +99,7 @@ export default {
{ prop: 'name', label: '流程实列名称', show: true }, { prop: 'name', label: '流程实列名称', show: true },
{ prop: 'startTime', label: '开始时间', show: true }, { prop: 'startTime', label: '开始时间', show: true },
{ prop: 'endTime', label: '结束时间', show: true }, { prop: 'endTime', label: '结束时间', show: true },
{ prop: 'durationInMillis', label: '耗时', show: true } { prop: 'durationInMillis', label: '耗时', show: true, formatter: this.durationFormatter }
], ],
// 表格数据 // 表格数据
tableDataList: [], tableDataList: [],
...@@ -159,6 +160,9 @@ export default { ...@@ -159,6 +160,9 @@ export default {
console.log(`当前页: ${val}`) console.log(`当前页: ${val}`)
this.queryParams.pageNum = val this.queryParams.pageNum = val
this.getList() this.getList()
},
durationFormatter(row, column, cellValue, index) {
return formatDuration(cellValue)
} }
} }
} }
......
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
<script> <script>
import { pageDoneTask } from '@/api/workflow/task' import { pageDoneTask } from '@/api/workflow/task'
import { formatDuration } from '@/utils'
export default { export default {
name: 'TaskDoneList', name: 'TaskDoneList',
...@@ -85,7 +86,7 @@ export default { ...@@ -85,7 +86,7 @@ export default {
{ prop: 'businessName', label: '业务名称', show: true }, { prop: 'businessName', label: '业务名称', show: true },
{ prop: 'createTime', label: '开始时间', show: true }, { prop: 'createTime', label: '开始时间', show: true },
{ prop: 'endTime', label: '结束时间', show: true }, { prop: 'endTime', label: '结束时间', show: true },
{ prop: 'durationInMillis', label: '耗时', show: true } { prop: 'durationInMillis', label: '耗时', show: true, formatter: this.durationFormatter }
], ],
// 表格数据 // 表格数据
tableDataList: [], tableDataList: [],
...@@ -142,12 +143,8 @@ export default { ...@@ -142,12 +143,8 @@ export default {
this.queryParams.pageNum = val this.queryParams.pageNum = val
this.getList() this.getList()
}, },
statusFormatter(row, column, cellValue, index) { durationFormatter(row, column, cellValue, index) {
if (cellValue === 1) { return formatDuration(cellValue)
return <el-tag type='success'>激活</el-tag>
} else if (cellValue === 2) {
return <el-tag type='warning'>挂起</el-tag>
}
} }
} }
} }
......
...@@ -249,13 +249,6 @@ export default { ...@@ -249,13 +249,6 @@ export default {
console.log(`当前页: ${val}`) console.log(`当前页: ${val}`)
this.queryParams.pageNum = val this.queryParams.pageNum = val
this.getList() this.getList()
},
statusFormatter(row, column, cellValue, index) {
if (cellValue === 1) {
return <el-tag type='success'>激活</el-tag>
} else if (cellValue === 2) {
return <el-tag type='warning'>挂起</el-tag>
}
} }
} }
} }
......
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