|
84 | 84 |
|
85 | 85 | <el-form-item :label="$t('cronjob.cronSpec')" prop="spec"> |
86 | 86 | <div v-for="(specObj, index) of dialogData.rowData.specObjs" :key="index" style="width: 100%"> |
87 | | - <el-select class="specTypeClass" v-model="specObj.specType" @change="changeSpecType(index)"> |
88 | | - <el-option |
89 | | - v-for="item in specOptions" |
90 | | - :key="item.label" |
91 | | - :value="item.value" |
92 | | - :label="item.label" |
93 | | - /> |
94 | | - </el-select> |
95 | | - <el-select v-if="specObj.specType === 'perWeek'" class="specClass" v-model="specObj.week"> |
96 | | - <el-option |
97 | | - v-for="item in weekOptions" |
98 | | - :key="item.label" |
99 | | - :value="item.value" |
100 | | - :label="item.label" |
101 | | - /> |
102 | | - </el-select> |
103 | | - <el-input v-if="hasDay(specObj)" class="specClass" v-model.number="specObj.day"> |
104 | | - <template #append> |
105 | | - <div class="append">{{ $t('cronjob.day') }}</div> |
106 | | - </template> |
107 | | - </el-input> |
108 | | - <el-input v-if="hasHour(specObj)" class="specClass" v-model.number="specObj.hour"> |
109 | | - <template #append> |
110 | | - <div class="append">{{ $t('commons.units.hour') }}</div> |
111 | | - </template> |
112 | | - </el-input> |
113 | | - <el-input |
114 | | - v-if="specObj.specType !== 'perNSecond'" |
115 | | - class="specClass" |
116 | | - v-model.number="specObj.minute" |
117 | | - > |
118 | | - <template #append> |
119 | | - <div class="append">{{ $t('commons.units.minute') }}</div> |
120 | | - </template> |
121 | | - </el-input> |
122 | | - <el-input |
123 | | - v-if="specObj.specType === 'perNSecond'" |
124 | | - class="specClass" |
125 | | - v-model.number="specObj.second" |
126 | | - > |
127 | | - <template #append> |
128 | | - <div class="append">{{ $t('commons.units.second') }}</div> |
129 | | - </template> |
130 | | - </el-input> |
131 | | - <el-button |
132 | | - link |
133 | | - type="primary" |
134 | | - style="float: right; margin-top: 5px" |
135 | | - @click="handleSpecDelete(index)" |
136 | | - v-if="dialogData.rowData.specObjs.length > 1" |
137 | | - > |
138 | | - {{ $t('commons.button.delete') }} |
139 | | - </el-button> |
| 87 | + <div class="grid sm:grid-cols-9 gap-4 grid-cols-1"> |
| 88 | + <el-select |
| 89 | + v-model="specObj.specType" |
| 90 | + class="col-span-2" |
| 91 | + @change="changeSpecType(index)" |
| 92 | + > |
| 93 | + <el-option |
| 94 | + v-for="item in specOptions" |
| 95 | + :key="item.label" |
| 96 | + :value="item.value" |
| 97 | + :label="item.label" |
| 98 | + /> |
| 99 | + </el-select> |
| 100 | + <el-select |
| 101 | + v-if="specObj.specType === 'perWeek'" |
| 102 | + class="col-span-2" |
| 103 | + v-model="specObj.week" |
| 104 | + > |
| 105 | + <el-option |
| 106 | + v-for="item in weekOptions" |
| 107 | + :key="item.label" |
| 108 | + :value="item.value" |
| 109 | + :label="item.label" |
| 110 | + /> |
| 111 | + </el-select> |
| 112 | + <el-input v-if="hasDay(specObj)" class="col-span-2" v-model.number="specObj.day"> |
| 113 | + <template #append> |
| 114 | + <div class="sm:min-w-8 min-w-14 text-center"> |
| 115 | + <el-tooltip :content="$t('cronjob.day')" placement="top"> |
| 116 | + {{ $t('cronjob.dayUnit') }} |
| 117 | + </el-tooltip> |
| 118 | + </div> |
| 119 | + </template> |
| 120 | + </el-input> |
| 121 | + <el-input v-if="hasHour(specObj)" class="col-span-2" v-model.number="specObj.hour"> |
| 122 | + <template #append> |
| 123 | + <div class="sm:min-w-8 min-w-14 text-center"> |
| 124 | + <el-tooltip :content="$t('commons.units.hour')" placement="top"> |
| 125 | + {{ $t('commons.units.hourUnit') }} |
| 126 | + </el-tooltip> |
| 127 | + </div> |
| 128 | + </template> |
| 129 | + </el-input> |
| 130 | + <el-input |
| 131 | + v-if="specObj.specType !== 'perNSecond'" |
| 132 | + class="col-span-2" |
| 133 | + v-model.number="specObj.minute" |
| 134 | + > |
| 135 | + <template #append> |
| 136 | + <div class="sm:min-w-8 min-w-14 text-center"> |
| 137 | + <el-tooltip :content="$t('commons.units.minute')" placement="top"> |
| 138 | + {{ $t('commons.units.minuteUnit') }} |
| 139 | + </el-tooltip> |
| 140 | + </div> |
| 141 | + </template> |
| 142 | + </el-input> |
| 143 | + <el-input |
| 144 | + v-if="specObj.specType === 'perNSecond'" |
| 145 | + class="col-span-2" |
| 146 | + v-model.number="specObj.second" |
| 147 | + > |
| 148 | + <template #append> |
| 149 | + <div class="sm:min-w-8 min-w-14 text-center"> |
| 150 | + <el-tooltip :content="$t('commons.units.second')" placement="top"> |
| 151 | + {{ $t('commons.units.secondUnit') }} |
| 152 | + </el-tooltip> |
| 153 | + </div> |
| 154 | + </template> |
| 155 | + </el-input> |
| 156 | + <el-button |
| 157 | + link |
| 158 | + type="primary" |
| 159 | + class="col-span-1" |
| 160 | + style="float: right; margin-top: 5px" |
| 161 | + @click="handleSpecDelete(index)" |
| 162 | + v-if="dialogData.rowData.specObjs.length > 1" |
| 163 | + > |
| 164 | + {{ $t('commons.button.delete') }} |
| 165 | + </el-button> |
| 166 | + </div> |
140 | 167 | <el-divider v-if="dialogData.rowData.specObjs.length > 1" class="divider" /> |
141 | 168 | </div> |
142 | 169 | </el-form-item> |
@@ -838,37 +865,9 @@ defineExpose({ |
838 | 865 | }); |
839 | 866 | </script> |
840 | 867 | <style scoped lang="scss"> |
841 | | -.specClass { |
842 | | - width: 20% !important; |
843 | | - margin-left: 20px; |
844 | | -
|
845 | | - .append { |
846 | | - width: 20px; |
847 | | - } |
848 | | -} |
849 | | -
|
850 | | -@media only screen and (max-width: 1000px) { |
851 | | - .specClass { |
852 | | - width: 100% !important; |
853 | | - margin-top: 20px; |
854 | | - margin-left: 0; |
855 | | -
|
856 | | - .append { |
857 | | - width: 43px; |
858 | | - } |
859 | | - } |
860 | | -} |
861 | | -
|
862 | | -.specTypeClass { |
863 | | - width: 22% !important; |
| 868 | +:deep(.el-input-group__append) { |
| 869 | + padding: 0 10px; |
864 | 870 | } |
865 | | -
|
866 | | -@media only screen and (max-width: 1000px) { |
867 | | - .specTypeClass { |
868 | | - width: 100% !important; |
869 | | - } |
870 | | -} |
871 | | -
|
872 | 871 | .selectClass { |
873 | 872 | width: 100%; |
874 | 873 | } |
|
0 commit comments