st-comp 0.0.58 → 0.0.59

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "st-comp",
3
3
  "public": true,
4
- "version": "0.0.58",
4
+ "version": "0.0.59",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -11,7 +11,7 @@ const visible = ref(false);
11
11
 
12
12
  // 表单相关参数
13
13
  const dialogFormRef = ref(null);
14
- const dialogForm = ref({ factorScreen: [{ cycle: null, factor: null, score: [null, null] }] });
14
+ const dialogForm = ref({ factorScreen: [{ cycle: props.config.cycleDefault ?? null, factor: null, score: [null, null] }] });
15
15
  // 特殊校验: 分数
16
16
  const scoreValidator = (rule, value, callback) => {
17
17
  // 检查开始和结束的分是否都没填
@@ -26,7 +26,7 @@ const scoreValidator = (rule, value, callback) => {
26
26
  const openDialog = () => {
27
27
  // 弹窗打开时, 重置表单
28
28
  if (data.value.length > 0) dialogForm.value.factorScreen = JSON.parse(JSON.stringify(data.value));
29
- else dialogForm.value.factorScreen = [{ cycle: null, factor: null, score: [null, null] }];
29
+ else dialogForm.value.factorScreen = [{ cycle: props.config.cycleDefault ?? null, factor: null, score: [null, null] }];
30
30
  visible.value = true;
31
31
  };
32
32
  // 函数: 弹窗外-删除因子
@@ -36,7 +36,7 @@ const deleteTag = (index) => {
36
36
 
37
37
  // 函数: 弹窗内-添加因子
38
38
  const addFactor = () => {
39
- dialogForm.value.factorScreen.push({ cycle: null, factor: null, score: [null, null] });
39
+ dialogForm.value.factorScreen.push({ cycle: props.config.cycleDefault ?? null, factor: null, score: [null, null] });
40
40
  };
41
41
  // 函数: 弹窗内-删除因子
42
42
  const deleteFactor = (index) => {
@@ -86,9 +86,10 @@ const handleTagName = (tag) => {
86
86
  <div v-for="(item, index) in dialogForm.factorScreen" class="form-row">
87
87
  <!-- 周期 -->
88
88
  <el-form-item
89
+ v-if="config.cycleShow"
89
90
  :prop="'factorScreen.' + index + '.cycle'"
90
91
  :rules="{ required: true, message: '周期不能为空', trigger: 'blur' }"
91
- style="width: 100px"
92
+ style="width: 100px; margin-right: 10px;"
92
93
  >
93
94
  <el-select v-model="item.cycle" placeholder="选择周期" size="small">
94
95
  <el-option v-for="{ label, value } in config.cycleOptions" :label="label" :value="value" :key="value" />
@@ -98,7 +99,7 @@ const handleTagName = (tag) => {
98
99
  <el-form-item
99
100
  :prop="'factorScreen.' + index + '.factor'"
100
101
  :rules="{ required: true, message: '因子不能为空', trigger: 'blur' }"
101
- style="width: 100px"
102
+ style="width: 100px; margin-right: 10px;"
102
103
  >
103
104
  <el-select v-model="item.factor" placeholder="选择因子" size="small">
104
105
  <el-option v-for="{ label, value } in config.factorOptions" :label="label" :value="value" :key="value" />
@@ -108,9 +109,9 @@ const handleTagName = (tag) => {
108
109
  <el-form-item
109
110
  :prop="'factorScreen.' + index + '.score'"
110
111
  :rules="{ validator: scoreValidator, trigger: 'blur' }"
111
- style="width: 200px"
112
+ style="width: 200px; margin-right: 10px;"
112
113
  >
113
- <div style="display: flex; align-items: center; width: 100%; height: 24px">
114
+ <div style="display: flex; align-items: center; width: 100%; height: 24px;">
114
115
  <el-input-number v-model="item.score[0]" size="small" controls-position="right" />
115
116
  <span>~</span>
116
117
  <el-input-number v-model="item.score[1]" size="small" controls-position="right" />
@@ -138,7 +139,7 @@ const handleTagName = (tag) => {
138
139
  .form-row {
139
140
  display: flex;
140
141
  align-items: center;
141
- justify-content: space-between;
142
+ justify-content: start;
142
143
  margin-bottom: 18px;
143
144
  .el-form-item {
144
145
  margin: 0;
@@ -37,7 +37,9 @@ export default {
37
37
  // 因子筛选
38
38
  factorScreen: {
39
39
  show: true,
40
+ cycleDefault: null,
40
41
  cycleOptions: [],
42
+ cycleShow: true,
41
43
  factorOptions: [],
42
44
  },
43
45
  // 常用指标
@@ -35,10 +35,12 @@ const varietySearchConfig = ref({
35
35
  // 因子筛选
36
36
  factorScreen: {
37
37
  show: true,
38
+ // cycleDefault: 1,
38
39
  cycleOptions: [
39
40
  { label: "周期一", value: 1 },
40
41
  { label: "周期二", value: 2 },
41
42
  ],
43
+ // cycleShow: true,
42
44
  factorOptions: [
43
45
  { label: "因子一", value: 1 },
44
46
  { label: "因子二", value: 2 },