mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-24 06:56:39 +08:00
Jeecg-Boot 2.1.2版本发布
This commit is contained in:
@ -181,6 +181,7 @@
|
||||
:options="col.options"
|
||||
:getPopupContainer="getParentContainer"
|
||||
:placeholder="replaceProps(col, col.placeholder)"
|
||||
:filterOption="(i,o)=>handleSelectFilterOption(i,o,col)"
|
||||
@change="(v)=>handleChangeSelectCommon(v,id,row,col)"
|
||||
@search="(v)=>handleSearchSelect(v,id,row,col)"
|
||||
@blur="(v)=>handleBlurSearch(v,id,row,col)"
|
||||
@ -514,7 +515,7 @@
|
||||
</div>
|
||||
|
||||
<!-- else (normal) -->
|
||||
<span v-else :key="i" v-bind="buildProps(row,col)" >{{ inputValues[rowIndex][col.key] }}</span>
|
||||
<span v-else :key="i" v-bind="buildProps(row,col)">{{ inputValues[rowIndex][col.key] }}</span>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
@ -657,17 +658,6 @@
|
||||
created() {
|
||||
// 当前显示的tr
|
||||
this.visibleTrEls = []
|
||||
// 用来存储input表单的值
|
||||
// 数组里的每项都是一个对象,对象里每个key都是input的rowKey,值就是input的值,其中有个id的字段来区分
|
||||
// 示例:
|
||||
// [{
|
||||
// id: "_jet-4sp0iu-15541771111770"
|
||||
// dbDefaultVal: "aaa",
|
||||
// dbFieldName: "bbb",
|
||||
// dbFieldTxt: "ccc",
|
||||
// dbLength: 32
|
||||
// }]
|
||||
this.inputValues = []
|
||||
this.disabledRowIds = (this.disabledRowIds || [])
|
||||
},
|
||||
// 计算属性
|
||||
@ -827,15 +817,18 @@
|
||||
for (let columnKey in this.disabledRows) {
|
||||
// 判断是否有该属性
|
||||
if (this.disabledRows.hasOwnProperty(columnKey) && data.hasOwnProperty(columnKey)) {
|
||||
// row[columnKey] =
|
||||
|
||||
if (disabled !== true) {
|
||||
disabled = this.disabledRows[columnKey] === data[columnKey]
|
||||
let temp = this.disabledRows[columnKey]
|
||||
// 禁用规则可以是一个数组
|
||||
if (temp instanceof Array) {
|
||||
disabled = temp.includes(data[columnKey])
|
||||
} else {
|
||||
disabled = (temp === data[columnKey])
|
||||
}
|
||||
if (disabled) {
|
||||
disabledRowIds.push(row.id)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -870,9 +863,9 @@
|
||||
column.options = column.options.map(item => {
|
||||
if (item) {
|
||||
return {
|
||||
...item,
|
||||
text: item.text || item.title,
|
||||
title: item.text || item.title,
|
||||
value: item.value
|
||||
title: item.text || item.title
|
||||
}
|
||||
}
|
||||
return {}
|
||||
@ -925,10 +918,20 @@
|
||||
|
||||
/** 初始化列表 */
|
||||
initialize() {
|
||||
// inputValues:用来存储input表单的值
|
||||
// 数组里的每项都是一个对象,对象里每个key都是input的rowKey,值就是input的值,其中有个id的字段来区分
|
||||
// 示例:
|
||||
// [{
|
||||
// id: "_jet-4sp0iu-15541771111770"
|
||||
// dbDefaultVal: "aaa",
|
||||
// dbFieldName: "bbb",
|
||||
// dbFieldTxt: "ccc",
|
||||
// dbLength: 32
|
||||
// }]
|
||||
this.inputValues = []
|
||||
this.visibleTrEls = []
|
||||
this.rows = []
|
||||
this.deleteIds = []
|
||||
this.inputValues = []
|
||||
this.selectValues = {}
|
||||
this.checkboxValues = {}
|
||||
this.jdateValues = {}
|
||||
@ -1094,16 +1097,17 @@
|
||||
}
|
||||
this.rows = rows
|
||||
|
||||
let rowValue = this.getValuesSync({
|
||||
validate: false,
|
||||
rowIds: [this.removeCaseId(row.id)]
|
||||
}).values[0]
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.updateFormValues()
|
||||
})
|
||||
// 触发add事件
|
||||
this.$emit('added', {
|
||||
row: (() => {
|
||||
let r = Object.assign({}, row)
|
||||
r.id = this.removeCaseId(r.id)
|
||||
return r
|
||||
})(),
|
||||
row: rowValue,
|
||||
target: this
|
||||
})
|
||||
// 设置滚动条位置
|
||||
@ -1600,9 +1604,16 @@
|
||||
clearSelection() {
|
||||
this.selectedRowIds = []
|
||||
},
|
||||
/** 用于搜索下拉框中的内容 */
|
||||
handleSelectFilterOption(input, option, column) {
|
||||
if (column.allowSearch === true) {
|
||||
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||
}
|
||||
return true
|
||||
},
|
||||
/** select 搜索时的事件,用于动态添加options */
|
||||
handleSearchSelect(value, id, row, col) {
|
||||
if (col.allowInput === true) {
|
||||
if (col.allowSearch !== true && col.allowInput === true) {
|
||||
// 是否找到了对应的项,找不到则添加这一项
|
||||
let flag = false
|
||||
for (let option of col.options) {
|
||||
@ -1941,7 +1952,7 @@
|
||||
}
|
||||
}
|
||||
// 判断select是否允许输入
|
||||
if (col.type === FormTypes.select && col.allowInput === true) {
|
||||
if (col.type === FormTypes.select && (col.allowInput === true || col.allowSearch === true)) {
|
||||
props['showSearch'] = true
|
||||
}
|
||||
|
||||
@ -2022,7 +2033,6 @@
|
||||
this.elemValueChange(FormTypes.list_multi, row, column, value)
|
||||
},
|
||||
handleSearchSelectChange(value, id, row, column) {
|
||||
console.log(value)
|
||||
this.searchSelectValues = this.bindValuesChange(value, id, 'searchSelectValues')
|
||||
this.validateOneInput(value, row, column, this.notPassedIds, true, 'change')
|
||||
this.elemValueChange(FormTypes.sel_search, row, column, value)
|
||||
|
||||
@ -61,6 +61,7 @@
|
||||
toolbar: this.toolbar,
|
||||
branding: false,
|
||||
menubar: false,
|
||||
toolbar_drawer: false,
|
||||
images_upload_handler: (blobInfo, success) => {
|
||||
const img = 'data:image/jpeg;base64,' + blobInfo.base64()
|
||||
success(img)
|
||||
|
||||
@ -63,7 +63,33 @@
|
||||
</a-col>
|
||||
|
||||
<a-col :span="8">
|
||||
<j-dict-select-tag v-if="item.dictCode" v-model="item.val" :dictCode="item.dictCode" placeholder="请选择"/>
|
||||
<template v-if="item.dictCode">
|
||||
<template v-if="item.type === 'table-dict'">
|
||||
<j-popup
|
||||
v-model="item.val"
|
||||
:code="item.dictTable"
|
||||
:field="item.dictCode"
|
||||
:orgFields="item.dictCode"
|
||||
:destFields="item.dictCode"
|
||||
></j-popup>
|
||||
</template>
|
||||
<j-dict-select-tag v-else v-model="item.val" :dictCode="item.dictCode" placeholder="请选择"/>
|
||||
</template>
|
||||
<j-select-multi-user
|
||||
v-else-if="item.type === 'select-user'"
|
||||
v-model="item.val"
|
||||
:buttons="false"
|
||||
:multiple="false"
|
||||
placeholder="请选择用户"
|
||||
:returnKeys="['id', item.customReturnField || 'username']"
|
||||
/>
|
||||
<j-select-depart
|
||||
v-else-if="item.type === 'select-depart'"
|
||||
v-model="item.val"
|
||||
:multi="false"
|
||||
placeholder="请选择部门"
|
||||
:customReturnField="item.customReturnField || 'id'"
|
||||
/>
|
||||
<j-date v-else-if=" item.type=='date' " v-model="item.val" placeholder="请选择日期" style="width: 100%"></j-date>
|
||||
<j-date v-else-if=" item.type=='datetime' " v-model="item.val" placeholder="请选择时间" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"></j-date>
|
||||
<a-input-number v-else-if=" item.type=='int'||item.type=='number' " style="width: 100%" placeholder="请输入数值" v-model="item.val"/>
|
||||
@ -86,7 +112,10 @@
|
||||
<div slot="title">
|
||||
保存的查询
|
||||
</div>
|
||||
|
||||
<a-empty v-if="treeData.length === 0" class="j-super-query-history-empty" description="没有保存任何查询"/>
|
||||
<a-tree
|
||||
v-else
|
||||
class="j-super-query-history-tree"
|
||||
showIcon
|
||||
:treeData="treeData"
|
||||
@ -113,10 +142,12 @@
|
||||
<script>
|
||||
import * as utils from '@/utils/util'
|
||||
import JDate from '@/components/jeecg/JDate.vue'
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
import JSelectMultiUser from '@/components/jeecgbiz/JSelectMultiUser'
|
||||
|
||||
export default {
|
||||
name: 'JSuperQuery',
|
||||
components: { JDate },
|
||||
components: { JDate, JSelectDepart, JSelectMultiUser },
|
||||
props: {
|
||||
/*
|
||||
fieldList: [{
|
||||
@ -182,7 +213,6 @@
|
||||
return item
|
||||
})
|
||||
}
|
||||
console.log({ list })
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -222,9 +252,12 @@
|
||||
handleSelected(option, item) {
|
||||
let index = option.data.attrs['data-idx']
|
||||
|
||||
let { type, dictCode } = this.fieldList[index]
|
||||
let { type, dictCode, dictTable, customReturnField } = this.fieldList[index]
|
||||
item['type'] = type
|
||||
item['dictCode'] = dictCode
|
||||
item['dictTable'] = dictTable
|
||||
item['customReturnField'] = customReturnField
|
||||
this.$set(item, 'val', '')
|
||||
},
|
||||
handleReset() {
|
||||
this.queryParamsModel = [{}]
|
||||
@ -338,6 +371,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
.j-super-query-history-empty /deep/ {
|
||||
.ant-empty-image {
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 80px;
|
||||
height: 65px;
|
||||
}
|
||||
|
||||
.ant-empty-description {
|
||||
color: #afafaf;
|
||||
margin: 8px 0;
|
||||
}
|
||||
}
|
||||
|
||||
.j-super-query-history-tree /deep/ {
|
||||
.ant-tree-switcher {
|
||||
display: none;
|
||||
|
||||
Reference in New Issue
Block a user