From 9039606dda347cb23924e6556929b8138507f619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?zhaobing=E2=80=99?= Date: Thu, 21 Sep 2023 09:39:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=B7=A5=E5=8D=95=E6=8E=A5=E5=85=A5?= =?UTF-8?q?=E5=AE=9E=E9=99=85=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/project/group.js | 88 +++++++- api/app/lib/middlewares/camunda-rest.js | 2 +- api/app/lib/models/form_data_table.js | 70 ++++++ api/app/lib/routes/project/index.js | 8 + api/app/lib/schedule/workOrder.js | 208 ++++++++---------- .../3.2/schema/1.create_form_data_table.sql | Bin 0 -> 4829 bytes .../sections/projectGroup/actions/group.js | 32 +++ .../projectGroup/containers/bigscreen.jsx | 55 +++-- .../sections/workOrder/containers/aboutMe.jsx | 2 +- .../workOrder/containers/initiated.jsx | 2 +- .../workOrder/containers/preserve.jsx | 3 +- .../sections/workOrder/containers/receipt.jsx | 2 +- .../workOrder/containers/stayDoWorkOrder.jsx | 2 +- web/client/src/utils/webapi.js | 3 + 14 files changed, 341 insertions(+), 136 deletions(-) create mode 100644 api/app/lib/models/form_data_table.js create mode 100644 script/3.2/schema/1.create_form_data_table.sql diff --git a/api/app/lib/controllers/project/group.js b/api/app/lib/controllers/project/group.js index 492b87b..016dd04 100644 --- a/api/app/lib/controllers/project/group.js +++ b/api/app/lib/controllers/project/group.js @@ -586,6 +586,90 @@ async function groupProject (ctx) { } } + +async function getProjectWorkOrders(){ + try{ + // 计算一个月前的日期 + const oneMonthAgo = moment().subtract(1, 'months').toDate() + const { models } = ctx.fs.dc + const {Op, fn, col} = ctx.fs.dc.ORM.sequelize + const { projectIds } = ctx.query + if(projectIds&&projectIds.length){ + const projectIdsArr=projectIds.map(Number) + const res= await models.FormDataTable.findAll({ + attributes: [ + 'projectId', + [fn('COUNT', col('id')), 'count'], + ], + where: { + projectIds: { + [Op.in]: projectIdsArr, + }, + startTime: { + [Op.gte]: oneMonthAgo, + }, + }, + group: ['projectId'], + order: [[fn('COUNT', col('id')), 'DESC']], + }) + ctx.body=res + ctx.status=200 + }else{ + ctx.body='没有查询到数据' + ctx.status=204 + } + + }catch(error){ + ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); + ctx.status = 400; + ctx.body = { + message: typeof error == 'string' ? error : undefined + } + } +} + +async function getWorkOrdersRepairRank(){ + try{ + const oneMonthAgo = moment().subtract(1, 'months').toDate() + const { models } = ctx.fs.dc + const {Op, fn, col} = ctx.fs.dc.ORM.sequelize + const { projectIds } = ctx.query + if(projectIds&&projectIds.length){ + const res= await models.FormDataTable.findAll({ + where: { + projectIds: { + [Op.in]: projectIdsArr, + }, + startTime: { + [Op.gte]: oneMonthAgo, + } + }, + order: [ + [fn('TIMESTAMPDIFF', literal('SECOND'), col('endTime'), col('startTime')), 'DESC'] + ] + }) + ctx.body=res + ctx.status=200 + }else{ + ctx.body='没有查询到信息' + ctx.status=204 + } + + + + + + + }catch(error){ + ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); + ctx.status = 400; + ctx.body = { + message: typeof error == 'string' ? error : undefined + } + } +} + + module.exports = { groupList, groupDetail, @@ -594,5 +678,7 @@ module.exports = { groupStatistic, groupStatisticOnline, groupStatisticAlarm, - groupProject + groupProject, + getProjectWorkOrders, + getWorkOrdersRepairRank }; \ No newline at end of file diff --git a/api/app/lib/middlewares/camunda-rest.js b/api/app/lib/middlewares/camunda-rest.js index 41f2f32..b0ab03a 100644 --- a/api/app/lib/middlewares/camunda-rest.js +++ b/api/app/lib/middlewares/camunda-rest.js @@ -10,7 +10,7 @@ function factory(app, router, opts) { const password = ctx.fs.api.password ? ctx.fs.api.password : "fs-workflow"; // console.log('[camunda-rest] ctx.fs.api:', JSON.stringify(ctx.fs.api)) - console.log('[camunda-rest] ctx.fs.api.camundaUserId:', ctx.fs.api.camundaUserId) + // console.log('[camunda-rest] ctx.fs.api.camundaUserId:', ctx.fs.api.camundaUserId) const req = { get: (url, query) => { return request diff --git a/api/app/lib/models/form_data_table.js b/api/app/lib/models/form_data_table.js new file mode 100644 index 0000000..34613f4 --- /dev/null +++ b/api/app/lib/models/form_data_table.js @@ -0,0 +1,70 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const FormDataTable = sequelize.define("formDataTable", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: "nextval(\"formDataTable_id_seq\"::regclass)", + comment: "id", + primaryKey: true, + field: "id", + autoIncrement: false + }, + projectId: { + type: DataTypes.INTEGER, + allowNull: true, + defaultValue: null, + comment: "项目id", + primaryKey: false, + field: "project_id", + autoIncrement: false + }, + formname: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "工单名称", + primaryKey: false, + field: "formname", + autoIncrement: false + }, + startTime: { + type: DataTypes.DATE, + allowNull: true, + defaultValue: null, + comment: "开始时间", + primaryKey: false, + field: "start_time", + autoIncrement: false + }, + endTime: { + type: DataTypes.DATE, + allowNull: true, + defaultValue: null, + comment: "结束时间", + primaryKey: false, + field: "end_time", + autoIncrement: false + }, + state: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "state", + autoIncrement: false + } + }, { + tableName: "form_data_table", + comment: "", + indexes: [] + }); + dc.models.FormDataTable = FormDataTable; + return FormDataTable; +}; \ No newline at end of file diff --git a/api/app/lib/routes/project/index.js b/api/app/lib/routes/project/index.js index 57da207..2d6e46c 100644 --- a/api/app/lib/routes/project/index.js +++ b/api/app/lib/routes/project/index.js @@ -54,4 +54,12 @@ module.exports = function (app, router, opts) { app.fs.api.logAttr['GET/project/group/list'] = { content: '获取分组项目信息', visible: true }; router.get('/project/group/list', projectGroup.groupProject); + + app.fs.api.logAttr['GET/project/workOrders'] = { content: '获取项目工单信息', visible: true }; + router.get('/project/workOrders', projectGroup.getProjectWorkOrders); + + + app.fs.api.logAttr['GET/project/workOrders/repairRank'] = { content: '获取工单修复信息', visible: true }; + router.get('project/workOrders/repairRank', projectGroup.getWorkOrdersRepairRank); + }; \ No newline at end of file diff --git a/api/app/lib/schedule/workOrder.js b/api/app/lib/schedule/workOrder.js index 7eb38a0..07222b9 100644 --- a/api/app/lib/schedule/workOrder.js +++ b/api/app/lib/schedule/workOrder.js @@ -1,116 +1,94 @@ -// const schedule = require('node-schedule'); -// const moment = require('moment') - -// module.exports = function (app, opts) { -// const updateAttendance = app.fs.scheduleInit( -// { -// interval: '34 21 4 * * *', -// // interval: '34 */15 * * * *', -// immediate: true, -// proRun: true, -// }, -// async()=>{ -// try{ -// const startTime = moment() -// const { models } = app.fs.dc -// const { clickHouse } = app.fs -// const { database: camWorkflow } = clickHouse.camWorkflow.opts.config -// //工单数据 -// let workOrderNeedData = { -// projectName: { -// keyWord: ['项目名称'], -// require: true, -// }, -// applyTime: { -// keyWord: ['申请时间'], -// require: true, -// }, -// completionTime: { -// keyWord: ['处理完成时间'], -// require: true, -// }, -// state:{ -// keyWord:[''], -// require: true, -// }, - - - - - - - - - - - - -// } -// const attendanceRes = await clickHouse.pepEmis.query( -// ` -// SELECT -// story.id AS historyId, -// story.apply_user AS pepUserId, -// story.form_data AS formData, -// story.submit_form_data AS submitFormData, -// fform.form_schema AS formSchema, -// fprocess.name AS processName, -// procin.state_ AS state, -// fform.id AS formId, -// fversion.id AS versionId, -// fgroup.name AS groupName -// FROM -// workflow_process_history AS story -// INNER JOIN workflow_process_version AS fversion -// ON fversion.id = story.version_id -// INNER JOIN workflow_process_form AS fform -// ON fform.id = fversion.form_id -// INNER JOIN workflow_process AS fprocess -// ON fprocess.id = fform.process_id -// INNER JOIN workflow_group AS fgroup -// ON fgroup.id = fprocess.group_id -// AND fgroup.name = '' -// INNER JOIN ${camWorkflow}.act_hi_procinst AS procin -// ON procin.id_ = story.procinst_id` -// +` ${existOvertimeCount || existVacateCount ?`WHERE story.create_at > '2023-03-16 00:00:00'`: ''}` -// ).toPromise() - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// }catch(error){ - -// } -// } -// ); -// return { -// updateAttendance, -// } -// } \ No newline at end of file +const schedule = require('node-schedule'); +const moment = require('moment') +let isDev = false + +module.exports = function (app, opts) { + const workOrder = app.fs.scheduleInit( + { + interval: '0 * * * *',//一小时执行一次 + immediate: isDev, + proRun: !isDev, + }, + async()=>{ + try{ + //前一次执行时间 + console.log('工单数据抽取开始') + let lastExecutionTime = null; + const { parseProcessData } = app.fs.utils + const startTime = moment() + const { models } = app.fs.dc + const { clickHouse } = app.fs + const { database: camWorkflow } = clickHouse.camWorkflow.opts.config + //新建表是否有数据 + const rescount=await models.FormDataTable.count() + if (lastExecutionTime === null) { + lastExecutionTime = moment().subtract(1, 'hour'); + } + const formRes = await clickHouse.pepEmis.query( + `SELECT + story.id AS historyId, + story.procinst_id as procinstId, + story.apply_user AS pepUserId, + story.form_data AS formData, + story.submit_form_data AS submitFormData, + story.create_at as createTime, + fform.form_schema AS formSchema, + fprocess.name AS processName, + procin.state_ AS state, + procin.end_time_ as endTime, + fform.id AS formId, + fversion.id AS versionId, + fgroup.name AS groupName + FROM + workflow_process_history AS story + INNER JOIN workflow_process_version AS fversion + ON fversion.id = story.version_id + INNER JOIN workflow_process_form AS fform + ON fform.id = fversion.form_id + INNER JOIN workflow_process AS fprocess + ON fprocess.id = fform.process_id + AND fprocess.name = '运维中台售后问题处理工单' + INNER JOIN workflow_group AS fgroup + ON fgroup.id = fprocess.group_id + INNER JOIN ${camWorkflow}.act_hi_procinst AS procin + ON procin.id_ = story.procinst_id + ${rescount ?` WHERE procin.end_time_ is not null + AND procin.end_time_ > '${lastExecutionTime}' + AND procin.end_time_ <='${startTime}'` + : ''}` + ).toPromise() + console.log('formRes1',formRes) + const procinstIds = [...new Set(formRes.map(e => e.procinstId))]; + // 获取流程实例变量 + if(formRes && formRes.length > 0){ + let procinstsVariables = await ctx.app.camunda.request.post(encodeURI(`/engine-rest/history/variable-instance`), { + processInstanceIdIn: procinstIds + }) + for (let f of formRes) { + if(f?.formData?.formData && f?.formData?.workflowProcessVersion?.workflowProcessForm?.formSchema) { + const parseData = parseProcessData({ + formSchema: JSON.parse(f.formSchema), + formData: JSON.parse(f.formData) + }) + await models.Workorder.create({ + projectId:parseData.pomsProjectId.value || null, + formname:procinstsVariables.find(item=>item.id===f.procinstId).name||null, + state: f.state||null, + endTime:f.endTime||null, + startTime:f.createTime||null + }) + console.log('工单数据抽取结束') + } + } + + } + }catch(error){ + console.error(error) + } + } + ); + return { + workOrder, + } +} \ No newline at end of file diff --git a/script/3.2/schema/1.create_form_data_table.sql b/script/3.2/schema/1.create_form_data_table.sql new file mode 100644 index 0000000000000000000000000000000000000000..72653a7341920dfd58f49f31824f0d47e87ceeb6 GIT binary patch literal 4829 zcmeH|`8O198^*^HV;zjqWH)v)HFje+Q;eOFAtZzFMb;OyTIM;nsq$wx<0E=|%v-^8v zJ(Y3$K-9HpCbOAtVtZY_M|p{?@7uj(n+ar_p^cPtw$<&G7mLZVl)Zy$kG~gNl3ors$0n7mA06D-- zfB``FOzQzK08_xw0G!{-zLT9vq;0Rto=9if1VY z!1*~Ra8BTyz&U|)0_OzI3H-kVTrR<@)Dk*#`#_>X!~E@$EQ<}q?1r0v#uGZqpw0zOVB0?+$-DLrU?+Cg%W7@lKuLLB^0Q(I7VUYj?;fr}zv9;-I>u z1($Aidx0<{O2ye)t!wZwQV^QrZ#H}PG4p{p#V zo#oNTy|ws)Eap1rR)?>0hW3#hm0ffV1H@{^87%B6go9T|ULKfI9r_!}a(C~-RmojB z=kdxZQxm8dF?CH?pbqW2u&Pnt>1x(h`Rvtlba}ukqn*#J8G~x;*BL1HnA5b(W!-{@ zihA9$Y>2_-Tz^vO68oNK$dYQ-v3!k;c!*MsZF=7052ROr9H=8RQ=wad!Z~O!_*+5! zaPEydTq(!8$S9Fo%l6HHa@b0=t_SD+$n}wIQ(Pckon&ih)1sPud+r0CF zsZ3PA@xlie^;L7DyfRJ@e~n#4Rh{+>2tR|a`b@C_X{MKkj7E8!AQ;?NUkvoLsF^n? zAG6c4o*KH=kozCHTqLi;r;Du)Y%yv4`6>#C{)k_oJ>2THo3P%$iZcGp$$wlO}7c z1UX7kx`iRZ27;Ebc7eQPJz}_RW-5TX*-gR!`Jz5YjsC6q8OAh8%VPVaPyZx2Br(F1 z({qQ1??svSl_G9;2QdhEmvXOdWyNVA_zQ5bHg;;Cl7Fh_FKg+Y15vm=x^f&&GET49 zf+J|2)frz0^3=8vjO~htr34J9t$|%Ay!m^IP?AoN%q=Y`Fw*z=phQdxjG;kmH-=8R zWKwtP9!A@b_q|Eub}jIlFA9=!B>suYR~m+00e0!!+)hy>;KJ=oo>oHNb~d4VX}^%a z(ita$!dEP5qK3k9KvWxNVX1)?7PKU?k?XW$-|t)9r#%*@1$`+jSb>xE4f0^;G;GgH z!JiElV=zyOQ1nhK>VT22d&JLP76=E}*l3nW3(|0P&YiGMsS3Oy^uYI46Bkwgm7L2$ zP>dxo@Q)rBk-N(EyrLX6uv<8vdXA~vN8+wM57SB?k8+oXerf$NY%HZee`6L6EIt-N zEBV(lKU9d;S4FC%2*)%eR%+n5{g zzCXl87An%LZ1f(n0V&w$8{vaMttX$VIwx-a(MhEUjui0_e@2k}W;!qsRS*;YM*Fmp zxu!tvbEwZ^g$|c4{W+!DnlCTJ^|xdtE7WfYgNntkygWw_c{m>HQU#V zUsj*ASqnuJNX~^Rn9X`Qy)N!^_YKQY2u{?VY~jMmvwqB9mN!iGOD-_&f@HWk!Vb{z zcA(XGbU7w14$%BBlWIuBj>!E~;rIGdANeKlytj&jqA2|+`<|WNqM)Gm( zlaQ!*b%Y9f=PIp5zGndSRqZSb8?*9AFNp0aj-AxR7Y_3t->)9-mA@<{y5Cw)VWXKyjLv<=G0}Fq{q60{;$1@Jp?AMvrz|ar43lGBH3C z6R)R{so{2o)Osyuky2$JPZ&RQ+TcI-Q9bDUki~&%;S;Tt(0D0*i<&W_T&c<&{VQi{ zf!|#(w1BNo;0Fq*b=bI zZ}zOh%Montk6W=tmfk9hZb|tZ#os%eONz1%azho$c0xaoSlYT@hv-;bqn)^91n$yD zj4{`zPI7Qvj&K`QxqX=k>@*bGccV4nPEQ}xU;y60DNFSUhyL6bY0?bi>gOv zR4BT0f5JLl?}|xJdU{v9_R?p?hAZnaua^(!06vqC9Q+6JJM$}|KRo&S?=hU!;gQ^! z>zz9RK6e6Lo&5>EfoEQvtEkn%*^ur`E68pM_}R2fvP6ayesXF5mL{`sf4OL$Q0)B^ zyJ7@zwR{)9Ef*C#uqP@b0+~zS7g*={Y0i0YoeEY+Z@ZA3PVPINc_iuK*i3$EGa<`W zfZs-Z)K{Fv2Jw*ODvw}2nwUJ2uCMl$AUJ(cAoS|JRHmDO!HCgomc>yKj=P#x2bIxF zcNf>}IvoA}RejoGnoaL;q|r5lnhx_F1x+nNqFeTV*3+j!@C7Hhz&I8-!mJNdB(Pk*fE zDt7{5dRqe=*&pq0B3&juq9kzoa>YM*4#>>4%2RJ*@a=&pcuxj3Wg_#7YgK*fwWFp(N|+H{ zJaHld6{_TN?zuyb%`dxgT)OqyHP(Xu#p^1Ee8lQzDRIv5qGkBo&eri{p}wC_s@%Dw zOs>(FYMb%hPIB1s9tjVY0OR0IPI3QGt4~@dO5r9!dM}1qtxN9yHc!mc8MhZZ&tv3EbBtdb`KH&gGKVk`QzA}(*xc&g z)OjY3j{P$^JQd2YZ<17(nrYb?a+eb(HYWCwxzIUn&Bn38oDWK`p1K-7;-oC)vi9h=LN){{r<}^rrv- literal 0 HcmV?d00001 diff --git a/web/client/src/sections/projectGroup/actions/group.js b/web/client/src/sections/projectGroup/actions/group.js index 53149e0..928b428 100644 --- a/web/client/src/sections/projectGroup/actions/group.js +++ b/web/client/src/sections/projectGroup/actions/group.js @@ -103,3 +103,35 @@ export function groupProject (query = {}) { }); } + +export function getProjectWorkOrders (query) { + return (dispatch) => basicAction({ + type: "get", + dispatch: dispatch, + query, + actionType: "GET_PROJECT_WORK_ORDERS", + url: `${ApiTable.projectWordOrders}`, + msg: { error: "获取项目工单信息失败" }, + reducer: { + name: "projectWorkOrders", + params: { noClear: true } + }, + }); +} + + +export function getWorkOrdersRepairRank (query) { + return (dispatch) => basicAction({ + type: "get", + dispatch: dispatch, + query, + actionType: "GET_WORK_ORDERS_REPAIR_RANK", + url: `${ApiTable.wordOrdersRepairRank}`, + msg: { error: "获取工单修复排名信息失败" }, + reducer: { + name: "projectWorkOrders", + params: { noClear: true } + }, + }); +} + diff --git a/web/client/src/sections/projectGroup/containers/bigscreen.jsx b/web/client/src/sections/projectGroup/containers/bigscreen.jsx index 133b9c5..fbfd939 100644 --- a/web/client/src/sections/projectGroup/containers/bigscreen.jsx +++ b/web/client/src/sections/projectGroup/containers/bigscreen.jsx @@ -15,7 +15,7 @@ let interrupt let repair let overviewScrollbar; const Bigscreen = (props) => { - const { dispatch, actions, user, match, history, clientHeight, groupStatisticOnline, ...restProps } = props + const { dispatch, actions, user, match, history, clientHeight, groupStatisticOnline, pomsProjectBasicAll,...restProps } = props const [InterruptRank, setInterruptRank] = useState([]) const [online, setOnline] = useState([]) @@ -56,19 +56,22 @@ const Bigscreen = (props) => { } }) - dispatch(actions.projectGroup.groupProject({ groupId: groupId_ })).then(res => { - if (res.success) { - setGroupProject(res.payload.data?.map(v => ({ ...v, value: (Math.random() * 20).toFixed(0) })) || []) - setProportion([...res.payload.data?.slice(0, 3)?.map(v => ({ name: v.name || v.pepProjectName, value: (Math.random() * 20).toFixed(0) })), { value: 20, name: '其它' }]) - } - }) + // dispatch(actions.projectGroup.groupProject({ groupId: groupId_ })).then(res => { + // if (res.success) { + // // setProportion([...res.payload.data?.slice(0, 3)?.map(v => ({ name: v.name || v.pepProjectName, value: (Math.random() * 20).toFixed(0) })), { value: 20, name: '其它' }]) + // } + // }) dispatch(actions.projectGroup.getProjectGroupDetail(groupId_)).then(res => { if (res.success) { - setGroupDetail(res.payload.data) + setGroupDetail(res.payload.data) } }) + + + + const interruptDom = document.getElementById("interrupt"); if (interruptDom) { interrupt = new PerfectScrollbar("#interrupt", { @@ -132,6 +135,28 @@ const Bigscreen = (props) => { } }, [mockData]) + + + useEffect(() => { + if(groupDetail?.pomsProjectIds&&groupDetail?.pomsProjectIds.length){ + const query=res.payload.data.pomsProjectIds.split(',') + dispatch(actions.projectGroup.getProjectWorkOrders({projectIds:query}).then(res=>{ + if(res.success){ + setProportion([...res.payload.data?.slice(0, 3)?.map(v => ({ name: pomsProjectBasicAll.find(item=>item.valiue===v.projectId)?.label, value: v.count })), + { value: res.payload.data&&res.payload.data.length>3?res.payload.data?.slice(3)?.reduce((p,c)=>{ + return p+c + },0):0, name: '其它' }]) + } + })) + dispatch(actions.projectGroup.getProjectWorkOrders({projectIds:query}).then(res=>{ + if(res.success){ + setGroupProject(res.payload.data?.slice(0, 10).map(v => ({name:v.formname,duration:v?.endTime.diff(v?.startTime,'hours') })) || []) + } + })) + + } + },[groupDetail]) + let statisticOnline = (groupId) => { dispatch(actions.projectGroup.groupStatisticOnline({ groupId })).then(res => { if (res.success) { @@ -292,16 +317,18 @@ const Bigscreen = (props) => {
修复时长
- {groupProject?.map((c, index) => { + {groupProject?.map((c, index) => { return index < 10 ?
NO.{index + 1}
-
- {c.name || c.pepProjectName}(售后工单)
+
+ {c.fromname}
- {c.value}h
+ {c.duration}h
: <> - })} + })}} containerStyle={{ position: "relative", height: "95%", }} + divHeight={"100%"} divId={"rank"} /> + @@ -458,7 +485,7 @@ const Bigscreen = (props) => { return
{c.name}
{title}
-
{c.offnum + '/' + c.totnum}
+
{c.offnum + '/' + c.totnum`(${(c.offnum/c.totnum).toFixed(4)*100}%)`}
})} } containerStyle={{ position: "relative", height: "85%", }} divHeight={"100%"} divId={"interruptchart"}/> diff --git a/web/client/src/sections/workOrder/containers/aboutMe.jsx b/web/client/src/sections/workOrder/containers/aboutMe.jsx index 3cca889..02420c9 100644 --- a/web/client/src/sections/workOrder/containers/aboutMe.jsx +++ b/web/client/src/sections/workOrder/containers/aboutMe.jsx @@ -91,7 +91,7 @@ const Rest = (props) => { title: '申请内容描述', dataIndex: 'applyContent', render: (text, record, index) => { - return record.name === '运维中台售后问题处理工单' ? record?.pomsNeedData?.detail?.value.length > 5 ? + return record.name === '运维中台售后问题处理工单' ? record?.pomsNeedData?.detail?.value&&record?.pomsNeedData?.detail?.value.length > 5 ? {record?.pomsNeedData?.detail?.value.substring(0, 5) + '...'} : record?.pomsNeedData?.detail?.value || '' : record?.pomsNeedData?.applyContent?.value || '' } }, diff --git a/web/client/src/sections/workOrder/containers/initiated.jsx b/web/client/src/sections/workOrder/containers/initiated.jsx index c2efa78..c988b0e 100644 --- a/web/client/src/sections/workOrder/containers/initiated.jsx +++ b/web/client/src/sections/workOrder/containers/initiated.jsx @@ -82,7 +82,7 @@ const Rest = (props) => { title: '申请内容描述', dataIndex: 'applyContent', render: (text, record, index) => { - return record.name==='运维中台售后问题处理工单'?record?.pomsNeedData?.detail?.value.length>5? + return record.name==='运维中台售后问题处理工单'?record?.pomsNeedData?.detail?.value&&record?.pomsNeedData?.detail?.value.length>5? {record?.pomsNeedData?.detail?.value.substring(0, 5) + '...'}:record?.pomsNeedData?.detail?.value || '':record?.pomsNeedData?.applyContent?.value || '' } }, diff --git a/web/client/src/sections/workOrder/containers/preserve.jsx b/web/client/src/sections/workOrder/containers/preserve.jsx index ed65ab1..02afc9d 100644 --- a/web/client/src/sections/workOrder/containers/preserve.jsx +++ b/web/client/src/sections/workOrder/containers/preserve.jsx @@ -73,6 +73,7 @@ const Rest = (props) => { title: '项目名称', dataIndex: 'pomsProject', render: (text, record, index) => { + console.log('pomsProjectBasicAll',pomsProjectBasicAll) return record.name === '运维中台售后问题处理工单' ? pomsProjectBasicAll?.find(item => item.value == record?.pomsNeedData?.pomsProjectId?.value)?.label || '' : record?.pomsNeedData?.projectName?.value || '' @@ -81,7 +82,7 @@ const Rest = (props) => { title: '申请内容描述', dataIndex: 'applyContent', render: (text, record, index) => { - return record.name === '运维中台售后问题处理工单' ? record?.pomsNeedData?.detail?.value.length > 5 ? + return record.name === '运维中台售后问题处理工单' ? record?.pomsNeedData?.detail?.value&&record?.pomsNeedData?.detail?.value.length > 5 ? {record?.pomsNeedData?.detail?.value.substring(0, 5) + '...'} : record?.pomsNeedData?.detail?.value || '' : record?.pomsNeedData?.applyContent?.value || '' } }, diff --git a/web/client/src/sections/workOrder/containers/receipt.jsx b/web/client/src/sections/workOrder/containers/receipt.jsx index 7f3b0e9..45d106c 100644 --- a/web/client/src/sections/workOrder/containers/receipt.jsx +++ b/web/client/src/sections/workOrder/containers/receipt.jsx @@ -93,7 +93,7 @@ const Rest = (props) => { title: '申请内容描述', dataIndex: 'applyContent', render: (text, record, index) => { - return record.name === '运维中台售后问题处理工单' ? record?.pomsNeedData?.detail?.value.length > 5 ? + return record.name === '运维中台售后问题处理工单' ? record?.pomsNeedData?.detail?.value&&record?.pomsNeedData?.detail?.value.length > 5 ? {record?.pomsNeedData?.detail?.value.substring(0, 5) + '...'} : record?.pomsNeedData?.detail?.value || '' : record?.pomsNeedData?.applyContent?.value || '' } }, diff --git a/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx b/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx index 4c91201..cae1882 100644 --- a/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx +++ b/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx @@ -80,7 +80,7 @@ const Rest = (props) => { title: '申请内容描述', dataIndex: 'applyContent', render: (text, record, index) => { - return record.fsFormItemName === '运维中台售后问题处理工单' ? record?.pomsNeedData?.detail?.value.length > 5 ? + return record.fsFormItemName === '运维中台售后问题处理工单' ? record?.pomsNeedData?.detail?.value&&record?.pomsNeedData?.detail?.value.length > 5 ? {record?.pomsNeedData?.detail?.value.substring(0, 5) + '...'} : record?.pomsNeedData?.detail?.value || '' : record?.pomsNeedData?.applyContent?.value || '' } }, diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index dab66f3..809f0f5 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -43,6 +43,9 @@ export const ApiTable = { groupStatisticAlarm: 'project/group/statistic/alarm', groupProject: "project/group/list", groupProjectDetail: "project/group/:groupId/detail", + projectWordOrders:'project/workOrders', + wordOrdersRepairRank:'project/workOrders/repairRank', + //告警 getProjectPoms: 'project/poms', //获取已绑定项目