Browse Source

checkout branch

shanbinzhang 1 month ago
parent
commit
42c0e3284c

+ 112 - 0
src/views/dataEntry_manage/databaseComponents/edbTableList.vue

@@ -0,0 +1,112 @@
+<template>
+  <div>
+    <el-table
+      :data="tableData"
+      ref="tableRef"
+      highlight-current-row
+      border
+    >
+        <el-table-column
+          v-for="item in tableColums"
+          :key="item.label"
+          :label="item.label"
+          :width="item.widthsty"
+          :min-width="item.minwidthsty"
+          align="center"
+        >
+          <template slot-scope="scope">
+            <span>{{ scope.row[item.key] }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" key="Opera" align="center" width="140">
+          <template slot-scope="scope" v-if="scope.row.HaveOperaAuth">
+            <span class="editsty" @click="copyCode(scope.row)" v-if="showCopyDataBtn">
+            <i class="el-icon-document-copy" />&nbsp;{{$t('Edb.detail_copydata_btn')}}</span
+          ><br v-if="showCopyDataBtn"/>
+          <span class="editsty" @click="viewTarget(scope.row)">{{$t('Edb.detail_lookdata_btn')/* 查看数据 */}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="收藏状态" key="CollectStatu" align="center">
+        
+      </el-table-column>
+      <div slot="empty">
+        <tableNoData :text="$t('Table.no_edb_msg')" size="mini"/>
+      </div>
+    </el-table>
+  </div>
+</template>
+<script>
+import { dataBaseInterface } from '@/api/api.js';
+export default {
+  computed: {
+    tableColums() {
+      return [
+				{
+					label: '指标名称',
+					key: 'EdbName',
+					minwidthsty: '200px'
+				},
+				{
+					label: '最新日期',
+					key: 'EndDate',
+					widthsty: '100px'
+				},
+				{
+					label: '最新值',
+					key: 'EndValue',
+					widthsty: '100px'
+				},
+				{
+					label: '频度',
+					key: 'Frequency',
+					widthsty: '160px'
+				},
+				{
+					label: '单位',
+					key: 'Unit',
+					widthsty: '160px'
+				},
+				{
+					label: '计算方式',
+					key: 'Unit',
+					widthsty: '160px'
+				},
+				{
+					label: '创建人',
+					key: 'SysUserRealName',
+					widthsty: '160px'
+				},
+				{
+					label: '数据来源',
+					key: 'SourceName',
+					widthsty: '160px'
+				},
+				{
+					label: '创建日期',
+					key: 'CreateDate',
+					widthsty: '160px'
+				},
+      ]
+    }
+  },
+  data() {
+    return {
+      pageNo:1,
+      pageSize:15,
+      total: 0,
+      list:[]
+    }
+  },
+  mounted(){
+    
+  },
+  methods:{
+    getTableData() {
+      
+    }
+  },
+}
+</script>
+<style scoped lang='scss'>
+
+</style>

+ 47 - 119
src/views/dataEntry_manage/databaseList.vue

@@ -1,8 +1,7 @@
 <template>
 	<div class="database_container">
-		<div class="database_top">
+		<div class="database_top" v-if="!isBasicBase">
 			<div class="top-left">
-				<template v-if="!isBasicBase">
 					<el-button v-permission="permissionBtn.edbDataPermission.edbData_addEdb"
 						type="primary" @click="addHandler"><!-- 添加指标 -->{{$t('EtaBasePage.add_edb_btn')}}</el-button>
 					<el-button v-permission="permissionBtn.edbDataPermission.edbData_calcuEdb"
@@ -13,12 +12,10 @@
 						type="primary" @click="$router.push({path: '/codecount'})"><!-- 代码运算 -->{{$t('EtaBasePage.algorithm_btn')}}</el-button>
 					<el-button v-permission="permissionBtn.edbDataPermission.edbData_dataAdjust"
 						type="primary" @click="$router.push({path: '/adjustdata'})"><!-- 数据调整 -->{{$t('EtaBasePage.adjustment_btn')}}</el-button>
-				</template>
 			</div>
 			<div class="top-right">
 
 				<el-select
-					v-if="classifyShowType==='public'"
 					v-model="search_txt"
 					v-loadMore="searchLoad"
 					ref="searchRef"
@@ -29,6 +26,7 @@
 					style="width: 260px;"
 					:remote-method="searchHandle"
 					@click.native="inputFocusHandle"
+					@keyup.enter.native="getEdbChartList"
 				>
 					<i slot="prefix" class="el-input__icon el-icon-search"></i>
 					<el-option
@@ -49,29 +47,9 @@
 						</div>
 					</el-option>
 				</el-select>
-
-				<el-input
-					v-else
-					v-model="searchCollectWord" 
-					:placeholder="$t('Edb.InputHolderAll.input_name_orid')"
-					style="width: 260px;"
-					@change="getEdbChartList"
-					clearable
-				>
-					<i slot="prefix" class="el-input__icon el-icon-search"/>
-				</el-input>
 			</div>
 		</div>
-		<!-- <div class="database-label">
-			<edb-label-list 
-				:currentLang="currentLang"
-				:labelList="labelList"
-				:activeLabelId="select_node"
-				@clickLabel="changeCurrentLabel"
-				@deleteLabel="deleteLabel"
-				@moveLabel="({oldIndex,newIndex})=>{labelList[oldIndex] = labelList.splice(newIndex, 1, labelList[oldIndex])[0];}"
-				/>
-		</div> -->
+		
 		<div class="database_main box" id="box" v-if="showData">
 			<!-- 展开收起目录按钮 -->
 			<span
@@ -98,12 +76,42 @@
 						</el-radio-button>
 					</el-radio-group>
 
+					<el-select
+						v-if="isBasicBase"
+						v-model="search_txt"
+						v-loadMore="searchLoad"
+						ref="searchRef"
+						:filterable="!search_txt"
+						remote
+						clearable
+						:placeholder="$t('Edb.InputHolderAll.input_name_orid')"
+						style="width: 260px;"
+						:remote-method="searchHandle"
+						@click.native="inputFocusHandle"
+						@keyup.enter.native="getEdbChartList"
+					>
+						<i slot="prefix" class="el-input__icon el-icon-search"></i>
+						<el-option
+							v-for="item in searchOptions"
+							:key="item.EdbInfoId"
+							:label="currentLang==='en'?(item.EdbNameEn||item.EdbName):item.EdbName"
+							:value="item.EdbInfoId"
+						>
+							<div>
+								<img 
+									:src="$icons.lock_ico2" 
+									width="18" 
+									height="18" 
+									style="vertical-align:middle" 
+									v-if="!item.HaveOperaAuth"
+								/>
+								{{currentLang==='en'?(item.EdbNameEn||item.EdbName):item.EdbName}}
+							</div>
+						</el-option>
+					</el-select>
+
 					<div style="padding:20px 0;padding-right:20px;display:flex;justify-content:space-between">
 						<span><!-- 目录 -->{{$t('EtaBasePage.tab_menu')}}</span>
-						<!-- <el-checkbox 
-							v-model="IsOnlyMe"
-							@change="onlyMeHandler"
-						>{{$t('Edb.only_see_mine')}}</el-checkbox> -->
 					</div>
 					<div class="target_tree">
 						<!-- 指标目录 -->
@@ -289,11 +297,11 @@
 						</div>
 					</draggable>	
 					<!-- </div> -->
-					
 				</div>
 				<div v-if="!Total" class="nodata">
 					<tableNoData :text="$t('Table.no_edb_msg')"/>
 				</div>
+				<edbTableList :list="list"/>
 			</div>
 
 			<!-- 指标详情 -->
@@ -550,12 +558,6 @@
 			@changeSource="changeComputedType"
 		/>
 
-		<!-- 一键更新弹窗 -->
-		<update-dialog
-			:isUpdate="isUpdate"
-			@cancel="isUpdate = false"
-		/>
-
 		<!-- 替换指标弹窗 -->
 		<replace-dialog
 			:isShow="isReplaceDia"
@@ -672,8 +674,6 @@ import addTargetDiaBase from './databaseComponents/addTargetDiaBase';
 import completeTargetDia from './databaseComponents/completeTargetDia'
 import computedDialog from './databaseComponents/computedDialog';
 import operationDialog from './databaseComponents/operationDialog';
-// import createChart from './databaseComponents/createChart';
-import updateDialog from './databaseComponents/updateDialog';
 import replaceDialog from './databaseComponents/replaceDialog';
 import jointTargetDia from './databaseComponents/jointTargetDia';
 import changeLang from "./components/changeLang.vue"
@@ -694,6 +694,7 @@ import edbHasUsedDia from './components/edbHasUsedDia.vue';
 import collectEdbMenu from './databaseComponents/collectEdbMenu.vue';
 import edbCollectDia from './databaseComponents/edbCollectDia.vue';
 import addCollectClassifyDia from './databaseComponents/addCollectClassifyDia.vue';
+import edbTableList from './databaseComponents/edbTableList.vue';
 export default {
 	name: '',
 	components: {
@@ -702,8 +703,6 @@ export default {
 		completeTargetDia,
 		computedDialog,
 		operationDialog,
-		// createChart,
-		updateDialog,
 		replaceDialog,
 		jointTargetDia,
 		changeLang,
@@ -723,7 +722,8 @@ export default {
 		edbHasUsedDia,
 		collectEdbMenu,
 		edbCollectDia,
-		addCollectClassifyDia
+		addCollectClassifyDia,
+		edbTableList
 	},
 	directives: {
 		drag(el, bindings,vnode) {
@@ -806,8 +806,7 @@ export default {
 			calculateLoading: false,//计算指标刷新loading
 			refreshLoading: false,//基础指标刷新loading
 
-			/* 一键更新弹窗 */
-			isUpdate:false,
+
 			/* 替换指标弹窗 */
 			isReplaceDia: false,
 			/* 拼接指标弹窗 */
@@ -1132,7 +1131,6 @@ export default {
 						
 						//将指标添加进标签列表中
 						const {EdbNameEn,EdbName,EdbInfoId,UniqueCode,ClassifyId}=res.Data.Item
-						this.addLabel({code:UniqueCode,id:EdbInfoId,classifyId:ClassifyId,EdbName,EdbNameEn})
 						// 展开目录
 						this.defaultShowNodes=classify_arr.map(item=>item.UniqueCode)
 						//设置tree高亮
@@ -1153,7 +1151,7 @@ export default {
 						this.$refs.menuTree.setCurrentKey(null)
 						// 清除当前的label
 						this.$message.warning('该图表已删除,自动查看下一图表')
-						this.deleteLabel({code:this.select_node,id:this.selected_edbid,classifyId:''})
+						// this.deleteLabel({code:this.select_node,id:this.selected_edbid,classifyId:''})
 						
 					}
 					if(type==='refresh') {
@@ -1655,7 +1653,7 @@ export default {
 					this.$message.success(this.$t('MsgPrompt.delete_msg'));
 					this.getTreeData();
 					this.selected_edbid = 0;
-					this.deleteLabel({code:this.select_node,id:EdbInfoId,classifyId:ClassifyId})
+					// this.deleteLabel({code:this.select_node,id:EdbInfoId,classifyId:ClassifyId})
 					// this.getNewTargetList();
 				}
 			})
@@ -2086,11 +2084,6 @@ export default {
 		 	}
 		},
 
-		/* 一键更新 */
-		updateHandler() {
-			this.isUpdate = true;
-		},
-
 		/* 替换指标 */
 		async replaceEdbHandler () {
 
@@ -2111,55 +2104,8 @@ export default {
 				this.initGetData()
 				this.rePainChart()
 		},
-		/* 获取标签列表 */
-		getlabelList(){
-			const List = JSON.parse(sessionStorage.getItem('database'))||[]
-			this.labelList = List
-		},
-		/* 添加标签  params :{code,id,classifyId,EdbName,EdbNameEn}*/
-		addLabel(params){
-			const index = this.labelList.findIndex(i=>i.code===params.code)
-			//标签已存在列表中,更新标签的值
-			if(index!==-1){
-				this.labelList.splice(index,1,params)
-				return
-			}
-			//根据页面宽度 判断标签数量是否达到上限
-			const listWidth = document.querySelector('.database-label')&&document.querySelector('.database-label').offsetWidth
-			const minWidth=170+20
-			const maxNum = Math.floor(listWidth/minWidth)
-			if(this.labelList.length>=maxNum){
-				//达到上限则挤出第一个,再添加
-				this.labelList.shift()
-			}
-			this.labelList.push(params)
-			sessionStorage.setItem('database',JSON.stringify(this.labelList))
-		},
-		//改变选中标签,
-		changeCurrentLabel(params){
-			if(params.code!==this.select_node){
-				this.selectCurrentNode(params)
-			}
-		},
-		//删除标签
-		deleteLabel(params){
-			const index = this.labelList.findIndex(i=>i.code===params.code)
-			//如果删除的标签是选中状态
-			if(this.select_node===params.code){
-				//删除的是唯一一个标签
-				if(this.labelList.length===1){
-					this.selected_edbid=0
-					this.select_node = ''
-					this.$refs.menuTree.setCurrentKey(null)
-				//不是唯一的标签,则默认选中上一个/下一个
-				}else{
-					index===0&&this.changeCurrentLabel(this.labelList[1])
-					index!==0&&index!==-1&&this.changeCurrentLabel(this.labelList[index-1])
-				}
-			}
-			index!==-1&&this.labelList.splice(index,1)
-			sessionStorage.setItem('database',JSON.stringify(this.labelList))
-		},
+
+
 		changeTreeNode(){
 			this.$refs.menuTree.setCurrentKey(this.select_node);
 		},
@@ -2309,26 +2255,13 @@ export default {
 			this.$message.success('移动成功')
 		},
 	},
-	//离开页面时保存标签
-	beforeRouteLeave(to,from,next){
-		sessionStorage.setItem('database',JSON.stringify(this.labelList))
-		next()
-	},
 	mounted() {
-		// this.getlabelList()
 		this.getEdbChartList()
 		this.$route.query.code 
 		? this.getTreeData({code: this.$route.query.code,id: this.$route.query.id,classifyId:this.$route.query.classifyId})
 		: this.getTreeData();
-
-		//离开页面时保存标签
-		window.onbeforeunload = ()=>{
-			sessionStorage.setItem('database',JSON.stringify(this.labelList))
-		}
+	
 	},
-	destroyed(){
-		window.onbeforeunload = null
-	}
 };
 </script>
 <style lang="scss">
@@ -2400,9 +2333,6 @@ export default {
 		position:relative;
 		width:100%;
 		overflow-x: auto;
-		/* div::-webkit-scrollbar {
-			width: 5px !important;
-		} */
 		.main-left {
 			width: 400px;
 			min-width: 400px;
@@ -2417,8 +2347,6 @@ export default {
 			box-sizing: border-box;
 			.tree-cont {
 				padding: 30px;
-				/* height: calc(100vh - 290px);
-				overflow: auto; */
 			}
 			.target_tree {
 				color: #333;