|
|
@ -1,9 +1,15 @@ |
|
|
|
<template> |
|
|
|
<!-- 任务名插件 --> |
|
|
|
<view>{{ task.name }}</view> |
|
|
|
<!-- <view>{{ task.name }}</view> --> |
|
|
|
<view class="flex justify-between items-center" @click="postMsg(param)"> |
|
|
|
<view class="flex-1">{{ task.name }}</view> |
|
|
|
<img style="height: 16px" src="https://www.tall.wiki/staticrec/photos/right.png" /> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { mapGetters } from 'vuex'; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'p-task-title', |
|
|
|
props: { |
|
|
@ -11,6 +17,31 @@ export default { |
|
|
|
type: Object, |
|
|
|
default: () => {}, |
|
|
|
}, |
|
|
|
param: { type: String, default: '' }, |
|
|
|
}, |
|
|
|
|
|
|
|
computed: { |
|
|
|
...mapGetters('user', ['userId']), |
|
|
|
...mapGetters('project', ['projectId']), |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
// 发送消息 PC端打开详情页 |
|
|
|
postMsg(param) { |
|
|
|
/* #ifdef H5 */ |
|
|
|
if (param) { |
|
|
|
const data = JSON.parse(param); |
|
|
|
if (data && data.url) { |
|
|
|
const url = `${data.url}?u=${this.userId}&p=${this.projectId}&t=${this.task.id}`; |
|
|
|
const msg = { |
|
|
|
event: 'openDetail', |
|
|
|
data: url, |
|
|
|
}; |
|
|
|
top.postMessage(msg, '*'); |
|
|
|
} |
|
|
|
} |
|
|
|
/* #endif */ |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|