1
This commit is contained in:
@@ -9,6 +9,6 @@ VUE_APP_BASE_API = ''
|
|||||||
|
|
||||||
# 路由懒加载
|
# 路由懒加载
|
||||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
VUE_APP_BASE_API = 'http://134.175.126.60:30313'
|
# VUE_APP_BASE_API = 'http://134.175.126.60:30313'
|
||||||
# VUE_APP_BASE_API = 'http://127.0.0.1:30313'
|
# VUE_APP_BASE_API = 'http://127.0.0.1:30313'
|
||||||
port = 8888
|
port = 8888
|
||||||
|
|||||||
@@ -7,5 +7,5 @@ ENV = 'production'
|
|||||||
# Jarvis/生产环境
|
# Jarvis/生产环境
|
||||||
VUE_APP_BASE_API = ''
|
VUE_APP_BASE_API = ''
|
||||||
|
|
||||||
VUE_APP_BASE_API = 'http://134.175.126.60:30313'
|
# VUE_APP_BASE_API = 'http://134.175.126.60:30313'
|
||||||
port = 8888
|
port = 8888
|
||||||
|
|||||||
11
src/api/system/instruction.js
Normal file
11
src/api/system/instruction.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function executeInstruction(data) {
|
||||||
|
return request({
|
||||||
|
url: '/jarvis/instruction/execute',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -131,6 +131,21 @@ export const constantRoutes = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/jd-instruction',
|
||||||
|
component: Layout,
|
||||||
|
redirect: 'noredirect',
|
||||||
|
name: 'JdInstruction',
|
||||||
|
meta: { title: '京东指令台', icon: 'guide' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'index',
|
||||||
|
component: () => import('@/views/system/jd-instruction/index'),
|
||||||
|
name: 'JdInstructionIndex',
|
||||||
|
meta: { title: '指令执行', icon: 'form' }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/sloworder',
|
path: '/sloworder',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
|||||||
77
src/views/system/jd-instruction/index.vue
Normal file
77
src/views/system/jd-instruction/index.vue
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>京东指令台</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form :model="form" label-width="80px" label-position="top">
|
||||||
|
<el-form-item label="输入指令">
|
||||||
|
<el-input v-model="form.command" type="textarea" :rows="10" placeholder="例如:京今日统计 / 京昨日订单 / 慢搜关键词 / 录单20250101-20250107" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="run" :loading="loading">执行</el-button>
|
||||||
|
<el-button @click="fillMenu">菜单</el-button>
|
||||||
|
<el-button @click="clearAll">清空</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form label-position="top">
|
||||||
|
<el-form-item label="响应">
|
||||||
|
<el-input :value="result" type="textarea" :rows="18" readonly />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { executeInstruction } from '@/api/system/instruction'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'JdInstruction',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form: { command: '' },
|
||||||
|
loading: false,
|
||||||
|
result: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
run() {
|
||||||
|
const cmd = (this.form.command || '').trim()
|
||||||
|
if (!cmd) { this.$modal.msgError('请输入指令'); return }
|
||||||
|
this.loading = true
|
||||||
|
executeInstruction({ command: cmd }).then(res => {
|
||||||
|
this.loading = false
|
||||||
|
if (res && (res.code === 200 || res.msg === '操作成功')) {
|
||||||
|
this.result = res.data || res.msg || ''
|
||||||
|
} else {
|
||||||
|
this.$modal.msgError(res && res.msg ? res.msg : '执行失败')
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.loading = false
|
||||||
|
this.$modal.msgError('执行失败,请稍后重试')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fillMenu() {
|
||||||
|
this.form.command = '京菜单'
|
||||||
|
},
|
||||||
|
clearAll() {
|
||||||
|
this.form.command = ''
|
||||||
|
this.result = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.box-card { margin: 20px; }
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user