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 | 6 | <a-row :gutter="24"> |
7 | 7 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
8 | 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 | 13 | </a-form-item> |
15 | 14 | </a-col> |
16 | 15 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
... | ... | @@ -37,17 +36,27 @@ |
37 | 36 | <!-- 操作按钮区域 --> |
38 | 37 | <div class="table-operator"> |
39 | 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 | 51 | <a-button type="primary" icon="import">导入</a-button> |
43 | 52 | </a-upload> |
44 | 53 | <a-dropdown v-if="selectedRowKeys.length > 0"> |
45 | 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 | 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 | 60 | </a-button> |
52 | 61 | </a-dropdown> |
53 | 62 | </div> |
... | ... | @@ -57,7 +66,7 @@ |
57 | 66 | <a-table |
58 | 67 | ref="table" |
59 | 68 | size="middle" |
60 | - :scroll="{x:true}" | |
69 | + :scroll="{ x: true }" | |
61 | 70 | bordered |
62 | 71 | rowKey="id" |
63 | 72 | :columns="columns" |
... | ... | @@ -65,8 +74,8 @@ |
65 | 74 | :pagination="ipagination" |
66 | 75 | :loading="loading" |
67 | 76 | class="j-table-force-nowrap" |
68 | - @change="handleTableChange"> | |
69 | - | |
77 | + @change="handleTableChange" | |
78 | + > | |
70 | 79 | <span slot="zoneCode" slot-scope="zoneCode"> |
71 | 80 | <a-tag :key="zoneCode" color="blue"> |
72 | 81 | {{ solutionZoneCode(zoneCode) }} |
... | ... | @@ -76,7 +85,7 @@ |
76 | 85 | <span slot="action" slot-scope="text, record"> |
77 | 86 | <a v-has="'address:edit'" @click="handleEdit(record)">编辑</a> |
78 | 87 | |
79 | - <a-divider type="vertical"/> | |
88 | + <a-divider type="vertical" /> | |
80 | 89 | <a-dropdown> |
81 | 90 | <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> |
82 | 91 | <a-menu slot="overlay"> |
... | ... | @@ -91,7 +100,6 @@ |
91 | 100 | </a-menu> |
92 | 101 | </a-dropdown> |
93 | 102 | </span> |
94 | - | |
95 | 103 | </a-table> |
96 | 104 | </div> |
97 | 105 | |
... | ... | @@ -116,6 +124,7 @@ export default { |
116 | 124 | return { |
117 | 125 | description: '接口地址管理页面', |
118 | 126 | zoneList: [], |
127 | + zoneOptions: [], | |
119 | 128 | // 表头 |
120 | 129 | columns: [ |
121 | 130 | { |
... | ... | @@ -196,6 +205,14 @@ export default { |
196 | 205 | getZoneList().then(res => { |
197 | 206 | if (res.success) { |
198 | 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 | }, |
... | ... |