2025-11-03 15:36:35 +08:00
|
|
|
<template>
|
|
|
|
|
<!-- 招标解析 -->
|
|
|
|
|
<el-card class="analysis-container">
|
|
|
|
|
<div class="table-container">
|
|
|
|
|
<TableModel :formLabel="formLabel" :showOperation="true" :showRightTools="false" ref="analysisTableRef"
|
|
|
|
|
:columnsList="columnsList" :request-api="listAPI">
|
|
|
|
|
<template slot="tableTitle">
|
|
|
|
|
<h3>数据列表</h3>
|
|
|
|
|
</template>
|
|
|
|
|
<template slot="tableActions">
|
2025-11-03 15:43:46 +08:00
|
|
|
<el-button @click="handleAdd" v-hasPermi="['analysis:analysis:add']" class="add-btn"><i
|
|
|
|
|
class="el-icon-plus"></i> 新建项目</el-button>
|
2025-11-04 13:22:28 +08:00
|
|
|
<el-button @click="showViewer = true">预览文档</el-button>
|
2025-11-03 15:36:35 +08:00
|
|
|
</template>
|
|
|
|
|
<template slot="handle" slot-scope="{ data }">
|
|
|
|
|
<el-button type="text" v-hasPermi="['enterpriseLibrary:tool:detail']" class="action-btn"
|
|
|
|
|
@click="handleDetail(data)">
|
|
|
|
|
查看
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button type="text" v-hasPermi="['enterpriseLibrary:tool:edit']" class="action-btn"
|
|
|
|
|
style="color: #EAA819;" @click="handleUpdate(data)">
|
|
|
|
|
编辑
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button type="text" v-hasPermi="['enterpriseLibrary:tool:del']" class="action-btn"
|
|
|
|
|
style="color: #DB3E29;" @click="handleDelete(data)">
|
|
|
|
|
删除
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
</TableModel>
|
|
|
|
|
</div>
|
2025-11-04 13:22:28 +08:00
|
|
|
<el-dialog :visible.sync="showViewer" width="60%" append-to-body>
|
|
|
|
|
<OnlyOfficeViewer :document-id="documentId" :document-name="documentName" height="80vh"
|
|
|
|
|
:allow-download="true" @close="showViewer = false" @loaded="onViewerLoaded" @error="onViewerError"
|
|
|
|
|
@download-success="onDownloadSuccess" />
|
|
|
|
|
</el-dialog>
|
2025-11-03 15:36:35 +08:00
|
|
|
</el-card>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import TableModel from '@/components/TableModel2'
|
|
|
|
|
import { columnsList, formLabel } from './config'
|
|
|
|
|
import { listAPI, delDataAPI } from '@/api/analysis/analysis'
|
2025-11-04 13:22:28 +08:00
|
|
|
import OnlyOfficeViewer from '@/views/common/OnlyOfficeViewer.vue'
|
2025-11-03 15:36:35 +08:00
|
|
|
export default {
|
|
|
|
|
name: 'Tool',
|
|
|
|
|
components: {
|
|
|
|
|
TableModel,
|
2025-11-04 13:22:28 +08:00
|
|
|
OnlyOfficeViewer,
|
2025-11-03 15:36:35 +08:00
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
formLabel,
|
|
|
|
|
columnsList,
|
|
|
|
|
listAPI,
|
2025-11-04 13:22:28 +08:00
|
|
|
showViewer: false,
|
|
|
|
|
documentId: '716d9f3d89434c56bc49296dbbccc226',
|
|
|
|
|
documentName: 'technicalSolutionDatabase/2025/11/03/716d9f3d89434c56bc49296dbbccc226.docx'
|
2025-11-03 15:36:35 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
created() {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
2025-11-04 13:22:28 +08:00
|
|
|
onViewerLoaded(editor) {
|
|
|
|
|
console.log('文档查看器已加载', editor);
|
|
|
|
|
},
|
|
|
|
|
onViewerError(error) {
|
|
|
|
|
console.error('文档查看器错误', error);
|
|
|
|
|
this.$message.error('加载文档失败');
|
|
|
|
|
},
|
|
|
|
|
onDownloadSuccess() {
|
|
|
|
|
this.$message.success('文档下载成功');
|
2025-11-03 15:36:35 +08:00
|
|
|
},
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
handleAdd() {
|
|
|
|
|
this.title = "新增工器具";
|
|
|
|
|
this.isAdd = 'add';
|
|
|
|
|
this.row = { enterpriseId: this.enterpriseId };
|
|
|
|
|
this.isflag = true;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 修改操作 */
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
this.title = "修改工器具";
|
|
|
|
|
this.isAdd = 'edit';
|
|
|
|
|
this.row = row;
|
|
|
|
|
this.isflag = true;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/* 查看操作 */
|
|
|
|
|
handleDetail(row) {
|
|
|
|
|
this.title = "查看详情";
|
|
|
|
|
this.isAdd = 'detail';
|
|
|
|
|
this.row = row;
|
|
|
|
|
this.isflag = true;
|
|
|
|
|
},
|
2025-11-04 13:22:28 +08:00
|
|
|
|
2025-11-03 15:36:35 +08:00
|
|
|
/* 搜索操作 */
|
|
|
|
|
handleQuery() {
|
|
|
|
|
this.$refs.analysisTableRef.getTableList()
|
|
|
|
|
},
|
|
|
|
|
/** 删除操作 */
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
this.$confirm(`确定要删除"${row.toolName}"吗?删除后将无法恢复!`, '操作提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
|
|
customClass: 'delete-confirm-dialog'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
delDataAPI(
|
|
|
|
|
{
|
|
|
|
|
toolId: row.toolId,
|
|
|
|
|
enterpriseId: this.enterpriseId
|
|
|
|
|
}
|
|
|
|
|
).then(res => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.$message.success('删除成功');
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.msg || '删除失败');
|
|
|
|
|
}
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
console.error('删除失败:', error);
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.analysis-container {
|
|
|
|
|
height: calc(100vh - 84px);
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
background: linear-gradient(180deg, #F1F6FF 20%, #E5EFFF 100%);
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-04 13:22:28 +08:00
|
|
|
::v-deep .table-card {
|
2025-11-03 15:36:35 +08:00
|
|
|
height: calc(100vh - 230px) !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.add-btn {
|
|
|
|
|
width: 121px;
|
|
|
|
|
height: 36px;
|
|
|
|
|
background: #1F72EA;
|
|
|
|
|
box-shadow: 0px 4px 8px 0px rgba(51, 135, 255, 0.5);
|
|
|
|
|
border-radius: 4px 4px 4px 4px;
|
|
|
|
|
color: #fff;
|
|
|
|
|
border: none;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
transition: all 0.3s;
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
background: #4A8BFF;
|
|
|
|
|
box-shadow: 0px 6px 12px 0px rgba(51, 135, 255, 0.6);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.action-btn {
|
|
|
|
|
margin-right: 8px;
|
|
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
|
margin-right: 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|