提交功能
This commit is contained in:
parent
5de7ce79ae
commit
4d63084f45
|
@ -59,3 +59,35 @@ export const remove = (ids) => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export const sendEmail = (email,tenantId) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/' + moduleName + '/ui/administrator/sendEmailCode',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
email,
|
||||||
|
tenantId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export const checkAccountOrEmail = (email,tenantId) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/' + moduleName + '/ui/administrator/checkAccountOrEmail',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
email,
|
||||||
|
tenantId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export const updatePassword = (email,newPassword,tenantId,code) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/' + moduleName + '/ui/administrator/updatePassword',
|
||||||
|
method: 'put',
|
||||||
|
params: {
|
||||||
|
email,
|
||||||
|
newPassword,
|
||||||
|
tenantId,
|
||||||
|
code
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
|
@ -84,7 +84,6 @@ export const useUserInfo = defineStore('userInfo', {
|
||||||
// })
|
// })
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,8 +2,7 @@ import axios from 'axios';
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||||
import qs from 'qs';
|
import qs from 'qs';
|
||||||
import { Session } from '/@/utils/storage';
|
import { Session } from '/@/utils/storage';
|
||||||
|
export const moduleName = 'yyhouc-biz-vordm';
|
||||||
export const moduleName = 'biz-vordm';
|
|
||||||
export const crawlModule = 'vordm-crawl';
|
export const crawlModule = 'vordm-crawl';
|
||||||
export const twitterModule = "vordm-twitter";
|
export const twitterModule = "vordm-twitter";
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
|
@ -21,7 +20,6 @@ const service = axios.create({
|
||||||
service.interceptors.request.use(
|
service.interceptors.request.use(
|
||||||
(config) => {
|
(config) => {
|
||||||
config.headers['Authorization'] = 'Basic Vm9SRE1BZG1pbjp2b3JkbV9hZG1pbl9zZWNyZXQ=';
|
config.headers['Authorization'] = 'Basic Vm9SRE1BZG1pbjp2b3JkbV9hZG1pbl9zZWNyZXQ=';
|
||||||
// 在发送请求之前做些什么 token
|
|
||||||
if (Session.getEx('token')) {
|
if (Session.getEx('token')) {
|
||||||
config.headers['Blade-Auth'] = `Bearer ${Session.getEx('token')}`;
|
config.headers['Blade-Auth'] = `Bearer ${Session.getEx('token')}`;
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,6 +146,7 @@ const onSignIn = () => {
|
||||||
};
|
};
|
||||||
// 登录成功后的跳转
|
// 登录成功后的跳转
|
||||||
const signInSuccess = () => {
|
const signInSuccess = () => {
|
||||||
|
console.log('登录成功');
|
||||||
// 初始化登录成功时间问候语
|
// 初始化登录成功时间问候语
|
||||||
let currentTimeInfo = currentTime.value;
|
let currentTimeInfo = currentTime.value;
|
||||||
// 登录成功,跳到转首页
|
// 登录成功,跳到转首页
|
||||||
|
|
|
@ -0,0 +1,230 @@
|
||||||
|
<template>
|
||||||
|
<el-form size="large" class="login-content-form" :rules="rules" :model="state.ruleForm">
|
||||||
|
<el-form-item class="login-animation1" prop="userName" >
|
||||||
|
<el-input text placeholder="Please input email," v-model="state.ruleForm.userName" clearable autocomplete="off">
|
||||||
|
<template #prefix>
|
||||||
|
<el-icon class="el-input__icon"><ele-User /></el-icon>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="login-animation3" prop="code">
|
||||||
|
<el-col :span="15">
|
||||||
|
<el-input text maxlength="6" placeholder="Please input validate code" v-model="state.ruleForm.code" clearable autocomplete="off">
|
||||||
|
<template #prefix>
|
||||||
|
<el-icon class="el-input__icon"><ele-Position /></el-icon>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1"></el-col>
|
||||||
|
<el-col :span="8" style="width: 132px; height: 48px;margin-top: 7px;">
|
||||||
|
<el-button class="login-content-code" v-waves @Click="send" ref ="sendRef" :disabled="state.send!='Send'">{{state.send}}</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="login-animation2" prop="password">
|
||||||
|
<el-input :type="state.isShowPassword ? 'text' : 'password'" placeholder="Please input new password" v-model="state.ruleForm.password" autocomplete="off">
|
||||||
|
<template #prefix>
|
||||||
|
<el-icon class="el-input__icon"><ele-Unlock /></el-icon>
|
||||||
|
</template>
|
||||||
|
<template #suffix>
|
||||||
|
<i
|
||||||
|
class="iconfont el-input__icon login-content-password"
|
||||||
|
:class="state.isShowPassword ? 'icon-yincangmima' : 'icon-xianshimima'"
|
||||||
|
@click="state.isShowPassword = !state.isShowPassword"
|
||||||
|
>
|
||||||
|
</i>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="login-animation2" prop="password1">
|
||||||
|
<el-input :type="state.isShowPassword1 ? 'text' : 'password'" placeholder="Please enter a confirmation password" v-model="state.ruleForm.password1" autocomplete="off">
|
||||||
|
<template #prefix>
|
||||||
|
<el-icon class="el-input__icon"><ele-Unlock /></el-icon>
|
||||||
|
</template>
|
||||||
|
<template #suffix>
|
||||||
|
<i
|
||||||
|
class="iconfont el-input__icon login-content-password"
|
||||||
|
:class="state.isShowPassword1 ? 'icon-yincangmima' : 'icon-xianshimima'"
|
||||||
|
@click="state.isShowPassword1 = !state.isShowPassword1"
|
||||||
|
>
|
||||||
|
</i>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="login-animation4">
|
||||||
|
<el-button type="primary" class="login-content-submit" round v-waves @click="onSignIn" :loading="state.loading.signIn">
|
||||||
|
<span>Edit</span>
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="forgotPassword">
|
||||||
|
import { reactive, computed, onMounted,ref } from 'vue';
|
||||||
|
import { ElMessage } from 'element-plus';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { useThemeConfig } from '/@/stores/themeConfig';
|
||||||
|
import {sendEmail,checkAccountOrEmail,updatePassword} from '/@/api/response/administrator';
|
||||||
|
//引入Session
|
||||||
|
import { Local as Session } from '/@/utils/storage';
|
||||||
|
// 定义变量内容
|
||||||
|
const storesThemeConfig = useThemeConfig();
|
||||||
|
const { website } = storeToRefs(storesThemeConfig);
|
||||||
|
const sendRef = ref(null);
|
||||||
|
//定义组件消息
|
||||||
|
const e =defineEmits(["success"]);
|
||||||
|
const state = reactive({
|
||||||
|
isShowPassword: false,
|
||||||
|
ruleForm: {
|
||||||
|
//租户ID
|
||||||
|
tenantId: website.value.tenantId,
|
||||||
|
//用户名
|
||||||
|
userName: "792163605@qq.com",
|
||||||
|
//密码
|
||||||
|
password: "",
|
||||||
|
//账号类型
|
||||||
|
type: "account",
|
||||||
|
//验证码key
|
||||||
|
key: "",
|
||||||
|
//验证码code
|
||||||
|
code: "",
|
||||||
|
},
|
||||||
|
loading: {
|
||||||
|
signIn: false,
|
||||||
|
},
|
||||||
|
send:"Send",
|
||||||
|
captchaMode: website.value.captchaMode,
|
||||||
|
//验证码localStroage key
|
||||||
|
captchaKey: "captchaKey",
|
||||||
|
});
|
||||||
|
const rules = reactive({
|
||||||
|
userName: [
|
||||||
|
{ required: true, message: "Please enter your email", trigger: "blur" },
|
||||||
|
{ type: "email", message: "Please enter the email", trigger: "blur" },
|
||||||
|
//自定义验证是否存在
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
checkAccountOrEmail(value,website.value.tenantId).then((res) => {
|
||||||
|
//判断res.data 是否存在 或者等于false 或者空
|
||||||
|
if (res.data || res.data == false || res.data == "") {
|
||||||
|
//提示是否注册
|
||||||
|
callback(new Error("The email is not registered"));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
password: [
|
||||||
|
{ required: true, message: "Please enter a new password", trigger: "blur" },
|
||||||
|
{ min: 6, max: 20, message: "The password length is 6-20 characters", trigger: "blur" },
|
||||||
|
],
|
||||||
|
password1: [
|
||||||
|
{ required: true, message: "Please enter a confirmation password", trigger: "blur" },
|
||||||
|
{ min: 6, max: 20, message: "The password length is 6-20 characters", trigger: "blur" },
|
||||||
|
//验证是否与password一致
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
if (value != state.ruleForm.password) {
|
||||||
|
callback(new Error("The password is inconsistent"));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
code: [{ required: true, message: "Please enter the verification code", trigger: "blur" }],
|
||||||
|
})
|
||||||
|
onMounted(() => {
|
||||||
|
let time = Session.get(state.captchaKey);
|
||||||
|
if (time&&time>0) {
|
||||||
|
state.send = time + "s";
|
||||||
|
buttonTime(time);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const send = () => {
|
||||||
|
buttonTime(60);
|
||||||
|
const { userName } = state.ruleForm;
|
||||||
|
if (!userName) {
|
||||||
|
ElMessage.error("Please enter your email address");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
sendEmail(userName,website.value.tenantId).then((res) => {
|
||||||
|
if (res.data) {
|
||||||
|
//使用英语提示验证码已发送到您的邮箱
|
||||||
|
ElMessage.success("The verification code has been sent to your email");
|
||||||
|
} else {
|
||||||
|
clearInterval(timer);
|
||||||
|
ElMessage.error(res.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//按钮倒计时
|
||||||
|
const buttonTime = (time) => {
|
||||||
|
state.send = time + "s";
|
||||||
|
let timer = setInterval(() => {
|
||||||
|
time--;
|
||||||
|
Session.set(state.captchaKey, time);
|
||||||
|
state.send = time + "s";
|
||||||
|
if (time <= 0) {
|
||||||
|
clearInterval(timer);
|
||||||
|
state.send = "Send";
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
};
|
||||||
|
// 修改
|
||||||
|
const onSignIn = () => {
|
||||||
|
updatePassword(
|
||||||
|
state.ruleForm.userName,
|
||||||
|
state.ruleForm.password,
|
||||||
|
state.ruleForm.tenantId,
|
||||||
|
state.ruleForm.code
|
||||||
|
).then((res) => {
|
||||||
|
if (res) {
|
||||||
|
ElMessage.success("Password changed successfully");
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.login-content-form {
|
||||||
|
margin-top: 12px;
|
||||||
|
@for $i from 1 through 4 {
|
||||||
|
.login-animation#{$i} {
|
||||||
|
opacity: 0;
|
||||||
|
animation-name: error-num;
|
||||||
|
animation-duration: 0.5s;
|
||||||
|
animation-fill-mode: forwards;
|
||||||
|
animation-delay: calc($i/10) + s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.login-content-password {
|
||||||
|
display: inline-block;
|
||||||
|
width: 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
&:hover {
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.login-content-code {
|
||||||
|
width: 100%;
|
||||||
|
padding: 0;
|
||||||
|
font-weight: bold;
|
||||||
|
letter-spacing: 5px;
|
||||||
|
}
|
||||||
|
.login-content-submit {
|
||||||
|
width: 100%;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
font-weight: 300;
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-form-item--large {
|
||||||
|
margin-bottom: 14px !important;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -19,9 +19,9 @@
|
||||||
<el-tab-pane label="Account Login" name="account">
|
<el-tab-pane label="Account Login" name="account">
|
||||||
<Account />
|
<Account />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<!-- <el-tab-pane label="手机号登录" name="mobile">
|
<el-tab-pane label="Forgot password" name="ForgotPassword">
|
||||||
<Mobile />
|
<ForgotPassword />
|
||||||
</el-tab-pane> -->
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
<!-- <Scan v-if="state.isScan" /> -->
|
<!-- <Scan v-if="state.isScan" /> -->
|
||||||
|
@ -47,8 +47,7 @@ import loginBg from '/@/assets/login-bg.svg';
|
||||||
|
|
||||||
// 引入组件
|
// 引入组件
|
||||||
const Account = defineAsyncComponent(() => import('/@/views/login/component/account.vue'));
|
const Account = defineAsyncComponent(() => import('/@/views/login/component/account.vue'));
|
||||||
const Mobile = defineAsyncComponent(() => import('/@/views/login/component/mobile.vue'));
|
const ForgotPassword = defineAsyncComponent(() => import('/@/views/login/component/forgotPassword.vue'));
|
||||||
const Scan = defineAsyncComponent(() => import('/@/views/login/component/scan.vue'));
|
|
||||||
|
|
||||||
// 定义变量内容
|
// 定义变量内容
|
||||||
const storesThemeConfig = useThemeConfig();
|
const storesThemeConfig = useThemeConfig();
|
||||||
|
|
|
@ -420,7 +420,7 @@
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">Cancel</el-button>
|
<el-button @click="dialogVisible = false">Cancel</el-button>
|
||||||
<el-button type="danger"
|
<el-button type="danger"
|
||||||
@click="reviews(1)">
|
@click="reviewRefuse">
|
||||||
Reject
|
Reject
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary"
|
<el-button type="primary"
|
||||||
|
@ -430,19 +430,45 @@
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<selectUser ref="select"
|
<selectUser ref="select" @callback="getTableData"></selectUser>
|
||||||
@callback="getTableData"></selectUser>
|
<el-dialog v-model="state.emailDialogVisible" title="Reason for refusal" width="60%" :before-close="handleClose">
|
||||||
|
<el-form-item label="Subject:" >
|
||||||
|
<el-input v-model="state.edit.refuseTitle" placeholder="Please enter the Subject"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="Content:" > -->
|
||||||
|
|
||||||
|
<QuillEditor ref="myQuillEditor"
|
||||||
|
theme="snow"
|
||||||
|
v-model:content="state.edit.refuseReason"
|
||||||
|
:options="state.options"
|
||||||
|
placeholder="Please enter the Content"
|
||||||
|
contentType="html"
|
||||||
|
@update:content="setValue()"
|
||||||
|
style="height:500px ;"
|
||||||
|
/>
|
||||||
|
<!-- </el-form-item> -->
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="state.emailDialogVisible = false;state.edit.refuseReason=''">Cancel</el-button>
|
||||||
|
<el-button type="primary" @click="reviews(1);state.edit.refuseReaso=''">
|
||||||
|
Send
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="userResponse">
|
<script setup name="userResponse">
|
||||||
import en from 'element-plus/dist/locale/en.mjs'
|
import en from 'element-plus/dist/locale/en.mjs'
|
||||||
import { reactive, onMounted, ref, nextTick, watchEffect, defineAsyncComponent, h } from 'vue';
|
import { reactive, onMounted, ref, nextTick, watchEffect, defineAsyncComponent, h ,toRaw} from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import { getList, review, responseEndedDisasterInfo, deleteByIds } from '/@/api/disasterInfo/index';
|
import { getList, review, responseEndedDisasterInfo, deleteByIds } from '/@/api/disasterInfo/index';
|
||||||
import { getDictionary, getList as getListNew } from '/@/api/system/dictbiz';
|
import { getDictionary, getList as getListNew } from '/@/api/system/dictbiz';
|
||||||
import { useVariableStore } from '/@/stores/index.ts'
|
import { useVariableStore } from '/@/stores/index.ts'
|
||||||
|
import { QuillEditor } from '@vueup/vue-quill'
|
||||||
|
import '@vueup/vue-quill/dist/vue-quill.snow.css'
|
||||||
//引入地图
|
//引入地图
|
||||||
import Map from '/@/components/Map.vue';
|
import Map from '/@/components/Map.vue';
|
||||||
import { useDateFormat } from '@vueuse/shared';
|
import { useDateFormat } from '@vueuse/shared';
|
||||||
|
@ -457,6 +483,7 @@ import { map } from 'lodash';
|
||||||
import * as turf from '@turf/turf'
|
import * as turf from '@turf/turf'
|
||||||
const variableStore = useVariableStore();
|
const variableStore = useVariableStore();
|
||||||
const mapRef = ref();
|
const mapRef = ref();
|
||||||
|
const myQuillEditor =ref();
|
||||||
const activeName = ref('first');
|
const activeName = ref('first');
|
||||||
const select = ref();
|
const select = ref();
|
||||||
const remove = (row) => {
|
const remove = (row) => {
|
||||||
|
@ -517,6 +544,7 @@ const state = reactive({
|
||||||
//灾害类型字典项
|
//灾害类型字典项
|
||||||
dictList: [],
|
dictList: [],
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
|
emailDialogVisible: false,
|
||||||
tableData: {
|
tableData: {
|
||||||
data: [],
|
data: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
|
@ -539,6 +567,24 @@ const state = reactive({
|
||||||
wktPoint_Poly: undefined,
|
wktPoint_Poly: undefined,
|
||||||
passLat: false,
|
passLat: false,
|
||||||
passLon: false,
|
passLon: false,
|
||||||
|
//富文本配置
|
||||||
|
options: {
|
||||||
|
modules: {
|
||||||
|
toolbar: [
|
||||||
|
['bold', 'italic', 'underline', 'strike'],
|
||||||
|
[{ 'size': ['small', false, 'large', 'huge'] }],
|
||||||
|
[{ 'font': [] }],
|
||||||
|
[{ 'align': [] }],
|
||||||
|
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
|
||||||
|
[{ 'indent': '-1' }, { 'indent': '+1' }],
|
||||||
|
[{ 'header': 1 }, { 'header': 2 }],
|
||||||
|
['image'],
|
||||||
|
[{ 'direction': 'rtl' }],
|
||||||
|
[{ 'color': [] }, { 'background': [] }]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
placeholder: '请输入内容...'
|
||||||
|
},
|
||||||
});
|
});
|
||||||
// 初始化表格数据
|
// 初始化表格数据
|
||||||
const getTableData = () => {
|
const getTableData = () => {
|
||||||
|
@ -720,7 +766,15 @@ const mapClick = (res) => {
|
||||||
state.dislon = res.latlng.lng.toFixed(3)
|
state.dislon = res.latlng.lng.toFixed(3)
|
||||||
mapRef.value.mapOperations.addInteractMarker(res.latlng.lat.toFixed(3), res.latlng.lng.toFixed(3))
|
mapRef.value.mapOperations.addInteractMarker(res.latlng.lat.toFixed(3), res.latlng.lng.toFixed(3))
|
||||||
}
|
}
|
||||||
|
const setValue = () => {
|
||||||
|
const text = toRaw(myQuillEditor.value).getHTML()
|
||||||
|
}
|
||||||
|
//审批拒绝
|
||||||
|
const reviewRefuse = () => {
|
||||||
|
state.emailDialogVisible = true;
|
||||||
|
}
|
||||||
const reviews = (index) => {
|
const reviews = (index) => {
|
||||||
|
|
||||||
//将修改后的地图位置赋值到state.edit.geometry
|
//将修改后的地图位置赋值到state.edit.geometry
|
||||||
//TODO 修改地图赋值
|
//TODO 修改地图赋值
|
||||||
//state.edit.geometry = map.mapOperations.getWkt();
|
//state.edit.geometry = map.mapOperations.getWkt();
|
||||||
|
|
Loading…
Reference in New Issue