浏览代码

修改-全局表单-2025-7-1

CaoGQ123 3 天之前
父节点
当前提交
008ed11aef
共有 3 个文件被更改,包括 38 次插入27 次删除
  1. 12 2
      src/views/tabbar/globalForm.vue
  2. 10 8
      src/views/tabbar/globalFormDetail.vue
  3. 16 17
      src/views/tabbar/globalFormFont.vue

+ 12 - 2
src/views/tabbar/globalForm.vue

@@ -207,8 +207,8 @@ export default {
             ruleForm: {
 
                 use_captcha: 0, // 新增验证码开关 
-                form_name: '', //表单名
-                table_name: '', //表名
+                form_name: '投诉举报', //表单名
+                table_name: 'complaints_report', //表名
                 webName: '', //网站名称
                 tabbarName: '', //单页名称
                 tabbarName_2: '', //单页名称
@@ -359,6 +359,15 @@ export default {
             this.ruleForm.pageType = '' //页面类型
             this.ruleForm.use_captcha = false //验证码    
 
+            this.ruleForm={
+                use_captcha: 0, // 新增验证码开关 
+                form_name: '投诉举报', //表单名
+                table_name: 'complaints_report', //表名
+                webName: '', //网站名称
+                tabbarName: '', //单页名称
+                tabbarName_2: '', //单页名称
+                pageType: '', //页面类型
+            }
 
         },
         // 弹出层相关方法
@@ -384,6 +393,7 @@ export default {
                                 }
                             }).catch(err =>{
                                 console.log(err);
+                                this.$message.error('添加失败---',err)
                             })
                             this.cancelForm()        
                      

+ 10 - 8
src/views/tabbar/globalFormDetail.vue

@@ -88,17 +88,15 @@
                 <el-form-item 
                 v-for="(head, index) in table_head" 
                         :key="index"
-                        :label="head.title"
+                        :label="head.title+':'"
                         :prop="`field_${index}`"
                         :rules="getValidationRules(head, index)">
- 
- 
 
                         <!-- 文本文字1 -->
                         <el-input 
                             v-if="head.field_type==1"
                             v-model="ruleForm[`field_${index}`]"
-                            :disabled="head.title === '编号' ? true : false"
+                            :disabled="head.title === '编号:' ? true : false"
                             @blur="handleBlurValidation(head.title, ruleForm[`field_${index}`])">
                         </el-input>
  
@@ -169,11 +167,15 @@
                         <!-- 上传单文件 7-->
                           
                        <template v-if="head.field_type==7">
- 
-                                
-                                <button @click="file_fun(table_per_fun(head, ruleForm[`field_${index}`] ))">
+  
+                                 <el-button 
+                                    type="primary" 
+                                    size="small"
+                                    class="listLookBtn"
+                                    @click="file_fun(table_per_fun(head, ruleForm[`field_${index}`] ))">
+                                    <i class="el-icon-view"></i>
                                     预览
-                                </button>
+                                </el-button>
 
                        </template>  
 

+ 16 - 17
src/views/tabbar/globalFormFont.vue

@@ -28,9 +28,10 @@
                                        <i class="el-icon-edit-outline"></i>
                                        修改 
                                    </div>
-                                    <div class="listDeleteBtn" @click="deleteRow(scope.row.id)">
+                                    <div class="listDeleteBtn" @click="deleteRow(scope.row.id)" 
+                                        v-if="scope.row.disable_del === 0">
                                         <i class="el-icon-delete"></i>
-                                        删除
+                                          删除 
                                     </div>
                                 </div>
                             </template>
@@ -50,6 +51,7 @@
                             v-model="ruleForm.field_name" 
                             placeholder="请输入"
                             :disabled="dialogName === '修改字段'"
+                             
                             clearable>
                         </el-input>
                     </el-form-item>
@@ -111,7 +113,7 @@
                     </el-form-item>
  
  
-                    <el-form-item label="校验内容:" prop="field_regular" 
+                    <el-form-item label="正则验证:" prop="field_regular" 
                         :rules="[
                             { 
                                 required: ruleForm.field_switch === 1, 
@@ -264,14 +266,14 @@ export default {
                     id: this.$route.query.id,
                 }).then(data => {
                     this.tableData = data.data 
-                    // console.log("自定义字段列表========", this.tableData);
+                     
                 })
             if (this.webSiteName_name && this.tabbarName) {
                 getFooterCategory({
                     name: this.tabbarName,
                     website_name: this.webSiteName_name, //网站名称
                 }).then(data => {
-                    // console.log(data);
+                     
                     this.tableData = data.data.rows
                 })
             } else if (this.webSiteName_name && !this.tabbarName) {
@@ -279,7 +281,7 @@ export default {
                     // name: this.tabbarName,
                     website_name: this.webSiteName_name, //网站名称
                 }).then(data => {
-                    // console.log(data);
+                     
                     this.tableData = data.data.rows
                 })
             } else if (!this.webSiteName_name && this.tabbarName) {
@@ -311,7 +313,7 @@ export default {
                 font_form_del_api({
                     id: id
                 }).then(data => {
-                    console.log(data);
+                    // console.log(data);
                     if (data.code = 200) {
                         this.$message({
                             message: '删除成功',
@@ -338,7 +340,7 @@ export default {
         },
         //1.9 编辑
         goEdit(id, val) {
-            console.log("--------------------",id, val);
+             
             this.dialogName = '修改字段'
             this.activeid = id
             this.dialogTableVisible = true
@@ -361,18 +363,17 @@ export default {
         },
         //1.7 添加
         addWebsite() {
-            console.log("添加字段---------");
             this.dialogTableVisible = true
             this.dialogName = "添加字段"
             this.disabled = false
             //添加时清空回显回来的数据
             this.ruleForm = {
                 field_recive_id: this.$route.query.id,
-                field_name: '',
-                field_name_show: '',
+                field_name: 'age',
+                field_name_show: '年龄',
                 field_type: "",
-                field_textarea: '',
-                field_length: '',
+                field_textarea: '男|1\n 女|2\n保密|3',
+                field_length: '1-255',
                 field_switch: 0,
                 field_switch_backend: 0,
                 field_switch_web: 0,
@@ -396,7 +397,6 @@ export default {
 
 
                     if (valid) {
-                        console.log("修改字段-------", this.ruleForm);
                         font_form_edit_api({
                             table_id: this.$route.query.id,
                             field_name: this.ruleForm.field_name,
@@ -489,7 +489,7 @@ export default {
 
 
         },
-
+ 
         //取消添加或编辑
         cancelForm() {
             this.dialogTableVisible = false
@@ -512,7 +512,6 @@ export default {
             this.$store.dispatch('pool/uploadFile', formData).then(res => {
                 this.logoUrl = res.data.imgUrl;//显示缩略图
                 this.ruleForm.adPhoto = res.data.imgUrl;//提供表单地址
-                console.log(res.data.imgUrl)
             }).catch(() => {
                 this.$message({
                     type: 'info',
@@ -529,7 +528,7 @@ export default {
         //添加 / 编辑弹窗中输入关键词下拉框 
         // 判断是否已经关联了网站
         detectionWebSite(value) {
-            console.log(value);
+            // console.log(value);
             this.website_id = value
         },
     },