|
@@ -75,140 +75,140 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import doc_template from './doc_template.vue';
|
|
|
|
|
-import fileEdit from './file-edit.vue';
|
|
|
|
|
-import browse from './browse.vue';
|
|
|
|
|
-import { queryIds } from './api';
|
|
|
|
|
|
|
+ import doc_template from './doc_template.vue';
|
|
|
|
|
+ import fileEdit from './file-edit.vue';
|
|
|
|
|
+ import browse from './browse.vue';
|
|
|
|
|
+ import { queryIds } from './api';
|
|
|
|
|
|
|
|
-export default {
|
|
|
|
|
- components: { doc_template, fileEdit, browse },
|
|
|
|
|
|
|
+ export default {
|
|
|
|
|
+ components: { doc_template, fileEdit, browse },
|
|
|
|
|
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
- fileId: [],
|
|
|
|
|
- fileShow: false,
|
|
|
|
|
- showEditFlag: false,
|
|
|
|
|
- tableList: [],
|
|
|
|
|
- type: 'add',
|
|
|
|
|
- columns: [
|
|
|
|
|
- {
|
|
|
|
|
- label: '编码',
|
|
|
|
|
- prop: 'code',
|
|
|
|
|
- width: 180,
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'name',
|
|
|
|
|
- label: '文档名称',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- slot: 'name',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- minWidth: 200
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'storagePath',
|
|
|
|
|
- label: '文件名称',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ fileId: [],
|
|
|
|
|
+ fileShow: false,
|
|
|
|
|
+ showEditFlag: false,
|
|
|
|
|
+ tableList: [],
|
|
|
|
|
+ type: 'add',
|
|
|
|
|
+ columns: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '编码',
|
|
|
|
|
+ prop: 'code',
|
|
|
|
|
+ width: 180,
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'name',
|
|
|
|
|
+ label: '文档名称',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ slot: 'name',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 200
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'storagePath',
|
|
|
|
|
+ label: '文件名称',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- minWidth: 200,
|
|
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
|
|
- return cellValue && cellValue[0]?.name;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'version',
|
|
|
|
|
- label: '版本',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- minWidth: 100
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'createUserName',
|
|
|
|
|
- label: '创建人',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- minWidth: 100
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'createTime',
|
|
|
|
|
- label: '创建时间',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- minWidth: 160
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 200,
|
|
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
|
|
+ return cellValue && cellValue[0]?.name;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'version',
|
|
|
|
|
+ label: '版本',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 100
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'sizeUnit',
|
|
|
|
|
- label: '文档大小',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- minWidth: 100
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'createUserName',
|
|
|
|
|
+ label: '创建人',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 100
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'createTime',
|
|
|
|
|
+ label: '创建时间',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 160
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- {
|
|
|
|
|
- columnKey: 'action',
|
|
|
|
|
- label: '操作',
|
|
|
|
|
- width: 200,
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- resizable: false,
|
|
|
|
|
- slot: 'action',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- created() {},
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'sizeUnit',
|
|
|
|
|
+ label: '文档大小',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 100
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- methods: {
|
|
|
|
|
- open(fileId, type) {
|
|
|
|
|
- //查看详情:view 新增:add
|
|
|
|
|
- this.showEditFlag = true;
|
|
|
|
|
- this.fileId = fileId || [];
|
|
|
|
|
- if (type) {
|
|
|
|
|
- this.type = type;
|
|
|
|
|
- }
|
|
|
|
|
- this.init();
|
|
|
|
|
- },
|
|
|
|
|
- fileEditOpen() {
|
|
|
|
|
- this.$refs.fileEditRef.open();
|
|
|
|
|
- },
|
|
|
|
|
- remove(row) {
|
|
|
|
|
- this.tableList = this.tableList.filter((item) => item.code != row.code);
|
|
|
|
|
- this.fileId = this.tableList.map((item) => item.id);
|
|
|
|
|
- },
|
|
|
|
|
- async init() {
|
|
|
|
|
- if (this.fileId.length > 0) {
|
|
|
|
|
- this.tableList = await queryIds({ ids: "'" + this.fileId + "'" });
|
|
|
|
|
- } else {
|
|
|
|
|
- this.tableList = [];
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- done(id) {
|
|
|
|
|
- this.fileId.push(...id);
|
|
|
|
|
- this.init();
|
|
|
|
|
- },
|
|
|
|
|
- browseOpen(row) {
|
|
|
|
|
- this.$refs.browseRef.open(row);
|
|
|
|
|
- },
|
|
|
|
|
- addFile() {
|
|
|
|
|
- this.$emit(
|
|
|
|
|
- 'success',
|
|
|
|
|
- this.tableList.map((item) => item.id)
|
|
|
|
|
- );
|
|
|
|
|
- this.showEditFlag = false;
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ columnKey: 'action',
|
|
|
|
|
+ label: '操作',
|
|
|
|
|
+ width: 200,
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ resizable: false,
|
|
|
|
|
+ slot: 'action',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ };
|
|
|
},
|
|
},
|
|
|
- addTemplate() {
|
|
|
|
|
- let list = this.$refs.doc_templateRef.getTableList();
|
|
|
|
|
- this.fileShow = false;
|
|
|
|
|
- if (list.length == 0) {
|
|
|
|
|
- this.$message.error('请选择一条数据');
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ created() {},
|
|
|
|
|
+
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ open(fileId, type) {
|
|
|
|
|
+ //查看详情:view 新增:add
|
|
|
|
|
+ this.showEditFlag = true;
|
|
|
|
|
+ this.fileId = fileId || [];
|
|
|
|
|
+ if (type) {
|
|
|
|
|
+ this.type = type;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.init();
|
|
|
|
|
+ },
|
|
|
|
|
+ fileEditOpen() {
|
|
|
|
|
+ this.$refs.fileEditRef.open();
|
|
|
|
|
+ },
|
|
|
|
|
+ remove(row) {
|
|
|
|
|
+ this.tableList = this.tableList.filter((item) => item.code != row.code);
|
|
|
|
|
+ this.fileId = this.tableList.map((item) => item.id);
|
|
|
|
|
+ },
|
|
|
|
|
+ async init() {
|
|
|
|
|
+ if (this.fileId.length > 0) {
|
|
|
|
|
+ this.tableList = await queryIds({ ids: "'" + this.fileId + "'" });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.tableList = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ done(id) {
|
|
|
|
|
+ this.fileId.push(...id);
|
|
|
|
|
+ this.init();
|
|
|
|
|
+ },
|
|
|
|
|
+ browseOpen(row) {
|
|
|
|
|
+ this.$refs.browseRef.open(row);
|
|
|
|
|
+ },
|
|
|
|
|
+ addFile() {
|
|
|
|
|
+ this.$emit(
|
|
|
|
|
+ 'success',
|
|
|
|
|
+ this.tableList.map((item) => item.id)
|
|
|
|
|
+ );
|
|
|
|
|
+ this.showEditFlag = false;
|
|
|
|
|
+ },
|
|
|
|
|
+ addTemplate() {
|
|
|
|
|
+ let list = this.$refs.doc_templateRef.getTableList();
|
|
|
|
|
+ this.fileShow = false;
|
|
|
|
|
+ if (list.length == 0) {
|
|
|
|
|
+ this.$message.error('请选择一条数据');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.tableList.push(...list);
|
|
|
}
|
|
}
|
|
|
- this.tableList.push(...list);
|
|
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ };
|
|
|
</script>
|
|
</script>
|