Просмотр исходного кода

流程执行人规则组批次默认为当前序号

cfort 2 лет назад
Родитель
Сommit
5c90e58922

+ 156 - 152
src/business/platform/bpmn/setting/bpmn-setting/components/user-condition-setting.vue

@@ -1,33 +1,33 @@
 <template>
-  <el-dialog
-    :visible.sync="dialogVisible"
-    :title="title"
-    width="70%"
-    top="10vh"
-    append-to-body
-    class="bpmn-node-user-dialog"
-    @close="closeDialog"
-    @open="getFormData"
-  >
-    <!--表单规则-->
-    <!-- <form-condition
-      v-model="condition"
-    /> -->
-    <!--用户设置-->
-    <user-setting
-      v-model="userCalcs"
-      :plugin-type-options="pluginTypeOptions"
-      :logic-cal-options="logicCalOptions"
-      :extract-optins="extractOptins"
-    />
+    <el-dialog
+        :visible.sync="dialogVisible"
+        :title="title"
+        width="70%"
+        top="10vh"
+        append-to-body
+        class="bpmn-node-user-dialog"
+        @close="closeDialog"
+        @open="getFormData"
+    >
+        <!--表单规则-->
+        <!-- <form-condition
+            v-model="condition"
+        /> -->
+        <!--用户设置-->
+        <user-setting
+            v-model="userCalcs"
+            :plugin-type-options="pluginTypeOptions"
+            :logic-cal-options="logicCalOptions"
+            :extract-optins="extractOptins"
+        />
 
-    <div slot="footer" class="el-dialog--center">
-      <ibps-toolbar
-        :actions="toolbars"
-        @action-event="handleActionEvent"
-      />
-    </div>
-  </el-dialog>
+        <div slot="footer" class="el-dialog--center">
+            <ibps-toolbar
+                :actions="toolbars"
+                @action-event="handleActionEvent"
+            />
+        </div>
+    </el-dialog>
 </template>
 
 <script>
