wenjie преди 3 години
родител
ревизия
c60b62d1a8

+ 2 - 3
designer/src/components/Container.vue

@@ -192,7 +192,6 @@ export default {
     WidgetConfig,
     FormConfig,
     WidgetForm,
-    // ToltalScore,
     CusDialog,
     GenerateForm
   },
@@ -219,7 +218,7 @@ export default {
     },
     basicFields: {
       type: Array,
-      default: () => ['input', 'textarea', 'number', 'radio', 'checkbox', 'time', 'date', 'rate', 'color', 'select', 'switch', 'slider', 'text']
+      default: () => ['input', 'textarea', 'number', 'radio', 'checkbox', 'time', 'date', 'rate', 'color', 'select', 'switch', 'slider', 'text','divider']
     },
     advanceFields: {
       type: Array,
@@ -227,7 +226,7 @@ export default {
     },
     layoutFields: {
       type: Array,
-      default: () => ['grid']
+      default: () => ['grid','tabs']
     }
   },
   data () {

+ 24 - 0
designer/src/components/GenerateFormItem.vue

@@ -72,6 +72,17 @@
       </el-radio-group>
     </template>
 
+    <!-- tabs -->
+    <template v-if="widget.type == 'tabs'">
+      <el-tabs v-model="dataModel"
+        :disabled="widget.options.disabled"
+      >
+        <el-tab-pane :label="widget.label"></el-tab-pane>
+        <el-tab-pane label="用户管理" name="first">用户管理 1</el-tab-pane>
+        <el-tab-pane label="用户管理" name="s">用户管理 2</el-tab-pane>
+      </el-tabs>
+    </template>
+
     <template v-if="widget.type == 'checkbox'">
       <el-checkbox-group v-model="dataModel"
         :style="{width: widget.options.width}"
@@ -96,6 +107,7 @@
         :end-placeholder="widget.options.endPlaceholder"
         :readonly="widget.options.readonly"
         :disabled="widget.options.disabled"
+        :hideLabel="widget.options.hideLabel"
         :editable="widget.options.editable"
         :clearable="widget.options.clearable"
         :arrowControl="widget.options.arrowControl"
@@ -222,6 +234,18 @@
     <template v-if="widget.type == 'totalScore'">
       <span>{{dataModel}}</span>
     </template>
+
+    <template v-if="widget.type == 'divider'">
+      <el-divider
+        v-model="dataModel"
+        :disabled="widget.options.disabled"
+        :hidden="widget.options.hidden"
+        :placeholder="widget.options.placeholder"
+      >
+
+      </el-divider>
+    </template>
+    
   </el-form-item>
 </template>
 

+ 0 - 48
designer/src/components/TotalScore.vue

@@ -1,48 +0,0 @@
-<template>
-  <div class="total-score">
-    <span>
-      宽:<el-input v-model="dataModel.width" style="width: 200px;"></el-input>
-    </span>
-    <span>
-      高:<el-input v-model="dataModel.height" style="width: 200px;"></el-input>
-    </span>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'total-score',
-  props: {
-    value: {
-      type: Object,
-      default: () => ({})
-    }
-  },
-  data() {
-    return {
-      dataModel: this.value
-    }
-  },
-  watch: {
-    value (val) {
-      this.dataModel = val
-    },
-    dataModel (val) {
-      this.$emit('input', val)
-    }
-  }
-}
-</script>
-
-<style lang="scss">
-.total-score{
-  background: #eee;
-  padding: 10px;
-
-  span{
-    +span{
-      margin-left: 10px;
-    }
-  }
-}
-</style>

+ 47 - 12
designer/src/components/WidgetConfig.vue

@@ -34,15 +34,16 @@
         </el-radio-group>
       </el-form-item>
       <!-- 分数汇总 scoreTo -->
-      <el-form-item :label="$t('计分到')" v-if="Object.keys(data.options).indexOf('scoreTo')>=0">
+      <el-form-item :label="$t('fm.config.widget.scoreTo')" v-if="Object.keys(data.options).indexOf('scoreTo')>=0">
         <el-input v-model="data.options.scoreTo"></el-input>
       </el-form-item>
-      <!-- 分数汇总 totalScore -->
-      <el-form-item :label="$t('总分')" v-if="Object.keys(data.options).indexOf('score')>=0">
-        <el-input v-model="this.data.totalScore"></el-input>
-      </el-form-item>
 
-      <!-- 设置是否显示标签 -->
+      <!-- tabs  -->
+      <!-- <el-form-item :label="$t('fm.config.widget.tabs')" v-if="Object.keys(data).indexOf('tabs')>=0">
+        <el-input v-model="this.data.tabs.name"></el-input>
+      </el-form-item> -->
+
+      <!-- 设置是否显示输入框 -->
       <el-form-item :label="$t('fm.config.widget.showInput')" v-if="Object.keys(data.options).indexOf('showInput')>=0">
         <el-switch v-model="data.options.showInput" ></el-switch>
       </el-form-item>
@@ -54,7 +55,7 @@
       <el-form-item :label="$t('fm.config.widget.max')" v-if="Object.keys(data.options).indexOf('max')>=0">
         <el-input-number v-model="data.options.max" :min="0" :max="100" :step="1"></el-input-number>
       </el-form-item>
