|
@@ -1,16 +1,17 @@
|
|
|
<template>
|
|
<template>
|
|
|
<a-drawer width="70%" title="设备异常反馈记录" :visible="visible" @close="onClose">
|
|
<a-drawer width="70%" title="设备异常反馈记录" :visible="visible" @close="onClose">
|
|
|
<div class="top">
|
|
<div class="top">
|
|
|
- <a-button type="primary">
|
|
|
|
|
|
|
+ <a-button type="primary" @click="() => state.visible = true">
|
|
|
新建异常反馈
|
|
新建异常反馈
|
|
|
</a-button>
|
|
</a-button>
|
|
|
<div>
|
|
<div>
|
|
|
- <a-form ref="formRef" layout="inline" :model="state.query" :colon="false">
|
|
|
|
|
|
|
+ <a-form ref="formRef" layout="inline" :model="formModel" :colon="false">
|
|
|
<a-form-item name="rangeDate">
|
|
<a-form-item name="rangeDate">
|
|
|
- <a-range-picker style="width: 250px;" v-model:value="state.query.rangeDate" />
|
|
|
|
|
|
|
+ <a-range-picker style="width: 250px;" valueFormat="YYYY-MM-DD"
|
|
|
|
|
+ v-model:value="formModel.rangeDate" />
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
<a-form-item name="device_name">
|
|
<a-form-item name="device_name">
|
|
|
- <a-select style="width: 200px;" placeholder="请选择反馈人" v-model:value="state.query.device_name">
|
|
|
|
|
|
|
+ <a-select style="width: 200px;" placeholder="请选择反馈人" v-model:value="formModel.device_name">
|
|
|
<a-select-option value="1">
|
|
<a-select-option value="1">
|
|
|
pilot
|
|
pilot
|
|
|
</a-select-option>
|
|
</a-select-option>
|
|
@@ -18,7 +19,7 @@
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
<a-form-item name="search_info">
|
|
<a-form-item name="search_info">
|
|
|
<a-input style="width: 200px;" placeholder="设备SN、设备异常描述"
|
|
<a-input style="width: 200px;" placeholder="设备SN、设备异常描述"
|
|
|
- v-model:value="state.query.search_info" />
|
|
|
|
|
|
|
+ v-model:value="formModel.search_info" />
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
<a-form-item>
|
|
<a-form-item>
|
|
|
<a-button style="margin-right: 10px;" @click="handleClicSekarch">
|
|
<a-button style="margin-right: 10px;" @click="handleClicSekarch">
|
|
@@ -43,25 +44,21 @@
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
|
<template #operation="{ record }">
|
|
<template #operation="{ record }">
|
|
|
- <div class="editable-row-operations">
|
|
|
|
|
- <div class="flex-align-center flex-row" style="color: #2d8cf0">
|
|
|
|
|
- <a-tooltip title="详情">
|
|
|
|
|
- <FileSearchOutlined style="margin-right: 10px;" @click="onClickDetail(record.id)" />
|
|
|
|
|
- </a-tooltip>
|
|
|
|
|
- <a-tooltip title="删除">
|
|
|
|
|
- <DeleteOutlined @click="onClickDelete(record.id)" />
|
|
|
|
|
- </a-tooltip>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <a-tooltip title="详情">
|
|
|
|
|
+ <FileSearchOutlined />
|
|
|
|
|
+ </a-tooltip>
|
|
|
</template>
|
|
</template>
|
|
|
</a-table>
|
|
</a-table>
|
|
|
</div>
|
|
</div>
|
|
|
</a-drawer>
|
|
</a-drawer>
|
|
|
|
|
+ <!-- 异常反馈-信息弹出层 -->
|
|
|
|
|
+ <FeedbackInfoModal :currentId="state.currentId" :visible="state.visible" :onClose="() => state.visible = false" />
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { ref, reactive, onMounted } from 'vue';
|
|
import { ref, reactive, onMounted } from 'vue';
|
|
|
-import { SearchOutlined, ReloadOutlined } from '@ant-design/icons-vue';
|
|
|
|
|
|
|
+import { SearchOutlined, ReloadOutlined, FileSearchOutlined } from '@ant-design/icons-vue';
|
|
|
|
|
+import FeedbackInfoModal from '../components/FeedbackInfoModal.vue';
|
|
|
import { apis } from '/@/api/custom';
|
|
import { apis } from '/@/api/custom';
|
|
|
import { Device } from '/@/types/device';
|
|
import { Device } from '/@/types/device';
|
|
|
|
|
|
|
@@ -77,24 +74,33 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
|
|
|
|
|
const formRef = ref();
|
|
const formRef = ref();
|
|
|
|
|
|
|
|
|
|
+const formModel = reactive({
|
|
|
|
|
+ rangeDate: undefined,
|
|
|
|
|
+ device_name: undefined,
|
|
|
|
|
+ search_info: undefined,
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+type Query = Partial<{
|
|
|
|
|
+ begin_time: string,
|
|
|
|
|
+ end_time: string,
|
|
|
|
|
+ device_name: undefined,
|
|
|
|
|
+ search_info: undefined,
|
|
|
|
|
+}>;
|
|
|
|
|
+
|
|
|
interface State {
|
|
interface State {
|
|
|
- query: any,
|
|
|
|
|
|
|
+ query?: Query,
|
|
|
listLoading: boolean,
|
|
listLoading: boolean,
|
|
|
list: any[],
|
|
list: any[],
|
|
|
currentId: string,
|
|
currentId: string,
|
|
|
- drawerVisible: boolean,
|
|
|
|
|
|
|
+ visible: boolean,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const state: State = reactive({
|
|
const state: State = reactive({
|
|
|
- query: {
|
|
|
|
|
- rangeDate: [],
|
|
|
|
|
- device_name: undefined,
|
|
|
|
|
- search_info: '',
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ query: undefined,
|
|
|
listLoading: false,
|
|
listLoading: false,
|
|
|
list: [],
|
|
list: [],
|
|
|
currentId: '',
|
|
currentId: '',
|
|
|
- drawerVisible: false,
|
|
|
|
|
|
|
+ visible: false,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const paginationConfig = reactive({
|
|
const paginationConfig = reactive({
|
|
@@ -103,7 +109,15 @@ const paginationConfig = reactive({
|
|
|
showSizeChanger: true,
|
|
showSizeChanger: true,
|
|
|
pageSize: 20,
|
|
pageSize: 20,
|
|
|
current: 1,
|
|
current: 1,
|
|
|
- total: 0
|
|
|
|
|
|
|
+ total: 0,
|
|
|
|
|
+ onChange: async (current: number) => {
|
|
|
|
|
+ paginationConfig.current = current;
|
|
|
|
|
+ await fetchList();
|
|
|
|
|
+ },
|
|
|
|
|
+ onShowSizeChange: async (current: number, pageSize: number) => {
|
|
|
|
|
+ paginationConfig.pageSize = pageSize;
|
|
|
|
|
+ await fetchList();
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const fetchList = async () => {
|
|
const fetchList = async () => {
|
|
@@ -173,38 +187,36 @@ const columns = [
|
|
|
sorter: (a: any, b: any) => a.status.localeCompare(b.status),
|
|
sorter: (a: any, b: any) => a.status.localeCompare(b.status),
|
|
|
width: 150,
|
|
width: 150,
|
|
|
},
|
|
},
|
|
|
- // {
|
|
|
|
|
- // title: '操作',
|
|
|
|
|
- // dataIndex: 'operation',
|
|
|
|
|
- // fixed: 'right',
|
|
|
|
|
- // width: 80,
|
|
|
|
|
- // slots: { customRender: 'operation' }
|
|
|
|
|
- // },
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '操作',
|
|
|
|
|
+ dataIndex: 'operation',
|
|
|
|
|
+ fixed: 'right',
|
|
|
|
|
+ width: 80,
|
|
|
|
|
+ slots: { customRender: 'operation' }
|
|
|
|
|
+ },
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
// 点击查询
|
|
// 点击查询
|
|
|
const handleClicSekarch = async () => {
|
|
const handleClicSekarch = async () => {
|
|
|
const values = formRef.value?.getFieldsValue();
|
|
const values = formRef.value?.getFieldsValue();
|
|
|
- const data = {
|
|
|
|
|
- ...values,
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ const data = { ...values };
|
|
|
delete data.rangeDate;
|
|
delete data.rangeDate;
|
|
|
if (values.rangeDate.length === 2) {
|
|
if (values.rangeDate.length === 2) {
|
|
|
- data.begin_time = moment(values.rangeDate[0]).valueOf();
|
|
|
|
|
- data.end_time = moment(values.rangeDate[1]).valueOf();
|
|
|
|
|
|
|
+ data.begin_time = values.rangeDate[0];
|
|
|
|
|
+ data.end_time = values.rangeDate[1];
|
|
|
}
|
|
}
|
|
|
- await props.onClickSearch(data);
|
|
|
|
|
|
|
+ state.query = data;
|
|
|
|
|
+ await fetchList();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 点击重置
|
|
// 点击重置
|
|
|
const handleClickReset = async () => {
|
|
const handleClickReset = async () => {
|
|
|
formRef.value?.resetFields();
|
|
formRef.value?.resetFields();
|
|
|
const values = formRef.value?.getFieldsValue();
|
|
const values = formRef.value?.getFieldsValue();
|
|
|
- const data = {
|
|
|
|
|
- ...values,
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ const data = { ...values };
|
|
|
delete data.rangeDate;
|
|
delete data.rangeDate;
|
|
|
- await props.onClickReset(data);
|
|
|
|
|
|
|
+ state.query = data;
|
|
|
|
|
+ await fetchList();
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|