coding
This commit is contained in:
parent
bc20f37a31
commit
1527623e2a
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<page-header-wrapper>
|
<page-header-wrapper>
|
||||||
<Grid :columns="['400px', 1]" :rows="gridRows">
|
<Grid :columns="['400px', 1]" :rows="gridRows">
|
||||||
<a-card title="组织架构-作战力量" class="my-card my-card-has-title" :bordered="false" style="grid-row: 1 / 3">
|
<a-card title="组织架构-保障力量" class="my-card my-card-has-title" :bordered="false" style="grid-row: 1 / 3">
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<a-button type="primary" icon="plus" shape="circle" title="新增" @click="handleOpenAddZzjgModal()"></a-button>
|
<a-button type="primary" icon="plus" shape="circle" title="新增" @click="handleOpenAddZzjgModal()"></a-button>
|
||||||
</template>
|
</template>
|
||||||
|
@ -161,7 +161,6 @@ export default {
|
||||||
formRules: {
|
formRules: {
|
||||||
codeName: [{ required: true, message: '请输入标识编码!', trigger: 'blur' }],
|
codeName: [{ required: true, message: '请输入标识编码!', trigger: 'blur' }],
|
||||||
name: [{ required: true, message: '请输入组织名称!', trigger: 'blur' }],
|
name: [{ required: true, message: '请输入组织名称!', trigger: 'blur' }],
|
||||||
unittype: [{ required: true, message: '请选择组织类型!', trigger: 'blur' }],
|
|
||||||
},
|
},
|
||||||
formData: {},
|
formData: {},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,9 +1,161 @@
|
||||||
<template>
|
<template>
|
||||||
<div>装备数据库</div>
|
<page-header-wrapper>
|
||||||
|
<Grid :columns="['400px', 1]">
|
||||||
|
<a-card title="装备管理" class="my-card my-card-has-title" :bordered="false">
|
||||||
|
<template #extra>
|
||||||
|
<a-button type="primary" icon="plus" shape="circle" title="新增" @click="handleOpenAddZbglModal()"></a-button>
|
||||||
|
</template>
|
||||||
|
<a-tree
|
||||||
|
:treeData="zbgl.treeData"
|
||||||
|
:selectedKeys.sync="zbgl.selectedKeys"
|
||||||
|
:expandedKeys.sync="zbgl.expandedKeys"
|
||||||
|
@select="handleChangeZbglSelected"
|
||||||
|
>
|
||||||
|
<template #title="scope">
|
||||||
|
<a-dropdown :trigger="['contextmenu']">
|
||||||
|
<span>{{ scope.title }}</span>
|
||||||
|
<span>{{ formatText(scope) }}</span>
|
||||||
|
<template #overlay>
|
||||||
|
<Flex class="contextmenu-zz">
|
||||||
|
<a-button
|
||||||
|
type="text-primary"
|
||||||
|
icon="edit"
|
||||||
|
title="编辑"
|
||||||
|
@click="handleOpenEditZbglModal(scope.key)"
|
||||||
|
></a-button>
|
||||||
|
<a-button
|
||||||
|
type="text-primary"
|
||||||
|
icon="plus"
|
||||||
|
title="新增子项"
|
||||||
|
@click="handleOpenAddZbglModal(scope.key)"
|
||||||
|
></a-button>
|
||||||
|
<a-button
|
||||||
|
type="text-danger"
|
||||||
|
icon="delete"
|
||||||
|
title="删除"
|
||||||
|
@click="handleDeleteZbgl(scope.key, scope.title)"
|
||||||
|
></a-button>
|
||||||
|
</Flex>
|
||||||
|
</template>
|
||||||
|
</a-dropdown>
|
||||||
|
</template>
|
||||||
|
</a-tree>
|
||||||
|
</a-card>
|
||||||
|
</Grid>
|
||||||
|
</page-header-wrapper>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {}
|
export default {
|
||||||
|
name: 'Zbsjk',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
zbgl: {
|
||||||
|
treeData: [],
|
||||||
|
selectedKeys: [],
|
||||||
|
expandedKeys: [],
|
||||||
|
},
|
||||||
|
zbglModal: {
|
||||||
|
visible: false,
|
||||||
|
title: '',
|
||||||
|
mode: '',
|
||||||
|
formItems: [
|
||||||
|
{
|
||||||
|
label: '上级装备',
|
||||||
|
prop: 'parentId',
|
||||||
|
component: 'AntOriginTreeSelect',
|
||||||
|
options: {
|
||||||
|
dataSource: () =>
|
||||||
|
this.$http({
|
||||||
|
url: '/tree/armament',
|
||||||
|
method: 'get',
|
||||||
|
}).then((res) => ({ data: [{ key: 0, title: '根组织' }].concat(res.data) })),
|
||||||
|
valueKey: 'key',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '标识编码',
|
||||||
|
prop: 'codeName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '装备名称',
|
||||||
|
prop: 'name',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
formRules: {
|
||||||
|
codeName: [{ required: true, message: '请输入标识编码!', trigger: 'blur' }],
|
||||||
|
name: [{ required: true, message: '请输入装备名称!', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
formData: {},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getZzTree()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
formatText(scope) {
|
||||||
|
console.log('----scope----', scope)
|
||||||
|
return ''
|
||||||
|
},
|
||||||
|
async getZzTree() {
|
||||||
|
try {
|
||||||
|
const res = await this.$http({
|
||||||
|
url: `/tree/armament`,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
this.zbgl.treeData = res.data
|
||||||
|
this.zbgl.selectedKeys = [this.zbgl.treeData[0].key]
|
||||||
|
this.handleChangeZbglSelected()
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleChangeZbglSelected() {},
|
||||||
|
handleOpenAddZbglModal(parentId) {
|
||||||
|
this.zbglModal.title = '新建装备管理'
|
||||||
|
this.zbglModal.mode = 'add'
|
||||||
|
this.zbglModal.formData = { parentId }
|
||||||
|
this.zbglModal.visible = true
|
||||||
|
},
|
||||||
|
async handleOpenEditZbglModal(id) {
|
||||||
|
try {
|
||||||
|
const res = await this.$http({
|
||||||
|
url: `/baseData/fightPowerHierarchy/${id}`,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
this.zbglModal.title = '编辑装备管理'
|
||||||
|
this.zbglModal.mode = 'edit'
|
||||||
|
this.zbglModal.formData = res.data
|
||||||
|
this.zbglModal.visible = true
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
this.$message.error('未知错误,请重试')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleSubmitZbgl(formData) {
|
||||||
|
return this.$http({
|
||||||
|
url: `/baseData/fightPowerHierarchy/save`,
|
||||||
|
method: 'post',
|
||||||
|
data: formData,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleSubmitZbglSuccess() {
|
||||||
|
this.getZzTree()
|
||||||
|
},
|
||||||
|
async handleDeleteZbgl(id, title) {
|
||||||
|
try {
|
||||||
|
await this.$confirm({ content: `确定删除装备管理-${title}?` })
|
||||||
|
await this.$http({
|
||||||
|
url: `/baseData/fightPowerHierarchy/remove/${id}`,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
this.$message.success('删除成功')
|
||||||
|
this.getZzTree()
|
||||||
|
} catch (error) {}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped></style>
|
<style lang="less" scoped></style>
|
||||||
|
|
|
@ -161,7 +161,6 @@ export default {
|
||||||
formRules: {
|
formRules: {
|
||||||
codeName: [{ required: true, message: '请输入标识编码!', trigger: 'blur' }],
|
codeName: [{ required: true, message: '请输入标识编码!', trigger: 'blur' }],
|
||||||
name: [{ required: true, message: '请输入组织名称!', trigger: 'blur' }],
|
name: [{ required: true, message: '请输入组织名称!', trigger: 'blur' }],
|
||||||
unittype: [{ required: true, message: '请选择组织类型!', trigger: 'blur' }],
|
|
||||||
},
|
},
|
||||||
formData: {},
|
formData: {},
|
||||||
},
|
},
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<a-radio-group v-model="right.radioType" button-style="solid">
|
<a-radio-group v-model="right.radioType" button-style="solid">
|
||||||
<a-radio-button value="jcsx">基础属性</a-radio-button>
|
<a-radio-button value="jcsx">基础属性</a-radio-button>
|
||||||
<a-radio-button value="zzxd">作战行动</a-radio-button>
|
<a-radio-button value="zzxd">作战行动</a-radio-button>
|
||||||
<a-radio-button value="dzsx">单装属性</a-radio-button>
|
<!-- <a-radio-button value="dzsx">单装属性</a-radio-button> -->
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</template>
|
</template>
|
||||||
<div class="normal" style="padding: 15px 0">
|
<div class="normal" style="padding: 15px 0">
|
||||||
|
@ -241,7 +241,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="right.radioType === 'dzsx'">
|
<!-- <div v-if="right.radioType === 'dzsx'">
|
||||||
<div>
|
<div>
|
||||||
<a-collapse>
|
<a-collapse>
|
||||||
<a-collapse-panel v-for="item in right.detail.equipmentList" :key="item.id" :header="item.name">
|
<a-collapse-panel v-for="item in right.detail.equipmentList" :key="item.id" :header="item.name">
|
||||||
|
@ -255,7 +255,7 @@
|
||||||
</a-collapse-panel>
|
</a-collapse-panel>
|
||||||
</a-collapse>
|
</a-collapse>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ModuleWrapper>
|
</ModuleWrapper>
|
||||||
|
@ -310,7 +310,20 @@
|
||||||
:destroyOnClose="true"
|
:destroyOnClose="true"
|
||||||
@ok="handleSubmilAction"
|
@ok="handleSubmilAction"
|
||||||
>
|
>
|
||||||
<div></div>
|
<a-form-model
|
||||||
|
:model="actionModal.formData"
|
||||||
|
layout="horizontal"
|
||||||
|
:labelCol="{ span: 6 }"
|
||||||
|
:wrapperCol="{ span: 15 }"
|
||||||
|
>
|
||||||
|
<a-form-model-item v-for="item in actionModal.formItems" :key="item.prop" v-bind="item">
|
||||||
|
<component
|
||||||
|
:is="item.component || 'a-input'"
|
||||||
|
v-model="actionModal.formData[item.prop]"
|
||||||
|
v-bind="item.options"
|
||||||
|
/>
|
||||||
|
</a-form-model-item>
|
||||||
|
</a-form-model>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</Grid>
|
</Grid>
|
||||||
</template>
|
</template>
|
||||||
|
@ -427,7 +440,7 @@ export default {
|
||||||
medicalInfo: {},
|
medicalInfo: {},
|
||||||
ammunition: {},
|
ammunition: {},
|
||||||
actionList: [],
|
actionList: [],
|
||||||
equipmentList: [],
|
// equipmentList: [],
|
||||||
},
|
},
|
||||||
checkedAction: null,
|
checkedAction: null,
|
||||||
},
|
},
|
||||||
|
@ -446,6 +459,33 @@ export default {
|
||||||
},
|
},
|
||||||
actionModal: {
|
actionModal: {
|
||||||
visible: false,
|
visible: false,
|
||||||
|
formItems: [
|
||||||
|
{ label: '事件名称', prop: 'typeName' },
|
||||||
|
{
|
||||||
|
label: '事件类型',
|
||||||
|
prop: 'typeType',
|
||||||
|
component: 'AntOriginSelect',
|
||||||
|
options: {
|
||||||
|
dataSource: () => ({
|
||||||
|
data: [
|
||||||
|
{ id: '1', title: '阵地进攻' },
|
||||||
|
{ id: '2', title: '机动进攻' },
|
||||||
|
{ id: '3', title: '城镇进攻' },
|
||||||
|
{ id: '4', title: '山地进攻' },
|
||||||
|
{ id: '5', title: '阵地防御' },
|
||||||
|
{ id: '6', title: '机动防御' },
|
||||||
|
{ id: '7', title: '城镇防御' },
|
||||||
|
{ id: '8', title: '山地防御' },
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ label: '开始时间', prop: 'beginDateTime', component: 'a-date-picker', options: { showTime: true } },
|
||||||
|
{ label: '结束时间', prop: 'endDateTime', component: 'a-date-picker', options: { showTime: true } },
|
||||||
|
{ label: '目标经度', prop: 'lon', component: 'a-input-number' },
|
||||||
|
{ label: '目标纬度', prop: 'lat', component: 'a-input-number' },
|
||||||
|
],
|
||||||
|
formData: {},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -482,9 +522,9 @@ export default {
|
||||||
name: '蓝方',
|
name: '蓝方',
|
||||||
selectable: false,
|
selectable: false,
|
||||||
children: [
|
children: [
|
||||||
{ id: '2-1', name: '作战力量', selectable: false, children: res.data.red.fight },
|
{ id: '2-1', name: '作战力量', selectable: false, children: res.data.blue.fight },
|
||||||
{ id: '2-2', name: '保障力量', selectable: false, children: res.data.red.guarantee },
|
{ id: '2-2', name: '保障力量', selectable: false, children: res.data.blue.guarantee },
|
||||||
{ id: '2-3', name: '指挥力量', selectable: false, children: res.data.red.command },
|
{ id: '2-3', name: '指挥力量', selectable: false, children: res.data.blue.command },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user