1404/11/04- first
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicMainCard>
|
||||
<div class="flex h-full">
|
||||
<!-- {{ menu }}-->
|
||||
<BasicMenu width="13rem" :menu="menu" class="overflow-auto min-w-[13.5rem]" />
|
||||
<!-- <component :is="selectedComponent" class="mr-5" />-->
|
||||
<RouterView class="mr-5 w-full"></RouterView>
|
||||
</div>
|
||||
</BasicMainCard>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import BasicMenu from '@/components/BasicMenu/index.vue'
|
||||
import { useRouterStore } from '@core/stores/router'
|
||||
import { get } from 'lodash'
|
||||
//import Nature from '@/pages/menuPages/setting/limitedOrder/index.vue'
|
||||
//s import test from './limitedOrder'
|
||||
//import Budget from '@/pages/menuPages/setting/budget/index.vue'
|
||||
//import ProjectType from '@/pages/menuPages/setting/projectType/index.vue'
|
||||
//import DocumentType from '@/pages/menuPages/setting/documentType/index.vue'
|
||||
// import Management from '@/pages/menuPages/setting/management/index.vue'
|
||||
//import Accessibility from '@/pages/menuPages/setting/accessibility/index.vue'
|
||||
//import SubmitProcess from '@/pages/menuPages/setting/submitProcess/index.vue'
|
||||
//import documentGroup from '@/pages/menuPages/setting/documentGroup/index.vue'
|
||||
//import userType from '@/pages/menuPages/setting/userType/index.vue'
|
||||
|
||||
const routerStore = useRouterStore()
|
||||
const menu = computed(() => {
|
||||
const item = routerStore.routes.find((item) => item.name === 'settings')
|
||||
//console.log('aaaa', get(item, 'children[0].children', []))
|
||||
return get(item, 'children[0].children', [])
|
||||
})
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
@@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<div>
|
||||
<div
|
||||
:style="{ backgroundImage: `url(${bg1})` }"
|
||||
class="w-[80vw] h-full bg-cover flex items-center justify-center"
|
||||
>
|
||||
<div class="shadow-2xl h-[25vh] w-1/3 rounded-lg p-10 bg-white">
|
||||
<a-form :model="form" ref="formRef" autocomplete="off" @finish="ok">
|
||||
<div class="gap-4">
|
||||
<a-form-item label="سقف واریز اولیه (ریال)" name="value" :rules="inputRules()">
|
||||
<BasicInput v-model:value="form.value" type="number" />
|
||||
</a-form-item>
|
||||
<div v-show="form.value > 10">معادل {{ usePrice(form.value / 10, true, 'تومان') }}</div>
|
||||
<!-- <a-form-item label="نام چاپی" name="print_name" :rules="inputRules()">
|
||||
<BasicInput v-model:value="form.print_name" />
|
||||
</a-form-item>-->
|
||||
<a-form-item>
|
||||
<BaseButton
|
||||
class="mt-10 w-full"
|
||||
:disabled="loading"
|
||||
type="primary"
|
||||
size="middle"
|
||||
html-type="submit"
|
||||
>
|
||||
<div>
|
||||
<a-spin v-if="loading" size="small" />
|
||||
<div v-else>ثبت</div>
|
||||
</div>
|
||||
</BaseButton>
|
||||
</a-form-item>
|
||||
</div>
|
||||
</a-form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <BasicShowContent>-->
|
||||
<!-- <!– <BasicTags-->
|
||||
<!-- :items="items"-->
|
||||
<!-- color="green"-->
|
||||
<!-- @add="add"-->
|
||||
<!-- @edit="edit"-->
|
||||
<!-- :key="refresh"-->
|
||||
<!-- :loading="loading"-->
|
||||
<!-- @delete="deleteTag"-->
|
||||
<!-- />–>-->
|
||||
<!-- </BasicShowContent>-->
|
||||
<!-- <a-modal
|
||||
v-model:visible="addNatureVisible"
|
||||
title="Vertically centered modal dialog"
|
||||
centered
|
||||
@ok="addNatureVisible = false"
|
||||
>
|
||||
<BaseInput title="عنوان" size="large" />
|
||||
</a-modal>-->
|
||||
<!-- <BasicModal
|
||||
v-model:visible="addNatureVisible"
|
||||
:title="editId ? `ویرایش` : 'افزودن'"
|
||||
@close="addNatureVisible = false"
|
||||
@ok="ok"
|
||||
:loading="loading"
|
||||
>
|
||||
<a-form ref="formRef" :model="form" autocomplete="off">
|
||||
<a-form-item name="value" label="حروف اختصاری" :rules="valueValidation">
|
||||
<BasicInput v-model:value="form.value" placeHolder="حروف اختصاری" />
|
||||
</a-form-item>
|
||||
<a-form-item name="title_fa" label="عنوان">
|
||||
<BasicInput v-model:value="form.title_fa" placeHolder="نام" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</BasicModal>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import BasicShowContent from '@/components/BasicShowContext.vue'
|
||||
import { inputRules, valueValidation } from '@/utils/inputRules'
|
||||
import type { Const } from '../../../../model/const'
|
||||
import type { TagItem } from '@/components/BasicTags/model'
|
||||
import { message } from 'ant-design-vue'
|
||||
import type { FormInstance } from 'ant-design-vue'
|
||||
import { useStaticApiListsStore } from '@/store/staticApisStore'
|
||||
import { createAddConst, deleteConst, updateEditConst } from '@/api/consts'
|
||||
import bg1 from '@/pages/login/assets/img/loginBack.svg'
|
||||
import { usePrice } from '../../../../core/utils/usePrice'
|
||||
//data Arrays
|
||||
const items = ref<Array<TagItem>>()
|
||||
const baseData = ref<Array<Const>>()
|
||||
|
||||
//limitedOrder modal
|
||||
const addNatureVisible = ref<boolean>()
|
||||
const loading = ref<boolean>()
|
||||
|
||||
//refresh
|
||||
let refresh = 0
|
||||
|
||||
const form = ref<Const>({
|
||||
title_fa: '',
|
||||
value: ''
|
||||
})
|
||||
const formRef = ref<FormInstance>()
|
||||
|
||||
//store
|
||||
const store = useStaticApiListsStore()
|
||||
|
||||
//get limitedOrder
|
||||
/*onMounted(() => {
|
||||
setTypes()
|
||||
})
|
||||
const getTypes = async () =>
|
||||
(baseData.value = store.natureListData ?? (await store.getNatureConst()))*/
|
||||
/*async function setTypes() {
|
||||
try {
|
||||
loading.value = true
|
||||
await getTypes()
|
||||
// console.log('set', baseData.value)
|
||||
items.value = baseData.value?.map((x: Const) => {
|
||||
return {
|
||||
id: x.id,
|
||||
name: `${x.title_fa ?? ''}(${x.value})`
|
||||
}
|
||||
})
|
||||
refresh++
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
// message.error('خطا در دریافت اطلاعات')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
// console.log(items.value)
|
||||
}*/
|
||||
|
||||
//delete limitedOrder item
|
||||
/*
|
||||
async function deleteTag(id: number) {
|
||||
// console.log(id)
|
||||
try {
|
||||
await deleteConst(id)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
// message.error('خطا در حذف مورد')
|
||||
await resetData()
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
//edit limitedOrder
|
||||
// let editId: number | undefined = undefined
|
||||
|
||||
// function edit(id: number) {
|
||||
// const obj: Const = baseData.value?.find((x: Const) => x.id === id) ?? ({} as Const)
|
||||
// addNatureVisible.value = true
|
||||
// editId = id
|
||||
// form.value = obj
|
||||
// }
|
||||
|
||||
//resetData
|
||||
// async function resetData() {
|
||||
// await store.getNatureConst()
|
||||
// formRef.value?.resetFields()
|
||||
// form.value = {
|
||||
// title_fa: '',
|
||||
// value: ''
|
||||
// }
|
||||
// await setTypes()
|
||||
// }
|
||||
|
||||
//add
|
||||
|
||||
// function add() {
|
||||
// editId = undefined
|
||||
// addNatureVisible.value = true
|
||||
// resetData()
|
||||
// }
|
||||
|
||||
//submit
|
||||
async function ok() {
|
||||
let obj: Const = {
|
||||
key: 'limited_price',
|
||||
// title_fa: form.value.title_fa,
|
||||
value: form.value.value
|
||||
// id: editId
|
||||
}
|
||||
formRef.value?.validateFields().then(async () => {
|
||||
try {
|
||||
loading.value = true
|
||||
await updateEditConst(obj)
|
||||
message.success('عملیات با موفقیت انجام شد')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
// message.error('خطا در ثبت اطلاعات')
|
||||
} finally {
|
||||
loading.value = false
|
||||
// addNatureVisible.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
Reference in New Issue
Block a user