1
李喆(开发组)
2025-03-18 c978996d3e0390c0050479be4684af895cfb72cd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<!--
 * @Date: 2024-05-20 21:43:10
 * @LastEditors: Sneed
 * @LastEditTime: 2024-06-02 21:43:55
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/dnc/log/index.vue
-->
<template>
    <el-main style="height: 100%;">
        <el-card shadow="never" style="height: 100%;" body-style="height: 100%">
            <el-container>
                <el-header>
                    <el-button @click="exportExcel">导出</el-button>
                    <el-select style="margin-left: auto;padding-left: 20px;width: 240px;" v-model="params.sourceType"
                        placeholder="请选择">
                        <template #prefix><span style="margin-right: 6px;">文件来源</span></template>
                        <el-option v-for="item in options.sourceType" :key="item.id" :label="item.name"
                            :value="item.id" />
                    </el-select>
                    <el-select style="margin-left: 8px;padding-left: 20px;width: 240px;" v-model="params.operationType"
                        placeholder="请选择">
                        <template #prefix><span style="margin-right: 6px;">操作类型</span></template>
                        <el-option v-for="item in options.operationType" :key="item.id" :label="item.name"
                            :value="item.id" />
                    </el-select>
                    <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-input v-model="params.keyWord" style="width: 240px;margin-left: 8px;" placeholder="" clearable>
                        <template #prefix>关键词</template>
                    </el-input>
                    <el-button style="margin-left: 8px;" @click="search" type="primary"
                        icon="el-icon-search"></el-button>
                </el-header>
                <el-main>
                    <scTable highlight-current-row @dataChange="dataChange" @row-click="rowClick" ref="table"
                        :params="params" :apiObj="apiObj" @selection-change="selectionChange" stripe>
                        <el-table-column type="selection" width="50"></el-table-column>
                        <el-table-column label="文件名称" prop="fileName">
                        </el-table-column>
                        <el-table-column label="版本" prop="version"></el-table-column>
                        <el-table-column label="文件类型" prop="suffix"></el-table-column>
                        <el-table-column label="文件来源" prop="sourceTypeDesc"></el-table-column>
                        <el-table-column label="操作类型" prop="operationTypeDesc"></el-table-column>
                        <el-table-column label="源路径" prop="sourcePathName"></el-table-column>
                        <el-table-column label="目标路径" prop="targetPathName"></el-table-column>
                        <el-table-column label="文件位置" prop="fileLocationDesc"></el-table-column>
                        <el-table-column label="操作人员" prop="operatorName"></el-table-column>
                        <el-table-column label="操作时间" prop="operationTime"></el-table-column>
                    </scTable>
                </el-main>
            </el-container>
        </el-card>
    </el-main>
</template>
 
<script>
export default {
    data() {
        return {
            selection: [],
            params: {},
            options: {
                sourceType: [
                    {
                        name: '本地文件',
                        id: 0
                    },
                    {
                        name: '我的文档',
                        id: 1
                    },
                    {
                        name: '工位文件',
                        id: 2
                    },
                    {
                        name: '工厂文件',
                        id: 3
                    },
                    {
                        name: '机床回传',
                        id: 4
                    },
                    {
                        name: '工艺包',
                        id: 5
                    },
                ],
                operationType: [
                    {
                        name: '上传',
                        id: 1
                    },
                    {
                        name: '下载',
                        id: 2
                    },
                    {
                        name: '删除',
                        id: 3
                    },
                    {
                        name: '更新',
                        id: 4
                    },
                    {
                        name: '移动',
                        id: 5
                    },
                    {
                        name: '复制',
                        id: 6
                    },
                ],
            },
            apiObj: {
                get: async (data) => {
                    let params = {
                        current: data.current,
                        size: data.size,
                    }
                    let newData = {
                        ...data,
                        ...this.params,
                        startTime: this.params?.time?.[0] || '',
                        endTime: this.params?.time?.[1] || '',
                    }
                    return await this.$HTTP.post(`/api/blade-dnc/operation-file/page-allData?current=1&size=15`, {}, { params, data: newData }).then(res => {
                        return res
                    })
                }
            },
        }
    },
    methods: {
        exportExcel() {
            let data = {
                ...this.params,
                startTime: this.params?.time?.[0] || '',
                endTime: this.params?.time?.[1] || '',
            }
            this.$HTTP.post(`/api/blade-dnc/operation-file/export-log`, data).then(res => {
 
            })
        },
        search() {
            this.$refs.table.reload()
        },
        selectionChange(selection) {
            this.selection = selection
        },
        del(selection) {
 
        },
        table_edit() {
 
        },
        rowClick() {
 
        },
        dataChange() {
 
        }
    }
}
</script>
 
<style lang="scss" scoped></style>