coding
This commit is contained in:
parent
bc20f37a31
commit
1527623e2a
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<page-header-wrapper>
|
||||
<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>
|
||||
<a-button type="primary" icon="plus" shape="circle" title="新增" @click="handleOpenAddZzjgModal()"></a-button>
|
||||
</template>
|
||||
|
@ -161,7 +161,6 @@ export default {
|
|||
formRules: {
|
||||
codeName: [{ required: true, message: '请输入标识编码!', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '请输入组织名称!', trigger: 'blur' }],
|
||||
unittype: [{ required: true, message: '请选择组织类型!', trigger: 'blur' }],
|
||||
},
|
||||
formData: {},
|
||||
},
|
||||
|
|
|
@ -1,9 +1,161 @@
|
|||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
|
|
|
@ -161,7 +161,6 @@ export default {
|
|||
formRules: {
|
||||
codeName: [{ required: true, message: '请输入标识编码!', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '请输入组织名称!', trigger: 'blur' }],
|
||||
unittype: [{ required: true, message: '请选择组织类型!', trigger: 'blur' }],
|
||||
},
|
||||
formData: {},
|
||||
},
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<a-radio-group v-model="right.radioType" button-style="solid">
|
||||
<a-radio-button value="jcsx">基础属性</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>
|
||||
</template>
|
||||
<div class="normal" style="padding: 15px 0">
|
||||
|
@ -241,7 +241,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="right.radioType === 'dzsx'">
|
||||
<!-- <div v-if="right.radioType === 'dzsx'">
|
||||
<div>
|
||||
<a-collapse>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</ModuleWrapper>
|
||||
|
@ -310,7 +310,20 @@
|
|||
:destroyOnClose="true"
|
||||
@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>
|
||||
</Grid>
|
||||
</template>
|
||||
|
@ -427,7 +440,7 @@ export default {
|
|||
medicalInfo: {},
|
||||
ammunition: {},
|
||||
actionList: [],
|
||||
equipmentList: [],
|
||||
// equipmentList: [],
|
||||
},
|
||||
checkedAction: null,
|
||||
},
|
||||
|
@ -446,6 +459,33 @@ export default {
|
|||
},
|
||||
actionModal: {
|
||||
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: '蓝方',
|
||||
selectable: false,
|
||||
children: [
|
||||
{ id: '2-1', name: '作战力量', selectable: false, children: res.data.red.fight },
|
||||
{ id: '2-2', name: '保障力量', selectable: false, children: res.data.red.guarantee },
|
||||
{ id: '2-3', name: '指挥力量', selectable: false, children: res.data.red.command },
|
||||
{ id: '2-1', name: '作战力量', selectable: false, children: res.data.blue.fight },
|
||||
{ id: '2-2', name: '保障力量', selectable: false, children: res.data.blue.guarantee },
|
||||
{ id: '2-3', name: '指挥力量', selectable: false, children: res.data.blue.command },
|
||||
],
|
||||
},
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue
Block a user