This commit is contained in:
yziiy
2025-10-31 18:46:09 +08:00
parent cfc8963084
commit ec1144e413
5 changed files with 114 additions and 42 deletions

View File

@@ -169,3 +169,10 @@ export const upadteTaskData = data => {
data
});
}
// 二级密码校验
export const checkPassWord = data => {
return http.request<Result>("post", "/adminapi/SysSet/check_second_pwd", {
data
});
}

View File

@@ -45,14 +45,8 @@ defineExpose({ getRef });
<el-input placeholder="请输入密码" v-model="newFormInline.secondary_password" show-password></el-input>
</el-form-item>
<el-form-item label="备注" prop="remarke">
<el-input
type="textarea"
placeholder="请输入备注"
v-model="newFormInline.remarke"
maxlength="30"
show-word-limit
>
</el-input>
<el-input type="textarea" placeholder="请输入备注" v-model="newFormInline.remarke" maxlength="30" show-word-limit>
</el-input>
</el-form-item>
</el-form>

View File

@@ -106,18 +106,18 @@ export function useData() {
label: "支付宝/微信账号",
prop: "alipay_account"
},
{
label: "微信账号",
prop: "coin"
},
{
label: "所属银行",
prop: "bank_card"
},
{
label: "开户行",
prop: "open_bank"
},
// {
// label: "微信账号",
// prop: "coin"
// },
// {
// label: "所属银行",
// prop: "bank_card"
// },
// {
// label: "开户行",
// prop: "open_bank"
// },
{
label: "银行卡号",
prop: "bank_card_number"
@@ -137,7 +137,6 @@ export function useData() {
{
label: "操作",
fixed: "right",
width: 210,
slot: "operation"
}
]);

View File

@@ -0,0 +1,27 @@
<script setup lang="ts">
import { ref } from "vue";
const ruleFormRef = ref();
const formRules = ref({
password: [{ required: true, message: "请输入二级密码", trigger: "blur" }]
});
const props = defineProps(["formInline"]);
const newFormInline = ref(
props.formInline
? props.formInline
: {
password: ""
}
);
function getRef() {
return ruleFormRef.value;
}
defineExpose({ getRef });
</script>
<template>
<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="120px">
<el-form-item label="二级密码" prop="password">
<el-input placeholder="请输入密码" v-model="newFormInline.password" show-password></el-input>
</el-form-item>
</el-form>
</template>

View File

@@ -1,10 +1,12 @@
import { ref, h } from "vue";
import { message } from "@/utils/message";
import editForm from "./form.vue";
import { ElMessageBox } from "element-plus";
import {
getConfigTypeList,
getConfigSetInfo,
SetConfigData
SetConfigData,
checkPassWord
} from "@/api/modules/system";
import { addDialog } from "@/components/ReDialog";
export function useData() {
@@ -36,33 +38,76 @@ export function useData() {
})
}
}
console.log(formData.value)
}
const tabClick = (event) => {
const { name } = event.props
getInfo(name)
}
const saveConfigEvent = async () => {
const { code, msg } = await SetConfigData({
...formData.value,
type: activeId.value
})
if (code) {
message("操作成功", { type: "success" });
getInfo(activeId.value)
} else {
message(msg, { type: "error" });
}
}
const saveConfig = async () => {
ElMessageBox.confirm(
`该操作将覆盖之前的数据,是否继续?`,
"提示",
{
type: "warning"
}
)
.then(async () => {
const { code, msg } = await SetConfigData({
...formData.value,
type: activeId.value
})
if (code) {
message("操作成功", { type: "success" });
getInfo(activeId.value)
} else {
message(msg, { type: "error" });
// 输入二级密码
addDialog({
title: `输入二级密码`,
width: "40%",
props: {
formInline: {
password: ""
}
})
.catch(() => { });
},
closeOnClickModal: false,
contentRenderer: () => h(editForm, { ref: formRef, formInline: null }),
beforeSure: (done, { options }) => {
const FormRef = formRef.value.getRef();
const curData = options.props.formInline;
const saveData = async form => {
const { data, code, msg } = await checkPassWord(form)
if (code) {
saveConfigEvent()
done()
} else {
message(msg, { type: "error" });
}
};
FormRef.validate(valid => {
if (valid) {
saveData(curData);
}
});
}
});
// ElMessageBox.confirm(
// `该操作将覆盖之前的数据,是否继续?`,
// "提示",
// {
// type: "warning"
// }
// )
// .then(async () => {
// const { code, msg } = await SetConfigData({
// ...formData.value,
// type: activeId.value
// })
// if (code) {
// message("操作成功", { type: "success" });
// getInfo(activeId.value)
// } else {
// message(msg, { type: "error" });
// }
// })
// .catch(() => { });
}
return {
onSearch,