no message

This commit is contained in:
小陌 2023-06-29 00:04:32 +08:00
parent 1795040676
commit 5c50c2575b
9 changed files with 73 additions and 60 deletions

View File

@ -17,11 +17,11 @@
</template>
<!-- input -->
<template v-if="item.component=='input'">
<el-input v-model="form[item.name]" :placeholder="item.options.placeholder" clearable :maxlength="item.options.maxlength" show-word-limit></el-input>
<el-input v-model="form[item.name]" v-bind="item.options" show-word-limit></el-input>
</template>
<!-- textarea -->
<template v-else-if="item.component=='textarea'">
<el-input v-model="form[item.name]" :placeholder="item.options.placeholder" :rows="item.options.rows" clearable :maxlength="item.options.maxlength" type="textarea" show-word-limit></el-input>
<el-input v-model="form[item.name]" v-bind="item.options" type="textarea" show-word-limit></el-input>
</template>
<!-- checkbox -->
<template v-else-if="item.component=='checkbox'">
@ -53,7 +53,7 @@
<!-- select -->
<template v-else-if="item.component=='select'">
<el-select v-model="form[item.name]" :multiple="item.options.multiple" :placeholder="item.options.placeholder" clearable filterable style="width: 100%;">
<el-option v-for="option in item.options.items" :key="option.value" :label="option.label" :value="option.value"></el-option>
<el-option v-for="option in item.options.items" :key="option.value" :label="option.label || option.name" :value="option.value"></el-option>
</el-select>
</template>
<!-- cascader -->
@ -99,7 +99,9 @@
</template>
<template v-else-if="item.component=='avatar'">
<el-avatar :src="form[item.name]" size="small"></el-avatar>
<el-link v-if="item.options.subfield" type="info" style="padding: 0 10px;" :underline="false">{{ form[item.options.subfield] }}</el-link>
<el-link v-if="item.options.subfield" type="info" style="padding: 0 10px;" :underline="false">
{{ form[item.options.subfield] }}
</el-link>
</template>
<template v-else-if="item.component=='formtable'">
<sc-form-table drag-sort="" placeholder="暂无数据" ref="videostable" :addTemplate="item.options.addTemplate || {}" :column="item.options.column || []" v-model="form[item.name]" :hideAdd="item.options.hideAdd || true" :hideDelete="item.options.hideDelete || true">

View File

@ -1,5 +1,5 @@
<template>
<sc-table-select v-model="value" :apiObj="apiObj" :table-width="600" :multiple="item.options.multiple" :props="item.options.props" style="width: 100%;">
<sc-table-select v-model="value" :api="item.api" :data="item.data" :table-width="600" :multiple="item.options.multiple" :props="item.options.props" style="width: 100%;">
<el-table-column v-for="(_item, _index) in item.options.column" :key="_index" :prop="_item.prop" :label="_item.label" :width="_item.width"></el-table-column>
</sc-table-select>
</template>
@ -14,7 +14,6 @@
data() {
return {
value: this.modelValue,
apiObj: this.getApiObj()
}
},
watch:{
@ -26,9 +25,6 @@
},
methods: {
getApiObj(){
return eval(`this.`+this.item.options.apiObj)
}
}
}
</script>

View File

@ -1,16 +1,10 @@
<!--
* @Descripttion: 状态指示器
* @version: 1.0
* @Author: sakuya
* @Date: 2021年11月11日09:30:12
* @LastEditors:
* @LastEditTime:
-->
<template>
<div>
<span class="sc-state" :class="[{'sc-status-processing':pulse}, 'sc-state-bg--'+type]"></span>
<span v-if="label" style="padding:0 6px;color: #8a8888; font-size: 12px; }">{{ label }}</span>
<span v-if="label" class="hidden-sm-and-down" style="padding:0 6px;color: #8a8888; font-size: 12px; }">{{ label }}</span>
</div>
</template>

View File

