no message
This commit is contained in:
parent
59ffafd4ad
commit
9e6a896aed
@ -11,7 +11,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<el-drawer :with-header="false" append-to-body="true" v-if="visible" v-model="visible" :size="options.size || 1000" :show-close="false" style="overflow: initial;" destroy-on-close @closed="visible=false;$emit('closed')">
|
<el-drawer :with-header="false" append-to-body="true" v-if="visible" v-model="visible" :size="options.size || 1000" :show-close="false" style="overflow: initial;" destroy-on-close @closed="visible=false;$emit('closed')">
|
||||||
<el-button type="danger" @click="closeUser" class="userdrawerclose" icon="el-icon-close"> </el-button>
|
<el-button type="danger" @click="closeUser" class="userdrawerclose" icon="el-icon-close"> </el-button>
|
||||||
<x-user v-model="copiedData"></x-user>
|
<x-user v-model="copiedData" :type="options.type || 'member'"></x-user>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -299,6 +299,7 @@
|
|||||||
.el-form--inline .el-form-item{
|
.el-form--inline .el-form-item{
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
display: revert;
|
display: revert;
|
||||||
|
width: auto !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -13,14 +13,34 @@
|
|||||||
<input v-else-if="item.columntype=='input'" @click="handleClick(row, item)" style="cursor: pointer; " class="el-input__inner" type="text" readonly :value="row[item.name]">
|
<input v-else-if="item.columntype=='input'" @click="handleClick(row, item)" style="cursor: pointer; " class="el-input__inner" type="text" readonly :value="row[item.name]">
|
||||||
|
|
||||||
<p v-else-if="item.columntype=='status'">
|
<p v-else-if="item.columntype=='status'">
|
||||||
<x-status-indicator @click="handleClick(row, item)" v-for="op in item.options.items" :key="op.value" pulse :type="op.type || 'success'" :label="op.label" v-show="op.value==row[item.name]">
|
|
||||||
</x-status-indicator>
|
<template v-for="{ value, type = 'success', label } in item.options.items">
|
||||||
|
<x-status-indicator
|
||||||
|
:key="value"
|
||||||
|
pulse
|
||||||
|
:type="type"
|
||||||
|
:label="label"
|
||||||
|
@click="handleClick(row, item)"
|
||||||
|
v-if="value === row[item.name]"
|
||||||
|
></x-status-indicator>
|
||||||
|
</template>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p v-else-if="item.columntype=='button' && item.options.items && item.options.items.length>0">
|
<p v-else-if="item.columntype=='button' && item.options.items && item.options.items.length>0">
|
||||||
<el-button @click="handleClick(row, item)" v-for="op in item.options.items" :key="op.value" :type="op.type || 'warning'" style="margin: 0;" :size="op.size || 'small'" :link="op.link" :icon="op.icon" v-show="op.value==row[item.name]">
|
<template v-for="{ value, type = 'warning', size = 'small', label, icon, link } in item.options.items">
|
||||||
{{ op.label }}
|
<el-button
|
||||||
</el-button>
|
@click="handleClick(row, item)"
|
||||||
|
:key="value"
|
||||||
|
:type="type"
|
||||||
|
style="margin: 0;"
|
||||||
|
:size="size"
|
||||||
|
:link="link"
|
||||||
|
:icon="icon"
|
||||||
|
v-if="value === row[item.name]"
|
||||||
|
>
|
||||||
|
{{ label }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p v-else-if="item.columntype=='button'">
|
<p v-else-if="item.columntype=='button'">
|
||||||
@ -46,17 +66,22 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleClick(row, item){
|
handleClick(row, item){
|
||||||
|
|
||||||
// 打开编辑层
|
// 打开编辑层
|
||||||
if (item.update && (item.update.url || item.update.name)) {
|
if (item.update && (item.update.url || item.update.name)) {
|
||||||
this.$emit('xtableupdate', row, {
|
this.$emit('xtableupdate', row, {
|
||||||
name:item.update.name || item.name,
|
name:item.update.name || item.name,
|
||||||
remoteurl: item.update.url || 'system/table/getUpdate?name='+item.update.name
|
remoteurl: item.update.url || 'table/getUpdate?name='+item.update.name
|
||||||
}, item.update.type || 'dialog');
|
}, item.update.type || 'dialog', 'update');
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打开表格
|
// 打开表格
|
||||||
if (item.update && (item.update.url || item.update.name)) {
|
if (item.table && (item.table.url || item.table.name)) {
|
||||||
|
this.$emit('xtableupdate', row, {
|
||||||
|
name:item.table.name || item.name,
|
||||||
|
remoteurl: item.table.url || 'table/get?name='+item.table.name
|
||||||
|
}, item.table.type || 'dialog', 'table');
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -59,6 +59,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<x-update v-if="tableUpdateKey" :name="tableUpdateKey" ref="xtableupdate" @success="handleSuccess" @closed="tableUpdateKey=''"></x-update>
|
<x-update v-if="tableUpdateKey" :name="tableUpdateKey" ref="xtableupdate" @success="handleSuccess" @closed="tableUpdateKey=''"></x-update>
|
||||||
|
<xTabledialog v-if="xtabledialog" ref="xtabledialog" v-model="xtabledialog"></xTabledialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
@ -153,6 +154,7 @@
|
|||||||
column: [],
|
column: [],
|
||||||
customColumnShow: false,
|
customColumnShow: false,
|
||||||
tableUpdateKey: '',
|
tableUpdateKey: '',
|
||||||
|
xtabledialog: '',
|
||||||
summary: {},
|
summary: {},
|
||||||
visibleInfo: {},
|
visibleInfo: {},
|
||||||
config: {
|
config: {
|
||||||
@ -181,10 +183,19 @@
|
|||||||
this.isActivat = false;
|
this.isActivat = false;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
xtableupdate(row, options=[], type){
|
xtableupdate(row, options=[], componenttype, type){
|
||||||
this.tableUpdateKey = options.name || this.name;
|
|
||||||
|
if (type=='update') {
|
||||||
|
this.tableUpdateKey = options.name || this.name;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.xtableupdate.open().getComponentType(componenttype).setData(row).setConfig(options);
|
||||||
|
})
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.xtabledialog = options.name || this.name;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.xtableupdate.open().getComponentType(type).setData(row).setConfig(options);
|
this.$refs.xtabledialog.open().getComponentType(componenttype).setConfig(options);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取数据
|
//获取数据
|
||||||
|
@ -9,11 +9,11 @@
|
|||||||
<div style="padding:0 6px 6px 6px" class="pagetable">
|
<div style="padding:0 6px 6px 6px" class="pagetable">
|
||||||
<xTable
|
<xTable
|
||||||
ref="table"
|
ref="table"
|
||||||
:tableColumn="column"
|
:tableColumn="config.column"
|
||||||
:name="tablename"
|
:name="config.tablename"
|
||||||
:params="search"
|
:params="config.search"
|
||||||
api="app/url/lists"
|
:api="config.api"
|
||||||
:row-key="key"
|
:row-key="config.key"
|
||||||
:remoteSort="true"
|
:remoteSort="true"
|
||||||
:remoteFilter="true"
|
:remoteFilter="true"
|
||||||
:hideDo="true"
|
:hideDo="true"
|
||||||
@ -23,22 +23,17 @@
|
|||||||
:height="contentHeight"
|
:height="contentHeight"
|
||||||
border
|
border
|
||||||
stripe>
|
stripe>
|
||||||
|
|
||||||
<el-table-column prop="msg" label="msg" width="800" />
|
|
||||||
<el-table-column prop="id" label="Name" width="180" />
|
|
||||||
<el-table-column prop="address" label="Address" width="500" />
|
|
||||||
|
|
||||||
|
|
||||||
</xTable>
|
</xTable>
|
||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
|
||||||
<el-pagination
|
<el-pagination
|
||||||
style="float: right;"
|
style="float: right;"
|
||||||
background
|
background
|
||||||
layout="consists,prev,pager,next"
|
layout="consists,prev,pager,next"
|
||||||
:total="1000"
|
:total="page.total"
|
||||||
:page-size="100"
|
:page-size="page.scPageSize"
|
||||||
:page-sizes="100" />
|
/>
|
||||||
</template>
|
</template>
|
||||||
</component>
|
</component>
|
||||||
</div>
|
</div>
|
||||||
@ -70,12 +65,17 @@
|
|||||||
},
|
},
|
||||||
data: {},
|
data: {},
|
||||||
style: {},
|
style: {},
|
||||||
|
page: {
|
||||||
|
total:0,
|
||||||
|
scPageSize:0,
|
||||||
|
currentPage:1,
|
||||||
|
},
|
||||||
config: {
|
config: {
|
||||||
column : this.column,
|
column : this.column,
|
||||||
labelPosition : "right",
|
labelPosition : "right",
|
||||||
labelWidth : "120px",
|
labelWidth : "120px",
|
||||||
size : "medium",
|
size : "medium",
|
||||||
url:'',
|
api:'',
|
||||||
submitname:'保存'
|
submitname:'保存'
|
||||||
},
|
},
|
||||||
size:900,
|
size:900,
|
||||||
@ -87,7 +87,12 @@
|
|||||||
watch: {
|
watch: {
|
||||||
column(){
|
column(){
|
||||||
this.config.column = this.column;
|
this.config.column = this.column;
|
||||||
}
|
},
|
||||||
|
'$refs.table.currentPage': function(newVal, oldVal) {
|
||||||
|
// 当this.$refs.table.total发生变化时,会执行这个回调函数
|
||||||
|
console.log('this.$refs.table.total发生了变化', newVal, oldVal);
|
||||||
|
// 这里可以进行你的逻辑处理
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
componentType() {
|
componentType() {
|
||||||
@ -119,11 +124,12 @@
|
|||||||
this.loading = true;
|
this.loading = true;
|
||||||
setTimeout(async ()=>{
|
setTimeout(async ()=>{
|
||||||
var res = await this.$http.get(this.config.remoteurl, {[this.key]: this.data[this.key]})
|
var res = await this.$http.get(this.config.remoteurl, {[this.key]: this.data[this.key]})
|
||||||
|
|
||||||
if (res.code == 200 ) {
|
if (res.code == 200 ) {
|
||||||
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.data.config) {
|
if (res.data) {
|
||||||
Object.assign(this.config, res.data.config);
|
Object.assign(this.config, res.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res.data.data) {
|
if (res.data.data) {
|
||||||
@ -145,6 +151,12 @@
|
|||||||
if (res.data.style) {
|
if (res.data.style) {
|
||||||
this.style = res.data.style;
|
this.style = res.data.style;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
this.page.total = this.$refs.table.total;
|
||||||
|
this.page.scPageSize = this.$refs.table.scPageSize;
|
||||||
|
},100);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$alert(res.message, "提示", {type: 'error'});
|
this.$alert(res.message, "提示", {type: 'error'});
|
||||||
|
@ -114,7 +114,6 @@
|
|||||||
this.$api.system.table.get(this.tablename, { cache: this.$route.meta.tablecache || 0 }).then((res) => {
|
this.$api.system.table.get(this.tablename, { cache: this.$route.meta.tablecache || 0 }).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
Object.assign(this.$data, res.data);
|
Object.assign(this.$data, res.data);
|
||||||
|
|
||||||
if (res.data.tabsdefaultvalue && res.data.tabskey) {
|
if (res.data.tabsdefaultvalue && res.data.tabskey) {
|
||||||
this.search[res.data.tabskey] = res.data.tabsdefaultvalue
|
this.search[res.data.tabskey] = res.data.tabsdefaultvalue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user