Commit 04c0ea55 by zhangdaihao

JeecgBoot 2.1.1 代码生成器AI版本发布

parent 9e8b97a0
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
Jeecg-Boot 快速开发平台(前后端分离版本) Jeecg-Boot 快速开发平台(前后端分离版本)
=============== ===============
当前最新版本: 2.1.0(发布日期:20190826 当前最新版本: 2.1.1(发布日期:20191011
[![AUR](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE) [![AUR](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE)
[![](https://img.shields.io/badge/Author-JEECG团队-orange.svg)](http://www.jeecg.com) [![](https://img.shields.io/badge/Author-JEECG团队-orange.svg)](http://www.jeecg.com)
......
Ant Design Jeecg Vue Ant Design Jeecg Vue
==== ====
当前最新版本: 2.1.0(发布日期:20190826 当前最新版本: 2.0.2(发布日期:20190708
Overview Overview
---- ----
......
This source diff could not be displayed because it is too large. You can view the blob instead.
{ {
"name": "vue-antd-jeecg", "name": "vue-antd-jeecg",
"version": "2.1.0", "version": "2.1.1",
"private": false, "private": true,
"scripts": { "scripts": {
"pre": "cnpm install || yarn --registry https://registry.npm.taobao.org || npm install --registry https://registry.npm.taobao.org ", "pre": "cnpm install || yarn --registry https://registry.npm.taobao.org || npm install --registry https://registry.npm.taobao.org ",
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
}, },
"dependencies": { "dependencies": {
"@antv/data-set": "^0.10.2", "@antv/data-set": "^0.10.2",
"@jeecg/antd-onine": "^1.0.1", "@jeecg/antd-online": "^1.2.0",
"@tinymce/tinymce-vue": "^2.0.0", "@tinymce/tinymce-vue": "^2.0.0",
"ant-design-vue": "^1.3.9", "ant-design-vue": "^1.4.0",
"apexcharts": "^3.6.5", "apexcharts": "^3.6.5",
"axios": "^0.18.0", "axios": "^0.18.0",
"clipboard": "^2.0.4", "clipboard": "^2.0.4",
......
...@@ -245,6 +245,7 @@ ...@@ -245,6 +245,7 @@
window._CONFIG['domianURL'] = 'http://127.0.0.1:8080/jeecg-boot'; window._CONFIG['domianURL'] = 'http://127.0.0.1:8080/jeecg-boot';
window._CONFIG['casPrefixUrl'] = 'http://cas.example.org:8443/cas'; window._CONFIG['casPrefixUrl'] = 'http://cas.example.org:8443/cas';
window._CONFIG['imgDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/view'; window._CONFIG['imgDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/view';
window._CONFIG['downloadUrl'] = window._CONFIG['domianURL'] + '/sys/common/download';
window._CONFIG['pdfDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/pdf/pdfPreviewIframe'; window._CONFIG['pdfDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/pdf/pdfPreviewIframe';
</script> </script>
</head> </head>
......
...@@ -31,6 +31,11 @@ const changPassword = (params)=>putAction("/sys/user/changPassword",params); ...@@ -31,6 +31,11 @@ const changPassword = (params)=>putAction("/sys/user/changPassword",params);
const addPermission= (params)=>postAction("/sys/permission/add",params); const addPermission= (params)=>postAction("/sys/permission/add",params);
const editPermission= (params)=>putAction("/sys/permission/edit",params); const editPermission= (params)=>putAction("/sys/permission/edit",params);
const getPermissionList = (params)=>getAction("/sys/permission/list",params); const getPermissionList = (params)=>getAction("/sys/permission/list",params);
/*update_begin author:wuxianquan date:20190908 for:添加查询一级菜单和子菜单查询api */
const getSystemMenuList = (params)=>getAction("/sys/permission/getSystemMenuList",params);
const getSystemSubmenu = (params)=>getAction("/sys/permission/getSystemSubmenu",params);
/*update_end author:wuxianquan date:20190908 for:添加查询一级菜单和子菜单查询api */
// const deletePermission = (params)=>deleteAction("/sys/permission/delete",params); // const deletePermission = (params)=>deleteAction("/sys/permission/delete",params);
// const deletePermissionList = (params)=>deleteAction("/sys/permission/deleteBatch",params); // const deletePermissionList = (params)=>deleteAction("/sys/permission/deleteBatch",params);
const queryTreeList = (params)=>getAction("/sys/permission/queryTreeList",params); const queryTreeList = (params)=>getAction("/sys/permission/queryTreeList",params);
...@@ -87,6 +92,8 @@ const queryUserByDepId = (params)=>getAction("/sys/user/queryUserByDepId",params ...@@ -87,6 +92,8 @@ const queryUserByDepId = (params)=>getAction("/sys/user/queryUserByDepId",params
const queryUserRoleMap = (params)=>getAction("/sys/user/queryUserRoleMap",params); const queryUserRoleMap = (params)=>getAction("/sys/user/queryUserRoleMap",params);
// 重复校验 // 重复校验
const duplicateCheck = (params)=>getAction("/sys/duplicate/check",params); const duplicateCheck = (params)=>getAction("/sys/duplicate/check",params);
// 加载分类字典
const loadCategoryData = (params)=>getAction("/sys/category/loadAllData",params);
export { export {
// imgView, // imgView,
...@@ -133,6 +140,9 @@ export { ...@@ -133,6 +140,9 @@ export {
queryUserRoleMap, queryUserRoleMap,
duplicateCheck, duplicateCheck,
queryTreeListForRole, queryTreeListForRole,
getSystemMenuList,
getSystemSubmenu,
loadCategoryData
} }
......
...@@ -56,7 +56,9 @@ ...@@ -56,7 +56,9 @@
// bar 使用不了 - 和 / 所以替换下 // bar 使用不了 - 和 / 所以替换下
return dv.rows.map(row => { return dv.rows.map(row => {
if (typeof row.x === 'string') {
row.x = row.x.replace(/[-/]/g, '_') row.x = row.x.replace(/[-/]/g, '_')
}
return row return row
}) })
......
...@@ -44,7 +44,7 @@ export function filterDictText(dictOptions, text) { ...@@ -44,7 +44,7 @@ export function filterDictText(dictOptions, text) {
* @return String * @return String
*/ */
export function filterMultiDictText(dictOptions, text) { export function filterMultiDictText(dictOptions, text) {
if(!text){ if(!text || !dictOptions || dictOptions.length==0){
return "" return ""
} }
let re = ""; let re = "";
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
@change="onChange" @change="onChange"
:disabled="disabled" :disabled="disabled"
mode="multiple" mode="multiple"
:placeholder="placeholder"> :placeholder="placeholder"
allowClear>
<a-select-option <a-select-option
v-for="(item,index) in dictOptions" v-for="(item,index) in dictOptions"
:key="index" :key="index"
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
style="width: 100%" style="width: 100%"
:filterOption="false" :filterOption="false"
@change="handleAsyncChange" @change="handleAsyncChange"
allowClear
:notFoundContent="loading ? undefined : null" :notFoundContent="loading ? undefined : null"
> >
<a-spin v-if="loading" slot="notFoundContent" size="small"/> <a-spin v-if="loading" slot="notFoundContent" size="small"/>
...@@ -25,6 +26,7 @@ ...@@ -25,6 +26,7 @@
@change="handleChange" @change="handleChange"
:filterOption="filterOption" :filterOption="filterOption"
v-model="selectedValue" v-model="selectedValue"
allowClear
:notFoundContent="loading ? undefined : null"> :notFoundContent="loading ? undefined : null">
<a-spin v-if="loading" slot="notFoundContent" size="small"/> <a-spin v-if="loading" slot="notFoundContent" size="small"/>
<a-select-option v-for="d in options" :key="d.value" :value="d.value">{{ d.text }}</a-select-option> <a-select-option v-for="d in options" :key="d.value" :value="d.value">{{ d.text }}</a-select-option>
......
<template>
<a-tree-select
allowClear
labelInValue
style="width: 100%"
:disabled="disabled"
:dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
:placeholder="placeholder"
:loadData="asyncLoadTreeData"
:value="treeValue"
:treeData="treeData"
:multiple="multiple"
@change="onChange">
</a-tree-select>
</template>
<script>
import { getAction } from '@/api/manage'
export default {
name: 'JCategorySelect',
props: {
value:{
type: String,
required: false
},
placeholder:{
type: String,
default: '请选择',
required: false
},
disabled:{
type:Boolean,
default:false,
required:false
},
condition:{
type:String,
default:'',
required:false
},
// 是否支持多选
multiple: {
type: Boolean,
default: false,
},
loadTriggleChange:{
type: Boolean,
default: false,
required:false
},
pid:{
type:String,
default:'',
required:false
},
pcode:{
type:String,
default:'',
required:false
},
back:{
type:String,
default:'',
required:false
}
},
data () {
return {
treeValue:"",
treeData:[],
url:"/sys/category/loadTreeData",
view:'/sys/category/loadDictItem/',
tableName:"",
text:"",
code:"",
}
},
watch: {
value () {
this.loadItemByCode()
},
pcode(){
this.loadRoot();
}
},
created(){
this.validateProp().then(()=>{
this.loadRoot()
this.loadItemByCode()
})
},
methods: {
/**加载一级节点 */
loadRoot(){
let param = {
pid:this.pid,
pcode:this.pcode,
condition:this.condition
}
getAction(this.url,param).then(res=>{
if(res.success && res.result){
for(let i of res.result){
i.value = i.key
if(i.leaf==false){
i.isLeaf=false
}else if(i.leaf==true){
i.isLeaf=true
}
}
this.treeData = [...res.result]
}else{
console.log("树一级节点查询结果-else",res)
}
})
},
/** 数据回显*/
loadItemByCode(){
if(!this.value || this.value=="0"){
this.treeValue = ""
}else{
getAction(this.view,{ids:this.value}).then(res=>{
console.log(124345)
console.log(124345,res)
if(res.success){
let values = this.value.split(',')
this.treeValue = res.result.map((item, index) => ({
key: values[index],
value: values[index],
label: item
}))
this.onLoadTriggleChange(res.result[0]);
}
})
}
},
onLoadTriggleChange(text){
//只有单选才会触发
if(!this.multiple && this.loadTriggleChange){
this.backValue(this.value,text)
}
},
backValue(value,label){
let obj = {}
if(this.back){
obj[this.back] = label
}
this.$emit('change', value, obj)
},
asyncLoadTreeData (treeNode) {
return new Promise((resolve) => {
if (treeNode.$vnode.children) {
resolve()
return
}
let pid = treeNode.$vnode.key
let param = {
pid:pid,
condition:this.condition
}
getAction(this.url,param).then(res=>{
if(res.success){
for(let i of res.result){
i.value = i.key
if(i.leaf==false){
i.isLeaf=false
}else if(i.leaf==true){
i.isLeaf=true
}
}
this.addChildren(pid,res.result,this.treeData)
this.treeData = [...this.treeData]
}
resolve()
})
})
},
addChildren(pid,children,treeArray){
if(treeArray && treeArray.length>0){
for(let item of treeArray){
if(item.key == pid){
if(!children || children.length==0){
item.isLeaf=true
}else{
item.children = children
}
break
}else{
this.addChildren(pid,children,item.children)
}
}
}
},
onChange(value){
if(!value){
this.$emit('change', '');
this.treeValue = ''
} else if (value instanceof Array) {
//this.$emit('change', value.map(item => item.value).join(','))
//this.treeValue = value
} else {
this.backValue(value.value,value.label)
this.treeValue = value
}
},
getCurrTreeData(){
return this.treeData
},
validateProp(){
let mycondition = this.condition
return new Promise((resolve,reject)=>{
if(!mycondition){
resolve();
}else{
try {
let test=JSON.parse(mycondition);
if(typeof test == 'object' && test){
resolve()
}else{
this.$message.error("组件JTreeSelect-condition传值有误,需要一个json字符串!")
reject()
}
} catch(e) {
this.$message.error("组件JTreeSelect-condition传值有误,需要一个json字符串!")
reject()
}
}
})
}
},
//2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型 这个牛逼
model: {
prop: 'value',
event: 'change'
}
}
</script>
<template> <template>
<a-checkbox-group :options="options" :value="checkboxArray" @change="onChange" /> <a-checkbox-group :options="options" :value="checkboxArray" v-bind="$attrs" @change="onChange" />
</template> </template>
<script> <script>
......
...@@ -228,10 +228,11 @@ ...@@ -228,10 +228,11 @@
// 初始化编辑器实例,传入需要被实例化的文本域对象和默认配置 // 初始化编辑器实例,传入需要被实例化的文本域对象和默认配置
this.coder = CodeMirror.fromTextArea(this.$refs.textarea, this.coderOptions) this.coder = CodeMirror.fromTextArea(this.$refs.textarea, this.coderOptions)
// 编辑器赋值 // 编辑器赋值
this.coder.setValue(this.value || this.code)
if(this.value||this.code){ if(this.value||this.code){
this.hasCode=true this.hasCode=true
this.coder.setValue(this.value || this.code)
}else{ }else{
this.coder.setValue('')
this.hasCode=false this.hasCode=false
} }
// 支持双向绑定 // 支持双向绑定
...@@ -266,7 +267,13 @@ ...@@ -266,7 +267,13 @@
return this.code return this.code
}, },
setCodeContent(val){ setCodeContent(val){
setTimeout(()=>{
if(!val){
this.coder.setValue('')
}else{
this.coder.setValue(val) this.coder.setValue(val)
}
},300)
}, },
// 获取当前语法类型 // 获取当前语法类型
_getLanguage (language) { _getLanguage (language) {
...@@ -405,5 +412,7 @@ ...@@ -405,5 +412,7 @@
} }
.CodeMirror-cursor{
height:18.4px !important;
}
</style> </style>
\ No newline at end of file
...@@ -18,9 +18,6 @@ ...@@ -18,9 +18,6 @@
value: { value: {
required: false, required: false,
type: String, type: String,
default:()=>{
return '* * * * * ? *'
}
} }
}, },
data(){ data(){
......
...@@ -87,12 +87,9 @@ ...@@ -87,12 +87,9 @@
this.myValue = (newValue == null ? '' : newValue) this.myValue = (newValue == null ? '' : newValue)
}, },
myValue(newValue) { myValue(newValue) {
console.log(newValue)
if(this.triggerChange){ if(this.triggerChange){
console.log(1)
this.$emit('change', newValue) this.$emit('change', newValue)
}else{ }else{
console.log(2)
this.$emit('input', newValue) this.$emit('input', newValue)
} }
} }
......
<template> <template>
<div v-if="disabled" class="jeecg-form-container-disabled"> <div :class="disabled?'jeecg-form-container-disabled':''">
<fieldset disabled> <fieldset disabled>
<slot></slot> <slot name="detail"></slot>
</fieldset> </fieldset>
</div> <slot name="edit"></slot>
<div v-else> <fieldset disabled>
<slot></slot> <slot></slot>
</fieldset>
</div> </div>
</template> </template>
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
</template> </template>
<script> <script>
import { getAction } from '@/api/manage'
export default { export default {
name: 'JGraphicCode', name: 'JGraphicCode',
props: { props: {
...@@ -59,6 +61,11 @@ ...@@ -59,6 +61,11 @@
contentHeight: { contentHeight: {
type: Number, type: Number,
default: 38 default: 38
},
remote:{
type:Boolean,
default:false,
required:false
} }
}, },
methods: { methods: {
...@@ -74,7 +81,7 @@ ...@@ -74,7 +81,7 @@
return 'rgb(' + r + ',' + g + ',' + b + ')' return 'rgb(' + r + ',' + g + ',' + b + ')'
}, },
drawPic () { drawPic () {
this.randomCode() this.randomCode().then(()=>{
let canvas = document.getElementById('gc-canvas') let canvas = document.getElementById('gc-canvas')
let ctx = canvas.getContext('2d') let ctx = canvas.getContext('2d')
ctx.textBaseline = 'bottom' ctx.textBaseline = 'bottom'
...@@ -88,6 +95,7 @@ ...@@ -88,6 +95,7 @@
this.drawLine(ctx) this.drawLine(ctx)
this.drawDot(ctx) this.drawDot(ctx)
this.$emit("success",this.code) this.$emit("success",this.code)
})
}, },
drawText (ctx, txt, i) { drawText (ctx, txt, i) {
ctx.fillStyle = this.randomColor(this.colorMin, this.colorMax) ctx.fillStyle = this.randomColor(this.colorMin, this.colorMax)
...@@ -136,6 +144,31 @@ ...@@ -136,6 +144,31 @@
this.drawPic() this.drawPic()
}, },
randomCode(){ randomCode(){
return new Promise((resolve)=>{
if(this.remote==true){
getAction("/sys/getCheckCode").then(res=>{
console.log("aaaaa",res)
if(res.success){
this.checkKey = res.result.key
this.code = res.result.code
resolve();
}else{
this.$message.error("生成验证码错误,请联系系统管理员")
this.code = 'BUG'
resolve();
}
}).catch(()=>{
console.log("生成验证码连接服务器异常")
this.code = 'BUG'
resolve();
})
}else{
this.randomLocalCode();
resolve();
}
})
},
randomLocalCode(){
let random = '' let random = ''
//去掉了I l i o O //去掉了I l i o O
let str = "QWERTYUPLKJHGFDSAZXCVBNMqwertyupkjhgfdsazxcvbnm1234567890" let str = "QWERTYUPLKJHGFDSAZXCVBNMqwertyupkjhgfdsazxcvbnm1234567890"
...@@ -144,6 +177,12 @@ ...@@ -144,6 +177,12 @@
random += str[index]; random += str[index];
} }
this.code = random this.code = random
},
getLoginParam(){
return {
checkCode:this.code,
checkKey:this.checkKey
}
} }
}, },
mounted () { mounted () {
...@@ -151,7 +190,8 @@ ...@@ -151,7 +190,8 @@
}, },
data(){ data(){
return { return {
code:"" code:"",
checkKey:""
} }
} }
......
<template>
<a-input :placeholder="placeholder" :value="inputVal" @input="backValue"></a-input>
</template>
<script>
const JINPUT_QUERY_LIKE = 'like';
const JINPUT_QUERY_NE = 'ne';
const JINPUT_QUERY_GE = 'ge'; //大于等于
const JINPUT_QUERY_LE = 'le'; //小于等于
export default {
name: 'JInput',
props:{
value:{
type:String,
required:false
},
type:{
type:String,
required:false,
default:JINPUT_QUERY_LIKE
},
placeholder:{
type:String,
required:false,
default:''
}
},
watch:{
value:{
immediate:true,
handler:function(){
this.initVal();
}
}
},
model: {
prop: 'value',
event: 'change'
},
data(){
return {
inputVal:''
}
},
methods:{
initVal(){
if(!this.value){
this.inputVal = ''
}else{
let text = this.value
switch (this.type) {
case JINPUT_QUERY_LIKE:
text = text.substring(1,text.length-1);
break;
case JINPUT_QUERY_NE:
text = text.substring(1);
break;
case JINPUT_QUERY_GE:
text = text.substring(2);
break;
case JINPUT_QUERY_LE:
text = text.substring(2);
break;
default:
}
this.inputVal = text
}
},
backValue(e){
let text = e.target.value
switch (this.type) {
case JINPUT_QUERY_LIKE:
text = "*"+text+"*";
break;
case JINPUT_QUERY_NE:
text = "!"+text;
break;
case JINPUT_QUERY_GE:
text = ">="+text;
break;
case JINPUT_QUERY_LE:
text = "<="+text;
break;
default:
}
this.$emit("change",text)
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
...@@ -59,8 +59,13 @@ ...@@ -59,8 +59,13 @@
this.mouseMoveStata = false; this.mouseMoveStata = false;
var width = e.clientX - this.beginClientX; var width = e.clientX - this.beginClientX;
if(width<this.maxwidth){ if(width<this.maxwidth){
document.getElementsByClassName('handler')[0].style.left = 0 + 'px'; // ---- update-begin- author:sunjianlei --- date:20191009 --- for: 修复获取不到 handler 的时候报错 ----
document.getElementsByClassName('drag_bg')[0].style.width = 0 + 'px'; let handler = document.getElementsByClassName('handler')[0]
if (handler) {
handler.style.left = 0 + 'px'
document.getElementsByClassName('drag_bg')[0].style.width = 0 + 'px'
}
// ---- update-end- author:sunjianlei --- date:20191009 --- for: 修复获取不到 handler 的时候报错 ----
} }
} //mouseup事件 } //mouseup事件
}, },
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
:loadData="asyncLoadTreeData" :loadData="asyncLoadTreeData"
:value="treeValue" :value="treeValue"
:treeData="treeData" :treeData="treeData"
:multiple="multiple"
@change="onChange" @change="onChange"
@search="onSearch"> @search="onSearch">
</a-tree-select> </a-tree-select>
...@@ -45,7 +46,7 @@ ...@@ -45,7 +46,7 @@
}, },
pidValue:{ pidValue:{
type: String, type: String,
default: '0', default: '',
required: false required: false
}, },
disabled:{ disabled:{
...@@ -57,6 +58,21 @@ ...@@ -57,6 +58,21 @@
type: String, type: String,
default: '', default: '',
required: false required: false
},
condition:{
type:String,
default:'',
required:false
},
// 是否支持多选
multiple: {
type: Boolean,
default: false,
},
loadTriggleChange:{
type: Boolean,
default: false,
required:false
} }
}, },
data () { data () {
...@@ -81,9 +97,11 @@ ...@@ -81,9 +97,11 @@
} }
}, },
created(){ created(){
this.validateProp().then(()=>{
this.initDictInfo() this.initDictInfo()
this.loadRoot() this.loadRoot()
this.loadItemByCode() this.loadItemByCode()
})
}, },
methods: { methods: {
loadItemByCode(){ loadItemByCode(){
...@@ -92,15 +110,23 @@ ...@@ -92,15 +110,23 @@
}else{ }else{
getAction(`${this.view}${this.dict}`,{key:this.value}).then(res=>{ getAction(`${this.view}${this.dict}`,{key:this.value}).then(res=>{
if(res.success){ if(res.success){
this.treeValue = { let values = this.value.split(',')
key:this.value, this.treeValue = res.result.map((item, index) => ({
value:this.value, key: values[index],
label:res.result value: values[index],
} label: item
}))
this.onLoadTriggleChange(res.result[0]);
} }
}) })
} }
}, },
onLoadTriggleChange(text){
//只有单选才会触发
if(!this.multiple && this.loadTriggleChange){
this.$emit('change', this.value,text)
}
},
initDictInfo(){ initDictInfo(){
let arr = this.dict.split(",") let arr = this.dict.split(",")
this.tableName = arr[0] this.tableName = arr[0]
...@@ -120,7 +146,8 @@ ...@@ -120,7 +146,8 @@
text:this.text, text:this.text,
code:this.code, code:this.code,
pidField:this.pidField, pidField:this.pidField,
hasChildField:this.hasChildField hasChildField:this.hasChildField,
condition:this.condition
} }
getAction(this.url,param).then(res=>{ getAction(this.url,param).then(res=>{
if(res.success){ if(res.success){
...@@ -162,7 +189,8 @@ ...@@ -162,7 +189,8 @@
text:this.text, text:this.text,
code:this.code, code:this.code,
pidField:this.pidField, pidField:this.pidField,
hasChildField:this.hasChildField hasChildField:this.hasChildField,
condition:this.condition
} }
getAction(this.url,param).then(res=>{ getAction(this.url,param).then(res=>{
if(res.success && res.result){ if(res.success && res.result){
...@@ -184,8 +212,11 @@ ...@@ -184,8 +212,11 @@
if(!value){ if(!value){
this.$emit('change', ''); this.$emit('change', '');
this.treeValue = '' this.treeValue = ''
}else{ } else if (value instanceof Array) {
this.$emit('change', value.value); this.$emit('change', value.map(item => item.value).join(','))
this.treeValue = value
} else {
this.$emit('change', value.value,value.label)
this.treeValue = value this.treeValue = value
} }
...@@ -195,6 +226,28 @@ ...@@ -195,6 +226,28 @@
}, },
getCurrTreeData(){ getCurrTreeData(){
return this.treeData return this.treeData
},
validateProp(){
let mycondition = this.condition
return new Promise((resolve,reject)=>{
if(!mycondition){
resolve();
}else{
try {
let test=JSON.parse(mycondition);
console.log("aaaaasdsdd",typeof test)
if(typeof test == 'object' && test){
resolve()
}else{
this.$message.error("组件JTreeSelect-condition传值有误,需要一个json字符串!")
reject()
}
} catch(e) {
this.$message.error("组件JTreeSelect-condition传值有误,需要一个json字符串!")
reject()
}
}
})
} }
}, },
//2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型 这个牛逼 //2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型 这个牛逼
......
...@@ -3,8 +3,11 @@ ...@@ -3,8 +3,11 @@
:rowKey="rowKey" :rowKey="rowKey"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
v-bind="tableProps" :expandedRowKeys="expandedRowKeys"
@expand="handleExpand"> v-bind="tableAttrs"
v-on="$listeners"
@expand="handleExpand"
@expandedRowsChange="expandedRowKeys=$event">
<template v-for="(slotItem) of slots" :slot="slotItem" slot-scope="text, record, index"> <template v-for="(slotItem) of slots" :slot="slotItem" slot-scope="text, record, index">
<slot :name="slotItem" v-bind="{text,record,index}"></slot> <slot :name="slotItem" v-bind="{text,record,index}"></slot>
...@@ -30,8 +33,7 @@ ...@@ -30,8 +33,7 @@
}, },
queryParams: { queryParams: {
type: Object, type: Object,
default: () => { default: () => ({})
}
}, },
// 查询顶级时的值,如果顶级为0,则传0 // 查询顶级时的值,如果顶级为0,则传0
topValue: { topValue: {
...@@ -52,13 +54,23 @@ ...@@ -52,13 +54,23 @@
}, },
tableProps: { tableProps: {
type: Object, type: Object,
default: () => { default: () => ({})
} },
/** 是否在创建组件的时候就查询数据 */
immediateRequest: {
type: Boolean,
default: true
},
condition:{
type:String,
default:'',
required:false
} }
}, },
data() { data() {
return { return {
dataSource: [] dataSource: [],
expandedRowKeys: []
} }
}, },
computed: { computed: {
...@@ -77,6 +89,9 @@ ...@@ -77,6 +89,9 @@
} }
} }
return slots return slots
},
tableAttrs() {
return Object.assign(this.$attrs, this.tableProps)
} }
}, },
watch: { watch: {
...@@ -88,20 +103,44 @@ ...@@ -88,20 +103,44 @@
} }
}, },
created() { created() {
this.loadData() if (this.immediateRequest) this.loadData()
}, },
methods: { methods: {
/** 加载数据*/ /** 加载数据*/
loadData(id = this.topValue, first = true, url = this.url) { loadData(id = this.topValue, first = true, url = this.url) {
this.$emit('requestBefore', { first })
if (first) {
this.expandedRowKeys = []
}
let params = Object.assign({}, this.queryParams || {}) let params = Object.assign({}, this.queryParams || {})
params[this.queryKey] = id params[this.queryKey] = id
if(this.condition && this.condition.length>0){
params['condition'] = this.condition
}
return getAction(url, params).then(res => { return getAction(url, params).then(res => {
let dataSource = res.result.map(item => { let list = []
if (res.result instanceof Array) {
list = res.result
} else if (res.result.records instanceof Array) {
list = res.result.records
} else {
throw '返回数据类型不识别'
}
let dataSource = list.map(item => {
// 判断是否标记了带有子级 // 判断是否标记了带有子级
if (item.hasChildren === true) { if (item.hasChildren === true) {
// 查找第一个带有dataIndex的值的列
let firstColumn
for (let column of this.columns) {
firstColumn = column.dataIndex
if (firstColumn) break
}
// 定义默认展开时显示的loading子级,实际子级数据只在展开时加载 // 定义默认展开时显示的loading子级,实际子级数据只在展开时加载
let loadChild = { id: `${item.id}_loadChild`, name: 'loading...', isLoading: true } let loadChild = { id: `${item.id}_loadChild`, [firstColumn]: 'loading...', isLoading: true }
item.children = [loadChild] item.children = [loadChild]
} }
return item return item
...@@ -109,8 +148,9 @@ ...@@ -109,8 +148,9 @@
if (first) { if (first) {
this.dataSource = dataSource this.dataSource = dataSource
} }
this.$emit('requestSuccess', { first, dataSource, res })
return Promise.resolve(dataSource) return Promise.resolve(dataSource)
}) }).finally(() => this.$emit('requestFinally', { first }))
}, },
/** 点击展开图标时触发 */ /** 点击展开图标时触发 */
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
:data="{'isup':1,'bizPath':bizPath}" :data="{'isup':1,'bizPath':bizPath}"
:fileList="fileList" :fileList="fileList"
:beforeUpload="beforeUpload" :beforeUpload="beforeUpload"
@change="handleChange"> @change="handleChange"
:disabled="disabled">
<a-button> <a-button>
<a-icon type="upload" />{{ text }} <a-icon type="upload" />{{ text }}
</a-button> </a-button>
...@@ -63,6 +64,13 @@ ...@@ -63,6 +64,13 @@
type:String, type:String,
required:false required:false
}, },
// update-begin- --- author:wangshuai ------ date:20190929 ---- for:Jupload组件增加是否能够点击
disabled:{
type:Boolean,
required:false,
default: false
},
// update-end- --- author:wangshuai ------ date:20190929 ---- for:Jupload组件增加是否能够点击
//此属性被废弃了 //此属性被废弃了
triggerChange:{ triggerChange:{
type: Boolean, type: Boolean,
......
...@@ -477,6 +477,7 @@ online用 实际开发请使用components/dict/JMultiSelectTag ...@@ -477,6 +477,7 @@ online用 实际开发请使用components/dict/JMultiSelectTag
| dict |string | ✔| 表名,显示字段名,存储字段名拼接的字符串 | | dict |string | ✔| 表名,显示字段名,存储字段名拼接的字符串 |
| pidField |string | ✔| 父ID的字段名 | | pidField |string | ✔| 父ID的字段名 |
| pidValue |string | | 根节点父ID的值 默认'0' 不可以设置为空,如果想使用此组件,而数据库根节点父ID为空,请修改之 | | pidValue |string | | 根节点父ID的值 默认'0' 不可以设置为空,如果想使用此组件,而数据库根节点父ID为空,请修改之 |
| multiple |boolean | |是否支持多选 |
使用示例 使用示例
---- ----
......
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
- `required` 是否必填,可选值为`true`or`false` - `required` 是否必填,可选值为`true`or`false`
- `pattern` 正则表达式验证,只有成功匹配该正则的值才能成功通过验证 - `pattern` 正则表达式验证,只有成功匹配该正则的值才能成功通过验证
- `handler` 自定义函数校验,使用方法请见[示例五](#示例五)
- `message` 当验证未通过时显示的提示文本,可以使用`${...}`变量替换文本(详见`${...} 变量使用方式` - `message` 当验证未通过时显示的提示文本,可以使用`${...}`变量替换文本(详见`${...} 变量使用方式`
- 配置示例请看[示例二](#示例二) - 配置示例请看[示例二](#示例二)
...@@ -252,6 +253,19 @@ setValues([ ...@@ -252,6 +253,19 @@ setValues([
} }
]) ])
``` ```
### clearSelection
主动清空选择的行
- `参数:`
- `返回值:`
## 内置插槽
| 插槽名 | 说明 |
|--------------|------------------------------------------------------|
| buttonBefore | 在操作按钮的**前面**插入插槽,不受`actionButton`属性的影响 |
| buttonAfter | 在操作按钮的**后面**插入插槽,不受`actionButton`属性的影响 |
## ${...} 变量使用方式 ## ${...} 变量使用方式
...@@ -511,3 +525,53 @@ this.$refs.editableTable.getValues((error, values) => { ...@@ -511,3 +525,53 @@ this.$refs.editableTable.getValues((error, values) => {
} }
</script> </script>
``` ```
## 示例五
```js
// 该示例是自定义函数校验
columns: [
{
title: '字段名称',
key: 'dbFieldName',
type: FormTypes.input,
defaultValue: '',
validateRules: [
{
// 自定义函数校验 handler
handler(type, value, row, column, callback, target) {
// type 触发校验的类型(input、change、blur)
// value 当前校验的值
// callback(flag, message) 方法必须执行且只能执行一次
// flag = 是否通过了校验,不填写或者填写 null 代表不进行任何操作
// message = 提示的类型,默认使用配置的 message
// target 行编辑的实例对象
if (type === 'blur') {
if (value === 'abc') {
callback(false, '${title}不能是abc') // false = 未通过,可以跟自定义提示
return
}
let { values } = target.getValuesSync({ validate: false })
let count = 0
for (let val of values) {
if (val['dbFieldName'] === value) {
if (++count >= 2) {
callback(false, '${title}不能重复')
return
}
}
}
callback(true) // true = 通过验证
} else {
callback() // 不填写或者填写 null 代表不进行任何操作
}
},
message: '${title}默认提示'
}
]
},
]
```
\ No newline at end of file
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</a-row> </a-row>
<a-row> <a-row>
<a-radio value="2">每隔 <a-radio value="2">每隔
<a-input-number size="small" v-model="result.second.incrementIncrement" :min="1" :max="60"></a-input-number> <a-input-number size="small" v-model="result.second.incrementIncrement" :min="1" :max="59"></a-input-number>
秒执行 从 秒执行 从
<a-input-number size="small" v-model="result.second.incrementStart" :min="0" :max="59"></a-input-number> <a-input-number size="small" v-model="result.second.incrementStart" :min="0" :max="59"></a-input-number>
秒开始 秒开始
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</a-row> </a-row>
<a-row> <a-row>
<a-radio value="4">周期从 <a-radio value="4">周期从
<a-input-number size="small" v-model="result.second.rangeStart" :min="1" :max="60"></a-input-number> <a-input-number size="small" v-model="result.second.rangeStart" :min="1" :max="59"></a-input-number>
<a-input-number size="small" v-model="result.second.rangeEnd" :min="0" :max="59"></a-input-number> <a-input-number size="small" v-model="result.second.rangeEnd" :min="0" :max="59"></a-input-number>
......
<template>
<a-modal
centered
:title="name + '选择'"
:width="900"
:visible="visible"
@ok="handleOk"
@cancel="close"
cancelText="关闭">
<a-row :gutter="18">
<a-col :span="16">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="24">
<a-col :span="14">
<a-form-item :label="(queryParamText||name)">
<a-input :placeholder="'请输入' + (queryParamText||name)" v-model="queryParam[valueKey]"></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<a-table
size="small"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:scroll="{ y: 240 }"
:rowSelection="{selectedRowKeys, onChange: onSelectChange, type: multiple ? 'checkbox':'radio'}"
:customRow="customRowFn"
@change="handleTableChange">
</a-table>
</a-col>
<a-col :span="8">
<a-card :title="'已选' + name" :bordered="false" :head-style="{padding:0}" :body-style="{padding:0}">
<a-table rowKey="id" size="small" bordered v-bind="selectedTable">
<span slot="action" slot-scope="text, record, index">
<a @click="handleDeleteSelected(record, index)">删除</a>
</span>
</a-table>
</a-card>
</a-col>
</a-row>
</a-modal>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
name: 'JSelectBizComponentModal',
mixins: [JeecgListMixin],
props: {
value: {
type: Array,
default: () => []
},
visible: {
type: Boolean,
default: false
},
valueKey: {
type: String,
required: true
},
multiple: {
type: Boolean,
default: true
},
name: {
type: String,
default: ''
},
listUrl: {
type: String,
required: true,
default: ''
},
displayKey: {
type: String,
default: null
},
propColumns: {
type: Array,
default: () => []
},
// 查询条件文字
queryParamText: {
type: String,
default: null
},
},
data() {
return {
// 表头
columns: this.propColumns,
// 已选择列表
selectedTable: {
pagination: false,
scroll: { y: 240 },
columns: [
this.propColumns[0],
{ title: '操作', dataIndex: 'action', align: 'center', width: 60, scopedSlots: { customRender: 'action' }, }
],
dataSource: [],
},
url: { list: this.listUrl }
}
},
watch: {
value: {
immediate: true,
handler(val) {
this.valueWatchHandler(val)
}
},
dataSource: {
deep: true,
handler(val) {
let options = val.map(data => ({ label: data[this.displayKey || this.valueKey], value: data[this.valueKey] }))
this.$emit('ok', options)
this.valueWatchHandler(this.value)
}
},
selectionRows: {
immediate: true,
deep: true,
handler(val) {
this.selectedTable.dataSource = val
},
},
},
methods: {
/** 关闭弹窗 */
close() {
this.$emit('update:visible', false)
},
valueWatchHandler(val) {
let dataSource = []
let selectedRowKeys = []
val.forEach(item => {
this.dataSource.forEach(data => {
if (data[this.valueKey] === item) {
dataSource.push(data)
selectedRowKeys.push(data.id)
}
})
})
this.selectedTable.dataSource = dataSource
this.selectedRowKeys = selectedRowKeys
},
/** 完成选择 */
handleOk() {
let value = this.selectedTable.dataSource.map(data => data[this.valueKey])
this.$emit('input', value)
this.close()
},
/** 删除已选择的 */
handleDeleteSelected(record, index) {
this.selectedRowKeys.splice(this.selectedRowKeys.indexOf(record.id), 1)
this.selectedTable.dataSource.splice(index, 1)
},
customRowFn(record) {
if (!this.multiple) {
return {
on: {
click: () => {
this.selectedRowKeys = [record.id]
this.selectedTable.dataSource = [record]
}
}
}
}
return {}
},
}
}
</script>
<style lang="less" scoped>
</style>
\ No newline at end of file
# JSelectBizComponent
Jeecg 选择组件的公共可复用组件
## 引用方式
```js
import JSelectBizComponent from '@/src/components/jeecgbiz/JSelectBizComponent'
export default {
components: { JSelectBizComponent }
}
```
## 参数
### 配置参数
- `name`:`String` 显示名字,例如选择部门就填写'部门'
- `listUrl`:`String` 数据请求地址,必须是封装了分页的地址
- `displayKey`:`String` 显示在标签上的字段 key
- `returnKeys`:`Array` v-model 绑定的 keys,是个数组,默认使用第二项,当配置了 `returnId=true` 就返回第一项
- `returnId`:`Boolean` 返回ID,设为true后将返回配置的 `returnKeys` 中的第一项
- `selectButtonText`:`String` 选择按钮的文字
- `queryParamText`:`String` 查询条件显示文字
- `columns`:`Array` 列配置项,与a-table的列配置项相同,会将第一项配置成已选择的列表
\ No newline at end of file
<template>
<a-row class="j-select-biz-component-box" type="flex" :gutter="8">
<a-col class="left">
<a-select
mode="multiple"
:placeholder="placeholder"
v-model="selectValue"
:options="selectOptions"
allowClear
:disabled="disabled"
:open="false"
style="width: 100%;"
/>
</a-col>
<a-col class="right">
<a-button type="primary" icon="search" :disabled="disabled" @click="visible=true">{{selectButtonText}}</a-button>
</a-col>
<j-select-biz-component-modal
v-model="selectValue"
:name="name" :listUrl="listUrl" :returnKeys="returnKeys" :displayKey="displayKey"
:propColumns="columns" :queryParamText="queryParamText" :multiple="multiple"
:visible.sync="visible"
:valueKey="valueKey"
@ok="selectOptions=$event"
/>
</a-row>
</template>
<script>
import JSelectBizComponentModal from './JSelectBizComponentModal'
export default {
name: 'JSelectBizComponent',
components: { JSelectBizComponentModal },
props: {
value: {
type: String,
default: ''
},
/** 是否返回 id,默认 false,返回 code */
returnId: {
type: Boolean,
default: false
},
placeholder: {
type: String,
default: '请选择'
},
disabled: {
type: Boolean,
default: false
},
// 是否支持多选,默认 true
multiple: {
type: Boolean,
default: true
},
/* 可复用属性 */
// 被选择的名字,例如选择部门就填写'部门'
name: {
type: String,
default: ''
},
// list 接口地址
listUrl: {
type: String,
required: true,
default: ''
},
// 显示的 Key
displayKey: {
type: String,
default: null
},
// 返回的 key
returnKeys: {
type: Array,
default: () => ['id', 'id']
},
// 选择按钮文字
selectButtonText: {
type: String,
default: '选择'
},
// 查询条件文字
queryParamText: {
type: String,
default: null
},
// columns
columns: {
type: Array,
default: () => []
}
},
data() {
return {
selectValue: [],
selectOptions: [],
visible: false
}
},
computed: {
valueKey() {
return this.returnId ? this.returnKeys[0] : this.returnKeys[1]
}
},
watch: {
value: {
immediate: true,
handler(val) {
if (val) {
this.selectValue = val.split(',')
} else {
this.selectValue = []
}
}
},
selectValue: {
deep: true,
handler(val) {
const data = val.join(',')
this.$emit('input', data)
this.$emit('change', data)
}
}
},
methods: {}
}
</script>
<style lang="scss">
.j-select-biz-component-box {
.ant-select-search__field {
display: none !important;
}
}
</style>
<style lang="scss" scoped>
.j-select-biz-component-box {
$width: 82px;
.left {
width: calc(100% - #{$width} - 8px);
}
.right {
width: #{$width};
}
}
</style>
\ No newline at end of file
<template> <template>
<div style="width: 100%;"> <j-select-biz-component
<a-select :value="value"
mode="multiple"
placeholder="Please select"
:value="nameList"
style="width: calc(100% - 178px);">
</a-select>
<span style="display: inline-block;width:170px;float: right;overflow: hidden;">
<a-button type="primary" @click="handleSelect" icon="search" style="width: 81px">选择</a-button>
<a-button type="primary" @click="selectReset" icon="reload" style="margin-left: 8px;width: 81px">清空</a-button>
</span>
<!-- 选择多个用户支持排序 --> name="用户"
<j-select-multi-user-modal ref="selectModal" @selectFinished="selectOK"/> displayKey="realname"
</div>
:returnKeys="returnKeys"
:listUrl="url.list"
:columns="columns"
queryParamText="账号"
v-on="$listeners"
v-bind="$attrs"
/>
</template> </template>
<script> <script>
import JSelectMultiUserModal from './modal/JSelectMultiUserModal' import JSelectBizComponent from './JSelectBizComponent'
export default { export default {
name: 'JSelectMultiUser', name: 'JSelectMultiUser',
components:{ JSelectMultiUserModal }, components: { JSelectBizComponent },
props:{ props: ['value'],
value:{ data() {
type:String,
required:false
}
},
data(){
return { return {
selectList: [], returnKeys: ['id', 'username'],
} url: { list: '/sys/user/list' },
}, columns: [
computed: { { title: '姓名', align: 'center', width: 100, dataIndex: 'realname' },
nameList: function () { { title: '账号', align: 'center', width: 100, dataIndex: 'username' },
var names = []; { title: '电话', align: 'center', width: 100, dataIndex: 'phone' },
for (var a = 0; a < this.selectList.length; a++) { { title: '出生日期', align: 'center', width: 100, dataIndex: 'birthday' }
names.push(this.selectList[a].name); ]
}
let nameStr = ''
if(names.length>0){
nameStr = names.join(",")
}
this.$emit("change",nameStr)
return names;
}
},
model: {
prop: 'value',
event: 'change'
},
methods:{
handleSelect: function () {
this.$refs.selectModal.add();
},
selectReset() {
this.selectList = [];
},
selectOK: function (data) {
this.selectList = data;
} }
} }
} }
</script> </script>
<style lang="scss" scoped></style>
\ No newline at end of file
<template>
<j-select-biz-component v-bind="configs" v-on="$listeners"/>
</template>
<script>
import JSelectBizComponent from './JSelectBizComponent'
export default {
name: 'JSelectPosition',
components: { JSelectBizComponent },
props: ['value'],
data() {
return {
settings: {
name: '职务',
displayKey: 'name',
returnKeys: ['id', 'code'],
listUrl: '/sys/position/list',
queryParamText: '职务编码',
columns: [
{ title: '职务名称', dataIndex: 'name', align: 'center', width: 100 },
{ title: '职务编码', dataIndex: 'code', align: 'center', width: 100 },
{ title: '职级', dataIndex: 'rank_dictText', align: 'center', width: 100 }
]
}
}
},
computed: {
configs() {
return Object.assign({ value: this.value }, this.settings, this.$attrs)
}
}
}
</script>
<style lang="scss" scoped></style>
\ No newline at end of file
<template>
<j-select-biz-component
:value="value"
name="角色"
displayKey="roleName"
:returnKeys="returnKeys"
:listUrl="url.list"
:columns="columns"
queryParamText="角色编码"
v-on="$listeners"
v-bind="$attrs"
/>
</template>
<script>
import JSelectBizComponent from './JSelectBizComponent'
export default {
name: 'JSelectMultiUser',
components: { JSelectBizComponent },
props: ['value'],
data() {
return {
returnKeys: ['id', 'roleCode'],
url: { list: '/sys/role/list' },
columns: [
{ title: '角色名称', dataIndex: 'roleName', align: 'center', width: 120 },
{ title: '角色编码', dataIndex: 'roleCode', align: 'center', width: 120 }
]
}
}
}
</script>
<style lang="scss" scoped></style>
\ No newline at end of file
<template> <template>
<div> <div>
<a-input-search <a-input-search
v-model="selectedDepUsers" v-model="userNames"
placeholder="请先选择用户" placeholder="请先选择用户"
disabled disabled
@search="onSearchDepUser"> @search="onSearchDepUser">
<a-button slot="enterButton" :disabled="disabled">选择用户</a-button> <a-button slot="enterButton" :disabled="disabled">选择用户</a-button>
</a-input-search> </a-input-search>
<j-select-user-by-dep-modal <j-select-user-by-dep-modal ref="selectModal" :modal-width="modalWidth" :multi="multi" @ok="selectOK" :user-ids="value" @initComp="initComp"/>
ref="selectModal"
:modal-width="modalWidth"
@ok="onSearchDepUserCallBack" />
</div> </div>
</template> </template>
<script> <script>
import JSelectUserByDepModal from './modal/JSelectUserByDepModal' import JSelectUserByDepModal from './modal/JSelectUserByDepModal'
export default { export default {
name: 'JSelectUserByDep', name: 'JSelectUserByDep',
components: { JSelectUserByDepModal }, components: {JSelectUserByDepModal},
props:{ props: {
modalWidth:{ modalWidth: {
type:Number, type: Number,
default:1250, default: 1250,
required:false required: false
}, },
value:{ value: {
type:String, type: String,
required:false required: false
}, },
disabled:{ disabled: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false
} },
multi: {
type: Boolean,
default: true,
required: false
},
}, },
data() { data() {
return { return {
selectedDepUsers:"", userIds: "",
userNames: ""
} }
}, },
mounted(){ mounted() {
this.selectedDepUsers = this.value this.userIds = this.value
}, },
watch:{ watch: {
value(val){ value(val) {
this.selectedDepUsers = val this.userIds = val
} }
}, },
model: { model: {
...@@ -53,14 +57,27 @@ ...@@ -53,14 +57,27 @@
event: 'change' event: 'change'
}, },
methods: { methods: {
//通过组织机构筛选选择用户 initComp(userNames) {
this.userNames = userNames
},
onSearchDepUser() { onSearchDepUser() {
this.$refs.selectModal.showModal() this.$refs.selectModal.showModal()
this.onSearchDepUserCallBack('')
}, },
onSearchDepUserCallBack(selectedDepUsers) { selectOK(rows, idstr) {
this.selectedDepUsers = selectedDepUsers console.log("当前选中用户", rows)
this.$emit("change",selectedDepUsers) console.log("当前选中用户ID", idstr)
if (!rows) {
this.userNames = ''
this.userIds = ''
} else {
let temp = ''
for (let item of rows) {
temp += ',' + item.realname
}
this.userNames = temp.substring(1)
this.userIds = idstr
}
this.$emit("change", this.userIds)
} }
} }
} }
......
<template>
<a-modal
centered
:title="title"
:width="1000"
:visible="visible"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
<a-row :gutter="18">
<a-col :span="16">
<a-card title="选择人员" :bordered="true">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="24">
<a-col :span="10">
<a-form-item label="姓名">
<a-input placeholder="请输入姓名" v-model="queryParam.name"></a-input>
</a-form-item>
</a-col>
<a-col :span="8" >
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<div>
<a-table
size="small"
bordered
rowKey="id"
:columns="columns1"
:dataSource="dataSource1"
:pagination="ipagination"
:loading="loading"
:scroll="{ y: 240 }"
:rowSelection="{selectedRowKeys: selectedRowKeys,onSelectAll:onSelectAll,onSelect:onSelect,onChange: onSelectChange}"
@change="handleTableChange">
</a-table>
</div>
<!-- table区域-end -->
</a-card>
</a-col>
<a-col :span="8">
<a-card title="用户选择" :bordered="true">
<!-- table区域-begin -->
<div>
<a-table
size="small"
bordered
rowKey="id"
:columns="columns2"
:dataSource="dataSource2"
:loading="loading"
:scroll="{ y: 240 }"
>
<span slot="action" slot-scope="text, record">
<a-button type="primary" size="small" @click="handleDelete(record)" icon="delete">删除</a-button>
</span>
</a-table>
</div>
<!-- table区域-end -->
</a-card>
</a-col>
</a-row>
</a-modal>
</template>
<script>
import { filterObj } from '@/utils/util'
import { getAction } from '@/api/manage'
export default {
name: 'JSelectMultiUserModal',
data () {
return {
title: "用户列表",
names: [],
visible: false,
placement: 'right',
description: '人员管理页面',
// 查询条件
queryParam: {},
// 表头
columns1: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:50,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title: '姓名',
align:"center",
width:113,
dataIndex: 'name'
},
{
title: '年龄',
align:"center",
width:100,
dataIndex: 'age'
},
{
title: '出生日期',
align:"center",
width:100,
dataIndex: 'birthday'
}
],
columns2: [
{
title: '用户账号',
align:"center",
width:100,
dataIndex: 'name'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
width:100,
scopedSlots: { customRender: 'action' },
}
],
//数据集
dataSource1:[],
dataSource2:[],
// 分页参数
ipagination:{
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
return range[0] + "-" + range[1] + " 共" + total + "条"
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
isorter:{
column: 'createTime',
order: 'desc',
},
loading:false,
selectedRowKeys: [],
selectedRows: [],
url: {
list: "/test/jeecgDemo/list",
},
}
},
created() {
this.loadData();
},
methods: {
searchQuery(){
this.loadData(1);
},
searchReset(){
this.queryParam={};
this.loadData(1);
},
handleCancel() {
this.visible = false;
},
handleOk() {
this.$emit("selectFinished",this.dataSource2);
this.visible = false;
},
add() {
this.visible = true;
},
loadData (arg){
//加载数据 若传入参数1则加载第一页的内容
if(arg===1){
this.ipagination.current = 1;
}
var params = this.getQueryParams();//查询条件
getAction(this.url.list,params).then((res)=>{
if(res.success){
this.dataSource1 = res.result.records;
this.ipagination.total = res.result.total;
}
})
},
getQueryParams(){
var param = Object.assign({}, this.queryParam,this.isorter);
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
return filterObj(param);
},
getQueryField(){
//TODO 字段权限控制
},
onSelectAll (selected, selectedRows, changeRows) {
if(selected===true){
for(var a = 0;a<changeRows.length;a++){
this.dataSource2.push(changeRows[a]);
}
}else{
for(var b = 0;b<changeRows.length;b++){
this.dataSource2.splice(this.dataSource2.indexOf(changeRows[b]),1);
}
}
// console.log(selected, selectedRows, changeRows);
},
onSelect (record,selected) {
if(selected===true){
this.dataSource2.push(record);
}else{
var index = this.dataSource2.indexOf(record);
//console.log();
if(index >=0 ){
this.dataSource2.splice(this.dataSource2.indexOf(record),1);
}
}
},
onSelectChange (selectedRowKeys,selectedRows) {
this.selectedRowKeys = selectedRowKeys;
this.selectionRows = selectedRows;
},
onClearSelected(){
this.selectedRowKeys = [];
this.selectionRows = [];
},
handleDelete: function(record){
this.dataSource2.splice(this.dataSource2.indexOf(record),1);
},
handleTableChange(pagination, filters, sorter){
//分页、排序、筛选变化时触发
console.log(sorter);
//TODO 筛选
if (Object.keys(sorter).length>0){
this.isorter.column = sorter.field;
this.isorter.order = "ascend"==sorter.order?"asc":"desc"
}
this.ipagination = pagination;
this.loadData();
}
}
}
</script>
<style lang="less" scoped>
.ant-card-body .table-operator{
margin-bottom: 18px;
}
.ant-table-tbody .ant-table-row td{
padding-top:15px;
padding-bottom:15px;
}
.anty-row-operator button{margin: 0 5px}
.ant-btn-danger{background-color: #ffffff}
.ant-modal-cust-warp{height: 100%}
.ant-modal-cust-warp .ant-modal-body{height:calc(100% - 110px) !important;overflow-y: auto}
.ant-modal-cust-warp .ant-modal-content{height:90% !important;overflow-y: hidden}
</style>
\ No newline at end of file
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
<!--组织机构--> <!--组织机构-->
<a-directory-tree <a-directory-tree
selectable selectable
:selectedKeys="selectedKeys" :selectedKeys="selectedDepIds"
:checkStrictly="true" :checkStrictly="true"
@select="this.onSelect" @select="onDepSelect"
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
:treeData="departTree" :treeData="departTree"
/> />
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type: getType}"
@change="handleTableChange"> @change="handleTableChange">
</a-table> </a-table>
</a-card> </a-card>
...@@ -52,16 +52,17 @@ ...@@ -52,16 +52,17 @@
</template> </template>
<script> <script>
import { filterObj } from '@/utils/util' import {filterObj} from '@/utils/util'
import { queryDepartTreeList, getUserList, queryUserByDepId, queryUserRoleMap } from '@/api/api' import {queryDepartTreeList, getUserList, queryUserByDepId} from '@/api/api'
export default { export default {
name: 'JSelectUserByDepModal', name: 'JSelectUserByDepModal',
components: {}, components: {},
props:['modalWidth'], props: ['modalWidth', 'multi', 'userIds'],
data() { data() {
return { return {
queryParam: { queryParam: {
username:"", username: "",
}, },
columns: [ columns: [
{ {
...@@ -83,7 +84,7 @@ ...@@ -83,7 +84,7 @@
title: '性别', title: '性别',
align: 'center', align: 'center',
dataIndex: 'sex', dataIndex: 'sex',
customRender: function(text) { customRender: function (text) {
if (text === 1) { if (text === 1) {
return '男' return '男'
} else if (text === 2) { } else if (text === 2) {
...@@ -106,10 +107,9 @@ ...@@ -106,10 +107,9 @@
], ],
scrollTrigger: {}, scrollTrigger: {},
dataSource: [], dataSource: [],
selectedKeys: [], selectedRowKeys: [],
userNameArr: [], selectUserRows: [],
departName: '', selectUserIds: [],
userRolesMap: {},
title: '根据部门选择用户', title: '根据部门选择用户',
ipagination: { ipagination: {
current: 1, current: 1,
...@@ -126,53 +126,73 @@ ...@@ -126,53 +126,73 @@
column: 'createTime', column: 'createTime',
order: 'desc' order: 'desc'
}, },
selectedRowKeys: [], selectedDepIds: [],
selectedRows: [],
departTree: [], departTree: [],
visible: false, visible: false,
form: this.$form.createForm(this) form: this.$form.createForm(this)
} }
}, },
computed: {
// 计算属性的 getter
getType: function () {
console.log("multi: ", this.multi);
return this.multi == true ? 'checkbox' : 'radio';
}
},
watch: {
userIds() {
this.initUserNames()
}
},
created() { created() {
// 该方法触发屏幕自适应 // 该方法触发屏幕自适应
this.resetScreenSize(); this.resetScreenSize();
this.queryUserRoleMap(); this.loadData().then((res) => {
this.initUserNames();
})
}, },
methods: { methods: {
loadData(arg) { initUserNames() {
let names = ''
console.log("props userIds: ", this.userIds)
if (this.userIds) {
let currUserIds = this.userIds
for (let item of this.dataSource) {
if (currUserIds.indexOf(item.username) >= 0) {
names += "," + item.realname
}
}
if (names) {
names = names.substring(1)
}
this.$emit("initComp", names)
}
},
async loadData(arg) {
if (arg === 1) { if (arg === 1) {
this.ipagination.current = 1; this.ipagination.current = 1;
} }
let params = this.getQueryParams();//查询条件 let params = this.getQueryParams();//查询条件
getUserList(params).then((res) => { await getUserList(params).then((res) => {
if (res.success) { if (res.success) {
this.dataSource = res.result.records; this.dataSource = res.result.records;
this.assignRoleName(this.dataSource);
this.ipagination.total = res.result.total; this.ipagination.total = res.result.total;
} }
}) })
}, },
queryUserRoleMap(){
queryUserRoleMap().then((res) => {
if (res.success) {
this.userRolesMap = res.result;
this.loadData();
}
})
},
// 触发屏幕自适应 // 触发屏幕自适应
resetScreenSize() { resetScreenSize() {
let screenWidth = document.body.clientWidth; let screenWidth = document.body.clientWidth;
if (screenWidth < 500) { if (screenWidth < 500) {
this.scrollTrigger = { x: 800 }; this.scrollTrigger = {x: 800};
} else { } else {
this.scrollTrigger = {}; this.scrollTrigger = {};
} }
}, },
showModal() { showModal() {
this.visible = true; this.visible = true;
this.assignRoleName(this.dataSource);
this.queryDepartTree(); this.queryDepartTree();
this.loadData();
this.form.resetFields(); this.form.resetFields();
}, },
getQueryParams() { getQueryParams() {
...@@ -191,13 +211,13 @@ ...@@ -191,13 +211,13 @@
}, },
searchReset(num) { searchReset(num) {
let that = this; let that = this;
if(num !== 0){ if (num !== 0) {
that.queryParam = {}; that.queryParam = {};
that.loadData(1); that.loadData(1);
} }
that.selectedRowKeys = []; that.selectedRowKeys = [];
that.userNameArr = []; that.selectUserIds = [];
that.selectedKeys = []; that.selectedDepIds = [];
}, },
close() { close() {
this.searchReset(0); this.searchReset(0);
...@@ -214,27 +234,31 @@ ...@@ -214,27 +234,31 @@
}, },
handleSubmit() { handleSubmit() {
let that = this; let that = this;
for (let i = 0, len = this.selectedRowKeys.length; i < len; i++) { this.getSelectUserRows();
this.getUserNames(this.selectedRowKeys[i]); console.log(that.selectUserRows)
} that.$emit('ok', that.selectUserRows, that.selectUserIds);
that.$emit('ok', that.userNameArr.join(',')); that.searchReset(0)
that.close(); that.close();
}, },
// 遍历匹配,获取用户真实姓名 //获取选择用户信息
getUserNames(rowId) { getSelectUserRows(rowId) {
let dataSource = this.dataSource; let dataSource = this.dataSource;
let userIds = "";
this.selectUserRows = [];
for (let i = 0, len = dataSource.length; i < len; i++) { for (let i = 0, len = dataSource.length; i < len; i++) {
if (rowId === dataSource[i].id) { if (this.selectedRowKeys.includes(dataSource[i].id)) {
this.userNameArr.push(dataSource[i].realname); this.selectUserRows.push(dataSource[i]);
userIds = userIds + "," + dataSource[i].username
} }
} }
this.selectUserIds = userIds.substring(1);
}, },
// 点击树节点,筛选出对应的用户 // 点击树节点,筛选出对应的用户
onSelect(selectedKeys) { onDepSelect(selectedDepIds) {
if (selectedKeys[0] != null) { if (selectedDepIds[0] != null) {
this.queryUserByDepId(selectedKeys); // 调用方法根据选选择的id查询用户信息 this.initQueryUserByDepId(selectedDepIds); // 调用方法根据选选择的id查询用户信息
if (this.selectedKeys[0] !== selectedKeys[0]) { if (this.selectedDepIds[0] !== selectedDepIds[0]) {
this.selectedKeys = [selectedKeys[0]]; this.selectedDepIds = [selectedDepIds[0]];
} }
} }
}, },
...@@ -246,26 +270,14 @@ ...@@ -246,26 +270,14 @@
this.loadData(1); this.loadData(1);
}, },
// 根据选择的id来查询用户信息 // 根据选择的id来查询用户信息
queryUserByDepId(selectedKeys) { initQueryUserByDepId(selectedDepIds) {
queryUserByDepId({ id: selectedKeys.toString() }).then((res) => { queryUserByDepId({id: selectedDepIds.toString()}).then((res) => {
if (res.success) { if (res.success) {
this.dataSource = res.result; this.dataSource = res.result;
this.ipagination.total = res.result.length; this.ipagination.total = res.result.length;
this.assignRoleName(this.dataSource);
} }
}) })
}, },
// 传入用户id,找到匹配的角色名称
queryUserRole(userId) {
let map = this.userRolesMap;
let roleName = [];
for (var key in map) {
if (userId === key) {
roleName.push(map[key]);
}
}
return roleName.join(',');
},
queryDepartTree() { queryDepartTree() {
queryDepartTreeList().then((res) => { queryDepartTreeList().then((res) => {
if (res.success) { if (res.success) {
...@@ -273,16 +285,6 @@ ...@@ -273,16 +285,6 @@
} }
}) })
}, },
// 为角色名称赋值
assignRoleName(data) {
let userId = '';
let role = '';
for (let i = 0, length = data.length; i < length; i++) {
userId = this.dataSource[i].id;
role = this.queryUserRole(userId);
this.dataSource[i].roleName = role;
}
},
modalFormOk() { modalFormOk() {
this.loadData(); this.loadData();
} }
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
export default { export default {
name: "IframePageContent", name: "IframePageContent",
inject:['closeCurrent'],
data () { data () {
return { return {
url: "", url: "",
...@@ -36,7 +37,13 @@ ...@@ -36,7 +37,13 @@
console.log("------url------"+url) console.log("------url------"+url)
if (url !== null && url !== undefined) { if (url !== null && url !== undefined) {
this.url = url; this.url = url;
//window.open(this.url); /*update_begin author:wuxianquan date:20190908 for:判断打开方式,新窗口打开时this.$route.meta.internalOrExternal==true */
if(this.$route.meta.internalOrExternal != undefined && this.$route.meta.internalOrExternal==true){
this.closeCurrent();
window.open(this.url);
}
/*update_end author:wuxianquan date:20190908 for:判断打开方式,新窗口打开时this.$route.meta.internalOrExternal==true */
} }
} }
} }
......
<template> <template>
<global-layout @dynamicRouterShow="dynamicRouterShow"> <global-layout @dynamicRouterShow="dynamicRouterShow">
<contextmenu :itemList="menuItemList" :visible.sync="menuVisible" @select="onMenuSelect"/> <!-- update-begin- author:sunjianlei --- date:20191009 --- for: 提升右键菜单的层级 -->
<contextmenu :itemList="menuItemList" :visible.sync="menuVisible" style="z-index: 9999;" @select="onMenuSelect"/>
<!-- update-end- author:sunjianlei --- date:20191009 --- for: 提升右键菜单的层级 -->
<a-tabs <a-tabs
@contextmenu.native="e => onContextmenu(e)" @contextmenu.native="e => onContextmenu(e)"
v-if="multipage" v-if="multipage"
...@@ -10,6 +12,7 @@ ...@@ -10,6 +12,7 @@
:hide-add="true" :hide-add="true"
type="editable-card" type="editable-card"
@change="changePage" @change="changePage"
@tabClick="tabCallBack"
@edit="editPage"> @edit="editPage">
<a-tab-pane :id="page.fullPath" :key="page.fullPath" v-for="page in pageList"> <a-tab-pane :id="page.fullPath" :key="page.fullPath" v-for="page in pageList">
<span slot="tab" :pagekey="page.fullPath">{{ page.meta.title }}</span> <span slot="tab" :pagekey="page.fullPath">{{ page.meta.title }}</span>
...@@ -18,9 +21,11 @@ ...@@ -18,9 +21,11 @@
<div style="margin: 12px 12px 0;"> <div style="margin: 12px 12px 0;">
<transition name="page-toggle"> <transition name="page-toggle">
<keep-alive v-if="multipage"> <keep-alive v-if="multipage">
<router-view/> <router-view v-if="reloadFlag"/>
</keep-alive> </keep-alive>
<router-view v-else/> <template v-else>
<router-view v-if="reloadFlag"/>
</template>
</transition> </transition>
</div> </div>
</global-layout> </global-layout>
...@@ -30,6 +35,7 @@ ...@@ -30,6 +35,7 @@
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'
const indexKey = '/dashboard/analysis' const indexKey = '/dashboard/analysis'
...@@ -47,12 +53,21 @@ ...@@ -47,12 +53,21 @@
activePage: '', activePage: '',
menuVisible: false, menuVisible: false,
menuItemList: [ menuItemList: [
{ key: '4', icon: 'reload', text: '刷 新' },
{ key: '1', icon: 'arrow-left', text: '关闭左侧' }, { key: '1', icon: 'arrow-left', text: '关闭左侧' },
{ key: '2', icon: 'arrow-right', text: '关闭右侧' }, { key: '2', icon: 'arrow-right', text: '关闭右侧' },
{ key: '3', icon: 'close', text: '关闭其它' } { key: '3', icon: 'close', text: '关闭其它' }
] ],
reloadFlag:true
} }
}, },
/* update_begin author:wuxianquan date:20190828 for: 关闭当前tab页,供子页面调用 ->望菜单能配置外链,直接弹出新页面而不是嵌入iframe #428 */
provide(){
return{
closeCurrent:this.closeCurrent
}
},
/* update_end author:wuxianquan date:20190828 for: 关闭当前tab页,供子页面调用->望菜单能配置外链,直接弹出新页面而不是嵌入iframe #428 */
computed: { computed: {
multipage() { multipage() {
//判断如果是手机模式,自动切换为单页面模式 //判断如果是手机模式,自动切换为单页面模式
...@@ -101,16 +116,23 @@ ...@@ -101,16 +116,23 @@
this.$router.push(Object.assign({},waitRouter)); this.$router.push(Object.assign({},waitRouter));
}, },
'multipage': function(newVal) { 'multipage': function(newVal) {
if(this.reloadFlag){
if (!newVal) { if (!newVal) {
this.linkList = [this.$route.fullPath] this.linkList = [this.$route.fullPath]
this.pageList = [this.$route] this.pageList = [this.$route]
} }
} }
}
}, },
methods: { methods: {
changePage(key) { changePage(key) {
this.activePage = key this.activePage = key
}, },
tabCallBack() {
this.$nextTick(() => {
triggerWindowResizeEvent()
})
},
editPage(key, action) { editPage(key, action) {
this[action](key) this[action](key)
}, },
...@@ -157,13 +179,21 @@ ...@@ -157,13 +179,21 @@
case '3': case '3':
this.closeOthers(pageKey) this.closeOthers(pageKey)
break break
case '4':
this.routeReload()
break
default: default:
break break
} }
}, },
/* update_begin author:wuxianquan date:20190828 for: 关闭当前tab页,供子页面调用->望菜单能配置外链,直接弹出新页面而不是嵌入iframe #428 */
closeCurrent(){
this.remove(this.activePage);
},
/* update_end author:wuxianquan date:20190828 for: 关闭当前tab页,供子页面调用->望菜单能配置外链,直接弹出新页面而不是嵌入iframe #428 */
closeOthers(pageKey) { closeOthers(pageKey) {
let index = this.linkList.indexOf(pageKey) let index = this.linkList.indexOf(pageKey)
if (pageKey == indexKey) { if (pageKey == indexKey || pageKey.indexOf('?ticke=')>=0) {
this.linkList = this.linkList.slice(index, index + 1) this.linkList = this.linkList.slice(index, index + 1)
this.pageList = this.pageList.slice(index, index + 1) this.pageList = this.pageList.slice(index, index + 1)
this.activePage = this.linkList[0] this.activePage = this.linkList[0]
...@@ -171,7 +201,7 @@ ...@@ -171,7 +201,7 @@
let indexContent = this.pageList.slice(0, 1)[0] let indexContent = this.pageList.slice(0, 1)[0]
this.linkList = this.linkList.slice(index, index + 1) this.linkList = this.linkList.slice(index, index + 1)
this.pageList = this.pageList.slice(index, index + 1) this.pageList = this.pageList.slice(index, index + 1)
this.linkList.unshift(indexKey) this.linkList.unshift(indexContent.fullPath)
this.pageList.unshift(indexContent) this.pageList.unshift(indexContent)
this.activePage = this.linkList[1] this.activePage = this.linkList[1]
} }
...@@ -185,7 +215,7 @@ ...@@ -185,7 +215,7 @@
let index = this.linkList.indexOf(pageKey) let index = this.linkList.indexOf(pageKey)
this.linkList = this.linkList.slice(index) this.linkList = this.linkList.slice(index)
this.pageList = this.pageList.slice(index) this.pageList = this.pageList.slice(index)
this.linkList.unshift(indexKey) this.linkList.unshift(indexContent.fullPath)
this.pageList.unshift(indexContent) this.pageList.unshift(indexContent)
if (this.linkList.indexOf(this.activePage) < 0) { if (this.linkList.indexOf(this.activePage) < 0) {
this.activePage = this.linkList[0] this.activePage = this.linkList[0]
...@@ -207,8 +237,20 @@ ...@@ -207,8 +237,20 @@
let meta = Object.assign({},currRouter.meta,{title:title}) let meta = Object.assign({},currRouter.meta,{title:title})
this.pageList.splice(keyIndex, 1, Object.assign({},currRouter,{meta:meta})) this.pageList.splice(keyIndex, 1, Object.assign({},currRouter,{meta:meta}))
} }
} },
//update-end-author:taoyan date:20190430 for:动态路由title显示配置的菜单title而不是其对应路由的title //update-end-author:taoyan date:20190430 for:动态路由title显示配置的菜单title而不是其对应路由的title
//update-begin-author:taoyan date:20191008 for:路由刷新
routeReload(){
this.reloadFlag = false
let ToggleMultipage = "ToggleMultipage"
this.$store.dispatch(ToggleMultipage,false)
this.$nextTick(()=>{
this.$store.dispatch(ToggleMultipage,true)
this.reloadFlag = true
})
}
//update-end-author:taoyan date:20191008 for:路由刷新
} }
} }
</script> </script>
......
...@@ -74,7 +74,9 @@ ...@@ -74,7 +74,9 @@
</a-layout-footer> </a-layout-footer>
</a-layout> </a-layout>
<setting-drawer></setting-drawer> <!-- update-start---- author:os_chengtgen -- date:20190830 -- for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ---- -->
<!--<setting-drawer></setting-drawer>-->
<!-- update-end---- author:os_chengtgen -- date:20190830 -- for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ---- -->
</a-layout> </a-layout>
</template> </template>
...@@ -82,7 +84,11 @@ ...@@ -82,7 +84,11 @@
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 SettingDrawer from '@/components/setting/SettingDrawer' // update-start---- author:os_chengtgen -- date:20190830 -- for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ------
// import SettingDrawer from '@/components/setting/SettingDrawer'
// 注释这个因为在个人设置模块已经加载了SettingDrawer页面
// update-end ---- author:os_chengtgen -- date:20190830 -- for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ------
import { triggerWindowResizeEvent } from '@/utils/util' import { triggerWindowResizeEvent } from '@/utils/util'
import { mapState, mapActions } from 'vuex' import { mapState, mapActions } from 'vuex'
import { mixin, mixinDevice } from '@/utils/mixin.js' import { mixin, mixinDevice } from '@/utils/mixin.js'
...@@ -93,7 +99,11 @@ ...@@ -93,7 +99,11 @@
SideMenu, SideMenu,
GlobalHeader, GlobalHeader,
GlobalFooter, GlobalFooter,
SettingDrawer // update-start---- author:os_chengtgen -- date:20190830 -- for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ------
// // SettingDrawer
// 注释这个因为在个人设置模块已经加载了SettingDrawer页面
// update-end ---- author:os_chengtgen -- date:20190830 -- for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ------
}, },
mixins: [mixin, mixinDevice], mixins: [mixin, mixinDevice],
data() { data() {
......
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
import ShowAnnouncement from './ShowAnnouncement' import ShowAnnouncement from './ShowAnnouncement'
import store from '@/store/' import store from '@/store/'
export default { export default {
name: "HeaderNotice", name: "HeaderNotice",
components: { components: {
...@@ -96,11 +97,14 @@ ...@@ -96,11 +97,14 @@
hovered: false, hovered: false,
announcement1:[], announcement1:[],
announcement2:[], announcement2:[],
msg1Count:"3", msg1Count:"0",
msg2Count:"0", msg2Count:"0",
msg1Title:"通知(3)", msg1Title:"通知(0)",
msg2Title:"", msg2Title:"",
stopTimer:false, stopTimer:false,
websock: null,
lockReconnect:false,
heartCheck:null,
} }
}, },
computed:{ computed:{
...@@ -112,6 +116,7 @@ ...@@ -112,6 +116,7 @@
this.loadData(); this.loadData();
//this.timerFun(); //this.timerFun();
this.initWebSocket(); this.initWebSocket();
this.heartCheckFun();
}, },
destroyed: function () { // 离开页面生命周期函数 destroyed: function () { // 离开页面生命周期函数
this.websocketclose(); this.websocketclose();
...@@ -195,26 +200,38 @@ ...@@ -195,26 +200,38 @@
}, },
websocketonopen: function () { websocketonopen: function () {
console.log("WebSocket连接成功"); console.log("WebSocket连接成功");
//心跳检测重置
this.heartCheck.reset().start();
}, },
websocketonerror: function (e) { websocketonerror: function (e) {
console.log("WebSocket连接发生错误"); console.log("WebSocket连接发生错误");
this.reconnect();
}, },
websocketonmessage: function (e) { websocketonmessage: function (e) {
console.log("-----接收消息-------",e.data); //console.log("-----接收消息-------",e.data);
var data = eval("(" + e.data + ")"); //解析对象 var data = eval("(" + e.data + ")"); //解析对象
this.loadData(); if(data.cmd == "topic"){
//if(data.cmd == "topic"){
//系统通知 //系统通知
this.openNotification(data); this.loadData();
//}else if(data.cmd == "user"){ }else if(data.cmd == "user"){
//用户消息 //用户消息
// this.openNotification(data); this.loadData();
//} }
//心跳检测重置
this.heartCheck.reset().start();
}, },
websocketsend(text) { // 数据发送
try {
this.websock.send(text);
} catch (err) {
console.log("send failed (" + err.code + ")");
}
},
websocketclose: function (e) { websocketclose: function (e) {
console.log("connection closed (" + e.code + ")"); console.log("connection closed (" + e.code + ")");
this.reconnect();
}, },
openNotification (data) { openNotification (data) {
...@@ -239,6 +256,45 @@ ...@@ -239,6 +256,45 @@
}); });
}, },
reconnect() {
var that = this;
if(that.lockReconnect) return;
that.lockReconnect = true;
//没连接上会一直重连,设置延迟避免请求过多
setTimeout(function () {
console.info("尝试重连...");
that.initWebSocket();
that.lockReconnect = false;
}, 5000);
},
heartCheckFun(){
var that = this;
//心跳检测,每20s心跳一次
that.heartCheck = {
timeout: 20000,
timeoutObj: null,
serverTimeoutObj: null,
reset: function(){
clearTimeout(this.timeoutObj);
//clearTimeout(this.serverTimeoutObj);
return this;
},
start: function(){
var self = this;
this.timeoutObj = setTimeout(function(){
//这里发送一个心跳,后端收到后,返回一个心跳消息,
//onmessage拿到返回的心跳就说明连接正常
that.websocketsend("HeartBeat");
console.info("客户端发送心跳");
//self.serverTimeoutObj = setTimeout(function(){//如果超过一定时间还没重置,说明后端主动断开了
// that.websock.close();//如果onclose会执行reconnect,我们执行ws.close()就行了.如果直接执行reconnect 会触发onclose导致重连两次
//}, self.timeout)
}, this.timeout)
}
}
},
showDetail(key,data){ showDetail(key,data){
this.$notification.close(key); this.$notification.close(key);
var id = data.msgId; var id = data.msgId;
......
...@@ -40,13 +40,14 @@ const updateTheme = primaryColor => { ...@@ -40,13 +40,14 @@ const updateTheme = primaryColor => {
return; return;
} }
const hideMessage = message.loading('正在编译主题!', 0); const hideMessage = message.loading('正在编译主题!', 0);
console.info(`正在编译主题!`)
function buildIt() { function buildIt() {
if (!window.less) { // 正确的判定less是否已经加载less.modifyVars可用
if (!window.less || !window.less.modifyVars) {
return; return;
} }
setTimeout(() => { // less.modifyVars可用
window.less window.less.modifyVars({
.modifyVars({
'@primary-color': primaryColor, '@primary-color': primaryColor,
}) })
.then(() => { .then(() => {
...@@ -56,7 +57,6 @@ const updateTheme = primaryColor => { ...@@ -56,7 +57,6 @@ const updateTheme = primaryColor => {
message.error('Failed to update theme'); message.error('Failed to update theme');
hideMessage(); hideMessage();
}); });
}, 200);
} }
if (!lessNodesAppended) { if (!lessNodesAppended) {
// insert less.js and color.less // insert less.js and color.less
......
...@@ -323,6 +323,30 @@ export const constantRouterMap = [ ...@@ -323,6 +323,30 @@ export const constantRouterMap = [
] ]
}, },
// {
// path: '/',
// name: 'index',
// component: TabLayout,
// meta: {title: '首页'},
// redirect: '/dashboard/workplace',
// children: [
// {
// path: '/online',
// name: 'online',
// redirect: '/online',
// component: RouteView,
// meta: {title: '在线开发', icon: 'dashboard', permission: ['dashboard']},
// children: [
// {
// path: '/online/auto/:code',
// name: 'report',
// component: () => import('@/views/modules/online/cgreport/OnlCgreportAutoList')
// },
// ]
// },
// ]
// },
{ {
path: '/test', path: '/test',
component: BlankLayout, component: BlankLayout,
......
...@@ -18,9 +18,8 @@ import VueApexCharts from 'vue-apexcharts' ...@@ -18,9 +18,8 @@ import VueApexCharts from 'vue-apexcharts'
import preview from 'vue-photo-preview' import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css' import 'vue-photo-preview/dist/skin.css'
import "@jeecg/antd-onine" import "@jeecg/antd-online"
import '@jeecg/antd-onine/dist/OnlineForm.css' import '@jeecg/antd-online/dist/OnlineForm.css'
import { import {
ACCESS_TOKEN, ACCESS_TOKEN,
......
...@@ -10,9 +10,6 @@ export const DisabledAuthFilterMixin = { ...@@ -10,9 +10,6 @@ export const DisabledAuthFilterMixin = {
} }
}, },
created() {
},
methods:{ methods:{
isDisabledAuth(code){ isDisabledAuth(code){
return disabledAuthFilter(code,this.formData); return disabledAuthFilter(code,this.formData);
......
...@@ -250,9 +250,24 @@ export const JeecgListMixin = { ...@@ -250,9 +250,24 @@ export const JeecgListMixin = {
console.log(info.file, info.fileList); console.log(info.file, info.fileList);
} }
if (info.file.status === 'done') { if (info.file.status === 'done') {
if(info.file.response.success){ if (info.file.response.success) {
this.$message.success(`${info.file.name} 文件上传成功`); // this.$message.success(`${info.file.name} 文件上传成功`);
this.loadData(); if (info.file.response.code === 201) {
let { message, result: { msg, fileUrl, fileName } } = info.file.response
let href = window._CONFIG['domianURL'] + fileUrl
this.$warning({
title: message,
content: (
<div>
<span>{msg}</span><br/>
<span>具体详情请 <a href={href} target="_blank" download={fileName}>点击下载</a> </span>
</div>
)
})
} else {
this.$message.success(info.file.response.message || `${info.file.name} 文件上传成功`)
}
this.loadData()
} else { } else {
this.$message.error(`${info.file.name} ${info.file.response.message}.`); this.$message.error(`${info.file.name} ${info.file.response.message}.`);
} }
......
...@@ -7,6 +7,14 @@ const FormTypes = { ...@@ -7,6 +7,14 @@ const FormTypes = {
date: 'date', date: 'date',
datetime: 'datetime', datetime: 'datetime',
upload: 'upload', upload: 'upload',
file: 'file',
image: 'image',
popup:'popup',
list_multi:"list_multi",
sel_search:"sel_search",
radio:'radio',
checkbox_meta:"checkbox_meta",
slot: 'slot', slot: 'slot',
hidden: 'hidden' hidden: 'hidden'
} }
......
/**
* LunarFullCalendar 公共 js
*
* @version 1.0.0
* @author sunjianlei
*
* */
import { getRefPromise } from '@/utils/JEditableTableUtil'
/* 日历的视图类型 */
const calendarViewType = {
month: 'month', // 月视图
basicWeek: 'basicWeek', // 基础周视图
basicDay: 'basicDay',// 基础天视图
agendaWeek: 'agendaWeek', // 议程周视图
agendaDay: 'agendaDay', // 议程天视图
}
/* 定义默认视图 */
const defaultView = calendarViewType.month
/* 定义日历默认配置 */
const defaultSettings = {
locale: 'zh-cn',
// 按钮文字
buttonText: {
today: '今天',
month: '月',
week: '周',
day: '日'
},
// 头部排列方式
header: {
left: 'prev,next, today',
center: 'title',
right: 'hide, custom, month,agendaWeek,agendaDay'
},
//点击今天日列表图
eventLimitClick: 'day',
// 隐藏超出的事件
eventLimit: true,
// 设置每周开始日期为周日
firstDay: 0,
// 默认显示视图
defaultView,
timeFormat: 'H:mm',
axisFormat: 'H:mm',
// agenda视图下是否显示all-day
allDaySlot: true,
// agenda视图下all-day的显示文本
allDayText: '全天',
// 时区默认本地的
timezone: 'local',
// 周视图和日视同的左侧时间显示
slotLabelFormat: 'HH:mm',
// 设置第二天阈值
nextDayThreshold: '00:00:00',
}
/** 提供了一些增强方法 */
const CalendarMixins = {
data() {
return {
calenderCurrentViewType: defaultView
}
},
methods: {
getCalendarConfigEventHandler() {
return {
// 处理 view changed 事件
viewRender: (view, element) => {
let { type } = view
let lastViewType = this.calenderCurrentViewType
this.calenderCurrentViewType = type
if (typeof this.handleViewRender === 'function') {
this.handleViewRender(type, view, element)
}
if (lastViewType !== this.calenderCurrentViewType && typeof this.handleViewChanged === 'function') {
this.handleViewChanged(type, view, element)
}
},
}
},
/** 获取 LunarFullCalendar 实例,ref = baseCalendar */
getCalendar(fn) {
return getRefPromise(this, 'baseCalendar').then(fn)
},
calendarEmit(name, data) {
this.getCalendar(ref => ref.$emit(name, data))
},
/** 强制重新加载所有的事件(日程)*/
calendarReloadEvents() {
this.calendarEmit('reload-events')
}
}
}
export { defaultSettings, calendarViewType, CalendarMixins }
\ No newline at end of file
...@@ -8,7 +8,7 @@ import { ACCESS_TOKEN } from "@/store/mutation-types" ...@@ -8,7 +8,7 @@ import { ACCESS_TOKEN } from "@/store/mutation-types"
// 创建 axios 实例 // 创建 axios 实例
const service = axios.create({ const service = axios.create({
baseURL: '/jeecg-boot', // api base_url baseURL: '/jeecg-boot', // api base_url
timeout: 6000 // 请求超时时间 timeout: 15000 // 请求超时时间
}) })
const err = (error) => { const err = (error) => {
......
...@@ -125,7 +125,10 @@ function generateChildRouters (data) { ...@@ -125,7 +125,10 @@ function generateChildRouters (data) {
icon: item.meta.icon, icon: item.meta.icon,
url:item.meta.url , url:item.meta.url ,
permissionList:item.meta.permissionList, permissionList:item.meta.permissionList,
keepAlive:item.meta.keepAlive keepAlive:item.meta.keepAlive,
/*update_begin author:wuxianquan date:20190908 for:赋值 */
internalOrExternal:item.meta.internalOrExternal
/*update_end author:wuxianquan date:20190908 for:赋值 */
} }
} }
if(item.alwaysShow){ if(item.alwaysShow){
......
...@@ -3,29 +3,39 @@ ...@@ -3,29 +3,39 @@
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline"> <a-form layout="inline" @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-item label="用户名">
<a-input placeholder="请输入名称查询" v-model="queryParam.name"></a-input> <j-input placeholder="请输入名称模糊查询" v-model="queryParam.name"></j-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="年龄"> <a-form-item label="年龄">
<a-input placeholder="请输入名称查询" v-model="queryParam.age"></a-input> <!-- <a-input placeholder="请输入名称查询" v-model="queryParam.age"></a-input>-->
<a-input placeholder="最小年龄" type="ge" v-model="queryParam.age_begin" style="width:calc(50% - 15px);"></a-input>
<span class="group-query-strig">~</span>
<a-input placeholder="最大年龄" type="le" v-model="queryParam.age_end" style="width:calc(50% - 15px);"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<template v-if="toggleSearchStatus"> <template v-if="toggleSearchStatus">
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="字典下拉"> <a-form-item label="生日">
<j-dict-select-tag v-model="queryParam.sex" placeholder="请选择用户名称" dictCode="sex"/> <a-range-picker v-model="queryParam.birthdayRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onBirthdayChange" />
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="性别">
<j-dict-select-tag v-model="queryParam.sex" placeholder="请选择性别" dictCode="sex"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="字典表下拉"> <a-form-item label="选择用户">
<j-dict-select-tag v-model="queryParam.realname" placeholder="请选择用户" dictCode="sys_user,realname,id"/> <j-dict-select-tag v-model="queryParam.id" placeholder="请选择用户" dictCode="demo,name,id"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</template> </template>
...@@ -165,10 +175,12 @@ ...@@ -165,10 +175,12 @@
<script> <script>
import JeecgDemoModal from './modules/JeecgDemoModal' import JeecgDemoModal from './modules/JeecgDemoModal'
import JSuperQuery from '@/components/jeecg/JSuperQuery.vue'; import JSuperQuery from '@/components/jeecg/JSuperQuery.vue';
import JInput from '@/components/jeecg/JInput.vue';
import JeecgDemoTabsModal from './modules/JeecgDemoTabsModal' import JeecgDemoTabsModal from './modules/JeecgDemoTabsModal'
import {initDictOptions, filterDictText} from '@/components/dict/JDictSelectUtil' import {initDictOptions, filterDictText} from '@/components/dict/JDictSelectUtil'
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import Vue from 'vue' import Vue from 'vue'
import { filterObj } from '@/utils/util';
//高级查询modal需要参数 //高级查询modal需要参数
const superQueryFieldList=[{ const superQueryFieldList=[{
...@@ -191,6 +203,7 @@ ...@@ -191,6 +203,7 @@
JeecgDemoModal, JeecgDemoModal,
JSuperQuery, JSuperQuery,
JeecgDemoTabsModal, JeecgDemoTabsModal,
JInput
}, },
data() { data() {
return { return {
...@@ -278,6 +291,15 @@ ...@@ -278,6 +291,15 @@
} }
}, },
methods: { methods: {
getQueryParams(){
console.log(this.queryParam.birthdayRange)
var param = Object.assign({}, this.queryParam,this.isorter);
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
delete param.birthdayRange; //范围参数不传递后台
return filterObj(param);
},
initDictConfig() { initDictConfig() {
console.log("--我才是真的方法!--") console.log("--我才是真的方法!--")
//初始化字典 - 性别 //初始化字典 - 性别
...@@ -295,6 +317,11 @@ ...@@ -295,6 +317,11 @@
jump() { jump() {
this.$router.push({path: '/jeecg/helloworld'}) this.$router.push({path: '/jeecg/helloworld'})
}, },
onBirthdayChange: function (value, dateString) {
console.log(dateString[0],dateString[1]);
this.queryParam.birthday_begin=dateString[0];
this.queryParam.birthday_end=dateString[1];
},
//列设置更改事件 //列设置更改事件
onColSettingsChange (checkedValues) { onColSettingsChange (checkedValues) {
var key = this.$route.name+":colsettings"; var key = this.$route.name+":colsettings";
......
...@@ -55,14 +55,14 @@ ...@@ -55,14 +55,14 @@
<a-col :span="12">选中的部门ID(v-model):{{ departId }}</a-col> <a-col :span="12">选中的部门ID(v-model):{{ 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-item label="选择用户">
<j-select-user-by-dep v-model="userRealName"></j-select-user-by-dep> <j-select-user-by-dep v-model="userIds" :multi="true"></j-select-user-by-dep>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12">选中的用户(v-model):{{ userRealName }}</a-col> <a-col :span="12">选中的用户(v-model):{{ userIds }}</a-col>
</a-row> </a-row>
<!-- 用户选择控件 --> <!-- 用户选择控件 -->
...@@ -75,6 +75,16 @@ ...@@ -75,6 +75,16 @@
<a-col :span="12">选中的用户(v-model):{{ multiUser }}</a-col> <a-col :span="12">选中的用户(v-model):{{ multiUser }}</a-col>
</a-row> </a-row>
<!-- 角色选择 -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="选择角色">
<j-select-role v-model="formData.selectRole"/>
</a-form-item>
</a-col>
<a-col :span="12">选中值:{{ formData.selectRole}}</a-col>
</a-row>
<!-- JCheckbox --> <!-- JCheckbox -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
...@@ -207,18 +217,48 @@ ...@@ -207,18 +217,48 @@
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="树字典"> <a-form-item label="树字典">
<j-tree-dict parentCode="B01" /> <j-tree-dict parentCode="A01" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"></a-col> <a-col :span="12"></a-col>
</a-row> </a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="下拉树选择">
<j-tree-select
v-model="formData.treeSelect"
placeholder="请选择菜单"
dict="sys_permission,name,id"
pidField="parent_id"
pidValue=""
/>
</a-form-item>
</a-col>
<a-col :spapn="12">选中的值(v-model):{{ formData.treeSelect }}</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="下拉树多选">
<j-tree-select
v-model="formData.treeSelectMultiple"
placeholder="请选择菜单"
dict="sys_permission,name,id"
pidField="parent_id"
pidValue=""
multiple
/>
</a-form-item>
</a-col>
<a-col :spapn="12">选中的值(v-model):{{ formData.treeSelectMultiple }}</a-col>
</a-row>
<!-- 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-item label="cron表达式">
<j-cron ref="innerVueCron" v-decorator="['cronExpression', {'initialValue':'0/1 * * * * ?'}]" @change="setCorn"></j-cron> <j-cron ref="innerVueCron" v-decorator="['cronExpression', { initialValue: '* * * * * ? *' }]" @change="setCorn"></j-cron>
<!-- <j-cron ref="innerVueCron" v-model="cron" @change="setCorn"></j-cron>-->
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -234,6 +274,7 @@ ...@@ -234,6 +274,7 @@
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart' import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep' import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
import JSelectMultiUser from '@/components/jeecgbiz/JSelectMultiUser' import JSelectMultiUser from '@/components/jeecgbiz/JSelectMultiUser'
import JSelectRole from '@/components/jeecgbiz/JSelectRole'
import JCheckbox from '@/components/jeecg/JCheckbox' import JCheckbox from '@/components/jeecg/JCheckbox'
import JCodeEditor from '@/components/jeecg/JCodeEditor' import JCodeEditor from '@/components/jeecg/JCodeEditor'
import JDate from '@/components/jeecg/JDate' import JDate from '@/components/jeecg/JDate'
...@@ -244,6 +285,8 @@ ...@@ -244,6 +285,8 @@
import JSelectMultiple from '@/components/jeecg/JSelectMultiple' import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
import JTreeDict from "../../components/jeecg/JTreeDict.vue"; import JTreeDict from "../../components/jeecg/JTreeDict.vue";
import JCron from "@/components/jeecg/JCron.vue"; import JCron from "@/components/jeecg/JCron.vue";
import JTreeSelect from '@/components/jeecg/JTreeSelect'
export default { export default {
name: 'SelectDemo', name: 'SelectDemo',
components: { components: {
...@@ -252,20 +295,21 @@ ...@@ -252,20 +295,21 @@
JSelectDepart, JSelectDepart,
JSelectUserByDep, JSelectUserByDep,
JSelectMultiUser, JSelectMultiUser,
JSelectRole,
JCheckbox, JCheckbox,
JCodeEditor, JCodeEditor,
JDate, JEditor, JEllipsis, JGraphicCode, JSlider, JSelectMultiple, JDate, JEditor, JEllipsis, JGraphicCode, JSlider, JSelectMultiple,
JCron JCron, JTreeSelect
}, },
data() { data() {
return { return {
selectList: [], selectList: [],
selectedDepUsers: '', selectedDepUsers: '',
formData:{}, formData: {},
form: this.$form.createForm(this), form: this.$form.createForm(this),
departId: '4f1765520d6346f9bd9c79e2479e5b12,57197590443c44f083d42ae24ef26a2c', departId: '4f1765520d6346f9bd9c79e2479e5b12,57197590443c44f083d42ae24ef26a2c',
userRealName: '', userIds: 'admin',
multiUser: '', multiUser: 'admin,jeecg',
jcheckbox: { jcheckbox: {
values: 'spring,jeecgboot', values: 'spring,jeecgboot',
options: [ options: [
...@@ -368,7 +412,6 @@ sayHi('hello, world!')` ...@@ -368,7 +412,6 @@ sayHi('hello, world!')`
this.modal.fullScreen = mode this.modal.fullScreen = mode
}, },
setCorn(data){ setCorn(data){
this.$nextTick(() => { this.$nextTick(() => {
this.form.cronExpression = data; this.form.cronExpression = data;
}) })
......
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
getAction(this.url.customerListByMainId, {mainId: record.id}).then((res) => { getAction(this.url.customerListByMainId, {mainId: record.id}).then((res) => {
if (res.success) { if (res.success) {
this.loading = false; this.loading = false;
this.innerData = res.result; this.innerData = res.result.records;
} }
}); });
} }
......
...@@ -62,6 +62,39 @@ ...@@ -62,6 +62,39 @@
{ {
pattern: /^[a-z|A-Z][a-z|A-Z\d_-]{0,}$/, // 正则 pattern: /^[a-z|A-Z][a-z|A-Z\d_-]{0,}$/, // 正则
message: '${title}必须以字母开头,可包含数字、下划线、横杠' message: '${title}必须以字母开头,可包含数字、下划线、横杠'
},
{
handler(type, value, row, column, callback, target) {
// type 触发校验的类型(input、change、blur)
// value 当前校验的值
// callback(flag, message) 方法必须执行且只能执行一次
// flag = 是否通过了校验,不填写或者填写 null 代表不进行任何操作
// message = 提示的类型,默认使用配置的 message
// target 行编辑的实例对象
if (type === 'blur') {
let { values } = target.getValuesSync({ validate: false })
if (value === 'abc') {
callback(false, '${title}不能是abc') // false = 未验证
return
}
let count = 0
for (let val of values) {
if (val['dbFieldName'] === value) {
if (++count >= 2) {
callback(false, '${title}不能重复==')
return
}
}
}
callback(true) // true = 通过验证
} else {
callback() // 不填写或者填写 null 代表不进行任何操作
}
},
message: '${title}默认提示'
} }
] ]
}, },
......
...@@ -133,14 +133,19 @@ ...@@ -133,14 +133,19 @@
if (arg === 1) { if (arg === 1) {
this.ipagination.current = 1; this.ipagination.current = 1;
} }
//update-begin--Author:kangxiaolin Date:20190905 for:[442]主子表分开维护,生成的代码子表的分页改为真实的分页--------------------
var params = this.getQueryParams(); var params = this.getQueryParams();
getAction(this.url.list, {mainId: params.mainId}).then((res) => { getAction(this.url.list, {orderId: params.mainId, pageNo : this.ipagination.current,
pageSize :this.ipagination.pageSize}).then((res) => {
if (res.success) { if (res.success) {
this.dataSource = res.result; this.dataSource = res.result.records;
this.ipagination.total = res.result.total;
} else { } else {
this.dataSource = null; this.dataSource = null;
} }
}) })
//update-end--Author:kangxiaolin Date:20190905 for:[442]主子表分开维护,生成的代码子表的分页改为真实的分页--------------------
}, },
getOrderMain(orderId) { getOrderMain(orderId) {
this.queryParam.mainId = orderId; this.queryParam.mainId = orderId;
......
...@@ -123,13 +123,17 @@ ...@@ -123,13 +123,17 @@
this.ipagination.current = 1; this.ipagination.current = 1;
} }
var params = this.getQueryParams(); var params = this.getQueryParams();
getAction(this.url.list, {mainId: params.mainId}).then((res) => { //update-begin--Author:kangxiaolin Date:20190905 for:[442]主子表分开维护,生成的代码子表的分页改为真实的分页--------------------
getAction(this.url.list, {orderId: params.mainId ,pageNo : this.ipagination.current,
pageSize :this.ipagination.pageSize}).then((res) => {
if (res.success) { if (res.success) {
this.dataSource = res.result; this.dataSource = res.result.records;
this.ipagination.total = res.result.total;
} else { } else {
this.dataSource = null; this.dataSource = null;
} }
}) })
//update-end--Author:kangxiaolin Date:20190905 for:[442]主子表分开维护,生成的代码子表的分页改为真实的分页--------------------
}, },
getOrderMain(orderId) { getOrderMain(orderId) {
this.queryParam.mainId = orderId; this.queryParam.mainId = orderId;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="航班时间" label="航班时间"
hasFeedback> hasFeedback>
<j-date v-decorator="['tickectDate',{trigger:'input',rules:[{ required: true,message: '请输入航班号!'}]}]"></j-date> <j-date :trigger-change="true" v-decorator="['tickectDate',{rules:[{ required: true,message: '请输入航班号!'}]}]"></j-date>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline"> <a-form layout="inline" @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-item label="消息标题">
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
......
...@@ -96,11 +96,21 @@ ...@@ -96,11 +96,21 @@
</template> </template>
<a-menu-item> <a-menu-item>
<a @click="copyConfig(record.id)">复制视图</a>
</a-menu-item>
<a-menu-item v-if="record.hascopy==1">
<a @click="showMyCopyInfo(record.id)">配置视图</a>
</a-menu-item>
<a-menu-item>
<a @click="handleRemoveRecord(record.id)">移除</a> <a @click="handleRemoveRecord(record.id)">移除</a>
</a-menu-item> </a-menu-item>
<a-menu-item> <a-menu-item>
<a @click="handleDelete(record.id)">删除</a> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
...@@ -168,6 +178,8 @@ ...@@ -168,6 +178,8 @@
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import Clipboard from 'clipboard' import Clipboard from 'clipboard'
import { filterObj } from '@/utils/util';
export default { export default {
name: 'OnlCgformHeadList', name: 'OnlCgformHeadList',
mixins: [JeecgListMixin], mixins: [JeecgListMixin],
...@@ -231,7 +243,8 @@ ...@@ -231,7 +243,8 @@
delete: '/online/cgform/head/delete', delete: '/online/cgform/head/delete',
deleteBatch: '/online/cgform/head/deleteBatch', deleteBatch: '/online/cgform/head/deleteBatch',
doDbSynch: '/online/cgform/api/doDbSynch/', doDbSynch: '/online/cgform/api/doDbSynch/',
removeRecord: '/online/cgform/head/removeRecord' removeRecord: '/online/cgform/head/removeRecord',
copyOnline: '/online/cgform/head/copyOnline'
}, },
tableTypeDictOptions: [], tableTypeDictOptions: [],
sexDictOptions: [], sexDictOptions: [],
...@@ -253,7 +266,6 @@ ...@@ -253,7 +266,6 @@
this.tableTypeDictOptions = res.result this.tableTypeDictOptions = res.result
} }
}) })
this.loadData()
}, },
methods: { methods: {
doDbSynch(id) { doDbSynch(id) {
...@@ -266,6 +278,15 @@ ...@@ -266,6 +278,15 @@
} }
}) })
}, },
getQueryParams() {
//获取查询条件
var param = Object.assign({}, this.queryParam, this.isorter ,this.filters);
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
param.copyType = 0;
return filterObj(param);
},
handleCancleDbSync() { handleCancleDbSync() {
this.syncModalVisible = false this.syncModalVisible = false
}, },
...@@ -281,9 +302,18 @@ ...@@ -281,9 +302,18 @@
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}) })
setTimeout(()=>{
if(this.syncLoading){
this.syncModalVisible = false
this.syncLoading = false
this.$message.success("网络延迟,已自动刷新!")
this.loadData()
}
},10000)
}, },
openSyncModal(id) { openSyncModal(id) {
this.syncModalVisible = true this.syncModalVisible = true
this.syncLoading = false
this.syncFormId = id this.syncFormId = id
}, },
goPageOnline(rd) { goPageOnline(rd) {
...@@ -391,7 +421,21 @@ ...@@ -391,7 +421,21 @@
this.$message.error('该浏览器不支持自动复制') this.$message.error('该浏览器不支持自动复制')
clipboard.destroy() clipboard.destroy()
}) })
},
showMyCopyInfo(id){
this.$router.push({ path: '/online/copyform/' + id })
},
copyConfig(id){
postAction(`${this.url.copyOnline}?code=${id}`).then(res=>{
if(res.success){
this.$message.success("复制成功")
this.loadData()
}else{
this.$message.error("复制失败>>"+res.message)
}
})
} }
} }
} }
</script> </script>
......
...@@ -89,8 +89,9 @@ ...@@ -89,8 +89,9 @@
:dataSource="table.dataSource" :dataSource="table.dataSource"
:pagination="table.pagination" :pagination="table.pagination"
:loading="table.loading" :loading="table.loading"
:rowSelection="{selectedRowKeys:table.selectedRowKeys, onChange: handleChangeInTableSelect}" :rowSelection="rowSelectionConfig"
@change="handleTableChange" @change="handleTableChange"
:scroll="table.scroll"
style="min-height: 300px"> style="min-height: 300px">
<template slot="dateSlot" slot-scope="text"> <template slot="dateSlot" slot-scope="text">
...@@ -102,19 +103,19 @@ ...@@ -102,19 +103,19 @@
</template> </template>
<template slot="imgSlot" slot-scope="text"> <template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">图片</span> <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/> <img v-else :src="getImgView(text)" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template> </template>
<template slot="fileSlot" slot-scope="text"> <template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">文件</span> <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button <a-button
v-else v-else
:ghost="true" :ghost="true"
type="primary" type="primary"
icon="download" icon="download"
size="small" size="small"
@click="uploadFile(text)"> @click="downloadRowFile(text)">
下载 下载
</a-button> </a-button>
</template> </template>
...@@ -143,6 +144,19 @@ ...@@ -143,6 +144,19 @@
<a href="javascript:;" @click="handleDetail(record)">详情</a> <a href="javascript:;" @click="handleDetail(record)">详情</a>
</a-menu-item> </a-menu-item>
<template v-if="hasBpmStatus"> <template v-if="hasBpmStatus">
<template v-if="record.bpm_status == '1'||record.bpm_status == ''|| record.bpm_status == null">
<a-menu-item>
<a href="javascript:;" @click="startProcess(record)">提交流程</a>
</a-menu-item>
<a-menu-item v-if="buttonSwitch.delete">
<a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteOne(record)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</template>
<template v-else>
<a-menu-item @click="handlePreviewPic(record)">审批进度</a-menu-item>
</template>
</template> </template>
<template v-else> <template v-else>
<a-menu-item v-if="buttonSwitch.delete"> <a-menu-item v-if="buttonSwitch.delete">
...@@ -165,10 +179,11 @@ ...@@ -165,10 +179,11 @@
</span> </span>
</a-table> </a-table>
<OnlCgformAutoModal @success="handleFormSuccess" ref="modal" :code="code"></OnlCgformAutoModal> <cgform-auto-modal @success="handleFormSuccess" ref="modal" :code="code"></cgform-auto-modal>
<j-import-modal ref="importModal" :url="getImportUrl()" @ok="importOk"></j-import-modal> <j-import-modal ref="importModal" :url="getImportUrl()" @ok="importOk"></j-import-modal>
</div> </div>
</a-card> </a-card>
</template> </template>
...@@ -183,7 +198,7 @@ ...@@ -183,7 +198,7 @@
export default { export default {
name: 'OnlCgFormAutoList', name: 'OnlCgFormAutoList',
components: { components: {
JImportModal JImportModal,
}, },
data() { data() {
return { return {
...@@ -197,6 +212,7 @@ ...@@ -197,6 +212,7 @@
optPre:"/online/cgform/api/form/", optPre:"/online/cgform/api/form/",
exportXls:'/online/cgform/api/exportXls/', exportXls:'/online/cgform/api/exportXls/',
buttonAction:'/online/cgform/api/doButton', buttonAction:'/online/cgform/api/doButton',
startProcess: "/process/extActProcess/startMutilProcess",
}, },
flowCodePre:"onl_", flowCodePre:"onl_",
isorter:{ isorter:{
...@@ -216,6 +232,7 @@ ...@@ -216,6 +232,7 @@
toggleSearchStatus:false, toggleSearchStatus:false,
table: { table: {
loading: true, loading: true,
scroll:{x:false},
// 表头 // 表头
columns: [], columns: [],
//数据集 //数据集
...@@ -225,6 +242,10 @@ ...@@ -225,6 +242,10 @@
selectionRows: [], selectionRows: [],
// 分页参数 // 分页参数
pagination: { pagination: {
}
},
metaPagination:{
current: 1, current: 1,
pageSize: 10, pageSize: 10,
pageSizeOptions: ['10', '20', '30'], pageSizeOptions: ['10', '20', '30'],
...@@ -234,7 +255,6 @@ ...@@ -234,7 +255,6 @@
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,
total: 0 total: 0
}
}, },
actionColumn:{ actionColumn:{
title: '操作', title: '操作',
...@@ -256,6 +276,7 @@ ...@@ -256,6 +276,7 @@
export:true export:true
}, },
hasBpmStatus:false, hasBpmStatus:false,
checkboxFlag:false
} }
}, },
created() { created() {
...@@ -270,6 +291,18 @@ ...@@ -270,6 +291,18 @@
this.initAutoList() this.initAutoList()
} }
}, },
computed:{
rowSelectionConfig:function() {
if(!this.checkboxFlag){
return null
}
return {
fixed:true,
selectedRowKeys:this.table.selectedRowKeys,
onChange: this.handleChangeInTableSelect
}
}
},
methods: { methods: {
hasBpmStatusFilter(){ hasBpmStatusFilter(){
var columnObjs = this.table.columns; var columnObjs = this.table.columns;
...@@ -283,6 +316,30 @@ ...@@ -283,6 +316,30 @@
this.hasBpmStatus = false; this.hasBpmStatus = false;
} }
}, },
startProcess: function(record){
var that = this;
this.$confirm({
title:"提示",
content:"确认提交流程吗?",
onOk: function(){
var param = {
flowCode:that.flowCodePre+that.currentTableName,
id:record.id,
formUrl:"modules/bpm/task/form/OnlineFormDetail",
formUrlMobile:"modules/bpm/task/form/OnlineFormDetail"
}
postAction(that.url.startProcess,param).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.loadData();
that.onClearSelected();
}else{
that.$message.warning(res.message);
}
});
}
});
},
initQueryInfo(){ initQueryInfo(){
getAction(`${this.url.getQueryInfo}${this.code}`).then((res)=>{ getAction(`${this.url.getQueryInfo}${this.code}`).then((res)=>{
console.log("--onlineList-获取查询条件配置",res); console.log("--onlineList-获取查询条件配置",res);
...@@ -302,6 +359,18 @@ ...@@ -302,6 +359,18 @@
getAction(`${this.url.getColumns}${this.code}`).then((res)=>{ getAction(`${this.url.getColumns}${this.code}`).then((res)=>{
console.log("--onlineList-加载动态列>>",res); console.log("--onlineList-加载动态列>>",res);
if(res.success){ if(res.success){
if(res.result.checkboxFlag == 'Y'){
this.checkboxFlag = true
}else{
this.checkboxFlag = false
}
if(res.result.paginationFlag=='Y'){
this.table.pagination = {...this.metaPagination}
}else{
this.table.pagination = false
}
this.dictOptions = res.result.dictOptions this.dictOptions = res.result.dictOptions
this.formTemplate = res.result.formTemplate this.formTemplate = res.result.formTemplate
this.description = res.result.description this.description = res.result.description
...@@ -313,11 +382,24 @@ ...@@ -313,11 +382,24 @@
for(let a=0;a<currColumns.length;a++){ for(let a=0;a<currColumns.length;a++){
if(currColumns[a].customRender){ if(currColumns[a].customRender){
let dictCode = currColumns[a].customRender; let dictCode = currColumns[a].customRender;
let replaceFlag = '_replace_text_';
if(dictCode.startsWith(replaceFlag)){
let textFieldName = dictCode.replace(replaceFlag,'')
currColumns[a].customRender=(text,record)=>{
return record[textFieldName]
}
}else{
currColumns[a].customRender=(text)=>{ currColumns[a].customRender=(text)=>{
return filterMultiDictText(this.dictOptions[dictCode], text); return filterMultiDictText(this.dictOptions[dictCode], text);
} }
} }
} }
}
if(res.result.scrollFlag==1){
this.table.scroll = { x :'115%' }
}else{
this.table.scroll = { x :false }
}
currColumns.push(this.actionColumn); currColumns.push(this.actionColumn);
this.table.columns = [...currColumns] this.table.columns = [...currColumns]
this.hasBpmStatusFilter(); this.hasBpmStatusFilter();
...@@ -329,6 +411,7 @@ ...@@ -329,6 +411,7 @@
}) })
}, },
loadData(arg){ loadData(arg){
if(this.table.pagination){
if(arg==1){ if(arg==1){
this.table.pagination.current=1 this.table.pagination.current=1
} }
...@@ -351,6 +434,27 @@ ...@@ -351,6 +434,27 @@
} }
this.table.loading = false this.table.loading = false
}) })
}else{
this.loadDataNoPage()
}
},
loadDataNoPage(){
let param = Object.assign({}, this.queryParam,this.isorter);
param['pageSize'] = -521;
getAction(`${this.url.getData}${this.code}`,filterObj(param)).then((res)=>{
console.log("--onlineList-列表数据",res)
if(res.success){
let result = res.result;
if(Number(result.total)>0){
this.table.dataSource = result.records
}else{
this.table.dataSource=[]
}
}else{
this.$message.warning(res.message)
}
this.table.loading = false
})
}, },
getQueryParams() { getQueryParams() {
let param = Object.assign({}, this.queryParam,this.isorter); let param = Object.assign({}, this.queryParam,this.isorter);
...@@ -361,6 +465,7 @@ ...@@ -361,6 +465,7 @@
handleChangeInTableSelect(selectedRowKeys, selectionRows) { handleChangeInTableSelect(selectedRowKeys, selectionRows) {
this.table.selectedRowKeys = selectedRowKeys this.table.selectedRowKeys = selectedRowKeys
this.table.selectionRows = selectionRows this.table.selectionRows = selectionRows
this.selectedRowKeys = selectedRowKeys
}, },
handleTableChange(pagination, filters, sorter){ handleTableChange(pagination, filters, sorter){
//TODO 筛选 //TODO 筛选
...@@ -453,7 +558,7 @@ ...@@ -453,7 +558,7 @@
} }
return window._CONFIG['imgDomainURL']+"/"+text return window._CONFIG['imgDomainURL']+"/"+text
}, },
uploadFile(text){ downloadRowFile(text){
if(!text){ if(!text){
this.$message.warning("未知的文件") this.$message.warning("未知的文件")
return; return;
...@@ -461,7 +566,7 @@ ...@@ -461,7 +566,7 @@
if(text.indexOf(",")>0){ if(text.indexOf(",")>0){
text = text.substring(0,text.indexOf(",")) text = text.substring(0,text.indexOf(","))
} }
window.open(window._CONFIG['imgDomainURL']+"/"+text);//TODO 下载的方法 window.open(window._CONFIG['downloadUrl']+"/"+text);//TODO 下载的方法
}, },
handleDelBatch(){ handleDelBatch(){
if(this.table.selectedRowKeys.length<=0){ if(this.table.selectedRowKeys.length<=0){
......
...@@ -66,28 +66,30 @@ ...@@ -66,28 +66,30 @@
</template> </template>
<template slot="imgSlot" slot-scope="text"> <template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">图片</span> <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/> <img v-else :src="getImgView(text)" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template> </template>
<template slot="fileSlot" slot-scope="text"> <template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">文件</span> <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button <a-button
v-else v-else
:ghost="true" :ghost="true"
type="primary" type="primary"
icon="download" icon="download"
size="small" size="small"
@click="uploadFile(text)"> @click="downloadRowFile(text)">
下载 下载
</a-button> </a-button>
</template> </template>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<template v-if="buttonSwitch.update">
<template v-if="showOptButton('update',record)">
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical"/> <a-divider type="vertical"/>
</template> </template>
<a-dropdown> <a-dropdown>
<a class="ant-dropdown-link"> <a class="ant-dropdown-link">
更多 <a-icon type="down" /> 更多 <a-icon type="down" />
...@@ -96,7 +98,16 @@ ...@@ -96,7 +98,16 @@
<a-menu-item > <a-menu-item >
<a @click="handleDetail(record)">详情</a> <a @click="handleDetail(record)">详情</a>
</a-menu-item> </a-menu-item>
<a-menu-item v-if="buttonSwitch.delete">
<a-menu-item v-if="showSubmitFlowButton(record)">
<a @click="startProcess(record)">提交流程</a>
</a-menu-item>
<template v-if="showViewFlowButton(record)">
<a-menu-item @click="handlePreviewPic(record)">审批进度</a-menu-item>
</template>
<a-menu-item v-if="showOptButton('delete',record)">
<a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteOne(record)"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteOne(record)">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
...@@ -117,9 +128,10 @@ ...@@ -117,9 +128,10 @@
</a-table> </a-table>
<onl-cgform-auto-modal @success="handleFormSuccess" ref="modal" :code="code"></onl-cgform-auto-modal> <cgform-auto-modal @success="handleFormSuccess" ref="modal" :code="code"></cgform-auto-modal>
<j-import-modal ref="importModal" :url="getImportUrl()" @ok="importOk"></j-import-modal> <j-import-modal ref="importModal" :url="getImportUrl()" @ok="importOk"></j-import-modal>
</div> </div>
</a-card> </a-card>
</template> </template>
...@@ -129,12 +141,11 @@ ...@@ -129,12 +141,11 @@
import { getAction,postAction,deleteAction,downFile } from '@/api/manage' import { getAction,postAction,deleteAction,downFile } from '@/api/manage'
import { filterMultiDictText } from '@/components/dict/JDictSelectUtil' import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
import { filterObj } from '@/utils/util'; import { filterObj } from '@/utils/util';
import JImportModal from '@/components/jeecg/JImportModal'
export default { export default {
name: 'OnlCgformTreeList', name: 'OnlCgformTreeList',
components: { components: {
JImportModal JImportModal,
}, },
data() { data() {
return { return {
...@@ -171,7 +182,7 @@ ...@@ -171,7 +182,7 @@
optPre:"/online/cgform/api/form/", optPre:"/online/cgform/api/form/",
exportXls:'/online/cgform/api/exportXls/', exportXls:'/online/cgform/api/exportXls/',
buttonAction:'/online/cgform/api/doButton', buttonAction:'/online/cgform/api/doButton',
startProcess: "/process/extActProcess/startMutilProcess", startProcess: "/process/extActProcess/startMutilProcess"
}, },
isorter:{ isorter:{
column: 'create_time', column: 'create_time',
...@@ -209,7 +220,9 @@ ...@@ -209,7 +220,9 @@
import:true, import:true,
export:true export:true
}, },
expandedRowKeys:[] expandedRowKeys:[],
hasBpmStatus:false,
flowCodePre:"onl_",
} }
}, },
...@@ -299,18 +312,27 @@ ...@@ -299,18 +312,27 @@
this.initButtonSwitch(res.result.hideColumns) this.initButtonSwitch(res.result.hideColumns)
let currColumns = res.result.columns let currColumns = res.result.columns
let textFieldIndex = -1 let textFieldIndex = -1
let hasBpmStatus = false
for(let a=0;a<currColumns.length;a++){ for(let a=0;a<currColumns.length;a++){
currColumns[a].align = 'left' currColumns[a].align = 'left'
//找到显示列
if(this.textField==currColumns[a].dataIndex){ if(this.textField==currColumns[a].dataIndex){
textFieldIndex = a textFieldIndex = a
} }
//数据字典翻译
if(currColumns[a].customRender){ if(currColumns[a].customRender){
let dictCode = currColumns[a].customRender; let dictCode = currColumns[a].customRender;
currColumns[a].customRender=(text)=>{ currColumns[a].customRender=(text)=>{
return filterMultiDictText(this.dictOptions[dictCode], text); return filterMultiDictText(this.dictOptions[dictCode], text);
} }
} }
//判断是否有bpm_status
if(currColumns[a].dataIndex.toLowerCase()=='bpm_status'){
hasBpmStatus = true;
}
} }
this.hasBpmStatus = hasBpmStatus;
if(textFieldIndex!=-1){ if(textFieldIndex!=-1){
let textFieldColumn = currColumns.splice(textFieldIndex,1) let textFieldColumn = currColumns.splice(textFieldIndex,1)
currColumns.unshift(textFieldColumn[0]) currColumns.unshift(textFieldColumn[0])
...@@ -461,7 +483,7 @@ ...@@ -461,7 +483,7 @@
} }
return window._CONFIG['imgDomainURL']+"/"+text return window._CONFIG['imgDomainURL']+"/"+text
}, },
uploadFile(text){ downloadRowFile(text){
if(!text){ if(!text){
this.$message.warning("未知的文件") this.$message.warning("未知的文件")
return; return;
...@@ -469,7 +491,7 @@ ...@@ -469,7 +491,7 @@
if(text.indexOf(",")>0){ if(text.indexOf(",")>0){
text = text.substring(0,text.indexOf(",")) text = text.substring(0,text.indexOf(","))
} }
window.open(window._CONFIG['domianURL'] + "/sys/common/download/"+text); window.open(window._CONFIG['downloadUrl']+"/"+text);
}, },
/*-------数据格式化-end----------*/ /*-------数据格式化-end----------*/
...@@ -615,6 +637,59 @@ ...@@ -615,6 +637,59 @@
}, },
/*-------JS增强-end----------*/ /*-------JS增强-end----------*/
showOptButton(opt,record){
//只有当按钮属性为false,或是按钮属性为true但是流程已提交时才隐藏
if(!this.buttonSwitch[opt]){
return false
}else{
if(this.hasBpmStatus){
if(record.bpm_status !=null && record.bpm_status !='' && record.bpm_status != '1'){
return false
}
}
}
return true
},
showSubmitFlowButton(record){
if(this.hasBpmStatus){
if(record.bpm_status ==null || record.bpm_status =='' || record.bpm_status == '1'){
return true
}
}
return false
},
showViewFlowButton(record){
if(this.hasBpmStatus){
if(record.bpm_status !=null && record.bpm_status !='' && record.bpm_status != '1'){
return true
}
}
return false
},
startProcess: function(record){
var that = this;
this.$confirm({
title:"提示",
content:"确认提交流程吗?",
onOk: function(){
var param = {
flowCode:that.flowCodePre+that.currentTableName,
id:record.id,
formUrl:"modules/bpm/task/form/OnlineFormDetail",
formUrlMobile:"modules/bpm/task/form/OnlineFormDetail"
}
postAction(that.url.startProcess,param).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.loadData();
that.onClearSelected();
}else{
that.$message.warning(res.message);
}
});
}
});
},
} }
} }
......
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="文件名称">
<a-input placeholder="请输入文件名称" v-model="queryParam.fileName"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="文件地址">
<a-input placeholder="请输入文件地址" v-model="queryParam.url"></a-input>
</a-form-item>
</a-col>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator">
<!-- <a-button type="primary" icon="download" @click="handleExportXls('文件列表')">导出</a-button>-->
<a-upload
name="file"
:multiple="false"
:action="uploadAction"
:headers="tokenHeader"
:showUploadList="false"
:beforeUpload="beforeUpload"
@change="handleChange">
<a-button>
<a-icon type="upload"/>
文件上传
</a-button>
</a-upload>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
style="font-weight: 600">{{
selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="ossDelete(record.id)">删除</a>
</span>
</a-table>
</div>
<!-- table区域-end -->
</a-card>
</template>
<script>
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
export default {
name: "OSSFileList",
mixins: [JeecgListMixin],
data() {
return {
description: '文件列表',
// 表头
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
},
{
title: '文件名称',
align: "center",
dataIndex: 'fileName'
},
{
title: '文件地址',
align: "center",
dataIndex: 'url'
},
{
title: '操作',
dataIndex: 'action',
align: "center",
scopedSlots: {customRender: 'action'},
}
],
url: {
upload: "/oss/file/upload",
list: "/oss/file/list",
delete: "/oss/file/delete"
}
}
},
computed: {
uploadAction() {
return window._CONFIG['domianURL'] + this.url.upload;
}
},
methods: {
beforeUpload(file) {
var fileType = file.type;
if (fileType === 'image') {
if (fileType.indexOf('image') < 0) {
this.$message.warning('请上传图片');
return false;
}
} else if (fileType === 'file') {
if (fileType.indexOf('image') >= 0) {
this.$message.warning('请上传文件');
return false;
}
}
return true
},
handleChange(info) {
if (info.file.status === 'done') {
if (info.file.response.success) {
this.loadData()
this.$message.success(`${info.file.name} 上传成功!`);
} else {
this.$message.error(`${info.file.name} 上传失败.`);
}
} else if (info.file.status === 'error') {
this.$message.error(`${info.file.name} 上传失败.`);
}
},
ossDelete(id) {
var that = this;
that.$confirm({
title: "确认删除",
content: "是否删除选中文件?",
onOk: function () {
that.handleDelete(id)
}
});
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>
<template>
<a-row type="flex" :gutter="16">
<a-col :md="5" :sm="24">
<address-list-left v-model="currentOrgCode"/>
</a-col>
<a-col :md="24-5" :sm="24">
<address-list-right v-model="currentOrgCode"/>
</a-col>
</a-row>
</template>
<script>
import AddressListLeft from './modules/AddressListLeft'
import AddressListRight from './modules/AddressListRight'
export default {
name: 'AddressList',
components: { AddressListLeft, AddressListRight },
data() {
return {
description: '通讯录页面',
currentOrgCode: ''
}
},
methods: {}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<a-card :bordered="false"> <a-card :bordered="false">
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline"> <a-form layout="inline" @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-item label="表名">
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
:selectedKeys="selectedKeys" :selectedKeys="selectedKeys"
:checkedKeys="checkedKeys" :checkedKeys="checkedKeys"
:treeData="departTree" :treeData="departTree"
:checkStrictly="true" :checkStrictly="checkStrictly"
:expandedKeys="iExpandedKeys" :expandedKeys="iExpandedKeys"
:autoExpandParent="autoExpandParent" :autoExpandParent="autoExpandParent"
@expand="onExpand"/> @expand="onExpand"/>
...@@ -53,6 +53,23 @@ ...@@ -53,6 +53,23 @@
</a-col> </a-col>
</div> </div>
</a-card> </a-card>
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
<div class="drawer-bootom-button">
<a-dropdown :trigger="['click']" placement="topCenter">
<a-menu slot="overlay">
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
<a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
</a-menu>
<a-button>
树操作 <a-icon type="up" />
</a-button>
</a-dropdown>
</div>
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
</a-col> </a-col>
<a-col :md="12" :sm="24"> <a-col :md="12" :sm="24">
<a-card :bordered="false"> <a-card :bordered="false">
...@@ -82,6 +99,28 @@ ...@@ -82,6 +99,28 @@
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="机构类型">
<template v-if="orgCategoryDisabled">
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型">
<a-radio value="1">
公司
</a-radio>
</a-radio-group>
</template>
<template v-else>
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型">
<a-radio value="2">
部门
</a-radio>
<a-radio value="3">
岗位
</a-radio>
</a-radio-group>
</template>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="排序"> label="排序">
<a-input-number v-decorator="[ 'departOrder',{'initialValue':0}]"/> <a-input-number v-decorator="[ 'departOrder',{'initialValue':0}]"/>
</a-form-item> </a-form-item>
...@@ -186,6 +225,10 @@ ...@@ -186,6 +225,10 @@
selectedKeys: [], selectedKeys: [],
autoIncr: 1, autoIncr: 1,
currSelected: {}, currSelected: {},
allTreeKeys:[],
checkStrictly: true,
form: this.$form.createForm(this), form: this.$form.createForm(this),
labelCol: { labelCol: {
xs: {span: 24}, xs: {span: 24},
...@@ -202,6 +245,7 @@ ...@@ -202,6 +245,7 @@
validatorRules: { validatorRules: {
departName: {rules: [{required: true, message: '请输入机构/部门名称!'}]}, departName: {rules: [{required: true, message: '请输入机构/部门名称!'}]},
orgCode: {rules: [{required: true, message: '请输入机构编码!'}]}, orgCode: {rules: [{required: true, message: '请输入机构编码!'}]},
orgCategory: {rules: [{required: true, message: '请输入机构类型!'}]},
mobile: {rules: [{validator: this.validateMobile}]} mobile: {rules: [{validator: this.validateMobile}]}
}, },
url: { url: {
...@@ -211,6 +255,7 @@ ...@@ -211,6 +255,7 @@
exportXlsUrl: "sys/sysDepart/exportXls", exportXlsUrl: "sys/sysDepart/exportXls",
importExcelUrl: "sys/sysDepart/importExcel", importExcelUrl: "sys/sysDepart/importExcel",
}, },
orgCategoryDisabled:false,
} }
}, },
computed: { computed: {
...@@ -233,7 +278,8 @@ ...@@ -233,7 +278,8 @@
that.treeData.push(temp) that.treeData.push(temp)
that.departTree.push(temp) that.departTree.push(temp)
that.setThisExpandedKeys(temp) that.setThisExpandedKeys(temp)
console.log(temp.id) that.getAllKeys(temp);
// console.log(temp.id)
} }
this.loading = false this.loading = false
} }
...@@ -338,7 +384,14 @@ ...@@ -338,7 +384,14 @@
onCheck(checkedKeys, info) { onCheck(checkedKeys, info) {
console.log('onCheck', checkedKeys, info) console.log('onCheck', checkedKeys, info)
this.hiding = false this.hiding = false
this.checkedKeys = checkedKeys.checked //this.checkedKeys = checkedKeys.checked
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
if(this.checkStrictly){
this.checkedKeys = checkedKeys.checked;
}else{
this.checkedKeys = checkedKeys
}
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
}, },
onSelect(selectedKeys, e) { onSelect(selectedKeys, e) {
console.log('selected', selectedKeys, e) console.log('selected', selectedKeys, e)
...@@ -355,8 +408,13 @@ ...@@ -355,8 +408,13 @@
}, },
// 触发onSelect事件时,为部门树右侧的form表单赋值 // 触发onSelect事件时,为部门树右侧的form表单赋值
setValuesToForm(record) { setValuesToForm(record) {
if(record.orgCategory == '1'){
this.orgCategoryDisabled = true;
}else{
this.orgCategoryDisabled = false;
}
this.form.getFieldDecorator('fax', {initialValue: ''}) this.form.getFieldDecorator('fax', {initialValue: ''})
this.form.setFieldsValue(pick(record, 'departName', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo')) this.form.setFieldsValue(pick(record, 'departName','orgCategory', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo'))
}, },
getCurrSelectedTitle() { getCurrSelectedTitle() {
return !this.currSelected.title ? '' : this.currSelected.title return !this.currSelected.title ? '' : this.currSelected.title
...@@ -459,6 +517,39 @@ ...@@ -459,6 +517,39 @@
} }
} }
}, },
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
expandAll () {
this.iExpandedKeys = this.allTreeKeys
},
closeAll () {
this.iExpandedKeys = []
},
checkALL () {
this.checkStriccheckStrictlytly = false
this.checkedKeys = this.allTreeKeys
},
cancelCheckALL () {
//this.checkedKeys = this.defaultCheckedKeys
this.checkedKeys = []
},
switchCheckStrictly (v) {
if(v==1){
this.checkStrictly = false
}else if(v==2){
this.checkStrictly = true
}
},
getAllKeys(node) {
// console.log('node',node);
this.allTreeKeys.push(node.key)
if (node.children && node.children.length > 0) {
for (let a = 0; a < node.children.length; a++) {
this.getAllKeys(node.children[a])
}
}
}
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
}, },
created() { created() {
this.currFlowId = this.$route.params.id this.currFlowId = this.$route.params.id
...@@ -516,4 +607,16 @@ ...@@ -516,4 +607,16 @@
.ant-btn { .ant-btn {
margin-left: 3px margin-left: 3px
} }
.drawer-bootom-button {
/*position: absolute;*/
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: left;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style> </style>
\ No newline at end of file
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
<template> <template>
<!--组织机构--> <!--组织机构-->
<a-directory-tree <a-tree
selectable showLine
:selectedKeys="selectedKeys" :selectedKeys="selectedKeys"
:checkStrictly="true" :checkStrictly="true"
@select="onSelect" @select="onSelect"
......
<template>
<a-modal
:width="modalWidth"
:style="modalStyle"
:visible="visible"
:maskClosable="false"
@cancel="handleCancel">
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
</template>
<a-table
ref="table"
rowKey="id"
size="middle"
:columns="columns"
:loading="loading"
:dataSource="dataSource"
:pagination="false">
<span slot="action" slot-scope="text, record">
<a @click="handleBack(record.id)"><a-icon type="redo"/>字典取回</a>
<a-divider type="vertical"/>
<a @click="handleDelete(record.id)"><a-icon type="scissor"/>彻底删除</a>
</span>
</a-table>
</a-modal>
</template>
<script>
import { getAction,deleteAction,putAction } from '@/api/manage'
export default {
name: "DictDeleteList",
data () {
return {
modalWidth: '90%',
modalStyle: { 'top': '20px'},
title: '操作',
visible: false,
loading: false,
dataSource:[],
columns:[
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 120,
align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
},
{
title: '字典名称',
align: "left",
dataIndex: 'dictName'
},
{
title: '字典编号',
align: "left",
dataIndex: 'dictCode'
},
{
title: '描述',
align: "left",
dataIndex: 'description'
},
{
title: '操作',
dataIndex: 'action',
align: "center",
scopedSlots: {customRender: 'action'}
}
]
}
},
methods: {
handleCancel(){
this.visible = false
},
show(){
this.visible = true
this.loadData();
},
loadData(){
this.loading = true
getAction("/sys/dict/deleteList").then(res=>{
this.loading = false
if(res.success){
this.dataSource = res.result
}else{
this.$message.warning(res.message)
}
})
},
handleBack(id){
putAction("/sys/dict/back/"+id).then(res=>{
if(res.success){
this.$message.success(res.message)
this.loadData();
}else{
this.$message.warning(res.message)
}
})
},
handleDelete(id){
deleteAction("/sys/dict/deletePhysic/"+id).then(res=>{
if(res.success){
this.$message.success(res.message)
this.loadData();
}else{
this.$message.warning(res.message)
}
})
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
}"> }">
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline" :form="form"> <a-form layout="inline" :form="form" @keyup.enter.native="searchQuery">
<a-row :gutter="10"> <a-row :gutter="10">
<a-col :md="8" :sm="12"> <a-col :md="8" :sm="12">
<a-form-item label="名称"> <a-form-item label="名称">
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- 左侧面板 --> <!-- 左侧面板 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="12"> <a-row :gutter="12">
<a-col :md="7" :sm="8"> <a-col :md="7" :sm="8">
<a-form-item label="字典名称" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}"> <a-form-item label="字典名称" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}">
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
<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>
</a-upload> </a-upload>
<a-button type="primary" icon="hdd" @click="openDeleteList">回收站</a-button>
</div> </div>
<a-table <a-table
...@@ -58,6 +60,7 @@ ...@@ -58,6 +60,7 @@
</div> </div>
<dict-modal ref="modalForm" @ok="modalFormOk"></dict-modal> <!-- 字典类型 --> <dict-modal ref="modalForm" @ok="modalFormOk"></dict-modal> <!-- 字典类型 -->
<dict-item-list ref="dictItemList"></dict-item-list> <dict-item-list ref="dictItemList"></dict-item-list>
<dict-delete-list ref="dictDeleteList"></dict-delete-list>
</a-card> </a-card>
</template> </template>
...@@ -66,11 +69,12 @@ ...@@ -66,11 +69,12 @@
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import DictModal from './modules/DictModal' import DictModal from './modules/DictModal'
import DictItemList from './DictItemList' import DictItemList from './DictItemList'
import DictDeleteList from './DictDeleteList'
export default { export default {
name: "DictList", name: "DictList",
mixins:[JeecgListMixin], mixins:[JeecgListMixin],
components: {DictModal, DictItemList}, components: {DictModal, DictItemList,DictDeleteList},
data() { data() {
return { return {
description: '这是数据字典页面', description: '这是数据字典页面',
...@@ -161,6 +165,10 @@ ...@@ -161,6 +165,10 @@
that.queryParam.dictCode = ""; that.queryParam.dictCode = "";
that.loadData(this.ipagination.current); that.loadData(this.ipagination.current);
}, },
openDeleteList(){
this.$refs.dictDeleteList.show()
}
}, },
watch: { watch: {
openKeys(val) { openKeys(val) {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
......
<template>
<a-card :bordered="false">
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button
@click="batchDel"
v-if="selectedRowKeys.length > 0"
ghost
type="primary"
icon="delete">批量删除
</a-button>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i>已选择&nbsp;<a style="font-weight: 600">{{
selectedRowKeys.length }}</a>&nbsp;&nbsp;
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
:columns="columns"
size="middle"
:pagination="false"
:dataSource="dataSource"
:loading="loading"
@expand="expandSubmenu"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical"/>
<a-dropdown>
<a class="ant-dropdown-link">
更多 <a-icon type="down"/>
</a>
<a-menu slot="overlay">
<a-menu-item>
<a href="javascript:;" @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a href="javascript:;" @click="handleAddSub(record)">添加子菜单</a>
</a-menu-item>
<a-menu-item>
<a href="javascript:;" @click="handleDataRule(record)">数据规则</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
<!-- 字符串超长截取省略号显示 -->
<span slot="url" slot-scope="text">
<j-ellipsis :value="text" :length="25"/>
</span>
<!-- 字符串超长截取省略号显示-->
<span slot="component" slot-scope="text">
<j-ellipsis :value="text"/>
</span>
</a-table>
</div>
<!-- table区域-end -->
<permission-modal ref="modalForm" @ok="modalFormOk"></permission-modal>
<permission-data-rule-list ref="PermissionDataRuleList" @ok="modalFormOk"></permission-data-rule-list>
</a-card>
</template>
<script>
import PermissionModal from './modules/PermissionModal'
import { getSystemMenuList,getSystemSubmenu } from '@/api/api'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import PermissionDataRuleList from './PermissionDataRuleList'
import JEllipsis from '@/components/jeecg/JEllipsis'
const columns = [
{
title: '菜单名称',
dataIndex: 'name',
key: 'name'
}, {
title: '菜单类型',
dataIndex: 'menuType',
key: 'menuType',
customRender: function(text) {
if (text == 0) {
return '菜单'
} else if (text == 1) {
return '菜单'
} else if (text == 2) {
return '按钮/权限'
} else {
return text
}
}
},/*{
title: '权限编码',
dataIndex: 'perms',
key: 'permissionCode',
},*/{
title: 'icon',
dataIndex: 'icon',
key: 'icon'
},
{
title: '组件',
dataIndex: 'component',
key: 'component',
scopedSlots: { customRender: 'component' }
},
{
title: '路径',
dataIndex: 'url',
key: 'url',
scopedSlots: { customRender: 'url' }
},
{
title: '排序',
dataIndex: 'sortNo',
key: 'sortNo'
},
{
title: '操作',
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
align: 'center',
width: 150
}
]
export default {
name: 'PermissionList',
mixins: [JeecgListMixin],
components: {
PermissionDataRuleList,
PermissionModal,
JEllipsis
},
data() {
return {
description: '这是菜单管理页面',
// 表头
columns: columns,
loading: false,
url: {
list: '/sys/permission/list',
delete: '/sys/permission/delete',
deleteBatch: '/sys/permission/deleteBatch'
}
}
},
methods: {
loadData() {
this.dataSource = []
getSystemMenuList().then((res) => {
if (res.success) {
console.log(res.result)
this.dataSource = res.result
}
})
},
expandSubmenu(expanded, record){
if(expanded){
getSystemSubmenu({parentId:record.id}).then((res) => {
if (res.success) {
record.children = res.result
}
})
}
},
// 打开数据规则编辑
handleDataRule(record) {
this.$refs.PermissionDataRuleList.edit(record)
},
handleAddSub(record) {
this.$refs.modalForm.title = "添加子菜单";
this.$refs.modalForm.localMenuType = 1;
this.$refs.modalForm.disableSubmit = false;
this.$refs.modalForm.edit({status:'1',permsType:'1',route:true,'parentId':record.id});
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>
\ No newline at end of file
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
background: '#fff', background: '#fff',
}"> }">
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form> <a-form @keyup.enter.native="searchQuery">
<a-row :gutter="12"> <a-row :gutter="12">
<a-col :md="8" :sm="8"> <a-col :md="8" :sm="8">
<a-form-item label="规则名称" :labelCol="{span: 8}" :wrapperCol="{span: 14, offset: 1}"> <a-form-item label="规则名称" :labelCol="{span: 8}" :wrapperCol="{span: 14, offset: 1}">
...@@ -118,6 +118,10 @@ ...@@ -118,6 +118,10 @@
}, },
methods: { methods: {
loadData() { loadData() {
//20190908 scott for: 首次进入菜单列表的时候,不加载权限列表
if(!this.permId){
return
}
let that = this let that = this
this.dataSource = [] this.dataSource = []
var params = this.getQueryParams()//查询条件 var params = this.getQueryParams()//查询条件
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="6" :sm="10"> <a-col :md="6" :sm="10">
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<!-- 搜索区域 --> <!-- 搜索区域 -->
<a-form layout="inline"> <a-form layout="inline" @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="名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}"> <a-form-item label="名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<!-- 搜索区域 --> <!-- 搜索区域 -->
<a-form layout="inline"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="12" :sm="12"> <a-col :md="12" :sm="12">
<a-form-item label="角色名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}"> <a-form-item label="角色名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="6"> <a-col :span="6">
...@@ -89,6 +89,9 @@ ...@@ -89,6 +89,9 @@
<a>撤销</a> <a>撤销</a>
</a-popconfirm> </a-popconfirm>
</a-menu-item> </a-menu-item>
<a-menu-item>
<a @click="handleDetail(record)">查看</a>
</a-menu-item>
</a-menu> </a-menu>
</a-dropdown> </a-dropdown>
</span> </span>
......
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="职务编码">
<a-input placeholder="请输入职务编码" v-model="queryParam.code"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="职务名称">
<a-input placeholder="请输入职务名称" v-model="queryParam.name"></a-input>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="8">
<a-form-item label="职级">
<j-dict-select-tag v-model="queryParam.rank" placeholder="请选择职级" dictCode="position_rank"/>
</a-form-item>
</a-col>
</template>
<a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</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-button type="primary" icon="import">导入</a-button>
</a-upload>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel">
<a-icon type="delete"/>
删除
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical"/>
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
<a-menu slot="overlay">
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<sysPosition-modal ref="modalForm" @ok="modalFormOk"></sysPosition-modal>
</a-card>
</template>
<script>
import SysPositionModal from './modules/SysPositionModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDictSelectTag from '@/components/dict/JDictSelectTag'
export default {
name: 'SysPositionList',
mixins: [JeecgListMixin],
components: {
SysPositionModal,
JDictSelectTag
},
data() {
return {
description: '职务表管理页面',
// 表头
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: 'center',
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{
title: '职务编码',
align: 'center',
dataIndex: 'code'
},
{
title: '职务名称',
align: 'center',
dataIndex: 'name'
},
{
title: '职级',
align: 'center',
dataIndex: 'rank_dictText'
},
// {
// title: '公司id',
// align: 'center',
// dataIndex: 'companyId'
// },
{
title: '操作',
dataIndex: 'action',
align: 'center',
scopedSlots: { customRender: 'action' },
}
],
url: {
list: '/sys/position/list',
delete: '/sys/position/delete',
deleteBatch: '/sys/position/deleteBatch',
exportXlsUrl: '/sys/position/exportXls',
importExcelUrl: '/sys/position/importExcel',
},
}
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<a-card :bordered="false"> <a-card :bordered="false">
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="6"> <a-col :span="6">
...@@ -132,11 +132,7 @@ ...@@ -132,11 +132,7 @@
loading:false, loading:false,
} }
}, },
created() {
this.loadData();
},
methods: { methods: {
handleDetail: function(record){ handleDetail: function(record){
this.$refs.sysAnnouncementModal.detail(record); this.$refs.sysAnnouncementModal.detail(record);
this.$refs.sysAnnouncementModal.title="查看"; this.$refs.sysAnnouncementModal.title="查看";
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment