Commit 70b5837b by 温丽香

页面完善

1 parent e69959c4
Pipeline #3671 passed
in 1 minute 6 seconds
...@@ -24,6 +24,7 @@ module.exports = { ...@@ -24,6 +24,7 @@ module.exports = {
// add your custom rules here // add your custom rules here
rules: { rules: {
"no-control-regex": 0,
// allow debugger during development // allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
......
window.g = { window.g = {
baseURL: 'http://hzdev.seetatech.com:9997', baseURL: 'https://hzdev.seetatech.com:9997',
defaultLang: 'zh-CN', // 目前支持 zh-CN / ja-JP defaultLang: 'zh-CN', // 目前支持 zh-CN / ja-JP
} }
\ No newline at end of file
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
<!-- 普通列 --> <!-- 普通列 -->
<!-- 表头居中 --> <!-- 表头居中 -->
<el-table-column <el-table-column
show-overflow-tooltip
header-align="left" header-align="left"
align="left" align="left"
v-else-if="!(typeof col.render === 'function')" v-else-if="!(typeof col.render === 'function')"
...@@ -109,6 +110,7 @@ ...@@ -109,6 +110,7 @@
</template> </template>
<slot></slot> <slot></slot>
</el-table> </el-table>
<div class="pagination"><slot name="pagination"></slot></div>
<div class="pagination" v-if="pagination"> <div class="pagination" v-if="pagination">
<el-pagination <el-pagination
:current-page.sync="currentPage" :current-page.sync="currentPage"
......
...@@ -15,7 +15,7 @@ function notificationError(title: any, msg: any, duration: number = 1500) { ...@@ -15,7 +15,7 @@ function notificationError(title: any, msg: any, duration: number = 1500) {
}) })
} }
// Axios.defaults.baseURL = '/front' // Axios.defaults.baseURL = baseUrl
export default (method, url, data, config) => { export default (method, url, data, config) => {
method = method.toLowerCase() method = method.toLowerCase()
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</ul> </ul>
<template v-slot:reference> <template v-slot:reference>
<span class="user-info flex right"> <span class="user-info flex right">
<span v-if="userData.info">{{ userData.info.username }}</span> <span v-if="userData.info">{{ userData.info.creater }}</span>
<i class="iconfont icon-mianxingxiala" <i class="iconfont icon-mianxingxiala"
:class="{ :class="{
'expand': showInfo, 'expand': showInfo,
......
...@@ -30,13 +30,13 @@ VueRouter.prototype.push = function push(location) { ...@@ -30,13 +30,13 @@ VueRouter.prototype.push = function push(location) {
// 取消转圈圈 // 取消转圈圈
NProgress.configure({ showSpinner: false }) NProgress.configure({ showSpinner: false })
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// if ((!browserStorage.getItem('id') || !browserStorage.getItem('userId')) && to.path !== '/login' && to.path !== '/register') { if (!browserStorage.getItem('token') && to.path !== '/login' && to.path !== '/register') {
// notificationError('提示', 'token无效或过期') notificationError('提示', 'token无效或过期')
// next({ name: 'login' }) next({ name: 'login' })
// return return
// } }
// NProgress.start() NProgress.start()
// store.commit('CHNAGE_BREADCRUMB', to.path) store.commit('CHNAGE_BREADCRUMB', to.path)
next() next()
}) })
router.afterEach((to, from) => { router.afterEach((to, from) => {
......
...@@ -62,3 +62,13 @@ export function isArrayEqual(value1 = [], value2 = []) { ...@@ -62,3 +62,13 @@ export function isArrayEqual(value1 = [], value2 = []) {
} }
return false return false
} }
export function calculateByte(base64) {
if (base64.indexOf('base64,') !== -1) {
base64 = base64.substring(base64.indexOf('base64,') + 7)
}
if (base64.indexOf('=') !== -1) {
base64 = base64.substring(0, base64.indexOf('='))
}
return base64.length * 0.75
}
...@@ -24,3 +24,23 @@ export const base64ToFile = (base64, fileName) => { ...@@ -24,3 +24,23 @@ export const base64ToFile = (base64, fileName) => {
const blob = new Blob([u8arr], { type: mime }) const blob = new Blob([u8arr], { type: mime })
return new File([blob], fileName, { type: mime }) return new File([blob], fileName, { type: mime })
} }
export const stringToBase64 = str => {
// 对字符串进行编码
const encode = encodeURI(str)
// 对编码的字符串转化base64
const base64 = btoa(encode)
return base64
}
export const base64ToString = base64 => {
// 对base64转编码
const decode = atob(base64)
// 编码转字符串
const str = decodeURI(decode)
return str
}
export const isASCII = str => {
return /^[\x00-\x7F]*$/.test(str)
}
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
}, },
methods: { methods: {
async getData() { async getData() {
const res = await getApp({ pages: 0, pagesize: 5 }) const res = await getApp({ pages: 0, pagesize: 10 })
if (res && res.data && res.data.code === 0) { if (res && res.data && res.data.code === 0) {
this.tokenList = res.data.data.apps this.tokenList = res.data.data.apps
this.total = res.data.data.total this.total = res.data.data.total
......
...@@ -104,15 +104,29 @@ export default { ...@@ -104,15 +104,29 @@ export default {
}, },
], ],
tokenList: [], tokenList: [],
currentPage: 1,
currentSize: 10,
total: 0 total: 0
} }
}, },
mounted() { watch: {
'$route.query': {
handler(val) {
if (!val) return
this.currentPage = Number(val.page_index)
this.currentSize = Number(val.page_size) || 10
this.getData() this.getData()
}, },
immediate: true,
deep: true
}
},
mounted() {
// this.getData()
},
methods: { methods: {
async getData() { async getData() {
const res = await getTable({ pages: 0, pagesize: 5 }) const res = await getTable({ pages: this.currentPage - 1, pagesize: this.currentSize })
if (res && res.data && res.data.code === 0) { if (res && res.data && res.data.code === 0) {
this.tokenList = res.data.data.tables this.tokenList = res.data.data.tables
this.total = res.data.data.total this.total = res.data.data.total
...@@ -129,6 +143,7 @@ export default { ...@@ -129,6 +143,7 @@ export default {
this.getData() this.getData()
} }
this.showDialog = false this.showDialog = false
this.form = {}
}, },
async handleDelete(row) { async handleDelete(row) {
const confirmDelete = await Dialog.confirm('提示', { message: '是否删除此数据表?' }) const confirmDelete = await Dialog.confirm('提示', { message: '是否删除此数据表?' })
......
...@@ -86,9 +86,11 @@ ...@@ -86,9 +86,11 @@
<div class="btn-box" v-if="scope.row.type === 'blob'"> <div class="btn-box" v-if="scope.row.type === 'blob'">
<span class="upload-btn" v-if="!scope.row.value">Select File</span> <span class="upload-btn" v-if="!scope.row.value">Select File</span>
<input type="file" @blur="handleBlur" @change="(event) => handleUpload(event, scope.row)" class="input-btn" v-if="!scope.row.value"> <input type="file" @blur="handleBlur" @change="(event) => handleUpload(event, scope.row)" class="input-btn" v-if="!scope.row.value">
<span class="file-btn" v-if="scope.row.value"> <span v-if="scope.row.value">
<el-image v-if="scope.row.value" style="width: 24px; height: 24px" :src="scope.row.value" fit="fit"></el-image> <span style="float: left;margin-right: 10px">{{calculateByte(scope.row.value)}}字节</span>
<i class="iconfont icon-guanbi" @click="deleteFile(scope.row)"></i> <el-image style="width: 42px; height: 28px;overflow: visible" :src="scope.row.value" fit="fit">
<div slot="error" style="width: 80px; height: 28px;overflow: visible">(不可预览)</div>
</el-image>
</span> </span>
</div> </div>
<div v-if="scope.row.type === 'table'"> <div v-if="scope.row.type === 'table'">
...@@ -126,6 +128,7 @@ ...@@ -126,6 +128,7 @@
<script> <script>
import { createParameter, getTable, getParameter } from '@/axios' import { createParameter, getTable, getParameter } from '@/axios'
import { fileToBase64 } from '@/utils/typeConversion' import { fileToBase64 } from '@/utils/typeConversion'
import { calculateByte } from '@/utils/system'
import Dialog from '@/helpers/dialog' import Dialog from '@/helpers/dialog'
export default { export default {
data() { data() {
...@@ -166,6 +169,7 @@ export default { ...@@ -166,6 +169,7 @@ export default {
this.getBaseOptions() this.getBaseOptions()
}, },
methods: { methods: {
calculateByte: base64 => calculateByte(base64),
async getTableOptions() { async getTableOptions() {
const res = await getTable({ pages: 0, pagesize: 10000000000 }) const res = await getTable({ pages: 0, pagesize: 10000000000 })
if (res && res.data && res.data.code === 0) { if (res && res.data && res.data.code === 0) {
...@@ -204,20 +208,17 @@ export default { ...@@ -204,20 +208,17 @@ export default {
table: tableObj table: tableObj
} }
}) })
if (res && res.data && res.data.code === 0) {
Toast.success('操作成功') Toast.success('操作成功')
this.$router.push({ path: '/params' }) this.$router.push({ path: '/params' })
}
}, },
cancel() { cancel() {
this.$router.push({ path: '/params' }) this.$router.push({ path: '/params' })
}, },
async handleUpload(event, row) { async handleUpload(event, row) {
row.file = event.target.files[0]
row.value = await fileToBase64(event.target.files[0]) row.value = await fileToBase64(event.target.files[0])
}, },
deleteFile(row) {
row.file = ''
row.value = ''
},
insertTableData() { insertTableData() {
this.tableData.push({ field: '', type: '', value: '' }) this.tableData.push({ field: '', type: '', value: '' })
}, },
...@@ -229,7 +230,6 @@ export default { ...@@ -229,7 +230,6 @@ export default {
this.flexHeight = ele && ele.clientHeight this.flexHeight = ele && ele.clientHeight
}, },
handleChange(row) { handleChange(row) {
row.file = ''
row.value = '' row.value = ''
}, },
handleVisibleChange(val) { handleVisibleChange(val) {
......
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
<span v-if="row.type === 'number' || row.type === 'string'">{{row.value}}</span> <span v-if="row.type === 'number' || row.type === 'string'">{{row.value}}</span>
<span v-if="row.type === 'blob'" style="line-height: 28px"> <span v-if="row.type === 'blob'" style="line-height: 28px">
<!-- TODO --> <!-- TODO -->
<span style="float: left;margin-right: 10px">{{row.value.length * 0.75}}字节</span> <span style="float: left;margin-right: 10px">{{calculateByte(row.value)}}字节</span>
<el-image style="width: 42px; height: 28px;overflow: visible" :src="row.value" fit="fit"> <el-image style="width: 42px; height: 28px;overflow: visible" :src="row.value" fit="fit">
<div slot="error">(不可预览)</div> <div slot="error" style="width: 80px; height: 28px;overflow: visible">(不可预览)</div>
</el-image> </el-image>
</span> </span>
<span v-if="row.type === 'table'" style="color: #409EFF; cursor: pointer" @click="$router.push({ path: '/data' })">{{row.value}}</span> <span v-if="row.type === 'table'" style="color: #409EFF; cursor: pointer" @click="$router.push({ path: '/data' })">{{row.value}}</span>
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
<script> <script>
import { detailParameter } from '@/axios' import { detailParameter } from '@/axios'
import { calculateByte } from '@/utils/system'
export default { export default {
data() { data() {
return { return {
...@@ -91,6 +92,7 @@ export default { ...@@ -91,6 +92,7 @@ export default {
} }
}, },
methods: { methods: {
calculateByte: base64 => calculateByte(base64),
} }
} }
</script> </script>
......
...@@ -86,15 +86,10 @@ ...@@ -86,15 +86,10 @@
<div class="btn-box" v-if="scope.row.type === 'blob'"> <div class="btn-box" v-if="scope.row.type === 'blob'">
<span class="upload-btn" v-if="!scope.row.value">Select File</span> <span class="upload-btn" v-if="!scope.row.value">Select File</span>
<input type="file" @blur="handleBlur" @change="(event) => handleUpload(event, scope.row)" class="input-btn" v-if="!scope.row.value"> <input type="file" @blur="handleBlur" @change="(event) => handleUpload(event, scope.row)" class="input-btn" v-if="!scope.row.value">
<span v-if="scope.row.value" style="float: left;margin-right: 10px">{{scope.row.value.length * 0.75}}字节</span> <span v-if="scope.row.value" style="float: left;margin-right: 10px">{{calculateByte(scope.row.value)}}字节</span>
<span class="file-btn" v-if="scope.row.value">
<el-image v-if="scope.row.value" style="width: 24px; height: 24px" :src="scope.row.value" fit="fit"></el-image>
<i class="iconfont icon-guanbi" @click="deleteFile(scope.row)"></i>
</span>
<!-- <span v-if="scope.row.value" style="float: left;margin-right: 10px">{{scope.row.value.length * 0.75}}字节</span>
<el-image v-if="scope.row.value" style="width: 42px; height: 28px;overflow: visible" :src="scope.row.value" fit="fit"> <el-image v-if="scope.row.value" style="width: 42px; height: 28px;overflow: visible" :src="scope.row.value" fit="fit">
<div slot="error">(不可预览)</div> <div slot="error" style="width: 80px; height: 28px;overflow: visible">(不可预览)</div>
</el-image> --> </el-image>
</div> </div>
<div v-if="scope.row.type === 'table'"> <div v-if="scope.row.type === 'table'">
<pack-select v-model="scope.row.value" placeholder="请选择" @blur="handleBlur" @visible-change="handleVisibleChange"> <pack-select v-model="scope.row.value" placeholder="请选择" @blur="handleBlur" @visible-change="handleVisibleChange">
...@@ -114,7 +109,7 @@ ...@@ -114,7 +109,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="add-btn" @click="addTableData"> <div class="add-btn" @click="insertTableData">
<span class="add-btn-text"><i class="iconfont icon-tianjia"></i> 添加</span> <span class="add-btn-text"><i class="iconfont icon-tianjia"></i> 添加</span>
</div> </div>
</div> </div>
...@@ -131,6 +126,7 @@ ...@@ -131,6 +126,7 @@
<script> <script>
import { editParameter, getParameter, detailParameter, getTable } from '@/axios' import { editParameter, getParameter, detailParameter, getTable } from '@/axios'
import { fileToBase64 } from '@/utils/typeConversion' import { fileToBase64 } from '@/utils/typeConversion'
import { calculateByte } from '@/utils/system'
import Dialog from '@/helpers/dialog' import Dialog from '@/helpers/dialog'
export default { export default {
data() { data() {
...@@ -173,6 +169,7 @@ export default { ...@@ -173,6 +169,7 @@ export default {
this.getBaseOptions() this.getBaseOptions()
}, },
methods: { methods: {
calculateByte: base64 => calculateByte(base64),
async getTableOptions() { async getTableOptions() {
const res = await getTable({ pages: 0, pagesize: 10000000000 }) const res = await getTable({ pages: 0, pagesize: 10000000000 })
if (res && res.data && res.data.code === 0) { if (res && res.data && res.data.code === 0) {
...@@ -204,7 +201,9 @@ export default { ...@@ -204,7 +201,9 @@ export default {
} }
} }
}, },
cancel() {}, cancel() {
this.$router.push({ path: '/params' })
},
async save() { async save() {
const tableData = this.tableData.filter(item => item.field && item.value) const tableData = this.tableData.filter(item => item.field && item.value)
const scalarsArr = tableData.filter(item => item.type === 'string' || item.type === 'number') const scalarsArr = tableData.filter(item => item.type === 'string' || item.type === 'number')
...@@ -230,29 +229,21 @@ export default { ...@@ -230,29 +229,21 @@ export default {
table: tableObj table: tableObj
} }
}) })
if (res && res.data && res.data.code === 0) {
Toast.success('操作成功') Toast.success('操作成功')
this.$router.push({ path: '/params' }) this.$router.push({ path: '/params' })
}
}, },
async handleUpload(event, row) { async handleUpload(event, row) {
row.file = event.target.files[0]
row.value = await fileToBase64(event.target.files[0]) row.value = await fileToBase64(event.target.files[0])
}, },
deleteFile(row) { insertTableData() {
row.file = '' this.tableData.push({ field: '', type: '', value: '' })
row.value = ''
},
setFlexHeight() {
const ele = document.getElementsByClassName('flex-item') && document.getElementsByClassName('flex-item')[0]
this.flexHeight = ele && ele.clientHeight
},
addTableData() {
this.tableData.push({ field: '', type: 'string', value: '' })
}, },
handleDelete(index) { handleDelete(index) {
this.tableData.splice(index, 1) this.tableData.splice(index, 1)
}, },
handleChange(row) { handleChange(row) {
row.file = ''
row.value = '' row.value = ''
}, },
handleVisibleChange(val) { handleVisibleChange(val) {
...@@ -260,6 +251,10 @@ export default { ...@@ -260,6 +251,10 @@ export default {
this.setCurrent() this.setCurrent()
} }
}, },
setFlexHeight() {
const ele = document.getElementsByClassName('flex-item') && document.getElementsByClassName('flex-item')[0]
this.flexHeight = ele && ele.clientHeight
},
handleBlur(event) { handleBlur(event) {
this.setCurrent() this.setCurrent()
event.target && event.target.classList && event.target.classList.remove('write') event.target && event.target.classList && event.target.classList.remove('write')
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<st-button type="primary" @click="$router.push({ path: '/params/add', query: { level: 1 } })"> <st-button type="primary" @click="$router.push({ path: '/params/add', query: { level: 1 } })">
<i class="iconfont icon-tianjia"></i><span class="text">{{'添加'}}</span></st-button> <i class="iconfont icon-tianjia"></i><span class="text">{{'添加'}}</span></st-button>
<div class="search"> <div class="search">
<input type="text" class="search-input" placeholder="请输入搜索内容" v-model="inputVal"> <input type="text" class="search-input" placeholder="请输入搜索内容" v-model="oneVal">
<i class="el-input__icon el-icon-search"></i> <i class="el-input__icon el-icon-search"></i>
</div> </div>
</div> </div>
...@@ -22,13 +22,19 @@ ...@@ -22,13 +22,19 @@
list: oneList, list: oneList,
total: oneTotal, total: oneTotal,
}" }"
:pagination="false"
highlight-current-row highlight-current-row
@row-click="handleClickRow"> @row-click="handleClickRow">
<div slot="operate" slot-scope="row"> <div slot="operate" slot-scope="row">
<span class="operate" @click="$router.push({ path: '/params/detail', query: { name: row.name }})">详情</span> <span class="operate" @click="$router.push({ path: '/params/detail', query: { name: row.name }})">详情</span>
<span class="operate" @click="$router.push({ path: '/params/edit', query: { name: row.name, level: 1 } })">编辑</span> <span class="operate" @click="$router.push({ path: '/params/edit', query: { name: row.name, level: 1 } })">编辑</span>
<span class="operate operate-delete" @click="handleDelete(row)">删除</span> <span class="operate operate-delete" @click="handleDelete(row, 1)">删除</span>
</div> </div>
<el-pagination slot="pagination" layout="prev, pager, next"
@current-change="handleOneCurrentChange"
:current-page="oneCurrentPage"
:total="oneTotal">
</el-pagination>
</st-table> </st-table>
</div> </div>
</div> </div>
...@@ -39,7 +45,7 @@ ...@@ -39,7 +45,7 @@
<st-button type="primary" @click="$router.push({ path: '/params/add', query: { level: 2 } })"> <st-button type="primary" @click="$router.push({ path: '/params/add', query: { level: 2 } })">
<i class="iconfont icon-tianjia"></i><span class="text">{{'添加'}}</span></st-button> <i class="iconfont icon-tianjia"></i><span class="text">{{'添加'}}</span></st-button>
<div class="search"> <div class="search">
<input type="text" class="search-input" placeholder="请输入搜索内容" v-model="inputVal"> <input type="text" class="search-input" placeholder="请输入搜索内容" v-model="twoVal">
<i class="el-input__icon el-icon-search"></i> <i class="el-input__icon el-icon-search"></i>
</div> </div>
</div> </div>
...@@ -48,6 +54,7 @@ ...@@ -48,6 +54,7 @@
<st-table <st-table
ref="vTable" ref="vTable"
:options="definitions" :options="definitions"
:pagination="false"
:data="{ :data="{
list: twoList, list: twoList,
total: twoTotal, total: twoTotal,
...@@ -55,8 +62,13 @@ ...@@ -55,8 +62,13 @@
<div slot="operate" slot-scope="row"> <div slot="operate" slot-scope="row">
<span class="operate" @click="$router.push({ path: '/params/detail', query: { name: row.name } })">详情</span> <span class="operate" @click="$router.push({ path: '/params/detail', query: { name: row.name } })">详情</span>
<span class="operate" @click="$router.push({ path: '/params/edit', query: { name: row.name, level: 2 } })">编辑</span> <span class="operate" @click="$router.push({ path: '/params/edit', query: { name: row.name, level: 2 } })">编辑</span>
<span class="operate operate-delete" @click="handleDelete(row)">删除</span> <span class="operate operate-delete" @click="handleDelete(row, 2)">删除</span>
</div> </div>
<el-pagination slot="pagination" layout="prev, pager, next"
@current-change="handleTwoCurrentChange"
:current-page="twoCurrentPage"
:total="twoTotal">
</el-pagination>
</st-table> </st-table>
</div> </div>
</div> </div>
...@@ -71,7 +83,14 @@ import Dialog from '@/helpers/dialog' ...@@ -71,7 +83,14 @@ import Dialog from '@/helpers/dialog'
export default { export default {
data() { data() {
return { return {
inputVal: '', oneVal: '',
twoVal: '',
oneList: [],
twoList: [],
oneTotal: 0,
twoTotal: 0,
oneCurrentPage: 1,
twoCurrentPage: 1,
definitions: [ definitions: [
{ {
label: '序号', label: '序号',
...@@ -96,41 +115,48 @@ export default { ...@@ -96,41 +115,48 @@ export default {
slotName: 'operate' slotName: 'operate'
}, },
], ],
oneList: [],
twoList: [],
oneTotal: 0,
twoTotal: 0
} }
}, },
mounted() { mounted() {
this.getData() this.getOneData()
this.getTwoData()
}, },
methods: { methods: {
async getData() { async getOneData() {
const oneLevel = await getParameter({ base: 1, pages: 0, pagesize: 5 }) const oneLevel = await getParameter({ base: 1, pages: this.oneCurrentPage - 1, pagesize: 10 })
if (oneLevel && oneLevel.data && oneLevel.data.code === 0) { if (oneLevel && oneLevel.data && oneLevel.data.code === 0) {
this.oneList = oneLevel.data.parameters.datas this.oneList = oneLevel.data.parameters.datas
this.oneTotal = oneLevel.data.parameters.total this.oneTotal = oneLevel.data.parameters.total
} }
const twoLevel = await getParameter({ base: 0, pages: 0, pagesize: 5 }) },
async getTwoData() {
const twoLevel = await getParameter({ base: 0, pages: this.twoCurrentPage - 1, pagesize: 10 })
if (twoLevel && twoLevel.data && twoLevel.data.code === 0) { if (twoLevel && twoLevel.data && twoLevel.data.code === 0) {
this.twoList = twoLevel.data.parameters.datas this.twoList = twoLevel.data.parameters.datas
this.twoTotal = twoLevel.data.parameters.total this.twoTotal = twoLevel.data.parameters.total
} }
}, },
async handleDelete(row) { async handleDelete(row, level) {
console.log(row)
const confirmDelete = await Dialog.confirm('提示', { message: '是否删除此模板?' }) const confirmDelete = await Dialog.confirm('提示', { message: '是否删除此模板?' })
if (!confirmDelete) return if (!confirmDelete) return
const res = await deleteParameter({ name: row.name }) const res = await deleteParameter({ name: row.name })
if (res) { if (res) {
Toast.success('操作成功') Toast.success('操作成功')
this.getData() if (level === 1) this.getOneData()
if (level === 2) this.getTwoData()
} }
}, },
handleClickRow(row, column, event) { handleClickRow(row, column, event) {
console.log(row) console.log(row)
},
handleOneCurrentChange(val) {
this.oneCurrentPage = val
this.getOneData()
},
handleTwoCurrentChange(val) {
this.twoCurrentPage = val
this.getTwoData()
} }
} }
} }
......
...@@ -7,26 +7,26 @@ ...@@ -7,26 +7,26 @@
<st-form <st-form
ref="form" ref="form"
label-width="70px" label-width="70px"
:model="form"> :model="userData">
<st-form-item <st-form-item
style="margin-bottom:10px" style="margin-bottom:10px"
:label="'头像'+':'"> :label="'头像'+':'">
<el-image style="width: 80px; height: 80px" src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" fit="fit"></el-image> <el-image style="width: 80px; height: 80px" :src="userData.image" fit="fit"></el-image>
</st-form-item> </st-form-item>
<st-form-item <st-form-item
style="margin-bottom:10px" style="margin-bottom:10px"
:label="'账户'+':'"> :label="'账户'+':'">
<span>{{form.account}}asdfasdf</span> <span>{{userData.role}}</span>
</st-form-item> </st-form-item>
<st-form-item <st-form-item
style="margin-bottom:10px" style="margin-bottom:10px"
:label="'姓名'+':'"> :label="'姓名'+':'">
<span>{{form.name}}asdfasdf</span><span class="btn-text" @click="showDialog = true;type = 'name'">编辑</span> <span>{{userData.creater}}</span><span class="btn-text" @click="showDialog = true;type = 'name'">编辑</span>
</st-form-item> </st-form-item>
<st-form-item <st-form-item
style="margin-bottom:10px" style="margin-bottom:10px"
:label="'邮箱'+':'"> :label="'邮箱'+':'">
<span>{{form.email}}asdfasdf</span><span class="btn-text" @click="showDialog = true;type = 'email'">编辑</span> <span>{{userData.email}}</span><span class="btn-text" @click="showDialog = true;type = 'email'">编辑</span>
</st-form-item> </st-form-item>
<st-form-item <st-form-item
style="margin-bottom:10px" style="margin-bottom:10px"
...@@ -78,11 +78,12 @@ ...@@ -78,11 +78,12 @@
</template> </template>
<script> <script>
import { getUser } from '@/utils/user'
export default { export default {
data() { data() {
return { return {
showDialog: false, showDialog: false,
form: {}, userData: {},
type: '', type: '',
email: '', email: '',
name: '', name: '',
...@@ -92,7 +93,8 @@ export default { ...@@ -92,7 +93,8 @@ export default {
} }
}, },
mounted() { mounted() {
// this.getData() this.userData = getUser().info
console.log(this.userData)
}, },
methods: { methods: {
submit() { submit() {
......
...@@ -289,9 +289,10 @@ export default { ...@@ -289,9 +289,10 @@ export default {
// }) // })
// .then(response => console.log(response.data)) // .then(response => console.log(response.data))
// .catch(e => console.log(e)) // .catch(e => console.log(e))
if (res && res.data.code === 0) { if (res && res.data && res.data.code === 0) {
// TokenId // TokenId
browserStorage.setItem('token', res.data.token) browserStorage.setItem('token', res.data.token)
browserStorage.setItem('user', JSON.stringify(res.data))
this.$router.push({ path: '/params' }) this.$router.push({ path: '/params' })
} else { } else {
Toast.danger(res.data.msg) Toast.danger(res.data.msg)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!