更新展示形式,升级到2.4.5

This commit is contained in:
zer0Black
2022-03-31 13:08:28 +08:00
parent 5b3ce242e2
commit abe1f7467d
41 changed files with 621 additions and 511 deletions
+3 -5
View File
@@ -45,7 +45,8 @@
"vuex": "^3.1.0", "vuex": "^3.1.0",
"vxe-table": "2.9.13", "vxe-table": "2.9.13",
"vxe-table-plugin-antd": "1.8.10", "vxe-table-plugin-antd": "1.8.10",
"xe-utils": "2.4.8" "xe-utils": "2.4.8",
"cron-parser": "^2.10.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/polyfill": "^7.2.5", "@babel/polyfill": "^7.2.5",
@@ -98,10 +99,7 @@
"vue/html-closing-bracket-newline": 0, "vue/html-closing-bracket-newline": 0,
"vue/no-parsing-error": 0, "vue/no-parsing-error": 0,
"no-tabs": 0, "no-tabs": 0,
"indent": [ "indent": ["off", 2],
"off",
2
],
"no-console": 0, "no-console": 0,
"space-before-function-paren": 0 "space-before-function-paren": 0
} }
@@ -6,7 +6,7 @@
</template> </template>
<script> <script>
import JVxeCellMixins, { vModel, dispatchEvent } from '@/components/jero/JVxeTable/mixins/JVxeCellMixins' import JVxeCellMixins, { dispatchEvent, vModel } from '@/components/jeecg/JVxeTable/mixins/JVxeCellMixins'
export default { export default {
name: 'JVxePopupCell', name: 'JVxePopupCell',
@@ -22,6 +22,8 @@
orgFields: col.orgFields, orgFields: col.orgFields,
destFields: col.destFields, destFields: col.destFields,
groupId: caseId, groupId: caseId,
param: col.param,
sorter: col.sorter,
} }
}, },
}, },
@@ -48,7 +50,9 @@
// 【组件增强】注释详见:JVxeCellMixins.js // 【组件增强】注释详见:JVxeCellMixins.js
enhanced: { enhanced: {
aopEvents: { aopEvents: {
editActived: event => dispatchEvent(event, 'ant-input'), editActived(event) {
dispatchEvent.call(this, event, 'ant-input')
},
}, },
}, },
} }
@@ -254,7 +254,9 @@ export const DictSearchInputCell = {
// 【组件增强】注释详见:JVxeCellMixins.js // 【组件增强】注释详见:JVxeCellMixins.js
enhanced: { enhanced: {
aopEvents: { aopEvents: {
editActived: event => dispatchEvent(event, 'ant-select'), editActived(event) {
dispatchEvent.call(this, event, 'ant-select')
},
}, },
} }
} }
@@ -25,7 +25,6 @@
props: { props: {
dictCode: String, dictCode: String,
placeholder: String, placeholder: String,
triggerChange: Boolean,
disabled: Boolean, disabled: Boolean,
value: [String, Number], value: [String, Number],
type: String, type: String,
@@ -82,19 +81,15 @@
} }
}) })
}, },
handleInput(e) { handleInput(e='') {
let val; let val;
if(this.tagType=="radio"){ if(Object.keys(e).includes('target')){
val = e.target.value val = e.target.value
}else{ }else{
val = e val = e
} }
console.log(val); console.log(val);
if(this.triggerChange){ this.$emit('change', val);
this.$emit('change', val);
}else{
this.$emit('input', val);
}
}, },
setCurrentDictOptions(dictOptions){ setCurrentDictOptions(dictOptions){
this.dictOptions = dictOptions this.dictOptions = dictOptions
@@ -102,6 +97,10 @@
getCurrentDictOptions(){ getCurrentDictOptions(){
return this.dictOptions return this.dictOptions
} }
},
model:{
prop: 'value',
event: 'change'
} }
} }
</script> </script>
@@ -65,7 +65,11 @@
type: Number, type: Number,
default: 10, default: 10,
required: false required: false
} },
getPopupContainer: {
type:Function,
default: null
},
}, },
data(){ data(){
this.loadData = debounce(this.loadData, 800);//消抖 this.loadData = debounce(this.loadData, 800);//消抖
@@ -226,7 +230,9 @@
return this.options return this.options
}, },
getParentContainer(node){ getParentContainer(node){
if(!this.popContainer){ if(typeof this.getPopupContainer === 'function'){
return this.getPopupContainer(node)
} else if(!this.popContainer){
return node.parentNode return node.parentNode
}else{ }else{
return document.querySelector(this.popContainer) return document.querySelector(this.popContainer)
+2 -2
View File
@@ -1,7 +1,7 @@
<template> <template>
<div class="components-input-demo-presuffix"> <div class="components-input-demo-presuffix">
<a-input @click="openModal" placeholder="corn表达式" v-model="cron" @change="handleOK"> <a-input @click="openModal" placeholder="cron表达式" v-model="cron" @change="(e)=>handleOK(e.target.value)">
<a-icon slot="prefix" type="schedule" title="corn控件"/> <a-icon slot="prefix" type="schedule" title="cron控件"/>
<a-icon v-if="cron" slot="suffix" type="close-circle" @click="handleEmpty" title="清空"/> <a-icon v-if="cron" slot="suffix" type="close-circle" @click="handleEmpty" title="清空"/>
</a-input> </a-input>
<JCronModal ref="innerVueCron" :data="cron" @ok="handleOK"></JCronModal> <JCronModal ref="innerVueCron" :data="cron" @ok="handleOK"></JCronModal>
+73 -13
View File
@@ -350,7 +350,7 @@
<a-tooltip v-bind="buildTooltipProps(row, col, id)"> <a-tooltip v-bind="buildTooltipProps(row, col, id)">
<a-upload <a-upload
name="file" name="file"
:data="{'isup':1}" :data="{'isup':1, ...(col.data||{})}"
:multiple="false" :multiple="false"
:action="col.action" :action="col.action"
:headers="uploadGetHeaders(row,col)" :headers="uploadGetHeaders(row,col)"
@@ -381,6 +381,8 @@
:dest-fields="col.destFields" :dest-fields="col.destFields"
:code="col.popupCode" :code="col.popupCode"
:groupId="caseId" :groupId="caseId"
:param="col.param"
:sorter="col.sorter"
@input="(value,others)=>popupCallback(value,others,id,row,col,rowIndex)" @input="(value,others)=>popupCallback(value,others,id,row,col,rowIndex)"
/> />
<span <span
@@ -595,6 +597,33 @@
</template> </template>
<!-- select搜索 -end --> <!-- select搜索 -end -->
<!-- select异步搜索 -begin -->
<template v-else-if="col.type === formTypes.sel_search_async">
<a-tooltip v-bind="buildTooltipProps(row, col, id)">
<j-search-select-tag
v-if="isEditRow(row, col)"
:id="id"
:key="i"
:value="searchSelectAsyncValues[id]"
:placeholder="replaceProps(col, col.placeholder)"
:dict="col.dict"
:async="true"
:getPopupContainer="getParentContainer"
v-bind="buildProps(row,col)"
style="width: 100%;"
@change="(v)=>handleSearchSelectAsyncChange(v,id,row,col)"
>
</j-search-select-tag>
<span
v-else
class="j-td-span no-edit"
:class="{disabled: buildProps(row,col).disabled}"
@click="handleEditRow(row, col)"
>{{ searchSelectAsyncValues[id] }}</span>
</a-tooltip>
</template>
<!-- select异步搜索 -end -->
<div v-else-if="col.type === formTypes.slot" :key="i"> <div v-else-if="col.type === formTypes.slot" :key="i">
<a-tooltip v-bind="buildTooltipProps(row, col, id)"> <a-tooltip v-bind="buildTooltipProps(row, col, id)">
<slot <slot
@@ -615,7 +644,7 @@
</div> </div>
<!-- else (normal) --> <!-- else (normal) -->
<span v-else :key="i" v-bind="buildProps(row,col)">{{ inputValues[rowIndex][col.key] }}</span> <span class="comp-normal" v-else :key="i" :title="inputValues[rowIndex][col.key]" v-bind="buildProps(row,col)">{{ inputValues[rowIndex][col.key] }}</span>
</template> </template>
</div> </div>
</div> </div>
@@ -672,13 +701,13 @@
import Draggable from 'vuedraggable' import Draggable from 'vuedraggable'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import { FormTypes, VALIDATE_NO_PASSED } from '@/utils/JEditableTableUtil' import { FormTypes, VALIDATE_NO_PASSED } from '@/utils/JEditableTableUtil'
import { cloneObject, randomString, randomNumber, getEventPath } from '@/utils/util' import { cloneObject, getEventPath, randomNumber, randomString } from '@/utils/util'
import JDate from '@/components/jero/JDate' import JDate from '@/components/jero/JDate'
import { filterDictText, initDictOptions } from '@/components/dict/JDictSelectUtil' import { filterDictText, initDictOptions } from '@/components/dict/JDictSelectUtil'
import { getFileAccessHttpUrl } from '@/api/manage'; import { getFileAccessHttpUrl } from '@/api/manage'
import JInputPop from '@/components/jero/minipop/JInputPop' import JInputPop from '@/components/jero/minipop/JInputPop'
import JFilePop from '@/components/jero/minipop/JFilePop' import JFilePop from '@/components/jero/minipop/JFilePop'
import { getNoAuthCols } from "@/utils/authFilter" import { getNoAuthCols } from '@/utils/authFilter'
// 行高,需要在实例加载完成前用到 // 行高,需要在实例加载完成前用到
let rowHeight = 61 let rowHeight = 61
@@ -814,6 +843,7 @@
metaCheckboxValues: {}, metaCheckboxValues: {},
multiSelectValues: {}, multiSelectValues: {},
searchSelectValues: {}, searchSelectValues: {},
searchSelectAsyncValues: {},
// 绑定左侧选择框已选择的id // 绑定左侧选择框已选择的id
selectedRowIds: [], selectedRowIds: [],
// 存储被删除行的id // 存储被删除行的id
@@ -1048,6 +1078,10 @@
this.inputValues = [] this.inputValues = []
this.rows = [] this.rows = []
this.deleteIds = [] this.deleteIds = []
this.selectedRowIds = []
this.tooltips = {}
this.notPassedIds = []
// 重置values
this.selectValues = {} this.selectValues = {}
this.checkboxValues = {} this.checkboxValues = {}
this.jdateValues = {} this.jdateValues = {}
@@ -1055,14 +1089,16 @@
this.departCompValues = {} this.departCompValues = {}
this.userCompValues = {} this.userCompValues = {}
this.slotValues = {} this.slotValues = {}
this.selectedRowIds = [] //update-begin-author:shunjlei date:20210415 for:类型赋值错误
this.tooltips = {} this.uploadValues = {}
this.notPassedIds = [] this.popupValues = {}
this.uploadValues = [] this.radioValues = {}
this.popupValues = [] this.multiSelectValues = {}
this.radioValues = [] this.searchSelectValues = {}
this.multiSelectValues = [] this.searchSelectAsyncValues = {}
this.searchSelectValues = [] //update-end-author:shunjlei date:20210415 for:类型赋值错误
// 重置滚动条
this.scrollTop = 0 this.scrollTop = 0
this.$nextTick(() => { this.$nextTick(() => {
this.getElement('tbody').scrollTop = 0 this.getElement('tbody').scrollTop = 0
@@ -1136,6 +1172,7 @@
let radioValues = { ...this.radioValues } let radioValues = { ...this.radioValues }
let multiSelectValues = { ...this.multiSelectValues } let multiSelectValues = { ...this.multiSelectValues }
let searchSelectValues = { ...this.searchSelectValues } let searchSelectValues = { ...this.searchSelectValues }
let searchSelectAsyncValues = { ...this.searchSelectAsyncValues }
// 禁用行的id // 禁用行的id
let disabledRowIds = (this.disabledRowIds || []) let disabledRowIds = (this.disabledRowIds || [])
dataSource.forEach((data, newValueIndex) => { dataSource.forEach((data, newValueIndex) => {
@@ -1225,6 +1262,8 @@
radioValues[inputId] = sourceValue radioValues[inputId] = sourceValue
} else if (column.type === FormTypes.sel_search) { } else if (column.type === FormTypes.sel_search) {
searchSelectValues[inputId] = sourceValue searchSelectValues[inputId] = sourceValue
} else if (column.type === FormTypes.sel_search_async) {
searchSelectAsyncValues[inputId] = sourceValue
} else if (column.type === FormTypes.list_multi) { } else if (column.type === FormTypes.list_multi) {
if (typeof sourceValue === 'string' && sourceValue.length > 0) { if (typeof sourceValue === 'string' && sourceValue.length > 0) {
multiSelectValues[inputId] = sourceValue.split(',') multiSelectValues[inputId] = sourceValue.split(',')
@@ -1245,6 +1284,8 @@
status: 'done', status: 'done',
path: sourceValue path: sourceValue
} }
} else {
uploadValues[inputId] = null
} }
} else { } else {
value[column.key] = sourceValue value[column.key] = sourceValue
@@ -1309,6 +1350,7 @@
this.radioValues = radioValues this.radioValues = radioValues
this.multiSelectValues = multiSelectValues this.multiSelectValues = multiSelectValues
this.searchSelectValues = searchSelectValues this.searchSelectValues = searchSelectValues
this.searchSelectAsyncValues = searchSelectAsyncValues
// 重新计算所有统计列 // 重新计算所有统计列
this.recalcAllStatisticsColumns() this.recalcAllStatisticsColumns()
// 更新到 dom // 更新到 dom
@@ -1543,6 +1585,8 @@
value[column.key] = this.radioValues[inputId] value[column.key] = this.radioValues[inputId]
} else if (column.type === FormTypes.sel_search) { } else if (column.type === FormTypes.sel_search) {
value[column.key] = this.searchSelectValues[inputId] value[column.key] = this.searchSelectValues[inputId]
} else if (column.type === FormTypes.sel_search_async) {
value[column.key] = this.searchSelectAsyncValues[inputId]
} else if (column.type === FormTypes.list_multi) { } else if (column.type === FormTypes.list_multi) {
if (!this.multiSelectValues[inputId] || this.multiSelectValues[inputId].length === 0) { if (!this.multiSelectValues[inputId] || this.multiSelectValues[inputId].length === 0) {
value[column.key] = '' value[column.key] = ''
@@ -1671,6 +1715,7 @@
radioValues: this.radioValues, radioValues: this.radioValues,
multiSelectValues: this.multiSelectValues, multiSelectValues: this.multiSelectValues,
searchSelectValues: this.searchSelectValues, searchSelectValues: this.searchSelectValues,
searchSelectAsyncValues: this.searchSelectAsyncValues,
}) })
}, },
/** 设置某行某列的值 */ /** 设置某行某列的值 */
@@ -1736,6 +1781,8 @@
edited = this.setOneValue(this.multiSelectValues, modelKey, newValue, true) edited = this.setOneValue(this.multiSelectValues, modelKey, newValue, true)
} else if (column.type === FormTypes.sel_search) { } else if (column.type === FormTypes.sel_search) {
edited = this.setOneValue(this.searchSelectValues, modelKey, newValue) edited = this.setOneValue(this.searchSelectValues, modelKey, newValue)
} else if (column.type === FormTypes.sel_search_async) {
edited = this.setOneValue(this.searchSelectAsyncValues, modelKey, newValue)
} else { } else {
edited = false edited = false
} }
@@ -2731,6 +2778,11 @@
this.validateOneInput(value, row, column, this.notPassedIds, true, 'change') this.validateOneInput(value, row, column, this.notPassedIds, true, 'change')
this.elemValueChange(FormTypes.sel_search, row, column, value) this.elemValueChange(FormTypes.sel_search, row, column, value)
}, },
handleSearchSelectAsyncChange(value, id, row, column) {
this.searchSelectAsyncValues = this.bindValuesChange(value, id, 'searchSelectAsyncValues')
this.validateOneInput(value, row, column, this.notPassedIds, true, 'change')
this.elemValueChange(FormTypes.sel_search_async, row, column, value)
},
filterOption(input, option) { filterOption(input, option) {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
}, },
@@ -2992,6 +3044,8 @@
border-bottom: @border; border-bottom: @border;
transition: background-color 300ms; transition: background-color 300ms;
width: 100%; width: 100%;
height: 61px;
overflow: hidden;
position: absolute; position: absolute;
left: 0; left: 0;
z-index: 10; z-index: 10;
@@ -3101,6 +3155,12 @@
} }
} }
.comp-normal {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.j-td-span { .j-td-span {
position: relative; position: relative;
padding: 4px 11px; padding: 4px 11px;
+6
View File
@@ -10,6 +10,7 @@
ref="jPopupOnlReport" ref="jPopupOnlReport"
:code="code" :code="code"
:multi="multi" :multi="multi"
:sorter="sorter"
:groupId="uniqGroupId" :groupId="uniqGroupId"
:param="param" :param="param"
@ok="callBack" @ok="callBack"
@@ -47,6 +48,11 @@
default: '', default: '',
required: false required: false
}, },
/** 排序列,指定要排序的列,使用方式:列名=desc|asc */
sorter: {
type: String,
default: ''
},
width: { width: {
type: Number, type: Number,
default: 1200, default: 1200,
+5
View File
@@ -2,6 +2,7 @@
<div :id="containerId" style="position: relative"> <div :id="containerId" style="position: relative">
<a-upload <a-upload
name="file" name="file"
:multiple="multiple"
:action="uploadAction" :action="uploadAction"
:headers="headers" :headers="headers"
:data="{'biz':bizPath}" :data="{'biz':bizPath}"
@@ -106,6 +107,10 @@
required:false, required:false,
default: true default: true
}, },
multiple: {
type: Boolean,
default: true
},
}, },
watch:{ watch:{
value:{ value:{
@@ -13,7 +13,7 @@ import JVxeDetailsModal from './JVxeDetailsModal'
import JVxePagination from './JVxePagination' import JVxePagination from './JVxePagination'
import { cloneObject, getVmParentByName, pushIfNotExist, randomString, simpleDebounce } from '@/utils/util' import { cloneObject, getVmParentByName, pushIfNotExist, randomString, simpleDebounce } from '@/utils/util'
import { UtilTools } from 'vxe-table/packages/tools/src/utils' import { UtilTools } from 'vxe-table/packages/tools/src/utils'
import { getNoAuthCols } from "@/utils/authFilter" import { getNoAuthCols } from '@/utils/authFilter'
export default { export default {
name: 'JVxeTable', name: 'JVxeTable',
@@ -95,6 +95,9 @@ export default {
// 是否异步删除行,如果你要实现异步删除,那么需要把这个选项开启, // 是否异步删除行,如果你要实现异步删除,那么需要把这个选项开启,
// 在remove事件里调用confirmRemove方法才会真正删除(除非删除的全是新增的行) // 在remove事件里调用confirmRemove方法才会真正删除(除非删除的全是新增的行)
asyncRemove: PropTypes.bool.def(false), asyncRemove: PropTypes.bool.def(false),
// 是否一直显示组件,如果为false则只有点击的时候才出现组件
// 注:该参数不能动态修改;如果行、列字段多的情况下,会根据机器性能造成不同程度的卡顿。
alwaysEdit: PropTypes.bool.def(false),
}, },
data() { data() {
return { return {
@@ -354,7 +357,7 @@ export default {
col.visible = false col.visible = false
} else if (enhanced.switches.editRender) { } else if (enhanced.switches.editRender) {
renderName = 'editRender' renderName = 'editRender'
renderOptions.type = enhanced.switches.visible ? 'visible' : 'default' renderOptions.type = (enhanced.switches.visible || this.alwaysEdit) ? 'visible' : 'default'
} }
} else { } else {
renderOptions.name = JVXETypes._prefix + JVXETypes.normal renderOptions.name = JVXETypes._prefix + JVXETypes.normal
@@ -1076,7 +1079,7 @@ export default {
// 添加默认值 // 添加默认值
xTable.tableFullColumn.forEach(column => { xTable.tableFullColumn.forEach(column => {
let col = column.own let col = column.own
if (record[col.key] == null || record[col.key] === '') { if (col.key && (record[col.key] == null || record[col.key] === '')) {
// 设置默认值 // 设置默认值
let createValue = getEnhancedMixins(col.$type || col.type, 'createValue') let createValue = getEnhancedMixins(col.$type || col.type, 'createValue')
record[col.key] = createValue({row: record, column, $table: xTable}) record[col.key] = createValue({row: record, column, $table: xTable})
@@ -55,7 +55,9 @@
// 【组件增强】注释详见:JVxeCellMixins.js // 【组件增强】注释详见:JVxeCellMixins.js
enhanced: { enhanced: {
aopEvents: { aopEvents: {
editActived: event => dispatchEvent(event, 'ant-calendar-picker', el => el.children[0].dispatchEvent(event.$event)), editActived(event) {
dispatchEvent.call(this, event, 'ant-calendar-picker', el => el.children[0].dispatchEvent(event.$event))
},
}, },
} }
} }
@@ -34,7 +34,7 @@
return this.rowIndex === 0 return this.rowIndex === 0
}, },
disabledMoveDown() { disabledMoveDown() {
return this.rowIndex === (this.rows.length - 1) return this.rowIndex === (this.fullDataLength - 1)
}, },
}, },
methods: { methods: {
@@ -116,7 +116,9 @@
// 【组件增强】注释详见:JVxeCellMixins.js // 【组件增强】注释详见:JVxeCellMixins.js
enhanced: { enhanced: {
aopEvents: { aopEvents: {
editActived: event => dispatchEvent(event, 'ant-select'), editActived(event) {
dispatchEvent.call(this, event, 'ant-select')
},
}, },
translate: {enabled: true}, translate: {enabled: true},
getValue(value) { getValue(value) {
@@ -23,7 +23,9 @@
autofocus: '.ant-input', autofocus: '.ant-input',
}, },
aopEvents: { aopEvents: {
editActived: event => dispatchEvent(event, 'anticon-fullscreen'), editActived(event) {
dispatchEvent.call(this, event, 'anticon-fullscreen')
},
}, },
}, },
} }
@@ -36,6 +36,9 @@ export default {
rows() { rows() {
return this.params.data return this.params.data
}, },
fullDataLength() {
return this.params.$table.tableFullData.length
},
rowIndex() { rowIndex() {
return this.params.rowIndex return this.params.rowIndex
}, },
@@ -291,6 +294,10 @@ export function vModel(value, row, property) {
/** 模拟触发事件 */ /** 模拟触发事件 */
export function dispatchEvent({cell, $event}, className, handler) { export function dispatchEvent({cell, $event}, className, handler) {
// alwaysEdit 下不模拟触发事件,否者会导致触发两次
if (this && this.alwaysEdit) {
return
}
window.setTimeout(() => { window.setTimeout(() => {
let element = cell.getElementsByClassName(className) let element = cell.getElementsByClassName(className)
if (element && element.length > 0) { if (element && element.length > 0) {
@@ -298,9 +305,7 @@ export function dispatchEvent({cell, $event}, className, handler) {
handler(element[0]) handler(element[0])
} else { } else {
// 模拟触发点击事件 // 模拟触发点击事件
console.log($event)
if($event){ if($event){
console.log("$event===>",$event)
element[0].dispatchEvent($event) element[0].dispatchEvent($event)
} }
} }
+2
View File
@@ -26,6 +26,7 @@ import JSlider from './JSlider.vue'
import JSwitch from './JSwitch.vue' import JSwitch from './JSwitch.vue'
import JTime from './JTime.vue' import JTime from './JTime.vue'
import JTreeTable from './JTreeTable.vue' import JTreeTable from './JTreeTable.vue'
import JEasyCron from "@/components/jeecg/JEasyCron";
//jerobiz //jerobiz
import JSelectDepart from '../jerobiz/JSelectDepart.vue' import JSelectDepart from '../jerobiz/JSelectDepart.vue'
@@ -69,5 +70,6 @@ export default {
Vue.component('JSelectMultiUser', JSelectMultiUser) Vue.component('JSelectMultiUser', JSelectMultiUser)
Vue.component('JSelectRole', JSelectRole) Vue.component('JSelectRole', JSelectRole)
Vue.component('JSelectUserByDep', JSelectUserByDep) Vue.component('JSelectUserByDep', JSelectUserByDep)
Vue.component(JEasyCron.name, JEasyCron)
} }
} }
@@ -1,6 +1,6 @@
<template> <template>
<a-modal <a-modal
title="corn表达式" title="cron表达式"
:width="modalWidth" :width="modalWidth"
:visible="visible" :visible="visible"
:confirmLoading="confirmLoading" :confirmLoading="confirmLoading"
@@ -78,7 +78,7 @@
const MODAL_WIDTH = 1200; const MODAL_WIDTH = 1200;
export default { export default {
name: 'JPopupOnlReport', name: 'JPopupOnlReport',
props: ['multi', 'code', 'groupId', 'param'], props: ['multi', 'code', 'sorter', 'groupId', 'param'],
components:{ components:{
}, },
data(){ data(){
@@ -122,8 +122,9 @@
cgRpConfigId:"", cgRpConfigId:"",
modalWidth:MODAL_WIDTH, modalWidth:MODAL_WIDTH,
tableScroll:{x:true}, tableScroll:{x:true},
dynamicParam:{} dynamicParam:{},
// 排序字段,默认无排序
iSorter: null,
} }
}, },
mounted() { mounted() {
@@ -139,7 +140,28 @@
this.dynamicParamHandler() this.dynamicParamHandler()
this.loadData(); this.loadData();
}, },
} },
sorter: {
immediate: true,
handler() {
if (this.sorter) {
let arr = this.sorter.split('=')
if (arr.length === 2 && ['asc', 'desc'].includes(arr[1].toLowerCase())) {
this.iSorter = {column: arr[0], order: arr[1].toLowerCase()}
// 排序字段受控
this.table.columns.forEach(col => {
if (col.dataIndex === this.iSorter.column) {
this.$set(col, 'sortOrder', this.iSorter.order === 'asc' ? 'ascend' : 'descend')
} else {
this.$set(col, 'sortOrder', false)
}
})
} else {
console.warn('【JPopup】sorter参数不合法')
}
}
},
},
}, },
computed:{ computed:{
showSearchFlag(){ showSearchFlag(){
@@ -167,6 +189,10 @@
return filterMultiDictText(this.dictOptions[dictCode], text+""); return filterMultiDictText(this.dictOptions[dictCode], text+"");
} }
} }
// 排序字段受控
if (this.iSorter && currColumns[a].dataIndex === this.iSorter.column) {
currColumns[a].sortOrder = this.iSorter.order === 'asc' ? 'ascend' : 'descend'
}
} }
this.table.columns = [...currColumns] this.table.columns = [...currColumns]
this.initQueryInfo() this.initQueryInfo()
@@ -253,7 +279,7 @@
paramTarget['self_'+key] = this.dynamicParam[key] paramTarget['self_'+key] = this.dynamicParam[key]
}) })
} }
let param = Object.assign(paramTarget, this.queryParam, this.sorter); let param = Object.assign(paramTarget, this.queryParam, this.iSorter);
param.pageNo = this.table.pagination.current; param.pageNo = this.table.pagination.current;
param.pageSize = this.table.pagination.pageSize; param.pageSize = this.table.pagination.pageSize;
return filterObj(param); return filterObj(param);
@@ -288,8 +314,18 @@
handleChangeInTable(pagination, filters, sorter) { handleChangeInTable(pagination, filters, sorter) {
//分页、排序、筛选变化时触发 //分页、排序、筛选变化时触发
if (Object.keys(sorter).length > 0) { if (Object.keys(sorter).length > 0) {
this.sorter.column = sorter.field this.iSorter = {
this.sorter.order = 'ascend' == sorter.order ? 'asc' : 'desc' column: sorter.field,
order: 'ascend' === sorter.order ? 'asc' : 'desc'
}
// 排序字段受控
this.table.columns.forEach(col => {
if (col.dataIndex === sorter.field) {
this.$set(col, 'sortOrder',sorter.order)
} else {
this.$set(col, 'sortOrder', false)
}
})
} }
this.table.pagination = pagination this.table.pagination = pagination
this.loadData() this.loadData()
+8 -14
View File
@@ -32,13 +32,14 @@
</template> </template>
<script> <script>
import GlobalLayout from '@/components/page/GlobalLayout' import GlobalLayout from '@/components/page/GlobalLayout'
import Contextmenu from '@/components/menu/Contextmenu' import Contextmenu from '@/components/menu/Contextmenu'
import { mixin, mixinDevice } from '@/utils/mixin.js' import { mixin, mixinDevice } from '@/utils/mixin.js'
import { triggerWindowResizeEvent } from '@/utils/util' import { triggerWindowResizeEvent } from '@/utils/util'
const indexKey = '/dashboard/analysis' import Vue from 'vue'
import Vue from 'vue' import { CACHE_INCLUDED_ROUTES } from '@/store/mutation-types'
import { CACHE_INCLUDED_ROUTES } from "@/store/mutation-types"
const indexKey = '/dashboard/analysis'
export default { export default {
name: 'TabLayout', name: 'TabLayout',
@@ -86,13 +87,6 @@
// 复制一个route对象出来,不能影响原route // 复制一个route对象出来,不能影响原route
let currentRoute = Object.assign({}, this.$route) let currentRoute = Object.assign({}, this.$route)
currentRoute.meta = Object.assign({}, currentRoute.meta) currentRoute.meta = Object.assign({}, currentRoute.meta)
// update-begin-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
let storeKey = 'route:title:' + currentRoute.fullPath
let routeTitle = this.$ls.get(storeKey)
if (routeTitle) {
currentRoute.meta.title = routeTitle
}
// update-end-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
this.pageList.push(currentRoute) this.pageList.push(currentRoute)
this.linkList.push(currentRoute.fullPath) this.linkList.push(currentRoute.fullPath)
this.activePage = currentRoute.fullPath this.activePage = currentRoute.fullPath
+3 -1
View File
@@ -57,7 +57,8 @@ import {
Cascader, Cascader,
Slider, Slider,
Transfer, Transfer,
Rate Rate,
Collapse,
} from 'ant-design-vue' } from 'ant-design-vue'
import Viser from 'viser-vue' import Viser from 'viser-vue'
@@ -112,6 +113,7 @@ Vue.use(Cascader)
Vue.use(Slider) Vue.use(Slider)
Vue.use(Transfer) Vue.use(Transfer)
Vue.use(Rate) Vue.use(Rate)
Vue.use(Collapse)
Vue.prototype.$confirm = Modal.confirm Vue.prototype.$confirm = Modal.confirm
Vue.prototype.$message = message Vue.prototype.$message = message
+5 -1
View File
@@ -11,6 +11,7 @@
:menu="menus" :menu="menus"
:theme="theme" :theme="theme"
@select="onSelect" @select="onSelect"
@updateMenuTitle="onUpdateMenuTitle"
:mode="mode" :mode="mode"
:style="smenuStyle"> :style="smenuStyle">
</s-menu> </s-menu>
@@ -19,7 +20,7 @@
</template> </template>
<script> <script>
import ALayoutSider from "ant-design-vue/es/layout/Sider" import ALayoutSider from 'ant-design-vue/es/layout/Sider'
import Logo from '../tools/Logo' import Logo from '../tools/Logo'
import SMenu from './index' import SMenu from './index'
import { mixin, mixinDevice } from '@/utils/mixin.js' import { mixin, mixinDevice } from '@/utils/mixin.js'
@@ -68,6 +69,9 @@
methods: { methods: {
onSelect (obj) { onSelect (obj) {
this.$emit('menuSelect', obj) this.$emit('menuSelect', obj)
},
onUpdateMenuTitle (obj) {
this.$emit('updateMenuTitle', obj)
} }
} }
} }
+32 -1
View File
@@ -82,18 +82,49 @@ export default {
} else { } else {
this.selectedKeys = [routes.pop().path] this.selectedKeys = [routes.pop().path]
} }
const openKeys = [] let openKeys = []
if (this.mode === 'inline') { if (this.mode === 'inline') {
routes.forEach(item => { routes.forEach(item => {
openKeys.push(item.path) openKeys.push(item.path)
}) })
} }
// update-begin-author:sunjianlei date:20210409 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题
// 包含冒号的是动态菜单
if (this.selectedKeys[0].includes(':')) {
let selectedKey = this.$route.fullPath
this.selectedKeys = [selectedKey]
let newOpenKeys = []
this.fullOpenKeys(this.menu, selectedKey, newOpenKeys)
if (newOpenKeys.length > 0) {
openKeys = newOpenKeys.reverse()
}
}
// update-end-author:sunjianlei date:20210409 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题
//update-begin-author:taoyan date:20190510 for:online表单菜单点击展开的一级目录不对 //update-begin-author:taoyan date:20190510 for:online表单菜单点击展开的一级目录不对
if(!this.selectedKeys || this.selectedKeys[0].indexOf(":")<0){ if(!this.selectedKeys || this.selectedKeys[0].indexOf(":")<0){
this.collapsed ? (this.cachedOpenKeys = openKeys) : (this.openKeys = openKeys) this.collapsed ? (this.cachedOpenKeys = openKeys) : (this.openKeys = openKeys)
} }
//update-end-author:taoyan date:20190510 for:online表单菜单点击展开的一级目录不对 //update-end-author:taoyan date:20190510 for:online表单菜单点击展开的一级目录不对
}, },
// update-begin-author:sunjianlei date:20210409 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题
// 递归查找当前选中的菜单和父级菜单,填充openKeys
fullOpenKeys(menus, selectedKey, openKeys) {
for (let item of menus) {
if (item.path === selectedKey) {
openKeys.push(item.path)
this.$emit('updateMenuTitle', item)
return true
} else if (Array.isArray(item.children)) {
if (this.fullOpenKeys(item.children, selectedKey, openKeys)) {
openKeys.push(item.path)
return true
}
}
}
},
// update-end-author:sunjianlei date:20210409 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题
// render // render
renderItem (menu) { renderItem (menu) {
+10 -2
View File
@@ -31,7 +31,9 @@
<s-menu <s-menu
mode="horizontal" mode="horizontal"
:menu="menus" :menu="menus"
:theme="theme"></s-menu> :theme="theme"
@updateMenuTitle="handleUpdateMenuTitle"
></s-menu>
</div> </div>
<a-icon <a-icon
v-else v-else
@@ -155,8 +157,14 @@
this.topMenuStyle.headerIndexLeft = { 'width': `calc(100% - ${rightWidth})` } this.topMenuStyle.headerIndexLeft = { 'width': `calc(100% - ${rightWidth})` }
} }
} }
} },
//update-begin--author:sunjianlei---date:20190508------for: 顶部导航栏过长时显示更多按钮----- //update-begin--author:sunjianlei---date:20190508------for: 顶部导航栏过长时显示更多按钮-----
// update-begin-author:sunjianlei date:20210508 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题
handleUpdateMenuTitle(value) {
this.$emit('updateMenuTitle', value)
},
// update-end-author:sunjianlei date:20210508 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题
} }
} }
</script> </script>
+17 -9
View File
@@ -16,6 +16,7 @@
v-if="device === 'mobile'" v-if="device === 'mobile'"
:menus="menus" :menus="menus"
@menuSelect="menuSelect" @menuSelect="menuSelect"
@updateMenuTitle="handleUpdateMenuTitle"
:theme="navTheme" :theme="navTheme"
:collapsed="false" :collapsed="false"
:collapsible="true"></side-menu> :collapsible="true"></side-menu>
@@ -26,6 +27,7 @@
mode="inline" mode="inline"
:menus="menus" :menus="menus"
@menuSelect="myMenuSelect" @menuSelect="myMenuSelect"
@updateMenuTitle="handleUpdateMenuTitle"
:theme="navTheme" :theme="navTheme"
:collapsed="collapsed" :collapsed="collapsed"
:collapsible="true"></side-menu> :collapsible="true"></side-menu>
@@ -45,6 +47,7 @@
mode="inline" mode="inline"
:menus="menus" :menus="menus"
@menuSelect="menuSelect" @menuSelect="menuSelect"
@updateMenuTitle="handleUpdateMenuTitle"
:theme="navTheme" :theme="navTheme"
:collapsed="false" :collapsed="false"
:collapsible="true"></side-menu> :collapsible="true"></side-menu>
@@ -62,6 +65,7 @@
:collapsed="collapsed" :collapsed="collapsed"
:device="device" :device="device"
@toggle="toggle" @toggle="toggle"
@updateMenuTitle="handleUpdateMenuTitle"
/> />
<!-- layout content --> <!-- layout content -->
@@ -85,15 +89,14 @@
import SideMenu from '@/components/menu/SideMenu' import SideMenu from '@/components/menu/SideMenu'
import GlobalHeader from '@/components/page/GlobalHeader' import GlobalHeader from '@/components/page/GlobalHeader'
import GlobalFooter from '@/components/page/GlobalFooter' import GlobalFooter from '@/components/page/GlobalFooter'
import { triggerWindowResizeEvent } from '@/utils/util'
import { mapActions, mapState } from 'vuex'
import { mixin, mixinDevice } from '@/utils/mixin.js'
// update-start---- author:os_chengtgen -- date:20190830 -- for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ------ // update-start---- author:os_chengtgen -- date:20190830 -- for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ------
// import SettingDrawer from '@/components/setting/SettingDrawer' // import SettingDrawer from '@/components/setting/SettingDrawer'
// 注释这个因为在个人设置模块已经加载了SettingDrawer页面 // 注释这个因为在个人设置模块已经加载了SettingDrawer页面
// update-end ---- author:os_chengtgen -- date:20190830 -- for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ------ // update-end ---- author:os_chengtgen -- date:20190830 -- for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ------
import { triggerWindowResizeEvent } from '@/utils/util'
import { mapState, mapActions } from 'vuex'
import { mixin, mixinDevice } from '@/utils/mixin.js'
export default { export default {
name: 'GlobalLayout', name: 'GlobalLayout',
components: { components: {
@@ -160,10 +163,6 @@
//此处触发动态路由被点击事件 //此处触发动态路由被点击事件
this.findMenuBykey(this.menus,value.key) this.findMenuBykey(this.menus,value.key)
this.$emit("dynamicRouterShow",value.key,this.activeMenu.meta.title) this.$emit("dynamicRouterShow",value.key,this.activeMenu.meta.title)
// update-begin-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
let storeKey = 'route:title:' + this.activeMenu.path
this.$ls.set(storeKey, this.activeMenu.meta.title)
// update-end-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
}, },
findMenuBykey(menus,key){ findMenuBykey(menus,key){
for(let i of menus){ for(let i of menus){
@@ -173,8 +172,17 @@
this.findMenuBykey(i.children,key) this.findMenuBykey(i.children,key)
} }
} }
} },
//update-end-author:taoyan date:20190430 for:动态路由title显示配置的菜单title而不是其对应路由的title //update-end-author:taoyan date:20190430 for:动态路由title显示配置的菜单title而不是其对应路由的title
// update-begin-author:sunjianlei date:20210409 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题
handleUpdateMenuTitle(value) {
this.findMenuBykey(this.menus, value.path)
this.activeMenu.meta.title = value.meta.title
this.$emit('dynamicRouterShow', value.path, this.activeMenu.meta.title)
},
// update-end-author:sunjianlei date:20210409 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题
} }
} }
+9 -3
View File
@@ -185,8 +185,8 @@
return that.Logout({}).then(() => { return that.Logout({}).then(() => {
// update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面 // update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面
that.$router.push({ path: '/user/login' }); that.$router.push({ path: '/user/login' });
window.location.reload()
// update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面 // update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面
//window.location.reload()
}).catch(err => { }).catch(err => {
that.$message.error({ that.$message.error({
title: '错误', title: '错误',
@@ -225,11 +225,17 @@
// update_begin author:sunjianlei date:20191230 for: 解决外部链接打开失败的问题 // update_begin author:sunjianlei date:20191230 for: 解决外部链接打开失败的问题
searchMethods(value) { searchMethods(value) {
let route = this.searchMenuOptions.filter(item => item.id === value)[0] let route = this.searchMenuOptions.filter(item => item.id === value)[0]
if (route.meta.internalOrExternal === true || route.component.includes('layouts/IframePageView')) { //update-begin-author:taoyan date:20210528 for: 【菜单问题】配置一个iframe地址的菜单,内部打开,在搜索菜单上打开却新开了一个窗口
if (route.meta.internalOrExternal === true) {
window.open(route.meta.url, '_blank') window.open(route.meta.url, '_blank')
} else { } else {
this.$router.push({ path: route.path }) if(route.component.includes('layouts/IframePageView')){
this.$router.push(route)
}else{
this.$router.push({ path: route.path })
}
} }
//update-end-author:taoyan date:20210528 for: 【菜单问题】配置一个iframe地址的菜单,内部打开,在搜索菜单上打开却新开了一个窗口
this.searchMenuVisible = false this.searchMenuVisible = false
}, },
// update_end author:sunjianlei date:20191230 for: 解决外部链接打开失败的问题 // update_end author:sunjianlei date:20191230 for: 解决外部链接打开失败的问题
+1
View File
@@ -14,6 +14,7 @@ const FormTypes = {
popup:'popup', popup:'popup',
list_multi:"list_multi", list_multi:"list_multi",
sel_search:"sel_search", sel_search:"sel_search",
sel_search_async:"sel_search_async",
radio:'radio', radio:'radio',
checkbox_meta:"checkbox_meta", checkbox_meta:"checkbox_meta",
input_pop:'input_pop', input_pop:'input_pop',
+142 -156
View File
@@ -2,26 +2,35 @@
<a-card :bordered="false" style="height:100%;padding-bottom:200px; "> <a-card :bordered="false" style="height:100%;padding-bottom:200px; ">
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline" :form="form"> <a-form-model ref="form" :model="formData" layout="inline">
<!-- 字典下拉 --> <!-- 字典下拉 -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="性别"> <a-form-model-item label="性别" prop="sex">
<j-dict-select-tag v-model="formData.sex" title="性别" dictCode="sex" placeholder="请选择性别"/> <j-dict-select-tag v-model="formData.sex" title="性别" dictCode="sex" placeholder="请选择性别"/>
<!-- <j-dict-select-tag title="性别" dictCode="sex" disabled/>--> <!-- <j-dict-select-tag title="性别" dictCode="sex" disabled/>-->
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">选中值:{{ formData.sex}}</a-col> <a-col :span="12">选中值:{{ formData.sex}}</a-col>
</a-row> </a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-model-item label="性别2" prop="sex2">
<j-dict-select-tag v-model="formData.sex2" type="radioButton" title="性别2" dictCode="sex" placeholder="请选择性别2"/>
</a-form-model-item>
</a-col>
<a-col :span="12">选中值:{{ formData.sex2}}</a-col>
</a-row>
<!-- 字典表下拉 --> <!-- 字典表下拉 -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="字典表下拉"> <a-form-model-item label="字典表下拉" prop="user">
<j-dict-select-tag v-model="formData.user" placeholder="请选择用户" dictCode="sys_user,realname,id"/> <j-dict-select-tag v-model="formData.user" placeholder="请选择用户" dictCode="sys_user,realname,id"/>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">选中值:{{ formData.user}}</a-col> <a-col :span="12">选中值:{{ formData.user}}</a-col>
</a-row> </a-row>
@@ -29,9 +38,9 @@
<!-- 带条件字典表下拉 --> <!-- 带条件字典表下拉 -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="字典表下拉(带条件)"> <a-form-model-item label="字典表下拉(带条件)" prop="user2">
<j-dict-select-tag v-model="formData.user2" placeholder="请选择用户" dictCode="sys_user,realname,id,username!='admin' order by create_time"/> <j-dict-select-tag v-model="formData.user2" placeholder="请选择用户" dictCode="sys_user,realname,id,username!='admin' order by create_time"/>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">选中值:{{ formData.user2}}</a-col> <a-col :span="12">选中值:{{ formData.user2}}</a-col>
</a-row> </a-row>
@@ -40,10 +49,10 @@
<!-- 字典搜索 --> <!-- 字典搜索 -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="字典搜索(同步)"> <a-form-model-item label="字典搜索(同步)" prop="searchValue">
<j-search-select-tag placeholder="请做出你的选择" v-model="formData.searchValue" :dictOptions="searchOptions"> <j-search-select-tag placeholder="请做出你的选择" v-model="formData.searchValue" :dictOptions="searchOptions">
</j-search-select-tag> </j-search-select-tag>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">选中值:{{ formData.searchValue}}</a-col> <a-col :span="12">选中值:{{ formData.searchValue}}</a-col>
</a-row> </a-row>
@@ -51,7 +60,7 @@
<!-- 字典搜索 异步加载 --> <!-- 字典搜索 异步加载 -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="字典搜索(异步)"> <a-form-model-item label="字典搜索(异步)" prop="asyncSelectValue">
<j-search-select-tag <j-search-select-tag
placeholder="请做出你的选择" placeholder="请做出你的选择"
v-model="formData.asyncSelectValue" v-model="formData.asyncSelectValue"
@@ -59,7 +68,7 @@
:pageSize="6" :pageSize="6"
:async="true"> :async="true">
</j-search-select-tag> </j-search-select-tag>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">选中值:{{ formData.asyncSelectValue}}</a-col> <a-col :span="12">选中值:{{ formData.asyncSelectValue}}</a-col>
</a-row> </a-row>
@@ -67,13 +76,13 @@
<!-- JMultiSelectTag --> <!-- JMultiSelectTag -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="字典下拉(多选)"> <a-form-model-item label="字典下拉(多选)" prop="selMuti">
<j-multi-select-tag <j-multi-select-tag
v-model="formData.selMuti" v-model="formData.selMuti"
dictCode="sex" dictCode="sex"
placeholder="请选择"> placeholder="请选择">
</j-multi-select-tag> </j-multi-select-tag>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">多选组合(v-model){{ formData.selMuti }}</a-col> <a-col :span="12">多选组合(v-model){{ formData.selMuti }}</a-col>
</a-row> </a-row>
@@ -81,48 +90,48 @@
<!-- 部门选择控件 --> <!-- 部门选择控件 -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="选择部门 自定义返回值"> <a-form-model-item label="选择部门 自定义返回值" prop="orgCodes">
<j-select-depart v-model="orgCodes" :trigger-change="true" customReturnField="orgCode" :multi="true"></j-select-depart> <j-select-depart v-model="formData.orgCodes" :trigger-change="true" customReturnField="orgCode" :multi="true"></j-select-depart>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">选中的部门Code(v-decorator):{{ orgCodes }}</a-col> <a-col :span="12">选中的部门Code(v-model):{{ formData.orgCodes }}</a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="选择部门"> <a-form-model-item label="选择部门" prop="departId">
<j-select-depart v-model="departId" :multi="true"></j-select-depart> <j-select-depart v-model="formData.departId" :multi="true"></j-select-depart>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">选中的部门ID(v-model):{{ departId }}</a-col> <a-col :span="12">选中的部门ID(v-model):{{ formData.departId }}</a-col>
</a-row> </a-row>
<!-- 通过部门选择用户控件 --> <!-- 通过部门选择用户控件 -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="选择用户"> <a-form-model-item label="选择用户" prop="userIds">
<j-select-user-by-dep v-model="userIds" :multi="true"></j-select-user-by-dep> <j-select-user-by-dep v-model="formData.userIds" :multi="true"></j-select-user-by-dep>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">选中的用户(v-model):{{ userIds }}</a-col> <a-col :span="12">选中的用户(v-model):{{ formData.userIds }}</a-col>
</a-row> </a-row>
<!-- 用户选择控件 --> <!-- 用户选择控件 -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="选择用户"> <a-form-model-item label="选择用户" prop="multiUser">
<j-select-multi-user v-model="multiUser" :query-config="selectUserQueryConfig"/> <j-select-multi-user v-model="formData.multiUser" :query-config="selectUserQueryConfig"/>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">选中的用户(v-model):{{ multiUser }}</a-col> <a-col :span="12">选中的用户(v-model):{{ formData.multiUser }}</a-col>
</a-row> </a-row>
<!-- 角色选择 --> <!-- 角色选择 -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="选择角色"> <a-form-model-item label="选择角色" prop="selectRole">
<j-select-role v-model="formData.selectRole" @change="changeMe"/> <j-select-role v-model="formData.selectRole" @change="changeMe"/>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">选中值:{{ formData.selectRole}}</a-col> <a-col :span="12">选中值:{{ formData.selectRole}}</a-col>
</a-row> </a-row>
@@ -130,90 +139,90 @@
<!-- JCheckbox --> <!-- JCheckbox -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="多选组合"> <a-form-model-item label="多选组合" prop="jCheckbox">
<j-checkbox <j-checkbox
v-model="jcheckbox.values" v-model="formData.jCheckbox"
:options="jcheckbox.options" :options="jCheckboxOptions"
/> />
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">多选组合(v-model){{ jcheckbox.values }}</a-col> <a-col :span="12">多选组合(v-model){{ formData.jCheckbox }}</a-col>
</a-row> </a-row>
<!-- JCodeEditor --> <!-- JCodeEditor -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="代码输入框" style="min-height: 120px"> <a-form-model-item label="代码输入框" style="min-height: 120px" prop="jCodeEditor">
<j-code-editor <j-code-editor
language="javascript" language="javascript"
v-model="jcodedditor.value" v-model="formData.jCodeEditor"
:fullScreen="true" :fullScreen="true"
style="min-height: 100px"/> style="min-height: 100px"/>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">代码输入框(v-model){{ jcodedditor.value }}</a-col> <a-col :span="12">代码输入框(v-model){{ formData.jCodeEditor }}</a-col>
</a-row> </a-row>
<!-- JDate --> <!-- JDate -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="日期选择框"> <a-form-model-item label="日期选择框" prop="jDate">
<j-date v-model="jdate.value" :showType="'time'" dateFormat="YYYY-MM-DD HH:mm:ss"/> <j-date v-model="formData.jDate" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"/>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">日期选择框(v-model){{ jdate.value }}</a-col> <a-col :span="12">日期选择框(v-model){{ formData.jDate }}</a-col>
</a-row> </a-row>
<!-- JEditor --> <!-- JEditor -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="富文本编辑器" style="min-height: 300px"> <a-form-model-item label="富文本编辑器" style="min-height: 300px" prop="jEditor">
<j-editor v-model="jeditor.value"/> <j-editor v-model="formData.jEditor"/>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">富文本编辑器(v-model){{ jeditor.value }}</a-col> <a-col :span="12">富文本编辑器(v-model){{ formData.jEditor }}</a-col>
</a-row> </a-row>
<!-- JEllipsis --> <!-- JEllipsis -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="过长剪切"> <a-form-model-item label="过长剪切" prop="jEllipsis">
<j-ellipsis :value="jellipsis.value" :length="20"/> <j-ellipsis :value="formData.jEllipsis" :length="30"/>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">过长剪切:{{ jellipsis.value }}</a-col> <a-col :span="12">过长剪切:{{ formData.jEllipsis }}</a-col>
</a-row> </a-row>
<!-- JSlider --> <!-- JSlider -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="滑块验证码"> <a-form-model-item label="滑块验证码" prop="jSlider">
<j-slider @onSuccess="handleJSliderSuccess"/> <j-slider @onSuccess="handleJSliderSuccess"/>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">滑块验证码验证通过:{{ jslider.value }}</a-col> <a-col :span="12">滑块验证码验证通过:{{ formData.jSlider }}</a-col>
</a-row> </a-row>
<!-- JSelectMultiple --> <!-- JSelectMultiple -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="多选下拉框"> <a-form-model-item label="多选下拉框" prop="jSelectMultiple">
<j-select-multiple v-model="jselectMultiple.value" :options="jselectMultiple.options"/> <j-select-multiple v-model="formData.jSelectMultiple" :options="jSelectMultipleOptions"/>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">多选下拉框(v-model){{ jselectMultiple.value }}</a-col> <a-col :span="12">多选下拉框(v-model){{ formData.jSelectMultiple }}</a-col>
</a-row> </a-row>
<!-- JSelectMultiple --> <!-- JSelectMultiple -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col> <a-col>
<a-form-item label="JModal弹窗"> <a-form-model-item label="JModal弹窗">
<a-button style="margin-right: 8px;" @click="()=>modal.visible=true">点击弹出JModal</a-button> <a-button style="margin-right: 8px;" @click="()=>modal.visible=true">点击弹出JModal</a-button>
<span style="margin-right: 8px;">全屏化:<a-switch v-model="modal.fullscreen"/></span> <span style="margin-right: 8px;">全屏化:<a-switch v-model="modal.fullscreen"/></span>
<span style="margin-right: 8px;">允许切换全屏:<a-switch v-model="modal.switchFullscreen"/></span> <span style="margin-right: 8px;">允许切换全屏:<a-switch v-model="modal.switchFullscreen"/></span>
</a-form-item> </a-form-model-item>
<j-modal <j-modal
:visible.sync="modal.visible" :visible.sync="modal.visible"
@@ -234,16 +243,16 @@
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="树字典"> <a-form-model-item label="树字典" prop="treeDict">
<j-tree-dict v-model="formData.treeDict" placeholder="请选择树字典" parentCode="A02"/> <j-tree-dict v-model="formData.treeDict" placeholder="请选择树字典" parentCode="A01"/>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">选中的值(v-model){{ formData.treeDict }}</a-col> <a-col :span="12">选中的值(v-model){{ formData.treeDict }}</a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="下拉树选择"> <a-form-model-item label="下拉树选择" prop="treeSelect">
<j-tree-select <j-tree-select
v-model="formData.treeSelect" v-model="formData.treeSelect"
placeholder="请选择菜单" placeholder="请选择菜单"
@@ -252,14 +261,14 @@
pidValue="" pidValue=""
:isAsync="true" :isAsync="true"
/> />
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">选中的值(v-model){{ formData.treeSelect }}</a-col> <a-col :span="12">选中的值(v-model){{ formData.treeSelect }}</a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="下拉树多选"> <a-form-model-item label="下拉树多选" prop="treeSelectMultiple">
<j-tree-select <j-tree-select
v-model="formData.treeSelectMultiple" v-model="formData.treeSelectMultiple"
placeholder="请选择菜单" placeholder="请选择菜单"
@@ -269,16 +278,16 @@
multiple multiple
:isAsync="false" :isAsync="false"
/> />
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">选中的值(v-model){{ formData.treeSelectMultiple }}</a-col> <a-col :span="12">选中的值(v-model){{ formData.treeSelectMultiple }}</a-col>
</a-row> </a-row>
<!-- 分类字典树 --> <!-- 分类字典树 -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="分类字典树"> <a-form-model-item label="分类字典树" prop="selectCategory">
<j-category-select v-model="formData.selectCategory" pCode="A02" :multiple="false"/> <j-category-select v-model="formData.selectCategory" pCode="A01" :multiple="false"/>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">选中的值(v-model){{ formData.selectCategory }}</a-col> <a-col :span="12">选中的值(v-model){{ formData.selectCategory }}</a-col>
</a-row> </a-row>
@@ -286,23 +295,23 @@
<!-- VueCron --> <!-- VueCron -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="cron表达式"> <a-form-model-item label="cron表达式" prop="cronExpression">
<j-cron ref="innerVueCron" v-decorator="['cronExpression', { initialValue: '* * * * * ? *' }]" @change="setCorn"></j-cron> <j-cron v-model="formData.cronExpression"></j-cron>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="高级查询"> <a-form-model-item label="高级查询">
<j-super-query :fieldList="superQuery.fieldList" /> <j-super-query :fieldList="superQuery.fieldList" />
</a-form-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="高级查询自定义按钮"> <a-form-model-item label="高级查询自定义按钮">
<j-super-query :fieldList="superQuery.fieldList"> <j-super-query :fieldList="superQuery.fieldList">
<!-- <!--
v-slot:button 可以更高自由的定制按钮 v-slot:button 可以更高自由的定制按钮
@@ -325,33 +334,33 @@
</a-button-group> </a-button-group>
</template> </template>
</j-super-query> </j-super-query>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="图片上传"> <a-form-model-item label="图片上传" prop="imgList">
<j-image-upload v-model="imgList" :isMultiple="true"></j-image-upload> <j-image-upload bizPath="scott/pic" v-model="formData.imgList"></j-image-upload>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">选中的值(v-model){{ imgList }}</a-col> <a-col :span="12">选中的值(v-model){{ formData.imgList }}</a-col>
</a-row> </a-row>
<a-row :gutter="24" style="margin-top: 65px;margin-bottom:50px;"> <a-row :gutter="24" style="margin-top: 65px;margin-bottom:50px;">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="文件上传"> <a-form-model-item label="文件上传" prop="fileList">
<j-upload v-model="fileList" :multiple="true" :fileType="'image'"></j-upload> <j-upload v-model="formData.fileList"></j-upload>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
选中的值(v-model) 选中的值(v-model)
<j-ellipsis :value="fileList" :length="30" v-if="fileList.length>0"/> <j-ellipsis :value="formData.fileList" :length="30" v-if="formData.fileList.length>0"/>
</a-col> </a-col>
</a-row> </a-row>
<!-- 特殊查询组件 --> <!-- 特殊查询组件 -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="特殊查询组件"> <a-form-model-item label="特殊查询组件" prop="jInput">
<a-row> <a-row>
<a-col :span="15"> <a-col :span="15">
<j-input v-model="formData.jInput" :type="jInput.type"/> <j-input v-model="formData.jInput" :type="jInput.type"/>
@@ -361,27 +370,27 @@
<a-select v-model="jInput.type" :options="jInput.options"></a-select> <a-select v-model="jInput.type" :options="jInput.options"></a-select>
</a-col> </a-col>
</a-row> </a-row>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">输入的值(v-model){{ formData.jInput }}</a-col> <a-col :span="12">输入的值(v-model){{ formData.jInput }}</a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="15"> <a-col :span="15">
<a-form-item label="MarkdownEditor" style="min-height: 300px"> <a-form-model-item label="MarkdownEditor" prop="content" style="min-height: 300px">
<j-markdown-editor v-model="content"></j-markdown-editor> <j-markdown-editor v-model="formData.content"></j-markdown-editor>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="9"> <a-col :span="9">
输入的值(v-model){{ content }} 输入的值(v-model){{ formData.content }}
</a-col> </a-col>
</a-row> </a-row>
<!-- 省市县级联 --> <!-- 省市县级联 -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="省市县级联"> <a-form-model-item label="省市县级联" prop="areaLinkage1">
<j-area-linkage v-model="formData.areaLinkage1" type="cascader"/> <j-area-linkage v-model="formData.areaLinkage1" type="cascader"/>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">输入的值(v-model){{ formData.areaLinkage1 }}</a-col> <a-col :span="12">输入的值(v-model){{ formData.areaLinkage1 }}</a-col>
</a-row> </a-row>
@@ -390,9 +399,9 @@
<!-- 省市县级联 --> <!-- 省市县级联 -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="省市县级联"> <a-form-model-item label="省市县级联" prop="areaLinkage2">
<j-area-linkage v-model="formData.areaLinkage2" type="select"/> <j-area-linkage v-model="formData.areaLinkage2" type="select"/>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">输入的值(v-model){{ formData.areaLinkage2 }}</a-col> <a-col :span="12">输入的值(v-model){{ formData.areaLinkage2 }}</a-col>
</a-row> </a-row>
@@ -400,18 +409,18 @@
<!-- 功能示例:关闭当前页面 --> <!-- 功能示例:关闭当前页面 -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="功能示例关闭当前页面"> <a-form-model-item label="功能示例关闭当前页面">
<a-button type="primary" @click="handleCloseCurrentPage">点击关闭当前页面</a-button> <a-button type="primary" @click="handleCloseCurrentPage">点击关闭当前页面</a-button>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<!-- JPopup示例 --> <!-- JPopup示例 -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="JPopup示例"> <a-form-model-item label="JPopup示例" prop="jPopup">
<j-popup v-model="formData.jPopup" code="demo" field="name" orgFields="name" destFields="name" :multi="true"/> <j-popup v-model="formData.jPopup" code="demo" field="name" orgFields="name" destFields="name" :multi="true"/>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">选择的值(v-model){{ formData.jPopup }}</a-col> <a-col :span="12">选择的值(v-model){{ formData.jPopup }}</a-col>
</a-row> </a-row>
@@ -433,7 +442,7 @@
</a-col> </a-col>
<a-col :span="12">选择的值(v-model){{ formData.mm }}</a-col> <a-col :span="12">选择的值(v-model){{ formData.mm }}</a-col>
</a-row> </a-row>
</a-form> </a-form-model>
</div> </div>
</a-card> </a-card>
@@ -496,56 +505,41 @@
}, },
data() { data() {
return { return {
ss:false, sw:false,
selectList: [], selectList: [],
selectedDepUsers: '', selectedDepUsers: '',
formData: { formData: {
areaLinkage1: '110105', areaLinkage1: '110105',
areaLinkage2: '140221', areaLinkage2: '140221',
sex: 1 sex: 1,
}, orgCodes: 'A02A01,A02A02',
form: this.$form.createForm(this), departId: '57197590443c44f083d42ae24ef26a2c,a7d7e77e06c84325a40932163adcdaa6',
departId: '57197590443c44f083d42ae24ef26a2c,a7d7e77e06c84325a40932163adcdaa6', userIds: 'admin',
orgCodes: 'A02A01,A02A02', multiUser: 'admin,jeecg',
userIds: 'admin', jCheckbox: 'spring,jeecgboot',
multiUser: 'admin,jero', jCodeEditor: `function sayHi(word) {\n alert(word)\n}\nsayHi('hello, world!')`,
jcheckbox: { jDate: '2019-5-10 15:33:06',
values: 'spring,jeroboot', jEditor: '<h2 style="text-align: center;">富文本编辑器</h2> <p>这里是富文本编辑器。</p>',
options: [ jEllipsis: '这是一串很长很长的文字段落。这是一串很长很长的文字段落。这是一串很长很长的文字段落。这是一串很长很长的文字段落。',
{ label: 'Jero', value: 'jero' }, jSlider: false,
{ label: 'Jero-Boot', value: 'jeroboot' }, jSelectMultiple: 'Integer,Boolean',
{ label: 'Spring', value: 'spring', disabled: true }, imgList:[],
{ label: 'MyBaits', value: 'mybatis' } fileList:[],
] content: '',
}, cronExpression: '* * * * * ? *',
jcodedditor: {
value: `function sayHi(word) {
alert(word)
}
sayHi('hello, world!')`
},
jdate: {
value: '2019-5-10 15:33:06'
},
jeditor: {
value: '<h2 style="text-align: center;">富文本编辑器</h2> <p>这里是富文本编辑器。</p>'
},
jellipsis: {
value: '这是一串很长很长的文字段落。这是一串很长很长的文字段落。这是一串很长很长的文字段落。这是一串很长很长的文字段落。'
},
jslider: {
value: false
},
jselectMultiple: {
options: [
{ text: '字符串', value: 'String' },
{ text: '字符串1', value: 'String1' },
{ text: '整数型', value: 'Integer' },
{ text: '浮点型', value: 'Double' },
{ text: '布尔型', value: 'Boolean' }
],
value: 'Integer,Boolean'
}, },
jCheckboxOptions: [
{label: 'Jeecg', value: 'jeecg'},
{label: 'Jeecg-Boot', value: 'jeecgboot'},
{label: 'Spring', value: 'spring', disabled: true},
{label: 'MyBaits', value: 'mybatis'}
],
jSelectMultipleOptions: [
{text: '字符串', value: 'String'},
{text: '整数型', value: 'Integer'},
{text: '浮点型', value: 'Double'},
{text: '布尔型', value: 'Boolean'}
],
modal: { modal: {
title: '这里是标题', title: '这里是标题',
visible: false, visible: false,
@@ -569,8 +563,6 @@ sayHi('hello, world!')`
}, },
] ]
}, },
fileList:[],
imgList:[],
jInput: { jInput: {
type: 'like', type: 'like',
options: [ options: [
@@ -580,7 +572,6 @@ sayHi('hello, world!')`
{ value: 'le', label: '小于等于(le)' }, { value: 'le', label: '小于等于(le)' },
], ],
}, },
content: '',
searchOptions:[{ searchOptions:[{
text:"选项一", text:"选项一",
value:"1" value:"1"
@@ -610,10 +601,10 @@ sayHi('hello, world!')`
}, },
methods: { methods: {
getDepartIdValue() { getDepartIdValue() {
return this.form.getFieldValue('departId') return this.formData.departId
}, },
getOrgCodesValue() { getOrgCodesValue() {
return this.form.getFieldValue('orgCodes') return this.formData.orgCodes
}, },
changeMe() { changeMe() {
@@ -637,12 +628,7 @@ sayHi('hello, world!')`
this.selectedDepUsers = selectedDepUsers this.selectedDepUsers = selectedDepUsers
}, },
handleJSliderSuccess(value) { handleJSliderSuccess(value) {
this.jslider.value = value this.formData.jSlider = value
},
setCorn(data){
this.$nextTick(() => {
this.form.cronExpression = data;
})
}, },
handleCloseCurrentPage() { handleCloseCurrentPage() {
@@ -99,7 +99,11 @@
placeholder: '点击上传', placeholder: '点击上传',
token: true, token: true,
responseName: 'message', responseName: 'message',
action: window._CONFIG['domianURL'] + '/sys/common/upload' action: window._CONFIG['domianURL'] + '/sys/common/upload',
data: {
biz: 'temp',
// 更多扩展参数
},
}, },
{ {
title: '字段类型', title: '字段类型',
@@ -1,6 +1,6 @@
<template> <template>
<a-modal <a-modal
title="corn表达式" title="cron表达式"
:width="modalWidth" :width="modalWidth"
:visible="visible" :visible="visible"
:confirmLoading="confirmLoading" :confirmLoading="confirmLoading"
+3 -3
View File
@@ -25,7 +25,7 @@
<div style="margin-top: 24px;" v-else-if="userIdentity === '2' && departTree.length==0"> <div style="margin-top: 24px;" v-else-if="userIdentity === '2' && departTree.length==0">
<h3><span>您的部门下暂无有效部门信息</span></h3> <h3><span>您的部门下暂无有效部门信息</span></h3>
</div> </div>
<div style="margin-top: 24px;" v-else><h3>普通员工暂此权限</h3></div> <div style="margin-top: 24px;" v-else><h3>普通员工暂此权限</h3></div>
</div> </div>
</a-card> </a-card>
</a-col> </a-col>
@@ -49,8 +49,8 @@
<script> <script>
import DeptBaseInfo from './modules/DeptBaseInfo' import DeptBaseInfo from './modules/DeptBaseInfo'
import DeptUserInfo from './modules/DeptUserInfo' import DeptUserInfo from './modules/DeptUserInfo'
import {queryMyDepartTreeList, searchByKeywords} from '@/api/api' import { queryMyDepartTreeList, searchByKeywords } from '@/api/api'
import {JeroListMixin} from '@/mixins/JeroListMixin' import { JeroListMixin } from '@/mixins/JeroListMixin'
import DeptRoleInfo from './modules/DeptRoleInfo' import DeptRoleInfo from './modules/DeptRoleInfo'
export default { export default {
+8 -8
View File
@@ -3,22 +3,22 @@
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form-model layout="inline" :model="queryParam" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="6" :sm="10"> <a-col :md="6" :sm="10">
<a-form-item label="任务类名"> <a-form-model-item label="任务类名" prop="jobClassName">
<a-input placeholder="请输入任务类名" v-model="queryParam.jobClassName"></a-input> <a-input placeholder="请输入任务类名" v-model="queryParam.jobClassName"></a-input>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :md="6" :sm="10"> <a-col :md="6" :sm="10">
<a-form-item label="任务状态"> <a-form-model-item label="任务状态" prop="status">
<a-select style="width: 220px" v-model="queryParam.status" placeholder="请选择状态"> <a-select style="width: 220px" v-model="queryParam.status" placeholder="请选择状态">
<a-select-option value="">全部</a-select-option> <a-select-option value="">全部</a-select-option>
<a-select-option value="0">正常</a-select-option> <a-select-option value="0">正常</a-select-option>
<a-select-option value="-1">停止</a-select-option> <a-select-option value="-1">停止</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :md="6" :sm="10" > <a-col :md="6" :sm="10" >
@@ -29,7 +29,7 @@
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form-model>
</div> </div>
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
@@ -225,7 +225,7 @@
title:"确认暂停", title:"确认暂停",
content:"是否暂停选中任务?", content:"是否暂停选中任务?",
onOk: function(){ onOk: function(){
getAction(that.url.pause,{jobClassName:record.jobClassName}).then((res)=>{ getAction(that.url.pause,{id:record.id}).then((res)=>{
if(res.success){ if(res.success){
that.$message.success(res.message); that.$message.success(res.message);
that.loadData(); that.loadData();
@@ -245,7 +245,7 @@
title:"确认启动", title:"确认启动",
content:"是否启动选中任务?", content:"是否启动选中任务?",
onOk: function(){ onOk: function(){
getAction(that.url.resume,{jobClassName:record.jobClassName}).then((res)=>{ getAction(that.url.resume,{id:record.id}).then((res)=>{
if(res.success){ if(res.success){
that.$message.success(res.message); that.$message.success(res.message);
that.loadData(); that.loadData();
@@ -102,6 +102,12 @@
<!-- 表单区域 --> <!-- 表单区域 -->
<sysAnnouncement-modal ref="modalForm" @ok="modalFormOk"></sysAnnouncement-modal> <sysAnnouncement-modal ref="modalForm" @ok="modalFormOk"></sysAnnouncement-modal>
<!-- 查看详情 -->
<j-modal class="detail-modal" title="查看详情" :visible.sync="detailModal.visible" :top="50" :width="600" switchFullscreen :footer="null">
<iframe v-if="detailModal.url" class="detail-iframe" :src="detailModal.url"/>
</j-modal>
</a-card> </a-card>
</template> </template>
@@ -110,6 +116,7 @@
import {doReleaseData, doReovkeData} from '@/api/api' import {doReleaseData, doReovkeData} from '@/api/api'
import {getAction} from '@/api/manage' import {getAction} from '@/api/manage'
import {JeroListMixin} from '@/mixins/JeroListMixin' import {JeroListMixin} from '@/mixins/JeroListMixin'
import { ACCESS_TOKEN } from '@/store/mutation-types'
export default { export default {
name: "SysAnnouncementList", name: "SysAnnouncementList",
@@ -237,6 +244,7 @@
scopedSlots: {customRender: 'action'}, scopedSlots: {customRender: 'action'},
} }
], ],
detailModal: {visible: false, url: '',},
url: { url: {
list: "/sys/annountCement/page", list: "/sys/annountCement/page",
delete: "/sys/annountCement/delete", delete: "/sys/annountCement/delete",
@@ -284,14 +292,42 @@
getAction("sys/annountCement/syncNotic",{anntId:anntId}) getAction("sys/annountCement/syncNotic",{anntId:anntId})
}, },
handleDetail:function(record){ handleDetail:function(record){
this.$refs.modalForm.edit(record); const domain = window._CONFIG['domianURL']
this.$refs.modalForm.title="详情"; const token = this.$ls.get(ACCESS_TOKEN)
this.$refs.modalForm.disableSubmit = true; this.detailModal.url = `${domain}/sys/annountCement/show/${record.id}?token=${token}`
this.$refs.modalForm.disabled = true; this.detailModal.visible = true
}, },
} }
} }
</script> </script>
<style scoped> <style scoped lang="less">
@import '~@assets/less/common.less' @import '~@assets/less/common.less';
/** 查看详情弹窗的样式 */
.detail-modal {
.detail-iframe {
border: 0;
width: 100%;
height: 88vh;
min-height: 600px;
}
&.fullscreen .detail-iframe {
height: 100%;
}
}
.detail-modal /deep/ .ant-modal {
top: 30px;
.ant-modal-body {
font-size: 0;
padding: 0;
}
}
.detail-modal.fullscreen /deep/ .ant-modal {
top: 0;
}
</style> </style>
@@ -3,18 +3,18 @@
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form-model layout="inline" :model="queryParam" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="规则名称"> <a-form-model-item label="规则名称" prop="ruleName">
<a-input placeholder="请输入规则名称" v-model="queryParam.ruleName"/> <a-input placeholder="请输入规则名称" v-model="queryParam.ruleName"/>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="规则Code"> <a-form-model-item label="规则Code" prop="ruleCode">
<a-input placeholder="请输入规则Code" v-model="queryParam.ruleCode"/> <a-input placeholder="请输入规则Code" v-model="queryParam.ruleCode"/>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<template v-if="toggleSearchStatus"> <template v-if="toggleSearchStatus">
</template> </template>
@@ -30,7 +30,7 @@
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form-model>
</div> </div>
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
@@ -3,17 +3,17 @@
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form-model layout="inline" :model="queryParam" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="规则名称"> <a-form-model-item label="规则名称" prop="ruleName">
<a-input placeholder="请输入规则名称" v-model="queryParam.ruleName"></a-input> <a-input placeholder="请输入规则名称" v-model="queryParam.ruleName"></a-input>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="规则Code"> <a-form-model-item label="规则Code" prop="ruleCode">
<a-input placeholder="请输入规则Code" v-model="queryParam.ruleCode"></a-input> <a-input placeholder="请输入规则Code" v-model="queryParam.ruleCode"></a-input>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
@@ -22,7 +22,7 @@
</span> </span>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form-model>
</div> </div>
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
+3 -3
View File
@@ -64,7 +64,7 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator" style="border-top: 5px"> <div class="table-operator" style="border-top: 5px">
<a-button @click="handleAdd" type="primary" icon="plus">添加用户</a-button> <a-button @click="handleAdd" type="primary" icon="plus" >添加用户</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('用户信息')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('用户信息')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button> <a-button type="primary" icon="import">导入</a-button>
@@ -119,9 +119,9 @@
</template> </template>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)" >编辑</a>
<a-divider type="vertical"/> <a-divider type="vertical" />
<a-dropdown> <a-dropdown>
<a class="ant-dropdown-link"> <a class="ant-dropdown-link">
@@ -1,20 +1,20 @@
<template> <template>
<a-card class="j-address-list-right-card-box" :loading="cardLoading" :bordered="false"> <a-card class="j-address-list-right-card-box" :loading="cardLoading" :bordered="false">
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline"> <a-form-model layout="inline" :model="queryParam">
<a-row :gutter="10"> <a-row :gutter="10">
<a-col :md="6" :sm="12"> <a-col :md="6" :sm="12">
<a-form-item label="姓名" style="margin-left:8px"> <a-form-model-item label="姓名" prop="realname" style="margin-left:8px">
<a-input placeholder="请输入姓名查询" v-model="queryParam.realname"></a-input> <a-input placeholder="请输入姓名查询" v-model="queryParam.realname"></a-input>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<a-col :md="6" :sm="12"> <a-col :md="6" :sm="12">
<a-form-item label="工号" style="margin-left:8px"> <a-form-model-item label="工号" prop="workNo" style="margin-left:8px">
<a-input placeholder="请输入工号查询" v-model="queryParam.workNo"></a-input> <a-input placeholder="请输入工号查询" v-model="queryParam.workNo"></a-input>
</a-form-item> </a-form-model-item>
</a-col> </a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
@@ -24,7 +24,7 @@
</a-col> </a-col>
</span> </span>
</a-row> </a-row>
</a-form> </a-form-model>
</div> </div>
<a-table <a-table
@@ -1,33 +1,33 @@
<template> <template>
<a-card :visible="visible"> <a-card :visible="visible">
<a-form :form="form"> <a-form-model ref="form" :model="model">
<a-form-item <a-form-model-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="机构名称"> label="机构名称">
<a-input style="border:0px;" placeholder="" v-decorator="['departName', {}]"/> <a-input style="border:0;" placeholder="" v-model="model.departName"/>
</a-form-item> </a-form-model-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级部门"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级部门">
<a-tree-select <a-tree-select
disabled disabled
style="width:100%;border: 0px;border: none;outline:none;" style="width:100%;border: 0;border: none;outline:none;"
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
:treeData="treeData" :treeData="treeData"
v-model="model.parentId" v-model="model.parentId"
placeholder=""> placeholder="">
</a-tree-select> </a-tree-select>
</a-form-item> </a-form-model-item>
<a-form-item <a-form-model-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="机构编码"> label="机构编码">
<a-input style="border:0px;" placeholder="" v-decorator="['orgCode', {}]"/> <a-input style="border:0;" placeholder="" v-model="model.orgCode"/>
</a-form-item> </a-form-model-item>
<a-form-item <a-form-model-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="机构类型"> label="机构类型">
<a-radio-group :disabled="true" v-decorator="['orgCategory',{}]" placeholder="请选择机构类型"> <a-radio-group :disabled="true" v-model="model.orgCategory" read-only>
<a-radio value="1"> <a-radio value="1">
公司 公司
</a-radio> </a-radio>
@@ -38,36 +38,35 @@
岗位 岗位
</a-radio> </a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-model-item>
<a-form-item <a-form-model-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="排序"> label="排序">
<a-input-number style="border:0px;" v-decorator="[ 'departOrder',{}]"/> <a-input-number style="border:0;" v-model="model.departOrder"/>
</a-form-item> </a-form-model-item>
<a-form-item <a-form-model-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="手机号"> label="手机号">
<a-input style="border:0px;" placeholder="" v-decorator="['mobile', {}]"/> <a-input style="border:0;" placeholder="" v-model="model.mobile"/>
</a-form-item> </a-form-model-item>
<a-form-item <a-form-model-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="地址"> label="地址">
<a-input style="border:0px;" placeholder="" v-decorator="['address', {}]"/> <a-input style="border:0;" placeholder="" v-model="model.address"/>
</a-form-item> </a-form-model-item>
<a-form-item <a-form-model-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="备注"> label="备注">
<a-textarea style="border:0px;" placeholder="" v-decorator="['memo', {}]"/> <a-textarea style="border:0;" placeholder="" v-model="model.memo"/>
</a-form-item> </a-form-model-item>
</a-form> </a-form-model>
</a-card> </a-card>
</template> </template>
<script> <script>
import pick from 'lodash.pick'
import {queryIdTree} from '@/api/api' import {queryIdTree} from '@/api/api'
export default { export default {
@@ -81,7 +80,6 @@
visible: false, visible: false,
disable: true, disable: true,
treeData: [], treeData: [],
form: this.$form.createForm(this),
labelCol: { labelCol: {
xs: {span: 24}, xs: {span: 24},
sm: {span: 3} sm: {span: 3}
@@ -108,17 +106,14 @@
}) })
}, },
open(record) { open(record) {
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true; this.visible = true;
console.log("record:");
console.log(record);
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(pick(record, 'orgCategory','departName', 'parentId', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo')); this.$refs.form.resetFields()
}); this.model = Object.assign({}, record)
})
}, },
clearForm() { clearForm() {
this.form.resetFields(); this.$refs.form.resetFields();
this.treeData = []; this.treeData = [];
}, },
} }
@@ -10,60 +10,37 @@
cancelText="关闭"> cancelText="关闭">
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<a-form :form="form"> <a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-item <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="任务类名" prop="jobClassName" hasFeedback >
:labelCol="labelCol" <a-input placeholder="请输入任务类名" v-model="model.jobClassName" />
:wrapperCol="wrapperCol" </a-form-model-item>
label="任务类名" <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="Cron表达式" prop="cronExpression">
hasFeedback > <!-- <j-cron v-model="model.cronExpression"/>-->
<a-input placeholder="请输入任务类名" v-decorator="['jobClassName', {rules: [{ required: true, message: '请输入任务类名!' }]}]" /> <j-easy-cron v-model="model.cronExpression" />
</a-form-item> </a-form-model-item>
<a-form-item <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="参数" prop="parameter" >
:labelCol="labelCol" <a-textarea placeholder="请输入参数" :rows="5" v-model="model.parameter" />
:wrapperCol="wrapperCol" </a-form-model-item>
label="cron表达式"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="描述" prop="description">
<!-- <a-input placeholder="请输入cron表达式" v-decorator="['cronExpression', {'initialValue':'0/1 * * * * ?',rules: [{ required: true, message: '请输入任务类名!' }]}]" />--> <a-textarea placeholder="请输入描述" :rows="3" v-model="model.description" />
<!-- <a target="_blank" href="http://cron.qqe2.com/">--> </a-form-model-item>
<!-- <a-icon type="share-alt" />--> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="状态" prop="status">
<!-- 在线cron表达式生成--> <j-dict-select-tag type="radioButton" v-model="model.status" dictCode="quartz_status"/>
<!-- </a>--> </a-form-model-item>
<!-- <j-cron ref="innerVueCron" v-decorator="['cronExpression', {'initialValue':'0/1 * * * * ?',rules: [{ required: true, message: '请输入cron表达式!' }]}]" @change="setCorn"></j-cron>--> </a-form-model>
<j-cron ref="innerVueCron" v-decorator="['cronExpression', { initialValue: '* * * * * ? *' }]" @change="setCorn"></j-cron>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="参数">
<a-textarea placeholder="请输入参数" :rows="5" v-decorator="['parameter', {}]" />
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="描述">
<a-textarea placeholder="请输入描述" :rows="3" v-decorator="['description', {}]" />
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="状态">
<j-dict-select-tag type="radioButton" v-decorator="[ 'status', {'initialValue':0}]" :trigger-change="true" dictCode="quartz_status"/>
</a-form-item>
</a-form>
</a-spin> </a-spin>
</a-modal> </a-modal>
</template> </template>
<script> <script>
import { httpAction } from '@/api/manage' import { httpAction } from '@/api/manage'
import JCron from "@/components/jero/JCron"; import cronValidator from "@/components/jeecg/JEasyCron/validator";
import pick from 'lodash.pick'
// import moment from "moment"
export default { export default {
name: "QuartzJobModal", name: "QuartzJobModal",
components: { components: {
JCron
}, },
data () { data () {
return { return {
@@ -86,11 +63,11 @@
confirmLoading: false, confirmLoading: false,
form: this.$form.createForm(this), form: this.$form.createForm(this),
validatorRules: { validatorRules: {
cron: { cronExpression: [
rules: [{ {required: true, message: '请输入cron表达式!'},
required: true, message: '请输入cron表达式!' {validator: cronValidator,}
}] ],
} jobClassName: [{required: true, message: '请输入任务类名!'}]
}, },
url: { url: {
add: "/sys/quartzJob/add", add: "/sys/quartzJob/add",
@@ -101,19 +78,19 @@
created () { created () {
}, },
methods: { methods: {
add () { add() {
this.edit({}); // 统一设置默认值
this.edit({
cronExpression: '* * * * * ? *',
status: 0,
})
}, },
edit (record) { edit (record) {
let that = this;
that.form.resetFields();
this.model = Object.assign({},record);
console.log(this.model)
this.visible = true; this.visible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'jobClassName','cronExpression','parameter','description','status')); this.$refs.form.resetFields()
}); this.model = Object.assign({}, record)
})
}, },
close () { close () {
this.$emit('close'); this.$emit('close');
@@ -122,14 +99,8 @@
handleOk () { handleOk () {
const that = this; const that = this;
// 触发表单验证 // 触发表单验证
this.form.validateFields((err, values) => { this.$refs.form.validate((ok, err) => {
console.log('values',values) if (ok) {
if (!err) {
if (typeof values.cronExpression == "undefined" || Object.keys(values.cronExpression).length==0 ) {
this.$message.warning('请输入cron表达式!');
return false;
}
that.confirmLoading = true; that.confirmLoading = true;
let httpurl = ''; let httpurl = '';
let method = ''; let method = '';
@@ -140,20 +111,18 @@
httpurl+=this.url.edit; httpurl+=this.url.edit;
method = 'put'; method = 'put';
} }
let formData = Object.assign(this.model, values);
//时间格式化
console.log('提交参数',formData) console.log('提交参数',this.model)
httpAction(httpurl,formData,method).then((res)=>{ httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){ if(res.success){
that.$message.success(res.message); that.$message.success(res.message);
that.$emit('ok'); that.$emit('ok');
that.close();
}else{ }else{
that.$message.warning(res.message); that.$message.warning(res.message);
} }
}).finally(() => { }).finally(() => {
that.confirmLoading = false; that.confirmLoading = false;
that.close();
}) })
} }
@@ -162,25 +131,6 @@
handleCancel () { handleCancel () {
this.close() this.close()
}, },
setCorn(data){
console.log('data)',data);
this.$nextTick(() => {
this.model.cronExpression = data;
})
// console.log(Object.keys(data).length==0);
if (Object.keys(data).length==0) {
this.$message.warning('请输入cron表达式!');
}
},
validateCron(rule, value, callback){
if(!value){
callback()
}else if (Object.keys(value).length==0) {
callback("请输入cron表达式!");
}
},
} }
} }
</script> </script>
@@ -9,41 +9,24 @@
cancelText="关闭"> cancelText="关闭">
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<a-form :form="form"> <a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-item <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="规则名称" prop="ruleName" >
:labelCol="labelCol" <a-input placeholder="请输入规则名称" v-model="model.ruleName"/>
:wrapperCol="wrapperCol" </a-form-model-item>
label="规则名称"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="规则Code" prop="ruleCode">
<a-input placeholder="请输入规则名称" v-decorator="['ruleName', validatorRules.ruleName]"/> <a-input placeholder="请输入规则Code" v-model="model.ruleCode"/>
</a-form-item> </a-form-model-item>
<a-form-item <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="规则描述" prop="ruleDescription">
:labelCol="labelCol" <a-textarea placeholder="请输入规则描述" v-model="model.ruleDescription"/>
:wrapperCol="wrapperCol" </a-form-model-item>
label="规则Code">
<a-input placeholder="请输入规则Code" v-decorator="['ruleCode', validatorRules.ruleCode]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="规则描述">
<a-textarea placeholder="请输入规则描述" v-decorator="['ruleDescription', {}]"/>
</a-form-item>
</a-form> </a-form-model>
<!-- 规则设计 --> <!-- 规则设计 -->
<a-tabs v-model="tabs.activeKey"> <a-tabs v-model="tabs.activeKey">
<a-tab-pane tab="局部规则" :key="tabs.design.key" forceRender> <a-tab-pane tab="局部规则" :key="tabs.design.key" forceRender>
<a-alert type="info" showIcon message="局部规则按照你输入的位数有序的校验。"/> <a-alert type="info" showIcon message="局部规则按照你输入的位数有序的校验。"/>
<j-editable-table <j-editable-table ref="designTable" dragSort rowNumber :maxHeight="240" :columns="tabs.design.columns" :dataSource="tabs.design.dataSource" style="margin-top: 8px;">
ref="designTable"
dragSort
rowNumber
:maxHeight="240"
:columns="tabs.design.columns"
:dataSource="tabs.design.dataSource"
style="margin-top: 8px;"
>
<template #action="props"> <template #action="props">
<my-action-button :rowEvent="props"/> <my-action-button :rowEvent="props"/>
@@ -51,16 +34,9 @@
</j-editable-table> </j-editable-table>
</a-tab-pane> </a-tab-pane>
<a-tab-pane tab="全局规则" :key="tabs.global.key" forceRender> <a-tab-pane tab="全局规则" :key="tabs.global.key" forceRender>
<j-editable-table <j-editable-table ref="globalTable" dragSort rowNumber actionButton :maxHeight="240" :columns="tabs.global.columns" :dataSource="tabs.global.dataSource">
ref="globalTable"
dragSort
rowNumber
actionButton
:maxHeight="240"
:columns="tabs.global.columns"
:dataSource="tabs.global.dataSource"
>
<template #actionButtonAfter> <template #actionButtonAfter>
<a-alert type="info" showIcon message="全局规则可校验用户输入的所有字符;全局规则的优先级比局部规则的要高。" style="margin-bottom: 8px;"/> <a-alert type="info" showIcon message="全局规则可校验用户输入的所有字符;全局规则的优先级比局部规则的要高。" style="margin-bottom: 8px;"/>
@@ -146,15 +122,12 @@
sm: { span: 16 }, sm: { span: 16 },
}, },
confirmLoading: false, confirmLoading: false,
form: this.$form.createForm(this),
validatorRules: { validatorRules: {
ruleName: { rules: [{ required: true, message: '请输入规则名称!' },] }, ruleName: [{required: true, message: '请输入规则名称!'}],
ruleCode: { ruleCode: [
rules: [ {required: true, message: '请输入规则Code!'},
{ required: true, message: '请输入规则Code!' }, {validator: (rule, value, callback) => validateDuplicateValue('sys_check_rule', 'rule_code', value, this.model.id, callback)}
{ validator: (rule, value, callback) => validateDuplicateValue('sys_check_rule', 'rule_code', value, this.model.id, callback) } ],
]
},
}, },
tabs: { tabs: {
activeKey: 'design', activeKey: 'design',
@@ -272,14 +245,14 @@
this.edit({}) this.edit({})
}, },
edit(record) { edit(record) {
this.form.resetFields()
this.tabs.activeKey = this.tabs.design.key this.tabs.activeKey = this.tabs.design.key
this.tabs.global.dataSource = [] this.tabs.global.dataSource = []
this.tabs.design.dataSource = [{ digits: '', pattern: '', message: '' }] this.tabs.design.dataSource = [{ digits: '', pattern: '', message: '' }]
this.model = Object.assign({}, record)
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'ruleName', 'ruleCode', 'ruleDescription')) this.$refs.form.resetFields()
this.model = Object.assign({}, record)
// 子表数据 // 子表数据
let ruleJson = this.model.ruleJson let ruleJson = this.model.ruleJson
if (ruleJson) { if (ruleJson) {
@@ -307,7 +280,7 @@
Promise.all([ Promise.all([
// 主表单校验 // 主表单校验
alwaysResolve(new Promise((resolve, reject) => { alwaysResolve(new Promise((resolve, reject) => {
this.form.validateFields((error, values) => error ? reject(error) : resolve(values)) this.$refs.form.validate((ok, err) => ok ? resolve(this.model) : reject(err))
})), })),
// 局部规则子表校验 // 局部规则子表校验
alwaysResolve(this.$refs.designTable.getValuesPromise), alwaysResolve(this.$refs.designTable.getValuesPromise),
@@ -10,40 +10,27 @@
cancelText="关闭"> cancelText="关闭">
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<a-form :form="form"> <a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-item <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="规则名称" prop="ruleName">
:labelCol="labelCol" <a-input placeholder="请输入规则名称" v-model="model.ruleName"/>
:wrapperCol="wrapperCol" </a-form-model-item>
label="规则名称"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="规则Code" prop="ruleCode" >
<a-input placeholder="请输入规则名称" v-decorator="['ruleName', validatorRules.ruleName]"/> <a-input placeholder="请输入规则Code" :disabled="disabledCode" v-model="model.ruleCode"/>
</a-form-item> </a-form-model-item>
<a-form-item <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="规则实现类" prop="ruleClass" >
:labelCol="labelCol" <a-input placeholder="请输入规则实现类" v-model="model.ruleClass"/>
:wrapperCol="wrapperCol" </a-form-model-item>
label="规则Code"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="规则参数" prop="ruleParams">
<a-input placeholder="请输入规则Code" :disabled="disabledCode" v-decorator="['ruleCode', validatorRules.ruleCode]"/> <a-textarea placeholder="请输入规则参数" :rows="5" v-model="model.ruleParams"/>
</a-form-item> </a-form-model-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="规则实现类">
<a-input placeholder="请输入规则实现类" v-decorator="['ruleClass', validatorRules.ruleClass]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="规则参数">
<a-textarea placeholder="请输入规则参数" :rows="5" v-decorator="['ruleParams', validatorRules.ruleParams]"/>
</a-form-item>
</a-form> </a-form-model>
</a-spin> </a-spin>
</a-modal> </a-modal>
</template> </template>
<script> <script>
import pick from 'lodash.pick'
import { httpAction } from '@/api/manage' import { httpAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util' import { validateDuplicateValue } from '@/utils/util'
@@ -59,35 +46,30 @@
wrapperCol: { xs: { span: 24 }, sm: { span: 16 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 16 } },
confirmLoading: false, confirmLoading: false,
form: this.$form.createForm(this),
validatorRules: { validatorRules: {
ruleName: { rules: [{ required: true, message: '规则名称不能为空' }] }, ruleName: [{ required: true, message: '规则名称不能为空' }],
ruleCode: { ruleCode: [
rules: [ { required: true, message: '规则Code不能为空' },
{ required: true, message: '规则Code不能为空' }, { validator: (rule, value, callback) => validateDuplicateValue('sys_fill_rule', 'rule_code', value, this.model.id, callback) }
{ validator: (rule, value, callback) => validateDuplicateValue('sys_fill_rule', 'rule_code', value, this.model.id, callback) } ],
] ruleClass: [{ required: true, message: '规则实现类不能为空' }],
}, ruleParams: [{
ruleClass: { rules: [{ required: true, message: '规则实现类不能为空' }] }, validator: (rule, value, callback) => {
ruleParams: {
rules: [{
validator: (rule, value, callback) => {
try { try {
let json = JSON.parse(value) let json = JSON.parse(value)
if (json instanceof Array) { if (json instanceof Array) {
callback('只能传递JSON对象不能传递JSON数组') callback('只能传递JSON对象不能传递JSON数组')
} else if (json instanceof Object) { } else if (json instanceof Object) {
callback() callback()
} else { } else {
callback('请输入JSON字符串')
}
} catch {
callback('请输入JSON字符串') callback('请输入JSON字符串')
} }
} catch {
callback('请输入JSON字符串')
} }
}] }
}, }],
}, },
url: { url: {
add: '/sys/fillRule/add', add: '/sys/fillRule/add',
@@ -107,11 +89,10 @@
this.edit({}) this.edit({})
}, },
edit(record) { edit(record) {
this.form.resetFields()
this.model = Object.assign({}, record)
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'ruleName', 'ruleCode', 'ruleClass', 'ruleParams')) this.$refs.form.resetFields()
this.model = Object.assign({}, record)
}) })
}, },
close() { close() {
@@ -121,8 +102,8 @@
handleOk() { handleOk() {
const that = this const that = this
// 触发表单验证 // 触发表单验证
this.form.validateFields((err, values) => { this.$refs.form.validate((ok, err) => {
if (!err) { if (ok) {
that.confirmLoading = true that.confirmLoading = true
let httpUrl = this.url.add, method = 'post' let httpUrl = this.url.add, method = 'post'
if (this.model.id) { if (this.model.id) {
@@ -130,17 +111,16 @@
method = 'put' method = 'put'
} }
let formData = Object.assign(this.model, values) httpAction(httpUrl, this.model, method).then((res) => {
httpAction(httpUrl, formData, method).then((res) => {
if (res.success) { if (res.success) {
that.$message.success(res.message) that.$message.success(res.message)
that.$emit('ok') that.$emit('ok')
that.close()
} else { } else {
that.$message.warning(res.message) that.$message.warning(res.message)
} }
}).finally(() => { }).finally(() => {
that.confirmLoading = false that.confirmLoading = false
that.close()
}) })
} }
}) })
@@ -148,7 +148,7 @@ export const JeroThirdLoginMixin = {
const hide = this.$message.loading('验证码发送中..', 0) const hide = this.$message.loading('验证码发送中..', 0)
let smsParams = {} let smsParams = {}
smsParams.mobile = this.thirdPhone smsParams.mobile = this.thirdPhone
smsParams.smsmode = '1' smsParams.smsmode = '0'
postAction('/sys/sms', smsParams).then(res => { postAction('/sys/sms', smsParams).then(res => {
if (!res.success) { if (!res.success) {
setTimeout(hide, 0) setTimeout(hide, 0)