-      <!-- 设置计数器的步长值 -->
+      <!-- 设置计数器的步长值 -->
       <el-form-item :label="$t('fm.config.widget.step')" v-if="Object.keys(data.options).indexOf('step')>=0">
         <el-input-number v-model="data.options.step" :min="0" :max="100" :step="1"></el-input-number>
       </el-form-item>
@@ -67,6 +68,14 @@
         <el-switch v-model="data.options.filterable"></el-switch>
       </el-form-item>
 
+      <!-- 隐藏标签 -->
+      <el-form-item :label="$t('fm.config.widget.hideLabel')" >
+        <el-switch
+          v-model="data.options.hideLabel"
+        >
+        </el-switch>
+      </el-form-item>
+
       <el-form-item :label="$t('fm.config.widget.allowHalf')" v-if="Object.keys(data.options).indexOf('allowHalf')>=0">
         <el-switch
             v-model="data.options.allowHalf"
@@ -119,7 +128,7 @@
                   >
                     <el-input :style="{'width': data.options.showLabel? '60px': '180px' }" size="mini" v-model="item.value"></el-input>
                     <el-input style="width:60px;" size="mini" v-if="data.options.showLabel" v-model="item.label"></el-input>
-                    <el-input style="width:60px;" size="mini"  v-model="item.score"></el-input>
+                    <el-input style="width:60px;" size="mini" v-if="data.type=='scoreRadio'"  v-model="item.score"></el-input>
                     <!-- <input v-model="item.value"/> -->
                   </el-radio>
                   <i class="drag-item" style="font-size: 16px;margin: 0 5px;cursor: move;"><i class="iconfont icon-icon_bars"></i></i>
@@ -130,7 +139,7 @@
             </el-radio-group>
           </template>
 
-        
+                
           
 
           <template v-if="data.type=='checkbox' || (data.type=='select' && data.options.multiple)">
@@ -214,6 +223,7 @@
           >
           </el-switch>
         </el-form-item>
+        
         <el-form-item :label="$t('fm.config.widget.isTimestamp')" v-if="data.type == 'date'">
           <el-switch
             v-model="data.options.timestamp"
@@ -325,6 +335,27 @@
           </el-select>
         </el-form-item>
       </template>
+
+      <!-- tabs -->
+      <template v-if=" data.type == 'tabs'">
+        <el-form-item :label="$t('fm.config.widget.tabs')">
+          <draggable tag="ul" :list="data.tabs" 
+            v-bind="{group:{ name:'options'}, ghostClass: 'ghost',handle: '.drag-item'}"
+            handle=".drag-item"
+          >
+            <li v-for="(item, index) in data.tabs" :key="index" >
+              <i class="drag-item" style="font-size: 16px;margin: 0 5px;cursor: move;"><i class="iconfont icon-icon_bars"></i></i>
+              <el-input :placeholder="$t('fm.config.widget.label')" size="mini" style="width: 100px;" ></el-input>
+              
+              <el-button @click="handleOptionsRemove(index)" circle plain type="danger" size="mini" icon="el-icon-minus" style="padding: 4px;margin-left: 5px;"></el-button>
+              
+            </li>
+          </draggable>
+          <div style="margin-left: 22px;">
+            <el-button type="text" @click="handleAddColumn">{{$t('fm.actions.addTab')}}</el-button>
+          </div>
+        </el-form-item>
+      </template>
       
 
       <template v-if="data.type != 'grid'">
@@ -382,9 +413,6 @@ export default {
     }
   },
   computed: {
-    computed_score(){
-      console.log("data.options.scoreTo",this.data.totalScore)
-    },
     show () {
       if (this.data && Object.keys(this.data).length > 0) {
         console.log("data.options.scoreTo",this.data.totalScore)
@@ -422,6 +450,13 @@ export default {
         list: []
       })
     },
+    // 添加标签
+    handleAddTabs () {
+      this.data.tabs.push({
+        label: '',
+        list: []
+      })
+    },
     generateRule () {
       this.data.rules = []
       Object.keys(this.validator).forEach(key => {

+ 22 - 2
designer/src/components/WidgetFormItem.vue

@@ -51,8 +51,7 @@
           <el-radio-group v-model="element.options.defaultValue"
             :style="{width: element.options.width}"
             :disabled="element.options.disabled"
-            :scoreTo="element.options.scoreTo"
-            :score="element.options.options.score"
+
           >
             <el-radio  
               :style="{display: element.options.inline ? 'inline-block' : 'block'}"
@@ -63,6 +62,26 @@
           </el-radio-group>
         </template>
 
+        <!-- tabs -->
+        <template v-if="element.type == 'tabs'">
+          <el-tabs v-model="element.options.defaultValue"
+            :disabled="element.options.disabled"
+          >
+            <el-tab-pane :label="element.options.tabs"></el-tab-pane>
+          <el-tab-pane label="用户管理" name="first">用户管理 1</el-tab-pane>
+          <el-tab-pane label="用户管理" name="s">用户管理 2</el-tab-pane>
+
+          </el-tabs>
+        </template>
+
+        <template v-if="element.type == 'divider'">
+          <el-divider
+            v-model="element.options.defaultValue" 
+            :disabled="element.options.disabled"
+            :hidden="element.options.hidden"
+          ></el-divider>
+        </template>
+
         <template v-if="element.type == 'checkbox'">
           <el-checkbox-group v-model="element.options.defaultValue"
             :style="{width: element.options.width}"
@@ -86,6 +105,7 @@
             :end-placeholder="element.options.endPlaceholder"
             :readonly="element.options.readonly"
             :disabled="element.options.disabled"
+            :hideLabel="element.options.hideLabel"
             :editable="element.options.editable"
             :clearable="element.options.clearable"
             :arrowControl="element.options.arrowControl"

+ 63 - 1
designer/src/components/componentsConfig.js

@@ -117,6 +117,7 @@ export const basicComponents = [
       arrowControl: true,
       format: 'HH:mm:ss',
       required: false,
+      hideLabel: false,
       width: '',
     }
   },
@@ -222,6 +223,16 @@ export const basicComponents = [
     options: {
       defaultValue: 'This is a text',
       customClass: '',
+      hideLabel: false
+    }
+  },
+  {
+    type: 'divider',
+    icon: 'icon-fengexian',
+    options: {
+      hidden: false,
+      contentPosition: '',
+      tableColumn: false
     }
   }
 ]
@@ -317,7 +328,6 @@ export const advanceComponents = [
         value: 'value',
         label: 'label'
       },
-      remoteFunc: '',
       disabled: false,
     }
   },
