Compare commits

...

3 Commits

5 changed files with 467 additions and 288 deletions

View File

@ -284,3 +284,20 @@ export function endProcess(params) {
params,
})
}
// 西--
export function deviceApplylist(params) {
return request({
url: '/deviceApply/page',
method: 'get',
params,
})
}
// 西----
export function getDeviceDetail(deviceId) {
return request({
url: `/device/${deviceId}`,
method: 'get',
})
}

View File

@ -341,10 +341,12 @@
" :pagination="pagination" @change="handleTableChange">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'operation'">
<a @click="goToApply(record)" style="margin-right: 10px">
<a-button @click="goToApply(record)" type="link" :disabled="record.state != 1">
申请
</a>
<a @click="showWrj(record)">详情</a>
</a-button>
<a-button @click="showWrj(record)" type="link">
详情
</a-button>
</template>
</template>
</a-table>
@ -635,11 +637,13 @@ const tabList = ref([
title: '设施类型',
content: isXiHaiAn ? ['视频资源'] : ['视频资源', '云资源', '感知资源', '城市云脑会客厅'],
},
{
])
if (!isXiHaiAn) {
tabList.value.push({
title: '视频标签',
content: [],
},
])
})
}
const wrjVisible = ref(false)
const wrjName = ref('')
const wrjData = ref([])
@ -1065,7 +1069,10 @@ const tabClick = (indexFather, name) => {
room.value = true
tableHeight.value = 330
showMap.value = true
if (tabList.value[1]) {
tabList.value[1].title = '视频标签'
}
} else if (name == '云资源') {
room.value = true
tableHeight.value = 600
@ -1073,7 +1080,9 @@ const tabClick = (indexFather, name) => {
dataSource.value = []
dataSource2.value = []
pagination.value.total = 0
if (tabList.value[1]) {
tabList.value[1].title = '云资源分类'
}
} else if (name == '感知资源') {
room.value = true
tableHeight.value = 330
@ -1100,26 +1109,34 @@ const tabClick = (indexFather, name) => {
wrjFlag.value = false
tableHeight.value = 330
showMap.value = true
if (tabList.value[1]) {
tabList.value[1].content = []
clickList.value[1].content = []
tabList.value[1].title = '视频标签'
}
if (clickList.value[1]) {
clickList.value[1].content = []
}
clickList.value[indexFather].content[0] = name
dataSource.value = []
dataSource2.value = []
room.value = true
getCameraAllLabel().then((res) => {
res.data.data.forEach((val) => {
if (tabList.value[1]) {
tabList.value[1].content.push({
labelCode: val.labelCode,
labelName: val.labelName,
})
}
})
})
// labelCode
mapSearchParam.value.labelCodes = []
if (clickList.value[1]) {
clickList.value[1].content.map((item) => {
mapSearchParam.value.labelCodes.push(item.labelCode)
})
}
console.log('选中的标签code', mapSearchParam.value)
mapSearchParam.value.labelCodes = mapSearchParam.value.labelCodes + ''
emits('add', 1)
@ -1130,9 +1147,12 @@ const tabClick = (indexFather, name) => {
dataSource.value = []
dataSource2.value = []
pagination.value.total = 0
if (clickList.value[1]) {
clickList.value[1].content = []
tabList.value[1].title = '云资源分类'
}
clickList.value[indexFather].content[0] = name
if (tabList.value[1]) {
tabList.value[1].title = '云资源分类'
tabList.value[1].content = [
'云主机',
'算力主机',
@ -1143,17 +1163,22 @@ const tabClick = (indexFather, name) => {
'负载均衡',
'公网IP',
]
}
room.value = true
wrjFlag.value = false
emits('add', 2)
} else if (name == '感知资源') {
tableHeight.value = 330
showMap.value = true
if (clickList.value[1]) {
clickList.value[1].content = []
}
pagination.value.total = 0
tabList.value[1].title = '感知资源分类'
clickList.value[indexFather].content[0] = name
if (tabList.value[1]) {
tabList.value[1].content = []
tabList.value[1].title = '感知资源分类'
}
dataSource.value = []
dataSource2.value = []
room.value = true
@ -1170,28 +1195,33 @@ const tabClick = (indexFather, name) => {
dataSource.value = []
dataSource2.value = []
pagination.value.total = 0
if (clickList.value[1]) {
clickList.value[1].content = []
}
clickList.value[indexFather].content[0] = name
tabList.value[1].title = ''
if (tabList.value[1]) {
tabList.value[1].content = []
tabList.value[1].title = ''
}
wrjFlag.value = true
room.value = false
// wrjFlag.value = true
// showMap.value = false
roomYuyue.value = true
roomResult.value = false
// tabList.value[1] = []
emits('add', 6)
searchData()
} else {
if (clickList.value[indexFather]) {
clickList.value[indexFather].content.push(name)
}
}
}
// labelCode
mapSearchParam.value.labelCodes = []
if (clickList.value[1]) {
clickList.value[1].content.map((item) => {
mapSearchParam.value.labelCodes.push(item.labelCode)
})
}
console.log('选中的标签code', mapSearchParam.value)
mapSearchParam.value.labelCodes = mapSearchParam.value.labelCodes + ''
@ -1220,10 +1250,14 @@ const getSoldierData = (indexFather, name) => {
showMap.value = false
dataSource.value = []
dataSource2.value = []
if (clickList.value[1]) {
clickList.value[1].content = []
}
clickList.value[indexFather].content[0] = name
if (tabList.value[1]) {
tabList.value[1].title = ''
tabList.value[1].content = []
}
wrjFlag.value = true
let _params = {
@ -1362,7 +1396,9 @@ const batchPicturePreview = async function (page) {
}
//
const nullClick = () => {
if (clickList.value[1]) {
clickList.value[1].content = []
}
mapSearchParam.value.labelCodes = ''
getCamera()
console.log('hhhhhhhh')
@ -1533,18 +1569,21 @@ const columns2 = ref([
title: '名称',
dataIndex: 'wrjName',
key: 'wrjName',
align: 'center'
},
{
title: '申请状态',
dataIndex: 'wrjState',
width: '60%',
key: 'wrjState',
align: 'center'
},
{
title: '操作',
dataIndex: 'operation',
width: '20%',
key: 'wrjName',
align: 'center'
},
])
// const allClick = ref([])
@ -1655,11 +1694,7 @@ const videoShowMsg = () => {
}
.tabBox {
margin-bottom: 0.16rem;
}
.tabBox:last-of-type {
margin-bottom: 0;
padding-bottom: 0.16rem;
}
}
@ -2068,4 +2103,5 @@ video::-webkit-media-controls {
margin-top: 14px;
cursor: pointer;
}
</style>

View File

@ -1,24 +1,12 @@
<template>
<div class="form-container">
<AbilityApplication
:refObj="refObj"
v-if="showType === '能力申请'"
></AbilityApplication>
<PutOnTheShelf
:refObj="refObj"
v-else-if="showType === '能力上架'"
></PutOnTheShelf>
<OffTheShelf
:refObj="refObj"
v-else-if="showType === '能力下架'"
></OffTheShelf>
<DeviceApplyDetail v-if="showType === '设备申请'" :refObj="refObj"></DeviceApplyDetail>
<div class="form-container" v-else>
<AbilityApplication :refObj="refObj" v-if="showType === '能力申请'"></AbilityApplication>
<PutOnTheShelf :refObj="refObj" v-else-if="showType === '能力上架'"></PutOnTheShelf>
<OffTheShelf :refObj="refObj" v-else-if="showType === '能力下架'"></OffTheShelf>
<Demand :refObj="refObj" v-else-if="showType === '能力需求'"></Demand>
<Comment :refObj="refObj" v-else-if="showType === '需求评论'"></Comment>
<OtherApplications :refObj="refObj" v-else></OtherApplications>
<!-- <div class="title">流程图</div>
<div>
<img :src="getResourceURL()" alt="" />
</div> -->
<div>
<div class="title">审批详情</div>
<template v-for="item in dataSource.data" :key="item">
@ -35,43 +23,46 @@
</div>
</template>
<script setup>
import AbilityApplication from './AbilityApplication.vue'
import PutOnTheShelf from './PutOnTheShelf .vue'
import OffTheShelf from './OffTheShelf.vue'
import Demand from './Demand.vue'
import Comment from './Comment.vue'
import OtherApplications from '@/views/personalCenter/components/OtherApplications '
import { onMounted, reactive, defineProps, ref } from 'vue'
import Cookies from 'js-cookie'
// import { baseURL } from '@/config'
import qs from 'qs'
import {
import AbilityApplication from './AbilityApplication.vue'
import PutOnTheShelf from './PutOnTheShelf .vue'
import OffTheShelf from './OffTheShelf.vue'
import Demand from './Demand.vue'
import Comment from './Comment.vue'
import DeviceApplyDetail from './DeviceApplyDetail.vue'
import OtherApplications from '@/views/personalCenter/components/OtherApplications '
import { onMounted, reactive, defineProps, ref } from 'vue'
import Cookies from 'js-cookie'
// import { baseURL } from '@/config'
import qs from 'qs'
import {
getApplyForm,
getTaskHandleDetailInfo,
getDemandForm,
nengliziyuanshangjiaapply,
getTaskVariables,
} from '@/api/personalCenter'
import { selectOneDel } from '@/api/home'
const props = defineProps({
} from '@/api/personalCenter'
import { selectOneDel } from '@/api/home'
const props = defineProps({
processDefinitionName: { type: String, default: null },
businessKey: { type: String, default: null },
processInstanceId: { type: String, default: null },
resourceId: { type: String, default: null },
refObj: { type: Object, default: null },
showType: { type: String, default: null },
})
const refObj = ref({})
const showType = ref('')
// eslint-disable-next-line vue/no-setup-props-destructure
refObj.value = props.refObj
// eslint-disable-next-line vue/no-setup-props-destructure
showType.value = props.showType
//
const dataSource = reactive({ data: [] })
// console.log(props.refObj, '---------------------------------------')
})
const refObj = ref({})
const showType = ref('')
// eslint-disable-next-line vue/no-setup-props-destructure
refObj.value = props.refObj
// eslint-disable-next-line vue/no-setup-props-destructure
showType.value = props.showType
//
const dataSource = reactive({ data: [] })
console.log('refObj------------>', refObj);
const downloadFile = (path, name) => {
// console.log(props.refObj, '---------------------------------------')
const downloadFile = (path, name) => {
const xhr = new XMLHttpRequest()
xhr.open('get', path)
xhr.responseType = 'blob'
@ -96,9 +87,9 @@
URL.revokeObjectURL(url)
}
}
}
//
const formName = reactive({
}
//
const formName = reactive({
user: '',
phone: '',
unit: '',
@ -107,12 +98,12 @@
scene: '',
basis: '',
id: '',
})
let shifoushizujian = ref('')
let nameNotShow = ref('')
let algorithmShow = ref('')
const dataForm = reactive({ data: {} })
const columns = [
})
let shifoushizujian = ref('')
let nameNotShow = ref('')
let algorithmShow = ref('')
const dataForm = reactive({ data: {} })
const columns = [
{
title: '任务名称',
dataIndex: 'activityName',
@ -143,8 +134,8 @@
dataIndex: 'durationInSeconds',
key: 'durationInSeconds',
},
]
const getInfo = () => {
]
const getInfo = () => {
console.log(props.processInstanceId, '============================')
if (props.processDefinitionName == '能力申请') {
// getTaskVariables({ taskId: props.processInstanceId }).then((res) => {
@ -208,9 +199,9 @@
dataForm.data = res.data.data
})
}
}
}
const getLiuZhuanInfo = () => {
const getLiuZhuanInfo = () => {
const params = qs.stringify({
processInstanceId: props.processInstanceId,
})
@ -221,9 +212,9 @@
})
dataSource.data.push([props.processInstanceId, arr])
})
}
}
onMounted(() => {
onMounted(() => {
// getInfo()
if (props.refObj.resourceApplication) {
dataSource.data = []
@ -237,9 +228,9 @@
} else {
getLiuZhuanInfo()
}
})
})
const getResourceURL = () => {
const getResourceURL = () => {
console.log('111111111111111111111111111111', Cookies.get('token'))
const params = qs.stringify({
token: Cookies.get('token'),
@ -247,7 +238,7 @@
processInstanceId: props.processInstanceId,
})
return `${window.SITE_CONFIG.apiURL}/act/his/getInstImage?${params}`
}
}
</script>
<style scoped lang="less">
@ -255,6 +246,7 @@
height: 6rem;
overflow-y: scroll;
padding: 20px 20px 30px 20px;
.title {
font-size: 18px;
color: #000;
@ -265,20 +257,23 @@
border-left: 6px #0058e1 solid;
}
}
:deep(.ant-table-thead) > tr > .ant-table-cell {
:deep(.ant-table-thead)>tr>.ant-table-cell {
background: #0087ff;
color: #fff;
border: none;
text-align: center;
font-size: 16px;
}
:deep(.ant-table-tbody) > tr > .ant-table-cell:nth-child(5) {
:deep(.ant-table-tbody)>tr>.ant-table-cell:nth-child(5) {
// width: 110px;
// display: inline-block;
// white-space: nowrap;
// overflow: hidden;
// text-overflow: ellipsis;
}
.oddNumbers {
margin-bottom: 0.05rem;
}

View File

@ -0,0 +1,43 @@
<!--
* @Description: 我的申请 设备申请 查看详情
-->
<template>
<div class="device-detail-box">
<div v-for="(db, key) in wrjData" :key="key">
<template v-if="typeof db == 'object'">
<div style="
font-size: 20px;
font-weight: 600;
margin: 10px 0;
text-align: center;
">
{{ db.attrType || '--' }}
</div>
<template v-if="db.attrValue">
<div style="padding: 0 30px" v-for="(value, key2) in JSON.parse(db.attrValue)" :key="value">
{{ key2 + '' + value }}
</div>
</template>
</template>
</div>
</div>
</template>
<script setup>
import { ref, defineProps, watch } from 'vue'
const props = defineProps({
refObj: { type: Object, default: null },
})
const wrjData = ref([])
wrjData.value = props.refObj.deviceAttrDTOList || []
watch(() => props.refObj, (val) => {
wrjData.value = val.deviceAttrDTOList || []
}, { immediate: true, deep: true })
</script>
<style lang="less" scoped>
.device-detail-box {
height: 6rem;
overflow-y: auto;
}
</style>

View File

@ -39,15 +39,20 @@
</div>
</a-tooltip>
<div class="content-body-content">
<p class="content-body-content-son">
<p class="content-body-content-son" v-if="typeName !=='设备申请'">
审核结果{{ item.ended ? '审核完成' : '审核中' }}
</p>
<p class="content-body-content-son" v-else>
审核结果{{ item.state === 0 ? '审核中' : '审核完成' }}
</p>
</div>
<div class="content-body-bottom">
<div>申请日期{{ item.createDate || item.startTime }}</div>
<div></div>
</div>
<div class="button-box">
<div class="button" v-if="typeName =='设备申请' && phoneSate.includes(item.state)"
@click="showPhoneModal(item)">联系方式</div>
<div class="button" @click="showDetail(item)">查看详情</div>
<div class="button" @click="showAdd(item)" v-if="item.backToFirst">
修改
@ -98,10 +103,16 @@
</a-table>
</a-modal>
</div>
<!-- 联系方式弹框 -->
<a-modal v-model:visible="phoneVisible" title="提示" @ok="phoneVisible = false">
<!-- 工业信息化局那个号电话配这个号199 6399 0996 -->
<p>请联系工业信息化局电话199 6399 0996</p>
</a-modal>
</template>
<script setup>
import { onMounted, reactive, ref, onBeforeUnmount } from 'vue'
import { onMounted, reactive, ref, onBeforeUnmount, h } from 'vue'
import {
getMyProcessInstancePage,
getTabilityapplication,
@ -109,6 +120,8 @@ import {
nengliziyuanshangjiaapply,
getDemandForm,
demandComment,
deviceApplylist,
getDeviceDetail,
} from '@/api/personalCenter'
import {
updateRes,
@ -132,6 +145,7 @@ let typeList = ref([
])
// 西-
let isXiHaiAn = whoShow.itShowXiHaiAn;
const phoneSate = ref([2, 3])
if (isXiHaiAn) {
typeList.value.push('设备申请')
}
@ -146,7 +160,6 @@ const contentList = reactive({ data: [] })
let tabIndex = ref(0)
let typeIndex = ref(0)
let typeName = ref(typeList.value[0])
console.log('typeName------------>', typeName);
const videoVisible = ref(false)
const numFlag = ref(true)
@ -206,9 +219,8 @@ const taskId = ref('')
const backUrl = ref(window.SITE_CONFIG.apiURL + '/')
const refObj = ref({})
const showDetail = (item) => {
console.log('showDetail', item)
// getProcDefBizRoute(item.processDefinitionId)
if (typeIndex.value == 0 && item.applyFlag) {
if (typeName.value == '能力申请' && item.applyFlag) {
getByApplyFlag(item.applyFlag).then((res) => {
if (res.data.code == 0) {
refObj.value = res.data.data
@ -221,7 +233,19 @@ const showDetail = (item) => {
message.error('数据请求失败!')
}
})
} else if (typeIndex.value !== 1) {
} else if (typeName.value == '设备申请') {
getDeviceDetailInfo(item.deviceId).then(res => {
if (res.data.code == 0) {
refObj.value = res.data.data
detailsVisible.value = true
processDefinitionName.value = item.processDefinitionName
// businessKey.value = item.businessKey
// processInstanceId.value = item.processInstanceId
// resourceId.value = item.resourceId
}
}).catch(err => {
})
} else if (Object.keys(typeStrObj).includes(typeName.value) || typeName.value == '能力评价') {
refObj.value = item
detailsVisible.value = true
processDefinitionName.value = item.processDefinitionName
@ -401,9 +425,18 @@ const getApplyList = () => {
num.value = []
showType.value = ''
} else if (typeName.value == '设备申请') {
let _state = ended.value === '' ? '全部' : ended.value === true ? '审核完成' : '审核中';
getDeviceApply(_state).then(res => {
if (res.data.code == 0) {
contentList.data = []
num.value = []
showType.value = ''
contentList.data = res.data.data.list || []
total.value = res.data.data.total
showType.value = '设备申请';
//
getDeviceNum()
}
}).catch(err => {
})
} else if (Object.keys(typeStrObj).includes(typeName.value)) {
processDefinitionKey.value = typeStrObj[typeName.value]
params.processDefinitionKey = processDefinitionKey.value;
@ -528,6 +561,61 @@ const del = () => {
}
})
}
// 西 todo
const getDeviceApply = (state) => {
return new Promise((resolve, reject) => {
let _data = {
page: page.value,
limit: 4,
state
}
deviceApplylist(_data).then(res => {
resolve(res)
console.log('res----设备申请-------->', res);
}).catch(err => {
reject(err)
console.log('err------------>', err);
})
})
}
// 西--
const getDeviceDetailInfo = (deviceId) => {
return new Promise((resolve, reject) => {
getDeviceDetail(deviceId).then(res => {
resolve(res)
console.log('res----查询详情-------->', res);
}).catch(err => {
reject(err)
console.log('err------------>', err);
})
})
}
// 西-,
const getDeviceNum = () => {
if (!numFlag.value) {
return;
}
num.value = []
Promise.all([getDeviceApply('审核中'), getDeviceApply('审核完成')]).then(res => {
console.log('res-----数量------->', res);
let unfinished = res[0] && res[0].data && res[0].data.data;
let finished = res[1] && res[1].data && res[1].data.data;
num.value.unfinished = unfinished.total || '';
num.value.finished = finished.total || '';
numFlag.value = false
}).catch(err => {
console.log('err------------>', err);
})
}
const phoneVisible = ref(false)
const showPhoneModal = () => {
phoneVisible.value = true
}
mybus.on('closeModal', (obj) => {
detailsVisible.value = false
changeType(obj.type, obj.index)