Commit 3b4c3251 authored by gongzijian's avatar gongzijian
Browse files

add remove Timing

parent 7b3ab01e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
# 后端接口地址
#API_BASE = http://192.168.221.188:12345
API_BASE = http://192.168.221.188:12345

API_BASE = http://192.168.220.154:12345
#API_BASE = http://192.168.220.154:12345

# 本地开发如需ip访问项目把"#"号去掉
#DEV_HOST = 192.168.xx.xx
+2 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
          </th>
        </tr>
        <tr v-for="(item, $index) in list" :key="item.id">
          <td width="50"><x-checkbox v-model="item.isCheck" @on-change="_arrDelChange"></x-checkbox></td>
          <td width="50"><x-checkbox v-model="item.isCheck" :disabled="item.releaseState === 'OFFLINE'" @on-change="_arrDelChange"></x-checkbox></td>
          <td width="50">
            <span>{{parseInt(pageNo === 1 ? ($index + 1) : (($index + 1) + (pageSize * (pageNo - 1))))}}</span>
          </td>
@@ -79,6 +79,7 @@
                  type="error"
                  shape="circle"
                  size="xsmall"
                  :disabled="item.releaseState === 'OFFLINE'"
                  data-toggle="tooltip"
                  :title="$t('delete')"
                  v-ps="['GENERAL_USER']">
+45 −2
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@
              <th>
                <span>{{$t('Update Time')}}</span>
              </th>
              <th width="80">
              <th width="120">
                <span>{{$t('Operation')}}</span>
              </th>
            </tr>
@@ -98,6 +98,28 @@
                        @click="_offline(item)"
                        v-if="item.releaseState === 'ONLINE'">
                </x-button>
                <x-poptip
                        :ref="'poptip-delete-' + $index"
                        placement="bottom-end"
                        width="90">
                  <p>{{$t('Delete?')}}</p>
                  <div style="text-align: right; margin: 0;padding-top: 4px;">
                    <x-button type="text" size="xsmall" shape="circle" @click="_closeDelete($index)">{{$t('Cancel')}}</x-button>
                    <x-button type="primary" size="xsmall" shape="circle" @click="_delete(item,$index)">{{$t('Confirm')}}</x-button>
                  </div>
                  <template slot="reference">
                    <x-button
                            icon="iconfont icon-shanchu"
                            type="error"
                            shape="circle"
                            size="xsmall"
                            :disabled="item.releaseState === 'ONLINE'"
                            data-toggle="tooltip"
                            :title="$t('delete')"
                            v-ps="['GENERAL_USER']">
                    </x-button>
                  </template>
                </x-poptip>
              </td>
            </tr>
          </table>
@@ -135,7 +157,28 @@
    props: {
    },
    methods: {
      ...mapActions('dag', ['getScheduleList', 'scheduleOffline', 'scheduleOnline', 'getReceiver']),
      ...mapActions('dag', ['getScheduleList', 'scheduleOffline', 'scheduleOnline', 'getReceiver','deleteTiming']),
      /**
       * delete
       */
      _delete (item, i) {
        this.deleteTiming({
          scheduleId: item.id
        }).then(res => {
          this.$refs[`poptip-delete-${i}`][0].doClose()
          this.$message.success(res.msg)
          this.$router.push({ name: 'projects-definition-list' })
        }).catch(e => {
          this.$refs[`poptip-delete-${i}`][0].doClose()
          this.$message.error(e.msg || '')
        })
      },
      /**
       * Close the delete layer
       */
      _closeDelete (i) {
        this.$refs[`poptip-delete-${i}`][0].doClose()
      },
      /**
       * return state
       */
+12 −0
Original line number Diff line number Diff line
@@ -589,5 +589,17 @@ export default {
        reject(e)
      })
    })
  },
  /**
   * remove timing
   */
  deleteTiming({ state }, payload){
    return new Promise((resolve, reject) => {
      io.get(`projects/${state.projectName}/schedule/delete`, payload, res => {
        resolve(res)
      }).catch(e => {
        reject(e)
      })
    })
  }
}