@@ -351,5 +361,57 @@ export const layoutComponents = [
       justify: 'start',
       align: 'top'
     }
+  },
+  {
+    type: 'tabs',
+    icon: 'icon-tabs',
+    tabs: [
+      {
+        label: 'Tab 1',
+        name: 'tab_1',
+        list: []
+      }
+    ],
+    options: {
+      type: 'border-card',
+      tabPosition: 'top',
+      customClass: '',
+      hidden: false,
+      remoteFunc: '',
+      remoteOption: '',
+      tableColumn: false
+    }
+  },
+  {
+    type: 'report',
+    icon: 'icon-table1',
+    options: {
+      customClass: '',
+      hidden: false,
+      borderWidth: 1,
+      borderColor: '#999',
+      width: '100%',
+      remoteFunc: '',
+      remoteOption: '',
+      tableColumn: false
+    },
+    rows: [
+      {
+        columns: [
+          {
+            type: 'td',
+            options: {
+              customClass: '',
+              colspan: 1,
+              rowspan: 1,
+              align: 'left',
+              valign: 'top',
+              width: '',
+              height: ''
+            }
+          }
+        ]
+      }
+    ]
   }
 ]

+ 0 - 675
designer/src/demo/APP-BarthelExponent.html

@@ -1,675 +0,0 @@
-<!DOCTYPE html>
-  <html>
-  <head>
-    <meta charset="UTF-8">
-    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
-    <link rel="stylesheet" href="https://unpkg.com/form-making/dist/FormMaking.css">
-  </head>
-  <body>
-    <div id="app">
-        <div class="panel"> 
-            <h3>基本信息</h3>
-            <hr>
-            <fm-generate-form :data="jsonData1" :remote="remoteFuncs" :value="editData1" ref="generateForm">
-            </fm-generate-form>
-        </div>
-        <div class="panel">
-            <h3>日常生活能力评定量表</h3>
-            <hr>
-            <fm-generate-form :data="jsonData2" :remote="remoteFuncs" :value="editData2" ref="generateForm">
-            </fm-generate-form>
-            <button @click="handleSubmit">计算总分</button>
-            <!-- <p>{{totalScore}}</p> -->
-        </div>
-    </div>
-    <script src="https://unpkg.com/vue/dist/vue.js"></script>
-    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
-    <script src="https://unpkg.com/form-making/dist/FormMaking.umd.js"></script>
-    <script>
-      new Vue({
-        el: '#app',
-        data: {
-            // totalScore: 0,
-            jsonData1:{
-                "list": [
-                    {
-                    "type": "grid",
-                    "icon": "icon-grid-",
-                    "columns": [
-                        {
-                        "span": 8,
-                        "list": [
-                            {
-                            "type": "text",
-                            "icon": "icon-wenzishezhi-",
-                            "options": {
-                                "defaultValue": "",
-                                "customClass": "",
-                                "remoteFunc": "func_1627611384000_98300"
-                            },
-                            "name": "姓名",
-                            "key": "1627611384000_98300",
-                            "model": "resident",
-                            "rules": []
-                            },
-                            {
-                            "type": "text",
-                            "icon": "icon-wenzishezhi-",
-                            "options": {
-                                "defaultValue": "",
-                                "customClass": "",
-                                "remoteFunc": "func_1627611437000_58862"
-                            },
-                            "name": "国籍",
-                            "key": "1627611437000_58862",
-                            "model": "country",
-                            "rules": []
-                            },
-                            {
-                            "type": "text",
-                            "icon": "icon-wenzishezhi-",
-                            "options": {
-                                "defaultValue": "",
-                                "customClass": "",
-                                "remoteFunc": "func_1627611434000_58872"
-                            },
-                            "name": "婚姻状态",
-                            "key": "1627611434000_58872",
-                            "model": "married",
-                            "rules": []
-                            }
-                        ]
-                        },
-                        {
-                        "span": 8,
-                        "list": [
-                            {
-                            "type": "text",
-                            "icon": "icon-wenzishezhi-",
-                            "options": {
-                                "defaultValue": "",
-                                "customClass": "",
-                                "remoteFunc": "func_1627611439000_99428"
-                            },
-                            "name": "性别",
-                            "key": "1627611439000_99428",
-                            "model": "gender",
-                            "rules": []
-                            },
-                            {
-                            "type": "text",
-                            "icon": "icon-wenzishezhi-",
-                            "options": {
-                                "defaultValue": "",
-                                "customClass": "",
-                                "remoteFunc": "func_1627611440000_1153"
-                            },
-                            "name": "民族",
-                            "key": "1627611440000_1153",
-                            "model": "nation",
-                            "rules": []
-                            },
-                            {
-                            "type": "text",
-                            "icon": "icon-wenzishezhi-",
-                            "options": {
-                                "defaultValue": "",
-                                "customClass": "",
-                                "remoteFunc": "func_1627611389000_53699"
-                            },
-                            "name": "文化程度",
-                            "key": "1627611389000_53699",
-                            "model": "educationLevel",
-                            "rules": []
-                            }
-                        ]
-                        },
-                        {
-                        "span": 8,
-                        "list": [
-                            {
-                            "type": "text",
-                            "icon": "icon-wenzishezhi-",
-                            "options": {
-                                "defaultValue": "",
-                                "customClass": "",
-                                "remoteFunc": "func_1627611443000_48875"
-                            },
-                            "name": "年龄",
-                            "key": "1627611443000_48875",
-                            "model": "age",
-                            "rules": []
-                            },
-                            {
-                            "type": "text",
-                            "icon": "icon-wenzishezhi-",
-                            "options": {
-                                "defaultValue": "",
-                                "customClass": "",
-                                "remoteFunc": "func_1627611443000_96274"
-                            },
-                            "name": "职业",
-                            "key": "1627611443000_96274",
-                            "model": "job",
-                            "rules": []
-                            },
-                            {
-                            "type": "text",
-                            "icon": "icon-wenzishezhi-",
-                            "options": {
-                                "defaultValue": "",
-                                "customClass": "",
-                                "remoteFunc": "func_1627611397000_33710"
-                            },
-                            "name": "居住类型",
-                            "key": "1627611397000_33710",
-                            "model": "residentStatus",
-                            "rules": []
-                            }
-                        ]
-                        }
-                    ],
-                    "options": {
-                        "gutter": 0,
-                        "justify": "start",
-                        "align": "top",
-                        "remoteFunc": "func_1627611368000_38651"
-                    },
-                    "name": "栅格布局",
-                    "key": "1627611368000_38651",
-                    "model": "grid_1627611368000_38651",
-                    "rules": []
-                    },
-                ],
-                "config": {
-                    "labelWidth": 100,
-                    "labelPosition": "left",
-                    "size": "small"
-                }
-            },
-            jsonData2:{
-            "list": [
-                {
-                "type": "radio",
-                "icon": "icon-radio-active",
-                "options": {
-                    "inline": true,
-                    "defaultValue": "value",
-                    "showLabel":  true,
-                    "options": [
-                    {
-                        "value": "10",
-                        "label": "完全独立(10)"
-                    },
-                    {
-                        "value": "5",
-                        "label": "需要部分帮助(5)"
-                    },
-                    {
-                        "value": "0",
-                        "label": "需要极大帮助(0)"
-                    }
-                    ],
-                    "required": false,
-                    "width": "",
-                    "remote": false,
-                    "remoteOptions": [],
-                    "props": {
-                    "value": "value",
-                    "label": "label"
-                    },
-                    "remoteFunc": "func_1627611996000_95346",
-                    "disabled": false
-                },
-                "name": "进食",
-                "key": "1627611996000_95346",
-                "model": "radio_1627611996000_95346",
-                "rules": []
-                },
-                {
-                "type": "radio",
-                "icon": "icon-radio-active",
-                "options": {
-                    "inline": true,
-                    "defaultValue": "",
-                    "showLabel": true,
-                    "options": [
-                    {
-                        "value": "5",
-                        "label": "完全独立(5)"
-                    },
-                    {
-                        "value": "0",
-                        "label": "需要部分帮助(0)"
-                    }
-                    ],
-                    "required": false,
-                    "width": "",
-                    "remote": false,
-                    "remoteOptions": [],
-                    "props": {
-                    "value": "value",
-                    "label": "label"
-                    },
-                    "remoteFunc": "func_1627611935000_55805",
-                    "disabled": false
-                },
-                "name": "洗澡",
-                "key": "1627611935000_55805",
-                "model": "radio_1627611935000_55805",
-                "rules": []
-                },
-                {
-                "type": "radio",
-                "icon": "icon-radio-active",
-                "options": {
-                    "inline": true,
-                    "defaultValue": "",
-                    "showLabel": true,
-                    "options": [
-                    {
-                        "value": "5",
-                        "label": "完全独立(5)"
-                    },
-                    {
-                        "value": "0",
-                        "label": "需要部分帮助(0)"
-                    }
-                    ],
-                    "required": false,
-                    "width": "",
-                    "remote": false,
-                    "remoteOptions": [],
-                    "props": {
-                    "value": "value",
-                    "label": "label"
-                    },
-                    "remoteFunc": "func_1627611728000_4511",
-                    "disabled": false
-                },
-                "name": "修饰",
-                "key": "1627611728000_4511",
-                "model": "modification",
-                "rules": []
-                },
-                {
-                "type": "radio",
-                "icon": "icon-radio-active",
-                "options": {
-                    "inline": true,
-                    "defaultValue": "",
-                    "showLabel": true,
-                    "options": [
-                    {
-                        "value": "10",
-                        "label": "完全独立(10)"
-                    },
-                    {
-                        "value": "5",
-                        "label": "需要部分帮助(5)"
-                    },
-                    {
-                        "value": "0",
-                        "label": "需要极大帮助(0)"
-                    }
-                    ],
-                    "required": false,
-                    "width": "",
-                    "remote": false,
-                    "remoteOptions": [],
-                    "props": {
-                    "value": "value",
-                    "label": "label"
-                    },
-                    "remoteFunc": "func_1627612043000_80587",
-                    "disabled": false
-                },
-                "name": "穿衣",
-                "key": "1627612043000_80587",
-                "model": "radio_1627612043000_80587",
-                "rules": []
-                },
-                {
-                "type": "radio",
-                "icon": "icon-radio-active",
-                "options": {
-                    "inline": true,
-                    "defaultValue": "",
-                    "showLabel": true,
-                    "options": [
-                    {
-                        "value": "10",
-                        "label": "完全独立(10)"
-                    },
-                    {
-                        "value": "5",
-                        "label": "需要部分帮助(5)"
-                    },
-                    {
-                        "value": "0",
-                        "label": "需要极大帮助(0)"
-                    }
-                    ],
-                    "required": false,
-                    "width": "",
-                    "remote": false,
-                    "remoteOptions": [],
-                    "props": {
-                    "value": "value",
-                    "label": "label"
-                    },
-                    "remoteFunc": "func_1627612080000_97438",
-                    "disabled": false
-                },
-                "name": "控制大便",
-                "key": "1627612080000_97438",
-                "model": "radio_1627612080000_97438",
-                "rules": []
-                },
-                {
-                "type": "radio",
-                "icon": "icon-radio-active",
-                "options": {
-                    "inline": true,
-                    "defaultValue": "",
-                    "showLabel": true,
-                    "options": [
-                    {
-                        "value": "10",
-                        "label": "完全独立(10)"
-                    },
-                    {
-                        "value": "5",
-                        "label": "需要部分帮助(5)"
-                    },
-                    {
-                        "value": "0",
-                        "label": "需要极大帮助(0)"
-                    }
-                    ],
-                    "required": false,
-                    "width": "",
-                    "remote": false,
-                    "remoteOptions": [],
-                    "props": {
-                    "value": "value",
-                    "label": "label"
-                    },
-                    "remoteFunc": "func_1627612114000_42091",
-                    "disabled": false
-                },
-                "name": "控制小便",
-                "key": "1627612114000_42091",
-                "model": "radio_1627612114000_42091",
-                "rules": []
-                },
-                {
-                "type": "radio",
-                "icon": "icon-radio-active",
-                "options": {
-                    "inline": true,
-                    "defaultValue": "",
-                    "showLabel": true,
-                    "options": [
-                    {
-                        "value": "10",
-                        "label": "完全独立(10)"
-                    },
-                    {
-                        "value": "5",
-                        "label": "需要部分帮助(5)"
-                    },
-                    {
-                        "value": "0",
-                        "label": "需要极大帮助(0)"
-                    }
-                    ],
-                    "required": false,
-                    "width": "",
-                    "remote": false,
-                    "remoteOptions": [],
-                    "props": {
-                    "value": "value",
-                    "label": "label"
-                    },
-                    "remoteFunc": "func_1627612330000_49436",
-                    "disabled": false
-                },
-                "name": "如厕",
-                "key": "1627612330000_49436",
-                "model": "radio_1627612330000_49436",
-                "rules": []
-                },
-                {
-                "type": "radio",
-                "icon": "icon-radio-active",
-                "options": {
-                    "inline": true,
-                    "defaultValue": "",
-                    "showLabel": true,
-                    "options": [
-                    {
-                        "value": "15",
-                        "label": "完全独立(15)"
-                    },
-                    {
-                        "value": "10",
-                        "label": "需要部分帮助(10)"
-                    },
-                    {
-                        "value": "5",
-                        "label": "需要极大帮助(5)"
-                    },
-                    {
-                        "value": "0",
-                        "label": "完全依赖(0)"
-                    }
-                    ],
-                    "required": false,
-                    "width": "",
-                    "remote": false,
-                    "remoteOptions": [],
-                    "props": {
-                    "value": "value",
-                    "label": "label"
-                    },
-                    "remoteFunc": "func_1627612187000_68030",
-                    "disabled": false
-                },
-                "name": "床椅转移",
-                "key": "1627612187000_68030",
-                "model": "radio_1627612187000_68030",
-                "rules": []
-                },
-                {
-                "type": "radio",
-                "icon": "icon-radio-active",
-                "options": {
-                    "inline": true,
-                    "defaultValue": "",
-                    "showLabel": true,
-                    "options": [
-                    {
-                        "value": "15",
-                        "label": "完全独立(15)"
-                    },
-                    {
-                        "value": "10",
-                        "label": "需要部分帮助(10)"
-                    },
-                    {
-                        "value": "5",
-                        "label": "需要极大帮助(5)"
-                    },
-                    {
-                        "value": "0",
-                        "label": "完全依赖(0)"
-                    }
-                    ],
-                    "required": false,
-                    "width": "",
-                    "remote": false,
-                    "remoteOptions": [],
-                    "props": {
-                    "value": "value",
-                    "label": "label"
-                    },
-                    "remoteFunc": "func_1627611871000_78312",
-                    "disabled": false
-                },
-                "name": "平地行走",
-                "key": "1627611871000_78312",
-                "model": "walkingFlat",
-                "rules": []
-                },
-                {
-                "type": "radio",
-                "icon": "icon-radio-active",
-                "options": {
-                    "inline": true,
-                    "defaultValue": "",
-                    "showLabel": true,
-                    "options": [
-                    {
-                        "value": "10",
-                        "label": "完全独立(10)"
-                    },
-                    {
-                        "value": "5",
-                        "label": "需要部分帮助(5)"
-                    },
-                    {
-                        "value": "0",
-                        "label": "需要极大帮助(0)"
-                    }
-                    ],
-                    "required": false,
-                    "width": "",
-                    "remote": false,
-                    "remoteOptions": [],
-                    "props": {
-                    "value": "value",
-                    "label": "label"
-                    },
-                    "remoteFunc": "func_1627612146000_29388",
-                    "disabled": false
-                },
-                "name": "上下楼梯",
-                "key": "1627612146000_29388",
-                "model": "upDownStairs",
-                "rules": []
-                },
-                {
-                "type": "text",
-                "icon": "icon-wenzishezhi-",
-                "options": {
-                    "defaultValue": "",
-                    "customClass": "",
-                    "remoteFunc": "func_1627612430000_75443"
-                },
-                "name": "总分",
-                "key": "1627612430000_75443",
-                "model": "text_1627612430000_75443",
-                "rules": []
-                },
-                {
-                "type": "text",
-                "icon": "icon-wenzishezhi-",
-                "options": {
-                    "defaultValue": "重度障碍(0 ~ 40)",
-                    "customClass": "",
-                    "remoteFunc": "func_1627612384000_56891"
-                },
-                "name": "自理能力等级",
-                "key": "1627612384000_56891",
-                "model": "selfCareAbility",
-                "rules": []
-                },
-                {
-                "type": "select",
-                "icon": "icon-select",
-                "options": {
-                    "defaultValue": "",
-                    "multiple": false,
-                    "disabled": false,
-                    "clearable": false,
-                    "placeholder": "",
-                    "required": false,
-                    "showLabel": false,
-                    "width": "50%",
-                    "options": [
-                    {
-                        "value": "Option 1"
-                    }
-                    ],
-                    "remote": false,
-                    "filterable": false,
-                    "remoteOptions": [],
-                    "props": {
-                    "value": "value",
-                    "label": "label"
-                    },
-                    "remoteFunc": "func_1627612478000_21979"
-                },
-                "name": "责任护士医生",
-                "key": "1627612478000_21979",
-                "model": "responsibleNurse",
-                "rules": []
-                }
-            ],
-            "config": {
-                "labelWidth": 100,
-                "labelPosition": "left",
-                "size": "small"
-            }
-        },
-            editData1: {
-                    value: 2
-                },    
-            editData2: {
-                    value: 2
-                },
-            remoteFuncs: {
-                
-            }
-        },
-        computed: {
-            totalScore:function(){
-                
-                // console.log("totalScore",totalScore)
-                console.log("jsonData1",this.data)
-                // return this.data.totalScore + 10
-            }
-        },
-        methods: {
-            test(){
-                console.log("jsonData1",this.data)
-            },  
-            handleSubmit () {
-                this.$refs.generateForm.getData().then(data => {
-                    
-                console.log("data",data)
-                console.log("editData",editData)
-                }).catch(e => {
-                })
-            }
-        }
-      })
-    </script>
-  </body>
-  <style>
-      .panel{
-        border-radius: 10px;
-        box-shadow:-10px 0px 10px rgb(190, 190, 190),   /*左边阴影*/
-            /* 0px -10px 10px rgb(190, 190, 190),  上边阴影 */
-            10px 0px 10px rgb(190, 190, 190) /*右边阴影*/
-            /* 0px 10px 10px rgb(190, 190, 190); 下边阴影 */;
-        width: 90%;
-        margin-top: 10px;
-        margin-bottom: 10px;
-        margin-left: 5%;
-        padding:10px;
-        padding-left: 20px;
-      }
-  </style>
-  </html>

