Karsa 3 月之前
父節點
當前提交
a7d0fd0f25

+ 2 - 0
src/utils/buttonConfig.js

@@ -216,6 +216,8 @@ export const dataSourcePermission = {
     manualData_add_updateRemind:'manualData:add:updateRemind',//新增编辑-更新提醒
     /*--------手工数据录入---- */
     manualDataWrite_edit:'manualDataWrite:edit',//编辑按钮,直接编辑没有禁
+    manualDataWrite_del:'manualDataWrite:del',//删除
+    manualDataWrite_add:'manualDataWrite:add',//添加
     manualDataWrite_export:'manualDataWrite:export',//导出
     manualDataWrite_import:'manualDataWrite:import',//导入
     manualDataWrite_online_excel:'manualDataWrite:online:excel',//在线excel

+ 26 - 4
src/views/dataEntry_manage/dataEntry/components/edbDetail.vue

@@ -1,10 +1,13 @@
 <template>
   <div class="edb-detail-data-wrap">
     <div class="handle-list">
-      <span class="editsty" @click="$emit('handle',{item:edbInfo.Detail,type:'edit'})"><!-- 编辑 -->{{$t('Table.edit_btn')}}</span>
-      <span class="editsty" @click="$emit('handle',{item:edbInfo.Detail,type:'addToBase'})"><!-- 加入指标库 -->{{$t('ManualEntryPage.add_tobase')}}</span>
+      <span class="editsty" @click="$emit('handle',{item:edbInfo.Detail,type:'edit'})" v-if="hasEditAuth"><!-- 编辑 -->{{$t('Table.edit_btn')}}</span>
+
+      <span class="editsty" @click="$emit('handle',{item:edbInfo.Detail,type:'addToBase'})" v-if="edbInfo.Detail&&edbInfo.Detail.IsJoinEdb===0&&permissionBtn.isShowBtn('dataSourcePermission','manualDataWrite_add')"><!-- 加入指标库 -->{{$t('ManualEntryPage.add_tobase')}}</span>
+
       <span class="editsty" @click="$emit('handle',{item:edbInfo.Detail,type:'logs'})"><!-- 操作日志 -->{{$t('ManualEntryPage.opera_logs')}}</span>
-      <span class="deletesty" @click="$emit('handle',{item:edbInfo.Detail,type:'del'})"><!-- 删除 -->{{$t('Table.delete_btn')}}</span>
+
+      <span class="deletesty" @click="$emit('handle',{item:edbInfo.Detail,type:'del'})" v-if="edbInfo.Detail&&edbInfo.Detail.IsJoinEdb===0&&permissionBtn.isShowBtn('dataSourcePermission','manualDataWrite_del')"><!-- 删除 -->{{$t('Table.delete_btn')}}</span>
     </div>
 		<el-table
 			:data="tableData"
@@ -89,6 +92,7 @@
                 :editable="false"
                 value-format="yyyy-MM-dd"
                 :readonly="readonly"
+                :disabled="!hasEditAuth"
                 @mousedown.native="e=> { readonly = e.button===2?true:false }"
                 prefix-icon="none"
                 @input="handleTimeChange(rindex, item)"
@@ -111,6 +115,7 @@
                 v-model="item.Close"
                 :data-rindex="rindex"
                 :data-cindex="1"
+                :disabled="!hasEditAuth"
               />
             </div>
           </li>
@@ -218,6 +223,10 @@ export default {
       console.log(this.startIndex,this.endIndex)
       console.log(this.dataList.slice(this.startIndex,this.endIndex))
       return this.dataList.slice(this.startIndex,this.endIndex)
+    },
+
+    hasEditAuth() {
+      return this.permissionBtn.isShowBtn('dataSourcePermission','manualDataWrite_edit')
     }
 
   },
@@ -276,7 +285,9 @@ export default {
       this.tableData = [res.Data.Detail]
       
       this.dataList = res.Data.Detail.DataList||[];
-      this.dataList.length && this.handleLoadData()
+      this.dataList.length && this.$nextTick(() => {
+        this.handleLoadData()
+      })
     },
 
     /* 滚动加载位置数据 */
