更新
This commit is contained in:
@@ -169,3 +169,10 @@ export const upadteTaskData = data => {
|
|||||||
data
|
data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 二级密码校验
|
||||||
|
export const checkPassWord = data => {
|
||||||
|
return http.request<Result>("post", "/adminapi/SysSet/check_second_pwd", {
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -45,14 +45,8 @@ defineExpose({ getRef });
|
|||||||
<el-input placeholder="请输入密码" v-model="newFormInline.secondary_password" show-password></el-input>
|
<el-input placeholder="请输入密码" v-model="newFormInline.secondary_password" show-password></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remarke">
|
<el-form-item label="备注" prop="remarke">
|
||||||
<el-input
|
<el-input type="textarea" placeholder="请输入备注" v-model="newFormInline.remarke" maxlength="30" show-word-limit>
|
||||||
type="textarea"
|
</el-input>
|
||||||
placeholder="请输入备注"
|
|
||||||
v-model="newFormInline.remarke"
|
|
||||||
maxlength="30"
|
|
||||||
show-word-limit
|
|
||||||
>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|||||||
@@ -106,18 +106,18 @@ export function useData() {
|
|||||||
label: "支付宝/微信账号",
|
label: "支付宝/微信账号",
|
||||||
prop: "alipay_account"
|
prop: "alipay_account"
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
label: "微信账号",
|
// label: "微信账号",
|
||||||
prop: "coin"
|
// prop: "coin"
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
label: "所属银行",
|
// label: "所属银行",
|
||||||
prop: "bank_card"
|
// prop: "bank_card"
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
label: "开户行",
|
// label: "开户行",
|
||||||
prop: "open_bank"
|
// prop: "open_bank"
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
label: "银行卡号",
|
label: "银行卡号",
|
||||||
prop: "bank_card_number"
|
prop: "bank_card_number"
|
||||||
@@ -137,7 +137,6 @@ export function useData() {
|
|||||||
{
|
{
|
||||||
label: "操作",
|
label: "操作",
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 210,
|
|
||||||
slot: "operation"
|
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 { ref, h } from "vue";
|
||||||
import { message } from "@/utils/message";
|
import { message } from "@/utils/message";
|
||||||
|
import editForm from "./form.vue";
|
||||||
import { ElMessageBox } from "element-plus";
|
import { ElMessageBox } from "element-plus";
|
||||||
import {
|
import {
|
||||||
getConfigTypeList,
|
getConfigTypeList,
|
||||||
getConfigSetInfo,
|
getConfigSetInfo,
|
||||||
SetConfigData
|
SetConfigData,
|
||||||
|
checkPassWord
|
||||||
} from "@/api/modules/system";
|
} from "@/api/modules/system";
|
||||||
import { addDialog } from "@/components/ReDialog";
|
import { addDialog } from "@/components/ReDialog";
|
||||||
export function useData() {
|
export function useData() {
|
||||||
@@ -36,21 +38,13 @@ export function useData() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(formData.value)
|
|
||||||
}
|
}
|
||||||
const tabClick = (event) => {
|
const tabClick = (event) => {
|
||||||
const { name } = event.props
|
const { name } = event.props
|
||||||
getInfo(name)
|
getInfo(name)
|
||||||
}
|
}
|
||||||
const saveConfig = async () => {
|
const saveConfigEvent = async () => {
|
||||||
ElMessageBox.confirm(
|
|
||||||
`该操作将覆盖之前的数据,是否继续?`,
|
|
||||||
"提示",
|
|
||||||
{
|
|
||||||
type: "warning"
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.then(async () => {
|
|
||||||
const { code, msg } = await SetConfigData({
|
const { code, msg } = await SetConfigData({
|
||||||
...formData.value,
|
...formData.value,
|
||||||
type: activeId.value
|
type: activeId.value
|
||||||
@@ -61,8 +55,59 @@ export function useData() {
|
|||||||
} else {
|
} else {
|
||||||
message(msg, { type: "error" });
|
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 {
|
return {
|
||||||
onSearch,
|
onSearch,
|
||||||
|
|||||||
Reference in New Issue
Block a user