Forráskód Böngészése

按钮权限控制

shanbinzhang 1 hete
szülő
commit
3ecb872c06

+ 128 - 0
src/components/edb/edbSelectSearch.vue

@@ -0,0 +1,128 @@
+<template>
+  <!-- 不包含预测指标 -->
+  <!-- 调用指标搜索的下拉样式,暂时还不统一;各处交互不一样;先把一样的地方公用下吧 -->
+  <el-select
+    v-model="search_txt"
+    v-loadMore="searchLoad"
+    ref="searchRef"
+    :filterable="!search_txt"
+    remote
+    clearable
+    :placeholder="$t('Edb.InputHolderAll.input_name_orid')"
+    :style="style"
+    :remote-method="searchHandle"
+    @click.native="inputFocusHandle"
+    @change="handleSelectTarget"
+    class="edbSelectSearch-select"
+  >
+    <i slot="prefix" class="el-input__icon el-icon-search"></i>
+    <div class="fixed-top">
+      <el-radio-group v-model="searchType" size="mini" @input="searchApi(current_search)">
+        <el-radio-button label="0">全部</el-radio-button>
+        <el-radio-button label="1">收藏</el-radio-button>
+      </el-radio-group>
+    </div>
+    <el-option
+      v-for="item in searchOptions"
+      :key="item.EdbInfoId"
+      :label="
+        $i18nt.locale === 'en' ? item.EdbNameEn || item.EdbName : item.EdbName
+      "
+      :value="item.EdbInfoId"
+      :disabled="!item.HaveOperaAuth"
+    >
+      <edbDetailPopover :info="item">
+        <div slot="reference">
+          <img
+            :src="$icons.lock_ico2"
+            width="18"
+            height="18"
+            style="vertical-align: middle"
+            v-if="!item.HaveOperaAuth"
+          />
+          {{
+            $i18nt.locale === "en"
+              ? item.EdbNameEn || item.EdbName
+              : item.EdbName
+          }}
+        </div>
+      </edbDetailPopover>
+    </el-option>
+  </el-select>
+</template>
+<script>
+import { dataBaseInterface } from '@/api/api.js';
+export default {
+  props: {
+    style: {
+      type: String,
+      default:''
+    }
+  },
+  data() {
+    return {
+      searchType: 0,
+      search_txt: '',
+      searchOptions: [],
+      search_have_more: true,
+      search_page: 1,
+      current_search: '',
+    }
+  },
+  mounted(){
+
+  },
+  methods:{
+
+    // 指标选择
+    handleSelectTarget(e){
+        let edb=this.searchOptions.find(_item=>_item.EdbInfoId==e);
+        this.$emit('change',edb);
+    },
+
+    /* 搜索 */
+		searchHandle(query) {
+			this.search_page = 1;
+			this.current_search = query;
+			this.searchApi(this.current_search)
+		},
+
+		searchApi(query,page=1) {
+
+			dataBaseInterface.targetSearchByPage({
+				KeyWord:query,
+				CurrentIndex: page,
+        EdbCollect: this.searchType
+			}).then(res => {
+				if(res.Ret !== 200) return
+
+				const { List,Paging } = res.Data;
+				this.search_have_more = page < Paging.Pages;
+				this.searchOptions = page === 1 ? List : this.searchOptions.concat(List);
+					
+			})
+		},
+
+		/* 聚焦获取当前检索 */
+		inputFocusHandle(e) {
+			this.search_page = 1;
+			this.current_search = e.target.value;
+			this.searchApi(this.current_search);
+		},
+
+		searchLoad() {
+			if(!this.search_have_more) return;
+			this.searchApi(this.current_search,++this.search_page);
+		},
+  },
+}
+</script>
+<style scoped lang='scss'>
+.fixed-top {
+  position: sticky;
+  top: 0;
+  background: #fff;
+  padding: 10px 20px;
+  z-index: 9;
+}
+</style>

+ 20 - 0
src/utils/buttonConfig.js

@@ -372,6 +372,16 @@ export const edbDataPermission = {
     edbData_edbCollectClassify_save:'edbData:edbCollectClassify:save',//收藏分类编辑
     edbData_edbCollectClassify_remove:'edbData:edbCollectClassify:remove',//收藏分类删除
     edbData_edbCollectClassify_move:'edbData:edbCollectClassify:move',//收藏分类移动
+
+
+    /* 指标加工 批量移动 设置共享 设置公开 公开指标目录 */
+    edbData_set_shared: 'edbData:set:shared', //设置共享
+    edbData_set_public: 'edbData:set:public', //设置公开
+    edbData_batch_move: 'edbData:batch:move', //个人批量移动
+    edbData_publicClassifyOpt_add: 'edbData:publicClassifyOpt:add', //公开目录新建编辑分类
+    // edbData_publicClassifyOpt_edit: 'edbData:publicClassifyOpt:edit',//公开目录编辑分类
+    edbData_publicClassifyOpt_del: 'edbData:publicClassifyOpt:del',//公开目录删除分类
+    edbData_publicClassifyOpt_batch_move: 'edbData:publicClassifyOpt:batch:move',//公开目录批量移动
 }
 /*
  * ---------------------------------------------------------------------------ETA预测指标------------------------------------------------
@@ -430,6 +440,16 @@ export const chartLibPermission = {
     chartLib_uploadToForum:'chartLib:uploadToForum',//上传至社区
     chartLib_updateToForum:'chartLib:updateToForum',//同步至社区
     chartLib_withdrawfromForum:'chartLib:withdrawfromForum',//从社区撤回
+
+
+    /* 图表 批量移动 设置共享 设置公开 公开目录 */
+    chartLib_set_shared: 'chartLib:set:shared', //设置共享
+    chartLib_set_public: 'chartLib:set:public', //设置公开
+    chartLib_batch_move: 'chartLib:batch:move', //个人批量移动
+    chartLib_publicClassifyOpt_add: 'chartLib:publicClassifyOpt:add', //公开目录新建编辑
+    // chartLib_publicClassifyOpt_edit: 'chartLib:publicClassifyOpt:edit',//公开目录编辑
+    chartLib_publicClassifyOpt_del: 'chartLib:publicClassifyOpt:del',//公开目录删除
+    chartLib_publicClassifyOpt_batch_move: 'chartLib:publicClassifyOpt:batch:move',//公开目录批量移动
 }
 
 /*

+ 4 - 0
src/utils/registryComponents.js

@@ -54,3 +54,7 @@ Vue.component('chartTypeSelect',chartTypeSelect)
 // 级联选择器多语言展示
 import cascader from '@/components/edb/cascader.vue';
 Vue.component('cascader',cascader)
+
+//调用指标的搜索交互统一(选择收藏和全部)  不含预测指标
+import edbSelectSearch from '@/components/edb/edbSelectSearch.vue';
+Vue.component('edbSelectSearch',edbSelectSearch)

+ 7 - 0
src/views/dataEntry_manage/addChart.vue

@@ -56,6 +56,7 @@
 								</el-radio-group>
 							</div>
 							<el-select
+								v-if="edbFromType===1"
 								v-model="search_txt"
 								v-loadMore="searchLoad"
 								ref="searchRef"
@@ -90,6 +91,12 @@
 									</edbDetailPopover>
 								</el-option>
 							</el-select>
+							
+							<edbSelectSearch 
+								v-else
+								style="width:90%;margin-top: 10px;display: block;"
+								@change="selectTarget"
+							/>
 						</div>
 					</el-form-item>
 

+ 95 - 62
src/views/dataEntry_manage/chartSetting.vue

@@ -12,8 +12,8 @@
         <div class="main-left left" id="left" v-show="!isSlideLeft">
           
           <div class="add-chart-cont">
-            <el-button 
-              v-permission="permissionBtn.chartLibPermission.chartLib_add"
+            <el-button
+              v-if="isBtnShow('chartLib_add')"
               @click="$router.push({path: '/addchart'})" type="primary"
             ><!-- 添加图表 -->{{$t('Chart.add_chart_btn')}}</el-button>
 
@@ -41,6 +41,7 @@
                 style="width: 100%; margin-top: 20px"
                 :remote-method="searchHandle"
                 @click.native="inputFocusHandle"
+                @keyup.enter.native="handleSearchEnter"
               >
                 <i slot="prefix" class="el-input__icon el-icon-search"></i>
                 <el-option
@@ -49,15 +50,18 @@
                   :label="currentLang==='en'?(item.ChartNameEn||item.ChartName):item.ChartName"
                   :value="item.ChartInfoId"
                 >
-                  <div>
-                    <img 
-                      :src="$icons.lock_ico2" 
-                      width="18" 
-                      height="18" 
-                      style="vertical-align:middle" 
-                      v-if="!item.HaveOperaAuth"
-                    />
-                    {{currentLang==='en'?(item.ChartNameEn||item.ChartName):item.ChartName}}
+                  <div class="chart-search-item">
+                    <div>
+                      <img 
+                        :src="$icons.lock_ico2" 
+                        width="18" 
+                        height="18" 
+                        style="vertical-align:middle" 
+                        v-if="!item.HaveOperaAuth"
+                      />
+                      {{currentLang==='en'?(item.ChartNameEn||item.ChartName):item.ChartName}}
+                    </div>
+                    <i class="el-icon-star-on" style="color: #0052D9;font-size:18px;" v-if="item.CollectClassifyIdList&&item.CollectClassifyIdList.length"/>
                   </div>
                 </el-option>
               </el-select>
@@ -129,7 +133,7 @@
                             alt=""
                             style="width: 14px; height: 14px; margin-right: 8px"
                             @click.stop="addNode(node, data)"
-                            v-if="data.Button.AddButton&&permissionBtn.isShowBtn('chartLibPermission','chartLib_classifyOpt_add')"
+                            v-if="data.Button.AddButton&&isBtnShow('chartLib_classifyOpt_add')"
                           />
                           <!-- 编辑子项 -->
                           <img
@@ -137,7 +141,7 @@
                             alt=""
                             style="width: 15px; height: 14px; margin-right: 8px"
                             @click.stop="editNode(node, data)"
-                            v-if="data.Button.OpButton&&permissionBtn.isShowBtn('chartLibPermission','chartLib_classifyOpt_add')"
+                            v-if="data.Button.OpButton&&isBtnShow('chartLib_classifyOpt_add')"
                           />
                           <!-- 删除子项 -->
                           <img
@@ -146,7 +150,7 @@
                             alt=""
                             style="width: 14px; height: 14px"
                             @click.stop="removeNode(node, data)"
-                            v-if="data.Button.DeleteButton&&permissionBtn.isShowBtn('chartLibPermission','chartLib_classifyOpt_delete')"
+                            v-if="data.Button.DeleteButton&&isBtnShow('chartLib_classifyOpt_delete')"
                           />
                         </span>
                       </span>
@@ -158,7 +162,7 @@
 									<div 
                     class="opt-item" 
                     @click="addLevelOneHandle"
-                    v-if="CanOpClassify&&permissionBtn.isShowBtn('chartLibPermission','chartLib_classifyOpt_add')"
+                    v-if="CanOpClassify&&isBtnShow('chartLib_classifyOpt_add')"
                   >
 										<img
 											src="~@/assets/img/set_m/add_ico.png"
@@ -168,7 +172,11 @@
 										<span>添加图表分类</span>
 									</div>
 									<!-- 移动图表 -->
-									<div class="opt-item" @click="isOpenBatchMoveDialog=true">
+									<div 
+                    v-if="isBtnShow('chartLib_batch_move')"
+                    class="opt-item" 
+                    @click="isOpenBatchMoveDialog=true"
+                  >
 										<img
 											src="~@/assets/img/set_m/move_batch_ico.png"
 											alt=""
@@ -178,7 +186,7 @@
 									</div>
 									<template v-if="classifyShowType==='own'">
 										<!-- 共享图表 -->
-										<div class="opt-item" @click="handleOpenSetShared('shared')">
+										<div class="opt-item" @click="handleOpenSetShared('shared')" v-if="isBtnShow('chartLib_set_shared')">
 											<img
 												src="~@/assets/img/set_m/shared_ico.png"
 												alt=""
@@ -187,7 +195,7 @@
 											<span>设置图表共享</span>
 										</div>
 										<!-- 公开图表 -->
-										<div class="opt-item" @click="handleOpenSetShared('public')">
+										<div class="opt-item" @click="handleOpenSetShared('public')" v-if="isBtnShow('chartLib_set_public')">
 											<img
 												src="~@/assets/img/set_m/public_ico.png"
 												alt=""
@@ -305,7 +313,7 @@
                                     size="mini"
                                     type="number"
                                     placeholder="上限"
-                                    :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
+                                    :disabled="!isBtnShow('chartLib_editLimit')"
                                     v-model="chartLimit.max"
                                     @change="changeLimit"
                                 />
@@ -314,7 +322,7 @@
                                     size="mini"
                                     type="number"
                                     placeholder="下限"
-                                    :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
+                                    :disabled="!isBtnShow('chartLib_editLimit')"
                                     v-model="chartLimit.min"
                                     @change="changeLimit"
                                 />
@@ -328,7 +336,7 @@
                             size="mini"
                             type="number"
                             placeholder="上限"
-                            :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
+                            :disabled="!isBtnShow('chartLib_editLimit')"
                             v-model="chartLimit.rightMax"
                             @change="changeLimit"
                           />
@@ -337,7 +345,7 @@
                             size="mini"
                             type="number"
                             placeholder="下限"
-                            :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
+                            :disabled="!isBtnShow('chartLib_editLimit')"
                             v-model="chartLimit.rightMin"
                             @change="changeLimit"
                           />
@@ -348,7 +356,7 @@
                             size="mini"
                             type="number"
                             placeholder="上限"
-                            :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
+                            :disabled="!isBtnShow('chartLib_editLimit')"
                             v-model="chartLimit.rightTwoMax"
                             @change="changeLimit"
                           />
@@ -357,7 +365,7 @@
                             size="mini"
                             type="number"
                             placeholder="下限"
-                            :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
+                            :disabled="!isBtnShow('chartLib_editLimit')"
                             v-model="chartLimit.rightTwoMin"
                             @change="changeLimit"
                           />
@@ -372,7 +380,7 @@
                               size="mini"
                               type="number"
                               :placeholder="$t('Chart.up_limit')"
-                              :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
+                              :disabled="!isBtnShow('chartLib_editLimit')"
                               v-model="chartLimit.max"
                               @change="changeLimit"
                             />
@@ -381,7 +389,7 @@
                               size="mini"
                               type="number"
                               :placeholder="$t('Chart.low_limit')"
-                              :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
+                              :disabled="!isBtnShow('chartLib_editLimit')"
                               v-model="chartLimit.min"
                               @change="changeLimit"
                             />
@@ -393,7 +401,7 @@
                               size="mini"
                               type="number"
                               :placeholder="$t('Chart.low_limit')"
-                              :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
+                              :disabled="!isBtnShow('chartLib_editLimit')"
                               v-model="chartLimit.x_min"
                               @change="changeLimit"
                             />
@@ -402,7 +410,7 @@
                               size="mini"
                               type="number"
                               :placeholder="$t('Chart.up_limit')"
-                              :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
+                              :disabled="!isBtnShow('chartLib_editLimit')"
                               v-model="chartLimit.x_max"
                               @change="changeLimit"
                             />
@@ -457,11 +465,10 @@
                     <ul class="right-actions">
                         <li><!-- 操作 -->{{$t('Table.column_operations')}}</li>
                         <li
-                          v-permission="permissionBtn.chartLibPermission.chartLib_share"
                           class="span-item shareLink"
                           @click="copyChartConfirm('url')"
                           :data-clipboard-text="linkUrl"
-                          v-if="!chartInfo.Disabled"
+                          v-if="!chartInfo.Disabled&&isBtnShow('chartLib_share')"
                         >
                           <i class="el-icon-share"/>&nbsp;<!-- 分享 -->
                           {{$t('Chart.chart_share_btn')}}
@@ -479,35 +486,34 @@
                           收藏
                         </li>
                     
-                        <li 
-                          v-permission="permissionBtn.chartLibPermission.chartLib_refresh"
+                        <li
                           class="span-item" 
                           @click="refreshHandle"
+                          v-if="isBtnShow('chartLib_refresh')"
                         >
                           <span>
                             <i class="el-icon-refresh" style="margin-left:0"/>&nbsp;<!-- 刷新 -->{{$t('Edb.detail_refresh_btn')}} 
                           </span>
                         </li>
-                        <li 
-                          v-permission="permissionBtn.chartLibPermission.chartLib_save"
+                        <li
                           class="span-item"
+                          v-if="isBtnShow('chartLib_save')"
                         >
                           <span @click="saveChartHandle('')">
                             <i class="el-icon-collection" />&nbsp;<!-- 保存 -->{{$t('Chart.chart_save_btn')}}
                           </span>
                         </li>
-                        <li 
-                          v-permission="permissionBtn.chartLibPermission.chartLib_otherSave"
+                        <li
+                          v-if="isBtnShow('chartLib_otherSave')"
                           class="span-item"
                         >
                           <span @click="saveChartOtherHandle">
                             <i class="el-icon-document-add" />&nbsp;<!-- 另存为 -->{{$t('Chart.chart_copy_btn')}}
                           </span>
                         </li>
-                        <li 
-                          v-permission="permissionBtn.chartLibPermission.chartLib_edit"
+                        <li
                           class="span-item"
-                          v-if="chartInfo.IsEdit"
+                          v-if="chartInfo.IsEdit&&isBtnShow('chartLib_edit')"
                           @click="editChartHandle"
                         >
                           <img
@@ -516,56 +522,52 @@
                             style="width: 13px; height: 12px;"
                           />&nbsp;<!-- 编辑 -->{{$t('Chart.chart_edit_btn')}}
                         </li>
-                        <li 
-                          v-permission="permissionBtn.chartLibPermission.chartLib_copyOffice"
+                        <li
                           class="span-item copy"
                           @click="copyChartConfirm('office')"
-                          v-if="!chartInfo.Disabled"
+                          v-if="!chartInfo.Disabled&&isBtnShow('chartLib_copyOffice')"
                         >
                           <i class="el-icon-document-copy" />&nbsp;<!-- 复制至office -->{{$t('Chart.chart_copyoffice')}}
                         </li>
-                        <li 
-                          v-permission="permissionBtn.chartLibPermission.chartLib_copyWechat"
+                        <li
                           class="span-item copy"
                           @click="copyChartConfirm('微信')"
-                          v-if="!chartInfo.Disabled"
+                          v-if="!chartInfo.Disabled&&isBtnShow('chartLib_copyWechat')"
                         >
                           <img style="width: 13px; height: 12px;vertical-align: middle" src="~@/assets/img/chart_m/WeChat.jpg" />&nbsp;<!-- 复制至微信 -->{{$t('Chart.chart_copywx')}}
                         </li>
-                        <li 
-                          v-permission="permissionBtn.chartLibPermission.chartLib_enNameSetting"
+                        <li
                           class="span-item copy"
                           @click="openLangInfoDia"
+                          v-if="isBtnShow('chartLib_enNameSetting')"
                         >
                           <img style="width: 16px;vertical-align: middle" :src="$icons.to_en" />&nbsp;<!-- 编辑信息 -->{{$t('Edb.detail_en_btn')}}
                         </li>
-                        <li 
-                          v-permission="permissionBtn.chartLibPermission.chartLib_del"
+                        <li
                           class="span-item"
                           style="color: #ff4040"
                           @click="delChartHandle"
-                          v-if="chartInfo.IsEdit"
+                          v-if="chartInfo.IsEdit&&isBtnShow('chartLib_del')"
                         >
                           <i class="el-icon-delete" style="color: #ff4040" />&nbsp;<!-- 删除 -->{{$t('Chart.chart_del_btn')}}
                         </li>
                         <li 
-                          v-if="chartInfo.ForumChartInfoId==0"
-                          v-permission="permissionBtn.chartLibPermission.chartLib_uploadToForum"
+                          v-if="chartInfo.ForumChartInfoId==0&&isBtnShow('chartLib_uploadToForum')"
                           class="span-item copy"
                           @click="showUploadToForum=true;uploadToForumIntro=''"
                         >
                           <img style="width: 16px;vertical-align: middle" :src="$icons.upload_to_forum" />&nbsp;<!-- 上传至社区 -->{{$t('Chart.upload_to_forum')}}
                         </li>
                         <template v-else>
-                        <li 
-                          v-permission="permissionBtn.chartLibPermission.chartLib_updateToForum"
+                        <li
+                          v-if="isBtnShow('chartLib_updateToForum')"
                           class="span-item copy"
                           @click="handleForumOpt('update')"
                         >
                           <img style="width: 16px;vertical-align: middle" :src="$icons.update_to_forum" />&nbsp;<!-- 同步至社区 -->{{$t('Chart.update_to_forum')}}
                         </li>
                         <li 
-                          v-permission="permissionBtn.chartLibPermission.chartLib_withdrawfromForum"
+                          v-if="isBtnShow('chartLib_withdrawfromForum')"
                           class="span-item copy"
                           @click="handleForumOpt('withdraw')"
                         >
@@ -621,14 +623,14 @@
                     width="110"
                   >
                     <template slot-scope="scope" v-if="scope.row.HaveOperaAuth">
-                      <span 
-                        v-permission="permissionBtn.chartLibPermission.chartLib_copyData"
+                      <span
+                        v-if="isBtnShow('chartLib_copyData')"
                         class="editsty" @click="copyCode(scope.row)"
                       >
                         <i class="el-icon-document-copy" />&nbsp;<!-- 复制数据 -->{{$t('Edb.detail_copydata_btn')}}
                       </span>
                       <span 
-                        v-permission="permissionBtn.chartLibPermission.chartLib_viewData"
+                        v-if="isBtnShow('chartLib_viewData')"
                         class="editsty"
                         @click="viewTarget(scope.row)"
                       >
@@ -926,7 +928,7 @@ export default {
 			classifyTabs: [
 				{ label: '我的图表',key: 'own' },
 				{ label: '共享图表',key: 'shared' },
-				{ label: '公图表',key: 'public' },
+				{ label: '公图表',key: 'public' },
 			],
 			classifyShowType:'own',
       currentTreeName: 'own',//当前点击的分类树 4块 列表请求接口不同  own public collect sharedReceive sharedSend
@@ -983,9 +985,9 @@ export default {
     /* 选中搜索图表 展开目录 选中图表 展示图表 */
     search_txt(newval) {
       if (newval) {
-        let [search_obj] = this.searchOptions.filter(
-          (item) => item.ChartInfoId === newval
-        );
+        let search_obj = this.searchOptions.find(item => item.ChartInfoId === newval);
+        if(!search_obj) return
+
         this.select_node = search_obj.UniqueCode;
       
         this.selected_chartClassify = search_obj.ChartClassifyId; //图表所属分类
@@ -1048,6 +1050,20 @@ export default {
     },
   },
   methods: {
+    //控制页面按钮权限
+		isBtnShow(key){
+			const {chartLibPermission,checkPermissionBtn}=this.permissionBtn
+
+      //同个按钮 不同分类分别控制的提出来判断
+			const BtnMap = {
+        'chartLib_classifyOpt_add': this.classifyShowType==='own'?chartLibPermission[key]:chartLibPermission.chartLib_publicClassifyOpt_add,  //新增分类
+        'chartLib_classifyOpt_delete': this.classifyShowType==='own'?chartLibPermission[key]:chartLibPermission.chartLib_publicClassifyOpt_del,  //删除分类
+        'chartLib_batch_move': this.classifyShowType==='own'?chartLibPermission[key]:chartLibPermission.chartLib_publicClassifyOpt_batch_move,  //批量移动
+			}
+			return BtnMap[key] ? checkPermissionBtn(BtnMap[key]) : checkPermissionBtn(chartLibPermission[key]);
+		},
+
+
     /* 获取目录 我的/公共目录 */
     async getTreeData(params) {
       const res = this.classifyShowType === 'public'
@@ -1775,6 +1791,18 @@ export default {
       });
     },
 
+    /* enter刷列表 */
+    handleSearchEnter(e) {
+      this.search_txt = e.target.value;
+      if(this.selected_chartid) {
+        this.selected_chartid = 0;
+        this.select_node = '';
+      }
+      this.$refs.listChartPage && (this.$refs.listChartPage.scrollTop = 0);
+      this.public_page_no = 1;
+      this.getChartList();
+    },
+
     /* 搜索 */
 		searchHandle(query) {
 			this.search_page = 1;
@@ -3049,4 +3077,9 @@ export default {
 .edb-item-style .el-input__icon {
 	line-height: 27px;
 }
+.el-select-dropdown .chart-search-item {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
 </style>

+ 30 - 21
src/views/dataEntry_manage/databaseList.vue

@@ -27,7 +27,7 @@
 					style="width: 260px;"
 					:remote-method="searchHandle"
 					@click.native="inputFocusHandle"
-					@keyup.enter.native="getEdbChartList"
+					@keyup.enter.native="handleSearchEnter"
 				>
 					<i slot="prefix" class="el-input__icon el-icon-search"></i>
 					<el-option
@@ -78,7 +78,7 @@
 						:placeholder="$t('Edb.InputHolderAll.input_name_orid')"
 						:remote-method="searchHandle"
 						@click.native="inputFocusHandle"
-						@keyup.enter.native="getEdbChartList"
+						@keyup.enter.native="handleSearchEnter"
 						style="width: 100%"
 					>
 						<i slot="prefix" class="el-input__icon el-icon-search"></i>
@@ -197,7 +197,7 @@
 										<span>{{$t('EtaBasePage.add_first_menu_btn')}}</span>
 									</div>
 									<!-- 移动指标 -->
-									<div class="opt-item" v-if="!isBasicBase" @click="isOpenBatchMoveDialog=true">
+									<div class="opt-item" v-if="!isBasicBase&&isEdbBtnShow('edbData_batch_move')" @click="isOpenBatchMoveDialog=true">
 										<img
 											src="~@/assets/img/set_m/move_batch_ico.png"
 											alt=""
@@ -208,7 +208,7 @@
 
 									<template v-if="classifyShowType==='own'&&!isBasicBase">
 										<!-- 共享指标 -->
-										<div class="opt-item" @click="handleOpenSetShared('shared')">
+										<div class="opt-item" @click="handleOpenSetShared('shared')" v-if="isEdbBtnShow('edbData_set_shared')">
 											<img
 												src="~@/assets/img/set_m/shared_ico.png"
 												alt=""
@@ -217,7 +217,7 @@
 											<span>设置指标共享</span>
 										</div>
 										<!-- 公开指标 -->
-										<div class="opt-item" @click="handleOpenSetShared('public')">
+										<div class="opt-item" @click="handleOpenSetShared('public')" v-if="isEdbBtnShow('edbData_set_public')">
 											<img
 												src="~@/assets/img/set_m/public_ico.png"
 												alt=""
@@ -878,7 +878,7 @@ export default {
 			classifyTabs: [
 				{ label: '我的指标',key: 'own' },
 				{ label: '共享指标',key: 'shared' },
-				{ label: '公指标',key: 'public' },
+				{ label: '公指标',key: 'public' },
 			],
 			classifyShowType:'own',
 			currentTreeName: 'own',//当前点击的分类树 4块 列表请求接口不同  own public collect sharedReceive sharedSend,
@@ -915,13 +915,10 @@ export default {
 		/* 选中搜索指标 展开目录 选中指标 展示数据 */
 		search_txt(newval) {
 			if (newval) {
-				let [search_obj] = this.searchOptions.filter(
-					(item) => item.EdbInfoId === newval
-				);
+				let search_obj = this.searchOptions.find((item) => item.EdbInfoId === newval);
+				if(!search_obj) return
+
 				this.page_no = 1;
-				if(this.$refs.edb_detail_data){
-					//this.$refs.edb_detail_data.$refs.valueUl.scrollTop=0
-				}
 				this.select_node = search_obj.UniqueCode;
 				this.selected_edbid = newval;
 			}
@@ -1069,19 +1066,17 @@ export default {
 				'editLimit':edbDataPermission.edbData_editLimit,//编辑上下限
 				'calculateAgain':edbDataPermission.edbData_calculateAgain,//重新计算
 
-				'editCatalog':edbDataPermission.edbData_classifyOpt_add,//添加编辑目录
-				'deleteCatalog':edbDataPermission.edbData_classifyOpt_delete,//删除目录
-				'moveCatalog':edbDataPermission.edbData_classifyOpt_move,//删除目录
+				'editCatalog': this.classifyShowType==='own' ? edbDataPermission.edbData_classifyOpt_add : edbDataPermission.edbData_publicClassifyOpt_add,//添加编辑目录
+				'deleteCatalog': this.classifyShowType==='own' ? edbDataPermission.edbData_classifyOpt_delete : edbDataPermission.edbData_publicClassifyOpt_del,//删除目录
+				'moveCatalog':edbDataPermission.edbData_classifyOpt_move,//移动目录
 				'checkRelatedChart':edbDataPermission.edbData_checkRelatedChart,//查看关联图表
 				'checkRelatedEdb':edbDataPermission.edbData_checkRelatedEdb,//查看关联指标
 				'checkCalcChart':edbDataPermission.edbData_checkCalcChart,//查看计算指标
 				'enableOrDisable':edbDataPermission.edbData_enableOrDisable,//启用/停用
-
-				// 'edbData_edbCollect_collect': edbDataPermission.edbData_edbCollect_collect,//收藏移出
-				// 'edbData_edbCollectClassify_save': edbDataPermission.edbData_edbCollectClassify_save,//收藏分类编辑
-				// 'edbData_edbCollectClassify_remove': edbDataPermission.edbData_edbCollectClassify_remove,//收藏分类删除
-				// 'edbData_edbCollectClassify_move': edbDataPermission.edbData_edbCollectClassify_move,//收藏分类移动
-				// 'edbData_edbCollectClassify_remove': edbDataPermission.edbData_edbCollectClassify_remove,//收藏分类移动
+				
+				'edbData_set_shared': edbDataPermission[type],  //设置共享
+				'edbData_set_public': edbDataPermission[type],  //批量移动
+				'edbData_batch_move': this.classifyShowType==='own'?edbDataPermission[type]:edbDataPermission.edbData_publicClassifyOpt_batch_move,  //批量移动
 			}
 			return checkPermissionBtn(BtnMap[type])
 		},
@@ -1280,6 +1275,20 @@ export default {
 			this.CurrentIndex = page;
 			this.getEdbChartList('pageChange');
 		},
+
+
+		/* 刷列表 */
+		handleSearchEnter(e) {
+
+			this.search_txt = e.target.value;
+      if(this.selected_edbid) {
+        this.selected_edbid = 0;
+        this.select_node = '';
+      }
+      this.CurrentIndex = 1;
+      this.getEdbChartList();
+		},
+
 		/* 搜索 */
 		searchHandle(query) {
 			this.search_page = 1;