| | |
| | | `${$t('operatManage.tokentool')}`, |
| | | ]"></My-bread> |
| | | <el-divider /> |
| | | <div class="inquire subpage_Div"> |
| | | <div |
| | | class="inquire subpage_Div" |
| | | ref="container" |
| | | > |
| | | <el-form |
| | | ref="formData" |
| | | :model="ruleForm" |
| | | :inline="true" |
| | | > |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.tokenQuery')" |
| | | prop="region" |
| | | > |
| | | <el-input |
| | | style="width: 200px" |
| | | v-model="ruleForm.name" |
| | | :placeholder="$t('common.pleaseInput')" |
| | | /> |
| | | </el-form-item> |
| | | <div class="flex_box"> |
| | | <div style="margin-right: auto"> |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.tokenQuery')" |
| | | prop="region" |
| | | > |
| | | <el-input |
| | | style="width: 200px" |
| | | size="small" |
| | | v-model="ruleForm.name" |
| | | :placeholder="$t('operatManage.tokentoolObj.tokenHolder')" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item :label="$t('operatManage.tokentoolObj.tokenStatus')"> |
| | | <el-select |
| | | style="width:200px" |
| | | :popper-append-to-body="false" |
| | | v-model="ruleForm.value" |
| | | :placeholder="$t('common.choose')" |
| | | > |
| | | <el-option |
| | | value="0" |
| | | :label="$t('operatManage.tokentoolObj.temporary')" |
| | | ></el-option> |
| | | <el-option |
| | | value="1" |
| | | :label="$t('operatManage.tokentoolObj.fixed')" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <!-- 查询 清空 --> |
| | | <el-form-item style="float:right"> |
| | | <el-button |
| | | v-if="menuStatus.insert" |
| | | @click="InsertFormdialog = true" |
| | | icon="el-icon-edit" |
| | | type="success" |
| | | size="small" |
| | | >{{ $t('common.append') }}</el-button> |
| | | <el-button |
| | | v-if="menuStatus.delete" |
| | | @click="delTokenData" |
| | | icon="el-icon-delete" |
| | | type="danger" |
| | | size="small" |
| | | >{{ $t('common.delete') }}</el-button> |
| | | <el-button |
| | | icon="el-icon-search" |
| | | size="small" |
| | | type="primary" |
| | | @click="onSubmit" |
| | | >{{ $t('common.iquery') }}</el-button> |
| | | <el-button |
| | | icon="el-icon-delete" |
| | | type="info" |
| | | size="small" |
| | | @click="onEmpty('formData1')" |
| | | >{{ $t('common.empty') }}</el-button> |
| | | </el-form-item> |
| | | <el-form-item :label="$t('operatManage.tokentoolObj.tokenStatus')"> |
| | | <el-select |
| | | style="width: 200px" |
| | | size="small" |
| | | :popper-append-to-body="false" |
| | | v-model="ruleForm.value" |
| | | :placeholder="$t('operatManage.tokentoolObj.tokenStatusHolder')" |
| | | > |
| | | <el-option |
| | | value="0" |
| | | :label="$t('operatManage.tokentoolObj.temporary')" |
| | | ></el-option> |
| | | <el-option |
| | | value="1" |
| | | :label="$t('operatManage.tokentoolObj.fixed')" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | <div> |
| | | <!-- 查询 清空 --> |
| | | <el-form-item> |
| | | <el-button |
| | | icon="el-icon-search" |
| | | size="small" |
| | | type="primary" |
| | | @click="onSubmit" |
| | | >{{ $t("common.iquery") }}</el-button> |
| | | <el-button |
| | | v-if="menuStatus.insert" |
| | | @click="InsertFormdialog = true" |
| | | icon="el-icon-edit" |
| | | type="success" |
| | | size="small" |
| | | >{{ $t("common.append") }}</el-button> |
| | | <el-button |
| | | v-if="menuStatus.delete" |
| | | @click="delTokenData" |
| | | icon="el-icon-delete" |
| | | type="danger" |
| | | size="small" |
| | | >{{ $t("common.delete") }}</el-button> |
| | | <el-button |
| | | icon="el-icon-delete" |
| | | type="info" |
| | | size="small" |
| | | @click="onEmpty('formData1')" |
| | | >{{ $t("common.empty") }}</el-button> |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | <div style="height: 73%"> |
| | | <el-table |
| | | ref="filterTable" |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | height="94%"> |
| | | <div class="dividing-line"></div> |
| | | <div |
| | | class="table_box" |
| | | :style="styleVar" |
| | | > |
| | | <el-table |
| | | ref="filterTable" |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | border |
| | | height="calc(100% - 45px)" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column |
| | | type="selection" |
| | | width="55" |
| | | /> |
| | | <el-table-column |
| | | width="70" |
| | | align="center" |
| | | type="index" |
| | | :label="$t('operatManage.tokentoolObj.index')" |
| | | /> |
| | | <el-table-column |
| | | prop="token" |
| | | align="center" |
| | | :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" |
| | | align="center" |
| | | width="120" |
| | | :label="$t('operatManage.tokentoolObj.duration')" |
| | | /> |
| | | <el-table-column |
| | | prop="expire" |
| | | align="center" |
| | | :label="$t('operatManage.tokentoolObj.expire')" |
| | | :formatter="formatTime" |
| | | /> |
| | | <el-table-column |
| | | prop="type" |
| | | align="center" |
| | | :label="$t('operatManage.tokentoolObj.type')" |
| | | > |
| | | <template slot-scope="scope"> |
| | |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="ip" |
| | | align="center" |
| | | :label="$t('operatManage.tokentoolObj.ip')" |
| | | /> |
| | | <el-table-column |
| | | prop="createUser" |
| | | align="center" |
| | | prop="createName" |
| | | :label="$t('operatManage.tokentoolObj.createUser')" |
| | | /> |
| | | <el-table-column |
| | | prop="createTime" |
| | | align="center" |
| | | :label="$t('operatManage.tokentoolObj.createTime')" |
| | | :formatter="formatTime" |
| | | /> |
| | | <el-table-column |
| | | prop="updateUser" |
| | | align="center" |
| | | prop="updateName" |
| | | :label="$t('operatManage.tokentoolObj.updateUser')" |
| | | /> |
| | | <el-table-column |
| | | prop="updateTime" |
| | | align="center" |
| | | :label="$t('operatManage.tokentoolObj.updateTime')" |
| | | :formatter="formatTime" |
| | | /> |
| | | <el-table-column |
| | | fixed="right" |
| | | :label="$t('operatManage.tokentoolObj.operation')" |
| | | width="320" |
| | | align="center" |
| | | width="220" |
| | | > |
| | | <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') |
| | | $t("operatManage.tokentoolObj.invalid") |
| | | }}</el-button> |
| | | <el-button |
| | | type="warning" |
| | | <!-- <el-button |
| | | type="info" |
| | | size="small" |
| | | plain |
| | | >{{ |
| | | $t('operatManage.tokentoolObj.renewal') |
| | | }}</el-button> |
| | | $t("operatManage.tokentoolObj.renewal") |
| | | }}</el-button> --> |
| | | <el-button |
| | | v-if="menuStatus.update" |
| | | @click="handleEdit(scope.$index, scope.row)" |
| | | type="warning" |
| | | plain |
| | | size="small" |
| | | >{{ $t('common.update') }}</el-button> |
| | | >{{ $t("common.update") }}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div style="margin-top:10px"> |
| | | <div style="margin-top: 10px"> |
| | | <el-pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | |
| | | <!-- 新增弹窗 --> |
| | | <el-dialog |
| | | :title="$t('operatManage.tokentoolObj.addToken')" |
| | | style="overflow: hidden" |
| | | :visible.sync="InsertFormdialog" |
| | | :before-close="handleClose" |
| | | > |
| | | <el-form |
| | | ref="formData1" |
| | | :model="insertform" |
| | | > |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.token')" |
| | | :label-width="formLabelWidth" |
| | | <div style="height: 500px; overflow: auto"> |
| | | <el-form |
| | | ref="formData1" |
| | | :model="insertform" |
| | | label-position="top" |
| | | > |
| | | <el-input |
| | | v-model="insertform.token" |
| | | :placeholder="$t('common.pleaseInput')" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.duration')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="insertform.duration" |
| | | :placeholder="$t('common.pleaseInput')" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.type')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-select |
| | | :popper-append-to-body="false" |
| | | style="width:94.2%" |
| | | v-model="insertform.type" |
| | | :placeholder="$t('common.choose')" |
| | | |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.token')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-option |
| | | value="0" |
| | | :label="$t('operatManage.tokentoolObj.temporary')" |
| | | ></el-option> |
| | | <el-option |
| | | value="1" |
| | | :label="$t('operatManage.tokentoolObj.fixed')" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.ip')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="insertform.ip" |
| | | :placeholder="$t('common.pleaseInput')" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-input |
| | | v-model="insertform.token" |
| | | :placeholder="$t('common.pleaseInput')" |
| | | style="width:85%" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.duration')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="insertform.duration" |
| | | :placeholder="$t('common.pleaseInput')" |
| | | style="width:85%" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.type')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-select |
| | | :popper-append-to-body="false" |
| | | style="width:85%" |
| | | v-model="insertform.type" |
| | | :placeholder="$t('common.choose')" |
| | | > |
| | | <el-option |
| | | value="0" |
| | | :label="$t('operatManage.tokentoolObj.temporary')" |
| | | ></el-option> |
| | | <el-option |
| | | value="1" |
| | | :label="$t('operatManage.tokentoolObj.fixed')" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.ip')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="insertform.ip" |
| | | :placeholder="$t('common.pleaseInput')" |
| | | style="width:85%" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div |
| | | slot="footer" |
| | | class="dialog-footer" |
| | |
| | | size="small" |
| | | @click="insertFromDataClose" |
| | | >{{ |
| | | $t('common.close') |
| | | $t("common.close") |
| | | }}</el-button> |
| | | <el-button |
| | | size="small" |
| | | type="primary" |
| | | @click="insertFromData" |
| | | >{{ $t('common.confirm') }}</el-button> |
| | | >{{ |
| | | $t("common.confirm") |
| | | }}</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 修改弹窗 --> |
| | | <el-dialog |
| | | :title="$t('operatManage.tokentoolObj.editToken')" |
| | | style="overflow: hidden" |
| | | :visible.sync="EditFormdialog" |
| | | :before-close="handleCloseEdit" |
| | | > |
| | | <el-form |
| | | ref="formData1" |
| | | :model="insertform" |
| | | > |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.token')" |
| | | :label-width="formLabelWidth" |
| | | <div style="height: 500px; overflow: auto"> |
| | | <el-form |
| | | ref="formData1" |
| | | :model="insertform" |
| | | label-position="top" |
| | | > |
| | | <el-input |
| | | v-model="upform.token" |
| | | :placeholder="$t('common.pleaseInput')" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.duration')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="upform.duration" |
| | | :placeholder="$t('common.pleaseInput')" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.type')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-select |
| | | :popper-append-to-body="false" |
| | | style="width:94.2%" |
| | | v-model="upform.edit" |
| | | @change="changeGame" |
| | | :placeholder="$t('common.choose')" |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.token')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-option |
| | | value="0" |
| | | :label="$t('operatManage.tokentoolObj.temporary')" |
| | | ></el-option> |
| | | <el-option |
| | | value="1" |
| | | :label="$t('operatManage.tokentoolObj.fixed')" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.ip')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="upform.ip" |
| | | :placeholder="$t('common.pleaseInput')" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-input |
| | | v-model="upform.token" |
| | | :placeholder="$t('common.pleaseInput')" |
| | | style="width:85%" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.duration')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="upform.duration" |
| | | :placeholder="$t('common.pleaseInput')" |
| | | style="width:85%" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.type')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-select |
| | | :popper-append-to-body="false" |
| | | style="width:85%" |
| | | v-model="upform.edit" |
| | | @change="changeGame" |
| | | :placeholder="$t('common.choose')" |
| | | > |
| | | <el-option |
| | | value="0" |
| | | :label="$t('operatManage.tokentoolObj.temporary')" |
| | | ></el-option> |
| | | <el-option |
| | | value="1" |
| | | :label="$t('operatManage.tokentoolObj.fixed')" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('operatManage.tokentoolObj.ip')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="upform.ip" |
| | | :placeholder="$t('common.pleaseInput')" |
| | | style="width:85%" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div |
| | | slot="footer" |
| | |
| | | size="small" |
| | | @click="editFromDataClose" |
| | | >{{ |
| | | $t('common.close') |
| | | $t("common.close") |
| | | }}</el-button> |
| | | <el-button |
| | | type="primary" |
| | | size="small" |
| | | @click="editFromData" |
| | | >{{ $t('common.confirm') }}</el-button> |
| | | >{{ |
| | | $t("common.confirm") |
| | | }}</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import moment from 'moment'; |
| | | import MyBread from '../../components/MyBread.vue'; |
| | | import moment from "moment"; |
| | | import MyBread from "../../components/MyBread.vue"; |
| | | import { |
| | | select_Token_ByPageAndCount, |
| | | insertToken, |
| | | updateToken, |
| | | deleteTokens, |
| | | } from '../../api/api.js'; |
| | | token_updateExpireById |
| | | } from "../../api/api.js"; |
| | | export default { |
| | | //import引入的组件需要注入到对象中才能使用 |
| | | components: { |
| | |
| | | |
| | | data() { |
| | | return { |
| | | formLabelWidth: '130px', |
| | | formLabelWidth: "130px", |
| | | InsertFormdialog: false, |
| | | EditFormdialog: false, |
| | | upform: {}, |
| | |
| | | insert: false, |
| | | update: false, |
| | | }, |
| | | tableHeight: 0, |
| | | timer: 0, |
| | | styleVar: { |
| | | height: "calc(100% - 109px)", |
| | | }, |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | } |
| | | this.getRoleTabelData(); |
| | | }, |
| | | mounted() { |
| | | window.addEventListener("resize", this.onResize); |
| | | this.calHeight(); |
| | | }, |
| | | beforeDestroy() { |
| | | this.timer && clearTimeout(this.timer); |
| | | 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", |
| | | }); |
| | | } |
| | | setTimeout((res) => { |
| | | this.getRoleTabelData(); |
| | | }, 500) |
| | | }, |
| | | onResize() { |
| | | this.timer && clearTimeout(this.timer); |
| | | this.timer = setTimeout(() => { |
| | | this.calHeight(); |
| | | }, 500); |
| | | }, |
| | | calHeight() { |
| | | this.$nextTick(() => { |
| | | const rect = this.$refs.container.getBoundingClientRect(); |
| | | this.tableHeight = `${rect.height + 97}px`; |
| | | this.styleVar["height"] = `calc(100% - ${rect.height + 30}px)`; |
| | | }); |
| | | }, |
| | | showPermsMenu(res) { |
| | | switch (res.tag) { |
| | | case '/delete': |
| | | case "/delete": |
| | | this.menuStatus.delete = true; |
| | | break; |
| | | case '/insert': |
| | | case "/insert": |
| | | this.menuStatus.insert = true; |
| | | break; |
| | | case '/update': |
| | | case "/update": |
| | | this.menuStatus.update = true; |
| | | break; |
| | | } |
| | | }, |
| | | async delTokenData() { |
| | | var std = []; |
| | | debugger |
| | | if (this.multipleSelection.length <= 0) { |
| | | return this.$message({ |
| | | message: "删除失败,未选择要删除的数据", |
| | | }); |
| | | } |
| | | for (var i in this.multipleSelection) { |
| | | std.push(this.multipleSelection[i].id); |
| | | } |
| | | this.$confirm('此操作将永久删除该令牌, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(async () => { |
| | | const data = await deleteTokens({ ids: std.toString() }); |
| | | if (data.code == 200) { |
| | | this.InsertFormdialog = false; |
| | | this.$confirm("此操作将永久删除该令牌, 是否继续?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(async () => { |
| | | const data = await deleteTokens({ ids: std.toString() }); |
| | | if (data.code == 200) { |
| | | this.InsertFormdialog = false; |
| | | this.$message({ |
| | | message: "删除成功!", |
| | | type: "success", |
| | | }); |
| | | this.getRoleTabelData(); |
| | | } else { |
| | | this.$message({ |
| | | message: "删除失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | this.$message({ |
| | | message: '删除成功!', |
| | | type: 'success', |
| | | type: "info", |
| | | message: "已取消删除", |
| | | }); |
| | | this.getRoleTabelData(); |
| | | } else { |
| | | this.$message({ |
| | | message: '删除失败!', |
| | | type: 'warning', |
| | | }); |
| | | } |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消删除' |
| | | }); |
| | | }); |
| | | // const data = await deleteTokens({ ids: std.toString() }); |
| | | // if (data.code == 200) { |
| | | // this.$message({ |
| | |
| | | // } |
| | | }, |
| | | editFromDataClose() { |
| | | this.EditFormdialog = false; |
| | | this.upform = {}; |
| | | this.$confirm("关闭后无法保存,是否关闭?") |
| | | .then((_) => { |
| | | this.EditFormdialog = false; |
| | | this.upform = {}; |
| | | this.getRoleTabelData(); |
| | | }) |
| | | .catch((_) => { }); |
| | | }, |
| | | async editFromData() { |
| | | this.upform.type = parseInt(this.upform.edit); |
| | |
| | | this.EditFormdialog = false; |
| | | this.upform = {}; |
| | | this.$message({ |
| | | message: '修改成功!', |
| | | type: 'success', |
| | | message: "修改成功!", |
| | | type: "success", |
| | | }); |
| | | this.getRoleTabelData(); |
| | | } else { |
| | | this.$message({ |
| | | message: '修改失败!', |
| | | type: 'warning', |
| | | message: "修改失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }, |
| | |
| | | this.upform.edit = JSON.stringify(row.type); |
| | | }, |
| | | handleSelectionChange(val) { |
| | | debugger |
| | | this.multipleSelection = val; |
| | | }, |
| | | insertFromDataClose() { |
| | | this.InsertFormdialog = false; |
| | | this.insertform = {}; |
| | | this.$confirm("关闭后无法保存,是否关闭?") |
| | | .then((_) => { |
| | | this.InsertFormdialog = false; |
| | | this.insertform = {}; |
| | | }) |
| | | .catch((_) => { }); |
| | | }, |
| | | async insertFromData() { |
| | | if ( |
| | |
| | | this.InsertFormdialog = false; |
| | | this.insertform = {}; |
| | | this.$message({ |
| | | message: '添加成功!', |
| | | type: 'success', |
| | | message: "添加成功!", |
| | | type: "success", |
| | | }); |
| | | this.getRoleTabelData(); |
| | | } else { |
| | | this.$message({ |
| | | message: '添加失败!', |
| | | type: 'warning', |
| | | message: "添加失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }, |
| | |
| | | var month = |
| | | date.getMonth() + 1 > 9 |
| | | ? date.getMonth() + 1 |
| | | : '0' + (date.getMonth() + 1); |
| | | var day = date.getDate() > 9 ? date.getDate() : '0' + date.getDate(); |
| | | : "0" + (date.getMonth() + 1); |
| | | var day = date.getDate() > 9 ? date.getDate() : "0" + date.getDate(); |
| | | // var todayDate = year + '-' + month + '-' + day |
| | | var hour = date.getHours() > 9 ? date.getHours() : '0' + date.getHours(); |
| | | var hour = date.getHours() > 9 ? date.getHours() : "0" + date.getHours(); |
| | | var min = |
| | | date.getMinutes() > 9 ? date.getMinutes() : '0' + date.getMinutes(); |
| | | date.getMinutes() > 9 ? date.getMinutes() : "0" + date.getMinutes(); |
| | | var sec = |
| | | date.getSeconds() > 9 ? date.getSeconds() : '0' + date.getSeconds(); |
| | | date.getSeconds() > 9 ? date.getSeconds() : "0" + date.getSeconds(); |
| | | var todayDate = |
| | | year + '-' + month + '-' + day + ' ' + hour + ':' + min + ':' + sec; |
| | | year + "-" + month + "-" + day + " " + hour + ":" + min + ":" + sec; |
| | | return todayDate; |
| | | }, |
| | | getNowDate(res) { |
| | | var date = new Date(); |
| | | var min = date.getMinutes(); //2. 获取当前分钟 |
| | | date.setMinutes(min + parseInt(res)); |
| | | var sign2 = ':'; |
| | | var sign2 = ":"; |
| | | var year = date.getFullYear(); // 年 |
| | | var month = date.getMonth() + 1; // 月 |
| | | var day = date.getDate(); // 日 |
| | |
| | | |
| | | var seconds = date.getSeconds(); //秒 |
| | | var weekArr = [ |
| | | '星期一', |
| | | '星期二', |
| | | '星期三', |
| | | '星期四', |
| | | '星期五', |
| | | '星期六', |
| | | '星期天', |
| | | "星期一", |
| | | "星期二", |
| | | "星期三", |
| | | "星期四", |
| | | "星期五", |
| | | "星期六", |
| | | "星期天", |
| | | ]; |
| | | var week = weekArr[date.getDay()]; |
| | | // 给一位数的数据前面加 “0” |
| | | if (month >= 1 && month <= 9) { |
| | | month = '0' + month; |
| | | month = "0" + month; |
| | | } |
| | | if (day >= 0 && day <= 9) { |
| | | day = '0' + day; |
| | | day = "0" + day; |
| | | } |
| | | if (hour >= 0 && hour <= 9) { |
| | | hour = '0' + hour; |
| | | hour = "0" + hour; |
| | | } |
| | | if (minutes >= 0 && minutes <= 9) { |
| | | minutes = '0' + minutes; |
| | | minutes = "0" + minutes; |
| | | } |
| | | if (seconds >= 0 && seconds <= 9) { |
| | | seconds = '0' + seconds; |
| | | seconds = "0" + seconds; |
| | | } |
| | | return ( |
| | | year + |
| | | '-' + |
| | | "-" + |
| | | month + |
| | | '-' + |
| | | "-" + |
| | | day + |
| | | ' ' + |
| | | " " + |
| | | hour + |
| | | sign2 + |
| | | minutes + |
| | |
| | | ); |
| | | }, |
| | | async getRoleTabelData() { |
| | | if (this.listData.tab == '') { |
| | | if (this.listData.tab == "") { |
| | | delete this.listData.tab; |
| | | } |
| | | this.listData.name = this.ruleForm.name; |
| | |
| | | this.listData.type = parseInt(this.ruleForm.value); |
| | | } |
| | | const data = await select_Token_ByPageAndCount(this.listData); |
| | | console.log('Token获取', data); |
| | | |
| | | if (data.code != 200) { |
| | | this.$message.error('列表调用失败'); |
| | | 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) { |
| | |
| | | if (date === undefined || date === null) { |
| | | return; |
| | | } |
| | | return moment(parseInt(date)).format('YYYY-MM-DD HH:mm:ss'); |
| | | return moment(parseInt(date)).format("YYYY-MM-DD HH:mm:ss"); |
| | | }, |
| | | handleClose() { |
| | | this.$confirm("关闭后无法保存,是否关闭?") |
| | | .then((_) => { |
| | | this.InsertFormdialog = false |
| | | }) |
| | | .catch((_) => { }); |
| | | }, |
| | | handleCloseEdit() { |
| | | this.$confirm("关闭后无法保存,是否关闭?") |
| | | .then((_) => { |
| | | this.EditFormdialog = false |
| | | this.getRoleTabelData(); |
| | | }) |
| | | .catch((_) => { }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | |
| | | <style lang="less" scoped> |
| | | //@import url(); 引入公共css类 |
| | | |
| | | .tokentool_box { |
| | | height: 98%; |
| | | width: 98%; |
| | | padding: 1%; |
| | | overflow: auto; |
| | | padding: 0.5% 1%; |
| | | |
| | | .el-input { |
| | | width: 745px; |
| | | width: 300px; |
| | | } |
| | | |
| | | .inquire { |
| | | padding: 10px; |
| | | margin-top: 20px; |
| | | padding: 0 8px; |
| | | //margin-top: 20px; |
| | | |
| | | border-radius: 5px; |
| | | |
| | | margin-bottom: 10px; |
| | | |
| | | //margin-bottom: 20px; |
| | | .el-form-item { |
| | | margin: 5px; |
| | | } |
| | | .el-select { |
| | | width: 200px; |
| | | } |
| | | } |
| | | .table_box { |
| | | padding: 10px; |
| | | |
| | | border-radius: 5px; |
| | | margin-bottom: 10px; |
| | | } |
| | | } |
| | | </style> |