|
|
@ -21,7 +21,16 @@ |
|
|
|
<span>{{ list.authorName || '无' }}</span> |
|
|
|
</div> |
|
|
|
<div class="mt-6"> |
|
|
|
<el-button type="primary" v-if="showConfig">移除</el-button> |
|
|
|
<el-popconfirm |
|
|
|
title="确定要移除该插件吗?" |
|
|
|
confirm-button-text="确定" |
|
|
|
cancel-button-text="再想想" |
|
|
|
@confirm="deleteRelevance(list)" |
|
|
|
> |
|
|
|
<template #reference> |
|
|
|
<el-button type="primary" v-if="showConfig">移除</el-button> |
|
|
|
</template> |
|
|
|
</el-popconfirm> |
|
|
|
<el-button type="primary" disabled>下载源代码</el-button> |
|
|
|
<el-button type="primary" disabled>下载示例代码</el-button> |
|
|
|
<!-- 添加到业务弹框 --> |
|
|
@ -58,8 +67,9 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script lang="ts" setup="true"> |
|
|
|
import { defineProps, reactive, watchEffect } from 'vue'; |
|
|
|
import { queryBusiness } from '@/apis/business.js'; |
|
|
|
import { defineProps, reactive, watchEffect, defineEmits } from 'vue'; |
|
|
|
import { ElMessage } from 'element-plus'; |
|
|
|
import { queryBusiness, delRelevance } from '@/apis/business.js'; |
|
|
|
|
|
|
|
const data = reactive({ |
|
|
|
currentPage: 1, |
|
|
@ -71,8 +81,11 @@ const data = reactive({ |
|
|
|
const props = defineProps({ |
|
|
|
lists: { default: () => [], type: Array }, |
|
|
|
showConfig: { default: false, type: Boolean }, |
|
|
|
businessId: { default: '', type: String }, |
|
|
|
}); |
|
|
|
|
|
|
|
const emit = defineEmits(['queryPluginOfBusiness']); |
|
|
|
|
|
|
|
watchEffect(() => { |
|
|
|
if (props.lists && props.lists.length) { |
|
|
|
data.listArray = []; |
|
|
@ -133,6 +146,20 @@ function collapseVisible(index) { |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 移除业务下的插件 |
|
|
|
*/ |
|
|
|
async function deleteRelevance(list) { |
|
|
|
try { |
|
|
|
const params = { param: { businessPluginId: list.businessPluginId } }; |
|
|
|
await delRelevance(params); |
|
|
|
ElMessage.success('删除成功'); |
|
|
|
emit('queryPluginOfBusiness', props.businessId); |
|
|
|
} catch (error) { |
|
|
|
ElMessage.success(error || '删除失败'); |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped> |
|
|
|