no message

This commit is contained in:
小陌 2023-07-07 13:01:16 +08:00
parent 8ae965de48
commit 6a8d59e7a7
3 changed files with 63 additions and 30 deletions

View File

@ -7,20 +7,10 @@
<el-table-column v-if="!item.hide && item.name" :column-key="item.name" :label="item.label" :prop="item.name" :width="item.width || 'auto'" :min-width="item.minWidth || 'auto'" :sortable="item.sortable" :fixed="item.fixed" :filters="item.filters" :filter-method="remoteFilter||!item.filters?null:filterHandler" :show-overflow-tooltip="item.showOverflowTooltip">
<template #default="scope">
<div style="display: flex;align-items: center;" @click="getUser(scope.row, scope.row[item.options.subfield])" v-if="item.columntype=='avatar' || item.component=='avatar'">
<el-avatar v-if="scope.row.anonymous" title="匿名发布" size="small"></el-avatar>
<el-avatar v-else :src="scope.row[item.name]" size="small"></el-avatar>
<label v-if="item.options.subfield" style="position: absolute;left: 42px;">
<input class="el-input__inner" type="text" readonly :value="scope.row[item.options.subfield]">
</label>
</div>
<x-avatar v-if="item.columntype=='avatar' || item.component=='avatar'" :name="item.name" :options="item.options" v-model="scope.row"></x-avatar>
<el-badge v-else-if="item.columntype=='badge'" :value="scope.row[item.name]" :type="item.options.type || 'warning'"></el-badge>
<el-tag style="border: none; background: none;" v-else-if="item.columntype=='tag'" v-time.tip="scope.row[item.name]"></el-tag>
<el-badge v-else-if="item.columntype=='imagegroup'" :value="scope.row[item.name].length" :type="item.options.type || 'warning'"></el-badge>
<el-image v-else-if="item.columntype=='image'" hide-on-click-modal="true" lazy="true" style="width: 30px; height: 30px" fit="cover" :src="getImg(scope.row[item.name])">
<template #error>
<div class="image-slot">
@ -28,7 +18,6 @@
</div>
</template>
</el-image>
<p v-else-if="item.columntype=='status'">
<sc-status-indicator v-for="op in item.options.items" :key="op.value" pulse :type="op.type || 'success'" :label="op.label" v-show="op.value==scope.row[item.name]">
</sc-status-indicator>
@ -86,16 +75,10 @@
</div>
</div>
</div>
<el-drawer type="primary" :with-header="false" append-to-body="true" v-model="visible" :size="1000" :show-close="false" style="overflow: initial;" destroy-on-close @closed="$emit('closed')">
<el-button type="danger" @click="closeUser" class="userdrawerclose" icon="el-icon-close"> </el-button>
<x-user v-model="visibleInfo"></x-user>
</el-drawer>
</template>
<style scoped>
.userdrawerclose {position: absolute; position: absolute; top: 148px; left: -36px; z-index: 10000; border-top-right-radius: 0px; border-bottom-right-radius: 0px; padding: 6px; font-size: 22px; font-weight: bolder;}
.scTable {}
.scTable-table {height: calc(100% - 50px);}
.scTable-page {height:50px;display: flex;align-items: center;justify-content: space-between;padding:0 15px;}
@ -211,18 +194,6 @@
this.isActivat = false;
},
methods: {
closeUser(){
this.visible = false;
},
getUser(o){
this.visible = true
this.visibleInfo = {
uid:o.uid,
avatar:o.avatar,
nickname:o.nickname,
username:o.username,
}
},
getNameByValue (value, degrees) {
const degree = degrees.find(degree => degree.value === value);
return degree ? (degree.name?degree.name:degree.label) : value;

View File

@ -0,0 +1,60 @@
<!--
* @Descripttion: 用户头像
-->
<template>
<div style="display: flex;align-items: center;cursor: pointer; " @click="getUser(data)">
<el-avatar v-if="data.anonymous" title="匿名发布" size="small"></el-avatar>
<el-avatar v-else :src="data[name]" size="small"></el-avatar>
<label v-if="options.subfield" style="position: absolute;left: 42px;">
<input class="el-input__inner" type="text" readonly :value="data[options.subfield]">
</label>
</div>
</template>
<el-drawer type="primary" :with-header="false" append-to-body="true" v-model="visible" :size="1000" :show-close="false" style="overflow: initial;" destroy-on-close @closed="$emit('closed')">
<el-button type="danger" @click="closeUser" class="userdrawerclose" icon="el-icon-close"> </el-button>
<x-user v-model="visibleInfo"></x-user>
</el-drawer>
<script>
export default {
props: {
modelValue: { type: Object, default: () => {} },
options: { type: Object, default: () => {} },
name: { type: String, default: "avatar" },
},
data() {
return {
data: this.modelValue,
visible:false,
visibleInfo:{},
}
},
watch:{
},
mounted() {
},
methods: {
closeUser(){
this.visible = false;
},
getUser(o){
this.visible = true
this.visibleInfo = {
uid:o.uid,
avatar:o.avatar,
nickname:o.nickname,
username:o.username,
}
},
}
}
</script>
<style scoped>
.userdrawerclose {position: absolute; position: absolute; top: 148px; left: -36px; z-index: 10000; border-top-right-radius: 0px; border-bottom-right-radius: 0px; padding: 6px; font-size: 22px; font-weight: bolder;}
</style>

View File

@ -20,6 +20,7 @@ import xDialog from './components/xDialog'
import scForm from './components/scForm'
import XItem from './components/scForm/item'
import xUser from './components/xUser'
import xAvatar from './components/xAvatar'
import xUpdate from './components/xUpdate'
import scTitle from './components/scTitle'
import scWaterMark from './components/scWaterMark'
@ -47,6 +48,7 @@ export default {
//注册全局组件
app.component('XItem', XItem);
app.component('xUser', xUser);
app.component('xAvatar', xAvatar);
app.component('xUpdate', xUpdate);
app.component('scTable', scTable);
app.component('scTableColumn', scTableColumn);