数据库管理

This commit is contained in:
liaoboping 2025-08-12 18:15:16 +08:00
parent 20849de05a
commit f2d6211ea7
11 changed files with 1587 additions and 67 deletions

View File

@ -9,7 +9,7 @@ import { ACCESS_TOKEN } from '@/store/mutation-types'
const request = axios.create({
// API 请求的默认前缀
baseURL: process.env.VUE_APP_API_BASE_URL,
timeout: 600000 // 请求超时时间
timeout: 600000, // 请求超时时间
})
// 异常拦截处理器
@ -21,15 +21,15 @@ const errorHandler = (error) => {
if (error.response.status === 403) {
notification.error({
message: 'Forbidden',
description: data.message
description: data.message,
})
}
if (error.response.status === 401 && !(data.result && data.result.isLogin)) {
notification.error({
message: '温馨提示',
description: '登录过期,请重新登录'
description: '登录过期,请重新登录',
})
if (token) {
store.dispatch('Logout').then(() => {
setTimeout(() => {
@ -43,7 +43,7 @@ const errorHandler = (error) => {
}
// request interceptor
request.interceptors.request.use(config => {
request.interceptors.request.use((config) => {
const token = storage.get(ACCESS_TOKEN)
// 如果 token 存在
// 让每个请求携带自定义 token 请根据实际情况自行修改
@ -55,19 +55,19 @@ request.interceptors.request.use(config => {
// response interceptor
request.interceptors.response.use((response) => {
if (response.data && response.data.code && response.data.code > 5000 && response.data.code < 5008) {
return Promise.reject(response.data)
}
return response.data
}, errorHandler)
const installer = {
vm: {},
install (Vue) {
install(Vue) {
Vue.use(VueAxios, request)
}
},
}
export default request
export {
installer as VueAxios,
request as axios
}
export { installer as VueAxios, request as axios }

View File

@ -123,30 +123,7 @@ export default {
runningMode: '1',
radioType: 'xdsm',
scenarioDetail: {
title: '中印边界xxx作战',
authorName: '周海鹏',
description: `<div style="width: 640px">
<h1>作战背景</h1>
<p style="text-indent: 2em">
由于印度一直受美国方面的指示试图想越过中印边界试图打开突破口侵占我国领土
</p>
<p style="text-indent: 2em">
为了防御突发战争的爆发亚东边防六团决定实施一次应对印度突然袭击的军事演习
</p>
<img
src="/mockData/68ab3707-2552-4b78-bfc0-cec3502ec62f.png"
style="display: block; margin: 0 auto"
/>
<div style="text-align: center">标绘</div>
<h1>作战企图</h1>
<p style="text-indent: 2em">
现代战争的准备和实施必须有相应的后勤保障包括武器装备及物资资源后勤保障
</p>
<p style="text-indent: 2em">制约着战略战术目标的达成</p>
<h1>基本情况</h1>
</div>`,
},
scenarioDetail: {},
visible: false,
ioEventList: [
@ -155,36 +132,6 @@ export default {
eventTime: '2021-06-26 11:50:35',
eventDesc: '加载数据中,请稍后',
},
{
id: '2',
eventTime: '2021-06-26 11:50:36',
eventDesc: '兵棋推演正式开始',
},
{
id: '3',
eventTime: '2021-06-26 11:53:10',
eventDesc: '红方051型驱逐舰驶向蓝方A102目标距离目标还有100海里准备开火',
},
{
id: '4',
eventTime: '2021-06-26 11:54:11',
eventDesc: '蓝方进入红方巡逻区,战斗机准备出动',
},
{
id: '5',
eventTime: '2021-06-26 11:54:19',
eventDesc: '红方辽宁舰发现不明舰艇靠近,疑似其他国家干涉,启动预案二',
},
{
id: '6',
eventTime: '2021-06-26 11:54:56',
eventDesc: '红方Chengdu J-20开始攻击蓝方飞机场',
},
{
id: '7',
eventTime: '2021-06-26 11:55:00',
eventDesc: '蓝方预警机出动',
},
],
}
},

View File

@ -0,0 +1,9 @@
<template>
<div>bzhjsjk</div>
</template>
<script>
export default {}
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,9 @@
<template>
<div>bzllsjk</div>
</template>
<script>
export default {}
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,265 @@
<template>
<page-header-wrapper>
<div v-grid-box="{ columns: ['400px', 1] }">
<a-card :bordered="false">
<a-list :loading="listLoading" item-layout="horizontal" :data-source="scenarioList">
<a-list-item slot="renderItem" slot-scope="item" @click="handleClickScenario(item)">
<a-list-item-meta :description="item.author">
<span slot="title">{{ item.name }}</span>
<a-checkbox slot="avatar" :checked="item.id === queryParam.id"></a-checkbox>
</a-list-item-meta>
</a-list-item>
</a-list>
</a-card>
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="48">
<!-- <a-col :xl="8" :lg="8">
<a-form-item label="想定名称">
<a-input placeholder="请输入" v-model="queryParam.name" />
</a-form-item>
</a-col> -->
<a-col :xl="8" :lg="8">
<span class="table-page-search-submitButtons">
<a-button type="primary" @click="getList">查询</a-button>
<a-button style="margin-left: 8px" @click="resetList">重置</a-button>
</span>
</a-col>
<a-col :xl="8" :lg="8">
<!-- <a-button type="primary" icon="plus" style="float: right" @click="handleAdd">新建</a-button> -->
</a-col>
</a-row>
</a-form>
</div>
<a-table
bordered
rowKey="id"
size="small"
:columns="columns"
:dataSource="loadData"
:pagination="false"
:loading="loadingTable"
>
<!-- <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)"> <a-icon type="form" /></a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除该想定吗?"
ok-text="确定"
cancel-text="取消"
@confirm="handleDelete(record)"
>
<a href="javascript:;"><a-icon type="delete" /></a>
</a-popconfirm>
</span> -->
</a-table>
</a-card>
</div>
<h-modal
:title="AEModal.title"
:width="640"
:visible="AEModal.visible"
:destroyOnClose="true"
@cancel="() => this.handleClose()"
@ok="() => this.handleOk()"
switch-fullscreen
:fullscreen.sync="AEModal.fullscreen"
>
<a-spin :spinning="AEModal.spinning">
<a-form-model
ref="form"
:model="AEModal.form"
:rules="AEModal.rules"
:label-col="AEModal.labelCol"
:wrapper-col="AEModal.wrapperCol"
>
<a-form-model-item label="想定名称" prop="name">
<a-input v-model="AEModal.form.name" />
</a-form-model-item>
</a-form-model>
</a-spin>
</h-modal>
</page-header-wrapper>
</template>
<script>
export default {
name: 'Fasjk',
data() {
return {
listLoading: false,
scenarioList: [],
queryParam: { id: '' },
columns: [
{
title: '#',
dataIndex: 'index',
customRender: (_, record, $index) => $index + 1,
align: 'center',
width: 80,
},
{
title: '分队',
dataIndex: '0',
align: 'left',
},
{
title: '方案类型',
dataIndex: '1',
align: 'left',
},
{
title: '方案目标',
dataIndex: '2',
align: 'left',
ellipsis: true,
},
{
title: '开始时间',
width: 160,
dataIndex: '3',
align: 'center',
},
{
title: '结束时间',
width: 160,
dataIndex: '4',
align: 'center',
},
{
title: '经度',
width: 120,
dataIndex: 'lat',
customRender: (_, record, $index) => record[5].split(',')[0],
align: 'center',
},
{
title: '纬度',
width: 120,
dataIndex: 'lon',
customRender: (_, record, $index) => record[5].split(',')[0],
align: 'center',
},
],
loadData: [], // Promise
loadingTable: false,
AEModal: {
title: '',
visible: false,
editStatus: false,
fullscreen: false,
spinning: false,
form: {},
rules: {
name: [{ required: true, message: '请输入想定名称!', trigger: 'blur' }],
},
labelCol: { xs: { span: 24 }, sm: { span: 7 } },
wrapperCol: { xs: { span: 24 }, sm: { span: 13 } },
},
}
},
mounted() {
this.getScenarioList()
},
methods: {
async getScenarioList() {
try {
this.listLoading = true
const res = await this.$http({
url: `/baseData/scenario/all`,
method: 'get',
})
this.scenarioList = res.data
this.queryParam.id = this.scenarioList[0].id
this.getList()
} catch (error) {
console.log(error)
} finally {
this.listLoading = false
}
},
handleClickScenario(item) {
this.queryParam.id = item.id
this.getList()
},
resetList() {
this.queryParam = {}
this.getList()
},
async getList(parameter = {}) {
try {
this.loadingTable = true
const res = await this.$http({
url: '/baseData/scenario/schemeList',
method: 'get',
params: { ...parameter, ...this.queryParam },
})
this.loadData = res.data
} catch (error) {
console.log(error)
} finally {
this.loadingTable = false
}
},
handleAdd() {
this.AEModal.title = '添加想定'
this.AEModal.editStatus = false
this.AEModal.visible = true
},
async handleEdit(record) {
try {
const res = await this.$http({
url: `/baseData/scenario/${record.id}`,
method: 'get',
})
this.AEModal.form = res.data.data
this.AEModal.title = '编辑想定'
this.AEModal.editStatus = true
this.AEModal.visible = true
} catch (error) {
console.log(error)
this.$message.error('未知错误,请重试')
}
},
handleClose() {
this.AEModal.visible = false
this.AEModal.form = {}
},
async handleOk() {
try {
await this.$refs.form.validate()
const params = { ...this.AEModal.form }
await this.$http({
url: `/baseData/scenario/save`,
method: 'post',
data: params,
})
this.$message.success(this.AEModal.editStatus ? '编辑想定成功!' : '添加想定成功!')
this.getList()
this.handleClose()
} catch (error) {
console.log(error)
}
},
async handleDelete(record) {
try {
await this.$http({
url: `/baseData/scenario/remove/${record.id}`,
method: 'get',
})
this.$message.success('删除角色成功')
this.getList()
} catch (error) {
console.log(error)
this.$message.error('删除角色失败')
}
},
},
}
</script>
<style lang="less" scoped></style>

View File

@ -2,7 +2,7 @@
<div class="database-page" v-grid-box="{ rows: [1, 1] }">
<ModuleWrapper title="保障实体类数据库">
<div class="normal bzstlsjk" v-grid-box="{ columns: [1, 1, 1] }">
<div v-for="(item, index) in bzstlsjk" :key="index" class="sjk-item">
<div v-for="(item, index) in bzstlsjk" :key="index" class="sjk-item" @click="$router.push(item.path)">
<img :src="item.image" alt="" />
<div class="title">{{ item.title }}</div>
</div>
@ -10,7 +10,7 @@
</ModuleWrapper>
<ModuleWrapper title="业务应用类数据库">
<div class="normal ywyylsjk" v-grid-box="{ columns: [1, 1, 1, 1, 1] }">
<div v-for="(item, index) in ywyylsjk" :key="index" class="sjk-item">
<div v-for="(item, index) in ywyylsjk" :key="index" class="sjk-item" @click="$router.push(item.path)">
<img :src="item.image" alt="" />
<div class="title">{{ item.title }}</div>
</div>
@ -28,36 +28,44 @@ export default {
{
title: '作战力量数据库',
image: require('@/assets/images/simulation-scene/database/zzllsjk.png'),
path: '/databaseSystem/zzllsjk',
},
{
title: '保障力量数据库',
image: require('@/assets/images/simulation-scene/database/bzllsjk.png'),
path: '/databaseSystem/bzllsjk',
},
{
title: '保障环境数据库',
image: require('@/assets/images/simulation-scene/database/bzhjsjk.png'),
path: '/databaseSystem/bzhjsjk',
},
],
ywyylsjk: [
{
title: '想定数据库',
image: require('@/assets/images/simulation-scene/database/xdsjk.png'),
path: '/databaseSystem/xdsjk',
},
{
title: '方案数据库',
image: require('@/assets/images/simulation-scene/database/fasjk.png'),
path: '/databaseSystem/fasjk',
},
{
title: '进程数据库',
image: require('@/assets/images/simulation-scene/database/jcsjk.png'),
path: '/databaseSystem/jcsjk',
},
{
title: '图形数据库',
image: require('@/assets/images/simulation-scene/database/txsjk.png'),
path: '/databaseSystem/txsjk',
},
{
title: '运行记录数据库',
image: require('@/assets/images/simulation-scene/database/yxjlsjk.png'),
path: '/databaseSystem/yxjlsjk',
},
],
}

View File

@ -0,0 +1,265 @@
<template>
<page-header-wrapper>
<div v-grid-box="{ columns: ['400px', 1] }">
<a-card :bordered="false">
<a-list :loading="listLoading" item-layout="horizontal" :data-source="scenarioList">
<a-list-item slot="renderItem" slot-scope="item" @click="handleClickScenario(item)">
<a-list-item-meta :description="item.author">
<span slot="title">{{ item.name }}</span>
<a-checkbox slot="avatar" :checked="item.id === queryParam.id"></a-checkbox>
</a-list-item-meta>
</a-list-item>
</a-list>
</a-card>
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="48">
<!-- <a-col :xl="8" :lg="8">
<a-form-item label="想定名称">
<a-input placeholder="请输入" v-model="queryParam.name" />
</a-form-item>
</a-col> -->
<a-col :xl="8" :lg="8">
<span class="table-page-search-submitButtons">
<a-button type="primary" @click="getList">查询</a-button>
<a-button style="margin-left: 8px" @click="resetList">重置</a-button>
</span>
</a-col>
<a-col :xl="8" :lg="8">
<!-- <a-button type="primary" icon="plus" style="float: right" @click="handleAdd">新建</a-button> -->
</a-col>
</a-row>
</a-form>
</div>
<a-table
bordered
rowKey="id"
size="small"
:columns="columns"
:dataSource="loadData"
:pagination="false"
:loading="loadingTable"
>
<!-- <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)"> <a-icon type="form" /></a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除该想定吗?"
ok-text="确定"
cancel-text="取消"
@confirm="handleDelete(record)"
>
<a href="javascript:;"><a-icon type="delete" /></a>
</a-popconfirm>
</span> -->
</a-table>
</a-card>
</div>
<h-modal
:title="AEModal.title"
:width="640"
:visible="AEModal.visible"
:destroyOnClose="true"
@cancel="() => this.handleClose()"
@ok="() => this.handleOk()"
switch-fullscreen
:fullscreen.sync="AEModal.fullscreen"
>
<a-spin :spinning="AEModal.spinning">
<a-form-model
ref="form"
:model="AEModal.form"
:rules="AEModal.rules"
:label-col="AEModal.labelCol"
:wrapper-col="AEModal.wrapperCol"
>
<a-form-model-item label="想定名称" prop="name">
<a-input v-model="AEModal.form.name" />
</a-form-model-item>
</a-form-model>
</a-spin>
</h-modal>
</page-header-wrapper>
</template>
<script>
export default {
name: 'Jcsjk',
data() {
return {
listLoading: false,
scenarioList: [],
queryParam: { id: '' },
columns: [
{
title: '#',
dataIndex: 'index',
customRender: (_, record, $index) => $index + 1,
align: 'center',
width: 80,
},
{
title: '分队',
dataIndex: '0',
align: 'left',
},
{
title: '方案类型',
dataIndex: '1',
align: 'left',
},
{
title: '方案目标',
dataIndex: '2',
align: 'left',
ellipsis: true,
},
{
title: '开始时间',
width: 160,
dataIndex: '3',
align: 'center',
},
{
title: '结束时间',
width: 160,
dataIndex: '4',
align: 'center',
},
{
title: '经度',
width: 120,
dataIndex: 'lat',
customRender: (_, record, $index) => record[5].split(',')[0],
align: 'center',
},
{
title: '纬度',
width: 120,
dataIndex: 'lon',
customRender: (_, record, $index) => record[5].split(',')[0],
align: 'center',
},
],
loadData: [], // Promise
loadingTable: false,
AEModal: {
title: '',
visible: false,
editStatus: false,
fullscreen: false,
spinning: false,
form: {},
rules: {
name: [{ required: true, message: '请输入想定名称!', trigger: 'blur' }],
},
labelCol: { xs: { span: 24 }, sm: { span: 7 } },
wrapperCol: { xs: { span: 24 }, sm: { span: 13 } },
},
}
},
mounted() {
this.getScenarioList()
},
methods: {
async getScenarioList() {
try {
this.listLoading = true
const res = await this.$http({
url: `/baseData/scenario/all`,
method: 'get',
})
this.scenarioList = res.data
this.queryParam.id = this.scenarioList[0].id
this.getList()
} catch (error) {
console.log(error)
} finally {
this.listLoading = false
}
},
handleClickScenario(item) {
this.queryParam.id = item.id
this.getList()
},
resetList() {
this.queryParam = {}
this.getList()
},
async getList(parameter = {}) {
try {
this.loadingTable = true
const res = await this.$http({
url: '/baseData/scenario/schemeList',
method: 'get',
params: { ...parameter, ...this.queryParam },
})
this.loadData = res.data
} catch (error) {
console.log(error)
} finally {
this.loadingTable = false
}
},
handleAdd() {
this.AEModal.title = '添加想定'
this.AEModal.editStatus = false
this.AEModal.visible = true
},
async handleEdit(record) {
try {
const res = await this.$http({
url: `/baseData/scenario/${record.id}`,
method: 'get',
})
this.AEModal.form = res.data.data
this.AEModal.title = '编辑想定'
this.AEModal.editStatus = true
this.AEModal.visible = true
} catch (error) {
console.log(error)
this.$message.error('未知错误,请重试')
}
},
handleClose() {
this.AEModal.visible = false
this.AEModal.form = {}
},
async handleOk() {
try {
await this.$refs.form.validate()
const params = { ...this.AEModal.form }
await this.$http({
url: `/baseData/scenario/save`,
method: 'post',
data: params,
})
this.$message.success(this.AEModal.editStatus ? '编辑想定成功!' : '添加想定成功!')
this.getList()
this.handleClose()
} catch (error) {
console.log(error)
}
},
async handleDelete(record) {
try {
await this.$http({
url: `/baseData/scenario/remove/${record.id}`,
method: 'get',
})
this.$message.success('删除角色成功')
this.getList()
} catch (error) {
console.log(error)
this.$message.error('删除角色失败')
}
},
},
}
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,265 @@
<template>
<page-header-wrapper>
<div v-grid-box="{ columns: ['400px', 1] }">
<a-card :bordered="false">
<a-list :loading="listLoading" item-layout="horizontal" :data-source="scenarioList">
<a-list-item slot="renderItem" slot-scope="item" @click="handleClickScenario(item)">
<a-list-item-meta :description="item.author">
<span slot="title">{{ item.name }}</span>
<a-checkbox slot="avatar" :checked="item.id === queryParam.id"></a-checkbox>
</a-list-item-meta>
</a-list-item>
</a-list>
</a-card>
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="48">
<!-- <a-col :xl="8" :lg="8">
<a-form-item label="想定名称">
<a-input placeholder="请输入" v-model="queryParam.name" />
</a-form-item>
</a-col> -->
<a-col :xl="8" :lg="8">
<span class="table-page-search-submitButtons">
<a-button type="primary" @click="getList">查询</a-button>
<a-button style="margin-left: 8px" @click="resetList">重置</a-button>
</span>
</a-col>
<a-col :xl="8" :lg="8">
<!-- <a-button type="primary" icon="plus" style="float: right" @click="handleAdd">新建</a-button> -->
</a-col>
</a-row>
</a-form>
</div>
<a-table
bordered
rowKey="id"
size="small"
:columns="columns"
:dataSource="loadData"
:pagination="false"
:loading="loadingTable"
>
<!-- <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)"> <a-icon type="form" /></a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除该想定吗?"
ok-text="确定"
cancel-text="取消"
@confirm="handleDelete(record)"
>
<a href="javascript:;"><a-icon type="delete" /></a>
</a-popconfirm>
</span> -->
</a-table>
</a-card>
</div>
<h-modal
:title="AEModal.title"
:width="640"
:visible="AEModal.visible"
:destroyOnClose="true"
@cancel="() => this.handleClose()"
@ok="() => this.handleOk()"
switch-fullscreen
:fullscreen.sync="AEModal.fullscreen"
>
<a-spin :spinning="AEModal.spinning">
<a-form-model
ref="form"
:model="AEModal.form"
:rules="AEModal.rules"
:label-col="AEModal.labelCol"
:wrapper-col="AEModal.wrapperCol"
>
<a-form-model-item label="想定名称" prop="name">
<a-input v-model="AEModal.form.name" />
</a-form-model-item>
</a-form-model>
</a-spin>
</h-modal>
</page-header-wrapper>
</template>
<script>
export default {
name: 'Txsjk',
data() {
return {
listLoading: false,
scenarioList: [],
queryParam: { id: '' },
columns: [
{
title: '#',
dataIndex: 'index',
customRender: (_, record, $index) => $index + 1,
align: 'center',
width: 80,
},
{
title: '分队',
dataIndex: '0',
align: 'left',
},
{
title: '方案类型',
dataIndex: '1',
align: 'left',
},
{
title: '方案目标',
dataIndex: '2',
align: 'left',
ellipsis: true,
},
{
title: '开始时间',
width: 160,
dataIndex: '3',
align: 'center',
},
{
title: '结束时间',
width: 160,
dataIndex: '4',
align: 'center',
},
{
title: '经度',
width: 120,
dataIndex: 'lat',
customRender: (_, record, $index) => record[5].split(',')[0],
align: 'center',
},
{
title: '纬度',
width: 120,
dataIndex: 'lon',
customRender: (_, record, $index) => record[5].split(',')[0],
align: 'center',
},
],
loadData: [], // Promise
loadingTable: false,
AEModal: {
title: '',
visible: false,
editStatus: false,
fullscreen: false,
spinning: false,
form: {},
rules: {
name: [{ required: true, message: '请输入想定名称!', trigger: 'blur' }],
},
labelCol: { xs: { span: 24 }, sm: { span: 7 } },
wrapperCol: { xs: { span: 24 }, sm: { span: 13 } },
},
}
},
mounted() {
this.getScenarioList()
},
methods: {
async getScenarioList() {
try {
this.listLoading = true
const res = await this.$http({
url: `/baseData/scenario/all`,
method: 'get',
})
this.scenarioList = res.data
this.queryParam.id = this.scenarioList[0].id
this.getList()
} catch (error) {
console.log(error)
} finally {
this.listLoading = false
}
},
handleClickScenario(item) {
this.queryParam.id = item.id
this.getList()
},
resetList() {
this.queryParam = {}
this.getList()
},
async getList(parameter = {}) {
try {
this.loadingTable = true
const res = await this.$http({
url: '/baseData/scenario/schemeList',
method: 'get',
params: { ...parameter, ...this.queryParam },
})
this.loadData = res.data
} catch (error) {
console.log(error)
} finally {
this.loadingTable = false
}
},
handleAdd() {
this.AEModal.title = '添加想定'
this.AEModal.editStatus = false
this.AEModal.visible = true
},
async handleEdit(record) {
try {
const res = await this.$http({
url: `/baseData/scenario/${record.id}`,
method: 'get',
})
this.AEModal.form = res.data.data
this.AEModal.title = '编辑想定'
this.AEModal.editStatus = true
this.AEModal.visible = true
} catch (error) {
console.log(error)
this.$message.error('未知错误,请重试')
}
},
handleClose() {
this.AEModal.visible = false
this.AEModal.form = {}
},
async handleOk() {
try {
await this.$refs.form.validate()
const params = { ...this.AEModal.form }
await this.$http({
url: `/baseData/scenario/save`,
method: 'post',
data: params,
})
this.$message.success(this.AEModal.editStatus ? '编辑想定成功!' : '添加想定成功!')
this.getList()
this.handleClose()
} catch (error) {
console.log(error)
}
},
async handleDelete(record) {
try {
await this.$http({
url: `/baseData/scenario/remove/${record.id}`,
method: 'get',
})
this.$message.success('删除角色成功')
this.getList()
} catch (error) {
console.log(error)
this.$message.error('删除角色失败')
}
},
},
}
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,227 @@
<template>
<page-header-wrapper>
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="48">
<a-col :xl="8" :lg="8">
<a-form-item label="想定名称">
<a-input placeholder="请输入" v-model="queryParam.name" />
</a-form-item>
</a-col>
<a-col :xl="8" :lg="8">
<span class="table-page-search-submitButtons">
<a-button type="primary" @click="getList">查询</a-button>
<a-button style="margin-left: 8px" @click="resetList">重置</a-button>
</span>
</a-col>
<a-col :xl="8" :lg="8">
<a-button type="primary" icon="plus" style="float: right" @click="handleAdd">新建</a-button>
</a-col>
</a-row>
</a-form>
</div>
<a-table
bordered
rowKey="id"
size="small"
:columns="columns"
:dataSource="loadData"
:pagination="paginationProps"
:loading="loadingTable"
@change="handleTableChange"
>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)"> <a-icon type="form" /></a>
<a-divider type="vertical" />
<a-popconfirm title="确定要删除该想定吗?" ok-text="确定" cancel-text="取消" @confirm="handleDelete(record)">
<a href="javascript:;"><a-icon type="delete" /></a>
</a-popconfirm>
</span>
</a-table>
</a-card>
<h-modal
:title="AEModal.title"
:width="640"
:visible="AEModal.visible"
:destroyOnClose="true"
@cancel="() => this.handleClose()"
@ok="() => this.handleOk()"
switch-fullscreen
:fullscreen.sync="AEModal.fullscreen"
>
<a-spin :spinning="AEModal.spinning">
<a-form-model
ref="form"
:model="AEModal.form"
:rules="AEModal.rules"
:label-col="AEModal.labelCol"
:wrapper-col="AEModal.wrapperCol"
>
<a-form-model-item label="想定名称" prop="name">
<a-input v-model="AEModal.form.name" />
</a-form-model-item>
</a-form-model>
</a-spin>
</h-modal>
</page-header-wrapper>
</template>
<script>
export default {
name: 'Xdsjk',
data() {
return {
queryParam: {}, //
columns: [
{
title: '#',
dataIndex: 'id',
align: 'center',
width: 80,
},
{
title: '想定名称',
align: 'left',
dataIndex: 'name',
ellipsis: true,
},
{
title: '作者',
dataIndex: 'author',
align: 'left',
},
{
title: '创建时间',
dataIndex: 'createTime',
customRender: (t) => t?.replace('T', ' '),
align: 'left',
},
{
title: '操作',
width: 140,
dataIndex: 'action',
align: 'center',
scopedSlots: { customRender: 'action' },
},
],
loadData: [], // Promise
loadingTable: false,
selectedRowKeys: [],
selectedRows: [],
paginationProps: {
defaultPageSize: 10,
showSizeChanger: true,
showQuickJumper: true,
showTotal: (total) => {
return `${total}`
},
onShowSizeChange: (current, pageSize) => (this.pageSize = pageSize),
},
AEModal: {
title: '',
visible: false,
editStatus: false,
fullscreen: false,
spinning: false,
form: {},
rules: {
name: [{ required: true, message: '请输入想定名称!', trigger: 'blur' }],
},
labelCol: { xs: { span: 24 }, sm: { span: 7 } },
wrapperCol: { xs: { span: 24 }, sm: { span: 13 } },
},
}
},
created() {
this.getList()
},
methods: {
resetList() {
this.queryParam = {}
this.getList()
},
async getList(parameter = {}) {
try {
this.loadingTable = true
const res = await this.$http({
url: '/baseData/scenario/list',
method: 'get',
params: { ...parameter, ...this.queryParam },
})
this.loadData = res.data.data
} catch (error) {
console.log(error)
} finally {
this.loadingTable = false
}
},
handleTableChange(pagination) {
const parameter = {}
parameter.pageSize = pagination.pageSize
parameter.pageNum = pagination.current
this.getList(parameter)
},
handleAdd() {
this.AEModal.title = '添加想定'
this.AEModal.editStatus = false
this.AEModal.visible = true
},
async handleEdit(record) {
try {
const res = await this.$http({
url: `/baseData/scenario/${record.id}`,
method: 'get',
})
this.AEModal.form = res.data.data
this.AEModal.title = '编辑想定'
this.AEModal.editStatus = true
this.AEModal.visible = true
} catch (error) {
console.log(error)
this.$message.error('未知错误,请重试')
}
},
handleClose() {
this.AEModal.visible = false
this.AEModal.form = {}
},
async handleOk() {
try {
await this.$refs.form.validate()
const params = { ...this.AEModal.form }
await this.$http({
url: `/baseData/scenario/save`,
method: 'post',
data: params,
})
this.$message.success(this.AEModal.editStatus ? '编辑想定成功!' : '添加想定成功!')
this.getList()
this.handleClose()
} catch (error) {
console.log(error)
}
},
async handleDelete(record) {
try {
await this.$http({
url: `/baseData/scenario/remove/${record.id}`,
method: 'get',
})
this.$message.success('删除角色成功')
this.getList()
} catch (error) {
console.log(error)
this.$message.error('删除角色失败')
}
},
},
}
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,265 @@
<template>
<page-header-wrapper>
<div v-grid-box="{ columns: ['400px', 1] }">
<a-card :bordered="false">
<a-list :loading="listLoading" item-layout="horizontal" :data-source="scenarioList">
<a-list-item slot="renderItem" slot-scope="item" @click="handleClickScenario(item)">
<a-list-item-meta :description="item.author">
<span slot="title">{{ item.name }}</span>
<a-checkbox slot="avatar" :checked="item.id === queryParam.id"></a-checkbox>
</a-list-item-meta>
</a-list-item>
</a-list>
</a-card>
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="48">
<!-- <a-col :xl="8" :lg="8">
<a-form-item label="想定名称">
<a-input placeholder="请输入" v-model="queryParam.name" />
</a-form-item>
</a-col> -->
<a-col :xl="8" :lg="8">
<span class="table-page-search-submitButtons">
<a-button type="primary" @click="getList">查询</a-button>
<a-button style="margin-left: 8px" @click="resetList">重置</a-button>
</span>
</a-col>
<a-col :xl="8" :lg="8">
<!-- <a-button type="primary" icon="plus" style="float: right" @click="handleAdd">新建</a-button> -->
</a-col>
</a-row>
</a-form>
</div>
<a-table
bordered
rowKey="id"
size="small"
:columns="columns"
:dataSource="loadData"
:pagination="false"
:loading="loadingTable"
>
<!-- <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)"> <a-icon type="form" /></a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除该想定吗?"
ok-text="确定"
cancel-text="取消"
@confirm="handleDelete(record)"
>
<a href="javascript:;"><a-icon type="delete" /></a>
</a-popconfirm>
</span> -->
</a-table>
</a-card>
</div>
<h-modal
:title="AEModal.title"
:width="640"
:visible="AEModal.visible"
:destroyOnClose="true"
@cancel="() => this.handleClose()"
@ok="() => this.handleOk()"
switch-fullscreen
:fullscreen.sync="AEModal.fullscreen"
>
<a-spin :spinning="AEModal.spinning">
<a-form-model
ref="form"
:model="AEModal.form"
:rules="AEModal.rules"
:label-col="AEModal.labelCol"
:wrapper-col="AEModal.wrapperCol"
>
<a-form-model-item label="想定名称" prop="name">
<a-input v-model="AEModal.form.name" />
</a-form-model-item>
</a-form-model>
</a-spin>
</h-modal>
</page-header-wrapper>
</template>
<script>
export default {
name: 'Yxjlsjk',
data() {
return {
listLoading: false,
scenarioList: [],
queryParam: { id: '' },
columns: [
{
title: '#',
dataIndex: 'index',
customRender: (_, record, $index) => $index + 1,
align: 'center',
width: 80,
},
{
title: '分队',
dataIndex: '0',
align: 'left',
},
{
title: '方案类型',
dataIndex: '1',
align: 'left',
},
{
title: '方案目标',
dataIndex: '2',
align: 'left',
ellipsis: true,
},
{
title: '开始时间',
width: 160,
dataIndex: '3',
align: 'center',
},
{
title: '结束时间',
width: 160,
dataIndex: '4',
align: 'center',
},
{
title: '经度',
width: 120,
dataIndex: 'lat',
customRender: (_, record, $index) => record[5].split(',')[0],
align: 'center',
},
{
title: '纬度',
width: 120,
dataIndex: 'lon',
customRender: (_, record, $index) => record[5].split(',')[0],
align: 'center',
},
],
loadData: [], // Promise
loadingTable: false,
AEModal: {
title: '',
visible: false,
editStatus: false,
fullscreen: false,
spinning: false,
form: {},
rules: {
name: [{ required: true, message: '请输入想定名称!', trigger: 'blur' }],
},
labelCol: { xs: { span: 24 }, sm: { span: 7 } },
wrapperCol: { xs: { span: 24 }, sm: { span: 13 } },
},
}
},
mounted() {
this.getScenarioList()
},
methods: {
async getScenarioList() {
try {
this.listLoading = true
const res = await this.$http({
url: `/baseData/scenario/all`,
method: 'get',
})
this.scenarioList = res.data
this.queryParam.id = this.scenarioList[0].id
this.getList()
} catch (error) {
console.log(error)
} finally {
this.listLoading = false
}
},
handleClickScenario(item) {
this.queryParam.id = item.id
this.getList()
},
resetList() {
this.queryParam = {}
this.getList()
},
async getList(parameter = {}) {
try {
this.loadingTable = true
const res = await this.$http({
url: '/baseData/scenario/schemeList',
method: 'get',
params: { ...parameter, ...this.queryParam },
})
this.loadData = res.data
} catch (error) {
console.log(error)
} finally {
this.loadingTable = false
}
},
handleAdd() {
this.AEModal.title = '添加想定'
this.AEModal.editStatus = false
this.AEModal.visible = true
},
async handleEdit(record) {
try {
const res = await this.$http({
url: `/baseData/scenario/${record.id}`,
method: 'get',
})
this.AEModal.form = res.data.data
this.AEModal.title = '编辑想定'
this.AEModal.editStatus = true
this.AEModal.visible = true
} catch (error) {
console.log(error)
this.$message.error('未知错误,请重试')
}
},
handleClose() {
this.AEModal.visible = false
this.AEModal.form = {}
},
async handleOk() {
try {
await this.$refs.form.validate()
const params = { ...this.AEModal.form }
await this.$http({
url: `/baseData/scenario/save`,
method: 'post',
data: params,
})
this.$message.success(this.AEModal.editStatus ? '编辑想定成功!' : '添加想定成功!')
this.getList()
this.handleClose()
} catch (error) {
console.log(error)
}
},
async handleDelete(record) {
try {
await this.$http({
url: `/baseData/scenario/remove/${record.id}`,
method: 'get',
})
this.$message.success('删除角色成功')
this.getList()
} catch (error) {
console.log(error)
this.$message.error('删除角色失败')
}
},
},
}
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,260 @@
<template>
<page-header-wrapper>
<div v-grid-box="{ columns: ['400px', 1] }">
<a-card :bordered="false">
<a-tree :treeData="zzTree" :selectedKeys.sync="selectedKeys" @select="getList()"> </a-tree>
</a-card>
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="48">
<a-col :xl="8" :lg="8">
<a-radio-group v-model="queryParam.type" button-style="solid" @change="handleChangeType">
<a-radio-button value="staff"> 人员 </a-radio-button>
<a-radio-button value="weapon"> 装备 </a-radio-button>
</a-radio-group>
</a-col>
<a-col :xl="8" :lg="8"> </a-col>
<a-col :xl="8" :lg="8">
<span class="table-page-search-submitButtons" style="float: right">
<a-button type="primary" @click="getList">查询</a-button>
<a-button style="margin-left: 8px" @click="resetList">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<a-table
bordered
rowKey="id"
size="small"
:columns="columns"
:dataSource="loadData"
:pagination="false"
:loading="loadingTable"
>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)"> <a-icon type="form" /></a>
<!-- <a-divider type="vertical" />
<a-popconfirm
title="确定要删除该岗位吗?"
ok-text="确定"
cancel-text="取消"
@confirm="handleDelete(record)"
>
<a href="javascript:;"><a-icon type="delete" /></a>
</a-popconfirm> -->
</span>
</a-table>
</a-card>
</div>
<h-modal
:title="AEModal.title"
:width="640"
:visible="AEModal.visible"
:destroyOnClose="true"
@cancel="() => this.handleClose()"
@ok="() => this.handleOk()"
switch-fullscreen
:fullscreen.sync="AEModal.fullscreen"
>
<a-spin :spinning="AEModal.spinning">
<a-form-model
ref="form"
:model="AEModal.form"
:rules="AEModal.rules"
:label-col="AEModal.labelCol"
:wrapper-col="AEModal.wrapperCol"
>
<a-form-model-item v-for="item in AEModal.formItems" :key="item.prop" v-bind="item">
<a-input v-model="AEModal.form[item.prop]" />
</a-form-model-item>
</a-form-model>
</a-spin>
</h-modal>
</page-header-wrapper>
</template>
<script>
export default {
name: 'Zzllsjk',
data() {
return {
zzTree: [],
selectedKeys: [],
queryParam: { id: '', type: 'staff' },
columns: [
{
title: '#',
dataIndex: 'index',
customRender: (_, record, $index) => $index + 1,
align: 'center',
width: 80,
},
{
title: '岗位',
dataIndex: 'name',
},
{
title: '岗位数量',
dataIndex: 'number',
},
{
title: '物资器材',
dataIndex: 'material',
},
{
title: '操作',
width: 140,
dataIndex: 'action',
align: 'center',
scopedSlots: { customRender: 'action' },
},
],
loadData: [], // Promise
loadingTable: false,
AEModal: {
title: '',
visible: false,
editStatus: false,
fullscreen: false,
spinning: false,
form: {},
formItems: [
{
label: '岗位名称',
prop: 'name',
},
{
label: '岗位数量',
prop: 'number',
},
],
rules: {
name: [{ required: true, message: '请输入岗位名称!', trigger: 'blur' }],
},
labelCol: { xs: { span: 24 }, sm: { span: 7 } },
wrapperCol: { xs: { span: 24 }, sm: { span: 13 } },
},
}
},
computed: {
typeMapLabel() {
return { staff: '人员', weapon: '装备' }[this.queryParam.type]
},
},
mounted() {
this.getZzTree()
},
methods: {
async getZzTree() {
try {
const res = await this.$http({
url: `/tree/organization`,
method: 'get',
params: { unitype: 1 },
})
this.zzTree = res.data
this.selectedKeys = [this.zzTree[0].key]
this.getList()
} catch (error) {
console.log(error)
}
},
handleChangeType(e) {
switch (e.target.value) {
case 'staff':
this.columns[1].title = '岗位'
this.columns[2].title = '岗位数量'
this.columns[3].title = '物资器材'
this.columns[3].dataIndex = 'material'
this.AEModal.formItems[0].label = '岗位名称'
this.AEModal.formItems[1].label = '岗位数量'
break
case 'weapon':
this.columns[1].title = '装备名称'
this.columns[2].title = '装备数量'
this.columns[3].title = '装备类型'
this.columns[3].dataIndex = 'type'
this.AEModal.formItems[0].label = '装备名称'
this.AEModal.formItems[1].label = '装备数量'
break
}
this.getList()
},
resetList() {
this.getList()
},
async getList(parameter = {}) {
try {
this.loadingTable = true
const res = await this.$http({
url: `/baseData/fightPowerHierarchy/${this.queryParam.type}/${this.selectedKeys[0]}`,
method: 'get',
})
this.loadData = res.data
} catch (error) {
console.log(error)
} finally {
this.loadingTable = false
}
},
handleAdd() {
this.AEModal.form = {}
this.AEModal.title = `添加${this.typeMapLabel}`
this.AEModal.editStatus = false
this.AEModal.visible = true
},
async handleEdit(record) {
try {
this.AEModal.form = { ...record }
this.AEModal.title = `编辑${this.typeMapLabel}`
this.AEModal.editStatus = true
this.AEModal.visible = true
} catch (error) {
console.log(error)
this.$message.error('未知错误,请重试')
}
},
handleClose() {
this.AEModal.visible = false
this.AEModal.form = {}
},
async handleOk() {
try {
await this.$refs.form.validate()
const params = { ...this.AEModal.form }
await this.$http({
url: `/baseData/fightPowerHierarchy/${this.queryParam.type}/save`,
method: 'post',
data: params,
})
this.$message.success(`${this.AEModal.title}成功!`)
this.getList()
this.handleClose()
} catch (error) {
console.log(error)
this.$message.error(error.message || '未知错误,请重试')
}
},
async handleDelete(record) {
try {
await this.$http({
url: `/baseData/scenario/remove/${record.id}`,
method: 'get',
})
this.$message.success('删除角色成功')
this.getList()
} catch (error) {
console.log(error)
this.$message.error('删除角色失败')
}
},
},
}
</script>
<style lang="less" scoped></style>