no message

This commit is contained in:
小陌 2023-09-13 18:43:36 +08:00
parent ae8d3f2714
commit 6155f74113
2 changed files with 33 additions and 26 deletions

View File

@ -85,7 +85,7 @@
<x-editor v-model="data[item.name]" v-bind="item.options"></x-editor>
</template>
<template v-else-if="item.component=='text'">
<el-link type="info" :underline="false">{{ data[item.name] }}</el-link>
<el-link type="info" :underline="false" v-copy="data[item.name]">{{ data[item.name] }}</el-link>
</template>
<!-- avatar -->
<template v-else-if="item.component=='avatar'">

View File

@ -10,22 +10,23 @@
<div class="left-panel">
<el-date-picker v-model="date" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</div>
<div class="right-panel">
<div class="right-panel-search">
<el-input v-model="search.keyword" placeholder="输入关键词" clearable></el-input>
<el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button>
</div>
</div>
</el-header>
<el-header style="height:120px;" v-if="typeof chartoption === 'object' && Object.keys(chartoption).length > 0">
<xEcharts height="100%" :option="chartoption"></xEcharts>
</el-header>
<el-main class="nopadding">
<xTable ref="table" :api="api" :params="params" :tableColumn="tableColumn" stripe highlightCurrentRow @row-click="rowClick">
<xTable ref="table" :api="api" :params="search" :tableColumn="tableColumn" stripe highlightCurrentRow @row-click="rowClick">
<el-table-column type="index" width="60" align="center">
<template #default="scope">
<span>{{scope.$index+(currentPage - 1) * limit + 1}}</span>
</template>
</el-table-column>
<!-- <el-table-column v-bind="item" v-for="(item, index) in tableColumn" :key="index">
<template #default="scope">
<columnItem row="scope.row" :item="item"> </columnItem>
</template>
</el-table-column> -->
</xTable>
</el-main>
</el-container>
@ -58,10 +59,10 @@
date: [],
data: [],
search: {
keyword: ""
keyword: this.$route.query.keyword || '',
type:this.$route.query.type || ''
},
api: '',
params: [],
current : '',
config : {},
tableColumn : {},
@ -77,23 +78,28 @@
//props
current(){
this.search.type = this.current;
this.getCurrent();
},
},
methods: {
changeURLArg(url,arg,arg_val){
var pattern=arg+'=([^&]*)';
var replaceText=arg+'='+arg_val;
if(url.match(pattern)){
var tmp='/('+ arg+'=)([^&]*)/gi';
tmp=url.replace(eval(tmp),replaceText);
return tmp;
}
if (url.match('[?]')) {
return url+'&'+replaceText;
}
return url+'?'+replaceText;
changeURLArg(url, arg, arg_val) {
var pattern = arg + '=([^&]*)';
if (arg_val === '') {
url = url.replace(new RegExp('&?' + pattern, 'gi'), '');
url = url.replace(new RegExp('\\??' + pattern + '&?', 'gi'), '?');
return url;
}
var replaceText = arg + '=' + arg_val;
if (url.match(pattern)) {
var tmp = '(' + arg + '=)([^&]*)';
tmp = url.replace(new RegExp(tmp, 'gi'), replaceText);
return tmp;
}
if (url.match('[?]')) {
return url + '&' + replaceText;
}
return url + '?' + replaceText;
},
//
nodeClick(data){
@ -104,7 +110,7 @@
this.column = data.column || 'column';
},
getType(){
this.$http.get('log/admin/types', {type:this.$route.query.type||''}, { cacheparameters: true }).then((res) => {
this.$http.get('log/admin/types', {type:this.search.type}, { cacheparameters: true }).then((res) => {
if (res.code == 200) {
Object.assign(this.$data, res.data);
}
@ -115,13 +121,14 @@
if (!this.api) {
this.api = 'log/admin/lists'
}
this.params = { type: this.current }
this.$refs.table.reload(this.params)
this.$refs.table.reload(this.search)
var url = this.changeURLArg(window.location.href, 'type', this.current )
url = this.changeURLArg(url, 'keyword', this.search.keyword )
history.replaceState(Object.assign({},window.history.state,{url: url}), 'null', url);
},
upsearch(){
this.getCurrent()
},
rowClick(row){
this.infoDrawer = true