Browse Source

修改bug

修改bug
dangyunlong 1 week ago
parent
commit
53f0a7fd31
4 changed files with 34 additions and 22 deletions
  1. 2 2
      package.json
  2. 1 1
      src/components/MDinput/index.vue
  3. 21 19
      src/views/news/creatNews.vue
  4. 10 0
      vue.config.js

+ 2 - 2
package.json

@@ -71,8 +71,8 @@
     "mockjs": "1.0.1-beta3",
     "plop": "2.3.0",
     "runjs": "4.3.2",
-    "sass": "1.26.2",
-    "sass-loader": "8.0.2",
+    "sass": "~1.38.0",
+    "sass-loader": "10.2.0",
     "script-ext-html-webpack-plugin": "2.1.3",
     "serve-static": "1.13.2",
     "svg-sprite-loader": "4.1.3",

+ 1 - 1
src/components/MDinput/index.vue

@@ -264,7 +264,7 @@ export default {
     }
     .material-input {
       font-size: $font-size-base;
-      padding: $spacer $spacer $spacer - $apixel * 10 $spacer / 2;
+      padding: 12px;
       display: block;
       width: 100%;
       border: none;

+ 21 - 19
src/views/news/creatNews.vue

@@ -176,7 +176,8 @@
                   <el-checkbox v-model="checked">允许用户自己填写</el-checkbox>
                 </el-form-item>
               </div>
-              <el-form-item label="手动推荐:" prop="commend_id" class="custom-align-right">
+              <!-- 推荐新闻 -->
+              <!-- <el-form-item label="手动推荐:" prop="commend_id" class="custom-align-right">
                 <el-select v-model="form.commend_id" placeholder="请选择手动推荐名称" multiple filterable clearable remote :remote-method="remoteMethod" :loading="loading">
                   <el-option v-for="item in commend_article" :key="item.id" :label="item.title" :value="item.id"></el-option>
                 </el-select>
@@ -188,10 +189,9 @@
                   </el-tag>
                 </draggable>
               </el-form-item>
-
               <el-form-item label="创建时间:" class="custom-align-right" v-if="created_at">
                 <el-input v-model="created_at" autocomplete="off" disabled></el-input>
-              </el-form-item>
+              </el-form-item> -->
             </div>
           </div>
         </div>
@@ -279,7 +279,7 @@ export default {
       disclaimer: true,//免责声明
       //提交表单
       creatNews_user_type: 0,//判断用户类型'
-      created_at: "",//创建时间
+      //created_at: "",//创建时间
       commend_article: [],//手动推荐
       form: {
         user_type: "??",//判断用户类型'
@@ -310,7 +310,7 @@ export default {
         survey_name: "",//问卷名称
         suvey_array: "",//选项名称集合 
         survey_type: 0, //0:单选 1:复选
-        commend_id: [],//手动推荐
+        //commend_id: [],//手动推荐
       },
       //1.2 表单验证规则
       formRules: {
@@ -553,9 +553,9 @@ export default {
         //如果是普通用户 推荐等级设置为0 
         this.form.level = "[0]";
       }
-      if (this.form.commend_id != undefined && this.form.commend_id.length > 0) {
-        this.form.commend_id = JSON.stringify(this.form.commend_id); // 提取推荐ID
-      }
+      // if (this.form.commend_id != undefined && this.form.commend_id.length > 0) {
+      //   this.form.commend_id = JSON.stringify(this.form.commend_id); // 提取推荐ID
+      // }
       //先进行验证
       console.log(this.form);
 
@@ -699,7 +699,7 @@ export default {
         } else {
           this.form.web_site_id = res.data.web_site_id//站点名称
         }
-        this.created_at = res.data.created_at;
+        //this.created_at = res.data.created_at;
         this.form.cat_arr_id = Array.isArray(res.data.cat_arr_id) ? res.data.cat_arr_id : JSON.parse(res.data.cat_arr_id);
         console.log(this.form.cat_arr_id)
         //回显导航池 连同非管理员得一起刷新
@@ -729,7 +729,7 @@ export default {
         this.form.fromurl = res.data.fromurl;
         this.form.status = res.data.status;
         this.form.survey_name = res.data.survey_name;
-        this.form.commend_id = JSON.parse(res.data.commend_id);
+        //this.form.commend_id = JSON.parse(res.data.commend_id);
         if (res.data.is_survey == null) {
           this.form.is_survey = 0;
         } else {
@@ -824,9 +824,11 @@ export default {
         }
         this.form.city_arr_id = JSON.stringify(this.form.city_arr_id);
       }
-      if (this.form.commend_id != undefined && this.form.commend_id.length > 0) {
-        this.form.commend_id = JSON.stringify(this.form.commend_id); // 提取推荐ID
-      }
+      //推荐新闻
+      // if (this.form.commend_id != undefined && this.form.commend_id.length > 0) {
+      //   this.form.commend_id = JSON.stringify(this.form.commend_id); // 提取推荐ID
+      // }
+
       //将department_id和city_id转换为字符串  
       // this.form.department_arr_id = JSON.stringify(this.form.department_arr_id);
       // this.form.city_arr_id = JSON.stringify(this.form.city_arr_id);
@@ -1029,12 +1031,12 @@ export default {
       // 处理拖拽结束事件(如果需要)
       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);
-      }
-    },
+    // handleClose(item) {
+    //   const index = this.form.commend_id.indexOf(item);
+    //   if (index > -1) {
+    //     this.form.commend_id.splice(index, 1);
+    //   }
+    // },
     //6.问卷 刘佳伟 end ------------------------------------------------------------>
   },
   mounted() {

+ 10 - 0
vue.config.js

@@ -52,6 +52,16 @@ module.exports = {
     //   }
     // }
   },
+  css: {
+    loaderOptions: {
+      sass: {
+        sassOptions: {
+          outputStyle: 'expanded',
+          quietDeps: true, // 忽略第三方库的警告
+        }
+      }
+    }
+  },
   configureWebpack: {
     // provide the app's title in webpack's name field, so that
     // it can be accessed in index.html to inject the correct title.