st-comp 0.0.13 → 0.0.16

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 (37) hide show
  1. package/auto-imports.d.ts +1 -1
  2. package/components.d.ts +2 -1
  3. package/lib/bundle.js +10145 -9151
  4. package/lib/bundle.umd.cjs +10 -12
  5. package/lib/style.css +1 -1
  6. package/lib/talib.wasm +0 -0
  7. package/package.json +4 -1
  8. package/packages/Kline/components/Contextmenu/index.vue +110 -0
  9. package/packages/Kline/components/Tips/index.vue +18 -86
  10. package/packages/Kline/formatKlineData.ts +67 -40
  11. package/packages/Kline/images/buy.svg +1 -0
  12. package/packages/Kline/images/pen.png +0 -0
  13. package/packages/Kline/images/sell.svg +1 -0
  14. package/packages/Kline/images/t.svg +1 -0
  15. package/packages/Kline/index.vue +439 -119
  16. package/packages/Kline/option.ts +316 -0
  17. package/packages/Kline/type.d.ts +192 -24
  18. package/packages/Kline/utils.ts +576 -171
  19. package/packages/Table/components/Button/index.vue +7 -0
  20. package/packages/Table/index.vue +37 -24
  21. package/packages/index.ts +0 -2
  22. package/public/talib.wasm +0 -0
  23. package/src/pages/ChartLayout/index.vue +22 -22
  24. package/src/pages/Kline/api.ts +57 -0
  25. package/src/pages/Kline/components/MultiCycleSingleVariety.vue +728 -0
  26. package/src/pages/Kline/components/SingleCycleSingleVariety.vue +663 -0
  27. package/src/pages/Kline/index.vue +85 -16
  28. package/src/router/routes.ts +0 -5
  29. package/src/style.css +75 -0
  30. package/vite.config.ts +37 -27
  31. package/vitePlugins/testRelese.ts +67 -0
  32. package/packages/Echarts/index.ts +0 -8
  33. package/packages/Echarts/index.vue +0 -113
  34. package/packages/Kline/kline_theme_dark.json +0 -30
  35. package/packages/Kline/kline_theme_light.json +0 -30
  36. package/src/components/Echarts/index.vue +0 -31
  37. package/src/pages/Echarts/index.vue +0 -12
@@ -9,6 +9,7 @@
9
9
  <el-button
10
10
  :type="option.type"
11
11
  :disabled="typeof option.disabled === 'function' ? option.disabled(scope.row, scope.$index) : option.disabled"
12
+ :style="{ marginTop: showMargin ? '10px' : 0 }"
12
13
  >
13
14
  {{ typeof option.text === 'function' ? option.text(scope.row, scope.$index) : option.text }}
14
15
  </el-button>
@@ -18,11 +19,13 @@
18
19
  v-else
19
20
  :type="option.type"
20
21
  :disabled="typeof option.disabled === 'function' ? option.disabled(scope.row, scope.$index) : option.disabled"
22
+ :style="{ marginTop: showMargin ? '10px' : 0 }"
21
23
  @click="option.onClick(scope.row, scope.$index)"
22
24
  >
23
25
  {{ typeof option.text === 'function' ? option.text(scope.row, scope.$index) : option.text }}
24
26
  </el-button>
25
27
  </template>
28
+ <template v-else></template>
26
29
  </template>
27
30
 
28
31
  <script setup lang="ts">
@@ -36,6 +39,10 @@
36
39
  scope: {
37
40
  type: Object,
38
41
  required: true
42
+ },
43
+ showMargin: {
44
+ type: Boolean,
45
+ default: () => false
39
46
  }
40
47
  })
41
48
 
@@ -43,31 +43,33 @@
43
43
  v-for="(btn, btnIndex) in item.btns"
44
44
  :key="`${btn.text}-${btnIndex}`"
45
45
  >
46
- <el-popover
47
- v-if="btn.children"
48
- placement="bottom"
49
- trigger="hover"
50
- :popper-style="{ minWidth: '0px', width: null }"
51
- >
52
- <template #reference>
53
- <el-icon
54
- :style="{ marginLeft: '10px', verticalAlign: '-5px', cursor: 'pointer' }"
55
- size="20"
56
- >
57
- <MoreFilled />
58
- </el-icon>
59
- </template>
60
- <div
61
- v-for="(subBtn, subBtnIndex) in btn.children"
62
- :key="`${subBtn.text}-${subBtnIndex}`"
63
- :style="{ marginTop: subBtnIndex === 0 ? 0 : '10px'}"
46
+ <template v-if="btn.children">
47
+ <el-popover
48
+ v-if="getShowChildren(btn.children, scope).length"
49
+ placement="bottom"
50
+ trigger="hover"
51
+ :popper-style="{ minWidth: '0px', width: null }"
64
52
  >
65
- <Button
66
- :option="subBtn"
67
- :scope="scope"
68
- />
69
- </div>
70
- </el-popover>
53
+ <template #reference>
54
+ <el-icon
55
+ :style="{ marginLeft: '10px', verticalAlign: '-5px', cursor: 'pointer' }"
56
+ size="20"
57
+ >
58
+ <MoreFilled />
59
+ </el-icon>
60
+ </template>
61
+ <div
62
+ v-for="(subBtn, subBtnIndex) in getShowChildren(btn.children, scope)"
63
+ :key="`${subBtn.text}-${subBtnIndex}`"
64
+ >
65
+ <Button
66
+ :option="subBtn"
67
+ :scope="scope"
68
+ :showMargin="subBtnIndex !== 0"
69
+ />
70
+ </div>
71
+ </el-popover>
72
+ </template>
71
73
  <Button
72
74
  v-else
73
75
  :option="btn"
@@ -114,6 +116,17 @@
114
116
  const sortChange = (params: any) => {
115
117
  emit('sortChange', params)
116
118
  }
119
+
120
+ const getShowChildren = (children: any[], scope: any) => {
121
+ return children.filter(item => {
122
+ if(typeof item.show === 'function' && item.show(scope.row, scope.$index) === false) {
123
+ return false
124
+ } else if (item.show === false) {
125
+ return false
126
+ }
127
+ return true
128
+ })
129
+ }
117
130
  </script>
118
131
 
119
132
  <style lang="scss" scoped>
package/packages/index.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { App } from "vue"
2
2
  import StChartLayout from "./ChartLayout/index.ts"
3
3
  import StDialog from "./Dialog/index.ts"
4
- import StEcharts from "./Echarts/index.ts"
5
4
  import StKline from "./Kline/index.ts"
6
5
  import StPagination from "./Pagination/index.ts"
7
6
  import StTable from "./Table/index.ts"
@@ -10,7 +9,6 @@ export default {
10
9
  install(app: App) {
11
10
  StChartLayout.install(app)
12
11
  StDialog.install(app)
13
- StEcharts.install(app)
14
12
  StKline.install(app)
15
13
  StPagination.install(app)
16
14
  StTable.install(app)
Binary file
@@ -1,22 +1,22 @@
1
- <template>
2
- <div style="width: 100%;height: 100%;">
3
- <st-chartLayout
4
- :data="data"
5
- :row="2"
6
- :col="3"
7
- >
8
- <template #default="{ data }">
9
- <div style="width: 100%;height: 100%;;background: #ccc">{{ data }}</div>
10
- </template>
11
- </st-chartLayout>
12
- </div>
13
- </template>
14
-
15
- <script setup lang="ts">
16
- const data = [
17
- 1,2,3,4,5,6
18
- ]
19
- </script>
20
-
21
- <style lang="scss" scoped>
22
- </style>
1
+ <template>
2
+ <div style="width: 100%;height: 100%;">
3
+ <st-chartLayout
4
+ :data="data"
5
+ :row="2"
6
+ :col="3"
7
+ >
8
+ <template #default="{ data }">
9
+ <div style="width: 100%;height: 100%;;background: #ccc">{{ data }}</div>
10
+ </template>
11
+ </st-chartLayout>
12
+ </div>
13
+ </template>
14
+
15
+ <script setup lang="ts">
16
+ const data = [
17
+ 1,2,3,4,5,6
18
+ ]
19
+ </script>
20
+
21
+ <style lang="scss" scoped>
22
+ </style>
@@ -0,0 +1,57 @@
1
+ import axios from 'axios'
2
+
3
+ /**
4
+ * @description: 通用接口-单品种单周期K线数据
5
+ */
6
+ export const getSingleCycleSingleVariety = async (data: any) => {
7
+ return axios({
8
+ method: 'post',
9
+ headers: {
10
+ token: '49d4a41f8776c86d36dd560969117785',
11
+ },
12
+ url: 'http://192.168.12.49:88/common/qt/getSingleCycleSingleVariety',
13
+ data,
14
+ })
15
+ }
16
+
17
+ /**
18
+ * @description: 通用接口-单品种多周期K线数据
19
+ */
20
+ export const getMultiCycleSingleVariety = async (data: any) => {
21
+ return axios({
22
+ method: 'post',
23
+ headers: {
24
+ token: '49d4a41f8776c86d36dd560969117785',
25
+ },
26
+ url: 'http://192.168.12.49:88/common/qt/getMultiCycleSingleVariety',
27
+ data,
28
+ })
29
+ }
30
+
31
+ /**
32
+ * @description: 通用接口-字典
33
+ */
34
+ export const getDict = async (data: any) => {
35
+ return axios({
36
+ method: 'post',
37
+ headers: {
38
+ token: '49d4a41f8776c86d36dd560969117785',
39
+ },
40
+ url: 'http://192.168.12.49:88/common/qt/getDict',
41
+ data,
42
+ })
43
+ }
44
+
45
+ /**
46
+ * @description: 获取指标配置表
47
+ * 后续会通过前端函数库进行自维护获取,而不是依赖接口拉表
48
+ */
49
+ export const getIndicatorConfig = async () => {
50
+ return axios({
51
+ method: 'get',
52
+ headers: {
53
+ token: '49d4a41f8776c86d36dd560969117785',
54
+ },
55
+ url: 'http://116.62.161.92:8005/get_indicator'
56
+ })
57
+ }