Commit 67ea443e8239b2e4b025738b18466c084b0749e7

Authored by 谭毅彬
1 parent 250d9de5

样式修改

Signed-off-by: TanYibin <5491541@qq.com>
ant-design-vue-jeecg/src/views/system/monitor/locationStatus.vue
... ... @@ -40,13 +40,11 @@
40 40 </a-select>
41 41 </li>
42 42 <li>
43   - <a-button type="primary" @click="search()" icon="search">查询</a-button>
44   - </li>
45   - <li>
46   - <a-button @click='expressDelivery()' v-if="expressDeliveryVisible" type='primary'>快速出库</a-button>
47   - </li>
48   - <li>
49   - <a-button @click="expressStorage()" type="primary" v-if="expressStorageVisible">快速入库</a-button>
  43 + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  44 + <a-button type="primary" @click="search()" icon="search" style="margin-left: 8px;">查询</a-button>
  45 + <a-button @click='expressDelivery()' v-if="expressDeliveryVisible" type='primary' style="margin-left: 8px;">快速出库</a-button>
  46 + <a-button @click="expressStorage()" type="primary" v-if="expressStorageVisible" style="margin-left: 8px;">快速入库</a-button>
  47 + </span>
50 48 </li>
51 49 </ul>
52 50 </div>
... ... @@ -83,7 +81,7 @@
83 81 </div>
84 82 <div class="col-sm-12 select-info">
85 83 <div id="borderCol" style="overflow-y: auto;white-space:nowrap" v-show="showPrise">
86   - <div class="location" id="location"/>
  84 + <div class="location" id="location"></div>
87 85 </div>
88 86 <a-spin tip="库位视图生成中..." :spinning="spinning">
89 87 <a-skeleton active :loading="loading" :paragraph="{ rows: 5 }"/>
... ... @@ -164,18 +162,19 @@ export default {
164 162 window.lays = this.lays
165 163 },
166 164 mounted() {
167   - // 监听浏览器宽度的改变
168   - const resizeObserver = new ResizeObserver(entries => {
169   - for (let entry of entries) {
170   - this.changeMargin();
171   - }
172   - });
173   - resizeObserver.observe(document.querySelector('.location'));
174   -
175   - let that = this;
176   - setTimeout(function () {
177   - that.refresh();
178   - }, 1000);
  165 + // 方法一:确保 .location 元素存在且已渲染
  166 + const locationElement = document.querySelector('.location');
  167 + if (locationElement) {
  168 + const resizeObserver = new ResizeObserver(entries => {
  169 + for (let entry of entries) {
  170 + this.changeMargin();
  171 + }
  172 + });
  173 + resizeObserver.observe(locationElement);
  174 + setTimeout(() => {
  175 + this.refresh(); // 使用箭头函数,this 指向 Vue 组件实例
  176 + }, 1000);
  177 + }
179 178 },
180 179 methods: {
181 180 loadData() {
... ...