Quellcode durchsuchen

把项目中TODO改为小写(todo注释),之后开始记录自己的TODO

liangyan0105 vor 3 Jahren
Ursprung
Commit
0cbc6022b2

+ 4 - 4
public/cdn/babel-polyfill/polyfill_7_2_5.js

@@ -2650,7 +2650,7 @@ if (_dereq_(36)) {
       && has(desc, 'value')
       && !has(desc, 'get')
       && !has(desc, 'set')
-      // TODO: add validation descriptor w/o calling accessors
+      // todo: add validation descriptor w/o calling accessors
       && !desc.configurable
       && (!has(desc, 'writable') || desc.writable)
       && (!has(desc, 'enumerable') || desc.enumerable)
@@ -6144,7 +6144,7 @@ var TO_STRING_TAG = wks('toStringTag');
 var ArrayValues = Iterators.Array;
 
 var DOMIterables = {
-  CSSRuleList: true, // TODO: Not spec compliant, should be false.
+  CSSRuleList: true, // todo: Not spec compliant, should be false.
   CSSStyleDeclaration: false,
   CSSValueList: false,
   ClientRectList: false,
@@ -6157,7 +6157,7 @@ var DOMIterables = {
   HTMLCollection: false,
   HTMLFormElement: false,
   HTMLSelectElement: false,
-  MediaList: true, // TODO: Not spec compliant, should be false.
+  MediaList: true, // todo: Not spec compliant, should be false.
   MimeTypeArray: false,
   NamedNodeMap: false,
   NodeList: true,
@@ -6171,7 +6171,7 @@ var DOMIterables = {
   SVGStringList: false,
   SVGTransformList: false,
   SourceBufferList: false,
-  StyleSheetList: true, // TODO: Not spec compliant, should be false.
+  StyleSheetList: true, // todo: Not spec compliant, should be false.
   TextTrackCueList: false,
   TextTrackList: false,
   TouchList: false

+ 105 - 107
src/components/dict/JSearchSelectTag.vue

@@ -39,177 +39,175 @@
 </template>
 
 <script>
-  import { ajaxGetDictItems,getDictItemsFromCache } from '@/api/api'
-  import debounce from 'lodash/debounce';
+  import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
+  import debounce from 'lodash/debounce'
   import { getAction } from '../../api/manage'
 
   export default {
     name: 'JSearchSelectTag',
-    props:{
+    props: {
       disabled: Boolean,
       value: [String, Number],
       dictOptions: Array,
       async: Boolean,
-      placeholder:{
-        type:String,
-        default:"请选择",
-        required:false
+      placeholder: {
+        type: String,
+        default: '请选择',
+        required: false
       },
-      dict:{
+      dict: {
         type: String,
         default: '',
         required: false
       },
-      popContainer:{
-        type:String,
-        default:'',
-        required:false
+      popContainer: {
+        type: String,
+        default: '',
+        required: false
       },
-      pageSize:{
+      pageSize: {
         type: Number,
         default: 10,
         required: false
       },
       getPopupContainer: {
-        type:Function,
+        type: Function,
         default: null
-      },
+      }
     },
-    data(){
-      this.loadData = debounce(this.loadData, 800);//消抖
-      this.lastLoad = 0;
+    data() {
+      this.loadData = debounce(this.loadData, 800)// 消抖
+      this.lastLoad = 0
       return {
-        loading:false,
-        selectedValue:[],
-        selectedAsyncValue:[],
-        options: [],
+        loading: false,
+        selectedValue: [],
+        selectedAsyncValue: [],
+        options: []
       }
     },
-    created(){
-      this.initDictData();
+    created() {
+      this.initDictData()
     },
-    watch:{
-      "value":{
-        immediate:true,
-        handler(val){
-          if(!val){
-            if(val==0){
+    watch: {
+      'value': {
+        immediate: true,
+        handler(val) {
+          if (!val) {
+            if (val == 0) {
               this.initSelectValue()
-            }else{
-              this.selectedValue=[]
-              this.selectedAsyncValue=[]
+            } else {
+              this.selectedValue = []
+              this.selectedAsyncValue = []
             }
-          }else{
+          } else {
             this.initSelectValue()
           }
         }
       },
-      "dict":{
-        handler(){
+      'dict': {
+        handler() {
           this.initDictData()
         }
       },
-      'dictOptions':{
+      'dictOptions': {
         deep: true,
-        handler(val){
-          if(val && val.length>0){
+        handler(val) {
+          if (val && val.length > 0) {
             this.options = [...val]
           }
         }
       }
     },
-    methods:{
-      initSelectValue(){
-        if(this.async){
-          if(!this.selectedAsyncValue || !this.selectedAsyncValue.key || this.selectedAsyncValue.key!=this.value){
-            console.log("这才请求后台")
-            //update-begin-author:taoyan date:20220112 for: 方法initSelectValue 根据下拉框实际值查询下拉框的显示的文本 因后台接口只处理3个参数,所以将过滤条件去掉
-            // TODO 隐患 查询效率问题 还是应该在后台作筛选
+    methods: {
+      initSelectValue() {
+        if (this.async) {
+          if (!this.selectedAsyncValue || !this.selectedAsyncValue.key || this.selectedAsyncValue.key != this.value) {
+            console.log('这才请求后台')
+            // update-begin-author:taoyan date:20220112 for: 方法initSelectValue 根据下拉框实际值查询下拉框的显示的文本 因后台接口只处理3个参数,所以将过滤条件去掉
+            // todo 隐患 查询效率问题 还是应该在后台作筛选
             let itemDictStr = this.dict
             let arr = itemDictStr.split(',')
-            if(arr && arr.length==4){
+            if (arr && arr.length == 4) {
               // 删除最后一个元素
-              arr.pop();
+              arr.pop()
               itemDictStr = arr.join(',')
             }
-            //update-end-author:taoyan date:20220112 for: 方法initSelectValue 根据下拉框实际值查询下拉框的显示的文本 因后台接口只处理3个参数,所以将过滤条件去掉
-            getAction(`/sys/dict/loadDictItem/${itemDictStr}`,{key:this.value}).then(res=>{
-              if(res.success){
+            // update-end-author:taoyan date:20220112 for: 方法initSelectValue 根据下拉框实际值查询下拉框的显示的文本 因后台接口只处理3个参数,所以将过滤条件去掉
+            getAction(`/sys/dict/loadDictItem/${itemDictStr}`, { key: this.value }).then(res => {
+              if (res.success) {
                 let obj = {
-                  key:this.value,
-                  label:res.result
+                  key: this.value,
+                  label: res.result
                 }
-                this.selectedAsyncValue = {...obj}
+                this.selectedAsyncValue = { ...obj }
               }
             })
           }
-        }else{
+        } else {
           this.selectedValue = this.value.toString()
         }
       },
-      loadData(value){
-        console.log("数据加载",value)
-        this.lastLoad +=1
+      loadData(value) {
+        console.log('数据加载', value)
+        this.lastLoad += 1
         const currentLoad = this.lastLoad
         this.options = []
-        this.loading=true
+        this.loading = true
         // 字典code格式:table,text,code
-        getAction(`/sys/dict/loadDict/${this.dict}`,{keyword:value, pageSize: this.pageSize}).then(res=>{
-          this.loading=false
-          if(res.success){
-            if(currentLoad!=this.lastLoad){
+        getAction(`/sys/dict/loadDict/${this.dict}`, { keyword: value, pageSize: this.pageSize }).then(res => {
+          this.loading = false
+          if (res.success) {
+            if (currentLoad != this.lastLoad) {
               return
             }
             this.options = res.result
-            console.log("我是第一个",res)
-          }else{
+            console.log('我是第一个', res)
+          } else {
             this.$message.warning(res.message)
           }
-
         })
-
       },
-      initDictData(){
-        if(!this.async){
-          //如果字典项集合有数据
-          if(this.dictOptions && this.dictOptions.length>0){
+      initDictData() {
+        if (!this.async) {
+          // 如果字典项集合有数据
+          if (this.dictOptions && this.dictOptions.length > 0) {
             this.options = [...this.dictOptions]
-          }else{
-            //根据字典Code, 初始化字典数组
+          } else {
+            // 根据字典Code, 初始化字典数组
             let dictStr = ''
-            if(this.dict){
+            if (this.dict) {
                 let arr = this.dict.split(',')
-                if(arr[0].indexOf('where')>0){
+                if (arr[0].indexOf('where') > 0) {
                   let tbInfo = arr[0].split('where')
-                  dictStr = tbInfo[0].trim()+','+arr[1]+','+arr[2]+','+encodeURIComponent(tbInfo[1])
-                }else{
+                  dictStr = tbInfo[0].trim() + ',' + arr[1] + ',' + arr[2] + ',' + encodeURIComponent(tbInfo[1])
+                } else {
                   dictStr = this.dict
                 }
-                if (this.dict.indexOf(",") == -1) {
-                  //优先从缓存中读取字典配置
+                if (this.dict.indexOf(',') == -1) {
+                  // 优先从缓存中读取字典配置
                   if (getDictItemsFromCache(this.dictCode)) {
-                    this.options = getDictItemsFromCache(this.dictCode);
+                    this.options = getDictItemsFromCache(this.dictCode)
                     return
                   }
                 }
                 ajaxGetDictItems(dictStr, null).then((res) => {
                   if (res.success) {
-                    this.options = res.result;
+                    this.options = res.result
                   }
                 })
             }
           }
-        }else{
-          if(!this.dict){
+        } else {
+          if (!this.dict) {
             console.error('搜索组件未配置字典项')
-          }else{
-            //异步一开始也加载一点数据
-            this.loading=true
-            getAction(`/sys/dict/loadDict/${this.dict}`,{pageSize: this.pageSize, keyword:''}).then(res=>{
-              this.loading=false
-              if(res.success){
+          } else {
+            // 异步一开始也加载一点数据
+            this.loading = true
+            getAction(`/sys/dict/loadDict/${this.dict}`, { pageSize: this.pageSize, keyword: '' }).then(res => {
+              this.loading = false
+              if (res.success) {
                 this.options = res.result
-              }else{
+              } else {
                 this.$message.warning(res.message)
               }
             })
@@ -220,42 +218,42 @@
         return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       },
       handleChange (selectedValue) {
-        console.log("selectedValue",selectedValue)
+        console.log('selectedValue', selectedValue)
         this.selectedValue = selectedValue
         this.callback()
       },
-      handleAsyncChange(selectedObj){
-        //update-begin-author:scott date:20201222 for:【搜索】搜索查询组件,删除条件,默认下拉还是上次的缓存数据,不好 JT-191
-        if(selectedObj){
+      handleAsyncChange(selectedObj) {
+        // update-begin-author:scott date:20201222 for:【搜索】搜索查询组件,删除条件,默认下拉还是上次的缓存数据,不好 JT-191
+        if (selectedObj) {
           this.selectedAsyncValue = selectedObj
           this.selectedValue = selectedObj.key
-        }else{
+        } else {
           this.selectedAsyncValue = null
           this.selectedValue = null
           this.options = null
-          this.loadData("")
+          this.loadData('')
         }
         this.callback()
-        //update-end-author:scott date:20201222 for:【搜索】搜索查询组件,删除条件,默认下拉还是上次的缓存数据,不好 JT-191
+        // update-end-author:scott date:20201222 for:【搜索】搜索查询组件,删除条件,默认下拉还是上次的缓存数据,不好 JT-191
       },
-      callback(){
-        this.$emit('change', this.selectedValue);
+      callback() {
+        this.$emit('change', this.selectedValue)
       },
-      setCurrentDictOptions(dictOptions){
+      setCurrentDictOptions(dictOptions) {
         this.options = dictOptions
       },
-      getCurrentDictOptions(){
+      getCurrentDictOptions() {
         return this.options
       },
-      getParentContainer(node){
-        if(typeof this.getPopupContainer === 'function'){
+      getParentContainer(node) {
+        if (typeof this.getPopupContainer === 'function') {
           return this.getPopupContainer(node)
-        } else if(!this.popContainer){
+        } else if (!this.popContainer) {
           return node.parentNode
-        }else{
+        } else {
           return document.querySelector(this.popContainer)
         }
-      },
+      }
 
     },
     model: {
@@ -267,4 +265,4 @@
 
 <style scoped>
 
-</style>
+</style>

+ 115 - 114
src/components/jeecg/JVxeTable/components/JVxeTable.js

@@ -23,7 +23,7 @@ export default {
     }
   },
   mixins: [VxeWebSocketMixins],
-  components: {JVxeToolbar, JVxeSubPopover, JVxeDetailsModal, JVxePagination},
+  components: { JVxeToolbar, JVxeSubPopover, JVxeDetailsModal, JVxePagination },
   props: {
     rowKey: PropTypes.string.def('id'),
     // 列信息
@@ -48,7 +48,7 @@ export default {
       // prefix 前缀;suffix 后缀;
       slots: ['prefix', 'suffix'],
       // add 新增按钮;remove 删除按钮;clearSelection 清空选择按钮;collapse 展开收起
-      btns: ['add', 'remove', 'clearSelection'],
+      btns: ['add', 'remove', 'clearSelection']
     })),
     // 是否显示行号
     rowNumber: PropTypes.bool.def(false),
@@ -66,7 +66,7 @@ export default {
     // 最大高度
     maxHeight: {
       type: Number,
-      default: () => null,
+      default: () => null
     },
     // 要禁用的行 TODO 未实现
     disabledRows: PropTypes.object.def(() => ({})),
@@ -99,7 +99,7 @@ export default {
     // 注:该参数不能动态修改;如果行、列字段多的情况下,会根据机器性能造成不同程度的卡顿。
     alwaysEdit: PropTypes.bool.def(false),
     // 联动配置,数组,详情配置见文档
-    linkageConfig: PropTypes.array.def(() => []),
+    linkageConfig: PropTypes.array.def(() => [])
   },
   data() {
     return {
@@ -111,7 +111,7 @@ export default {
       // 内置 EditRules
       _innerEditRules: [],
       // 记录滚动条位置
-      scroll: {top: 0, left: 0},
+      scroll: { top: 0, left: 0 },
       // 当前是否正在滚动
       scrolling: false,
       // vxe 默认配置
@@ -125,7 +125,7 @@ export default {
         'show-header-overflow': true,
         'show-footer-overflow': true,
         // 可编辑配置
-        'edit-config': {trigger: 'click', mode: 'cell', showStatus: true},
+        'edit-config': { trigger: 'click', mode: 'cell', showStatus: true },
         'expand-config': {
           iconClose: 'ant-table-row-expand-icon ant-table-row-collapsed',
           iconOpen: 'ant-table-row-expand-icon ant-table-row-expanded'
@@ -137,8 +137,8 @@ export default {
         // 'scroll-x': {
         //   gt: 15
         // },
-        'radio-config': {highlight: true},
-        'checkbox-config': {highlight: true},
+        'radio-config': { highlight: true },
+        'checkbox-config': { highlight: true }
       },
       // 绑定左侧选择框
       selectedRows: [],
@@ -148,15 +148,15 @@ export default {
       statistics: {
         has: false,
         sum: [],
-        average: [],
+        average: []
       },
       // 允许执行刷新特效的行ID
       reloadEffectRowKeysMap: {},
-      //配置了但是没有授权的按钮和列 集合
-      excludeCode:[],
+      // 配置了但是没有授权的按钮和列 集合
+      excludeCode: [],
       // 联动下拉选项(用于隔离不同的下拉选项)
       // 内部联动配置,map
-      _innerLinkageConfig: null,
+      _innerLinkageConfig: null
     }
   },
   computed: {
@@ -171,7 +171,7 @@ export default {
           scrolling: this.scrolling,
           reloadEffect: this.reloadEffect,
           reloadEffectRowKeysMap: this.reloadEffectRowKeysMap,
-          listeners: this.cellListeners,
+          listeners: this.cellListeners
         }
         if (column.$type === JVXETypes.rowDragSort) {
           renderOptions.dragSortKey = this.dragSortKey
@@ -191,7 +191,7 @@ export default {
               config: this._innerLinkageConfig.get(column.key),
               getLinkageOptionsSibling: this.getLinkageOptionsSibling,
               getLinkageOptionsAsync: this.getLinkageOptionsAsync,
-              linkageSelectChange: this.linkageSelectChange,
+              linkageSelectChange: this.linkageSelectChange
             }
           }
         }
@@ -204,21 +204,21 @@ export default {
         // update--begin--autor:lvdandan-----date:20201019------for:LOWCOD-882 【新行编辑】列表上带按钮的遮挡问题
         if (column.$type === JVXETypes.file || column.$type === JVXETypes.image) {
           if (column.width && column.width.endsWith('px')) {
-            column.width = Number.parseInt(column.width.substr(0,column.width.length-2))+Number.parseInt(1)+'px';
+            column.width = Number.parseInt(column.width.substr(0, column.width.length - 2)) + Number.parseInt(1) + 'px'
           }
         }
         // update--begin--autor:lvdandan-----date:20201019------for:LOWCOD-882 【新行编辑】列表上带按钮的遮挡问题
 
         // update--begin--autor:lvdandan-----date:20201211------for:JT-118 【online】 日期、时间控件长度较小
         if (column.$type === JVXETypes.datetime || column.$type === JVXETypes.userSelect || column.$type === JVXETypes.departSelect) {
-          let width = column.width && column.width.endsWith('px')?Number.parseInt(column.width.substr(0,column.width.length-2)):0;
-          if(width <= 190){
+          let width = column.width && column.width.endsWith('px') ? Number.parseInt(column.width.substr(0, column.width.length - 2)) : 0
+          if (width <= 190) {
             column.width = '190px'
           }
         }
         if (column.$type === JVXETypes.date) {
-          let width = column.width && column.width.endsWith('px')?Number.parseInt(column.width.substr(0,column.width.length-2)):0;
-          if(width <= 135){
+          let width = column.width && column.width.endsWith('px') ? Number.parseInt(column.width.substr(0, column.width.length - 2)) : 0
+          if (width <= 135) {
             column.width = '135px'
           }
         }
@@ -235,7 +235,7 @@ export default {
       let expandConfig = Object.assign({}, this.defaultVxeProps['expand-config'], this.expandConfig)
 
       return Object.assign({}, this.defaultVxeProps, {
-        showFooter: this.statistics.has,
+        showFooter: this.statistics.has
       }, this.$attrs, {
         loading: this.loading,
         columns: this.vxeColumns,
@@ -245,7 +245,7 @@ export default {
         maxHeight: this.maxHeight,
         border: this.bordered,
         expandConfig: expandConfig,
-        footerMethod: this.handleFooterMethod,
+        footerMethod: this.handleFooterMethod
         // footerSpanMethod: this.handleFooterSpanMethod,
       })
     },
@@ -259,7 +259,7 @@ export default {
         'edit-actived': this.handleEditActived,
         'radio-change': this.handleVxeRadioChange,
         'checkbox-all': this.handleVxeCheckboxAll,
-        'checkbox-change': this.handleVxeCheckboxChange,
+        'checkbox-change': this.handleVxeCheckboxChange
       }
       // 用户传递的事件,进行合并操作
       Object.keys(this.$listeners).forEach(key => {
@@ -285,9 +285,9 @@ export default {
         /** 当前行向下移一位 */
         rowMoveDown: rowIndex => this.rowResort(rowIndex, rowIndex + 1),
         /** 在当前行下面插入一行 */
-        rowInsertDown: rowIndex => this.insertRows({}, rowIndex + 1),
+        rowInsertDown: rowIndex => this.insertRows({}, rowIndex + 1)
       }
-    },
+    }
   },
   watch: {
     dataSource: {
@@ -312,7 +312,7 @@ export default {
         // 阻断vue监听大数据,提高性能
         vxe.loadData(this.dataSource)
 
-        // TODO 解析disabledRows
+        // todo 解析disabledRows
         // let disabled = false
         //
         // let disabledRowIds = (this.disabledRowIds || [])
@@ -334,16 +334,16 @@ export default {
         //     }
         //   }
         // })
-      },
+      }
     },
     columns: {
       immediate: true,
       handler(columns) {
-        //获取不需要显示列
+        // 获取不需要显示列
         this.loadExcludeCode()
         let _innerColumns = []
         let _innerEditRules = {}
-        let {rowNumber, rowSelection, rowExpand, dragSort} = this
+        let { rowNumber, rowSelection, rowExpand, dragSort } = this
         let expandColumn, seqColumn, checkboxColumn, radioColumn, dragSortColumn
         if (Array.isArray(columns)) {
           this.statistics.has = false
@@ -352,11 +352,11 @@ export default {
 
           // 处理成vxe可识别的columns
           columns.forEach(column => {
-            if(this.excludeCode.indexOf(column.key)>=0){
+            if (this.excludeCode.indexOf(column.key) >= 0) {
               return false
             }
-            let col = {...column}
-            let {type} = col
+            let col = { ...column }
+            let { type } = col
             const enhanced = getEnhancedMixins(type)
             if (type === JVXETypes.rowNumber) {
               seqColumn = col
@@ -373,7 +373,7 @@ export default {
               // 防止和vxeTable自带的type起冲突
               col.$type = col.type
               delete col.type
-              let renderName = 'cellRender', renderOptions = {name: JVXETypes._prefix + type}
+              let renderName = 'cellRender'; let renderOptions = { name: JVXETypes._prefix + type }
               if (type) {
                 // hidden 是特殊的组件
                 if (type === JVXETypes.hidden) {
@@ -441,9 +441,9 @@ export default {
         }
         // 判断是否开启了序号
         if (rowNumber) {
-          let col = {type: 'seq', title: '#', width: 60, fixed: 'left', align: 'center'}
+          let col = { type: 'seq', title: '#', width: 60, fixed: 'left', align: 'center' }
           if (seqColumn) {
-            col = Object.assign(col, seqColumn, {type: 'seq'})
+            col = Object.assign(col, seqColumn, { type: 'seq' })
           }
           _innerColumns.unshift(col)
         }
@@ -453,14 +453,14 @@ export default {
           if (this.statistics.has && !rowExpand && !dragSort) {
             width = 60
           }
-          let col = {type: this.rowSelectionType, width, fixed: 'left', align: 'center'}
+          let col = { type: this.rowSelectionType, width, fixed: 'left', align: 'center' }
           // radio
           if (this.rowSelectionType === 'radio' && radioColumn) {
-            col = Object.assign(col, radioColumn, {type: 'radio'})
+            col = Object.assign(col, radioColumn, { type: 'radio' })
           }
           // checkbox
           if (this.rowSelectionType === 'checkbox' && checkboxColumn) {
-            col = Object.assign(col, checkboxColumn, {type: 'checkbox'})
+            col = Object.assign(col, checkboxColumn, { type: 'checkbox' })
           }
           _innerColumns.unshift(col)
         }
@@ -470,9 +470,9 @@ export default {
           if (this.statistics.has && !dragSort) {
             width = 60
           }
-          let col = {type: 'expand', title: '', width, fixed: 'left', align: 'center', slots: {content: 'expandContent'}}
+          let col = { type: 'expand', title: '', width, fixed: 'left', align: 'center', slots: { content: 'expandContent' } }
           if (expandColumn) {
-            col = Object.assign(col, expandColumn, {type: 'expand'})
+            col = Object.assign(col, expandColumn, { type: 'expand' })
           }
           _innerColumns.unshift(col)
         }
@@ -482,9 +482,9 @@ export default {
           if (this.statistics.has) {
             width = 60
           }
-          let col = {type: JVXETypes.rowDragSort, title: '', width, fixed: 'left', align: 'center', cellRender: {name: JVXETypes._prefix + JVXETypes.rowDragSort}}
+          let col = { type: JVXETypes.rowDragSort, title: '', width, fixed: 'left', align: 'center', cellRender: { name: JVXETypes._prefix + JVXETypes.rowDragSort } }
           if (dragSortColumn) {
-            col = Object.assign(col, dragSortColumn, {type: JVXETypes.rowDragSort})
+            col = Object.assign(col, dragSortColumn, { type: JVXETypes.rowDragSort })
           }
           _innerColumns.unshift(col)
         }
@@ -515,7 +515,8 @@ export default {
             let keys = getLcKeys(lc.key, [])
             // 多个key共享一个,引用地址
             let configItem = {
-              ...lc, keys,
+              ...lc,
+keys,
               optionsMap: new Map()
             }
             keys.forEach(k => configMap.set(k, configItem))
@@ -525,7 +526,7 @@ export default {
           this._innerLinkageConfig = null
         }
       }
-    },
+    }
   },
   created() {
   },
@@ -559,7 +560,7 @@ export default {
     },
 
     handleVxeScroll(event) {
-      let {$refs, scroll} = this
+      let { $refs, scroll } = this
 
       // 记录滚动条的位置
       scroll.top = event.scrollTop
@@ -609,8 +610,8 @@ export default {
 
     // 点击单元格时触发的事件
     handleCellClick(event) {
-      let {row, column, $event, $table} = event
-      let {$refs} = this
+      let { row, column, $event, $table } = event
+      let { $refs } = this
 
       // 点击了可编辑的
       if (column.editRender) {
@@ -651,20 +652,20 @@ export default {
     },
 
     // 单元格编辑状态下被关闭时会触发该事件
-    handleEditClosed({column}) {
+    handleEditClosed({ column }) {
       // 执行增强
       getEnhancedMixins(column.own.$type, 'aopEvents').editClosed.apply(this, arguments)
     },
 
     // 单元格被激活编辑时会触发该事件
-    handleEditActived({column}) {
+    handleEditActived({ column }) {
       // 执行增强
       getEnhancedMixins(column.own.$type, 'aopEvents').editActived.apply(this, arguments)
     },
 
     /** 表尾数据处理方法,用于显示统计信息 */
-    handleFooterMethod({columns, data}) {
-      const {statistics} = this
+    handleFooterMethod({ columns, data }) {
+      const { statistics } = this
       let footers = []
       if (statistics.has) {
         if (statistics.sum.length > 0) {
@@ -687,7 +688,7 @@ export default {
       return footers
     },
 
-    getFooterStatisticsMap({columns, title, checks, method}) {
+    getFooterStatisticsMap({ columns, title, checks, method }) {
       return columns.map((column, columnIndex) => {
         if (columnIndex === 0) {
           return title
@@ -702,11 +703,11 @@ export default {
     /** 表尾单元格合并方法 */
     handleFooterSpanMethod(event) {
       if (event.columnIndex === 0) {
-        return {colspan: 2}
+        return { colspan: 2 }
       }
     },
 
-    /*--- 外部可调用接口方法 ---*/
+    /* --- 外部可调用接口方法 --- */
 
     /**
      * 重置滚动条Top位置
@@ -723,7 +724,7 @@ export default {
      */
     async loadNewData(dataSource) {
       if (Array.isArray(dataSource)) {
-        let {xTable} = this.$refs.vxe.$refs
+        let { xTable } = this.$refs.vxe.$refs
         // issues/2784
         // 先清空所有数据
         xTable.loadData([])
@@ -749,12 +750,12 @@ export default {
     // 校验table,失败返回errMap,成功返回null
     async validateTable() {
       const errMap = await this.validate().catch(errMap => errMap)
-      return errMap ? errMap : null
+      return errMap || null
     },
     // 完整校验
     async fullValidateTable() {
       const errMap = await this.fullValidate().catch(errMap => errMap)
-      return errMap ? errMap : null
+      return errMap || null
     },
 
     /** 设置某行某列的值 */
@@ -764,8 +765,8 @@ export default {
         return
       }
       values.forEach((item, idx) => {
-        let {rowKey, values: record} = item
-        let {row} = this.getIfRowById(rowKey)
+        let { rowKey, values: record } = item
+        let { row } = this.getIfRowById(rowKey)
         if (!row) {
           return
         }
@@ -783,7 +784,7 @@ export default {
                 oldValue: oldValue,
                 col: column.own,
                 column: column,
-                isSetValues: true,
+                isSetValues: true
               })
             }
           } else {
@@ -802,18 +803,18 @@ export default {
     },
     /** 获取表格表单里的值 */
     getValues(callback, rowIds) {
-      let tableData = this.getTableData({rowIds: rowIds})
+      let tableData = this.getTableData({ rowIds: rowIds })
       callback('', tableData)
     },
     /** 获取表格数据 */
     getTableData(options = {}) {
-      let {rowIds} = options
+      let { rowIds } = options
       let tableData
       // 仅查询指定id的行
       if (Array.isArray(rowIds) && rowIds.length > 0) {
         tableData = []
         rowIds.forEach(rowId => {
-          let {row} = this.getIfRowById(rowId)
+          let { row } = this.getIfRowById(rowId)
           if (row) {
             tableData.push(row)
           }
@@ -837,16 +838,16 @@ export default {
     },
     /** 根据ID获取行,新增的行也能查出来 */
     getIfRowById(id) {
-      let row = this.getRowById(id), isNew = false
+      let row = this.getRowById(id); let isNew = false
       if (!row) {
         row = this.getNewRowById(id)
         if (!row) {
           console.warn(`JVxeTable.getIfRowById:没有找到id为"${id}"的行`)
-          return {row: null}
+          return { row: null }
         }
         isNew = true
       }
-      return {row, isNew}
+      return { row, isNew }
     },
     /** 通过临时ID获取新增的行 */
     getNewRowById(id) {
@@ -894,8 +895,8 @@ export default {
      * @param options.setActive 是否激活最后一行的编辑模式
      */
     async pushRows(rows = {}, options = {}) {
-      let {xTable} = this.$refs.vxe.$refs
-      let {setActive, index} = options
+      let { xTable } = this.$refs.vxe.$refs
+      let { setActive, index } = options
       setActive = setActive == null ? false : !!setActive
       index = index == null ? -1 : index
       index = index === -1 ? index : xTable.tableFullData[index]
@@ -911,7 +912,7 @@ export default {
 
     /** 清空选择行 */
     clearSelection() {
-      let event = {$table: this.$refs.vxe, target: this}
+      let event = { $table: this.$refs.vxe, target: this }
       if (this.rowSelectionType === JVXETypes.rowRadio) {
         this.$refs.vxe.clearRadioRow()
         this.handleVxeRadioChange(event)
@@ -937,7 +938,7 @@ export default {
         rowIds = [rowId]
       }
       let rows = rowIds.map((id) => {
-        let {row} = this.getIfRowById(id)
+        let { row } = this.getIfRowById(id)
         if (!row) {
           return
         }
@@ -955,13 +956,13 @@ export default {
       return this.$refs.vxe.getColumnByField.apply(this.$refs.vxe, arguments)
     },
 
-    /* --- 辅助方法 ---*/
+    /* --- 辅助方法 --- */
 
     // 触发事件
     trigger(name, event = {}) {
       event.$target = this
       event.$table = this.$refs.vxe
-      //online增强参数兼容
+      // online增强参数兼容
       event.target = this
       this.$emit(name, event)
     },
@@ -996,7 +997,7 @@ export default {
     /** 【多级联动】获取联动下拉选项(异步) */
     getLinkageOptionsAsync(config, parent) {
       return new Promise(resolve => {
-        let key = parent ? parent : 'root'
+        let key = parent || 'root'
         let options
         if (config.optionsMap.has(key)) {
           options = config.optionsMap.get(key)
@@ -1045,7 +1046,7 @@ export default {
           values[config.keys[i]] = ''
         }
         // 清空后几列的数据
-        this.setValues([{rowKey: row.id, values}])
+        this.setValues([{ rowKey: row.id, values }])
       }
     },
 
@@ -1067,8 +1068,8 @@ export default {
         }
       })
     },
-    //options自定义赋值 刷新
-    virtualRefresh(){
+    // options自定义赋值 刷新
+    virtualRefresh() {
       this.scrolling = true
       this.closeScrolling()
     },
@@ -1089,7 +1090,7 @@ export default {
       for (let row of rows) {
         let item = cloneObject(row)
         if (insertRecords.includes(row)) {
-          handler ? handler({item, row, insertRecords}) : null
+          handler ? handler({ item, row, insertRecords }) : null
 
           if (remove) {
             continue
@@ -1118,9 +1119,9 @@ export default {
     _remove(rows) {
       const xTable = this.$refs.vxe.$refs.xTable
 
-      const {afterFullData, tableFullData, tableSourceData, editStore, treeConfig, checkboxOpts, selection, isInsertByRow, scrollYLoad} = xTable
-      const {actived, removeList, insertList} = editStore
-      const {checkField: property} = checkboxOpts
+      const { afterFullData, tableFullData, tableSourceData, editStore, treeConfig, checkboxOpts, selection, isInsertByRow, scrollYLoad } = xTable
+      const { actived, removeList, insertList } = editStore
+      const { checkField: property } = checkboxOpts
       let rest = []
       const nowData = afterFullData
       if (treeConfig) {
@@ -1171,7 +1172,7 @@ export default {
       }
       return xTable.$nextTick().then(() => {
         xTable.recalculate()
-        return {row: rest.length ? rest[rest.length - 1] : null, rows: rest}
+        return { row: rest.length ? rest[rest.length - 1] : null, rows: rest }
       })
     },
 
@@ -1204,7 +1205,7 @@ export default {
     },
 
     async _addOrInsert(rows = {}, index, triggerName, isOnlJs) {
-      let {xTable} = this.$refs.vxe.$refs
+      let { xTable } = this.$refs.vxe.$refs
       let records
       if (Array.isArray(rows)) {
         records = rows
@@ -1213,7 +1214,7 @@ export default {
       }
       // 遍历添加默认值
       records.forEach(record => this._createRow(record))
-      let result = await this.pushRows(records, {index: index, setActive: true})
+      let result = await this.pushRows(records, { index: index, setActive: true })
       // 遍历插入的行
       // update--begin--autor:lvdandan-----date:20201117------for:LOWCOD-987 【新行编辑】js增强附表内置方法调用问题 #1819
       // online js增强时以传过来值为准,不再赋默认值
@@ -1223,7 +1224,7 @@ export default {
           this.trigger(triggerName, {
             row: row,
             $table: xTable,
-            target: this,
+            target: this
           })
         }
       }
@@ -1232,14 +1233,14 @@ export default {
     },
     // 创建新行,自动添加默认值
     _createRow(record = {}) {
-      let {xTable} = this.$refs.vxe.$refs
+      let { xTable } = this.$refs.vxe.$refs
       // 添加默认值
       xTable.tableFullColumn.forEach(column => {
         let col = column.own
         if (col.key && (record[col.key] == null || record[col.key] === '')) {
           // 设置默认值
           let createValue = getEnhancedMixins(col.$type || col.type, 'createValue')
-          record[col.key] = createValue({row: record, column, $table: xTable})
+          record[col.key] = createValue({ row: record, column, $table: xTable })
         }
         // update-begin--author:sunjianlei---date:20210819------for: 处理联动列,联动列只能作用于 select 组件
         if (col.$type === JVXETypes.select && this._innerLinkageConfig != null) {
@@ -1254,7 +1255,7 @@ export default {
       return record
     },
 
-    /*--- 渲染函数 ---*/
+    /* --- 渲染函数 --- */
 
     // 渲染 vxe
     renderVxeGrid(h) {
@@ -1264,7 +1265,7 @@ export default {
         props: this.vxeProps,
         on: this.vxeEvents,
         // 作用域插槽的格式为
-        scopedSlots: this.$scopedSlots,
+        scopedSlots: this.$scopedSlots
       })
     },
     // 渲染工具栏
@@ -1277,7 +1278,7 @@ export default {
             size: this.size,
             disabled: this.disabled,
             disabledRows: this.disabledRows,
-            selectedRowIds: this.selectedRowIds,
+            selectedRowIds: this.selectedRowIds
           },
           on: {
             // 新增事件
@@ -1285,7 +1286,7 @@ export default {
             // 保存事件
             save: () => this.trigger('save', {
               $table: this.$refs.vxe,
-              target: this,
+              target: this
             }),
             // 删除事件
             remove: () => {
@@ -1293,7 +1294,7 @@ export default {
               let deleteRows = this.filterNewRows(this.selectedRows)
               // 触发删除事件
               if (deleteRows.length > 0) {
-                let removeEvent = {deleteRows, $table, target: this}
+                let removeEvent = { deleteRows, $table, target: this }
                 if (this.asyncRemove) {
                   // 确认删除,只有调用这个方法才会真删除
                   removeEvent.confirmRemove = () => this.removeSelection()
@@ -1310,8 +1311,8 @@ export default {
           },
           scopedSlots: {
             toolbarPrefix: this.$scopedSlots.toolbarPrefix,
-            toolbarSuffix: this.$scopedSlots.toolbarSuffix,
-          },
+            toolbarSuffix: this.$scopedSlots.toolbarSuffix
+          }
         })
       }
       return null
@@ -1329,7 +1330,7 @@ export default {
         return h('j-vxe-sub-popover', {
           ref: 'subPopover',
           scopedSlots: {
-            subForm: this.$scopedSlots.subForm,
+            subForm: this.$scopedSlots.subForm
           }
         })
       }
@@ -1358,17 +1359,17 @@ export default {
           },
           on: {
             change: (e) => this.trigger('pageChange', e)
-          },
+          }
         })
       }
       return null
     },
-    loadExcludeCode(){
-      if(!this.authPre || this.authPre.length==0){
+    loadExcludeCode() {
+      if (!this.authPre || this.authPre.length == 0) {
         this.excludeCode = []
-      }else{
+      } else {
         let pre = this.authPre
-        if(!pre.endsWith(':')){
+        if (!pre.endsWith(':')) {
           pre += ':'
         }
         this.excludeCode = getNoAuthCols(pre)
@@ -1385,7 +1386,7 @@ export default {
       this.renderToolbar(h),
       this.renderToolbarAfterSlot(),
       this.renderVxeGrid(h),
-      this.renderPagination(h),
+      this.renderPagination(h)
     ])
   },
   beforeDestroy() {
@@ -1395,23 +1396,23 @@ export default {
 
 // 兼容 online 的规则
 const fooPatterns = [
-  {title: '非空', value: '*', pattern: /^.+$/},
-  {title: '6到16位数字', value: 'n6-16', pattern: /^\d{6,16}$/},
-  {title: '6到16位任意字符', value: '*6-16', pattern: /^.{6,16}$/},
-  {title: '6到18位字母', value: 's6-18', pattern: /^[a-z|A-Z]{6,18}$/},
-  {title: '网址', value: 'url', pattern: /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/},
-  {title: '电子邮件', value: 'e', pattern: /^([\w]+\.*)([\w]+)@[\w]+\.\w{3}(\.\w{2}|)$/},
-  {title: '手机号码', value: 'm', pattern: /^1[3456789]\d{9}$/},
-  {title: '邮政编码', value: 'p', pattern: /^[0-9]{6}$/},
-  {title: '字母', value: 's', pattern: /^[A-Z|a-z]+$/},
-  {title: '数字', value: 'n', pattern: /^-?\d+(\.?\d+|\d?)$/},
-  {title: '整数', value: 'z', pattern: /^-?\d+$/},
-  {title: '金额', value: 'money', pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/},
+  { title: '非空', value: '*', pattern: /^.+$/ },
+  { title: '6到16位数字', value: 'n6-16', pattern: /^\d{6,16}$/ },
+  { title: '6到16位任意字符', value: '*6-16', pattern: /^.{6,16}$/ },
+  { title: '6到18位字母', value: 's6-18', pattern: /^[a-z|A-Z]{6,18}$/ },
+  { title: '网址', value: 'url', pattern: /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/ },
+  { title: '电子邮件', value: 'e', pattern: /^([\w]+\.*)([\w]+)@[\w]+\.\w{3}(\.\w{2}|)$/ },
+  { title: '手机号码', value: 'm', pattern: /^1[3456789]\d{9}$/ },
+  { title: '邮政编码', value: 'p', pattern: /^[0-9]{6}$/ },
+  { title: '字母', value: 's', pattern: /^[A-Z|a-z]+$/ },
+  { title: '数字', value: 'n', pattern: /^-?\d+(\.?\d+|\d?)$/ },
+  { title: '整数', value: 'z', pattern: /^-?\d+$/ },
+  { title: '金额', value: 'money', pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/ }
 ]
 
 /** 旧版handler转为新版Validator */
 function handlerConvertToValidator(event) {
-  const {column, rule} = event
+  const { column, rule } = event
   return new Promise((resolve, reject) => {
     rule.handler(event, (flag, msg) => {
       let message = rule.message
@@ -1420,7 +1421,7 @@ function handlerConvertToValidator(event) {
       }
       if (flag == null) {
         resolve(message)
-      } else if (!!flag) {
+      } else if (flag) {
         resolve(message)
       } else {
         reject(new Error(message))
@@ -1431,7 +1432,7 @@ function handlerConvertToValidator(event) {
 
 /** 唯一校验器 */
 function uniqueValidator(event) {
-  const {cellValue, column, rule} = event
+  const { cellValue, column, rule } = event
   let tableData = this.getTableData()
   let findCount = 0
   for (let rowData of tableData) {

+ 11 - 11
src/components/jeecg/JVxeTable/components/JVxeToolbar.vue

@@ -38,33 +38,33 @@
       size: String,
       disabled: Boolean,
       disabledRows: Object,
-      selectedRowIds: Array,
+      selectedRowIds: Array
     },
     data() {
       return {
         // 是否收起
-        collapsed: true,
+        collapsed: true
       }
     },
     computed: {
       boxClass() {
         return {
           'j-vxe-toolbar': true,
-          'j-vxe-toolbar-collapsed': this.collapsed,
+          'j-vxe-toolbar-collapsed': this.collapsed
         }
       },
 
       btns() {
         let arr = this.toolbarConfig.btn || ['add', 'remove', 'clearSelection']
         let exclude = [...this.excludeCode]
-        // TODO 需要将remove替换batch_delete
+        // todo 需要将remove替换batch_delete
         // 系统默认的批量删除编码配置为 batch_delete 此处需要转化一下
-        if(exclude.indexOf('batch_delete')>=0){
+        if (exclude.indexOf('batch_delete') >= 0) {
           exclude.push('remove')
         }
         // 按钮权限 需要去掉不被授权的按钮
-        return arr.filter(item=>{
-          return exclude.indexOf(item)<0
+        return arr.filter(item => {
+          return exclude.indexOf(item) < 0
         })
       },
       slots() {
@@ -100,7 +100,7 @@
 
       btnSize() {
         return this.size === 'tiny' ? 'small' : null
-      },
+      }
     },
     methods: {
       /** 触发事件 */
@@ -110,8 +110,8 @@
       // 切换展开收起
       toggleCollapse() {
         this.collapsed = !this.collapsed
-      },
-    },
+      }
+    }
   }
 </script>
 
@@ -125,4 +125,4 @@
   .j-vxe-tool-button.div .ant-btn {
     margin-right: 8px;
   }
-</style>
+</style>

+ 29 - 29
src/components/jeecg/JVxeTable/mixins/JVxeCellMixins.js

@@ -5,7 +5,7 @@ import { getEnhancedMixins, JVXERenderType, replaceProps } from '@/components/je
 // noinspection JSUnusedLocalSymbols
 export default {
   inject: {
-    getParentContainer: {default: () => ((node) => node.parentNode)},
+    getParentContainer: { default: () => (node) => node.parentNode }
   },
   props: {
     value: PropTypes.any,
@@ -16,11 +16,11 @@ export default {
     // 渲染选项
     renderOptions: PropTypes.object,
     // 渲染类型
-    renderType: PropTypes.string.def('default'),
+    renderType: PropTypes.string.def('default')
   },
   data() {
     return {
-      innerValue: null,
+      innerValue: null
     }
   },
   computed: {
@@ -46,7 +46,7 @@ export default {
       return this.params.columnIndex
     },
     cellProps() {
-      let {originColumn: col, renderOptions} = this
+      let { originColumn: col, renderOptions } = this
 
       let props = {}
 
@@ -63,7 +63,7 @@ export default {
       // 判断是否是禁用的列
       props['disabled'] = (typeof col['disabled'] === 'boolean' ? col['disabled'] : props['disabled'])
 
-      // TODO 判断是否是禁用的行
+      // todo 判断是否是禁用的行
       // if (props['disabled'] !== true) {
       //   props['disabled'] = ((this.disabledRowIds || []).indexOf(row.id) !== -1)
       // }
@@ -75,16 +75,16 @@ export default {
 
       // update-begin-author:taoyan date:20211011 for: online表单,附表用户选择器{"multiSelect":false}不生效,单表可以生效 #3036
       let jsonStr = col['fieldExtendJson']
-      if(jsonStr){
+      if (jsonStr) {
         let fieldExtendJson = JSON.parse(jsonStr)
-        if(fieldExtendJson && fieldExtendJson['multiSelect']==false){
+        if (fieldExtendJson && fieldExtendJson['multiSelect'] == false) {
           props['multi'] = false
         }
       }
       // update-end-author:taoyan date:20211011 for: online表单,附表用户选择器{"multiSelect":false}不生效,单表可以生效 #3036
 
       return props
-    },
+    }
   },
   watch: {
     $type: {
@@ -92,7 +92,7 @@ export default {
       handler($type) {
         this.enhanced = getEnhancedMixins($type)
         this.listeners = getListeners.call(this)
-      },
+      }
     },
     value: {
       immediate: true,
@@ -120,8 +120,8 @@ export default {
             this.innerValue = res
           }
         }
-      },
-    },
+      }
+    }
   },
   created() {
   },
@@ -130,7 +130,7 @@ export default {
     /** 通用处理change事件 */
     handleChangeCommon(value) {
       let handle = this.enhanced.getValue.call(this, value)
-      this.trigger('change', {value: handle})
+      this.trigger('change', { value: handle })
       // 触发valueChange事件
       this.parentTrigger('valueChange', {
         type: this.$type,
@@ -138,12 +138,12 @@ export default {
         oldValue: this.value,
         col: this.originColumn,
         rowIndex: this.params.rowIndex,
-        columnIndex: this.params.columnIndex,
+        columnIndex: this.params.columnIndex
       })
     },
     /** 通用处理blur事件 */
     handleBlurCommon(value) {
-      this.trigger('blur', {value})
+      this.trigger('blur', { value })
     },
 
     /**
@@ -168,7 +168,7 @@ export default {
     packageEvent(name, event = {}) {
       event.row = this.row
       event.column = this.column
-      //online增强参数兼容
+      // online增强参数兼容
       event.column['key'] = this.column['property']
       event.cellTarget = this
       if (!event.type) {
@@ -182,7 +182,7 @@ export default {
         event.validate = true
       }
       return event
-    },
+    }
 
   },
   model: {
@@ -200,20 +200,20 @@ export default {
     // 注册参数(详见:https://xuliangzhan_admin.gitee.io/vxe-table/#/table/renderer/edit)
     installOptions: {
       // 自动聚焦的 class 类名
-      autofocus: '',
+      autofocus: ''
     },
     // 事件拦截器(用于兼容)
     interceptor: {
       // 已实现:event.clearActived
       // 说明:比如点击了某个组件的弹出层面板之后,此时被激活单元格不应该被自动关闭,通过返回 false 可以阻止默认的行为。
-      ['event.clearActived'](params, event, target) {
+      'event.clearActived'(params, event, target) {
         return true
       },
       // 自定义:event.clearActived.className
       // 说明:比原生的多了一个参数:className,用于判断点击的元素的样式名(递归到顶层)
-      ['event.clearActived.className'](params, event, target) {
+      'event.clearActived.className'(params, event, target) {
         return true
-      },
+      }
     },
     // 【功能开关】
     switches: {
@@ -221,7 +221,7 @@ export default {
       // 如果设为true,则表头上方会出现一个可编辑的图标
       editRender: true,
       // false = 组件触发后可视);true = 组件一直可视
-      visible: false,
+      visible: false
     },
     // 【切面增强】切面事件处理,一般在某些方法执行后同步执行
     aopEvents: {
@@ -230,7 +230,7 @@ export default {
       },
       // 单元格编辑状态下被关闭时会触发该事件
       editClosed() {
-      },
+      }
     },
     // 【翻译增强】可以实现例如select组件保存的value,但是span模式下需要显示成text
     translate: {
@@ -243,10 +243,10 @@ export default {
        * @param value 需要翻译的值
        * @returns{*} 返回翻译后的数据
        */
-      handler(value,) {
+      handler(value) {
         // 默认翻译方法
         return filterDictText(this.column.own.options, value)
-      },
+      }
     },
     /**
      * 【获取值增强】组件抛出的值
@@ -279,9 +279,9 @@ export default {
      *
      * @returns 返回新值
      */
-    createValue({row, column, $table, renderOptions, params}) {
+    createValue({ row, column, $table, renderOptions, params }) {
       return column.own.defaultValue
-    },
+    }
   }
 }
 
@@ -309,7 +309,7 @@ export function vModel(value, row, property) {
 }
 
 /** 模拟触发事件 */
-export function dispatchEvent({cell, $event}, className, handler) {
+export function dispatchEvent({ cell, $event }, className, handler) {
   // alwaysEdit 下不模拟触发事件,否者会导致触发两次
   if (this && this.alwaysEdit) {
     return
@@ -321,10 +321,10 @@ export function dispatchEvent({cell, $event}, className, handler) {
         handler(element[0])
       } else {
         // 模拟触发点击事件
-        if($event){
+        if ($event) {
           element[0].dispatchEvent($event)
         }
       }
     }
   }, 10)
-}
+}

+ 71 - 73
src/components/jeecgbiz/modal/JSelectUserByDepModal.vue

@@ -33,10 +33,10 @@
               <a-row type="flex" :gutter="8">
                 <a-col :span="18">
                   <a-input-search
-                      :style="{width:'100%'}"
-                      placeholder="请输入账号"
-                      v-model="queryParam.username"
-                      @search="onSearch"
+                    :style="{width:'100%'}"
+                    placeholder="请输入账号"
+                    v-model="queryParam.username"
+                    @search="onSearch"
                   ></a-input-search>
                 </a-col>
                 <a-col :span="6">
@@ -66,7 +66,7 @@
 
 <script>
   import { pushIfNotExist, filterObj } from '@/utils/util'
-  import {queryDepartTreeList, getUserList, queryUserByDepId, queryDepartTreeSync} from '@/api/api'
+  import { queryDepartTreeList, getUserList, queryUserByDepId, queryDepartTreeSync } from '@/api/api'
   import { getAction } from '@/api/manage'
 
   export default {
@@ -76,7 +76,7 @@
     data() {
       return {
         queryParam: {
-          username: "",
+          username: ''
         },
         columns: [
           {
@@ -144,18 +144,18 @@
         expandedKeys: [],
         labelCol: {
           xs: { span: 24 },
-          sm: { span: 4 },
+          sm: { span: 4 }
         },
         wrapperCol: {
           xs: { span: 24 },
-          sm: { span: 10 },
-        },
+          sm: { span: 10 }
+        }
       }
     },
     computed: {
       // 计算属性的 getter
       getType: function () {
-        return this.multi == true ? 'checkbox' : 'radio';
+        return this.multi == true ? 'checkbox' : 'radio'
       }
     },
     watch: {
@@ -164,11 +164,11 @@
         handler() {
           this.initUserNames()
         }
-      },
+      }
     },
     created() {
       // 该方法触发屏幕自适应
-      this.resetScreenSize();
+      this.resetScreenSize()
       this.loadData()
     },
     methods: {
@@ -176,13 +176,13 @@
         if (this.userIds) {
           // 这里最后加一个 , 的原因是因为无论如何都要使用 in 查询,防止后台进行了模糊匹配,导致查询结果不准确
           let values = this.userIds.split(',') + ','
-          let param = {[this.store]: values}
-          getAction('/sys/user/getMultiUser', param).then((list)=>{
+          let param = { [this.store]: values }
+          getAction('/sys/user/getMultiUser', param).then((list) => {
             this.selectionRows = []
             let selectedRowKeys = []
             let textArray = []
-            if(list && list.length>0){
-              for(let user of list){
+            if (list && list.length > 0) {
+              for (let user of list) {
                 textArray.push(user[this.text])
                 selectedRowKeys.push(user['id'])
                 this.selectionRows.push(user)
@@ -191,7 +191,6 @@
             this.selectedRowKeys = selectedRowKeys
             this.$emit('initComp', textArray.join(','))
           })
-
         } else {
           // JSelectUserByDep组件bug issues/I16634
           this.$emit('initComp', '')
@@ -201,11 +200,11 @@
       },
       async loadData(arg) {
         if (arg === 1) {
-          this.ipagination.current = 1;
+          this.ipagination.current = 1
         }
-        let params = this.getQueryParams()//查询条件
+        let params = this.getQueryParams()// 查询条件
         this.loading = true
-        getAction('/sys/user/queryUserComponentData', params).then(res=>{
+        getAction('/sys/user/queryUserComponentData', params).then(res => {
           if (res.success) {
             this.dataSource = res.result.records
             this.ipagination.total = res.result.total
@@ -216,66 +215,66 @@
       },
       // 触发屏幕自适应
       resetScreenSize() {
-        let screenWidth = document.body.clientWidth;
+        let screenWidth = document.body.clientWidth
         if (screenWidth < 500) {
-          this.scrollTrigger = {x: 800};
+          this.scrollTrigger = { x: 800 }
         } else {
-          this.scrollTrigger = {};
+          this.scrollTrigger = {}
         }
       },
       showModal() {
-        this.visible = true;
-        this.queryDepartTree();
+        this.visible = true
+        this.queryDepartTree()
         this.initUserNames()
-        this.loadData();
-        this.form.resetFields();
+        this.loadData()
+        this.form.resetFields()
       },
       getQueryParams() {
-        let param = Object.assign({}, this.queryParam, this.isorter);
-        param.field = this.getQueryField();
-        param.pageNo = this.ipagination.current;
-        param.pageSize = this.ipagination.pageSize;
+        let param = Object.assign({}, this.queryParam, this.isorter)
+        param.field = this.getQueryField()
+        param.pageNo = this.ipagination.current
+        param.pageSize = this.ipagination.pageSize
         param.departId = this.selectedDepIds.join(',')
-        return filterObj(param);
+        return filterObj(param)
       },
       getQueryField() {
-        let str = 'id,';
+        let str = 'id,'
         for (let a = 0; a < this.columns.length; a++) {
-          str += ',' + this.columns[a].dataIndex;
+          str += ',' + this.columns[a].dataIndex
         }
-        return str;
+        return str
       },
       searchReset(num) {
-        let that = this;
-        that.selectedRowKeys = [];
-        that.selectUserIds = [];
-        that.selectedDepIds = [];
+        let that = this
+        that.selectedRowKeys = []
+        that.selectUserIds = []
+        that.selectedDepIds = []
         if (num !== 0) {
-          that.queryParam = {};
-          that.loadData(1);
+          that.queryParam = {}
+          that.loadData(1)
         }
       },
       close() {
-        this.searchReset(0);
-        this.visible = false;
+        this.searchReset(0)
+        this.visible = false
       },
       handleTableChange(pagination, filters, sorter) {
-        //TODO 筛选
+        // todo 筛选
         if (Object.keys(sorter).length > 0) {
-          this.isorter.column = sorter.field;
-          this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc';
+          this.isorter.column = sorter.field
+          this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc'
         }
-        this.ipagination = pagination;
-        this.loadData();
+        this.ipagination = pagination
+        this.loadData()
       },
       handleSubmit() {
-        let that = this;
-        this.getSelectUserRows();
-        that.$emit('ok', that.selectUserRows);
+        let that = this
+        this.getSelectUserRows()
+        that.$emit('ok', that.selectUserRows)
         that.searchReset(0)
-        that.close();
+        that.close()
       },
-      //获取选择用户信息
+      // 获取选择用户信息
       getSelectUserRows() {
         this.selectUserRows = []
         for (let row of this.selectionRows) {
@@ -289,32 +288,32 @@
       onDepSelect(selectedDepIds) {
         if (selectedDepIds[0] != null) {
           if (this.selectedDepIds[0] !== selectedDepIds[0]) {
-            this.selectedDepIds = [selectedDepIds[0]];
+            this.selectedDepIds = [selectedDepIds[0]]
           }
-          this.loadData(1);
+          this.loadData(1)
         }
       },
       onSelectChange(selectedRowKeys, selectionRows) {
-        this.selectedRowKeys = selectedRowKeys;
+        this.selectedRowKeys = selectedRowKeys
         selectionRows.forEach(row => pushIfNotExist(this.selectionRows, row, 'id'))
       },
       onSearch() {
-        this.loadData(1);
+        this.loadData(1)
       },
       // 根据选择的id来查询用户信息
       initQueryUserByDepId(selectedDepIds) {
         this.loading = true
-        return queryUserByDepId({id: selectedDepIds.toString()}).then((res) => {
+        return queryUserByDepId({ id: selectedDepIds.toString() }).then((res) => {
           if (res.success) {
-            this.dataSource = res.result;
-            this.ipagination.total = res.result.length;
+            this.dataSource = res.result
+            this.ipagination.total = res.result.length
           }
         }).finally(() => {
           this.loading = false
         })
       },
       queryDepartTree() {
-        //update-begin-author:taoyan date:20211202 for: 异步加载部门树 https://github.com/jeecgboot/jeecg-boot/issues/3196
+        // update-begin-author:taoyan date:20211202 for: 异步加载部门树 https://github.com/jeecgboot/jeecg-boot/issues/3196
         this.expandedKeys = []
         this.departTree = []
         queryDepartTreeSync().then((res) => {
@@ -326,25 +325,24 @@
           }
         })
       },
-      onLoadDepartment(treeNode){
+      onLoadDepartment(treeNode) {
         return new Promise(resolve => {
-          queryDepartTreeSync({pid:treeNode.dataRef.id}).then((res) =>  {
+          queryDepartTreeSync({ pid: treeNode.dataRef.id }).then((res) => {
             if (res.success) {
-              //判断chidlren是否为空,并修改isLeaf属性值
-              if(res.result.length == 0){
-                treeNode.dataRef['isLeaf']=true
-                return;
-              }else{
-                treeNode.dataRef['children']= res.result;
+              // 判断chidlren是否为空,并修改isLeaf属性值
+              if (res.result.length == 0) {
+                treeNode.dataRef['isLeaf'] = true
+              } else {
+                treeNode.dataRef['children'] = res.result
               }
             }
           })
-          resolve();
-        });
+          resolve()
+        })
       },
-      //update-end-author:taoyan date:20211202 for: 异步加载部门树 https://github.com/jeecgboot/jeecg-boot/issues/3196
+      // update-end-author:taoyan date:20211202 for: 异步加载部门树 https://github.com/jeecgboot/jeecg-boot/issues/3196
       modalFormOk() {
-        this.loadData();
+        this.loadData()
       }
     }
   }

+ 201 - 190
src/mixins/JeecgListMixin.js

@@ -3,318 +3,330 @@
  * 高级查询按钮调用 superQuery方法  高级查询组件ref定义为superQueryModal
  * data中url定义 list为查询列表  delete为删除单条记录  deleteBatch为批量删除
  */
-import { filterObj } from '@/utils/util';
-import { deleteAction, getAction,downFile,getFileAccessHttpUrl } from '@/api/manage'
+import { filterObj } from '@/utils/util'
+import { deleteAction, getAction, downFile, getFileAccessHttpUrl } from '@/api/manage'
 import Vue from 'vue'
-import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types"
+import { ACCESS_TOKEN, TENANT_ID } from '@/store/mutation-types'
 import store from '@/store'
 
 export const JeecgListMixin = {
-  data(){
+  data() {
     return {
       /* 查询条件-请不要在queryParam中声明非字符串值的属性 */
       queryParam: {},
       /* 数据源 */
-      dataSource:[],
+      dataSource: [],
       /* 分页参数 */
-      ipagination:{
+      ipagination: {
         current: 1,
         pageSize: 10,
         pageSizeOptions: ['10', '20', '30'],
         showTotal: (total, range) => {
-          return range[0] + "-" + range[1] + " 共" + total + "条"
+          return range[0] + '-' + range[1] + ' 共' + total + '条'
         },
         showQuickJumper: true,
         showSizeChanger: true,
         total: 0
       },
       /* 排序参数 */
-      isorter:{
+      isorter: {
         column: 'createTime',
-        order: 'desc',
+        order: 'desc'
       },
       /* 筛选参数 */
       filters: {},
       /* table加载状态 */
-      loading:false,
-      /* table选中keys*/
+      loading: false,
+      /* table选中keys */
       selectedRowKeys: [],
-      /* table选中records*/
+      /* table选中records */
       selectionRows: [],
       /* 查询折叠 */
-      toggleSearchStatus:false,
+      toggleSearchStatus: false,
       /* 高级查询条件生效状态 */
-      superQueryFlag:false,
+      superQueryFlag: false,
       /* 高级查询条件 */
       superQueryParams: '',
       /** 高级查询拼接方式 */
-      superQueryMatchType: 'and',
+      superQueryMatchType: 'and'
     }
   },
   created() {
-      if(!this.disableMixinCreated){
-        console.log(' -- mixin created -- ')
-        this.loadData();
-        //初始化字典配置 在自己页面定义
-        this.initDictConfig();
-      }
+    if (!this.disableMixinCreated) {
+      console.log(' -- mixin created -- ')
+      this.loadData()
+      // 初始化字典配置 在自己页面定义
+      this.initDictConfig()
+    }
   },
   computed: {
-    //token header
-    tokenHeader(){
-      let head = {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)}
+    // token header
+    tokenHeader() {
+      let head = { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) }
       let tenantid = Vue.ls.get(TENANT_ID)
-      if(tenantid){
+      if (tenantid) {
         head['tenant-id'] = tenantid
       }
-      return head;
+      return head
     }
   },
-  methods:{
+  methods: {
     loadData(arg) {
-      if(!this.url.list){
-        this.$message.error("请设置url.list属性!")
+      if (!this.url.list) {
+        this.$message.error('请设置url.list属性!')
         return
       }
-      //加载数据 若传入参数1则加载第一页的内容
+      // 加载数据 若传入参数1则加载第一页的内容
       if (arg === 1) {
-        this.ipagination.current = 1;
+        this.ipagination.current = 1
       }
-      var params = this.getQueryParams();//查询条件
-      this.loading = true;
-      getAction(this.url.list, params).then((res) => {
-        if (res.success) {
-          //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
-          this.dataSource = res.result.records||res.result;
-          if(res.result.total)
-          {
-            this.ipagination.total = res.result.total;
-          }else{
-            this.ipagination.total = 0;
+      var params = this.getQueryParams() // 查询条件
+      this.loading = true
+      getAction(this.url.list, params)
+        .then(res => {
+          if (res.success) {
+            // update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
+            this.dataSource = res.result.records || res.result
+            if (res.result.total) {
+              this.ipagination.total = res.result.total
+            } else {
+              this.ipagination.total = 0
+            }
+            // update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
+          } else {
+            this.$message.warning(res.message)
           }
-          //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
-        }else{
-          this.$message.warning(res.message)
-        }
-      }).finally(() => {
-        this.loading = false
-      })
+        })
+        .finally(() => {
+          this.loading = false
+        })
     },
-    initDictConfig(){
-      console.log("--这是一个假的方法!")
+    initDictConfig() {
+      console.log('--这是一个假的方法!')
     },
     handleSuperQuery(params, matchType) {
-      //高级查询方法
-      if(!params){
-        this.superQueryParams=''
+      // 高级查询方法
+      if (!params) {
+        this.superQueryParams = ''
         this.superQueryFlag = false
-      }else{
+      } else {
         this.superQueryFlag = true
-        this.superQueryParams=JSON.stringify(params)
+        this.superQueryParams = JSON.stringify(params)
         this.superQueryMatchType = matchType
       }
       this.loadData(1)
     },
     getQueryParams() {
-      //获取查询条件
+      // 获取查询条件
       let sqp = {}
-      if(this.superQueryParams){
-        sqp['superQueryParams']=encodeURI(this.superQueryParams)
+      if (this.superQueryParams) {
+        sqp['superQueryParams'] = encodeURI(this.superQueryParams)
         sqp['superQueryMatchType'] = this.superQueryMatchType
       }
-      var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
-      param.field = this.getQueryField();
-      param.pageNo = this.ipagination.current;
-      param.pageSize = this.ipagination.pageSize;
-      return filterObj(param);
+      var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters)
+      param.field = this.getQueryField()
+      param.pageNo = this.ipagination.current
+      param.pageSize = this.ipagination.pageSize
+      return filterObj(param)
     },
     getQueryField() {
-      //TODO 字段权限控制
-      var str = "id,";
-      this.columns.forEach(function (value) {
-        str += "," + value.dataIndex;
-      });
-      return str;
+      // TODO: 字段权限控制
+      var str = 'id,'
+      this.columns.forEach(function(value) {
+        str += ',' + value.dataIndex
+      })
+      return str
     },
 
     onSelectChange(selectedRowKeys, selectionRows) {
-      this.selectedRowKeys = selectedRowKeys;
-      this.selectionRows = selectionRows;
+      this.selectedRowKeys = selectedRowKeys
+      this.selectionRows = selectionRows
     },
     onClearSelected() {
-      this.selectedRowKeys = [];
-      this.selectionRows = [];
+      this.selectedRowKeys = []
+      this.selectionRows = []
     },
     searchQuery() {
-      this.loadData(1);
+      this.loadData(1)
       // 点击查询清空列表选中行
       // https://gitee.com/jeecg/jeecg-boot/issues/I4KTU1
       this.selectedRowKeys = []
       this.selectionRows = []
     },
     superQuery() {
-      this.$refs.superQueryModal.show();
+      this.$refs.superQueryModal.show()
     },
     searchReset() {
       this.queryParam = {}
-      this.loadData(1);
+      this.loadData(1)
     },
-    batchDel: function () {
-      if(!this.url.deleteBatch){
-        this.$message.error("请设置url.deleteBatch属性!")
+    batchDel: function() {
+      if (!this.url.deleteBatch) {
+        this.$message.error('请设置url.deleteBatch属性!')
         return
       }
       if (this.selectedRowKeys.length <= 0) {
-        this.$message.warning('请选择一条记录!');
-        return;
+        this.$message.warning('请选择一条记录!')
       } else {
-        var ids = "";
+        var ids = ''
         for (var a = 0; a < this.selectedRowKeys.length; a++) {
-          ids += this.selectedRowKeys[a] + ",";
+          ids += this.selectedRowKeys[a] + ','
         }
-        var that = this;
+        var that = this
         this.$confirm({
-          title: "确认删除",
-          content: "是否删除选中数据?",
-          onOk: function () {
-            that.loading = true;
-            deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => {
-              if (res.success) {
-                //重新计算分页问题
-                that.reCalculatePage(that.selectedRowKeys.length)
-                that.$message.success(res.message);
-                that.loadData();
-                that.onClearSelected();
-              } else {
-                that.$message.warning(res.message);
-              }
-            }).finally(() => {
-              that.loading = false;
-            });
+          title: '确认删除',
+          content: '是否删除选中数据?',
+          onOk: function() {
+            that.loading = true
+            deleteAction(that.url.deleteBatch, { ids: ids })
+              .then(res => {
+                if (res.success) {
+                  // 重新计算分页问题
+                  that.reCalculatePage(that.selectedRowKeys.length)
+                  that.$message.success(res.message)
+                  that.loadData()
+                  that.onClearSelected()
+                } else {
+                  that.$message.warning(res.message)
+                }
+              })
+              .finally(() => {
+                that.loading = false
+              })
           }
-        });
+        })
       }
     },
-    handleDelete: function (id) {
-      if(!this.url.delete){
-        this.$message.error("请设置url.delete属性!")
+    handleDelete: function(id) {
+      if (!this.url.delete) {
+        this.$message.error('请设置url.delete属性!')
         return
       }
-      var that = this;
-      deleteAction(that.url.delete, {id: id}).then((res) => {
+      var that = this
+      deleteAction(that.url.delete, { id: id }).then(res => {
         if (res.success) {
-          //重新计算分页问题
+          // 重新计算分页问题
           that.reCalculatePage(1)
-          that.$message.success(res.message);
-          that.loadData();
+          that.$message.success(res.message)
+          that.loadData()
         } else {
-          that.$message.warning(res.message);
+          that.$message.warning(res.message)
         }
-      });
+      })
     },
-    reCalculatePage(count){
-      //总数量-count
-      let total=this.ipagination.total-count;
-      //获取删除后的分页数
-      let currentIndex=Math.ceil(total/this.ipagination.pageSize);
-      //删除后的分页数<所在当前页
-      if(currentIndex<this.ipagination.current){
-        this.ipagination.current=currentIndex;
+    reCalculatePage(count) {
+      // 总数量-count
+      let total = this.ipagination.total - count
+      // 获取删除后的分页数
+      let currentIndex = Math.ceil(total / this.ipagination.pageSize)
+      // 删除后的分页数<所在当前页
+      if (currentIndex < this.ipagination.current) {
+        this.ipagination.current = currentIndex
       }
-      console.log('currentIndex',currentIndex)
+      console.log('currentIndex', currentIndex)
     },
-    handleEdit: function (record) {
-      this.$refs.modalForm.edit(record);
-      this.$refs.modalForm.title = "编辑";
-      this.$refs.modalForm.disableSubmit = false;
+    handleEdit: function(record) {
+      this.$refs.modalForm.edit(record)
+      this.$refs.modalForm.title = '编辑'
+      this.$refs.modalForm.disableSubmit = false
     },
-    handleAdd: function () {
-      this.$refs.modalForm.add();
-      this.$refs.modalForm.title = "新增";
-      this.$refs.modalForm.disableSubmit = false;
+    handleAdd: function() {
+      this.$refs.modalForm.add()
+      this.$refs.modalForm.title = '新增'
+      this.$refs.modalForm.disableSubmit = false
     },
     handleTableChange(pagination, filters, sorter) {
-      //分页、排序、筛选变化时触发
-      //TODO 筛选
+      // 分页、排序、筛选变化时触发
+      // TODO: 筛选
       console.log(pagination)
       if (Object.keys(sorter).length > 0) {
-        this.isorter.column = sorter.field;
-        this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
+        this.isorter.column = sorter.field
+        this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
       }
-      this.ipagination = pagination;
-      this.loadData();
+      this.ipagination = pagination
+      this.loadData()
     },
-    handleToggleSearch(){
-      this.toggleSearchStatus = !this.toggleSearchStatus;
+    handleToggleSearch() {
+      this.toggleSearchStatus = !this.toggleSearchStatus
     },
     // 给popup查询使用(查询区域不支持回填多个字段,限制只返回一个字段)
-    getPopupField(fields){
+    getPopupField(fields) {
       return fields.split(',')[0]
     },
     modalFormOk() {
       // 新增/修改 成功时,重载列表
-      this.loadData();
-      //清空列表选中
+      this.loadData()
+      // 清空列表选中
       this.onClearSelected()
     },
-    handleDetail:function(record){
-      this.$refs.modalForm.edit(record);
-      this.$refs.modalForm.title="详情";
-      this.$refs.modalForm.disableSubmit = true;
+    handleDetail: function(record) {
+      this.$refs.modalForm.edit(record)
+      this.$refs.modalForm.title = '详情'
+      this.$refs.modalForm.disableSubmit = true
     },
     /* 导出 */
-    handleExportXls2(){
-      let paramsStr = encodeURI(JSON.stringify(this.getQueryParams()));
-      let url = `${window._CONFIG['domianURL']}/${this.url.exportXlsUrl}?paramsStr=${paramsStr}`;
-      window.location.href = url;
+    handleExportXls2() {
+      let paramsStr = encodeURI(JSON.stringify(this.getQueryParams()))
+      let url = `${window._CONFIG['domianURL']}/${this.url.exportXlsUrl}?paramsStr=${paramsStr}`
+      window.location.href = url
     },
-    handleExportXls(fileName){
-      if(!fileName || typeof fileName != "string"){
-        fileName = "导出文件"
+    handleExportXls(fileName) {
+      if (!fileName || typeof fileName !== 'string') {
+        fileName = '导出文件'
       }
-      let param = this.getQueryParams();
-      if(this.selectedRowKeys && this.selectedRowKeys.length>0){
-        param['selections'] = this.selectedRowKeys.join(",")
+      let param = this.getQueryParams()
+      if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
+        param['selections'] = this.selectedRowKeys.join(',')
       }
-      console.log("导出参数",param)
-      downFile(this.url.exportXlsUrl,param).then((data)=>{
+      console.log('导出参数', param)
+      downFile(this.url.exportXlsUrl, param).then(data => {
         if (!data) {
-          this.$message.warning("文件下载失败")
+          this.$message.warning('文件下载失败')
           return
         }
         if (typeof window.navigator.msSaveBlob !== 'undefined') {
-          window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
-        }else{
-          let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
+          window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
+        } else {
+          let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
           let link = document.createElement('a')
           link.style.display = 'none'
           link.href = url
-          link.setAttribute('download', fileName+'.xls')
+          link.setAttribute('download', fileName + '.xls')
           document.body.appendChild(link)
           link.click()
-          document.body.removeChild(link); //下载完成移除元素
-          window.URL.revokeObjectURL(url); //释放掉blob对象
+          document.body.removeChild(link) // 下载完成移除元素
+          window.URL.revokeObjectURL(url) // 释放掉blob对象
         }
       })
     },
     /* 导入 */
-    handleImportExcel(info){
-      this.loading = true;
+    handleImportExcel(info) {
+      this.loading = true
       if (info.file.status !== 'uploading') {
-        console.log(info.file, info.fileList);
+        console.log(info.file, info.fileList)
       }
       if (info.file.status === 'done') {
-        this.loading = false;
+        this.loading = false
         if (info.file.response.success) {
           // this.$message.success(`${info.file.name} 文件上传成功`);
           if (info.file.response.code === 201) {
-            let { message, result: { msg, fileUrl, fileName } } = info.file.response
+            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>
+              content: (
+                <div>
+                  <span>{msg}</span>
+                  <br />
+                  <span>
+                    具体详情请{' '}
+                    <a href={href} target="_blank" download={fileName}>
+                      点击下载
+                    </a>{' '}
+                  </span>
                 </div>
               )
             })
@@ -323,14 +335,14 @@ export const JeecgListMixin = {
           }
           this.loadData()
         } else {
-          this.$message.error(`${info.file.name} ${info.file.response.message}.`);
+          this.$message.error(`${info.file.name} ${info.file.response.message}.`)
         }
       } else if (info.file.status === 'error') {
-        this.loading = false;
+        this.loading = false
         if (info.file.response.status === 500) {
           let data = info.file.response
           const token = Vue.ls.get(ACCESS_TOKEN)
-          if (token && data.message.includes("Token失效")) {
+          if (token && data.message.includes('Token失效')) {
             this.$error({
               title: '登录已过期',
               content: '很抱歉,登录已过期,请重新登录',
@@ -339,36 +351,35 @@ export const JeecgListMixin = {
               onOk: () => {
                 store.dispatch('Logout').then(() => {
                   Vue.ls.remove(ACCESS_TOKEN)
-                  window.location.reload();
+                  window.location.reload()
                 })
               }
             })
           }
         } else {
-          this.$message.error(`文件上传失败: ${info.file.msg} `);
+          this.$message.error(`文件上传失败: ${info.file.msg} `)
         }
       }
     },
     /* 图片预览 */
-    getImgView(text){
-      if(text && text.indexOf(",")>0){
-        text = text.substring(0,text.indexOf(","))
+    getImgView(text) {
+      if (text && text.indexOf(',') > 0) {
+        text = text.substring(0, text.indexOf(','))
       }
       return getFileAccessHttpUrl(text)
     },
     /* 文件下载 */
     // update--autor:lvdandan-----date:20200630------for:修改下载文件方法名uploadFile改为downloadFile------
-    downloadFile(text){
-      if(!text){
-        this.$message.warning("未知的文件")
-        return;
+    downloadFile(text) {
+      if (!text) {
+        this.$message.warning('未知的文件')
+        return
       }
-      if(text.indexOf(",")>0){
-        text = text.substring(0,text.indexOf(","))
+      if (text.indexOf(',') > 0) {
+        text = text.substring(0, text.indexOf(','))
       }
       let url = getFileAccessHttpUrl(text)
-      window.open(url);
-    },
+      window.open(url)
+    }
   }
-
-}
+}

+ 6 - 7
src/store/modules/online.js

@@ -1,25 +1,24 @@
 import Vue from 'vue'
-import { ONL_AUTH_FIELDS } from "@/store/mutation-types"
+import { ONL_AUTH_FIELDS } from '@/store/mutation-types'
 import { getAction } from '@/api/manage'
 
-
 const online = {
   state: {
-    //存储对象属性 value,text
-    authFields: [],
+    // 存储对象属性 value,text
+    authFields: []
   },
   mutations: {
     SET_AUTHFIELDS: (state, fields) => {
-      console.log('fields',fields)
+      console.log('fields', fields)
       Vue.set(state, 'authFields', fields)
     }
   },
   actions: {
-    // TODO 如果没找到可以尝试请求一下
+    // todo 如果没找到可以尝试请求一下
     xxxxxx({ commit }, userInfo) {
     }
 
   }
 }
 
-export default online
+export default online

+ 84 - 87
src/utils/util.js

@@ -12,7 +12,7 @@ export function timeFix() {
 
 export function welcome() {
   const arr = ['休息一会儿吧', '准备吃什么呢?', '要不要打一把 DOTA', '我猜你可能累了']
-  let index = Math.floor((Math.random()*arr.length))
+  let index = Math.floor((Math.random() * arr.length))
   return arr[index]
 }
 
@@ -32,17 +32,17 @@ export function triggerWindowResizeEvent() {
  * @returns {*}
  */
 export function filterObj(obj) {
-  if (!(typeof obj == 'object')) {
-    return;
+  if (!(typeof obj === 'object')) {
+    return
   }
 
-  for ( let key in obj) {
-    if (obj.hasOwnProperty(key)
-      && (obj[key] == null || obj[key] == undefined || obj[key] === '')) {
-      delete obj[key];
+  for (let key in obj) {
+    if (obj.hasOwnProperty(key) &&
+      (obj[key] == null || obj[key] == undefined || obj[key] === '')) {
+      delete obj[key]
     }
   }
-  return obj;
+  return obj
 }
 
 /**
@@ -52,10 +52,10 @@ export function filterObj(obj) {
  * @returns {*}
  */
 export function formatDate(value, fmt) {
-  let regPos = /^\d+(\.\d+)?$/;
-  if(regPos.test(value)){
-    //如果是数字
-    let getDate = new Date(value);
+  let regPos = /^\d+(\.\d+)?$/
+  if (regPos.test(value)) {
+    // 如果是数字
+    let getDate = new Date(value)
     let o = {
       'M+': getDate.getMonth() + 1,
       'd+': getDate.getDate(),
@@ -64,7 +64,7 @@ export function formatDate(value, fmt) {
       's+': getDate.getSeconds(),
       'q+': Math.floor((getDate.getMonth() + 3) / 3),
       'S': getDate.getMilliseconds()
-    };
+    }
     if (/(y+)/.test(fmt)) {
       fmt = fmt.replace(RegExp.$1, (getDate.getFullYear() + '').substr(4 - RegExp.$1.length))
     }
@@ -73,11 +73,11 @@ export function formatDate(value, fmt) {
         fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
       }
     }
-    return fmt;
-  }else{
-    //TODO
-    value = value.trim();
-    return value.substr(0,fmt.length);
+    return fmt
+  } else {
+    // todo
+    value = value.trim()
+    return value.substr(0, fmt.length)
   }
 }
 
@@ -86,96 +86,96 @@ export function generateIndexRouter(data) {
   let indexRouter = [{
     path: '/',
     name: 'dashboard',
-    //component: () => import('@/components/layouts/BasicLayout'),
+    // component: () => import('@/components/layouts/BasicLayout'),
     component: resolve => require(['@/components/layouts/TabLayout'], resolve),
     meta: { title: '首页' },
     redirect: '/dashboard/analysis',
     children: [
       ...generateChildRouters(data)
     ]
-  },{
-    "path": "*", "redirect": "/404", "hidden": true
+  }, {
+    'path': '*', 'redirect': '/404', 'hidden': true
   }]
-  return indexRouter;
+  return indexRouter
 }
 
 // 生成嵌套路由(子路由)
 
-function  generateChildRouters (data) {
-  const routers = [];
+function generateChildRouters (data) {
+  const routers = []
   for (let item of data) {
-    let component = "";
-    if(item.component.indexOf("layouts")>=0){
-      component = "components/"+item.component;
-    }else{
-      component = "views/"+item.component;
+    let component = ''
+    if (item.component.indexOf('layouts') >= 0) {
+      component = 'components/' + item.component
+    } else {
+      component = 'views/' + item.component
     }
 
     // eslint-disable-next-line
     let URL = (item.meta.url|| '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量
     if (isURL(URL)) {
-      item.meta.url = URL;
+      item.meta.url = URL
     }
 
     let componentPath
-    if(item.component=="modules/online/cgform/OnlCgformHeadList"){
+    if (item.component == 'modules/online/cgform/OnlCgformHeadList') {
       componentPath = onlineCommons.OnlCgformHeadList
-    }else if(item.component=="modules/online/cgform/OnlCgformCopyList"){
+    } else if (item.component == 'modules/online/cgform/OnlCgformCopyList') {
       componentPath = onlineCommons.OnlCgformCopyList
-    }else if(item.component=="modules/online/cgform/auto/OnlCgformAutoList"){
+    } else if (item.component == 'modules/online/cgform/auto/OnlCgformAutoList') {
       componentPath = onlineCommons.OnlCgformAutoList
-    }else if(item.component=="modules/online/cgform/auto/OnlCgformTreeList"){
+    } else if (item.component == 'modules/online/cgform/auto/OnlCgformTreeList') {
       componentPath = onlineCommons.OnlCgformTreeList
-    }else if(item.component=="modules/online/cgform/auto/erp/OnlCgformErpList"){
+    } else if (item.component == 'modules/online/cgform/auto/erp/OnlCgformErpList') {
       componentPath = onlineCommons.OnlCgformErpList
-    }else if(item.component=="modules/online/cgform/auto/tab/OnlCgformTabList"){
+    } else if (item.component == 'modules/online/cgform/auto/tab/OnlCgformTabList') {
       componentPath = onlineCommons.OnlCgformTabList
-    }else if(item.component=="modules/online/cgform/auto/innerTable/OnlCgformInnerTableList"){
+    } else if (item.component == 'modules/online/cgform/auto/innerTable/OnlCgformInnerTableList') {
       componentPath = onlineCommons.OnlCgformInnerTableList
-    }else if(item.component=="modules/online/cgreport/OnlCgreportHeadList"){
+    } else if (item.component == 'modules/online/cgreport/OnlCgreportHeadList') {
       componentPath = onlineCommons.OnlCgreportHeadList
-    }else if(item.component=="modules/online/cgreport/auto/OnlCgreportAutoList"){
+    } else if (item.component == 'modules/online/cgreport/auto/OnlCgreportAutoList') {
       componentPath = onlineCommons.OnlCgreportAutoList
-    }else{
-      componentPath = resolve => require(['@/' + component+'.vue'], resolve)
+    } else {
+      componentPath = resolve => require(['@/' + component + '.vue'], resolve)
     }
 
-    let menu =  {
+    let menu = {
       path: item.path,
       name: item.name,
-      redirect:item.redirect,
+      redirect: item.redirect,
       component: componentPath,
-      //component: resolve => require(['@/' + component+'.vue'], resolve),
-      hidden:item.hidden,
-      //component:()=> import(`@/views/${item.component}.vue`),
+      // component: resolve => require(['@/' + component+'.vue'], resolve),
+      hidden: item.hidden,
+      // component:()=> import(`@/views/${item.component}.vue`),
       meta: {
-        title:item.meta.title ,
+        title: item.meta.title,
         icon: item.meta.icon,
-        url:item.meta.url ,
-        permissionList:item.meta.permissionList,
-        keepAlive:item.meta.keepAlive,
-        /*update_begin author:wuxianquan date:20190908 for:赋值 */
-        internalOrExternal:item.meta.internalOrExternal,
-        /*update_end author:wuxianquan date:20190908 for:赋值 */
-        componentName:item.meta.componentName
+        url: item.meta.url,
+        permissionList: item.meta.permissionList,
+        keepAlive: item.meta.keepAlive,
+        /* update_begin author:wuxianquan date:20190908 for:赋值 */
+        internalOrExternal: item.meta.internalOrExternal,
+        /* update_end author:wuxianquan date:20190908 for:赋值 */
+        componentName: item.meta.componentName
       }
     }
-    if(item.alwaysShow){
-      menu.alwaysShow = true;
-      menu.redirect = menu.path;
+    if (item.alwaysShow) {
+      menu.alwaysShow = true
+      menu.redirect = menu.path
     }
     if (item.children && item.children.length > 0) {
-      menu.children = [...generateChildRouters( item.children)];
+      menu.children = [...generateChildRouters(item.children)]
     }
-    //--update-begin----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
-    //判断是否生成路由
-    if(item.route && item.route === '0'){
-      //console.log(' 不生成路由 item.route:  '+item.route);
-      //console.log(' 不生成路由 item.path:  '+item.path);
-    }else{
-      routers.push(menu);
+    // --update-begin----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
+    // 判断是否生成路由
+    if (item.route && item.route === '0') {
+      // console.log(' 不生成路由 item.route:  '+item.route);
+      // console.log(' 不生成路由 item.path:  '+item.path);
+    } else {
+      routers.push(menu)
     }
-    //--update-end----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
+    // --update-end----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
   }
   return routers
 }
@@ -248,10 +248,10 @@ export function randomUUID() {
  * @param string
  * @returns {*}
  */
-export function underLine2CamelCase(string){
-  return string.replace( /_([a-z])/g, function( all, letter ) {
-    return letter.toUpperCase();
-  });
+export function underLine2CamelCase(string) {
+  return string.replace(/_([a-z])/g, function(all, letter) {
+    return letter.toUpperCase()
+  })
 }
 
 /**
@@ -259,11 +259,11 @@ export function underLine2CamelCase(string){
  * @param bpmStatus
  * @returns {*}
  */
-export function showDealBtn(bpmStatus){
-  if(bpmStatus!="1"&&bpmStatus!="3"&&bpmStatus!="4"){
-    return true;
+export function showDealBtn(bpmStatus) {
+  if (bpmStatus != '1' && bpmStatus != '3' && bpmStatus != '4') {
+    return true
   }
-  return false;
+  return false
 }
 
 /**
@@ -273,7 +273,7 @@ export function showDealBtn(bpmStatus){
  */
 export function cssExpand(css, id) {
   let style = document.createElement('style')
-  style.type = "text/css"
+  style.type = 'text/css'
   style.innerHTML = `@charset "UTF-8"; ${css}`
   // 清除旧样式
   if (id) {
@@ -285,7 +285,6 @@ export function cssExpand(css, id) {
   document.head.appendChild(style)
 }
 
-
 /** 用于js增强事件,运行JS代码,可以传参 */
 // options 所需参数:
 //    参数名         类型            说明
@@ -294,10 +293,9 @@ export function cssExpand(css, id) {
 //    jsCode         String          待执行的js代码
 //    errorMessage   String          执行出错后的提示(控制台)
 export function jsExpand(options = {}) {
-
   // 绑定到window上的keyName
   let windowKeyName = 'J_CLICK_EVENT_OPTIONS'
-  if (typeof window[windowKeyName] != 'object') {
+  if (typeof window[windowKeyName] !== 'object') {
     window[windowKeyName] = {}
   }
 
@@ -340,7 +338,6 @@ export function jsExpand(options = {}) {
   document.body.appendChild(script)
 }
 
-
 /**
  * 重复值验证工具方法
  *
@@ -553,14 +550,14 @@ export function neverNull(value, def) {
  */
 export function removeArrayElement(array, prod, value) {
   let index = -1
-  for(let i = 0;i<array.length;i++){
-    if(array[i][prod] == value){
-      index = i;
-      break;
+  for (let i = 0; i < array.length; i++) {
+    if (array[i][prod] == value) {
+      index = i
+      break
     }
   }
-  if(index>=0){
-    array.splice(index, 1);
+  if (index >= 0) {
+    array.splice(index, 1)
   }
 }
 
@@ -623,7 +620,7 @@ export function aspectAroundFunction(obj, funcName, callback) {
         } catch (e) {
           console.error(e)
         }
-      },
+      }
     })
   }
-}
+}

+ 15 - 3
src/views/jeecg/report/ViserChartDemo.vue

@@ -91,9 +91,21 @@
   export default {
     name: 'ViserChartDemo',
     components: {
-      Bar, MiniBar, BarMultid, AreaChartTy, LineChartMultid,
-      Pie, Radar, DashChartDemo, MiniProgress, RankList,
-      TransferBar, Trend, Liquid, MiniArea, BarAndLine
+      Bar,
+MiniBar,
+BarMultid,
+AreaChartTy,
+LineChartMultid,
+      Pie,
+Radar,
+DashChartDemo,
+MiniProgress,
+RankList,
+      TransferBar,
+Trend,
+Liquid,
+MiniArea,
+BarAndLine
     },
     data() {
       return {

+ 63 - 65
src/views/system/DepartList2.vue

@@ -70,19 +70,19 @@
 <script>
   import SysDepartModal from './modules/DepartModal'
   /*  import { filterObj } from '@/utils/util'
-    , queryByFactories*/
-  import {queryDepartTreeList} from '@/api/api'
-  import {deleteAction} from '@/api/manage'
+    , queryByFactories */
+  import { queryDepartTreeList } from '@/api/api'
+  import { deleteAction } from '@/api/manage'
 
   // 表头
   const columns = [
     {
       title: '机构名称',
-      dataIndex: 'departName',
+      dataIndex: 'departName'
     },
     {
       title: '机构类型',
-      align: "center",
+      align: 'center',
       dataIndex: 'orgType'
     },
     {
@@ -108,14 +108,14 @@
     },
     {
       title: '操作',
-      align: "center",
+      align: 'center',
       dataIndex: 'action',
-      scopedSlots: {customRender: 'action'},
+      scopedSlots: { customRender: 'action' }
     }
-  ];
+  ]
 
   export default {
-    name: "DepartList2",
+    name: 'DepartList2',
     components: {
       SysDepartModal
     },
@@ -124,7 +124,7 @@
         description: 'jeecg 生成SysDepart代码管理页面',
         // 查询条件
         queryParam: {},
-        //数据集
+        // 数据集
         factories: '',
         dataSource: [],
         columns: columns,
@@ -139,122 +139,120 @@
                   showQuickJumper: true,
                   showSizeChanger: true,
                   total: 0
-                },*/
+                }, */
         isorter: {
           column: 'createTime',
-          order: 'desc',
+          order: 'desc'
         },
         loading: false,
         selectedRowKeys: [],
         selectedRows: [],
         url: {
-          list: "/sys/sysDepart/list",
-          delete: "/sys/sysDepart/delete",
-          deleteBatch: "/sys/sysDepart/deleteBatch",
-        },
+          list: '/sys/sysDepart/list',
+          delete: '/sys/sysDepart/delete',
+          deleteBatch: '/sys/sysDepart/deleteBatch'
+        }
 
       }
     },
     created() {
-      this.loadData();
+      this.loadData()
     },
     methods: {
       loadData() {
-        this.dataSource = [];
+        this.dataSource = []
         queryDepartTreeList().then((res) => {
           if (res.success) {
-            this.dataSource = res.result;
+            this.dataSource = res.result
           }
         })
-
       },
 
       getQueryField() {
-        //TODO 字段权限控制
-        var str = "id,";
+        // todo 字段权限控制
+        var str = 'id,'
         for (var a = 0; a < this.columns.length; a++) {
-          str += "," + this.columns[a].dataIndex;
+          str += ',' + this.columns[a].dataIndex
         }
-        return str;
+        return str
       },
       onSelectChange(selectedRowKeys, selectionRows) {
-        this.selectedRowKeys = selectedRowKeys;
-        this.selectionRows = selectionRows;
+        this.selectedRowKeys = selectedRowKeys
+        this.selectionRows = selectionRows
       },
       onClearSelected() {
-        this.selectedRowKeys = [];
-        this.selectionRows = [];
+        this.selectedRowKeys = []
+        this.selectionRows = []
       },
-//TODO getQueryParams
+// todo getQueryParams
       handleDelete: function (id) {
-        var that = this;
-        deleteAction(that.url.delete, {id: id}).then((res) => {
+        var that = this
+        deleteAction(that.url.delete, { id: id }).then((res) => {
           if (res.success) {
-            that.$message.success(res.message);
-            that.loadData();
+            that.$message.success(res.message)
+            that.loadData()
           } else {
-            that.$message.warning(res.message);
+            that.$message.warning(res.message)
           }
-        });
+        })
       },
       handleDetail(record) {
-        this.$refs.sysDepartModal.edit(record);
-        this.$refs.sysDepartModal.title = "详情";
-        this.$refs.sysDepartModal.disableSubmit = true;
+        this.$refs.sysDepartModal.edit(record)
+        this.$refs.sysDepartModal.title = '详情'
+        this.$refs.sysDepartModal.disableSubmit = true
       },
       batchDel: function () {
         if (this.selectedRowKeys.length <= 0) {
-          this.$message.warning('请选择一条记录!');
-          return;
+          this.$message.warning('请选择一条记录!')
         } else {
-          var ids = "";
+          var ids = ''
           for (var a = 0; a < this.selectedRowKeys.length; a++) {
-            ids += this.selectedRowKeys[a] + ",";
+            ids += this.selectedRowKeys[a] + ','
           }
-          var that = this;
+          var that = this
           this.$confirm({
-            title: "确认删除",
-            content: "是否删除选中数据?",
+            title: '确认删除',
+            content: '是否删除选中数据?',
             onOk: function () {
-              deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => {
+              deleteAction(that.url.deleteBatch, { ids: ids }).then((res) => {
                 if (res.success) {
-                  that.$message.success(res.message);
-                  that.loadData();
-                  that.onClearSelected();
+                  that.$message.success(res.message)
+                  that.loadData()
+                  that.onClearSelected()
                 } else {
-                  that.$message.warning(res.message);
+                  that.$message.warning(res.message)
                 }
-              });
+              })
             }
-          });
+          })
         }
       },
       handleEdit: function (record) {
-        this.$refs.sysDepartModal.edit(record);
-        this.$refs.sysDepartModal.title = "编辑";
+        this.$refs.sysDepartModal.edit(record)
+        this.$refs.sysDepartModal.title = '编辑'
       },
       handleAdd() {
-        this.$refs.sysDepartModal.add();
-        this.$refs.sysDepartModal.title = "新增";
+        this.$refs.sysDepartModal.add()
+        this.$refs.sysDepartModal.title = '新增'
       },
       handleTableChange(pagination, filters, sorter) {
-        //分页、排序、筛选变化时触发
-        console.log(sorter);
-        //TODO 筛选
+        // 分页、排序、筛选变化时触发
+        console.log(sorter)
+        // todo 筛选
         if (Object.keys(sorter).length > 0) {
-          this.isorter.column = sorter.field;
-          this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
+          this.isorter.column = sorter.field
+          this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
         }
-        /*this.ipagination = pagination;*/
-        this.loadData();
+        /* this.ipagination = pagination; */
+        this.loadData()
       },
       modalFormOk() {
         // 新增/修改 成功时,重载列表
-        this.loadData();
+        this.loadData()
       }
     }
   }
 </script>
 <style scoped>
   @import '~@assets/less/common.less'
-</style>
+</style>

+ 95 - 91
src/views/system/QuartzJobList.vue

@@ -36,7 +36,13 @@
     <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-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">
@@ -75,7 +81,6 @@
           <j-ellipsis :value="text" :length="20" />
         </span>
 
-
         <span slot="action" slot-scope="text, record">
           <a @click="resumeJob(record)" v-if="record.status==-1">启动</a>
           <a @click="pauseJob(record)" v-if="record.status==0">停止</a>
@@ -113,11 +118,11 @@
   import QuartzJobModal from './modules/QuartzJobModal'
   import { getAction } from '@/api/manage'
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-  import JEllipsis from "@/components/jeecg/JEllipsis";
+  import JEllipsis from '@/components/jeecg/JEllipsis'
 
   export default {
-    name: "QuartzJobList",
-    mixins:[JeecgListMixin],
+    name: 'QuartzJobList',
+    mixins: [JeecgListMixin],
     components: {
       QuartzJobModal,
       JEllipsis
@@ -132,159 +137,158 @@
           {
             title: '#',
             dataIndex: '',
-            key:'rowIndex',
-            width:60,
-            align:"center",
-            customRender:function (t,r,index) {
-              return parseInt(index)+1;
+            key: 'rowIndex',
+            width: 60,
+            align: 'center',
+            customRender: function (t, r, index) {
+              return parseInt(index) + 1
             }
           },
           {
             title: '任务类名',
-            align:"center",
+            align: 'center',
             dataIndex: 'jobClassName',
-            sorter: true,
+            sorter: true
 /*            customRender:function (text) {
               return "*"+text.substring(9,text.length);
-            }*/
+            } */
           },
           {
             title: 'cron表达式',
-            align:"center",
+            align: 'center',
             dataIndex: 'cronExpression'
           },
           {
             title: '参数',
-            align:"center",
+            align: 'center',
             width: 150,
             dataIndex: 'parameter',
-            scopedSlots: {customRender: 'parameterRender'},
+            scopedSlots: { customRender: 'parameterRender' }
           },
           {
             title: '描述',
-            align:"center",
+            align: 'center',
             width: 250,
             dataIndex: 'description',
-            scopedSlots: {customRender: 'description'},
+            scopedSlots: { customRender: 'description' }
           },
           {
             title: '状态',
-            align:"center",
+            align: 'center',
             dataIndex: 'status',
             scopedSlots: { customRender: 'customRenderStatus' },
             filterMultiple: false,
             filters: [
               { text: '已启动', value: '0' },
-              { text: '已暂停', value: '-1' },
+              { text: '已暂停', value: '-1' }
             ]
           },
           {
             title: '操作',
             dataIndex: 'action',
-            align:"center",
-            width:180,
-            scopedSlots: { customRender: 'action' },
+            align: 'center',
+            width: 180,
+            scopedSlots: { customRender: 'action' }
           }
         ],
 		url: {
-          list: "/sys/quartzJob/list",
-          delete: "/sys/quartzJob/delete",
-          deleteBatch: "/sys/quartzJob/deleteBatch",
-          pause: "/sys/quartzJob/pause",
-          resume: "/sys/quartzJob/resume",
-          exportXlsUrl: "sys/quartzJob/exportXls",
-          importExcelUrl: "sys/quartzJob/importExcel",
-          execute: "sys/quartzJob/execute"
-        },
+          list: '/sys/quartzJob/list',
+          delete: '/sys/quartzJob/delete',
+          deleteBatch: '/sys/quartzJob/deleteBatch',
+          pause: '/sys/quartzJob/pause',
+          resume: '/sys/quartzJob/resume',
+          exportXlsUrl: 'sys/quartzJob/exportXls',
+          importExcelUrl: 'sys/quartzJob/importExcel',
+          execute: 'sys/quartzJob/execute'
+        }
       }
     },
     computed: {
       importExcelUrl: function () {
-        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
       }
     },
 
     methods: {
 
-      //筛选需要重写handleTableChange
+      // 筛选需要重写handleTableChange
       handleTableChange(pagination, filters, sorter) {
-        //分页、排序、筛选变化时触发
-        //TODO 筛选
+        // 分页、排序、筛选变化时触发
+        // 筛选????
         if (Object.keys(sorter).length > 0) {
-          this.isorter.column = sorter.field;
-          this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
+          this.isorter.column = sorter.field
+          this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
         }
-        //这种筛选方式只支持单选
-        
+        // 这种筛选方式只支持单选
+
         // update-begin-author:liusq date:20210624 for:前台定时任务无法翻页  #2666
-        if(filters && Object.keys(filters).length>0 && filters.status){
-          this.filters.status = filters.status[0];
+        if (filters && Object.keys(filters).length > 0 && filters.status) {
+          this.filters.status = filters.status[0]
         }
         // update-end-author:liusq date:20210624 for:前台定时任务无法翻页  #2666
-        this.ipagination = pagination;
-        this.loadData();
+        this.ipagination = pagination
+        this.loadData()
       },
-      pauseJob: function(record){
-        var that = this;
-        //暂停定时任务
+      pauseJob: function(record) {
+        var that = this
+        // 暂停定时任务
         this.$confirm({
-          title:"确认暂停",
-          content:"是否暂停选中任务?",
-          onOk: function(){
-            getAction(that.url.pause,{id:record.id}).then((res)=>{
-              if(res.success){
-                that.$message.success(res.message);
-                that.loadData();
-                that.onClearSelected();
-              }else{
-                that.$message.warning(res.message);
+          title: '确认暂停',
+          content: '是否暂停选中任务?',
+          onOk: function() {
+            getAction(that.url.pause, { id: record.id }).then((res) => {
+              if (res.success) {
+                that.$message.success(res.message)
+                that.loadData()
+                that.onClearSelected()
+              } else {
+                that.$message.warning(res.message)
               }
-            });
+            })
           }
-        });
-
+        })
       },
-      resumeJob: function(record){
-        var that = this;
-        //恢复定时任务
+      resumeJob: function(record) {
+        var that = this
+        // 恢复定时任务
         this.$confirm({
-          title:"确认启动",
-          content:"是否启动选中任务?",
-          onOk: function(){
-            getAction(that.url.resume,{id:record.id}).then((res)=>{
-              if(res.success){
-                that.$message.success(res.message);
-                that.loadData();
-                that.onClearSelected();
-              }else{
-                that.$message.warning(res.message);
+          title: '确认启动',
+          content: '是否启动选中任务?',
+          onOk: function() {
+            getAction(that.url.resume, { id: record.id }).then((res) => {
+              if (res.success) {
+                that.$message.success(res.message)
+                that.loadData()
+                that.onClearSelected()
+              } else {
+                that.$message.warning(res.message)
               }
-            });
+            })
           }
-        });
+        })
       },
-      executeImmediately(record){
-        var that = this;
-        //立即执行定时任务
+      executeImmediately(record) {
+        var that = this
+        // 立即执行定时任务
         this.$confirm({
-          title:"确认提示",
-          content:"是否立即执行任务?",
-          onOk: function(){
-            getAction(that.url.execute,{id:record.id}).then((res)=>{
-              if(res.success){
-                that.$message.success(res.message);
-                that.loadData();
-                that.onClearSelected();
-              }else{
-                that.$message.warning(res.message);
+          title: '确认提示',
+          content: '是否立即执行任务?',
+          onOk: function() {
+            getAction(that.url.execute, { id: record.id }).then((res) => {
+              if (res.success) {
+                that.$message.success(res.message)
+                that.loadData()
+                that.onClearSelected()
+              } else {
+                that.$message.warning(res.message)
               }
-            });
+            })
           }
-        });
+        })
       }
     }
   }
 </script>
 <style scoped>
   @import '~@assets/less/common.less'
-</style>
+</style>

+ 75 - 74
src/views/system/RoleUserList.vue

@@ -22,11 +22,11 @@
               </a-col>
               -->
               <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
-            <a-col :md="12" :sm="24">
-               <a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 21px">查询</a-button>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
-            </a-col>
-          </span>
+                <a-col :md="12" :sm="24">
+                  <a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 21px">查询</a-button>
+                  <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+                </a-col>
+              </span>
             </a-row>
           </a-form>
         </div>
@@ -34,7 +34,13 @@
         <div class="table-operator" style="margin: 5px 0 10px 2px">
           <a-button @click="handleAdd" type="primary" icon="plus">新建角色</a-button>
           <!--<a-button @click="handleEdit(model1)" type="primary" icon="plus">角色编辑</a-button>-->
-          <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+          <a-upload
+            name="file"
+            :showUploadList="false"
+            :multiple="false"
+            :headers="tokenHeader"
+            :action="importExcelUrl"
+            @change="handleImportExcel">
             <a-button type="primary" icon="import">导入</a-button>
           </a-upload>
           <a-button type="primary" icon="download" @click="handleExportXls('角色管理')">导出</a-button>
@@ -59,30 +65,29 @@
             :loading="loading"
             :rowSelection="{selectedRowKeys: selectedRowKeys1, onChange: onSelectChange1, type:'radio'}"
             @change="handleTableChange">
-          <span slot="action" slot-scope="text, record">
-            <a @click="handleOpen(record)">用户</a>
-            <a-divider type="vertical"/>
+            <span slot="action" slot-scope="text, record">
+              <a @click="handleOpen(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 @click="handlePerssion(record.id)">授权</a>
-                </a-menu-item>
-                <a-menu-item>
-                  <a @click="handleEdit(record)">编辑</a>
-                </a-menu-item>
-                <a-menu-item>
-                  <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete1(record.id)">
-                    <a>删除</a>
-                  </a-popconfirm>
-                </a-menu-item>
-              </a-menu>
-            </a-dropdown>
-        </span>
+              <a-dropdown>
+                <a class="ant-dropdown-link">
+                  更多 <a-icon type="down"/>
+                </a>
+                <a-menu slot="overlay">
+                  <a-menu-item>
+                    <a @click="handlePerssion(record.id)">授权</a>
+                  </a-menu-item>
+                  <a-menu-item>
+                    <a @click="handleEdit(record)">编辑</a>
+                  </a-menu-item>
+                  <a-menu-item>
+                    <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete1(record.id)">
+                      <a>删除</a>
+                    </a-popconfirm>
+                  </a-menu-item>
+                </a-menu>
+              </a-dropdown>
+            </span>
           </a-table>
         </div>
         <!-- 右侧的角色权限配置 -->
@@ -106,12 +111,12 @@
                 </a-form-item>
               </a-col>
               <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
-            <a-col :md="9" :sm="24">
-             <a-button type="primary" @click="searchQuery2" icon="search" style="margin-left: 21px">查询</a-button>
-              <a-button type="primary" @click="searchReset2" icon="reload" style="margin-left: 8px">重置</a-button>
+                <a-col :md="9" :sm="24">
+                  <a-button type="primary" @click="searchQuery2" icon="search" style="margin-left: 21px">查询</a-button>
+                  <a-button type="primary" @click="searchReset2" icon="reload" style="margin-left: 8px">重置</a-button>
 
-            </a-col>
-          </span>
+                </a-col>
+              </span>
             </a-row>
           </a-form>
         </div>
@@ -137,7 +142,7 @@
         <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">{{
-            selectedRowKeys2.length }}</a>项
+              selectedRowKeys2.length }}</a>项
             <a style="margin-left: 24px" @click="onClearSelected2">清空</a>
           </div>
           <a-table
@@ -152,22 +157,22 @@
             :loading="loading2"
             :rowSelection="{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2}"
             @change="handleTableChange2">
-           <span slot="action" slot-scope="text, record">
-           <a @click="handleEdit2(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="() => handleDelete2(record.id)">
-                  <a>删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
-        </span>
+            <span slot="action" slot-scope="text, record">
+              <a @click="handleEdit2(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="() => handleDelete2(record.id)">
+                      <a>删除</a>
+                    </a-popconfirm>
+                  </a-menu-item>
+                </a-menu>
+              </a-dropdown>
+            </span>
           </a-table>
         </div>
         <!-- 表单区域 -->
@@ -245,8 +250,8 @@
         selectedRowKeys2: [],
         selectionRows1: [],
         selectionRows2: [],
-        test:{},
-        rightcolval:0,
+        test: {},
+        rightcolval: 0,
         columns:
           [
             {
@@ -262,7 +267,7 @@
             {
               title: '创建时间',
               dataIndex: 'createTime',
-              align:"center",
+              align: 'center',
               sorter: true,
               customRender: (text) => {
                 return moment(text).format('YYYY-MM-DD')
@@ -355,7 +360,7 @@
       },
 
       getQueryParams2() {
-        //获取查询条件
+        // 获取查询条件
         let sqp = {}
         if (this.superQueryParams2) {
           sqp['superQueryParams'] = encodeURI(this.superQueryParams2)
@@ -368,7 +373,7 @@
         return filterObj(param)
       },
       getQueryField2() {
-        //TODO 字段权限控制
+        // todo 字段权限控制
         var str = 'id,'
         this.columns2.forEach(function(value) {
           str += ',' + value.dataIndex
@@ -386,7 +391,7 @@
         } else {
           this.$refs.modalForm2.roleDisabled = true
           this.$refs.modalForm2.title = '新增'
-          this.$refs.modalForm2.edit({activitiSync:'1',userIdentity:1,selectedroles:this.currentRoleId})
+          this.$refs.modalForm2.edit({ activitiSync: '1', userIdentity: 1, selectedroles: this.currentRoleId })
         }
       },
       modalFormOk2() {
@@ -398,23 +403,21 @@
           this.$message.error('请设置url.list2属性!')
           return
         }
-        //加载数据 若传入参数1则加载第一页的内容
+        // 加载数据 若传入参数1则加载第一页的内容
         if (arg === 1) {
           this.ipagination2.current = 1
         }
         if (this.currentRoleId === '') return
-        let params = this.getQueryParams2()//查询条件
+        let params = this.getQueryParams2()// 查询条件
         params.roleId = this.currentRoleId
         this.loading2 = true
         getAction(this.url.list2, params).then((res) => {
           if (res.success) {
             this.dataSource2 = res.result.records
             this.ipagination2.total = res.result.total
-
           }
           this.loading2 = false
         })
-
       },
       handleDelete1: function(id) {
         this.handleDelete(id)
@@ -437,14 +440,12 @@
         })
       },
       batchDel2: function() {
-
         if (!this.url.deleteBatch2) {
           this.$message.error('请设置url.deleteBatch2属性!')
           return
         }
         if (this.selectedRowKeys2.length <= 0) {
           this.$message.warning('请选择一条记录!')
-          return
         } else {
           var ids = ''
           for (var a = 0; a < this.selectedRowKeys2.length; a++) {
@@ -502,14 +503,14 @@
         this.onClearSelected2()
         this.loadData2()
       },
-      /*handleEdit: function(record) {
+      /* handleEdit: function(record) {
         if (this.currentRoleId == '') {
           this.$message.error('请选择一个角色!')
         } else {
           this.$refs.modalForm.edit(record)
           this.$refs.modalForm.title = '编辑'
         }
-      },*/
+      }, */
       searchQuery2() {
         this.loadData2(1)
       },
@@ -518,22 +519,22 @@
         this.loadData2(1)
       },
       handleTableChange2(pagination, filters, sorter) {
-        //分页、排序、筛选变化时触发
-        //TODO 筛选
+        // 分页、排序、筛选变化时触发
+        // todo 筛选
         if (Object.keys(sorter).length > 0) {
           this.isorter2.column = sorter.field
-          this.isorter2.order = 'ascend' == sorter.order ? 'asc' : 'desc'
+          this.isorter2.order = sorter.order == 'ascend' ? 'asc' : 'desc'
         }
         this.ipagination2 = pagination
         this.loadData2()
       },
-      hideUserList(){
-        //this.rightcolval = 0
+      hideUserList() {
+        // this.rightcolval = 0
         this.selectedRowKeys1 = []
       },
-      handlePerssion(roleId){
-        this.$refs.modalUserRole.show(roleId);
-      },
+      handlePerssion(roleId) {
+        this.$refs.modalUserRole.show(roleId)
+      }
     }
   }
 </script>
@@ -543,4 +544,4 @@
   .ant-btn {
     margin-left: 8px
   }
-</style>
+</style>

+ 2 - 2
src/views/system/UserList.vue

@@ -365,7 +365,7 @@
       },
       handleFrozen: function (id, status, username) {
         let that = this
-        // TODO 后台校验管理员角色
+        //  后台校验管理员角色????
         if (username == 'admin') {
           that.$message.warning('管理员账号不允许此操作!')
           return
@@ -387,7 +387,7 @@
         this.$refs.sysUserAgentModal.title = '用户代理人设置'
       },
       passwordModalOk() {
-        // TODO 密码修改完成 不需要刷新页面,可以把datasource中的数据更新一下
+        // todo 密码修改完成 不需要刷新页面,可以把datasource中的数据更新一下
       },
       onSyncFinally({ isToLocal }) {
         // 同步到本地时刷新下数据

+ 107 - 108
src/views/system/modules/SelectUserListModal.vue

@@ -27,7 +27,6 @@
             </a-form-item>
           </a-col>
 
-
           <template v-if="toggleSearchStatus">
             <a-col :span="6">
               <a-form-item label="邮箱">
@@ -66,7 +65,7 @@
         </a-row>
       </a-form>
     </div>
- <!--    update-begin author:kangxiaolin   date:20190921   for:系统发送通知 用户多选失败 #513  -->
+    <!--    update-begin author:kangxiaolin   date:20190921   for:系统发送通知 用户多选失败 #513  -->
     <a-table
       ref="table"
       rowKey="id"
@@ -76,186 +75,186 @@
       :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
       @change="handleTableChange"
     >
-<!--     update-end   author:kangxiaolin  date:20190921     for:系统发送通知 用户多选失败 #513 -->
+      <!--     update-end   author:kangxiaolin  date:20190921     for:系统发送通知 用户多选失败 #513 -->
     </a-table>
   </a-modal>
 </template>
 
 <script>
-  import { filterObj } from '@/utils/util';
+  import { filterObj } from '@/utils/util'
 
   import { getUserList } from '@/api/api'
 
   export default {
-    name: "SelectUserListModal",
+    name: 'SelectUserListModal',
     components: {
     },
     data () {
       return {
-        title:"选择用户",
+        title: '选择用户',
         queryParam: {},
         columns: [{
           title: '用户账号',
-          align:"center",
+          align: 'center',
           dataIndex: 'username',
-          fixed:'left',
-          width:200
-        },{
+          fixed: 'left',
+          width: 200
+        }, {
           title: '用户名称',
-          align:"center",
-          dataIndex: 'realname',
-        },{
+          align: 'center',
+          dataIndex: 'realname'
+        }, {
           title: '性别',
-          align:"center",
+          align: 'center',
           dataIndex: 'sex',
-          customRender:function (text) {
-            if(text==1){
-              return "男";
-            }else if(text==2){
-              return "女";
-            }else{
-              return text;
+          customRender: function (text) {
+            if (text == 1) {
+              return '男'
+            } else if (text == 2) {
+              return '女'
+            } else {
+              return text
             }
           }
-        },{
+        }, {
           title: '手机号码',
-          align:"center",
+          align: 'center',
           dataIndex: 'phone'
-        },{
+        }, {
           title: '邮箱',
-          align:"center",
+          align: 'center',
           dataIndex: 'email'
-        },{
+        }, {
           title: '状态',
-          align:"center",
+          align: 'center',
           dataIndex: 'status',
-          customRender:function (text) {
-            if(text==1){
-              return "正常";
-            }else if(text==2){
-              return "冻结";
-            }else{
-              return text;
+          customRender: function (text) {
+            if (text == 1) {
+              return '正常'
+            } else if (text == 2) {
+              return '冻结'
+            } else {
+              return text
             }
           }
         }],
-        dataSource:[],
-        ipagination:{
+        dataSource: [],
+        ipagination: {
           current: 1,
           pageSize: 5,
           pageSizeOptions: ['5', '10', '20'],
           showTotal: (total, range) => {
-            return range[0] + "-" + range[1] + " 共" + total + "条"
+            return range[0] + '-' + range[1] + ' 共' + total + '条'
           },
           showQuickJumper: true,
           showSizeChanger: true,
           total: 0
         },
-        isorter:{
+        isorter: {
           column: 'createTime',
-          order: 'desc',
+          order: 'desc'
         },
         selectedRowKeys: [],
         selectionRows: [],
-        visible:false,
-        toggleSearchStatus:false,
+        visible: false,
+        toggleSearchStatus: false
       }
     },
     created() {
-      this.loadData();
+      this.loadData()
     },
     methods: {
-      add (selectUser,userIds) {
-        this.visible = true;
-        this.edit(selectUser,userIds);
+      add (selectUser, userIds) {
+        this.visible = true
+        this.edit(selectUser, userIds)
       },
-      edit(selectUser,userIds){
-        //控制台报错
-        if(userIds&&userIds.length>0){
-          this.selectedRowKeys = userIds.split(',');
-        }else{
+      edit(selectUser, userIds) {
+        // 控制台报错
+        if (userIds && userIds.length > 0) {
+          this.selectedRowKeys = userIds.split(',')
+        } else {
           this.selectedRowKeys = []
         }
-        if(!selectUser){
-          this.selectionRows=[]
-        }else{
-          var that=this;
-          that.selectionRows=[];
-          selectUser.forEach(function(record,index){
+        if (!selectUser) {
+          this.selectionRows = []
+        } else {
+          var that = this
+          that.selectionRows = []
+          selectUser.forEach(function(record, index) {
             console.log(record)
-            that.selectionRows.push({id: that.selectedRowKeys[index],realname:record.label})
+            that.selectionRows.push({ id: that.selectedRowKeys[index], realname: record.label })
           })
           // this.selectionRows = selectUser;
         }
       },
-      loadData (arg){
-        if(arg===1){
-          this.ipagination.current = 1;
+      loadData (arg) {
+        if (arg === 1) {
+          this.ipagination.current = 1
         }
-        let params = this.getQueryParams();//查询条件
-        getUserList(params).then((res)=>{
-          if(res.success){
-            this.dataSource = res.result.records;
-            this.ipagination.total = res.result.total;
+        let params = this.getQueryParams()// 查询条件
+        getUserList(params).then((res) => {
+          if (res.success) {
+            this.dataSource = res.result.records
+            this.ipagination.total = res.result.total
           }
         })
       },
-      getQueryParams(){
-        let param = Object.assign({}, this.queryParam,this.isorter);
-        param.field = this.getQueryField();
-        //--update-begin----author:scott---date:20190818------for:新建公告时指定特定用户翻页错误SelectUserListModal #379----
+      getQueryParams() {
+        let param = Object.assign({}, this.queryParam, this.isorter)
+        param.field = this.getQueryField()
+        // --update-begin----author:scott---date:20190818------for:新建公告时指定特定用户翻页错误SelectUserListModal #379----
         // param.current = this.ipagination.current;
         // param.pageSize = this.ipagination.pageSize;
-        param.pageNo = this.ipagination.current;
-        param.pageSize = this.ipagination.pageSize;
-        //--update-end----author:scott---date:20190818------for:新建公告时指定特定用户翻页错误SelectUserListModal #379---
-        return filterObj(param);
+        param.pageNo = this.ipagination.current
+        param.pageSize = this.ipagination.pageSize
+        // --update-end----author:scott---date:20190818------for:新建公告时指定特定用户翻页错误SelectUserListModal #379---
+        return filterObj(param)
       },
-      getQueryField(){
-        let str = "id,";
-        for(let a = 0;a<this.columns.length;a++){
-          str+=","+this.columns[a].dataIndex;
+      getQueryField() {
+        let str = 'id,'
+        for (let a = 0; a < this.columns.length; a++) {
+          str += ',' + this.columns[a].dataIndex
         }
-        return str;
+        return str
       },
-      //--update-begin----author:kangxiaolin---date:20190921------for:系统发送通知 用户多选失败 #513----
-      onSelectChange (selectedRowKeys,selectionRows) {
-        this.selectedRowKeys = selectedRowKeys;
-        //update-begin---author:wangshuai ---date:20211227  for:全选不好用------------
-        this.selectionRows = selectionRows;
-        //update-end---author:wangshuai ---date:20211227  for:全选不好用------------
+      // --update-begin----author:kangxiaolin---date:20190921------for:系统发送通知 用户多选失败 #513----
+      onSelectChange (selectedRowKeys, selectionRows) {
+        this.selectedRowKeys = selectedRowKeys
+        // update-begin---author:wangshuai ---date:20211227  for:全选不好用------------
+        this.selectionRows = selectionRows
+        // update-end---author:wangshuai ---date:20211227  for:全选不好用------------
       },
-      searchReset(){
-        let that = this;
-        Object.keys(that.queryParam).forEach(function(key){
-          that.queryParam[key] = '';
-        });
-        that.loadData(1);
+      searchReset() {
+        let that = this
+        Object.keys(that.queryParam).forEach(function(key) {
+          that.queryParam[key] = ''
+        })
+        that.loadData(1)
       },
-      handleTableChange(pagination, filters, sorter){
-        //TODO 筛选
-        if (Object.keys(sorter).length>0){
-          this.isorter.column = sorter.field;
-          this.isorter.order = "ascend"==sorter.order?"asc":"desc"
+      handleTableChange(pagination, filters, sorter) {
+        // todo 筛选
+        if (Object.keys(sorter).length > 0) {
+          this.isorter.column = sorter.field
+          this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
         }
-        this.ipagination = pagination;
-        this.loadData();
+        this.ipagination = pagination
+        this.loadData()
       },
       handleCancel () {
-        this.selectionRows = [];
-        this.selectedRowKeys = [];
-        this.visible = false;
+        this.selectionRows = []
+        this.selectedRowKeys = []
+        this.visible = false
       },
       handleOk () {
-        this.$emit("choseUser",this.selectionRows);
-        this.handleCancel();
+        this.$emit('choseUser', this.selectionRows)
+        this.handleCancel()
       },
-      searchByquery(){
-        this.loadData(1);
-      },
-      handleToggleSearch(){
-        this.toggleSearchStatus = !this.toggleSearchStatus;
+      searchByquery() {
+        this.loadData(1)
       },
+      handleToggleSearch() {
+        this.toggleSearchStatus = !this.toggleSearchStatus
+      }
     }
   }
 </script>
@@ -277,4 +276,4 @@
 
   .anty-img-wrap{height:25px;position: relative;}
   .anty-img-wrap > img{max-height:100%;}
-</style>
+</style>

+ 66 - 69
src/views/system/modules/SelectUserModal.vue

@@ -9,10 +9,9 @@
       @cancel="handleCancel"
       cancelText="关闭">
 
-
       <!-- 查询区域 -->
       <div class="table-page-search-wrapper">
-        <a-form layout="inline"  @keyup.enter.native="searchQuery">
+        <a-form layout="inline" @keyup.enter.native="searchQuery">
           <a-row :gutter="24">
 
             <a-col :span="10">
@@ -21,10 +20,10 @@
               </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>
+              <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>
@@ -48,20 +47,19 @@
       </div>
       <!-- table区域-end -->
 
-
     </a-modal>
   </div>
 </template>
 
 <script>
-  import {filterObj} from '@/utils/util'
-  import {getAction} from '@/api/manage'
+  import { filterObj } from '@/utils/util'
+  import { getAction } from '@/api/manage'
 
   export default {
-    name: "SelectUserModal",
+    name: 'SelectUserModal',
     data() {
       return {
-        title: "添加已有用户",
+        title: '添加已有用户',
         names: [],
         visible: false,
         placement: 'right',
@@ -75,38 +73,38 @@
             dataIndex: '',
             key: 'rowIndex',
             width: 50,
-            align: "center",
+            align: 'center',
             customRender: function (t, r, index) {
-              return parseInt(index) + 1;
+              return parseInt(index) + 1
             }
           },
           {
             title: '用户账号',
-            align: "center",
+            align: 'center',
             width: 100,
             dataIndex: 'username'
           },
           {
             title: '用户名称',
-            align: "center",
+            align: 'center',
             width: 100,
             dataIndex: 'realname'
           },
           {
             title: '性别',
-            align: "center",
+            align: 'center',
             width: 100,
             dataIndex: 'sex_dictText'
           },
           {
             title: '电话',
-            align: "center",
+            align: 'center',
             width: 100,
             dataIndex: 'phone'
           },
           {
             title: '部门',
-            align: "center",
+            align: 'center',
             width: 150,
             dataIndex: 'orgCode'
           }
@@ -114,24 +112,24 @@
         columns2: [
           {
             title: '用户账号',
-            align: "center",
-            dataIndex: 'username',
+            align: 'center',
+            dataIndex: 'username'
 
           },
           {
             title: '用户名称',
-            align: "center",
-            dataIndex: 'realname',
+            align: 'center',
+            dataIndex: 'realname'
           },
           {
             title: '操作',
             dataIndex: 'action',
-            align: "center",
+            align: 'center',
             width: 100,
-            scopedSlots: {customRender: 'action'},
+            scopedSlots: { customRender: 'action' }
           }
         ],
-        //数据集
+        // 数据集
         dataSource1: [],
         dataSource2: [],
         // 分页参数
@@ -140,7 +138,7 @@
           pageSize: 10,
           pageSizeOptions: ['10', '20', '30'],
           showTotal: (total, range) => {
-            return range[0] + "-" + range[1] + " 共" + total + "条"
+            return range[0] + '-' + range[1] + ' 共' + total + '条'
           },
           showQuickJumper: true,
           showSizeChanger: true,
@@ -148,107 +146,106 @@
         },
         isorter: {
           column: 'createTime',
-          order: 'desc',
+          order: 'desc'
         },
         loading: false,
         selectedRowKeys: [],
         selectedRows: [],
         url: {
-          list: "/sys/user/list",
+          list: '/sys/user/list'
         }
       }
     },
     created() {
-      this.loadData();
+      this.loadData()
     },
     methods: {
       searchQuery() {
-        this.loadData(1);
+        this.loadData(1)
       },
       searchReset() {
-        this.queryParam = {};
-        this.loadData(1);
+        this.queryParam = {}
+        this.loadData(1)
       },
       handleCancel() {
-        this.visible = false;
+        this.visible = false
       },
       handleOk() {
-        this.dataSource2 = this.selectedRowKeys;
-        console.log("data:" + this.dataSource2);
-        this.$emit("selectFinished", this.dataSource2);
-        this.visible = false;
+        this.dataSource2 = this.selectedRowKeys
+        console.log('data:' + this.dataSource2)
+        this.$emit('selectFinished', this.dataSource2)
+        this.visible = false
       },
       add() {
-        this.visible = true;
+        this.visible = true
       },
       loadData(arg) {
-        //加载数据 若传入参数1则加载第一页的内容
+        // 加载数据 若传入参数1则加载第一页的内容
         if (arg === 1) {
-          this.ipagination.current = 1;
+          this.ipagination.current = 1
         }
-        var params = this.getQueryParams();//查询条件
+        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;
+            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);
+        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 字段权限控制
+        // todo 字段权限控制
       },
       onSelectAll(selected, selectedRows, changeRows) {
         if (selected === true) {
           for (var a = 0; a < changeRows.length; a++) {
-            this.dataSource2.push(changeRows[a]);
+            this.dataSource2.push(changeRows[a])
           }
         } else {
           for (var b = 0; b < changeRows.length; b++) {
-            this.dataSource2.splice(this.dataSource2.indexOf(changeRows[b]), 1);
+            this.dataSource2.splice(this.dataSource2.indexOf(changeRows[b]), 1)
           }
         }
         // console.log(selected, selectedRows, changeRows);
       },
       onSelect(record, selected) {
         if (selected === true) {
-          this.dataSource2.push(record);
+          this.dataSource2.push(record)
         } else {
-          var index = this.dataSource2.indexOf(record);
-          //console.log();
+          var index = this.dataSource2.indexOf(record)
+          // console.log();
           if (index >= 0) {
-            this.dataSource2.splice(this.dataSource2.indexOf(record), 1);
+            this.dataSource2.splice(this.dataSource2.indexOf(record), 1)
           }
-
         }
       },
       onSelectChange(selectedRowKeys, selectedRows) {
-        this.selectedRowKeys = selectedRowKeys;
-        this.selectionRows = selectedRows;
+        this.selectedRowKeys = selectedRowKeys
+        this.selectionRows = selectedRows
       },
       onClearSelected() {
-        this.selectedRowKeys = [];
-        this.selectionRows = [];
+        this.selectedRowKeys = []
+        this.selectionRows = []
       },
       handleDelete: function (record) {
-        this.dataSource2.splice(this.dataSource2.indexOf(record), 1);
+        this.dataSource2.splice(this.dataSource2.indexOf(record), 1)
       },
       handleTableChange(pagination, filters, sorter) {
-        //分页、排序、筛选变化时触发
-        console.log(sorter);
-        //TODO 筛选
+        // 分页、排序、筛选变化时触发
+        console.log(sorter)
+        // todo 筛选
         if (Object.keys(sorter).length > 0) {
-          this.isorter.column = sorter.field;
-          this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
+          this.isorter.column = sorter.field
+          this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
         }
-        this.ipagination = pagination;
-        this.loadData();
+        this.ipagination = pagination
+        this.loadData()
       }
     }
   }
@@ -284,4 +281,4 @@
     height: 90% !important;
     overflow-y: hidden
   }
-</style>
+</style>

+ 186 - 188
src/views/system/modules/UserModal.vue

@@ -47,7 +47,7 @@
         <a-form-model-item label="手机号码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phone">
           <a-input placeholder="请输入手机号码" v-model="model.phone" />
         </a-form-model-item>
-        
+
         <a-form-model-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol">
           <j-select-position placeholder="请选择职务" :multiple="false" v-model="model.post"/>
         </a-form-model-item>
@@ -77,12 +77,12 @@
         </a-form-model-item>
 
         <a-form-model-item label="身份" :labelCol="labelCol" :wrapperCol="wrapperCol">
-          <a-radio-group  v-model="model.userIdentity"  @change="identityChange">
+          <a-radio-group v-model="model.userIdentity" @change="identityChange">
             <a-radio :value="1">普通用户</a-radio>
             <a-radio :value="2">上级</a-radio>
           </a-radio-group>
         </a-form-model-item>
-        <a-form-model-item label="负责部门" :labelCol="labelCol" :wrapperCol="wrapperCol"  v-if="departIdShow==true">
+        <a-form-model-item label="负责部门" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="departIdShow==true">
           <j-multi-select-tag
             :disabled="disableSubmit"
             v-model="model.departIds"
@@ -105,7 +105,7 @@
         </a-form-model-item>
 
         <a-form-model-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol">
-          <a-select  v-model="model.sex"  placeholder="请选择性别" :getPopupContainer= "(target) => target.parentNode">
+          <a-select v-model="model.sex" placeholder="请选择性别" :getPopupContainer="(target) => target.parentNode">
             <a-select-option :value="1">男</a-select-option>
             <a-select-option :value="2">女</a-select-option>
           </a-select>
@@ -120,13 +120,12 @@
         </a-form-model-item>
 
         <a-form-model-item label="工作流引擎" :labelCol="labelCol" :wrapperCol="wrapperCol">
-          <j-dict-select-tag  v-model="model.activitiSync"  placeholder="请选择是否同步工作流引擎" :type="'radio'" dictCode="activiti_sync"/>
+          <j-dict-select-tag v-model="model.activitiSync" placeholder="请选择是否同步工作流引擎" :type="'radio'" dictCode="activiti_sync"/>
         </a-form-model-item>
 
       </a-form-model>
     </a-spin>
 
-
     <div class="drawer-bootom-button" v-show="!disableSubmit">
       <a-popconfirm title="确定放弃编辑?" @confirm="handleCancel" okText="确定" cancelText="取消">
         <a-button style="margin-right: .8rem">取消</a-button>
@@ -139,229 +138,228 @@
 <script>
   import moment from 'moment'
   import Vue from 'vue'
-  import { ACCESS_TOKEN } from "@/store/mutation-types"
+  import { ACCESS_TOKEN } from '@/store/mutation-types'
   import { getAction } from '@/api/manage'
-  import { addUser,editUser,queryUserRole,queryall } from '@/api/api'
-  import { disabledAuthFilter } from "@/utils/authFilter"
-  import { duplicateCheck } from '@/api/api'
+  import { addUser, editUser, queryUserRole, queryall, duplicateCheck } from '@/api/api'
+  import { disabledAuthFilter } from '@/utils/authFilter'
 
   export default {
-    name: "UserModal",
+    name: 'UserModal',
     components: {
     },
     data () {
       return {
-        departDisabled: false, //是否是我的部门调用该页面
-        roleDisabled: false, //是否是角色维护调用该页面
-        modalWidth:800,
-        drawerWidth:700,
-        modaltoggleFlag:true,
+        departDisabled: false, // 是否是我的部门调用该页面
+        roleDisabled: false, // 是否是角色维护调用该页面
+        modalWidth: 800,
+        drawerWidth: 700,
+        modaltoggleFlag: true,
         confirmDirty: false,
-        userId:"", //保存用户id
-        disableSubmit:false,
-        dateFormat:"YYYY-MM-DD",
-        validatorRules:{
-          username:[{required: true, message: '请输入用户账号!'},
-                    {validator: this.validateUsername,}],
-          password: [{required: true,pattern:/^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/,message: '密码由8位数字、大小写字母和特殊符号组成!'},
-                     {validator: this.validateToNextPassword,trigger: 'change'}],
-          confirmpassword: [{required: true, message: '请重新输入登录密码!',},
-                            { validator: this.compareToFirstPassword,}],
-          realname:[{ required: true, message: '请输入用户名称!' }],
-          phone: [{required: true, message: '请输入手机号!'}, {validator: this.validatePhone}],
-          email: [{validator: this.validateEmail}],
-          roles:{},
-          workNo:[ { required: true, message: '请输入工号' },
+        userId: '', // 保存用户id
+        disableSubmit: false,
+        dateFormat: 'YYYY-MM-DD',
+        validatorRules: {
+          username: [{ required: true, message: '请输入用户账号!' },
+                    { validator: this.validateUsername }],
+          password: [{ required: true, pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/, message: '密码由8位数字、大小写字母和特殊符号组成!' },
+                     { validator: this.validateToNextPassword, trigger: 'change' }],
+          confirmpassword: [{ required: true, message: '请重新输入登录密码!' },
+                            { validator: this.compareToFirstPassword }],
+          realname: [{ required: true, message: '请输入用户名称!' }],
+          phone: [{ required: true, message: '请输入手机号!' }, { validator: this.validatePhone }],
+          email: [{ validator: this.validateEmail }],
+          roles: {},
+          workNo: [ { required: true, message: '请输入工号' },
                   { validator: this.validateWorkNo }],
-          telephone: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' },]
+          telephone: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' } ]
         },
-        departIdShow:false,
-        title:"操作",
+        departIdShow: false,
+        title: '操作',
         visible: false,
         model: {},
         labelCol: {
           xs: { span: 24 },
-          sm: { span: 5 },
+          sm: { span: 5 }
         },
         wrapperCol: {
           xs: { span: 24 },
-          sm: { span: 16 },
+          sm: { span: 16 }
         },
-        uploadLoading:false,
+        uploadLoading: false,
         confirmLoading: false,
-        headers:{},
+        headers: {},
         url: {
-          fileUpload: window._CONFIG['domianURL']+"/sys/common/upload",
-          userWithDepart: "/sys/user/userDepartList", // 引入为指定用户查看部门信息需要的url
-          userId:"/sys/user/generateUserId", // 引入生成添加用户情况下的url
-          syncUserByUserName:"/act/process/extActProcess/doSyncUserByUserName",//同步用户到工作流
+          fileUpload: window._CONFIG['domianURL'] + '/sys/common/upload',
+          userWithDepart: '/sys/user/userDepartList', // 引入为指定用户查看部门信息需要的url
+          userId: '/sys/user/generateUserId', // 引入生成添加用户情况下的url
+          syncUserByUserName: '/act/process/extActProcess/doSyncUserByUserName', // 同步用户到工作流
           queryTenantList: '/sys/tenant/queryList'
         },
         tenantsOptions: [],
-        rolesOptions:[],
-        nextDepartOptions:[],
+        rolesOptions: [],
+        nextDepartOptions: []
       }
     },
     created () {
-      const token = Vue.ls.get(ACCESS_TOKEN);
-      this.headers = {"X-Access-Token":token}
+      const token = Vue.ls.get(ACCESS_TOKEN)
+      this.headers = { 'X-Access-Token': token }
       this.initRoleList()
       this.initTenantList()
     },
-    computed:{
-      uploadAction:function () {
-        return this.url.fileUpload;
+    computed: {
+      uploadAction: function () {
+        return this.url.fileUpload
       }
     },
     methods: {
       add () {
-        this.refresh();
-        this.edit({activitiSync:'1',userIdentity:1});
+        this.refresh()
+        this.edit({ activitiSync: '1', userIdentity: 1 })
       },
       edit (record) {
-        let that = this;
-        that.visible = true;
-        //根据屏幕宽度自适应抽屉宽度
-        this.resetScreenSize();
-        that.userId = record.id;
-        that.model = Object.assign({},{selectedroles:'',selecteddeparts:''}, record);
-        //身份为上级显示负责部门,否则不显示
-        if(this.model.userIdentity==2){
-          this.departIdShow=true;
-        }else{
-          this.departIdShow=false;
+        let that = this
+        that.visible = true
+        // 根据屏幕宽度自适应抽屉宽度
+        this.resetScreenSize()
+        that.userId = record.id
+        that.model = Object.assign({}, { selectedroles: '', selecteddeparts: '' }, record)
+        // 身份为上级显示负责部门,否则不显示
+        if (this.model.userIdentity == 2) {
+          this.departIdShow = true
+        } else {
+          this.departIdShow = false
         }
 
-        if(record.hasOwnProperty("id")){
-          that.getUserRoles(record.id);
-          that.getUserDeparts(record.id);
+        if (record.hasOwnProperty('id')) {
+          that.getUserRoles(record.id)
+          that.getUserDeparts(record.id)
         }
-        console.log('that.model=',that.model)
+        console.log('that.model=', that.model)
       },
-      isDisabledAuth(code){
-        return disabledAuthFilter(code);
+      isDisabledAuth(code) {
+        return disabledAuthFilter(code)
       },
-      //窗口最大化切换
-      toggleScreen(){
-        if(this.modaltoggleFlag){
-          this.modalWidth = window.innerWidth;
-        }else{
-          this.modalWidth = 800;
+      // 窗口最大化切换
+      toggleScreen() {
+        if (this.modaltoggleFlag) {
+          this.modalWidth = window.innerWidth
+        } else {
+          this.modalWidth = 800
         }
-        this.modaltoggleFlag = !this.modaltoggleFlag;
+        this.modaltoggleFlag = !this.modaltoggleFlag
       },
       // 根据屏幕变化,设置抽屉尺寸
-      resetScreenSize(){
-        let screenWidth = document.body.clientWidth;
-        if(screenWidth < 500){
-          this.drawerWidth = screenWidth;
-        }else{
-          this.drawerWidth = 700;
+      resetScreenSize() {
+        let screenWidth = document.body.clientWidth
+        if (screenWidth < 500) {
+          this.drawerWidth = screenWidth
+        } else {
+          this.drawerWidth = 700
         }
       },
-      //初始化租户字典
-      initTenantList(){
-        getAction(this.url.queryTenantList).then(res=>{
-          if(res.success){
-            this.tenantsOptions = res.result.map((item,index,arr)=>{
-              let c = {label:item.name, value: item.id+""}
-              return c;
+      // 初始化租户字典
+      initTenantList() {
+        getAction(this.url.queryTenantList).then(res => {
+          if (res.success) {
+            this.tenantsOptions = res.result.map((item, index, arr) => {
+              let c = { label: item.name, value: item.id + '' }
+              return c
             })
-            console.log('this.tenantsOptions: ',this.tenantsOptions)
+            console.log('this.tenantsOptions: ', this.tenantsOptions)
           }
         })
       },
-      //初始化角色字典
-      initRoleList(){
-        queryall().then((res)=>{
-          if(res.success){
-            this.rolesOptions = res.result.map((item,index,arr)=>{
-              let c = {label:item.roleName, value:item.id}
-              return c;
+      // 初始化角色字典
+      initRoleList() {
+        queryall().then((res) => {
+          if (res.success) {
+            this.rolesOptions = res.result.map((item, index, arr) => {
+              let c = { label: item.roleName, value: item.id }
+              return c
             })
-            console.log('this.rolesOptions: ',this.rolesOptions)
+            console.log('this.rolesOptions: ', this.rolesOptions)
           }
-        });
+        })
       },
-      getUserRoles(userid){
-        queryUserRole({userid:userid}).then((res)=>{
-          if(res.success){
-            this.model.selectedroles = res.result.join(",");
-            console.log('that.model.selectedroles=',this.model.selectedroles)
+      getUserRoles(userid) {
+        queryUserRole({ userid: userid }).then((res) => {
+          if (res.success) {
+            this.model.selectedroles = res.result.join(',')
+            console.log('that.model.selectedroles=', this.model.selectedroles)
           }
-        });
+        })
       },
-      getUserDeparts(userid){
-        let that = this;
-        getAction(that.url.userWithDepart,{userId:userid}).then((res)=>{
-          if(res.success){
-            let departOptions=[];
-            let selectDepartKeys=[]
+      getUserDeparts(userid) {
+        let that = this
+        getAction(that.url.userWithDepart, { userId: userid }).then((res) => {
+          if (res.success) {
+            let departOptions = []
+            let selectDepartKeys = []
             for (let i = 0; i < res.result.length; i++) {
-              selectDepartKeys.push(res.result[i].key);
-              //新增负责部门选择下拉框
+              selectDepartKeys.push(res.result[i].key)
+              // 新增负责部门选择下拉框
               departOptions.push({
                 value: res.result[i].key,
                 label: res.result[i].title
               })
             }
-            that.model.selecteddeparts = selectDepartKeys.join(",")
-            that.nextDepartOptions=departOptions;
-            console.log('that.nextDepartOptions=',that.nextDepartOptions)
+            that.model.selecteddeparts = selectDepartKeys.join(',')
+            that.nextDepartOptions = departOptions
+            console.log('that.nextDepartOptions=', that.nextDepartOptions)
           }
         })
       },
       backDepartInfo(info) {
-        this.model.departIds = this.model.selecteddeparts;
-        this.nextDepartOptions = info.map((item,index,arr)=>{
-          let c = {label:item.text, value: item.value+""}
-          return c;
+        this.model.departIds = this.model.selecteddeparts
+        this.nextDepartOptions = info.map((item, index, arr) => {
+          let c = { label: item.text, value: item.value + '' }
+          return c
         })
       },
       refresh () {
-        this.userId=""
-        this.nextDepartOptions=[];
-        this.departIdShow=false;
+        this.userId = ''
+        this.nextDepartOptions = []
+        this.departIdShow = false
       },
       close () {
-        this.$emit('close');
-        this.visible = false;
-        this.disableSubmit = false;
-        this.nextDepartOptions=[];
-        this.departIdShow=false;
-        this.$refs.form.resetFields();
+        this.$emit('close')
+        this.visible = false
+        this.disableSubmit = false
+        this.nextDepartOptions = []
+        this.departIdShow = false
+        this.$refs.form.resetFields()
       },
       moment,
       handleSubmit () {
-        const that = this;
+        const that = this
         // 触发表单验证
         this.$refs.form.validate(valid => {
           if (valid) {
-            that.confirmLoading = true;
-            //如果是上级择传入departIds,否则为空
-            if(this.model.userIdentity!==2){
-              this.model.departIds="";
+            that.confirmLoading = true
+            // 如果是上级择传入departIds,否则为空
+            if (this.model.userIdentity !== 2) {
+              this.model.departIds = ''
             }
-            let obj;
-            if(!this.model.id){
-              this.model.id = this.userId;
-              obj=addUser(this.model);
-            }else{
-              obj=editUser(this.model);
+            let obj
+            if (!this.model.id) {
+              this.model.id = this.userId
+              obj = addUser(this.model)
+            } else {
+              obj = editUser(this.model)
             }
-            obj.then((res)=>{
-              if(res.success){
-                that.$message.success(res.message);
-                that.$emit('ok');
-              }else{
-                that.$message.warning(res.message);
+            obj.then((res) => {
+              if (res.success) {
+                that.$message.success(res.message)
+                that.$emit('ok')
+              } else {
+                that.$message.warning(res.message)
               }
             }).finally(() => {
-              that.confirmLoading = false;
-              that.close();
+              that.confirmLoading = false
+              that.close()
             })
-          }else{
-            return false;
+          } else {
+            return false
           }
         })
       },
@@ -369,116 +367,116 @@
         this.close()
       },
       validateToNextPassword (rule, value, callback) {
-        const confirmpassword=this.model.confirmpassword;
+        const confirmpassword = this.model.confirmpassword
         if (value && confirmpassword && value !== confirmpassword) {
-          callback('两次输入的密码不一样!');
+          callback('两次输入的密码不一样!')
         }
         if (value && this.confirmDirty) {
-          this.$refs.form.validateField(['confirmpassword']);
+          this.$refs.form.validateField(['confirmpassword'])
         }
-        callback();
+        callback()
       },
       compareToFirstPassword (rule, value, callback) {
         if (value && value !== this.model.password) {
-          callback('两次输入的密码不一样!');
+          callback('两次输入的密码不一样!')
         } else {
           callback()
         }
       },
-      validatePhone(rule, value, callback){
-        if(!value){
+      validatePhone(rule, value, callback) {
+        if (!value) {
           callback()
-        }else{
-          if(new RegExp(/^1[3|4|5|7|8|9][0-9]\d{8}$/).test(value)){
+        } else {
+          if (new RegExp(/^1[3|4|5|7|8|9][0-9]\d{8}$/).test(value)) {
             var params = {
               tableName: 'sys_user',
               fieldName: 'phone',
               fieldVal: value,
               dataId: this.userId
-            };
+            }
             duplicateCheck(params).then((res) => {
               if (res.success) {
                 callback()
               } else {
-                callback("手机号已存在!")
+                callback('手机号已存在!')
               }
             })
-          }else{
-            callback("请输入正确格式的手机号码!");
+          } else {
+            callback('请输入正确格式的手机号码!')
           }
         }
       },
-      validateEmail(rule, value, callback){
-        if(!value){
+      validateEmail(rule, value, callback) {
+        if (!value) {
           callback()
-        }else{
-          if(new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(value)){
+        } else {
+          if (new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(value)) {
             var params = {
               tableName: 'sys_user',
               fieldName: 'email',
               fieldVal: value,
               dataId: this.userId
-            };
+            }
             duplicateCheck(params).then((res) => {
               console.log(res)
               if (res.success) {
                 callback()
               } else {
-                callback("邮箱已存在!")
+                callback('邮箱已存在!')
               }
             })
-          }else{
-            callback("请输入正确格式的邮箱!")
+          } else {
+            callback('请输入正确格式的邮箱!')
           }
         }
       },
-      validateUsername(rule, value, callback){
+      validateUsername(rule, value, callback) {
         var params = {
           tableName: 'sys_user',
           fieldName: 'username',
           fieldVal: value,
           dataId: this.userId
-        };
+        }
         duplicateCheck(params).then((res) => {
           if (res.success) {
           callback()
         } else {
-          callback("用户名已存在!")
+          callback('用户名已存在!')
         }
       })
       },
-      validateWorkNo(rule, value, callback){
+      validateWorkNo(rule, value, callback) {
         var params = {
           tableName: 'sys_user',
           fieldName: 'work_no',
           fieldVal: value,
           dataId: this.userId
-        };
+        }
         duplicateCheck(params).then((res) => {
           if (res.success) {
             callback()
           } else {
-            callback("工号已存在!")
+            callback('工号已存在!')
           }
         })
       },
       handleConfirmBlur(e) {
-        const value = e.target.value;
+        const value = e.target.value
         this.confirmDirty = this.confirmDirty || !!value
       },
-      beforeUpload: function(file){
-        var fileType = file.type;
-        if(fileType.indexOf('image')<0){
-          this.$message.warning('请上传图片');
-          return false;
+      beforeUpload: function(file) {
+        var fileType = file.type
+        if (fileType.indexOf('image') < 0) {
+          this.$message.warning('请上传图片')
+          return false
         }
-        //TODO 验证文件大小
+        // todo 验证文件大小
       },
-      identityChange(e){
-        if(e.target.value===1){
-            this.departIdShow=false;
-        }else{
-            this.departIdShow=true;
+      identityChange(e) {
+        if (e.target.value === 1) {
+            this.departIdShow = false
+        } else {
+            this.departIdShow = true
         }
       }
     }

+ 10 - 10
src/views/user/oauth2/OAuth2Login.vue

@@ -21,14 +21,14 @@ export default {
       env: {
         thirdApp: false,
         wxWork: false,
-        dingtalk: false,
-      },
+        dingtalk: false
+      }
     }
   },
   beforeCreate() {
     // 如果当前 不是 OAuth2APP环境,就重定向到 /user/login 页面
     if (!isOAuth2AppEnv()) {
-      this.$router.replace({path: '/user/login'})
+      this.$router.replace({ path: '/user/login' })
     }
   },
   created() {
@@ -83,11 +83,11 @@ export default {
     },
     loginSuccess() {
       // 登陆成功,重定向到主页
-      this.$router.replace({path: INDEX_MAIN_PAGE_PATH})
-      // TODO 这个提示是否还需要?
+      this.$router.replace({ path: INDEX_MAIN_PAGE_PATH })
+
       this.$notification.success({
         message: '欢迎',
-        description: `${timeFix()},欢迎回来`,
+        description: `${timeFix()},欢迎回来`
       })
     },
     requestFailed(err) {
@@ -100,7 +100,7 @@ export default {
         },
         onCancel() {
           window.location.reload()
-        },
+        }
       })
     },
 
@@ -119,12 +119,12 @@ export default {
       let url = `${window._CONFIG['domianURL']}/sys/thirdLogin/oauth2/${source}/login`
       url += `?state=${encodeURIComponent(window.location.origin)}`
       window.location.href = url
-    },
+    }
 
-  },
+  }
 }
 </script>
 
 <style scoped>
 
-</style>
+</style>