create-bubbles 0.1.3 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/package.json +2 -2
  2. package/template-react-rsbuild-biome/biome.json +26 -4
  3. package/template-react-rsbuild-biome/package.json +24 -24
  4. package/template-react-rsbuild-biome/src/App.tsx +1 -0
  5. package/template-react-rsbuild-biome/src/pages/home/index.tsx +1 -1
  6. package/template-react-rsbuild-biome/src/types/auto-import.d.ts +40 -30
  7. package/template-react-rsbuild-biome/src/utils/request/core/index.ts +1 -1
  8. package/template-react-rsbuild-biome/uno.config.ts +2 -2
  9. package/template-vue-rsbuild-biome/biome.json +33 -5
  10. package/template-vue-vite-biome/biome.json +7 -2
  11. package/template-vue-vite-eslint/.env +4 -2
  12. package/template-vue-vite-eslint/.env.development +2 -1
  13. package/template-vue-vite-eslint/.vscode/settings.json +8 -0
  14. package/template-vue-vite-eslint/eslint.config.js +7 -2
  15. package/template-vue-vite-eslint/package.json +32 -26
  16. package/template-vue-vite-eslint/src/api/index.ts +12 -0
  17. package/template-vue-vite-eslint/src/assets/icon/computer-data.svg +3 -0
  18. package/template-vue-vite-eslint/src/assets/icon/cpu.svg +3 -0
  19. package/template-vue-vite-eslint/src/assets/icon/data-search.svg +3 -0
  20. package/template-vue-vite-eslint/src/assets/icon/home.svg +3 -0
  21. package/template-vue-vite-eslint/src/assets/icon/knowledge-graph.svg +3 -0
  22. package/template-vue-vite-eslint/src/assets/icon/robot.svg +3 -0
  23. package/template-vue-vite-eslint/src/assets/image/.gitkeep +0 -0
  24. package/template-vue-vite-eslint/src/components/Icon/svg-icon.vue +2 -2
  25. package/template-vue-vite-eslint/src/hooks/chart/lib.ts +57 -0
  26. package/template-vue-vite-eslint/src/hooks/chart/useEcharts.ts +65 -0
  27. package/template-vue-vite-eslint/src/layout/default/header/index.vue +12 -0
  28. package/template-vue-vite-eslint/src/layout/default/index.vue +53 -1
  29. package/template-vue-vite-eslint/src/main.ts +1 -0
  30. package/template-vue-vite-eslint/src/router/interface.ts +9 -0
  31. package/template-vue-vite-eslint/src/router/modules/example.ts +21 -0
  32. package/template-vue-vite-eslint/src/router/modules/index.ts +14 -9
  33. package/template-vue-vite-eslint/src/styles/element-plus-variables.css +1 -2
  34. package/template-vue-vite-eslint/src/styles/index.scss +2 -0
  35. package/template-vue-vite-eslint/src/styles/plus-pro-components-variables.css +3 -0
  36. package/template-vue-vite-eslint/src/types/auto-import.d.ts +78 -0
  37. package/template-vue-vite-eslint/src/types/components.d.ts +22 -0
  38. package/template-vue-vite-eslint/src/types/index.d.ts +1 -0
  39. package/template-vue-vite-eslint/src/utils/env.ts +5 -4
  40. package/template-vue-vite-eslint/src/utils/request/core/index.ts +19 -5
  41. package/template-vue-vite-eslint/src/utils/request/index.ts +4 -1
  42. package/template-vue-vite-eslint/src/views/example/echart/config.ts +1794 -0
  43. package/template-vue-vite-eslint/src/views/example/echart/index.vue +22 -0
  44. package/template-vue-vite-eslint/src/views/example/h-full.vue +24 -0
  45. package/template-vue-vite-eslint/src/views/example/tree-chart.vue +94 -0
  46. package/template-vue-vite-eslint/src/views/home/index.vue +3 -2
  47. package/template-vue-vite-eslint/tsconfig.json +1 -1
  48. package/template-vue-vite-eslint/uno.config.ts +6 -2
  49. package/template-vue-vite-eslint/vite.config.ts +13 -4
  50. package/template-vue-vite-eslint/.gitlab-ci.yml +0 -84
  51. package/template-vue-vite-eslint/src/views/model/index.vue +0 -7
  52. /package/dist/{index.js → index.mjs} +0 -0
  53. /package/template-vue-vite-eslint/src/assets/icon/{vue.svg → logo.svg} +0 -0
