zyz преди 1 година
родител
ревизия
89dbfc89c0

+ 1 - 1
zkqy-ui/src/views/asEditor/components/rightslider/decorate/index.vue

@@ -154,7 +154,7 @@ export default {
   },
 
   created() {
-     console.log("接收到的datas:", this.datas);
+    //  console.log("接收到的datas:", this.datas);
   },
 
   methods: {

+ 2 - 1
zkqy-ui/src/views/asEditor/components/rightslider/investigatestyle/index.vue

@@ -407,7 +407,8 @@ export default {
       this.showButtons = this.selecttext[index] === "下拉框";
       if(this.selecttext[index] === "时间选择器"){
         console.log(111);
-        item.dataValue = moment(new Date()).format('YYYY-MM-DD HH:mm:ss');
+        item.dataValue = moment(new Date()).format('YYYY-MM-DD');
+        // item.dataValue = moment(new Date()).format('YYYY-MM-DD HH:mm:ss');
       }
       console.log(this.selecttext[index], 888);
       console.log(this.showButtons, 999);

+ 35 - 39
zkqy-ui/src/views/asEditor/components/rightslider/queryListStyle/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="notecardstyle">
+  <div class="queryListstyle">
     <!-- 标题 -->
     <h2>{{ datas.text }}</h2>
 
@@ -7,7 +7,7 @@
       <!-- 选择表单 -->
       <el-form-item class="lef" label="" prop="tableName">
         <!-- 选择表单 -->
-        <el-form-item label="数据库表" prop="tableName">
+        <!-- <el-form-item label="数据库表" prop="tableName">
           <el-select
             v-model="datas.tableName"
             placeholder="请选择"
@@ -55,7 +55,7 @@
               }}</span>
             </el-option>
           </el-select>
-        </el-form-item>
+        </el-form-item> -->
 
         <div style="height: 20px" />
         <el-radio-group v-model="listQueryData.isSingleTable">
