Tskmgr.vue 15.2 KB
Newer Older
liushikai committed
1
<template>
liuxin committed
2
    <div class="eibs-tab">
liuxin committed
3 4 5 6 7 8 9 10 11 12 13 14 15
        <el-form
            ref="paramsForm"
            label-position="right"
            label-width="110px"
            size="small"
        >
            <c-col :span="24" style="margin-top: 10px">
                <!-- ================左=============== -->
                <c-col :span="8">
                    <c-col :span="24">
                        <el-form-item
                            label="Start Processing"
                            prop="wfetsk.tsklist.strflg"
liuxin committed
16 17
                            style="width: 100%"
                        >
liuxin committed
18 19 20 21
                            <c-select
                                v-model="model.wfetsk.tsklist.strflg"
                                style="width: 100%"
                                placeholder="请选择Automatic Start Flag"
liuxin committed
22
                            >
liuxin committed
23 24 25 26 27 28 29 30 31 32
                                <el-option
                                    v-for="item in codes.strflg"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                >
                                </el-option>
                            </c-select>
                        </el-form-item>
                    </c-col>
liuxin committed
33

liuxin committed
34 35 36 37 38 39 40 41 42 43 44 45
                    <c-col :span="24">
                        <el-form-item
                            label="Ref No"
                            prop="wfetsk.refno"
                            style="width: 100%"
                        >
                            <c-input
                                v-model="model.wfetsk.refno"
                                placeholder="请输入"
                            ></c-input>
                        </el-form-item>
                    </c-col>
liuxin committed
46
                </c-col>
wangren committed
47

liuxin committed
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
                <!-- ================中=============== -->
                <c-col :span="8">
                    <c-col :span="24"
                        ><el-form-item
                            label="Initialization File"
                            prop="wfetsk.tsklist.ininam"
                            style="width: 100%"
                        >
                            <c-input
                                v-model="model.wfetsk.tsklist.ininam"
                                placeholder=""
                                style="width: 100%"
                            ></c-input>
                        </el-form-item>
                    </c-col>
liuxin committed
63

liuxin committed
64 65 66 67
                    <c-col :span="24">
                        <el-form-item
                            label="Restart Period"
                            prop="wfetsk.tsklist.redotime"
liuxin committed
68
                            style="width: 100%"
liuxin committed
69 70 71 72 73 74 75 76
                        >
                            <c-input
                                v-model="model.wfetsk.tsklist.redotime"
                                placeholder="请输入Redotime"
                                style="width: 100%"
                            ></c-input>
                        </el-form-item>
                    </c-col>
liuxin committed
77
                </c-col>
78

liuxin committed
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
                <!-- ================右=============== -->
                <c-col :span="8">
                    <c-col :span="14">
                        <el-form-item
                            label="Started"
                            prop="wfetsk.tsklist.jobstrdat"
                            style="width: 100%"
                        >
                            <c-date-picker
                                type="date"
                                v-model="model.wfetsk.tsklist.jobstrdat"
                                disabled
                                style="width: 100%"
                                placeholder="请选择"
                            ></c-date-picker>
                        </el-form-item>
                    </c-col>
                    <c-col :span="4" :offset="1">
                        <el-form-item
                            label="h"
                            prop="wfetsk.tsklist.jobstrtimhh"
liuxin committed
100
                            label-width="25px"
liuxin committed
101 102 103 104 105 106 107 108 109 110 111 112 113
                            style="width: 100%"
                        >
                            <c-input
                                v-model="model.wfetsk.tsklist.jobstrtimhh"
                                disabled
                                placeholder="请输入"
                                style="width: 100%"
                            ></c-input>
                        </el-form-item>
                    </c-col>
                    <c-col :span="4" :offset="1">
                        <el-form-item
                            label="min"
liuxin committed
114
                            label-width="25px"
liuxin committed
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
                            style="width: 100%"
                        >
                            <c-input
                                v-model="model.wfetsk.tsklist.jobstrtimmm"
                                placeholder="请输入"
                                disabled
                                style="width: 100%"
                            ></c-input>
                        </el-form-item>
                    </c-col>

                    <c-col :span="14">
                        <el-form-item
                            label="Termination"
                            prop="wfetsk.tsklist.terflg"
liuxin committed
130 131
                            style="width: 100%"
                        >
liuxin committed
132 133 134 135
                            <c-select
                                v-model="model.wfetsk.tsklist.terflg"
                                style="width: 100%"
                                placeholder="请选择Automatic Termination Flag"
liuxin committed
136
                            >
liuxin committed
137 138 139 140 141 142 143 144 145 146 147 148 149 150
                                <el-option
                                    v-for="item in codes.terflg"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                >
                                </el-option>
                            </c-select>
                        </el-form-item>
                    </c-col>
                    <c-col :span="4" :offset="1">
                        <el-form-item
                            label="h"
                            prop="wfetsk.tsklist.downtimehh"
liuxin committed
151 152
                            label-width="25px"
                            style="width: 100%"
