| | |
| | | style="width: 100%" |
| | | border |
| | | height="calc(100% - 45px)" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column |
| | | type="selection" |
| | |
| | | <el-table-column |
| | | prop="token" |
| | | :label="$t('operatManage.tokentoolObj.token')" |
| | | /> |
| | | > |
| | | <template slot-scope="scope"> |
| | | |
| | | <span |
| | | style="color: #F56C6C;" |
| | | v-if="!scope.row.status" |
| | | >{{scope.row.token }}</span> |
| | | |
| | | <span v-if="scope.row.status">{{scope.row.token }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="duration" |
| | | width="120" |
| | |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | v-if="scope.row.status" |
| | | type="danger" |
| | | size="small" |
| | | plain |
| | | @click="setExpireById(scope.$index, scope.row)" |
| | | >{{ |
| | | $t("operatManage.tokentoolObj.invalid") |
| | | }}</el-button> |
| | | <el-button |
| | | <!-- <el-button |
| | | type="info" |
| | | size="small" |
| | | plain |
| | | >{{ |
| | | $t("operatManage.tokentoolObj.renewal") |
| | | }}</el-button> |
| | | }}</el-button> --> |
| | | <el-button |
| | | v-if="menuStatus.update" |
| | | @click="handleEdit(scope.$index, scope.row)" |
| | |
| | | :visible.sync="InsertFormdialog" |
| | | :before-close="handleClose" |
| | | > |
| | | <div style="height: 500px; overflow: auto"> |
| | | <div style="height: 300px; overflow: auto"> |
| | | <el-form |
| | | ref="formData1" |
| | | :model="insertform" |
| | | label-position="top" |
| | | > |
| | | <el-form-item |
| | | <!-- <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.token')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | |
| | | :placeholder="$t('common.pleaseInput')" |
| | | style="width:85%" |
| | | /> |
| | | </el-form-item> |
| | | </el-form-item> --> |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.duration')" |
| | | :label-width="formLabelWidth" |
| | |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item |
| | | <!-- <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.ip')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | |
| | | :placeholder="$t('common.pleaseInput')" |
| | | style="width:85%" |
| | | /> |
| | | </el-form-item> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | <div |
| | |
| | | v-model="upform.token" |
| | | :placeholder="$t('common.pleaseInput')" |
| | | style="width:85%" |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | |
| | | v-model="upform.ip" |
| | | :placeholder="$t('common.pleaseInput')" |
| | | style="width:85%" |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | insertToken, |
| | | updateToken, |
| | | deleteTokens, |
| | | token_updateExpireById |
| | | } from "../../api/api.js"; |
| | | export default { |
| | | //import引入的组件需要注入到对象中才能使用 |
| | |
| | | window.removeEventListener("resize", this.onResize); |
| | | }, |
| | | methods: { |
| | | |
| | | async setExpireById(index, row) { |
| | | const data = await token_updateExpireById({ id: row.id }) |
| | | if (data.code == 200) { |
| | | this.$message({ |
| | | message: "成功!", |
| | | type: "success", |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | message: "失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | this.getRoleTabelData(); |
| | | }, |
| | | onResize() { |
| | | this.timer && clearTimeout(this.timer); |
| | | this.timer = setTimeout(() => { |
| | |
| | | }, |
| | | async delTokenData() { |
| | | var std = []; |
| | | if (this.multipleSelection.length <= 0) { |
| | | return this.$message({ |
| | | message: "删除失败,未选择要删除的数据!", |
| | | |
| | | }); |
| | | } |
| | | for (var i in this.multipleSelection) { |
| | | std.push(this.multipleSelection[i].id); |
| | | } |
| | |
| | | if (data.code != 200) { |
| | | this.$message.error("列表调用失败"); |
| | | } |
| | | |
| | | this.tableData = data.result; |
| | | var val = data.result.filter((res) => { |
| | | res.status = false; |
| | | if (res.expire > new Date().getTime()) { |
| | | res.status = true |
| | | } |
| | | return res; |
| | | }) |
| | | this.tableData = val; |
| | | this.count = data.count; |
| | | }, |
| | | handleSizeChange(val) { |