|
|
@@ -143,7 +143,7 @@
|
|
|
class="titles"
|
|
|
:label-key="labelField['name']"
|
|
|
:data="item"
|
|
|
- :descField="labelField"
|
|
|
+ :desc-field="labelField"
|
|
|
:field-options="comFieldOptions(labelField['name'])"
|
|
|
:field-type="comFieldType(labelField['name'])"
|
|
|
:template-fields="templateFields"
|
|
|
@@ -167,7 +167,7 @@
|
|
|
:field-options="comFieldOptions(descField['name'])"
|
|
|
:field-type="comFieldType(descField['name'])"
|
|
|
:template-fields="templateFields"
|
|
|
- :descField="descField"
|
|
|
+ :desc-field="descField"
|
|
|
class="desc"
|
|
|
default-value
|
|
|
/>
|
|
|
@@ -393,7 +393,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- fields () {
|
|
|
+ fields() {
|
|
|
if (this.$utils.isEmpty(this.dataTemplate)) {
|
|
|
return {}
|
|
|
}
|
|
|
@@ -408,7 +408,7 @@ export default {
|
|
|
return fields
|
|
|
},
|
|
|
ownsDeptInfo() {
|
|
|
- return this.$store.getters.mainPosition ? this.$store.getters.mainPosition : this.$store.getters.position ? this.$store.getters.position[0] : {id: ''}
|
|
|
+ return this.$store.getters.mainPosition ? this.$store.getters.mainPosition : this.$store.getters.position ? this.$store.getters.position[0] : { id: '' }
|
|
|
},
|
|
|
toolbarButtons() {
|
|
|
return this.toolbars.length > 4
|
|
|
@@ -516,7 +516,7 @@ export default {
|
|
|
: ''
|
|
|
}
|
|
|
},
|
|
|
- initUI () {
|
|
|
+ initUI() {
|
|
|
this.initialization = false
|
|
|
if (!this.initialization) {
|
|
|
this.initJTemplate()
|
|
|
@@ -586,14 +586,14 @@ export default {
|
|
|
this.formKey = dataTemplate['attrs']['form_key']
|
|
|
template['query_columns'] = template['query_columns'].filter(t => t.isAppShow !== 'N')
|
|
|
this.buildQuerycolumns(template['query_columns'])
|
|
|
-
|
|
|
+
|
|
|
let fieldsList = template['display_columns']
|
|
|
? template['display_columns']
|
|
|
: []
|
|
|
- console.log('fieldsList--->', fieldsList)
|
|
|
- // 设置表格列的过滤
|
|
|
- fieldsList=fieldsList.filter(t => !this.defaultFilterListCol.includes(t.name) && t.field_type !== "hidden" && t.isAppShow !== "N")
|
|
|
-
|
|
|
+ console.log('fieldsList--->', fieldsList)
|
|
|
+ // 设置表格列的过滤
|
|
|
+ fieldsList = fieldsList.filter(t => !this.defaultFilterListCol.includes(t.name) && t.field_type !== 'hidden' && t.isAppShow !== 'N')
|
|
|
+
|
|
|
if (this.$utils.isNotEmpty(fieldsList)) {
|
|
|
this.fieldsList = fieldsList.map(i => {
|
|
|
return { name: i.label }
|
|
|
@@ -622,7 +622,7 @@ export default {
|
|
|
)
|
|
|
? template['filter_conditions']
|
|
|
: []
|
|
|
-
|
|
|
+
|
|
|
if (this.$utils.isNotEmpty(filterActions)) {
|
|
|
this.rangeData[this.rootIndex].options = filterActions.map(i => {
|
|
|
return { text: i.label, value: i.key }
|
|
|
@@ -650,17 +650,17 @@ export default {
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
- const columns = [];
|
|
|
- const labelMap = new Map();
|
|
|
+ const columns = []
|
|
|
+ const labelMap = new Map()
|
|
|
// 创建映射:label -> 字段对象(保留原始索引)
|
|
|
fieldsList.forEach((t, i) => {
|
|
|
- labelMap.set(t.label, { data: t, index: i });
|
|
|
+ labelMap.set(t.label, { data: t, index: i })
|
|
|
})
|
|
|
// 单次遍历匹配
|
|
|
for (const item of displayColumns) {
|
|
|
- const match = labelMap.get(item.label);
|
|
|
+ const match = labelMap.get(item.label)
|
|
|
if (match && match.data) {
|
|
|
- columns[match.index] = match.data;
|
|
|
+ columns[match.index] = match.data
|
|
|
}
|
|
|
}
|
|
|
const titleCol = columns.find(t => t.isTitle === 'Y')
|
|
|
@@ -788,7 +788,7 @@ export default {
|
|
|
// params['Q^bian_zhi_bu_men_^SL'] = this.ownsDeptInfo.id
|
|
|
// params['Q^shi_fou_guo_shen_^SL'] = '待处理'
|
|
|
// 加载数据
|
|
|
-
|
|
|
+
|
|
|
queryDataByKey(ActionUtils.formatParams(params, this.pagination))
|
|
|
.then(response => {
|
|
|
const responseData = response.data
|
|
|
@@ -828,7 +828,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
- *
|
|
|
+ *
|
|
|
* @param list 条件过滤数组{label,value}
|
|
|
* @param index 第几条
|
|
|
*/
|
|
|
@@ -940,22 +940,22 @@ export default {
|
|
|
return selection
|
|
|
},
|
|
|
// 前置脚本
|
|
|
- beforeScript (action, position, selection, data, callback) {
|
|
|
- if (!this.hasScript) {
|
|
|
- const flag = true
|
|
|
- callback(flag)
|
|
|
- return
|
|
|
- }
|
|
|
- JTemplate._beforeSubmit(this, action, position, selection, data, callback)
|
|
|
+ beforeScript(action, position, selection, data, callback) {
|
|
|
+ if (!this.hasScript) {
|
|
|
+ const flag = true
|
|
|
+ callback(flag)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ JTemplate._beforeSubmit(this, action, position, selection, data, callback)
|
|
|
},
|
|
|
// 后置脚本
|
|
|
- afterScript (action, position, selection, data, callback) {
|
|
|
- if (!this.hasScript) {
|
|
|
- const flag = true
|
|
|
- callback(flag)
|
|
|
- return
|
|
|
- }
|
|
|
- JTemplate._afterSubmit(this, action, position, selection, data, callback)
|
|
|
+ afterScript(action, position, selection, data, callback) {
|
|
|
+ if (!this.hasScript) {
|
|
|
+ const flag = true
|
|
|
+ callback(flag)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ JTemplate._afterSubmit(this, action, position, selection, data, callback)
|
|
|
},
|
|
|
handleEdit(pkValue, button) {
|
|
|
if (this.$utils.isEmpty(this.formKey)) {
|
|
|
@@ -1030,18 +1030,23 @@ export default {
|
|
|
// 功能按钮
|
|
|
functionButtons.forEach((rf, i) => {
|
|
|
const btn = this.buildButton(rf, i)
|
|
|
+ if (rf.show_on_h5 === 'N') {
|
|
|
+ return
|
|
|
+ }
|
|
|
if (btn.rights === 'none') {
|
|
|
return
|
|
|
}
|
|
|
// 顶部按钮
|
|
|
if (hasButton(rf.button_type, 'toolbar', rf.position)) {
|
|
|
btn.position = 'toolbar'
|
|
|
+ btn['showOnH5'] = rf.show_on_h5 ? rf.show_on_h5 : ''
|
|
|
toolbars.push(JSON.parse(JSON.stringify(btn)))
|
|
|
}
|
|
|
|
|
|
// 管理列按钮
|
|
|
if (hasButton(rf.button_type, 'manage', rf.position)) {
|
|
|
btn.position = 'manage'
|
|
|
+ btn['showOnH5'] = rf.show_on_h5 ? rf.show_on_h5 : ''
|
|
|
manages.push(JSON.parse(JSON.stringify(btn)))
|
|
|
}
|
|
|
})
|
|
|
@@ -1052,14 +1057,14 @@ export default {
|
|
|
|
|
|
this.defaultToolbars = toolbars
|
|
|
this.toolbars = toolbars.filter(b => {
|
|
|
- if (allowButtons.includes(b.button_type)) {
|
|
|
+ if (allowButtons.includes(b.button_type) && b.showOnH5 === 'Y') {
|
|
|
return b
|
|
|
}
|
|
|
})
|
|
|
|
|
|
this.defaultManages = manages
|
|
|
this.manages = manages.filter(b => {
|
|
|
- if (allowButtons.includes(b.button_type)) {
|
|
|
+ if (allowButtons.includes(b.button_type) && b.showOnH5 === 'Y') {
|
|
|
return b
|
|
|
}
|
|
|
})
|
|
|
@@ -1146,87 +1151,87 @@ export default {
|
|
|
return btns.includes(key)
|
|
|
},
|
|
|
buildQuerycolumns(queryColumns) {
|
|
|
- this.searchForms.forms = []
|
|
|
- if (this.$utils.isEmpty(queryColumns)) {
|
|
|
- return
|
|
|
+ this.searchForms.forms = []
|
|
|
+ if (this.$utils.isEmpty(queryColumns)) {
|
|
|
+ return
|
|
|
}
|
|
|
- // TODO:目前第一个字段查询字段只支持 文本,多行文本和自动编号、数字、日期范围
|
|
|
- const firstFieldTypes = ['text', 'textarea', 'daterange', 'autonumber', 'number']
|
|
|
- const arr = [
|
|
|
- 'text',
|
|
|
- 'number',
|
|
|
- 'numberRange',
|
|
|
- 'hidden',
|
|
|
- 'select',
|
|
|
- 'dateRange',
|
|
|
- 'datePicker',
|
|
|
- 'autoNumber'
|
|
|
- ]
|
|
|
- const columns = []
|
|
|
- const queryColumnsData = []
|
|
|
+ // TODO:目前第一个字段查询字段只支持 文本,多行文本和自动编号、数字、日期范围
|
|
|
+ const firstFieldTypes = ['text', 'textarea', 'daterange', 'autonumber', 'number']
|
|
|
+ const arr = [
|
|
|
+ 'text',
|
|
|
+ 'number',
|
|
|
+ 'numberRange',
|
|
|
+ 'hidden',
|
|
|
+ 'select',
|
|
|
+ 'dateRange',
|
|
|
+ 'datePicker',
|
|
|
+ 'autoNumber'
|
|
|
+ ]
|
|
|
+ const columns = []
|
|
|
+ const queryColumnsData = []
|
|
|
queryColumns.forEach(column => {
|
|
|
- // 是否常用条件
|
|
|
+ // 是否常用条件
|
|
|
if (column.common === 'N') return
|
|
|
- // 拿到转换过后的列
|
|
|
- const field = this.convertField(column)
|
|
|
- const fd = this.buildSearchForm(field, !!column.same)
|
|
|
- columns.push(fd)
|
|
|
- const fieldType = field.field_type || ''
|
|
|
- if (firstFieldTypes.includes(fieldType.toLowerCase())) {
|
|
|
- queryColumnsData.push(fd)
|
|
|
- }
|
|
|
- if (!arr.includes(fieldType)) {
|
|
|
- this.slotForms.push(fd)
|
|
|
- }
|
|
|
- this.slotForms.forEach(v => {
|
|
|
- this.paramsForm[v.prop] = ''
|
|
|
- })
|
|
|
+ // 拿到转换过后的列
|
|
|
+ const field = this.convertField(column)
|
|
|
+ const fd = this.buildSearchForm(field, !!column.same)
|
|
|
+ columns.push(fd)
|
|
|
+ const fieldType = field.field_type || ''
|
|
|
+ if (firstFieldTypes.includes(fieldType.toLowerCase())) {
|
|
|
+ queryColumnsData.push(fd)
|
|
|
+ }
|
|
|
+ if (!arr.includes(fieldType)) {
|
|
|
+ this.slotForms.push(fd)
|
|
|
+ }
|
|
|
+ this.slotForms.forEach(v => {
|
|
|
+ this.paramsForm[v.prop] = ''
|
|
|
+ })
|
|
|
})
|
|
|
- console.log('this.slotForms====>', this.slotForms)
|
|
|
- this.searchForms.forms = columns
|
|
|
- // 顶部查询条件
|
|
|
- this.queryColumns = queryColumnsData || []
|
|
|
- const queryColumn = this.$utils.isNotEmpty(this.queryColumns) ? this.queryColumns[0] : {}
|
|
|
- this.queryKey = queryColumn.prop || ''
|
|
|
- this.queryName = queryColumn.label || ''
|
|
|
- this.fieldType = queryColumn.fieldType || ''
|
|
|
+ console.log('this.slotForms====>', this.slotForms)
|
|
|
+ this.searchForms.forms = columns
|
|
|
+ // 顶部查询条件
|
|
|
+ this.queryColumns = queryColumnsData || []
|
|
|
+ const queryColumn = this.$utils.isNotEmpty(this.queryColumns) ? this.queryColumns[0] : {}
|
|
|
+ this.queryKey = queryColumn.prop || ''
|
|
|
+ this.queryName = queryColumn.label || ''
|
|
|
+ this.fieldType = queryColumn.fieldType || ''
|
|
|
},
|
|
|
/**
|
|
|
* 组合判断queryColumn最终形态
|
|
|
* @param queryColumn queryColumn 列表查询区域的表单框集合
|
|
|
*/
|
|
|
- convertField: function (queryColumn) {
|
|
|
+ convertField: function(queryColumn) {
|
|
|
const field = this.fields[queryColumn.name.toLowerCase()] || null
|
|
|
- const same = !(queryColumn['same'] && queryColumn['same'] === 'N')
|
|
|
- let fieldType = same ? (field ? field['field_type'] || 'text' : 'text') : queryColumn['field_type'] || 'text'
|
|
|
- const fieldOptions = same ? (field ? field['field_options'] || {} : {}) : queryColumn['field_options'] || {}
|
|
|
- const dataType = field ? field['type'] || 'varchar' : 'varchar'
|
|
|
- const dataTypeList = ['date', 'timestamp', 'datetime', 'currentTime', 'currentDate']
|
|
|
- // console.log('datePicker===>',queryColumn.name, JSON.parse(JSON.stringify(queryColumn)))
|
|
|
- // 字段是日期类型
|
|
|
- if (dataTypeList.includes(dataType) && fieldType !== 'datePicker' && fieldType !== 'dateRange') {
|
|
|
- fieldType = 'datePicker'
|
|
|
- }
|
|
|
- if (fieldType === 'datePicker' || fieldType === 'dateRange') {
|
|
|
- const datefmtType = fieldOptions['datefmt_type']
|
|
|
- if (datefmtType !== 'custom') {
|
|
|
- fieldOptions['datefmt'] = this.getDatefmt(fieldOptions)
|
|
|
- }
|
|
|
+ const same = !(queryColumn['same'] && queryColumn['same'] === 'N')
|
|
|
+ let fieldType = same ? (field ? field['field_type'] || 'text' : 'text') : queryColumn['field_type'] || 'text'
|
|
|
+ const fieldOptions = same ? (field ? field['field_options'] || {} : {}) : queryColumn['field_options'] || {}
|
|
|
+ const dataType = field ? field['type'] || 'varchar' : 'varchar'
|
|
|
+ const dataTypeList = ['date', 'timestamp', 'datetime', 'currentTime', 'currentDate']
|
|
|
+ // console.log('datePicker===>',queryColumn.name, JSON.parse(JSON.stringify(queryColumn)))
|
|
|
+ // 字段是日期类型
|
|
|
+ if (dataTypeList.includes(dataType) && fieldType !== 'datePicker' && fieldType !== 'dateRange') {
|
|
|
+ fieldType = 'datePicker'
|
|
|
+ }
|
|
|
+ if (fieldType === 'datePicker' || fieldType === 'dateRange') {
|
|
|
+ const datefmtType = fieldOptions['datefmt_type']
|
|
|
+ if (datefmtType !== 'custom') {
|
|
|
+ fieldOptions['datefmt'] = this.getDatefmt(fieldOptions)
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- // 处理当前用户,当前组织控件
|
|
|
- if (fieldType === 'currentUser' || fieldType === 'currentOrg' || fieldType === 'currentPosition') {
|
|
|
- fieldType = 'selector'
|
|
|
- }
|
|
|
- queryColumn['field_type'] = fieldType
|
|
|
- queryColumn['field_options'] = fieldOptions
|
|
|
- queryColumn['data_type'] = dataType
|
|
|
- return queryColumn
|
|
|
+ // 处理当前用户,当前组织控件
|
|
|
+ if (fieldType === 'currentUser' || fieldType === 'currentOrg' || fieldType === 'currentPosition') {
|
|
|
+ fieldType = 'selector'
|
|
|
+ }
|
|
|
+ queryColumn['field_type'] = fieldType
|
|
|
+ queryColumn['field_options'] = fieldOptions
|
|
|
+ queryColumn['data_type'] = dataType
|
|
|
+ return queryColumn
|
|
|
},
|
|
|
/**
|
|
|
* 组合判断查询区域
|
|
|
* @param field 表单字段和表格列字段组合后的列字段属性
|
|
|
- * @param same
|
|
|
+ * @param same
|
|
|
*/
|
|
|
buildSearchForm(field, same) {
|
|
|
// console.log(field)
|
|
|
@@ -1466,19 +1471,19 @@ export default {
|
|
|
// console.log('searchColumn===>', searchColumn)
|
|
|
return searchColumn
|
|
|
},
|
|
|
- buildOptions (options = []) {
|
|
|
- const rtn = []
|
|
|
- options.forEach((option) => {
|
|
|
- rtn.push({
|
|
|
- value: option.val,
|
|
|
- label: option.label
|
|
|
- })
|
|
|
+ buildOptions(options = []) {
|
|
|
+ const rtn = []
|
|
|
+ options.forEach((option) => {
|
|
|
+ rtn.push({
|
|
|
+ value: option.val,
|
|
|
+ label: option.label
|
|
|
})
|
|
|
- return rtn
|
|
|
+ })
|
|
|
+ return rtn
|
|
|
},
|
|
|
- setOptionsInField () {},
|
|
|
- buildSwitchOptions (fieldOptions) {
|
|
|
- return FormUtils.getSwitchOptions(fieldOptions, 'value')
|
|
|
+ setOptionsInField() {},
|
|
|
+ buildSwitchOptions(fieldOptions) {
|
|
|
+ return FormUtils.getSwitchOptions(fieldOptions, 'value')
|
|
|
},
|
|
|
changeQuery(val, data) {
|
|
|
this.queryName = data['label']
|