Browse Source

登录界面修改

master
aBin 3 years ago
parent
commit
01c284674d
  1. 11
      src/api/otherPage.js
  2. BIN
      src/assets/bg.png
  3. 50
      src/views/lists/index.vue
  4. 9
      src/views/login/index.vue

11
src/api/otherPage.js

@ -12,3 +12,14 @@ export function GET_LIST(params) {
data: params
}).then(res => res.data)
}
/**
* 修改常量内容
*/
export function UPDATE_DATA(params) {
return request({
url: `${constant}/update`,
method: 'post',
data: params
}).then(res => res.data)
}

BIN
src/assets/bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

50
src/views/lists/index.vue

@ -36,12 +36,14 @@
<div>{{ item.title }}</div>
<template v-if="Array.isArray(item.value)">
<div v-for="(itemA,indexA) in item.value" :key="indexA">
<el-input :value="itemA" />
<span>{{ itemA }}</span>
<el-input :value="itemA" @blur="changeValue($event,item.title,lists.row,indexA)" />
</div>
</template>
<template v-else>
<div>
<el-input :value="item.value" />
<span>{{ item.value }}</span>
<el-input :value="item.value" @blur="changeValue($event,item.title,lists.row)" />
</div>
</template>
</div>
@ -88,7 +90,7 @@
<script>
const FormContainer = () => import('./form.vue');
const DetailsOfDistribution = () => import('./detailsOfDistribution.vue');
import { GET_LIST } from '@/api/otherPage';
import { GET_LIST,UPDATE_DATA } from '@/api/otherPage';
import Alert from "@/utils/alert";
import {pageSize} from '../../config';
@ -175,6 +177,48 @@
console.log('itemList',itemList)
return itemList
},
// ,JSON
changeValue(e,title,defaultValue,index) {
let dValue = JSON.parse(defaultValue.value);
if(Array.isArray(dValue)) {
for(let i = 0; i < dValue.length; i++) {
const item = dValue[i]
for(let key in item) {
if(Array.isArray(item[key]) && key === title) {
item[key][index] = e.target.value
} else {
if(item.content === title) {
item.url = e.target.value
break;
}
}
}
}
} else {
for(let key in dValue) {
if(key === title) {
dValue[key] = e.target.value
}
}
}
const params = {
code: defaultValue.code,
constantId: defaultValue.constantId,
value: JSON.stringify(dValue)
}
this.updateData(params)
},
//
async updateData(params) {
await UPDATE_DATA(params).then(res => {
const { code } = res
console.log('code: ', code);
if(code === 200) {
Alert.success('修改成功')
this.getList()
}
});
},
/**
* 分页

9
src/views/login/index.vue

@ -190,6 +190,8 @@ $cursor: #fff;
/* reset element-ui css */
.login-container {
background-image: url('../../assets/bg.png');
background-size: 100% 100%;
.el-input {
display: inline-block;
height: 47px;
@ -221,7 +223,7 @@ $cursor: #fff;
<style rel="stylesheet/scss" lang="scss" scoped>
$bg: #2d3a4b;
$dark_gray: #889aa4;
$light_gray: #eee;
$light_gray: #666;
.login-container {
min-height: 100%;
@ -229,7 +231,10 @@ $light_gray: #eee;
background-color: $bg;
overflow: hidden;
.login-form {
position: relative;
background: rgba(255,255,255,0.3);
position: absolute;
top: 20%;
right: 200px;
width: 520px;
max-width: 100%;
padding: 160px 35px 0;

Loading…
Cancel
Save