更新
This commit is contained in:
@@ -19,7 +19,7 @@ export function useData() {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
const { data, code } = await getConfigTypeList({});
|
const { data, code } = await getConfigTypeList({});
|
||||||
if (code) {
|
if (code) {
|
||||||
tableList.value = data
|
tableList.value = data.filter(ele => { return ele.id !== 11 })
|
||||||
activeId.value = data[0].id
|
activeId.value = data[0].id
|
||||||
getInfo(activeId.value)
|
getInfo(activeId.value)
|
||||||
}
|
}
|
||||||
|
|||||||
60
src/views/system/secondPassword/index.vue
Normal file
60
src/views/system/secondPassword/index.vue
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { onMounted, ref } from "vue";
|
||||||
|
import { message } from "@/utils/message";
|
||||||
|
import { ElMessageBox } from "element-plus";
|
||||||
|
import {
|
||||||
|
getConfigSetInfo,
|
||||||
|
SetConfigData
|
||||||
|
} from "@/api/modules/system";
|
||||||
|
const Info = ref({
|
||||||
|
key_desc: '',
|
||||||
|
key_title: '',
|
||||||
|
key_value: ''
|
||||||
|
})
|
||||||
|
const formData = ref({
|
||||||
|
})
|
||||||
|
const getInfo = async (id) => {
|
||||||
|
const { data, code } = await getConfigSetInfo({ type: id })
|
||||||
|
if (code) {
|
||||||
|
// console.log(data)
|
||||||
|
Info.value = data[0]
|
||||||
|
formData.value[Info.value.key_title] = Info.value.key_value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const save = async () => {
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
`该操作将覆盖之前的数据,是否继续?`,
|
||||||
|
"提示",
|
||||||
|
{
|
||||||
|
type: "warning"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(async () => {
|
||||||
|
const { code, msg } = await SetConfigData({
|
||||||
|
...formData.value,
|
||||||
|
type: 11
|
||||||
|
})
|
||||||
|
if (code) {
|
||||||
|
message("操作成功", { type: "success" });
|
||||||
|
getInfo(11)
|
||||||
|
} else {
|
||||||
|
message(msg, { type: "error" });
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => { });
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
getInfo(11);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<el-form ref="form" :model="formData" label-width="100px">
|
||||||
|
|
||||||
|
<el-form-item :label="Info.key_desc" :prop="Info.key_title">
|
||||||
|
<el-input v-model="formData[Info.key_title]" style="width: 280px;" :show-password="true"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="">
|
||||||
|
<el-button @click="save">保存配置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
Reference in New Issue
Block a user