“dzb”
2022-10-24 0a6f89cc126ef05f51b62565c3ea004e82d078b8
src/views/operate/log/index.vue
@@ -23,11 +23,10 @@
                    <el-date-picker v-model="mytime" type="daterange" range-separator="-" start-placeholder="开始日期"
                        end-placeholder="结束日期">
                    </el-date-picker>
                    <!-- <el-input placeholder="选择时间范围" v-model="timeArea"></el-input> -->
                </div>
                <div class="find">
                    <el-button type="primary" icon="el-icon-search" @click="setTableData">查询</el-button>
                    <el-button icon="el-icon-delete-solid">重置</el-button>
                    <el-button icon="el-icon-delete-solid" @click="resetTableData">重置</el-button>
                </div>
            </div>
        </header>
@@ -93,6 +92,7 @@
</template>
<script>
import helper from '@/utils/mydate'
import {parseTime} from '@/utils/index'
import { createNamespacedHelpers } from "vuex";
const { mapActions } = createNamespacedHelpers("logs");
export default {
@@ -112,23 +112,14 @@
            options: [
                {
                    value: 1,
                    label: '批量启用',
                },
                {
                    value: 2,
                    label: '批量禁用',
                },
                {
                    value: 3,
                    label: '批量删除',
                }
            ],
            mysort: 0,
            tempList: [],
            timeArea: '',
            operationType: '全部',
            operationTypeList: [],
            mytime: '',
            mytime: ['',''],
        }
    },
    created() {
@@ -137,6 +128,14 @@
    },
    methods: {
        ...mapActions(["getLogsList", 'getLogsOperationType', 'exportLogs']),
        // 重置
        resetTableData(){
            const {setTableData} = this
            this.operationType = '全部'
            this.mytime = ['','']
            this.context = ''
            setTableData();
        },
        // 导出日志
        async handleExport() {
            const { currentPage, pageSize, context, operationType } = this;
@@ -219,16 +218,17 @@
        },
        // 获取日志数据
        async getLogList() {
            const { currentPage, pageSize, context, operationType, mysort } = this;
            const { currentPage, pageSize, context, operationType, mysort,mytime } = this;
            console.log(mytime)
            let arr = await this.getLogsList({
                content: context,
                current: currentPage,
                endTime: '',
                endTime: mytime[1] !==''?parseTime(mytime[1]):'',
                id: '',
                operationType: operationType === '全部' ? '' : operationType,
                portEquipment: '',
                size: pageSize,
                startTime: '',
                startTime: mytime[0] !==''?parseTime(mytime[0]):'',
                sort: mysort
            })
            console.log(arr)