st-comp 0.0.127 → 0.0.129
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.
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +244 -237
- package/es/style.css +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +124 -124
- package/lib/{index-9315299f.js → index-46222655.js} +6007 -6000
- package/lib/{python-e3723c58.js → python-477921cb.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/KlineBasic/api.js +25 -25
- package/packages/KlineBasic/index.vue +7 -3
- package/src/pages/KlineBasic/api.js +1 -1
- package/src/pages/KlineBasic/index.vue +1 -0
package/package.json
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { initRequest, isLogin, getToken, loginout, getUserData } from "st-func";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
handleRes: (response) => {
|
|
12
|
-
const { data } = response;
|
|
13
|
-
// 登录失效
|
|
14
|
-
if (data.code === 401) {
|
|
15
|
-
if (location.origin.includes("localhost")) {
|
|
16
|
-
location.href = `${location.origin}/#/404`;
|
|
17
|
-
} else {
|
|
18
|
-
loginout();
|
|
3
|
+
let get = null;
|
|
4
|
+
let post = null;
|
|
5
|
+
|
|
6
|
+
export const initRequestByEnv = (env) => {
|
|
7
|
+
const requestFn = initRequest(env, {
|
|
8
|
+
handleReq: (request) => {
|
|
9
|
+
if (isLogin()) {
|
|
10
|
+
request.headers["token"] = getToken();
|
|
19
11
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
12
|
+
},
|
|
13
|
+
handleRes: (response) => {
|
|
14
|
+
const { data } = response;
|
|
15
|
+
// 登录失效
|
|
16
|
+
if (data.code === 401) {
|
|
17
|
+
if (location.origin.includes("localhost")) {
|
|
18
|
+
location.href = `${location.origin}/#/404`;
|
|
19
|
+
} else {
|
|
20
|
+
loginout();
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
get = requestFn.get;
|
|
27
|
+
post = requestFn.post;
|
|
28
|
+
}
|
|
29
29
|
|
|
30
30
|
// 获取K线数据以及基础数据
|
|
31
31
|
export const getKlineBasic = (data) => {
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
import { onMounted, onUnmounted, ref, watch, computed } from "vue"
|
|
85
85
|
import * as echarts from "echarts"
|
|
86
86
|
import dayjs from "dayjs"
|
|
87
|
-
import { getKlineBasic, getKline, getWarningLine, addWarningLine, updateWarningLine, deleteWarningLine } from './api'
|
|
87
|
+
import { initRequestByEnv, getKlineBasic, getKline, getWarningLine, addWarningLine, updateWarningLine, deleteWarningLine } from './api'
|
|
88
88
|
import { addResizeListener } from 'st-func'
|
|
89
89
|
import { getMainOptions, getWarningLineOptions } from './utils'
|
|
90
90
|
import KlineTips from './components/KlineTips/index.vue'
|
|
@@ -149,6 +149,10 @@ const props = defineProps({
|
|
|
149
149
|
type: Object,
|
|
150
150
|
default: () => ({})
|
|
151
151
|
}, // 配置
|
|
152
|
+
env: {
|
|
153
|
+
type: Object,
|
|
154
|
+
default: () => ({})
|
|
155
|
+
}, // 环境变量
|
|
152
156
|
})
|
|
153
157
|
|
|
154
158
|
const isEmpty = ref(false) // 是否无数据
|
|
@@ -196,7 +200,7 @@ watch(
|
|
|
196
200
|
)
|
|
197
201
|
|
|
198
202
|
onMounted(() => {
|
|
199
|
-
|
|
203
|
+
initRequestByEnv(props.env)
|
|
200
204
|
getMainData()
|
|
201
205
|
})
|
|
202
206
|
|
|
@@ -308,7 +312,7 @@ const getMainData = async () => {
|
|
|
308
312
|
params.limit = defaultShowCounts + addCounts
|
|
309
313
|
} else {
|
|
310
314
|
// 未传入时间,使用最新时间作为结束时间请求数据
|
|
311
|
-
params.endTime = dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
315
|
+
params.endTime = dayjs().add(1, "hour").format('YYYY-MM-DD HH:mm:ss')
|
|
312
316
|
params.limit = defaultShowCounts + addCounts
|
|
313
317
|
}
|
|
314
318
|
const res = await getKlineBasic(params)
|