Browse Source

修改创新比赛

zs 1 year ago
parent
commit
df4401564a
3 changed files with 40 additions and 9 deletions
  1. 3 3
      src/views/innovation/detail.vue
  2. 11 6
      src/views/release/index.vue
  3. 26 0
      src/views/release/parts/match.vue

+ 3 - 3
src/views/innovation/detail.vue

@@ -48,7 +48,7 @@
                   <el-tab-pane label="常见问题" name="third"></el-tab-pane>
                 </el-tabs>
               </el-col>
-              <el-col :span="2" class="twoRight">
+              <el-col :span="2" class="twoRight" v-if="info.match_status == '1'">
                 <a-button type="primary" @click="toSign"> 报名参赛 </a-button>
               </el-col>
             </el-row>
@@ -456,14 +456,14 @@ provide('submitForm', submitForm)
     }
     .thr_2 {
       display: flex;
-      justify-content: space-around;
+      flex-wrap: wrap;
       margin: 10px 0 0 0;
       .list {
         display: flex;
         align-items: center;
         min-height: 150px;
         width: 100%;
-        margin-bottom: 10px;
+        margin: 10px;
         position: relative;
         overflow: hidden;
         border: 1px solid #f5f5f5;

+ 11 - 6
src/views/release/index.vue

@@ -47,6 +47,7 @@ const form = ref({})
 // 字典表
 const fieldList = ref([])
 const statusList = ref([])
+const matchList = ref([])
 const typeList = ref([
   { value: '0', label: '供给' },
   { value: '1', label: '需求' }
@@ -73,7 +74,7 @@ const searchField = async () => {
       { label: '成果名称', model: 'name', type: 'name' },
       { label: '技术领域:', model: 'field', type: 'dict' },
       { label: '成果地区:', model: 'area', type: 'area' },
-      { label: '状态:', model: 'status', type: 'dict' }
+      { label: '审核状态:', model: 'status', type: 'dict' }
     ]
   } else if (routeType.value == 'demand') {
     fields.value = [
@@ -81,21 +82,22 @@ const searchField = async () => {
       { label: '技术领域:', model: 'field', type: 'dict' },
       { label: '类型:', model: 'type', type: 'dict' },
       { label: '需求地区:', model: 'area', type: 'area' },
-      { label: '状态:', model: 'status', type: 'dict' }
+      { label: '审核状态:', model: 'status', type: 'dict' }
     ]
   } else if (routeType.value == 'project') {
     fields.value = [
       { label: '项目名称', model: 'name', type: 'name' },
       { label: '技术领域:', model: 'field', type: 'dict' },
       { label: '发布时间:', model: 'time' },
-      { label: '状态:', model: 'status', type: 'dict' }
+      { label: '审核状态:', model: 'status', type: 'dict' }
     ]
   } else if (routeType.value == 'match') {
     fields.value = [
       { label: '比赛名称', model: 'name', type: 'name' },
       { label: '比赛金额:', model: 'money' },
       { label: '比赛日期:', model: 'time', type: 'time' },
-      { label: '状态:', model: 'status', type: 'dict' }
+      { label: '赛事状态:', model: 'match_status', type: 'dict' },
+      { label: '审核状态:', model: 'status', type: 'dict' }
     ]
   }
   await search({ skip, limit })
@@ -124,6 +126,9 @@ const searchOther = async () => {
   // 状态
   result = await dictDataStore.query({ code: 'examStatus', is_use: '0' })
   if ($checkRes(result)) statusList.value = result.data
+  // 赛事状态
+  result = await dictDataStore.query({ code: 'matchStatus', is_use: '0' })
+  if ($checkRes(result)) matchList.value = result.data
 }
 // 字典数据转换
 const getDict = (data, model) => {
@@ -131,6 +136,7 @@ const getDict = (data, model) => {
   if (model == 'field') res = fieldList.value.find((f) => f.value == data)
   if (model == 'status') res = statusList.value.find((f) => f.value == data)
   if (model == 'type') res = typeList.value.find((f) => f.value == data)
+  if (model == 'match_status') res = matchList.value.find((f) => f.value == data)
   return get(res, 'label')
 }
 // 地区显示
@@ -144,7 +150,7 @@ const getTime = (data) => {
   else return '暂无'
 }
 const toCommon = (data) => {
-  if (routeType.value == 'match') form.value = { rules: {} }
+  if (routeType.value == 'match') form.value = { file: [], rules: {} }
   else form.value = {}
   type.value = data
 }
@@ -160,7 +166,6 @@ const toView = (item) => {
 // 修改
 const toEdit = (item) => {
   form.value = item
-  console.log(item)
   type.value = '1'
 }
 // 保存

+ 26 - 0
src/views/release/parts/match.vue

@@ -21,6 +21,16 @@
           label-width="80px"
           class="form"
         >
+          <el-form-item label="封面" prop="file">
+            <custom-upload
+              model="file"
+              :list="form.file"
+              :limit="1"
+              url="/files/web/template/match/upload"
+              @change="onFUpload"
+              listType="picture-card"
+            ></custom-upload>
+          </el-form-item>
           <el-row :gutter="20">
             <el-col :span="12">
               <el-form-item label="赛事名称" prop="name">
@@ -122,6 +132,16 @@
           <el-form-item class="editor" label="常见问题" prop="brief">
             <WangEditor v-model="form.brief" />
           </el-form-item>
+          <el-form-item label="赛事状态" prop="match_status">
+            <el-select v-model="form.match_status" clearable placeholder="请选择赛事状态">
+              <el-option
+                v-for="(item, index) in matchList"
+                :key="index"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
+          </el-form-item>
           <el-form-item>
             <el-col :span="24" class="button">
               <el-button type="primary" @click="submitForm(MatchRules)">保存</el-button>
@@ -156,6 +176,7 @@ const rules = reactive({
   money: [{ required: true, message: '请输入奖金', trigger: 'blur' }],
   time: [{ required: true, message: '请选择有效期', trigger: 'change' }],
   is_use: [{ required: true, message: '请选择是否使用', trigger: 'change' }],
+  match_status: [{ required: true, message: '请选择赛事状态', trigger: 'change' }],
   brief: [{ required: true, message: '请输入常见问题', trigger: 'blur' }]
 })
 // 请求
@@ -180,6 +201,11 @@ const searchOther = async () => {
   result = await dictDataStore.query({ code: 'matchStatus', is_use: '0' })
   if ($checkRes(result)) matchList.value = result.data
 }
+// 上传图片
+const onFUpload = (e) => {
+  const { model, value } = e
+  form.value[model] = value
+}
 </script>
 <style scoped lang="scss">
 .one {