Jelajahi Sumber

文件分类编辑保存报错问题修复

cfort 1 tahun lalu
induk
melakukan
d89ba26864

+ 296 - 296
src/views/platform/auth/resources/manage.vue

@@ -1,91 +1,91 @@
 <template>
-  <ibps-layout ref="layout">
-    <div slot="west">
-      <ibps-tree
-        ref="tree"
-        :width="width"
-        :height="height"
-        :loading="loading"
-        :data="treeData"
-        :options="treeOptions"
-        :contextmenus="treeContextmenus"
-        title="菜单管理"
-        @action-event="handleTreeAction"
-        @node-click="handleNodeClick"
-        @expand-collapse="handleExpandCollapse"
-      >
-        <el-select
-          slot="searchForm"
-          v-model="systemId"
-          placeholder="请先设置子系统"
-          @change="changeSystem"
-        >
-          <el-option
-            v-for="item in subsystemList"
-            :key="item.id"
-            :label="item.name"
-            :value="item.id"
-          />
-        </el-select>
-      </ibps-tree>
-      <ibps-container
-        :margin-left="width+'px'"
-        class="page"
-      >
-        <edit
-          v-if="show==='edit'"
-          :id="id"
-          :parent-id="parentId"
-          :system-id="systemId"
-          @callback="search"
-        />
-        <el-alert
-          v-else
-          :closable="false"
-          title="请选择左边菜单右键进行操作!"
-          type="warning"
-          show-icon
-          style="height:50px;"
-        />
-      </ibps-container>
+    <ibps-layout ref="layout">
+        <div slot="west">
+            <ibps-tree
+                ref="tree"
+                :width="width"
+                :height="height"
+                :loading="loading"
+                :data="treeData"
+                :options="treeOptions"
+                :contextmenus="treeContextmenus"
+                title="菜单管理"
+                @action-event="handleTreeAction"
+                @node-click="handleNodeClick"
+                @expand-collapse="handleExpandCollapse"
+            >
+                <el-select
+                    slot="searchForm"
+                    v-model="systemId"
+                    placeholder="请先设置子系统"
+                    @change="changeSystem"
+                >
+                    <el-option
+                        v-for="item in subsystemList"
+                        :key="item.id"
+                        :label="item.name"
+                        :value="item.id"
+                    />
+                </el-select>
+            </ibps-tree>
+            <ibps-container
+                :margin-left="width+'px'"
+                class="page"
+            >
+                <edit
+                    v-if="show==='edit'"
+                    :id="id"
+                    :parent-id="parentId"
+                    :system-id="systemId"
+                    @callback="search"
+                />
+                <el-alert
+                    v-else
+                    :closable="false"
+                    title="请选择左边菜单右键进行操作!"
+                    type="warning"
+                    show-icon
+                    style="height:50px;"
+                />
+            </ibps-container>
 
-      <!-- 导入定义 -->
-      <import-Menu
-        :id="systemId"
-        :resource-id="resourceId"
-        :visible="importFormVisible"
-        @callback="search"
-        @close="visible => importFormVisible = visible"
-      />
+            <!-- 导入定义 -->
+            <import-Menu
+                :id="systemId"
+                :resource-id="resourceId"
+                :visible="importFormVisible"
+                @callback="search"
+                @close="visible => importFormVisible = visible"
+            />
 
-      <!--移动节点-->
-      <move-node
-        :id="id"
-        :visible="moveNodeVisible"
-        :system-id="systemId"
-        :data="treeData"
-        @callback="search"
-        @close="visible => moveNodeVisible = visible"
-      />
+            <!--移动节点-->
+            <move-node
+                :id="id"
+                :visible="moveNodeVisible"
+                :system-id="systemId"
+                :data="treeData"
+                @callback="search"
+                @close="visible => moveNodeVisible = visible"
+            />
 
