mirror of https://gitee.com/godoos/godoos.git
10 changed files with 234 additions and 184 deletions
@ -1,74 +1,114 @@ |
|||
<template> |
|||
<div class="file-pwd-box"> |
|||
<!-- <div v-if="setPwd"> |
|||
<div class="setting-item"> |
|||
<label>文件密码</label> |
|||
<el-input |
|||
v-model="filePwd" |
|||
placeholder="请设置6-10位的密码" |
|||
type="password" |
|||
show-password |
|||
/> |
|||
</div> |
|||
<div class="setting-item"> |
|||
<label></label> |
|||
<el-button |
|||
@click="toSetFilePwd" |
|||
type="primary" |
|||
>{{ t("setFilePwd") }}</el-button |
|||
> |
|||
<el-button |
|||
@click="clearPwd" |
|||
type="primary" |
|||
>取消文件加密</el-button |
|||
> |
|||
</div> |
|||
</div> --> |
|||
<div |
|||
class="setting-item" |
|||
> |
|||
<label></label> |
|||
<el-button |
|||
@click="setFilePwd" |
|||
type="primary" |
|||
>{{ isSetPwd ? t("cancleFilePwd") : t("setFilePwd") }}</el-button |
|||
> |
|||
</div> |
|||
</div> |
|||
<el-button type="primary" :icon="Plus" circle @click="addPwd"/> |
|||
<div class="file-pwd-list-box"> |
|||
<div class="file-pwd-list"> |
|||
<div class="pwd-box"> |
|||
<p>密码提示</p> |
|||
<el-button type="danger" :icon="Delete" circle @click="addPwd"/> |
|||
<el-tag type="primary">default</el-tag> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<el-dialog v-model="dialogShow" title="添加密码" width="350px"> |
|||
<span> |
|||
<el-form> |
|||
<el-form-item label="密码提示"> |
|||
<el-input v-model="formData.pwdName"/> |
|||
</el-form-item> |
|||
<el-form-item label="密码"> |
|||
<el-input v-model="formData.pwd" show-password/> |
|||
</el-form-item> |
|||
<el-form-item label="是否为默认密码"> |
|||
<el-switch v-model="formData.isDefault"/> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="dialogShow = false"> |
|||
确认 |
|||
</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</span> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { t } from "@/system"; |
|||
import { |
|||
fetchGet, |
|||
getApiUrl, |
|||
getSystemConfig, |
|||
setSystemKey, |
|||
} from "@/system/config"; |
|||
import { onMounted, ref } from "vue"; |
|||
const config = getSystemConfig(); |
|||
const isSetPwd = ref(false); |
|||
async function setFilePwd() { |
|||
isSetPwd.value = !isSetPwd.value |
|||
const params = { |
|||
isPwd: isSetPwd.value ? 1 : 0 |
|||
} |
|||
await fetchGet(`${getApiUrl()}/file/changeispwd?ispwd=${params.isPwd}`); |
|||
setSystemKey("file", params); |
|||
import { Plus, Delete } from '@element-plus/icons-vue' |
|||
import { reactive, ref } from "vue"; |
|||
const dialogShow = ref(false) |
|||
const formData = reactive({ |
|||
pwdName: '', |
|||
pwd: '', |
|||
isDefault: '' |
|||
}) |
|||
function addPwd() { |
|||
dialogShow.value = true |
|||
} |
|||
// import { t } from "@/system"; |
|||
// import { |
|||
// fetchGet, |
|||
// getApiUrl, |
|||
// getSystemConfig, |
|||
// setSystemKey, |
|||
// } from "@/system/config"; |
|||
// const config = getSystemConfig(); |
|||
// const isSetPwd = ref(false); |
|||
// async function setFilePwd() { |
|||
// isSetPwd.value = !isSetPwd.value |
|||
// const params = { |
|||
// isPwd: isSetPwd.value ? 1 : 0 |
|||
// } |
|||
// await fetchGet(`${getApiUrl()}/file/changeispwd?ispwd=${params.isPwd}`); |
|||
// setSystemKey("file", params); |
|||
|
|||
} |
|||
onMounted(() => { |
|||
isSetPwd.value = config.file.isPwd ? true : false; |
|||
}); |
|||
// } |
|||
// onMounted(() => { |
|||
// isSetPwd.value = config.file.isPwd ? true : false; |
|||
// }); |
|||
</script> |
|||
|
|||
<style scoped> |
|||
@import "./setStyle.css"; |
|||
.file-pwd-box { |
|||
<style scoped lang="scss"> |
|||
@import "./setStyle.css"; |
|||
.file-pwd-list-box { |
|||
width: 100%; |
|||
height: 100%; |
|||
.file-pwd-list { |
|||
width: 100%; |
|||
height: 90%; |
|||
padding: 10px; |
|||
box-sizing: border-box; |
|||
background-color: rgb(248, 247, 247); |
|||
overflow-y: scroll; |
|||
|
|||
.pwd-box { |
|||
width: 95%; |
|||
height: 60px; |
|||
padding: 10px 30px; |
|||
margin: 10px auto; |
|||
border: 1px solid black; |
|||
background-color: white; |
|||
box-sizing: border-box; |
|||
|
|||
p { |
|||
display: inline-block; |
|||
height: 38px; |
|||
line-height: 38px; |
|||
margin: 0; |
|||
} |
|||
.el-tag { |
|||
float: right; |
|||
margin: 5px 20px; |
|||
} |
|||
.el-button { |
|||
float: right; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
/* .file-pwd-box { |
|||
padding-top: 20px; |
|||
} |
|||
.setting-item { |
|||
display: flex; |
|||
align-items: center; |
|||
} |
|||
} */ |
|||
</style> |
|||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Loading…
Reference in new issue