@ -4,17 +4,21 @@
<el-table v-bind="$attrs" :data="tableData" :row-key="rowKey" :key="toggleIndex" ref="scTable" :height="height=='auto'?null:'100%'" :size="config.size" :border="config.border" :stripe="config.stripe" :summary-method="remoteSummary?remoteSummaryMethod:summaryMethod" @sort-change="sortChange" @filter-change="filterChange">
<slot></slot>
<template v-for="(item, index) in column" :key="index">
<el-table-column v-if="!item.hide && item.name" :column-key="item.name" :label="item.label" :prop="item.name" :width="item.width || 150" :sortable="item.sortable" :fixed="item.fixed" :filters="item.filters" :filter-method="remoteFilter||!item.filters?null:filterHandler" :show-overflow-tooltip="item.showOverflowTooltip">
<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;" v-if="item.columntype=='avatar'">
<el-avatar :src="scope.row[item.name]" size="small"></el-avatar>
<label v-if="item.options.subfield" style="display: inline-block;margin-left:5px;font-size: 12px;cursor:pointer;">
{{ scope.row[item.options.subfield] }}
<div style="display: flex;align-items: center;" 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>
<el-badge v-else-if="item.columntype=='badge'" :value="scope.row[item.name]" :type="item.options.type || 'warning'"></el-badge>
<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">
@ -27,11 +31,16 @@
<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>
</p>
<slot v-else :name="item.name" v-bind="scope">
<p style="overflow:hidden; white-space: nowrap; text-overflow: ellipsis; -o-text-overflow:ellipsis;" :title="scope.row[item.name]">
{{scope.row[item.name]}}
<p v-else-if="item.columntype=='input'">
<input class="el-input__inner" type="text" readonly :value="scope.row[item.name]">
</p>
<slot v-else-if="item.columntype=='select'" :name="item.name" v-bind="scope">
<p style="overflow:hidden; white-space: nowrap; text-overflow: ellipsis; -o-text-overflow:ellipsis;" :title="scope.row[item.name]">
{{ getNameByValue( scope.row[item.name], item.options.items) }}
</p>
</slot>
<slot v-else :name="item.name" v-bind="scope">
{{scope.row[item.name]}}
</slot>
</template>
</el-table-column>
@ -181,6 +190,12 @@
this.isActivat = false;
},
methods: {
getNameByValue (value, degrees) {
const degree = degrees.find(degree => degree.value === value);
return degree ? (degree.name?degree.name:degree.label) : value;
},
getImg(o){
if (!o) {
return ;

View File

@ -1,10 +1,5 @@
<!--
* @Descripttion: 表格选择器组件
* @version: 1.3
* @Author: sakuya
* @Date: 2021年6月10日10:04:07
* @LastEditors: sakuya
* @LastEditTime: 2022年6月6日21:50:36
-->
<template>
@ -17,12 +12,12 @@
<el-table ref="table" :data="tableData" :height="245" :highlight-current-row="!multiple" @row-click="click" @select="select" @select-all="selectAll">
<el-table-column v-if="multiple" type="selection" width="45"></el-table-column>
<el-table-column v-else type="index" width="45">
<template #default="scope"><span>{{scope.$index+(currentPage - 1) * pageSize + 1}}</span></template>
<template #default="scope"><span>{{scope.$index+(currentPage - 1) * limit + 1}}</span></template>
</el-table-column>
<slot></slot>
</el-table>
<div class="sc-table-select__page">
<el-pagination small background layout="prev, pager, next" :total="total" :page-size="pageSize" v-model:currentPage="currentPage" @current-change="reload"></el-pagination>
<el-pagination small background layout="prev, pager, next" :total="total" :page-size="limit" v-model:currentPage="currentPage" @current-change="reload"></el-pagination>
</div>
</div>
</template>
@ -35,7 +30,7 @@
export default {
props: {
modelValue: null,
apiObj: { type: Object, default: () => {} },
api: { type: String, default: '' },
params: { type: Object, default: () => {} },
placeholder: { type: String, default: "请选择" },
size: { type: String, default: "default" },
@ -55,14 +50,14 @@
keyword: null,
defaultValue: [],
tableData: [],
pageSize: config.pageSize,
limit: config.limit,
total: 0,
currentPage: 1,
defaultProps: {
label: config.props.label,
value: config.props.value,
page: config.request.page,
pageSize: config.request.pageSize,
limit: config.request.limit,
keyword: config.request.keyword
},
formData: {}
@ -102,11 +97,11 @@
this.loading = true;
var reqData = {
[this.defaultProps.page]: this.currentPage,
[this.defaultProps.pageSize]: this.pageSize,
[this.defaultProps.limit]: this.limit,
[this.defaultProps.keyword]: this.keyword
}
Object.assign(reqData, this.params, this.formData)
var res = await this.apiObj.get(reqData);
var res = await this.$http.get(this.api, reqData);
var parseData = config.parseData(res)
this.tableData = parseData.rows;
this.total = parseData.total;

View File

@ -1,19 +1,18 @@
//表格选择器配置
export default {
pageSize: 20, //表格每一页条数
parseData: function (res) {
limit: 20, //表格每一页条数
parseData: function(res) {
return {
data: res.data,
rows: res.data.rows, //分析行数据字段结构
total: res.data.total, //分析总数字段结构
rows: res.data.data, //分析行数据字段结构
total: res.data.count, //分析总数字段结构
msg: res.message, //分析描述字段结构
code: res.code //分析状态字段结构
}
},
request: {
page: 'page', //规定当前分页字段
pageSize: 'pageSize', //规定一页条数字段
limit: 'limit', //规定一页条数字段
keyword: 'keyword' //规定搜索字段
},
props: {

View File

@ -42,6 +42,11 @@
.el-popconfirm__main {margin: 14px 0;}
.el-card__header {border-bottom: 0;font-size: 17px;font-weight: bold;padding:15px 20px 0px 20px;}
.el-dialog__title {font-size: 17px;font-weight: bold;}
.el-drawer__header{
margin-bottom: 12px;
}
.el-drawer__header>:first-child {font-size: 17px;font-weight: bold;}
.el-tree.menu .el-tree-node__content {height:36px;}
.el-tree.menu .el-tree-node__content .el-tree-node__label .icon {margin-right: 5px;}

View File

@ -51,4 +51,11 @@
.common-main .el-form {width: 100% !important;}
.common-header-logo label {display: none;}
.common-header-title {display: none;}
.el-drawer {
--el-drawer-bg-color: var(--el-dialog-bg-color, var(--el-bg-color));
--el-drawer-padding-primary: var(--el-dialog-padding-primary, 10px 20px);
}
}

View File

@ -65,8 +65,8 @@
}
],
value2: {
id: "520000198407304275",
user: "史平"
id: "520000198407275",
user: "史平lllll"
},
props: {
label: 'user',