diff --git a/back/src/views/modules/myAgent/demo/competency-application.vue b/back/src/views/modules/myAgent/demo/competency-application.vue index 3fb7d661..fdbd870c 100644 --- a/back/src/views/modules/myAgent/demo/competency-application.vue +++ b/back/src/views/modules/myAgent/demo/competency-application.vue @@ -2,7 +2,7 @@ * @Author: hisense.liangjunhua * @Date: 2022-06-29 15:59:51 * @LastEditors: hisense.liangjunhua - * @LastEditTime: 2022-08-02 16:06:20 + * @LastEditTime: 2022-08-04 14:34:45 * @Description: 告诉大家这是什么 --> @@ -291,6 +291,7 @@ export default { if (val.cameraList) { flag = true obj.describe += val.system + obj.describe += ';' } else { this.$http.get('/resource/' + val.resourceId).then((res1) => { // console.log(res1.data.data, '1111111111111111111111111111111111') diff --git a/front/src/views/home/apply.vue b/front/src/views/home/apply.vue index 57291cce..24431ac0 100644 --- a/front/src/views/home/apply.vue +++ b/front/src/views/home/apply.vue @@ -249,7 +249,7 @@ relaunch, selectOne, } from '@/api/home' - import { getCategoryTreePage } from '@/api/personalCenter' + import { getCategoryTreePage, endProcess } from '@/api/personalCenter' import mybus from '@/myplugins/mybus' import { sgcDel, getApplyForm } from '@/api/personalCenter' import { pageWithAttrs } from '@/api/home' @@ -327,6 +327,30 @@ enclosureName: '', //附件 }) const dataList = ref([]) + const id = router.currentRoute.value.query.id + const taskId = router.currentRoute.value.query.taskId + const businessKey = ref(router.currentRoute.value.query.id) + if (id) { + getApplyForm(id).then((res) => { + console.log('修改==============>', res.data.data) + // formName.id = res.data.data.id || '' + formName.applicationSystem = res.data.data.applicationSystem || '' + formName.applicationScene = res.data.data.applicationScene || [] + formName.applicationBackground = + res.data.data.applicationBackground || '' + formName.effectWish = res.data.data.effectWish || '' + formName.phone = res.data.data.phone || '' + // formName.system = res.data.data.system || [] + formName.enclosure = res.data.data.enclosure || '' + formName.enclosureName = res.data.data.enclosureName || '' + if (res.data.data.enclosure) { + fileList.value.push({ + name: res.data.data.enclosureName, + url: res.data.data.enclosure, + }) + } + }) + } getUser().then((res) => { formName.user = res.data.data.realName formName.userId = res.data.data.id @@ -338,18 +362,6 @@ }) }) // console.log('本地存储====================》', list.value) - const businessKey = ref(router.currentRoute.value.query.id) - const taskId = ref(router.currentRoute.value.query.taskId) - if (businessKey.value) { - getApplyForm(businessKey.value).then((res) => { - formName.id = res.data.data.id - formName.phone = res.data.data.phone - formName.scene = res.data.data.scene - formName.basis = res.data.data.basis - formName.enclosure = res.data.data.enclosure - // console.log('回填数据================>', res, formName.phone) - }) - } const applicationSceneOpthion = ref([]) getCategoryTreePage({ page: 1, @@ -385,41 +397,146 @@ window.history.go(-1) } const processStartHandle = () => { - if (businessKey.value) { - const obj = ref({}) - for (const key in formName) { - if (key !== 'formNameSystem') { - obj.value[key] = formName[key] - } + formRef.value.validate().then(() => { + if (!formUrl) { + return message.error('请设置保存表单的URL') } - obj.value.system = formName.system[0].resourceName - tabilityapplication(obj.value).then((upres) => { - if (upres.data.code == 0) { - relaunch({ data: obj.value, taskId: taskId.value }).then( - (res) => { - // console.log('驳回================>', res) - if (res.data.code == 0) { - message.success('重新发起流程成功!') - window.setTimeout(() => { - window.history.go(-1) - }, 1000) - } else { - message.error('重新发起流程失败!') + if (!formName) { + return message.error('请设置表单名称') + } + if (id) { + endProcess({ instanceId: taskId }).then((end) => { + if (end.data.code == 0) { + let ids = [] + let falgNum = 0 + let sxt = true + formName.system = [] + console.log('list==================', list.value) + list.value.map((val) => { + val.arr.map((item) => { + if (item.type !== '基础设施') { + falgNum++ + } + }) + }) + list.value.map((val) => { + val.arr.map((item) => { + if (item.type !== '基础设施') { + formName.system.push({ + resourceId: item.resourceId, + resourceName: item.resourceName, + }) + falgNum++ + console.log(item.id) + if (item.id) { + ids.push(item.id) + } + } else { + let obj = {} + Object.assign(obj, formName) + console.log('摄像头===============>', obj, item) + obj.system = [] + item.note1 = JSON.parse(item.note1) + item.note1.map((sxt) => { + obj.system.push({ + resourceId: sxt.idtCameraChannel + '', + resourceName: sxt.channelName, + cameraId: sxt.channelId, // 改接口后删除 + channelCode: sxt.channelCode, + channelId: sxt.channelId, + channelName: sxt.channelName, + checkStatus: sxt.checkStatus + '', + gpsX: sxt.gpsX, + gpsY: sxt.gpsY, + idtCameraChannel: sxt.idtCameraChannel + '', + nodeName: sxt.nodeName, + parentId: sxt.parentId, + status: sxt.status + '', + }) + }) + submitApply(obj).then((res) => { + // applySuccess.value = false + console.log('摄像头申请================>', res) + if (item.id) { + sgcDel({ ids: [item.id] }).then((res1) => { + if (res1.data.msg === 'success') { + if (falgNum == 0 && sxt) { + message.success( + '申请提交成功,请到消息中心查看!' + ) + sxt = false + } + mybus.emit('getSgcNum') + router.push({ + path: '/DetailsPageconetent', + query: { + select: '组件服务', + }, + }) + } + }) + } else { + if ( + res.data.msg === 'success' && + falgNum == 0 && + sxt + ) { + message.success('申请提交成功,请到消息中心查看!') + sxt = false + } + router.push({ + path: '/DetailsPageconetent', + query: { + select: '组件服务', + }, + }) + } + }) + } + }) + }) + console.log( + '提交数据==========================>', + formName, + ids + ) + if (formName.system.length !== 0) { + if (formName.applicationSystem.length == 0) { + formName.applicationSystem = '' } + submitApply(formName).then((res) => { + // applySuccess.value = false + message.success('申请提交成功,请到消息中心查看!') + console.log('能力申请================>', res) + if (res.data.code == 0) { + if (ids && ids.length > 0) { + sgcDel({ ids: ids }).then((res) => { + if (res.data.msg === 'success') { + mybus.emit('getSgcNum') + router.push({ + path: '/DetailsPageconetent', + query: { + select: '组件服务', + }, + }) + } + }) + } else { + router.push({ + path: '/DetailsPageconetent', + query: { + select: '组件服务', + }, + }) + } + } else { + message.error('申请失败!') + } + }) } - ) - } else { - message.error('数据更新失败!') - } - }) - } else { - formRef.value.validate().then(() => { - if (!formUrl) { - return message.error('请设置保存表单的URL') - } - if (!formName) { - return message.error('请设置表单名称') - } + } + }) + } else { if (!applyAll) { console.log(list.value[0].arr[0]) // 单兵设备为了演示 添加 不做处理 @@ -576,8 +693,8 @@ } }) } - }) - } + } + }) } // 启动流程 const startProcess = (processDefinitionKey, businessKey, formData) => { @@ -841,4 +958,4 @@ justify-content: center; // position: fixed; } - \ No newline at end of file + diff --git a/front/src/views/home/infrastructurePage.vue b/front/src/views/home/infrastructurePage.vue index 88adb112..8b593e72 100644 --- a/front/src/views/home/infrastructurePage.vue +++ b/front/src/views/home/infrastructurePage.vue @@ -264,9 +264,8 @@ const pagination = ref({ total: 0, current: 1, - pageSize: 10, //每页中显示10条数据 + pageSize: 300, //每页中显示10条数据 showSizeChanger: true, - pageSizeOptions: ['5', '10', '15', '20'], //每页中显示的数据 }) const mapSearchParam = ref({ // 地图搜索初始化数据 @@ -709,8 +708,8 @@ const onSelectChange = (record, selected, selectedRows, nativeEvent) => { console.log('hahhahah', record, selected, selectedRows, nativeEvent) if (selected) { - if (selectedRowKeys.value.length == 10) { - message.warning('最多只能添加10个摄像头!') + if (selectedRowKeys.value.length == 300) { + message.warning('最多只能添加300个摄像头!') } else { selectedList.value.push(record) selectedRowKeys.value.push(record.channelCode || record.channelId) @@ -734,8 +733,8 @@ selectedList.value.push(val) selectedRowKeys.value.push(val.channelCode || val.channelId) }) - if (selectedRowKeys.value.length > 10) { - message.warning('最多只能添加10个摄像头!') + if (selectedRowKeys.value.length > 300) { + message.warning('最多只能添加300个摄像头!') changeRows.map((val) => { selectedList.value = selectedList.value.filter( (item) => item.idtCameraChannel !== val.idtCameraChannel diff --git a/front/src/views/personalCenter/components/AbilityApplication.vue b/front/src/views/personalCenter/components/AbilityApplication.vue index d879ff27..709bab2f 100644 --- a/front/src/views/personalCenter/components/AbilityApplication.vue +++ b/front/src/views/personalCenter/components/AbilityApplication.vue @@ -2,7 +2,7 @@ * @Author: hisense.liangjunhua * @Date: 2022-07-12 09:42:44 * @LastEditors: hisense.liangjunhua - * @LastEditTime: 2022-08-02 16:34:42 + * @LastEditTime: 2022-08-04 10:41:06 * @Description:我的申请 能力申请 查看详情 -->