Browse Source

增加向企业微信发送信息

qin_v5
hreenshan112 11 months ago
parent
commit
e41c2633da
  1. 8
      src/api/lowCode/form/index.ts
  2. 6
      src/api/lowCode/taskapi/management.ts
  3. BIN
      src/assets/icons/weworkapi_golang-master.zip
  4. 41457
      src/assets/image/JSON在线校验格式化工具(Be JSON).mhtml
  5. 11
      src/utils/router/index.ts
  6. 15
      src/views/formTable/page/flowAndLog.vue
  7. 5
      src/views/formTable/pageInfo.vue
  8. 203
      src/views/lookCodePage/index.vue

8
src/api/lowCode/form/index.ts

@ -54,3 +54,11 @@ export function gainNumber(data?:any){
data: data data: data
}); });
} }
//获取web表单数据
export function gainWebTaskFlowInfo(data?:any){
return request({
url: '/systemapi/task_management/gainWebTaskFlowInfo',
method: 'post',
data: data
});
}

6
src/api/lowCode/taskapi/management.ts

@ -156,7 +156,8 @@ export function authorizeWorkflow(data?:any){
export function runTaskFlow(data?:any){ export function runTaskFlow(data?:any){
return request({ return request({
url: '/systemapi/task_management/runTaskFlow', // url: '/systemapi/task_management/runTaskFlow',
url: '/systemapi/flow/runTaskFlow',
method: 'post', method: 'post',
data: data data: data
}); });
@ -213,7 +214,8 @@ export function createAppTask(data?:any){
//发起工作流 //发起工作流
export function startRunFlow(data?:any){ export function startRunFlow(data?:any){
return request({ return request({
url: '/systemapi/task_management/startRunWorkFlow', // url: '/systemapi/task_management/startRunWorkFlow',
url: '/systemapi/flow/startProcess',
// url: '/systemapi/task_flow/startRunFlow', // url: '/systemapi/task_flow/startRunFlow',
method: 'post', method: 'post',
data: data data: data

BIN
src/assets/icons/weworkapi_golang-master.zip

Binary file not shown.

41457
src/assets/image/JSON在线校验格式化工具(Be JSON).mhtml

File diff suppressed because it is too large

11
src/utils/router/index.ts

@ -7,7 +7,7 @@ import { useUserStoreHook } from '@/utils/pinia/stores/modules/userOrders'
const appTokenKey = import.meta.env.VITE_APP_TOKEN_KEY //声明apptoken字符串 const appTokenKey = import.meta.env.VITE_APP_TOKEN_KEY //声明apptoken字符串
NProgress.configure({ showSpinner: false }); // 进度条 NProgress.configure({ showSpinner: false }); // 进度条
// 白名单路由 // 白名单路由
const whiteList = ["/login"]; const whiteList = ["/login","/work_wechat"];
/** /**
@ 作者: 秦东 @ 作者: 秦东
@ -64,6 +64,11 @@ export const staticRouting : RouteRecordRaw[] = [
path: '/user', path: '/user',
component: () => import('@/views/user/index.vue'), component: () => import('@/views/user/index.vue'),
meta: { hidden: true }, meta: { hidden: true },
},
{
path: '/work_wechat',
component: () => import('@/views/lookCodePage/index.vue'),
meta: { hidden: true },
} }
] ]
@ -100,6 +105,10 @@ router.beforeEach(async (to:any, from:any, next:any) => {
next({ path: "/" }); next({ path: "/" });
NProgress.done(); NProgress.done();
break; break;
case "/work_wechat":
next();
NProgress.done();
break;
default: default:
const userStore = useUserStoreHook(); const userStore = useUserStoreHook();
const hasRoles = userStore.userKeying && userStore.userKeying.length > 0; const hasRoles = userStore.userKeying && userStore.userKeying.length > 0;

15
src/views/formTable/page/flowAndLog.vue

@ -81,6 +81,10 @@ onBeforeMount(() => {
}) })
watch(()=>props.stateForm,(val)=>{
newAddPageData()
},{tree:true})
/** /**
@ 作者: 秦东 @ 作者: 秦东
@ 时间: 2024-11-19 10:41:41 @ 时间: 2024-11-19 10:41:41
@ -89,12 +93,13 @@ onBeforeMount(() => {
const newAddPageData = () => { const newAddPageData = () => {
flowLoading.value = true flowLoading.value = true
if(types.value == 1){ if(types.value == 1){
// console.log("",props.stateForm.flowIsTrue,props.stateForm.flowKey) console.log("新增时获取流程列表3",props.stateForm)
console.log("新增时获取流程列表1",props.stateForm.flowIsTrue,props.stateForm.flowKey)
if(props.stateForm&&props.stateForm.flowIsTrue&&props.stateForm.flowKey){ if(props.stateForm&&props.stateForm.flowIsTrue&&props.stateForm.flowKey){
gainRunFlowStart({id:props.stateForm.flowKey}) gainRunFlowStart({id:props.stateForm.flowKey})
.then(({data})=>{ .then(({data})=>{
// console.log("==1==>",data) console.log("获取流程==1==>",data)
flowMap.value = data.flowList flowMap.value = data.flowList
nextStep.value = data.nextStep nextStep.value = data.nextStep
currentProgress.value = data.Step currentProgress.value = data.Step
@ -109,11 +114,11 @@ const newAddPageData = () => {
} }
}else{ }else{
// console.log("==2=1=>",props.appPageInfo) console.log("获取流程==2=1=>",props.appPageInfo)
if(props.appPageInfo && props.appPageInfo.runFlowId && props.appPageInfo.runFlowId != "0" && props.appPageInfo.runFlowId != ""){ if(props.appPageInfo && props.appPageInfo.runFlowId && props.appPageInfo.runFlowId != "0" && props.appPageInfo.runFlowId != ""){
gainRunTaskFlow({id:props.appPageInfo.runFlowId}) gainRunTaskFlow({id:props.appPageInfo.runFlowIdStr})
.then(({data})=>{ .then(({data})=>{
// console.log("==2==>",data) console.log("获取流程==2==>",data)
flowMap.value = data.flowList flowMap.value = data.flowList
flowOpinion.value = data.operational flowOpinion.value = data.operational
currentProgress.value = data.current_step currentProgress.value = data.current_step

5
src/views/formTable/pageInfo.vue

@ -182,6 +182,11 @@ const afterSubmit = (type: string,val?:any) => {
default: default:
} }
}; };
onMounted(()=>{
console.log("挺挺挺挺下")
console.log(props)
})
</script> </script>
<template> <template>
<div class="newDrawerCont"> <div class="newDrawerCont">

203
src/views/lookCodePage/index.vue

@ -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, // 123
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…
Cancel
Save