|
|
|
@ -10,17 +10,21 @@
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<view class="tab-row">
|
|
|
|
<view class="filter-row">
|
|
|
|
<view class="tab" :class="typeTab === 'all' ? 'active' : ''" @click="switchType('all')">全部</view>
|
|
|
|
<text class="filter-label">通知类型</text>
|
|
|
|
<view class="tab" :class="typeTab === '1' ? 'active' : ''" @click="switchType('1')">内部</view>
|
|
|
|
<picker
|
|
|
|
<view class="tab" :class="typeTab === '2' ? 'active' : ''" @click="switchType('2')">外部</view>
|
|
|
|
mode="selector"
|
|
|
|
|
|
|
|
:range="noticeTypeOptions"
|
|
|
|
|
|
|
|
range-key="label"
|
|
|
|
|
|
|
|
:value="selectedNoticeTypeIndex"
|
|
|
|
|
|
|
|
@change="onNoticeTypeChange"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<view class="filter-picker">
|
|
|
|
|
|
|
|
<text class="picker-text">{{ selectedNoticeTypeLabel }}</text>
|
|
|
|
|
|
|
|
<text class="picker-arrow">▼</text>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</picker>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <view class="tab-row" style="margin-top: 20rpx;">
|
|
|
|
|
|
|
|
<view class="tab" :class="statusTab === 'all' ? 'active' : ''" @click="switchStatus('all')">全部状态</view>
|
|
|
|
|
|
|
|
<view class="tab" :class="statusTab === '0' ? 'active' : ''" @click="switchStatus('0')">草稿</view>
|
|
|
|
|
|
|
|
<view class="tab" :class="statusTab === '1' ? 'active' : ''" @click="switchStatus('1')">提交</view>
|
|
|
|
|
|
|
|
</view> -->
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 列表 -->
|
|
|
|
<!-- 列表 -->
|
|
|
|
@ -50,7 +54,7 @@
|
|
|
|
<view class="card-body">
|
|
|
|
<view class="card-body">
|
|
|
|
<view class="row">
|
|
|
|
<view class="row">
|
|
|
|
<text class="label">通知类型:</text>
|
|
|
|
<text class="label">通知类型:</text>
|
|
|
|
<text class="value">{{ item.noticeType || '—' }}</text>
|
|
|
|
<text class="value">{{ dict.getLabel('sys_notice_type', item.noticeType) || item.noticeType || '—' }}</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="row">
|
|
|
|
<view class="row">
|
|
|
|
<text class="label">通知范围:</text>
|
|
|
|
<text class="label">通知范围:</text>
|
|
|
|
@ -87,9 +91,8 @@ export default {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
query: {
|
|
|
|
query: {
|
|
|
|
noticeTitle: '',
|
|
|
|
noticeTitle: '',
|
|
|
|
|
|
|
|
noticeType: '',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeTab: 'all', // all | 1 | 2
|
|
|
|
|
|
|
|
statusTab: '1', // all | 0 | 1
|
|
|
|
|
|
|
|
records: [],
|
|
|
|
records: [],
|
|
|
|
page: 1,
|
|
|
|
page: 1,
|
|
|
|
limit: 10,
|
|
|
|
limit: 10,
|
|
|
|
@ -104,13 +107,29 @@ export default {
|
|
|
|
onPullDownRefresh() {
|
|
|
|
onPullDownRefresh() {
|
|
|
|
this.refreshList();
|
|
|
|
this.refreshList();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
computed: {
|
|
|
|
switchType(type) {
|
|
|
|
noticeTypeOptions() {
|
|
|
|
this.typeTab = type;
|
|
|
|
const dictList = this.dict.get('sys_notice_type') || [];
|
|
|
|
this.refreshList();
|
|
|
|
const options = dictList.map(item => ({
|
|
|
|
|
|
|
|
label: item.dictLabel,
|
|
|
|
|
|
|
|
value: item.dictValue,
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
return [{ label: '全部', value: '' }].concat(options);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
selectedNoticeTypeIndex() {
|
|
|
|
|
|
|
|
const index = this.noticeTypeOptions.findIndex(item => item.value === this.query.noticeType);
|
|
|
|
|
|
|
|
return index >= 0 ? index : 0;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
selectedNoticeTypeLabel() {
|
|
|
|
|
|
|
|
const current = this.noticeTypeOptions[this.selectedNoticeTypeIndex];
|
|
|
|
|
|
|
|
return current ? current.label : '全部';
|
|
|
|
},
|
|
|
|
},
|
|
|
|
switchStatus(status) {
|
|
|
|
},
|
|
|
|
this.statusTab = status;
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
onNoticeTypeChange(e) {
|
|
|
|
|
|
|
|
const index = Number(e?.detail?.value);
|
|
|
|
|
|
|
|
const current = this.noticeTypeOptions[index];
|
|
|
|
|
|
|
|
this.query.noticeType = current ? current.value : '';
|
|
|
|
this.refreshList();
|
|
|
|
this.refreshList();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async refreshList() {
|
|
|
|
async refreshList() {
|
|
|
|
@ -133,8 +152,11 @@ export default {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const noticeTitle = (this.query.noticeTitle || '').trim();
|
|
|
|
const noticeTitle = (this.query.noticeTitle || '').trim();
|
|
|
|
if (noticeTitle) params.noticeTitle = noticeTitle;
|
|
|
|
if (noticeTitle) params.noticeTitle = noticeTitle;
|
|
|
|
if (this.typeTab !== 'all') params.type = this.typeTab;
|
|
|
|
if (this.query.noticeType) {
|
|
|
|
if (this.statusTab !== 'all') params.status = this.statusTab;
|
|
|
|
params.noticeType = this.query.noticeType;
|
|
|
|
|
|
|
|
// 兼容后端仍使用 type 字段筛选的场景
|
|
|
|
|
|
|
|
params.type = this.query.noticeType;
|
|
|
|
|
|
|
|
}
|
|
|
|
return params;
|
|
|
|
return params;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async fetchList() {
|
|
|
|
async fetchList() {
|
|
|
|
@ -225,37 +247,39 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.tab-row {
|
|
|
|
.filter-row {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
background-color: #fff;
|
|
|
|
background-color: #fff;
|
|
|
|
border-radius: 12rpx;
|
|
|
|
border-radius: 12rpx;
|
|
|
|
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.06);
|
|
|
|
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.06);
|
|
|
|
|
|
|
|
padding: 0 20rpx;
|
|
|
|
|
|
|
|
height: 72rpx;
|
|
|
|
|
|
|
|
|
|
|
|
.tab {
|
|
|
|
.filter-label {
|
|
|
|
flex: 1;
|
|
|
|
|
|
|
|
height: 72rpx;
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
font-size: 26rpx;
|
|
|
|
font-size: 26rpx;
|
|
|
|
color: #666;
|
|
|
|
color: #666;
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
.filter-picker {
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
max-width: 420rpx;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.picker-text {
|
|
|
|
|
|
|
|
font-size: 26rpx;
|
|
|
|
color: #409eff;
|
|
|
|
color: #409eff;
|
|
|
|
font-weight: 600;
|
|
|
|
max-width: 360rpx;
|
|
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
&::after {
|
|
|
|
overflow: hidden;
|
|
|
|
content: '';
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
position: absolute;
|
|
|
|
}
|
|
|
|
bottom: 0;
|
|
|
|
|
|
|
|
left: 50%;
|
|
|
|
.picker-arrow {
|
|
|
|
transform: translateX(-50%);
|
|
|
|
margin-left: 10rpx;
|
|
|
|
width: 60rpx;
|
|
|
|
font-size: 18rpx;
|
|
|
|
height: 4rpx;
|
|
|
|
color: #999;
|
|
|
|
background-color: #409eff;
|
|
|
|
|
|
|
|
border-radius: 2rpx;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|