Commit fc573372 authored by 黄奎's avatar 黄奎

页面修改

parent df16d6d1
......@@ -47,7 +47,7 @@ module.exports = function(ctx) {
vueRouterMode: 'history', // available values: 'hash', 'history'
env: ctx.dev ? {
API: 'http://localhost:5001/api',
API: 'http://localhost:8300/api',
// API: 'http://192.168.10.128:8300/api',
// API: 'https://eduapi.oytour.com/api',
API_ZC: 'http://192.168.5.238:8087/api',
......
......@@ -25,8 +25,8 @@ export function getFontConfig() {
export function CommonConfig() {
return {
FileConfig: {
FileUrl: 'http://192.168.5.46:8130', //本地服务器文件预览地址
UploadUrl: 'http://192.168.5.46:8120'
FileUrl: 'http://192.168.5.214:8130', //本地服务器文件预览地址
UploadUrl: 'http://192.168.5.214:8120'
}
}
}
......@@ -296,7 +296,7 @@ export function UploadFileToALi(uploadConfig, fileFullPath, fileObj, uploadLoadd
if (locationName.indexOf('localhost') !== -1) {
uploadConfig.UploadDomain = fileConfig.FileConfig.UploadUrl;
}
let url = uploadConfig.UploadDomain + "/Upload/UploadToALiOSS?filePath=" + newFileName;
let url = uploadConfig.UploadDomain + "/Upload/UploadToALiOSS?isDomain=1&filePath=" + newFileName;
let formData = new FormData()
formData.append('myfile', fileObj)
let xhr = new XMLHttpRequest()
......@@ -332,7 +332,7 @@ export function UploadFileToTencent(uploadConfig, fileFullPath, fileObj, uploadL
if (locationName.indexOf('localhost') !== -1) {
uploadConfig.UploadDomain = fileConfig.FileConfig.UploadUrl;
}
let url = uploadConfig.UploadDomain + "/Upload/UploadToTecent?filePath=" + newFileName;
let url = uploadConfig.UploadDomain + "/Upload/UploadToTecent?isDomain=1&filePath=" + newFileName;
let formData = new FormData()
formData.append('myfile', fileObj)
let xhr = new XMLHttpRequest()
......
......@@ -21,7 +21,8 @@
width: 1px;
padding: 20px 26px;
}
.personalData .box_r2{
.personalData .box_r2 {
flex: 1;
width: 1px;
padding: 0px 0px;
......@@ -102,6 +103,7 @@
margin-top: 20px;
}
</style>
<template>
<div class="page-body personalData row" style="background: transparent;">
......@@ -117,7 +119,8 @@
<div class="text-muted" style="font-size:14px;margin-top: 12px;">
{{showObj.SchoolName}}·{{showObj.PostName}}</div>
<div class="q-mt-xs">
<q-btn style="background: var(--q-color-negative);color: white;margin-top: 10px;" size="sm" @click="logout">退出登录</q-btn>
<q-btn style="background: var(--q-color-negative);color: white;margin-top: 10px;" size="sm" @click="logout">
退出登录</q-btn>
</div>
</div>
</div>
......@@ -161,21 +164,21 @@
<div style="font-size: 12px;color: #999999;margin-top: 12px;">图片格式:png、jpg、jpeg</div>
<div class="box_r_title">基础资料</div>
<div class="box_r_input">
<q-input v-model="datamodify.EmployeeName" label="姓名"
:rules="[val => !!val || '姓名不能为空']" lazy-rules filled maxlength="20" />
<q-input v-model="datamodify.EmployeeName" label="姓名" :rules="[val => !!val || '姓名不能为空']" lazy-rules filled
maxlength="20" />
</div>
<div class="box_r_input">
<q-select filled stack-label option-value="SId" option-label="SName" v-model="datamodify.School_Id"
ref="SId" :options="CompanyList" label="校区" :dense="false" emit-value map-options />
<q-select filled stack-label option-value="SId" option-label="SName" v-model="datamodify.School_Id" ref="SId"
:options="CompanyList" label="校区" :dense="false" emit-value map-options />
</div>
<div class="box_r_title">联系方式</div>
<div class="box_r_input">
<q-input v-model="datamodify.EmployeeTel" label="电话" type='number'
:rules="[val => !!val || '电话不能为空']" lazy-rules filled maxlength="11" />
<q-input v-model="datamodify.EmployeeTel" label="电话" type='number' :rules="[val => !!val || '电话不能为空']"
lazy-rules filled maxlength="11" />
</div>
<div class="box_r_input">
<q-input v-model="datamodify.Email" label="邮箱"
:rules="[val => !!val || '邮箱不能为空']" lazy-rules filled maxlength="20" />
<q-input v-model="datamodify.Email" label="邮箱" :rules="[val => !!val || '邮箱不能为空']" lazy-rules filled
maxlength="20" />
</div>
<q-btn color="primary" style="width: 300px;margin-top: 50px;" :loading="loading1" @click='dataSubmit'>
<div class="ellipsis">
......@@ -201,7 +204,8 @@
<q-input v-model="passwordMsg.NewSurePassWord" label="请再次输入新密码" type='password' ref='NewSurePassWord'
:rules="[val => !!val || '请再次输入新密码']" lazy-rules filled />
</div>
<q-btn color="primary" style="width: 300px;margin-top: 50px;" :loading="loading2" label="确定修改" type="submit" > </q-btn>
<q-btn color="primary" style="width: 300px;margin-top: 50px;" :loading="loading2" label="确定修改" type="submit">
</q-btn>
</form>
......@@ -221,9 +225,9 @@
UploadSelfFile
} from '../../api/common/common'
const defaultpassword = {
OldPassWord:'',
NewPassWord:'',
NewSurePassWord:'',
OldPassWord: '',
NewPassWord: '',
NewSurePassWord: '',
}
import summaryInfo from '../../components/user/summaryInfo'
import Lockr from 'lockr'
......@@ -237,12 +241,12 @@
data() {
return {
loading1: false,
loading2:false,
loading2: false,
showObj: {},
rightType: 0,//右边显示类型
rightType: 0, //右边显示类型
datamodify: {},
CompanyList: [],
passwordMsg:Object.assign({},defaultpassword),
passwordMsg: Object.assign({}, defaultpassword),
}
},
created() {
......@@ -260,7 +264,7 @@
this.getBranchList()
},
methods: {
getBranchList() {//获取校区
getBranchList() { //获取校区
getSchoolDropdown({}).then(res => {
this.CompanyList = res.Data;
}).catch(() => {
......@@ -269,13 +273,16 @@
},
uploadFileBtn(file) { //上传
UploadSelfFile('studentIcon', file.file, x => {
//UploadFileToTencent
//UploadSelfFile
this.UploadFileToTencent('studentIcon', file.file, x => {
if (x.Code == 1) {
this.datamodify.UserIcon = x.FileUrl
}
}, 1);
},
logout() {//退出登录
logout() { //退出登录
this.$store
.dispatch('LogOut')
.then(() => {
......@@ -285,7 +292,7 @@
})
},
dataSubmit() {//资料提交
dataSubmit() { //资料提交
if (this.datamodify.UserIcon == null || this.datamodify.UserIcon == '') {
this.$q.notify({
type: 'negative',
......@@ -334,14 +341,14 @@
this.showObj.Email = this.datamodify.Email
this.showObj.School_Id = this.datamodify.School_Id
this.CompanyList.map(x=>{
if(x.SId == this.datamodify.School_Id){
this.CompanyList.map(x => {
if (x.SId == this.datamodify.School_Id) {
this.showObj.SchoolName = x.SName;
return
}
})
Lockr.set("loginUserInfo",this.showObj)
this.$store.dispatch("setUserUpdate",this.showObj)
Lockr.set("loginUserInfo", this.showObj)
this.$store.dispatch("setUserUpdate", this.showObj)
// location.reload()
// this.$router.push({
// path: this.redirect || '/home'
......@@ -358,14 +365,13 @@
})
},
passwordSubmit () {
passwordSubmit() {
this.$refs.OldPassWord.validate()
this.$refs.NewPassWord.validate()
this.$refs.NewSurePassWord.validate()
if (this.$refs.OldPassWord.hasError || this.$refs.NewPassWord.hasError|| this.$refs.NewSurePassWord.hasError) {
if (this.$refs.OldPassWord.hasError || this.$refs.NewPassWord.hasError || this.$refs.NewSurePassWord.hasError) {
this.formHasError = true
}
else {
} else {
// 掉接口
updateUserPassword(this.passwordMsg).then(res => {
if (res.Code == 1) {
......@@ -408,4 +414,5 @@
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
......@@ -160,7 +160,7 @@ export default {
document.body.appendChild(link);
link.click();
successCall(res);
}).catch(function (res) { });
}).catch(function (res) {});
},
//HTTP提交数据
......@@ -272,7 +272,7 @@ export default {
}
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) { } else if (res.resultCode == 10005) {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {} else if (res.resultCode == 10005) {
this.$router.go(-1);
} else {
successCall(res);
......@@ -296,7 +296,7 @@ export default {
document.body.appendChild(link);
link.click();
successCall(res);
}).catch(function (res) { });
}).catch(function (res) {});
},
//价钱格式化,三位数逗号分隔,保留两位小数 duanjun
Vue.prototype.moneyFormat = function (value) {
......@@ -433,7 +433,9 @@ export default {
},
//上传文件到云存储
Vue.prototype.UploadFileToTencent = function (path, fileObj, callback) {
var upInfo = JSON.parse(localStorage.uploadInfo);
var localCache = this.getLocalStorage();
if (localCache && localCache.UploadConfig) {
let maxSize = 500 * 1024
if ((fileObj.type == "image/png" || fileObj.type == "image/jpeg") && fileObj.size > maxSize) {
let that = this
......@@ -454,20 +456,34 @@ export default {
var newFile = new File([u8arr], fileObj.name, {
type: mime
});
this.RealFileToTencent(path,newFile,callback)
}).catch(function (error) {
}).always(function () {
//不管成功或失败,都会执行
})
} else {
this.RealFileToTencent(path,fileObj,callback)
}
}
},
//真实上传文件方法
Vue.prototype.RealFileToTencent = function (path, fileObj, callback) {
let str = '';
str = "/2024/"
var newFileName = str + path;
let url = upInfo.UploadDomain + "/Upload/UploadToTecent?filePath=" + newFileName;
var upInfo = this.getLocalStorage().UploadConfig;
var u_url = upInfo.UploadDomain;
//u_url = "http://192.168.5.46:8120"
let url = u_url + "/Upload/UploadToTecent?isDomain=1&filePath=" + newFileName;
let formData = new FormData()
formData.append('myfile', newFile)
formData.append('myfile', fileObj)
let xhr = new XMLHttpRequest()
xhr.onload = function () {
uploadLoadding.hide();
var jsonObj = JSON.parse(xhr.responseText);
if (jsonObj.StatusCode === 1 && callback) {
var uploadResult = {
resultCode: 1,
Code:1,
FileName: fileObj.name,
FileUrl: jsonObj.FilePath,
}
......@@ -478,15 +494,7 @@ export default {
}
xhr.open('post', url, true)
xhr.send(formData)
}).catch(function (error) {
}).always(function () {
//不管成功或失败,都会执行
})
} else {
}
},
//公用判断图片地址 判断是否包含http
Vue.prototype.getIconLink = function (url) {
......@@ -519,7 +527,7 @@ export default {
});
return getBlob
},
Vue.prototype.accAdd = function (arg1, arg2) {//加法精密计算
Vue.prototype.accAdd = function (arg1, arg2) { //加法精密计算
var r1;
var r2;
var m;
......@@ -552,18 +560,16 @@ export default {
return (arg1 + arg2) / m;
},
// 减法
Vue.prototype.subtr = function(arg1, arg2) {
Vue.prototype.subtr = function (arg1, arg2) {
var r1, r2, m, n;
try {
r1 = arg1.toString().split(".")[1].length;
}
catch (e) {
} catch (e) {
r1 = 0;
}
try {
r2 = arg2.toString().split(".")[1].length;
}
catch (e) {
} catch (e) {
r2 = 0;
}
m = Math.pow(10, Math.max(r1, r2));
......@@ -573,17 +579,29 @@ export default {
return ((arg1 * m - arg2 * m) / m).toFixed(n);
}
// 乘法获取准确值
Vue.prototype.accMul = function(arg1,arg2){
var m=0,s1=arg1.toString(),s2=arg2.toString();
try{m+=s1.split(".")[1].length}catch(e){}
try{m+=s2.split(".")[1].length}catch(e){}
return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)
Vue.prototype.accMul = function (arg1, arg2) {
var m = 0,
s1 = arg1.toString(),
s2 = arg2.toString();
try {
m += s1.split(".")[1].length
} catch (e) {}
try {
m += s2.split(".")[1].length
} catch (e) {}
return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
}
// 除法获取精确值
Vue.prototype.accDiv = function(arg1, arg2) {
var t1 = 0, t2 = 0, r1, r2;
try { t1 = arg1.toString().split(".")[1].length } catch (e) { }
try { t2 = arg2.toString().split(".")[1].length } catch (e) { }
Vue.prototype.accDiv = function (arg1, arg2) {
var t1 = 0,
t2 = 0,
r1, r2;
try {
t1 = arg1.toString().split(".")[1].length
} catch (e) {}
try {
t2 = arg2.toString().split(".")[1].length
} catch (e) {}
Math.r1 = Number(arg1.toString().replace(".", ""))
Math.r2 = Number(arg2.toString().replace(".", ""))
return (Math.r1 / Math.r2) * Math.pow(10, t2 - t1);
......
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