Commit a6b11124 by lichengming

修改了项目进度显示

parent 6f6b44e3
...@@ -74,8 +74,6 @@ export default { ...@@ -74,8 +74,6 @@ export default {
// 右侧的连接线 // 右侧的连接线
endValue() { endValue() {
// 最后一个节点数据 // 最后一个节点数据
console.log('右侧连接线', this.list)
console.log('右侧连接线', this.endList)
// const current_value = this.list[2].value // const current_value = this.list[2].value
const currentValue = this.list[2].value const currentValue = this.list[2].value
const endValue = this.endList[0].value const endValue = this.endList[0].value
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<li> <li>
<div class="title">委托日期</div> <div class="title">委托日期</div>
<div class="cont"> <div class="cont">
{{$dateformat(itemInfo.entrustVO.entrustDate)}} {{$dateformat(itemInfo.entrustVO.entrustDate,'yyyy-mm-dd HH:MM:ss')}}
</div> </div>
</li> </li>
<li> <li>
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
</Col> </Col>
<!--样品进度信息--> <!--样品进度信息-->
<Col span="18"> <Col span="18">
<flowIndex></flowIndex> <flowIndex :listInfo = itemInfo.data></flowIndex>
</Col> </Col>
</Row> </Row>
</div> </div>
......
...@@ -68,12 +68,16 @@ export default { ...@@ -68,12 +68,16 @@ export default {
FlowBranch, FlowBranch,
Legend Legend
}, },
props: {
// 数据源
listInfo: null
},
data() { data() {
return { return {
list: { list: {
start: [ start: [
{ name: '收样', key: 'key1' }, { name: '收样', key: 'receiveSample' },
{ name: '任务评审', key: 'key2' }, { name: '任务评审', key: 'review' },
{ name: '开土', key: 'key3' } { name: '开土', key: 'key3' }
], ],
branch: [ branch: [
...@@ -101,7 +105,8 @@ export default { ...@@ -101,7 +105,8 @@ export default {
] ]
}, },
// 构造数据源 // 构造数据源
obj: {} obj: [],
nodeObj: {}
} }
}, },
mounted() { mounted() {
...@@ -109,27 +114,33 @@ export default { ...@@ -109,27 +114,33 @@ export default {
}, },
methods: { methods: {
getData() { getData() {
if (this.listInfo) {
this.obj = this.listInfo
}
for (let j = 0; j < this.obj.length; j++) {
Object.assign(this.nodeObj, this.obj[j])
}
// 1.后台返回的数据,需要流转的全部节点数据(前后盾自己定义,对应上即可) // 1.后台返回的数据,需要流转的全部节点数据(前后盾自己定义,对应上即可)
// key:bool (已经流转的节点为true,待流转的节点为false) // key:bool (已经流转的节点为true,待流转的节点为false)
this.obj = { // this.obj = {
key1: true, // key1: true,
key2: true, // key2: true,
key3: true, // key3: true,
key4: true, // key4: true,
key5: true, // key5: true,
key6: undefined, // key6: undefined,
// key7: true, // key7: true,
// key8: true, // key8: true,
// key9: true, // key9: true,
// key10: false, // key10: false,
// key11: false, // key11: false,
// key12: false, // key12: false,
key13: true, // key13: true,
key14: false, // key14: false,
key15: false, // key15: false,
key16: false, // key16: false,
key20: '20%' // key20: '20%'
} // }
// 2.前端进行过组合数据 // 2.前端进行过组合数据
const startArray = this.list.start const startArray = this.list.start
const branchArray = this.list.branch.flat() // 将一个二维数组拉平 const branchArray = this.list.branch.flat() // 将一个二维数组拉平
...@@ -137,17 +148,11 @@ export default { ...@@ -137,17 +148,11 @@ export default {
const allArray = startArray.concat(branchArray, endArray) const allArray = startArray.concat(branchArray, endArray)
for (let i = 0; i < allArray.length; i++) { for (let i = 0; i < allArray.length; i++) {
const key = allArray[i].key const key = allArray[i].key
this.$set(allArray[i], 'value', this.obj[key]) this.$set(allArray[i], 'value', this.nodeObj[key])
if (allArray[i].key === 'key8') {
this.$set(allArray[i], 'per', this.obj.key20)
}
} }
console.log('allArray', allArray)
console.log('this.list', this.list)
}, },
// 上面连接线颜色 // 上面连接线颜色
upLineClassObj() { upLineClassObj() {
console.log('右侧线')
const valueZero = this.list.end[0].value const valueZero = this.list.end[0].value
const upValue = this.list.branch[0][2].value const upValue = this.list.branch[0][2].value
const upValueZero = this.list.branch[0][0].value const upValueZero = this.list.branch[0][0].value
......
...@@ -56,9 +56,9 @@ ...@@ -56,9 +56,9 @@
<!-- <Col span="12">--> <!-- <Col span="12">-->
<!-- <CustomerContract></CustomerContract>--> <!-- <CustomerContract></CustomerContract>-->
<!-- </Col>--> <!-- </Col>-->
<!-- <Col span="24">--> <Col span="24">
<!-- <ItemFlow></ItemFlow>--> <ItemFlow></ItemFlow>
<!-- </Col>--> </Col>
<div :style="{height}" v-if="moduleList.length" class="config_home"> <div :style="{height}" v-if="moduleList.length" class="config_home">
<Row :gutter="10"> <Row :gutter="10">
<Col <Col
......
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