@@ -483,17 +483,13 @@ export default {
     };
   },
   created() {
-    console.log('tableName', this.datas.tableName);
-    if (this.datas.tableName) {
-      this.getFieldOptions1(this.datas.tableName);
-    }
     this.getAllTable();
   },
   watch: {
     mainTableFieldOptions: {
       handler(val) {
         if (val.length) {
-          console.log(val);
+          // console.log(val);
           this.mainTableData = val.map((item, index) => {
             return {
               sort: parseInt(index) + 1,
@@ -575,6 +571,7 @@ export default {
         operator: "=",
         type: "",
       });
+      console.log(this.queryContionTableData);
     },
     // 保存字段配置回调
     onSaveAttibute() {
@@ -584,6 +581,7 @@ export default {
       console.log(this.mainTableData);
       this.$message.success("保存成功");
       this.fieldEditOpen = false;
+      console.log(this.queryContionTableData);
     },
     // 字段配置回调
     fieldEditHandler(row, index) {
@@ -632,7 +630,7 @@ export default {
       }
     },
     // 开始编辑查询条件
-    editQueryHandler() {
+    async editQueryHandler() {
       this.editOpen = true;
       this.$nextTick(() => {
         this.initDragTable();
@@ -643,6 +641,9 @@ export default {
         // 主表
         let tableColumnName = JSON.parse(echoMessage.tableColumnName);
         this.listQueryData.mainForm.mainTableName = tableColumnName[0].tbname;
+        if (this.listQueryData.mainForm.mainTableName) {
+          this.mainTableFieldOptions = await this.getFieldOptions(this.listQueryData.mainForm.mainTableName);    
+        }
         // 表格主键
         let tablelistSort = JSON.parse(echoMessage.tablelistSort);
         let dataSortFromEcho = tablelistSort.DataSort; // "student.id"
@@ -712,17 +713,30 @@ export default {
         res.tableColumnDesc.push(descItem);
       });
       // 查询条件
-      let queryData = {}
-      this.queryContionTableData.map((item) => {
-        let { fieldName, tableName, value, operator, type } = item;
-        // let queryData = {}
-        queryData.fieldName = tableName + "." + fieldName;
-        queryData.value = value;
-        queryData.operator = operator;
-        queryData.type = String(type);
+      // let queryData = {}
+      // this.queryContionTableData.map((item) => {
+      //   let { fieldName, tableName, value, operator, type } = item;
+      //   // let queryData = {}
+      //   queryData.fieldName = tableName + "." + fieldName;
+      //   queryData.value = value;
+      //   queryData.operator = operator;
+      //   queryData.type = String(type);
         
+      // });
+      // console.log(this.queryContionTableData);
+      // this.tableQueryConditions.push(queryData)
+      // console.log(this.tableQueryConditions);
+      let queryDataArray = this.queryContionTableData.map((item) => {
+      let { fieldName, tableName, value, operator, type } = item;
+      return {
+          fieldName: tableName + "." + fieldName,
+          value: value,
+          operator: operator,
+          type: String(type)
+          };
       });
-      this.tableQueryConditions.push(queryData)
+      console.log(this.queryContionTableData);
+      this.tableQueryConditions.push(...queryDataArray);
       console.log(this.tableQueryConditions);
       let tableQueryConditionsString = JSON.stringify(this.tableQueryConditions);
       res.tableQueryConditions = tableQueryConditionsString;
@@ -751,7 +765,7 @@ export default {
         databaseType: this.databaseType,
       };
       let res = await getFormName(data);
-      console.log(res.data, 123);
+      // console.log(res.data, 123);
       this.tableList = res.data;
     },
     async getFieldOptions(value) {
@@ -767,25 +781,7 @@ export default {
         this.$message.error("网络异常,请稍后再试");
       }
     },
-    async getFieldOptions1(value, tempData) {
-      let data = {
-        databaseName: this.databaseName,
-        databaseType: this.databaseType,
-        tableName: value,
-      };
-      try {
-        let res = await getListName(data);
-        if (tempData) {
-          console.log(res, 456);
-          tempData.fieldOptions = res;
-        } else {
-          console.log(res, 4567);
-          this.fieldList = res;
-        }
-      } catch (error) {
-        this.$message.error("网络异常,请稍后再试");
-      }
-    },
+    
   },
   computed: {
     ...mapState({
@@ -822,7 +818,7 @@ export default {
 ::v-deep .el-dialog {
   top: 0 !important;
 }
-.notecardstyle {
+.queryListstyle {
   width: 100%;
   position: absolute;
   left: 0;

+ 13 - 9
zkqy-ui/src/views/asEditor/layout/home/pageDesign.vue

@@ -538,14 +538,16 @@ export default {
         payload.mobilePageTableList.extensions = JSON.stringify(this.extensions)
       }
       try {
+        let temp='保存'
         if (this.isEdit) {
           payload.id = this.$route.query.id;
+          temp='修改'
         }
         let reqApi = this.isEdit ? updatemobilePageData : addmobilePageData;
         let res = await reqApi(payload);
         console.log(res);
         if (res.code == 200) {
-          this.$message.success("保存成功");
+          this.$message.success(`${temp}成功`);
           this.$tab.closePage();
           this.$router.push({
             path: "/ydyq/h5Editor",
@@ -553,22 +555,23 @@ export default {
         } else {
           this.$message.error(res.msg);
         }
+        // if (this.isEdit) {
+        //   console.log("isEdit", this.isEdit);
+        //   // 修改
+        //   this.updateJSONData();
+        // } else {
+        //   //新增
+        //   this.addJSONData();
+        // }
       } catch (error) {
         this.$message.error(error);
       }
       return;
-      if (this.isEdit) {
-        // console.log(this.isEdit);
-        // 修改
-        this.updateJSONData();
-      } else {
-        //新增
-        this.addJSONData();
-      }
     },
 
     // 添加JSON数据
     addJSONData() {
+      console.log("新增了~~~~~~~~");
       let JSONData = this.getJSONData();
       console.log(JSONData, 898989);
       this.selectFormData.name = JSONData.name;
@@ -598,6 +601,7 @@ export default {
 
     // 修改JSON数据
     updateJSONData() {
+      console.log("修改了~~~~~~~~");
       let updatePayload = this.getJSONData();
       console.log(updatePayload);
       updatemobilePageData(updatePayload).then((response) => {