Преглед на файлове

Merge remote-tracking branch 'remotes/github/master'

Mark преди 5 години
родител
ревизия
3f78a0b609

+ 1 - 0
src/components/table-tree-column/index.vue

@ -72,6 +72,7 @@
72 72
        var ids = []
73 73
        for (var i = 0; i < data.length; i++) {
74 74
          if (parentIds.indexOf(data[i][this.parentKey]) !== -1 && parentIds.indexOf(data[i][this.treeKey]) === -1) {
75
            data[i]._expanded = false
75 76
            ids.push(data.splice(i, 1)[0][this.treeKey])
76 77
            i--
77 78
          }

+ 1 - 1
src/icons/index.js

@ -22,6 +22,6 @@ const iconList = svgFiles.keys().map(item => svgFiles(item))
22 22
export default {
23 23
  // 获取图标icon-(*).svg名称列表, 例如[shouye, xitong, zhedie, ...]
24 24
  getNameList () {
25
    return iconList.map(item => item.default.id.split('-')[1])
25
    return iconList.map(item => item.default.id.replace('icon-', ''))
26 26
  }
27 27
}

+ 5 - 0
src/store/modules/common.js

@ -12,6 +12,8 @@ export default {
12 12
    // 侧边栏, 菜单
13 13
    menuList: [],
14 14
    menuActiveName: '',
15
    // 内容, 是否需要刷新
16
    contentIsNeedRefresh: false,
15 17
    // 主入口标签页
16 18
    mainTabs: [],
17 19
    mainTabsActiveName: ''
@ -35,6 +37,9 @@ export default {
35 37
    updateMenuActiveName (state, name) {
36 38
      state.menuActiveName = name
37 39
    },
40
    updateContentIsNeedRefresh (state, status) {
41
      state.contentIsNeedRefresh = status
42
    },
38 43
    updateMainTabs (state, tabs) {
39 44
      state.mainTabs = tabs
40 45
    },

+ 8 - 6
src/views/main-content.vue

@ -13,7 +13,7 @@
13 13
          <el-dropdown-item @click.native="tabsCloseCurrentHandle">关闭当前标签页</el-dropdown-item>
14 14
          <el-dropdown-item @click.native="tabsCloseOtherHandle">关闭其它标签页</el-dropdown-item>
15 15
          <el-dropdown-item @click.native="tabsCloseAllHandle">关闭全部标签页</el-dropdown-item>
16
          <el-dropdown-item @click.native="tabsRefreshCurrentHandle">刷新当前标签页</el-dropdown-item>
16
          <el-dropdown-item @click.native="refresh()">刷新当前标签页</el-dropdown-item>
17 17
        </el-dropdown-menu>
18 18
      </el-dropdown>
19 19
      <el-tab-pane
@ -45,6 +45,7 @@
45 45
<script>
46 46
  import { isURL } from '@/utils/validate'
47 47
  export default {
48
    inject: ['refresh'],
48 49
    data () {
49 50
      return {
50 51
      }
@ -79,7 +80,7 @@
79 80
      selectedTabHandle (tab) {
80 81
        tab = this.mainTabs.filter(item => item.name === tab.name)
81 82
        if (tab.length >= 1) {
82
          this.$router.push({ name: tab[0].name })
83
          this.$router.push({ name: tab[0].name, query: tab[0].query, params: tab[0].params })
83 84
        }
84 85
      },
85 86
      // tabs, 删除tab
@ -88,7 +89,8 @@
88 89
        if (this.mainTabs.length >= 1) {
89 90
          // 当前选中tab被删除
90 91
          if (tabName === this.mainTabsActiveName) {
91
            this.$router.push({ name: this.mainTabs[this.mainTabs.length - 1].name }, () => {
92
            var tab = this.mainTabs[this.mainTabs.length - 1]
93
            this.$router.push({ name: tab.name, query: tab.query, params: tab.params }, () => {
92 94
              this.mainTabsActiveName = this.$route.name
93 95
            })
94 96
          }
@ -113,10 +115,10 @@
113 115
      },
114 116
      // tabs, 刷新当前
115 117
      tabsRefreshCurrentHandle () {
116
        var tempTabName = this.mainTabsActiveName
117
        this.removeTabHandle(tempTabName)
118
        var tab = this.$route
119
        this.removeTabHandle(tab.name)
118 120
        this.$nextTick(() => {
119
          this.$router.push({ name: tempTabName })
121
          this.$router.push({ name: tab.name, query: tab.query, params: tab.params })
120 122
        })
121 123
      }
122 124
    }

+ 3 - 1
src/views/main-sidebar.vue

@ -97,7 +97,9 @@
97 97
              name: route.name,
98 98
              title: route.meta.title,
99 99
              type: isURL(route.meta.iframeUrl) ? 'iframe' : 'module',
100
              iframeUrl: route.meta.iframeUrl || ''
100
              iframeUrl: route.meta.iframeUrl || '',
101
              params: route.params,
102
              query: route.query
101 103
            }
102 104
            this.mainTabs = this.mainTabs.concat(tab)
103 105
          }

+ 12 - 1
src/views/main.vue

@ -8,7 +8,7 @@
8 8
      <main-navbar />
9 9
      <main-sidebar />
10 10
      <div class="site-content__wrapper" :style="{ 'min-height': documentClientHeight + 'px' }">
11
        <main-content />
11
        <main-content v-if="!$store.state.common.contentIsNeedRefresh" />
12 12
      </div>
13 13
    </template>
14 14
  </div>
@ -19,6 +19,17 @@
19 19
  import MainSidebar from './main-sidebar'
20 20
  import MainContent from './main-content'
21 21
  export default {
22
    provide () {
23
      return {
24
        // 刷新
25
        refresh () {
26
          this.$store.commit('common/updateContentIsNeedRefresh', true)
27
          this.$nextTick(() => {
28
            this.$store.commit('common/updateContentIsNeedRefresh', false)
29
          })
30
        }
31
      }
32
    },
22 33
    data () {
23 34
      return {
24 35
        loading: true

+ 0 - 9
src/views/modules/job/schedule-add-or-update.vue

@ -7,9 +7,6 @@
7 7
      <el-form-item label="bean名称" prop="beanName">
8 8
        <el-input v-model="dataForm.beanName" placeholder="spring bean名称, 如: testTask"></el-input>
9 9
      </el-form-item>
10
      <el-form-item label="方法名称" prop="methodName">
11
        <el-input v-model="dataForm.methodName" placeholder="方法名称"></el-input>
12
      </el-form-item>
13 10
      <el-form-item label="参数" prop="params">
14 11
        <el-input v-model="dataForm.params" placeholder="参数"></el-input>
15 12
      </el-form-item>
@ -35,7 +32,6 @@
35 32
        dataForm: {
36 33
          id: 0,
37 34
          beanName: '',
38
          methodName: '',
39 35
          params: '',
40 36
          cronExpression: '',
41 37
          remark: '',
@ -45,9 +41,6 @@
45 41
          beanName: [
46 42
            { required: true, message: '用户名不能为空', trigger: 'blur' }
47 43
          ],
48
          methodName: [
49
            { required: true, message: '方法名称不能为空', trigger: 'blur' }
50
          ],
51 44
          cronExpression: [
52 45
            { required: true, message: 'cron表达式不能为空', trigger: 'blur' }
53 46
          ]
@ -68,7 +61,6 @@
68 61
            }).then(({data}) => {
69 62
              if (data && data.code === 0) {
70 63
                this.dataForm.beanName = data.schedule.beanName
71
                this.dataForm.methodName = data.schedule.methodName
72 64
                this.dataForm.params = data.schedule.params
73 65
                this.dataForm.cronExpression = data.schedule.cronExpression
74 66
                this.dataForm.remark = data.schedule.remark
@ -88,7 +80,6 @@
88 80
              data: this.$http.adornData({
89 81
                'jobId': this.dataForm.id || undefined,
90 82
                'beanName': this.dataForm.beanName,
91
                'methodName': this.dataForm.methodName,
92 83
                'params': this.dataForm.params,
93 84
                'cronExpression': this.dataForm.cronExpression,
94 85
                'remark': this.dataForm.remark,

+ 0 - 6
src/views/modules/job/schedule-log.vue

@ -38,12 +38,6 @@
38 38
        align="center"
39 39
        label="bean名称">
40 40
      </el-table-column>
41
      <el-table-column
42
        prop="methodName"
43
        header-align="center"
44
        align="center"
45
        label="方法名称">
46
      </el-table-column>
47 41
      <el-table-column
48 42
        prop="params"
49 43
        header-align="center"

+ 0 - 6
src/views/modules/job/schedule.vue

@ -39,12 +39,6 @@
39 39
        align="center"
40 40
        label="bean名称">
41 41
      </el-table-column>
42
      <el-table-column
43
        prop="methodName"
44
        header-align="center"
45
        align="center"
46
        label="方法名称">
47
      </el-table-column>
48 42
      <el-table-column
49 43
        prop="params"
50 44
        header-align="center"

+ 19 - 10
src/views/modules/sys/menu-add-or-update.vue

@ -47,14 +47,16 @@
47 47
              placement="bottom-start"
48 48
              trigger="click"
49 49
              popper-class="mod-menu__icon-popover">
50
              <div class="mod-menu__icon-list">
51
                <el-button
52
                  v-for="(item, index) in iconList"
53
                  :key="index"
54
                  @click="iconActiveHandle(item)"
55
                  :class="{ 'is-active': item === dataForm.icon }">
56
                  <icon-svg :name="item"></icon-svg>
57
                </el-button>
50
              <div class="mod-menu__icon-inner">
51
                <div class="mod-menu__icon-list">
52
                  <el-button
53
                    v-for="(item, index) in iconList"
54
                    :key="index"
55
                    @click="iconActiveHandle(item)"
56
                    :class="{ 'is-active': item === dataForm.icon }">
57
                    <icon-svg :name="item"></icon-svg>
58
                  </el-button>
59
                </div>
58 60
              </div>
59 61
            </el-popover>
60 62
            <el-input v-model="dataForm.icon" v-popover:iconListPopover :readonly="true" placeholder="菜单图标名称" class="icon-list__input"></el-input>
@ -223,10 +225,17 @@
223 225
      }
224 226
    }
225 227
    &__icon-popover {
226
      max-width: 370px;
228
      width: 458px;
229
      overflow: hidden;
230
    }
231
    &__icon-inner {
232
      width: 478px;
233
      max-height: 258px;
234
      overflow-x: hidden;
235
      overflow-y: auto;
227 236
    }
228 237
    &__icon-list {
229
      max-height: 180px;
238
      width: 458px;
230 239
      padding: 0;
231 240
      margin: -8px 0 0 -8px;
232 241
      > .el-button {