@@ -0,0 +1,22 @@
1
+ <script setup lang="ts">
2
+ import { useECharts } from '@/hooks/chart/useEcharts'
3
+
4
+ import { getOption } from './config'
5
+
6
+ const dom = useTemplateRef('chart')
7
+ const { setOptions } = useECharts(dom)
8
+
9
+ onMounted(() => {
10
+ setOptions(getOption())
11
+ })
12
+ </script>
13
+
14
+ <template>
15
+ <div class="h-100vh w-full bg-black">
16
+ <div ref="chart" class="h-30% w-30%" />
17
+ </div>
18
+ </template>
19
+
20
+ <style lang="scss" scoped>
21
+
22
+ </style>
@@ -0,0 +1,24 @@
1
+ <script setup lang="ts">
2
+ import SvgIcon from '@/components/Icon/svg-icon.vue'
3
+
4
+ const a = ref()
5
+
6
+ const b = ref([1, 3, 4])
7
+ </script>
8
+
9
+ <template>
10
+ <div class="content-h-full w-full bg-green p-[111px] p-3px p-4px text-red">
11
+ home
12
+ <el-date-picker v-model="a" type="date" value-format="yyyy-MM-dd" />
13
+ <SvgIcon icon="vue" class="text-green" />
14
+ <el-button type="primary">
15
+ 按钮
16
+ </el-button>
17
+ <div v-for="item in b" :key="item">
18
+ {{ item }}
19
+ </div>
20
+ <image src="https://img2.baidu.com/it/u=3422424222,2328894338&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500" />
21
+ </div>
22
+ </template>
23
+
24
+ <style lang="scss" scoped></style>
@@ -0,0 +1,94 @@
1
+ <script>
2
+ import { defineComponent, reactive, ref } from 'vue'
3
+
4
+ import BlocksTree from 'vue3-blocks-tree'
5
+
6
+ import 'vue3-blocks-tree/dist/vue3-blocks-tree.css'
7
+
8
+ export default defineComponent({
9
+ components: {
10
+ BlocksTree,
11
+ },
12
+ setup() {
13
+ const selected = ref([])
14
+ const treeOrientation = ref('0')
15
+ const treeData = reactive({
16
+ label: 'root',
17
+ expand: true,
18
+ some_id: 1,
19
+ children: [
20
+ { label: 'child 1', some_id: 2 },
21
+ { label: 'child 2', some_id: 3 },
22
+ {
23
+ label: 'subparent 1',
24
+ some_id: 4,
25
+ expand: false,
26
+ children: [
27
+ { label: 'subchild 1', some_id: 5 },
28
+ {
29
+ label: 'subchild 2',
30
+ some_id: 6,
31
+ expand: false,
32
+ children: [
33
+ { label: 'subchild 11', some_id: 7 },
34
+ { label: 'subchild 22', some_id: 8 },
35
+ ],
36
+ },
37
+ ],
38
+ },
39
+ ],
40
+ })
41
+
42
+ const toggleSelect = (node, isSelected) => {
43
+ isSelected ? selected.value.push(node.some_id) : selected.value.splice(selected.value.indexOf(node.some_id), 1)
44
+ if (node.children && node.children.length) {
45
+ node.children.forEach((ch) => {
46
+ toggleSelect(ch, isSelected)
47
+ })
48
+ }
49
+ }
50
+
51
+ return {
52
+ treeData,
53
+ selected,
54
+ toggleSelect,
55
+ treeOrientation,
56
+ }
57
+ },
58
+ })
59
+ </script>
60
+
61
+ <template>
62
+ <h1>Basic</h1>
63
+ <div>
64
+ <BlocksTree :data="treeData" :horizontal="treeOrientation === '1'" :collapsable="true" />
65
+ </div>
66
+
67
+ <h1>With slots</h1>
68
+ <div>
69
+ <BlocksTree :data="treeData" :horizontal="treeOrientation === '1'" :collapsable="false" :props="{ label: 'label', expand: 'expand', children: 'children', key: 'some_id' }">
70
+ <template #node="{ data, context }">
71
+ <span>
72
+ <input type="checkbox" :checked="selected.includes(data.some_id)" @change="(e) => toggleSelect(data, e.target.checked)"> {{ data.label }}
73
+ </span>
74
+ <br>
75
+ <span v-if="data.children && data.children.length">
76
+ <a href="#" @click="context.toggleExpand">toggle expand</a>
77
+ </span>
78
+ </template>
79
+ </BlocksTree>
80
+ <div>
81
+ Selected: {{ selected }}
82
+ </div>
83
+ </div>
84
+
85
+ <h1>Change orientation</h1>
86
+ <select v-model="treeOrientation">
87
+ <option value="0">
88
+ Vertical
89
+ </option>
90
+ <option value="1">
91
+ Horizontal
92
+ </option>
93
+ </select>
94
+ </template>
@@ -7,10 +7,11 @@ const b = ref([1, 3, 4])
7
7
  </script>
