Commit ab0ba506 authored by ztf's avatar ztf

修改项目要素左侧树组件

parent f373cea4
......@@ -60,41 +60,8 @@ export default {
}
},
mounted() {
this.getTypeDictionaries()
},
methods: {
async getTypeDictionaries(value) {
const params = {
'pageFrom': 1,
'pageSize': 9999,
'searchItems': {
'items': [
{
'fieldName': 'dictState',
'operator': 'EQ',
'value': 'ENABLE'
},
{
'fieldName': 'dictCode',
'operator': 'EQ',
'value': 'DesignPhase' // ApplicantType
}
]
},
'sortItem': [
{
'fieldName': 'dictSeq',
'sortOrder': 'asc'
}
]
}
await post('/DictData/search', params).then(res => {
if (res.code === 0) {
console.log('测试接口数据', res.items)
}
})
},
async getOrganization() {
const params = {
'items': [],
......
......@@ -36,8 +36,11 @@ export default {
},
watch: {
basicData(val) {
console.log('val', val)
// 监听传进来的数据,如果是项目的话都展示
// 如果是子项的话只能看到支出合同
// 可以通过传进来的id,调用接口,获取到该项目的详情,通过详情得知是项目还是子项
// 进行判断,以及这个的显示与隐藏
}
}
......@@ -47,6 +50,6 @@ export default {
<style lang="scss" scoped>
.content{
height: calc(100vh - 100px);
height: calc(100vh - 200px);
}
</style>
<!--
* @Author: zhangtianfeng 3232807530@qq.com
* @Date: 2024-09-02 11:34:39
* @LastEditors: zhangtianfeng 3232807530@qq.com
* @LastEditTime: 2024-09-05 14:43:50
-->
<template>
<div class="link" @click="ToRelatedPage">{{ currentValue }}</div>
</template>
......@@ -47,9 +53,10 @@ export default {
const name = this.form.name
const id = this.form.id
const pageNumber = '7cbdc38f-0122-4e78-b162-57601a33bb7a'
const title = '项目要素'
this.$router.push({
path: `/page/${pageNumber}/${id}/?id=${id}&title=${name}`,
query: { title: name + '详情', id: id }
path: `/page/${pageNumber}/${id}?title=${title}&id=${id}&name=${name}`,
query: { name: name + '详情', id: id }
})
}
}
......
......@@ -4,7 +4,10 @@
<!-- <el-tooltip effect="dark" :content="projectTitle" placement="bottom" :disabled="!isShowTooltip">
<div ref="name" class="title ellipsis" @mouseover="onMouseOver">{{ projectTitle }}</div>
</el-tooltip> -->
<div ref="name" class="title ellipsis" :title="isShowTooltip?projectTitle:''" @mouseover="onMouseOver">{{ projectTitle }}</div>
<!-- <div class="sub-title">
项目要素
</div> -->
<div ref="name" class="title ellipsis" :title="isShowTooltip?projectTitle:''" @mouseover="onMouseOver" @click="handleClickTitle">{{ projectTitle }}</div>
<el-tree
ref="tree"
class="PlanTreeMenu-main"
......@@ -56,8 +59,16 @@ export default {
treeData: [],
isEdit: false,
basicData: null,
projectTitle: `${this.$route.query.projectCode} - ${this.$route.query.title}`,
isShowTooltip: false
projectTitle: `${this.$route.query.projectCode} - ${this.$route.query.name}`,
isShowTooltip: false,
planDetail: {
name: this.projectTitle,
disabled: false,
planId: this.$route.query.id,
componentType: 'formConfig',
formConfigType: 'page',
pageKey: '1cab3884-adf2-4b58-acab-2b3d50df78e3'
}
}
},
computed: {
......@@ -66,7 +77,6 @@ export default {
},
mounted() {
this.initTreeData()
console.log('this.$route.query', this.$route.query)
},
methods: {
onMouseOver() {
......@@ -74,75 +84,24 @@ export default {
this.isShowTooltip = el.clientWidth < el.scrollWidth
},
// 判断是否显示按钮`
initTreeData(val, planTaskNodes) {
// getPlanTree(this.$route.query.id).then(res => {
// let plans = []
// if (Array.isArray(res.items) && res.items.length > 0) {
// plans = res.items.map(r => {
// r.componentType = 'customComponent'
// r.componentName = 'TaskGantt'
// return r
// })
// }
const planNode = {
disabled: false,
name: '计划',
// planId: this.$route.query.id,
// componentType: 'customComponent',
// componentName: 'TaskGantt',
icon: '/icons/dee-project/plan.png',
// subTypeName: 'DxProjectItem'
componentType: 'formConfig',
formConfigType: 'page',
pageKey: '22c90a9f-0907-49ea-8f8d-d5234e93e0e6',
// children: plans
children: [{
name: '采购',
planId: this.$route.query.id,
icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig',
formConfigType: 'page',
pageKey: 'a5728005-cd38-4568-bc63-8888fd7e5b5a'
},
{
name: 'IED',
planId: this.$route.query.id,
icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig',
formConfigType: 'page',
pageKey: 'd4e791a9-57bf-477c-b760-53bdc351bc7f'
},
{
name: 'ICM',
planId: this.$route.query.id,
icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig',
formConfigType: 'page',
pageKey: 'fe0b5925-0b7f-42bd-adbc-8ecb738013a0'
}]
}
const treeData = [planNode].concat(this.projectMenus)
this.treeData = treeData
// plans.length && this.nodeClick(plans[0])
// })
initTreeData() {
this.treeData = this.projectMenus
this.nodeClick(this.planDetail)
},
completeEven() {
this.initTreeData()
},
nodeClick(data) {
// console.log('nodeClick', data) this.$emit('nodeClick', data)
// if (data.name !== '计划') {
this.$emit('nodeClick', data)
// console.log('data', data)
// }
},
handleClickTitle() {
this.nodeClick(this.planDetail)
}
}
}
</script>
<style lang="scss">
<style lang="scss" scoped>
.PlanTreeMenu{
height: 100%;
box-sizing: border-box;
......@@ -289,6 +248,9 @@ export default {
}
}
}
.sub-title{
padding: 25px 0 0 15px;
}
.disabled-node {
opacity: .5;
}
......
......@@ -2,15 +2,55 @@
* @Author: zhangtianfeng 3232807530@qq.com
* @Date: 2024-09-02 09:44:58
* @LastEditors: zhangtianfeng 3232807530@qq.com
* @LastEditTime: 2024-09-03 16:06:05
* @FilePath: \inet-two\applications\dee-project\src\privateComponents\components\leftProjectTree\view.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @LastEditTime: 2024-09-05 11:39:18
*/
export default {
props: {},
data() {
return {
projectMenus: [
{
disabled: false,
name: '计划',
planId: this.$route.query.id,
icon: '/icons/dee-project/plan.png',
componentType: 'formConfig',
formConfigType: 'page',
pageKey: '22c90a9f-0907-49ea-8f8d-d5234e93e0e6',
children: [
{
name: '进度计划',
planId: this.$route.query.id,
icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig',
formConfigType: 'page',
pageKey: '22c90a9f-0907-49ea-8f8d-d5234e93e0e6'
},
{
name: '采购计划',
planId: this.$route.query.id,
icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig',
formConfigType: 'page',
pageKey: 'a5728005-cd38-4568-bc63-8888fd7e5b5a'
},
{
name: 'IED计划',
planId: this.$route.query.id,
icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig',
formConfigType: 'page',
pageKey: 'd4e791a9-57bf-477c-b760-53bdc351bc7f'
},
{
name: '接口计划',
planId: this.$route.query.id,
icon: '/icons/dee-project/baseline.png',
componentType: 'formConfig',
formConfigType: 'page',
pageKey: 'fe0b5925-0b7f-42bd-adbc-8ecb738013a0'
}]
},
{
name: '资源',
planId: this.$route.query.id,
......
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