liuxin committed
153 154 155 156 157 158 159 160
                        >
                            <c-input
                                v-model="model.wfetsk.tsklist.downtimehh"
                                disabled
                                placeholder="请输入"
                            ></c-input>
                        </el-form-item>
                    </c-col>
161

liuxin committed
162
                    <c-col :span="4" :offset="1">
liuxin committed
163
                        <el-form-item label="min" prop="" label-width="25px" style="width: 100%">
liuxin committed
164 165 166 167
                            <c-input
                                v-model="model.wfetsk.tsklist.downtimemm"
                                disabled
                                placeholder=""
liuxin committed
168
                                style="width: 100%"
liuxin committed
169 170 171
                            ></c-input>
                        </el-form-item>
                    </c-col>
liuxin committed
172
                </c-col>
liuxin committed
173 174 175 176 177
            </c-col>
            <c-col :span="24" style="text-align: right">
                <c-button
                    size="small"
                    type="primary"
178
                    style="margin-left: 10px"
liuxin committed
179 180 181 182 183 184 185
                    :disabled="buttonFlag"
                    @click="Update"
                    >Update</c-button
                >
                <c-button
                    size="small"
                    type="primary"
186
                    style="margin-left: 10px"
liuxin committed
187 188 189 190 191 192 193
                    :disabled="buttonFlag"
                    @click="Start"
                    >Start</c-button
                >
                <c-button
                    size="small"
                    type="primary"
194
                    style="margin-left: 10px"
liuxin committed
195 196 197 198 199 200 201 202 203 204
                    :disabled="!buttonFlag"
                    @click="Stop"
                    >Stop</c-button
                >
            </c-col>
        </el-form>

        <c-col :span="24" style="margin-top:12px">
            <div style="border-bottom: 10px solid rgb(232, 232, 232)"></div>
        </c-col>
wangren committed
205

liuxin committed
206
        <!-- <c-col :span="16">
207 208 209 210 211 212 213
          <span
            v-text="model.wfetsk.tsklist.ininam"
            data-path=".wfetsk.tsklist.ininam"
          >
            Initialization File
          </span>
        </c-col> -->
liuxin committed
214
        <!-- <c-col :span="12">
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
      <el-form-item label="Automatic Start Flag" prop="wfetsk.tsklist.strflg">
        <c-select
          v-model="model.wfetsk.tsklist.strflg"
          style="width: 100%"
          placeholder="请选择Automatic Start Flag"
        >
        </c-select>
      </el-form-item>
    </c-col>

    <c-col :span="12">
      <c-button size="small" type="primary" @click="onTsklistButstr">
        &Start
      </c-button>
    </c-col>

    <c-col :span="12">
      <c-button size="small" type="primary" @click="onTsklistButstp">
        S&top
      </c-button>
    </c-col>

    <c-col :span="12">
      <span
        v-text="model.wfetsk.tsklist.bcklab"
        data-path=".wfetsk.tsklist.bcklab"
      >
      </span>
    </c-col>

    <c-col :span="12">
      <span v-text="model.wfetsk.labetyextkey" data-path=".wfetsk.labetyextkey">
      </span>
    </c-col>

    <c-col :span="12">
      <el-form-item label="Selected Entity ID" prop="wfetsk.seletyextkey">
        <c-select
          v-model="model.wfetsk.seletyextkey"
          style="width: 100%"
          placeholder="请选择Selected Entity ID"
        >
        </c-select>
      </el-form-item>
    </c-col>

    <c-col :span="12">
      <span
        v-text="model.wfetsk.tsklist.timzonlab"
        data-path=".wfetsk.tsklist.timzonlab"
      >
      </span>
    </c-col>

    <c-col :span="12">
      <span v-text="model.wfetsk.labetgextkey" data-path=".wfetsk.labetgextkey">
      </span>
    </c-col>

    <c-col :span="12">
      <el-form-item label="Selected Entity Group" prop="wfetsk.seletgextkey">
        <c-input
          v-model="model.wfetsk.seletgextkey"
          maxlength="8"
          placeholder="请输入Selected Entity Group"
        ></c-input>
      </el-form-item>
    </c-col>

    <c-col :span="12">
      <el-form-item label="Stream of WFE entries" prop="wfetsk.wfestm">
        <c-input
          v-model="model.wfetsk.wfestm"
          placeholder="请输入Stream of WFE entries"
        ></c-input>
      </el-form-item>
    </c-col>

    <c-col :span="12">
      <c-button size="small" type="primary" @click="onTsklistButexe">
        &Do Entry
      </c-button>
    </c-col>

    <c-col :span="12">
      <c-button size="small" type="primary" @click="onTsklistButupd">
        &Upd. List
      </c-button>
    </c-col>

    <c-col :span="12">
      <c-button size="small" type="primary" @click="onLogdspButdsp">
        &View Log
      </c-button>
    </c-col>

    <c-col :span="12">
      <c-button size="small" type="primary" @click="onTsklistButexi">
        E&xit
      </c-button>
    </c-col> -->
liuxin committed
316
        <c-col :span="24">