8
8
 
9
9
  <template>
10
- <div class="relative z-1 m-2px p-[111px] p-3px p-4px text-red">
10
+ <div class="content-h-full h-98px w-full flex bg-green p-[111px] p-3px p-4px text-red">
11
11
  home
12
+ <SvgIcon icon="cpu" style="color: #303133" />
12
13
  <el-date-picker v-model="a" type="date" value-format="yyyy-MM-dd" />
13
- <SvgIcon name="vue" class="text-green" />
14
+ <SvgIcon icon="vue" class="text-green" />
14
15
  <el-button type="primary">
15
16
  按钮
16
17
  </el-button>
@@ -13,7 +13,7 @@
13
13
  "paths": {
14
14
  "@/*": ["src/*"]
15
15
  },
16
- "types": ["vite/client", "vue"],
16
+ "types": ["vite/client", "vue", "node"],
17
17
  "allowImportingTsExtensions": true,
18
18
 
19
19
  /* Linting */
@@ -1,4 +1,6 @@
1
- import { defineConfig, presetUno } from 'unocss'
1
+ import presetAttributify from '@unocss/preset-attributify'
2
+ import presetWind4 from '@unocss/preset-wind4'
3
+ import { defineConfig } from 'unocss'
2
4
 
3
5
  export default defineConfig({
4
6
  // content: {
@@ -9,9 +11,11 @@ export default defineConfig({
9
11
  shortcuts: [
10
12
  {
11
13
  'flex-center': 'flex justify-center items-center',
14
+ 'content-h-full': 'h-[calc(100vh-var(--plus-header-height)-2*var(--el-main-padding))]',
12
15
  },
13
16
  ],
14
17
  presets: [
15
- presetUno(),
18
+ presetWind4(),
19
+ presetAttributify(),
16
20
  ],
17
21
  })
@@ -1,5 +1,4 @@
1
1
  import path from 'node:path'
2
- import process from 'node:process'
3
2
 
4
3
  import { PlusProComponentsResolver } from '@plus-pro-components/resolver'
5
4
  import Vue from '@vitejs/plugin-vue'
@@ -12,10 +11,11 @@ import Inspect from 'vite-plugin-inspect'
12
11
  import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
13
12
 
14
13
  // https://vite.dev/config/
15
- export default defineConfig(({ _command, mode }) => {
14
+ export default defineConfig(({ mode }) => {
16
15
  const root = process.cwd()
17
16
  const env = loadEnv(mode, root)
18
- const { VITE_PORT } = env
17
+ const { VITE_PORT, VITE_API_URL, VITE_API_AFFIX } = env
18
+ console.log(env)
19
19
 
20
20
  return {
21
21
  resolve: {
@@ -23,11 +23,20 @@ export default defineConfig(({ _command, mode }) => {
23
23
  '@': path.resolve(__dirname, 'src'),
24
24
  },
25
25
  },
26
+
26
27
  server: {
27
28
  port: Number(VITE_PORT),
28
29
  host: '0.0.0.0',
29
30
  open: false,
30
- proxy: {},
31
+
32
+ proxy: {
33
+ [`^/${VITE_API_AFFIX}`]: {
34
+ target: VITE_API_URL,
35
+ changeOrigin: true,
36
+ // secure: false, // Disable SSL certificate verification
37
+ rewrite: path => path.replace(new RegExp(`^/${VITE_API_AFFIX}`), ''),
38
+ },
39
+ },
31
40
  },
32
41
  plugins: [
33
42
  Vue(),
@@ -1,84 +0,0 @@
1
- .send_dingtalk_notification: &send_dingtalk_notification |
2
- case "$CI_JOB_STAGE" in
3
- "build")
4
- stage_name="构建"
5
- ;;
6
- "deploy")
7
- stage_name="部署"
8
- ;;
9
- esac
10
-
11
- if [ "$CI_JOB_STATUS" == "success" ]; then
12
- title="==✅ ${stage_name}成功=="
13
- else
14
- title="==❌ ${stage_name}失败=="
15
- fi
16
-
17
- curl -s -X POST ${DINGTALK_WEBHOOK} \
18
- -H "Content-Type: application/json" \
19
- -d "{
20
- \"msgtype\": \"markdown\",
21
- \"markdown\": {
22
- \"title\": \"GitLab CI/CD 通知\",
23
- \"text\": \"### ${title}\n\n- **项目**: ${CI_PROJECT_NAME}\n- **项目地址**: ${CI_PROJECT_URL}\n- **阶段**: ${stage_name}\n- **任务**: [查看详情](${CI_JOB_URL})\n- **分支**: ${CI_COMMIT_REF_NAME}\n- **提交人**: ${CI_COMMIT_AUTHOR}\n- **提交信息**: ${CI_COMMIT_MESSAGE}\n- **时间**: $(date '+%Y-%m-%d %H:%M:%S')\"
24
- }
25
- }"
26
-
27
- stages:
28
- - build
29
- - deploy
30
-
31
- variables:
32
- DEPLOY_PATH: /usr/local/bee/web/pipe-network/pipe-network-model
33
- MOCK_DEPLOY_PATH: /usr/local/bee/web/pipe-network/pipe-network-model-mock
34
- DINGTALK_WEBHOOK: 'https://oapi.dingtalk.com/robot/send?access_token=${DING_TALK_ACCESS_TOKEN}'
35
-
36
- cache:
37
- paths:
38
- - node_modules/
39
-
40
- # 打包
41
- build:
42
- stage: build
43
- script:
44
- - cd ${CI_PROJECT_DIR}
45
- - whoami
46
- - echo "===== 开始构建 ====="
47
- - pnpm install
48
- - pnpm build
49
- - echo "===== 构建完成 ====="
50
- only:
51
- - dev
52
- - mock
53
- artifacts:
54
- paths:
55
- - dist/
56
- after_script:
57
- # 钉钉通知
58
- - *send_dingtalk_notification
59
-
60
- # 部署
61
- deploy:
62
- stage: deploy
63
- needs: [build]
64
- only:
65
- - dev
66
- - mock
67
- script:
68
- - echo "-----------------开始部署------------------"
69
- - |
70
- if [ "$CI_COMMIT_BRANCH" == "dev" ]; then
71
- ssh root@192.168.2.245 "rm -rf $DEPLOY_PATH/*" || { echo "❌ 清理245失败"; exit 1; }
72
- scp -r dist/* root@192.168.2.245:$DEPLOY_PATH || { echo "❌ 传输到245失败"; exit 1; }
73
- ssh root@192.168.2.57 "rm -rf $DEPLOY_PATH/*" || { echo "❌ 清理57失败"; exit 1; }
74
- scp -r dist/* root@192.168.2.57:$DEPLOY_PATH || { echo "❌ 传输到57失败"; exit 1; }
75
- elif [ "$CI_COMMIT_BRANCH" == "mock" ]; then
76
- ssh root@192.168.2.57 "rm -rf $MOCK_DEPLOY_PATH/*" || { echo "❌ 清理57失败"; exit 1; }
77
- scp -r dist/* root@192.168.2.57:$MOCK_DEPLOY_PATH || { echo "❌ 传输到57失败"; exit 1; }
78
- else
79
- echo "没有匹配到需要部署的分支或标签,跳过部署"
80
- exit 0
81
- fi
82
- after_script:
83
- # 钉钉通知
84
- - *send_dingtalk_notification
@@ -1,7 +0,0 @@
1
- <script setup lang="ts"></script>
2
-
3
- <template>
4
- <div>model</div>
5
- </template>
6
-
7
- <style lang="scss" scoped></style>
File without changes