update 文档拆分-编辑-导入

This commit is contained in:
赵霄
2023-10-23 15:58:22 +08:00
parent 07f4f9def6
commit 23d131e3bd
@@ -75,15 +75,20 @@
<!--新增--> <!--新增-->
<!--<a-button icon="plus" type="primary" @click="handleAdd" v-has="'split:sarFileSplitItems:add'">{{ $t('newlyAdded') }}</a-button>--> <!--<a-button icon="plus" type="primary" @click="handleAdd" v-has="'split:sarFileSplitItems:add'">{{ $t('newlyAdded') }}</a-button>-->
<!--导入--> <!--导入-->
<a-upload name="file" <span @click="handleImport">
:showUploadList="false" <a-button type="primary" icon="download" ghost v-if="!menuId">{{ $t('import') }}</a-button>
:multiple="false" <a-upload v-if="menuId"
:headers="tokenHeader" name="file"
:action="importExcelUrl" :showUploadList="false"
v-has="'split:sarFileSplitItems:import'" :multiple="false"
@change="handleImportExcel"> :headers="tokenHeader"
<a-button type="primary" icon="download" ghost>{{ $t('import') }}</a-button> :action="importExcelUrl"
</a-upload> v-has="'split:sarFileSplitItems:import'"
:data="uploadData"
@change="handleImportExcel">
<a-button type="primary" icon="download" ghost>{{ $t('import') }}</a-button>
</a-upload>
</span>
<!--导出--> <!--导出-->
<a-button icon="upload" <a-button icon="upload"
type="primary" type="primary"
@@ -266,13 +271,14 @@ export default {
downTemplateUrl: '/laws/DocumentTool/documentSplit/downloadImportTemplate' // 模板下载 downTemplateUrl: '/laws/DocumentTool/documentSplit/downloadImportTemplate' // 模板下载
}, },
disabledMixinsCreate: true, disabledMixinsCreate: true,
tableSlotField: ['item_content', 'interpretation_articles'] tableSlotField: ['item_content', 'interpretation_articles'],
uploadData: {}
} }
}, },
computed: { computed: {
// 页面标题是标准名称 // 页面标题是标准名称
pageTitle () { pageTitle () {
return this.$route.query.standardName return this.$route.query.infoNumber + ' ' + this.$route.query.standardName
}, },
...mapGetters(['userInfo']) ...mapGetters(['userInfo'])
}, },
@@ -325,7 +331,10 @@ export default {
handleSelectTreeNode ({ dataRef }) { handleSelectTreeNode ({ dataRef }) {
this.selectedKeys = [dataRef.id] this.selectedKeys = [dataRef.id]
this.menuId = this.selectedKeys[0] this.menuId = this.selectedKeys[0]
this.uploadMenuId = this.selectedKeys[0] this.uploadData = {
menuId: this.menuId,
infoId: this.infoId
}
this.filters.info_id = this.infoId this.filters.info_id = this.infoId
this.filters.menu_id = this.menuId this.filters.menu_id = this.menuId
this.loadData() this.loadData()
@@ -610,6 +619,11 @@ export default {
// 销毁这个提示 // 销毁这个提示
modalLoading.destroy() modalLoading.destroy()
}) })
},
handleImport () {
if (!this.menuId) {
this.$message.warning(this.$t('docTool.split.selectDirectoryTerms'))
}
} }
} }
} }