diff --git a/package.json b/package.json
index 497e69a..bef7909 100644
--- a/package.json
+++ b/package.json
@@ -39,6 +39,7 @@
"vue-cropper": "0.4.9",
"vue-i18n": "^8.27.1",
"vue-quill-editor": "^3.0.6",
+ "vue-resize-directive": "^1.2.0",
"vue-router": "^3.5.3",
"vue-svg-component-runtime": "^1.0.1",
"vuex": "^3.6.2",
diff --git a/src/components/Common/Layout/AntFormModal.vue b/src/components/Common/Layout/AntFormModal.vue
new file mode 100644
index 0000000..2e88875
--- /dev/null
+++ b/src/components/Common/Layout/AntFormModal.vue
@@ -0,0 +1,86 @@
+
+
+
+
+
+ {{ item.customRender(formData[item.prop], formData) }}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Common/Layout/AntQueryTable.vue b/src/components/Common/Layout/AntQueryTable.vue
new file mode 100644
index 0000000..c550204
--- /dev/null
+++ b/src/components/Common/Layout/AntQueryTable.vue
@@ -0,0 +1,516 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 重置
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ config.title }}
+
+
+ {{ config.explain }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Common/Layout/defaultSettings.js b/src/components/Common/Layout/defaultSettings.js
new file mode 100644
index 0000000..9cefdec
--- /dev/null
+++ b/src/components/Common/Layout/defaultSettings.js
@@ -0,0 +1,25 @@
+export const defaultUserColumns = [
+ { title: '创建时间', dataIndex: 'createTime', type: 'date', format: 'YYYY-MM-DD HH:mm:ss' },
+ { title: '创建人', dataIndex: 'createUserName', width: 130, align: 'center' },
+ { title: '更新时间', dataIndex: 'updateTime', type: 'date', format: 'YYYY-MM-DD HH:mm:ss' },
+ { title: '更新人', dataIndex: 'updateUserName', width: 130, align: 'center' },
+]
+export const tabletitleSlotPrefix = 'tabletitle-'
+export const tablecellSlotPrefix = 'tablecell-'
+export const defaultTableCellWidth = 168
+// 滚动条的大小需要与样式表中保持一致
+// 当前样式详见@/style/antd.less#@table-scroll-size
+export const defaultTableScrollSize = 8
+export const defaultTableConfig = {
+ bordered: true,
+ rowKey: 'id',
+}
+
+export const actionSlotName = 'action'
+
+export const defaultPageSize = 10
+export const defaultPageConfig = {
+ showTotal: total => `共 ${total} 条`,
+ showSizeChanger: true,
+ pageSizeOptions: ['5', '10', '20', '50'],
+}
diff --git a/src/components/Common/register.js b/src/components/Common/register.js
index 9fc907d..fcee2b4 100644
--- a/src/components/Common/register.js
+++ b/src/components/Common/register.js
@@ -1,6 +1,8 @@
import ModuleWrapper from './Layout/ModuleWrapper.vue'
import Flex from './Layout/Flex.vue'
import Grid from './Layout/Grid.vue'
+import AntFormModal from './Layout/AntFormModal.vue'
+import AntQueryTable from './Layout/AntQueryTable.vue'
import AntOriginSelect from './Form/AntOriginSelect.vue'
import AntOriginTreeSelect from './Form/AntOriginTreeSelect.vue'
@@ -9,6 +11,7 @@ import DurationPicker from './Form/DurationPicker.vue'
import WangEditor from './WangEditor/Index.vue'
import Loading from './Directives/Loading'
+import resize from 'vue-resize-directive'
import Bus from './Bus/index'
import MyCesium from './Cesium/index'
@@ -19,6 +22,8 @@ export default {
Vue.component('ModuleWrapper', ModuleWrapper)
Vue.component('Flex', Flex)
Vue.component('Grid', Grid)
+ Vue.component('AntFormModal', AntFormModal)
+ Vue.component('AntQueryTable', AntQueryTable)
Vue.component('AntOriginSelect', AntOriginSelect)
Vue.component('AntOriginTreeSelect', AntOriginTreeSelect)
@@ -27,6 +32,7 @@ export default {
Vue.component('WangEditor', WangEditor)
Vue.directive('loading', Loading)
+ Vue.directive('resize', resize)
window.$bus = Bus
window.MyCesium = MyCesium
diff --git a/src/components/GlobalHeader/RightContent.vue b/src/components/GlobalHeader/RightContent.vue
index 1aea050..5560926 100644
--- a/src/components/GlobalHeader/RightContent.vue
+++ b/src/components/GlobalHeader/RightContent.vue
@@ -1,19 +1,19 @@
-
+
diff --git a/src/views/simulationScene/database/zzllsjk.vue b/src/views/simulationScene/database/zzllsjk.vue
index c431d75..70bcc99 100644
--- a/src/views/simulationScene/database/zzllsjk.vue
+++ b/src/views/simulationScene/database/zzllsjk.vue
@@ -1,87 +1,121 @@
-
-
-
-
-
-
-
-
-
-
- 人员
- 装备
-
-
-
-
- 查询
- 重置
-
-
-
- 新建
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+ {{ title }}
+
+
+
+
+
+
+
+
+
+ 新增
+
+
+
+
+
+
+
+
+
+
+
+ 新增
+
+
+
+
+
+
+
+
- this.handleClose()"
- @ok="() => this.handleOk()"
- switch-fullscreen
- :fullscreen.sync="AEModal.fullscreen"
- >
-
-
-
- {{ item.customRender(AEModal.form[item.prop]) }}
-
-
-
-
-
+
+
+
@@ -90,143 +124,171 @@ export default {
name: 'Zzllsjk',
data() {
return {
- zzTree: [],
- selectedKeys: [],
-
- queryParam: { id: '', type: 'staff' },
- staffColumns: [
- {
- 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' },
- },
- ],
- weaponColumns: [
- {
- title: '#',
- dataIndex: 'index',
- customRender: (_, record, $index) => $index + 1,
- align: 'center',
- width: 80,
- },
- {
- title: '装备名称',
- dataIndex: 'name',
- },
- {
- title: '装备数量',
- dataIndex: 'number',
- },
- {
- title: '操作',
- width: 140,
- dataIndex: 'action',
- align: 'center',
- scopedSlots: { customRender: 'action' },
- },
- ],
- loadData: [], // 加载数据方法 必须为 Promise 对象
- loadingTable: false,
-
- AEModal: {
- title: '',
+ layoutRight: 'auto',
+ zzjg: {
+ treeData: [],
+ selectedKeys: [],
+ expandedKeys: [],
+ },
+ zzjgModal: {
visible: false,
- editStatus: false,
- fullscreen: false,
- spinning: false,
- form: {},
- staffRules: {
+ title: '',
+ mode: '',
+ formItems: [
+ {
+ label: '上级组织',
+ prop: 'parentId',
+ component: 'AntOriginTreeSelect',
+ options: {
+ dataSource: () =>
+ this.$http({
+ url: '/tree/organization',
+ method: 'get',
+ params: { unittype: 1 },
+ }).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' }],
+ unittype: [{ required: true, message: '请选择组织类型!', trigger: 'blur' }],
+ },
+ formData: {},
+ },
+
+ zzry: {
+ queryConfig: false,
+ tableConfig: {
+ table: {},
+ immediate: false,
+ query: () =>
+ this.$http({
+ url: `/baseData/fightPowerHierarchy/staff/${this.zzjg.selectedKeys[0]}`,
+ method: 'get',
+ }),
+ columns: [
+ { dataIndex: 'serial' },
+ { title: '岗位', dataIndex: 'name', width: 'auto', minWidth: 150 },
+ { title: '岗位数量', dataIndex: 'number', type: 'number', width: 'auto', minWidth: 150 },
+ { dataIndex: 'action' },
+ ],
+ },
+ pageConfig: false,
+ showTool: false,
+ },
+ zzryModal: {
+ visible: false,
+ title: '',
+ mode: '',
+ formItems: [
+ {
+ label: '岗位名称',
+ prop: 'typeId',
+ component: 'AntOriginSelect',
+ options: {
+ dataSource: () =>
+ this.$http({
+ url: '/unit/getAll',
+ method: 'get',
+ }),
+ labelKey: 'name',
+ readonly: false,
+ },
+ },
+ { label: '岗位数量', prop: 'number' },
+ ],
+ formRules: {
typeId: [{ required: true, message: '请选择岗位!', trigger: 'change' }],
number: [{ required: true, message: '请输入岗位数量!', trigger: 'blur' }],
},
- weaponRules: {
+ formData: {},
+ },
+
+ zzzb: {
+ queryConfig: false,
+ tableConfig: {
+ table: {},
+ immediate: false,
+ query: () =>
+ this.$http({
+ url: `/baseData/fightPowerHierarchy/weapon/${this.zzjg.selectedKeys[0]}`,
+ method: 'get',
+ }),
+ columns: [
+ { dataIndex: 'serial' },
+ { title: '装备名称', dataIndex: 'name', width: 'auto', minWidth: 150 },
+ { title: '装备数量', dataIndex: 'number', type: 'number', width: 'auto', minWidth: 150 },
+ { dataIndex: 'action' },
+ ],
+ },
+ pageConfig: false,
+ showTool: false,
+ },
+ zzzbModal: {
+ visible: false,
+ title: '',
+ mode: '',
+ formItems: [
+ {
+ label: '装备名称',
+ prop: 'weaponId',
+ component: 'AntOriginTreeSelect',
+ options: {
+ dataSource: () =>
+ this.$http({
+ url: '/tree/armament',
+ method: 'get',
+ }),
+ readonly: false,
+ },
+ },
+ { label: '装备数量', prop: 'number' },
+ ],
+ formRules: {
weaponId: [{ required: true, message: '请选择装备!', trigger: 'change' }],
number: [{ required: true, message: '请输入装备数量!', trigger: 'blur' }],
},
- labelCol: { xs: { span: 24 }, sm: { span: 7 } },
- wrapperCol: { xs: { span: 24 }, sm: { span: 13 } },
+ formData: {},
},
}
},
computed: {
- columns() {
- return this[`${this.queryParam.type}Columns`]
+ gridRows() {
+ return {
+ auto: [1, 1],
+ zzry: [1, '56px'],
+ zzzb: ['56px', 1],
+ }[this.layoutRight]
},
- typeMapLabel() {
- return { staff: '人员', weapon: '装备' }[this.queryParam.type]
- },
- formItems() {
- const result = []
- switch (this.queryParam.type) {
- case 'staff':
- result.push(
- {
- label: '岗位名称',
- prop: 'typeId',
- component: 'AntOriginSelect',
+ zzzbFormItems() {
+ return [
+ this.zzzbModal.mode === 'add'
+ ? {
+ label: '装备名称',
+ prop: 'weaponId',
+ component: 'AntOriginTreeSelect',
options: {
dataSource: () =>
this.$http({
- url: '/unit/getAll',
+ url: '/tree/armament',
method: 'get',
}),
- labelKey: 'name',
- readonly: this.AEModal.editStatus,
+ readonly: false,
},
- },
- { label: '岗位数量', prop: 'number' }
- // { label: '物资器材', prop: 'material' }
- )
- break
- case 'weapon':
- result.push(
- this.AEModal.editStatus
- ? {
- label: '装备名称',
- prop: 'name',
- customRender: (v) => v,
- }
- : {
- label: '装备名称',
- prop: 'weaponId',
- component: 'AntOriginTreeSelect',
- options: {
- dataSource: () =>
- this.$http({
- url: '/tree/armament',
- method: 'get',
- }),
- readonly: this.AEModal.editStatus,
- },
- },
- { label: '装备数量', prop: 'number' }
- )
- break
- default:
- break
- }
- return result
+ }
+ : { label: '装备名称', prop: 'name', customRender: (v) => v },
+ { label: '装备数量', prop: 'number' },
+ ]
},
},
created() {
@@ -240,82 +302,116 @@ export default {
method: 'get',
params: { unittype: 1 },
})
- this.zzTree = res.data
- this.selectedKeys = [this.zzTree[0].key]
- this.getList()
+ this.zzjg.treeData = res.data
+ this.zzjg.selectedKeys = [this.zzjg.treeData[0].key]
+ this.handleChangeZzjgSelected()
} catch (error) {
console.log(error)
}
},
- resetList() {
- this.getList()
+ handleChangeZzjgSelected() {
+ this.$refs['zzry-table'].commitAction('reload')
+ this.$refs['zzzb-table'].commitAction('reload')
},
- async getList(parameter = {}) {
+ handleOpenAddZzjgModal(parentId) {
+ this.zzjgModal.title = '新建作战力量'
+ this.zzjgModal.mode = 'add'
+ this.zzjgModal.formData = { unittype: 1, parentId }
+ this.zzjgModal.visible = true
+ },
+ async handleOpenEditZzjgModal(id) {
try {
- this.loadingTable = true
const res = await this.$http({
- url: `/baseData/fightPowerHierarchy/${this.queryParam.type}/${this.selectedKeys[0]}`,
+ url: `/baseData/fightPowerHierarchy/${id}`,
method: 'get',
})
- this.loadData = res.data
- } catch (error) {
- console.log(error)
- } finally {
- this.loadingTable = false
- }
- },
- handleAdd() {
- this.AEModal.form = { parentId: this.selectedKeys[0] }
- 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
+ this.zzjgModal.title = '编辑作战力量'
+ this.zzjgModal.mode = 'edit'
+ this.zzjgModal.formData = res.data
+ this.zzjgModal.visible = true
} catch (error) {
console.log(error)
this.$message.error('未知错误,请重试')
}
},
- handleClose() {
- this.AEModal.visible = false
- this.AEModal.form = {}
+ handleSubmitZzjg(formData) {
+ return this.$http({
+ url: `/baseData/fightPowerHierarchy/save`,
+ method: 'post',
+ data: formData,
+ })
},
- 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)
- }
+ handleSubmitZzjgSuccess() {
+ this.getZzTree()
},
- async handleDelete(record) {
+ async handleDeleteZzjg(id, title) {
try {
+ await this.$confirm({ content: `确定删除作战力量-${title}?` })
await this.$http({
- url: `/baseData/scenario/remove/${record.id}`,
+ url: `/baseData/fightPowerHierarchy/remove/${id}`,
method: 'get',
})
- this.$message.success('删除角色成功')
- this.getList()
- } catch (error) {
- console.log(error)
- this.$message.error('删除角色失败')
- }
+ this.$message.success('删除成功')
+ this.getZzTree()
+ } catch (error) {}
+ },
+
+ handleOpenAddZzryModal() {
+ this.zzryModal.title = '新建组织人员'
+ this.zzryModal.mode = 'add'
+ this.zzryModal.formData = { parentId: this.zzjg.selectedKeys[0] }
+ this.zzryModal.formItems[0].options.readonly = false
+ this.zzryModal.visible = true
+ },
+ handleOpenEditZzryModal(record) {
+ this.zzryModal.title = `编辑组织人员`
+ this.zzryModal.mode = 'edit'
+ this.zzryModal.formData = { ...record }
+ this.zzryModal.formItems[0].options.readonly = true
+ this.zzryModal.visible = true
+ },
+ handleSubmitZzry(formData) {
+ return this.$http({
+ url: `/baseData/fightPowerHierarchy/staff/save`,
+ method: 'post',
+ data: formData,
+ })
+ },
+ handleSubmitZzrySuccess() {
+ this.$refs['zzry-table'].commitAction('query')
+ },
+
+ handleOpenAddZzzbModal() {
+ this.zzzbModal.title = '新建组织装备'
+ this.zzzbModal.mode = 'add'
+ this.zzzbModal.formData = { parentId: this.zzjg.selectedKeys[0] }
+ this.zzzbModal.visible = true
+ },
+ handleOpenEditZzzbModal(record) {
+ this.zzzbModal.title = `编辑组织装备`
+ this.zzzbModal.mode = 'edit'
+ this.zzzbModal.formData = { ...record }
+ this.zzzbModal.visible = true
+ },
+ handleSubmitZzzb(formData) {
+ return this.$http({
+ url: `/baseData/fightPowerHierarchy/weapon/save`,
+ method: 'post',
+ data: formData,
+ })
+ },
+ handleSubmitZzzbSuccess() {
+ this.$refs['zzzb-table'].commitAction('query')
},
},
}
-
+