修改
This commit is contained in:
parent
2959b0db06
commit
4dc7853a14
@ -466,7 +466,10 @@ const menuOpt = optName => {
|
||||
color: #ebebeb !important;
|
||||
}
|
||||
.ed-collapse-item__wrap .ed-input-number__decrease, .ed-input-number__increase{
|
||||
background-color: #434343 !important;
|
||||
background-color: #434343;
|
||||
color:#ffffff;
|
||||
}
|
||||
.ed-input-number__decrease, .ed-input-number__increase{
|
||||
color:#ffffff;
|
||||
}
|
||||
.ed-collapse-item__wrap .ed-input-number.is-controls-right .ed-input-number__increase{
|
||||
|
@ -92,7 +92,6 @@ const TimeDisplay = {
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
console.log(props,66)
|
||||
navmenulist.value = props.menuList
|
||||
navtitle.value = props.projectName
|
||||
})
|
||||
|
@ -18,10 +18,10 @@
|
||||
</div>
|
||||
<div class="sfc-content-bottom">
|
||||
<el-button type="primary">导入模板</el-button>
|
||||
<el-button type="primary">保存</el-button>
|
||||
<el-button type="primary" @click="saveClick">保存</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="预览" name="预览">
|
||||
<el-tab-pane label="预览" name="预览" style="height: calc(100vh - 190px);">
|
||||
<div ref="previewContainer" class="preview"></div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@ -31,6 +31,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, reactive, nextTick } from 'vue'
|
||||
import { ElIcon, ElMessage } from 'element-plus-secondary'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { loadModule } from 'vue3-sfc-loader'
|
||||
import * as Vue from 'vue/dist/vue.esm-bundler.js'
|
||||
@ -38,17 +39,19 @@ import ElementPlus from 'element-plus'
|
||||
import less from 'less'
|
||||
import defaultTemplate from '@/viewsnew/application/SfcEditor/Navbar.vue?raw'
|
||||
import { getMenuTree } from '@/api/permission/menu'
|
||||
import { moduleUpdate,moduleById } from '@/api/application/module'
|
||||
import 'element-plus/dist/index.css'
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const activeName: any = ref('代码')
|
||||
const hearderName: any = ref('')
|
||||
const sfcCode = ref(defaultTemplate)
|
||||
const sfcCode = ref('')
|
||||
const previewContainer = ref(null)
|
||||
let prevApp = null
|
||||
const applicationId: any = ref('')
|
||||
const menuList: any = ref([])
|
||||
const appname: any = ref('')
|
||||
const dvId: any = ref('')
|
||||
// 增强的Base64转换函数
|
||||
const convertToBase64 = async (imagePath) => {
|
||||
try {
|
||||
@ -178,6 +181,7 @@ onMounted(() => {
|
||||
if (route.query.appId) {
|
||||
applicationId.value = route.query.appId
|
||||
appname.value = route.query.appname
|
||||
dvId.value = route.query.dvId
|
||||
getmenuinfo()
|
||||
}
|
||||
})
|
||||
@ -190,6 +194,12 @@ function getmenuinfo() {
|
||||
getMenuTree(params).then(res => {
|
||||
menuList.value = res.data
|
||||
})
|
||||
moduleById(dvId.value).then(res => {
|
||||
if(res.data.data.canvas_style_data){
|
||||
sfcCode.value = res.data.data.canvas_style_data
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
function goBack() {
|
||||
router.push({
|
||||
@ -205,6 +215,21 @@ function handleClick() {
|
||||
runCode()
|
||||
}
|
||||
}
|
||||
function saveClick(){
|
||||
// console.log(typeof(sfcCode.value))
|
||||
const params = {
|
||||
canvasStyleData:sfcCode.value,
|
||||
componentData:'',
|
||||
id:dvId.value
|
||||
}
|
||||
moduleUpdate(params).then(res => {
|
||||
if(res.data.code == '0'){
|
||||
ElMessage.success('保存成功')
|
||||
}else{
|
||||
ElMessage.error('保存失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
@ -12,6 +12,7 @@ import 'element-plus/dist/index.css'
|
||||
import less from 'less'
|
||||
import { i18n } from '@/plugins/vue-i18n'
|
||||
import defaultTemplate from '@/viewsnew/application/SfcEditor/Navbar.vue?raw'
|
||||
import { moduleUpdate,moduleById } from '@/api/application/module'
|
||||
const props = defineProps({
|
||||
menuList: {
|
||||
type: Array,
|
||||
@ -21,10 +22,11 @@ const props = defineProps({
|
||||
isFixed: Boolean,
|
||||
projectName: String,
|
||||
applicationId: String,
|
||||
isExecuteEvent: Boolean
|
||||
isExecuteEvent: Boolean,
|
||||
projectId: String
|
||||
})
|
||||
|
||||
const sfcCode = ref(defaultTemplate)
|
||||
const sfcCode = ref('')
|
||||
const previewContainer = ref(null)
|
||||
let prevApp = null
|
||||
|
||||
@ -137,10 +139,16 @@ const runCode = async () => {
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
console.log(props.menuList,999)
|
||||
runCode()
|
||||
init()
|
||||
})
|
||||
|
||||
function init(){
|
||||
moduleById(props.projectId).then(res => {
|
||||
if(res.data.data.canvas_style_data){
|
||||
sfcCode.value = res.data.data.canvas_style_data
|
||||
runCode()
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
/* 保留原有样式并补充 */
|
||||
|
@ -377,7 +377,7 @@ function delTreeClic(){ // 删除
|
||||
color: #fff;
|
||||
}
|
||||
:deep(.ed-input-group__prepend){
|
||||
background-color: rgba(37, 38, 38, 1);
|
||||
background-color: rgba(37, 38, 38, 1) !important;
|
||||
border: 0;
|
||||
box-shadow:0 0 0 1px transparent ;
|
||||
padding:0 10px;
|
||||
|
@ -67,6 +67,7 @@ const projectInfo:any = ref({})
|
||||
const applicationId:any = ref('')
|
||||
const busiFlag = ref('dataV')
|
||||
const isExecuteEvent = ref(false)
|
||||
const projectId = ref('')
|
||||
onMounted(() => {
|
||||
applicationId.value = route.query.id
|
||||
getInit()
|
||||
@ -126,6 +127,7 @@ function handleNodeClick(e){
|
||||
isFormCreate.value = true
|
||||
} else if(e.type == '02'){
|
||||
isExecuteEvent.value = true
|
||||
projectId.value = e.id
|
||||
const params = {
|
||||
appId: applicationId.value,
|
||||
name:'',
|
||||
@ -161,7 +163,7 @@ onBeforeMount(() => {
|
||||
></dv-preview>
|
||||
<form-create v-if="isFormCreate" :moduleInfo="moduleInfo"></form-create>
|
||||
<Navbar v-if="isNavbar" :isFixed="true" :applicationId="applicationId"
|
||||
:menuList="menuList" :projectName="projectInfo.name" :isExecuteEvent="isExecuteEvent"></Navbar>
|
||||
:menuList="menuList" :projectId="projectId" :projectName="projectInfo.name" :isExecuteEvent="isExecuteEvent"></Navbar>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -184,3 +186,23 @@ onBeforeMount(() => {
|
||||
z-index:1;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.ed-message-box{
|
||||
background: #212121;
|
||||
}
|
||||
.ed-message-box__content{
|
||||
color: #ffffff;
|
||||
}
|
||||
.ed-message-box__btns .ed-button--primary{
|
||||
background: #0089ff;
|
||||
border-color: #0089ff;
|
||||
}
|
||||
.ed-message-box__btns .ed-button.is-secondary{
|
||||
color: #F2F4F5 !important;
|
||||
background-color: #212121 !important;
|
||||
border: 1px solid #434343 !important;
|
||||
}
|
||||
.ed-message-box__headerbtn{
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
@ -925,7 +925,7 @@ initFunction()
|
||||
}
|
||||
.ed-input-number__decrease, .ed-input-number__increase{
|
||||
background-color: #434343 !important;
|
||||
color:#ffffff;
|
||||
color:#ffffff !important;
|
||||
}
|
||||
.ed-input-number.is-controls-right .ed-input-number__increase{
|
||||
border-bottom: 1px solid #5f5f5f !important;
|
||||
|
Loading…
Reference in New Issue
Block a user