- {{ rowData.name }}
+
+
+ {{ rowData.name }}
+
-
- {{ item }}
+
+
+
+ {{ item }}
+
@@ -85,9 +101,8 @@ import HomeHeader from '@/views/home/components/header'
import CompareGroupView from '@/views/home/components/CompareGroupView'
import { pageWithAttrs } from '@/api/abilityStatistics'
import { defineComponent, ref, onMounted, getCurrentInstance, computed, unref, reactive, nextTick } from 'vue';
-import { Table, Spin } from 'ant-design-vue';
import { selectOne } from '@/api/home'
-import { message } from 'ant-design-vue'
+import { message, Tooltip, Table, Spin } from 'ant-design-vue'
const ctx = getCurrentInstance();
// 最大4列
@@ -230,7 +245,7 @@ let textObj = {
},
'应用场景': {
name: '场景名称',
- desc: '场景描述'
+ desc: '场景描述',
},
'计费标准信息': {
type: '计费方式',
@@ -253,36 +268,23 @@ const loadingPage = ref(false)
// 初始化
onMounted(() => {
-
getList().then(res => {
- loadingPage.value = true
initData()
- // console.log('selectedRowKeys.value------------>', selectedRowKeys.value);
-
- // Promise.all(selectedRowKeys.value.map(id => getDetail(id))).then(data => {
- // data.map((v, i) => {
- // detailArray.value.splice(i, 1, formatterData(v));
- // })
- // // 处理数据
- // nextTick(() => {
- // getNewData()
- // })
- // loadingPage.value = false
- // }).catch(err => {
- // loadingPage.value = false
- // message.error(err || '获取算法详情失败,请重试!')
- // })
})
})
const initData = () => {
loadingPage.value = true
- selectedRowKeys.value.push('1539125877366808578')
// 获取详情
Promise.all(selectedRowKeys.value.map(id => getDetail(id))).then(data => {
- data.map((v, i) => {
- detailArray.value.splice(i, 1, formatterData(v));
- })
+ detailArray.value = []
+ for (let index = 0; index < 4; index++) {
+ if (data[index] == undefined) {
+ detailArray.value.push('')
+ } else {
+ detailArray.value.push(formatterData(data[index]))
+ }
+ }
// 处理数据
nextTick(() => {
getNewData()
@@ -348,7 +350,9 @@ const getGroupList = (titleKey, trName) => {
let textInfo = textObj[titleKey]
_list.map(v => {
Object.keys(v).map(d => {
- groupItemObj[textInfo[d]] = v[d]
+ if (textInfo[d] !== undefined) {
+ groupItemObj[textInfo[d]] = v[d]
+ }
})
})
arr.push(groupItemObj)
@@ -378,25 +382,21 @@ const translateArray = (list) => {
return arr;
}
-const getArrayLength = (list) => {
- let _newList = list.filter(v => v) || []
- return _newList.length
-}
-
// 获取算法列表
const getList = () => {
const data = {
deptIds: [],
districtId: '',
infoList: [
- { attrType: "组件类型", attrValue: "智能算法" }
+ // { attrType: "组件类型", attrValue: "智能算法" }
],
name: '',
orderField: 'total',
orderType: 'DESC',
pageNum: 1,
pageSize: 15,
- type: '组件服务',
+ // type: '组件服务',
+ type: '',
}
return new Promise((resolve, reject) => {
pageWithAttrs(data).then((res) => {
@@ -416,8 +416,13 @@ const getList = () => {
// 删除算法
const deleteList = (i) => {
selectedRowKeys.value.splice(i, 1)
- detailArray.value.splice(i, 1, '')
+ detailArray.value.splice(i, 1)
nextTick(() => {
+ for (let index = 0; index < 4; index++) {
+ if (detailArray.value[index] == undefined) {
+ detailArray.value.splice(index, 1, '')
+ }
+ }
getNewData()
})
}
@@ -427,7 +432,6 @@ const addList = () => {
}
const handleOk = () => {
- console.log('selectedRowKeys------handleOk------>', selectedRowKeys);
if (selectedRowKeys.length > 4) {
message.error('最多选择四个算法!')
return false;
@@ -444,8 +448,6 @@ const rowSelection = computed(() => {
return {
selectedRowKeys: unref(selectedRowKeys),
onChange: changableRowKeys => {
- console.log('changableRowKeys------------>', changableRowKeys);
-
if (changableRowKeys.length > 4) {
message.error('最多选择四个算法!')
} else {
@@ -454,12 +456,30 @@ const rowSelection = computed(() => {
if (selectedRowKeys.value.length > 4) {
selectedRowKeys.value = selectedRowKeys.value.splice(4)
}
- console.log('selectedRowKeys------------>', selectedRowKeys.value);
},
hideDefaultSelections: true,
};
});
+
+// 动态获取高度
+const getHeight = (name) => {
+ if (name.indexOf('描述') != -1) {
+ return '120px'
+ }
+ if (name.indexOf('视频') != -1) {
+ return '230px'
+ }
+}
+
+// 是否视频播放
+const showVideo = (name) => {
+ if (name.indexOf('视频') !== -1) {
+ return true
+ }
+ return false;
+}
+
// 切换左侧
const changeTab = (n, data) => {
activeNameIndex.value = n;
@@ -467,7 +487,7 @@ const changeTab = (n, data) => {
let realTop = ctx.refs[data][0].offsetTop;
if (realTop || realTop === 0) {
ctx.refs.bottomRef.scrollTo({
- 'top': realTop - 250,
+ 'top': realTop - 240,
'behavior': 'smooth'
})
}
@@ -506,20 +526,12 @@ const formatterData = (obj) => {
return _obj
}
-// 获取数组非空长度
-const getLength = (array) => {
- let newArr = array.filter(v => v !== '')
- return newArr.length
-}
-
-
\ No newline at end of file