更新
This commit is contained in:
@@ -169,3 +169,10 @@ export const upadteTaskData = data => {
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 二级密码校验
|
||||
export const checkPassWord = data => {
|
||||
return http.request<Result>("post", "/adminapi/SysSet/check_second_pwd", {
|
||||
data
|
||||
});
|
||||
}
|
||||
@@ -45,13 +45,7 @@ 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 type="textarea" placeholder="请输入备注" v-model="newFormInline.remarke" maxlength="30" show-word-limit>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]);
|
||||
|
||||
27
src/views/system/private/form.vue
Normal file
27
src/views/system/private/form.vue
Normal 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>
|
||||
@@ -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,21 +38,13 @@ export function useData() {
|
||||
})
|
||||
}
|
||||
}
|
||||
console.log(formData.value)
|
||||
|
||||
}
|
||||
const tabClick = (event) => {
|
||||
const { name } = event.props
|
||||
getInfo(name)
|
||||
}
|
||||
const saveConfig = async () => {
|
||||
ElMessageBox.confirm(
|
||||
`该操作将覆盖之前的数据,是否继续?`,
|
||||
"提示",
|
||||
{
|
||||
type: "warning"
|
||||
}
|
||||
)
|
||||
.then(async () => {
|
||||
const saveConfigEvent = async () => {
|
||||
const { code, msg } = await SetConfigData({
|
||||
...formData.value,
|
||||
type: activeId.value
|
||||
@@ -61,8 +55,59 @@ export function useData() {
|
||||
} else {
|
||||
message(msg, { type: "error" });
|
||||
}
|
||||
})
|
||||
.catch(() => { });
|
||||
}
|
||||
const saveConfig = async () => {
|
||||
// 输入二级密码
|
||||
addDialog({
|
||||
title: `输入二级密码`,
|
||||
width: "40%",
|
||||
props: {
|
||||
formInline: {
|
||||
password: ""
|
||||
}
|
||||
},
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user