فهرست منبع

修改添加编辑项目的前端推荐等级的问题及bug修改

15313670163 3 روز پیش
والد
کامیت
439fcecf37
1فایلهای تغییر یافته به همراه18 افزوده شده و 49 حذف شده
  1. 18 49
      src/views/project/creatProject.vue

+ 18 - 49
src/views/project/creatProject.vue

@@ -28,7 +28,11 @@
             <el-input v-model="form.title" autocomplete="off" placeholder="请输入标题名称"></el-input>
             <!-- <el-checkbox v-model="form.islink">是否使用外链</el-checkbox> -->
           </el-form-item>
-          
+          <el-form-item label="推荐等级:" prop="level" class="custom-align-right">
+              <el-select v-model="form.level" clearable placeholder="请选择公司的推荐等级">
+                <el-option label="推荐项目" :value="1"></el-option>
+              </el-select>
+            </el-form-item>
           <div>
             <el-form-item label="缩略图:" class="custom-align-right" prop="imgurl">
               <div class="uploaderBox">
@@ -74,7 +78,7 @@
               <template #label>
                 <span class="askBox">
                   项目关键词:
-                  <el-tooltip class="item" effect="dark" introduce="项目关键词,如:三农市场网、全国三农、信息一体化。" placement="top">
+                  <el-tooltip class="item" effect="dark" content="项目关键词,如:三农市场网、全国三农、信息一体化。" placement="top">
                     <i class="el-icon-question"></i>
                   </el-tooltip>
                 </span>
@@ -85,7 +89,7 @@
               <template #label>
                 <span class="askBox">
                   项目描述:
-                  <el-tooltip class="item" effect="dark" introduce="项目描述,如:中国三农市场网创建以来,社会效益和会员经济效益贡献。" placement="top">
+                  <el-tooltip class="item" effect="dark" content="项目描述,如:中国三农市场网创建以来,社会效益和会员经济效益贡献。" placement="top">
                     <i class="el-icon-question"></i>
                   </el-tooltip>
                 </span>
@@ -223,6 +227,7 @@ export default {
         category_id: 0,//栏目id
         nav_add_pool_id: [],//导航池子级
         title: '',//项目标题
+        level: null,//推荐等级
         imgurl: [],//缩略图
         description: "",//描述
         keyword: "",//关键词
@@ -432,6 +437,7 @@ export default {
           }
           formData.category_id = this.form.category_id;
           formData.cat_arr_id = Array.isArray(this.form.cat_arr_id) ? JSON.stringify(this.form.cat_arr_id):  this.form.cat_arr_id ;
+          formData.level = this.form.level;
           delete formData.commend_id;
           delete formData.nav_add_pool_id;
           delete formData.user_type;
@@ -479,6 +485,7 @@ export default {
         this.form.nav_add_pool_id = [],//导航池子级
         this.form.category_id = 0;
         this.form.title = "";
+        this.form.level = null;
         this.form.imgurl = "";
         this.form.description = "";
         this.form.keyword = "";
@@ -532,6 +539,8 @@ export default {
       };
       this.$store.dispatch('project/getProjectInfo', data).then(res => {
         this.form.title = res.data.title;
+        this.form.level = res.data.level;
+        console.log(res.data.level)
         if (typeof res.data.website_id === 'string') {
           this.form.website_id = Number(res.data.website_id);
         } else {
@@ -604,7 +613,7 @@ export default {
         // ===== 日期处理逻辑结束 =====
           //取出行政职能和行政区划数组的最后一个数字
           if (this.form.city_arr_id == "[]" || this.form.city_arr_id == null) {
-            this.form.city_arr_id = '[]'
+            this.form.city_arr_id = '[]';
             this.form.city_id = 0;
           } else {
             if (JSON.parse(this.form.city_arr_id.length == 0)) {
@@ -614,7 +623,7 @@ export default {
             }
           }
           if (this.form.cat_arr_id == "[]" || this.form.cat_arr_id == null) {
-            this.form.cat_arr_id = '[]'
+            this.form.cat_arr_id = '[]';
             this.form.category_id = 0;
           } else {
             if (JSON.parse(this.form.cat_arr_id.length == 0)) {
@@ -629,6 +638,9 @@ export default {
             this.form.status = 0;
             this.form.website_id = this.websiteid;
           }
+          if(this.form.level == 0 || this.form.level == ''){
+            this.form.level = null;
+          }
           const formData = { ...this.form };
           formData.city_arr_id = Array.isArray(this.form.city_arr_id) ? JSON.stringify(this.form.city_arr_id):  this.form.city_arr_id ;
           formData.cat_arr_id = Array.isArray(this.form.cat_arr_id) ? JSON.stringify(this.form.cat_arr_id):  this.form.cat_arr_id ;
@@ -740,20 +752,6 @@ export default {
     levelChange(value) {
       this.form.level = value;
     },
-    getNews() {
-      this.$store.dispatch('news/getArticleList', { page: 1, pageSize: 20 }).then(res => {
-        let data = [];
-        for (let item of res.data.rows) {
-          data.push(item)
-        }
-        this.commend_article = data;
-      }).catch(() => {
-        this.$message({
-          type: 'info',
-          message: '网络错误,请重试!'
-        });
-      })
-    },
     // 远程搜索方法
     remoteMethod(query) {
       const artical_params = { page: 1, pageSize: 20, id: query }
@@ -788,38 +786,9 @@ export default {
       }
     },
     //5.站点选择 曹国庆 end ------------------------------------------------------------>
-
-    //6.问卷 刘佳伟 start ------------------------------------------------------------>
-    addInput(index) {
-      // 在当前索引后插入一个新的输入框对象
-      if (this.inputList.length > 10) {
-        this.$message.warning('最多只能添加10个文本框');
-        return false;
-      }
-      this.inputList.splice(index + 1, 0, { value: '' });
-    },
-    deleteInput(index) {
-      if (this.inputList.length > 1) {
-        // 如果输入框数量大于 1,则删除当前索引对应的输入框对象
-        this.inputList.splice(index, 1);
-      } else {
-        this.$message.warning('至少保留一个输入框');
-      }
-    },
-    onDragEnd() {
-      // 处理拖拽结束事件(如果需要)
-      console.log('拖拽结束', this.commend_article);
-    },
-    handleClose(item) {
-      const index = this.form.commend_id.indexOf(item);
-      if (index > -1) {
-        this.form.commend_id.splice(index, 1);
-      }
-    },
-    //6.问卷 刘佳伟 end ------------------------------------------------------------>
   },
   mounted() {
-    this.getNews()
+    // this.getNews()
     this.creatNews_user_type = getUseType()
     this.websiteid = getWebSiteId()
     //1.获得站点标识