perf: 统一status-box组件
This commit is contained in:
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import { STATUS_LIST } from './constants';
|
import { STATUS_LIST } from '@/views/property-marketing/media-account/components/status-select/constants';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
|
|||||||
@ -135,7 +135,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { STATUS_LIST } from '@/views/property-marketing/put-account/components/status-select/constants';
|
import { STATUS_LIST } from '@/views/property-marketing/media-account/components/status-select/constants';
|
||||||
import { formatTableField, exactFormatTime } from '@/utils/tools';
|
import { formatTableField, exactFormatTime } from '@/utils/tools';
|
||||||
import { TABLE_COLUMNS } from './constants';
|
import { TABLE_COLUMNS } from './constants';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
|||||||
@ -81,7 +81,7 @@ import {
|
|||||||
import GroupSelect from '../group-select';
|
import GroupSelect from '../group-select';
|
||||||
|
|
||||||
import OperatorSelect from '@/views/property-marketing/put-account/components/operator-select';
|
import OperatorSelect from '@/views/property-marketing/put-account/components/operator-select';
|
||||||
import StatusSelect from '@/views/property-marketing/put-account/components/status-select';
|
import StatusSelect from '@/views/property-marketing/media-account/components/status-select';
|
||||||
import AccountSelect from '@/views/property-marketing/put-account/components/account-select';
|
import AccountSelect from '@/views/property-marketing/put-account/components/account-select';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
@ -133,7 +133,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { STATUS_LIST } from '@/views/property-marketing/put-account/components/status-select/constants';
|
import { STATUS_LIST } from '@/views/property-marketing/media-account/components/status-select/constants';
|
||||||
import { formatTableField } from '@/utils/tools';
|
import { formatTableField } from '@/utils/tools';
|
||||||
import { TABLE_COLUMNS } from './constants';
|
import { TABLE_COLUMNS } from './constants';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
|||||||
@ -77,7 +77,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { defineProps, ref, computed } from 'vue';
|
import { defineProps, ref, computed } from 'vue';
|
||||||
import { PLATFORM_LIST } from '@/views/property-marketing/put-account/common_constants';
|
import { PLATFORM_LIST } from '@/views/property-marketing/put-account/common_constants';
|
||||||
import { EnumStatus } from '@/views/property-marketing/put-account/components/status-select/constants';
|
import { EnumStatus } from '@/views/property-marketing/media-account/components/status-select/constants';
|
||||||
|
|
||||||
import { formatNumberShow, exactFormatTime } from '@/utils/tools';
|
import { formatNumberShow, exactFormatTime } from '@/utils/tools';
|
||||||
|
|
||||||
|
|||||||
@ -67,7 +67,7 @@
|
|||||||
import { defineEmits, defineProps } from 'vue';
|
import { defineEmits, defineProps } from 'vue';
|
||||||
import { getPlacementAccountOperators } from '@/api/all/propertyMarketing';
|
import { getPlacementAccountOperators } from '@/api/all/propertyMarketing';
|
||||||
import { PLATFORM_LIST } from '@/views/property-marketing/put-account/common_constants';
|
import { PLATFORM_LIST } from '@/views/property-marketing/put-account/common_constants';
|
||||||
import StatusSelect from '@/views/property-marketing/put-account/components/status-select';
|
import StatusSelect from '@/views/property-marketing/media-account/components/status-select';
|
||||||
import OperatorSelect from '@/views/property-marketing/put-account/components/operator-select';
|
import OperatorSelect from '@/views/property-marketing/put-account/components/operator-select';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { STATUS_LIST, EnumStatus } from '@/views/property-marketing/put-account/components/status-select/constants';
|
import { STATUS_LIST, EnumStatus } from '@/views/property-marketing/media-account/components/status-select/constants';
|
||||||
|
|
||||||
import iconWarn1 from '@/assets/img/media-account/icon-warn-1.png';
|
import iconWarn1 from '@/assets/img/media-account/icon-warn-1.png';
|
||||||
import iconWarn2 from '@/assets/img/media-account/icon-warn-2.png';
|
import iconWarn2 from '@/assets/img/media-account/icon-warn-2.png';
|
||||||
|
|||||||
@ -1,60 +0,0 @@
|
|||||||
/*
|
|
||||||
* @Author: RenXiaoDong
|
|
||||||
* @Date: 2025-07-04 11:18:11
|
|
||||||
*/
|
|
||||||
export enum EnumStatus {
|
|
||||||
UNAUTHORIZED = 0,
|
|
||||||
NORMAL = 1,
|
|
||||||
ABNORMAL = 3,
|
|
||||||
PAUSE = 2,
|
|
||||||
ABNORMAL_LOGIN = 4,
|
|
||||||
ABNORMAL_REQUEST = 5,
|
|
||||||
ABNORMAL_FREEZE = 6,
|
|
||||||
ABNORMAL_MISSING = 7,
|
|
||||||
}
|
|
||||||
|
|
||||||
export const STATUS_LIST = [
|
|
||||||
{
|
|
||||||
text: '正常',
|
|
||||||
label: '正常',
|
|
||||||
value: EnumStatus.NORMAL,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '暂停同步',
|
|
||||||
label: '暂停同步',
|
|
||||||
value: EnumStatus.PAUSE,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '未授权',
|
|
||||||
label: '未授权',
|
|
||||||
value: EnumStatus.UNAUTHORIZED,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '异常',
|
|
||||||
label: '异常',
|
|
||||||
value: EnumStatus.ABNORMAL,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '数据缺失',
|
|
||||||
label: '数据缺失',
|
|
||||||
value: EnumStatus.ABNORMAL_MISSING,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '异常-登录状态失效',
|
|
||||||
label: '异常',
|
|
||||||
value: EnumStatus.ABNORMAL_LOGIN,
|
|
||||||
tooltip: '登录状态失效,需重新扫码授权',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '异常-请求过于频繁',
|
|
||||||
label: '异常',
|
|
||||||
value: EnumStatus.ABNORMAL_REQUEST,
|
|
||||||
tooltip: '请求过于频繁,需等待24小时后重试',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '异常-账号被冻结/封禁',
|
|
||||||
label: '异常',
|
|
||||||
value: EnumStatus.ABNORMAL_FREEZE,
|
|
||||||
tooltip: '账号被冻结/封禁',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: RenXiaoDong
|
|
||||||
* @Date: 2025-06-25 14:02:40
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<a-select
|
|
||||||
v-model="selectedStatus"
|
|
||||||
:multiple="multiple"
|
|
||||||
size="medium"
|
|
||||||
:placeholder="placeholder"
|
|
||||||
allow-clear
|
|
||||||
@change="handleChange"
|
|
||||||
>
|
|
||||||
<a-option v-for="(item, index) in STATUS_LIST" :key="index" :value="item.value" :label="item.text">
|
|
||||||
{{ item.text }}
|
|
||||||
</a-option>
|
|
||||||
</a-select>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, watch } from 'vue';
|
|
||||||
import { STATUS_LIST } from './constants';
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
modelValue: {
|
|
||||||
type: [Array, String, Number],
|
|
||||||
default: () => [],
|
|
||||||
},
|
|
||||||
multiple: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
placeholder: {
|
|
||||||
type: String,
|
|
||||||
default: '全部',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const emits = defineEmits(['update:modelValue', 'change']);
|
|
||||||
|
|
||||||
const selectedStatus = ref(props.multiple ? [] : '');
|
|
||||||
|
|
||||||
// 监听外部传入的值变化
|
|
||||||
watch(
|
|
||||||
() => props.modelValue,
|
|
||||||
(newVal) => {
|
|
||||||
selectedStatus.value = newVal;
|
|
||||||
},
|
|
||||||
{ immediate: true },
|
|
||||||
);
|
|
||||||
// 监听内部值变化,向外部发送更新
|
|
||||||
watch(selectedStatus, (newVal) => {
|
|
||||||
emits('update:modelValue', newVal);
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleChange = (value) => {
|
|
||||||
selectedStatus.value = value;
|
|
||||||
emits('change', value);
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
Reference in New Issue
Block a user