refactor: project plugins module typescript support (#1217)
This commit is contained in:
parent
37f71dc3bd
commit
3739ce2d72
|
|
@ -16,19 +16,19 @@ const getDevAlias = (useSourceAlias) => {
|
|||
'@opentiny/tiny-engine-common/component': path.resolve(basePath, 'packages/common/component'),
|
||||
'@opentiny/tiny-engine-common/js': path.resolve(basePath, 'packages/common/js'),
|
||||
'@opentiny/tiny-engine-common': path.resolve(basePath, 'packages/common/index.ts'),
|
||||
'@opentiny/tiny-engine-plugin-materials': path.resolve(basePath, 'packages/plugins/materials/index.js'),
|
||||
'@opentiny/tiny-engine-plugin-block': path.resolve(basePath, 'packages/plugins/block/index.js'),
|
||||
'@opentiny/tiny-engine-plugin-state': path.resolve(basePath, 'packages/plugins/state/index.js'),
|
||||
'@opentiny/tiny-engine-plugin-datasource': path.resolve(basePath, 'packages/plugins/datasource/index.js'),
|
||||
'@opentiny/tiny-engine-plugin-script': path.resolve(basePath, 'packages/plugins/script/index.js'),
|
||||
'@opentiny/tiny-engine-plugin-tree': path.resolve(basePath, 'packages/plugins/tree/index.js'),
|
||||
'@opentiny/tiny-engine-plugin-materials': path.resolve(basePath, 'packages/plugins/materials/index.ts'),
|
||||
'@opentiny/tiny-engine-plugin-block': path.resolve(basePath, 'packages/plugins/block/index.ts'),
|
||||
'@opentiny/tiny-engine-plugin-state': path.resolve(basePath, 'packages/plugins/state/index.ts'),
|
||||
'@opentiny/tiny-engine-plugin-datasource': path.resolve(basePath, 'packages/plugins/datasource/index.ts'),
|
||||
'@opentiny/tiny-engine-plugin-script': path.resolve(basePath, 'packages/plugins/script/index.ts'),
|
||||
'@opentiny/tiny-engine-plugin-tree': path.resolve(basePath, 'packages/plugins/tree/index.ts'),
|
||||
'@opentiny/tiny-engine-plugin-help': path.resolve(basePath, 'packages/plugins/help/index.ts'),
|
||||
'@opentiny/tiny-engine-plugin-schema': path.resolve(basePath, 'packages/plugins/schema/index.js'),
|
||||
'@opentiny/tiny-engine-plugin-page': path.resolve(basePath, 'packages/plugins/page/index.js'),
|
||||
'@opentiny/tiny-engine-plugin-i18n': path.resolve(basePath, 'packages/plugins/i18n/index.js'),
|
||||
'@opentiny/tiny-engine-plugin-bridge': path.resolve(basePath, 'packages/plugins/bridge/index.js'),
|
||||
'@opentiny/tiny-engine-plugin-tutorial': path.resolve(basePath, 'packages/plugins/tutorial/index.js'),
|
||||
'@opentiny/tiny-engine-plugin-robot': path.resolve(basePath, 'packages/plugins/robot/index.js'),
|
||||
'@opentiny/tiny-engine-plugin-schema': path.resolve(basePath, 'packages/plugins/schema/index.ts'),
|
||||
'@opentiny/tiny-engine-plugin-page': path.resolve(basePath, 'packages/plugins/page/index.ts'),
|
||||
'@opentiny/tiny-engine-plugin-i18n': path.resolve(basePath, 'packages/plugins/i18n/index.ts'),
|
||||
'@opentiny/tiny-engine-plugin-bridge': path.resolve(basePath, 'packages/plugins/bridge/index.ts'),
|
||||
'@opentiny/tiny-engine-plugin-tutorial': path.resolve(basePath, 'packages/plugins/tutorial/index.ts'),
|
||||
'@opentiny/tiny-engine-plugin-robot': path.resolve(basePath, 'packages/plugins/robot/index.ts'),
|
||||
'@opentiny/tiny-engine-settings-panel': path.resolve(basePath, 'packages/settings/panel/index.ts'),
|
||||
'@opentiny/tiny-engine-setting-events': path.resolve(basePath, 'packages/settings/events/index.ts'),
|
||||
'@opentiny/tiny-engine-setting-props': path.resolve(basePath, 'packages/settings/props/index.ts'),
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@
|
|||
*/
|
||||
|
||||
import entry, { api } from './src/Main.vue'
|
||||
import metaData from './meta.js'
|
||||
import { BlockService } from './src/composable'
|
||||
import metaData from './meta'
|
||||
import { BlockService } from './src/composable/index'
|
||||
import SaveNewBlock from './src/SaveNewBlock.vue'
|
||||
import './src/styles/vars.less'
|
||||
|
||||
|
|
@ -107,7 +107,7 @@
|
|||
</tiny-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, ref, computed, nextTick, watchEffect } from 'vue'
|
||||
import { Input, Tag, Button, Form, FormItem, Radio, Select, Option } from '@opentiny/vue'
|
||||
import { constants } from '@opentiny/tiny-engine-utils'
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
</block-guide>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { computed, reactive } from 'vue'
|
||||
import { Row as TinyRow, Col as TinyCol, Alert as TinyAlert } from '@opentiny/vue'
|
||||
import BlockGuide from './BlockGuide.vue'
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
</tiny-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { computed, reactive, watch } from 'vue'
|
||||
import { Input as TinyInput, Form as TinyForm, FormItem as TinyFormItem } from '@opentiny/vue'
|
||||
import { REGEXP_EVENT_NAME, verifyEventName } from '@opentiny/tiny-engine-common/js/verification'
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
</meta-list-items>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { Button as TinyButton } from '@opentiny/vue'
|
||||
import { MetaListItems, SvgButton } from '@opentiny/tiny-engine-common'
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive } from 'vue'
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
</video-guide>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { VideoGuide } from '@opentiny/tiny-engine-common'
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
</block-guide>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import BlockGuide from './BlockGuide.vue'
|
||||
import BlockPropertyList from './BlockPropertyList.vue'
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import {
|
||||
Input as TinyInput,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
</meta-list-items>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { Button as TinyButton } from '@opentiny/vue'
|
||||
import { remove } from '@opentiny/vue-renderless/common/array'
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@
|
|||
></block-deploy-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="jsx">
|
||||
<script lang="tsx">
|
||||
import { reactive, ref, watch, watchEffect, computed } from 'vue'
|
||||
import { Button as TinyButton, Collapse as TinyCollapse, CollapseItem as TinyCollapseItem } from '@opentiny/vue'
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
</tiny-dialog-box>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script lang="ts" setup>
|
||||
import { defineProps, defineEmits, ref, reactive, computed, watch } from 'vue'
|
||||
import { pinyin } from 'pinyin-pro'
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@
|
|||
<save-new-block :boxVisibility="boxVisibility" @close="close"></save-new-block>
|
||||
</template>
|
||||
|
||||
<script lang="jsx">
|
||||
<script lang="tsx">
|
||||
import { ref, reactive, computed, watch, provide } from 'vue'
|
||||
import {
|
||||
Search as TinySearch,
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, computed, ref } from 'vue'
|
||||
import { Input, Form, FormItem, Button, DialogBox, Select } from '@opentiny/vue'
|
||||
import { useBlock, useLayout, useCanvas, useModal } from '@opentiny/tiny-engine-meta-register'
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ const setSelectedGroup = (selected) => {
|
|||
|
||||
const copyCss = (css, classNameList) => {
|
||||
classNameList = Array.from(new Set(classNameList)).map((item) => '.' + item)
|
||||
let cssObject = getCssObjectFromStyleStr(css)
|
||||
const cssObject = getCssObjectFromStyleStr(css)
|
||||
let styleStr = ''
|
||||
|
||||
Object.entries(cssObject).forEach(([key, value]) => {
|
||||
|
|
@ -144,9 +144,9 @@ const copyCss = (css, classNameList) => {
|
|||
const copySchema = (schema, contentList, methods) => {
|
||||
const content = schema?.properties?.[0]?.content || []
|
||||
let emitList = []
|
||||
let emitListCopies = {}
|
||||
const emitListCopies = {}
|
||||
Object.keys(methods).forEach((key) => {
|
||||
let item = JSON.stringify(methods[key].value).match(/emit..*?\)/g)
|
||||
const item = JSON.stringify(methods[key].value).match(/emit..*?\)/g)
|
||||
|
||||
if (item?.length) {
|
||||
emitList = [...emitList, ...item]
|
||||
|
|
@ -195,7 +195,7 @@ const copyMethods = (schema) => {
|
|||
}
|
||||
|
||||
const copyState = (stateObj = {}, methodsObj = {}) => {
|
||||
let stateCopies = {}
|
||||
const stateCopies = {}
|
||||
const stateKey = Object.keys(stateObj).map((e) => `state.${e} `)
|
||||
|
||||
stateKey.forEach((e) => {
|
||||
|
|
@ -632,7 +632,7 @@ const getDateFromNow = (timeStamp) => {
|
|||
['更久以前', () => '']
|
||||
])
|
||||
|
||||
for (let [key, value] of dateMap) {
|
||||
for (const [key, value] of dateMap) {
|
||||
if (timeStamp >= value()) {
|
||||
return key
|
||||
}
|
||||
|
|
@ -23,9 +23,9 @@ export default defineConfig({
|
|||
resolve: {},
|
||||
build: {
|
||||
lib: {
|
||||
entry: path.resolve(__dirname, './index.js'),
|
||||
entry: path.resolve(__dirname, './index.ts'),
|
||||
name: 'plugin-block',
|
||||
fileName: () => 'index.js',
|
||||
fileName: (_format, entryName) => `${entryName}.js`,
|
||||
formats: ['es']
|
||||
},
|
||||
rollupOptions: {
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
*/
|
||||
|
||||
import entry from './src/Main.vue'
|
||||
import metaData from './meta.js'
|
||||
import metaData from './meta'
|
||||
import './src/styles/vars.less'
|
||||
|
||||
export default {
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { watchEffect, ref, reactive } from 'vue'
|
||||
import { Search } from '@opentiny/vue'
|
||||
import { iconSearch } from '@opentiny/vue-icon'
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@
|
|||
</plugin-setting>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { computed, onMounted, reactive, ref, watchEffect, nextTick, watch } from 'vue'
|
||||
import {
|
||||
Input as TinyInput,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
</plugin-panel>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { ref, reactive, computed, provide } from 'vue'
|
||||
import { PluginPanel, SvgButton } from '@opentiny/tiny-engine-common'
|
||||
import { useLayout } from '@opentiny/tiny-engine-meta-register'
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ export default defineConfig({
|
|||
resolve: {},
|
||||
build: {
|
||||
lib: {
|
||||
entry: path.resolve(__dirname, './index.js'),
|
||||
entry: path.resolve(__dirname, './index.ts'),
|
||||
name: 'plugin-bridge',
|
||||
fileName: () => 'index.js',
|
||||
fileName: (_format, entryName) => `${entryName}.js`,
|
||||
formats: ['es']
|
||||
},
|
||||
rollupOptions: {
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
import { fetchDataSourceList, fetchDataSourceDetail } from './src/js/http'
|
||||
import entry from './src/Main.vue'
|
||||
import metaData from './meta.js'
|
||||
import metaData from './meta'
|
||||
import { DataSourceService } from './src/composable'
|
||||
import './src/styles/vars.less'
|
||||
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, ref, watchEffect, nextTick } from 'vue'
|
||||
import { Button } from '@opentiny/vue'
|
||||
import DataSourceFieldList from './DataSourceFieldList.vue'
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
</tiny-form-item>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { computed, inject } from 'vue'
|
||||
import DataSourceFieldCheckMultipleLine from './DataSourceFieldCheckMultipleLine.vue'
|
||||
import DataSourceFieldCheckRanger from './DataSourceFieldCheckRanger.vue'
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
</tiny-form-item>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { inject } from 'vue'
|
||||
import { Radio, FormItem } from '@opentiny/vue'
|
||||
import { formDataInjectionSymbols } from './DataSourceFieldForm.vue'
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { inject } from 'vue'
|
||||
import { Numeric, FormItem } from '@opentiny/vue'
|
||||
import { formDataInjectionSymbols } from './DataSourceFieldForm.vue'
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, watchEffect, ref, provide, computed } from 'vue'
|
||||
import { Button, Input, FormItem, Form } from '@opentiny/vue'
|
||||
import { ButtonGroup, I18nInput } from '@opentiny/tiny-engine-common'
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
</data-source-field-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, watchEffect } from 'vue'
|
||||
import fieldTypes from './config'
|
||||
import DataSourceFieldForm from './DataSourceFieldForm.vue'
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, ref } from 'vue'
|
||||
import { iconArrowDown } from '@opentiny/vue-icon'
|
||||
import fieldTypes from './config'
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
</plugin-setting>
|
||||
</template>
|
||||
|
||||
<script lang="jsx">
|
||||
<script lang="tsx">
|
||||
import { reactive, ref, watch, computed } from 'vue'
|
||||
import { Form, Button } from '@opentiny/vue'
|
||||
import { ButtonGroup, PluginSetting, SvgButton } from '@opentiny/tiny-engine-common'
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
</plugin-setting>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import DataHandlerEditor from './RemoteDataAdapterForm.vue'
|
||||
import { watch, ref, nextTick, reactive, computed } from 'vue'
|
||||
import { requestGlobalDataHandler } from './js/http'
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
></data-source-record-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import { useDataSource, useResource, getMetaApi, META_SERVICE } from '@opentiny/tiny-engine-meta-register'
|
||||
import { close as closeRemotePanel } from './DataSourceRemotePanel.vue'
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, watchEffect, ref } from 'vue'
|
||||
import { Form, FormItem, Input } from '@opentiny/vue'
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
</plugin-setting>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { computed, reactive, ref, watch } from 'vue'
|
||||
import { Button, Input, Numeric, DatePicker, Form, FormItem, Switch, Slider } from '@opentiny/vue'
|
||||
import { PluginSetting } from '@opentiny/tiny-engine-common'
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@
|
|||
></data-source-record-upload>
|
||||
</template>
|
||||
|
||||
<script lang="jsx">
|
||||
<script lang="tsx">
|
||||
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'
|
||||
|
|
@ -158,6 +158,7 @@ export default {
|
|||
message: '复制失败,请尝试手动复制',
|
||||
type: 'error'
|
||||
})
|
||||
throw new Error(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
</tiny-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, watch } from 'vue'
|
||||
import { Button, Modal, FileUpload } from '@opentiny/vue'
|
||||
import { getDataFromFile } from './js/datasource'
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive } from 'vue'
|
||||
import { Checkbox } from '@opentiny/vue'
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, ref, watch } from 'vue'
|
||||
import { Popover } from '@opentiny/vue'
|
||||
import { iconHelpCircle } from '@opentiny/vue-icon'
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, watchEffect, ref } from 'vue'
|
||||
import { VueMonaco as MonacoEditor } from '@opentiny/tiny-engine-common'
|
||||
import { Button as TinyButton } from '@opentiny/vue'
|
||||
|
|
@ -62,6 +62,7 @@ export default {
|
|||
try {
|
||||
await toClipboard(state.value)
|
||||
} catch (e) {
|
||||
throw new Error(e)
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
</tiny-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, watchEffect, ref } from 'vue'
|
||||
import { Form, FormItem, Input, Select } from '@opentiny/vue'
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, watchEffect, ref } from 'vue'
|
||||
import { Input, Select, Checkbox } from '@opentiny/vue'
|
||||
import { PluginSetting } from '@opentiny/tiny-engine-common'
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, watch, ref, computed } from 'vue'
|
||||
import { Collapse, CollapseItem, Tabs, TabItem, Button } from '@opentiny/vue'
|
||||
import { PluginSetting } from '@opentiny/tiny-engine-common'
|
||||
|
|
@ -183,7 +183,7 @@ export default {
|
|||
// await validate() 如果验证不通过会抛出异常,而不是返回 false
|
||||
await getServiceForm().validate()
|
||||
} catch (error) {
|
||||
return
|
||||
throw new Error(`请先完成表单验证: ${error?.message || ''}`)
|
||||
}
|
||||
|
||||
const options = { ...state.remoteData.options }
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<monaco-editor :value="modelValue" class="monaco-editor" :options="options" @change="change" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { VueMonaco } from '@opentiny/tiny-engine-common'
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, onMounted } from 'vue'
|
||||
import { Button } from '@opentiny/vue'
|
||||
import { getMergeMeta } from '@opentiny/tiny-engine-meta-register'
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { watch, ref } from 'vue'
|
||||
import { Form, FormItem, RadioGroup, Radio } from '@opentiny/vue'
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
<data-source-global-data-handler></data-source-global-data-handler>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, watch, provide } from 'vue'
|
||||
import { Button } from '@opentiny/vue'
|
||||
import DataSourceList, { refresh as refreshDataSourceList, clearActive } from './DataSourceList.vue'
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<monaco-editor ref="editor" :value="modelValue" class="monaco-editor" :options="options" @change="change" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { VueMonaco } from '@opentiny/tiny-engine-common'
|
||||
|
||||
|
|
|
|||
|
|
@ -48,8 +48,7 @@ const compareData = () => {
|
|||
const handleConfirmSave = (dataSourceState, isRecordSame, resolve, isDataSourceSame, callback) => {
|
||||
let {
|
||||
name,
|
||||
id,
|
||||
data: { data, columns, type }
|
||||
data: { data, columns }
|
||||
} = dataSourceState.dataSource
|
||||
|
||||
if (!isRecordSame) {
|
||||
|
|
@ -79,6 +78,11 @@ const handleConfirmSave = (dataSourceState, isRecordSame, resolve, isDataSourceS
|
|||
name = dataSourceState.dataSourceColumn?.name
|
||||
}
|
||||
|
||||
const {
|
||||
id,
|
||||
data: { type }
|
||||
} = dataSourceState.dataSource
|
||||
|
||||
const requestData = { name, data: { columns, data, type } }
|
||||
|
||||
callback(id, requestData).then((data) => {
|
||||
|
|
@ -23,9 +23,9 @@ export default defineConfig({
|
|||
resolve: {},
|
||||
build: {
|
||||
lib: {
|
||||
entry: path.resolve(__dirname, './index.js'),
|
||||
entry: path.resolve(__dirname, './index.ts'),
|
||||
name: 'plugin-datasource',
|
||||
fileName: () => 'index.js',
|
||||
fileName: (_format, entryName) => `${entryName}.js`,
|
||||
formats: ['es']
|
||||
},
|
||||
rollupOptions: {
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@
|
|||
*
|
||||
*/
|
||||
import entry from './src/Main.vue'
|
||||
import metaData from './meta.js'
|
||||
import { TranslateService } from './src/composable'
|
||||
import metaData from './meta'
|
||||
import { TranslateService } from './src/composable/index.js'
|
||||
import './src/styles/vars.less'
|
||||
|
||||
export default {
|
||||
|
|
@ -119,7 +119,7 @@
|
|||
</plugin-panel>
|
||||
</template>
|
||||
|
||||
<script lang="jsx">
|
||||
<script lang="tsx">
|
||||
import { computed, ref, watchEffect, reactive, onMounted, nextTick, resolveComponent, watch, provide } from 'vue'
|
||||
import useClipboard from 'vue-clipboard3'
|
||||
import { Grid, GridColumn, Input, Popover, Button, FileUpload, Loading, Tooltip, Select } from '@opentiny/vue'
|
||||
|
|
@ -350,6 +350,8 @@ export default {
|
|||
copyTipContent.value = '复制成功'
|
||||
} catch (e) {
|
||||
copyTipContent.value = '复制失败'
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Clipboard operation failed:', e)
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
copyRowIndex.value = ''
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ const ensureI18n = (obj, send) => {
|
|||
|
||||
useCanvas().canvasApi.value?.setLocales(messages, true)
|
||||
} catch (e) {
|
||||
throw new Error(e)
|
||||
// 不需要处理,有报错的词条会在画布初始化的时候统一调setLocales这个方法
|
||||
}
|
||||
|
||||
|
|
@ -23,9 +23,9 @@ export default defineConfig({
|
|||
resolve: {},
|
||||
build: {
|
||||
lib: {
|
||||
entry: path.resolve(__dirname, './index.js'),
|
||||
entry: path.resolve(__dirname, './index.ts'),
|
||||
name: 'plugin-i18n',
|
||||
fileName: () => 'index.js',
|
||||
fileName: (_format, entryName) => `${entryName}.js`,
|
||||
formats: ['es']
|
||||
},
|
||||
rollupOptions: {
|
||||
|
|
@ -11,11 +11,11 @@
|
|||
*/
|
||||
|
||||
import entry from './src/Main.vue'
|
||||
import metaData from './meta.js'
|
||||
import { ResourceService, MaterialService } from './src/composable'
|
||||
import MaterialLayout from './src/meta/layout'
|
||||
import MaterialBlock from './src/meta/block'
|
||||
import MaterialComponent from './src/meta/component'
|
||||
import metaData from './meta'
|
||||
import { ResourceService, MaterialService } from './src/composable/index'
|
||||
import MaterialLayout from './src/meta/layout/index'
|
||||
import MaterialBlock from './src/meta/block/index'
|
||||
import MaterialComponent from './src/meta/component/index'
|
||||
import MaterialHeader from './src/components/header/Main.vue'
|
||||
import { basePropertyOptions } from './src/js/options'
|
||||
import './src/styles/vars.less'
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
<component :is="layout.entry" :registryData="registryData" class="plugin-materials"></component>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { getMergeRegistry } from '@opentiny/tiny-engine-meta-register'
|
||||
import meta from '../meta'
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
></svg-button>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { SvgButton } from '@opentiny/tiny-engine-common'
|
||||
import { useLayout } from '@opentiny/tiny-engine-meta-register'
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="jsx">
|
||||
<script lang="tsx">
|
||||
import { Button } from '@opentiny/vue'
|
||||
import { IconDel, iconDoubleRight } from '@opentiny/vue-icon'
|
||||
import { inject } from 'vue'
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@
|
|||
</tiny-dialog-box>
|
||||
</template>
|
||||
|
||||
<script lang="jsx">
|
||||
<script lang="tsx">
|
||||
import { inject, reactive, ref, nextTick } from 'vue'
|
||||
import {
|
||||
Input,
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, inject } from 'vue'
|
||||
import { Tabs, TabItem } from '@opentiny/vue'
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { computed, reactive } from 'vue'
|
||||
import { CheckboxGroup, Checkbox, Select, Option } from '@opentiny/vue'
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
</template>
|
||||
</plugin-setting>
|
||||
</template>
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, watch, provide, inject, ref, computed } from 'vue'
|
||||
import { Search } from '@opentiny/vue'
|
||||
import { iconSearch } from '@opentiny/vue-icon'
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive } from 'vue'
|
||||
import { Popover } from '@opentiny/vue'
|
||||
import { iconDeltaDown } from '@opentiny/vue-icon'
|
||||
|
|
|
|||
|
|
@ -32,14 +32,14 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { computed, onMounted, provide, reactive, watch } from 'vue'
|
||||
import { useBlock, useModal } from '@opentiny/tiny-engine-meta-register'
|
||||
import { SelectAll } from '@opentiny/tiny-engine-common'
|
||||
import BlockList from './BlockList.vue'
|
||||
import BlockGroupArrange from './BlockGroupArrange.vue'
|
||||
import { Select, Option } from '@opentiny/vue'
|
||||
import { fetchBlockById } from './http.js'
|
||||
import { fetchBlockById } from './http'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import BlockList from './BlockList.vue'
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
></plugin-block-list>
|
||||
</template>
|
||||
|
||||
<script lang="jsx">
|
||||
<script lang="tsx">
|
||||
import { computed, inject, reactive, ref } from 'vue'
|
||||
import {
|
||||
useBlock,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
</teleport>
|
||||
</template>
|
||||
|
||||
<script lang="jsx">
|
||||
<script lang="tsx">
|
||||
import { onMounted, reactive, watch, provide, computed } from 'vue'
|
||||
import { Search } from '@opentiny/vue'
|
||||
import { iconSearch } from '@opentiny/vue-icon'
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
</plugin-setting>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, watch, ref } from 'vue'
|
||||
import { Grid, GridColumn, Button } from '@opentiny/vue'
|
||||
import { format } from '@opentiny/vue-renderless/common/date'
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<block-panel v-if="existBlockModule" v-bind="$attrs"></block-panel>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { getMergeMeta } from '@opentiny/tiny-engine-meta-register'
|
||||
import BlockPanel from './BlockPanel.vue'
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import { getMergeMeta } from '@opentiny/tiny-engine-meta-register'
|
|||
|
||||
const getParams = (obj) => {
|
||||
let result = ''
|
||||
for (let item in obj) {
|
||||
for (const item in obj) {
|
||||
if (obj[item] instanceof Array) {
|
||||
obj[item].forEach((i) => {
|
||||
result += `&${item}=${i}`
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { inject, onMounted, reactive, ref } from 'vue'
|
||||
import { Collapse, CollapseItem, Search } from '@opentiny/vue'
|
||||
import { SearchEmpty, CanvasDragItem } from '@opentiny/tiny-engine-common'
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
</plugin-panel>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { reactive, provide, ref, computed } from 'vue'
|
||||
import { Tabs, TabItem } from '@opentiny/vue'
|
||||
import { META_APP as PLUGIN_NAME, getMergeMeta } from '@opentiny/tiny-engine-meta-register'
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ export default defineConfig({
|
|||
publicDir: false,
|
||||
build: {
|
||||
lib: {
|
||||
entry: path.resolve(__dirname, './index.js'),
|
||||
entry: path.resolve(__dirname, './index.ts'),
|
||||
name: 'plugin-materials',
|
||||
fileName: () => 'index.js',
|
||||
fileName: (_format, entryName) => `${entryName}.js`,
|
||||
formats: ['es']
|
||||
},
|
||||
rollupOptions: {
|
||||
|
|
@ -11,8 +11,8 @@
|
|||
*/
|
||||
|
||||
import entry, { api } from './src/Main.vue'
|
||||
import metaData from './meta.js'
|
||||
import { PageService } from './src/composable'
|
||||
import metaData from './meta'
|
||||
import { PageService } from './src/composable/index'
|
||||
import PageGeneral from './src/PageGeneral.vue'
|
||||
import './src/styles/vars.less'
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue