Skip to content

Commit

Permalink
feature: 全局变量支持批量编辑 TencentBlueKing#43
Browse files Browse the repository at this point in the history
  • Loading branch information
hailinxiao committed Jul 8, 2021
1 parent ad9d0bf commit 90f158d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/frontend/src/components/jb-sideslider/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@
const queryRange = [
1366, 1680, 1920, 2560,
];
const { clientWidth } = document.documentElement;
const windowHeight = window.innerWidth;
while (index < 3) {
const current = queryRange[index];
if (current < clientWidth) index += 1;
if (current < windowHeight) index += 1;
else break;
}
if (index > this.media.length - 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</template>
</table>
<div
v-if="variableList.length < 1"
v-if="isEmpty"
class="empty-box"
@click="handleAppendVariable(0)">
<Icon type="add-fill" />
Expand Down Expand Up @@ -74,6 +74,17 @@
variableList: _.cloneDeep(this.variable),
};
},
computed: {
isEmpty () {
// eslint-disable-next-line no-plusplus
for (let i = 0; i < this.variableList.length; i++) {
if (!this.variableList[i].delete) {
return false;
}
}
return true;
},
},
methods: {
/**
* @desc 不包含当前索引变量的变量列表
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
<jb-sideslider
v-if="isOperation"
:is-show.sync="isShowBatchOperation"
v-bind="operationSideSliderInfo"
:title="$t('template.编辑全局变量')"
:media="batchOperationMediaQuery">
<batch-operation
v-if="isShowBatchOperation"
Expand Down

0 comments on commit 90f158d

Please sign in to comment.