|
|
@@ -27,172 +27,173 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { filePageAPI } from './api';
|
|
|
-import browse from './browse.vue';
|
|
|
+ import { filePageAPI } from './api';
|
|
|
+ import browse from './browse.vue';
|
|
|
+ import { setFileUrl } from './util.js';
|
|
|
|
|
|
-export default {
|
|
|
- components: { browse },
|
|
|
- props: {
|
|
|
- // 上级
|
|
|
- parentData: {
|
|
|
- type: Object,
|
|
|
- default: () => {}
|
|
|
+ export default {
|
|
|
+ components: { browse },
|
|
|
+ props: {
|
|
|
+ // 上级
|
|
|
+ parentData: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {}
|
|
|
+ },
|
|
|
+
|
|
|
+ disabledTableList: {
|
|
|
+ //已选择列表
|
|
|
+ default: () => []
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
- disabledTableList: {
|
|
|
- //已选择列表
|
|
|
- default: () => []
|
|
|
- }
|
|
|
- },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ selection: [],
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ width: 45,
|
|
|
+ type: 'selection',
|
|
|
+ columnKey: 'selection',
|
|
|
+ align: 'center',
|
|
|
+ selectable: (row, index) => {
|
|
|
+ return !this.disabledTableList
|
|
|
+ .map((item) => item.id)
|
|
|
+ .includes(row.id);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '编码',
|
|
|
+ prop: 'code',
|
|
|
+ width: 180,
|
|
|
+ align: 'center',
|
|
|
+ fixed: 'left',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '文档名称',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'name',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 200
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'storagePath',
|
|
|
+ label: '文件名称',
|
|
|
+ align: 'center',
|
|
|
|
|
|
- data() {
|
|
|
- return {
|
|
|
- selection: [],
|
|
|
- columns: [
|
|
|
- {
|
|
|
- width: 45,
|
|
|
- type: 'selection',
|
|
|
- columnKey: 'selection',
|
|
|
- align: 'center',
|
|
|
- selectable: (row, index) => {
|
|
|
- return !this.disabledTableList
|
|
|
- .map((item) => item.id)
|
|
|
- .includes(row.id);
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '编码',
|
|
|
- prop: 'code',
|
|
|
- width: 180,
|
|
|
- align: 'center',
|
|
|
- fixed: 'left',
|
|
|
- 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[0]?.name;
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'version',
|
|
|
- label: '版本',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'checkOutUserName',
|
|
|
- label: '检出人',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'checkOutStatus',
|
|
|
- label: '检出状态',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100,
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- return cellValue == 1 ? '已检出' : '';
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 200,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return cellValue[0]?.name;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'version',
|
|
|
+ label: '版本',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'checkOutUserName',
|
|
|
+ label: '检出人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'checkOutStatus',
|
|
|
+ label: '检出状态',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return cellValue == 1 ? '已检出' : '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'checkOutTime',
|
|
|
+ label: '检出时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 160
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'createUserName',
|
|
|
+ label: '创建人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'createTime',
|
|
|
+ label: '创建时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 160,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return this.$util.toDateString(cellValue);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'updateUserName',
|
|
|
+ label: '修改人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'updateTime',
|
|
|
+ label: '修改时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 160
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'sizeUnit',
|
|
|
+ label: '文档大小',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 150,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ slot: 'action',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'right'
|
|
|
}
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'checkOutTime',
|
|
|
- label: '检出时间',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 160
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'createUserName',
|
|
|
- label: '创建人',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'createTime',
|
|
|
- label: '创建时间',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 160,
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- return this.$util.toDateString(cellValue);
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'updateUserName',
|
|
|
- label: '修改人',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'updateTime',
|
|
|
- label: '修改时间',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 160
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'sizeUnit',
|
|
|
- label: '文档大小',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100
|
|
|
- },
|
|
|
- {
|
|
|
- columnKey: 'action',
|
|
|
- label: '操作',
|
|
|
- width: 150,
|
|
|
- align: 'center',
|
|
|
- resizable: false,
|
|
|
- slot: 'action',
|
|
|
- showOverflowTooltip: true,
|
|
|
- fixed: 'right'
|
|
|
- }
|
|
|
- ]
|
|
|
- };
|
|
|
- },
|
|
|
- created() {},
|
|
|
-
|
|
|
- methods: {
|
|
|
- /* 表格数据源 */
|
|
|
- datasource({ page, limit, where, order }) {
|
|
|
- return filePageAPI({
|
|
|
- ...where,
|
|
|
- ...order,
|
|
|
- pageNum: page,
|
|
|
- size: limit,
|
|
|
- directoryId: this.parentData?.id
|
|
|
- });
|
|
|
- },
|
|
|
- /* 刷新表格 */
|
|
|
- reload(where) {
|
|
|
- this.$refs.table.reload({ pageNum: 1, where: where });
|
|
|
+ ]
|
|
|
+ };
|
|
|
},
|
|
|
+ created() {},
|
|
|
|
|
|
- browseOpen(row) {
|
|
|
- this.$refs.browseRef.open(row);
|
|
|
- },
|
|
|
- getTableList() {
|
|
|
- return JSON.parse(JSON.stringify(this.selection));
|
|
|
+ methods: {
|
|
|
+ /* 表格数据源 */
|
|
|
+ datasource({ page, limit, where, order }) {
|
|
|
+ return filePageAPI({
|
|
|
+ ...where,
|
|
|
+ ...order,
|
|
|
+ pageNum: page,
|
|
|
+ size: limit,
|
|
|
+ directoryId: this.parentData?.id
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /* 刷新表格 */
|
|
|
+ reload(where) {
|
|
|
+ this.$refs.table.reload({ pageNum: 1, where: where });
|
|
|
+ },
|
|
|
+
|
|
|
+ browseOpen(row) {
|
|
|
+ window.open(setFileUrl(row));
|
|
|
+ },
|
|
|
+ getTableList() {
|
|
|
+ return JSON.parse(JSON.stringify(this.selection));
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|