fix: 文件名称修改

develop
时启龙 2024-08-28 16:50:02 +08:00
parent 06e4f2ac78
commit 7167274dec
25 changed files with 47 additions and 38 deletions

View File

@ -1,5 +1,5 @@
import { request } from '@cmp/cmp-element' import { request } from '@cmp/cmp-element'
import { getSelectPosition } from '@/views/usePostion' import { getSelectPosition } from '@/views/usePosition'
// 封装原始的 request.get 方法 // 封装原始的 request.get 方法
export default function enhancedRequestGet(url: string, config: any = {}) { export default function enhancedRequestGet(url: string, config: any = {}) {

View File

@ -1,5 +1,5 @@
import { request } from '@cmp/cmp-element' import { request } from '@cmp/cmp-element'
import { getSelectPosition } from '@/views/usePostion' import { getSelectPosition } from '@/views/usePosition'
export function getValidateRules(type: string) { export function getValidateRules(type: string) {
return request.get('/ams/v1/regexps', { return request.get('/ams/v1/regexps', {

View File

@ -1,5 +1,5 @@
import { request, downloadFile } from '@cmp/cmp-element' import { request, downloadFile } from '@cmp/cmp-element'
import { getSelectPosition } from '@/views/usePostion' import { getSelectPosition } from '@/views/usePosition'
const baseUrl = '/ams/v1/instances' const baseUrl = '/ams/v1/instances'
export function getInstance(params: Base.IListParams) { export function getInstance(params: Base.IListParams) {

View File

@ -2,12 +2,12 @@
<div> <div>
<data-dialog v-if="detailDialog.visible" :dialog="detailDialog" :isBackup="isBackup" :table-name="detailDialog.record.tableName"></data-dialog> <data-dialog v-if="detailDialog.visible" :dialog="detailDialog" :isBackup="isBackup" :table-name="detailDialog.record.tableName"></data-dialog>
<cb-advance-table :card-border="false" :search-configs="searchConfigs" :data="list" :params="params" :columns="exampleColumns" :get-list="getList" :total="total" :loading="loading" ref="tableRef" @select="handleSelectItem" @select-all="handleSelectAll"> <cb-advance-table :card-border="false" :search-configs="searchConfigs" :data="list" :params="params" :columns="exampleColumns" :get-list="getList" :total="total" :loading="loading" ref="tableRef" @select="handleSelectItem" @select-all="handleSelectAll">
<template #action> <template #action v-if="isLeaderPosition">
<el-button @click="handleUpdate('update')" icon="el-icon-edit" :disabled="!selectIds.length || !reconcile || isShow">批量更新</el-button> <el-button @click="handleUpdate('update')" icon="el-icon-edit" :disabled="!selectIds.length || !reconcile || isShow">批量更新</el-button>
<el-button @click="handleUpdate('cancel')" icon="el-icon-edit" :disabled="!selectIds.length || !reconcile || isShow">批量取消</el-button> <el-button @click="handleUpdate('cancel')" icon="el-icon-edit" :disabled="!selectIds.length || !reconcile || isShow">批量取消</el-button>
</template> </template>
<template #instanceUuid="instanceUuid, record"> <template #instanceUuid="instanceUuid, record">
<el-tooltip :disabled="instanceUuid" class="item" effect="dark" content="可查看数据详情" placement="top-start"> <el-tooltip :disabled="!!instanceUuid" class="item" effect="dark" content="可查看数据详情" placement="top-start">
<span class="detail-href" @click="getDetail(record)">{{ instanceUuid || '--' }}</span> <span class="detail-href" @click="getDetail(record)">{{ instanceUuid || '--' }}</span>
</el-tooltip> </el-tooltip>
</template> </template>
@ -33,6 +33,7 @@ import { getCollectionhistory, batchCollectionhistory } from 'services/data-coll
import { getCollectionHistoryBackup } from 'services/data-collection/backup' import { getCollectionHistoryBackup } from 'services/data-collection/backup'
import { exampleColumns, exampleSearchConfigs } from './config' import { exampleColumns, exampleSearchConfigs } from './config'
import { MessageBox, Message } from 'element-ui' import { MessageBox, Message } from 'element-ui'
import usePosition from '@/views/usePosition'
export default defineComponent({ export default defineComponent({
components: { DataDialog }, components: { DataDialog },
@ -58,6 +59,7 @@ export default defineComponent({
}, },
}, },
setup(props, context) { setup(props, context) {
const { isLeaderPosition } = usePosition()
const searchConfigs = ref([{ value: 'type', type: 'Const', initValue: props.type }, { value: 'taskInstanceId', type: 'Const', initValue: props.id }, ...exampleSearchConfigs, { value: 'tableName', type: 'Const', initValue: props.tableName }]) const searchConfigs = ref([{ value: 'type', type: 'Const', initValue: props.type }, { value: 'taskInstanceId', type: 'Const', initValue: props.id }, ...exampleSearchConfigs, { value: 'tableName', type: 'Const', initValue: props.tableName }])
const statusOptions = { RECONCILED: '未调和', SUCCESS: '执行成功', FAILED: '执行失败' } const statusOptions = { RECONCILED: '未调和', SUCCESS: '执行成功', FAILED: '执行失败' }
const statusColor = { RECONCILED: 'primary', SUCCESS: 'success', FAILED: 'danger' } const statusColor = { RECONCILED: 'primary', SUCCESS: 'success', FAILED: 'danger' }
@ -149,6 +151,7 @@ export default defineComponent({
getDetail, getDetail,
getList, getList,
handleUpdate, handleUpdate,
isLeaderPosition,
} }
}, },
}) })

View File

@ -27,7 +27,7 @@ import { columns, searchConfigs } from './config'
import { taskExeStatusFilter } from '@/filters/index' import { taskExeStatusFilter } from '@/filters/index'
import { cloneDeep } from 'lodash-es' import { cloneDeep } from 'lodash-es'
import { useRoute } from '@cmp/cmp-core' import { useRoute } from '@cmp/cmp-core'
import usePostion from '@/views/usePostion' import usePostion from '@/views/usePosition'
import AmsPosition from '@/views/AmsPosition.vue' import AmsPosition from '@/views/AmsPosition.vue'
export default defineComponent({ export default defineComponent({
components: { HistoryDetail, AmsPosition }, components: { HistoryDetail, AmsPosition },

View File

@ -21,7 +21,7 @@ import { defineComponent, reactive, watch, toRefs } from 'vue'
import { useTable } from '@cmp/cmp-element' import { useTable } from '@cmp/cmp-element'
import { searchConfigs, columns } from './config' import { searchConfigs, columns } from './config'
import { getCollectionPlugins, removeCollectionPlugin, getUser } from 'services/data-collection/plugins' import { getCollectionPlugins, removeCollectionPlugin, getUser } from 'services/data-collection/plugins'
import usePostion from '@/views/usePostion' import usePostion from '@/views/usePosition'
export default defineComponent({ export default defineComponent({
props: { props: {

View File

@ -23,7 +23,7 @@ import AddData from './AddData/index.vue'
import { getCollectionPluginDetail } from 'services/data-collection/plugins' import { getCollectionPluginDetail } from 'services/data-collection/plugins'
import Detail from './detail/index.vue' import Detail from './detail/index.vue'
import { decrypt } from '@cmp/cmp-element' import { decrypt } from '@cmp/cmp-element'
import usePostion from '@/views/usePostion' import usePostion from '@/views/usePosition'
import AmsPosition from '@/views/AmsPosition.vue' import AmsPosition from '@/views/AmsPosition.vue'
export default defineComponent({ export default defineComponent({
components: { components: {

View File

@ -43,7 +43,7 @@ import { getCollectionTasks, removeCollectionTask, patchCollectionTask } from 's
import { MessageBox, Message } from 'element-ui' import { MessageBox, Message } from 'element-ui'
import { jumpRouter } from '../utils' import { jumpRouter } from '../utils'
import { decrypt } from '@cmp/cmp-element' import { decrypt } from '@cmp/cmp-element'
import usePostion from '@/views/usePostion' import usePostion from '@/views/usePosition'
export default defineComponent({ export default defineComponent({
components: { components: {

View File

@ -52,7 +52,7 @@ import AddData from './AddData.vue'
import Detail from './Detail.vue' import Detail from './Detail.vue'
import { MessageBox, Message } from 'element-ui' import { MessageBox, Message } from 'element-ui'
import { jumpRouter } from '../utils' import { jumpRouter } from '../utils'
import usePostion from '@/views/usePostion' import usePostion from '@/views/usePosition'
export default defineComponent({ export default defineComponent({
components: { components: {

View File

@ -17,7 +17,7 @@ import { defineComponent, reactive, toRefs, ref } from 'vue'
import SplitPane from 'vue-splitpane' import SplitPane from 'vue-splitpane'
import Tree from '@/views/data-collection/components/Tree.vue' import Tree from '@/views/data-collection/components/Tree.vue'
import Content from './content/index.vue' import Content from './content/index.vue'
import usePostion from '@/views/usePostion' import usePostion from '@/views/usePosition'
import AmsPosition from '@/views/AmsPosition.vue' import AmsPosition from '@/views/AmsPosition.vue'
export default defineComponent({ export default defineComponent({
components: { components: {

View File

@ -52,7 +52,7 @@ import { Message, MessageBox } from 'element-ui'
import { useTable, useSelection } from '@cmp/cmp-element' import { useTable, useSelection } from '@cmp/cmp-element'
import { getCategoryByModuleId, getRuleByModuleId } from 'services/index' import { getCategoryByModuleId, getRuleByModuleId } from 'services/index'
import { cloneDeep } from 'lodash-es' import { cloneDeep } from 'lodash-es'
import usePostion from '@/views/usePostion' import usePostion from '@/views/usePosition'
import AmsPosition from '@/views/AmsPosition.vue' import AmsPosition from '@/views/AmsPosition.vue'
export default defineComponent({ export default defineComponent({

View File

@ -62,7 +62,7 @@ import { columns, searchConfigs as searchConfig } from './config'
import { defineComponent, ref } from 'vue' import { defineComponent, ref } from 'vue'
import { Message, MessageBox } from 'element-ui' import { Message, MessageBox } from 'element-ui'
import { useTable } from '@cmp/cmp-element' import { useTable } from '@cmp/cmp-element'
import usePostion from '@/views/usePostion' import usePostion from '@/views/usePosition'
import AmsPosition from '@/views/AmsPosition.vue' import AmsPosition from '@/views/AmsPosition.vue'
export default defineComponent({ export default defineComponent({
components: { AddDialog, AmsPosition }, components: { AddDialog, AmsPosition },

View File

@ -14,7 +14,7 @@
<script lang="ts"> <script lang="ts">
import { defineComponent, reactive, ref } from 'vue' import { defineComponent, reactive, ref } from 'vue'
import LogList from './LogList.vue' import LogList from './LogList.vue'
import usePostion from '@/views/usePostion' import usePostion from '@/views/usePosition'
import AmsPosition from '@/views/AmsPosition.vue' import AmsPosition from '@/views/AmsPosition.vue'
export default defineComponent({ export default defineComponent({
components: { LogList, AmsPosition }, components: { LogList, AmsPosition },

View File

@ -22,7 +22,7 @@ import { defineComponent, reactive, toRefs, ref } from 'vue'
import AddDialog from './AddDialog.vue' import AddDialog from './AddDialog.vue'
import { columns, searchConfigs } from './config' import { columns, searchConfigs } from './config'
import { useTable } from '@cmp/cmp-element' import { useTable } from '@cmp/cmp-element'
import usePostion from '@/views/usePostion' import usePostion from '@/views/usePosition'
import AmsPosition from '@/views/AmsPosition.vue' import AmsPosition from '@/views/AmsPosition.vue'
export default defineComponent({ export default defineComponent({

View File

@ -56,7 +56,7 @@ import { getCurrentInstance } from 'vue'
import splitPane from 'vue-splitpane' import splitPane from 'vue-splitpane'
import ModuleDetail from './ModuleDetail.vue' import ModuleDetail from './ModuleDetail.vue'
import { getModules, removeModule } from 'services/cmdb/module' import { getModules, removeModule } from 'services/cmdb/module'
import usePostion from '@/views/usePostion' import usePostion from '@/views/usePosition'
import AmsPosition from '@/views/AmsPosition.vue' import AmsPosition from '@/views/AmsPosition.vue'
function getSearchConfigs(moduleGroupId, flag) { function getSearchConfigs(moduleGroupId, flag) {

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<div class="operate-btn-group"> <div class="operate-btn-group" v-if="isLeaderPosition">
<el-button class="w-ss" type="primary" @click="getProperties" v-if="!isEdit"> </el-button> <el-button class="w-ss" type="primary" @click="getProperties" v-if="!isEdit"> </el-button>
<el-button class="w-ss" type="primary" @click="saveModule" v-if="isEdit"> </el-button> <el-button class="w-ss" type="primary" @click="saveModule" v-if="isEdit"> </el-button>
<el-button class="w-ss" type="ghost" @click="cancelModule" v-if="isEdit"> </el-button> <el-button class="w-ss" type="ghost" @click="cancelModule" v-if="isEdit"> </el-button>
@ -74,7 +74,7 @@ import { cloneDeep } from 'lodash-es'
import { fieldList as fields } from '../attribute-pool/config' import { fieldList as fields } from '../attribute-pool/config'
import { getModuleProperties, updateModuleProperties } from 'services/cmdb/module' import { getModuleProperties, updateModuleProperties } from 'services/cmdb/module'
import { MessageBox, Message } from 'element-ui' import { MessageBox, Message } from 'element-ui'
import usePosition from '@/views/usePosition'
export default { export default {
components: { components: {
draggable: () => import('vuedraggable'), draggable: () => import('vuedraggable'),
@ -102,6 +102,7 @@ export default {
attrHeight: [Number, String], attrHeight: [Number, String],
}, },
setup(props) { setup(props) {
const { isLeaderPosition } = usePosition()
const state = reactive({ const state = reactive({
addData: { addData: {
dialog: false, dialog: false,
@ -390,6 +391,7 @@ export default {
getProperties, getProperties,
cancelModule, cancelModule,
saveModule, saveModule,
isLeaderPosition,
} }
}, },
} }

View File

@ -51,7 +51,7 @@ import DotDropdown from './DotDropdown.vue'
import RelationList from './list.vue' import RelationList from './list.vue'
import { getGroup, createGroup, modifyGroup, removeGroup } from 'services/relation' import { getGroup, createGroup, modifyGroup, removeGroup } from 'services/relation'
import { useDelete } from '@cmp/cmp-element' import { useDelete } from '@cmp/cmp-element'
import usePostion from '@/views/usePostion' import usePostion from '@/views/usePosition'
import AmsPosition from '@/views/AmsPosition.vue' import AmsPosition from '@/views/AmsPosition.vue'
export default defineComponent({ export default defineComponent({

View File

@ -42,6 +42,7 @@ import { defineComponent, reactive, toRefs, ref, inject } from 'vue'
import { Message } from 'element-ui' import { Message } from 'element-ui'
import { useTable } from '@cmp/cmp-element' import { useTable } from '@cmp/cmp-element'
import { cloneDeep } from 'lodash-es' import { cloneDeep } from 'lodash-es'
import usePosition from '@/views/usePosition'
const searchConfig = [ const searchConfig = [
{ {
@ -85,7 +86,7 @@ export default defineComponent({
}, },
}, },
setup() { setup() {
const isLeaderPosition = inject('isLeaderPosition') const { isLeaderPosition } = usePosition()
const searchConfigs = ref(cloneDeep(searchConfig)) const searchConfigs = ref(cloneDeep(searchConfig))
const { list, total, params, handleDelete, loading, getList } = useTable({ const { list, total, params, handleDelete, loading, getList } = useTable({
getService: getRelation, getService: getRelation,

View File

@ -17,6 +17,7 @@
import { reactive, toRefs, ref, inject } from 'vue' import { reactive, toRefs, ref, inject } from 'vue'
import { getRootGroups, removeModuleGroup, removeModule } from 'services/cmdb/module' import { getRootGroups, removeModuleGroup, removeModule } from 'services/cmdb/module'
import { MessageBox, Message } from 'element-ui' import { MessageBox, Message } from 'element-ui'
import usePosition from '@/views/usePosition'
export default { export default {
components: { components: {
Tree: () => import('./Tree'), Tree: () => import('./Tree'),
@ -29,7 +30,7 @@ export default {
}, },
}, },
setup(props, { emit }) { setup(props, { emit }) {
const isLeaderPosition = inject('isLeaderPosition') const { isLeaderPosition } = usePosition()
const state = reactive({ const state = reactive({
addData: { addData: {
data: {}, data: {},

View File

@ -64,11 +64,12 @@ import { getPropertyByModule } from 'services/index'
import { generateListConfig, getSingleName, getMultileName } from './utils' import { generateListConfig, getSingleName, getMultileName } from './utils'
import DetailItem from './detail/index.vue' import DetailItem from './detail/index.vue'
import ImportData from '@cmp/cmp-common/components/import-data/index.vue' import ImportData from '@cmp/cmp-common/components/import-data/index.vue'
import usePosition from '@/views/usePosition'
export default defineComponent({ export default defineComponent({
components: { AddDialog, DetailItem, ImportData, BatchEditDialog, TipDialog, AuthDialog }, components: { AddDialog, DetailItem, ImportData, BatchEditDialog, TipDialog, AuthDialog },
setup(props, context) { setup(props, context) {
const isLeaderPosition = inject('isLeaderPosition') as Ref<boolean> const { isLeaderPosition } = usePosition()
const { list, total, params, handleDelete, loading, getList } = useTable({ const { list, total, params, handleDelete, loading, getList } = useTable({
getService: getInstance, getService: getInstance,
removeService: removeInstance, removeService: removeInstance,

View File

@ -21,6 +21,7 @@ import { Message, MessageBox } from 'element-ui'
import { useTable } from '@cmp/cmp-element' import { useTable } from '@cmp/cmp-element'
import { cloneDeep } from 'lodash-es' import { cloneDeep } from 'lodash-es'
import AddDialog from './AuthDialog.vue' import AddDialog from './AuthDialog.vue'
import usePosition from '@/views/usePosition'
const searchConfig = [ const searchConfig = [
{ {
@ -65,7 +66,7 @@ export default defineComponent({
}, },
}, },
setup(props) { setup(props) {
const isLeaderPosition = inject('isLeaderPosition') const { isLeaderPosition } = usePosition()
const searchConfigs = reactive(cloneDeep(searchConfig)) const searchConfigs = reactive(cloneDeep(searchConfig))
searchConfigs[0].initValue = props.detailData.moduleId searchConfigs[0].initValue = props.detailData.moduleId
searchConfigs[1].initValue = props.detailData.id searchConfigs[1].initValue = props.detailData.id

View File

@ -3,7 +3,7 @@
<AmsPosition></AmsPosition> <AmsPosition></AmsPosition>
<split-pane :min-percent="10" :default-percent="15" split="vertical" style="height: calc(100vh - 110px)"> <split-pane :min-percent="10" :default-percent="15" split="vertical" style="height: calc(100vh - 110px)">
<template slot="paneL"> <template slot="paneL">
<SideMenu @handleNodeClick="handleNodeClick"></SideMenu> <SideMenu @handleNodeClick="handleNodeClick" v-if="switchControl"></SideMenu>
</template> </template>
<template slot="paneR"> <template slot="paneR">
<RightList ref="listRef"></RightList> <RightList ref="listRef"></RightList>
@ -16,19 +16,22 @@ import { defineComponent, ref, unref } from 'vue'
import SplitPane from 'vue-splitpane' import SplitPane from 'vue-splitpane'
import SideMenu from './SideMenu.vue' import SideMenu from './SideMenu.vue'
import RightList from './List.vue' import RightList from './List.vue'
import usePostion from '@/views/usePostion' import usePostion from '@/views/usePosition'
import AmsPosition from '@/views/AmsPosition.vue' import AmsPosition from '@/views/AmsPosition.vue'
export default defineComponent({ export default defineComponent({
components: { SplitPane, SideMenu, RightList, AmsPosition }, components: { SplitPane, SideMenu, RightList, AmsPosition },
setup() { setup() {
const lastNode = ref({}) const switchControl = ref(true)
usePostion(() => { usePostion(() => {
handleNodeClick(unref(lastNode)) switchControl.value = !switchControl.value
setTimeout(() => {
switchControl.value = !switchControl.value
listRef.value.list = []
}, 100)
}) })
const listRef = ref() const listRef = ref()
function handleNodeClick(node: any) { function handleNodeClick(node: any) {
lastNode.value = node
const { type, id } = node const { type, id } = node
if (type === 'module') { if (type === 'module') {
listRef.value.init(node) listRef.value.init(node)
@ -37,6 +40,7 @@ export default defineComponent({
return { return {
listRef, listRef,
handleNodeClick, handleNodeClick,
switchControl,
} }
}, },
}) })

View File

@ -26,7 +26,7 @@ import { defineComponent, reactive, toRefs } from 'vue'
import { useTable } from '@cmp/cmp-element' import { useTable } from '@cmp/cmp-element'
import { columns, searchConfigs } from './config' import { columns, searchConfigs } from './config'
import { getInstanceTopo, removeInstanceTopo, getInstanceTopoDetail } from 'services/resource' import { getInstanceTopo, removeInstanceTopo, getInstanceTopoDetail } from 'services/resource'
import usePostion from '@/views/usePostion' import usePostion from '@/views/usePosition'
import AmsPosition from '@/views/AmsPosition.vue' import AmsPosition from '@/views/AmsPosition.vue'
export default defineComponent({ export default defineComponent({

View File

@ -26,7 +26,7 @@ import { defineComponent, reactive, toRefs } from 'vue'
import { useTable } from '@cmp/cmp-element' import { useTable } from '@cmp/cmp-element'
import { columns, searchConfigs } from './config' import { columns, searchConfigs } from './config'
import { getInstanceTopo, removeInstanceTopo, getInstanceTopoDetail } from 'services/resource' import { getInstanceTopo, removeInstanceTopo, getInstanceTopoDetail } from 'services/resource'
import usePostion from '@/views/usePostion' import usePostion from '@/views/usePosition'
import AmsPosition from '@/views/AmsPosition.vue' import AmsPosition from '@/views/AmsPosition.vue'
export default defineComponent({ export default defineComponent({

View File

@ -1,13 +1,9 @@
import { computed, onMounted, onUnmounted, provide, ref, unref, watch } from 'vue' import { onMounted, onUnmounted, ref, watch } from 'vue'
const usePostion = (cb?: Function) => { const usePostion = (cb?: Function) => {
const isLeaderPosition = ref(false) const isLeaderPosition = ref(window.sessionStorage.getItem('isLeaderPosition') === 'true')
const value = window.sessionStorage.getItem('selectPostion') || '' const selectPostion = ref(window.sessionStorage.getItem('selectPostion') || '')
const selectPostion = ref(value)
provide(
'isLeaderPosition',
computed(() => unref(isLeaderPosition))
)
const handleStorageEvent = (event) => { const handleStorageEvent = (event) => {
if (event.key === 'isLeaderPosition') { if (event.key === 'isLeaderPosition') {
isLeaderPosition.value = event.newValue === 'true' isLeaderPosition.value = event.newValue === 'true'