|
|
@@ -3,7 +3,7 @@
|
|
|
<div class="communal-title">
|
|
|
<div>团组任务分配</div>
|
|
|
</div>
|
|
|
- <el-dialog title="批量分配" :visible.sync="batchVisible" close-on-click-modal="false">
|
|
|
+ <el-dialog title="批量分配" :visible.sync="batchVisible" :close-on-click-modal="false">
|
|
|
<el-form ref="batch" :rules="batchs" :model="batch">
|
|
|
<div class="batchbox">
|
|
|
<el-form-item prop="TimePeriod" label="时间段" :label-width="formLabelWidth">
|
|
|
@@ -49,9 +49,9 @@
|
|
|
<div class="konzh" style="display: flex;justify-content: space-between;">
|
|
|
<el-form style="display: flex;" label-width="70px" class="demo-form-inline">
|
|
|
<el-form-item style="width: 300px;margin-right: 20px;" label="团组名称">
|
|
|
- <el-select v-model="diId" filterable clearable placeholder="请选择" style="width:230px;"
|
|
|
+ <el-select v-model="diId" filterable :filter-method="advancedFilter" clearable placeholder="请选择" style="width:230px;"
|
|
|
@change="diidChange()">
|
|
|
- <el-option v-for="item1 in delegationInfos" :key=item1.id :label=item1.name
|
|
|
+ <el-option v-for="item1 in delegationInfoss" :key=item1.id :label=item1.name
|
|
|
:value=item1.id></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
@@ -171,6 +171,8 @@ export default {
|
|
|
token: '',
|
|
|
userId: 0,
|
|
|
delegationInfos: [],
|
|
|
+ delegationInfoss: [],
|
|
|
+ searchMode: 'character', // 'character': 字符匹配, 'fuzzy': 模糊匹配
|
|
|
setData: [],
|
|
|
user: [],
|
|
|
diId: '',
|
|
|
@@ -203,6 +205,42 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ advancedFilter(query) {
|
|
|
+ console.log(query);
|
|
|
+
|
|
|
+ if (!query || query.trim() === '') {
|
|
|
+ this.delegationInfoss = [...this.delegationInfos];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const trimmedQuery = query.trim();
|
|
|
+
|
|
|
+ if (this.searchMode === 'character') {
|
|
|
+ // 字符匹配模式:每个字都必须包含
|
|
|
+ this.characterMatchFilter(trimmedQuery);
|
|
|
+ } else {
|
|
|
+ // 模糊匹配模式(默认的filterable行为)
|
|
|
+ this.fuzzyMatchFilter(trimmedQuery);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /*** 严格的字符匹配 - 每个查询字符都必须出现*/
|
|
|
+ characterMatchFilter(query) {
|
|
|
+ const queryChars = query.split('').filter(char => char.trim() !== '');
|
|
|
+
|
|
|
+ this.delegationInfoss = this.delegationInfos.filter(item => {
|
|
|
+ const groupName = item.name || '';
|
|
|
+ return queryChars.every(char => groupName.includes(char));
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /*** 模糊匹配 - 包含整个查询字符串即可*/
|
|
|
+ fuzzyMatchFilter(query) {
|
|
|
+ const lowerQuery = query.toLowerCase();
|
|
|
+ this.delegationInfoss = this.delegationInfos.filter(item => {
|
|
|
+ const groupName = (item.name || '').toLowerCase();
|
|
|
+ return groupName.includes(lowerQuery);
|
|
|
+ });
|
|
|
+ },
|
|
|
GetTaskAssignmen() {
|
|
|
this.fullscreenLoading=true;
|
|
|
var that = this
|
|
|
@@ -217,6 +255,10 @@ export default {
|
|
|
console.log(res)
|
|
|
if (res.data.code == 200) {
|
|
|
that.delegationInfos = res.data.data.delegationInfos;
|
|
|
+ that.delegationInfoss = that.delegationInfos;
|
|
|
+ console.log(that.delegationInfoss);
|
|
|
+ console.log(that.delegationInfos);
|
|
|
+
|
|
|
that.diId=res.data.data.delegationInfos[0].id;
|
|
|
that.setData = res.data.data.setData;
|
|
|
that.ctId=res.data.data.setData[0].id;
|