|
@@ -35,7 +35,7 @@
|
|
|
<script>
|
|
|
import TabActionItem from '@/views/article/ui/TabActionItem.vue'
|
|
|
import FollowPopoverContentCard from '@/views/article/ui/FollowPopoverContentCard.vue'
|
|
|
-import useQuickMonitor from '@jy/data-models/modules/quick-monitor/model'
|
|
|
+import { useQuickMonitorModel } from '@/composables/quick-monitor/index'
|
|
|
import { Popover } from 'vant'
|
|
|
import { AppIcon } from '@/ui'
|
|
|
import { reactive, toRefs, toRef } from 'vue'
|
|
@@ -77,7 +77,7 @@ const confMap = {
|
|
|
}
|
|
|
|
|
|
export default {
|
|
|
- name: 'ActionMonitor',
|
|
|
+ name: 'QuickMonitor',
|
|
|
components: {
|
|
|
[Popover.name]: Popover,
|
|
|
FollowPopoverContentCard,
|
|
@@ -102,10 +102,15 @@ export default {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
},
|
|
|
- // value: {
|
|
|
- // type: Boolean,
|
|
|
- // default: false
|
|
|
- // },
|
|
|
+ cache: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ // 默认doFetch请求
|
|
|
+ auto: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
direction: {
|
|
|
type: String,
|
|
|
default: 'column',
|
|
@@ -120,8 +125,9 @@ export default {
|
|
|
beforeAction: Function
|
|
|
},
|
|
|
setup(props, { emit }) {
|
|
|
- const useMonitor = useQuickMonitor({
|
|
|
+ const useMonitor = useQuickMonitorModel({
|
|
|
type: props.type,
|
|
|
+ cache: props.cache,
|
|
|
params: {
|
|
|
id: props.id
|
|
|
}
|
|
@@ -130,9 +136,12 @@ export default {
|
|
|
const { model, fid } = toRefs(reactive(useMonitor))
|
|
|
const { follow } = toRef(model)
|
|
|
const { doFetch, doChange } = useMonitor
|
|
|
- doFetch().then((res) => {
|
|
|
- emit('afterFetch', res)
|
|
|
- })
|
|
|
+
|
|
|
+ if (props.auto) {
|
|
|
+ doFetch().then((res) => {
|
|
|
+ emit('afterFetch', res)
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
return {
|
|
|
useMonitor,
|
|
@@ -304,6 +313,8 @@ export default {
|
|
|
try {
|
|
|
const { success, msg, data } = await this.doChange()
|
|
|
loading.clear()
|
|
|
+ console.log(msg)
|
|
|
+ debugger
|
|
|
if (success) {
|
|
|
// 判断是否开启推送提醒
|
|
|
if (data?.msg_open) {
|