Kaynağa Gözat

更新组件

lex-xin 4 yıl önce
ebeveyn
işleme
bfc39d57da

+ 6 - 6
src/components/VueFormMaking/components/Container.vue

@@ -91,12 +91,12 @@
         <el-aside class="widget-config-container" style="width: 305px;">
           <el-container>
             <el-header height="45px">
-              <div class="config-tab" :class="{active: configTab=='widget'}" @click="handleConfigSelect('widget')">{{ $t('fm.config.widget.title') }}</div>
-              <div class="config-tab" :class="{active: configTab=='form'}" @click="handleConfigSelect('form')">{{ $t('fm.config.form.title') }}</div>
+              <div class="config-tab" style="width: 100%;" :class="{active: configTab=='widget'}" @click="handleConfigSelect('widget')">{{ $t('fm.config.widget.title') }}</div>
+              <!-- <div class="config-tab" :class="{active: configTab=='form'}" @click="handleConfigSelect('form')">{{ $t('fm.config.form.title') }}</div> -->
             </el-header>
             <el-main class="config-content">
               <widget-config v-if="widgetFormSelect!==null" v-show="configTab=='widget'" :data="widgetFormSelect" />
-              <form-config v-show="configTab=='form'" :data="widgetForm.config" />
+              <!-- <form-config v-show="configTab=='form'" :data="widgetForm.config" /> -->
             </el-main>
           </el-container>
 
@@ -178,7 +178,7 @@
 <script>
 import Draggable from 'vuedraggable'
 import WidgetConfig from './WidgetConfig'
-import FormConfig from './FormConfig'
+// import FormConfig from './FormConfig'
 import WidgetForm from './WidgetForm'
 import CusDialog from './CusDialog'
 import GenerateForm from './GenerateForm'
