|
@@ -0,0 +1,212 @@
|
|
|
+<template>
|
|
|
+ <div id="warrant-manage-detail" class="detail-default">
|
|
|
+ <div class="detail-header">
|
|
|
+ <div class="d-title">
|
|
|
+ <span v-if="route.params.type==='Detail'">详情</span>
|
|
|
+ <span v-if="route.params.type==='Check'">审核</span>
|
|
|
+ </div>
|
|
|
+ <div class="d-btns">
|
|
|
+ <template v-if="route.params.type==='Check'">
|
|
|
+ <el-button class="btn-default primary" type="primary" @click="handleSave(2)">审核通过</el-button>
|
|
|
+ <el-button class="btn-default primary" type="danger" @click="handleSave(3)">审核不通过</el-button>
|
|
|
+ </template>
|
|
|
+ <el-button class="btn-default" @click="handleClose">关闭</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="detail-main-wrapper">
|
|
|
+ <div class="detail-main">
|
|
|
+ <span class="detail-part-title">基本信息</span>
|
|
|
+ <el-form :model="form.apiInfo" label-position="top" ref="apiInfo" class="form-detail" disabled>
|
|
|
+ <el-form-item label="接口名称" prop="apiName">
|
|
|
+ <el-input v-model="form.apiInfo.apiName" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="接口类别" prop="apiClassName">
|
|
|
+ <el-input v-model="form.apiInfo.apiClassName" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="接口简介" prop="apiDes" class="item-row">
|
|
|
+ <el-input type="textarea" :rows="4" v-model="form.apiInfo.apiDes"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <span class="detail-part-title">接口信息</span>
|
|
|
+ <el-form-item label="接口地址" prop="apiUrl">
|
|
|
+ <el-input v-model="form.apiInfo.apiUrl" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="请求方式" prop="apiRequest">
|
|
|
+ <el-input v-model="form.apiInfo.apiRequest" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="接口说明" prop="apiExplain" class="item-row">
|
|
|
+ <el-input type="textarea" :rows="4" v-model="form.apiInfo.apiExplain"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span class="detail-part-title">申请信息</span>
|
|
|
+ <el-form :model="form.applicationInfo" label-position="top" ref="applicationInfo" class="form-detail" disabled>
|
|
|
+ <el-form-item label="访问IP" prop="applicationAccessIp">
|
|
|
+ <el-input v-model="form.applicationInfo.applicationAccessIp" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="使用期限(天)" prop="applicationUseDay">
|
|
|
+ <el-input v-model="form.applicationInfo.applicationUseDay" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="每天访问" prop="applicationAccessFlow">
|
|
|
+ <el-input v-model="form.applicationInfo.applicationAccessFlow" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="并发量" prop="applicationConcurrent">
|
|
|
+ <el-input v-model="form.applicationInfo.applicationConcurrent" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="申请人" prop="applicationUser">
|
|
|
+ <el-input v-model="form.applicationInfo.applicationUser" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="所属单位" prop="tresourceName">
|
|
|
+ <el-input v-model="form.applicationInfo.tresourceName" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="申请时间" prop="applicationTime">
|
|
|
+ <el-input v-model="form.applicationInfo.applicationTime" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="申请原因" prop="applicationReason" class="item-row">
|
|
|
+ <el-input type="textarea" :rows="4" v-model="form.applicationInfo.applicationReason"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span class="detail-part-title">申请信息</span>
|
|
|
+ <el-form :model="form.CheckInfo" :rules="rules" label-position="top" ref="CheckInfo" class="form-detail">
|
|
|
+ <template v-if="route.params.type==='Detail'">
|
|
|
+ <el-form-item label="审核人" prop="auditUser">
|
|
|
+ <el-input v-model="form.CheckInfo.auditUser" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="审核时间" prop="auditTime">
|
|
|
+ <el-input v-model="form.CheckInfo.auditTime" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ <el-form-item label="审核意见" prop="auditReason" class="item-row">
|
|
|
+ <el-input type="textarea" :rows="4" v-model="form.CheckInfo.auditReason" :disabled="route.params.type==='Detail'"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <img v-if="route.params.type==='Detail' && form.CheckInfo.auditStatus === '2'" src="../../assets/imgs/pages/check-pass.png" alt="" class="stamp">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+ import {useRoute, useRouter} from "vue-router";
|
|
|
+ import {reactive, ref} from "vue";
|
|
|
+ import {onBeforeMount} from "@vue/runtime-core";
|
|
|
+ import {ServiceManageDetail,ApplicationDetail,AuditDetail,AuditSave} from "../../service/warrantManageApi";
|
|
|
+ import {ElMessage} from "element-plus";
|
|
|
+ import {toRef, toRefs} from "@vue/reactivity";
|
|
|
+
|
|
|
+ const route = useRoute()
|
|
|
+ const router = useRouter()
|
|
|
+ const form = ref({
|
|
|
+ apiInfo: {
|
|
|
+ apiName: '',
|
|
|
+ apiClass: '',
|
|
|
+ apiDes: '',
|
|
|
+ apiUrl:'',
|
|
|
+ apiRequest:'',
|
|
|
+ apiExplain:''
|
|
|
+ },
|
|
|
+ applicationInfo:{
|
|
|
+ applicationAccessIp:'',
|
|
|
+ applicationUseDay:'',
|
|
|
+ applicationAccessFlow:'',
|
|
|
+ applicationConcurrent:'',
|
|
|
+ applicationUser:'',
|
|
|
+ applicationTime:'',
|
|
|
+ applicationReason:''
|
|
|
+ },
|
|
|
+ CheckInfo:{
|
|
|
+ auditUser:'',
|
|
|
+ auditTime:'',
|
|
|
+ auditReason:'',
|
|
|
+ auditStatus:''
|
|
|
+ },
|
|
|
+ })
|
|
|
+ const CheckInfo = ref()
|
|
|
+ const state = ref(null)
|
|
|
+ const rules = reactive({})
|
|
|
+ function handleSave(stateValue) {
|
|
|
+ state.value = stateValue
|
|
|
+ Promise.all([CheckInfo.value.validate()]).then(valid => {
|
|
|
+ if(valid.findIndex(val => val===false)===-1) {
|
|
|
+ // 校验通过
|
|
|
+ let pForm={}
|
|
|
+ for (const k in form.value.CheckInfo) {
|
|
|
+ pForm[k] = form.value.CheckInfo[k]
|
|
|
+ }
|
|
|
+ pForm['auditStatus'] = state.value;
|
|
|
+ pForm['applicationId'] = route.params.id2
|
|
|
+ AuditSave(pForm).then(res => {
|
|
|
+ if(res.code=='200'&&res.data==='保存成功') {
|
|
|
+ ElMessage({type:'success', message: '修改成功'})
|
|
|
+ handleClose()
|
|
|
+ }else{
|
|
|
+ ElMessage({type:'fail', message: '修改失败'})
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ onBeforeMount(()=> {
|
|
|
+ ServiceManageDetail(route.params.id).then(res => {
|
|
|
+ if(res.code===200) {
|
|
|
+ const data = res.data
|
|
|
+ form.value.apiInfo = res.data
|
|
|
+ switch ( data.apiClass) {
|
|
|
+ case 1:
|
|
|
+ form.value.apiInfo.apiClassName = '基础底图'
|
|
|
+ break
|
|
|
+ case 2:
|
|
|
+ form.value.apiInfo.apiClassName = '空间查询'
|
|
|
+ break
|
|
|
+ case 3:
|
|
|
+ form.value.apiInfo.apiClassName = '三维分析'
|
|
|
+ break
|
|
|
+ case 4:
|
|
|
+ form.value.apiInfo.apiClassName = '空间可视化'
|
|
|
+ break
|
|
|
+ case 5:
|
|
|
+ form.value.apiInfo.apiClassName = '空间编辑'
|
|
|
+ break
|
|
|
+ case 6:
|
|
|
+ form.value.apiInfo.apiClassName = '其它功能'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ ApplicationDetail(route.params.id2).then(res => {
|
|
|
+ if(res.code===200) {
|
|
|
+ const data = res.data
|
|
|
+ form.value.applicationInfo = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ AuditDetail(route.params.id2).then(res => {
|
|
|
+ if(res.code===200) {
|
|
|
+ const data = res.data
|
|
|
+ if (res.data !== null) {
|
|
|
+ form.value.CheckInfo = res.data
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ function handleClose() {
|
|
|
+ router.push({
|
|
|
+ name: route.name.slice(0,-6)
|
|
|
+ })
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+ #warrant-manage-detail {
|
|
|
+ .detail-main {
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+ .stamp {
|
|
|
+ position: absolute;
|
|
|
+ width: 136px;
|
|
|
+ height: 136px;
|
|
|
+ top: 60px;
|
|
|
+ right: 60px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|