|
1 | 1 | <template>
|
2 |
| - <el-table :data="tableData"> |
3 |
| - <el-table-column type="index" label="序号" width="64" /> |
4 |
| - <el-table-column prop="name" label="脚本名称" /> |
| 2 | + <el-table :data="tableData" @dblclick="row => handleRow('managerEdit', row)"> |
| 3 | + <el-table-column type="index" label="序号" width="60" /> |
| 4 | + <el-table-column prop="name" label="名称" width="120" /> |
| 5 | + <el-table-column prop="port" label="端口" width="120" /> |
| 6 | + <el-table-column prop="nodeVersion" label="node版本" width="90" /> |
| 7 | + <el-table-column prop="terminal" label="终端" width="64" /> |
5 | 8 | <el-table-column prop="path" label="脚本路径" />
|
6 |
| - <el-table-column prop="port" label="端口" /> |
7 | 9 | <el-table-column prop="keywords" label="关键词" />
|
8 |
| - <el-table-column prop="nodeVersion" label="node版本" /> |
9 |
| - <el-table-column prop="terminal" label="终端" /> |
10 | 10 | <el-table-column prop="desc" label="备注" />
|
11 | 11 | <el-table-column prop="handle" label="操作" width="240">
|
12 | 12 | <template #default="{ row }">
|
13 |
| - <el-button type="info" size="small" @click="emit('open', row)">打开路径</el-button> |
14 |
| - <el-button type="warning" size="small" @click="emit('edit', row)">修改</el-button> |
15 |
| - <el-button type="primary" size="small" @click="emit('copy', row)">复制</el-button> |
| 13 | + <el-button type="info" size="small" @click="handleOpen(row)">打开路径</el-button> |
| 14 | + <el-button type="warning" size="small" @click="handleRow('managerEdit', row)">修改</el-button> |
| 15 | + <el-button type="primary" size="small" @click="handleRow('managerCopy', row)">复制</el-button> |
16 | 16 | </template>
|
17 | 17 | </el-table-column>
|
18 | 18 | </el-table>
|
19 |
| - <el-space> |
20 |
| - <el-button type="info" @click="handleOutput">输出配置</el-button> |
21 |
| - <el-button type="success" @click="handleDownload">导出配置</el-button> |
22 |
| - </el-space> |
23 | 19 | </template>
|
24 | 20 |
|
25 | 21 | <script setup>
|
26 |
| -import { ref, defineEmits } from 'vue' |
27 |
| -import { handleOutput, handleDownload, manifest } from './common' |
28 |
| -const emit = defineEmits(['edit', 'copy', 'open']) |
| 22 | +import { ref } from 'vue' |
| 23 | +import api from '@/api' |
| 24 | +import { manifest } from './common' |
| 25 | +import router from '@/router' |
| 26 | +const handleRow = (type, row) => { |
| 27 | + router.push({ |
| 28 | + name: type, |
| 29 | + query: { |
| 30 | + uuid: row.uuid |
| 31 | + } |
| 32 | + }) |
| 33 | +} |
| 34 | +const handleOpen = (row) => { |
| 35 | + api.open(row) |
| 36 | +} |
29 | 37 | const tableData = ref(manifest.value.commands)
|
30 | 38 | </script>
|
31 | 39 | <style scoped>
|
|
0 commit comments