瀏覽代碼

switch branch

Karsa 1 年之前
父節點
當前提交
4f1815c58e

+ 42 - 18
src/views/dataEntry_manage/databaseComponents/computedDialog.vue

@@ -149,7 +149,7 @@
 			placement="top-start"
 			width="360"
 			trigger="click">
-			<p style="padding:30px;line-height:25px;" v-html="$parent.tips.get(4)"/>
+			<p style="padding:30px;line-height:25px;" v-html="$parent.tips.get(type)"/>
 			<span slot="reference" class="tip-label">公式说明</span>
 		</el-popover>
 	</el-dialog>
@@ -157,6 +157,7 @@
 
 <script>
 import { dataBaseInterface } from '@/api/api.js';
+import * as preDictEdbInterface from '@/api/modules/predictEdbApi.js';
 import { formRules } from '../databaseComponents/util';
 import { unitArr } from '@/utils/defaultOptions';
 const tag_arr = [];
@@ -177,6 +178,15 @@ export default {
 		calulateList: {
 			type: Array,
 		},
+		edbSource: { // ''||'predict'
+			type: String,
+			default: ''
+		}
+	},
+	computed: {
+		type() {
+			return this.edbSource ? 31 : 4;
+		}
 	},
 	watch: {
 		isOpenComputed(newval) {
@@ -258,13 +268,14 @@ export default {
 	},
 	methods: {
 		/* 获取目录结构 */
-		getMenu() {
-			dataBaseInterface.menuListV3().then((res) => {
-				if (res.Ret === 200) {
-					this.filterNodes(res.Data.AllNodes||[]);
-					this.options = res.Data.AllNodes || [];
-				}
-			});
+		async getMenu() {
+			const res = this.edbSource === 'predict'
+				? await preDictEdbInterface.classifyListV2()
+				: await dataBaseInterface.menuListV3()
+				if (res.Ret !== 200) return
+				
+				this.filterNodes(res.Data.AllNodes||[]);
+				this.options = res.Data.AllNodes || [];
 		},
 		// 递归改变第三级目录结构
 		filterNodes(arr) {
@@ -303,18 +314,25 @@ export default {
 			this.searchApi(this.current_search);
 		},
 
-		searchApi(query,page=1) {
-			dataBaseInterface.targetSearchByPage({
-				KeyWord:query,
-				CurrentIndex: page
-			}).then(res => {
+		async searchApi(query,page=1) {
+			const res = this.edbSource === 'predict'
+				? await preDictEdbInterface.edbSearch({
+            Keyword: query,
+            CurrentIndex: page,
+						FilterSource: this.type === 45 ? 3 : this.type === 66 ? 6 : 1,
+						Frequency: this.type===64?'季度': ''
+          })
+				: await dataBaseInterface.targetSearchByPage({
+					KeyWord:query,
+					CurrentIndex: page,
+					FilterSource: this.type === 14 ? 3 : this.type === 63 ? 6 : 1,
+					Frequency: this.type===61?'季度': ''
+				})
 				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);
-					
-			})
 		},
 
 		searchLoad() {
@@ -383,9 +401,15 @@ export default {
 					EdbInfoIdArr: target_arr,
 				};
 				this.dataloading = true;
-				const res = this.calulateForm.edb_id
-					? await dataBaseInterface.calculateEdit({...params,EdbInfoId: this.calulateForm.edb_id})
-					: await dataBaseInterface.calculateAdd(params)
+
+				let res;
+				if(this.edbSource === 'predict') {
+					res = await preDictEdbInterface.calculateEdbSave(this.calulateForm.edb_id ? {...params,EdbInfoId:this.calulateForm.edb_id } : params)
+				}else {
+					res = this.calulateForm.edb_id
+						? await dataBaseInterface.calculateEdit({...params,EdbInfoId: this.calulateForm.edb_id})
+						: await dataBaseInterface.calculateAdd(params)
+				}
 
 				this.dataloading = false;
 				if (res.Ret !== 200) return

+ 3 - 1
src/views/predictEdb_manage/predictEdb.vue

@@ -339,6 +339,7 @@
 		<!-- 运算指标弹窗 -->
 		<computedDialog
 			:isOpenComputed="computed_type === 31"
+			edbSource="predict"
 			:title="computedTit"
 			:calulateForm="calulateForm"
 			:calulateList="calulateList"
@@ -443,7 +444,8 @@ import edbDetail from './components/edbDetail.vue'
 import edbClassifyDia from './components/classifyDia.vue'
 import changeLang from "@/views/dataEntry_manage/components/changeLang.vue"
 import setEnNameDia from "@/views/dataEntry_manage/components/setEnNameDia.vue"
-import computedDialog from './components/computedDialog';
+// import computedDialog from './components/computedDialog';
+import computedDialog from '@/views/dataEntry_manage/databaseComponents/computedDialog';
 import operationDialog from './components/operationDialog';
 import rulesDetail from './components/rulesDetailDia.vue'
 import batchComputedDialog from '@/views/dataEntry_manage/databaseComponents/batchComptedDialog.vue';