"态势接口部分"
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']
|
||||
ElOption: typeof import('element-plus/es')['ElOption']
|
||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
|
||||
ElRadio: typeof import('element-plus/es')['ElRadio']
|
||||
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
||||
ElRow: typeof import('element-plus/es')['ElRow']
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
clearable
|
||||
/></span>
|
||||
<span>创建人 <el-input
|
||||
v-model="searchParams.create_by"
|
||||
v-model="searchParams.createdBy"
|
||||
style="width: 240px"
|
||||
placeholder="请输入创建人姓名"
|
||||
clearable
|
||||
@ -36,13 +36,13 @@
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
date-format="YYYY-MM-DD ddd"
|
||||
time-format="A hh:mm:ss"
|
||||
value-format="x"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
/></span>
|
||||
<el-button @click="search">搜索</el-button>
|
||||
<el-button @click="reset">重置</el-button>
|
||||
</div>
|
||||
<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="Upload">导出</el-button>
|
||||
</div>
|
||||
@ -53,13 +53,26 @@
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column align="center" prop="name" label="推演名称"/>
|
||||
<el-table-column align="center" prop="description" label="推演描述"/>
|
||||
<el-table-column align="center" prop="create_by" label="创建人"/>
|
||||
<el-table-column align="center" prop="date" label="创建日期" sortable/>
|
||||
<el-table-column align="center" prop="desc" label="推演描述"/>
|
||||
<el-table-column align="center" prop="createdBy" label="创建人"/>
|
||||
<el-table-column align="center" prop="createdAt" label="创建日期" sortable/>
|
||||
<el-table-column align="center" label="操作">
|
||||
<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="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>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -86,6 +99,7 @@
|
||||
</el-pagination>
|
||||
</div>-->
|
||||
</div>
|
||||
<NewPlan @addCallback="getList(searchParams.value)"></NewPlan>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -93,14 +107,16 @@
|
||||
import {ref} from "vue";
|
||||
import {useRouter} from "vue-router";
|
||||
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 {TsApi} from "../../api/ts";
|
||||
import NewPlan from "./newPlan.vue"
|
||||
|
||||
const {ipcRenderer} = require('electron')
|
||||
const router = useRouter()
|
||||
let searchParams = ref({
|
||||
name: "",
|
||||
create_by: "",
|
||||
createdBy: "",
|
||||
datetime: "",
|
||||
})
|
||||
|
||||
@ -119,41 +135,39 @@ const handleCurrentChange = (val) => {
|
||||
pageNum = val
|
||||
getList();
|
||||
}
|
||||
const getList = () => {
|
||||
console.log(pageSize, pageNum)
|
||||
const getList = (params = null) => {
|
||||
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])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
TsApi.planList(formData).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
tableData.value = res.data.records
|
||||
}
|
||||
})
|
||||
}
|
||||
const tableData: User[] = [
|
||||
{
|
||||
date: '2016-05-03',
|
||||
name: '测试',
|
||||
description: "这是一个方案描述",
|
||||
create_by: "admin",
|
||||
},
|
||||
{
|
||||
date: '2016-05-02',
|
||||
name: '协同方案',
|
||||
description: "这是一个方案描述",
|
||||
create_by: "admin",
|
||||
},
|
||||
{
|
||||
date: '2016-05-04',
|
||||
name: '1990',
|
||||
description: "这是一个方案描述",
|
||||
create_by: "admin",
|
||||
},
|
||||
{
|
||||
date: '2016-05-01',
|
||||
name: '2025',
|
||||
description: "这是一个方案描述",
|
||||
create_by: "admin",
|
||||
},
|
||||
]
|
||||
getList()
|
||||
const tableData = ref([])
|
||||
const search = () => {
|
||||
console.log(searchParams)
|
||||
|
||||
getList(searchParams.value)
|
||||
}
|
||||
const reset = () => {
|
||||
searchParams.value = {name: "", create_by: "", datetime: ""}
|
||||
searchParams.value = {name: "", createdBy: "", datetime: ""}
|
||||
getList(searchParams.value)
|
||||
}
|
||||
const toTSEdit = (row) => {
|
||||
// router.push({path: '/tsEdit'})
|
||||
@ -163,6 +177,24 @@ const toTSEdit = (row) => {
|
||||
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 = (
|
||||
columns: ReturnType<typeof generateColumns>,
|
||||
|
||||
@ -48,6 +48,7 @@ import {ref, reactive,} from "vue";
|
||||
import {ElMessage} from 'element-plus'
|
||||
import {TsApi} from "../../api/ts";
|
||||
|
||||
const emit = defineEmits(['addCallback']);
|
||||
const isShowPup = ref(true)
|
||||
const sizeForm = reactive({
|
||||
name: '',
|
||||
@ -62,6 +63,7 @@ const addPlan = () => {
|
||||
message: '操作成功',
|
||||
type: 'success'
|
||||
})
|
||||
emit('addCallback');
|
||||
}
|
||||
$(".newPlan")[0].style.display = "none"
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user