diff --git a/src/renderer/components.d.ts b/src/renderer/components.d.ts
index 06e6a6f..c553028 100644
--- a/src/renderer/components.d.ts
+++ b/src/renderer/components.d.ts
@@ -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']
diff --git a/src/renderer/src/views/TS/list.vue b/src/renderer/src/views/TS/list.vue
index 47ac7f8..a7f5965 100644
--- a/src/renderer/src/views/TS/list.vue
+++ b/src/renderer/src/views/TS/list.vue
@@ -23,7 +23,7 @@
clearable
/>
创建人
搜索
重置
- 新建推演
+ 新建推演
导入
导出
@@ -53,13 +53,26 @@
style="width: 100%"
>
-
-
-
+
+
+
编辑
- 删除
+
+
+ 删除
+
+
+
+
+
@@ -86,6 +99,7 @@
-->
+
@@ -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,
diff --git a/src/renderer/src/views/TS/newPlan.vue b/src/renderer/src/views/TS/newPlan.vue
index a709c35..be8caff 100644
--- a/src/renderer/src/views/TS/newPlan.vue
+++ b/src/renderer/src/views/TS/newPlan.vue
@@ -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"
})