Commit 1ad7b273 authored by 夏敏伟's avatar 夏敏伟

删除部分无用组件

parent f13f920d
Pipeline #508 canceled with stages
import request from "@/utils/request";
/**
* @param data请求接口传递的参数
* @return {Promise}
*/
//登录接口
export const login = (data) => {
return request({
url: '/rest/system/user/login',
method: 'POST',
data
})
}
\ No newline at end of file
<template>
<a-modal class="handleForm" :visible="visible" :title="title" :width="600" :bodyStyle="{ padding: '16px 24px' }" @ok="handleOk" @cancel="handleCancel" :destroyOnClose="true" :maskClosable="false">
<video ref="local_video1" width="560" height="480" style="object-fit: fill" autoplay></video>
</a-modal>
</template>
<script setup>
import { reactive, ref, defineProps, onMounted, getCurrentInstance } from "vue";
import { message } from 'ant-design-vue';
const props = defineProps({
visible: Boolean,
title: String,
});
const emit = defineEmits(["handleSubmit", "changeCancel"]);
const local_video = ref("");
/**打开摄像头 */
const OnCamera = () => {
navigator.getUserMedia(
{
audio: false,
video: true,
},
function (stream) {
local_video.value.srcObject = stream;
},
function (error) {
console.log(error);
message.warning('未找到摄像头设备,请检查设备是否插紧');
}
);
};
/**关闭摄像头 */
const OffCamera = () => {
if (local_video.value.srcObject != null) {
let stream = local_video.value.srcObject;
stream.getTracks().forEach(function (track) {
track.stop();
});
local_video.value.srcObject = null;
}
};
const imgBase64 = ref("");
/**截图 */
const screenshot = () => {
const canvas = document.createElement("canvas");
const canvasCtx = canvas.getContext("2d");
const ratio = window.devicePixelRatio || 1;
canvasCtx.scale(ratio, ratio);
canvas.width = local_video.value.offsetWidth * ratio;
canvas.height = local_video.value.offsetHeight * ratio;
canvasCtx.drawImage(local_video.value, 0, 0, canvas.width, canvas.height);
imgBase64.value = canvas.toDataURL("image/png");
OffCamera();
};
// 提交事件
const handleOk = async () => {
screenshot();
await emit("handleSubmit", imgBase64, handleCancel);
};
// 关闭弹框事件
const handleCancel = async () => {
OffCamera();
await emit("changeCancel", false);
};
onMounted(() => {
const instance = getCurrentInstance();
local_video.value = instance?.refs.local_video1;
OnCamera();
});
</script>
<style lang="less" scoped>
.handleForm {
:deep(.ant-modal-content .ant-modal-close-x) {
width: 49px;
height: 49px;
line-height: 49px;
}
:deep(.ant-modal-content .ant-modal-body) {
padding-block: 16px;
}
.form {
:deep(.ant-form-item-with-help) {
margin-bottom: -16px;
}
:deep(.ant-input-number, .ant-picker) {
width: 100%;
}
:deep(.ant-form-item) {
margin-right: 0;
margin-bottom: 10px;
}
}
.dropPoint {
display: flex;
justify-content: space-between;
align-items: center;
> .ant-input {
flex: 1;
margin-right: 10px;
}
}
}
</style>
\ No newline at end of file
<template>
<a-modal
class="handleForm"
:visible="visible"
:title="title"
:width="800"
:bodyStyle="{ padding: '16px 24px' }"
@ok="handleOk"
@cancel="handleCancel"
:destroyOnClose="true"
:maskClosable="false"
>
<div style="display: flex">
<div style="width: 65%">
<!--使用ref属性给图片元素命名为imageRef-->
<img ref="imageRef" :src="imageSrc" alt="image" style="width: 600px" />
<div style="margin-top: 20px">
<a-space :size="40">
<a-button type="primary" @click="retake">重拍</a-button>
<a-button type="primary" @click="cropImage">裁剪图片</a-button>
</a-space>
</div>
</div>
<div style="width: 35%; text-align: center; margin-left: 20px">
<div style="font-size: 20px; line-height: 70px; font-weight: 600">
<span>预览</span>
</div>
<div>
<a-image
width="186.829px"
height="230px"
:src="croppedImage"
fallback="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40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nQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="
/>
</div>
</div>
</div>
</a-modal>
</template>
<script setup>
import { ref, onMounted, onBeforeUnmount } from "vue";
import Cropper from "cropperjs";
import "cropperjs/dist/cropper.css";
const props = defineProps({
//图片地址
imageSrc: {
type: String,
required: true,
},
//aspectRatio:置裁剪框为固定的宽高比
aspectRatio: {
type: Number,
default: 0.812,
},
//viewMode: 视图控制
viewMode: {
type: Number,
default: 1,
},
//autoCropArea: 设置裁剪区域占图片的大小 值为 0-1 默认 0.8 表示 80%的区域
autoCropArea: {
type: Number,
default: 0.8,
},
visible: Boolean,
title: String,
});
//绑定图片的dom对象
const imageRef = ref(null);
let cropper = null;
//使用Cropper构造函数创建裁剪器实例,并将图片元素和一些裁剪选项传入
onMounted(() => {
new_Cropper();
});
/**导入图片 */
const new_Cropper = () => {
cropper = new Cropper(imageRef.value, {
aspectRatio: props.aspectRatio,
viewMode: props.viewMode,
autoCropArea: props.autoCropArea,
});
};
//定义方法
const emit = defineEmits([
"updateImageSrc",
"changeCancel",
"handleSubmit",
"handleRetake",
]);
//在cropImage函数中,获取裁剪后的图片数据URL,并使用emit方法触发updateImageSrc事件,
// 将裁剪后的图片数据URL传递给父组件。
const croppedImage = ref("");
const cropImage = () => {
const canvas = cropper.getCroppedCanvas();
croppedImage.value = canvas.toDataURL();
// emit("updateImageSrc", croppedImage);
};
/**重拍 */
const retake = async () => {
await emit("handleRetake", {}, handleCancel);
};
// 提交事件
const handleOk = async () => {
await emit("handleSubmit", croppedImage, handleCancel);
};
// 关闭弹框事件
const handleCancel = async () => {
await emit("changeCancel");
};
//销毁
onBeforeUnmount(() => {
cropper.destroy();
});
</script>
\ No newline at end of file
<script setup>
import { onMounted, reactive } from "vue";
import { getInfo } from "../api/commonapi";//引入接口方法
import { BorderBox3 as DvBorderBox3 } from '@kjgl77/datav-vue3'
const userInfo = reactive({
userName: "XXX",
age: "XX",
});
onMounted(() => {
//调接口,处理返回结果
getInfo({ orgid: "3348847743" }).then((res) => {
userInfo.userName=res.userName
userInfo.age=res.age
});
});
</script>
<template>
<h1>{{ userInfo.userName }}---{{ userInfo.age }}</h1>
<div w50rem h18rem flex justify-center items-center bg-dark>
<dv-decoration1 style="width:200px;height:50px;" />
</div>
</template>
<style scoped>
</style>
\ No newline at end of file
...@@ -8,217 +8,35 @@ import { ...@@ -8,217 +8,35 @@ import {
message message
} from 'ant-design-vue'; } from 'ant-design-vue';
import router from '@/router/index'; import router from '@/router/index';
import {
getAllRoom
} from '@/api/room.js'
import {
// getAllCountry,
// getAllVisa,
// getAllGender,
// getAllForeignGuest,
// getAllInternalGuest,
// getAllPlateNumber,
// getAllReasonEntry,
// getAllProvinciaUrbanAreas,
// getAllNation,
// getAllRoomType,
getAllCode
} from '@/api/default';
export const useStore = defineStore('user', () => { export const useStore = defineStore('user', () => {
const userInfo = ref(); const userInfo = ref();
const token = ref(null); const token = ref(null);
const hotelInfo = ref({
hotelId: null,
hotelAddress: null
});
const menuParams = ref({
selectedKeys: ['/inland/inlandAdd'],
openKeys: ['lkgl', '/inland/inlandAdd'],
preOpenKeys: ['lkgl'],
activeKey: '/inland/inlandAdd',
panes: [{ title: '内宾入住', key: '/inland/inlandAdd', closable: false }]
});
// const hotelId = ref(null);
const roomAll = ref([]);
// const defaultType = ref({
// countryAll: [],
// visaAll: [],
// genderAll: [],
// foreignGuestAll: [],
// internalGuestAll: [],
// plateNumberAll: [],
// reasonEntryAll: [],
// provinciaUrbanAreasAll: [],
// nationAll: [],
// roomAllType: [],
// checkInStatusAll: [],
// departmentAll: []
// });
const defaultType = ref([]);
const getUserInfo = async (param) => { const getUserInfo = async (param) => {
login(param).then(res => { // login(param).then(res => {
if (res.code == '9000') { // if (res.code == '9000') {
message.success('登录成功!'); // message.success('登录成功!');
hotelInfo.value.hotelId = param.hotelId; // token.value = res.data;
hotelInfo.value.hotelAddress = param.address; // let strings = res.data.split("."); //截取token,获取载体
token.value = res.data; // userInfo.value = JSON.parse(decodeURIComponent(escape(window.atob(strings[1].replace(/-/g, "+").replace(/_/g, "/")))));
let strings = res.data.split("."); //截取token,获取载体 // router.push({
userInfo.value = JSON.parse(decodeURIComponent(escape(window.atob(strings[1].replace(/-/g, "+").replace(/_/g, "/"))))); // name: 'homepage'
router.push({ // });
name: 'homepage' // }
}); // }).catch(err => {
getAllCode().then(res => { // message.error(err.message);
defaultType.value = res.data; // })
// for (let i = 0; i < res.data.length; i++) {
// switch (res.data[i].key) {
// case 1: //查询房间类型
// defaultType.value.roomAllType = res.data[i];
// break;
// case 2: //查询入住状态
// defaultType.value.checkInStatusAll = res.data[i];
// break;
// case 3: //查询所有内宾证件种类
// defaultType.value.internalGuestAll = res.data[i];
// break;
// case 4: //查询所有外宾证件种类
// defaultType.value.foreignGuestAll = res.data[i];
// break;
// case 5: //查询性别
// defaultType.value.genderAll = res.data[i];
// break;
// case 6: //查询所有车牌类型
// defaultType.value.plateNumberAll = res.data[i];
// break;
// case 7: //查询入境事由
// defaultType.value.reasonEntryAll = res.data[i];
// break;
// case 8: //查询所有签证种类
// defaultType.value.visaAll = res.data[i];
// break;
// case 9: //查询所有国家
// defaultType.value.countryAll = res.data[i];
// break;
// case 10: //查询所有民族
// defaultType.value.visaAll = res.data[i];
// break;
// case 11: //查询全国省市县
// defaultType.value.departmentAll = res.data[i];
// break;
// }
// }
})
//当前酒店下所有的房间号
getAllRoom({
hotelid: param.hotelId
}).then(res => {
roomAll.value = res.data;
});
// //查询所有国家
// getAllCountry().then(res => {
// defaultType.value.countryAll = res.data;
// });
// //查询所有签证种类
// getAllVisa().then(res => {
// defaultType.value.visaAll = res.data;
// })
// //查询性别
// getAllGender().then(res => {
// defaultType.value.genderAll = res.data;
// })
// //查询所有外宾证件种类
// getAllForeignGuest().then(res => {
// defaultType.value.foreignGuestAll = res.data;
// })
// //查询所有内宾证件种类
// getAllInternalGuest().then(res => {
// defaultType.value.internalGuestAll = res.data;
// })
// //查询所有车牌类型
// getAllPlateNumber().then(res => {
// defaultType.value.plateNumberAll = res.data;
// });
// //查询入境事由
// getAllReasonEntry().then(res => {
// defaultType.value.reasonEntryAll = res.data;
// })
// //查询省市县
// getAllProvinciaUrbanAreas().then(res => {
// defaultType.value.provinciaUrbanAreasAll = res.data;
// })
// //查询所有民族
// getAllNation().then(res => {
// defaultType.value.nationAll = res.data;
// })
// //查询所有房间类型
// getAllRoomType().then(res => {
// defaultType.value.roomAllType = res.data;
// })
}
}).catch(err => {
message.error(err.message);
})
} }
const clearUserInfo = () => { const clearUserInfo = () => {
userInfo.value = {}; userInfo.value = {};
localStorage.removeItem('user'); localStorage.removeItem('user');
}; };
const returnCode = key => {
if (defaultType.value.length > 0) {
let mateCode = defaultType.value.filter(item => {
return item.key == key
});
return mateCode[0].value
} else {
getCode();
}
}
const getCode = () => {
getAllCode().then(res => {
defaultType.value = res.data;
let mateCode = defaultType.value.filter(item => {
return item.key == key
});
return mateCode[0].value
})
}
const clearAll = () => {
defaultType.value = [];
roomAll.value = [];
}
const setAll = (dataCode,dataRoom) => {
defaultType.value = dataCode;
roomAll.value = dataRoom
}
return { return {
userInfo, userInfo,
token, token
hotelInfo,
menuParams,
// hotelId,
roomAll,
defaultType,
returnCode,
getUserInfo,
clearUserInfo,
clearAll,
setAll,
} }
}, { }, {
persist: true persist: true
......
This diff is collapsed.
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
<div class="login-content-form"> <div class="login-content-form">
<a-form :model="formState" @finish="handleFinish" @finishFailed="handleFinishFailed"> <a-form :model="formState" @finish="handleFinish" @finishFailed="handleFinishFailed">
<a-form-item> <a-form-item>
<a-input v-model:value="formState.user" placeholder="Username"> <a-input v-model:value="formState.username" placeholder="Username">
<template #prefix> <template #prefix>
<UserOutlined style="color: rgba(0, 0, 0, 0.25)" /> <UserOutlined style="color: rgba(0, 0, 0, 0.25)" />
</template> </template>
</a-input> </a-input>
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<a-input v-model:value="formState.password" type="password" placeholder="Password"> <a-input v-model:value="formState.passwordBase64" type="password" placeholder="Password">
<template #prefix> <template #prefix>
<LockOutlined style="color: rgba(0, 0, 0, 0.25)" /> <LockOutlined style="color: rgba(0, 0, 0, 0.25)" />
</template> </template>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<a-button type="primary" html-type="submit" :loading="loading" <a-button type="primary" html-type="submit" :loading="loading"
:disabled="formState.user === '' || formState.password === ''"> :disabled="formState.username === '' || formState.passwordBase64 === ''">
登录 登录
</a-button> </a-button>
</a-form-item> </a-form-item>
...@@ -36,26 +36,27 @@ ...@@ -36,26 +36,27 @@
import { UserOutlined, LockOutlined } from '@ant-design/icons-vue'; import { UserOutlined, LockOutlined } from '@ant-design/icons-vue';
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import router from '@/router/index.js'; import router from '@/router/index.js';
// import { login } from '../../api/login/login'; import { login } from '@/api/user.js';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
const loading = ref(false); const loading = ref(false);
const formState = reactive({ const formState = reactive({
user:'', username:'',
password:'' passwordBase64:''
}); });
const handleFinish = async (values) => { const handleFinish = async (values) => {
loading.value = true; loading.value = true;
// try { try {
// const response = await login() || []; formState.passwordBase64 = btoa(formState.passwordBase64);
// if (response.data) { const response = await login(formState) || [];
// message.success('登录成功!'); if (response.data) {
// router.push({ message.success('登录成功!');
// name: 'home' router.push({
// }); name: 'home'
// } });
// } catch (error) { }
// loading.value = false; } catch (error) {
// } loading.value = false;
}
loading.value = false; loading.value = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment