Procházet zdrojové kódy

时间控件格式化,自定义对话框选择器转化,多数据标题转化

cyy před 2 roky
rodič
revize
131bc1029b

+ 1 - 1
src/business/platform/data/data-template/field-formatter.vue

@@ -67,7 +67,7 @@ export default {
   },
   methods: {
     initData() {
-      console.log(this.labelKey, 'this.labelKeythis.labelKey')
+      console.log(this.labelKey, this.templateFields, 'this.labelKeythis.labelKey')
       if (!this.labelKey) return
       const value = this.data[this.labelKey]
       if (this.$utils.isEmpty(value)) {

+ 26 - 30
src/business/platform/data/data-template/template.vue

@@ -61,14 +61,10 @@
                   /> -->
                   <div>
                     <div v-for="(item, i) in data" :key="i">
-                      <span v-if="item.label">{{ item.label }}</span>
-                      <span v-if="item.label">:</span>
-                      <span v-if="item.val">{{ item.val }}</span>
-                      <tree-popup
-                        :visible="visible"
-                        :selectedData="selectedData"
-                        @close="visible => treeVisible = visible"
-                      />
+                      <span v-if="i!=='id_'">{{ item.label }}</span>
+                      <span v-if="i!=='id_'">:</span>
+                      <span v-if="item.fieldType!=='selector' && i!=='id_'">{{ item.val }}</span>
+                      <span v-else-if="i!=='id_'"><van-tag>{{ selectorArr.find(i=>i.id_ === item.val) ? selectorArr.find(i=>i.id_ === item.val).name_ :'' }}</van-tag></span>
                     </div>
                   </div>
                 </van-checkbox>
@@ -148,13 +144,11 @@ import ActionUtils from '@/utils/action'
 import i18n from '@/utils/i18n' // Internationalization 国际化
 import FieldFormatter from './field-formatter'
 import IbpsPickerToolbar from '@/components/ibps-picker-toolbar'
-import TreePopup from '../../org/selector/popup-tree/index.vue'
 
 export default {
   components: {
     IbpsPickerToolbar,
-    FieldFormatter,
-    TreePopup
+    FieldFormatter
   },
   props: {
     visible: Boolean,
@@ -206,7 +200,8 @@ export default {
       showDetailPopup: false,
       page: 1,
       loading: true,
-      finished: false
+      finished: false,
+      selectorArr: []
     }
   },
   computed: {
@@ -252,9 +247,15 @@ export default {
     }
 
   },
+  created() {
+    const sql = `select name_,id_ from ibps_party_entity `
+    this.$common.request('sql', sql).then((res) => {
+      const { data } = res.variables
+      this.selectorArr = data
+    })
+  },
   methods: {
     initData() {
-      console.log(this.datat, 'dataTemplate')
       const data = this.value
       this.checkedValue = []
       this.checkbox = []
@@ -289,7 +290,6 @@ export default {
       remoteRequest('dataTemplate', params, () => {
         return this.getRemoteDataTemplateByIdFunc(params)
       }).then(responseData => {
-        console.log(responseData, 'responseData')
         if (this.$utils.isNotEmpty(responseData) && this.$utils.isNotEmpty(responseData.data)) {
           const data = responseData.data[0] || {}
           let key = id
@@ -329,13 +329,10 @@ export default {
       if (!this.isTre) {
         pagination = { page: this.page }
       }
-      // console.log(!this.isTre, this.page, 'this.pagethis.page')
-      //
       getByKey({
         dataTemplateKey: this.templateKey
       }).then(response => {
         this.dataTem = this.$utils.parseData(response.data).templates[0]
-        console.log(this.dataTem, 'dadadadadadada')
         // this.loadAjaxOptions()
         // TODO: 分页数据处理
         // 加载数据
@@ -359,27 +356,27 @@ export default {
             const dl = dataResult
             dl.map((d) => {
               this.cacheData[d[this.valueKey]] = d
-              const objName = Object.keys(d)
+              // const objName = Object.keys(d)
               const fb = {}
-              objName.forEach((it, i) => {
+
+              this.dataTem.display_columns.forEach((it, i) => {
                 let b = {}
-                const keyName = this.dataTem.display_columns.find(t => t.name === it)
-                if (typeof keyName !== 'undefined' && keyName) {
-                  b = { 'label': keyName.label, 'val': d[it] }
-                } else {
-                  b = d[it]
-                }
-                fb[it] = b
+                // const keyName = objName.find(t => t === it.name)
+                // if (typeof keyName !== 'undefined' && keyName) {
+                b = { 'label': it.label, 'val': d[it.name], 'fieldType': it.field_type }
+                // } else {
+                // b = d[it.name]
+                // }
+                fb[it.name] = b
+                // }
               })
+              fb['id_'] = d['id_']
               this.dataList.push(fb)
             })
-            // this.dataList = [this.dataList, ...mid]
-            // console.log(this.dataList, 'this.dataList')
           }
           this.page++
           // 加载状态结束
           this.loading = false
-          console.log(this.dataList.length >= pageResult.totalCount, this.page > pageResult.totalPages)
           // 数据全部加载完成
           if (this.dataList.length >= pageResult.totalCount || this.page > pageResult.totalPages) {
             this.finished = true
@@ -400,7 +397,6 @@ export default {
         [this.labelKey]: vars.rootLabel || '顶级',
         [this.childrenKey]: this.dataList
       }
-      console.log(this.dataList, 'this.dataList')
       this.pathData.push(data)
     },
 

+ 99 - 0
src/business/platform/data/templaterender/utils/JComposeTemplate.js

@@ -0,0 +1,99 @@
+
+/**
+ * 数据模版--封装自定义代码扩展接口
+ */
+import _ from 'lodash'
+import Vue from 'vue'
+import request from '@/utils/request'
+import dialog from '@/utils/dialog'
+import common from '@/utils/common'
+const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
+import store from '@/store'
+import router from '@/router'
+
+// 定义全局
+var JComposeTemplate
+if (!window.JComposeTemplate) {
+    JComposeTemplate = window.JComposeTemplate = {}
+} else {
+    JComposeTemplate = window.JComposeTemplate
+}
+/**
+   * 封装自定义代码扩展接口
+   */
+_.extend(JComposeTemplate, {
+    // 已经初始化
+    _isInitialization: false,
+    _isLoadJavaScriptFile: false,
+    // 初始化表单
+    _init: function (template) {
+        if (this._isInitialization) return
+        this.$template = template
+        this.$vue = Vue
+        this.$request = request
+        this.$dialog = dialog
+        this.$common = common
+        this.$router = router
+        this.$store = store
+        this.$import = _import
+        this._ = _
+        this._isInitialization = true
+    },
+
+    // 页面加载
+    _onLoad: function (template) {
+        this._init(template)
+        if (_.isFunction(this.onLoad)) {
+            this.onLoad(template)
+        }
+    },
+
+    // 加载按钮
+    _onLoadActions: function (template) {
+        if (_.isFunction(this.onLoadActions)) {
+            this.onLoadActions(template)
+        }
+    },
+    // 按钮提交前事件
+    _beforeSubmit: function (template, action, position, selection, data, callback) {
+        if (_.isFunction(this.beforeSubmit)) {
+            return this.beforeSubmit(template, action, position, selection, data, callback)
+        }
+        if (_.isFunction(callback)) {
+            const flag = true
+            callback(flag)
+        }
+    },
+
+    // 按钮提交后事件
+    _afterSubmit: function (template, action, position, selection, data, callback) {
+        if (_.isFunction(this.afterSubmit)) {
+            return this.afterSubmit(template, action, position, selection, data, callback)
+        }
+        if (_.isFunction(callback)) {
+            const flag = true
+            callback(flag)
+        }
+    },
+    // 单元格自定义格式
+    _customFormatter: function (template, name, value, rowData, column) {
+        if (_.isFunction(this.customFormatter)) {
+            return this.customFormatter(template, name, value, rowData, column)
+        }
+    },
+    // 清理所有自定义事件
+    cleanEvents: function () {
+        this.onLoad = null
+        this.onLoadActions = null
+        this.onValidate = null
+        this.afterSubButton = null
+        this.beforeSubButton = null
+        this.summaryMethod = null
+        this.afterSubmit = null
+        this.beforeSubmit = null
+        this.customFormatter = null
+        this._isInitialization = false
+    }
+})
+
+export default JComposeTemplate

+ 98 - 0
src/business/platform/data/templaterender/utils/JDialogTemplate.js

@@ -0,0 +1,98 @@
+/**
+ * 数据模版--封装自定义代码扩展接口
+ */
+import _ from 'lodash'
+import Vue from 'vue'
+import request from '@/utils/request'
+import dialog from '@/utils/dialog'
+import common from '@/utils/common'
+const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
+import store from '@/store'
+import router from '@/router'
+
+// 定义全局
+var JDialog
+if (!window.JDialog) {
+    JDialog = window.JDialog = {}
+} else {
+    JDialog = window.JDialog
+}
+/**
+   * 封装自定义代码扩展接口
+   */
+_.extend(JDialog, {
+    // 已经初始化
+    _isInitialization: false,
+    _isLoadJavaScriptFile: false,
+    // 初始化表单
+    _init: function (template) {
+        if (this._isInitialization) return
+        this.$template = template
+        this.$vue = Vue
+        this.$request = request
+        this.$dialog = dialog
+        this.$common = common
+        this.$router = router
+        this.$store = store
+        this.$import = _import
+        this._ = _
+        this._isInitialization = true
+    },
+
+    // 页面加载
+    _onLoad: function (template) {
+        this._init(template)
+        if (_.isFunction(this.onLoad)) {
+            this.onLoad(template)
+        }
+    },
+
+    // 加载按钮
+    _onLoadActions: function (template) {
+        if (_.isFunction(this.onLoadActions)) {
+            this.onLoadActions(template)
+        }
+    },
+    // 按钮提交前事件
+    _beforeSubmit: function (template, action, position, selection, data, callback) {
+        if (_.isFunction(this.beforeSubmit)) {
+            return this.beforeSubmit(template, action, position, selection, data, callback)
+        }
+        if (_.isFunction(callback)) {
+            const flag = true
+            callback(flag)
+        }
+    },
+
+    // 按钮提交后事件
+    _afterSubmit: function (template, action, position, selection, data, callback) {
+        if (_.isFunction(this.afterSubmit)) {
+            return this.afterSubmit(template, action, position, selection, data, callback)
+        }
+        if (_.isFunction(callback)) {
+            const flag = true
+            callback(flag)
+        }
+    },
+    // 单元格自定义格式
+    _customFormatter: function (template, name, value, rowData, column) {
+        if (_.isFunction(this.customFormatter)) {
+            return this.customFormatter(template, name, value, rowData, column)
+        }
+    },
+    // 清理所有自定义事件
+    cleanEvents: function () {
+        this.onLoad = null
+        this.onLoadActions = null
+        this.onValidate = null
+        this.afterSubButton = null
+        this.beforeSubButton = null
+        this.summaryMethod = null
+        this.afterSubmit = null
+        this.beforeSubmit = null
+        this.customFormatter = null
+        this._isInitialization = false
+    }
+})
+
+export default JDialog

+ 98 - 0
src/business/platform/data/templaterender/utils/JTemplate.js

@@ -0,0 +1,98 @@
+/**
+ * 数据模版--封装自定义代码扩展接口
+ */
+import _ from 'lodash'
+import Vue from 'vue'
+import request from '@/utils/request'
+import dialog from '@/utils/dialog'
+import common from '@/utils/common'
+const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
+import store from '@/store'
+import router from '@/router'
+
+// 定义全局
+var JTemplate
+if (!window.JTemplate) {
+    JTemplate = window.JTemplate = {}
+} else {
+    JTemplate = window.JTemplate
+}
+/**
+ * 封装自定义代码扩展接口
+ */
+_.extend(JTemplate, {
+    // 已经初始化
+    _isInitialization: false,
+    _isLoadJavaScriptFile: false,
+    // 初始化表单
+    _init: function (template) {
+        if (this._isInitialization) return
+        this.$template = template
+        this.$vue = Vue
+        this.$request = request
+        this.$dialog = dialog
+        this.$common = common
+        this.$router = router
+        this.$store = store
+        this.$import = _import
+        this._ = _
+        this._isInitialization = true
+    },
+
+    // 页面加载
+    _onLoad: function (template) {
+        this._init(template)
+        if (_.isFunction(this.onLoad)) {
+            this.onLoad(template)
+        }
+    },
+
+    // 加载按钮
+    _onLoadActions: function (template, action, button, type, row) {
+        if (_.isFunction(this.onLoadActions)) {
+            return this.onLoadActions(template, action, button, type, row)
+        }
+    },
+    // 按钮提交前事件
+    _beforeSubmit: function (template, action, position, selection, data, callback) {
+        if (_.isFunction(this.beforeSubmit)) {
+            return this.beforeSubmit(template, action, position, selection, data, callback)
+        }
+        if (_.isFunction(callback)) {
+            const flag = true
+            callback(flag)
+        }
+    },
+
+    // 按钮提交后事件
+    _afterSubmit: function (template, action, position, selection, data, callback) {
+        if (_.isFunction(this.afterSubmit)) {
+            return this.afterSubmit(template, action, position, selection, data, callback)
+        }
+        if (_.isFunction(callback)) {
+            const flag = true
+            callback(flag)
+        }
+    },
+    // 单元格自定义格式
+    _customFormatter: function (template, name, value, rowData, column) {
+        if (_.isFunction(this.customFormatter)) {
+            return this.customFormatter(template, name, value, rowData, column)
+        }
+    },
+    // 清理所有自定义事件
+    cleanEvents: function () {
+        this.onLoad = null
+        this.onLoadActions = null
+        this.onValidate = null
+        this.afterSubButton = null
+        this.beforeSubButton = null
+        this.summaryMethod = null
+        this.afterSubmit = null
+        this.beforeSubmit = null
+        this.customFormatter = null
+        this._isInitialization = false
+    }
+})
+
+export default JTemplate

+ 98 - 0
src/business/platform/data/templaterender/utils/JTreeTemplate.js

@@ -0,0 +1,98 @@
+/**
+ * 数据模版--封装自定义代码扩展接口
+ */
+import _ from 'lodash'
+import Vue from 'vue'
+import request from '@/utils/request'
+import dialog from '@/utils/dialog'
+import common from '@/utils/common'
+const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
+import store from '@/store'
+import router from '@/router'
+
+// 定义全局
+var JTreeTemplate
+if (!window.JTreeTemplate) {
+    JTreeTemplate = window.JTreeTemplate = {}
+} else {
+    JTreeTemplate = window.JTreeTemplate
+}
+/**
+   * 封装自定义代码扩展接口
+  */
+_.extend(JTreeTemplate, {
+    // 已经初始化
+    _isInitialization: false,
+    _isLoadJavaScriptFile: false,
+    // 初始化表单
+    _init: function (template) {
+        if (this._isInitialization) return
+        this.$template = template
+        this.$vue = Vue
+        this.$request = request
+        this.$dialog = dialog
+        this.$common = common
+        this.$router = router
+        this.$store = store
+        this.$import = _import
+        this._ = _
+        this._isInitialization = true
+    },
+
+    // 页面加载
+    _onLoad: function (template) {
+        this._init(template)
+        if (_.isFunction(this.onLoad)) {
+            this.onLoad(template)
+        }
+    },
+
+    // 加载按钮
+    _onLoadActions: function (template) {
+        if (_.isFunction(this.onLoadActions)) {
+            this.onLoadActions(template)
+        }
+    },
+    // 按钮提交前事件
+    _beforeSubmit: function (template, action, position, selection, data, callback) {
+        if (_.isFunction(this.beforeSubmit)) {
+            return this.beforeSubmit(template, action, position, selection, data, callback)
+        }
+        if (_.isFunction(callback)) {
+            const flag = true
+            callback(flag)
+        }
+    },
+
+    // 按钮提交后事件
+    _afterSubmit: function (template, action, position, selection, data, callback) {
+        if (_.isFunction(this.afterSubmit)) {
+            return this.afterSubmit(template, action, position, selection, data, callback)
+        }
+        if (_.isFunction(callback)) {
+            const flag = true
+            callback(flag)
+        }
+    },
+    // 单元格自定义格式
+    _customFormatter: function (template, name, value, rowData, column) {
+        if (_.isFunction(this.customFormatter)) {
+            return this.customFormatter(template, name, value, rowData, column)
+        }
+    },
+    // 清理所有自定义事件
+    cleanEvents: function () {
+        this.onLoad = null
+        this.onLoadActions = null
+        this.onValidate = null
+        this.afterSubButton = null
+        this.beforeSubButton = null
+        this.summaryMethod = null
+        this.afterSubmit = null
+        this.beforeSubmit = null
+        this.customFormatter = null
+        this._isInitialization = false
+    }
+})
+
+export default JTreeTemplate

+ 192 - 0
src/business/platform/data/templaterender/utils/index.js

@@ -0,0 +1,192 @@
+
+import Utils from '@/utils/util'
+import { numberThousands, numberCurrency, numberPercent, parseNumber } from '@/business/platform/form/utils/number'
+// import QueryBuilder from '@/components/ibps-query-builder/constants'
+import FormFieldUtil from '@/business/platform/form/utils/formFieldUtil'
+
+/**
+ * 获取动态参数
+ * @param {*} dataTemplate
+ */
+export function getDynamicParamsConditions(dataTemplate, getDataByKey) {
+  let dynamicParams = {}
+  if (dataTemplate.templates) {
+    let template = {}
+    let conditions = {}
+    // 如果是组合
+    if (dataTemplate.showType === 'compose') {
+      let tpl = {}
+      if (dataTemplate.composeType === 'treeList') {
+        tpl = dataTemplate.templates[1]
+      } else if (dataTemplate.composeType === 'listTree') {
+        tpl = dataTemplate.templates[0]
+      }
+      if (!tpl) {
+        this.$alert('未设置模版!')
+        return
+      }
+
+      if (tpl.attrs && tpl.attrs['bind_template'] === 'Y') {
+        // TODO:获取模版
+        const t = getDataByKey(tpl.attrs['bind_template_key'])
+        if (t) {
+          template = t.templates[0]
+        }
+      } else {
+        template = tpl
+      }
+    } else {
+      template = dataTemplate.templates[0]
+    }
+
+    if (Utils.isNotEmpty(template)) {
+      conditions = template.filter_conditions
+    }
+    dynamicParams = buildDynamicParams(conditions)
+  }
+  return dynamicParams
+}
+
+export function buildFelds(fields, datasets) {
+  const fieldMap = {}
+  const columns = FormFieldUtil.getColumns(fields)
+
+  columns.forEach(field => {
+    if (Utils.isNotEmpty(field.field_name)) {
+      fieldMap[field.field_name.toLowerCase()] = field
+    }
+  })
+  const rtn = []
+  datasets.forEach(dataset => {
+    let field = fieldMap[dataset.name]
+    if (Utils.isNotEmpty(dataset.name)) {
+      field = fieldMap[dataset.name.toLowerCase()]
+    }
+    if (Utils.isNotEmpty(field)) {
+      dataset.field_name = Utils.isNotEmpty(field.name) ? field.name.toLowerCase() : field.name
+      dataset.form_field_name = field.name
+      dataset.field_type = field.field_type
+      dataset.field_options = field.field_options
+    }
+    rtn.push(dataset)
+  })
+  return rtn
+}
+
+export function buildDynamicParams(conditions) {
+  const dynamicParams = {}
+  if (Utils.isEmpty(conditions)) {
+    return dynamicParams
+  }
+  const filterConditions = Utils.isNotEmpty(conditions) ? conditions[0] : {}
+  const filter = filterConditions.filter
+  if (filter) {
+    _createDynamicParams(dynamicParams, filter)
+  }
+  return dynamicParams
+}
+
+// export function _createDynamicParams(params, filter) {
+//   const rules = filter.rules
+//   if (Utils.isEmpty(rules)) {
+//     return
+//   }
+//   for (let _i = 0, _len = rules.length; _i < _len; _i++) {
+//     const rule = rules[_i]
+//     if (rule.rules) {
+//       buildDynamicParams(params, rule)
+//     } else {
+//       if (QueryBuilder.OPERATORS[rule.operator].nb_inputs > 0 && rule.source === 'dynamic') {
+//         params[rule.field] = rule
+//       }
+//     }
+//   }
+// }
+/**
+ * 构建label标题
+ * @param {*} dataTemplate
+ */
+export function buildLabelTitle(dataTemplate) {
+  if (Utils.isEmpty(dataTemplate)) {
+    return ''
+  }
+  // TODO: 数据模版不同类型不同的处理,需处理组合模版
+  const template = dataTemplate.dialog_list || dataTemplate.templates[0] || {}
+  //  标题文字
+  const dataTitle = template.attrs ? template.attrs.data_title || {} : {}
+
+  const titleType = Utils.isNotEmpty(dataTitle) ? dataTitle.type : 'first'
+  const dataTitleTitle = dataTitle ? dataTitle.title : ''
+  const lableKey = template.result_columns && template.result_columns.length > 0 ? template.result_columns[0].name : ''
+  // return buildLinkLabelTitle(titleType, dataTitleTitle, lableKey)
+  return {'dataTitle':dataTitle,'titleType':titleType,'dataTitleTitle':dataTitleTitle,'lableKey':lableKey}
+}
+/**
+ * 构建label标题
+ * @param {*} dataTemplate
+ */
+export function buildLinkLabelTitle(titleType = 'first', dataTitle, lableKey,data) {
+  if (titleType === 'first') {
+    return lableKey
+  } else {
+    // return function(data) {
+      const d = dataTitle.split(/(\$[0-9a-zA-Z._]+#[0-9A-Fa-f]*)/g)
+      const rtn = []
+
+      d.forEach(n => {
+        let a = n
+        if (/^\$(_widget_)/.test(n)) { // 对字段进行处理
+          const f = n.replace('$_widget_', '').split('#')
+          a = data[f[0]] || ''
+        }
+        rtn.push(a)
+      })
+      console.log(rtn.join(''))
+      return rtn.join('')
+    // }
+  }
+}
+
+export function filterNumber(data, fieldOptions = {}) {
+  if (!Utils.isNum(data)) return ''
+  const value = data
+  if (isNaN(value)) return data
+  const type = fieldOptions.number_type || 'orig'
+  if (type === 'orig') {
+    return value
+  } else if (type === 'integer') { // 整型
+    const val = value
+    if (fieldOptions.number_format === 'thousands') {
+      return numberThousands(val)
+    } else if (fieldOptions.number_format === 'capital') {
+      return numberCurrency(val)
+    } else if (fieldOptions.number_format === 'percent') {
+      return numberPercent(val)
+    } else {
+      return val
+    }
+  } else if (type === 'number') { // 数字
+    const val = parseNumber(value, fieldOptions.decimal_places, fieldOptions.decimal_scale)
+    if (fieldOptions.number_format === 'thousands') {
+      return numberThousands(val)
+    } else if (fieldOptions.number_format === 'capital') {
+      return numberCurrency(val)
+    } else if (fieldOptions.number_format === 'percent') {
+      return numberPercent(val)
+    }
+    return val
+  } else if (type === 'currency') { // 货币
+    let val = parseNumber(value, fieldOptions.decimal_places, fieldOptions.decimal_scale)
+    if (fieldOptions.number_format === 'thousands') {
+      val = numberThousands(val)
+    } else if (fieldOptions.number_format === 'capital') {
+      val = numberCurrency(val)
+    } else if (fieldOptions.number_format === 'percent') {
+      val = numberPercent(val)
+    }
+    return (fieldOptions.prefix || '') + (val) + (fieldOptions.suffix || '')
+  } else {
+    return value
+  }
+}
+

+ 14 - 4
src/business/platform/form/utils/customValidator.js

@@ -61,6 +61,15 @@ function getCurrentMonthLast(date) {
 function getCurDate(datefmt) {
   return fecha.parse(fecha.format(new Date(), datefmt), datefmt)
 }
+/**
+ * 格式化时间【日期】
+ * @param {*} date
+ * @param {*} datefmt
+ */
+function formatParseDate(date, datefmt) {
+  if (Utils.isEmpty(date)) return date
+  return fecha.format(fecha.parse(date, datefmt), datefmt)
+}
 /**
  * 获取时间戳
  * @param {*} value
@@ -75,7 +84,7 @@ function getDate(dateType, dateVal, dateInterval, datefmt, models) {
   if (dateType === 'specific') { // 特定时间
     date = dateVal
   } else if (dateType === 'form') { // 表单字段
-    date = models[dateVal]
+    date = formatParseDate(models[dateVal], datefmt)
   } else if (dateType === 'today') { // 当前时间
     date = fecha.format(new Date(), datefmt)
   } else if (dateType === 'before') {
@@ -106,11 +115,13 @@ export const validateDateBetween = (rule, value, callback) => {
   const curTimestamp = curValDate.getTime()
   // 表单数据
   const models = rule.models
+
+  const nowDate = new Date()
   // 开始时间
   let startDate
   let startTimestamp// 开始时间时间戳
   if (fieldOptions['is_start_date'] && Utils.isNotEmpty(fieldOptions['start_date_type'])) {
-    startDate = getDate(fieldOptions['start_date_type'], fieldOptions['start_date'], fieldOptions['start_date_interval'], datefmt, models)
+    startDate = getDate(fieldOptions['start_date_type'], fieldOptions['start_date'], fieldOptions['start_date_interval'], datefmt, nowDate, models)
     if (Utils.isNotEmpty(startDate)) {
       startTimestamp = getDateTimestamp(startDate, datefmt)
     }
@@ -120,12 +131,11 @@ export const validateDateBetween = (rule, value, callback) => {
   let endDate
   let endTimestamp // 结束时间时间戳
   if (fieldOptions['is_end_date'] && Utils.isNotEmpty(fieldOptions['end_date_type'])) {
-    endDate = getDate(fieldOptions['end_date_type'], fieldOptions['end_date'], fieldOptions['end_date_interval'], datefmt, models)
+    endDate = getDate(fieldOptions['end_date_type'], fieldOptions['end_date'], fieldOptions['end_date_interval'], datefmt, nowDate, models)
     if (Utils.isNotEmpty(endDate)) {
       endTimestamp = getDateTimestamp(endDate, datefmt)
     }
   }
-
   // 时间范围
   if (Utils.isNotEmpty(startTimestamp) && Utils.isNotEmpty(startDate) &&
     Utils.isNotEmpty(endTimestamp) && Utils.isNotEmpty(endDate) &&

+ 2 - 2
src/business/platform/org/selector/index.vue

@@ -348,7 +348,7 @@ export default {
     },
     filter: {
       handler(val, oldVal) {
-        console.info(val, '==>>filter')
+        // console.info(val, '==>>filter')
         this.filterScope(val)
       },
       immediate: true,
@@ -576,7 +576,7 @@ export default {
           this.getRoleSelectorCondition(val)
           break
       }
-      console.info(this.condition, '=>>this.condition')
+      // console.info(this.condition, '=>>this.condition')
     },
     getUserSelectorCondition(val, type) {
       this.condition[type] ? this.condition[type].partyTypeId = val.descVal : null

+ 3 - 1
src/business/platform/org/selector/position.vue

@@ -35,6 +35,7 @@
 <script>
 import { getScriptValue } from '@/api/platform/form/formDef'// 脚本
 import { findTreeData as queryByParentId, get as getPositionById } from '@/api/platform/org/position'
+import { findTreeData as getPositionTreeData } from '@/api/platform/org/position'
 import { getScriptValue as getTreeDataByScriptValue } from '@/api/platform/form/common'
 import ActionUtils from '@/utils/action'
 import Selector from './selector'
@@ -226,7 +227,8 @@ export default {
         params.posId = data.id === 0 ? null : data.id
       }
       if (this.$utils.isEmpty(data) || data.id === '0' || data.id === '') {
-        queryByParentId(params).then(res => {
+        getPositionTreeData(params).then(res => {
+          console.log(res, '1111')
           this.loading = false
           this.refreshing = false
           this.finished = true