8 changed files with 41697 additions and 8 deletions
Binary file not shown.
File diff suppressed because it is too large
@ -0,0 +1,203 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-12-19 10:54:09 |
|||
@ 备注: 解析要查看的数据 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import { useRoute,useRouter } from 'vue-router' |
|||
import { userStror } from "@/utils/pinia/stores/modules/userOrders"; |
|||
import{ json2string,string2json,stringToObj } from '@/utils/lowCode/form' |
|||
import { gainTaskFormInfo,gainEditDataLog,afreshRunWorkflow } from '@/api/lowCode/taskapi/management' |
|||
|
|||
import { gainWebTaskFlowInfo } from '@/api/lowCode/form/index' |
|||
import { judgeSubmitCancel } from '@/api/lowCode/form/index' |
|||
|
|||
const userPinia = userStror(); |
|||
const router = useRouter() |
|||
const route = useRoute() |
|||
|
|||
const loading = ref(false) |
|||
const lookIsShow = ref(false) |
|||
const loadTitle = ref("数据加载中,请稍后!") |
|||
const formDesign = ref<any>(); |
|||
const flowLogPage = ref<any>(); //流程与历史记录 |
|||
const appContent = reactive<any>({ |
|||
appKey:route.query.appKey, |
|||
appId:route.query.appId, |
|||
taskId:route.query.taskId, |
|||
taskKey:route.query.taskKey, |
|||
}) |
|||
const mastersKey = ref(route.query.masters_key) |
|||
const runFlowId = ref(route.query.runFlowId) |
|||
const formDesign = ref<any>(); |
|||
const stateForm = reactive<any>({ |
|||
type: 1, // 1新增;2修改;3查看(表单模式) |
|||
formData: { |
|||
list: [], |
|||
form: {}, |
|||
config: {}, |
|||
powerstr: {}, |
|||
}, |
|||
dict: {}, |
|||
appKey: route.query.key, |
|||
appId: route.query.id, |
|||
taskTitle: route.query.title, |
|||
taskId:route.query.formid, |
|||
taskKey:route.query.formKey, |
|||
flowIsTrue:false, |
|||
flowKey:"", |
|||
loading: true, |
|||
}); |
|||
const pageLog = ref<any[]>([]); //历史记录 |
|||
const appPageInfo = ref("") |
|||
|
|||
|
|||
const getTableFormFlow = () => { |
|||
let sendVal = { |
|||
id:mastersKey.value |
|||
} |
|||
console.log("发送参数---2---》",sendVal) |
|||
gainWebTaskFlowInfo({id:mastersKey.value}) |
|||
.then((data) =>{ |
|||
console.log("接收数据---2---》",data.data) |
|||
|
|||
appPageInfo.value = data.data.taskInfo |
|||
|
|||
appContent.appKey = data.data.taskInfo.appKeyStr |
|||
appContent.appId = data.data.taskInfo.version |
|||
appContent.taskId = data.data.taskInfo.flowRunSing |
|||
appContent.taskKey = data.data.taskInfo.tableKeyStr |
|||
|
|||
|
|||
stateForm.type = 3 |
|||
stateForm.flowIsTrue = true |
|||
stateForm.flowKey = data.data.structure.flowkeystr |
|||
|
|||
|
|||
stateForm.formData = stringToObj(data.data.structure.mastesform); |
|||
stateForm.dict = string2json(data.data.structure.dict); |
|||
if(stateForm.type != 3){ |
|||
judgeSubmitCancel({ name: data.data.structure.mastesformjson }).then((dataes: any) => { |
|||
if (stateForm.type == 1) { |
|||
// console.log("添加按钮---------------->",stateForm.type,submitButtonEs); |
|||
stateForm.formData.list.push(submitButton); |
|||
} else if (stateForm.type == 2) { |
|||
stateForm.formData.list.push(submitButtonEs); |
|||
} else if (stateForm.type == 4) { |
|||
stateForm.formData.list.push(afreshSubmitButton); |
|||
} else if (stateForm.type == 5) { |
|||
stateForm.formData.list.push(afreshSubmitButton); |
|||
} else if (stateForm.type == 6) { |
|||
stateForm.formData.list.push(editFormCont); |
|||
} |
|||
}) |
|||
} |
|||
nextTick(() => { |
|||
// console.log("获取自定义表单内容-1111-->", stateForm, data.tableData); |
|||
if(stateForm.type != 1){ |
|||
formDesign.value.setValue(data.data.tableData); |
|||
} |
|||
}); |
|||
|
|||
}) |
|||
.finally(() => { |
|||
lookIsShow.value = true |
|||
if(stateForm.type != 1){ |
|||
gainEditDataLog({ id: mastersKey.value }).then(({ data }) => { |
|||
console.log("获取修改记录-1111-->",data) |
|||
pageLog.value = data; |
|||
}); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
onBeforeMount(() => { |
|||
loading.value = true |
|||
if(userPinia.judgeIsLogin(route.query.userkey,route.query.token)){ |
|||
console.log("判断是否登录---2---》",userPinia.userKeying,userPinia.userToken) |
|||
loading.value = false |
|||
getTableFormFlow() |
|||
}else{ |
|||
if(judgingEnvironment() != 1){ |
|||
window.location.href="http://wab.hxgk.group/systemapi/wechat/obtaOnePage?systemapp="+import.meta.env.VITE_APP_SYSTEM_APP+"&isagain="+import.meta.env.VITE_APP_AGAIN+"&userid="+route.query.userid |
|||
}else{ |
|||
loadTitle.value = "请在企业微信中打开!" |
|||
} |
|||
} |
|||
|
|||
}) |
|||
|
|||
|
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-10-23 13:46:25 |
|||
@ 功能: 判断登录环境 |
|||
*/ |
|||
const judgingEnvironment = () => { |
|||
let huanjing = window.navigator.userAgent.toLowerCase() |
|||
if( (huanjing.match(/MicroMessenger/i) == 'micromessenger') && (huanjing.match(/wxwork/i) == 'wxwork') ){ |
|||
return 3; |
|||
}else if( huanjing.match(/MicroMessenger/i) == 'micromessenger' ){ |
|||
return 2; |
|||
}else{ |
|||
return 1; |
|||
} |
|||
return 3; |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-04-07 10:55:34 |
|||
@ 功能: 表单动作回调 |
|||
*/ |
|||
const afterSubmit = (type: string,val?:any) => { |
|||
console.log("表单提交成功",type) |
|||
|
|||
switch (type) { |
|||
case "success": |
|||
|
|||
|
|||
break; |
|||
case "runFlow": |
|||
flowLogPage.value.runWorkFlow(val) |
|||
|
|||
|
|||
break |
|||
case "reapplyFlow": |
|||
flowLogPage.value.reapplyWorkFlow(val) |
|||
|
|||
|
|||
|
|||
break; |
|||
case "draftRunFlow": |
|||
flowLogPage.value.rundraftWorkFlow(val) |
|||
|
|||
|
|||
break; |
|||
case "closePage": |
|||
|
|||
|
|||
break; |
|||
default: |
|||
} |
|||
}; |
|||
</script> |
|||
<template> |
|||
<el-scrollbar v-loading="loading" :element-loading-text="loadTitle" ref="taskScrollbar" class="pageBox" > |
|||
<FormDesign |
|||
ref="formDesign" |
|||
:type="stateForm.type" |
|||
:form-data="stateForm.formData" |
|||
:is-work-flow="stateForm.flowIsTrue" |
|||
:app-info="appContent" |
|||
:after-submit="afterSubmit" |
|||
/> |
|||
<FlowAndLog v-if="lookIsShow" ref="flowLogPage" :types="stateForm.type" :app-flow-info="appFlowInfo" :app-info="appContent" :log-list="pageLog" :app-page-info="appPageInfo" :state-form="stateForm" /> |
|||
</el-scrollbar> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.pageBox{ |
|||
width: 100%; |
|||
padding: 0px 10px 0 10px; |
|||
height: 100vh; |
|||
} |
|||
</style> |
|||
Loading…
Reference in new issue