feat: hover-image-preview失效问题调整
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
@cancel="onClose"
|
||||
>
|
||||
<div class="content">
|
||||
<Steps changeable :current="currentStep" @change="setCurrent" class="mb-24px mx-79px w-full">
|
||||
<Steps changeable :current="currentStep" @change="setCurrent" class="mb-24px px-79px w-full">
|
||||
<Steps.Step v-for="(step, index) in STEPS" :key="index" :title="step.label" />
|
||||
</Steps>
|
||||
|
||||
@ -41,22 +41,22 @@ import StepFour from './stepFour.vue';
|
||||
const STEPS = [
|
||||
{
|
||||
label: '项目信息',
|
||||
index: 1,
|
||||
index: 0,
|
||||
comp: StepOne,
|
||||
},
|
||||
{
|
||||
label: '关联平台账号',
|
||||
index: 2,
|
||||
index: 1,
|
||||
comp: StepTwo,
|
||||
},
|
||||
{
|
||||
label: '关联渠道账户',
|
||||
index: 3,
|
||||
index: 2,
|
||||
comp: StepThree,
|
||||
},
|
||||
{
|
||||
label: '关联内容稿件',
|
||||
index: 4,
|
||||
index: 3,
|
||||
comp: StepFour,
|
||||
},
|
||||
];
|
||||
@ -73,14 +73,14 @@ const INITIAL_QUERY = {
|
||||
const update = inject('update');
|
||||
|
||||
const visible = ref(false);
|
||||
const currentStep = ref(1);
|
||||
const currentStep = ref(0);
|
||||
const formQuery = ref(cloneDeep(INITIAL_QUERY));
|
||||
const compRef = ref(null);
|
||||
const projectId = ref(null);
|
||||
|
||||
const isFirstStep = computed(() => currentStep.value === 1);
|
||||
const isFirstStep = computed(() => currentStep.value === 0);
|
||||
const isEdit = computed(() => projectId.value);
|
||||
const isLastStep = computed(() => currentStep.value === STEPS.length);
|
||||
const isLastStep = computed(() => currentStep.value === STEPS.length - 1);
|
||||
const activeComp = computed(() => STEPS.find((v) => v.index === currentStep.value)?.comp ?? null);
|
||||
|
||||
const open = (id = null) => {
|
||||
@ -100,7 +100,7 @@ const getDetail = (id) => {
|
||||
});
|
||||
};
|
||||
const onClose = () => {
|
||||
currentStep.value = 1;
|
||||
currentStep.value = 0;
|
||||
formQuery.value = cloneDeep(INITIAL_QUERY);
|
||||
projectId.value = '';
|
||||
compRef.value?.reset?.();
|
||||
@ -143,14 +143,13 @@ const handleEdit = () => {
|
||||
};
|
||||
|
||||
const setCurrent = (current) => {
|
||||
if (isFirstStep.value) {
|
||||
compRef.value.validate().then(() => {
|
||||
if (isFirstStep.value) {
|
||||
compRef.value?.validate().then(() => {
|
||||
currentStep.value = current;
|
||||
});
|
||||
return;
|
||||
}
|
||||
currentStep.value = current;
|
||||
|
||||
};
|
||||
const onPrev = () => {
|
||||
currentStep.value--;
|
||||
|
||||
@ -53,7 +53,7 @@
|
||||
<div class="filter-row-item">
|
||||
<span class="label">时间筛选</span>
|
||||
<DatePicker.RangePicker
|
||||
v-model="data_time"
|
||||
v-model:value="data_time"
|
||||
:allowClear="false"
|
||||
format="YYYY-MM-DD"
|
||||
class="w-240px"
|
||||
@ -145,8 +145,12 @@ const onDateChange = (date) => {
|
||||
handleSearch();
|
||||
};
|
||||
|
||||
const init = () => {
|
||||
data_time.value = [dayjs().subtract(1, 'day'), dayjs().subtract(1, 'day')];
|
||||
};
|
||||
|
||||
const handleReset = () => {
|
||||
data_time.value = [];
|
||||
init();
|
||||
emits('onReset');
|
||||
};
|
||||
|
||||
@ -163,13 +167,6 @@ const getOperators = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const getYesterdayDays = () => {
|
||||
const today = new Date();
|
||||
const last7Days = new Date(today);
|
||||
last7Days.setDate(today.getDate() - 1);
|
||||
return [last7Days.toISOString().split('T')[0], today.toISOString().split('T')[0]];
|
||||
};
|
||||
|
||||
const getAccounts = async () => {
|
||||
const { code, data } = await getPlacementAccountsList();
|
||||
if (code === 200) {
|
||||
@ -178,8 +175,7 @@ const getAccounts = async () => {
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
const defaultTime = getYesterdayDays();
|
||||
data_time.value = defaultTime;
|
||||
init();
|
||||
|
||||
getGroups();
|
||||
getOperators();
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
<div class="filter-row flex mb-20px">
|
||||
<div class="filter-row-item flex items-center">
|
||||
<span class="label">时间筛选</span>
|
||||
<DatePicker.RangePicker v-model="data_time" size="medium" allowClear format="YYYY-MM-DD" class="w-310" @change="onDateChange" />
|
||||
<DatePicker.RangePicker v-model:value="data_time" size="medium" allowClear format="YYYY-MM-DD" class="w-310" @change="onDateChange" />
|
||||
</div>
|
||||
|
||||
<div class="filter-row-item flex items-center">
|
||||
|
||||
Reference in New Issue
Block a user