소스 검색

:lipstick: Updating the UI and style files. 升级UI ,checkbox radio 样式调整

冷冷 6 년 전
부모
커밋
8855ea764f

+ 1 - 1
package.json

@@ -10,7 +10,7 @@
   },
   "dependencies": {
     "@xkeshi/vue-qrcode": "^1.0.0",
-    "avue-form-design": "^1.0.0",
+    "avue-form-design": "^1.1.0",
     "axios": "^0.18.0",
     "babel-polyfill": "^6.26.0",
     "classlist-polyfill": "^1.2.0",

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
public/cdn/avue/index.css


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2 - 2
public/cdn/avue/index.js


+ 1 - 0
src/const/crud/admin/client.js

@@ -69,6 +69,7 @@ export const tableOption = {
     prop: 'autoapprove',
     align: 'center',
     type: 'radio',
+    border:true,
     dicData: DIC.vaild,
     rules: [{
       required: true,

+ 1 - 1
src/const/crud/admin/dict.js

@@ -44,7 +44,7 @@ export const tableOption = {
   }, {
     label: '字典类型',
     prop: 'system',
-    type: 'select',
+    type: 'radio',
     dicUrl: '/admin/dict/type/dict_type',
     addDisplay: false,
     editDisplay: false,

+ 2 - 1
src/const/crud/admin/tenant.js

@@ -75,7 +75,8 @@ export const tableOption = {
     {
       label: '状态',
       prop: 'status',
-      type: 'select',
+      type: 'radio',
+      border:true,
       dicUrl: '/admin/dict/type/status_type',
       search: true
     }

+ 3 - 1
src/const/crud/admin/user.js

@@ -86,6 +86,7 @@ export const tableOption = {
     slot: true,
     span: 24,
     hide: true,
+    dataType:"number",
     rules: [{
       required: true,
       message: '请选择部门',
@@ -118,8 +119,9 @@ export const tableOption = {
   }, {
     label: '状态',
     prop: 'lockFlag',
-    type: 'select',
+    type: 'radio',
     slot: true,
+    border:true,
     span: 24,
     rules: [{
       required: true,

+ 92 - 90
src/views/admin/client/index.vue

@@ -35,100 +35,102 @@
 </template>
 
 <script>
-  import {addObj, delObj, fetchList, putObj} from '@/api/admin/client'
-  import {tableOption} from '@/const/crud/admin/client'
-  import {mapGetters} from 'vuex'
+    import {addObj, delObj, fetchList, putObj} from '@/api/admin/client'
+    import {tableOption} from '@/const/crud/admin/client'
+    import {mapGetters} from 'vuex'
 
-  export default {
-    name: 'Client',
-    data() {
-      return {
-        tableData: [],
-        page: {
-          total: 0, // 总页数
-          currentPage: 1, // 当前页数
-          pageSize: 20 // 每页显示多少条
+    export default {
+        name: 'Client',
+        data() {
+            return {
+                tableData: [],
+                page: {
+                    total: 0, // 总页数
+                    currentPage: 1, // 当前页数
+                    pageSize: 20 // 每页显示多少条
+                },
+                tableLoading: false,
+                tableOption: tableOption
+            }
         },
-        tableLoading: false,
-        tableOption: tableOption
-      }
-    },
-    created() {
-    },
-    mounted: function () {
-    },
-    computed: {
-      ...mapGetters(['permissions']),
-      permissionList() {
-        return {
-          addBtn: this.vaildData(this.permissions.sys_client_add, false),
-          delBtn: this.vaildData(this.permissions.sys_client_del, false),
-          editBtn: this.vaildData(this.permissions.sys_client_edit, false)
+        created() {
+        },
+        mounted: function () {
+        },
+        computed: {
+            ...mapGetters(['permissions']),
+            permissionList() {
+                return {
+                    addBtn: this.vaildData(this.permissions.sys_client_add, false),
+                    delBtn: this.vaildData(this.permissions.sys_client_del, false),
+                    editBtn: this.vaildData(this.permissions.sys_client_edit, false)
+                }
+            }
+        },
+        methods: {
+            getList(page, params) {
+                this.tableLoading = true
+                fetchList(Object.assign({
+                    current: page.currentPage,
+                    size: page.pageSize
+                }, params)).then(response => {
+                    this.tableData = response.data.data.records
+                    this.page.total = response.data.data.total
+                    this.tableLoading = false
+                })
+            },
+            handleDelete: function (row, index) {
+                var _this = this
+                this.$confirm('是否确认删除ID为' + row.clientId, '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(function () {
+                    return delObj(row.clientId)
+                }).then(() => {
+                    _this.tableData.splice(index, 1)
+                    _this.$message({
+                        showClose: true,
+                        message: '删除成功',
+                        type: 'success'
+                    })
+                    this.refreshChange()
+                }).catch(function () {
+                })
+            },
+            handleUpdate: function (row, index, done) {
+                row.authorizedGrantTypes = row.authorizedGrantTypes.join(',')
+                if (row.accessTokenValidity === 0) {
+                    row.accessTokenValidity = 60 * 60 * 12
+                }
+                if (row.refreshTokenValidity === 0) {
+                    row.refreshTokenValidity = 60 * 60 * 24 * 30
+                }
+                putObj(row).then(() => {
+                    this.$message.success('修改成功');
+                    this.refreshChange()
+                    done()
+                })`-`
+            },
+            handleSave: function (row, done) {
+                row.authorizedGrantTypes = row.authorizedGrantTypes.join(',')
+                if (row.accessTokenValidity === 0) {
+                    row.accessTokenValidity = 60 * 60 * 12
+                }
+                if (row.refreshTokenValidity === 0) {
+                    row.refreshTokenValidity = 60 * 60 * 24 * 30
+                }
+                addObj(row).then(() => {
+                    this.$message.success('添加成功');
+                    this.refreshChange()
+                    done()
+                })
+            },
+            refreshChange() {
+                this.getList(this.page)
+            }
         }
-      }
-    },
-    methods: {
-      getList(page, params) {
-        this.tableLoading = true
-        fetchList(Object.assign({
-          current: page.currentPage,
-          size: page.pageSize
-        }, params)).then(response => {
-          this.tableData = response.data.data.records
-          this.page.total = response.data.data.total
-          this.tableLoading = false
-        })
-      },
-      handleDelete: function (row, index) {
-        var _this = this
-        this.$confirm('是否确认删除ID为' + row.clientId, '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(function () {
-          return delObj(row.clientId)
-        }).then(() => {
-          _this.tableData.splice(index, 1)
-          _this.$message({
-            showClose: true,
-            message: '删除成功',
-            type: 'success'
-          })
-          this.refreshChange()
-        }).catch(function () {
-        })
-      },
-      handleUpdate: function (row, index, done) {
-        row.authorizedGrantTypes = row.authorizedGrantTypes.join(',')
-        putObj(row).then(() => {
-          this.tableData.splice(index, 1, Object.assign({}, row))
-          this.$message({
-            showClose: true,
-            message: '修改成功',
-            type: 'success'
-          })
-          this.refreshChange()
-          done()
-        })
-      },
-      handleSave: function (row, done) {
-        row.authorizedGrantTypes = row.authorizedGrantTypes.join(',')
-        addObj(row).then(() => {
-          this.tableData.push(Object.assign({}, row))
-          this.$message({
-            showClose: true,
-            message: '添加成功',
-            type: 'success'
-          })
-          this.refreshChange()
-          done()
-        })
-      },
-      refreshChange() {
-        this.getList(this.page)
-      }
     }
-  }
 </script>
 
 <style lang="scss" scoped>

+ 180 - 179
src/views/admin/user/index.vue

@@ -130,192 +130,193 @@
 </template>
 
 <script>
-  import {addObj, delObj, fetchList, putObj} from '@/api/admin/user'
-  import {deptRoleList} from '@/api/admin/role'
-  import {fetchTree} from '@/api/admin/dept'
-  import {tableOption} from '@/const/crud/admin/user'
-  import {mapGetters} from 'vuex'
+    import {addObj, delObj, fetchList, putObj} from '@/api/admin/user'
+    import {deptRoleList} from '@/api/admin/role'
+    import {fetchTree} from '@/api/admin/dept'
+    import {tableOption} from '@/const/crud/admin/user'
+    import {mapGetters} from 'vuex'
 
-  export default {
-    name: 'SysUser',
-    data() {
-      return {
-        searchForm: {},
-        treeOption: {
-          nodeKey: 'id',
-          addBtn: false,
-          menu: false,
-          props: {
-            label: 'name',
-            value: 'id'
-          }
+    export default {
+        name: 'SysUser',
+        data() {
+            return {
+                searchForm: {},
+                treeOption: {
+                    nodeKey: 'id',
+                    addBtn: false,
+                    menu: false,
+                    props: {
+                        label: 'name',
+                        value: 'id'
+                    }
+                },
+                treeData: [],
+                option: tableOption,
+                treeDeptData: [],
+                checkedKeys: [],
+                roleProps: {
+                    label: 'roleName',
+                    value: 'roleId'
+                },
+                defaultProps: {
+                    label: 'name',
+                    value: 'id'
+                },
+                page: {
+                    total: 0, // 总页数
+                    currentPage: 1, // 当前页数
+                    pageSize: 20, // 每页显示多少条,
+                    isAsc: false// 是否倒序
+                },
+                list: [],
+                listLoading: true,
+                role: [],
+                form: {},
+                rolesOptions: []
+            }
         },
-        treeData: [],
-        option: tableOption,
-        treeDeptData: [],
-        checkedKeys: [],
-        roleProps: {
-          label: 'roleName',
-          value: 'roleId'
+        computed: {
+            ...mapGetters(['permissions'])
         },
-        defaultProps: {
-          label: 'name',
-          value: 'id'
+        watch: {
+            role() {
+                this.form.role = this.role
+            }
         },
-        page: {
-          total: 0, // 总页数
-          currentPage: 1, // 当前页数
-          pageSize: 20, // 每页显示多少条,
-          isAsc: false// 是否倒序
+        created() {
+            this.sys_user_add = this.permissions['sys_user_add']
+            this.sys_user_edit = this.permissions['sys_user_edit']
+            this.sys_user_del = this.permissions['sys_user_del']
+            this.init()
         },
-        list: [],
-        listLoading: true,
-        role: [],
-        form: {},
-        rolesOptions: []
-      }
-    },
-    computed: {
-      ...mapGetters(['permissions'])
-    },
-    watch: {
-      role() {
-        this.form.role = this.role
-      }
-    },
-    created() {
-      this.sys_user_add = this.permissions['sys_user_add']
-      this.sys_user_edit = this.permissions['sys_user_edit']
-      this.sys_user_del = this.permissions['sys_user_del']
-      this.init()
-    },
-    methods: {
-      init() {
-        fetchTree().then(response => {
-          this.treeData = response.data.data
-        })
-      },
-      nodeClick(data) {
-        this.page.page = 1
-        this.getList(this.page, {deptId: data.id})
-      },
-      getList(page, params) {
-        this.listLoading = true
-        fetchList(Object.assign({
-          current: page.currentPage,
-          size: page.pageSize
-        }, params, this.searchForm)).then(response => {
-          this.list = response.data.data.records
-          this.page.total = response.data.data.total
-          this.listLoading = false
-        })
-      },
-      getNodeData() {
-        deptRoleList().then(response => {
-          this.rolesOptions = response.data.data
-        })
-      },
-      handleDept() {
-        fetchTree().then(response => {
-          this.treeDeptData = response.data.data
-        })
-      },
-      handleFilter(param) {
-        this.searchForm = param
-        this.getList(this.page, param)
-      },
-      handleRefreshChange() {
-        this.getList(this.page)
-      },
-      handleCreate() {
-        this.$refs.crud.rowAdd()
-      },
-      handleOpenBefore(show, type) {
-        window.boxType = type
-        this.handleDept()
-        if (['edit', 'views'].includes(type)) {
-          this.role = []
-          for (var i = 0; i < this.form.roleList.length; i++) {
-            this.role[i] = this.form.roleList[i].roleId
-          }
-          deptRoleList().then(response => {
-            this.rolesOptions = response.data.data
-          })
-        } else if (type === 'add') {
-          this.role = []
-        }
-        show()
-      },
-      handleUpdate(row, index) {
-        this.$refs.crud.rowEdit(row, index)
-        this.form.password = undefined
-      },
-      create(row, done, loading) {
-        if (this.form.phone.indexOf('*') > 0) {
-          this.form.phone = undefined
+        methods: {
+            init() {
+                fetchTree().then(response => {
+                    this.treeData = response.data.data
+                })
+            },
+            nodeClick(data) {
+                this.page.page = 1
+                this.getList(this.page, {deptId: data.id})
+            },
+            getList(page, params) {
+                this.listLoading = true
+                fetchList(Object.assign({
+                    current: page.currentPage,
+                    size: page.pageSize
+                }, params, this.searchForm)).then(response => {
+                    this.list = response.data.data.records
+                    this.page.total = response.data.data.total
+                    this.listLoading = false
+                })
+            },
+            getNodeData() {
+                deptRoleList().then(response => {
+                    this.rolesOptions = response.data.data
+                })
+            },
+            handleDept() {
+                fetchTree().then(response => {
+                    this.treeDeptData = response.data.data
+                })
+            },
+            handleFilter(param) {
+                this.searchForm = param
+                this.getList(this.page, param)
+            },
+            handleRefreshChange() {
+                this.getList(this.page)
+            },
+            handleCreate() {
+                this.$refs.crud.rowAdd()
+            },
+            handleOpenBefore(show, type) {
+                window.boxType = type
+                this.handleDept()
+                if (['edit', 'views'].includes(type)) {
+                    this.role = []
+                    for (var i = 0; i < this.form.roleList.length; i++) {
+                        this.role[i] = this.form.roleList[i].roleId
+                    }
+                    deptRoleList().then(response => {
+                        this.rolesOptions = response.data.data
+                    })
+                } else if (type === 'add') {
+                    this.role = []
+                }
+                show()
+            },
+            handleUpdate(row, index) {
+                console.log(row)
+                this.$refs.crud.rowEdit(row, index)
+                this.form.password = undefined
+            },
+            create(row, done, loading) {
+                if (this.form.phone.indexOf('*') > 0) {
+                    this.form.phone = undefined
+                }
+                addObj(this.form).then(() => {
+                    this.getList(this.page)
+                    done()
+                    this.$notify({
+                        title: '成功',
+                        message: '创建成功',
+                        type: 'success',
+                        duration: 2000
+                    })
+                }).catch(() => {
+                    loading()
+                })
+            },
+            update(row, index, done, loading) {
+                if (this.form.phone.indexOf('*') > 0) {
+                    this.form.phone = undefined
+                }
+                putObj(this.form).then(() => {
+                    this.getList(this.page)
+                    done()
+                    this.$notify({
+                        title: '成功',
+                        message: '修改成功',
+                        type: 'success',
+                        duration: 2000
+                    })
+                }).catch(() => {
+                    loading()
+                })
+            },
+            deletes(row, index) {
+                this.$confirm(
+                    '此操作将永久删除该用户(用户名:' + row.username + '), 是否继续?',
+                    '提示',
+                    {
+                        confirmButtonText: '确定',
+                        cancelButtonText: '取消',
+                        type: 'warning'
+                    }
+                ).then(() => {
+                    delObj(row.userId)
+                        .then(() => {
+                            this.list.splice(index, 1)
+                            this.$notify({
+                                title: '成功',
+                                message: '删除成功',
+                                type: 'success',
+                                duration: 2000
+                            })
+                        })
+                        .cache(() => {
+                            this.$notify({
+                                title: '失败',
+                                message: '删除失败',
+                                type: 'error',
+                                duration: 2000
+                            })
+                        })
+                })
+            }
         }
-        addObj(this.form).then(() => {
-          this.getList(this.page)
-          done()
-          this.$notify({
-            title: '成功',
-            message: '创建成功',
-            type: 'success',
-            duration: 2000
-          })
-        }).catch(() => {
-          loading()
-        })
-      },
-      update(row, index, done, loading) {
-        if (this.form.phone.indexOf('*') > 0) {
-          this.form.phone = undefined
-        }
-        putObj(this.form).then(() => {
-          this.getList(this.page)
-          done()
-          this.$notify({
-            title: '成功',
-            message: '修改成功',
-            type: 'success',
-            duration: 2000
-          })
-        }).catch(() => {
-          loading()
-        })
-      },
-      deletes(row, index) {
-        this.$confirm(
-          '此操作将永久删除该用户(用户名:' + row.username + '), 是否继续?',
-          '提示',
-          {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning'
-          }
-        ).then(() => {
-          delObj(row.userId)
-            .then(() => {
-              this.list.splice(index, 1)
-              this.$notify({
-                title: '成功',
-                message: '删除成功',
-                type: 'success',
-                duration: 2000
-              })
-            })
-            .cache(() => {
-              this.$notify({
-                title: '失败',
-                message: '删除失败',
-                type: 'error',
-                duration: 2000
-              })
-            })
-        })
-      }
     }
-  }
 </script>
 <style lang="scss">
   .user {