|
@@ -9,7 +9,7 @@
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import { nextTick, ref } from 'vue'
|
|
import { nextTick, ref } from 'vue'
|
|
-import { getDapSiteData } from '~api/other'
|
|
|
|
|
|
+import { getDapSiteData, getDesignStrengthList } from '~api/other'
|
|
import { ElOption, ElSelect } from 'z-element-plus'
|
|
import { ElOption, ElSelect } from 'z-element-plus'
|
|
import { arrIndex, getObjVal, getObjValue } from 'js-fast-way'
|
|
import { arrIndex, getObjVal, getObjValue } from 'js-fast-way'
|
|
|
|
|
|
@@ -48,6 +48,7 @@ const selectVal = ref(props.val)
|
|
|
|
|
|
//加载完成
|
|
//加载完成
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
|
|
+ console.log(props, 'props')
|
|
if (props.keyname && props.type) {
|
|
if (props.keyname && props.type) {
|
|
setTableFormRemoteMethod(props.keyname, props.type)
|
|
setTableFormRemoteMethod(props.keyname, props.type)
|
|
}
|
|
}
|
|
@@ -57,6 +58,8 @@ nextTick(() => {
|
|
const setTableFormRemoteMethod = async (key, type) => {
|
|
const setTableFormRemoteMethod = async (key, type) => {
|
|
if (type === 'dap_site_data') {
|
|
if (type === 'dap_site_data') {
|
|
await getDapSiteDataApi(key)
|
|
await getDapSiteDataApi(key)
|
|
|
|
+ } else if (type === 'strength_search') {
|
|
|
|
+ await getDesignStrengthListApi(key)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -81,7 +84,24 @@ const getDapSiteDataApi = async (key) => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+const getDesignStrengthListApi = async (key) => {
|
|
|
|
+ const datas = selectDatas.value
|
|
|
|
+ if (datas.length > 0) {
|
|
|
|
+ return datas
|
|
|
|
+ } else {
|
|
|
|
+ const { error, code, data } = await getDesignStrengthList({
|
|
|
|
+ contractId: props.contractId,
|
|
|
|
+ key: key,
|
|
|
|
+ }, false)
|
|
|
|
+ //处理数据
|
|
|
|
+ const resData = getObjVal(data)
|
|
|
|
+ if (!error && code === 200 && resData) {
|
|
|
|
+ selectDatas.value = await objToArr(resData, key)
|
|
|
|
+ } else {
|
|
|
|
+ selectDatas.value = []
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
//对象转数组
|
|
//对象转数组
|
|
const objToArr = async (obj) => {
|
|
const objToArr = async (obj) => {
|
|
let newArr = []
|
|
let newArr = []
|