-      <node-sort
-        :data="sortData"
-        :visible="nodeSortVisible"
-        title="菜单排序"
-        @close="visible => nodeSortVisible = visible"
-        @callback="search"
-      />
-      <!-- API 授权申请 -->
-      <client-grant
-        :title="title"
-        :client-key="clientKey"
-        :grant-type="grantType"
-        :visible="apiGrantVisible"
-        @callback="search"
-        @close="visible => apiGrantVisible = visible"
-      />
-    </div>
-  </ibps-layout>
+            <node-sort
+                :data="sortData"
+                :visible="nodeSortVisible"
+                title="菜单排序"
+                @close="visible => nodeSortVisible = visible"
+                @callback="search"
+            />
+            <!-- API 授权申请 -->
+            <client-grant
+                :title="title"
+                :client-key="clientKey"
+                :grant-type="grantType"
+                :visible="apiGrantVisible"
+                @callback="search"
+                @close="visible => apiGrantVisible = visible"
+            />
+        </div>
+    </ibps-layout>
 </template>
 <script>
 import { getTreeData, remove, exportXml, updateNode } from '@/api/platform/auth/resources'
@@ -99,223 +99,223 @@ import MoveNode from './move-node'
 import NodeSort from './sort'
 import ImportMenu from './import'
 export default {
-  components: {
-    Edit,
-    MoveNode,
-    NodeSort,
-    ClientGrant,
-    ImportMenu
-  },
-  mixins: [FixHeight],
-  data() {
-    return {
-      show: '',
-      width: 230,
-      height: document.clientHeight,
-      id: '',
-      title: '',
-      parentId: '',
-      // 移动节点
-      moveNodeVisible: false,
-      importFormVisible: false,
-      apiGrantVisible: false,
-      subsystemList: [],
-      systemId: '',
-      resourceId: '',
-      sortData: '',
-      nodeSortVisible: false,
-      clientKey: '',
-      grantType: '',
-      // 树配置
-      loading: false,
-      treeOptions: { 'rootPId': '-1', showIcon: true },
-      treeContextmenus: [
-        { icon: 'add',
-          label: '添加',
-          value: 'add',
-          rights: function(menu, data, isRoot) {
-            if (isRoot) return true
-            return data.isFolder
-          } },
-        // { icon: 'edit', label: '编辑', value: 'edit', rights: ['node'] },
-        { icon: 'remove', label: '删除', value: 'remove', rights: ['node'] },
-        { type: 'divided' },
-        { icon: 'export', label: '导出', value: 'export' },
-        { icon: 'import', label: '导入', value: 'import' },
-        { type: 'divided' },
-        { icon: 'ticket', label: '接口授权', value: 'authApiGrant', rights: ['node'] },
-        { type: 'divided', rights: ['node'] },
-        { icon: 'arrows-v', label: '移动节点', value: 'moveNode', rights: ['node'] },
-        { icon: 'sort', label: '节点排序', value: 'nodeSort' },
-        { icon: 'refresh',
-          label: '更新数据',
-          value: 'nodeUpdate',
-          rights: function(menu, data, isRoot) {
-            return isRoot
-          } }
-      ],
-      treeData: []
-    }
-  },
-  created() {
-    this.loadSubsystemData()
-  },
-  methods: {
-    loadSubsystemData() {
-      findAllSubsystem().then(response => {
-        this.subsystemList = response.data
-        this.systemId = this.subsystemList && this.subsystemList.length > 0 ? this.subsystemList[0].id : ''
-        this.loadTreeData()
-      })
-    },
-    changeSystem(value) {
-      this.systemId = value
-      this.loadTreeData()
-    },
-    loadTreeData() {
-      this.loading = true
-      getTreeData({
-        systemId: this.systemId
-      }).then(response => {
-        this.loading = false
-        this.treeData = response.data
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    // 查询
-    search() {
-      this.loadTreeData()
+    components: {
+        Edit,
+        MoveNode,
+        NodeSort,
+        ClientGrant,
+        ImportMenu
     },
-    handleTreeAction(command, position, selection, data) {
-      if (position === 'toolbar') {
-        if (command === 'refresh') {
-          this.loadTreeData()
+    mixins: [FixHeight],
+    data () {
+        return {
+            show: '',
+            width: 230,
+            height: document.clientHeight,
+            id: '',
+            title: '',
+            parentId: '',
+            // 移动节点
+            moveNodeVisible: false,
+            importFormVisible: false,
+            apiGrantVisible: false,
+            subsystemList: [],
+            systemId: '',
+            resourceId: '',
+            sortData: '',
+            nodeSortVisible: false,
+            clientKey: '',
+            grantType: '',
+            // 树配置
+            loading: false,
+            treeOptions: { 'rootPId': '-1', showIcon: true },
+            treeContextmenus: [
+                { icon: 'add',
+                    label: '添加',
+                    value: 'add',
+                    rights: function (menu, data, isRoot) {
+                        if (isRoot) return true
+                        return data.isFolder
+                    } },
+                // { icon: 'edit', label: '编辑', value: 'edit', rights: ['node'] },
+                { icon: 'remove', label: '删除', value: 'remove', rights: ['node'] },
+                { type: 'divided' },
+                { icon: 'export', label: '导出', value: 'export' },
+                { icon: 'import', label: '导入', value: 'import' },
+                { type: 'divided' },
+                { icon: 'ticket', label: '接口授权', value: 'authApiGrant', rights: ['node'] },
+                { type: 'divided', rights: ['node'] },
+                { icon: 'arrows-v', label: '移动节点', value: 'moveNode', rights: ['node'] },
+                { icon: 'sort', label: '节点排序', value: 'nodeSort' },
+                { icon: 'refresh',
+                    label: '更新数据',
+                    value: 'nodeUpdate',
+                    rights: function (menu, data, isRoot) {
+                        return isRoot
+                    } }
+            ],
+            treeData: []
         }
-      } else {
-        const id = data.id
-        switch (command) {
-        // 组织负责人
-          case 'add':// 添加
-            this.handleEdit('', id)
-            break
-          // case 'edit':// 编辑
-          //   this.handleEdit(id)
-          //   break
-          case 'remove':// 删除
-            ActionUtils.removeRecord(id).then((ids) => {
-              if (data.children && this.$utils.isNotEmpty(data.children)) {
-                ActionUtils.removeRecord(id, '是否删除子菜单?不删除则子菜单层次会转换到该菜单层次!').then((ids) => {
-                  this.handleRemove(ids, true)
-                }).catch(() => {
-                  this.handleRemove(ids)
-                })
-              } else {
-                this.handleRemove(ids)
-              }
-            }).catch(() => { })
-            break
-          case 'export':// 导出
-            this.handleExport(id, this.systemId, data.name)
-            break
-          case 'import':// 导入
-            this.handImport(id)
-            break
-          case 'authApiGrant':// 接口授权
-            this.title = '接口授权申请'
-            this.clientKey = data.alias
-            this.grantType = 'res'
-            this.handleApiGrant()
-            break
-          case 'moveNode':// 移动节点
-            this.handleMoveNode(id)
-            break
-          case 'nodeSort':// 节点排序
-            this.handleNodeSort(data)
-            break
-          case 'nodeUpdate':// 更新数据
-            this.handleNodeUpdate(this.systemId)
-            break
-          default:
-            break
-        }
-      }
     },
-    /**
+    created () {
+        this.loadSubsystemData()
+    },
+    methods: {
+        loadSubsystemData () {
+            findAllSubsystem().then(response => {
+                this.subsystemList = response.data
+                this.systemId = this.subsystemList && this.subsystemList.length > 0 ? this.subsystemList[0].id : ''
+                this.loadTreeData()
+            })
+        },
+        changeSystem (value) {
+            this.systemId = value
+            this.loadTreeData()
+        },
+        loadTreeData () {
+            this.loading = true
+            getTreeData({
+                systemId: this.systemId
+            }).then(response => {
+                this.loading = false
+                this.treeData = response.data
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+        // 查询
+        search () {
+            this.loadTreeData()
+        },
+        handleTreeAction (command, position, selection, data) {
+            if (position === 'toolbar') {
+                if (command === 'refresh') {
+                    this.loadTreeData()
+                }
+            } else {
+                const id = data.id
+                switch (command) {
+                    // 组织负责人
+                    case 'add':// 添加
+                        this.handleEdit('', id)
+                        break
+                        // case 'edit':// 编辑
+                        //   this.handleEdit(id)
+                        //   break
+                    case 'remove':// 删除
+                        ActionUtils.removeRecord(id).then((ids) => {
+                            if (data.children && this.$utils.isNotEmpty(data.children)) {
+                                ActionUtils.removeRecord(id, '是否删除子菜单?不删除则子菜单层次会转换到该菜单层次!').then((ids) => {
+                                    this.handleRemove(ids, true)
+                                }).catch(() => {
+                                    this.handleRemove(ids)
+                                })
+                            } else {
+                                this.handleRemove(ids)
+                            }
+                        }).catch(() => { })
+                        break
+                    case 'export':// 导出
+                        this.handleExport(id, this.systemId, data.name)
+                        break
+                    case 'import':// 导入
+                        this.handImport(id)
+                        break
+                    case 'authApiGrant':// 接口授权
+                        this.title = '接口授权申请'
+                        this.clientKey = data.alias
+                        this.grantType = 'res'
+                        this.handleApiGrant()
+                        break
+                    case 'moveNode':// 移动节点
+                        this.handleMoveNode(id)
+                        break
+                    case 'nodeSort':// 节点排序
+                        this.handleNodeSort(data)
+                        break
+                    case 'nodeUpdate':// 更新数据
+                        this.handleNodeUpdate(this.systemId)
+                        break
+                    default:
+                        break
+                }
+            }
+        },
+        /**
      * 接口授权申请
      */
-    handleApiGrant() {
-      this.apiGrantVisible = true
-    },
-    // 导入
-    handImport(resourceId) {
-      this.resourceId = resourceId
-      this.importFormVisible = true
-    },
-    handleExport(resourceId, systemId, name) {
-      exportXml({
-        resourceId: resourceId,
-        systemId: systemId
-      }).then(response => {
-        ActionUtils.exportFile(response.data, name + '.xml')
-      }).catch(() => {})
-    },
-    // 添加 编辑
-    handleEdit(id = '', parentId) {
-      if (this.id === id) {
-        this.show = ''
-      }
-      setTimeout(() => {
-        this.show = 'edit'
-        this.id = id
-        this.parentId = parentId
-      }, 0)
-    },
-    // 处理删除
-    handleRemove(ids, cascade) {
-      remove({ resourceIds: ids, cascade: cascade || false }).then(response => {
-        ActionUtils.removeSuccessMessage()
-        this.loadTreeData()
-      }).catch(() => {})
-    },
-    // 移动节点
-    handleMoveNode(id = '') {
-      this.moveNodeVisible = true
-      this.id = id
-    },
-    handleNodeSort(data) {
-      if (this.$utils.isEmpty(data.children)) {
-        ActionUtils.warning('无子节点排序')
-        return
-      }
-      if (data.children.length === 1) {
-        ActionUtils.warning('只有一个节点无需排序')
-      } else {
-        this.nodeSortVisible = true
-        this.sortData = data.children
-      }
-    },
-    // 树点击
-    handleNodeClick(data) {
-      if (data.id === '0' || data.id === 0) {
-        this.show = ''
-      } else {
-        this.show = 'edit'
-        this.id = data.id
-      }
-    },
-    handleExpandCollapse(isExpand) {
-      this.width = isExpand ? 230 : 30
-    },
-    handleNodeUpdate(systemId) {
-      this.loading = true
-      updateNode({ systemId: systemId }).then(response => {
-        this.loadTreeData()
-      }).catch((err) => {
-        this.loading = false
-        console.error(err)
-      })
+        handleApiGrant () {
+            this.apiGrantVisible = true
+        },
+        // 导入
+        handImport (resourceId) {
+            this.resourceId = resourceId
+            this.importFormVisible = true
+        },
+        handleExport (resourceId, systemId, name) {
+            exportXml({
+                resourceId: resourceId,
+                systemId: systemId
+            }).then(response => {
+                ActionUtils.exportFile(response.data, name + '.xml')
+            }).catch(() => {})
+        },
+        // 添加 编辑
+        handleEdit (id = '', parentId) {
+            if (this.id === id) {
+                this.show = ''
+            }
+            setTimeout(() => {
+                this.show = 'edit'
+                this.id = id
+                this.parentId = parentId
+            }, 0)
+        },
+        // 处理删除
+        handleRemove (ids, cascade) {
+            remove({ resourceIds: ids, cascade: cascade || false }).then(response => {
+                ActionUtils.removeSuccessMessage()
+                this.loadTreeData()
+            }).catch(() => {})
+        },
+        // 移动节点
+        handleMoveNode (id = '') {
+            this.moveNodeVisible = true
+            this.id = id
+        },
+        handleNodeSort (data) {
+            if (this.$utils.isEmpty(data.children)) {
+                ActionUtils.warning('无子节点排序')
+                return
+            }
+            if (data.children.length === 1) {
+                ActionUtils.warning('只有一个节点无需排序')
+            } else {
+                this.nodeSortVisible = true
+                this.sortData = data.children
+            }
+        },
+        // 树点击
+        handleNodeClick (data) {
+            if (data.id === '0' || data.id === 0) {
+                this.show = ''
+            } else {
+                this.show = 'edit'
+                this.id = data.id
+            }
+        },
+        handleExpandCollapse (isExpand) {
+            this.width = isExpand ? 230 : 30
+        },
+        handleNodeUpdate (systemId) {
+            this.loading = true
+            updateNode({ systemId: systemId }).then(response => {
+                this.loadTreeData()
+            }).catch((err) => {
+                this.loading = false
+                console.error(err)
+            })
+        }
     }
-  }
 }
 </script>

+ 56 - 83
src/views/platform/cat/type/edit.vue

@@ -21,29 +21,22 @@
             :label-width="formLabelWidth"
             @submit.native.prevent
         >
-            <!-- <el-form-item  v-show="!formId" label="父节点名称:">
-        <span>{{ parentData.name }}</span>
-      </el-form-item> -->
+            <!-- <el-form-item v-show="!formId" label="父节点名称:">
+                <span>{{ parentData.name }}</span>
+            </el-form-item> -->
 
-            <el-form-item
-                label="分类名称:"
-                prop="name"
-            >
+            <el-form-item label="分类名称:" prop="name">
                 <el-input
                     v-model="type.name"
                     v-pinyin="{vm:type,key:'typeKey'}"
                 />
             </el-form-item>
-            <el-form-item
-                label="分类Key:"
-                prop="typeKey"
-            >
+            <el-form-item label="分类Key:" prop="typeKey">
                 <el-input
                     v-model="type.typeKey"
                     :disabled="$utils.isNotEmpty(formId)"
                 />
             </el-form-item>
-
             <el-form-item
                 v-show="categoryKey==='DIC_TYPE'"
                 label="分类类型:"
@@ -59,10 +52,7 @@
                 </el-radio-group>
             </el-form-item>
         </el-form>
-        <div
-            slot="footer"
-            class="el-dialog--center"
-        >
+        <div slot="footer" class="el-dialog--center">
             <ibps-toolbar
                 :actions="toolbars"
                 @action-event="handleActionEvent"
@@ -70,14 +60,8 @@
         </div>
     </el-dialog>
     <!--默认形式-->
-    <div
-        v-else
-        class="main-container"
-    >
-        <ibps-container
-            type="full"
-            class="page"
-        >
+    <div v-else class="main-container">
+        <ibps-container type="full" class="page">
             <template slot="header">
                 <el-button
                     type="primary"
@@ -95,16 +79,10 @@
                 <el-form-item label="分类:">
                     <span>{{ isPrivateLocal ? '私有分类' : '普通分类' }}</span>
                 </el-form-item>
-                <el-form-item
-                    v-show="!formId"
-                    label="父节点名称:"
-                >
+                <el-form-item v-show="!formId" label="父节点名称:">
                     <span>{{ parentData.name }}</span>
                 </el-form-item>
-                <el-form-item
-                    label="分类名称:"
-                    prop="name"
-                >
+                <el-form-item label="分类名称:" prop="name">
                     <el-input
                         v-if="!readonly"
                         v-model="type.name"
@@ -112,10 +90,7 @@
                     />
                     <span v-else>{{ type.name }}</span>
                 </el-form-item>
-                <el-form-item
-                    label="分类Key:"
-                    prop="typeKey"
-                >
+                <el-form-item label="分类Key:" prop="typeKey">
                     <el-input
                         v-if="!readonly"
                         v-model="type.typeKey"
@@ -228,12 +203,6 @@ export default {
         title: {
             type: String
         },
-        firstDiDian: {
-            type: String
-        },
-        secondDiDian: {
-            type: String
-        },
         readonly: {
             type: Boolean,
             default: false
@@ -245,8 +214,12 @@ export default {
         randomNum: [String, Number] // 时间戳,用于保证点击请求数据
     },
     data () {
-        const level = this.firstDiDian || this.secondDiDian
+        const { first, second } = this.$store.getters.level || {}
+        const level = second || first
         return {
+            first,
+            second,
+            level,
             rules: {
                 name: [{ required: true, message: this.$t('validate.required') }],
                 typeKey: [{ required: true, validator: validateKey }]
@@ -306,7 +279,8 @@ export default {
                 } else {
                     delete this.rules.authorityObject
                 }
-            }
+            },
+            immediate: true
         },
         random () {
             if (this.displayType !== 'dialog') {
@@ -333,12 +307,12 @@ export default {
             },
             immediate: true
         },
-        /* formId() {
-       if (this.displayType !== 'dialog') {
-         this.getFormData()
-         if (!this.id) this.type = JSON.parse(JSON.stringify(this.defaultForm))
-       }
-    }, */
+        // formId () {
+        //     if (this.displayType !== 'dialog') {
+        //         this.getFormData()
+        //         if (!this.id) this.type = JSON.parse(JSON.stringify(this.defaultForm))
+        //     }
+        // },
         isPrivate: {
             handler: function (val, oldVal) {
                 this.isPrivateLocal = this.isPrivate
@@ -369,7 +343,8 @@ export default {
         // 保存数据
         handleSave () {
             if (this.categoryKey === 'FILE_TYPE') {
-                if (this.type.authorityObject.chaYue === '部门查阅' && (!this.type.authorityObject.buMen || this.type.authorityObject.buMen.length === 0)) {
+                const { chaYue, buMen } = this.type.authorityObject
+                if (chaYue === '部门查阅' && this.$utils.isEmpty(buMen)) {
                     this.rules.authorityObject.buMen = [{ required: true, message: '部门选择不得为空!' }]
                 } else {
                     this.rules.authorityObject.buMen = [{ required: false }]
@@ -425,8 +400,8 @@ export default {
             })
         },
         /**
-     * 表单验证
-     */
+         * 表单验证
+         */
         formValidate () {
             if (this.readonly) return
             this.$nextTick(() => {
@@ -434,8 +409,8 @@ export default {
             })
         },
         /**
-     * 获取表单数据
-     */
+         * 获取表单数据
+         */
         getFormData () {
             if (this.$utils.isEmpty(this.formId)) {
                 // 重置表单
@@ -443,9 +418,7 @@ export default {
                 this.formValidate()
                 return
             }
-            get({
-                typeId: this.formId
-            }).then(response => {
+            get({ typeId: this.formId }).then(response => {
                 this.$refs[this.formName].clearValidate()
                 this.type = response.data
                 this.type.authorityObject = JSON.parse(response.data.authorityObject)
@@ -454,7 +427,7 @@ export default {
         },
         getRadioOptions () {
             this.type.authorityObject.buMen = ''
-            const sql = `select * FROM  ibps_party_entity WHERE party_type_='position' and (path_ like '%${this.secondDiDian}%' or path_ = '${this.firstDiDian}.')`
+            const sql = `select * FROM  ibps_party_entity WHERE party_type_='position' and (path_ like '%${this.second}%' or path_ = '${this.first}.')`
             curdPost('sql', sql).then(res => {
                 const datas = res.variables.data
                 const treeDatas = this.buildTree(datas, 'ID_', 'PARENT_ID_')
@@ -505,32 +478,32 @@ export default {
 </script>
 <style lang="scss">
 .el-cascader {
-  width: 100%;
+    width: 100%;
 }
 .gy-cascader {
-  max-width: 500px;
-  overflow-x: auto;
-  &::-webkit-scrollbar-track-piece {
-    background-color: #f8f8f800;
-  }
-  &::-webkit-scrollbar {
-    transition: all 2s;
-    height: 6px;
-  }
-  &::-webkit-scrollbar-thumb {
-    background-color: #ebeaef;
-    border-radius: 10px;
-  }
-  &::-webkit-scrollbar-thumb:hover {
-    background-color: #bbb;
-  }
-  &::-webkit-scrollbar-track {
-    background: #ffffff;
-    border-radius: 10px;
-  }
-  &::-webkit-scrollbar-corner {
-    background-color: rgba(255, 255, 255, 0);
-  }
+    max-width: 500px;
+    overflow-x: auto;
+    &::-webkit-scrollbar-track-piece {
+        background-color: #f8f8f800;
+    }
+    &::-webkit-scrollbar {
+        transition: all 2s;
+        height: 6px;
+    }
+    &::-webkit-scrollbar-thumb {
+        background-color: #ebeaef;
+        border-radius: 10px;
+    }
+    &::-webkit-scrollbar-thumb:hover {
+        background-color: #bbb;
+    }
+    &::-webkit-scrollbar-track {
+        background: #ffffff;
+        border-radius: 10px;
+    }
+    &::-webkit-scrollbar-corner {
+        background-color: rgba(255, 255, 255, 0);
+    }
 }
 </style>
 

+ 9 - 13
src/views/platform/cat/type/manage.vue

@@ -42,8 +42,6 @@
                 :parent-data="nodeData"
                 :is-private="isPrivate"
                 :random-num="randomNum"
-                :first-di-dian="firstDiDian"
-                :second-di-dian="secondDiDian"
                 display-type="edit"
                 @callback="loadTreeData"
             />
@@ -69,7 +67,6 @@
             :visible="sortFormVisible"
             title="分类排序"
             :category-key="categoryKey"
-            :di-dian="diDian"
             @callback="callback"
             @close="visible => sortFormVisible = visible"
         />
@@ -92,12 +89,10 @@ export default {
     },
     mixins: [FixHeight],
     data () {
-        const { first, second } = this.$store.getters.level
+        const { first, second } = this.$store.getters.level || {}
         return {
             width: 200,
-            diDian: second || first,
-            firstDiDian: first,
-            secondDiDian: second,
+            level: second || first,
             height: document.clientHeight,
             importFormVisible: false,
             sortFormVisible: false,
@@ -188,12 +183,13 @@ export default {
             if (this.$router.currentRoute.fullPath === '/zlgl/wjkzgl/wjjflsz') {
                 this.categoryKey = 'FILE_TYPE'
                 whereParams = {
-                    'parameters': [
+                    parameters: [
                         {
-                            'key': 'Q^category_key_^SL',
-                            'value': 'FILE_TYPE'
+                            key: 'Q^category_key_^SL',
+                            value: 'FILE_TYPE'
                         }
-                    ] }
+                    ]
+                }
             } else {
                 this.categoryKey = 'FLOW_TYPE'
             }
@@ -211,7 +207,7 @@ export default {
                 'categoryKey': this.categoryKey
             }
             if (this.categoryKey === 'FILE_TYPE') {
-                whereParams.diDian = this.diDian
+                whereParams.diDian = this.level
             }
             findTreeData(whereParams).then(response => {
                 const data = response.data
@@ -222,7 +218,7 @@ export default {
         handleTreeAction (command, position, selection, data) {
             if (data.sn === 0 && data.name === '文件分类') {
                 const object = {
-                    diDian: this.diDian,
+                    diDian: this.level,
                     buMen: '',
                     chaYue: '公用查阅',
                     shenCha: '不需要',

+ 18 - 17
src/views/platform/cat/type/sort.vue

@@ -78,11 +78,12 @@ export default {
         },
         id: String,
         title: String,
-        categoryKey: String,
-        diDian: String
+        categoryKey: String
     },
     data () {
+        const { first, second } = this.$store.getters.level || {}
         return {
+            level: second || first,
             formName: 'dictionaryForm',
             formLabelWidth: '120px',
             dialogVisible: this.visible,
@@ -158,8 +159,8 @@ export default {
             this.$emit('close', false)
         },
         /**
-     * 获取表单数据
-     */
+         * 获取表单数据
+         */
         getFormData () {
             if (this.$utils.isEmpty(this.formId)) {
                 return
@@ -169,7 +170,7 @@ export default {
                 typeId: this.formId
             }
             if (this.categoryKey === 'FILE_TYPE') {
-                whererParams.diDian = this.diDian
+                whererParams.diDian = this.level
             }
             sortList(whererParams).then(response => {
                 this.data = response.data
@@ -212,17 +213,17 @@ export default {
 </script>
 <style lang="scss">
 .type-sort-dialog {
-  // .el-dialog__body{
-  //   height:  calc(27vh - 120px) !important;
-  // }
-  .button-padding {
-    height: 5px;
-  }
-  .el-main {
-    border: 1px #d4d4de solid;
-  }
-  .el-aside {
-    padding-left: 20px;
-  }
+    // .el-dialog__body{
+    //     height:  calc(27vh - 120px) !important;
+    // }
+    .button-padding {
+        height: 5px;
+    }
+    .el-main {
+        border: 1px #d4d4de solid;
+    }
+    .el-aside {
+        padding-left: 20px;
+    }
 }
 </style>