no message
This commit is contained in:
parent
59ffafd4ad
commit
9e6a896aed
@ -11,7 +11,7 @@
|
||||
</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-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>
|
||||
</template>
|
||||
|
||||
|
@ -299,6 +299,7 @@
|
||||
.el-form--inline .el-form-item{
|
||||
margin-top: 10px;
|
||||
display: revert;
|
||||
width: auto !important;
|
||||
}
|
||||
}
|
||||
</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]">
|
||||
|
||||
<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 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]">
|
||||
{{ op.label }}
|
||||
</el-button>
|
||||
<template v-for="{ value, type = 'warning', size = 'small', label, icon, link } in item.options.items">
|
||||
<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 v-else-if="item.columntype=='button'">
|
||||
@ -46,17 +66,22 @@
|
||||
},
|
||||
methods: {
|
||||
handleClick(row, item){
|
||||
|
||||
// 打开编辑层
|
||||
if (item.update && (item.update.url || item.update.name)) {
|
||||
this.$emit('xtableupdate', row, {
|
||||
name:item.update.name || item.name,
|
||||
remoteurl: item.update.url || 'system/table/getUpdate?name='+item.update.name
|
||||
}, item.update.type || 'dialog');
|
||||
remoteurl: item.update.url || 'table/getUpdate?name='+item.update.name
|
||||
}, item.update.type || 'dialog', 'update');
|
||||
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 ;
|
||||
}
|
||||
},
|
||||
|
@ -59,6 +59,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
|
||||
@ -153,6 +154,7 @@
|
||||
column: [],
|
||||
customColumnShow: false,
|
||||
tableUpdateKey: '',
|
||||
xtabledialog: '',
|
||||
summary: {},
|
||||
visibleInfo: {},
|
||||
config: {
|
||||
@ -181,10 +183,19 @@
|
||||
this.isActivat = false;
|
||||
},
|
||||
methods: {
|
||||
xtableupdate(row, options=[], type){
|
||||
this.tableUpdateKey = options.name || this.name;
|
||||
xtableupdate(row, options=[], componenttype, type){
|
||||
|
||||
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.$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">
|
||||
<xTable
|
||||
ref="table"
|
||||
:tableColumn="column"
|
||||
:name="tablename"
|
||||
:params="search"
|
||||
api="app/url/lists"
|
||||
:row-key="key"
|
||||
:tableColumn="config.column"
|
||||
:name="config.tablename"
|
||||
:params="config.search"
|
||||
:api="config.api"
|
||||
:row-key="config.key"
|
||||
:remoteSort="true"
|
||||
:remoteFilter="true"
|
||||
:hideDo="true"
|
||||
@ -23,22 +23,17 @@
|
||||
:height="contentHeight"
|
||||
border
|
||||
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>
|
||||
</div>
|
||||
<template #footer>
|
||||
|
||||
<el-pagination
|
||||
style="float: right;"
|
||||
background
|
||||
layout="consists,prev,pager,next"
|
||||
:total="1000"
|
||||
:page-size="100"
|
||||
:page-sizes="100" />
|
||||
:total="page.total"
|
||||
:page-size="page.scPageSize"
|
||||
/>
|
||||
</template>
|
||||
</component>
|
||||
</div>
|
||||
@ -70,12 +65,17 @@
|
||||
},
|
||||
data: {},
|
||||
style: {},
|
||||
page: {
|
||||
total:0,
|
||||
scPageSize:0,
|
||||
currentPage:1,
|
||||
},
|
||||
config: {
|
||||
column : this.column,
|
||||
labelPosition : "right",
|
||||
labelWidth : "120px",
|
||||
size : "medium",
|
||||
url:'',
|
||||
api:'',
|
||||
submitname:'保存'
|
||||
},
|
||||
size:900,
|
||||
@ -87,7 +87,12 @@
|
||||
watch: {
|
||||
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: {
|
||||
componentType() {
|
||||
@ -119,11 +124,12 @@
|
||||
this.loading = true;
|
||||
setTimeout(async ()=>{
|
||||
var res = await this.$http.get(this.config.remoteurl, {[this.key]: this.data[this.key]})
|
||||
|
||||
if (res.code == 200 ) {
|
||||
|
||||
this.loading = false;
|
||||
if (res.data.config) {
|
||||
Object.assign(this.config, res.data.config);
|
||||
if (res.data) {
|
||||
Object.assign(this.config, res.data);
|
||||
}
|
||||
|
||||
if (res.data.data) {
|
||||
@ -145,6 +151,12 @@
|
||||
if (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;
|
||||
}
|
||||
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) => {
|
||||
if (res.code == 200) {
|
||||
Object.assign(this.$data, res.data);
|
||||
|
||||
if (res.data.tabsdefaultvalue && res.data.tabskey) {
|
||||
this.search[res.data.tabskey] = res.data.tabsdefaultvalue
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user