pref:批量上传&资源管理小优化 (#199)

This commit is contained in:
wang-liang0615 2023-10-12 15:06:39 +08:00 committed by GitHub
parent 4e1f25b389
commit cbe579fdb4
4 changed files with 15 additions and 8 deletions

View File

@ -99,7 +99,7 @@
align="center" align="center"
show-overflow> show-overflow>
<template #default="{ row }"> <template #default="{ row }">
<span v-show="row.isGroup"> <span v-show="isGroup">
<a @click="handleDisplayMember(row)">成员</a> <a @click="handleDisplayMember(row)">成员</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a @click="handleGroupEdit(row)">编辑</a> <a @click="handleGroupEdit(row)">编辑</a>

View File

@ -61,18 +61,18 @@ const genCmdbRoutes = async () => {
name: 'cmdb_disabled2', name: 'cmdb_disabled2',
meta: { title: '配置', disabled: true, }, meta: { title: '配置', disabled: true, },
}, },
{
path: '/cmdb/batch',
component: () => import('../views/batch'),
name: 'cmdb_batch',
meta: { 'title': '批量导入', icon: 'ops-cmdb-batch', selectedIcon: 'ops-cmdb-batch-selected', keepAlive: false }
},
{ {
path: '/cmdb/preference', path: '/cmdb/preference',
component: () => import('../views/preference/index'), component: () => import('../views/preference/index'),
name: 'cmdb_preference', name: 'cmdb_preference',
meta: { title: '我的订阅', icon: 'ops-cmdb-preference', selectedIcon: 'ops-cmdb-preference-selected', keepAlive: false } meta: { title: '我的订阅', icon: 'ops-cmdb-preference', selectedIcon: 'ops-cmdb-preference-selected', keepAlive: false }
}, },
{
path: '/cmdb/batch',
component: () => import('../views/batch'),
name: 'cmdb_batch',
meta: { 'title': '批量导入', icon: 'ops-cmdb-batch', selectedIcon: 'ops-cmdb-batch-selected', keepAlive: false }
},
{ {
path: '/cmdb/ci_types', path: '/cmdb/ci_types',
name: 'ci_type', name: 'ci_type',

View File

@ -5,7 +5,7 @@
</div> </div>
<a-row> <a-row>
<a-col :span="12"> <a-col :span="12">
<upload-file-form ref="uploadFileForm" @uploadDone="uploadDone"></upload-file-form> <upload-file-form :ciType="ciType" ref="uploadFileForm" @uploadDone="uploadDone"></upload-file-form>
</a-col> </a-col>
<a-col :span="24" v-if="ciType && uploadData.length"> <a-col :span="24" v-if="ciType && uploadData.length">
<CiUploadTable :ciTypeAttrs="ciTypeAttrs" ref="ciUploadTable" :uploadData="uploadData"></CiUploadTable> <CiUploadTable :ciTypeAttrs="ciTypeAttrs" ref="ciUploadTable" :uploadData="uploadData"></CiUploadTable>

View File

@ -7,6 +7,7 @@
accept=".xls,.xlsx" accept=".xls,.xlsx"
:showUploadList="false" :showUploadList="false"
:fileList="fileList" :fileList="fileList"
:disabled="!ciType"
> >
<img :style="{ width: '80px', height: '80px' }" src="@/assets/file_upload.png" /> <img :style="{ width: '80px', height: '80px' }" src="@/assets/file_upload.png" />
<p class="ant-upload-text">点击或拖拽文件至此上传</p> <p class="ant-upload-text">点击或拖拽文件至此上传</p>
@ -24,6 +25,12 @@ import { processFile } from '@/modules/cmdb/api/batch'
export default { export default {
name: 'UploadFileForm', name: 'UploadFileForm',
props: {
ciType: {
type: Number,
default: 0,
}
},
data() { data() {
return { return {
ciItemNum: 0, ciItemNum: 0,