全部应用资源申请

This commit is contained in:
a0049873 2022-07-18 17:26:18 +08:00
parent 57758bbfa4
commit 5af7b5f7e8
5 changed files with 154 additions and 92 deletions

View File

@ -1,8 +1,8 @@
/* /*
* @Author: hisense.wuhongjian * @Author: hisense.wuhongjian
* @Date: 2022-04-01 19:19:40 * @Date: 2022-04-01 19:19:40
* @LastEditors: hisense.wuhongjian * @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-06-30 19:36:48 * @LastEditTime: 2022-07-18 16:24:44
* @Description: 告诉大家这是什么 * @Description: 告诉大家这是什么
*/ */
import request from '@/utils/request' import request from '@/utils/request'
@ -119,6 +119,14 @@ export function submitApply(data) {
data, data,
}) })
} }
//
export function applyAllApplication(data) {
return request({
url: '/ability/center/v2/applyAllApplication',
method: 'post',
data,
})
}
export function tabilityapplication(data) { export function tabilityapplication(data) {
return request({ return request({
url: '/processForm/tabilityapplication', url: '/processForm/tabilityapplication',
@ -342,7 +350,7 @@ export function getIntegrationServicesList(params) {
return request({ return request({
url: '/fuse/page', url: '/fuse/page',
method: 'get', method: 'get',
params params,
}) })
} }
@ -359,6 +367,6 @@ export function getDevelopDocTree(params) {
return request({ return request({
url: '/resource/selectDevelopDoc', url: '/resource/selectDevelopDoc',
method: 'get', method: 'get',
params params,
}) })
} }

View File

@ -39,6 +39,14 @@
class="resultListSearchInput" class="resultListSearchInput"
/> />
<button class="button-reset" @click="chongzhi()">重置</button> <button class="button-reset" @click="chongzhi()">重置</button>
<button
v-if="Cardsname == '应用资源'"
class="button-reset"
@click="applyAll()"
style="margin-left: 0.1rem"
>
全部申请
</button>
<div class="hengxian"></div> <div class="hengxian"></div>
</div> </div>
</div> </div>
@ -96,7 +104,7 @@
/> />
</div> </div>
</div> </div>
<div <!-- <div
class="top-content" class="top-content"
v-if="Cardsname == '组件服务' || Cardsname == '应用资源'" v-if="Cardsname == '组件服务' || Cardsname == '应用资源'"
> >
@ -119,7 +127,7 @@
</a-checkable-tag> </a-checkable-tag>
</div> </div>
</div> </div>
</div> </div> -->
</div> </div>
</template> </template>
</div> </div>
@ -316,7 +324,7 @@
/> />
</div> </div>
</div> </div>
<div class="top-content" v-if="Cardsname == '组件服务'"> <!-- <div class="top-content" v-if="Cardsname == '组件服务'">
<span class="top-content-title">共享条件</span> <span class="top-content-title">共享条件</span>
<div class="leixingsumfather"> <div class="leixingsumfather">
<div class="leixingsum"> <div class="leixingsum">
@ -336,7 +344,7 @@
</a-checkable-tag> </a-checkable-tag>
</div> </div>
</div> </div>
</div> </div> -->
</div> </div>
</template> </template>
</div> </div>
@ -514,7 +522,7 @@
/> />
</div> </div>
</div> </div>
<div class="top-content" v-if="Cardsname == '组件服务'"> <!-- <div class="top-content" v-if="Cardsname == '组件服务'">
<span class="top-content-title">共享条件</span> <span class="top-content-title">共享条件</span>
<div class="leixingsumfather"> <div class="leixingsumfather">
<div class="leixingsum"> <div class="leixingsum">
@ -534,7 +542,7 @@
</a-checkable-tag> </a-checkable-tag>
</div> </div>
</div> </div>
</div> </div> -->
</div> </div>
</template> </template>
</div> </div>
@ -1095,7 +1103,15 @@
getAppResources() getAppResources()
} }
}) })
//
const applyAll = () => {
router.push({
path: '/apply',
query: {
applyAll: true,
},
})
}
// //
const onShowSizeChange = (current, pageSize) => { const onShowSizeChange = (current, pageSize) => {
currentPage.value = current currentPage.value = current
@ -1193,6 +1209,7 @@
loading, loading,
getShoppingCartList, getShoppingCartList,
whoShow1, whoShow1,
applyAll,
} }
}, },
components: { components: {

View File

@ -6,7 +6,7 @@
<aside-menu></aside-menu> <aside-menu></aside-menu>
</aside> --> </aside> -->
<article> <article>
<div class="from-card" v-if="applySuccess"> <div class="from-card" v-if="applySuccess && !applyAll">
<AbilityToApplyFor :dataList="list"></AbilityToApplyFor> <AbilityToApplyFor :dataList="list"></AbilityToApplyFor>
</div> </div>
<div class="form-container"> <div class="form-container">
@ -243,6 +243,7 @@
startOfBusinessKey, startOfBusinessKey,
updateInstanceId, updateInstanceId,
submitApply, submitApply,
applyAllApplication,
getUser, getUser,
getUserInfo, getUserInfo,
relaunch, relaunch,
@ -269,25 +270,28 @@
const disabled = ref(false) const disabled = ref(false)
const flag = ref(false) const flag = ref(false)
const list = ref(JSON.parse(localStorage.getItem('applyList'))) const list = ref(JSON.parse(localStorage.getItem('applyList')))
const num = ref(0) const applyAll = router.currentRoute.value.query.applyAll
list.value.map((item) => { if (!applyAll) {
item.arr.map((val) => { list.value.map((item) => {
console.log(item, '组件===========================') item.arr.map((val) => {
let obj = item.children console.log(item, '组件===========================')
? item.children.filter((type) => type.id == val.id)[0] let obj = item.children
: val.type !== '应用资源' ? item.children.filter((type) => type.id == val.id)[0]
if (obj) { : val.type !== '应用资源'
console.log('11111111111111111111111111111', obj, flag.value) if (obj) {
if (obj.type !== '应用资源') { console.log('11111111111111111111111111111', obj, flag.value)
flag.value = true if (obj.type !== '应用资源') {
flag.value = true
}
} }
})
if (item.checkedList) {
console.log(item)
num.value += Number(item.checkedList.length)
} }
}) })
if (item.checkedList) { }
console.log(item) const num = ref(0)
num.value += Number(item.checkedList.length)
}
})
console.log( console.log(
'list', 'list',
list.value list.value
@ -299,7 +303,9 @@
let record = ref('1') let record = ref('1')
const text = ref('') const text = ref('')
const formName = reactive({ const formName = reactive({
title: list.value[0].children title: applyAll
? '全部应用资源申请'
: list.value[0].children
? list.value[0].children ? list.value[0].children
.filter((val) => val.id == list.value[0].checkedList[0])[0] .filter((val) => val.id == list.value[0].checkedList[0])[0]
.resourceName.concat( .resourceName.concat(
@ -412,73 +418,89 @@
if (!formName) { if (!formName) {
return message.error('请设置表单名称') return message.error('请设置表单名称')
} }
let ids = [] if (!applyAll) {
formName.system = [] let ids = []
console.log('list==================', list.value) formName.system = []
list.value.map((val) => { console.log('list==================', list.value)
val.arr.map((item) => { list.value.map((val) => {
if (item.type !== '基础设施') { val.arr.map((item) => {
formName.system.push({ if (item.type !== '基础设施') {
resourceId: item.resourceId, formName.system.push({
resourceName: item.resourceName, resourceId: item.resourceId,
}) resourceName: item.resourceName,
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,
}) })
}) console.log(item.id)
submitApply(obj).then((res) => {
applySuccess.value = false
console.log('摄像头申请================>', res)
if (item.id) { if (item.id) {
sgcDel({ ids: [item.id] }).then((res) => { ids.push(item.id)
if (res.data.msg === 'success') {
mybus.emit('getSgcNum')
}
})
} }
}) } 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,
})
})
submitApply(obj).then((res) => {
applySuccess.value = false
console.log('摄像头申请================>', res)
if (item.id) {
sgcDel({ ids: [item.id] }).then((res) => {
if (res.data.msg === 'success') {
mybus.emit('getSgcNum')
}
})
}
})
}
})
}) })
}) console.log('提交数据==========================>', formName, ids)
console.log('提交数据==========================>', formName, ids) if (formName.system.length !== 0) {
if (formName.system.length !== 0) { submitApply(formName).then((res) => {
submitApply(formName).then((res) => { // applySuccess.value = false
applySuccess.value = false message.success('申请提交成功,请到消息中心查看!')
message.success('操作成功!') console.log('能力申请================>', res)
console.log('能力申请================>', res) if (ids && ids.length > 0) {
if (ids && ids.length > 0) { sgcDel({ ids: ids }).then((res) => {
sgcDel({ ids: ids }).then((res) => { if (res.data.msg === 'success') {
if (res.data.msg === 'success') { mybus.emit('getSgcNum')
mybus.emit('getSgcNum') router.push({
path: '/DetailsPageconetent',
router.push({ query: {
path: '/DetailsPageconetent', select: '组件服务',
query: { },
select: '组件服务', })
}, }
}) })
} } else {
}) router.push({
} else { path: '/DetailsPageconetent',
query: {
select: '组件服务',
},
})
}
})
}
} else {
formName.applicationSystem = ''
applyAllApplication(formName).then((res) => {
if (res.data.code == 0) {
message.success('申请提交成功,请到消息中心查看!')
router.push({ router.push({
path: '/DetailsPageconetent', path: '/DetailsPageconetent',
query: { query: {
select: '组件服务', select: '组件服务',
}, },
}) })
} else {
message.error('申请失败!')
} }
}) })
} }
@ -668,6 +690,7 @@
systemOptions, systemOptions,
applicationSceneOpthion, applicationSceneOpthion,
flag, flag,
applyAll,
} }
}, },
} }

