Karsa 3 месяцев назад
Родитель
Сommit
329775231e

+ 10 - 1
src/api/modules/dataApi.js

@@ -296,6 +296,7 @@ const dataInterence = {
 	},
 
 
+
 	//=========new version eta2.0.0
 	/**
 	 * 获取分类
@@ -340,7 +341,15 @@ const dataInterence = {
 	 */
 	searchEdbV2: params => {
 		return http.get('/entry/target/edb/search',params)
-	}
+	},
+
+	/**
+	 * 可批量加入的指标列表
+	 * @param {*} params 
+	 */
+	getBatchAddListV2: params => {
+		return http.get('/entry/target/edb/batch/list',params)
+	},
 
 
 }

+ 55 - 4
src/views/dataEntry_manage/dataEntry/index.vue

@@ -37,9 +37,9 @@
 					<i slot="prefix" class="el-input__icon el-icon-search"></i>
 					<el-option
 						v-for="item in searchOptions"
-						:key="item.EdbInfoId"
-						:label="item.EdbName"
-						:value="item.EdbInfoId"
+						:key="item.TradeCode"
+						:label="item.SecName"
+						:value="item.TradeCode"
 					/>
 				</el-select>
       </div>
@@ -201,6 +201,18 @@ export default {
       return str.replace(/#/g, encodeURIComponent("#")).replace(/;/g, encodeURIComponent(";"));
     },
   },
+  watch: {
+    search_txt(nval) {
+      if(!nval) return
+
+      this.selectClassifyId = 0;
+			this.selectedEdb = nval;
+
+			this.selectNode = this.searchOptions.find(_ => _.TradeCode===nval).UniqueCode;
+
+      this.$refs.treeRef.setCurrentNode(this.selectNode)
+    }
+  },
   data() {
     return {
       defaultProp: {
@@ -215,7 +227,13 @@ export default {
       total: 0,
       pageSize: 10,
 
-      exportMsg: ``,
+      search_txt: '',
+      searchOptions: [],
+      search_page: 1,
+      current_search: '',
+      search_have_more: false,
+
+      exportMsg: ``,//导出tip
 
       selectClassifyId: 0,
       selectNode: '',
@@ -284,6 +302,39 @@ export default {
       this.getTableData()
     },
 
+    	/* 搜索 */
+		searchHandle(query) {
+			this.search_page = 1;
+			this.current_search = query;
+			this.searchApi(this.current_search)
+		},
+
+		searchApi(query,page=1) {
+			dataInterence.searchEdbV2({
+				KeyWord:query,
+				CurrentIndex: page
+			}).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);
+		},
+
     //选中节点
     nodeChange(data,node) {
       this.selectClassifyId = !data.TradeCode?data.ClassifyId:0;

+ 1 - 78
src/views/dataEntry_manage/databaseList.vue

@@ -1165,11 +1165,6 @@ export default {
 			this.searchApi(this.current_search,++this.search_page);
 		},
 
-		/* 存储中英文状态 */
-		// setLangIntoStore() {
-		// 	this.$store.commit('edb/SET_LANG',this.currentLang)
-		// },
-
 		/* 数值滚动加载 */
 		scrollHandle: _.throttle(function() {
 			let scrollTop = this.$refs.valueUl.scrollTop;
@@ -1183,79 +1178,7 @@ export default {
 				this.getDataList();
 			}
 		},200),
-		/* 切换中英文 */
-		// changeLanguage: _.debounce(async function (lang){
-		// 	this.search_txt = '';
-		// 	this.currentLang = lang;
-		// 	await dataBaseInterface.setUserLang({
-		// 		ConfigCode: 'edb_language',
-		// 		ConfigValue: lang === 'en' ? 'EN' : 'CN'
-		// 	})
-
-		// 	this.setLangIntoStore()
-		// },200),
-		// 打开 编辑英文名称弹窗
-		// openEnNameDia(type='table'){
-		// 	this.updateType = type
-		// 	this.formItemArray=[{
-		// 		label:/* '指标名称' */ this.$t('Edb.Detail.e_name'),
-		// 		value:this.tableData[0].EdbName,
-		// 		key:'EdbName',
-		// 		notEdit:true
-		// 	}]
-		// 	// 中文单位有 才能编辑英文单位
-		// 	if(this.tableData[0].Unit && this.tableData[0].Unit!='无'){
-		// 		this.formItemArray.push({
-		// 			label:this.$t('Edb.Detail.e_unit') /* '单位' */,
-		// 			value:this.tableData[0].Unit,
-		// 			key:'Unit',
-		// 			notEdit:true
-		// 		},
-		// 		{
-		// 			label:this.$t('Edb.Detail.e_en_name')/* '英文指标名称' */,
-		// 			value:this.tableData[0].EdbNameEn,
-		// 			key:'EdbNameEn',
-		// 			placeholder: this.$t('Edb.InputHolderAll.input_common',{label:this.$t('Edb.Detail.e_en_name')}) /* '请输入英文指标名称' */
-		// 		},
-		// 		{
-		// 			label:this.$t('Edb.Detail.e_en_unit') /* '英文单位' */,
-		// 			value:this.tableData[0].UnitEn,
-		// 			key:'UnitEn',
-		// 			placeholder:this.$t('Edb.InputHolderAll.input_common',{label:this.$t('Edb.Detail.e_en_unit')})  /* '请输入英文单位' */
-		// 		})
-		// 	}else{
-		// 		this.formItemArray.push({
-		// 			label:this.$t('Edb.Detail.e_en_name') /* '英文指标名称' */,
-		// 			value:this.tableData[0].EdbNameEn,
-		// 			key:'EdbNameEn',
-		// 			placeholder:this.$t('Edb.InputHolderAll.input_common',{label:this.$t('Edb.Detail.e_en_name')}) /* '请输入英文指标名称' */
-		// 		})
-		// 	}
-
-		// 	this.setEnName = true
-		// },
-		// updateEnName(item){
-		// 	let params={
-		// 		EdbInfoId: Number(this.selected_edbid),
-		// 		...item
-		// 	}
-		// 	dataBaseInterface.edbInfoEditEn(params).then(res=>{
-		// 		if(res.Ret ==200){
-		// 			this.$message({
-		// 				message:res.Msg,
-		// 				type:"success"
-		// 			})
-
-		// 			this.getTreeData()
-		// 			this.getDataList()
-		// 			if(this.updateType=='chart'){
-		// 				// 重绘图表,刷新数据
-		// 				this.$refs.createChart.getEdbData()
-		// 			}
-		// 			this.setEnName = false
-		// 		}
-		// 	})
-		// },
+
 		openLangInfoDia(type='table') {
 				this.updateType = type
 				this.formItemArray=[