|
|
@ -4,7 +4,7 @@ |
|
|
|
<view |
|
|
|
class="content" |
|
|
|
style="border-radius: 8px;" |
|
|
|
id="project" |
|
|
|
:id="`project-${task.id}`" |
|
|
|
:data-did="task.detailId" |
|
|
|
:data-param="param" |
|
|
|
:data-pdu="task.planDuration" |
|
|
@ -22,7 +22,7 @@ |
|
|
|
<!-- #ifdef APP-PLUS --> |
|
|
|
<view |
|
|
|
class="content" |
|
|
|
id="project" |
|
|
|
:id="`project-${task.id}`" |
|
|
|
:data-did="task.detailId" |
|
|
|
:data-param="param" |
|
|
|
:data-pdu="task.planDuration" |
|
|
@ -41,7 +41,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup> |
|
|
|
import { computed, reactive } from 'vue'; |
|
|
|
import { computed, reactive, watch, ref } from 'vue'; |
|
|
|
import { useStore } from 'vuex'; |
|
|
|
|
|
|
|
defineProps({ |
|
|
@ -60,6 +60,7 @@ const roleId = computed(() => store.state.role.roleId); |
|
|
|
const token = computed(() => store.state.user.token); |
|
|
|
const userId = computed(() => store.getters['user/userId']); |
|
|
|
const projectId = computed(() => store.getters['project/projectId']); |
|
|
|
const allPlugin = uni.$storage.getStorageSync('allPlugin'); |
|
|
|
</script> |
|
|
|
|
|
|
|
<script module="project" lang="renderjs"> |
|
|
@ -69,6 +70,9 @@ export default { |
|
|
|
pluginContent: null, |
|
|
|
pluginJs: null, |
|
|
|
show: false, |
|
|
|
pluginlists: [], |
|
|
|
flag: false, |
|
|
|
pluginInfo: {} |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
@ -81,12 +85,26 @@ export default { |
|
|
|
methods: { |
|
|
|
// 获取插件信息 |
|
|
|
async getPlugin() { |
|
|
|
this.pluginlists = JSON.parse(this.allPlugin); |
|
|
|
this.pluginlists.forEach(item => { |
|
|
|
if (this.pluginId === item.id) { |
|
|
|
this.flag = true; |
|
|
|
this.pluginInfo = item; |
|
|
|
this.show = true; |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
if (this.flag) { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.init(this.pluginInfo); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
const params = { businessPluginId: this.businessPluginId }; |
|
|
|
this.$catchReq.getOtherPlugin(params, (err, res) => { |
|
|
|
if (err) { |
|
|
|
console.error('err: ', err); |
|
|
|
} else { |
|
|
|
if (!res || !res.id) return; |
|
|
|
if (!res) return; |
|
|
|
if (res.html && res.js) { |
|
|
|
this.show = true; |
|
|
|
this.$nextTick(() => { |
|
|
@ -95,10 +113,11 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
init(res) { |
|
|
|
const content = document.querySelector('.content'); |
|
|
|
const content = document.getElementById(`project-${this.task.id}`); |
|
|
|
content.innerHTML = res.html; |
|
|
|
|
|
|
|
const script = document.createElement('script'); |
|
|
|