修改
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<!-- <img alt="Vue logo" src="./assets/logo.png"> -->
|
||||
<HelloWorld msg="Welcome to Your Vue.js App"/>
|
||||
<!-- <HelloWorld2 msg="Welcome to Your Vue.js App"/> -->
|
||||
<HelloWorld style="display:none" msg="Welcome to Your Vue.js App"/>
|
||||
<router-view/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -12,6 +14,9 @@
|
||||
// import HelloWorld from './components/tinyMCE.vue'
|
||||
// import HelloWorld from './components/vditor.vue'
|
||||
import HelloWorld from './components/wang.vue'
|
||||
// import HelloWorld2 from './components/wangTest.vue'
|
||||
// import HelloWorld from './components/wangG.vue'
|
||||
// import HelloWorld2 from './components/wangITEM.vue'
|
||||
// import HelloWorld from './components/XMLwangS1000D.vue'
|
||||
// import HelloWorld from './components/XMLwang.vue'
|
||||
// import HelloWorld from './components/vditor2.vue'
|
||||
@@ -32,6 +37,6 @@ export default {
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-align: center;
|
||||
color: #2c3e50;
|
||||
margin-top: 60px;
|
||||
/* margin-top: 60px; */
|
||||
}
|
||||
</style>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
84
src/main.js
84
src/main.js
@@ -1,6 +1,16 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
import axios from 'axios';
|
||||
import router from './router' // 引入路由配置
|
||||
import ElementUI from 'element-ui';
|
||||
import 'element-ui/lib/theme-chalk/index.css';
|
||||
// 导入拖拽指令
|
||||
import draggable from './directives/draggable';
|
||||
|
||||
|
||||
// 全局注册指令
|
||||
Vue.directive('draggable', draggable);
|
||||
Vue.use(ElementUI);
|
||||
|
||||
Vue.prototype.$axios = axios;
|
||||
Vue.config.productionTip = false
|
||||
@@ -14,42 +24,76 @@ axios.defaults.headers.common['Authorization'] = 'Bearer token';
|
||||
axios.defaults.timeout = 10000;
|
||||
|
||||
|
||||
window.handleMessageFromDotNet = function(msg) {
|
||||
|
||||
|
||||
|
||||
let funAll = [
|
||||
// 'FrontLoadProject',
|
||||
'FrontLoadDM',
|
||||
'GetDMDta',
|
||||
'SendResourcePath',
|
||||
'SendLisentPath',
|
||||
'SendProjectName',
|
||||
'SendNewVersionDMFileName',
|
||||
'GetHistoryVesions',
|
||||
'GetDMHistoryContent',
|
||||
'GetHistoryDMContent',
|
||||
'GetExistenceDMContent',
|
||||
'handPrePath',
|
||||
'handreContent',
|
||||
'SelectFilePathSend',
|
||||
'handleMessageFromDotNet'
|
||||
];
|
||||
for(let i =0;i<funAll.length;i++){
|
||||
window[funAll[i]] = function(msg) {//接收后端返回路径
|
||||
Vue.prototype.$dotNetMessage = msg
|
||||
// 可以触发全局事件
|
||||
// console.log("MAIN FrontLoadProject 2222",msg)
|
||||
const event = new CustomEvent(funAll[i], { detail: msg })
|
||||
window.dispatchEvent(event)
|
||||
}
|
||||
}
|
||||
|
||||
window.FrontLoadProject = function(msg) {//接收后端返回路径
|
||||
Vue.prototype.$dotNetMessage = msg
|
||||
// 可以触发全局事件
|
||||
const event = new CustomEvent('dotnet-message', { detail: msg })
|
||||
console.log("MAIN FrontLoadProject 2222",msg)
|
||||
const event = new CustomEvent('FrontLoadProjectNew', { detail: msg })
|
||||
window.dispatchEvent(event)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const sendToDotNet = (type, payload) => {
|
||||
export const sendToDotNet = (type, payload,id,content,lagreVersion) => {//和后端进行通讯
|
||||
if (!window.chrome?.webview?.postMessage) {
|
||||
console.error('WebView2 环境未就绪!当前环境:', window.chrome ? '有chrome对象' : '无chrome对象');
|
||||
return;
|
||||
}
|
||||
// const message = JSON.stringify(type, payload)
|
||||
// console.log("开始给C#发送的信息",message)
|
||||
|
||||
console.log('接收到的参数:', { type, payload, id, content,lagreVersion });
|
||||
let message = {
|
||||
// 'Type':'',
|
||||
'Payload':payload
|
||||
// GetFilePath、SaveFile 取,存。
|
||||
// LoadDM 加载DM 富文本。
|
||||
// DragMaterial 拖拽时候告诉后端
|
||||
// 当Type为SaveFile时,
|
||||
// Data1为类型(PMC或者DMC) 目录PMC,富文本DMC
|
||||
// Data2为文件编号、
|
||||
// Data3为文件内容
|
||||
'Type':type||'',// AddSource
|
||||
'Data1':payload||'',
|
||||
'Data2':id||'',
|
||||
'Data3':content||'',
|
||||
'Data4':lagreVersion||'',
|
||||
'Data5':'',
|
||||
'Data6':'',
|
||||
}
|
||||
console.log("传参",message,JSON.stringify(message))
|
||||
window.chrome.webview.postMessage(message)
|
||||
// if (window.chrome?.webview?.postMessage) {
|
||||
// const message = JSON.stringify({ type, payload })
|
||||
// console.log("开始给C#发送的信息",message)
|
||||
// window.chrome.webview.postMessage(message)
|
||||
// } else {
|
||||
// console.warn('WebView2环境未就绪')
|
||||
// // 可选:开发环境模拟
|
||||
// if (process.env.NODE_ENV === 'development') {
|
||||
// console.log('[模拟发送]', { type, payload })
|
||||
// }
|
||||
// }
|
||||
window.chrome.webview.postMessage(message)
|
||||
|
||||
}
|
||||
|
||||
|
||||
Vue.prototype.$sendToDotNet = sendToDotNet
|
||||
new Vue({
|
||||
router, // 注册路由
|
||||
render: h => h(App),
|
||||
}).$mount('#app')
|
||||
|
||||
Reference in New Issue
Block a user