|
@@ -10,10 +10,13 @@
|
|
|
>
|
|
|
<!-- 表格 header 按钮 -->
|
|
|
<template #tableHeader="scope">
|
|
|
- <el-button type="primary" v-auth="['manage:instructionInfo:add']" :icon="CirclePlus" @click="connect()"> 连接 </el-button>
|
|
|
<el-button type="primary" v-auth="['manage:instructionInfo:add']" :icon="CirclePlus" @click="openDialog(1, '指令信息新增')"> 新增 </el-button>
|
|
|
- <el-button type="primary" v-auth="['manage:instructionInfo:import']" :icon="Upload" plain @click="batchAdd"> 导入 </el-button>
|
|
|
- <el-button type="primary" v-auth="['manage:instructionInfo:export']" :icon="Download" plain @click="downloadFile"> 导出 </el-button>
|
|
|
+ <el-button type="primary" :icon="CirclePlus" @click="connect()"> 连接 </el-button>
|
|
|
+ <el-button type="primary" :icon="CirclePlus" @click="openAirDialog()"> 实时结果 </el-button>
|
|
|
+ <el-button type="primary" v-if="0" v-auth="['manage:instructionInfo:import111']" :icon="Upload" plain @click="batchAdd"> 导入 </el-button>
|
|
|
+ <el-button type="primary" v-if="0" v-auth="['manage:instructionInfo:export111']" :icon="Download" plain @click="downloadFile">
|
|
|
+ 导出
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
type="danger"
|
|
|
v-auth="['system:user:remove']"
|
|
@@ -27,7 +30,7 @@
|
|
|
</template>
|
|
|
<!-- 表格操作 -->
|
|
|
<template #operation="scope">
|
|
|
- <el-button type="primary" link :icon="View" v-auth="['manage:instructionInfo:query']" @click="send(scope.row)"> 发送 </el-button>
|
|
|
+ <el-button type="primary" link :icon="View" v-auth="['manage:instructionInfo:query']" @click="send(scope.row.id)"> 发送 </el-button>
|
|
|
<el-button type="primary" link :icon="View" v-auth="['manage:instructionInfo:query']" @click="openDialog(3, '指令信息查看', scope.row)">
|
|
|
查看
|
|
|
</el-button>
|
|
@@ -41,6 +44,7 @@
|
|
|
</ProTable>
|
|
|
<FormDialog ref="formDialogRef" />
|
|
|
<ImportExcel ref="dialogRef" />
|
|
|
+ <AirResult ref="airResultRef" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -49,6 +53,7 @@ import { ref, reactive } from 'vue'
|
|
|
import { useHandleData } from '@/hooks/useHandleData'
|
|
|
import { useDownload } from '@/hooks/useDownload'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
+import AirResult from './components/index.vue'
|
|
|
import ProTable from '@/components/ProTable/index.vue'
|
|
|
import ImportExcel from '@/components/ImportExcel/index.vue'
|
|
|
import FormDialog from '@/components/DialogOld/form.vue'
|
|
@@ -137,6 +142,14 @@ const openDialog = async (type: number, title: string, row?: any) => {
|
|
|
}
|
|
|
formDialogRef.value?.openDialog(params)
|
|
|
}
|
|
|
+const airResultRef = ref<InstanceType<typeof AirResult> | null>(null)
|
|
|
+// 打开弹框的功能
|
|
|
+const openAirDialog = async () => {
|
|
|
+ const params = {
|
|
|
+ title: '结果'
|
|
|
+ }
|
|
|
+ airResultRef.value?.openDialog(params)
|
|
|
+}
|
|
|
|
|
|
const connect = async () => {
|
|
|
const res = await connectApi()
|
|
@@ -145,10 +158,8 @@ const connect = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const send = async (data: any) => {
|
|
|
- console.log(data)
|
|
|
-
|
|
|
- const res = await sendApi('ssdsd')
|
|
|
+const send = async (id: any) => {
|
|
|
+ const res = await sendApi(id)
|
|
|
if (res.code == 200) {
|
|
|
ElMessage.success('发送成功')
|
|
|
}
|
|
@@ -159,13 +170,7 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
{ type: 'selection', fixed: 'left', width: 70 },
|
|
|
{
|
|
|
prop: 'attribute',
|
|
|
- label: '指令属性',
|
|
|
- search: {
|
|
|
- el: 'input'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'attribute',
|
|
|
+ label: '指令',
|
|
|
tag: true,
|
|
|
enum: () => getDictsApi('air_order'),
|
|
|
search: {
|
|
@@ -184,17 +189,18 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
prop: 'createTime',
|
|
|
label: '创建时间'
|
|
|
},
|
|
|
- { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
|
|
|
+ { prop: 'operation', label: '操作', width: 250, fixed: 'right' }
|
|
|
])
|
|
|
+// air_order_result
|
|
|
// 表单配置项
|
|
|
let fieldList: Form.FieldItem[] = []
|
|
|
const setFieldList = () => {
|
|
|
fieldList = [
|
|
|
- {
|
|
|
- label: '指令属性',
|
|
|
- field: 'attribute',
|
|
|
- placeholder: '请输入指令属性'
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // label: '指令属性',
|
|
|
+ // field: 'attribute',
|
|
|
+ // placeholder: '请输入指令属性'
|
|
|
+ // },
|
|
|
{
|
|
|
label: '指令属性',
|
|
|
field: 'attribute',
|
|
@@ -211,13 +217,13 @@ const setFieldList = () => {
|
|
|
label: '指令内容',
|
|
|
field: 'content',
|
|
|
placeholder: '请输入指令内容'
|
|
|
- },
|
|
|
- {
|
|
|
- label: 'XML格式文件',
|
|
|
- field: 'xml',
|
|
|
- type: 'textarea',
|
|
|
- placeholder: '请输入内容'
|
|
|
}
|
|
|
+ // {
|
|
|
+ // label: 'XML格式文件',
|
|
|
+ // field: 'xml',
|
|
|
+ // type: 'textarea',
|
|
|
+ // placeholder: '请输入内容'
|
|
|
+ // }
|
|
|
]
|
|
|
}
|
|
|
</script>
|