mirror of https://gitee.com/godoos/godoos.git
10 changed files with 234 additions and 184 deletions
@ -1,74 +1,114 @@ |
|||||
<template> |
<template> |
||||
<div class="file-pwd-box"> |
<el-button type="primary" :icon="Plus" circle @click="addPwd"/> |
||||
<!-- <div v-if="setPwd"> |
<div class="file-pwd-list-box"> |
||||
<div class="setting-item"> |
<div class="file-pwd-list"> |
||||
<label>文件密码</label> |
<div class="pwd-box"> |
||||
<el-input |
<p>密码提示</p> |
||||
v-model="filePwd" |
<el-button type="danger" :icon="Delete" circle @click="addPwd"/> |
||||
placeholder="请设置6-10位的密码" |
<el-tag type="primary">default</el-tag> |
||||
type="password" |
|
||||
show-password |
|
||||
/> |
|
||||
</div> |
</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> |
||||
</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> |
</template> |
||||
|
|
||||
<script lang="ts" setup> |
<script lang="ts" setup> |
||||
import { t } from "@/system"; |
import { Plus, Delete } from '@element-plus/icons-vue' |
||||
import { |
import { reactive, ref } from "vue"; |
||||
fetchGet, |
const dialogShow = ref(false) |
||||
getApiUrl, |
const formData = reactive({ |
||||
getSystemConfig, |
pwdName: '', |
||||
setSystemKey, |
pwd: '', |
||||
} from "@/system/config"; |
isDefault: '' |
||||
import { onMounted, ref } from "vue"; |
}) |
||||
const config = getSystemConfig(); |
function addPwd() { |
||||
const isSetPwd = ref(false); |
dialogShow.value = true |
||||
async function setFilePwd() { |
|
||||
isSetPwd.value = !isSetPwd.value |
|
||||
const params = { |
|
||||
isPwd: isSetPwd.value ? 1 : 0 |
|
||||
} |
} |
||||
await fetchGet(`${getApiUrl()}/file/changeispwd?ispwd=${params.isPwd}`); |
// import { t } from "@/system"; |
||||
setSystemKey("file", params); |
// 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(() => { |
// onMounted(() => { |
||||
isSetPwd.value = config.file.isPwd ? true : false; |
// isSetPwd.value = config.file.isPwd ? true : false; |
||||
}); |
// }); |
||||
</script> |
</script> |
||||
|
|
||||
<style scoped> |
<style scoped lang="scss"> |
||||
@import "./setStyle.css"; |
@import "./setStyle.css"; |
||||
.file-pwd-box { |
.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; |
padding-top: 20px; |
||||
} |
} |
||||
.setting-item { |
.setting-item { |
||||
display: flex; |
display: flex; |
||||
align-items: center; |
align-items: center; |
||||
} |
} */ |
||||
</style> |
</style> |
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Loading…
Reference in new issue