技术监督新增查看功能
This commit is contained in:
@@ -82,7 +82,7 @@
|
||||
@getTree="treeRef.loadData(dotList.id), (popupEditFlag = false)" />
|
||||
<!-- 定义 -->
|
||||
<el-dialog v-model="viewFlag" title="定义" width="60%">
|
||||
<div class="editor" v-html="summary" style="min-height: 300px;" />
|
||||
<div class="editor" ref="editorRef" v-html="summary" style="min-height: 300px;" />
|
||||
</el-dialog>
|
||||
<!-- 删除 -->
|
||||
<el-dialog v-model="dialogVisible" title="请选择需要删除的数据" width="400">
|
||||
@@ -112,6 +112,8 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { deleteyById } from '@/api/supervision-boot/database/index'
|
||||
import { queryAllAlgorithmLibrary, updateAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import katex from "katex";
|
||||
import "katex/dist/katex.css";
|
||||
const adminInfo = useAdminInfo()
|
||||
defineOptions({
|
||||
name: 'database/algorithm'
|
||||
@@ -121,6 +123,7 @@ const height = mainHeight(20)
|
||||
const heightTab = mainHeight(82)
|
||||
const size = ref(0)
|
||||
const addTreeRef = ref()
|
||||
const editorRef = ref()
|
||||
const dialogVisible = ref(false)
|
||||
const viewFlag = ref(false)
|
||||
const popupEditFlag = ref(false)
|
||||
@@ -207,9 +210,31 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
const view = (row: any) => {
|
||||
|
||||
viewFlag.value = true
|
||||
summary.value = row.definition
|
||||
setTimeout(() => {
|
||||
|
||||
const spans = document.querySelectorAll('span[data-value]');
|
||||
// 遍历每个 span 标签
|
||||
spans.forEach(function (span) {
|
||||
|
||||
let val = katex.renderToString(span.getAttribute('data-value'), {
|
||||
throwOnError: false,
|
||||
})
|
||||
// var newDiv = document.createElement('div');
|
||||
var newDiv = span
|
||||
newDiv.innerHTML = val;
|
||||
|
||||
span.parentNode.replaceChild(newDiv, span);
|
||||
});
|
||||
|
||||
}, 100)
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
if (data.pid != '0') {
|
||||
dotList.value = data
|
||||
|
||||
Reference in New Issue
Block a user