|
@@ -13,13 +13,14 @@
|
|
<a class="table-action-link">删除</a>
|
|
<a class="table-action-link">删除</a>
|
|
</a-popconfirm>
|
|
</a-popconfirm>
|
|
<a class="table-action-link" @click="handleDownLoad(record)">下载</a>
|
|
<a class="table-action-link" @click="handleDownLoad(record)">下载</a>
|
|
|
|
+ <a class="table-action-link" @click="handleHisrecord(record)">历史记录</a>
|
|
<slot name="action" v-bind="{ record }"></slot>
|
|
<slot name="action" v-bind="{ record }"></slot>
|
|
</template>
|
|
</template>
|
|
<template #bodyCell="{ column, record }">
|
|
<template #bodyCell="{ column, record }">
|
|
<slot name="filterCell" v-bind="{ column, record }"></slot>
|
|
<slot name="filterCell" v-bind="{ column, record }"></slot>
|
|
</template>
|
|
</template>
|
|
</BasicTable>
|
|
</BasicTable>
|
|
- <DeviceModal :editID="editID" @register="registerModal" :addOredit="addOredit" @saveOrUpdate="saveOrUpdate" />
|
|
|
|
|
|
+ <DeviceModal :editID="editID" :reportLogHis="reportLogHis" :fileType="fileType" @register="registerModal" :addOredit="addOredit" @saveOrUpdate="saveOrUpdate" />
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
@@ -27,19 +28,14 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
//ts语法
|
|
//ts语法
|
|
- import { ref, provide, reactive, toRaw, defineExpose, watch } from 'vue';
|
|
|
|
- import { BasicTable, ActionItem, EditRecordRow, BasicColumn } from '/@/components/Table';
|
|
|
|
|
|
+ import { ref, reactive, toRaw, defineExpose, watch } from 'vue';
|
|
|
|
+ import { BasicTable, } from '/@/components/Table';
|
|
import { useModal } from '/@/components/Modal';
|
|
import { useModal } from '/@/components/Modal';
|
|
import DeviceModal from './DeviceModal.vue';
|
|
import DeviceModal from './DeviceModal.vue';
|
|
import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
|
|
import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
|
|
import { useListPage } from '/@/hooks/system/useListPage';
|
|
import { useListPage } from '/@/hooks/system/useListPage';
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
- //主键ID
|
|
|
|
- Id:{
|
|
|
|
- type:String,
|
|
|
|
- default:''
|
|
|
|
- },
|
|
|
|
//下载文件接口
|
|
//下载文件接口
|
|
downLoad: {
|
|
downLoad: {
|
|
type: Function,
|
|
type: Function,
|
|
@@ -79,14 +75,13 @@
|
|
let addOredit=ref('')
|
|
let addOredit=ref('')
|
|
//文件ID
|
|
//文件ID
|
|
let editID = ref(0);
|
|
let editID = ref(0);
|
|
|
|
+let fileType = ref(''); //文件类型
|
|
|
|
+let reportLogHis=ref('')//是否为报表记录编辑
|
|
|
|
|
|
- const emit = defineEmits(['submitSuccess', 'editHandler','saveAdd']);
|
|
|
|
|
|
+ const emit = defineEmits(['saveAdd']);
|
|
|
|
|
|
- const isUpdate = ref(false);
|
|
|
|
const record = reactive({});
|
|
const record = reactive({});
|
|
|
|
|
|
- provide('isUpdate', isUpdate);
|
|
|
|
-
|
|
|
|
const [registerModal, { openModal, closeModal }] = useModal();
|
|
const [registerModal, { openModal, closeModal }] = useModal();
|
|
|
|
|
|
const columnList = getTableHeaderColumns('');
|
|
const columnList = getTableHeaderColumns('');
|
|
@@ -121,7 +116,7 @@ let editID = ref(0);
|
|
width: 180,
|
|
width: 180,
|
|
},
|
|
},
|
|
beforeFetch: (params) => {
|
|
beforeFetch: (params) => {
|
|
- return Object.assign(params, { column: 'createTime',id:props.Id,});
|
|
|
|
|
|
+ return Object.assign(params, { column: 'createTime',});
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|
|
});
|
|
@@ -140,7 +135,6 @@ let editID = ref(0);
|
|
for (let key in record) {
|
|
for (let key in record) {
|
|
delete record[key];
|
|
delete record[key];
|
|
}
|
|
}
|
|
- isUpdate.value = false;
|
|
|
|
openModal(true);
|
|
openModal(true);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -156,14 +150,15 @@ let editID = ref(0);
|
|
*/
|
|
*/
|
|
function handleEdit(data) {
|
|
function handleEdit(data) {
|
|
addOredit.value='edit'
|
|
addOredit.value='edit'
|
|
- isUpdate.value = true;
|
|
|
|
|
|
+ reportLogHis.value=''
|
|
Object.assign(record, toRaw(data));
|
|
Object.assign(record, toRaw(data));
|
|
- console.log(record, '编辑');
|
|
|
|
|
|
+ let index = record.fileName.indexOf('.');
|
|
|
|
+ fileType.value = record.fileName.substring(index + 1);
|
|
editID.value = record.id;
|
|
editID.value = record.id;
|
|
console.log(editID.value, '编辑文件ID');
|
|
console.log(editID.value, '编辑文件ID');
|
|
openModal(true, {
|
|
openModal(true, {
|
|
record,
|
|
record,
|
|
- }, false);
|
|
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -173,12 +168,20 @@ let editID = ref(0);
|
|
await props.deleteById({ id: record.id }, reload);
|
|
await props.deleteById({ id: record.id }, reload);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 历史记录
|
|
|
|
+ function handleHisrecord(data){
|
|
|
|
+ addOredit.value='hisRecord'
|
|
|
|
+ Object.assign(record, toRaw(data));
|
|
|
|
+ openModal(true, {
|
|
|
|
+ record,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
//下载文件
|
|
//下载文件
|
|
function handleDownLoad(record) {
|
|
function handleDownLoad(record) {
|
|
console.log(record, '下载');
|
|
console.log(record, '下载');
|
|
- props.downLoad({ reportInfo: record }).then((res) => {
|
|
|
|
- console.log('11111');
|
|
|
|
|
|
+ props.downLoad({ id: record.id }).then((res) => {
|
|
console.log(res, '文件下载成功');
|
|
console.log(res, '文件下载成功');
|
|
let filename = `${record.fileName}`;
|
|
let filename = `${record.fileName}`;
|
|
downFilePublic(res, filename);
|
|
downFilePublic(res, filename);
|
|
@@ -205,32 +208,6 @@ let editID = ref(0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-// /**
|
|
|
|
-// * 操作列定义
|
|
|
|
-// * @param record
|
|
|
|
-// */
|
|
|
|
-// function getActions(record: EditRecordRow, column: BasicColumn): ActionItem[] {
|
|
|
|
-// return [
|
|
|
|
-// {
|
|
|
|
-// label: '编辑',
|
|
|
|
-// onClick: handleEdit.bind(null, record, column),
|
|
|
|
-// },
|
|
|
|
-// {
|
|
|
|
-// label: '删除',
|
|
|
|
-// popConfirm: {
|
|
|
|
-// title: '是否确认删除',
|
|
|
|
-// confirm: handleDelete.bind(null, record, column),
|
|
|
|
-// },
|
|
|
|
-// },
|
|
|
|
-// // {
|
|
|
|
-// // label: '查看',
|
|
|
|
-// // onClick: handleDetail.bind(null, record),
|
|
|
|
-// // },
|
|
|
|
-// ];
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
defineExpose({
|
|
defineExpose({
|
|
doRequest, onExportXls, onImportXls, reload, getForm
|
|
doRequest, onExportXls, onImportXls, reload, getForm
|
|
});
|
|
});
|