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