"态势接口部分"
This commit is contained in:
1
src/renderer/components.d.ts
vendored
1
src/renderer/components.d.ts
vendored
@ -27,6 +27,7 @@ declare module 'vue' {
|
|||||||
ElInput: typeof import('element-plus/es')['ElInput']
|
ElInput: typeof import('element-plus/es')['ElInput']
|
||||||
ElOption: typeof import('element-plus/es')['ElOption']
|
ElOption: typeof import('element-plus/es')['ElOption']
|
||||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||||
|
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
|
||||||
ElRadio: typeof import('element-plus/es')['ElRadio']
|
ElRadio: typeof import('element-plus/es')['ElRadio']
|
||||||
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
||||||
ElRow: typeof import('element-plus/es')['ElRow']
|
ElRow: typeof import('element-plus/es')['ElRow']
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
clearable
|
clearable
|
||||||
/></span>
|
/></span>
|
||||||
<span>创建人 <el-input
|
<span>创建人 <el-input
|
||||||
v-model="searchParams.create_by"
|
v-model="searchParams.createdBy"
|
||||||
style="width: 240px"
|
style="width: 240px"
|
||||||
placeholder="请输入创建人姓名"
|
placeholder="请输入创建人姓名"
|
||||||
clearable
|
clearable
|
||||||
@ -36,13 +36,13 @@
|
|||||||
format="YYYY-MM-DD HH:mm:ss"
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
date-format="YYYY-MM-DD ddd"
|
date-format="YYYY-MM-DD ddd"
|
||||||
time-format="A hh:mm:ss"
|
time-format="A hh:mm:ss"
|
||||||
value-format="x"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
/></span>
|
/></span>
|
||||||
<el-button @click="search">搜索</el-button>
|
<el-button @click="search">搜索</el-button>
|
||||||
<el-button @click="reset">重置</el-button>
|
<el-button @click="reset">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="option">
|
<div class="option">
|
||||||
<el-button :icon="CirclePlus">新建推演</el-button>
|
<el-button :icon="CirclePlus" @click="addPlan">新建推演</el-button>
|
||||||
<el-button :icon="Download">导入</el-button>
|
<el-button :icon="Download">导入</el-button>
|
||||||
<el-button :icon="Upload">导出</el-button>
|
<el-button :icon="Upload">导出</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -53,13 +53,26 @@
|
|||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
>
|
>
|
||||||
<el-table-column align="center" prop="name" label="推演名称"/>
|
<el-table-column align="center" prop="name" label="推演名称"/>
|
||||||
<el-table-column align="center" prop="description" label="推演描述"/>
|
<el-table-column align="center" prop="desc" label="推演描述"/>
|
||||||
<el-table-column align="center" prop="create_by" label="创建人"/>
|
<el-table-column align="center" prop="createdBy" label="创建人"/>
|
||||||
<el-table-column align="center" prop="date" label="创建日期" sortable/>
|
<el-table-column align="center" prop="createdAt" label="创建日期" sortable/>
|
||||||
<el-table-column align="center" label="操作">
|
<el-table-column align="center" label="操作">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button text size="small" type="primary" :icon="Edit" @click="toTSEdit(scope.row)">编辑</el-button>
|
<el-button text size="small" type="primary" :icon="Edit" @click="toTSEdit(scope.row)">编辑</el-button>
|
||||||
<el-button text size="small" type="primary" :icon="Delete">删除</el-button>
|
<el-popconfirm
|
||||||
|
confirm-button-text="确定"
|
||||||
|
cancel-button-text="取消"
|
||||||
|
icon-color="#626AEF"
|
||||||
|
title="确定删除吗?"
|
||||||
|
@confirm="delPlan(scope.row.id)"
|
||||||
|
>
|
||||||
|
<template #reference>
|
||||||
|
<el-button text size="small" type="primary" :icon="Delete">删除
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<!--<el-button>Delete</el-button>-->
|
||||||
|
</template>
|
||||||
|
</el-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -86,6 +99,7 @@
|
|||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>-->
|
</div>-->
|
||||||
</div>
|
</div>
|
||||||
|
<NewPlan @addCallback="getList(searchParams.value)"></NewPlan>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -93,14 +107,16 @@
|
|||||||
import {ref} from "vue";
|
import {ref} from "vue";
|
||||||
import {useRouter} from "vue-router";
|
import {useRouter} from "vue-router";
|
||||||
import {Delete, Edit, CirclePlus, Download, Upload} from '@element-plus/icons-vue'
|
import {Delete, Edit, CirclePlus, Download, Upload} from '@element-plus/icons-vue'
|
||||||
import {TableV2SortOrder} from 'element-plus'
|
import {ElMessage, TableV2SortOrder} from 'element-plus'
|
||||||
import type {SortBy} from 'element-plus'
|
import type {SortBy} from 'element-plus'
|
||||||
|
import {TsApi} from "../../api/ts";
|
||||||
|
import NewPlan from "./newPlan.vue"
|
||||||
|
|
||||||
const {ipcRenderer} = require('electron')
|
const {ipcRenderer} = require('electron')
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
let searchParams = ref({
|
let searchParams = ref({
|
||||||
name: "",
|
name: "",
|
||||||
create_by: "",
|
createdBy: "",
|
||||||
datetime: "",
|
datetime: "",
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -119,41 +135,39 @@ const handleCurrentChange = (val) => {
|
|||||||
pageNum = val
|
pageNum = val
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
const getList = () => {
|
const getList = (params = null) => {
|
||||||
console.log(pageSize, pageNum)
|
console.log(params)
|
||||||
|
let formData = new FormData()
|
||||||
|
formData.append('pageSize', pageSize.value)
|
||||||
|
formData.append('pageNum', pageNum.value)
|
||||||
|
if (params) {
|
||||||
|
for (const paramsKey in params) {
|
||||||
|
if (params[paramsKey]) {
|
||||||
|
if (paramsKey == 'datetime') {
|
||||||
|
formData.append('startTime', params[paramsKey][0])
|
||||||
|
formData.append('endTime', params[paramsKey][1])
|
||||||
|
} else {
|
||||||
|
formData.append(paramsKey, params[paramsKey])
|
||||||
}
|
}
|
||||||
const tableData: User[] = [
|
}
|
||||||
{
|
}
|
||||||
date: '2016-05-03',
|
}
|
||||||
name: '测试',
|
TsApi.planList(formData).then(res => {
|
||||||
description: "这是一个方案描述",
|
console.log(res)
|
||||||
create_by: "admin",
|
if (res.code == 200) {
|
||||||
},
|
tableData.value = res.data.records
|
||||||
{
|
}
|
||||||
date: '2016-05-02',
|
})
|
||||||
name: '协同方案',
|
}
|
||||||
description: "这是一个方案描述",
|
getList()
|
||||||
create_by: "admin",
|
const tableData = ref([])
|
||||||
},
|
|
||||||
{
|
|
||||||
date: '2016-05-04',
|
|
||||||
name: '1990',
|
|
||||||
description: "这是一个方案描述",
|
|
||||||
create_by: "admin",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
date: '2016-05-01',
|
|
||||||
name: '2025',
|
|
||||||
description: "这是一个方案描述",
|
|
||||||
create_by: "admin",
|
|
||||||
},
|
|
||||||
]
|
|
||||||
const search = () => {
|
const search = () => {
|
||||||
console.log(searchParams)
|
console.log(searchParams)
|
||||||
|
getList(searchParams.value)
|
||||||
}
|
}
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
searchParams.value = {name: "", create_by: "", datetime: ""}
|
searchParams.value = {name: "", createdBy: "", datetime: ""}
|
||||||
|
getList(searchParams.value)
|
||||||
}
|
}
|
||||||
const toTSEdit = (row) => {
|
const toTSEdit = (row) => {
|
||||||
// router.push({path: '/tsEdit'})
|
// router.push({path: '/tsEdit'})
|
||||||
@ -163,6 +177,24 @@ const toTSEdit = (row) => {
|
|||||||
query: {id: 123, name: "战时推演", start_time: 946684800000}
|
query: {id: 123, name: "战时推演", start_time: 946684800000}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const delPlan = (id) => {
|
||||||
|
|
||||||
|
let formData = new FormData()
|
||||||
|
formData.append('id', id)
|
||||||
|
TsApi.delPlan(formData).then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
ElMessage({
|
||||||
|
message: '操作成功!',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
getList(searchParams.value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const addPlan = () => {
|
||||||
|
$(".newPlan")[0].style.display = 'block'
|
||||||
|
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
const generateData = (
|
const generateData = (
|
||||||
columns: ReturnType<typeof generateColumns>,
|
columns: ReturnType<typeof generateColumns>,
|
||||||
|
|||||||
@ -48,6 +48,7 @@ import {ref, reactive,} from "vue";
|
|||||||
import {ElMessage} from 'element-plus'
|
import {ElMessage} from 'element-plus'
|
||||||
import {TsApi} from "../../api/ts";
|
import {TsApi} from "../../api/ts";
|
||||||
|
|
||||||
|
const emit = defineEmits(['addCallback']);
|
||||||
const isShowPup = ref(true)
|
const isShowPup = ref(true)
|
||||||
const sizeForm = reactive({
|
const sizeForm = reactive({
|
||||||
name: '',
|
name: '',
|
||||||
@ -62,6 +63,7 @@ const addPlan = () => {
|
|||||||
message: '操作成功',
|
message: '操作成功',
|
||||||
type: 'success'
|
type: 'success'
|
||||||
})
|
})
|
||||||
|
emit('addCallback');
|
||||||
}
|
}
|
||||||
$(".newPlan")[0].style.display = "none"
|
$(".newPlan")[0].style.display = "none"
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user