gaoshp
2024-06-05 9b97217e39c04a2d062c5f8598722521225bb697
src/views/dnc/station-file/Log.vue
@@ -1,29 +1,30 @@
<!--
 * @Date: 2024-05-22 23:18:15
 * @LastEditors: Sneed
 * @LastEditTime: 2024-06-05 21:21:55
 * @LastEditTime: 2024-06-05 23:03:45
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/dnc/station-file/Log.vue
-->
<template>
    <el-container>
        <el-header>
            <el-input v-model="params.name" style="width: 240px;margin-left: 8px;" placeholder="Please input">
            <el-input v-model="params.fileName" style="width: 240px;margin-left: 8px;" placeholder="">
                <template #prefix>文件名称</template>
            </el-input>
            <el-select v-model="params.typeId" style="width: 240px;margin-left: 8px;">
            <el-select v-model="params.fileType" style="width: 240px;margin-left: 8px;">
                <template #prefix>
                    文件类型
                </template>
                <el-option v-for="item in options.typeId" :key="item.value" :label="item.label" :value="item.value" />
                <el-option v-for="item in options.fileType" :key="item.value" :label="item.label" :value="item.value" />
            </el-select>
            <el-date-picker style="width: 260px;flex-grow: 0;margin-left: 8px;" v-model="params.name" type="daterange"
            <el-date-picker style="width: 260px;flex-grow: 0;margin-left: 8px;" v-model="params.time" type="daterange"
                range-separator="-" start-placeholder="操作开始时间" end-placeholder="操作结束时间">
            </el-date-picker>
            <el-select v-model="params.typeId" style="width: 240px;margin-left: 8px;margin-right: auto;">
            <el-select v-model="params.operationType" style="width: 240px;margin-left: 8px;margin-right: auto;">
                <template #prefix>
                    操作类型
                </template>
                <el-option v-for="item in options.typeId" :key="item.value" :label="item.label" :value="item.value" />
                <el-option v-for="item in options.operationType" :key="item.value" :label="item.label"
                    :value="item.value" />
            </el-select>
        </el-header>
        <el-main>
@@ -55,15 +56,24 @@
            this.$nextTick(() => {
                val && this.$refs?.table?.reload()
            })
        },
        params: {
            handler() {
                this.$refs.table.reload()
            },
            deep: true
        }
    },
    data() {
        return {
            params: {
                name: ''
                fileName: '',
                fileType: '',
                time: [],
                operationType: ''
            },
            options: {
                typeId: []
                fileType: []
            },
            apiObj: {
                get: async (data) => {
@@ -71,14 +81,32 @@
                        current: data.current,
                        size: data.size
                    }
                    return await this.$HTTP.post(`/api/blade-dnc/operation-file/page/${this.id}`, {}, { params, data: this.params }).then(res => {
                    let dataNew = {
                        ...this.params,
                        operationStartTime: this.params[0] || "",
                        operationEndTime: this.params[1] || ""
                    }
                    return await this.$HTTP.post(`/api/blade-dnc/operation-file/page/${this.id}`, {}, { params, data: dataNew }).then(res => {
                        return res
                    })
                }
            }
        }
    },
    created() {
        this.init()
    },
    methods: {
        init() {
            this.$HTTP.get(`/api/blade-dnc/operation-file/list/suffix`).then(res => {
                this.options.fileType = res.data.suffix.map(v => {
                    return {
                        value: v,
                        label: v
                    }
                })
            })
        },
        dataChange(data) {
            console.log(data)
        }