Browse Source

添加模板选择类型

木星 3 weeks ago
parent
commit
7cd5521bfe
1 changed files with 29 additions and 6 deletions
  1. 29 6
      src/views/Template/TemplateManage.vue

+ 29 - 6
src/views/Template/TemplateManage.vue

@@ -140,6 +140,31 @@ const schema = reactive<FormSchema[]>([
140 140
       rules: [required()]
141 141
     }
142 142
   },
143
+
144
+  {
145
+    field: 'typeNumber',
146
+    label: '选择类型',
147
+    component: 'Select',
148
+    colProps: {
149
+      span: 24
150
+    },
151
+    componentProps: {
152
+      options: [
153
+        {
154
+          value: 1,
155
+          label: '不包含pak包'
156
+        },
157
+        {
158
+          value: 2,
159
+          label: '包含pak包'
160
+        }
161
+      ],
162
+      slots: {}
163
+    },
164
+    formItemProps: {
165
+      rules: [required()]
166
+    }
167
+  },
143 168
   {
144 169
     field: 'thumbnail',
145 170
     component: 'Upload',
@@ -221,15 +246,12 @@ const schema = reactive<FormSchema[]>([
221 246
         if (rawFile.type !== 'application/x-zip-compressed' && rawFile.type !== 'application/zip') {
222 247
           ElMessage.error('只能上传ZIP文件')
223 248
           return false
224
-        } else if (rawFile.size / 1024 / 1024 > 2048) {
225
-          ElMessage.error('文件不超过2G!')
226
-          return false
227 249
         }
228 250
         return true
229 251
       },
230 252
       slots: {
231 253
         default: () => <BaseButton type="primary">点击上传</BaseButton>,
232
-        tip: () => <div class="el-upload__tip">只能上传ZIP文件,且不超过2G</div>
254
+        tip: () => <div class="el-upload__tip">只能上传ZIP文件</div>
233 255
       }
234 256
     }
235 257
   }
@@ -248,7 +270,8 @@ const edittab = async (data: TableSlotDefault) => {
248 270
   formData.thumbnail = data.row.thumbnail
249 271
   imageUrl.value = PATH_URL + data.row.thumbnail
250 272
   formData.zoneId = data.row.zoneId
251
-  schema[2].componentProps.fileList = [
273
+  formData.typeNumber = data.row.typeNumber
274
+  schema[3].componentProps.fileList = [
252 275
     {
253 276
       name: data.row.templateFileName,
254 277
       url: data.row.templateFilePath
@@ -352,7 +375,7 @@ const tianjia = async () => {
352 375
     />
353 376
   </ContentWrap>
354 377
 
355
-  <Dialog v-model="dialogVisible" maxHeight="380px" width="35rem" :title="isedit">
378
+  <Dialog v-model="dialogVisible" maxHeight="430px" width="35rem" :title="isedit">
356 379
     <Form :schema="schema" @register="formRegister" />
357 380
 
358 381
     <template #footer>