@@ -199,7 +199,7 @@ export default {
   components: {
     Draggable,
     WidgetConfig,
-    FormConfig,
+    // FormConfig,
     WidgetForm,
     CusDialog,
     GenerateForm
@@ -227,7 +227,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', 'organ', 'school']
     },
     advanceFields: {
       type: Array,

+ 28 - 0
src/components/VueFormMaking/components/GenerateFormItem.vue

@@ -226,6 +226,34 @@
         </el-select>
       </template>
 
+      <template v-if="widget.type === 'organ'">
+        <el-select
+          v-model="dataModel"
+          :disabled="widget.options.disabled"
+          :multiple="widget.options.multiple"
+          :clearable="widget.options.clearable"
+          :placeholder="widget.options.placeholder"
+          :style="{width: widget.options.width}"
+          :filterable="widget.options.filterable"
+        >
+          <el-option v-for="item in (widget.options.remote ? widget.options.remoteOptions : widget.options.options)" :key="item.value" :value="item.value" :label="widget.options.showLabel || widget.options.remote?item.label:item.value" />
+        </el-select>
+      </template>
+
+      <template v-if="widget.type === 'school'">
+        <el-select
+          v-model="dataModel"
+          :disabled="widget.options.disabled"
+          :multiple="widget.options.multiple"
+          :clearable="widget.options.clearable"
+          :placeholder="widget.options.placeholder"
+          :style="{width: widget.options.width}"
+          :filterable="widget.options.filterable"
+        >
+          <el-option v-for="item in (widget.options.remote ? widget.options.remoteOptions : widget.options.options)" :key="item.value" :value="item.value" :label="widget.options.showLabel || widget.options.remote?item.label:item.value" />
+        </el-select>
+      </template>
+
       <template v-if="widget.type=='switch'">
         <el-switch
           v-model="dataModel"

+ 6 - 6
src/components/VueFormMaking/components/WidgetConfig.vue

@@ -6,11 +6,11 @@
         <el-input v-model="data.model" />
       </el-form-item>
       <!-- 标题 -->
-      <el-form-item v-if="data.type!=='grid' && data.type!=='divider'" :label="$t('fm.config.widget.name')">
+      <el-form-item v-if="data.type!=='grid' && data.type!=='divider' && data.type != 'organ' && data.type != 'school'" :label="$t('fm.config.widget.name')">
         <el-input v-model="data.name" />
       </el-form-item>
       <!-- 宽度 -->
-      <el-form-item v-if="Object.keys(data.options).indexOf('width')>=0" :label="$t('fm.config.widget.width')">
+      <el-form-item v-if="Object.keys(data.options).indexOf('width')>=0 " :label="$t('fm.config.widget.width')">
         <el-input v-model="data.options.width" />
       </el-form-item>
 
@@ -78,11 +78,11 @@
         <el-input-number v-model="data.options.step" :min="0" :max="100" :step="1" />
       </el-form-item>
       <!-- 是否多选 -->
-      <el-form-item v-if="data.type=='select'" :label="$t('fm.config.widget.multiple')">
+      <el-form-item v-if="data.type=='select' && data.options.showMultiple" :label="$t('fm.config.widget.multiple')">
         <el-switch v-model="data.options.multiple" @change="handleSelectMuliple" />
       </el-form-item>
       <!-- 是否可搜索 -->
-      <el-form-item v-if="data.type=='select'" :label="$t('fm.config.widget.filterable')">
+      <el-form-item v-if="data.type=='select' && data.options.showFilterable" :label="$t('fm.config.widget.filterable')">
         <el-switch v-model="data.options.filterable" />
       </el-form-item>
       <!-- 允许半选 -->
@@ -107,9 +107,9 @@
       <el-form-item v-if="Object.keys(data.options).indexOf('options')>=0" :label="$t('fm.config.widget.option')">
         <el-radio-group v-model="data.options.remote" size="mini" style="margin-bottom:10px;">
           <el-radio-button :label="false">{{ $t('fm.config.widget.staticData') }}</el-radio-button>
-          <el-radio-button :label="true">{{ $t('fm.config.widget.remoteData') }}</el-radio-button>
+          <el-radio-button v-if="data.options.showRemote" :label="true">{{ $t('fm.config.widget.remoteData') }}</el-radio-button>
         </el-radio-group>
-        <template v-if="data.options.remote">
+        <template v-if="data.options.remote && data.options.showRemote">
           <div>
             <el-input v-model="data.options.remoteFunc" size="mini" style="">
               <template slot="prepend">{{ $t('fm.config.widget.remoteFunc') }}</template>

+ 26 - 0
src/components/VueFormMaking/components/WidgetFormFields.vue

@@ -125,6 +125,32 @@
       </el-select>
     </template>
 
+    <template v-if="element.type == 'organ'">
+      <el-select
+        v-model="element.options.defaultValue"
+        :disabled="element.options.disabled"
+        :multiple="element.options.multiple"
+        :clearable="element.options.clearable"
+        :placeholder="element.options.placeholder"
+        :style="{width: element.options.width}"
+      >
+        <el-option v-for="item in element.options.options" :key="item.value" :value="item.value" :label="element.options.showLabel?item.label:item.value" />
+      </el-select>
+    </template>
+
+    <template v-if="element.type == 'school'">
+      <el-select
+        v-model="element.options.defaultValue"
+        :disabled="element.options.disabled"
+        :multiple="element.options.multiple"
+        :clearable="element.options.clearable"
+        :placeholder="element.options.placeholder"
+        :style="{width: element.options.width}"
+      >
+        <el-option v-for="item in element.options.options" :key="item.value" :value="item.value" :label="element.options.showLabel?item.label:item.value" />
+      </el-select>
+    </template>
+
     <template v-if="element.type=='switch'">
       <el-switch
         v-model="element.options.defaultValue"

+ 170 - 111
src/components/VueFormMaking/components/componentsConfig.js

@@ -13,14 +13,14 @@ export const basicComponents = [
       showPassword: false,
       labelWidth: 100,
       labelWidthDisabled: false,
-      labelWidthStatus: true,
-      displayVerifiy: {
-        type: 'hide',
-        list: [{
-          model: '字段标识',
-          value: '字段值'
-        }]
-      }
+      labelWidthStatus: true
+      // displayVerifiy: {
+      //   type: 'hide',
+      //   list: [{
+      //     model: '字段标识',
+      //     value: '字段值'
+      //   }]
+      // }
     }
   },
   {
@@ -35,14 +35,14 @@ export const basicComponents = [
       placeholder: '',
       labelWidth: 100,
       labelWidthDisabled: false,
-      labelWidthStatus: true,
-      displayVerifiy: {
-        type: 'hide',
-        list: [{
-          model: '字段标识',
-          value: '字段值'
-        }]
-      }
+      labelWidthStatus: true
+      // displayVerifiy: {
+      //   type: 'hide',
+      //   list: [{
+      //     model: '字段标识',
+      //     value: '字段值'
+      //   }]
+      // }
     }
   },
   {
@@ -59,14 +59,14 @@ export const basicComponents = [
       controlsPosition: '',
       labelWidth: 100,
       labelWidthDisabled: false,
-      labelWidthStatus: true,
-      displayVerifiy: {
-        type: 'hide',
-        list: [{
-          model: '字段标识',
-          value: '字段值'
-        }]
-      }
+      labelWidthStatus: true
+      // displayVerifiy: {
+      //   type: 'hide',
+      //   list: [{
+      //     model: '字段标识',
+      //     value: '字段值'
+      //   }]
+      // }
     }
   },
   {
@@ -102,14 +102,14 @@ export const basicComponents = [
       disabled: false,
       labelWidth: 100,
       labelWidthDisabled: false,
-      labelWidthStatus: true,
-      displayVerifiy: {
-        type: 'hide',
-        list: [{
-          model: '字段标识',
-          value: '字段值'
-        }]
-      }
+      labelWidthStatus: true
+      // displayVerifiy: {
+      //   type: 'hide',
+      //   list: [{
+      //     model: '字段标识',
+      //     value: '字段值'
+      //   }]
+      // }
     }
   },
   {
@@ -142,14 +142,14 @@ export const basicComponents = [
       disabled: false,
       labelWidth: 100,
       labelWidthDisabled: false,
-      labelWidthStatus: true,
-      displayVerifiy: {
-        type: 'hide',
-        list: [{
-          model: '字段标识',
-          value: '字段值'
-        }]
-      }
+      labelWidthStatus: true
+      // displayVerifiy: {
+      //   type: 'hide',
+      //   list: [{
+      //     model: '字段标识',
+      //     value: '字段值'
+      //   }]
+      // }
     }
   },
   // {
@@ -207,14 +207,14 @@ export const basicComponents = [
       required: false,
       labelWidth: 100,
       labelWidthDisabled: false,
-      labelWidthStatus: true,
-      displayVerifiy: {
-        type: 'hide',
-        list: [{
-          model: '字段标识',
-          value: '字段值'
-        }]
-      }
+      labelWidthStatus: true
+      // displayVerifiy: {
+      //   type: 'hide',
+      //   list: [{
+      //     model: '字段标识',
+      //     value: '字段值'
+      //   }]
+      // }
     }
   },
   // {
