|
@@ -35,7 +35,7 @@
|
|
<el-table-column label="操作" align="center" width="150">
|
|
<el-table-column label="操作" align="center" width="150">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-dropdown split-button type="primary" size="small" @command="handleCommand($event, scope.row)">
|
|
<el-dropdown split-button type="primary" size="small" @command="handleCommand($event, scope.row)">
|
|
- <P @click="handleCommand('e', scope.row)">编辑</P>
|
|
|
|
|
|
+ <spa @click="handleCommand('e', scope.row)">编辑</spa>
|
|
|
|
|
|
<el-dropdown-menu slot="dropdown" class="text-align_center">
|
|
<el-dropdown-menu slot="dropdown" class="text-align_center">
|
|
<el-dropdown-item command="0">下载</el-dropdown-item>
|
|
<el-dropdown-item command="0">下载</el-dropdown-item>
|
|
@@ -46,7 +46,7 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
-
|
|
|
|
|
|
+
|
|
</el-main>
|
|
</el-main>
|
|
<el-footer>
|
|
<el-footer>
|
|
<div class="pagination">
|
|
<div class="pagination">
|
|
@@ -59,11 +59,11 @@
|
|
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" append-to-body destroy-on-close
|
|
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" append-to-body destroy-on-close
|
|
:close-on-click-modal="false" :before-close="handleClose">
|
|
:close-on-click-modal="false" :before-close="handleClose">
|
|
<el-form :model="form" :rules="rules" ref="form" label-width="80px" label-position="left">
|
|
<el-form :model="form" :rules="rules" ref="form" label-width="80px" label-position="left">
|
|
- <el-form-item label="文件名称" prop="name">
|
|
|
|
- <el-input v-model="form.name" placeholder="请输入文件名称"></el-input>
|
|
|
|
|
|
+ <el-form-item label="文件名称" prop="referencesName">
|
|
|
|
+ <el-input v-model="form.referencesName" placeholder="请输入文件名称"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="文件选择" class="margin-bottom_0">
|
|
<el-form-item label="文件选择" class="margin-bottom_0">
|
|
- <myUpload :file-list="form.systemFileList" @on-change="onchangeFile" @on-remove="onRemove"
|
|
|
|
|
|
+ <myUpload :file-list="form.systemFileList" @on-change="onchangeFile" @on-remove="onRemove" :multiple="false"
|
|
style="height: 185px;" :autoUpload="true">
|
|
style="height: 185px;" :autoUpload="true">
|
|
</myUpload>
|
|
</myUpload>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -80,8 +80,11 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { downLoad2 } from "@/utils"
|
|
|
|
|
|
+// import { downLoad2 } from "@/utils"
|
|
|
|
+import { File } from '@/utils/model/menu/mixins'
|
|
export default {
|
|
export default {
|
|
|
|
+ mixins: [File],
|
|
|
|
+ props: ['projectId'],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
// table数据
|
|
// table数据
|
|
@@ -97,27 +100,27 @@ export default {
|
|
{
|
|
{
|
|
name: "名称",
|
|
name: "名称",
|
|
type: "String",
|
|
type: "String",
|
|
- value: "name",
|
|
|
|
|
|
+ value: "referencesName",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: "类型",
|
|
name: "类型",
|
|
type: "String",
|
|
type: "String",
|
|
- value: "suffix",
|
|
|
|
|
|
+ value: "type",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: "所属报告",
|
|
name: "所属报告",
|
|
type: "String",
|
|
type: "String",
|
|
- value: "reportName",
|
|
|
|
|
|
+ value: "projectName",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: "创建人",
|
|
name: "创建人",
|
|
type: "String",
|
|
type: "String",
|
|
- value: "personName",
|
|
|
|
|
|
+ value: "createName",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: "创建时间",
|
|
name: "创建时间",
|
|
type: "String",
|
|
type: "String",
|
|
- value: "DataTime",
|
|
|
|
|
|
+ value: "createTime",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: "备注",
|
|
name: "备注",
|
|
@@ -126,7 +129,14 @@ export default {
|
|
},
|
|
},
|
|
],
|
|
],
|
|
// 检索字段
|
|
// 检索字段
|
|
- searchFiled: [],
|
|
|
|
|
|
+ searchFiled: [
|
|
|
|
+ {
|
|
|
|
+ label: '名称',
|
|
|
|
+ value: 'referencesName',
|
|
|
|
+ type: 1,
|
|
|
|
+ placeholder: '请输入名称'
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
// 检索字符串
|
|
// 检索字符串
|
|
searchOption: {},
|
|
searchOption: {},
|
|
//排序字段
|
|
//排序字段
|
|
@@ -143,7 +153,7 @@ export default {
|
|
},
|
|
},
|
|
// 表单校验
|
|
// 表单校验
|
|
rules: {
|
|
rules: {
|
|
- name: [{ required: true, message: '请输入文件名称', trigger: 'blur' },],
|
|
|
|
|
|
+ referencesName: [{ required: true, message: '请输入文件名称', trigger: 'blur' },],
|
|
},
|
|
},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -153,19 +163,18 @@ export default {
|
|
// 获取栏位
|
|
// 获取栏位
|
|
// await this.getColumn()
|
|
// await this.getColumn()
|
|
// 获取数据
|
|
// 获取数据
|
|
- // this.getList()
|
|
|
|
|
|
+ this.getList()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
-
|
|
|
|
// 弹窗确定
|
|
// 弹窗确定
|
|
submit() {
|
|
submit() {
|
|
// 判断文件是否都上传完毕
|
|
// 判断文件是否都上传完毕
|
|
this.$commonJS.allUploadFile(this.form)
|
|
this.$commonJS.allUploadFile(this.form)
|
|
-
|
|
|
|
|
|
+ this.form.fileGuid=this.form.fileGuids[0]
|
|
this.$refs.form.validate((valid) => {
|
|
this.$refs.form.validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
if (!this.form.id) {
|
|
if (!this.form.id) {
|
|
- this.$api.add(this.form).then(res => {
|
|
|
|
|
|
+ this.$api.addReferences(this.form).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.$message.success('新增成功')
|
|
this.$message.success('新增成功')
|
|
this.getList()
|
|
this.getList()
|
|
@@ -175,7 +184,7 @@ export default {
|
|
|
|
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- this.$api.edit(this.form).then(res => {
|
|
|
|
|
|
+ this.$api.updateReferences(this.form).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.$message.success('编辑成功')
|
|
this.$message.success('编辑成功')
|
|
this.getList()
|
|
this.getList()
|
|
@@ -199,6 +208,12 @@ export default {
|
|
},
|
|
},
|
|
// 上传的文件监听
|
|
// 上传的文件监听
|
|
onchangeFile(file, fileList) {
|
|
onchangeFile(file, fileList) {
|
|
|
|
+ if (this.form.systemFileList && this.form.systemFileList.length > 0) {
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ if (file) {
|
|
|
|
+ this.$set(this.form, 'referencesName', file.name)
|
|
|
|
+ }
|
|
if (file.guid && this.form.systemFileList && this.form.systemFileList.length > 0) {
|
|
if (file.guid && this.form.systemFileList && this.form.systemFileList.length > 0) {
|
|
let index = this.form.systemFileList.findIndex(item => {
|
|
let index = this.form.systemFileList.findIndex(item => {
|
|
return item.uid == file.uid
|
|
return item.uid == file.uid
|
|
@@ -223,25 +238,27 @@ export default {
|
|
},
|
|
},
|
|
// 新增
|
|
// 新增
|
|
handleAdd() {
|
|
handleAdd() {
|
|
|
|
+ this.form.projectId = this.projectId
|
|
this.dialogVisible = true
|
|
this.dialogVisible = true
|
|
},
|
|
},
|
|
getList() {
|
|
getList() {
|
|
let params = {
|
|
let params = {
|
|
- reportId: null,//放在外面还是searchQuery里面??
|
|
|
|
|
|
+ projectId: this.projectId,//放在外面还是searchQuery里面??
|
|
...this.queryParams,//分页信息
|
|
...this.queryParams,//分页信息
|
|
- searchQuery: this.$commonJS.objectToString(this.searchOption),//检索条件
|
|
|
|
- orderDTOList: this.sort,//排序信息
|
|
|
|
|
|
+ searchQuery: this.$commonJS.objectToString(this.searchOption || {}),//检索条件
|
|
|
|
+ // orderDTOList: this.sort,//排序信息
|
|
}
|
|
}
|
|
- this.loading = false
|
|
|
|
- this.$api.query(params).then(res => {
|
|
|
|
|
|
+ this.loading = true
|
|
|
|
+ this.$api.getReferences(params).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.tableData = res.data
|
|
this.tableData = res.data
|
|
this.total = res.data.total
|
|
this.total = res.data.total
|
|
- this.loading = true
|
|
|
|
|
|
+ this.loading = false
|
|
}
|
|
}
|
|
}).catch(error => {
|
|
}).catch(error => {
|
|
this.tableData = []
|
|
this.tableData = []
|
|
this.total = 0
|
|
this.total = 0
|
|
|
|
+ this.loading = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 分页
|
|
// 分页
|
|
@@ -287,10 +304,10 @@ export default {
|
|
this.handleEdit(row)
|
|
this.handleEdit(row)
|
|
break;
|
|
break;
|
|
case '0'://下载
|
|
case '0'://下载
|
|
- this.downloads(row)
|
|
|
|
|
|
+ this.downLoad(row)
|
|
break;
|
|
break;
|
|
case '1'://预览
|
|
case '1'://预览
|
|
-
|
|
|
|
|
|
+ this.preview(row)
|
|
break;
|
|
break;
|
|
case '2'://删除
|
|
case '2'://删除
|
|
this.handleDelete(row)
|
|
this.handleDelete(row)
|
|
@@ -300,7 +317,12 @@ export default {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 编辑
|
|
handleEdit(row) {
|
|
handleEdit(row) {
|
|
|
|
+ row.systemFileList = [{
|
|
|
|
+ name: row.referencesName,
|
|
|
|
+ guid:row.guid,
|
|
|
|
+ }]
|
|
this.form = row
|
|
this.form = row
|
|
this.dialogVisible = true
|
|
this.dialogVisible = true
|
|
},
|
|
},
|
|
@@ -314,7 +336,7 @@ export default {
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
type: 'warning'
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- this.$api.delete(ids).then(response => {
|
|
|
|
|
|
+ this.$api.deleteReferences(ids).then(response => {
|
|
if (response.code == 200) {
|
|
if (response.code == 200) {
|
|
this.$message.success('删除成功')
|
|
this.$message.success('删除成功')
|
|
this.queryParams.current = 1
|
|
this.queryParams.current = 1
|
|
@@ -325,10 +347,6 @@ export default {
|
|
this.$message.info('操作已取消')
|
|
this.$message.info('操作已取消')
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- // 下载
|
|
|
|
- downloads(data) {
|
|
|
|
- downLoad2(data.guid)
|
|
|
|
- },
|
|
|
|
},
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|