Browse Source

业务域名调试;排序调试

dev
jiangyy 5 years ago
parent
commit
5c7e24061d
  1. 4
      epmet-oper-web/src/js/columns/customer/manage/customer.js
  2. 8
      epmet-oper-web/src/js/columns/miniPro/customizedFunction.js
  3. 47
      epmet-oper-web/src/router/index.js
  4. 10
      epmet-oper-web/src/views/modules/customer/customize/ConfigEdit.vue
  5. 26
      epmet-oper-web/src/views/modules/customer/customize/ConfigItem.vue
  6. 9
      epmet-oper-web/src/views/modules/customer/manage/EditForm.vue
  7. 33
      epmet-oper-web/src/views/modules/customer/miniProAgent/BasicInfo.vue
  8. 15
      epmet-oper-web/src/views/modules/productConfig/customizeFunction/CustomFun.vue
  9. 96
      epmet-oper-web/src/views/modules/productConfig/customizeFunction/Edit.vue
  10. 64
      epmet-oper-web/src/views/pages/login.vue
  11. 155
      epmet-oper-web/src/views/pages/loginWork.vue

4
epmet-oper-web/src/js/columns/customer/manage/customer.js

@ -76,7 +76,7 @@ export default {
{ {
key: 'rootManageName', key: 'rootManageName',
title: '管理员', title: '管理员',
display: ['formA', 'formU', 'table', 'model'], display: ['table', 'model'],
type: 'input', type: 'input',
rule: [ rule: [
{ {
@ -91,7 +91,7 @@ export default {
{ {
key: 'rootManagePhone', key: 'rootManagePhone',
title: '联系方式', title: '联系方式',
display: ['formA', 'formU', 'table', 'model'], display: ['table', 'model'],
type: 'input', type: 'input',
rule: [ rule: [
{ {

8
epmet-oper-web/src/js/columns/miniPro/customizedFunction.js

@ -22,7 +22,7 @@ export default [
return '未知' return '未知'
} }
}, },
width: 80 width: 60
}, },
{ {
key: 'functionExplain', key: 'functionExplain',
@ -48,7 +48,9 @@ export default [
fixed: false, fixed: false,
block: true, block: true,
width: 100, width: 100,
tableType: 'image' tableType: 'image',
imgWidth: '30px',
imgHeight: '30px'
}, },
{ {
@ -56,7 +58,7 @@ export default [
title: '外链地址', title: '外链地址',
display: ['formA', 'formU', 'table', 'model'], display: ['formA', 'formU', 'table', 'model'],
block: true, block: true,
width: 60 width: 120
}, },
// { // {
// key: 'domainName', // key: 'domainName',

47
epmet-oper-web/src/router/index.js

@ -21,7 +21,18 @@ export const pageRoutes = [
next() next()
} }
}, },
{ path: '/login', component: () => import('@/views/pages/login'), name: 'login', meta: { title: '登录' } } {
path: '/login',
component: () => import('@/views/pages/login'),
name: 'login',
meta: { title: '登录' }
},
{
path: '/loginWork',
component: () => import('@/views/pages/loginWork'),
name: 'loginWork',
meta: { title: '工作端登录' }
}
] ]
// 模块路由(基于主入口布局页面) // 模块路由(基于主入口布局页面)
@ -32,14 +43,21 @@ export const moduleRoutes = {
redirect: { name: 'home' }, redirect: { name: 'home' },
meta: { title: '主入口布局' }, meta: { title: '主入口布局' },
children: [ children: [
{ path: '/home', component: () => import('@/views/modules/home'), name: 'home', meta: { title: '首页', isTab: true } } {
path: '/home',
component: () => import('@/views/modules/home'),
name: 'home',
meta: { title: '首页', isTab: true }
}
] ]
} }
export function addDynamicRoute(routeParams, router) { export function addDynamicRoute(routeParams, router) {
// 组装路由名称, 并判断是否已添加, 如是: 则直接跳转 // 组装路由名称, 并判断是否已添加, 如是: 则直接跳转
var routeName = routeParams.routeName var routeName = routeParams.routeName
var dynamicRoute = window.SITE_CONFIG['dynamicRoutes'].filter(item => item.name === routeName)[0] var dynamicRoute = window.SITE_CONFIG['dynamicRoutes'].filter(
(item) => item.name === routeName
)[0]
if (dynamicRoute) { if (dynamicRoute) {
return router.push({ name: routeName, params: routeParams.params }) return router.push({ name: routeName, params: routeParams.params })
} }
@ -74,18 +92,26 @@ const router = new Router({
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// 添加动态(菜单)路由 // 添加动态(菜单)路由
// 已添加或者当前路由为页面路由, 可直接访问 // 已添加或者当前路由为页面路由, 可直接访问
if (window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] || fnCurrentRouteIsPageRoute(to, pageRoutes)) { if (
window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] ||
fnCurrentRouteIsPageRoute(to, pageRoutes)
) {
return next() return next()
} }
// 获取字典列表, 添加并全局变量保存 // 获取字典列表, 添加并全局变量保存
http.get('/sys/dict/type/all').then(({ data: res }) => { http
.get('/sys/dict/type/all')
.then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return return
} }
window.SITE_CONFIG['dictList'] = res.data window.SITE_CONFIG['dictList'] = res.data
}).catch(() => { }) })
.catch(() => {})
// 获取菜单列表, 添加并全局变量保存 // 获取菜单列表, 添加并全局变量保存
http.get('/oper/access/menu/nav').then(({ data: res }) => { http
.get('/oper/access/menu/nav')
.then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
// Vue.prototype.$message.error(res.msg) // Vue.prototype.$message.error(res.msg)
return next({ name: 'login' }) return next({ name: 'login' })
@ -94,7 +120,8 @@ router.beforeEach((to, from, next) => {
fnAddDynamicMenuRoutes(window.SITE_CONFIG['menuList']) fnAddDynamicMenuRoutes(window.SITE_CONFIG['menuList'])
// next({ ...to, replace: true }) // next({ ...to, replace: true })
next({ ...to, replace: true }) next({ ...to, replace: true })
}).catch(() => { })
.catch(() => {
next({ name: 'login' }) next({ name: 'login' })
}) })
}) })
@ -141,7 +168,9 @@ function fnAddDynamicMenuRoutes (menuList = [], routes = []) {
} }
} }
// eslint-disable-next-line // eslint-disable-next-line
let URL = (menuList[i].url || '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量 let URL = (menuList[i].url || '').replace(/{{([^}}]+)?}}/g, (s1, s2) =>
eval(s2)
) // URL支持{{ window.xxx }}占位符变量
if (isURL(URL)) { if (isURL(URL)) {
route['path'] = route['name'] = `i-${menuList[i].id}` route['path'] = route['name'] = `i-${menuList[i].id}`
route['meta']['iframeURL'] = URL route['meta']['iframeURL'] = URL

10
epmet-oper-web/src/views/modules/customer/customize/ConfigEdit.vue

@ -45,11 +45,12 @@
class="function-icon"> class="function-icon">
<i v-else <i v-else
class="el-icon-plus avatar-uploader-icon"></i> class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<el-button class="btn_reset" <el-button class="btn_reset"
type="primary" type="primary"
size="mini" size="mini"
@click="resetLargeImg">恢复默认</el-button> @click="resetLargeImg">恢复默认</el-button>
</el-upload>
</el-form-item> </el-form-item>
</div> </div>
@ -58,7 +59,7 @@
label="默认小图标"> label="默认小图标">
<div class="item_width_1"> <div class="item_width_1">
<img :src="dataForm.defaultSmallImg" <img :src="dataForm.defaultSmallImg"
style="width:70px;height:70px" style="width:40px;height:40px"
class="function-icon"> class="function-icon">
</div> </div>
@ -73,15 +74,16 @@
:before-upload="beforeImgUpload"> :before-upload="beforeImgUpload">
<img v-if="dataForm.iconSmallImg" <img v-if="dataForm.iconSmallImg"
:src="dataForm.iconSmallImg" :src="dataForm.iconSmallImg"
style="width:70px;height:70px" style="width:40px;height:40px"
class="function-icon"> class="function-icon">
<i v-else <i v-else
class="el-icon-plus avatar-uploader-icon"></i> class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<el-button class="btn_reset" <el-button class="btn_reset"
type="primary" type="primary"
size="mini" size="mini"
@click="resetSmallImg">恢复默认</el-button> @click="resetSmallImg">恢复默认</el-button>
</el-upload>
</el-form-item> </el-form-item>
</div> </div>

26
epmet-oper-web/src/views/modules/customer/customize/ConfigItem.vue

@ -81,7 +81,7 @@
prop="iconSmallImg"> prop="iconSmallImg">
<template slot-scope="scope"> <template slot-scope="scope">
<el-image v-if="scope.row.iconSmallImg" <el-image v-if="scope.row.iconSmallImg"
style="width: 50px; height: 50px;text-align: center;" style="width: 40px; height: 40px;text-align: center;"
:src="scope.row.iconSmallImg" :src="scope.row.iconSmallImg"
:preview-src-list="[scope.row.iconSmallImg]"> :preview-src-list="[scope.row.iconSmallImg]">
</el-image> </el-image>
@ -444,11 +444,11 @@ export default {
if (i === index - 1) { if (i === index - 1) {
one.customerId = this.customizedList[i].customerId one.customerId = this.customizedList[i].customerId
one.functionId = this.customizedList[i].functionId one.functionId = this.customizedList[i].functionId
one.displayOrder = i one.displayOrder = index
} else if (i === index) { } else if (i === index) {
obj.customerId = this.customizedList[i].customerId obj.customerId = this.customizedList[i].customerId
obj.functionId = this.customizedList[i].functionId obj.functionId = this.customizedList[i].functionId
obj.displayOrder = i obj.displayOrder = index - 1
resultList.push(obj) resultList.push(obj)
resultList.push(one) resultList.push(one)
} else { } else {
@ -461,16 +461,18 @@ export default {
console.log(resultList) console.log(resultList)
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfunctiondetail/updatedisplayorder' // const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfunctiondetail/updatedisplayorder'
// const url = '/oper/customize/customerfunctiondetail/updatedisplayorder' const url = '/oper/customize/customerfunctiondetail/updatedisplayorder'
// window.app.ajax.post(url, resultList, window.app.ajax.post(url, resultList,
// (data, rspMsg) => { (data, rspMsg) => {
// // this.$message.success('') this.endLoading()
// this.loadTableData() // this.$message.success('')
// }, this.loadTableData()
// (rspMsg, data) => { },
// this.$message.error(rspMsg) (rspMsg, data) => {
// })
this.endLoading() this.endLoading()
this.$message.error(rspMsg)
})
} else { } else {
this.$message.warning('无法上移') this.$message.warning('无法上移')

9
epmet-oper-web/src/views/modules/customer/manage/EditForm.vue

@ -133,8 +133,13 @@ export default {
// let url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/crm/customer/updatecustomer' // let url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/crm/customer/updatecustomer'
let url = '/oper/crm/customer/updatecustomer' let url = '/oper/crm/customer/updatecustomer'
// //
let _data = this.$refs['ref_form'].model const model = this.$refs['ref_form'].model
_data.logo = this.formData2.logo let _data = {
customerId: model.customerId,
customerName: model.customerName,
logo: this.formData2.logo
}
window.app.ajax.post(url, _data, window.app.ajax.post(url, _data,
(data, rspMsg) => { (data, rspMsg) => {
this.endLoading() this.endLoading()

33
epmet-oper-web/src/views/modules/customer/miniProAgent/BasicInfo.vue

@ -8,7 +8,10 @@
:width="70" :width="70"
@cancel="diaCancel" @cancel="diaCancel"
@ok="setDomains"> @ok="setDomains">
<el-tabs v-model="activeName"
class="el-tabs">
<el-tab-pane label="服务器域名"
name="service">
<el-form :inline="true" <el-form :inline="true"
:model="formData" :model="formData"
class="form" class="form"
@ -119,6 +122,26 @@
</el-form> </el-form>
</el-tab-pane>
<el-tab-pane label="业务域名"
name="webViewD">
<el-form :inline="true"
:model="formData"
class="form"
label-width="170px">
<el-form-item label="业务域名">
<div v-for="(item, index) in formData.webViewDomain"
:key="index">
<span style="width:300px;display:block;margin-bottom:10px; float:left">{{formData.webViewDomain[index]}} </span>
</div>
</el-form-item>
</el-form>
</el-tab-pane>
</el-tabs>
</c-dialog> </c-dialog>
</div> </div>
@ -137,11 +160,13 @@ export default {
customerId: '', // id customerId: '', // id
clientType: '', // clientType: '', //
diaVisible: false, diaVisible: false,
activeName: 'service',
formData: { formData: {
requestDomain: [], // request requestDomain: [], // request
wsRequestDomain: [], // socket wsRequestDomain: [], // socket
uploadDomain: [], // uploadFile uploadDomain: [], // uploadFile
downloadDomain: [] // downloadFile downloadDomain: [], // downloadFile
webViewDomain: []//
} }
} }
}, },
@ -188,6 +213,9 @@ export default {
if (this.formData.downloadDomain.length === 0) { if (this.formData.downloadDomain.length === 0) {
this.formData.downloadDomain.push('') this.formData.downloadDomain.push('')
} }
if (this.formData.webViewDomain.length === 0) {
this.formData.webViewDomain.push('无')
}
this.endLoading() this.endLoading()
}, },
(rspMsg, data) => { (rspMsg, data) => {
@ -214,6 +242,7 @@ export default {
const param = { const param = {
customerId: this.customerId, customerId: this.customerId,
clientType: this.clientType, clientType: this.clientType,
action: 'set',
requestDomain: requestDomain, requestDomain: requestDomain,
wsRequestDomain: wsRequestDomain, wsRequestDomain: wsRequestDomain,
uploadDomain: uploadDomain, uploadDomain: uploadDomain,

15
epmet-oper-web/src/views/modules/productConfig/customizeFunction/CustomFun.vue

@ -166,22 +166,11 @@ export default {
}, },
// //
addShow () { addShow () {
let row = { this.$refs['ref_edit'].init('', 'A')
functionId: '',
customizedName: '',
iconLargeImg: '',
iconSmallImg: '',
shoppingStatus: '1',
functionExplain: '',
targetLink: '',
domainName: '',
fromApp: 'resi'
}
this.$refs['ref_edit'].init(row, 'A')
}, },
// //
editShow (row) { editShow (row) {
this.$refs['ref_edit'].init(row, 'U') this.$refs['ref_edit'].init(row.functionId, 'U')
}, },
// //

96
epmet-oper-web/src/views/modules/productConfig/customizeFunction/Edit.vue

@ -3,7 +3,9 @@
:title="'修改定制功能'" :title="'修改定制功能'"
:close-on-click-modal="false" :close-on-click-modal="false"
:before-close="handleClose" :before-close="handleClose"
:close-on-press-escape="false"> :close-on-press-escape="false"
:width="60+'%'"
:top="'20px'">
<el-form :inline="true" <el-form :inline="true"
:model="dataForm" :model="dataForm"
:rules="dataRule" :rules="dataRule"
@ -31,6 +33,7 @@
<el-form-item label="上架状态" <el-form-item label="上架状态"
prop="shoppingStatus"> prop="shoppingStatus">
<el-select class="item_width_1" <el-select class="item_width_1"
:disabled="isApply===1"
v-model="dataForm.shoppingStatus" v-model="dataForm.shoppingStatus"
placeholder="请选择" placeholder="请选择"
clearable> clearable>
@ -44,6 +47,7 @@
<el-form-item label="外链地址" <el-form-item label="外链地址"
prop="targetLink"> prop="targetLink">
<el-input class="item_width_1" <el-input class="item_width_1"
:disabled="isApply===1"
v-model="dataForm.targetLink" v-model="dataForm.targetLink"
placeholder="外链地址"></el-input> placeholder="外链地址"></el-input>
</el-form-item> </el-form-item>
@ -73,7 +77,7 @@
:before-upload="beforeImgUpload"> :before-upload="beforeImgUpload">
<img v-if="dataForm.iconSmallImg" <img v-if="dataForm.iconSmallImg"
:src="dataForm.iconSmallImg" :src="dataForm.iconSmallImg"
style="width:70px;height:70px" style="width:50px;height:50px"
class="function-icon"> class="function-icon">
<i v-else <i v-else
class="el-icon-plus avatar-uploader-icon"></i> class="el-icon-plus avatar-uploader-icon"></i>
@ -82,20 +86,21 @@
<el-form-item class="block" <el-form-item class="block"
label="业务域名"> label="业务域名">
<div v-for="(item, index) in dataForm.domainNameList" <div v-for="(item, index) in domainNameList"
:key="index"> :key="index">
<el-input style="width:300px;display:block;margin-bottom:10px; float:left" <el-input :disabled="isApply===1"
placeholder='请输入uploadFile 合法域名' style="width:300px;display:block;margin-bottom:10px; float:left"
v-model="dataForm.domainNameList[index]"> </el-input> placeholder='请输入业务域名'
v-model="domainNameList[index]"> </el-input>
<el-button v-if="index===0" <el-button v-if="index===0&&isApply===0"
size="mini" size="mini"
class="btn_serve" class="btn_serve"
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"
@click="addRequest()" @click="addRequest()"
circle></el-button> circle></el-button>
<el-button v-else <el-button v-if="index!==0&&isApply===0"
size="mini" size="mini"
type="danger" type="danger"
class="btn_serve" class="btn_serve"
@ -107,16 +112,6 @@
</el-form-item> </el-form-item>
<!-- <el-form-item class="block"
label="业务域名"
prop="domainName">
<el-input class="item_width_2"
v-model="dataForm.domainName"
placeholder="业务域名"
type="textarea"></el-input>
</el-form-item>
<div slot="tip"
class="el-upload__tip">可写多个;分隔</div> -->
<el-form-item class="block" <el-form-item class="block"
label="功能说明" label="功能说明"
prop="functionExplain"> prop="functionExplain">
@ -144,6 +139,7 @@ export default {
return { return {
visible: false, visible: false,
type: '', // A/U type: '', // A/U
functionId: '', // id
dataForm: { dataForm: {
functionId: '', functionId: '',
functionName: '', functionName: '',
@ -154,9 +150,10 @@ export default {
functionExplain: '', functionExplain: '',
targetLink: '', targetLink: '',
domainName: '', domainName: '',
domainNameList: [],
fromApp: 'resi' fromApp: 'resi'
}, },
domainNameList: [],
isApply: 0,//
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/function/upload', uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/function/upload',
fromAppList: [ fromAppList: [
{ {
@ -209,26 +206,55 @@ export default {
} }
}, },
methods: { methods: {
init (dataForm, type) { init (functionId, type) {
this.type = type this.type = type
this.visible = true this.visible = true
// this.dataForm=dataForm this.functionId = functionId
if (type === 'A') {
this.$nextTick(() => { this.dataForm = {
dataForm.functionName = dataForm.customizedName functionId: '',
if (dataForm.domainName === '') { functionName: '',
dataForm.domainNameList.push('') customizedName: '',
iconLargeImg: '',
iconSmallImg: '',
shoppingStatus: '1',
functionExplain: '',
targetLink: '',
domainName: '',
fromApp: 'resi'
}
this.domainNameList = ['']
this.isApply = 0
} else { } else {
dataForm.domainNameList = dataForm.domainName.split(';') this.loadFormData()
} }
Object.assign(this.dataForm, dataForm)
})
}, },
addRequest () { addRequest () {
this.dataForm.domainNameList.push('') // eslint-disable-next-line
// debugger
this.domainNameList.push('')
}, },
delRequest (index) { delRequest (index) {
this.dataForm.domainNameList.splice(index, 1) this.domainNameList.splice(index, 1)
},
loadFormData () {
// const url='https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/functioncustomized/getfunctioncustomized'
const url = '/oper/customize/functioncustomized/getfunctioncustomized'
let _data = {
functionId: this.functionId
}
window.app.ajax.post(url, _data,
(data, rspMsg) => {
this.dataForm = data
// this.dataForm.domainNameList = this.dataForm.domainName.split(';')
this.domainNameList = this.dataForm.domainName.split(';')
this.isApply = data.isApply
},
(rspMsg, data) => {
this.endLoading()
this.$message.error(rspMsg)
})
}, },
// //
@ -273,9 +299,9 @@ export default {
// eslint-disable-next-line // eslint-disable-next-line
// debugger // debugger
let domainName = '' let domainName = ''
for (let i = 0; i < this.dataForm.domainNameList.length; i++) { for (let i = 0; i < this.domainNameList.length; i++) {
if (this.dataForm.domainNameList[i] !== '') { if (this.domainNameList[i] !== '') {
domainName = domainName + this.dataForm.domainNameList[i] + ';' domainName = domainName + this.domainNameList[i] + ';'
} }
} }
domainName = domainName.substring(0, domainName.length - 1) domainName = domainName.substring(0, domainName.length - 1)
@ -337,7 +363,7 @@ export default {
width: 300px; width: 300px;
} }
.item_width_2 { .item_width_2 {
width: 700px; width: 500px;
} }
.block { .block {
display: block; display: block;

64
epmet-oper-web/src/views/pages/login.vue

@ -7,51 +7,81 @@
</div> </div>
<div class="login-body"> <div class="login-body">
<h3 class="login-title">{{ $t('login.title') }}</h3> <h3 class="login-title">{{ $t('login.title') }}</h3>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" status-icon> <el-form :model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()"
status-icon>
<el-form-item> <el-form-item>
<el-select v-model="$i18n.locale" class="w-percent-100"> <el-select v-model="$i18n.locale"
<el-option v-for="(val, key) in i18nMessages" :key="key" :label="val._lang" :value="key"></el-option> class="w-percent-100">
<el-option v-for="(val, key) in i18nMessages"
:key="key"
:label="val._lang"
:value="key"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="phone"> <el-form-item prop="phone">
<el-input v-model="dataForm.phone" placeholder="手机号"> <el-input v-model="dataForm.phone"
<span slot="prefix" class="el-input__icon"> placeholder="手机号">
<svg class="icon-svg" aria-hidden="true"><use xlink:href="#icon-user"></use></svg> <span slot="prefix"
class="el-input__icon">
<svg class="icon-svg"
aria-hidden="true">
<use xlink:href="#icon-user"></use>
</svg>
</span> </span>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<el-input v-model="dataForm.password" type="password" :placeholder="$t('login.password')"> <el-input v-model="dataForm.password"
<span slot="prefix" class="el-input__icon"> type="password"
<svg class="icon-svg" aria-hidden="true"><use xlink:href="#icon-lock"></use></svg> :placeholder="$t('login.password')">
<span slot="prefix"
class="el-input__icon">
<svg class="icon-svg"
aria-hidden="true">
<use xlink:href="#icon-lock"></use>
</svg>
</span> </span>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="captcha"> <el-form-item prop="captcha">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="14"> <el-col :span="14">
<el-input v-model="dataForm.captcha" :placeholder="$t('login.captcha')"> <el-input v-model="dataForm.captcha"
<span slot="prefix" class="el-input__icon"> :placeholder="$t('login.captcha')">
<svg class="icon-svg" aria-hidden="true"><use xlink:href="#icon-safetycertificate"></use></svg> <span slot="prefix"
class="el-input__icon">
<svg class="icon-svg"
aria-hidden="true">
<use xlink:href="#icon-safetycertificate"></use>
</svg>
</span> </span>
</el-input> </el-input>
</el-col> </el-col>
<el-col :span="10" class="login-captcha"> <el-col :span="10"
<img :src="captchaPath" @click="getCaptcha()"> class="login-captcha">
<img :src="captchaPath"
@click="getCaptcha()">
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="dataFormSubmitHandle()" class="w-percent-100">{{ $t('login.title') }}</el-button> <el-button type="primary"
@click="dataFormSubmitHandle()"
class="w-percent-100">{{ $t('login.title') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="login-footer"> <div class="login-footer">
<p> <p>
<a href="https://demo.cloud.renren.io/renren-cloud" target="_blank">{{ $t('login.demo') }}</a> <a href="https://demo.cloud.renren.io/renren-cloud"
target="_blank">{{ $t('login.demo') }}</a>
</p> </p>
<!-- 2020 © renren.io --> <!-- 2020 © renren.io -->
<p><a href="https://www.renren.io/" target="_blank">{{ $t('login.copyright') }}</a></p> <p><a href="https://www.renren.io/"
target="_blank">{{ $t('login.copyright') }}</a></p>
</div> </div>
</main> </main>
</div> </div>

155
epmet-oper-web/src/views/pages/loginWork.vue

@ -0,0 +1,155 @@
<template>
<div class="aui-wrapper aui-page__login">
<div class="aui-content__wrapper">WorkWorkWorkWorkWork</div>
<div class="aui-content__wrapper">
<main class="aui-content">
<div class="login-header">
<h2 class="login-brand">{{ $t('brand.lg') }}</h2>
</div>
<div class="login-body">
<h3 class="login-title">{{ $t('login.title') }}</h3>
<el-form :model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()"
status-icon>
<el-form-item>
<el-select v-model="$i18n.locale"
class="w-percent-100">
<el-option v-for="(val, key) in i18nMessages"
:key="key"
:label="val._lang"
:value="key"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="phone">
<el-input v-model="dataForm.phone"
placeholder="手机号">
<span slot="prefix"
class="el-input__icon">
<svg class="icon-svg"
aria-hidden="true">
<use xlink:href="#icon-user"></use>
</svg>
</span>
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input v-model="dataForm.password"
type="password"
:placeholder="$t('login.password')">
<span slot="prefix"
class="el-input__icon">
<svg class="icon-svg"
aria-hidden="true">
<use xlink:href="#icon-lock"></use>
</svg>
</span>
</el-input>
</el-form-item>
<el-form-item prop="captcha">
<el-row :gutter="20">
<el-col :span="14">
<el-input v-model="dataForm.captcha"
:placeholder="$t('login.captcha')">
<span slot="prefix"
class="el-input__icon">
<svg class="icon-svg"
aria-hidden="true">
<use xlink:href="#icon-safetycertificate"></use>
</svg>
</span>
</el-input>
</el-col>
<el-col :span="10"
class="login-captcha">
<img :src="captchaPath"
@click="getCaptcha()">
</el-col>
</el-row>
</el-form-item>
<el-form-item>
<el-button type="primary"
@click="dataFormSubmitHandle()"
class="w-percent-100">{{ $t('login.title') }}</el-button>
</el-form-item>
</el-form>
</div>
<div class="login-footer">
<p>
<a href="https://demo.cloud.renren.io/renren-cloud"
target="_blank">{{ $t('login.demo') }}</a>
</p>
<!-- 2020 © renren.io -->
<p><a href="https://www.renren.io/"
target="_blank">{{ $t('login.copyright') }}</a></p>
</div>
</main>
</div>
</div>
</template>
<script>
import Cookies from 'js-cookie'
import debounce from 'lodash/debounce'
import { messages } from '@/i18n'
import { getUUID } from '@/utils'
export default {
data () {
return {
i18nMessages: messages,
captchaPath: '',
dataForm: {
app: 'oper',
client: 'web',
username: '',
phone: '',
password: '',
uuid: '',
captcha: ''
}
}
},
computed: {
dataRule () {
return {
phone: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
password: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
captcha: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
created () {
this.getCaptcha()
},
methods: {
//
getCaptcha () {
this.dataForm.uuid = getUUID()
this.captchaPath = `${window.SITE_CONFIG['apiURL']}/auth/login/captcha?uuid=${this.dataForm.uuid}`
},
//
dataFormSubmitHandle: debounce(function() {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http.post('/auth/login/operweb/loginbypassword', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
this.getCaptcha()
return this.$message.error(res.msg)
}
Cookies.set('token', res.data.token)
this.$router.replace({ name: 'home' })
}).catch(() => { })
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>
Loading…
Cancel
Save