فهرست منبع

task-1251 首页系统指引查询功能优化

cfort 2 سال پیش
والد
کامیت
fe4ef0a3c0

+ 174 - 174
src/views/platform/org/components/attr/attr-form.vue

@@ -1,192 +1,192 @@
 <template>
-  <el-form
-    ref="form"
-    :model="formData"
-    :inline="inline"
-    :label-width="labelWidth ? (labelWidth + 'px') : ''"
-    @keyup.enter.native="handleEnter"
-  >
-    <el-form-item
-      v-for="(form, index) in forms"
-      :key="index"
-      :prop="form.prop"
-      :label="form.label"
-      :rules="form.rules || []"
-      :label-width="form.labelWidth ? (form.labelWidth + 'px') : ''"
-      class="attr-form"
-      @submit.native.prevent
+    <el-form
+        ref="form"
+        :model="formData"
+        :inline="inline"
+        :label-width="labelWidth ? (labelWidth + 'px') : ''"
+        @keyup.enter.native="handleEnter"
     >
-      <!-- 文本框-->
-      <el-input
-        v-if="form.fieldType === 'STRING' || form.fieldType === 'INT' || form.fieldType === 'DOUBLE' || form.fieldType === undefined"
-        v-model="formData[form.modelValue]"
-        :size="form.size ? form.size : size"
-        :readonly="form.readonly"
-        :disabled="disabled"
-        :placeholder="form.placeholder"
-        :clearable="form.clearable||true"
-        :style="itemStyle + (form.itemWidth ? `width: ${form.itemWidth}px;` : '')"
-      />
-      <el-switch
-        v-else-if="form.fieldType === 'BOOLEAN'"
-        v-model="formData[form.modelValue]"
-        :size="form.size ? form.size : size"
-        :disabled="disabled"
-        :style="itemStyle + (form.itemWidth ? `width: ${form.itemWidth}px;` : '')"
-        active-value="Y"
-        inactive-value="N"
-      />
-      <!--选项 option-->
-      <el-select
-        v-else-if="form.fieldType === 'OPTION'"
-        v-model="formData[form.modelValue]"
-        :size="form.size ? form.size : size"
-        :disabled="disabled"
-        :placeholder="form.placeholder"
-        :clearable="form.clearable||true"
-        :multiple="form.multiple||false"
-        :style="itemStyle + (form.itemWidth ? `width: ${form.itemWidth}px;` : '')"
-      >
-        <el-option
-          v-for="(option, optionIndex) in form.options"
-          :key="optionIndex"
-          :value="(typeof option === 'object') ? option[form.valueKey || 'value'] : option"
-          :label="(typeof option === 'object') ? option[form.labelKey || 'groupName'] : option"
-        />
-      </el-select>
-      <!-- 日期-->
-      <el-date-picker
-        v-else-if="form.fieldType === 'DATE'"
-        v-model="formData[form.modelValue]"
-        :placeholder="form.placeholder"
-        :size="form.size ? form.size : size"
-        :disabled="disabled"
-        :readonly="form.readonly"
-        :editable="form.editable"
-        :clearable="form.clearable||true"
-        :style="itemStyle + (form.itemWidth ? `width: ${form.itemWidth}px;` : '')"
-        :picker-options="form.pickerOptions || {}"
-        :value-format="form.valueFormat||'yyyy-MM-dd'"
-        type="date"
-      />
-    </el-form-item>
-  </el-form>
+        <el-form-item
+            v-for="(form, index) in forms"
+            :key="index"
+            :prop="form.prop"
+            :label="form.label"
+            :rules="form.rules || []"
+            :label-width="form.labelWidth ? (form.labelWidth + 'px') : ''"
+            class="attr-form"
+            @submit.native.prevent
+        >
+            <!-- 文本框-->
+            <el-input
+                v-if="form.fieldType === 'STRING' || form.fieldType === 'INT' || form.fieldType === 'DOUBLE' || form.fieldType === undefined"
+                v-model="formData[form.modelValue]"
+                :size="form.size ? form.size : size"
+                :readonly="form.readonly"
+                :disabled="disabled"
+                :placeholder="form.placeholder"
+                :clearable="form.clearable||true"
+                :style="itemStyle + (form.itemWidth ? `width: ${form.itemWidth}px;` : '')"
+            />
+            <el-switch
+                v-else-if="form.fieldType === 'BOOLEAN'"
+                v-model="formData[form.modelValue]"
+                :size="form.size ? form.size : size"
+                :disabled="disabled"
+                :style="itemStyle + (form.itemWidth ? `width: ${form.itemWidth}px;` : '')"
+                active-value="Y"
+                inactive-value="N"
+            />
+            <!--选项 option-->
+            <el-select
+                v-else-if="form.fieldType === 'OPTION'"
+                v-model="formData[form.modelValue]"
+                :size="form.size ? form.size : size"
+                :disabled="disabled"
+                :placeholder="form.placeholder"
+                :clearable="form.clearable||true"
+                :multiple="form.multiple||false"
+                :style="itemStyle + (form.itemWidth ? `width: ${form.itemWidth}px;` : '')"
+            >
+                <el-option
+                    v-for="(option, optionIndex) in form.options"
+                    :key="optionIndex"
+                    :value="(typeof option === 'object') ? option[form.valueKey || 'value'] : option"
+                    :label="(typeof option === 'object') ? option[form.labelKey || 'groupName'] : option"
+                />
+            </el-select>
+            <!-- 日期-->
+            <el-date-picker
+                v-else-if="form.fieldType === 'DATE'"
+                v-model="formData[form.modelValue]"
+                :placeholder="form.placeholder"
+                :size="form.size ? form.size : size"
+                :disabled="disabled"
+                :readonly="form.readonly"
+                :editable="form.editable"
+                :clearable="form.clearable||true"
+                :style="itemStyle + (form.itemWidth ? `width: ${form.itemWidth}px;` : '')"
+                :picker-options="form.pickerOptions || {}"
+                :value-format="form.valueFormat||'yyyy-MM-dd'"
+                type="date"
+            />
+        </el-form-item>
+    </el-form>
 </template>
 <script>
 export default {
-  props: {
+    props: {
     // 尺寸
-    size: {
-      type: String
-    },
-    // 是否在一行
-    inline: {
-      type: Boolean,
-      default: false
-    },
-    labelWidth: {
-      type: Number,
-      default: 100
-    },
-    disabled: {
-      type: Boolean,
-      default: false
-    },
-    itemWidth: [Number, String],
-    forms: {
-      type: Array,
-      required: true
+        size: {
+            type: String
+        },
+        // 是否在一行
+        inline: {
+            type: Boolean,
+            default: false
+        },
+        labelWidth: {
+            type: Number,
+            default: 100
+        },
+        disabled: {
+            type: Boolean,
+            default: false
+        },
+        itemWidth: [Number, String],
+        forms: {
+            type: Array,
+            required: true
+        },
+        data: {
+            type: Object,
+            default: () => {}
+        }
     },
-    data: {
-      type: Object,
-      default: () => {}
-    }
-  },
-  data() {
-    const { forms, fuzzy } = this.$props
-    const formData = {}
-    const format = {}
-    const fuzzyOps = {}
-    const defaultFormData = {}
+    data () {
+        const { forms, fuzzy } = this.$props
+        const formData = {}
+        const format = {}
+        const fuzzyOps = {}
+        const defaultFormData = {}
 
-    forms.forEach((v, i) => {
-      const propType = typeof v.prop
+        forms.forEach((v, i) => {
+            const propType = typeof v.prop
 
-      if (propType === 'string') {
-        v.modelValue = v.prop
-        formData[v.prop] = this.data[v.prop] || (v.fieldType === 'OPTION' && v.multiple ? [] : null)
-        fuzzyOps[v.prop] = v.fuzzy ? v.fuzzy : fuzzy
-        if (v.format) {
-          format[v.prop] = v.format
-        }
-        defaultFormData[v.prop] = (v.fieldType === 'OPTION' && v.multiple ? [] : null)
-      } else if (propType === 'object' && Object.prototype.toString.call(v.prop) === '[object Array]') {
-        v.prop.forEach(vv => {
-          formData[vv] = this.data[vv.prop] || (v.fieldType === 'OPTION' && v.multiple ? [] : null)
-          defaultFormData[vv] = (v.fieldType === 'OPTION' && v.multiple ? [] : null)
-          fuzzyOps[vv] = v.fuzzy ? v.fuzzy : fuzzy
-          if (v.format) {
-            format[vv] = v.format
-          }
+            if (propType === 'string') {
+                v.modelValue = v.prop
+                formData[v.prop] = this.data[v.prop] || (v.fieldType === 'OPTION' && v.multiple ? [] : null)
+                fuzzyOps[v.prop] = v.fuzzy ? v.fuzzy : fuzzy
+                if (v.format) {
+                    format[v.prop] = v.format
+                }
+                defaultFormData[v.prop] = (v.fieldType === 'OPTION' && v.multiple ? [] : null)
+            } else if (propType === 'object' && Object.prototype.toString.call(v.prop) === '[object Array]') {
+                v.prop.forEach(vv => {
+                    formData[vv] = this.data[vv.prop] || (v.fieldType === 'OPTION' && v.multiple ? [] : null)
+                    defaultFormData[vv] = (v.fieldType === 'OPTION' && v.multiple ? [] : null)
+                    fuzzyOps[vv] = v.fuzzy ? v.fuzzy : fuzzy
+                    if (v.format) {
+                        format[vv] = v.format
+                    }
+                })
+            }
         })
-      }
-    })
-    return {
-      formData,
-      defaultFormData
-    }
-  },
-  computed: {
-    itemStyle() {
-      const { itemWidth } = this
-      if (typeof itemWidth === 'number') {
-        return `width: ${itemWidth}px;`
-      } else if (typeof itemWidth === 'string') {
-        return `width: ${itemWidth};`
-      }
-      return ''
-    }
-  },
-  watch: {
-    data: {
-      handler: function(val, oldVal) {
-        if (val !== oldVal) {
-          this.formData = this.data
-          this.formValidate()
+        return {
+            formData,
+            defaultFormData
         }
-      },
-      deep: true
     },
-    formData: {
-      handler: function(val, oldVal) {
-        this.$emit('input', this.formData)
-        this.callback()
-      },
-      deep: true
-    }
-  },
-  methods: {
-    callback() {
-      let attrValidator = true
-      this.$refs['form'].validate((valid) => {
-        if (!valid) {
-          attrValidator = false
+    computed: {
+        itemStyle () {
+            const { itemWidth } = this
+            if (typeof itemWidth === 'number') {
+                return `width: ${itemWidth}px;`
+            } else if (typeof itemWidth === 'string') {
+                return `width: ${itemWidth};`
+            }
+            return ''
         }
-      })
-      return attrValidator
     },
-    /**
-     * 表单验证
-     */
-    formValidate() {
-      if (this.readonly) return
-      this.$nextTick(() => {
-        this.$refs['form'].validate(() => {})
-      })
+    watch: {
+        data: {
+            handler: function (val, oldVal) {
+                if (val !== oldVal) {
+                    this.formData = this.data
+                    this.formValidate()
+                }
+            },
+            deep: true
+        },
+        formData: {
+            handler: function (val, oldVal) {
+                this.$emit('input', this.formData)
+                this.callback()
+            },
+            deep: true
+        }
     },
-    clearData() {
-      this.formData = JSON.parse(JSON.stringify(this.defaultFormData))
+    methods: {
+        callback () {
+            let attrValidator = true
+            this.$refs['form'].validate((valid) => {
+                if (!valid) {
+                    attrValidator = false
+                }
+            })
+            return attrValidator
+        },
+        /**
+         * 表单验证
+         */
+        formValidate () {
+            if (this.readonly) return
+            this.$nextTick(() => {
+                this.$refs['form'].validate(() => {})
+            })
+        },
+        clearData () {
+            this.formData = JSON.parse(JSON.stringify(this.defaultFormData))
+        }
     }
-  }
 }
 </script>

+ 149 - 149
src/views/platform/org/components/attr/ext-attr.vue

@@ -1,30 +1,30 @@
 <template>
-  <div :style="{height:height+'px'}" class="position-content">
-    <el-row>
-      <el-col :span="24">
-        <div class="ibps-tools-btn">
-          <el-button type="primary" icon="ibps-icon-save" @click="saveData">保存</el-button>
-          <el-button type="info" icon="ibps-icon-clean" @click="clearData">清空</el-button>
-        </div>
-      </el-col>
-      <el-col :span="24" class="detail">
-        <attr-form
-          v-if="forms && forms.length >0"
-          ref="form"
-          :data="formData"
-          :forms="forms"
-          :item-width="100+'%'"
-          @input="handlerData"
-        />
-        <el-alert
-          v-else
-          title="无配置扩展属性"
-          type="info"
-          show-icon
-          style="height:50px;"
-        />
-      </el-col>
-    </el-row></div>
+    <div :style="{height:height+'px'}" class="position-content">
+        <el-row>
+            <el-col :span="24">
+                <div class="ibps-tools-btn">
+                    <el-button type="primary" icon="ibps-icon-save" @click="saveData">保存</el-button>
+                    <el-button type="info" icon="ibps-icon-clean" @click="clearData">清空</el-button>
+                </div>
+            </el-col>
+            <el-col :span="24" class="detail">
+                <attr-form
+                    v-if="forms && forms.length >0"
+                    ref="form"
+                    :data="formData"
+                    :forms="forms"
+                    :item-width="100+'%'"
+                    @input="handlerData"
+                />
+                <el-alert
+                    v-else
+                    title="无配置扩展属性"
+                    type="info"
+                    show-icon
+                    style="height:50px;"
+                />
+            </el-col>
+        </el-row></div>
 </template>
 <script>
 import { findByPartyTypeUserId4Edit } from '@/api/platform/org/attr'
@@ -34,136 +34,136 @@ import ActionUtils from '@/utils/action'
 import AttrForm from './attr-form'
 
 export default {
-  components: {
-    AttrForm
-  },
-  props: {
-    id: [String, Number],
-    partyType: String,
-    height: Number
-  },
-  data() {
-    return {
-      forms: [],
-      formData: {}
-    }
-  },
-  watch: {
-    id: {
-      handler() {
-        if (this.$utils.isNotEmpty(this.id)) {
-          // 初始化数据
-          this.forms = []
-          this.formData = {}
-          this.getFormData()
-        }
-      },
-      immediate: true
-    }
-  },
-  methods: {
-    clearData() {
-      this.$refs.form ? this.$refs.form.clearData() : null
-      save({
-        'attrValueVoList': [],
-        'entityId': this.id
-      }).then(response => {
-        ActionUtils.successMessage('清空成功!')
-        this.$emit('callback', this)
-      })
+    components: {
+        AttrForm
     },
-    saveData() {
-      const list = []
-      const attrValidator = this.$refs['form'] ? this.$refs['form'].callback() : null
-      if (!attrValidator) {
-        ActionUtils.warning('请检查表单数据是否填写正确')
-        return
-      }
-      for (const key in this.formData) {
-        const value = this.formData[key] || ''
-        if (Array.isArray(value)) {
-          value.forEach(v => {
-            list.push({
-              attrId: key,
-              value: v
-            })
-          })
-        } else {
-          list.push({
-            attrId: key,
-            value: value
-          })
+    props: {
+        id: [String, Number],
+        partyType: String,
+        height: Number
+    },
+    data () {
+        return {
+            forms: [],
+            formData: {}
         }
-      }
-      if (this.$utils.isEmpty(list)) {
-        ActionUtils.warning('属性值不能为空!')
-        return
-      }
-      save({
-        'attrValueVoList': list,
-        'entityId': this.id
-      }).then(response => {
-        ActionUtils.successMessage('保存成功!')
-        this.$emit('callback', this)
-      })
     },
-    // 获取数据
-    getFormData() {
-      findByPartyTypeUserId4Edit({
-        partyType: this.partyType,
-        userId: this.id
-      }).then(response => {
-        const data = response.data
-        const formData = {}
-        this.forms = data.map(item => {
-          formData[item.id] = this.getValue(item, item.values)
-          var rules = []
-          if (item.dataType === 'INT') {
-            rules.push({ validator: validateInteger, trigger: 'blur' })
-          }
-          if (item.dataType === 'DOUBLE') {
-            rules.push({ validator: validateFloat, trigger: 'blur' })
-          }
-          return {
-            prop: item.id,
-            label: item.name,
-            fieldType: item.dataType,
-            options: item.options,
-            multiple: item.isMulti === 'Y',
-            rules: rules
-          }
-        })
-        this.formData = formData
-      }).catch(() => {
-      })
+    watch: {
+        id: {
+            handler () {
+                if (this.$utils.isNotEmpty(this.id)) {
+                    // 初始化数据
+                    this.forms = []
+                    this.formData = {}
+                    this.getFormData()
+                }
+            },
+            immediate: true
+        }
     },
-    getValue({ isMulti }, values) {
-      if (this.$utils.isEmpty(values)) return ''
-      // if (dataType === 'STRING' || dataType === 'INT' ||
-      //  dataType === 'DOUBLE' || dataType === 'BOOLEAN' ||
-      //   dataType === 'OPTION' || dataType === 'DATE') {
+    methods: {
+        clearData () {
+            this.$refs.form ? this.$refs.form.clearData() : null
+            save({
+                'attrValueVoList': [],
+                'entityId': this.id
+            }).then(response => {
+                ActionUtils.successMessage('清空成功!')
+                this.$emit('callback', this)
+            })
+        },
+        saveData () {
+            const list = []
+            const attrValidator = this.$refs['form'] ? this.$refs['form'].callback() : null
+            if (!attrValidator) {
+                ActionUtils.warning('请检查表单数据是否填写正确')
+                return
+            }
+            for (const key in this.formData) {
+                const value = this.formData[key] || ''
+                if (Array.isArray(value)) {
+                    value.forEach(v => {
+                        list.push({
+                            attrId: key,
+                            value: v
+                        })
+                    })
+                } else {
+                    list.push({
+                        attrId: key,
+                        value: value
+                    })
+                }
+            }
+            if (this.$utils.isEmpty(list)) {
+                ActionUtils.warning('属性值不能为空!')
+                return
+            }
+            save({
+                'attrValueVoList': list,
+                'entityId': this.id
+            }).then(response => {
+                ActionUtils.successMessage('保存成功!')
+                this.$emit('callback', this)
+            })
+        },
+        // 获取数据
+        getFormData () {
+            findByPartyTypeUserId4Edit({
+                partyType: this.partyType,
+                userId: this.id
+            }).then(response => {
+                const data = response.data
+                const formData = {}
+                this.forms = data.map(item => {
+                    formData[item.id] = this.getValue(item, item.values)
+                    var rules = []
+                    if (item.dataType === 'INT') {
+                        rules.push({ validator: validateInteger, trigger: 'blur' })
+                    }
+                    if (item.dataType === 'DOUBLE') {
+                        rules.push({ validator: validateFloat, trigger: 'blur' })
+                    }
+                    return {
+                        prop: item.id,
+                        label: item.name,
+                        fieldType: item.dataType,
+                        options: item.options,
+                        multiple: item.isMulti === 'Y',
+                        rules: rules
+                    }
+                })
+                this.formData = formData
+            }).catch(() => {
+            })
+        },
+        getValue ({ isMulti }, values) {
+            if (this.$utils.isEmpty(values)) return ''
+            // if (dataType === 'STRING' || dataType === 'INT' ||
+            //  dataType === 'DOUBLE' || dataType === 'BOOLEAN' ||
+            //   dataType === 'OPTION' || dataType === 'DATE') {
 
-      // }
-      if (isMulti === 'Y') {
-        var datas = []
-        values.forEach(v => {
-          datas.push(v.value)
-        })
-        return datas
-      }
-      return values[0].value || ''
-    },
-    handlerData(data) {
-      this.formData = data
+            // }
+            if (isMulti === 'Y') {
+                var datas = []
+                values.forEach(v => {
+                    datas.push(v.value)
+                })
+                return datas
+            }
+            return values[0].value || ''
+        },
+        handlerData (data) {
+            this.formData = data
+        }
     }
-  }
 }
 </script>
 <style lang="scss" scoped>
-  .ibps-tools-btn{
-    padding:5px;
-    margin-bottom: 5px;
-    background-color: #f5f5f7;
-    border: 1px solid #ebeef5;
-  }
+    .ibps-tools-btn{
+        padding:5px;
+        margin-bottom: 5px;
+        background-color: #f5f5f7;
+        border: 1px solid #ebeef5;
+    }
 </style>

+ 1 - 1
src/views/system/dashboard/components/workbench.js

@@ -138,7 +138,7 @@ export const listSearchForm = {
             { prop: 'range', label: '显示范围', labelWidth: 70, fieldType: 'select', options: rangeOption, value: 'aboutMe' },
             { prop: 'suo_shu_xi_tong_', label: '所属子系统', labelWidth: 85, fieldType: 'select', options: [] },
             { prop: 'gong_neng_mo_kuai', label: '所属功能模块', labelWidth: 100, fieldType: 'input' },
-            { prop: 'role', label: '执行角色', labelWidth: 70, fieldType: 'select', options: [] },
+            { prop: 'role', label: '编制角色', labelWidth: 70, fieldType: 'select', options: [] },
             { prop: 'biao_dan_ming_che', label: '记录表单', labelWidth: 70, fieldType: 'input' },
             { prop: 'shi_wu_lei_xing_', label: '事务类型', labelWidth: 70, fieldType: 'select', options: taskTypeOption }
         ]

+ 1 - 1
src/views/system/dashboard/components/workbench.vue

@@ -155,7 +155,7 @@ export default {
                     aboutMeParams = ` and (${range[item.value].join(' or ')})`
                 }
                 if (item.key === 'role') {
-                    roleParams = ` and (bian_zhi_jiao_se_ like '%${item.value}%' or shen_he_jiao_se_ like '%${item.value}%' or shen_pi_jiao_se_ like '%${item.value}%')`
+                    roleParams = ` and (bian_zhi_jiao_se_ like '%${item.value}%')`
                 }
             })
             // 获取查询字段