Commit bf4b4505 authored by “lixuyan”'s avatar “lixuyan”

修改指令标识页面

parent 515f4382
<template>
<section>
<div v-if="!show" class="from">
<div class="icon-wrap"><i class="icon" /> <span>搜索</span></div>
<el-form ref="ruleForm" :model="form" label-width="95px">
<el-form-item label="机型" prop="model">
<el-select v-model="form.model" clearable class="input-with-select el-input--small">
<el-option
v-for="item in dataModel"
:key="item.id"
:label="item.defName"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="架次" prop="sortie">
<el-select v-model="form.sortie" clearable class="input-with-select el-input--small" :loading="sortiesLoading">
<el-option
v-for="item in dataSortie"
:key="item.id"
:label="item.defName"
:value="item.id"
/>
</el-select>
</el-form-item>
<!-- <el-form-item v-if="labelShow()" label="AO(号/名称)" prop="aoName">
<el-input v-model="form.aoName" clearable class="input-with-select el-input--small" @change="searchAoname" />
</el-form-item> -->
<p class="btn">
<el-button size="small" type="primary" @click="searchForm">查询</el-button>
<el-button size="small" @click="resetForm('ruleForm')">重置</el-button>
</p>
</el-form>
</div>
</section>
</template>
<script>
export default {
name: 'Left',
props: {
show: {
type: Boolean,
default: null
},
dataModel: {
type: Array,
default: () => {
return []
}
}
},
data() {
return {
form: {
model: '',
modelName: '',
sortie: '',
sortieName: '',
aoName: ''
},
sortiesLoading: true,
dataSortie: [],
isCollapse: false
}
},
watch: {
dataModel(newV) {
if (newV.length <= 0) return
this.$nextTick(() => {
this.form.model = newV[0].id
this.form.modelName = newV[0].defName
this.getAddRecursion()
})
},
'form.model': {
immediate: true,
handler(val) {
if (!val) {
return
}
const model = this.dataModel.find((r) => r.id === val)
this.$set(this.form, 'modelName', (model && model.defName) || '')
this.getAddRecursion()
}
},
'form.sortie': {
immediate: true,
handler(val) {
if (!val) {
return
}
const sorties = this.dataSortie.find((r) => r.id === val)
this.$set(this.form, 'sortieName', (sorties && sorties.defName) || '')
}
}
},
mounted() {
this.getAddRecursion()
},
methods: {
labelShow() {
if (this.$parent.$parent &&
this.$parent.$parent.name === 'right' &&
this.$parent.$parent.isActive === 'ag') {
return false
} else {
return true
}
},
searchForm() {
this.$parent.$children
.filter(function(item) {
return item.name === 'tree'
})[0]
.getTreeData(this.form)
},
searchAoname() {
const that = this
if (that.$parent.$parent.name === 'right') {
that.$parent.$parent.getTableData()
} else {
this.searchForm()
}
},
/**
* 获取架次数据
*/
getAddRecursion() {
this.sortiesLoading = true
const params = { searchItems: { items: [{ fieldName: 'aircraftTypeId', operator: 'EQ', value: this.form.model }] }, sortItem: [{ fieldName: 'modifyTime', sortOrder: 'asc' }] }
params.openProps = [{ name: 'aircraftType' }]
this.$api
.searchApi('AircraftSorties', params)
.then((res) => {
this.dataSortie = []
if (res) {
this.dataSortie = res && res.items && res.items.content
this.$nextTick(() => {
if (this.dataSortie.length) {
this.form.sortie = this.dataSortie[0].id
this.form.sortieName = this.dataSortie[0].defName
this.searchForm()
}
})
} else {
this.$message({
showClose: true,
message: res.message,
type: 'error'
})
}
})
.catch((err) => console.log(err))
.finally(() => {
this.$nextTick(() => {
this.sortiesLoading = false
})
})
},
resetForm() {
if (this.dataModel.length) {
this.form.model = this.dataModel[0].id
this.getAddRecursion()
}
this.form.aoName = null
}
}
}
</script>
<style lang="scss" >
.from {
border: 1px solid #ccc;
padding: 20px 20px 5px 20px;
border-radius: 5px;
box-sizing: border-box;
.icon-collapse {
display: inline-block;
width: 21px;
height: 21px;
background-size: contain;
cursor: pointer;
position: absolute;
z-index: 10;
top: 20px;
right: 20px;
}
.tobottom {
background: url("/icons/tobottom.png") no-repeat;
}
.totop {
background: url("/icons/totop.png") no-repeat;
}
.icon-wrap {
margin-bottom: 10px;
position: relative;
.icon {
display: inline-block;
width: 21px;
height: 21px;
background: url("/icons/r-access.png") no-repeat;
background-size: contain;
vertical-align: middle;
}
span {
vertical-align: middle;
// font-size: 12px;
}
}
.btn {
text-align: center;
}
.el-form-item {
margin-bottom: 8px;
}
}
/deep/.el-input {
height: 32px;
}
/deep/.el-button {
border-radius: 5px;
padding: 12px 30px;
}
</style>
<template>
<section class="single-mbom-left" :class="{ collapse: isCollapse }">
<div class="left-menu">
<searchForm
ref="searchForm"
:show="isCollapse"
:data-model="searchData.model"
/>
<!-- <i
class="iconTo"
:class="[isCollapse ? 'toright' : 'toleft']"
@click="handleCollapse"
/> -->
<tree
ref="tree"
class="tree"
:is-collapse="isCollapse"
/>
</div>
</section>
</template>
<script>
import searchForm from './form'
import tree from './tree'
export default {
components: {
searchForm,
tree
},
props: {
searchData: {
type: Object,
default: () => {
return {
model: []
}
}
}
},
data() {
return {
isCollapse: false
}
},
computed: {},
mounted() { },
created() {},
methods: {
// handleCollapse() {
// this.isCollapse = !this.isCollapse
// this.$emit('handleCollapse', this.isCollapse)
// }
}
}
</script>
<style lang="scss" >
.single-mbom-left {
height: 100%;
// width: 320px;
.left-menu {
position: relative;
display: flex;
flex-direction: column;
height: 100%;
.iconTo {
display: block;
width: 18px;
height: 21px;
background-size: contain;
cursor: pointer;
position: absolute;
top: 292px;
}
// .toleft {
// background: url("/icons/toleft.png") no-repeat;
// right: -18px;
// }
// .toright {
// background: url("/icons/toright.png") no-repeat;
// left: -10px;
// }
}
p {
text-align: right;
.b-packup {
display: inline-block;
width: 21px;
height: 21px;
background: url("/icons/b-packup.png") no-repeat;
background-size: contain;
cursor: pointer;
}
}
&.collapse {
width: 0px;
}
}
</style>
<template>
<section v-show="!isCollapse" class="left-tree">
<el-tree
ref="tree"
class="tree"
:data="treeData"
default-expand-all
node-key="id"
:current-node-key="currentNodekey"
:props="defaultProps"
:highlight-current="true"
:expand-on-click-node="false"
@node-click="handleNodeClick"
>
<span
slot-scope="{ data }"
class="custom-tree-node"
:class="[{ 'is-leaff': data.isLeaf }, { 'is-curr': data.id == curId }]"
>
<span class="tree-row">
<i :class="data.icon" />
<span class="label">{{ data.title }}</span>
<!-- <span>{{
"(" + data.quantity + "/" + data.total + ")"
}}</span> -->
</span>
</span>
</el-tree>
</section>
</template>
<script>
// import { post } from '@/utils/http'
import $ from 'jquery'
export default {
name: 'Tree',
props: {
isCollapse: {
type: Boolean,
default: null
}
},
data() {
return {
// 组件唯一标识
name: 'tree',
treeData: [],
rowData: {},
curId: null,
// 判断当前组件处于指令标识还是Mbom
isMbom: false,
curNodeTitle: null,
assembly: null,
defaultProps: {
children: 'children',
label: 'label'
},
curTree: {},
currentNodekey: ''
}
},
mounted() {
this.$bus.$on('getPositionData', () => {
this.getTreeData()
})
// const that = this
// if (that.$parent.$parent.name === 'right') {
// that.assembly = that.$parent.$parent.$parent.$parent
// that.isMbom = true
// } else {
// that.assembly = that.$parent.$parent.$children.filter(function(item) {
// return item.name === 'right'
// })[0]
// }
},
methods: {
handleNodeClick(data, node, event) {
if (!data || !data.id) return
this.$bus.$emit('getPlanData', data, node ? node.level : data.level)
},
/**
* 高亮状态
*/
highlightTreeRow() {
if (this.isMbom) {
this.$nextTick(() => {
if (
this.assembly.isActive === 'ag' ||
this.assembly.isActive === 'ins'
) {
$('.el-tree-node__content').each((index, ele) => {
$(ele).removeClass('disabled')
$(ele).removeClass('is-curr')
if ($(ele).find('.is-leaff').length) {
$(ele).addClass('hhover')
} else {
$(ele).addClass('disabled')
}
if ($(ele).find('.is-curr').length) {
$(ele).addClass('is-curr')
}
})
} else {
$('.el-tree-node__content').each((index, ele) => {
$(ele).removeClass('disabled')
$(ele).removeClass('is-curr')
if ($(ele).find('.is-leaff').length) {
$(ele).addClass('disabled')
} else {
$(ele).addClass('hhover')
}
if ($(ele).find('.is-curr').length) {
$(ele).addClass('is-curr')
}
})
}
})
} else {
this.$nextTick(() => {
$('.el-tree-node__content').each((index, ele) => {
$(ele).removeClass('disabled')
$(ele).removeClass('is-curr')
if ($(ele).find('.is-leaff').length) {
$(ele).addClass('disabled')
} else {
$(ele).addClass('hhover')
}
if ($(ele).find('.is-curr').length) {
$(ele).addClass('is-curr')
}
})
})
}
},
statuwMbom(id) {
if (id) {
this.curId = id
}
const that = this
if (that.isMbom) {
if (this.assembly.isActive === 'ass') {
this.handleNodeClick(that.data[0].children[0], this.froms.aoName)
} else {
this.handleNodeClick(that.data[0], this.froms.aoName)
}
}
this.highlightTreeRow()
},
/**
* 获取树结构数据
*/
getTreeData(froms) {
// var that = this
if (froms) {
this.froms = froms
}
const params = {
pageFrom: 1,
pageSize: 9999,
searchItems: {
children: [
{
items: [
{
fieldName: 'aircraftSorties.id', // 架次ID
operator: 'EQ',
value: this.froms.sortie
}
],
operator: 'AND'
}
],
items: [],
operator: 'AND'
},
openProps: [],
sortItem: [
{
fieldName: 'serialNumber',
sortOrder: 'desc'
}
]
}
this.$api
.searchApi('ExtPosition', params).then((res) => {
// let quantity = 0
// let total = 0
const data = [{
title: this.froms.modelName + '-' + this.froms.sortieName,
icon: 'aircraft',
id: this.froms.sortie,
serialNo: this.froms.sortieName,
isLeaf: true,
disabled: true,
level: 1,
children: res.items.content.map((t) => {
// quantity += t.completeCount
// total += t.carryCount
return {
serialNo: this.froms.sortieName,
title: t.serialNumber,
icon: 'c-backups3',
id: t.id
// quantity: t.completeCount,
// total: t.carryCount
}
})
// quantity: quantity,
// total: total
}]
this.treeData = data
this.handleNodeClick(data[0])
this.currentNodekey = data[0].id
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.currentNodekey)
})
})
.catch((err) => console.error(err))
.finally(() => {})
}
}
}
</script>
<style lang="scss" >
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-thumb {
border-radius: 100px;
background: #dcdfe6;
}
.left-tree {
margin-top: 20px;
border: 1px solid #ccc;
padding: 20px;
border-radius: 5px;
box-sizing: border-box;
flex-grow: 1;
overflow: auto;
> .tree {
//当前选中项
&.el-tree--highlight-current .el-tree-node__content {
&.disabled {
color: #c0c4cc;
cursor: not-allowed;
background-color: #fff;
}
&.is-curr:not(.disabled),
&:hover:not(.disabled) {
font-weight: bold;
color: rgb(31, 30, 30);
background-color: rgb(214, 214, 214);
}
}
.el-tree-node {
// margin: 20px 0 !important;
.el-tree-node__content {
height: 40px !important;
// &:hover {
// font-weight: bold;
// color: #000;
// }
i {
display: inline-block;
vertical-align: middle;
margin: 10px;
}
.aircraft {
background: url("/icons/aircraft.png") no-repeat;
width: 32px;
height: 30px;
}
.c-backups3 {
width: 21px;
height: 21px;
background: url("/icons/u513.png") no-repeat;
background-size: contain;
}
.label {
vertical-align: middle;
}
}
}
}
overflow: hidden;
&:hover {
overflow: auto;
}
}
// .sidebar-container.sidebar-container{
// display: none;
// }
</style>
<template>
<section v-loading="instructionIdentificationShow" class="instruction-identification">
<dee-fold-pane :min-percent="18" :default-percent="18" split="vertical" class="detail-pane">
<template slot="paneL">
<div class="left">
<left
ref="left"
:search-data="searchData"
@handleTreeClick="handleTreeClick"
/>
</div>
</template>
<template slot="paneR">
<div class="right">
<right ref="right" />
</div>
</template>
</dee-fold-pane>
</section>
</template>
<script>
import left from './components/left/index'
import right from './components/right/index'
export default {
components: {
left,
right
},
data() {
return {
title: '',
instructionIdentificationShow: false,
jurisdId: null,
searchData: {
model: []
}
}
},
mounted() {
this.getModelData()
},
created() { },
methods: {
/**
* 获取机型数据
*/
getModelData() {
console.log(5555)
const param = { searchItems: { items: [{ fieldName: 'id', operator: 'NEQ', value: 0 }] }, sortItem: [{ fieldName: 'modifyTime', sortOrder: 'asc' }] }
this.$api
.searchApi('AircraftType', param)
.then((res) => {
if (res && res.items && res.items.content) {
this.searchData.model = res.items.content
} else {
this.$message({
showClose: true,
message: '机型数据获取失败!',
type: 'error'
})
}
})
.catch((err) => console.log(err))
.finally(() => { })
},
open(v) {
this.dialogCmp = {
typeName: 'RequestOutStorageOut',
typeKey: '34fcf9f2-0ae6-47bb-920c-7c625d3e0937'
}
// this.$refs.dialog.open()
},
handleTreeClick(v) {
this.title = v.label
},
handleCollapse(v) {
}
}
}
</script>
<style lang="scss" >
.instruction-identification {
display: flex;
height: 100%;
background: #fff;
.detail-pane{
width: 100%;
.left{
height: 100%;
overflow-x: hidden;
}
.right {
height: 100%;
.table {
margin-top: 0;
}
}
}
}
</style>
......@@ -23,9 +23,9 @@
/>
</el-select>
</el-form-item>
<el-form-item v-if="labelShow()" label="AO(号/名称)" prop="aoName">
<!-- <el-form-item v-if="labelShow()" label="AO(号/名称)" prop="aoName">
<el-input v-model="form.aoName" clearable class="input-with-select el-input--small" @change="searchAoname" />
</el-form-item>
</el-form-item> -->
<p class="btn">
<el-button size="small" type="primary" @click="searchForm">查询</el-button>
<el-button size="small" @click="resetForm('ruleForm')">重置</el-button>
......
......@@ -95,7 +95,7 @@
prop="countWorkHour"
align="center"
label="定额工时(min)"
:width="140"
:width="150"
>
<template slot="header">
<span>定额工时(min)</span>
......@@ -314,10 +314,6 @@ export default {
async getDicListByCode() {
this.stateOption = await this.$utils.getDicListByCode('ObjStatus')
},
getRefreshData() {
console.log(5454)
this.getTableData(this.nodeData, this.level)
},
/**
* 工具栏
*/
......@@ -625,7 +621,7 @@ export default {
]
}
if (level === 2) {
params.searchItems.items.push(
params.searchItems.children[0].items.push(
{
fieldName: 'positionNumber',
operator: 'EQ',
......@@ -760,7 +756,7 @@ export default {
this.tablePagination.currentPage = 1
this.tablePagination.pageSize = $event
}
this.getTableData()
this.getTableData(this.nodeData, this.level)
},
/**
* 关闭
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment