小宝贝 2 years ago
parent
commit
ce0507c667

+ 23 - 14
ruoyi-ui/src/components/updateModule/k-form-design/packages/components/KFormDesign/module/formItemProperties.vue

@@ -19,25 +19,35 @@
           v-if="!hideModel && isDefined(selectItem.model)"
           label="表名"
         >
-        <Select
-            :options="formList.formName"
+        <!-- <Select
             v-model="formList.tableName"
-            :allowClear="options.clearable"
-            :mode="options.multiple ? 'multiple' : ''"
+            :fieldNames="{
+              'label': tableComment, 'value': tableName
+            }"
             @change="getFormList"
-          />
+            mode="tags"
+          /> -->
+          <el-select v-model="formList.tableName" placeholder="请选择" @change="getListName">
+            <el-option
+              v-for="item in formList.formName"
+              :key="item.tableName"
+              :label="item.tableComment"
+              :value="item.tableName">
+            </el-option>
+          </el-select>
         </a-form-item>
         <a-form-item
           v-if="!hideModel && isDefined(selectItem.model)"
           label="列名"
         >
-          <Input v-model="selectItem.model" placeholder="请输入" />
-          <Select
-            :options="formList.ListName"
-            v-model="selectItem.model"
-            :allowClear="options.clearable"
-            :mode="options.multiple ? 'multiple' : ''"
-          />
+          <el-select v-model="selectItem.model" placeholder="请选择">
+            <el-option
+              v-for="item in formList.listName"
+              :key="item.fieldName"
+              :label="item.fieldName"
+              :value="item.fieldName">
+            </el-option>
+          </el-select>
         </a-form-item>
        
         
@@ -699,9 +709,8 @@ export default {
         ... this.$store.state.user.dataSource,
         'tableName':this.formList.tableName
       }
-      
       getListName(par2).then(res=>{
-        this.formList.listName = res.data
+        this.formList.listName = res;
       })
     }
   },

+ 2 - 1
ruoyi-ui/src/router/index.js

@@ -147,7 +147,7 @@ export const dynamicRoutes = [
         meta: { title: '表单建模', activeMenu: '/system/fromModel/index' }
       },
       // {
-      //   path: 'fromModel/:index',
+      //   path: '/fromModel/:index',
       //   component: () => import('@/views/system/fromModel/formBuild'),
       //   name: 'fromModel',
       //   meta: { title: '表单建模', activeMenu: '/system/fromModel/formBuild' }
@@ -222,6 +222,7 @@ Router.prototype.push = function push(location) {
 }
 // replace
 Router.prototype.replace = function push(location) {
+  console.log(location)
   return routerReplace.call(this, location).catch(err => err)
 }
 

+ 5 - 2
ruoyi-ui/src/views/dragform/index.vue

@@ -232,7 +232,7 @@ v-hasPermi="['dragform:form:export']"
             >修改
           </el-button>
           <!--  v-hasPermi="['dragform:form:edit']"
-            v-hasPermi="['dragform:form:remove']"
+            
 
           -->
           <el-button
@@ -426,12 +426,14 @@ export default {
     },
     /** 新增按钮操作 */
     handleAdd() {
+      sessionStorage.removeItem('fid')
       this.$router.push("system/fromModel/index");
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
       const fId = row.fId || this.ids;
-      this.$router.push({ name: "fromModel", params: { id: fId } });
+      sessionStorage.setItem('fid',fId);
+      this.$router.replace("system/fromModel/index");
     },
     /** 提交按钮 */
     submitForm() {
@@ -482,3 +484,4 @@ export default {
 };
 </script>
 
+

+ 2 - 1
ruoyi-ui/src/views/system/fromModel/index.vue

@@ -63,6 +63,7 @@ let codeHtmlFront = `<!DOCTYPE html>
 
 </html>`
 import { addForm ,getForm,updateForm} from "@/api/dragform/form";
+
 export default {
   name:'fromModel',
   data() {
@@ -105,7 +106,7 @@ export default {
 
   },
   mounted() {
-    const fid = this.$route.params.id;
+    const fid = sessionStorage.getItem('fid');
 
     if(!fid)return;
     this.fid = fid;