@@ -36,142 +36,146 @@ import UserSetting from './user-setting'
 import { pluginTypeOptions, logicCalOptions, extractOptins } from './user-setting/constants'
 
 export default {
-  components: {
-    // FormCondition,
-    UserSetting
-  },
-  props: {
-    visible: {
-      type: Boolean,
-      default: false
+    components: {
+        // FormCondition,
+        UserSetting
     },
-    title: String,
-    data: {
-      type: Object
-    }
-  },
-  data() {
-    return {
-      pluginTypeOptions,
-      logicCalOptions,
-      extractOptins,
-      dialogVisible: this.visible,
-      userCalcs: [],
-      condition: {},
-      buttonDisable: false,
-      toolbars: [
-        { key: 'confirm', label: '确定' },
-        { key: 'cancel' }
-      ]
-    }
-  },
-  computed: {
-    pluginTypeMap() {
-      const pluginTypeMap = {}
-      this.pluginTypeOptions.forEach(item => {
-        pluginTypeMap[item.value] = item
-      })
-      return pluginTypeMap
+    props: {
+        visible: {
+            type: Boolean,
+            default: false
+        },
+        title: String,
+        data: {
+            type: Object
+        },
+        users: {
+            type: Array,
+            default: () => []
+        }
     },
-    logicCalMap() {
-      const logicCalMap = {}
-      this.logicCalOptions.forEach(item => {
-        logicCalMap[item.value] = item
-      })
-      return logicCalMap
-    }
-  },
-  watch: {
-    visible: {
-      handler: function(val, oldVal) {
-        this.buttonDisable = false
-        this.dialogVisible = this.visible
-      },
-      immediate: true
-    }
-  },
-  methods: {
-    handleActionEvent({ key }) {
-      switch (key) {
-        case 'confirm':
-          this.handleConfirm()
-          break
-        case 'cancel':
-          this.closeDialog()
-          break
-        default:
-          break
-      }
+    data () {
+        return {
+            pluginTypeOptions,
+            logicCalOptions,
+            extractOptins,
+            dialogVisible: this.visible,
+            userCalcs: [],
+            condition: {},
+            buttonDisable: false,
+            toolbars: [
+                { key: 'confirm', label: '确定' },
+                { key: 'cancel' }
+            ]
+        }
     },
-    // 关闭当前窗口
-    closeDialog() {
-      this.buttonDisable = true
-      this.$emit('close', false)
+    computed: {
+        pluginTypeMap () {
+            const pluginTypeMap = {}
+            this.pluginTypeOptions.forEach(item => {
+                pluginTypeMap[item.value] = item
+            })
+            return pluginTypeMap
+        },
+        logicCalMap () {
+            const logicCalMap = {}
+            this.logicCalOptions.forEach(item => {
+                logicCalMap[item.value] = item
+            })
+            return logicCalMap
+        }
     },
-    getDescription() {
-      // 规则拼装
-      // ==============TODO:人员规则====
-      // 拼装描述
+    watch: {
+        visible: {
+            handler: function (val, oldVal) {
+                this.buttonDisable = false
+                this.dialogVisible = this.visible
+            },
+            immediate: true
+        }
+    },
+    methods: {
+        handleActionEvent ({ key }) {
+            switch (key) {
+                case 'confirm':
+                    this.handleConfirm()
+                    break
+                case 'cancel':
+                    this.closeDialog()
+                    break
+                default:
+                    break
+            }
+        },
+        // 关闭当前窗口
+        closeDialog () {
+            this.buttonDisable = true
+            this.$emit('close', false)
+        },
+        getDescription () {
+            // 规则拼装
+            // ==============TODO:人员规则====
+            // 拼装描述
 
-      let description = ''
-      this.userCalcs.forEach((item) => {
-        description = description + '【' + this.pluginTypeMap[item.pluginType].label + '】' +
+            let description = ''
+            this.userCalcs.forEach((item) => {
+                description = description + '【' + this.pluginTypeMap[item.pluginType].label + '】' +
                    item.description + '(' + this.logicCalMap[item.logicCal].label + ') ; '
-      })
+            })
 
-      return description
-    },
-    handleConfirm() {
-      if (this.buttonDisable) {
-        return
-      }
-      if (this.userCalcs.length < 1) {
-        this.$message.closeAll()
-        this.$message({
-          message: '请添加人员配置项',
-          type: 'warning'
-        })
-        return
-      }
-      for (var i = 0; i < this.userCalcs.length; i++) {
-        // 如果 配置条件为空 则return
-        if (!this.userCalcs[i]['description']) {
-          this.$message.closeAll()
-          this.$message({
-            message: `第${i + 1}行人员配置无效,请检查。`,
-            type: 'warning'
-          })
-          return
+            return description
+        },
+        handleConfirm () {
+            if (this.buttonDisable) {
+                return
+            }
+            if (this.userCalcs.length < 1) {
+                this.$message.closeAll()
+                this.$message({
+                    message: '请添加人员配置项',
+                    type: 'warning'
+                })
+                return
+            }
+            for (var i = 0; i < this.userCalcs.length; i++) {
+                // 如果 配置条件为空 则return
+                if (!this.userCalcs[i]['description']) {
+                    this.$message.closeAll()
+                    this.$message({
+                        message: `第${i + 1}行人员配置无效,请检查。`,
+                        type: 'warning'
+                    })
+                    return
+                }
+            }
+            const data = {
+                calcs: this.userCalcs,
+                condition: this.condition,
+                conditionMode: '',
+                description: this.getDescription(),
+                groupNo: this.data.groupNo ? this.data.groupNo : this.users.length ? this.users.length + 1 : 1
+            }
+            this.$emit('callback', data)
+            this.closeDialog()
+        },
+        getFormData () {
+            if (this.$utils.isNotEmpty(this.data)) {
+                this.condition = JSON.parse(JSON.stringify(this.data.condition))
+                this.userCalcs = JSON.parse(JSON.stringify(this.data.calcs))
+            } else {
+                this.condition = {}
+                this.userCalcs = []
+            }
         }
-      }
-      const data = {
-        calcs: this.userCalcs,
-        condition: this.condition,
-        conditionMode: '',
-        description: this.getDescription(),
-        groupNo: this.data.groupNo || 1
-      }
-      this.$emit('callback', data)
-      this.closeDialog()
-    },
-    getFormData() {
-      if (this.$utils.isNotEmpty(this.data)) {
-        this.condition = JSON.parse(JSON.stringify(this.data.condition))
-        this.userCalcs = JSON.parse(JSON.stringify(this.data.calcs))
-      } else {
-        this.condition = {}
-        this.userCalcs = []
-      }
     }
-  }
 }
 </script>
 <style lang="scss">
 .bpmn-node-user-dialog{
- .el-dialog{
-  .el-dialog__body{
-    height: 60vh;
-  }
-  }
+    .el-dialog{
+        .el-dialog__body{
+            height: 60vh;
+        }
+    }
 }
 </style>

+ 105 - 104
src/business/platform/bpmn/setting/bpmn-setting/components/user-rules.vue

@@ -1,118 +1,119 @@
 <template>
-  <div>
-    <div class="buttons ibps-pb-5 ibps-tr">
-      <el-button type="success" size="mini" plain icon="el-icon-circle-plus-outline" @click="handleAddUser">添加人员</el-button>
-      <el-button  size="mini" plain icon="el-icon-circle-close" type="danger" @click="cleanUser">清空人员</el-button>
+    <div>
+        <div class="buttons ibps-pb-5 ibps-tr">
+            <el-button type="success" size="mini" plain icon="el-icon-circle-plus-outline" @click="handleAddUser">添加人员</el-button>
+            <el-button size="mini" plain icon="el-icon-circle-close" type="danger" @click="cleanUser">清空人员</el-button>
+        </div>
+        <el-table ref="elTable" :data="users" border style="width: 100%">
+            <el-table-column
+                type="index"
+                width="50"
+                label="序号"
+            />
+            <el-table-column prop="description" label="条件" />
+            <el-table-column align="center" prop="groupNo" width="80" label="批次">
+                <template slot-scope="scope">
+                    <el-input
+                        v-model="scope.row.groupNo"
+                        type="number"
+                        placeholder="批次"
+                    />
+                </template>
+            </el-table-column>
+            <el-table-column align="center" label="管理" width="100">
+                <template slot-scope="scope">
+                    <el-button type="text" size="small" @click="editUser(scope.$index)">编辑</el-button>
+                    <el-button type="text" size="small" @click="removeUser(scope.$index)">删除</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <user-condition-setting
+            :title="title"
+            :data.sync="editData"
+            :users="users"
+            :visible="dialogFormVisible"
+            @callback="handleUserData"
+            @close="visible => dialogFormVisible = false"
+        />
     </div>
-    <el-table ref="elTable" :data="users" border style="width: 100%">
-      <el-table-column
-        type="index"
-        width="50"
-        label="序号"
-      />
-      <el-table-column prop="description" label="条件" />
-      <el-table-column align="center" prop="groupNo" width="80" label="批次">
-        <template slot-scope="scope">
-          <el-input
-            v-model="scope.row.groupNo"
-            type="number"
-            placeholder="批次"
-          />
-        </template>
-      </el-table-column>
-      <el-table-column align="center" label="管理" width="100">
-        <template slot-scope="scope">
-          <el-button type="text" size="small" @click="editUser(scope.$index)">编辑</el-button>
-          <el-button type="text" size="small" @click="removeUser(scope.$index)">删除</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-    <user-condition-setting
-      :title="title"
-      :data.sync="editData"
-      :visible="dialogFormVisible"
-      @callback="handleUserData"
-      @close="visible => dialogFormVisible = false"
-    />
-  </div>
 </template>
 <script>
 import { defaultsDeep } from 'lodash'
 import UserConditionSetting from './user-condition-setting'
 export default {
-  components: {
-    UserConditionSetting
-  },
-  props: {
-    data: Array,
-    title: String
-  },
-  data() {
-    return {
-      dialogFormVisible: false,
-      defaultValue: {},
-      editIndex: -1,
-      editData: {},
-      editTitle: ''
-    }
-  },
-  computed: {
-    users() {
-      return this.data
-    }
-  },
-  watch: {
-    users: {
-      handler() {
-        this.$nextTick(() => {
-          setTimeout(() => {
-            this.$refs.elTable.doLayout()
-          }, 10)
-        })
-      },
-      immediate: true
-    }
-  },
-  beforeDestroy() {
-    this.editData = null
-  },
-  methods: {
-    handleAddUser() {
-      this.editData = {}
-      this.editIndex = -1
-      this.dialogFormVisible = true
+    components: {
+        UserConditionSetting
+    },
+    props: {
+        data: Array,
+        title: String
+    },
+    data () {
+        return {
+            dialogFormVisible: false,
+            defaultValue: {},
+            editIndex: -1,
+            editData: {},
+            editTitle: ''
+        }
     },
-    // 新增编辑人员设置
-    editUser(index) {
-      const data = this.$utils.isNotEmpty(index) ? this.users[index] : {}
-      this.editData = defaultsDeep(JSON.parse(JSON.stringify(data)), this.defaultValue)
-      this.editIndex = this.$utils.isNotEmpty(index) ? index : -1
-      this.dialogFormVisible = true
+    computed: {
+        users () {
+            return this.data
+        }
     },
-    // 删除单行人员设置
-    removeUser(index) {
-      this.users.splice(index, 1)
+    watch: {
+        users: {
+            handler () {
+                this.$nextTick(() => {
+                    setTimeout(() => {
+                        this.$refs.elTable.doLayout()
+                    }, 10)
+                })
+            },
+            immediate: true
+        }
     },
-    // 清空人员设置
-    cleanUser() {
-      this.$confirm('是否清空人员设置?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        this.users.splice(0, this.users.length)
-      })
+    beforeDestroy () {
+        this.editData = null
     },
-    /**
-     * 处理数据
-     */
-    handleUserData(data) {
-      if (this.editIndex > -1) {
-        this.users.splice(this.editIndex, 1, data)
-      } else {
-        this.users.push(data)
-      }
+    methods: {
+        handleAddUser () {
+            this.editData = {}
+            this.editIndex = -1
+            this.dialogFormVisible = true
+        },
+        // 新增编辑人员设置
+        editUser (index) {
+            const data = this.$utils.isNotEmpty(index) ? this.users[index] : {}
+            this.editData = defaultsDeep(JSON.parse(JSON.stringify(data)), this.defaultValue)
+            this.editIndex = this.$utils.isNotEmpty(index) ? index : -1
+            this.dialogFormVisible = true
+        },
+        // 删除单行人员设置
+        removeUser (index) {
+            this.users.splice(index, 1)
+        },
+        // 清空人员设置
+        cleanUser () {
+            this.$confirm('是否清空人员设置?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                this.users.splice(0, this.users.length)
+            })
+        },
+        /**
+         * 处理数据
+         */
+        handleUserData (data) {
+            if (this.editIndex > -1) {
+                this.users.splice(this.editIndex, 1, data)
+            } else {
+                this.users.push(data)
+            }
+        }
     }
-  }
 }
 </script>

+ 0 - 1
src/business/platform/bpmn/setting/bpmn-setting/settings/button-setting.vue

@@ -112,7 +112,6 @@ export default {
         // }
         buttons: {
             get (v) {
-                console.log(this.data)
                 return this.data || []
             },
             set (value) {

+ 337 - 338
src/views/platform/bo/boDef/edit/detail/object-attr/edit.vue

@@ -1,150 +1,150 @@
 <template>
-  <el-dialog
-    :title="title"
-    :visible.sync="dialogVisible"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    append-to-body
-    class="bo-attr-dialog"
-    top="13vh"
-    width="65%"
-    @open="getFormData"
-    @close="closeDialog"
-  >
-    <el-tabs v-model="activeName" @tab-click="handleClick">
-      <el-tab-pane label="属性信息" name="attInfo">
-        <el-form
-          ref="form"
-          v-loading="dialogLoading"
-          :element-loading-text="$t('common.loading')"
-          :model="form"
-          :rules="rules"
-          :label-width="formLabelWidth"
-          @submit.native.prevent
-        >
-          <el-row>
-            <el-col :span="24">
-              <el-form-item label="名称:" prop="name">
-                <el-input
-                    ref="formNameCont"
-                  v-model="form.name"
-                  v-pinyin="{vm:form,config:{format:'WITHOUT_TONE'},py:[{key:'code',camelCase:true},{key:'fieldName',separator:'_',separatorEnd:true}]}"
-                  @blur="validateFormField"
-                />
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="编码" prop="code" class="forms" @keyup.enter.native="handleSave('apply')">
-                <span class="forms-span">
-                  <el-tooltip
-                    class="item"
-                    effect="light"
-                    content="驼峰命名法:sysData、uesrId"
-                    placement="bottom"
-                  >
-                    <ibps-icon name="exclamation-circle" class="forms-icon" @keyup.enter.native="handleSave('apply')" />
-                  </el-tooltip>:
-                </span>
-                <el-input v-model="form.code" :disabled="!form.edit&&isCreateTable==='Y'" @keyup.enter.native="handleSave('apply')"/>
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="字段" prop="fieldName" class="forms">
-                <span class="forms-span">
-                  <el-tooltip
-                    class="item"
-                    effect="light"
-                    content="下划线分隔:sys_data_"
-                    placement="bottom"
-                  >
-                    <ibps-icon name="exclamation-circle" class="forms-icon" />
-                  </el-tooltip>:
-                </span>
-                <el-input v-model="form.fieldName" :disabled="!form.edit&&isCreateTable==='Y'"  @keyup.enter.native="handleSave('apply')"/>
-              </el-form-item>
-            </el-col>
-            <el-col :span="24">
-              <el-form-item label="描述:" prop="desc">
-                <el-input v-model="form.desc" type="textarea" @keyup.enter.native="handleSave('apply')" />
-              </el-form-item>
-            </el-col>
-            <el-col v-if="false" :span="12">
-              <el-form-item label="是否允许为空:" prop="isNull">
-                <el-radio-group v-model="form.isNull">
-                  <el-radio label="Y">是</el-radio>
-                  <el-radio label="N">否</el-radio>
-                </el-radio-group>
-              </el-form-item>
-            </el-col>
-            <el-col v-if="false" :span="12">
-              <el-form-item label="默认值" prop="defValue" class="forms">
-                <span class="forms-span">
-                  <el-tooltip effect="light" placement="bottom">
-                    <div slot="content">
-                      日期型默认值只支持函数值,例:<br>
-                      oracle的sysdate;<br>
-                      mysql的current_timestamp;<br>
-                      sqlserver的getdate();
-                    </div>
-                    <ibps-icon name="exclamation-circle" class="forms-icon" @keyup.enter.native="handleSave('apply')"/>
-                  </el-tooltip>:
-                </span>
-                <el-input v-model="form.defValue" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="数据类型:" prop="dataType">
-                <el-select
-                @keyup.enter.native="handleSave('apply')"
-                  v-if="!readonly"
-                  v-model="form.dataType"
-                  placeholder="请选择"
-                  style="width:100%;"
-                  :disabled="!form.edit&&isCreateTable==='Y'"
-                  @change="dataType()"
+    <el-dialog
+        :title="title"
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        append-to-body
+        class="bo-attr-dialog"
+        top="13vh"
+        width="65%"
+        @open="getFormData"
+        @close="closeDialog"
+    >
+        <el-tabs v-model="activeName" @tab-click="handleClick">
+            <el-tab-pane label="属性信息" name="attInfo">
+                <el-form
+                    ref="form"
+                    v-loading="dialogLoading"
+                    :element-loading-text="$t('common.loading')"
+                    :model="form"
+                    :rules="rules"
+                    :label-width="formLabelWidth"
+                    @submit.native.prevent
                 >
-                  <el-option
-                    v-for="option in typeOptions"
-                    :key="option.value"
-                    :label="option.label"
-                    :value="option.value"
-                  />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item v-if="form.dataType==='varchar'||form.dataType==='number'" label="属性长度:" prop="attrLength">
-                <el-input v-model="form.attrLength" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item v-if="form.dataType==='date'" label="日期格式:" prop="format">
-                <el-select v-model="form.format" placeholder="请选择" style="width:100%;">
-                  <el-option
-                    v-for="option in formatOptions"
-                    :key="option.value"
-                    :label="option.label"
-                    :value="option.value"
-                  />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item v-if="form.dataType==='number'" label="小数位数:" prop="precision">
-                <el-input v-model="form.precision" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-      </el-tab-pane>
-    </el-tabs>
-    <div slot="footer" class="el-dialog--center">
-      <ibps-toolbar
-        :actions="toolbars"
-        @action-event="handleActionEvent"
-      />
-    </div>
-  </el-dialog>
+                    <el-row>
+                        <el-col :span="24">
+                            <el-form-item label="名称:" prop="name">
+                                <el-input
+                                    ref="formNameCont"
+                                    v-model="form.name"
+                                    v-pinyin="{vm:form,config:{format:'WITHOUT_TONE'},py:[{key:'code',camelCase:true},{key:'fieldName',separator:'_',separatorEnd:true}]}"
+                                    @blur="validateFormField"
+                                />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="12">
+                            <el-form-item label="编码" prop="code" class="forms" @keyup.enter.native="handleSave('apply')">
+                                <span class="forms-span">
+                                    <el-tooltip
+                                        class="item"
+                                        effect="light"
+                                        content="驼峰命名法:sysData、uesrId"
+                                        placement="bottom"
+                                    >
+                                        <ibps-icon name="exclamation-circle" class="forms-icon" @keyup.enter.native="handleSave('apply')" />
+                                    </el-tooltip>:
+                                </span>
+                                <el-input v-model="form.code" :disabled="!form.edit&&isCreateTable==='Y'" @keyup.enter.native="handleSave('apply')" />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="12">
+                            <el-form-item label="字段" prop="fieldName" class="forms">
+                                <span class="forms-span">
+                                    <el-tooltip
+                                        class="item"
+                                        effect="light"
+                                        content="下划线分隔:sys_data_"
+                                        placement="bottom"
+                                    >
+                                        <ibps-icon name="exclamation-circle" class="forms-icon" />
+                                    </el-tooltip>:
+                                </span>
+                                <el-input v-model="form.fieldName" :disabled="!form.edit&&isCreateTable==='Y'" @keyup.enter.native="handleSave('apply')" />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24">
+                            <el-form-item label="描述:" prop="desc">
+                                <el-input v-model="form.desc" type="textarea" @keyup.enter.native="handleSave('apply')" />
+                            </el-form-item>
+                        </el-col>
+                        <el-col v-if="false" :span="12">
+                            <el-form-item label="是否允许为空:" prop="isNull">
+                                <el-radio-group v-model="form.isNull">
+                                    <el-radio label="Y">是</el-radio>
+                                    <el-radio label="N">否</el-radio>
+                                </el-radio-group>
+                            </el-form-item>
+                        </el-col>
+                        <el-col v-if="false" :span="12">
+                            <el-form-item label="默认值" prop="defValue" class="forms">
+                                <span class="forms-span">
+                                    <el-tooltip effect="light" placement="bottom">
+                                        <div slot="content">
+                                            日期型默认值只支持函数值,例:<br>
+                                            oracle的sysdate;<br>
+                                            mysql的current_timestamp;<br>
+                                            sqlserver的getdate();
+                                        </div>
+                                        <ibps-icon name="exclamation-circle" class="forms-icon" @keyup.enter.native="handleSave('apply')" />
+                                    </el-tooltip>:
+                                </span>
+                                <el-input v-model="form.defValue" />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="12">
+                            <el-form-item label="数据类型:" prop="dataType">
+                                <el-select
+                                    v-if="!readonly"
+                                    v-model="form.dataType"
+                                    placeholder="请选择"
+                                    style="width:100%;"
+                                    :disabled="!form.edit&&isCreateTable==='Y'"
+                                    @keyup.enter.native="handleSave('apply')"
+                                    @change="dataType()"
+                                >
+                                    <el-option
+                                        v-for="option in typeOptions"
+                                        :key="option.value"
+                                        :label="option.label"
+                                        :value="option.value"
+                                    />
+                                </el-select>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="12">
+                            <el-form-item v-if="form.dataType==='varchar'||form.dataType==='number'" label="属性长度:" prop="attrLength">
+                                <el-input v-model="form.attrLength" />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="12">
+                            <el-form-item v-if="form.dataType==='date'" label="日期格式:" prop="format">
+                                <el-select v-model="form.format" placeholder="请选择" style="width:100%;">
+                                    <el-option
+                                        v-for="option in formatOptions"
+                                        :key="option.value"
+                                        :label="option.label"
+                                        :value="option.value"
+                                    />
+                                </el-select>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="12">
+                            <el-form-item v-if="form.dataType==='number'" label="小数位数:" prop="precision">
+                                <el-input v-model="form.precision" />
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                </el-form>
+            </el-tab-pane>
+        </el-tabs>
+        <div slot="footer" class="el-dialog--center">
+            <ibps-toolbar
+                :actions="toolbars"
+                @action-event="handleActionEvent"
+            />
+        </div>
+    </el-dialog>
 </template>
 
 <script>
@@ -152,217 +152,216 @@ import { typeOptions, formatOptions, objectAttrRootData } from '../../../constan
 import { validateInteger, testField } from '@/utils/validate'
 import ActionUtils from '@/utils/action'
 
-const uuid =()=>{
-  return  require('uuid').v1()
+const uuid = () => {
+    return require('uuid').v1()
 }
 
 export default {
-  props: {
-    visible: {
-      type: Boolean,
-      default: false
-    },
-    readonly: {
-      type: Boolean,
-      default: false
-    },
-    id: String,
-    title: String,
-    datas: Object,
-    isCreateTable: {
-      type: String,
-      default: 'N'
+    props: {
+        visible: {
+            type: Boolean,
+            default: false
+        },
+        readonly: {
+            type: Boolean,
+            default: false
+        },
+        id: String,
+        title: String,
+        datas: Object,
+        isCreateTable: {
+            type: String,
+            default: 'N'
+        },
+        clear: {
+            type: Boolean,
+            default: false
+        }
     },
-    clear: {
-      type: Boolean,
-      default: false
-    }
-  },
-  data() {
-    return {
-      activeName: 'attInfo',
-      formName: 'form',
-      formLabelWidth: '120px',
-      dialogVisible: this.visible,
-      dialogLoading: false,
-      format: false,
-      apply: true,
-      typeOptions: typeOptions,
-      formatOptions: formatOptions,
-      defaultForm: {},
-      form: objectAttrRootData,
-      rules: {
-        name: [{ required: true, message: this.$t('validate.required') },
-          { min: 1, max: 64, message: '长度不能超过64个字符', trigger: 'blur' }],
-        code: [
-          { required: true, message: this.$t('validate.required') },
-          { validator: testField, trigger: 'blur' }
-        ],
-        fieldName: [
-          { required: true, message: this.$t('validate.required') },
-          { validator: testField, trigger: 'blur' }
-        ],
-        dataType: [{ required: true, message: this.$t('validate.required') }],
-        format: [{ required: true, message: this.$t('validate.required') }],
-        attrLength: [{ required: true, message: this.$t('validate.required') }, { validator: validateInteger, trigger: 'blur' }],
-        precision: [{ required: true, message: this.$t('validate.required') }, { validator: validateInteger, trigger: 'blur' }]
-      },
-      toolbars: [
-        { key: 'save', type: 'success', label: '应用', hidden: () => { return !this.apply } },
-        { key: 'confirm' },
-        { key: 'cancel' }
-      ]
-    }
-  },
-  computed: {
-    formId() {
-      return this.id
+    data () {
+        return {
+            activeName: 'attInfo',
+            formName: 'form',
+            formLabelWidth: '120px',
+            dialogVisible: this.visible,
+            dialogLoading: false,
+            format: false,
+            apply: true,
+            typeOptions: typeOptions,
+            formatOptions: formatOptions,
+            defaultForm: {},
+            form: objectAttrRootData,
+            rules: {
+                name: [{ required: true, message: this.$t('validate.required') },
+                    { min: 1, max: 64, message: '长度不能超过64个字符', trigger: 'blur' }],
+                code: [
+                    { required: true, message: this.$t('validate.required') },
+                    { validator: testField, trigger: 'blur' }
+                ],
+                fieldName: [
+                    { required: true, message: this.$t('validate.required') },
+                    { validator: testField, trigger: 'blur' }
+                ],
+                dataType: [{ required: true, message: this.$t('validate.required') }],
+                format: [{ required: true, message: this.$t('validate.required') }],
+                attrLength: [{ required: true, message: this.$t('validate.required') }, { validator: validateInteger, trigger: 'blur' }],
+                precision: [{ required: true, message: this.$t('validate.required') }, { validator: validateInteger, trigger: 'blur' }]
+            },
+            toolbars: [
+                { key: 'save', type: 'success', label: '应用', hidden: () => { return !this.apply } },
+                { key: 'confirm' },
+                { key: 'cancel' }
+            ]
+        }
     },
-    formData() {
-      return this.datas
-    }
-  },
-  watch: {
-    visible: {
-      handler: function(val, oldVal) {
-        this.dialogVisible = this.visible
-      },
-      immediate: true
-    }
-  },
-  created() {
-    this.defaultForm = JSON.parse(JSON.stringify(this.form))
-  },
-  methods: {
-    handleActionEvent({ key }) {
-      switch (key) {
-        case 'save':
-          this.handleSave('apply')
-          break
-        case 'confirm':
-          this.handleSave('confirm')
-          break
-        case 'cancel':
-          this.closeDialog()
-          break
-        default:
-          break
-      }
+    computed: {
+        formId () {
+            return this.id
+        },
+        formData () {
+            return this.datas
+        }
     },
-    dataType() {
-      if (this.form.dataType === 'date') {
-        this.form.format = 'yyyy-MM-dd'
-      }
-      if (this.form.dataType === 'varchar') {
-        this.form.attrLength = '200'
-      }
-      if (this.form.dataType === 'number') {
-        this.form.attrLength = '20'
-      }
+    watch: {
+        visible: {
+            handler: function (val, oldVal) {
+                this.dialogVisible = this.visible
+            },
+            immediate: true
+        }
     },
-    handleClick(tab, event) {
-      console.log(tab, event)
+    created () {
+        this.defaultForm = JSON.parse(JSON.stringify(this.form))
     },
-    // 保存数据
-    handleSave(buttonKey) {
-      if ((this.form.code && this.form.code !== this.form.code.trim()) ||
-        (this.form.fieldName && this.form.fieldName !== this.form.fieldName.trim())) {
-        this.$message({
-          message: '编码和字段首尾不能存在空格,请删除后再进行保存操作',
-          type: 'warning'
-        })
-        return
-      }
-       if (this.form.code.length > 17) {
-      	    this.form.code = this.form.code.slice(0, 17)
-      	  }
-      	  if (this.form.fieldName.length > 17) {
-      	    this.form.fieldName = this.form.fieldName.slice(0, 17)
-      	  }
-      this.$refs[this.formName].validate(valid => {
-        if (valid) {
-          this.$emit('callback', this.form, buttonKey)
-          this.$nextTick(() => {
-            if (!this.clear) {
-              this.form = JSON.parse(JSON.stringify(this.defaultForm))
+    methods: {
+        handleActionEvent ({ key }) {
+            switch (key) {
+                case 'save':
+                    this.handleSave('apply')
+                    break
+                case 'confirm':
+                    this.handleSave('confirm')
+                    break
+                case 'cancel':
+                    this.closeDialog()
+                    break
+                default:
+                    break
+            }
+        },
+        dataType () {
+            if (this.form.dataType === 'date') {
+                this.form.format = 'yyyy-MM-dd'
+            }
+            if (this.form.dataType === 'varchar') {
+                this.form.attrLength = '200'
+            }
+            if (this.form.dataType === 'number') {
+                this.form.attrLength = '20'
+            }
+        },
+        handleClick (tab, event) {
+            console.log(tab, event)
+        },
+        // 保存数据
+        handleSave (buttonKey) {
+            if ((this.form.code && this.form.code !== this.form.code.trim()) || (this.form.fieldName && this.form.fieldName !== this.form.fieldName.trim())) {
+                this.$message({
+                    message: '编码和字段首尾不能存在空格,请删除后再进行保存操作',
+                    type: 'warning'
+                })
+                return
             }
-          })
-          if (buttonKey !== 'apply') {
+            if (this.form.code.length > 17) {
+                this.form.code = this.form.code.slice(0, 17)
+            }
+            if (this.form.fieldName.length > 17) {
+                this.form.fieldName = this.form.fieldName.slice(0, 17)
+            }
+            this.$refs[this.formName].validate(valid => {
+                if (valid) {
+                    this.$emit('callback', this.form, buttonKey)
+                    this.$nextTick(() => {
+                        if (!this.clear) {
+                            this.form = JSON.parse(JSON.stringify(this.defaultForm))
+                        }
+                    })
+                    if (buttonKey !== 'apply') {
+                        this.$nextTick(() => {
+                            if (!this.clear) {
+                                this.closeDialog()
+                            }
+                        })
+                    }
+                } else {
+                    ActionUtils.saveErrorMessage()
+                }
+            })
             this.$nextTick(() => {
-              if (!this.clear) {
-                this.closeDialog()
-              }
+                this.$refs.formNameCont.focus()
             })
-          }
-        } else {
-          ActionUtils.saveErrorMessage()
-        }
-      })
-      this.$nextTick(()=>{
-      	         this.$refs.formNameCont.focus();
-      	      })
-    },
-    // 关闭当前窗口
-    closeDialog() {
-      this.format = false
-      this.$emit('close', false)
-    },
-    /**
-     * 表单验证
-     */
-    formValidate() {
-      if (this.readonly) return
-      this.$nextTick(() => {
-        this.$refs[this.formName].validate(() => {})
-      })
-    },
-    validateFormField() {
-      setTimeout(() => {
-        if (this.$refs['form']) {
-          this.$refs['form'].validateField('code')
-          this.$refs['form'].validateField('fieldName')
+        },
+        // 关闭当前窗口
+        closeDialog () {
+            this.format = false
+            this.$emit('close', false)
+        },
+        /**
+         * 表单验证
+         */
+        formValidate () {
+            if (this.readonly) return
+            this.$nextTick(() => {
+                this.$refs[this.formName].validate(() => {})
+            })
+        },
+        validateFormField () {
+            setTimeout(() => {
+                if (this.$refs['form']) {
+                    this.$refs['form'].validateField('code')
+                    this.$refs['form'].validateField('fieldName')
+                }
+            }, 50)
+        },
+        /**
+         * 获取表单数据
+         */
+        getFormData () {
+            if (this.$utils.isEmpty(this.formId)) {
+                // 重置表单
+                this.form = JSON.parse(JSON.stringify(this.defaultForm))
+                this.formValidate()
+                this.apply = true
+                return
+            }
+            this.form = JSON.parse(JSON.stringify(this.formData))
+            this.apply = false
+            if (!this.$utils.isEmpty(this.form.format)) {
+                this.format = true
+            }
         }
-      }, 50)
-    },
-    /**
-     * 获取表单数据
-     */
-    getFormData() {
-      if (this.$utils.isEmpty(this.formId)) {
-        // 重置表单
-        this.form = JSON.parse(JSON.stringify(this.defaultForm))
-        this.formValidate()
-        this.apply = true
-        return
-      }
-      this.form = JSON.parse(JSON.stringify(this.formData))
-      this.apply = false
-      if (!this.$utils.isEmpty(this.form.format)) {
-        this.format = true
-      }
     }
-  }
 
 }
 </script>
 <style lang="scss">
-.bo-attr-dialog{
-  .el-dialog__body{
-    padding: 15px 20px;
-    .forms{
-      position: relative;
-      label{
-        width: 90px!important;
-      }
-      .forms-span{
-        position:absolute;
-        left: -40px;
-        top: 0;
-        .forms-icon{
-          color: #337ab7;
+.bo-attr-dialog {
+    .el-dialog__body {
+        padding: 15px 20px;
+        .forms {
+            position: relative;
+            label {
+                width: 90px !important;
+            }
+            .forms-span {
+                position: absolute;
+                left: -40px;
+                top: 0;
+                .forms-icon {
+                    color: #337ab7;
+                }
+            }
         }
-      }
     }
-  }
 }
 </style>