Explorar o código

Merge branch 'master' of http://62.234.61.92:3000/wjm/mec-cloud_IntelligentManufacturing_CRM

lph hai 1 ano
pai
achega
58e1ed88f2

+ 2 - 2
zkqy-ui/src/views/asEditor/components/formDesign/selectEdit.vue

@@ -436,7 +436,7 @@ export default {
     },
     myOptions: {
       handler(nval) {
-        console.log("options", nval);
+        // console.log("options", nval);
         /*    this.btnList = [];
           this.reset();
           if (nval.sqlData && nval.sqlData.dynamicName == nval?.dynamicKey) {
@@ -668,7 +668,7 @@ export default {
     },
   },
   async mounted() {
-    console.log(this.options, this.selectItem);
+    // console.log(this.options, this.selectItem);
     // if (this.selectItem.options.sqlData) {
     //   this.btnList = this.selectItem.options.sqlData.echoDatas.map((item) => {
     //     return {

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

@@ -149,7 +149,13 @@ export default {
     }
   },
 
-  created() {},
+  mounted() {
+  
+  },
+
+  created() {
+     console.log("接收到的datas:", this.datas);
+  },
 
   methods: {
     // 显示上传图片组件   type :  2 页面背景图

+ 28 - 11
zkqy-ui/src/views/asEditor/components/rightslider/investigatestyle/index.vue

@@ -78,27 +78,29 @@
         <el-select
           v-model="item.type"
           placeholder="请选择显示格式"
-          @change="conChange"
+          @change="(index)=>{conChange(index,item)}"
         >
           <el-option
-            v-for="(item, index) in selecttext"
-            :label="item"
+            v-for="(item1, index) in selecttext"
+            :label="item1"
             :value="index"
             :key="index"
           ></el-option>
         </el-select>
 
         <!-- 时间选择器 -->
-        <template v-if="showTimePicker && item.type == 4">
+       <!--  <template v-if="item.type == 4">
           <div class="block">
             <span class="demonstration">请选择时间</span>
             <el-date-picker
               v-model="item.dataValue"
               type="datetime"
+              @change="onTimeChange"
+              value-format="yyyy/MM/dd HH:mm:ss"
               placeholder="选择日期时间">
             </el-date-picker>
           </div>
-        </template>
+        </template> -->
         
         <!-- 动态显示按钮 -->
         <div v-if="item.type == 1">
@@ -202,6 +204,13 @@
             item.type !== 0 && item.optionType === ''
           "
         ></el-input>
+        <el-input
+          type="textarea"
+          v-model="item.value"
+          placeholder="请选择时间"
+          v-if="item.type == 4"
+          :disabled="true"
+        ></el-input>
       </el-form-item>
       <el-form-item>
         <el-button @click="addText" class="uploadImg" type="primary" plain>
@@ -223,6 +232,7 @@ import { getFormName, getListName } from "@/api/dragform/form.js";
 import getOptionsSqlString from "@/utils/sqlString";
 import selectEdit from "@/views/asEditor/components/formDesign/selectEdit.vue";
 import uuid from "@/utils/bpmn/uuid";
+import moment from 'moment';
 export default {
   name: "investigatestyle",
   props: {
@@ -234,7 +244,6 @@ export default {
   data() {
     return {
       dataValue: "", 
-      showTimePicker: false,  // 控制时间选择器是否显示  
       lieData: "",
       zisShow: false,
       isShow: false,
@@ -293,11 +302,18 @@ export default {
   },
 
   created() {
+    console.log('tableName', this.datas.tableName);
+    if (this.datas.tableName) {
+      this.getFieldOptions(this.datas.tableName);
+    }
     this.getAllTable();
     // this.getFieldOptions();
   },
 
   methods: {
+    onTimeChange() {
+      console.log(this.dataValue);
+    },
     inputUpdate() {
       this.$forceUpdate();
     },
@@ -387,9 +403,12 @@ export default {
       // 当输入框内容变化时,根据输入内容的长度决定是否显示按钮
       this.shouldShowButton = event.target.value.trim().length > 0;
     },
-    conChange(index) {
+    conChange(index,item) {
       this.showButtons = this.selecttext[index] === "下拉框";
-      this.showTimePicker = this.selecttext[index] === "时间选择器";
+      if(this.selecttext[index] === "时间选择器"){
+        console.log(111);
+        item.dataValue = moment(new Date()).format('YYYY-MM-DD HH:mm:ss');
+      }
       console.log(this.selecttext[index], 888);
       console.log(this.showButtons, 999);
       // 当切换选项时重置输入框显示状态
@@ -455,11 +474,10 @@ export default {
     addText() {
       // 获取当前选中的tableName
       const currentTableName = this.datas.tableName;
-      console.log(currentTableName);
+      // console.log(currentTableName);
       // 调用接口获取字段列表
       this.getFieldOptions(currentTableName);
 
-      console.log(this.datas);
       if (!this.datas.tableName) {
         this.$message.error("请先选择数据库表");
         return;
@@ -480,7 +498,6 @@ export default {
         optionConditions: "", //动态数据
         options: { static: [] }, //静态数据
       };
-      console.log(text);
       this.datas.jsonData.push(text);
     },
     //删除文本

+ 78 - 27
zkqy-ui/src/views/asEditor/components/rightslider/queryListStyle/index.vue

@@ -270,7 +270,7 @@
             <el-select
               v-model="scope.row.type"
               value-key=""
-              placeholder=""
+              placeholder="请选择类型"
               filterable
               @change="changeType(scope.row)"
             >
@@ -291,6 +291,7 @@
               value-key=""
               placeholder=""
               filterable
+              disabled
             >
               <el-option
                 v-for="item in operatorOptions"
@@ -306,12 +307,20 @@
           <template slot-scope="scope">
             <el-input
               v-model="scope.row.value"
-              :disabled="scope.row.type == '2'"
+              :disabled="scope.row.type == '1'|| scope.row.type == '2'"
               placeholder="请输入参照值"
               size="normal"
             ></el-input>
           </template>
         </el-table-column>
+        <el-table-column label="操作">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="danger"
+              @click="delContionHandler(scope.$index, queryContionTableData)">删除</el-button>
+          </template>
+        </el-table-column>
       </el-table>
 
       <template #footer>
@@ -328,7 +337,7 @@
       :fullscreen="false"
     >
       <el-form
-        :model="columnAttibute"
+        :model="column_attribute"
         ref="columnAttibuteForm"
         :rules="columnAttibuteRules"
         label-width="100px"
@@ -336,14 +345,14 @@
         size="normal"
       >
         <el-form-item label="是否是日期">
-          <el-radio-group v-model="columnAttibute.isDateColumn">
+          <el-radio-group v-model="column_attribute.isDateColumn">
             <el-radio :label="true"> 是 </el-radio>
             <el-radio :label="false"> 否 </el-radio>
           </el-radio-group>
         </el-form-item>
         <el-form-item label="日期格式">
           <el-select
-            v-model="columnAttibute.dateFormat"
+            v-model="column_attribute.dateFormat"
             placeholder="请选择日期格式"
             filterable
           >
@@ -357,7 +366,7 @@
         </el-form-item>
         <el-form-item label="是否显示" prop="isShow">
           <el-switch
-            v-model="columnAttibute.isShow"
+            v-model="column_attribute.isShow"
             active-text="显示"
             inactive-text="隐藏"
           >
@@ -388,6 +397,7 @@ export default {
   dicts: ["sys_time_format"],
   props: {
     datas: Object,
+    echoMessage: Object 
   },
   components: { vuedraggable },
   data() {
@@ -395,11 +405,12 @@ export default {
       if (value.length === 0) callback(new Error("请输入有效数字"));
     };
     return {
+      tablelistSort: null,
       tableQueryConditions: [],
       tableList: [],
       fieldList: [],
       currentRow: {}, //当前正在编辑的列
-      columnAttibute: {
+      column_attribute: {
         isDateColumn: false,
         dateFormat: "yyyy-MM-dd",
         isShow: false,
@@ -438,10 +449,10 @@ export default {
           value: 0,
           label: "默认值",
         },
-        // {
-        //   value: 1,
-        //   label: "检索字段",
-        // },
+        {
+          value: 1,
+          label: "输入值",
+        },
         {
           value: 2,
           label: "系统值",
@@ -472,6 +483,10 @@ export default {
     };
   },
   created() {
+    console.log('tableName', this.datas.tableName);
+    if (this.datas.tableName) {
+      this.getFieldOptions1(this.datas.tableName);
+    }
     this.getAllTable();
   },
   watch: {
@@ -513,6 +528,7 @@ export default {
       immediate: true,
     },
   },
+  mounted() { },
   methods: {
     // 列名变化回调
     changeModel() {
@@ -528,7 +544,13 @@ export default {
       // this.lieData = this.datas.jsonData[0].fieldName;
     },
     changeType(row) {
-      row.value = "#{userID}";
+      if (row.type == 1) {
+        row.value = "#{x}";
+      } else if(row.type == 2){
+        row.value = "#{userID}";
+      } else {
+        row.value = "";
+      }
     },
     // 查询条件变化回调
     // changeContionField(row) {
@@ -536,6 +558,9 @@ export default {
     //     (item) => item.fieldName == row.fieldName
     //   )?.fieldDescription;
     // },
+    delContionHandler(index, row) {
+      row.splice(index, 1);
+    },
     // 添加查询条件回调
     addContionHandler() {
       if (!this.listQueryData.mainForm.mainTableName) {
@@ -548,13 +573,13 @@ export default {
         fieldDescription: "",
         value: "",
         operator: "=",
-        type: "0",
+        type: "",
       });
     },
     // 保存字段配置回调
     onSaveAttibute() {
-      this.currentRow.columnAttibute = JSON.parse(
-        JSON.stringify(this.columnAttibute)
+      this.currentRow.column_attribute = JSON.parse(
+        JSON.stringify(this.column_attribute)
       );
       console.log(this.mainTableData);
       this.$message.success("保存成功");
@@ -562,10 +587,11 @@ export default {
     },
     // 字段配置回调
     fieldEditHandler(row, index) {
-      if (Object.keys(row.columnAttibute || {}).length) {
-        this.columnAttibute = JSON.parse(JSON.stringify(row.columnAttibute));
+      console.log(row);
+      if (Object.keys(row.column_attribute || {}).length) {
+        this.column_attribute = JSON.parse(JSON.stringify(row.column_attribute));
       } else {
-        Object.assign(this.columnAttibute, {
+        Object.assign(this.column_attribute, {
           isDateColumn: false,
           dateFormat: "yyyy-MM-dd",
           isShow: false,
@@ -611,6 +637,31 @@ export default {
       this.$nextTick(() => {
         this.initDragTable();
       });
+      if(this.echoMessage) {
+        console.log("回显数据", this.echoMessage);
+        let echoMessage = this.echoMessage; 
+        // 主表
+        let tableColumnName = JSON.parse(echoMessage.tableColumnName);
+        this.listQueryData.mainForm.mainTableName = tableColumnName[0].tbname;
+        // 表格主键
+        let tablelistSort = JSON.parse(echoMessage.tablelistSort);
+        let dataSortFromEcho = tablelistSort.DataSort; // "student.id"
+        const idOnly = dataSortFromEcho.split('.').pop(); // "id"
+        this.listQueryData.mainForm.tablePrimaryKey = idOnly;
+        this.listQueryData.mainForm.sortFieldName = idOnly;
+        this.listQueryData.mainForm.sortType = tablelistSort.DataSortType;
+        // 查询条件
+        let tableQueryConditions = JSON.parse(echoMessage.tableQueryConditions);
+        this.queryContionTableData = tableQueryConditions.map(item => ({
+          ...item
+        }))
+        // 表格
+        this.mainTableData = tableColumnName.map(item => ({
+          ...item,
+          fieldDescription : item.field_des,
+          column_attribute:JSON.parse(item.column_attribute),   
+        })) 
+      }
     },
     confirmHandler() {
       let res = {};
@@ -635,15 +686,15 @@ export default {
       this.mainTableData.forEach((item, index) => {
         let nameItem = {},
           descItem = {};
-        let { tableName, fieldName, fieldDescription, columnAttibute } = item;
+        let { tableName, fieldName, fieldDescription, column_attribute } = item;
         const columnAttributeString = JSON.stringify({
-          isDateColumn: columnAttibute?.isDateColumn
-            ? columnAttibute?.isDateColumn
+          isDateColumn: column_attribute?.isDateColumn
+            ? column_attribute?.isDateColumn
             : false,
-          dateFormat: columnAttibute?.dateFormat
-            ? columnAttibute?.dateFormat
+          dateFormat: column_attribute?.dateFormat
+            ? column_attribute?.dateFormat
             : "",
-          isShow: columnAttibute?.isShow ? columnAttibute?.isShow : false,
+          isShow: column_attribute?.isShow ? column_attribute?.isShow : false,
         });
         nameItem = {
           tbname: tableName,
@@ -668,7 +719,7 @@ export default {
         queryData.fieldName = tableName + "." + fieldName;
         queryData.value = value;
         queryData.operator = operator;
-        queryData.type = type;
+        queryData.type = String(type);
         
       });
       this.tableQueryConditions.push(queryData)
@@ -676,14 +727,14 @@ export default {
       let tableQueryConditionsString = JSON.stringify(this.tableQueryConditions);
       res.tableQueryConditions = tableQueryConditionsString;
       // 排序
-      let tablelistSort = {
+      this.tablelistSort = {
         DataSort:
           this.listQueryData.mainForm.mainTableName +
           "." +
           this.listQueryData.mainForm.sortFieldName,
         DataSortType: this.listQueryData.mainForm.sortType,
       };
-      let tablelistSortString = JSON.stringify(tablelistSort);
+      let tablelistSortString = JSON.stringify(this.tablelistSort);
       res.tablelistSort = tablelistSortString;
       res.listMapValue = {};
       const key = this.datas.componentKey;

+ 6 - 1
zkqy-ui/src/views/asEditor/layout/home/index.vue

@@ -238,7 +238,12 @@ export default {
         : `${jsonStr.substring(0, maxLength)}...`;
     },
   },
-
+  // computed: {
+  //   ...mapState({
+  //     databaseName: (state) => state.user.dataSource.databaseName,
+  //     databaseType: (state) => state.user.dataSource.databaseType,
+  //   }),
+  // },
   created() {
     this.getList();
   },

+ 23 - 6
zkqy-ui/src/views/asEditor/layout/home/pageDesign.vue

@@ -91,7 +91,6 @@
                 @dblclick.native="toPageComponent(item, index)"
                 class="componentsClass"
                 :data-type="item.type"
-                
               >
                 <div
                   v-show="deleShow"
@@ -153,6 +152,7 @@
             @componenmanagement="componenmanagement"
             @data-from-child="handleDataFromChild"
             @data-list="handleListData"
+            :echoMessage="echoMessage"
           />
         </transition>
         <img src="" alt="" />
@@ -304,6 +304,8 @@ export default {
   },
   data() {
     return {
+      echoMessage: null,
+      extensions: [],
       isExistsList: false, // 是否有查询列表
       mobilePageTableList: '', // listData数据
       selectFormData: {
@@ -346,8 +348,9 @@ export default {
   },
 
   mounted() {
-    this.pageSetup.name = "页面标题";
-    this.currentproperties = this.pageSetup;
+    // this.pageSetup.name = "页面标题";
+    // this.currentproperties = this.pageSetup;
+    // console.log(this.currentproperties);
     // console.log(this.$route.query.id);
 
     if (this.$route.query.id) {
@@ -355,15 +358,22 @@ export default {
       this.initPageData(this.$route.query.id);
     }
   },
-
   methods: {
     handleListData(data){
-      console.log("从组件接收到的数据:", data);
+      console.log("从queryList组件接收到的数据:", data);
       data.tableColumnDesc = JSON.stringify(data.tableColumnDesc);
       data.tableColumnName = JSON.stringify(data.tableColumnName);
       data.listMapValue = JSON.stringify(data.listMapValue);
       this.mobilePageTableList = data
       this.isExistsList = true
+      this.extensions = {
+        tablelistSort: data.tablelistSort,
+        listMapValue: data.listMapValue,
+        tableColumnDesc: data.tableColumnDesc,
+        tableColumnName: data.tableColumnName,
+        tableQueryConditions: data.tableQueryConditions,
+      };
+      console.log(this.extensions);
     },
     handleDataFromChild({ selectQualifiedField, selectMapValue }) {
       let a = new Map();
@@ -421,6 +431,12 @@ export default {
           );
           this.pageComponents = pageComponents;
           this.pageSetup = pageSetup;
+          this.currentproperties = this.pageSetup;
+          if (response.data.mobilePageTableList) {
+            let echoMessage = JSON.parse(response.data.mobilePageTableList.extensions);
+            // console.log(echoMessage, 666666);
+            this.echoMessage = echoMessage;
+          }
         } else {
           this.$message.error("获取数据失败");
         }
@@ -519,6 +535,7 @@ export default {
       payload.isExistsList = this.isExistsList;
       if(this.mobilePageTableList) {
         payload.mobilePageTableList = this.mobilePageTableList;
+        payload.mobilePageTableList.extensions = JSON.stringify(this.extensions)
       }
       try {
         if (this.isEdit) {
@@ -1282,7 +1299,7 @@ export default {
   .decorateTab {
     position: fixed;
     display: flex;
-    right: 440px;
+    right: 27%;
     top: 220px;
     flex-direction: column;
     span {