| | |
| | | <template> |
| | | <div class="tokentool_box"> |
| | | <My-bread |
| | | :list="[ |
| | | <My-bread :list="[ |
| | | `${$t('operatManage.operatManage')}`, |
| | | `${$t('operatManage.tokentool')}`, |
| | | ]" |
| | | ></My-bread> |
| | | ]"></My-bread> |
| | | <el-divider /> |
| | | <div class="inquire"> |
| | | <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="inquire subpage_Div" |
| | | ref="container" |
| | | > |
| | | <el-form |
| | | ref="formData" |
| | | :model="ruleForm" |
| | | :inline="true" |
| | | > |
| | | <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 |
| | | 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> |
| | | <el-button |
| | | icon="el-icon-search" |
| | | style="background: #409eff; border: 1px solid #409eff; color: white" |
| | | @click="onSubmit" |
| | | >{{ $t('common.iquery') }}</el-button |
| | | > |
| | | <el-button |
| | | icon="el-icon-delete" |
| | | type="info" |
| | | @click="onEmpty('formData1')" |
| | | >{{ $t('common.empty') }}</el-button |
| | | > |
| | | <el-button |
| | | v-if="menuStatus.insert" |
| | | @click="InsertFormdialog = true" |
| | | icon="el-icon-edit" |
| | | type="success" |
| | | >{{ $t('common.append') }}</el-button |
| | | > |
| | | <el-button |
| | | v-if="menuStatus.delete" |
| | | @click="delTokenData" |
| | | icon="el-icon-delete" |
| | | type="danger" |
| | | >{{ $t('common.delete') }}</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 class="table_box"> |
| | | <div class="dividing-line"></div> |
| | | <div |
| | | class="table_box" |
| | | :style="styleVar" |
| | | > |
| | | <el-table |
| | | ref="filterTable" |
| | | :data="tableData" |
| | | height="102.1%" |
| | | style="width: 100%" |
| | | border |
| | | height="calc(100% - 45px)" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55" /> |
| | | <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 type="danger" size="small">{{ |
| | | $t('operatManage.tokentoolObj.invalid') |
| | | <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 type="warning" size="small">{{ |
| | | $t('operatManage.tokentoolObj.renewal') |
| | | }}</el-button> |
| | | <!-- <el-button |
| | | type="info" |
| | | size="small" |
| | | plain |
| | | >{{ |
| | | $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"> |
| | | <el-pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="listData.pageIndex" |
| | | :page-sizes="[10, 20, 50, 100]" |
| | | :page-size="listData.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="count" |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | <div class="pagination_box"> |
| | | <el-pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="listData.pageIndex" |
| | | :page-sizes="[10, 20, 30, 40]" |
| | | :page-size="listData.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="count" |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | | |
| | | <!-- 新增弹窗 --> |
| | | <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 |
| | | 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> |
| | | |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="insertFromDataClose">{{ |
| | | $t('common.close') |
| | | <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" |
| | | > |
| | | <el-button |
| | | size="small" |
| | | @click="insertFromDataClose" |
| | | >{{ |
| | | $t("common.close") |
| | | }}</el-button> |
| | | <el-button |
| | | style="background: #409eff; border: 1px solid #409eff; color: white" |
| | | 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 |
| | | 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" class="dialog-footer"> |
| | | <el-button @click="editFromDataClose">{{ |
| | | $t('common.close') |
| | | <div |
| | | slot="footer" |
| | | class="dialog-footer" |
| | | > |
| | | <el-button |
| | | size="small" |
| | | @click="editFromDataClose" |
| | | >{{ |
| | | $t("common.close") |
| | | }}</el-button> |
| | | <el-button |
| | | style="background: #409eff; border: 1px solid #409eff; color: white" |
| | | 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); |
| | | } |
| | | const data = await deleteTokens({ ids: std.toString() }); |
| | | if (data.code == 200) { |
| | | this.$message({ |
| | | message: '删除成功!', |
| | | type: 'success', |
| | | 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({ |
| | | type: "info", |
| | | message: "已取消删除", |
| | | }); |
| | | }); |
| | | this.getRoleTabelData(); |
| | | } else { |
| | | this.$message({ |
| | | message: '删除失败!', |
| | | type: 'warning', |
| | | }); |
| | | } |
| | | // const data = await deleteTokens({ ids: std.toString() }); |
| | | // if (data.code == 200) { |
| | | // this.$message({ |
| | | // message: '删除成功!', |
| | | // type: 'success', |
| | | // }); |
| | | // this.getRoleTabelData(); |
| | | // } else { |
| | | // this.$message({ |
| | | // message: '删除失败!', |
| | | // type: 'warning', |
| | | // }); |
| | | // } |
| | | }, |
| | | 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 scoped> |
| | | /deep/ .el-table__fixed-right { |
| | | height: 100% !important; |
| | | } |
| | | </style> |
| | | |
| | | <style lang="less" scoped> |
| | | //@import url(); 引入公共css类 |
| | | |
| | | .tokentool_box { |
| | | height: 98%; |
| | | height: 98%; |
| | | width: 98%; |
| | | padding: 1%; |
| | | position: absolute; |
| | | padding: 0.5% 1%; |
| | | |
| | | .el-input { |
| | | width: 745px; |
| | | width: 300px; |
| | | } |
| | | .el-select { |
| | | width: 745px; |
| | | } |
| | | |
| | | .inquire { |
| | | padding: 10px; |
| | | margin-top: 20px; |
| | | padding: 0 8px; |
| | | //margin-top: 20px; |
| | | |
| | | border-radius: 5px; |
| | | border: 1px solid rgb(202, 201, 204); |
| | | margin-bottom: 10px; |
| | | .herder_box { |
| | | padding: 10px; |
| | | border-bottom: 1px solid #ccc; |
| | | margin-bottom: 20px; |
| | | font-size: 14px; |
| | | |
| | | //margin-bottom: 20px; |
| | | .el-form-item { |
| | | margin: 5px; |
| | | } |
| | | .el-select { |
| | | width: 200px; |
| | | } |
| | | /deep/.el-form-item__label { |
| | | color: white; |
| | | } |
| | | /deep/ .el-input__inner { |
| | | background-color: transparent !important; |
| | | border: 1px solid; |
| | | color: white; |
| | | } |
| | | } |
| | | .table_box { |
| | | padding: 10px; |
| | | height: 63%; |
| | | border-radius: 5px; |
| | | border: 1px solid rgb(202, 201, 204); |
| | | margin-bottom: 10px; |
| | | /*修改table 表体的背景颜色和文字颜色*/ |
| | | /deep/ .el-table { |
| | | background-color: transparent; |
| | | |
| | | th, |
| | | td { |
| | | background-color: transparent; |
| | | } |
| | | .el-table__expanded-cell { |
| | | background-color: transparent !important; |
| | | } |
| | | |
| | | // 表头背景色 |
| | | th.el-table__cell { |
| | | background-color: #303030; |
| | | color: #fff; |
| | | } |
| | | tr > td { |
| | | background-color: #303030; |
| | | color: #fff; |
| | | } |
| | | |
| | | // hover效果 |
| | | tr:hover > td { |
| | | background-color: rgba(255, 255, 255, 0.3) !important; |
| | | } |
| | | |
| | | tbody tr:hover { |
| | | background-color: rgba(255, 255, 255, 0.3) !important; |
| | | // text-align: center; |
| | | } |
| | | |
| | | // 滚动条宽高 |
| | | .el-table__body-wrapper::-webkit-scrollbar { |
| | | width: 5px; |
| | | height: 5px; |
| | | } |
| | | |
| | | .el-table__body-wrapper::-webkit-scrollbar { |
| | | width: 5px; |
| | | /*滚动条宽度*/ |
| | | height: 10px; |
| | | /*滚动条高度*/ |
| | | } |
| | | /*定义滚动条轨道 内阴影+圆角*/ |
| | | .el-table__body-wrapper::-webkit-scrollbar-track { |
| | | box-shadow: 0px 1px 3px #216fe6 inset; |
| | | /*滚动条的背景区域的内阴影*/ |
| | | border-radius: 10px; |
| | | } |
| | | |
| | | /*定义滑块 内阴影+圆角*/ |
| | | .el-table__body-wrapper::-webkit-scrollbar-thumb { |
| | | box-shadow: 0px 1px 3px #216fe6 inset; |
| | | border-radius: 6px; |
| | | background-color: #216fe6; |
| | | } |
| | | } |
| | | } |
| | | .pagination_box { |
| | | /deep/.el-input__inner { |
| | | background-color: transparent !important; |
| | | border: 1px solid; |
| | | color: white; |
| | | } |
| | | /deep/.el-pagination__total { |
| | | color: white; |
| | | } |
| | | /deep/.el-pagination__jump { |
| | | color: white; |
| | | } |
| | | /deep/.el-pager li.active { |
| | | color: #1890ff; |
| | | } |
| | | /deep/.el-pager li { |
| | | color: white; |
| | | background: transparent; |
| | | } |
| | | /deep/.el-pager li { |
| | | color: white; |
| | | } |
| | | /deep/.btn-prev { |
| | | background: transparent; |
| | | } |
| | | /deep/.btn-next { |
| | | background: transparent; |
| | | } |
| | | } |
| | | /deep/ .el-input__inner { |
| | | background-color: transparent !important; |
| | | border: 1px solid; |
| | | color: white; |
| | | } |
| | | /deep/ .el-dialog { |
| | | background: #303030; |
| | | } |
| | | /deep/.el-range-editor.is-active, |
| | | .el-range-editor.is-active:hover, |
| | | .el-select .el-input.is-focus .el-input__inner { |
| | | border: 1px solid; |
| | | } |
| | | /deep/.el-dialog__title { |
| | | color: white; |
| | | } |
| | | /deep/.el-form-item__label { |
| | | color: white; |
| | | } |
| | | } |
| | | </style> |