st-comp 0.0.159 → 0.0.161
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/components.d.ts +1 -0
- package/es/ChartLayout.js +3 -3
- package/es/Dialog.js +12 -12
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +27 -27
- package/es/Kline.js +16 -16
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +248 -251
- package/es/KlineNew.js +14 -14
- package/es/MonacoEditor.cjs +1 -1
- package/es/MonacoEditor.js +7 -2
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +18 -18
- package/es/PasswordPrompt.js +3 -3
- package/es/Table.cjs +1 -1
- package/es/Table.js +196 -347
- package/es/User.cjs +1 -1
- package/es/User.js +21 -21
- package/es/VarietySearch.cjs +3 -1
- package/es/VarietySearch.js +4265 -1071
- package/es/VirtualTable.js +12 -12
- package/es/_commonjsHelpers-10dfc225.js +8 -0
- package/es/_commonjsHelpers-87b0abe8.cjs +1 -0
- package/es/{_initCloneObject-e3d8a9ab.js → _initCloneObject-7f4a9bd7.js} +3 -3
- package/es/{base-19787dfb.js → base-113d028b.js} +7 -7
- package/es/{castArray-8405000b.js → castArray-2b3f27ef.js} +1 -1
- package/es/{config-provider-0f6672af.js → config-provider-3ffe8f8f.js} +3 -3
- package/es/{debounce-6cb0781f.js → debounce-3517a4c7.js} +1 -1
- package/es/{dropdown-17b3ef6a.js → dropdown-ee1240ff.js} +4 -4
- package/es/{el-button-0bf1d532.js → el-button-de89fb60.js} +4 -4
- package/es/{el-checkbox-group-d53bc316.js → el-checkbox-group-17e4156a.js} +2 -2
- package/es/{el-empty-bd5343a7.js → el-empty-546e4106.js} +2 -2
- package/es/{el-form-item-05c0e335.js → el-form-item-73ecd9af.js} +8 -8
- package/es/{el-input-1e309239.js → el-input-c715d419.js} +9 -8
- package/es/{el-input-6a3805c5.cjs → el-input-cb340042.cjs} +1 -1
- package/es/{el-input-number-60ebc58f.js → el-input-number-02db11f6.js} +13 -13
- package/es/{el-input-number-96ff2e47.cjs → el-input-number-0f194f3f.cjs} +1 -1
- package/es/{el-menu-item-6c6236a1.js → el-menu-item-67fac653.js} +8 -8
- package/es/{el-message-7d927756.js → el-message-2eae949c.js} +7 -7
- package/es/{el-overlay-26bf0945.js → el-overlay-f94c4f3b.js} +8 -8
- package/es/{el-popover-17e2e66c.js → el-popconfirm-029f2c00.js} +12 -12
- package/es/{el-popover-7bd8a7c3.cjs → el-popconfirm-86503f8a.cjs} +1 -1
- package/es/{el-popper-b6527ae2.js → el-popper-b34ec18f.js} +9 -9
- package/es/{el-scrollbar-29bcab5f.js → el-scrollbar-c463eaff.js} +7 -7
- package/es/{el-select-7395562b.js → el-select-b77506ca.js} +13 -13
- package/es/{el-table-column-47d80736.js → el-table-column-4aea6b31.js} +12 -12
- package/es/{el-tag-7414e0c7.js → el-tag-1cf8487e.js} +3 -3
- package/es/index-2da94fd7.js +159 -0
- package/es/{index-273822d1.js → index-440d64f2.js} +7 -7
- package/es/{index-75cce588.js → index-496e80be.js} +2 -2
- package/es/index-58521b9e.cjs +1 -0
- package/es/{index-621b092b.js → index-7125c109.js} +1 -1
- package/es/{index-dc22ffe4.js → index-a777a57a.js} +2 -2
- package/es/{index-72151b24.js → index-dd5d4ae9.js} +6 -6
- package/es/{index-c066fe0d.js → index-f393f2d4.js} +3 -3
- package/es/{index-70372cdb.js → index-f905d74d.js} +1 -1
- package/es/{index-ad9f40cd.cjs → index.vue_vue_type_script_setup_true_lang-4024853c.cjs} +3 -3
- package/es/{index-015c420d.js → index.vue_vue_type_script_setup_true_lang-745718ff.js} +5 -9
- package/es/{python-81655341.cjs → python-6a3f6816.cjs} +2 -2
- package/es/{python-be1bd6d2.js → python-7fcad568.js} +1 -1
- package/es/{raf-a532c514.js → raf-5d53429d.js} +1 -1
- package/es/{scroll-d787d648.js → scroll-9ec370f4.js} +1 -1
- package/es/style.css +1 -1
- package/es/{use-form-common-props-5ff2f51b.js → use-form-common-props-d20ca09c.js} +8 -8
- package/es/{vnode-6a0c7411.js → vnode-2d8e2f0e.js} +1 -1
- package/es/{zh-cn-f37255ae.js → zh-cn-4d2bbda7.js} +2 -2
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +222 -220
- package/lib/{index-819ef426.js → index-c0cfb828.js} +45519 -42330
- package/lib/{python-4c5a7f20.js → python-4a34bda1.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +2 -1
- package/packages/VarietySearch/components/CommonIndicator/index.vue +98 -54
- package/packages/VarietySearch/components/FactorScreen/ScriptSelect.vue +300 -0
- package/packages/VarietySearch/components/FactorScreen/VarietySelect.vue +78 -0
- package/packages/VarietySearch/components/FactorScreen/index.vue +123 -21
- package/packages/VarietySearch/config.js +49 -0
- package/packages/VarietySearch/index.vue +24 -13
- package/src/pages/VarietySearch/api.js +70 -0
- package/src/pages/VarietySearch/index.vue +83 -109
- package/vitePlugins/createExportFile.ts +0 -101
- package/vitePlugins/testRelese.ts +0 -67
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div style="width: 100%; height: 100%">
|
|
3
|
-
<st-varietySearch
|
|
4
|
-
ref="varietySearchRef"
|
|
5
|
-
v-model:searchData="varietySearchData"
|
|
6
|
-
:config="varietySearchConfig"
|
|
7
|
-
/>
|
|
8
|
-
<el-button @click="query">查询</el-button>
|
|
9
|
-
<br />
|
|
10
|
-
<p>格式化转为接口参数_api params:</p>
|
|
11
|
-
<p>{{ formatData }}</p>
|
|
12
|
-
</div>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
1
|
<script setup>
|
|
16
2
|
import axios from "axios";
|
|
17
|
-
import { ref, onMounted } from "vue";
|
|
3
|
+
import { ref, onMounted, computed } from "vue";
|
|
4
|
+
import { getAlarDict, getAlarFreq, getAlarFactor } from "./api.js";
|
|
18
5
|
|
|
19
6
|
const varietySearchRef = ref(null);
|
|
20
7
|
const varietySearchData = ref({
|
|
@@ -33,104 +20,91 @@ const varietySearchData = ref({
|
|
|
33
20
|
},
|
|
34
21
|
commonIndicator: [],
|
|
35
22
|
});
|
|
36
|
-
const varietySearchConfig = ref({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
// 常用选项 [选项: 前端默认]
|
|
42
|
-
commonOption: {
|
|
43
|
-
show: true,
|
|
44
|
-
},
|
|
45
|
-
// 上市板块 [选项: 接口获取**!]
|
|
46
|
-
marketIds: {
|
|
47
|
-
show: true,
|
|
48
|
-
options: [],
|
|
49
|
-
},
|
|
50
|
-
// 自定标签 [选项: 接口获取**!]
|
|
51
|
-
customTag: {
|
|
52
|
-
show: true,
|
|
53
|
-
options: [
|
|
54
|
-
{ label: "自定标签一", value: 1 },
|
|
55
|
-
{ label: "自定标签二", value: 2 },
|
|
56
|
-
],
|
|
57
|
-
},
|
|
58
|
-
// 因子筛选 [选项: 接口获取**!]
|
|
59
|
-
factorScreen: {
|
|
60
|
-
show: true,
|
|
61
|
-
sqlShow: true,
|
|
62
|
-
// 周期下拉框数据源
|
|
63
|
-
cycleOptions: [
|
|
64
|
-
{ label: "周期一", value: 1 },
|
|
65
|
-
{ label: "周期二", value: 2 },
|
|
66
|
-
],
|
|
67
|
-
// 因子下拉框数据源
|
|
68
|
-
factorOptions: [
|
|
69
|
-
{ label: "ema720阳线箱体低点偏差", value: 1, type: 1 },
|
|
70
|
-
{ label: "历史K线的前低前高附近(人工)", value: 3, type: 3 },
|
|
71
|
-
{ label: "阳线-双箱高点", value: 4, type: 4 },
|
|
72
|
-
],
|
|
73
|
-
// 因子使用说明数据源
|
|
74
|
-
factorDescriptions: [],
|
|
75
|
-
},
|
|
76
|
-
// 常用指标 [选项: 前端默认]
|
|
77
|
-
commonIndicator: {
|
|
78
|
-
show: true,
|
|
79
|
-
},
|
|
23
|
+
const varietySearchConfig = ref({});
|
|
24
|
+
|
|
25
|
+
// 前端筛选条件格式化成API接口入参
|
|
26
|
+
const apiParams = computed(() => {
|
|
27
|
+
return { ...(varietySearchRef.value?.formatData(varietySearchData.value) ?? {}) };
|
|
80
28
|
});
|
|
81
29
|
|
|
82
|
-
|
|
30
|
+
onMounted(async () => {
|
|
31
|
+
const dicAlar = await getAlarDict();
|
|
32
|
+
const dicCycle = await getAlarFreq();
|
|
33
|
+
const dicFactor = await getAlarFactor();
|
|
83
34
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
{ label: "深股通", value: 2048, varietyMarketIds: "3" },
|
|
98
|
-
{ label: "沪港通", value: 4096, varietyMarketIds: "5" },
|
|
99
|
-
{ label: "深港通", value: 8192, varietyMarketIds: "5" },
|
|
100
|
-
];
|
|
101
|
-
};
|
|
102
|
-
// 获取: 因子使用说明数据源
|
|
103
|
-
const getFactorDescriptionApi = async () => {
|
|
104
|
-
const { data } = await axios({
|
|
105
|
-
method: "post",
|
|
106
|
-
headers: {
|
|
107
|
-
token: "09c77eb8eb452a8e07ed5ac37252b663",
|
|
35
|
+
varietySearchConfig.value = {
|
|
36
|
+
// 品种市场 [选项: 接口获取 1000]
|
|
37
|
+
varietyMarket: {
|
|
38
|
+
show: true,
|
|
39
|
+
options: dicAlar[1000]
|
|
40
|
+
.map((item) => {
|
|
41
|
+
return {
|
|
42
|
+
...item,
|
|
43
|
+
label: item.dictName,
|
|
44
|
+
value: item.dictCode,
|
|
45
|
+
memo: item?.memo?.split(",")?.map(Number),
|
|
46
|
+
};
|
|
47
|
+
}),
|
|
108
48
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
49
|
+
// 常用选项 [选项: 接口获取 1003]
|
|
50
|
+
commonOption: {
|
|
51
|
+
show: true,
|
|
52
|
+
options: dicAlar[1003]
|
|
53
|
+
.map((item) => {
|
|
54
|
+
return {
|
|
55
|
+
...item,
|
|
56
|
+
label: item.dictName,
|
|
57
|
+
value: item.dictCode,
|
|
58
|
+
};
|
|
59
|
+
}),
|
|
113
60
|
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
61
|
+
// 上市板块 [选项: 接口获取 1030]
|
|
62
|
+
marketIds: {
|
|
63
|
+
show: true,
|
|
64
|
+
options: dicAlar[1030].map((item) => {
|
|
65
|
+
return {
|
|
66
|
+
...item,
|
|
67
|
+
varietyMarketIds: item?.memo,
|
|
68
|
+
};
|
|
69
|
+
}),
|
|
70
|
+
},
|
|
71
|
+
// 自定标签 [选项: 接口获取]
|
|
72
|
+
customTag: {
|
|
73
|
+
show: true,
|
|
74
|
+
},
|
|
75
|
+
// 价差转换 [选项: 前端默认]
|
|
76
|
+
jcTranslate: {
|
|
77
|
+
show: true,
|
|
78
|
+
},
|
|
79
|
+
// 因子筛选 [选项: 接口获取]
|
|
80
|
+
factorScreen: {
|
|
81
|
+
show: true,
|
|
82
|
+
sqlShow: true,
|
|
83
|
+
cycleOptions: dicCycle.reduce((result, item) => {
|
|
84
|
+
if (item.freqTypeName === "单周期") {
|
|
85
|
+
result.push({ label: item.freqName, value: item.id });
|
|
86
|
+
}
|
|
87
|
+
return result;
|
|
88
|
+
}, []),
|
|
89
|
+
factorOptions: dicFactor,
|
|
90
|
+
factorDescriptions: dicFactor,
|
|
91
|
+
},
|
|
92
|
+
// 常用指标 [选项: 组件默认]
|
|
93
|
+
commonIndicator: {
|
|
94
|
+
show: true,
|
|
95
|
+
},
|
|
96
|
+
};
|
|
135
97
|
});
|
|
136
98
|
</script>
|
|
99
|
+
|
|
100
|
+
<template>
|
|
101
|
+
<div style="width: 100%; height: 100%">
|
|
102
|
+
<st-varietySearch
|
|
103
|
+
ref="varietySearchRef"
|
|
104
|
+
v-model:searchData="varietySearchData"
|
|
105
|
+
:config="varietySearchConfig"
|
|
106
|
+
/>
|
|
107
|
+
<el-divider content-position="left">格式化转为接口入参格式apiParams:</el-divider>
|
|
108
|
+
<div>{{ apiParams }}</div>
|
|
109
|
+
</div>
|
|
110
|
+
</template>
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 创建统一的导出文件
|
|
3
|
-
*/
|
|
4
|
-
import fs from 'fs'
|
|
5
|
-
|
|
6
|
-
const toFirstLowerCase = (word) => {
|
|
7
|
-
return `${word[0].toLowerCase()}${word.substr(1)}`
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export default ({ external }) => {
|
|
11
|
-
return {
|
|
12
|
-
name: 'createExport',
|
|
13
|
-
buildStart() {
|
|
14
|
-
fs.unlink(`./packages/index.ts`, (err) => {
|
|
15
|
-
if (err) throw err
|
|
16
|
-
})
|
|
17
|
-
fs.readdir('./packages', (err, files) => {
|
|
18
|
-
if (err) {
|
|
19
|
-
console.error(err)
|
|
20
|
-
return
|
|
21
|
-
}
|
|
22
|
-
const filterFiles = files.filter(fileName => !fileName.includes('.'))
|
|
23
|
-
// 生成每个组件的导出文件
|
|
24
|
-
filterFiles.forEach(fileName => {
|
|
25
|
-
if (external.includes(fileName)) return
|
|
26
|
-
const content = `import { App } from "vue";
|
|
27
|
-
import St${fileName} from "./index.vue";
|
|
28
|
-
|
|
29
|
-
export default {
|
|
30
|
-
install(app: App) {
|
|
31
|
-
app.component("st-${toFirstLowerCase(fileName)}", St${fileName});
|
|
32
|
-
},
|
|
33
|
-
}
|
|
34
|
-
`
|
|
35
|
-
fs.writeFile(`./packages/${fileName}/index.ts`, content, (err) => {
|
|
36
|
-
if (err) throw err
|
|
37
|
-
})
|
|
38
|
-
})
|
|
39
|
-
// 生成统一导出文件
|
|
40
|
-
const mainContent = `import { App } from "vue"
|
|
41
|
-
${filterFiles.map(fileName => `import St${fileName} from "./${fileName}/index.ts"`).join(`
|
|
42
|
-
`)}
|
|
43
|
-
|
|
44
|
-
export default {
|
|
45
|
-
install(app: App) {
|
|
46
|
-
${filterFiles.map(fileName => `St${fileName}.install(app)`).join(`
|
|
47
|
-
`)}
|
|
48
|
-
},
|
|
49
|
-
}
|
|
50
|
-
`
|
|
51
|
-
fs.writeFile(`./packages/index.ts`, mainContent, (err) => {
|
|
52
|
-
if (err) throw err
|
|
53
|
-
})
|
|
54
|
-
// 生成routes配置
|
|
55
|
-
const routesContent = `export default [
|
|
56
|
-
${filterFiles.map(fileName => `{
|
|
57
|
-
path: '/${toFirstLowerCase(fileName)}',
|
|
58
|
-
name: '${fileName}',
|
|
59
|
-
component: () => import('../pages/${fileName}/index.vue'),
|
|
60
|
-
},`).join(`
|
|
61
|
-
`)}
|
|
62
|
-
]
|
|
63
|
-
`
|
|
64
|
-
fs.writeFile(`./src/router/routes.ts`, routesContent, (err) => {
|
|
65
|
-
if (err) throw err
|
|
66
|
-
})
|
|
67
|
-
// 如果没有pages文件,则生成pages文件
|
|
68
|
-
fs.readdir('./src/pages', (pagesErr, pagesFiles) => {
|
|
69
|
-
if (pagesErr) {
|
|
70
|
-
console.error(pagesErr)
|
|
71
|
-
return
|
|
72
|
-
}
|
|
73
|
-
const filterPagesFiles = pagesFiles.filter(fileName => !fileName.includes('.'))
|
|
74
|
-
filterFiles.forEach(fileName => {
|
|
75
|
-
if (!filterPagesFiles.includes(fileName)) {
|
|
76
|
-
const pagesContent = `<template>
|
|
77
|
-
<div>
|
|
78
|
-
${fileName}
|
|
79
|
-
</div>
|
|
80
|
-
</template>
|
|
81
|
-
|
|
82
|
-
<script setup lang="ts">
|
|
83
|
-
</script>
|
|
84
|
-
|
|
85
|
-
<style lang="scss" scoped>
|
|
86
|
-
|
|
87
|
-
</style>
|
|
88
|
-
`
|
|
89
|
-
fs.mkdir(`./src/pages/${fileName}`, err => {
|
|
90
|
-
if(err) throw err;
|
|
91
|
-
fs.writeFile(`./src/pages/${fileName}/index.vue`, pagesContent, (err) => {
|
|
92
|
-
if (err) throw err
|
|
93
|
-
})
|
|
94
|
-
})
|
|
95
|
-
}
|
|
96
|
-
})
|
|
97
|
-
})
|
|
98
|
-
})
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 上传资源并重启nginx插件
|
|
3
|
-
* 需要安装依赖 ssh2-sftp-client ssh2
|
|
4
|
-
* 执行命令 npm install ssh2-sftp-client ssh2 -D
|
|
5
|
-
* 使用方法:
|
|
6
|
-
* 1.将该文件放到项目根目录中
|
|
7
|
-
* 2.vue.config.js中引入该文件到处的类
|
|
8
|
-
* 3.在configureWebpack.plugins中根据想要的环境(目前仅支持发测试环境)加入该插件
|
|
9
|
-
* 4.参数option.source为需要上传的文件夹路径,使用相对路径即可(必填)
|
|
10
|
-
* 参数option.target为需要上传到服务端的路径,当前默认为测试环境的路径(可选)
|
|
11
|
-
* 参数option.target_dir为上传到服务器后的文件夹名称(必填)
|
|
12
|
-
*/
|
|
13
|
-
import Client from 'ssh2-sftp-client'
|
|
14
|
-
import Ssh2Client from 'ssh2'
|
|
15
|
-
|
|
16
|
-
const defaultOption = {
|
|
17
|
-
source: '', // 需要上传的文件夹
|
|
18
|
-
target: '/usr/local/nginx/html/', // 服务端存放资源的路径
|
|
19
|
-
target_dir: '', // 目标文件夹名称
|
|
20
|
-
host: '192.168.12.49', // 服务器地址
|
|
21
|
-
port: '22', // 服务器断开
|
|
22
|
-
username: 'root', // 服务器登录用户名
|
|
23
|
-
password: 'hzst2020', // 服务器登录密码
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// 重启nginx
|
|
27
|
-
const reloadNginx = (serverMsg) => {
|
|
28
|
-
const conn = new Ssh2Client.Client()
|
|
29
|
-
conn.on('ready', () => {
|
|
30
|
-
conn.shell((err, stream) => {
|
|
31
|
-
if (err) throw err
|
|
32
|
-
stream.end('cd /usr/local/nginx/ \n/usr/local/nginx/sbin/nginx -s reload')
|
|
33
|
-
console.log('nginx重启完成')
|
|
34
|
-
conn.end()
|
|
35
|
-
})
|
|
36
|
-
}).connect(serverMsg)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// 上传文件
|
|
40
|
-
const upload = async mergeOption => {
|
|
41
|
-
const { source, target, target_dir, host, port, username, password } = mergeOption
|
|
42
|
-
if (!source || !target_dir) {
|
|
43
|
-
console.log('发布插件参数有误,请检查后重试')
|
|
44
|
-
return
|
|
45
|
-
}
|
|
46
|
-
const sftp = new Client()
|
|
47
|
-
try {
|
|
48
|
-
const serverMsg = { host, port, username, password }
|
|
49
|
-
await sftp.connect(serverMsg)
|
|
50
|
-
console.log('服务器连接成功,开始上传资源')
|
|
51
|
-
await sftp.uploadDir(`./${source}`, `${target}${target_dir}`)
|
|
52
|
-
console.log('资源上传完成')
|
|
53
|
-
sftp.end()
|
|
54
|
-
reloadNginx(serverMsg)
|
|
55
|
-
} catch (err) {
|
|
56
|
-
console.log('发布失败', err)
|
|
57
|
-
sftp.end()
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export default option => ({
|
|
62
|
-
name: 'release',
|
|
63
|
-
closeBundle() {
|
|
64
|
-
const mergeOption = { ...defaultOption, ...option }
|
|
65
|
-
upload(mergeOption)
|
|
66
|
-
}
|
|
67
|
-
})
|