|
@@ -10,111 +10,121 @@ import PermissionButton from '/@/components/PermissionButton/index.vue';
|
|
import { getTagType } from '/@/utils/useTagColor';
|
|
import { getTagType } from '/@/utils/useTagColor';
|
|
import { handleCopy } from '/@/utils/useCopyText';
|
|
import { handleCopy } from '/@/utils/useCopyText';
|
|
|
|
|
|
|
|
+
|
|
const props = defineProps<{
|
|
const props = defineProps<{
|
|
- row: any;
|
|
|
|
- field: any;
|
|
|
|
|
|
+ row: any;
|
|
|
|
+ field: any;
|
|
}>();
|
|
}>();
|
|
const { row, field } = props;
|
|
const { row, field } = props;
|
|
|
|
|
|
-const emit: any = defineEmits(['edit-row', 'handle-delete', 'show-sku', 'release-sku']);
|
|
|
|
|
|
+const emit: any = defineEmits([ 'edit-row', 'handle-delete', 'show-sku', 'release-sku' ]);
|
|
|
|
|
|
function handleEdit() {
|
|
function handleEdit() {
|
|
- emit('edit-row', row);
|
|
|
|
|
|
+ emit('edit-row', row);
|
|
}
|
|
}
|
|
|
|
|
|
function onConfirm() {
|
|
function onConfirm() {
|
|
- emit('handle-delete', row);
|
|
|
|
|
|
+ emit('handle-delete', row);
|
|
}
|
|
}
|
|
|
|
|
|
function release() {
|
|
function release() {
|
|
- emit('release-sku', row);
|
|
|
|
|
|
+ emit('release-sku', row);
|
|
}
|
|
}
|
|
|
|
|
|
function showDetail() {
|
|
function showDetail() {
|
|
- emit('show-sku', row);
|
|
|
|
|
|
+ emit('show-sku', row);
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
- <div class="font-medium">
|
|
|
|
- <div v-if="field === 'operate'">
|
|
|
|
- <div class="flex justify-center gap-2 mb-2">
|
|
|
|
- <PermissionButton circle plain type="success" @click="showDetail()">
|
|
|
|
- <el-icon>
|
|
|
|
- <View />
|
|
|
|
- </el-icon>
|
|
|
|
- </PermissionButton>
|
|
|
|
-
|
|
|
|
- <!--</div>-->
|
|
|
|
- <!--<div class="flex justify-center gap-2">-->
|
|
|
|
- <PermissionButton circle plain type="warning" @click="handleEdit">
|
|
|
|
- <el-icon>
|
|
|
|
- <Operation />
|
|
|
|
- </el-icon>
|
|
|
|
- </PermissionButton>
|
|
|
|
- <el-popconfirm :icon="InfoFilled" icon-color="#626AEF" title="发布后此sku将无法更改, 是否继续?" width="220" @confirm="release">
|
|
|
|
- <template #reference>
|
|
|
|
- <!--div不可以删除,否则会导致popconfirm的弹出框消失-->
|
|
|
|
- <div>
|
|
|
|
- <el-tooltip :enterable="false" :show-arrow="false" content="发布" hide-after="0" placement="top" popper-class="custom-btn-tooltip-2">
|
|
|
|
- <PermissionButton :color="'#6466F1'" circle plain :disabled="row.status === 3">
|
|
|
|
- <el-icon>
|
|
|
|
- <Position />
|
|
|
|
- </el-icon>
|
|
|
|
- </PermissionButton>
|
|
|
|
- </el-tooltip>
|
|
|
|
- </div>
|
|
|
|
- </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>
|
|
|
|
- <el-popconfirm :icon="InfoFilled" icon-color="#626AEF" title="你确定要删除此项吗?" width="220" @confirm="onConfirm">
|
|
|
|
- <template #reference>
|
|
|
|
- <PermissionButton circle plain type="danger" :disabled="row.status === 3">
|
|
|
|
- <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>
|
|
|
|
- <div v-else-if="field === 'sku'" class="flex flex-nowrap">
|
|
|
|
- {{ row.sku }}
|
|
|
|
- <el-button :disabled="!row.sku" :icon="DocumentCopy" class="ml-2 cursor-pointer" link @click="handleCopy(row.sku || '')"></el-button>
|
|
|
|
- </div>
|
|
|
|
- <div v-else-if="field === 'brand'">
|
|
|
|
- <el-tag :disable-transitions="true" :type="getTagType(row.brand.brand_name)" effect="plain" round>
|
|
|
|
- {{ row.brand.brand_name }}
|
|
|
|
- </el-tag>
|
|
|
|
- </div>
|
|
|
|
- <div v-else-if="field === 'kind'">
|
|
|
|
- <el-tag :disable-transitions="true" :type="getTagType(row.kind.name)" effect="plain" round>
|
|
|
|
- {{ row.kind.name }}
|
|
|
|
- </el-tag>
|
|
|
|
- </div>
|
|
|
|
- <div v-else-if="field === 'status'">
|
|
|
|
- <el-tag :disable-transitions="true" :type="row.status === 1 ? 'warning' : 'success'">
|
|
|
|
- {{ row.status === 1 ? '草稿' : '已发布' }}
|
|
|
|
- </el-tag>
|
|
|
|
- </div>
|
|
|
|
- <div v-else>
|
|
|
|
- {{ row[field] }}
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="font-medium">
|
|
|
|
+ <div v-if="field === 'operate'">
|
|
|
|
+ <div class="flex justify-center gap-2 mb-2">
|
|
|
|
+ <div>
|
|
|
|
+ <PermissionButton circle plain type="success" @click="showDetail()">
|
|
|
|
+ <el-icon>
|
|
|
|
+ <View />
|
|
|
|
+ </el-icon>
|
|
|
|
+ </PermissionButton>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ <PermissionButton circle plain type="warning" @click="handleEdit">
|
|
|
|
+ <el-icon>
|
|
|
|
+ <Operation />
|
|
|
|
+ </el-icon>
|
|
|
|
+ </PermissionButton>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ <el-popconfirm :icon="InfoFilled" icon-color="#626AEF" title="发布后此sku将无法更改, 是否继续?" width="220"
|
|
|
|
+ @confirm="release">
|
|
|
|
+ <template #reference>
|
|
|
|
+ <!--div不可以删除,否则会导致popconfirm的弹出框消失-->
|
|
|
|
+ <div>
|
|
|
|
+ <el-tooltip :enterable="false" :show-arrow="false" content="发布" hide-after="0" placement="top"
|
|
|
|
+ popper-class="custom-btn-tooltip-2">
|
|
|
|
+ <PermissionButton :color="'#6466F1'" :disabled="row.status === 3" circle plain>
|
|
|
|
+ <el-icon>
|
|
|
|
+ <Position />
|
|
|
|
+ </el-icon>
|
|
|
|
+ </PermissionButton>
|
|
|
|
+ </el-tooltip>
|
|
|
|
+ </div>
|
|
|
|
+ </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-popconfirm :icon="InfoFilled" icon-color="#626AEF" title="你确定要删除此项吗?" width="220"
|
|
|
|
+ @confirm="onConfirm">
|
|
|
|
+ <template #reference>
|
|
|
|
+ <PermissionButton :disabled="row.status === 3" 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>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-else-if="field === 'sku'" class="flex flex-nowrap">
|
|
|
|
+ {{ row.sku }}
|
|
|
|
+ <el-button :disabled="!row.sku" :icon="DocumentCopy" class="ml-2 cursor-pointer" link
|
|
|
|
+ @click="handleCopy(row.sku || '')"></el-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-else-if="field === 'brand'">
|
|
|
|
+ <el-tag :disable-transitions="true" :type="getTagType(row.brand.brand_name)" effect="plain" round>
|
|
|
|
+ {{ row.brand.brand_name }}
|
|
|
|
+ </el-tag>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-else-if="field === 'kind'">
|
|
|
|
+ <el-tag :disable-transitions="true" :type="getTagType(row.kind.name)" effect="plain" round>
|
|
|
|
+ {{ row.kind.name }}
|
|
|
|
+ </el-tag>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-else-if="field === 'status'">
|
|
|
|
+ <el-tag :disable-transitions="true" :type="row.status === 1 ? 'warning' : 'success'">
|
|
|
|
+ {{ row.status === 1 ? '草稿' : '已发布' }}
|
|
|
|
+ </el-tag>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-else>
|
|
|
|
+ {{ row[field] }}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
.custom-btn-tooltip-2 {
|
|
.custom-btn-tooltip-2 {
|
|
- background-color: #f0f0fe !important;
|
|
|
|
- color: #606266 !important;
|
|
|
|
- border: 1px solid #6466f1 !important;
|
|
|
|
- font-size: 14px;
|
|
|
|
|
|
+ background-color: #f0f0fe !important;
|
|
|
|
+ color: #606266 !important;
|
|
|
|
+ border: 1px solid #6466f1 !important;
|
|
|
|
+ font-size: 14px;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|