|
@@ -5,23 +5,39 @@
|
|
|
<ele-pro-table ref="table" :columns="columns" :datasource="datasource">
|
|
<ele-pro-table ref="table" :columns="columns" :datasource="datasource">
|
|
|
<!-- 表头工具栏 -->
|
|
<!-- 表头工具栏 -->
|
|
|
<template v-slot:toolbar>
|
|
<template v-slot:toolbar>
|
|
|
- <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="openEdit('add')">
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
|
+ class="ele-btn-icon"
|
|
|
|
|
+ @click="openEdit('add')"
|
|
|
|
|
+ >
|
|
|
添加
|
|
添加
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
- <template v-slot:files="scope">
|
|
|
|
|
- <el-link v-for="link in scope.row.files" :key="link.id" type="primary" :underline="false"
|
|
|
|
|
|
|
+ <template v-slot:files="{ row }">
|
|
|
|
|
+ <!-- <el-link v-for="link in scope.row.files" :key="link.id" type="primary" :underline="false"
|
|
|
@click="downloadFile(link)">
|
|
@click="downloadFile(link)">
|
|
|
{{ link.name }}
|
|
{{ link.name }}
|
|
|
- </el-link>
|
|
|
|
|
|
|
+ </el-link> -->
|
|
|
|
|
+ <fileMain v-model="row.files" type="view"></fileMain>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<!-- 操作列 -->
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row }">
|
|
<template v-slot:action="{ row }">
|
|
|
- <el-link type="primary" :underline="false" icon="el-icon-edit" @click="openEdit('edit', row)">
|
|
|
|
|
|
|
+ <el-link
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ :underline="false"
|
|
|
|
|
+ icon="el-icon-edit"
|
|
|
|
|
+ @click="openEdit('edit', row)"
|
|
|
|
|
+ >
|
|
|
修改
|
|
修改
|
|
|
</el-link>
|
|
</el-link>
|
|
|
- <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove(row)">
|
|
|
|
|
|
|
+ <el-popconfirm
|
|
|
|
|
+ class="ele-action"
|
|
|
|
|
+ title="确定要删除吗?"
|
|
|
|
|
+ @confirm="remove(row)"
|
|
|
|
|
+ >
|
|
|
<template v-slot:reference>
|
|
<template v-slot:reference>
|
|
|
<el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
<el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
删除
|
|
删除
|
|
@@ -31,125 +47,132 @@
|
|
|
</template>
|
|
</template>
|
|
|
</ele-pro-table>
|
|
</ele-pro-table>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
- <newEdit v-if="showEdit" :type="editType" :editObj="editObj" @close="close"></newEdit>
|
|
|
|
|
|
|
+ <newEdit
|
|
|
|
|
+ v-if="showEdit"
|
|
|
|
|
+ :type="editType"
|
|
|
|
|
+ :editObj="editObj"
|
|
|
|
|
+ @close="close"
|
|
|
|
|
+ ></newEdit>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
-import search from './components/search.vue';
|
|
|
|
|
-import newEdit from './components/newEdit.vue';
|
|
|
|
|
-import { getList, removeItem } from '@/api/inspectionPoint';
|
|
|
|
|
-import dictMixins from '@/mixins/dictMixins';
|
|
|
|
|
-import { getFile } from '@/api/system/file';
|
|
|
|
|
|
|
+ import fileMain from '@/components/addDoc/index.vue';
|
|
|
|
|
+ import search from './components/search.vue';
|
|
|
|
|
+ import newEdit from './components/newEdit.vue';
|
|
|
|
|
+ import { getList, removeItem } from '@/api/inspectionPoint';
|
|
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
|
|
+ import { getFile } from '@/api/system/file';
|
|
|
|
|
|
|
|
-export default {
|
|
|
|
|
- mixins: [dictMixins],
|
|
|
|
|
- components: {
|
|
|
|
|
- search,
|
|
|
|
|
- newEdit
|
|
|
|
|
- },
|
|
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
- columns: [
|
|
|
|
|
- {
|
|
|
|
|
- width: 55,
|
|
|
|
|
- type: 'index',
|
|
|
|
|
- label: '序号',
|
|
|
|
|
- columnKey: 'index',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- fixed: 'left'
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ export default {
|
|
|
|
|
+ mixins: [dictMixins],
|
|
|
|
|
+ components: {
|
|
|
|
|
+ search,
|
|
|
|
|
+ newEdit,
|
|
|
|
|
+ fileMain
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ columns: [
|
|
|
|
|
+ {
|
|
|
|
|
+ width: 55,
|
|
|
|
|
+ type: 'index',
|
|
|
|
|
+ label: '序号',
|
|
|
|
|
+ columnKey: 'index',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ fixed: 'left'
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'pointCode',
|
|
|
|
|
- label: '编码',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- fixed: 'left'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '名称',
|
|
|
|
|
- prop: 'pointName',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- fixed: 'left'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '区域',
|
|
|
|
|
- prop: 'areaName',
|
|
|
|
|
- align: 'center'
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'pointCode',
|
|
|
|
|
+ label: '编码',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ fixed: 'left'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '名称',
|
|
|
|
|
+ prop: 'pointName',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ fixed: 'left'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '区域',
|
|
|
|
|
+ prop: 'areaName',
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- {
|
|
|
|
|
- label: '附件',
|
|
|
|
|
- slot: 'files',
|
|
|
|
|
- align: 'center'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'createUserName',
|
|
|
|
|
- label: '创建人',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- align: 'center'
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '附件',
|
|
|
|
|
+ slot: 'files',
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'createUserName',
|
|
|
|
|
+ label: '创建人',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'createTime',
|
|
|
|
|
- label: '创建时间',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- minWidth: 110
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- columnKey: 'action',
|
|
|
|
|
- label: '操作',
|
|
|
|
|
- width: 220,
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- resizable: false,
|
|
|
|
|
- slot: 'action',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'createTime',
|
|
|
|
|
+ label: '创建时间',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 110
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ columnKey: 'action',
|
|
|
|
|
+ label: '操作',
|
|
|
|
|
+ width: 220,
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ resizable: false,
|
|
|
|
|
+ slot: 'action',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
|
|
|
- editType: null,
|
|
|
|
|
- editObj: {},
|
|
|
|
|
- showEdit: false
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- created() { },
|
|
|
|
|
- methods: {
|
|
|
|
|
- datasource({ page, where, limit }) {
|
|
|
|
|
- return getList({
|
|
|
|
|
- ...where,
|
|
|
|
|
- pageNum: page,
|
|
|
|
|
- size: limit
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- reload(where) {
|
|
|
|
|
- this.$refs.table.reload({
|
|
|
|
|
- where: where,
|
|
|
|
|
- page: 1
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- openEdit(type, row) {
|
|
|
|
|
- this.editType = type;
|
|
|
|
|
- this.editObj = row || {};
|
|
|
|
|
- this.showEdit = true;
|
|
|
|
|
- },
|
|
|
|
|
- close(val) {
|
|
|
|
|
- this.showEdit = false;
|
|
|
|
|
- if (val) {
|
|
|
|
|
- this.reload();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ editType: null,
|
|
|
|
|
+ editObj: {},
|
|
|
|
|
+ showEdit: false
|
|
|
|
|
+ };
|
|
|
},
|
|
},
|
|
|
|
|
+ created() {},
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ datasource({ page, where, limit }) {
|
|
|
|
|
+ return getList({
|
|
|
|
|
+ ...where,
|
|
|
|
|
+ pageNum: page,
|
|
|
|
|
+ size: limit
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ reload(where) {
|
|
|
|
|
+ this.$refs.table.reload({
|
|
|
|
|
+ where: where,
|
|
|
|
|
+ page: 1
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ openEdit(type, row) {
|
|
|
|
|
+ this.editType = type;
|
|
|
|
|
+ this.editObj = row || {};
|
|
|
|
|
+ this.showEdit = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ close(val) {
|
|
|
|
|
+ this.showEdit = false;
|
|
|
|
|
+ if (val) {
|
|
|
|
|
+ this.reload();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- downloadFile(file) {
|
|
|
|
|
- getFile({ objectName: file.storePath }, file.name);
|
|
|
|
|
- },
|
|
|
|
|
- remove(row) {
|
|
|
|
|
- removeItem([row.id])
|
|
|
|
|
- .then((message) => {
|
|
|
|
|
- this.$message.success(message);
|
|
|
|
|
- this.reload()
|
|
|
|
|
- })
|
|
|
|
|
- .catch((e) => { });
|
|
|
|
|
|
|
+ downloadFile(file) {
|
|
|
|
|
+ getFile({ objectName: file.storePath }, file.name);
|
|
|
|
|
+ },
|
|
|
|
|
+ remove(row) {
|
|
|
|
|
+ removeItem([row.id])
|
|
|
|
|
+ .then((message) => {
|
|
|
|
|
+ this.$message.success(message);
|
|
|
|
|
+ this.reload();
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((e) => {});
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ };
|
|
|
</script>
|
|
</script>
|