+ 0 - 267
designer/src/demo/APP.js

@@ -1,267 +0,0 @@
-require(prefixPath(["hCore.js"]), function (hCore) {
-
-    function getUrlParam(name) {
-        var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
-        var result = window.location.search.substr(1).match(reg);
-        return result ? decodeURIComponent(result[2]) : null;
-    }
-
-    var taskId = getUrlParam("taskId");
-    var patientId = getUrlParam("patientId");
-    var userCode = getUrlParam("userCode");
-    var isMobile = getUrlParam("isMobile");
-    var barthelId = getUrlParam("barthelId");
-    var barthelDate = getUrlParam("barthelDate");
-    if (1 == isMobile) {
-        $(".barthel_exponent").height('100%');
-    }
-    var isUpdate = false;// 是否更新过
-    sessionStorage.setItem('barthel', 0);
-
-    layui.use(['laytpl', 'form', 'layer'], function () {
-        var laytpl = layui.laytpl;
-
-        /** 查询barthel指数等级表 */
-        var barthelLevelListCache = [];
-        hCore.request({
-            url: "getAllBarthelLevel",
-            success: function (data) {
-                barthelLevelListCache = data;
-            }
-        });
-
-        /** 查询barthel指数 */
-        (function getFullBarthelItems() {
-            var param = {
-                'taskId': taskId,
-                'barthelId': barthelId
-            };
-            hCore.request({
-                url: "mobile/getBarthelItemsById",
-                data: param,
-                success: function (data, msg) {
-                    if (data) {
-                        if (data.residentInfo) {
-                            var residentInfo = data.residentInfo;
-                            $("#resident").html(residentInfo.name);
-                            $("#gender").html(residentInfo.gender);
-                            $("#age").html(residentInfo.age);
-                            $("#country").html(residentInfo.country);
-                            $("#nation").html(residentInfo.nation);
-                            $("#job").html(residentInfo.job);
-                            $("#married").html(residentInfo.married);
-                            $("#educationLevel").html(residentInfo.educationLevel);
-                            $("#residentStatus").html(residentInfo.residentStatus);
-                        }
-                        if (data.barthelBean) {
-                            var barthelBean = data.barthelBean;
-                            setData(barthelBean.barthelItemTypeBeans);
-                            // 总分
-                            $("#totalScore").html(barthelBean.totalScore);
-                            // 自理能力等级
-                            $("#selfCareAbility").html(barthelBean.selfCareAbility);
-                            // 责任护士签名
-                            responsibleNurse.Value(barthelBean.responsibleNurse == null
-                                ? (userCode == null ? '' : userCode)
-                                : barthelBean.responsibleNurse);
-                            // 护士长签名
-                            // headNurse.Value(barthelBean.headNurse == null ? '' : barthelBean.headNurse);
-                            isUpdate = false;// 是否更新过
-                            sessionStorage.setItem('barthel', 0);
-                        }
-                    }
-                }
-            });
-        })();
-
-        /** 删除 */
-        $("#deleteImg").click(function () {
-            if(barthelId == 'null') {
-                document.location = window.location.href + '&DELETE';
-            } else {
-                var param = {'barthelId': barthelId};
-                hCore.request({
-                    url: "mobile/deleteBarthel",
-                    data: param,
-                    success: function (data, msg) {
-                        hCore.successTips(msg);
-                        setTimeout(function () {
-                            document.location = window.location.href + '&DELETE';
-                        }, 200);
-                    }
-                });
-            }
-            // if (barthelId == 'null') {
-            //     return layer.msg('不能删除空的barthel指数!', {icon: 5, shift: 6});
-            // }
-            // SmallConfirm("确定要删除该张barthel指数!", "警告", function (result) {
-            //     if (result) {
-            //
-            //     }
-            // });
-        });
-
-        /** 保存 */
-        var barthelItemTypeList = [];
-        $("#saveBtn").click(function () {
-            // 单选校验
-            for (var i = 0; i < barthelItemTypeList.length; i++) {
-                var item = barthelItemTypeList[i];
-                var radioVal = $('input[name='+ item.typeCode +']:checked').val();
-                if (radioVal == undefined) {
-                    return layer.msg(item.typeName + '不能为空', {icon: 5, shift: 6});
-                }
-            }
-            // 校验下拉框
-            var $select = $('select');
-            for (var i = 0; i < $select.length; i++) {
-                var select = $select[i];
-                if (select.value == '') {
-                    select.focus();
-                    $(select).parent().find('button').click();
-                    $(select).parent().click();
-                    var idVal = select.getAttribute('id');
-                    if ('responsibleNurse' == idVal) {
-                        return layer.msg('责任护士签名不能为空', {icon: 5, shift: 6});
-                    } else {
-                        return layer.msg('护士长签名不能为空', {icon: 5, shift: 6});
-                    }
-                }
-            }
-            if (!isUpdate) {
-                return hCore.errorTips("信息没有变更,不需要重复保存!");
-            }
-            // 保存
-            layer.load();
-            hCore.request({
-                method: 'POST',
-                url: "mobile/saveOrUpdateBarthel",
-                data: JSON.stringify(getData()),
-                success: function (data, msg) {
-                    if (data && data > 0) {
-                        hCore.successTips("保存成功!");
-                        barthelId = data;
-                        isUpdate = false;
-                        sessionStorage.setItem('barthel', 0);
-                        setTimeout(function () {
-                            document.location = window.location.href + '&SAVE';
-                        }, 200);
-                    } else {
-                        hCore.errorTips("保存失败!");
-                    }
-                    layer.closeAll('loading');
-                },
-                error: function () {
-                    hCore.errorTips("保存失败!");
-                    layer.closeAll('loading');
-                }
-            });
-        });
-
-        // 计算totalScore分数、评估等级
-        function calculatorTotalScore() {
-            var totalScore = 0;
-            $.each($("body input[type='radio']"), function (index, item) {
-                if (item.checked) {
-                    totalScore += $(item).data('val');
-                }
-            });
-            $("#totalScore").html(totalScore);
-
-            // 根据分数计算其评估等级
-            var filter = barthelLevelListCache.filter(function (item) {
-                return totalScore >= item.under && totalScore <= item.upper;
-            });
-            if (filter.length > 0) {
-                $("#selfCareAbility").html(filter[0].describe);
-            }
-        }
-
-        function setData(barthelItemTypeBeans) {
-            barthelItemTypeList = barthelItemTypeBeans;
-            $.each(barthelItemTypeBeans, function (index, item) {
-                var typeCode = item.typeCode;
-                var data = item.barthelItemBeanList;
-                laytpl(tableData.innerHTML).render({"list": data}, function (html) {
-                    $("#"+typeCode).html(html);
-                });
-            });
-            // 监听修改
-            $("input[type='radio']").click(function () {
-                calculatorTotalScore();
-                isUpdate = true;// 是否更新过
-                sessionStorage.setItem('barthel', 1);
-            });
-            $("select").parent().find('button').click(function () {
-                isUpdate = true;// 是否更新过
-                sessionStorage.setItem('barthel', 1);
-            });
-            $("select").click(function () {
-                isUpdate = true;// 是否更新过
-                sessionStorage.setItem('barthel', 1);
-            });
-        }
-
-        function getData() {
-            var data = {
-                'barthelDateString': barthelDate,
-                'barthelId': barthelId,
-                'patientId': patientId,
-                'taskId': taskId,
-                'creator': userCode || sessionStorage.getItem('userCode') || 'admin',
-                'modifier': userCode || sessionStorage.getItem('userCode') || 'admin',
-                // 进食
-                'eat': getRadioVal('eat'),
-                // 洗澡
-                'shower': getRadioVal('shower'),
-                // 修饰
-                'modification': getRadioVal('modification'),
-                // 穿衣
-                'dressing': getRadioVal('dressing'),
-                // 控制大便
-                'controllingStool': getRadioVal('controllingStool'),
-                // 控制小便
-                'controllingUrination': getRadioVal('controllingUrination'),
-                // 如厕
-                'toilet': getRadioVal('toilet'),
-                // 床椅转移
-                'chairTransfer': getRadioVal('chairTransfer'),
-                // 平地行走
-                'walkingFlat': getRadioVal('walkingFlat'),
-                // 上下楼梯
-                'upDownStairs': getRadioVal('upDownStairs'),
-                // 总分
-                'totalScore': getTextVal('#totalScore'),
-                // 自理能力等级
-                'selfCareAbility': getTextVal('#selfCareAbility'),
-                // 责任护士签名
-                'responsibleNurse': getSelectVal('#responsibleNurse'),
-                // 护士长签名
-                'headNurse': '',//getSelectVal('#headNurse'),
-                'responsibleNurseAutograph': getSelectVal('#responsibleNurse'),
-                'headNurseAutograph': '',//getSelectVal('#headNurse')
-            };
-            return data;
-        }
-
-        // 获取单选框
-        function getRadioVal(name) {
-            return getTrim($("input[name='" + name + "']:checked").val());
-        }
-
-        // 获取下拉框
-        function getSelectVal(id) {
-            return getTrim($(id).selectpicker('val'))
-        }
-
-        // 获取文本框
-        function getTextVal(id) {
-            return getTrim($(id).html())
-        }
-
-        function getTrim(val) {
-            return $.trim(val);
-        }
-
-    });
-});

+ 4 - 0
designer/src/lang/zh-CN.js

@@ -7,6 +7,7 @@ export default {
         number: '计数器',
         scoreRadio:'分数单选框',
         totalScore:'分数汇总框',
+        report: '网格布局',
         radio: '单选框组',
         checkbox: '多选框组',
         time: '时间选择器',
@@ -83,6 +84,8 @@ export default {
         name: '标题',
         width: '宽度',
         height: '高度',
+        scoreTo: '记分到',
+        tabs: '标签配置项',
         size: '大小',
         labelWidth: '标签宽度',
         custom: '自定义',
@@ -113,6 +116,7 @@ export default {
         defaultValue: '默认值',
         showType: '显示类型',
         isRange: '是否为范围选择',
+        hideLabel: '隐藏标签',
         isTimestamp: '是否获取时间戳',
         startPlaceholder: '开始时间占位内容',
         endPlaceholder: '结束时间占位内容',