feat 添加价格涨跌
All checks were successful
Build image / build (push) Successful in 24s

This commit is contained in:
timerzz 2024-05-15 17:36:26 +08:00
parent 4d94feff03
commit c0472f3464

View File

@ -17,6 +17,13 @@
<template v-else-if="column.key === 'updatedAt'"> <template v-else-if="column.key === 'updatedAt'">
<span>{{moment(record.updatedAt).format('YYYY-MM-DD HH:mm:ss')}}</span> <span>{{moment(record.updatedAt).format('YYYY-MM-DD HH:mm:ss')}}</span>
</template> </template>
<template v-else-if="column.key === 'usPrice'">
<div class="flex space items-center">
<span>{{record.usPrice}}</span>
<CaretUpOutlined class="text-red" v-if="record.priceStatus === PRICE_STATUS.UP"/>
<CaretDownOutlined class="text-green" v-if="record.priceStatus === PRICE_STATUS.DOWN"/>
</div>
</template>
<template v-else-if="column.key === 'freight'"> <template v-else-if="column.key === 'freight'">
<div class="flex space-x-4"> <div class="flex space-x-4">
<a-input-number v-if="editData.edit && editData.param==='freight' && editData.data.pid === record.pid" v-model:value="editData.data.freight" @pressEnter="doUpdate"></a-input-number> <a-input-number v-if="editData.edit && editData.param==='freight' && editData.data.pid === record.pid" v-model:value="editData.data.freight" @pressEnter="doUpdate"></a-input-number>
@ -95,7 +102,7 @@ import {computed, h, onMounted, reactive, ref} from "vue";
import {ListProducts, UpdateProduct} from "@/api/product.js"; import {ListProducts, UpdateProduct} from "@/api/product.js";
import moment from "moment/moment.js"; import moment from "moment/moment.js";
import { clone } from 'radash' import { clone } from 'radash'
import {LoadingOutlined, SaveOutlined,SettingOutlined} from "@ant-design/icons-vue"; import {LoadingOutlined, SaveOutlined,SettingOutlined,CaretUpOutlined,CaretDownOutlined} from "@ant-design/icons-vue";
import {message, Modal} from "ant-design-vue"; import {message, Modal} from "ant-design-vue";
import {CreateWatcher} from "@/api/watcher.js"; import {CreateWatcher} from "@/api/watcher.js";
@ -263,6 +270,12 @@ const onWatch = (pid, name)=>{
}, },
}); });
} }
const PRICE_STATUS = {
NO_CHANGE: 0,
UP: 1,
DOWN: 2
}
</script> </script>