update i18n

This commit is contained in:
2023-07-17 17:31:42 +08:00
parent 1f3f9d7b31
commit 248c57b338
64 changed files with 504 additions and 196 deletions

View File

@ -431,7 +431,7 @@
<el-button type="primary" @click="submitForm">{{
t("admin.common.confirm")
}}</el-button>
<el-button @click="cancel"> </el-button>
<el-button @click="cancel">{{ t("admin.common.cancel") }}</el-button>
</div>
</template>
</el-dialog>
@ -480,7 +480,9 @@
<el-button type="primary" @click="submitFileForm">{{
t("admin.common.confirm")
}}</el-button>
<el-button @click="upload.open = false"> </el-button>
<el-button @click="upload.open = false">{{
t("admin.common.cancel")
}}</el-button>
</div>
</template>
</el-dialog>
@ -590,7 +592,9 @@ const data = reactive({
phonenumber: [
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
message: computed(() =>
t("admin.validation.pleaseEnterTheCorrectFormatOfThePhoneNumber")
),
trigger: "blur",
},
],

View File

@ -41,8 +41,10 @@
:before-upload="beforeUpload"
>
<el-button>
选择
<el-icon class="el-icon--right"><Upload /></el-icon>
{{ t("common.select") }}
<el-icon class="el-icon--right">
<Upload />
</el-icon>
</el-button>
</el-upload>
</el-col>
@ -59,7 +61,9 @@
<el-button icon="RefreshRight" @click="rotateRight()"></el-button>
</el-col>
<el-col :lg="{ span: 2, offset: 6 }" :md="2">
<el-button type="primary" @click="uploadImg()"> </el-button>
<el-button type="primary" @click="uploadImg()">{{
t("common.submit")
}}</el-button>
</el-col>
</el-row>
</el-dialog>
@ -71,13 +75,16 @@ import "vue-cropper/dist/index.css";
import { VueCropper } from "vue-cropper";
import { uploadAvatar } from "@/api/system/user";
import useUserStore from "@/store/modules/user";
import { computed } from "vue";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
const userStore = useUserStore();
const { proxy } = getCurrentInstance();
const open = ref(false);
const visible = ref(false);
const title = ref("修改头像");
const title = computed(() => t("headerMenu.changeAvatar"));
//图片裁剪数据
const options = reactive({
@ -93,25 +100,31 @@ const options = reactive({
function editCropper() {
open.value = true;
}
/** 打开弹出层结束时的回调 */
function modalOpened() {
visible.value = true;
}
/** 覆盖默认上传行为 */
function requestUpload() {}
/** 向左旋转 */
function rotateLeft() {
proxy.$refs.cropper.rotateLeft();
}
/** 向右旋转 */
function rotateRight() {
proxy.$refs.cropper.rotateRight();
}
/** 图片缩放 */
function changeScale(num) {
num = num || 1;
proxy.$refs.cropper.changeScale(num);
}
/** 上传预处理 */
function beforeUpload(file) {
if (file.type.indexOf("image/") == -1) {
@ -126,6 +139,7 @@ function beforeUpload(file) {
};
}
}
/** 上传图片 */
function uploadImg() {
proxy.$refs.cropper.getCropBlob((data) => {
@ -140,10 +154,12 @@ function uploadImg() {
});
});
}
/** 实时预览 */
function realTime(data) {
options.previews = data;
}
/** 关闭窗口 */
function closeDialog() {
options.img = userStore.avatar;

View File

@ -47,7 +47,9 @@ const rules = ref({
{ required: true, message: "手机号码不能为空", trigger: "blur" },
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
message: computed(() =>
t("admin.validation.pleaseEnterTheCorrectFormatOfThePhoneNumber")
),
trigger: "blur",
},
],