修改链接
parent
c77514378f
commit
ce4621feb9
|
|
@ -59,6 +59,41 @@ export const columns: BasicColumn[] = [
|
||||||
return h(Tag, { color: color }, () => text)
|
return h(Tag, { color: color }, () => text)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '内链',
|
||||||
|
dataIndex: 'is_iframe',
|
||||||
|
width: 100,
|
||||||
|
customRender: ({ record }) => {
|
||||||
|
if (!Reflect.has(record, 'pendingShowStatus')) {
|
||||||
|
record.pendingShowStatus = false
|
||||||
|
}
|
||||||
|
return h(Switch, {
|
||||||
|
checked: record.is_iframe === 1,
|
||||||
|
checkedChildren: '开启',
|
||||||
|
unCheckedChildren: '关闭',
|
||||||
|
loading: record.pendingShowStatus,
|
||||||
|
onChange(checked: boolean) {
|
||||||
|
record.pendingShowStatus = true
|
||||||
|
const newStatus = checked ? 1 : 0
|
||||||
|
const { createMessage } = useMessage()
|
||||||
|
updateFriendinks({
|
||||||
|
id: record.id,
|
||||||
|
is_iframe: checked,
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
record.is_iframe = newStatus
|
||||||
|
createMessage.success(`已成功设置内链状态`)
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
createMessage.error('修改内链状态失败')
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
record.pendingShowStatus = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '推荐',
|
title: '推荐',
|
||||||
dataIndex: 'is_recommend',
|
dataIndex: 'is_recommend',
|
||||||
|
|
@ -197,6 +232,17 @@ export const accountFormSchema: FormSchema[] = [
|
||||||
precision: 0,
|
precision: 0,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'is_iframe',
|
||||||
|
label: '是否内链',
|
||||||
|
required: true,
|
||||||
|
defaultValue: false,
|
||||||
|
component: 'Switch',
|
||||||
|
componentProps: {
|
||||||
|
checkedChildren: '是',
|
||||||
|
unCheckedChildren: '否',
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'is_recommend',
|
field: 'is_recommend',
|
||||||
label: '推荐',
|
label: '推荐',
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</LinkModal>
|
</LinkModal>
|
||||||
<IframeModal v-model:visible="iframeModalShow" :footer="null" />
|
<IframeModal v-model:visible="iframeModalShow" :footer="null" :url="current.content" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -118,7 +118,12 @@
|
||||||
function onClick(e) {
|
function onClick(e) {
|
||||||
current.value = e
|
current.value = e
|
||||||
if (e.type == 1) {
|
if (e.type == 1) {
|
||||||
window.open(e.content)
|
console.log(e)
|
||||||
|
if (e.is_iframe == 1) {
|
||||||
|
iframeModalShow.value = true
|
||||||
|
} else {
|
||||||
|
window.open(e.content)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
visibleModal.value = true
|
visibleModal.value = true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,11 +30,11 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="h-full mt-5">
|
<div class="h-full py-5">
|
||||||
<iframe
|
<iframe
|
||||||
v-if="url"
|
v-if="urlStr"
|
||||||
onload="Javascript:setHeight(this)"
|
onload="Javascript:setHeight(this)"
|
||||||
:src="url"
|
:src="urlStr"
|
||||||
frameborder="0"
|
frameborder="0"
|
||||||
width="100%"
|
width="100%"
|
||||||
height="100%"
|
height="100%"
|
||||||
|
|
@ -76,7 +76,7 @@
|
||||||
}
|
}
|
||||||
return attr
|
return attr
|
||||||
})
|
})
|
||||||
const url = computed(() => {
|
const urlStr = computed(() => {
|
||||||
return props.url
|
return props.url
|
||||||
})
|
})
|
||||||
const closeModal = () => {
|
const closeModal = () => {
|
||||||
|
|
@ -97,8 +97,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
urlStr,
|
||||||
isFull,
|
isFull,
|
||||||
url,
|
|
||||||
closeModal,
|
closeModal,
|
||||||
handleFull,
|
handleFull,
|
||||||
getBindValue,
|
getBindValue,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue