|
@@ -6,11 +6,12 @@
|
|
|
*/
|
|
|
|
|
|
import { useCountryInfoStore } from '/@/stores/countryInfo';
|
|
|
-import { CopyDocument, Message, Operation } from '@element-plus/icons-vue';
|
|
|
+import { CopyDocument, Delete, InfoFilled, Message, Operation } from '@element-plus/icons-vue';
|
|
|
import { getTagType } from '/@/utils/useTagColor';
|
|
|
import PermissionButton from '/@/components/PermissionButton/index.vue';
|
|
|
import ProductInfo from '/@/views/product-manage/component/ProductInfo.vue';
|
|
|
import { handleCopy } from '/@/utils/useCopyText';
|
|
|
+import { hasPermission } from '/@/utils/hasPermission';
|
|
|
// import { BtnPermissionStore } from '/@/stores/btnPermission';
|
|
|
//
|
|
|
// const x = BtnPermissionStore();
|
|
@@ -22,7 +23,7 @@ const props = defineProps<{
|
|
|
}>();
|
|
|
const { row, field } = props;
|
|
|
|
|
|
-const emit = defineEmits([ 'edit-row', 'handle-notice', 'handle-monitor' ]);
|
|
|
+const emit = defineEmits([ 'edit-row', 'handle-notice', 'handle-monitor' ,'handle-delete',]);
|
|
|
|
|
|
const countryInfoStore = useCountryInfoStore();
|
|
|
const country = countryInfoStore.Countries.find(c => c.code == row.country_code);
|
|
@@ -35,6 +36,10 @@ function handleEdit() {
|
|
|
emit('edit-row', row);
|
|
|
}
|
|
|
|
|
|
+function onConfirm() {
|
|
|
+ emit('handle-delete', row);
|
|
|
+}
|
|
|
+
|
|
|
function handleNotice() {
|
|
|
emit('handle-notice', row);
|
|
|
}
|
|
@@ -131,6 +136,33 @@ function handleMonitor() {
|
|
|
</el-icon>
|
|
|
</PermissionButton>
|
|
|
</div>
|
|
|
+ <div v-if="hasPermission('GoodsDelete')">
|
|
|
+ <el-popconfirm
|
|
|
+ :icon="InfoFilled"
|
|
|
+ icon-color="#626AEF"
|
|
|
+ title="你确定要删除此项吗?"
|
|
|
+ width="220"
|
|
|
+ @confirm="onConfirm"
|
|
|
+ >
|
|
|
+ <template #reference>
|
|
|
+ <PermissionButton circle plain type="danger">
|
|
|
+ <el-icon>
|
|
|
+ <Delete />
|
|
|
+ </el-icon>
|
|
|
+ </PermissionButton>
|
|
|
+ </template>
|
|
|
+ <template #actions="{ confirm, cancel }">
|
|
|
+ <el-button size="small" @click="cancel">No!</el-button>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="danger"
|
|
|
+ @click="confirm"
|
|
|
+ >
|
|
|
+ Yes?
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
+ </div>
|
|
|
<div>
|
|
|
<el-tooltip :enterable="false" :show-arrow="false" content="变更通知" hide-after="0"
|
|
|
placement="top" popper-class="custom-btn-tooltip-info">
|