Alerts store the selected product instead of falling back to gold, and the convert sliders turn the chosen asset amount into complementary 1.5 and 2.5 rings. Co-authored-by: Cursor <cursoragent@cursor.com>
69 lines
2.1 KiB
Vue
69 lines
2.1 KiB
Vue
<template>
|
||
<a-form
|
||
ref="formRef"
|
||
:model="form"
|
||
class="!mt-0"
|
||
name="price-trigger-form"
|
||
@finish="ok()"
|
||
>
|
||
<div class="flex flex-col gap-4 w-full">
|
||
<a-form-item :rules="[required()]" label="محصول" name="product_id">
|
||
<BasicSelect
|
||
v-model:value="form.product_id"
|
||
:items="productOptions"
|
||
key-name="id"
|
||
placeholder="کاتد مس، مفتول مس و..."
|
||
size="large"
|
||
value-name="title"
|
||
/>
|
||
</a-form-item>
|
||
<a-form-item :rules="[required()]" label="جهت قیمت" name="price_condition">
|
||
<BasicSelect
|
||
v-model:value="form.price_condition"
|
||
:items="typeItems"
|
||
:show-search="false"
|
||
key-name="key"
|
||
placeholder="انتخاب نوع جهت قیمت"
|
||
size="large"
|
||
value-name="value"
|
||
/>
|
||
</a-form-item>
|
||
<a-form-item :rules="[required()]" label="قیمت" name="target_price">
|
||
<BasicInput
|
||
v-model:value="form.target_price"
|
||
addon-before="ریال"
|
||
place-holder="وارد کردن قیمت"
|
||
size="large"
|
||
type="price"
|
||
/>
|
||
</a-form-item>
|
||
<p class="m-0 text-sm text-gray-500">پس از فعال شدن هشدار، پیامک به شماره موبایل شما ارسال میشود.</p>
|
||
<a-form-item>
|
||
<a-spin :spinning="loading">
|
||
<BasicButton class="w-full" html-type="submit" type="primary">
|
||
{{ editId ? 'ویرایش هشدار' : 'ثبت هشدار' }}
|
||
</BasicButton>
|
||
</a-spin>
|
||
</a-form-item>
|
||
</div>
|
||
</a-form>
|
||
</template>
|
||
|
||
<script lang="ts" setup>
|
||
import BasicButton from '@/components/BasicPacks/BasicButton.vue'
|
||
import BasicInput from '@/components/BasicPacks/BasicInput.vue'
|
||
import BasicSelect from '@/components/BasicPacks/BasicSelect.vue'
|
||
import { required } from '@/utils/inputRules'
|
||
import { usePriceTriggerPageContext } from '../composables/usePriceTriggerPage'
|
||
|
||
const {
|
||
form,
|
||
formRef,
|
||
editId,
|
||
loading,
|
||
typeItems,
|
||
productOptions,
|
||
ok,
|
||
} = usePriceTriggerPageContext()
|
||
</script>
|