|
|
@@ -37,7 +37,7 @@
|
|
|
@export-plan="handleExportPlan"
|
|
|
@link-to="(val) => linkTo(val, plan)"
|
|
|
/>
|
|
|
- <el-empty v-else description="暂无方案数据" />
|
|
|
+ <el-empty v-else description="暂无方案数据"/>
|
|
|
</template>
|
|
|
|
|
|
<!-- 底部右侧分页 -->
|
|
|
@@ -57,27 +57,42 @@
|
|
|
|
|
|
<!-- 干扰方案上传弹窗 -->
|
|
|
<DarkDialog
|
|
|
- :visible.sync="showInteUpload"
|
|
|
- title="上传干扰方案"
|
|
|
- width="50%">
|
|
|
- <el-upload
|
|
|
+ :visible.sync="showInteUpload"
|
|
|
+ :title="inteHasFile"
|
|
|
+ width="50%">
|
|
|
+ <div v-if="inteHasFile === '上传干扰方案'">
|
|
|
+ <el-upload
|
|
|
class="upload-demo"
|
|
|
ref="inteUpload"
|
|
|
action="#"
|
|
|
:file-list="inteFileList"
|
|
|
- accept=".doc,.docx,.pdf,.xlsx,.xls"
|
|
|
+ accept=".doc,.docx"
|
|
|
:auto-upload="false"
|
|
|
:on-change="handleInteFileChange"
|
|
|
:limit="1"
|
|
|
- >
|
|
|
- <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
|
|
- <el-button style="margin-left: 10px;" size="small" type="success" @click="submitInteUpload">
|
|
|
- 上传到服务器
|
|
|
- </el-button>
|
|
|
- <div slot="tip" class="el-upload__tip">
|
|
|
- 只能上传doc、docx、pdf、xlsx、xls格式的文件
|
|
|
- </div>
|
|
|
- </el-upload>
|
|
|
+ >
|
|
|
+ <!-- ,.pdf,.xlsx,.xls -->
|
|
|
+ <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
|
|
+ <el-button style="margin-left: 10px;" size="small" type="success" @click="submitInteUpload">
|
|
|
+ 上传到服务器
|
|
|
+ </el-button>
|
|
|
+ <div slot="tip" class="el-upload__tip">
|
|
|
+ 只能上传doc、docx格式的文件
|
|
|
+ </div>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-else>
|
|
|
+ <el-table :data="grFileList" border>
|
|
|
+ <el-table-column label="文件名称" prop="fileName"></el-table-column>
|
|
|
+ <el-table-column label="文件类型" prop="fileType"></el-table-column>
|
|
|
+ <el-table-column label="操作" width="120px" align="center">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <el-button @click="downFile(row)">下载</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="showInteUpload = false">取消</el-button>
|
|
|
</span>
|
|
|
@@ -85,31 +100,46 @@
|
|
|
|
|
|
<!-- 靶标方案上传弹窗 -->
|
|
|
<DarkDialog
|
|
|
- :visible.sync="showTargetUpload"
|
|
|
- title="上传靶标方案"
|
|
|
- width="50%">
|
|
|
- <el-upload
|
|
|
+ :visible.sync="showTargetUpload"
|
|
|
+ :title="hasFile"
|
|
|
+ width="50%">
|
|
|
+ <div v-if="hasFile === '上传靶标方案'">
|
|
|
+ <el-upload
|
|
|
class="upload-demo"
|
|
|
ref="targetUpload"
|
|
|
action="#"
|
|
|
:file-list="targetFileList"
|
|
|
- accept=".doc,.docx,.pdf,.xlsx,.xls"
|
|
|
+ accept=".doc,.docx"
|
|
|
:auto-upload="false"
|
|
|
:on-change="handleTargetFileChange"
|
|
|
:limit="1"
|
|
|
- >
|
|
|
- <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
|
|
- <el-button style="margin-left: 10px;" size="small" type="success" @click="submitTargetUpload">
|
|
|
- 上传到服务器
|
|
|
- </el-button>
|
|
|
- <div slot="tip" class="el-upload__tip">
|
|
|
- 只能上传doc、docx、pdf、xlsx、xls格式的文件
|
|
|
- </div>
|
|
|
- </el-upload>
|
|
|
+ >
|
|
|
+ <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
|
|
+ <el-button style="margin-left: 10px;" size="small" type="success" @click="submitTargetUpload">
|
|
|
+ 上传到服务器
|
|
|
+ </el-button>
|
|
|
+ <div slot="tip" class="el-upload__tip">
|
|
|
+ 只能上传doc、docx格式的文件
|
|
|
+ </div>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <el-table :data="bbFileList" border>
|
|
|
+ <el-table-column label="文件名称" prop="fileName"></el-table-column>
|
|
|
+ <el-table-column label="文件类型" prop="fileType"></el-table-column>
|
|
|
+ <el-table-column label="操作" width="120px" align="center">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <el-button @click="downFile(row)">下载</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="showTargetUpload = false">取消</el-button>
|
|
|
</span>
|
|
|
</DarkDialog>
|
|
|
+
|
|
|
<!-- 任务详情弹窗 -->
|
|
|
<DarkDialog title="任务详情"
|
|
|
:visible.sync="dialogVisible"
|
|
|
@@ -143,9 +173,10 @@ import {
|
|
|
planningSchemeUploadTarget
|
|
|
} from "@/api/planningScheme";
|
|
|
import {exportSolutionToWord} from "@/views/planningSchem/comprehensive/wordExporter";
|
|
|
-import { baseURL,contentType,tokenName } from "@/config";
|
|
|
+import {baseURL, contentType, tokenName} from "@/config";
|
|
|
import store from "@/store";
|
|
|
import {doUpload} from "@/api/tool/ossTool";
|
|
|
+// import Docx from 'docxjs'
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
@@ -155,6 +186,10 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ hasFile: '上传靶标方案',
|
|
|
+ inteHasFile: '上传干扰方案',
|
|
|
+ bbFileList: [],
|
|
|
+ grFileList: [],
|
|
|
tableData: [
|
|
|
{
|
|
|
date: '2023-06-01',
|
|
|
@@ -173,11 +208,11 @@ export default {
|
|
|
taskName: '',
|
|
|
taskCode: ''
|
|
|
},
|
|
|
- plans:[],
|
|
|
+ plans: [],
|
|
|
planss: [
|
|
|
{
|
|
|
id: '1',
|
|
|
- fightAway:"对陆",
|
|
|
+ fightAway: "对陆",
|
|
|
planName: '新型导弹打击试验',
|
|
|
taskName: '新型导弹打击试验',
|
|
|
taskCode: 'TASK-2023-001',
|
|
|
@@ -191,7 +226,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
id: '2',
|
|
|
- fightAway:"对陆",
|
|
|
+ fightAway: "对陆",
|
|
|
planName: '电子对抗演练',
|
|
|
taskName: '电子对抗演练',
|
|
|
taskCode: 'TASK-2023-002',
|
|
|
@@ -205,7 +240,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
id: '4',
|
|
|
- fightAway:"对陆",
|
|
|
+ fightAway: "对陆",
|
|
|
planName: '电子对抗演练',
|
|
|
taskName: '电子对抗演练',
|
|
|
taskCode: 'TASK-2023-003',
|
|
|
@@ -220,7 +255,7 @@ export default {
|
|
|
|
|
|
{
|
|
|
id: '3',
|
|
|
- fightAway:"对陆",
|
|
|
+ fightAway: "对陆",
|
|
|
planName: '新型导弹打击试验',
|
|
|
taskName: '新型导弹打击试验',
|
|
|
taskCode: 'TASK-2023-003',
|
|
|
@@ -234,7 +269,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
id: '9',
|
|
|
- fightAway:"对陆",
|
|
|
+ fightAway: "对陆",
|
|
|
planName: '电子对抗演练',
|
|
|
taskName: '电子对抗演练',
|
|
|
taskCode: 'TASK-2023-001',
|
|
|
@@ -252,7 +287,7 @@ export default {
|
|
|
pageSize: 10,
|
|
|
total: 0
|
|
|
},
|
|
|
- selectPlan:null,
|
|
|
+ selectPlan: null,
|
|
|
showAdvancedSearch: false,
|
|
|
showInteUpload: false, // 干扰方案上传弹窗
|
|
|
showTargetUpload: false, // 靶标方案上传弹窗
|
|
|
@@ -264,6 +299,20 @@ export default {
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 下载文件
|
|
|
+ downFile(data) {
|
|
|
+ const fileUrl = data.fileHttp;
|
|
|
+ if (!fileUrl) {
|
|
|
+ this.$message.error('文件链接不存在,无法下载');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const a = document.createElement('a');
|
|
|
+ a.href = fileUrl;
|
|
|
+ a.download = data.fileName; // 可根据需求从 data 中取文件名,如 data.fileName
|
|
|
+ document.body.appendChild(a);
|
|
|
+ a.click();
|
|
|
+ document.body.removeChild(a);
|
|
|
+ },
|
|
|
|
|
|
// 页面导航方法
|
|
|
navigateTo(type, isOk) {
|
|
|
@@ -277,19 +326,19 @@ export default {
|
|
|
|
|
|
// 干扰方案上传成功处理
|
|
|
async handleInteUploadSuccess(response, file, fileList) {
|
|
|
- if(response.code !==200){
|
|
|
+ if (response.code !== 200) {
|
|
|
this.$message.success('干扰方案上传失败');
|
|
|
return;
|
|
|
}
|
|
|
this.$message.success('干扰方案上传成功');
|
|
|
|
|
|
const fileJson = JSON.stringify(
|
|
|
- fileList.map(item => ({
|
|
|
- fileName: item.name,
|
|
|
- fileHttp: item.response?.data?.url || '',
|
|
|
- fileType: item.response?.data?.type || '',
|
|
|
- type: 1
|
|
|
- })).filter(item => item.fileHttp)
|
|
|
+ fileList.map(item => ({
|
|
|
+ fileName: item.name,
|
|
|
+ fileHttp: item.response?.data?.url || '',
|
|
|
+ fileType: item.response?.data?.type || '',
|
|
|
+ type: 1
|
|
|
+ })).filter(item => item.fileHttp)
|
|
|
);
|
|
|
|
|
|
try {
|
|
|
@@ -309,10 +358,9 @@ export default {
|
|
|
},
|
|
|
|
|
|
|
|
|
-
|
|
|
// 靶标方案上传成功处理
|
|
|
async handleTargetUploadSuccess(response, file, fileList) {
|
|
|
- if(response.code !==200){
|
|
|
+ if (response.code !== 200) {
|
|
|
this.$message.success('靶标方案上传失败');
|
|
|
return;
|
|
|
}
|
|
|
@@ -320,12 +368,12 @@ export default {
|
|
|
|
|
|
// 1. 将 fileList 转为 JSON(和干扰方案保持一致)
|
|
|
const fileJson = JSON.stringify(
|
|
|
- fileList.map(item => ({
|
|
|
- fileName: item.name,
|
|
|
- fileHttp: item.response?.data?.url || '',
|
|
|
- fileType: item.response?.data?.type || '',
|
|
|
- type: 2
|
|
|
- })).filter(item => item.fileHttp) // 过滤掉上传失败的文件
|
|
|
+ fileList.map(item => ({
|
|
|
+ fileName: item.name,
|
|
|
+ fileHttp: item.response?.data?.url || '',
|
|
|
+ fileType: item.response?.data?.type || '',
|
|
|
+ type: 2
|
|
|
+ })).filter(item => item.fileHttp) // 过滤掉上传失败的文件
|
|
|
);
|
|
|
|
|
|
try {
|
|
|
@@ -514,7 +562,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
handleViewDetail(plan) {
|
|
|
- this.$router.push({ path: '/planningSchem/overallPlanDesign',query:{batchId:plan.batchId} })
|
|
|
+ this.$router.push({path: '/planningSchem/overallPlanDesign', query: {batchId: plan.batchId}})
|
|
|
},
|
|
|
//导出
|
|
|
async handleExportPlan(plan) {
|
|
|
@@ -532,16 +580,26 @@ export default {
|
|
|
// 根据不同类型和状态判断显示上传还是跳转
|
|
|
if (val.type === "inte" && plan.interferenceSchemeStatus === '未导入') {
|
|
|
console.log("干扰方案未导入,显示上传组件")
|
|
|
+ this.inteHasFile = '上传干扰方案'
|
|
|
this.selectPlan = plan;
|
|
|
this.showInteUpload = true;
|
|
|
} else if (val.type === "target" && plan.targetSchemeStatus === '未导入') {
|
|
|
console.log("靶标方案未导入,显示上传组件")
|
|
|
+ this.hasFile = '上传靶标方案'
|
|
|
this.selectPlan = plan;
|
|
|
this.showTargetUpload = true;
|
|
|
- } else if (val.type === "meas" && plan.measurementSchemeStatus === '未编制' ) {
|
|
|
- this.$router.push({path: "/childPlan/measPlan", query: {plan:JSON.stringify(plan)}})
|
|
|
- } else if (val.type === 'meas' && plan.measurementSchemeStatus === '已编制' ) {
|
|
|
- this.$router.push({ path: '/home/collaborativeCreate_Cl',query:{plan:JSON.stringify(plan),isEdit:'false'} });
|
|
|
+ } else if (val.type === "meas" && plan.measurementSchemeStatus === '未编制') {
|
|
|
+ this.$router.push({path: "/childPlan/measPlan", query: {plan: JSON.stringify(plan)}})
|
|
|
+ } else if (val.type === 'meas' && plan.measurementSchemeStatus === '已编制') {
|
|
|
+ this.$router.push({path: '/home/collaborativeCreate_Cl', query: {plan: JSON.stringify(plan), isEdit: 'false'}});
|
|
|
+ } else if (val.type === "inte" && plan.interferenceSchemeStatus === '已导入') {
|
|
|
+ this.grFileList = JSON.parse(plan.schemeSubPlan)
|
|
|
+ this.inteHasFile = '查看干扰方案'
|
|
|
+ this.showInteUpload = true;
|
|
|
+ } else if (val.type === "target" && plan.targetSchemeStatus === '已导入') {
|
|
|
+ this.bbFileList = JSON.parse(plan.schemeSubPlan)
|
|
|
+ this.hasFile = '查看靶标方案'
|
|
|
+ this.showTargetUpload = true;
|
|
|
} else {
|
|
|
// 已导入/已编制状态正常跳转
|
|
|
this.navigateTo(val.type, val.isOk);
|
|
|
@@ -552,8 +610,8 @@ export default {
|
|
|
// 查询逻辑
|
|
|
const res = await planningSchemePage({
|
|
|
...this.queryForm,
|
|
|
- pageNo:this.pagination.currentPage,
|
|
|
- pageSize:this.pagination.pageSize,
|
|
|
+ pageNo: this.pagination.currentPage,
|
|
|
+ pageSize: this.pagination.pageSize,
|
|
|
})
|
|
|
this.plans = res.data.records
|
|
|
this.pagination.total = res.data.total
|