@@ -242,6 +242,7 @@ export const basicComponents = [
     icon: 'icon-select',
     options: {
       defaultValue: '',
+      showMultiple: false,
       multiple: false,
       disabled: false,
       clearable: false,
@@ -259,7 +260,9 @@ export const basicComponents = [
           value: 'Option 3'
         }
       ],
+      showRemote: false,
       remote: false,
+      showFilterable: false,
       filterable: false,
       remoteOptions: [],
       props: {
@@ -269,14 +272,14 @@ export const basicComponents = [
       remoteFunc: '',
       labelWidth: 100,
       labelWidthDisabled: false,
-      labelWidthStatus: true,
-      displayVerifiy: {
-        type: 'hide',
-        list: [{
-          model: '字段标识',
-          value: '字段值'
-        }]
-      }
+      labelWidthStatus: true
+      // displayVerifiy: {
+      //   type: 'hide',
+      //   list: [{
+      //     model: '字段标识',
+      //     value: '字段值'
+      //   }]
+      // }
     }
   },
   // {
@@ -335,14 +338,70 @@ export const basicComponents = [
       labelWidthStatus: true,
       customClass: '',
       labelWidth: 100,
+      labelWidthDisabled: false
+      // displayVerifiy: {
+      //   type: 'hide',
+      //   list: [{
+      //     model: '字段标识',
+      //     value: '字段值'
+      //   }]
+      // }
+    }
+  },
+  {
+    type: 'organ',
+    icon: 'icon-slider',
+    options: {
+      defaultValue: '',
+      showMultiple: false,
+      multiple: false,
+      disabled: false,
+      clearable: false,
+      placeholder: '',
+      required: false,
+      showLabel: false,
+      // width: '',
+      showRemote: false,
+      remote: false,
+      showFilterable: false,
+      filterable: false,
+      remoteOptions: [],
+      props: {
+        value: 'value',
+        label: 'label'
+      },
+      remoteFunc: '',
+      labelWidth: 100,
       labelWidthDisabled: false,
-      displayVerifiy: {
-        type: 'hide',
-        list: [{
-          model: '字段标识',
-          value: '字段值'
-        }]
-      }
+      labelWidthStatus: true
+    }
+  },
+  {
+    type: 'school',
+    icon: 'icon-slider',
+    options: {
+      defaultValue: '',
+      showMultiple: false,
+      multiple: false,
+      disabled: false,
+      clearable: false,
+      placeholder: '',
+      required: false,
+      showLabel: false,
+      // width: '',
+      showRemote: false,
+      remote: false,
+      showFilterable: false,
+      filterable: false,
+      remoteOptions: [],
+      props: {
+        value: 'value',
+        label: 'label'
+      },
+      remoteFunc: '',
+      labelWidth: 100,
+      labelWidthDisabled: false,
+      labelWidthStatus: true
     }
   }
 ]