liuxin committed
317
            <c-istream-table :list="stmData.data" :columns="stmData.columns">
liuxin committed
318
                <el-table-column fixed="right" label="操作">
liuxin committed
319 320 321 322
                    <template slot-scope="scope">
                        <el-button
                            size="mini"
                            type="primary"
liuxin committed
323 324
                            :disabled="buttonFlag"
                            @click="Entry(scope.$index, scope.row)"
liuxin committed
325 326 327 328 329 330 331
                            >Entry</el-button
                        >
                    </template>
                </el-table-column>
            </c-istream-table>
        </c-col>
    </div>
liushikai committed
332 333
</template>
<script>
334
import Api from "~/service/Api";
wangren committed
335
import commonProcess from "~/mixin/commonProcess";
336 337
import CodeTable from "~/config/CodeTable";
import Event from "~/model/Mgrtsk/Event";
liuxin committed
338
import Utils from "~/utils/index";
liushikai committed
339 340

export default {
liuxin committed
341 342 343 344 345 346
    inject: ["root"],
    props: ["model", "codes"],
    mixins: [commonProcess],
    data() {
        return {
            stmData: {
liuxin committed
347
                columns: [
liuxin committed
348 349 350 351 352 353
                    '8 1 "Entity" 100 1 0',
                    '7 2 "Object Identification" 390 1 0',
                    '6 3 "Ident" 100 1 0',
                    '1 4 "Service" 100 1 0 3 SRVTXT',
                    '2 5 "Status" 100 1 0 2 WFE:STA',
                    '3 6 "Retries" 100 2 20:1 1 FormatRTR',
liuxin committed
354
                    '4 7 "Target" 200 20 30 1',
liuxin committed
355
                ],
liuxin committed
356
                data: [],
liuxin committed
357
            },
liuxin committed
358 359
            buttonFlag: false,
            timer: null,
liuxin committed
360
        };
liuxin committed
361
    },
liuxin committed
362 363
    methods: {
        ...Event,
364
        async Entry(idx, row) {
liuxin committed
365 366 367
            const selIds = [idx + 1];
            const selDst = "wfetsk.wfestm"; //列表对应后台模型中的stream
            let params = { selDst, selIds };
368
            await this.executeRule("wfetsk.tsklist.butexe", params).then((res) => {
liuxin committed
369
                if (res.respCode == SUCCESS) {
370
                    this.Update();
liuxin committed
371 372 373 374 375 376 377 378 379 380 381 382 383
                } else {
                    const h = this.$createElement;
                    const msg = res.respMsg || "请求执行失败!";
                    this.$notify.error({
                        title: "错误",
                        message: h(
                            "p",
                            { style: "word-break:break-all;" },
                            msg
                        ),
                    });
                }
            });
liuxin committed
384
        },
385 386
        async Update() {
            let rtnmsg = await this.executeRule("wfetsk.tsklist.butupd");
liuxin committed
387 388
            if (rtnmsg.respCode == SUCCESS) {
                //TODO 处理数据逻辑
389 390
                // Utils.copyValueFromVO(this.model, rtnmsg.data);
                this.stmData.data = rtnmsg.data.wfetsk_wfestm.rows;
liuxin committed
391 392
            }
        },
393
        async Start() {
394
            this.buttonFlag = true;
395
            let rtnmsg = await this.executeRule("wfetsk.tsklist.butstr");
liuxin committed
396 397
            if (rtnmsg.respCode == SUCCESS) {
                //TODO 处理数据逻辑
398
                this.stmData.data = rtnmsg.data.wfetsk_wfestm.rows;
liuxin committed
399
            }
400 401 402
            //定时任务
            var timeVal = this.model.wfetsk.tsklist.redotime * 1000;
            var that = this;
403 404
            this.timer = setInterval(async function () {
                let rtnmsg = await that.executeRule("wfetsk.tsklist.butstr");
liuxin committed
405 406
                if (rtnmsg.respCode == SUCCESS) {
                    //TODO 处理数据逻辑
407
                    that.stmData.data = rtnmsg.data.wfetsk_wfestm.rows;
liuxin committed
408
                }
409
            }, timeVal);
liuxin committed
410
        },
411
        async Stop() {
412 413
            this.buttonFlag = false;
            clearInterval(this.timer);
414
            let rtnmsg = await this.executeRule("wfetsk.tsklist.butstp");
liuxin committed
415 416
            if (rtnmsg.respCode == SUCCESS) {
                //TODO 处理数据逻辑
417
                this.stmData.data = rtnmsg.data.wfetsk_wfestm.rows;
liuxin committed
418 419 420 421 422 423 424 425
            }
        },
    },
    created: function () {},
    watch: {
        "model.wfetsk.wfestm": function () {
            this.stmData.data = this.model.wfetsk.wfestm.rows;
        },
liuxin committed
426
    },
427
};
liushikai committed
428
</script>
liuxin committed
429 430 431 432
<style scope>
/* .m-table-search-form .el-form-item__content {
  width: calc(100% - 110px);
} */
liushikai committed
433
</style>