Commit 7f4a6bac6689f04a52267fcfaac984dfe708a2fe
1 parent
f082fe8e
接口地址库区选择改多选框
Signed-off-by: TanYibin <5491541@qq.com>
Showing
1 changed file
with
33 additions
and
16 deletions
ant-design-vue-jeecg/src/views/system/config/AddressList.vue
@@ -6,11 +6,10 @@ | @@ -6,11 +6,10 @@ | ||
6 | <a-row :gutter="24"> | 6 | <a-row :gutter="24"> |
7 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> | 7 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
8 | <a-form-item label="库区"> | 8 | <a-form-item label="库区"> |
9 | - <a-select show-search placeholder="请选择库区" option-filter-prop="children" v-model="queryParam.zoneCode" > | ||
10 | - <a-select-option v-for="item in zoneList" :key="item.name" :value="item.code"> | ||
11 | - {{ item.name }} | ||
12 | - </a-select-option> | ||
13 | - </a-select> | 9 | + <a-form-model-item prop="zoneOptions"> |
10 | + <j-multi-select-tag v-model="queryParam.zoneCode" :options="zoneOptions" placeholder="请选择"> | ||
11 | + </j-multi-select-tag> | ||
12 | + </a-form-model-item> | ||
14 | </a-form-item> | 13 | </a-form-item> |
15 | </a-col> | 14 | </a-col> |
16 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> | 15 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
@@ -37,17 +36,27 @@ | @@ -37,17 +36,27 @@ | ||
37 | <!-- 操作按钮区域 --> | 36 | <!-- 操作按钮区域 --> |
38 | <div class="table-operator"> | 37 | <div class="table-operator"> |
39 | <a-button @click="handleAdd" v-has="'address:add'" type="primary" icon="plus">新增</a-button> | 38 | <a-button @click="handleAdd" v-has="'address:add'" type="primary" icon="plus">新增</a-button> |
40 | - <a-button v-has="'address:export'" type="primary" icon="download" @click="handleExportXls('接口地址')">导出</a-button> | ||
41 | - <a-upload v-has="'address:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | 39 | + <a-button v-has="'address:export'" type="primary" icon="download" @click="handleExportXls('接口地址')" |
40 | + >导出</a-button | ||
41 | + > | ||
42 | + <a-upload | ||
43 | + v-has="'address:import'" | ||
44 | + name="file" | ||
45 | + :showUploadList="false" | ||
46 | + :multiple="false" | ||
47 | + :headers="tokenHeader" | ||
48 | + :action="importExcelUrl" | ||
49 | + @change="handleImportExcel" | ||
50 | + > | ||
42 | <a-button type="primary" icon="import">导入</a-button> | 51 | <a-button type="primary" icon="import">导入</a-button> |
43 | </a-upload> | 52 | </a-upload> |
44 | <a-dropdown v-if="selectedRowKeys.length > 0"> | 53 | <a-dropdown v-if="selectedRowKeys.length > 0"> |
45 | <a-menu slot="overlay" v-has="'address:deleteBatch'"> | 54 | <a-menu slot="overlay" v-has="'address:deleteBatch'"> |
46 | - <a-menu-item key="1" @click="batchDel"> | ||
47 | - <a-icon type="delete"/> 删除 </a-menu-item> | 55 | + <a-menu-item key="1" @click="batchDel"> <a-icon type="delete" /> 删除 </a-menu-item> |
48 | </a-menu> | 56 | </a-menu> |
49 | - <a-button style="margin-left: 8px"> 批量操作 | ||
50 | - <a-icon type="down"/> | 57 | + <a-button style="margin-left: 8px"> |
58 | + 批量操作 | ||
59 | + <a-icon type="down" /> | ||
51 | </a-button> | 60 | </a-button> |
52 | </a-dropdown> | 61 | </a-dropdown> |
53 | </div> | 62 | </div> |
@@ -57,7 +66,7 @@ | @@ -57,7 +66,7 @@ | ||
57 | <a-table | 66 | <a-table |
58 | ref="table" | 67 | ref="table" |
59 | size="middle" | 68 | size="middle" |
60 | - :scroll="{x:true}" | 69 | + :scroll="{ x: true }" |
61 | bordered | 70 | bordered |
62 | rowKey="id" | 71 | rowKey="id" |
63 | :columns="columns" | 72 | :columns="columns" |
@@ -65,8 +74,8 @@ | @@ -65,8 +74,8 @@ | ||
65 | :pagination="ipagination" | 74 | :pagination="ipagination" |
66 | :loading="loading" | 75 | :loading="loading" |
67 | class="j-table-force-nowrap" | 76 | class="j-table-force-nowrap" |
68 | - @change="handleTableChange"> | ||
69 | - | 77 | + @change="handleTableChange" |
78 | + > | ||
70 | <span slot="zoneCode" slot-scope="zoneCode"> | 79 | <span slot="zoneCode" slot-scope="zoneCode"> |
71 | <a-tag :key="zoneCode" color="blue"> | 80 | <a-tag :key="zoneCode" color="blue"> |
72 | {{ solutionZoneCode(zoneCode) }} | 81 | {{ solutionZoneCode(zoneCode) }} |
@@ -76,7 +85,7 @@ | @@ -76,7 +85,7 @@ | ||
76 | <span slot="action" slot-scope="text, record"> | 85 | <span slot="action" slot-scope="text, record"> |
77 | <a v-has="'address:edit'" @click="handleEdit(record)">编辑</a> | 86 | <a v-has="'address:edit'" @click="handleEdit(record)">编辑</a> |
78 | 87 | ||
79 | - <a-divider type="vertical"/> | 88 | + <a-divider type="vertical" /> |
80 | <a-dropdown> | 89 | <a-dropdown> |
81 | <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> | 90 | <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> |
82 | <a-menu slot="overlay"> | 91 | <a-menu slot="overlay"> |
@@ -91,7 +100,6 @@ | @@ -91,7 +100,6 @@ | ||
91 | </a-menu> | 100 | </a-menu> |
92 | </a-dropdown> | 101 | </a-dropdown> |
93 | </span> | 102 | </span> |
94 | - | ||
95 | </a-table> | 103 | </a-table> |
96 | </div> | 104 | </div> |
97 | 105 | ||
@@ -116,6 +124,7 @@ export default { | @@ -116,6 +124,7 @@ export default { | ||
116 | return { | 124 | return { |
117 | description: '接口地址管理页面', | 125 | description: '接口地址管理页面', |
118 | zoneList: [], | 126 | zoneList: [], |
127 | + zoneOptions: [], | ||
119 | // 表头 | 128 | // 表头 |
120 | columns: [ | 129 | columns: [ |
121 | { | 130 | { |
@@ -196,6 +205,14 @@ export default { | @@ -196,6 +205,14 @@ export default { | ||
196 | getZoneList().then(res => { | 205 | getZoneList().then(res => { |
197 | if (res.success) { | 206 | if (res.success) { |
198 | this.zoneList = res.result | 207 | this.zoneList = res.result |
208 | + //延迟半秒执行,避免组件未加载完,数据已经加载完 | ||
209 | + setTimeout(() => { | ||
210 | + //slice可以在数组的任何位置进行删除/添加操作 | ||
211 | + this.zoneOptions.splice(0, 1) | ||
212 | + for (let i = 0; i < res.result.length; i++) { | ||
213 | + this.zoneOptions.push({ value: res.result[i].code, text: res.result[i].name }) | ||
214 | + } | ||
215 | + }, 500) | ||
199 | } | 216 | } |
200 | }) | 217 | }) |
201 | }, | 218 | }, |