@@ -355,14 +414,14 @@ export const advanceComponents = [
       defaultType: 'String',
       labelWidth: 100,
       labelWidthDisabled: false,
-      labelWidthStatus: true,
-      displayVerifiy: {
-        type: 'hide',
-        list: [{
-          model: '字段标识',
-          value: '字段值'
-        }]
-      }
+      labelWidthStatus: true
+      // displayVerifiy: {
+      //   type: 'hide',
+      //   list: [{
+      //     model: '字段标识',
+      //     value: '字段值'
+      //   }]
+      // }
     }
   },
   {
@@ -388,14 +447,14 @@ export const advanceComponents = [
       action: 'https://jsonplaceholder.typicode.com/photos/',
       labelWidth: 100,
       labelWidthDisabled: false,
-      labelWidthStatus: true,
-      displayVerifiy: {
-        type: 'hide',
-        list: [{
-          model: '字段标识',
-          value: '字段值'
-        }]
-      }
+      labelWidthStatus: true
+      // displayVerifiy: {
+      //   type: 'hide',
+      //   list: [{
+      //     model: '字段标识',
+      //     value: '字段值'
+      //   }]
+      // }
     }
   },
   {
@@ -415,14 +474,14 @@ export const advanceComponents = [
       action: 'http://ipaddress:port/api/v1/public/uploadFile',
       labelWidth: 100,
       labelWidthDisabled: false,
-      labelWidthStatus: true,
-      displayVerifiy: {
-        type: 'hide',
-        list: [{
-          model: '字段标识',
-          value: '字段值'
-        }]
-      }
+      labelWidthStatus: true
+      // displayVerifiy: {
+      //   type: 'hide',
+      //   list: [{
+      //     model: '字段标识',
+      //     value: '字段值'
+      //   }]
+      // }
     }
   },
   // {
@@ -485,14 +544,14 @@ export const advanceComponents = [
       remoteFunc: '',
       labelWidth: 100,
       labelWidthDisabled: false,
-      labelWidthStatus: true,
-      displayVerifiy: {
-        type: 'hide',
-        list: [{
-          model: '字段标识',
-          value: '字段值'
-        }]
-      }
+      labelWidthStatus: true
+      // displayVerifiy: {
+      //   type: 'hide',
+      //   list: [{
+      //     model: '字段标识',
+      //     value: '字段值'
+      //   }]
+      // }
     }
   },
   {
@@ -511,14 +570,14 @@ export const advanceComponents = [
       align: 'top',
       labelWidth: 100,
       labelWidthDisabled: false,
-      labelWidthStatus: true,
-      displayVerifiy: {
-        type: 'hide',
-        list: [{
-          model: '字段标识',
-          value: '字段值'
-        }]
-      }
+      labelWidthStatus: true
+      // displayVerifiy: {
+      //   type: 'hide',
+      //   list: [{
+      //     model: '字段标识',
+      //     value: '字段值'
+      //   }]
+      // }
     }
   }
 ]
@@ -553,14 +612,14 @@ export const layoutComponents = [
       font_weight: '500', // 粗体
       font_family: '', // 字体属性
       direction: 'horizontal', // horizontal / vertical 设置分割线方向
-      content_position: 'center', // left / right / center 设置分割线文案的位置
-      displayVerifiy: {
-        type: 'hide',
-        list: [{
-          model: '字段标识',
-          value: '字段值'
-        }]
-      }
+      content_position: 'center' // left / right / center 设置分割线文案的位置
+      // displayVerifiy: {
+      //   type: 'hide',
+      //   list: [{
+      //     model: '字段标识',
+      //     value: '字段值'
+      //   }]
+      // }
     }
   }
 ]

+ 2 - 1
src/components/VueFormMaking/lang/en-US.js

