拓扑图配置
This commit is contained in:
37
src/api/cs-device-boot/topologyTemplate.ts
Normal file
37
src/api/cs-device-boot/topologyTemplate.ts
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import createAxios from '@/utils/request'
|
||||||
|
// 上传拓扑图
|
||||||
|
export const uploadTopo = file => {
|
||||||
|
let form = new FormData()
|
||||||
|
form.append('file', file)
|
||||||
|
return createAxios({
|
||||||
|
url: '/cs-device-boot/topologyTemplate/uploadImage',
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
},
|
||||||
|
data: form
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 查询拓扑图模板
|
||||||
|
export const getTopoTemplate = () => {
|
||||||
|
return createAxios({
|
||||||
|
url: '/cs-device-boot/topologyTemplate/queryImage',
|
||||||
|
method: 'POST'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除拓扑图模板
|
||||||
|
export const deleteTopoTemplate = id => {
|
||||||
|
let form = new FormData()
|
||||||
|
form.append('id', id)
|
||||||
|
return createAxios({
|
||||||
|
url: '/cs-device-boot/topologyTemplate/deleteImage',
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded'
|
||||||
|
},
|
||||||
|
data: form
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -4,7 +4,6 @@ import createAxios from '@/utils/request'
|
|||||||
* 查询app个人中心信息详情
|
* 查询app个人中心信息详情
|
||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const queryAppInfo = (type: string) => {
|
export const queryAppInfo = (type: string) => {
|
||||||
let form = new FormData()
|
let form = new FormData()
|
||||||
form.append('type', type)
|
form.append('type', type)
|
||||||
@@ -17,3 +16,15 @@ export const queryAppInfo = (type: string) => {
|
|||||||
data: form
|
data: form
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增app基础信息
|
||||||
|
**/
|
||||||
|
export const addAppInfo = (data: { type: string, content: string }) => {
|
||||||
|
return createAxios({
|
||||||
|
url: '/cs-system-boot/appinfo/addAppInfo',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style='border: 1px solid #ccc'>
|
<div style='border: 1px solid #e4e4e4;height: 100%'>
|
||||||
<Toolbar
|
<Toolbar
|
||||||
style='border-bottom: 1px solid #ccc'
|
style='border-bottom: 1px solid #e4e4e4'
|
||||||
:editor='editorRef'
|
:editor='editorRef'
|
||||||
:defaultConfig='toolbarConfig'
|
:defaultConfig='toolbarConfig'
|
||||||
mode='default'
|
mode='default'
|
||||||
/>
|
/>
|
||||||
<Editor
|
<Editor
|
||||||
style='height: 500px; overflow-y: hidden;'
|
v-bind='$attrs'
|
||||||
v-model='valueHtml'
|
|
||||||
:defaultConfig='editorConfig'
|
:defaultConfig='editorConfig'
|
||||||
mode='default'
|
mode='default'
|
||||||
@onCreated='handleCreated'
|
@onCreated='handleCreated'
|
||||||
|
style='height: calc(100% - 42px); '
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -33,8 +33,32 @@ onMounted(() => {
|
|||||||
}, 1500)
|
}, 1500)
|
||||||
})
|
})
|
||||||
|
|
||||||
const toolbarConfig = {}
|
const toolbarConfig = {
|
||||||
const editorConfig = { placeholder: '请输入内容...' }
|
excludeKeys: ['fullScreen', 'emotion']
|
||||||
|
}
|
||||||
|
let sever = '/cs-harmonic-boot/csconfiguration/uploadImage'
|
||||||
|
// 本地加api
|
||||||
|
if (process.env.NODE_ENV === 'development') {
|
||||||
|
sever = '/api' + sever
|
||||||
|
}
|
||||||
|
const editorConfig = {
|
||||||
|
placeholder: '请输入内容...',
|
||||||
|
MENU_CONF: {
|
||||||
|
uploadImage: {
|
||||||
|
server: sever,
|
||||||
|
fieldName: 'file',
|
||||||
|
compress: true,
|
||||||
|
uploadFileName: 'file',
|
||||||
|
withCredentials: true,
|
||||||
|
headers: {},
|
||||||
|
timeout: 0,
|
||||||
|
customInsert: (insertImg, result, editor) => {
|
||||||
|
const url = result.data.url
|
||||||
|
insertImg(url)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 组件销毁时,也及时销毁编辑器
|
// 组件销毁时,也及时销毁编辑器
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ const init = async () => {
|
|||||||
icon: 'el-icon-List',
|
icon: 'el-icon-List',
|
||||||
menu_type: 'tab',
|
menu_type: 'tab',
|
||||||
url: '',
|
url: '',
|
||||||
component: '/src/views/govern/setting/app/index.vue',
|
component: '/src/views/govern/manage/gplot/index.vue',
|
||||||
keepalive: 'auth/role',
|
keepalive: 'auth/role',
|
||||||
extend: 'none',
|
extend: 'none',
|
||||||
children: []
|
children: []
|
||||||
|
|||||||
@@ -13,13 +13,17 @@ import 'element-plus/theme-chalk/display.css'
|
|||||||
import '@fortawesome/fontawesome-free/css/all.css'
|
import '@fortawesome/fontawesome-free/css/all.css'
|
||||||
import '@/styles/index.scss'
|
import '@/styles/index.scss'
|
||||||
import '@/assets/font/iconfont.css'
|
import '@/assets/font/iconfont.css'
|
||||||
|
import { ElDialog } from 'element-plus'
|
||||||
|
|
||||||
window.XEUtils = XEUtils
|
window.XEUtils = XEUtils
|
||||||
|
|
||||||
|
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|
||||||
app.use(router)
|
app.use(router)
|
||||||
app.use(pinia)
|
app.use(pinia)
|
||||||
app.use(ElementPlus)
|
app.use(ElementPlus);
|
||||||
|
(app._context.components.ElDialog as typeof ElDialog).props.closeOnClickModal.default = false
|
||||||
app.use(VXETable)
|
app.use(VXETable)
|
||||||
registerIcons(app) // icons
|
registerIcons(app) // icons
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
height: 30px;
|
height: 30px;
|
||||||
line-height: calc(var(--el-input-height, 40px) - 4px);
|
line-height: calc(var(--el-input-height, 40px) - 4px);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 修复 Chrome 浏览器输入框内选中字符行高异常的bug-e */
|
/* 修复 Chrome 浏览器输入框内选中字符行高异常的bug-e */
|
||||||
|
|
||||||
.datetime-picker {
|
.datetime-picker {
|
||||||
@@ -10,16 +11,19 @@
|
|||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-divider__text.is-center {
|
.el-divider__text.is-center {
|
||||||
transform: translateX(-50%) translateY(-62%);
|
transform: translateX(-50%) translateY(-62%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-menu {
|
.el-menu {
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
||||||
.el-menu-item:hover,
|
.el-menu-item:hover,
|
||||||
.el-sub-menu__title:hover {
|
.el-sub-menu__title:hover {
|
||||||
background-color: var(--el-menu-hover-color) !important;
|
background-color: var(--el-menu-hover-color) !important;
|
||||||
color: var(--el-menu-active-color) !important;
|
color: var(--el-menu-active-color) !important;
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
color: var(--el-menu-active-color) !important;
|
color: var(--el-menu-active-color) !important;
|
||||||
}
|
}
|
||||||
@@ -29,11 +33,13 @@
|
|||||||
.el-dialog__header {
|
.el-dialog__header {
|
||||||
background: var(--el-color-primary);
|
background: var(--el-color-primary);
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
|
|
||||||
.el-dialog__headerbtn {
|
.el-dialog__headerbtn {
|
||||||
.el-icon {
|
.el-icon {
|
||||||
color: var(--el-color-white);
|
color: var(--el-color-white);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-dialog__title {
|
.el-dialog__title {
|
||||||
color: var(--el-color-white);
|
color: var(--el-color-white);
|
||||||
}
|
}
|
||||||
@@ -46,9 +52,11 @@
|
|||||||
.el-card {
|
.el-card {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-card__header {
|
.el-card__header {
|
||||||
border-bottom: 1px solid var(--el-border-color-extra-light);
|
border-bottom: 1px solid var(--el-border-color-extra-light);
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-textarea__inner {
|
.el-textarea__inner {
|
||||||
padding: 5px 11px;
|
padding: 5px 11px;
|
||||||
}
|
}
|
||||||
@@ -62,39 +70,50 @@
|
|||||||
.el-tabs__content,
|
.el-tabs__content,
|
||||||
.ba-scroll-style {
|
.ba-scroll-style {
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
|
|
||||||
&::-webkit-scrollbar {
|
&::-webkit-scrollbar {
|
||||||
width: 5px;
|
width: 5px;
|
||||||
height: 5px;
|
height: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::-webkit-scrollbar-thumb {
|
&::-webkit-scrollbar-thumb {
|
||||||
background: #eaeaea;
|
background: #eaeaea;
|
||||||
border-radius: var(--el-border-radius-base);
|
border-radius: var(--el-border-radius-base);
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
-webkit-box-shadow: none;
|
-webkit-box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
&::-webkit-scrollbar-thumb:hover {
|
&::-webkit-scrollbar-thumb:hover {
|
||||||
background: #c8c9cc;
|
background: #c8c9cc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* dialog滚动条-e */
|
/* dialog滚动条-e */
|
||||||
|
|
||||||
/* 小屏设备 el-radio-group 样式优化-s */
|
/* 小屏设备 el-radio-group 样式优化-s */
|
||||||
.ba-input-item-radio {
|
.ba-input-item-radio {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
||||||
.el-radio-group {
|
.el-radio-group {
|
||||||
.el-radio {
|
.el-radio {
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 小屏设备 el-radio-group 样式调整-e */
|
/* 小屏设备 el-radio-group 样式调整-e */
|
||||||
|
|
||||||
.el-tabs--card > .el-tabs__header .el-tabs__item.is-active {
|
.el-tabs--card > .el-tabs__header .el-tabs__item.is-active {
|
||||||
background: var(--el-color-primary);
|
background: var(--el-color-primary);
|
||||||
color: var(--el-color-white);
|
color: var(--el-color-white);
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-tabs__header {
|
.el-tabs__header {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form--inline .el-form-item {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ export const getCurrentRoutePath = () => {
|
|||||||
* @param domain 指定域名
|
* @param domain 指定域名
|
||||||
*/
|
*/
|
||||||
export const fullUrl = (relativeUrl: string, domain = '') => {
|
export const fullUrl = (relativeUrl: string, domain = '') => {
|
||||||
return domain + relativeUrl
|
return domain + '/api/system-boot/image/toStream?bgImage=' + relativeUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ onMounted(() => {
|
|||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
tableStore.table.height = mainHeight(190).height as any
|
tableStore.table.height = mainHeight(180).height as any
|
||||||
}, 0)
|
}, 0)
|
||||||
const addMenu = () => {}
|
const addMenu = () => {}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ onMounted(() => {
|
|||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
tableStore.table.height = mainHeight(190).height as any
|
tableStore.table.height = mainHeight(180).height as any
|
||||||
}, 0)
|
}, 0)
|
||||||
const addMenu = () => {}
|
const addMenu = () => {}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
const bxecharts = mainHeight(175).height as any
|
const bxecharts = mainHeight(175).height as any
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
tableStore.table.height = mainHeight(190).height as any
|
tableStore.table.height = mainHeight(180).height as any
|
||||||
}, 0)
|
}, 0)
|
||||||
|
|
||||||
const addMenu = () => {}
|
const addMenu = () => {}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
v-for="(item, index) in deviceData.dataSetList"
|
v-for="(item, index) in deviceData.dataSetList"
|
||||||
:key="index"
|
:key="index"
|
||||||
></el-tab-pane>
|
></el-tab-pane>
|
||||||
<el-form :inline="true" style="white-space: nowrap">
|
<el-form :inline="true" style="white-space: nowrap;margin-top: 10px">
|
||||||
<el-form-item label="指标">
|
<el-form-item label="指标">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="formInline.searchValue"
|
v-model="formInline.searchValue"
|
||||||
@@ -159,7 +159,7 @@ const dataSet = ref('')
|
|||||||
const devTypeOptions = ref([])
|
const devTypeOptions = ref([])
|
||||||
const devModelOptions = ref([])
|
const devModelOptions = ref([])
|
||||||
const tableData = ref<any[]>([])
|
const tableData = ref<any[]>([])
|
||||||
const tableHeight = mainHeight(320).height
|
const tableHeight = mainHeight(310).height
|
||||||
const mangePopup = ref()
|
const mangePopup = ref()
|
||||||
const datePickerRef = ref()
|
const datePickerRef = ref()
|
||||||
const formInline = reactive({
|
const formInline = reactive({
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ const dataSet = ref('')
|
|||||||
const devTypeOptions = ref([])
|
const devTypeOptions = ref([])
|
||||||
const devModelOptions = ref([])
|
const devModelOptions = ref([])
|
||||||
const tableData = ref([])
|
const tableData = ref([])
|
||||||
const tableHeight = mainHeight(225).height
|
const tableHeight = mainHeight(215).height
|
||||||
const mangePopup = ref()
|
const mangePopup = ref()
|
||||||
const nodeClick = (e: anyObj) => {
|
const nodeClick = (e: anyObj) => {
|
||||||
if (e.level == 2) {
|
if (e.level == 2) {
|
||||||
|
|||||||
106
src/views/govern/manage/gplot/index.vue
Normal file
106
src/views/govern/manage/gplot/index.vue
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
<template>
|
||||||
|
<div class="default-main">
|
||||||
|
<TableHeader>
|
||||||
|
<template v-slot:operation>
|
||||||
|
<el-upload
|
||||||
|
action=""
|
||||||
|
class="upload-demo"
|
||||||
|
:show-file-list="false"
|
||||||
|
:auto-upload="false"
|
||||||
|
:on-change="chooseImage"
|
||||||
|
>
|
||||||
|
<el-button type="primary" icon="el-icon-Plus">新增拓扑图</el-button>
|
||||||
|
</el-upload>
|
||||||
|
</template>
|
||||||
|
</TableHeader>
|
||||||
|
<Table ref="tableRef" />
|
||||||
|
<popupEdit ref="popupRef"></popupEdit>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { Plus } from '@element-plus/icons-vue'
|
||||||
|
import { ref, onMounted, provide } from 'vue'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import Table from '@/components/table/index.vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import popupEdit from './popupEdit.vue'
|
||||||
|
import { deleteTopoTemplate, uploadTopo } from '@/api/cs-device-boot/topologyTemplate'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: 'govern/manage/gplot'
|
||||||
|
})
|
||||||
|
const tableRef = ref()
|
||||||
|
const popupRef = ref()
|
||||||
|
const tableStore = new TableStore({
|
||||||
|
showPage: false,
|
||||||
|
url: '/cs-device-boot/topologyTemplate/queryImage',
|
||||||
|
method: 'POST',
|
||||||
|
column: [
|
||||||
|
{ title: '序号', type: 'seq', width: 60 },
|
||||||
|
{ title: '拓扑图模版名称', field: 'name', align: 'center' },
|
||||||
|
{ title: '监测点数量', field: 'pointNum', align: 'center' },
|
||||||
|
{ title: '拓扑图', field: 'filePath', align: 'center', render: 'image' },
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
align: 'center',
|
||||||
|
width: '130',
|
||||||
|
render: 'buttons',
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
name: 'edit',
|
||||||
|
title: '编辑',
|
||||||
|
type: 'primary',
|
||||||
|
icon: 'el-icon-EditPen',
|
||||||
|
render: 'tipButton',
|
||||||
|
click: row => {
|
||||||
|
popupRef.value.open('编辑菜单', row)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'del',
|
||||||
|
title: '删除',
|
||||||
|
type: 'danger',
|
||||||
|
icon: 'el-icon-Delete',
|
||||||
|
render: 'confirmButton',
|
||||||
|
popconfirm: {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
confirmButtonType: 'danger',
|
||||||
|
title: '确定删除该菜单吗?'
|
||||||
|
},
|
||||||
|
click: row => {
|
||||||
|
deleteTopoTemplate(row.id).then(res => {
|
||||||
|
ElMessage.success('删除成功')
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
loadCallback: () => {
|
||||||
|
tableStore.table.data.forEach((item: any) => {
|
||||||
|
item.pointNum = item.csLineTopologyTemplateVOList.length
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
tableStore.table.ref = tableRef.value
|
||||||
|
tableStore.index()
|
||||||
|
tableStore.table.loading = false
|
||||||
|
})
|
||||||
|
const addMenu = () => {
|
||||||
|
console.log(popupRef)
|
||||||
|
popupRef.value.open('新增菜单')
|
||||||
|
}
|
||||||
|
const chooseImage = e => {
|
||||||
|
console.warn(e)
|
||||||
|
uploadTopo(e.raw).then(res => {
|
||||||
|
ElMessage.success('新增成功')
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
103
src/views/govern/manage/gplot/popupEdit.vue
Normal file
103
src/views/govern/manage/gplot/popupEdit.vue
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog class='cn-operate-dialog' v-model='dialogVisible' :title='title'>
|
||||||
|
<el-scrollbar>
|
||||||
|
<el-form :inline='false' :model='form' label-width='120px'>
|
||||||
|
<el-form-item label='上级菜单'>
|
||||||
|
<el-cascader
|
||||||
|
v-model='form.pid'
|
||||||
|
:options='tableStore.table.data'
|
||||||
|
:props='cascaderProps'
|
||||||
|
style='width: 100%'
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='菜单名称'>
|
||||||
|
<el-input v-model='form.name' placeholder='请输入菜单名称' />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='图标'>
|
||||||
|
<IconSelector v-model='form.icon' placeholder='请选择图标' />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='菜单路由'>
|
||||||
|
<el-input v-model='form.path' placeholder='请输入菜单名称' />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='组件路径'>
|
||||||
|
<el-input v-model='form.routeName' placeholder='请输入组件路径,如/src/views/dashboard/index.vue' />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='排序'>
|
||||||
|
<el-input-number v-model='form.sort' :min='0' />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label='菜单描述'>
|
||||||
|
<el-input v-model='form.remark' :rows='2' type='textarea' placeholder='请输入描述' />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-scrollbar>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<span class='dialog-footer'>
|
||||||
|
<el-button @click='dialogVisible = false'>取消</el-button>
|
||||||
|
<el-button type='primary' @click='submit'>确认</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script lang='ts' setup>
|
||||||
|
import { ref, inject } from 'vue'
|
||||||
|
import { reactive } from 'vue'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import IconSelector from '@/components/baInput/components/iconSelector.vue'
|
||||||
|
import { updateMenu, addMenu } from '@/api/systerm'
|
||||||
|
|
||||||
|
const tableStore = inject('tableStore') as TableStore
|
||||||
|
const cascaderProps = {
|
||||||
|
label: 'title',
|
||||||
|
value: 'id'
|
||||||
|
}
|
||||||
|
const form: any = reactive({
|
||||||
|
code: '',
|
||||||
|
icon: '',
|
||||||
|
id: '',
|
||||||
|
name: '',
|
||||||
|
path: '',
|
||||||
|
pid: '0',
|
||||||
|
remark: '',
|
||||||
|
routeName: '',
|
||||||
|
sort: 0,
|
||||||
|
type: 0
|
||||||
|
})
|
||||||
|
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const title = ref('新增菜单')
|
||||||
|
const open = (text: string, data?: anyObj) => {
|
||||||
|
console.log(data)
|
||||||
|
title.value = text
|
||||||
|
if (data) {
|
||||||
|
for (let key in form) {
|
||||||
|
form[key] = data[key]
|
||||||
|
}
|
||||||
|
form.path = data.routePath
|
||||||
|
form.name = data.title
|
||||||
|
} else {
|
||||||
|
// 重置表单
|
||||||
|
for (let key in form) {
|
||||||
|
form[key] = ''
|
||||||
|
}
|
||||||
|
form.pid = '0'
|
||||||
|
form.sort = 0
|
||||||
|
form.type = 0
|
||||||
|
}
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
const submit = async () => {
|
||||||
|
if (form.id) {
|
||||||
|
await updateMenu(form)
|
||||||
|
} else {
|
||||||
|
form.code = 'menu'
|
||||||
|
let obj = JSON.parse(JSON.stringify(form))
|
||||||
|
delete obj.id
|
||||||
|
await addMenu(obj)
|
||||||
|
}
|
||||||
|
tableStore.index()
|
||||||
|
dialogVisible.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ open })
|
||||||
|
</script>
|
||||||
@@ -7,22 +7,23 @@
|
|||||||
<el-tab-pane label='使用手册' name='User_Manual'></el-tab-pane>
|
<el-tab-pane label='使用手册' name='User_Manual'></el-tab-pane>
|
||||||
<el-tab-pane label='公司介绍' name='Company_Profile'></el-tab-pane>
|
<el-tab-pane label='公司介绍' name='Company_Profile'></el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<div class='agreement' style='height: calc(100vh - 190px)'>
|
<div class='agreement' :style='{height:height}'>
|
||||||
<div style='margin-top: 5px; right: 10px; position: absolute; z-index: 9999999'>
|
<div style='margin-top: 5px; right: 10px; position: absolute; z-index: 9999999'>
|
||||||
<el-button type='primary' @click='submit' icon='el-icon-Checked'>保存</el-button>
|
<el-button type='primary' @click='submit' icon='el-icon-Checked'>保存</el-button>
|
||||||
</div>
|
</div>
|
||||||
<WangEditor v-model='html' style='height: 100%' />
|
<WangEditor v-model='html' style='border-top: none' />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang='ts'>
|
<script setup lang='ts'>
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, nextTick } from 'vue'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import { BasicDictData } from '@/stores/interface'
|
import { BasicDictData } from '@/stores/interface'
|
||||||
import { queryAppInfo } from '@/api/cs-system-boot/appinfo'
|
import { addAppInfo, queryAppInfo } from '@/api/cs-system-boot/appinfo'
|
||||||
import WangEditor from '@/components/wangEditor/index.vue'
|
import WangEditor from '@/components/wangEditor/index.vue'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'govern/setting/app'
|
name: 'govern/setting/app'
|
||||||
@@ -31,18 +32,29 @@ const dic = useDictData().getBasicData('appInformationType')
|
|||||||
const id = ref('')
|
const id = ref('')
|
||||||
const activeName = ref('User_Agreement')
|
const activeName = ref('User_Agreement')
|
||||||
const html = ref('')
|
const html = ref('')
|
||||||
|
const height = mainHeight(60).height
|
||||||
const submit = () => {
|
const submit = () => {
|
||||||
|
addAppInfo({
|
||||||
|
type: id.value,
|
||||||
|
content: html.value
|
||||||
|
}).then((res) => {
|
||||||
|
ElMessage.success('保存成功')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
const init = () => {
|
const init = () => {
|
||||||
|
nextTick(() => {
|
||||||
dic.forEach((item: BasicDictData) => {
|
dic.forEach((item: BasicDictData) => {
|
||||||
if (item.code == activeName.value) {
|
if (item.code == activeName.value) {
|
||||||
|
console.log(activeName.value)
|
||||||
|
console.log(item.id)
|
||||||
|
|
||||||
id.value = item.id
|
id.value = item.id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
queryAppInfo(id.value).then((res: any) => {
|
queryAppInfo(id.value).then((res: any) => {
|
||||||
html.value = res.data.content
|
html.value = res.data.content
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
init()
|
init()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user