View File

@ -289,7 +289,7 @@
" "
> >
{{ {{
item.shareCondition == '免批申请' ? '免批申请' : '立即申请' item.shareCondition == '免批申请' ? '立即申请' : '立即申请'
}} }}
</a-button> </a-button>
</div> </div>
@ -548,8 +548,8 @@
type: item.type, type: item.type,
componentType: componentType:
(item.infoList.filter( (item.infoList.filter(
(val) => (val.attrType == '组件类型')[0] (val) => val.attrType == '组件类型'
) && )[0] &&
item.infoList.filter( item.infoList.filter(
(val) => val.attrType == '组件类型' (val) => val.attrType == '组件类型'
)[0].attrValue) || )[0].attrValue) ||

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua * @Author: hisense.liangjunhua
* @Date: 2022-07-12 09:42:44 * @Date: 2022-07-12 09:42:44
* @LastEditors: hisense.liangjunhua * @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-07-13 15:56:51 * @LastEditTime: 2022-07-18 17:25:03
* @Description:我的申请 能力申请 查看详情 * @Description:我的申请 能力申请 查看详情
--> -->
<template> <template>
@ -34,7 +34,7 @@
申请单附件 申请单附件
<span class="enclosure"> <span class="enclosure">
{{ props.refObj.enclosureName || '--' }} {{ props.refObj.enclosureName || '--' }}
<span class="btn">预览</span> <span class="btn" @click="showThis()">预览</span>
</span> </span>
</span> </span>
</p> </p>
@ -139,6 +139,13 @@
const props = defineProps({ const props = defineProps({
refObj: { type: Object, default: null }, refObj: { type: Object, default: null },
}) })
const showThis = () => {
window.open(
window.SITE_CONFIG.previewUrl +
'hisense_office/onlinePreview?url=' +
btoa(encodeURI(props.refObj.enclosure))
)
}
const showArr = ref([]) const showArr = ref([])
console.log(props.refObj, '=====================================') console.log(props.refObj, '=====================================')
if (props.refObj.resourceApplication) { if (props.refObj.resourceApplication) {
@ -286,6 +293,13 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.name { .name {
width: 6rem;
height: 0.2rem;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
.type { .type {
background: #0087ff; background: #0087ff;
color: #fff; color: #fff;