@@ -23,7 +23,8 @@ export default {
         table: 'Sub-table',
         grid: 'Grid',
         tabs: 'Tabs',
-        divider: 'Divider'
+        divider: 'Divider',
+        organ: 'Organ'
       },
       basic: {
         title: 'Basic Component'

+ 3 - 1
src/components/VueFormMaking/lang/zh-CN.js

@@ -25,7 +25,9 @@ export default {
         grid: '栅格布局',
         tabs: '标签页',
         divider: '分割线',
-        file: '文件'
+        file: '文件',
+        organ: '分部',
+        school: '学校'
       },
       basic: {
         title: '基础字段'

+ 19 - 0
src/components/wfd/components/DetailPanel/EndEventDetail.vue

@@ -28,6 +28,21 @@
         :readonly-preview="false"
         :cc-preview="false"
       />
+
+      <div class="panelRow">
+        <div>子流程:</div>
+        <el-select
+          size="small"
+          style="width:90%; font-size:12px"
+          placeholder="选择子流程"
+          :disabled="readOnly"
+          :value="model.transferProcess"
+          :filterable="true"
+          @change="(e) => onChange('transferProcess', e)"
+        >
+          <el-option v-for="(item, index) in process" :key="index" :label="item.name" :value="item.id" />
+        </el-select>
+      </div>
     </div>
   </div>
 </template>
@@ -53,6 +68,10 @@ export default {
       type: Function,
       default: () => {}
     },
+    process: {
+      type: Array,
+      default: () => ([])
+    },
     readOnly: {
       type: Boolean,
       default: false

+ 4 - 4
src/components/wfd/components/DetailPanel/HandleNodeDetail.vue

@@ -208,11 +208,11 @@ export default {
   data() {
     return {
       variableOptions: [{
-        value: 1,
-        label: '创建者'
-      }, {
         value: 2,
-        label: '创建者负责人'
+        label: '部门主管'
+      }, {
+        value: 3,
+        label: '创建者部门主管'
       }],
       roleList: []
     }

+ 8 - 4
src/components/wfd/components/DetailPanel/UserTaskDetail.vue

@@ -207,12 +207,16 @@ export default {
   },
   data() {
     return {
+      //   {
+      //   value: 1,
+      //   label: '创建者'
+      // },
       variableOptions: [{
-        value: 1,
-        label: '创建者'
-      }, {
         value: 2,
-        label: '创建者负责人'
+        label: '部门主管'
+      }, {
+        value: 3,
+        label: '创建者部门主管'
       }],
       roleList: []
     }

+ 5 - 0
src/components/wfd/components/DetailPanel/index.vue

@@ -58,6 +58,7 @@
       :on-change="onChange"
       :read-only="readOnly"
       :tasks="tasks"
+      :process="process"
       :templates="templates"
       :templates-base="templatesBase"
     />
@@ -133,6 +134,10 @@ export default {
       type: Array,
       default: () => ([])
     },
+    process: {
+      type: Array,
+      default: () => ([])
+    },
     templates: {
       type: Array,
       default: () => ([])

+ 5 - 0
src/components/wfd/components/Wfd.vue

@@ -15,6 +15,7 @@
         :groups="groups"
         :departments="departments"
         :tasks="tasks"
+        :process="process"
         :templates="templates"
         :templates-base="templatesBase"
         :signal-defs="processModel.signalDefs"
@@ -98,6 +99,10 @@ export default {
       type: Array,
       default: () => ([])
     },
+    process: {
+      type: Array,
+      default: () => ([])
+    },
     templates: {
       type: Array,
       default: () => ([])

+ 11 - 1
src/views/process/admin/process-manager.vue

@@ -173,6 +173,7 @@
                     :roles="roles"
                     :departments="departments"
                     :tasks="taskListData"
+                    :process="processData"
                     :templates="ruleForm.tpls"
                     :templates-base="templates"
                     :data="ruleForm.structure"
@@ -238,6 +239,7 @@ export default {
       departments: [],
       templates: [],
       taskListData: [],
+      processData: [],
       wfdDesignRefresh: true,
       classifyListData: [],
       dialogProcessVisibleName: 1,
@@ -283,6 +285,14 @@ export default {
         this.taskListData = response.data.data
       })
     },
+    getProcessList() {
+      processList({
+        page: 1,
+        per_page: 99999
+      }).then(response => {
+        this.processData = response.data.data
+      })
+    },
     // 获取流程分类列表
     getClassifyList() {
       classifyList({
@@ -320,7 +330,6 @@ export default {
     getDepartments() {
       getOrdinaryDeptList().then(response => {
         this.departments = response.data
-        console.log(this.departments)
       })
     },
     /** 查询流程列表 */
@@ -343,6 +352,7 @@ export default {
       this.getRoles()
       this.getDepartments()
       this.getTaskList()
+      this.getProcessList()
     },
     handleCreate() {
       this.getProcessInitData()