| | |
| | | <template> |
| | | <basic-container> |
| | | |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | |
| | | @on-load="onLoad"> |
| | | <!-- 自定义url --> |
| | | <template #url="scope"> |
| | | <template #url="scope"> |
| | | <el-link |
| | | :href="scope.row.url" |
| | | target="_blank" |
| | |
| | | 下载证书 |
| | | </el-link> |
| | | </template> |
| | | |
| | | <!-- 自定义过期时间列 --> |
| | | <template #expireDay="scope"> |
| | | <span :style="{ color: isExpired(scope.row.expireDay) ? 'red' : 'inherit' }"> |
| | |
| | | {{ scope.row.checkMachineCode ? '校验机器码' : '不校验' }} |
| | | </span> |
| | | </template> |
| | | <template #menu-left> |
| | | <el-button type="primary" icon="el-icon-plus" |
| | | @click="createLicenseShow()">新 增 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | <!-- 新增弹窗 --> |
| | | <el-dialog title="新增License" |
| | | v-model="addDialogVisible" |
| | | width="70%" |
| | | :close-on-click-modal="false" |
| | | @close="resetForm" |
| | | > |
| | | <el-form :model="newLicense" label-width="120px"> |
| | | <el-form-item label="机构ID" prop="licenseId" required> |
| | | <el-input v-model="newLicense.licenseId" /> |
| | | </el-form-item> |
| | | <el-form-item label="机构名称" prop="licenseName" required> |
| | | <el-input v-model="newLicense.licenseName" /> |
| | | </el-form-item> |
| | | <el-form-item label="类型" prop="licenseType" required> |
| | | <el-select v-model="newLicense.licenseType" placeholder="请选择"> |
| | | <el-option label="不验证过期时间" :value="1" /> |
| | | <el-option label="验证过期时间" :value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="过期时间" prop="expireDay"> |
| | | <el-date-picker v-model="newLicense.expireDay" type="date" placeholder="选择日期" /> |
| | | </el-form-item> |
| | | <el-form-item label="设备数量" prop="printClientCount"> |
| | | <el-input-number v-model="newLicense.printClientCount" :min="-1" /> |
| | | </el-form-item> |
| | | <el-form-item label="是否校验机器码" prop="checkMachineCode"> |
| | | <el-switch v-model="newLicense.checkMachineCode" /> |
| | | </el-form-item> |
| | | <el-form-item label="机器码" prop="machineCode"> |
| | | <el-input v-model="newLicense.machineCode" type="textarea" rows="3" /> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input v-model="newLicense.remark" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="addDialogVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="createLicense">保存</el-button> |
| | | </div> |
| | | </template> |
| | | |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | |
| | | total: 0, |
| | | }, |
| | | selectionList: [], |
| | | addDialogVisible: false, |
| | | newLicense: { |
| | | licenseId: '', |
| | | licenseName: '', |
| | | licenseType: null, |
| | | expireDay: null, |
| | | printClientCount: -1, |
| | | checkMachineCode: false, |
| | | machineCode: '', |
| | | remark: '', |
| | | }, |
| | | option: { |
| | | menuWidth: 300, |
| | | lazy: true, |
| | |
| | | viewBtn: true, |
| | | selection: false, |
| | | excelBtn: false, |
| | | addBtn: true, |
| | | addBtnText: '新建license', |
| | | addBtn: false, |
| | | dialogClickModal: false, |
| | | grid: false, |
| | | column: [ |
| | |
| | | } |
| | | ); |
| | | }, |
| | | createLicenseShow(){ |
| | | this.addDialogVisible = true; |
| | | }, |
| | | createLicense() { |
| | | add(this.newLicense).then(() => { |
| | | this.$message.success('新增成功'); |
| | | this.addDialogVisible = false; |
| | | this.onLoad(this.page); |
| | | }).catch(error => { |
| | | console.error(error); |
| | | this.$message.error('新增失败'); |
| | | }); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, params).then(res => { |