Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 

283 рядки
7.2 KiB

  1. <template>
  2. <Card :bordered="false">
  3. <p slot="title">RADIUS</p>
  4. <Alert show-icon>
  5. RADIUS(远程用户拨号认证系统)
  6. <Icon type="ios-bulb-outline" slot="icon"></Icon>
  7. <template slot="desc">
  8. 使用 RADIUS(Remote Authentication Dial In User Service,远程用户拨号认证系统)可以实现对防火墙、堡垒机、Wi-Fi 等设备的统一认证。
  9. IDaaS RADIUS Server 安装包,并配合列表中 RADIUS 可下载的配置文件使用。
  10. </template>
  11. </Alert>
  12. <div class="search-box box-pack-between">
  13. <div class="search-left-box" style="width: 50%;">
  14. <div class="search-left-tools">
  15. <!--<Button type="primary">添加应用</Button>-->
  16. </div>
  17. <div class="search">
  18. <Input search enter-button placeholder="搜索认证源"/>
  19. </div>
  20. </div>
  21. <div class="search-right-tools"></div>
  22. </div>
  23. <Table :columns="articleColumns" :data="datalist"></Table>
  24. <Page class="page" :total="100" show-total show-sizer show-elevator/>
  25. </Card>
  26. </template>
  27. <script>
  28. import {articleList,deleteContent} from '@/api/data'
  29. import store from '@/store'
  30. import qs from 'qs'
  31. export default {
  32. name: 'articleList',
  33. props: {
  34. },
  35. components: {},
  36. data () {
  37. return {
  38. contentType:'',
  39. pageSizeOpts:[10,20,30,40,50,100],
  40. loading: true,
  41. pageNow:1,
  42. pageSize:50,
  43. articlePage:{},
  44. defaultList: [],
  45. imgName: '',
  46. dirname: '',
  47. selectedItems: [],
  48. breadData: [],
  49. busy: false,
  50. nextMarker: '',
  51. buckets: [],
  52. currentBucket: '',
  53. articleColumns: [
  54. {
  55. type: 'selection',
  56. width: 60,
  57. align: 'center',
  58. fixed: 'left'
  59. },
  60. {
  61. title: 'RADIUS 名称',
  62. align: 'left',
  63. key: 'title'
  64. },
  65. {
  66. title: '认证端口',
  67. align: 'center',
  68. key: 'size'
  69. },
  70. {
  71. title: '计费端口',
  72. align: 'center',
  73. key: 'size'
  74. },
  75. {
  76. title: '连接超时时间',
  77. align: 'center',
  78. key: 'createTime',
  79. sortable: true
  80. },
  81. {
  82. title: '认证方式',
  83. align: 'center',
  84. key: 'updateTime',
  85. sortable: true
  86. },
  87. {
  88. title: 'RADIUS 服务提供商',
  89. align: 'center',
  90. key: 'updateTime',
  91. sortable: true
  92. },
  93. {
  94. title: '启用计费',
  95. align: 'center',
  96. key: 'updateTime',
  97. sortable: true
  98. },
  99. {
  100. title: '创建时间',
  101. align: 'center',
  102. key: 'updateTime',
  103. sortable: true
  104. },
  105. {
  106. title: '备注',
  107. align: 'center',
  108. key: 'updateTime',
  109. sortable: true
  110. },
  111. {
  112. title: '操作',
  113. align: 'right',
  114. key: 'opt',
  115. fixed: 'right',
  116. render: (h, params) => {
  117. let item = this.articlePage.list[params.index]
  118. return h('div', [
  119. h('Button', {
  120. props: {
  121. type: 'success',
  122. size: 'small',
  123. to:'/admin/article/edit/'+item.id
  124. },
  125. on: {
  126. click: () => {
  127. }
  128. }
  129. }, 'Edit'),
  130. h('span',{
  131. style:"margin:0 8px"
  132. }),
  133. h('Button', {
  134. props: {
  135. type: 'error',
  136. size: 'small'
  137. },
  138. on: {
  139. click: () => {
  140. const msg = this.$Message.loading({
  141. content: '删除中...',
  142. duration: 0
  143. })
  144. deleteContent(item.id).then(res=>{
  145. msg();
  146. this.remove(params.index)
  147. }).catch(function (error) {
  148. msg();
  149. console.log(error)
  150. })
  151. }
  152. }
  153. }, 'Delete')
  154. ])
  155. }
  156. }
  157. ],
  158. datalist: [],
  159. uploadList: [],
  160. accessKey: '---',
  161. uploadParam: {},
  162. showUploadList: true,
  163. currentPath: '',
  164. formValidate: {
  165. pathName: ''
  166. },
  167. ruleValidate: {
  168. pathName: [
  169. { required: true, message: '目录名称不能为空', trigger: 'blur' },
  170. { required: true, type: 'string', min: 1, max: 254, message: '目录字符长度必须在1~254之间', trigger: 'blur' },
  171. { required: true, pattern: /^(?!.*\/\/).*$/, message: '目录名称不能含有//', trigger: 'blur' },
  172. { required: true, pattern: /^(?!.*\.\.).*$/, message: '目录名称不能含有..', trigger: 'blur' },
  173. { required: true, pattern: /^(?!\/).*$/, message: '目录名称不能以 / 打头', trigger: 'blur' }
  174. ]
  175. },
  176. styles: {
  177. height: 'calc(100% - 105px)',
  178. overflow: 'auto',
  179. paddingBottom: '53px'
  180. }
  181. }
  182. },
  183. methods: {
  184. remove (index) {
  185. this.articlePage.list.splice(index, 1)
  186. },
  187. handleSubmit (name) {
  188. this.$refs[name].validate((valid) => {
  189. if (valid) {
  190. console.log(this.formValidate.pathName)
  191. this.$Message.success('Success!')
  192. } else {
  193. this.$Message.error('Fail!')
  194. }
  195. })
  196. },
  197. refresh () {
  198. this.listArticles({pageNow:this.pageNow,pageSize:this.pageSize});
  199. },
  200. listArticles(){
  201. var _this = this;
  202. articleList({pageNow:this.pageNow,pageSize:this.pageSize,type:this.contentType}).then((res) => {
  203. _this.loading = false
  204. this.articlePage = res.data
  205. }).catch(function (error) {
  206. _this.loading = false
  207. console.log(error)
  208. })
  209. },
  210. toPage(page){
  211. console.log("page:"+page)
  212. this.loading = true
  213. this.pageNow = page;
  214. this.listArticles();
  215. },
  216. changePageSize(pageSize){
  217. this.loading = true
  218. this.pageNow = 1;
  219. this.pageSize = pageSize;
  220. this.listArticles();
  221. }
  222. },
  223. mounted () {
  224. this.contentType = this.$route.query.contentType;
  225. this.listArticles();
  226. },
  227. watch:{
  228. '$route':{
  229. handler(val){
  230. if(val.query.contentType){
  231. this.contentType = val.query.contentType? val.query.contentType:'post'
  232. this.listArticles()
  233. }
  234. }
  235. }
  236. }
  237. }
  238. </script>
  239. <style>
  240. .search-box{
  241. position:relative;
  242. width:100%;
  243. display:-webkit-flex;
  244. -webkit-box-orient:horizontal;
  245. -webkit-box-direction:normal;
  246. -ms-flex-direction:row;
  247. flex-direction:row;
  248. -webkit-box-align:center;
  249. -ms-flex-align:center;
  250. align-items:center;
  251. margin-bottom:15px
  252. }
  253. .search-box .search-left-box {
  254. width:50%;
  255. display:-webkit-box;
  256. display:-ms-flexbox;
  257. display:flex
  258. }
  259. .search-box .search-left-tools{
  260. display:inline-block;
  261. margin-right:5px
  262. }
  263. .search-box .total{
  264. position:absolute;
  265. right:0;
  266. font-weight:700
  267. }
  268. .search-box .total .icon{
  269. font-size:20px;
  270. font-weight:800;
  271. color:#199be6
  272. }
  273. .search-box .search-right-tools{
  274. text-align:right
  275. }
  276. </style>