Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions locales/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"Basis.Form.436809-24": "Show filing number",
"Basis.Form.436809-25": "Filing number content",
"Basis.Form.436809-26": "Please enter the filing number",
"Basis.Form.436809-27": "Points exchange rate",
"Basis.Form.436809-28": "1 point = X CNY. Used only when converting recharge amount to cash payment.",
"Basis.Form.436809-29": "Please enter the points exchange rate",
"upload.upload.283727-0": "Upload Image",
"upload.upload.283727-1": "Click to modify",
"upload.upload.283727-2": "Recommended size 200*200",
Expand Down
3 changes: 3 additions & 0 deletions locales/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"Basis.Form.436809-24": "展示备案号",
"Basis.Form.436809-25": "备案号内容",
"Basis.Form.436809-26": "请输入备案号",
"Basis.Form.436809-27": "积分汇率",
"Basis.Form.436809-28": "1 积分 = X 元,仅用于积分充值换算现金金额",
"Basis.Form.436809-29": "请输入积分汇率",
"upload.upload.283727-0": "上传图片",
"upload.upload.283727-1": "点击修改",
"upload.upload.283727-2": "推荐尺寸200*200",
Expand Down
35 changes: 32 additions & 3 deletions views/system/Basis/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@
</template>
<a-input v-model:value="formData['base-path']" :placeholder="$t('Basis.Form.436809-14')"></a-input>
</a-form-item>
<a-form-item name="exchangeRate">
<template #label>
<a-space>
<span>{{ $t('Basis.Form.436809-27') }}</span>
<a-tooltip :title="$t('Basis.Form.436809-28')">
<AIcon type="QuestionCircleOutlined"/>
</a-tooltip>
</a-space>
</template>
<a-input v-model:value="formData.exchangeRate" :placeholder="$t('Basis.Form.436809-29')"></a-input>
</a-form-item>
<a-form-item
name="showRecordNumber"
:label="$t('Basis.Form.436809-24')"
Expand Down Expand Up @@ -139,7 +150,8 @@
</template>

<script lang="ts" name="BasicForm" setup>
import {reactive, ref} from 'vue'
import {computed, onMounted, reactive, ref} from 'vue'
import type { Rule } from 'ant-design-vue/es/form'
import type {formDataType} from './typing'
import {useRequest} from '@jetlinks-web/hooks';
import {save_api} from '../../../api/system/basis';
Expand All @@ -165,7 +177,10 @@ const formData = reactive<formDataType>({
apiKey: "", // 高德API Key
webKey: "", // 高德web key
secretKey: "", // 高德web key
exchangeRate: "0.01",
'base-path': `${window.location.origin}/api`, // base-path
showRecordNumber: false,
recordNumber: '',
logo: "/images/login/logo.png", // 系统logo
ico: "/favicon.ico", // 浏览器页签
background: "/images/login/login.png" // 登录背景图
Expand All @@ -177,7 +192,7 @@ const showBtn = computed(() => {
return props.hideSubmitBtn === false
})
// 表单验证规则
const formRules = {
const formRules: Record<string, Rule[]> = {
// 系统名称输入框验证规则
title: [
{
Expand All @@ -202,6 +217,13 @@ const formRules = {
message: $t('Basis.Form.436809-20'),
trigger: "blur"
}
],
exchangeRate: [
{
required: true,
message: $t('Basis.Form.436809-29'),
trigger: 'blur'
}
]
}

Expand All @@ -228,6 +250,7 @@ const getDetails = async () => {
apiKey: configInfo.amap?.apiKey,
webKey: configInfo.amap?.webKey,
secretKey: configInfo.amap?.secretKey,
exchangeRate: configInfo.points?.exchangeRate || '0.01',
'base-path': configInfo.paths?.['base-path'],
})
}
Expand Down Expand Up @@ -276,13 +299,19 @@ const submit = () => {
'base-path': formData['base-path'],
},
},
{
scope: 'points',
properties: {
exchangeRate: formData.exchangeRate,
},
},
]
run(params).then(resp => {
resolve(true)
}).catch(() => {
reject(false)
})
}).catch((e) => {
}).catch((e: unknown) => {
reject(e)
return false
})
Expand Down
3 changes: 3 additions & 0 deletions views/system/Basis/typing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ export interface formDataType {
webKey: string | undefined, // 高德web key

secretKey: string | undefined, // 高德web key
exchangeRate: string | undefined,
'base-path': string | undefined, // base-path
showRecordNumber?: boolean,
recordNumber?: string,
logo: string | undefined, // 系统logo
ico: string | undefined, // 浏览器页签
background: string | undefined // 登录背景图
Expand Down