Kaynağa Gözat

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

lph 1 yıl önce
ebeveyn
işleme
7b605cff04

+ 12 - 1
zkqy-ui/src/views/asEditor/components/componentscom/investigate/index.vue

@@ -59,7 +59,6 @@
       </van-field>
 
       <!-- 复选框 -->
-
       <van-field
         name="checkboxGroup"
         :label="item1.name"
@@ -77,6 +76,18 @@
           </van-checkbox-group>
         </template>
       </van-field>
+
+      <!-- 时间选择器 -->
+      <div v-if="item1.type == 4 && item1.dataValue ">
+        <van-cell-group>
+          <van-field
+            :label="item1.name"
+            :placeholder="item1.value"
+            :value="item1.dataValue"
+            :readonly="true"
+          />
+        </van-cell-group>
+      </div>
     </div>
     <div class="button">
       <button>提交</button>

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

@@ -88,6 +88,18 @@
           ></el-option>
         </el-select>
 
+        <!-- 时间选择器 -->
+        <template v-if="showTimePicker && item.type == 4">
+          <div class="block">
+            <span class="demonstration">请选择时间</span>
+            <el-date-picker
+              v-model="item.dataValue"
+              type="datetime"
+              placeholder="选择日期时间">
+            </el-date-picker>
+          </div>
+        </template>
+        
         <!-- 动态显示按钮 -->
         <div v-if="item.type == 1">
           <!-- <el-button @click="onClickStatic">静态数据</el-button>
@@ -221,6 +233,8 @@ export default {
   },
   data() {
     return {
+      dataValue: "", 
+      showTimePicker: false,  // 控制时间选择器是否显示  
       lieData: "",
       zisShow: false,
       isShow: false,
@@ -259,7 +273,7 @@ export default {
           jsonData: [],
         },
       },
-      selecttext: ["文本", "下拉框", "单选", "多选"],
+      selecttext: ["文本", "下拉框", "单选", "多选", "时间选择器"],
       showButtons: false, // 控制按钮是否显示
       showStaticInput: false, // 控制静态数据输入框显示
       showDynamicInput: false, // 控制动态数据输入框显示
@@ -375,6 +389,7 @@ export default {
     },
     conChange(index) {
       this.showButtons = this.selecttext[index] === "下拉框";
+      this.showTimePicker = this.selecttext[index] === "时间选择器";
       console.log(this.selecttext[index], 888);
       console.log(this.showButtons, 999);
       // 当切换选项时重置输入框显示状态
@@ -438,6 +453,12 @@ export default {
 
     //添加文本
     addText() {
+      // 获取当前选中的tableName
+      const currentTableName = this.datas.tableName;
+      console.log(currentTableName);
+      // 调用接口获取字段列表
+      this.getFieldOptions(currentTableName);
+
       console.log(this.datas);
       if (!this.datas.tableName) {
         this.$message.error("请先选择数据库表");
@@ -449,6 +470,7 @@ export default {
         fieldKey: uuid(8),
         name: "",
         type: "",
+        dataValue: "",
         value: "",
         value1: [],
         value2: "",

+ 44 - 48
zkqy-ui/src/views/asEditor/components/rightslider/notecardstyle/index.vue

@@ -5,9 +5,7 @@
 
     <el-form label-width="80px" :model="datas" size="small">
       <!-- 选择表单 -->
-      <el-form-item  
-        label="数据库表" 
-        prop="tableName">
+      <el-form-item label="数据库表" prop="tableName">
         <el-select
           v-model="datas.tableName"
           placeholder="请选择"
@@ -38,30 +36,30 @@
 
       <el-form-item label="控件字段">
         <el-select
-        v-model="datas.fieldName"
-        placeholder="请选择控件字段"
-        @change="changeModel"
-      >
-        <el-option
-          v-for="i in fieldList"
-          :key="i.fieldName"
-          :label="i.fieldName"
-          :value="i.fieldName"
+          v-model="datas.fieldName"
+          placeholder="请选择控件字段"
+          @change="changeModel"
         >
-          <span style="float: left">{{ i.fieldName }}</span>
-          <span style="float: right; color: #8492a6; font-size: 13px">{{
-            i.fieldDescription
-          }}</span>
-        </el-option>
-      </el-select>
+          <el-option
+            v-for="i in fieldList"
+            :key="i.fieldName"
+            :label="i.fieldName"
+            :value="i.fieldName"
+          >
+            <span style="float: left">{{ i.fieldName }}</span>
+            <span style="float: right; color: #8492a6; font-size: 13px">{{
+              i.fieldDescription
+            }}</span>
+          </el-option>
+        </el-select>
       </el-form-item>
 
       <div style="height: 20px" />
 
-       <!-- 框体样式 -->
-       <el-form-item class="lef" label="框体样式">
+      <!-- 框体样式 -->
+      <el-form-item class="lef" label="框体样式">
         <div class="weiz">
-          <span>{{ datas.borderRadius1 === 0 ? '方形' : '圆形' }}</span>
+          <span>{{ datas.borderRadius1 === 0 ? "方形" : "圆形" }}</span>
           <div>
             <el-tooltip
               effect="dark"
@@ -88,7 +86,7 @@
       <!-- 文本位置 -->
       <el-form-item class="lef" label="文本位置">
         <div class="weiz">
-          <span>{{ datas.textPosition === 0 ? '居左' : '居中' }}</span>
+          <span>{{ datas.textPosition === 0 ? "居左" : "居中" }}</span>
           <div>
             <el-tooltip
               effect="dark"
@@ -170,7 +168,6 @@
 
       <div style="height: 10px" v-if="datas.commodityType === 0" />
       <div class="bor" />
-
     </el-form>
 
     <!-- 上传图片 -->
@@ -179,19 +176,19 @@
 
 <script>
 import { mapState } from "vuex";
-import vuedraggable from 'vuedraggable' //拖拽组件
+import vuedraggable from "vuedraggable"; //拖拽组件
 import { getFormName, getListName } from "@/api/dragform/form.js";
 
 export default {
-  name: 'notecardstyle',
+  name: "notecardstyle",
   props: {
     datas: Object,
   },
-  components: { vuedraggable, },
+  components: { vuedraggable },
   data() {
     let kon = (rule, value, callback) => {
-      if (value.length === 0) callback(new Error('请输入有效数字'))
-    }
+      if (value.length === 0) callback(new Error("请输入有效数字"));
+    };
     return {
       tableList: [],
       fieldList: [],
@@ -199,47 +196,47 @@ export default {
       moditystyles: [
         /* 卡片样式 */
         {
-          text: '无边白底',
+          text: "无边白底",
           type: 0,
         },
         {
-          text: '卡片投影',
+          text: "卡片投影",
           type: 1,
         },
         {
-          text: '描边白底',
+          text: "描边白底",
           type: 2,
         },
         {
-          text: '无边透明底',
+          text: "无边透明底",
           type: 3,
         },
       ],
       commodityTypes: [
         {
-          icon: 'icon-datumoshi',
+          icon: "icon-datumoshi",
           type: 0,
-          content: '详细模式',
+          content: "详细模式",
         },
         {
-          icon: 'icon-commodity-yihangliangge',
+          icon: "icon-commodity-yihangliangge",
           type: 1,
-          content: '一行两个',
+          content: "一行两个",
         },
         {
-          icon: 'icon-xuanzemokuai-daohanghengxianghuadong',
+          icon: "icon-xuanzemokuai-daohanghengxianghuadong",
           type: 2,
-          content: '横向滑动',
+          content: "横向滑动",
         },
       ],
-    }
+    };
   },
   created() {
     this.getAllTable();
   },
   methods: {
-     // 列名变化回调
-     changeModel() {
+    // 列名变化回调
+    changeModel() {
       console.log("列", this.datas);
       // this.lieData = this.datas.jsonData[0].fieldName;
     },
@@ -278,12 +275,12 @@ export default {
       databaseType: (state) => state.user.dataSource.databaseType,
     }),
     styleText() {
-      if (this.datas.commodityType === 0) return '详细列表'
-      if (this.datas.commodityType === 1) return '一行两个'
-      if (this.datas.commodityType === 2) return '横向滑动'
+      if (this.datas.commodityType === 0) return "详细列表";
+      if (this.datas.commodityType === 1) return "一行两个";
+      if (this.datas.commodityType === 2) return "横向滑动";
     },
   },
-}
+};
 </script>
 
 <style scoped lang="scss">
@@ -304,8 +301,8 @@ export default {
     font-weight: 600;
     color: #323233;
   }
-   /* 图片样式 */
-   .weiz {
+  /* 图片样式 */
+  .weiz {
     display: flex;
     justify-content: space-between;
     i {
@@ -386,6 +383,5 @@ export default {
       }
     }
   }
-
 }
 </style>

+ 137 - 32
zkqy-ui/src/views/asEditor/components/rightslider/queryListStyle/index.vue

@@ -6,17 +6,72 @@
     <el-form label-width="80px" :model="datas" size="small">
       <!-- 选择表单 -->
       <el-form-item class="lef" label="" prop="tableName">
+        <!-- 选择表单 -->
+        <el-form-item label="数据库表" prop="tableName">
+          <el-select
+            v-model="datas.tableName"
+            placeholder="请选择"
+            style="width: 87%"
+            @change="
+              (value) => {
+                getFieldOptions1(value);
+              }
+            "
+          >
+            <el-option
+              v-for="item in tableList"
+              :key="item.tableName"
+              :label="item.tableComment"
+              :value="item.tableName"
+            >
+              <span class="discribe" style="float: left">{{
+                item.tableComment
+              }}</span>
+              <span style="float: right; color: #8492a6; font-size: 13px">{{
+                item.tableName
+              }}</span>
+            </el-option>
+          </el-select>
+        </el-form-item>
+
+        <div style="height: 20px" />
+
+        <el-form-item label="控件字段">
+          <el-select
+            v-model="datas.fieldName"
+            placeholder="请选择控件字段"
+            style="width: 87%"
+            @change="changeModel"
+          >
+            <el-option
+              v-for="i in fieldList"
+              :key="i.fieldName"
+              :label="i.fieldName"
+              :value="i.fieldName"
+            >
+              <span style="float: left">{{ i.fieldName }}</span>
+              <span style="float: right; color: #8492a6; font-size: 13px">{{
+                i.fieldDescription
+              }}</span>
+            </el-option>
+          </el-select>
+        </el-form-item>
+
+        <div style="height: 20px" />
         <el-radio-group v-model="listQueryData.isSingleTable">
           <el-radio :label="0">单表</el-radio>
           <el-radio :label="1">多表</el-radio>
         </el-radio-group>
       </el-form-item>
-      <el-button type="primary" size="mini" @click="editQueryHandler"
+      <el-button
+        type="primary"
+        @click="editQueryHandler"
+        style="margin-left: 80px"
         >编辑查询条件</el-button
       >
-
       <div style="height: 20px" />
     </el-form>
+
     <el-dialog
       title="查询条件"
       style="top: 0"
@@ -329,7 +384,7 @@ import { camelCase } from "@/utils/index.js";
 import Data from "@/views/system/dict/data.vue";
 
 export default {
-  name: "notecardstyle",
+  name: "queryListstyle",
   dicts: ["sys_time_format"],
   props: {
     datas: Object,
@@ -340,6 +395,9 @@ export default {
       if (value.length === 0) callback(new Error("请输入有效数字"));
     };
     return {
+      tableQueryConditions: [],
+      tableList: [],
+      fieldList: [],
       currentRow: {}, //当前正在编辑的列
       columnAttibute: {
         isDateColumn: false,
@@ -354,7 +412,7 @@ export default {
 
         mainForm: {
           mainTableName: "",
-          table_name_des: "",
+          tableNameDes: "",
           tablePrimaryKey: "",
           sortFieldName: "",
           sortType: "",
@@ -456,6 +514,19 @@ export default {
     },
   },
   methods: {
+    // 列名变化回调
+    changeModel() {
+      console.log("列", this.datas);
+      let newObject = { }
+      // newObject.fieldName = `${this.datas.tableName}.${this.datas.fieldName}`;
+      // newObject.value = "#{x}";   
+      // newObject.operator = "=";
+      // newObject.type = "1";
+      // console.log(newObject);
+      // this.tableQueryConditions.push(newObject);
+      // console.log(this.tableQueryConditions);
+      // this.lieData = this.datas.jsonData[0].fieldName;
+    },
     changeType(row) {
       row.value = "#{userID}";
     },
@@ -477,7 +548,7 @@ export default {
         fieldDescription: "",
         value: "",
         operator: "=",
-        type: 0,
+        type: "0",
       });
     },
     // 保存字段配置回调
@@ -527,7 +598,7 @@ export default {
     async mainTableChangeHandler(val) {
       if (val) {
         this.mainTableFieldOptions = await this.getFieldOptions(val);
-        this.listQueryData.mainForm.table_name_des = this.tableList.find(
+        this.listQueryData.mainForm.tableNameDes = this.tableList.find(
           (item) => {
             return item.tableName == val;
           }
@@ -543,70 +614,85 @@ export default {
     },
     confirmHandler() {
       let res = {};
-      let { mainTableName, table_name_des, tablePrimaryKey, sortFieldName } =
+      let { mainTableName, tableNameDes, tablePrimaryKey, sortFieldName } =
         this.listQueryData.mainForm;
-      res.table_name_des = table_name_des;
+      let tableNameDesString = JSON.stringify(tableNameDes);
+      res.tableNameDes = tableNameDesString;
       res.isSingleTable = this.listQueryData.isSingleTable;
       // 表数据  目前单表
-      res.table_names = [
+      let tableNames = [
         {
           tableName: mainTableName,
-          asName: mainTableName,
+          tableAsName: mainTableName,
           isMain: true,
         },
       ];
+      let tableNamesSteing = JSON.stringify(tableNames);
+      res.tableNames = tableNamesSteing;
       // 展示描述
-      res.table_column_name = [];
-      res.table_column_desc = [];
+      res.tableColumnName = [];
+      res.tableColumnDesc = [];
       this.mainTableData.forEach((item, index) => {
         let nameItem = {},
           descItem = {};
         let { tableName, fieldName, fieldDescription, columnAttibute } = item;
+        const columnAttributeString = JSON.stringify({
+          isDateColumn: columnAttibute?.isDateColumn
+            ? columnAttibute?.isDateColumn
+            : false,
+          dateFormat: columnAttibute?.dateFormat
+            ? columnAttibute?.dateFormat
+            : "",
+          isShow: columnAttibute?.isShow ? columnAttibute?.isShow : false,
+        });
         nameItem = {
           tbname: tableName,
           fieldName: fieldName,
           fieldAsName: camelCase(tableName + "_" + fieldName),
           field_des: fieldDescription,
-          column_attribute: {
-            isDateColumn: columnAttibute?.isDateColumn
-              ? columnAttibute?.isDateColumn
-              : false,
-            dateFormat: columnAttibute?.dateFormat
-              ? columnAttibute?.dateFormat
-              : "",
-            isShow: columnAttibute?.isShow ? columnAttibute?.isShow : false,
-          },
+          column_attribute: columnAttributeString,
         };
         descItem = {
           column: camelCase(tableName + "_" + fieldName),
           columnDes: fieldDescription,
           columnSort: index + 1,
         };
-        res.table_column_name.push(nameItem);
-        res.table_column_desc.push(descItem);
+        res.tableColumnName.push(nameItem);
+        res.tableColumnDesc.push(descItem);
       });
       // 查询条件
-      res.table_query_condition = this.queryContionTableData.map((item) => {
+      let queryData = {}
+      this.queryContionTableData.map((item) => {
         let { fieldName, tableName, value, operator, type } = item;
-        return {
-          fieldName: tableName + "." + fieldName,
-          value,
-          operator,
-          type,
-        };
+        // let queryData = {}
+        queryData.fieldName = tableName + "." + fieldName;
+        queryData.value = value;
+        queryData.operator = operator;
+        queryData.type = type;
+        
       });
+      this.tableQueryConditions.push(queryData)
+      console.log(this.tableQueryConditions);
+      let tableQueryConditionsString = JSON.stringify(this.tableQueryConditions);
+      res.tableQueryConditions = tableQueryConditionsString;
       // 排序
-      res.tablelistSort = {
+      let tablelistSort = {
         DataSort:
           this.listQueryData.mainForm.mainTableName +
           "." +
           this.listQueryData.mainForm.sortFieldName,
         DataSortType: this.listQueryData.mainForm.sortType,
       };
+      let tablelistSortString = JSON.stringify(tablelistSort);
+      res.tablelistSort = tablelistSortString;
+      res.listMapValue = {};
+      const key = this.datas.componentKey;
+      res.listMapValue[key] = this.listQueryData.mainForm.mainTableName;
       console.log(res);
       this.datas.jsonData.listData = res;
+      this.$emit("data-list", this.datas.jsonData.listData);
       console.log(this.datas);
-      // this.editOpen = false;
+      this.editOpen = false;
     },
     async getAllTable() {
       let data = {
@@ -630,6 +716,25 @@ 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({

+ 14 - 4
zkqy-ui/src/views/asEditor/layout/home/index.vue

@@ -189,11 +189,13 @@ import {
   delmobilePageData,
   setAsHomePage,
 } from "@/api/asEditor/index.js";
+import { getFormName, getListName } from "@/api/dragform/form.js";
 
 export default {
   name: "Data",
   data() {
     return {
+      tableList : [],
       // 是否为首页
       isIndex: true,
       // 遮罩层
@@ -242,7 +244,7 @@ export default {
   },
   methods: {
     formatIndexType(row) {
-      console.log(row.isIndex);
+      // console.log(row.isIndex);
       if(row.isIndex == 'true'){
         return "首页";
       } else {
@@ -311,12 +313,20 @@ export default {
       // this.open = true;
       // this.title = "添加移动端数据";
       this.isIndex = false;
-      console.log(this.isIndex);
+      // console.log(this.isIndex);
       this.$router.push({
         path: "/pageDesign",
       });
     },
-
+    async getAllTable() {
+      let data = {
+        databaseName: this.databaseName,
+        databaseType: this.databaseType,
+      };
+      let res = await getFormName(data);
+      console.log(res.data, 123);
+      this.tableList = res.data;
+    },
     /** 修改按钮操作 */
     handleUpdate(row) {
       let { id } = row;
@@ -324,7 +334,7 @@ export default {
         path: "/pageDesign",
         query: { id: id },
       });
-
+      
       // this.reset();
       // const id = row.id || this.ids
       // updatemobilePageData(id).then(response => {

+ 18 - 2
zkqy-ui/src/views/asEditor/layout/home/pageDesign.vue

@@ -91,6 +91,7 @@
                 @dblclick.native="toPageComponent(item, index)"
                 class="componentsClass"
                 :data-type="item.type"
+                
               >
                 <div
                   v-show="deleShow"
@@ -151,6 +152,7 @@
             :datas="currentproperties"
             @componenmanagement="componenmanagement"
             @data-from-child="handleDataFromChild"
+            @data-list="handleListData"
           />
         </transition>
         <img src="" alt="" />
@@ -302,6 +304,8 @@ export default {
   },
   data() {
     return {
+      isExistsList: false, // 是否有查询列表
+      mobilePageTableList: '', // listData数据
       selectFormData: {
         name: "",
         pageJson: "",
@@ -353,6 +357,14 @@ export default {
   },
 
   methods: {
+    handleListData(data){
+      console.log("从子组件接收到的数据:", 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
+    },
     handleDataFromChild({ selectQualifiedField, selectMapValue }) {
       let a = new Map();
       console.log(
@@ -504,13 +516,17 @@ export default {
       payload.pageJson = pageJson;
       payload.fromMapDb = this.getFromMapDb(pageJson);
       payload.selectQualifiedField = this.getSelectQualifiedField(pageJson);
-      payload.selectMapValue = this.getSelectMapValue(pageJson);
+      payload.isExistsList = this.isExistsList;
+      if(this.mobilePageTableList) {
+        payload.mobilePageTableList = this.mobilePageTableList;
+      }
       try {
         if (this.isEdit) {
           payload.id = this.$route.query.id;
         }
         let reqApi = this.isEdit ? updatemobilePageData : addmobilePageData;
         let res = await reqApi(payload);
+        console.log(res);
         if (res.code == 200) {
           this.$message.success("保存成功");
           this.$tab.closePage();
@@ -1266,7 +1282,7 @@ export default {
   .decorateTab {
     position: fixed;
     display: flex;
-    right: 388px;
+    right: 440px;
     top: 220px;
     flex-direction: column;
     span {