Skip to content

Commit

Permalink
fix: fix review
Browse files Browse the repository at this point in the history
  • Loading branch information
lichunn committed Sep 23, 2024
1 parent 08cfd55 commit 548e71e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 146 deletions.
48 changes: 4 additions & 44 deletions packages/plugins/bridge/src/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
<script>
import { ref, computed } from 'vue'
import { PluginPanel, SvgButton } from '@opentiny/tiny-engine-common'
import { useHelp } from '@opentiny/tiny-engine-meta-register'
import { isVsCodeEnv } from '@opentiny/tiny-engine-common/js/environments'
import { RESOURCE_TYPE } from './js/resource'
import BridgeManage from './BridgeManage.vue'
import BridgeSetting, { openPanel, closePanel } from './BridgeSetting.vue'
import { setType, RESOURCE_TIP } from './js/resource'
import { RESOURCE_TIP } from './js/resource'
export default {
components: {
Expand All @@ -29,74 +27,36 @@ export default {
},
setup() {
const activedName = ref(RESOURCE_TYPE.Util)
const bridge = ref(null)
const utilsRef = ref(null)
const tips = computed(() => RESOURCE_TIP[activedName.value])
const docsUrl = useHelp().getDocsUrl('bridge')
const switchTab = (tab) => {
closePanel()
setType(tab.name)
}
const openUtilPanel = () => {
closePanel()
}
const openBridgePanel = () => {
openPanel()
}
const refreshList = (type) => {
type === RESOURCE_TYPE.Util ? utilsRef.value.refresh(type) : bridge.value.refresh(type)
type == utilsRef.value.refresh(type)
}
const addResource = (type) => {
activedName.value === RESOURCE_TYPE.Util ? utilsRef.value.add(type) : bridge.value.add(type)
activedName.value == utilsRef.value.add(type)
}
return {
addResource,
RESOURCE_TYPE,
activedName,
switchTab,
openBridgePanel,
closePanel,
openUtilPanel,
refreshList,
bridge,
docsUrl,
utilsRef,
tips,
isVsCodeEnv
tips
}
}
}
</script>

<style lang="less" scoped>
.tabs {
height: calc(100% - 46px);
}
:deep(.tiny-tabs__header) {
padding: 8px;
border-bottom: 1px solid var(--ti-lowcode-tabs-border-color);
}
:deep(.tiny-tabs__content) {
height: calc(100% - 45px);
padding: 0;
margin: 0;
& > div {
height: 100%;
}
}
:deep(.help-box) {
position: absolute;
left: 72px;
top: 12px;
}
:deep(.tiny-button) {
border-radius: 4px;
height: 24px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@

<script>
import { inject } from 'vue'
import { Numeric, FormItem, Row as TinyRow, Col as TinyCol } from '@opentiny/vue'
import { Numeric, FormItem, Row, Col } from '@opentiny/vue'
import { formDataInjectionSymbols } from './DataSourceFieldForm.vue'
export default {
components: {
TinyNumeric: Numeric,
TinyFormItem: FormItem,
TinyRow,
TinyCol
TinyRow: Row,
TinyCol: Col
},
props: {
type: {
Expand Down
14 changes: 6 additions & 8 deletions packages/plugins/datasource/src/DataSourceFieldForm.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div v-if="state.isOpen" class="step-select-second" :id="setId()">
<div v-if="state.isOpen" class="step-select-second" :id="defaultStyle">
<div class="field-row">
<slot>
<div class="icon-and-text">
Expand Down Expand Up @@ -34,7 +34,7 @@
</template>

<script>
import { reactive, watchEffect, ref, provide } from 'vue'
import { reactive, watchEffect, ref, provide, computed } from 'vue'
import { Button, Input, FormItem, Form } from '@opentiny/vue'
import { ButtonGroup, I18nInput } from '@opentiny/tiny-engine-common'
import DataSourceFieldCheck from './DataSourceFieldCheck.vue'
Expand Down Expand Up @@ -92,18 +92,16 @@ export default {
state.isOpen = props.isOpen === undefined ? true : props.isOpen
})
const defaultStyle = computed(() => (props.isRow && !props.editable ? 'default-item' : ''))
const open = () => {
state.isOpen = true
}
const close = () => {
state.isOpen = false
}
const setId = () => {
if (props.isRow && !props.editable) {
return 'default-item'
}
}
const handleCancel = () => {
emit('cancel')
}
Expand Down Expand Up @@ -140,7 +138,7 @@ export default {
saveField,
open,
close,
setId,
defaultStyle,
form,
rules: {
title: [{ required: true, message: '必填', trigger: 'change' }, { validator: validateIsReserveValue }],
Expand Down
20 changes: 1 addition & 19 deletions packages/plugins/datasource/src/DataSourceRecordList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
import { reactive, ref, watchEffect, watch, computed } from 'vue'
import { camelize, capitalize } from '@vue/shared'
import { Grid, Pager, Input, Numeric, DatePicker, Switch, Slider, Link, Button } from '@opentiny/vue'
import { IconPlusCircle, IconImport, iconPlus, iconUpload } from '@opentiny/vue-icon'
import { iconPlus, iconUpload } from '@opentiny/vue-icon'
import { PluginSetting } from '@opentiny/tiny-engine-common'
import { utils } from '@opentiny/tiny-engine-utils'
import { useModal, useLayout, useNotify, useCanvas } from '@opentiny/tiny-engine-meta-register'
Expand Down Expand Up @@ -569,8 +569,6 @@ export default {
saveRecordFormData,
getGridData,
saveRecordList,
IconPlusCircle: IconPlusCircle(),
IconImport: IconImport(),
download,
showImportModal,
batchDelete,
Expand Down Expand Up @@ -627,22 +625,6 @@ export default {
font-size: 16px;
}
}
.addButton {
margin: 0 12px;
font-size: 14px;
.icon-plusCircle {
margin: 0 1px 4px 0;
font-size: 16px;
}
}
.importButton {
margin: 0 12px;
font-size: 14px;
.icon-import {
margin: 0 1px 4px 0;
font-size: 16px;
}
}
}
.empty-container {
Expand Down
72 changes: 0 additions & 72 deletions packages/plugins/i18n/src/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -438,78 +438,6 @@ export default {
}
.stripe-tiny-grid {
word-wrap: break-word;
// :deep(.tiny-grid) {
// .tiny-grid__header-wrapper {
// .tiny-grid-header__column {
// height: 32px;
// }
// .tiny-grid-cell {
// padding: 0;
// .tiny-grid-required-icon {
// display: none;
// }
// }
// .tiny-grid__repair {
// border-color: var(--ti-lowcode-tabs-border-color);
// }
// .tiny-grid-resizable.is__line:before {
// background-color: var(--ti-lowcode-toolbar-border-color);
// }
// }
// .tiny-grid__body-wrapper {
// &::-webkit-scrollbar {
// height: 10px;
// }
// .tiny-grid-body__column {
// height: 36px;
// .tiny-grid-cell {
// padding: 8px 0;
// }
// .i18n-opera svg {
// color: var(--ti-lowcode-i18n-operate-svg-color);
// }
// .copy-data {
// svg {
// margin-left: 5px;
// }
// }
// }
// .tiny-grid-body__row,
// .tiny-grid-body__row:not(.row__hover):nth-child(2n) {
// background-image: linear-gradient(
// -180deg,
// var(--ti-lowcode-tabs-border-color),
// var(--ti-lowcode-tabs-border-color)
// );
// background-repeat: no-repeat;
// background-size: 100% 1px;
// background-position: 100% 100%;
// &.row__current {
// background-color: var(--ti-lowcode-toolbar-view-hover-bg);
// }
// }
// .tiny-grid-body__row {
// &.row__selected {
// .tiny-grid-checkbox__icon {
// svg {
// color: var(--ti-lowcode-common-primary-color);
// width: 100%;
// height: 100%;
// }
// }
// }
// }
// }
// .tiny-grid__empty-text {
// color: var(--ti-lowcode-toolbar-breadcrumb-color);
// }
// }
#empty-loading-box {
width: 100%;
color: red;
Expand Down

0 comments on commit 548e71e

Please sign in to comment.