@@ -332,6 +343,8 @@ export default {
 
      // 日期获取焦点存放日期
     handleTimeFocus(index, e) {
+      if(!this.hasEditAuth) return 
+
       this.tempTime = e.timeVal;
       this.rightMouseMenu.rindex = index;
       this.rightMouseMenu.cindex = 0;
@@ -341,6 +354,8 @@ export default {
     handleInputFocus(e, rindex, cindex) {
       console.log(e, rindex, cindex)
 
+      if(!this.hasEditAuth) return 
+
       this.rightMouseMenu.rindex = rindex;
       this.rightMouseMenu.cindex = cindex;
       this.temInputVal = _.cloneDeep(e)
@@ -445,6 +460,8 @@ export default {
 
     /* 右键 */
     handleRightClick(e) {
+      if(!this.hasEditAuth) return 
+
       let dom = $('.right-lick-menu')[0];
       if(e.clientY > window.innerHeight/2) {
         dom.style.left = e.clientX-3 + 'px';
@@ -646,6 +663,11 @@ export default {
       border: none;
       text-align: center;
     }
+
+    .el-input.is-disabled .el-input__inner {
+      background-color: #fff;
+      color: #666;
+    }
   }
 }
 </style>

+ 39 - 12
src/views/dataEntry_manage/dataEntry/index.vue

@@ -3,10 +3,29 @@
     
     <header>
       <div class="left-btn">
-        <el-button type="primary" @click="isShowinsert=true"><!-- 导入数据 -->{{$t('ManualEntryPage.tit_insert_data')}}</el-button>
-        <el-button type="primary" @click="$router.push({path: '/batchToBase' })"><!-- 批量加入指标库 -->{{$t('ManualEntryPage.batch_addbase')}}</el-button>
-        <el-button v-permission="permissionBtn.dataSourcePermission.manualDataWrite_import" type="primary" @click="$router.push({path: '/onlineExcelCopy' })"><!-- 在线Excel -->{{$t('ManualEntryPage.online_excel')}}</el-button>
-        <el-button type="primary" @click="$router.push({path: '/batchDelList' })"><!-- 批量删除 -->{{$t('ManualEntryPage.batch_del')}}</el-button>
+        <el-button 
+          type="primary" 
+          @click="isShowinsert=true" 
+          v-permission="permissionBtn.dataSourcePermission.manualDataWrite_import"
+        ><!-- 导入数据 -->{{$t('ManualEntryPage.tit_insert_data')}}</el-button>
+
+        <el-button 
+          type="primary" 
+          @click="$router.push({path: '/batchToBase' })" 
+          v-permission="permissionBtn.dataSourcePermission.manualDataWrite_batch_add"
+        ><!-- 批量加入指标库 -->{{$t('ManualEntryPage.batch_addbase')}}</el-button>
+
+        <el-button 
+          v-permission="permissionBtn.dataSourcePermission.manualDataWrite_online_excel" 
+          type="primary" 
+          @click="$router.push({path: '/onlineExcelCopy' })"
+        ><!-- 在线Excel -->{{$t('ManualEntryPage.online_excel')}}</el-button>
+
+        <el-button
+          v-permission="permissionBtn.dataSourcePermission.manualDataWrite_batch_del" 
+          type="primary" 
+          @click="$router.push({path: '/batchDelList' })"
+        ><!-- 批量删除 -->{{$t('ManualEntryPage.batch_del')}}</el-button>
       </div>
 
       <div class="right-wrap">
@@ -113,10 +132,12 @@
               >
                 <template slot-scope="{row}">
                   <div>
-                    <span class="editsty" @click="handleEdb({item:row,type:'edit'})">{{$t('Table.edit_btn')}}</span>
-                    <span v-if="row.IsJoinEdb===0" class="editsty" @click="handleEdb({item:row,type:'addToBase'})"><!-- 加入指标库 -->{{$t('ManualEntryPage.add_tobase')}}</span>
+                    <span class="editsty" @click="handleEdb({item:row,type:'edit'})"  v-if="permissionBtn.isShowBtn('dataSourcePermission','manualDataWrite_edit')">{{$t('Table.edit_btn')}}</span>
+
+                    <span v-if="row.IsJoinEdb===0&&permissionBtn.isShowBtn('dataSourcePermission','manualDataWrite_add')" class="editsty" @click="handleEdb({item:row,type:'addToBase'})"><!-- 加入指标库 -->{{$t('ManualEntryPage.add_tobase')}}</span>
+
                     <span class="editsty" @click="handleEdb({item:row,type:'logs'})"><!-- 操作日志 -->{{$t('ManualEntryPage.opera_logs')}}</span>
-                    <span v-if="row.IsJoinEdb===0" class="deletesty" @click="handleEdb({item:row,type:'del'})">{{$t('Table.delete_btn')}}</span>
+                    <span v-if="row.IsJoinEdb===0&&permissionBtn.isShowBtn('dataSourcePermission','manualDataWrite_del')" class="deletesty" @click="handleEdb({item:row,type:'del'})">{{$t('Table.delete_btn')}}</span>
                   </div>
 
                   
@@ -129,7 +150,7 @@
             
             <div style="height:35px;margin: 20px 0;">
               <m-page
-                :page_no="page_no"
+                :page_no="pageNo"
                 :pageSize="pageSize"
                 :total="total"
                 @handleCurrentChange="pageChange"
@@ -141,6 +162,7 @@
         <!-- 指标详情 -->
         <template v-else>
           <edbDetail
+            ref="edbDetailRef"
             :id="selectedEdb"
             @handle="handleEdb"
           />
@@ -179,6 +201,7 @@ import edbDetail from './components/edbDetail.vue'
 import operateLogsDia from './components/operateLogsDia.vue';
 import insertData from '../components/insertData.vue';
 import completeTargetDia from '../databaseComponents/completeTargetDia.vue';
+import { escape } from '@antv/x6/lib/util/string/string';
 export default {
   components: { 
     mPage,
@@ -243,7 +266,7 @@ export default {
       current_search: '',
       search_have_more: false,
 
-      exportMsg: ``,//导出tip
+      exportMsg: `导出当前页面筛选的指标列表`,//导出tip
 
       selectClassifyId: 0,
       selectNode: '',
@@ -326,7 +349,7 @@ export default {
 
 		searchApi(query,page=1) {
 			dataInterence.searchEdbV2({
-				KeyWord:query,
+				Keyword:query,
 				CurrentIndex: page
 			}).then(res => {
 				if(res.Ret !== 200) return
@@ -415,10 +438,14 @@ export default {
 
           if(res.Ret!==200) return 
 
-          this.getTableData()
           this.$message.success(this.$t('MsgPrompt.add_msg2'))
-
           this.isAddBaseDia = false;
+
+          if(this.selectedEdb){
+            this.$refs.edbDetailRef.edbInfo.Detail.IsJoinEdb=1
+          }else {
+             this.getTableData()
+          }
       })
     },