Procházet zdrojové kódy

task-5606 首页添加受控文件模块

tianxinyu před 3 měsíci
rodič
revize
8153c8cffb

+ 2 - 1
src/api/platform/desktop/column.js

@@ -110,6 +110,7 @@ export function getData(
   params,
   isQuery = true
 ) {
+
   if (dataMode === 2) {
     // api
     dataFrom = dataFrom
@@ -125,7 +126,7 @@ export function getData(
       return request({
         url: dataFrom,
         method: dataMethod || 'post',
-        data: params
+        data: JSON.stringify(params)  
       })
     }
   } else {

binární
src/assets/images/homepage/file1.png


binární
src/assets/images/homepage/file2.png


+ 40 - 0
src/assets/styles/pages/dashboard.scss

@@ -313,6 +313,46 @@ $transition: all 0.5s;
         }
       }
     }
+   
+  }
+  .home-file .el-card__header {
+    padding: 0;
+  }
+  .file-grid-icon{
+    width: 50px;
+    height: 50px;
+    background-color: #fef9c3;
+    margin-right: 10px;
+    border-radius: 12px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    background-image: url('../../images/homepage/file1.png');
+    background-size: 20px 20px; /* 或 contain, 100% 等 */
+    background-position: center;
+    background-repeat: no-repeat; 
+  }
+  .file-grid-icon-1{
+    background-color: #dcfce7;
+    background-image: url('../../images/homepage/file2.png');
+  }
+  .file-grid-content{
+    display: flex;
+    flex-direction: column;
+    justify-content: space-around;
+    align-items: flex-start;
+  }
+  .file-grid-title{
+    color: #333;
+    font-size: 14px;
+    overflow: hidden;
+    width: 130px;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+  .file-grid-text{
+    color: #999;
+    font-size: 12px;
   }
 
   [alias='userInfo'] {

+ 18 - 2
src/views/infosManage/fileIE.vue

@@ -2,8 +2,10 @@
   <ibps-layout ref="layout">
     <div slot="west">
       <ibps-type-tree
+      ref="test"
         :width="width"
         :height="height"
+        :title="title"
         :category-key="categoryKey"
         :has-permission="true"
         @refresh="refresh"
@@ -91,7 +93,9 @@ export default {
   data() {
     const { userId, isSuper } = this.$store.getters || {}
     const hasRole = localStorage.getItem('hasHighRole') === '1'
+    const searchText = this.$route.query.searchText 
     return {
+      title: '程序文件',
       userId,
       isSuper,
       hasRole,
@@ -107,7 +111,7 @@ export default {
       loading: false,
       filterText: '',
       pkKey: 'id', // 主键  如果主键不是pk需要传主键
-      tableTitle: '',
+      tableTitle: '程序文件',
       listData: [],
       listConfig: {
         // 工具栏
@@ -115,7 +119,7 @@ export default {
         // 查询条件
         searchForm: {
           forms: [
-            { prop: 'fileName', label: '文件名称', itemWidth: 150 },
+            { prop: 'fileName', label: '文件名称', itemWidth: 150, value: searchText },
             { prop: 'fileCode', label: '文件编号', itemWidth: 150 },
             { prop: 'version', label: '版本号', itemWidth: 150 },
             {
@@ -181,6 +185,16 @@ export default {
   },
   mounted() {
     this.loadData()
+    let this_ = this
+    let id = this_.$route.query.id
+    let info = this_.$route.query.info
+
+    if(this_.$route.query.id){
+      setTimeout(() => {
+        this_.handleNodeClick(id, info, this_.$refs.test.treeData)
+      },1000)
+    }
+
   },
   methods: {
     refresh() {
@@ -258,6 +272,8 @@ export default {
       })
     },
     handleNodeClick(nodeId, nodeData, treeDatas) {
+      // console.log('handleNodeClick', nodeId, nodeData, treeDatas)
+      this.tableTitle = nodeData?.name || ''
       // 避免重复请求
       if (this.typeId === nodeId) {
         return

+ 31 - 5
src/views/system/dashboard/components/util.js

@@ -185,7 +185,9 @@ export function buildComponent(name, column, preview, vm) {
           attendanceData: [],
           scheduleShift: [],
           todaySchedule: [],
-          tempSelectedValue: ''
+          tempSelectedValue: '',
+          searchText: '',
+          keysList: []
         }
       },
       computed: {
@@ -201,8 +203,19 @@ export function buildComponent(name, column, preview, vm) {
           // this.scheduleData = await this.getScheduleData()
           this.todaySchedule = await this.getTodaySchedule()
         })
+
       },
       methods: {
+        // 受控文件查阅模块搜索
+        searchFile () {
+          this.$router.push({ path: '/xxgl/nbwj', query: { searchText: this.searchText } })
+        },
+        goDetail(nodeInfo) {
+          if(!nodeInfo){
+            return
+          }
+          this.$router.push({ path: '/xxgl/nbwj', query: {info: JSON.parse(JSON.stringify(nodeInfo)), id:nodeInfo.id} })
+        },
         fetchData(columns, params = {}) {
           this.loading = true
           this.data = []
@@ -252,7 +265,14 @@ export function buildComponent(name, column, preview, vm) {
               this.quickNavigationData = data
             })
           } else {
-            getData(param, params)
+            const { first = '', second = '' } = this.$store.getters.level || {}
+            // console.log('11111111', param, params, typeof params)
+            let type = true
+            if(param.alias == 'newmk'){
+              type = false
+              params['diDian'] = second || first
+            }
+            getData(param, params, type)
               .then((res) => {
                 let { data } = res || {}
                 if (Utils.isNotEmpty(data) && Utils.isString(data)) {
@@ -266,6 +286,9 @@ export function buildComponent(name, column, preview, vm) {
                   Bus.$emit('getMessageCount', this.totalCount)
                 }
                 this.variables = res.variables
+                if(param.alias == 'newmk'){
+                  this.keysList = Object.keys(this.variables)
+                }
                 this.loading = false
               })
               .catch((e) => {
@@ -273,6 +296,10 @@ export function buildComponent(name, column, preview, vm) {
               })
           }
         },
+        
+        
+        
+        
         // 过滤日程提醒数据
         filterAlertData(data, dayNumber = 3) {
           if (dayNumber <= 0) return
@@ -487,7 +514,6 @@ export function buildComponent(name, column, preview, vm) {
           })
         },
         handleUnreadMessage(id, tableId, tableName) {
-          console.log('99999999')
           this.$emit('action-event', 'unRead', { id, tableId, tableName })
         },
         // 处理全屏
@@ -502,7 +528,8 @@ export function buildComponent(name, column, preview, vm) {
             myDiscard: 'lhjcgl/ypgqcl',
             notice: 'tygl/tzgg',
             myFacility: 'sshjgl/sshjjk/sshjkzzl',
-            quickNavigation: 'xtgl/xtsjpz/tyglpz/kjdhpz'
+            quickNavigation: 'xtgl/xtsjpz/tyglpz/kjdhpz',
+            moreFile: 'xxgl/nbwj'  //受控文件查阅
           }
           if (menuMap[url]) {
             const alias = menuMap[url].split('/')[0]
@@ -693,7 +720,6 @@ export function buildComponent(name, column, preview, vm) {
                   }
 
                 })
-                console.log(todaySchedule)
                 resolve(todaySchedule)
               })
               .catch((error) => {