|
@@ -59,25 +59,51 @@
|
|
|
</div>
|
|
|
<div class="hc-page-content-box hc-division-page">
|
|
|
<div v-if="isTemplateType" style="height: 50px" class="mb-2">
|
|
|
- <hc-card class="text-right">
|
|
|
- <el-button
|
|
|
+ <hc-card>
|
|
|
+ <div class="aligin-center flex justify-between">
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ :loading="downloadLoading"
|
|
|
+ hc-btn
|
|
|
+ type="warning"
|
|
|
+ color="#1591E4"
|
|
|
+ class="text-white"
|
|
|
+ @click="divisionExportClick"
|
|
|
+ >
|
|
|
+ <HcIcon name="folder-download" />
|
|
|
+ <span>导出划分</span>
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ hc-btn
|
|
|
+ color="#1591E4"
|
|
|
+ class="text-white"
|
|
|
+ @click="divisionImportCodeClick"
|
|
|
+ >
|
|
|
+ <HcIcon name="folder-upload" />
|
|
|
+ <span>导入划分编码</span>
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
|
|
|
- hc-btn
|
|
|
- type="warning"
|
|
|
- @click="divisionClick"
|
|
|
- >
|
|
|
- <HcIcon name="git-merge" />
|
|
|
- <span>节点划分</span>
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- hc-btn
|
|
|
- type="primary"
|
|
|
+ hc-btn
|
|
|
+ type="warning"
|
|
|
+ @click="divisionClick"
|
|
|
+ >
|
|
|
+ <HcIcon name="git-merge" />
|
|
|
+ <span>节点划分</span>
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ hc-btn
|
|
|
+ type="primary"
|
|
|
|
|
|
- @click="divisionImportClick"
|
|
|
- >
|
|
|
- <HcIcon name="folder-received" />
|
|
|
- <span>节点导入</span>
|
|
|
- </el-button>
|
|
|
+ @click="divisionImportClick"
|
|
|
+ >
|
|
|
+ <HcIcon name="folder-received" />
|
|
|
+ <span>节点导入</span>
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</hc-card>
|
|
|
</div>
|
|
|
<div class="basic-info">
|
|
@@ -1149,6 +1175,7 @@ import { HcDelMsg, getHeader } from 'hc-vue3-ui'
|
|
|
|
|
|
import { getChildList } from '~api/other'
|
|
|
import { getDictionaryData } from '~uti/tools'
|
|
|
+import { HcUploadFileApi } from 'hc-vue3-ui'
|
|
|
|
|
|
//初始变量
|
|
|
const router = useRouter()
|
|
@@ -2873,6 +2900,41 @@ const saveNodeNmeClick = async () => {
|
|
|
const contentStyle = computed(() => ({
|
|
|
'--project-info-height': !isTemplateType.value ? 'calc(100% - 238px)' : 'calc(100% - 298px)',
|
|
|
}))
|
|
|
+const downloadLoading = ref(false)
|
|
|
+const divisionExportClick = async ()=>{
|
|
|
+
|
|
|
+ downloadLoading.value = true
|
|
|
+ const { error, disposition, res } = await divisionApi.exportTree({
|
|
|
+ contractId: contractId.value,
|
|
|
+
|
|
|
+ })
|
|
|
+ //处理数据
|
|
|
+ downloadLoading.value = false
|
|
|
+ if (!error) {
|
|
|
+ if (disposition) {
|
|
|
+ downloadBlob(res, disposition)
|
|
|
+ } else {
|
|
|
+ window.$message?.error('数据异常')
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+//导入划分模板
|
|
|
+const divisionImportCodeClick = ()=>{
|
|
|
+ HcUploadFileApi({
|
|
|
+ url: '/api/blade-manager/wbsTreeContract/importPartitionCode',
|
|
|
+ accept: '.xls,.xlsx,',
|
|
|
+ accept_tip: 'Excel(xls、xlsx)<br/>',
|
|
|
+
|
|
|
+ multiple: false,
|
|
|
+
|
|
|
+ success: ({ echoParams }, { data }) => {
|
|
|
+ window.$message.success(data?.msg || '上传成功')
|
|
|
+ },
|
|
|
+ error: () => {
|
|
|
+ window.$message.error('上传失败')
|
|
|
+ },
|
|
|
+ })
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|