From 2527a643d7ac70c7a4742b297972d46c8b1495a4 Mon Sep 17 00:00:00 2001
From: hcong <1050828145@qq.com>
Date: 星期二, 12 十一月 2024 10:50:09 +0800
Subject: [PATCH] 问题审核bug修改
---
src/views/fysp/task/components/CompMonitorObj.vue | 92 +++++++++++++++++++++++++++++++++++----------
1 files changed, 71 insertions(+), 21 deletions(-)
diff --git a/src/views/fysp/task/components/CompMonitorObj.vue b/src/views/fysp/task/components/CompMonitorObj.vue
index 9093a2b..0047d9f 100644
--- a/src/views/fysp/task/components/CompMonitorObj.vue
+++ b/src/views/fysp/task/components/CompMonitorObj.vue
@@ -1,17 +1,40 @@
<template>
- <div>
- <el-segmented :model-value="tabName" :options="tabs" @change="tabChange" />
+ <div class="monitor-obj-wrapper">
+ <el-affix v-if="affix" :offset="60" target=".monitor-obj-wrapper">
+ <div>
+ <el-segmented
+ :model-value="activeName"
+ :options="activeTabs"
+ @change="tabChange"
+ />
+ </div>
+ </el-affix>
+ <div v-else>
+ <el-segmented
+ :model-value="activeName"
+ :options="activeTabs"
+ @change="tabChange"
+ />
+ </div>
+ <el-scrollbar :height="height">
+ <el-space wrap>
+ <ItemMonitorObj v-for="obj in activeData" :key="obj.movid" :item="obj">
+ <template #default="{ item }">
+ <slot :item="item">
+ <el-button
+ v-if="showBtn"
+ size="small"
+ plain
+ :type="btnType"
+ @click="itemClick(item)"
+ >{{ btnName }}</el-button
+ >
+ </slot>
+ </template>
+ </ItemMonitorObj>
+ </el-space>
+ </el-scrollbar>
</div>
- <el-space wrap>
- <ItemMonitorObj v-for="obj in activeData" :key="obj.movid" :item="obj">
- <template #default="{ item }">
- <!-- <slot :item="item"></slot> -->
- <el-button v-if="showDelete" size="small" type="danger" @click="deleteMov(item)"
- >绉婚櫎</el-button
- >
- </template>
- </ItemMonitorObj>
- </el-space>
</template>
<script>
@@ -26,12 +49,24 @@
type: String,
default: defaultTabName
},
+ tabOptions: Array,
showData: Array,
// 鏄惁娣诲姞榛樿鐨勫叏閮ㄩ�夐」
allOption: Boolean,
- showDelete: Boolean
+ showBtn: Boolean,
+ btnName: {
+ type: String,
+ default: '绉婚櫎'
+ },
+ btnType: {
+ type: String,
+ default: 'danger'
+ },
+ // 澶撮儴閫夐」鏄惁鍚搁《
+ affix: Boolean,
+ height: String
},
- emits: ['update:tabName', 'update:showData', 'deleteItem'],
+ emits: ['update:tabName', 'update:showData', 'itemClick'],
data() {
return {
activeName: defaultTabName,
@@ -41,11 +76,20 @@
computed: {
activeData() {
const list = this.data.filter((v) => {
- // return this.activeName == defaultTabName || v.sceneType == this.activeName;
- return this.tabName == defaultTabName || v.sceneType == this.tabName;
+ return (
+ this.activeName == defaultTabName || v.sceneType == this.activeName
+ );
+ // return this.tabName == defaultTabName || v.sceneType == this.tabName;
});
this.$emit('update:showData', list);
return list;
+ },
+ activeTabs() {
+ if (this.tabOptions) {
+ return this.tabOptions;
+ } else {
+ return this.tabs;
+ }
}
},
watch: {
@@ -60,11 +104,16 @@
tabs: {
handler(nV, oV) {
if (nV != oV && nV.length > 0) {
- // this.activeName = nV[0];
- this.tabChange(nV);
+ this.activeName = nV[0];
+ this.tabChange(nV[0]);
}
},
immediate: true
+ },
+ tabName(nV, oV) {
+ if (nV != oV) {
+ this.activeName = nV;
+ }
}
},
methods: {
@@ -73,13 +122,14 @@
dataList.forEach((d) => {
if (list.indexOf(d.sceneType) == -1) list.push(d.sceneType);
});
- this.tabs = list;
+ this.tabs = list.sort();
},
tabChange(tabName) {
+ this.activeName = tabName;
this.$emit('update:tabName', tabName);
},
- deleteMov(item) {
- this.$emit('deleteItem', item);
+ itemClick(item) {
+ this.$emit('itemClick', item);
}
}
};
--
Gitblit v1.9.3