服务指令调整

This commit is contained in:
1378012178@qq.com 2025-08-26 09:39:47 +08:00
parent 70d5555465
commit 98bc724bda
1 changed files with 384 additions and 227 deletions

View File

@ -24,7 +24,8 @@
</a-form> </a-form>
</div> </div>
<div> <div>
<div style="width:350px;float: left;height:80vh; background: white; overflow:auto;position: relative;margin-right: 14px;"> <div
style="width:350px;float: left;height:80vh; background: white; overflow:auto;position: relative;margin-right: 14px;">
<div <div
style="position: absolute; top: 8px; right: 8px; z-index: 1; background: white; padding: 0px; border-radius: 4px;"> style="position: absolute; top: 8px; right: 8px; z-index: 1; background: white; padding: 0px; border-radius: 4px;">
<a-radio-group v-model:value="filterIzEnabled" @change="searchQuery"> <a-radio-group v-model:value="filterIzEnabled" @change="searchQuery">
@ -40,22 +41,17 @@
<a-empty v-if="!treeLoading && treeLoading" /> <a-empty v-if="!treeLoading && treeLoading" />
<a-button v-if="!treeLoading && treeData.length < 1" type="link" class="btnPrivate" @click="addInstruction" <a-button v-if="!treeLoading && treeData.length < 1" type="link" class="btnPrivate" @click="addInstruction"
preIcon="ant-design:plus-outlined">新增分类标签</a-button> v-show="mainOrgCode == ownOrgCode" preIcon="ant-design:plus-outlined">新增分类标签</a-button>
<a-menu <a-menu v-model:selectedKeys="selectedKeys" style="width: 100%;margin-top: 50px;" mode="inline"
v-model:selectedKeys="selectedKeys" :open-keys="openKeys" @openChange="onOpenChange">
style="width: 100%;margin-top: 50px;" <template v-for="item in treeData">
mode="inline"
:open-keys="openKeys"
@openChange="onOpenChange"
>
<template v-for="item in treeData" >
<!-- 第一层判断是否有下级 --> <!-- 第一层判断是否有下级 -->
<a-sub-menu v-if="item.children && item.children.length > 0" :key="item.id" > <a-sub-menu v-if="item.children && item.children.length > 0" :key="item.id">
<template #icon > <template #icon>
<Icon :icon="item.icon" :size="20" v-if="item.icon" /> <Icon :icon="item.icon" :size="20" v-if="item.icon" />
<Icon icon="ant-design:appstore-add-outlined" :size="20" v-else /> <Icon icon="ant-design:appstore-add-outlined" :size="20" v-else />
</template> </template>
<template #title > <template #title>
<span @mouseenter="item.showContent = true" @mouseleave="item.showContent = false">{{ item?.title }} <span @mouseenter="item.showContent = true" @mouseleave="item.showContent = false">{{ item?.title }}
<span v-if="item?.izEnabled == '1' && item.level != 5" style="color:red;">(已停用)</span> <span v-if="item?.izEnabled == '1' && item.level != 5" style="color:red;">(已停用)</span>
<span v-show="item.showContent"> <span v-show="item.showContent">
@ -63,8 +59,9 @@
<a-dropdown :open="menuState[item?.key]?.open" @openChange="onMenuOpenChange(item.key, $event)"> <a-dropdown :open="menuState[item?.key]?.open" @openChange="onMenuOpenChange(item.key, $event)">
<template #overlay> <template #overlay>
<a-menu> <a-menu>
<a-menu-item v-for="itemMenu in menuItems(item)" :key="itemMenu.key" :disabled="!itemMenu.canAdd" <a-menu-item v-for="itemMenu in menuItems(item)" :key="itemMenu.key"
class="nu-menu-item" @click="() => { closeAllMenus(); itemMenu.action(item) }"> :disabled="!itemMenu.canAdd" class="nu-menu-item"
@click="() => { closeAllMenus(); itemMenu.action(item) }">
<Icon style="color:#1890FF;" :icon="itemMenu.icon" class="action-icon"></Icon> <Icon style="color:#1890FF;" :icon="itemMenu.icon" class="action-icon"></Icon>
<span style=" color:#1890FF;margin-left: 5px;">{{ itemMenu.label }}</span> <span style=" color:#1890FF;margin-left: 5px;">{{ itemMenu.label }}</span>
</a-menu-item> </a-menu-item>
@ -82,81 +79,91 @@
<!-- 第二层判断是否有下级 --> <!-- 第二层判断是否有下级 -->
<template v-for="child in item.children"> <template v-for="child in item.children">
<a-sub-menu :key="child.key" v-if="child.children && child.children.length > 0" > <a-sub-menu :key="child.key" v-if="child.children && child.children.length > 0">
<!-- <template #icon> <!-- <template #icon>
<Icon icon="ant-design:border-verticle-outlined" :size="20" /> <Icon icon="ant-design:border-verticle-outlined" :size="20" />
</template> --> </template> -->
<template #title> <template #title>
<span @mouseenter="child.showContent = true" @mouseleave="child.showContent = false">{{ child?.title }} <span @mouseenter="child.showContent = true" @mouseleave="child.showContent = false">{{ child?.title
}}
<span v-if="child?.izEnabled == '1' && child.level != 5" style="color:red;">(已停用)</span> <span v-if="child?.izEnabled == '1' && child.level != 5" style="color:red;">(已停用)</span>
<span v-show="child.showContent"> <span v-show="child.showContent">
<!-- 下拉菜单 --> <!-- 下拉菜单 -->
<a-dropdown :open="menuState[child?.key]?.open" @openChange="onMenuOpenChange(child.key, $event)"> <a-dropdown :open="menuState[child?.key]?.open"
@openChange="onMenuOpenChange(child.key, $event)">
<template #overlay> <template #overlay>
<a-menu> <a-menu>
<a-menu-item v-for="itemMenu in menuItems(child)" :key="itemMenu.key" :disabled="!itemMenu.canAdd" <a-menu-item v-for="itemMenu in menuItems(child)" :key="itemMenu.key"
class="nu-menu-item" @click="() => { closeAllMenus(); itemMenu.action(child) }"> :disabled="!itemMenu.canAdd" class="nu-menu-item"
@click="() => { closeAllMenus(); itemMenu.action(child) }">
<Icon style="color:#1890FF;" :icon="itemMenu.icon" class="action-icon"></Icon> <Icon style="color:#1890FF;" :icon="itemMenu.icon" class="action-icon"></Icon>
<span style=" color:#1890FF;margin-left: 5px;">{{ itemMenu.label }}</span> <span style=" color:#1890FF;margin-left: 5px;">{{ itemMenu.label }}</span>
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
</template> </template>
<!-- 图标 --> <!-- 图标 -->
<Icon style="color:#1890FF;" :icon="iconClass(child.level)" <Icon style="color:#1890FF;" :icon="iconClass(child.level)" class="action-icon"
class="action-icon" @mouseenter="onNodeIconEnter(child, child.children)" @mouseenter="onNodeIconEnter(child, child.children)" @mouseleave="onNodeIconLeave(child)" />
@mouseleave="onNodeIconLeave(child)" />
</a-dropdown> </a-dropdown>
</span> </span>
</span> </span>
</template> </template>
<!-- 第三层判断是否有下级 --> <!-- 第三层判断是否有下级 -->
<template v-for="childThree in child.children"> <template v-for="childThree in child.children">
<a-sub-menu :key="childThree.key" v-if="childThree.children && childThree.children.length > 0" > <a-sub-menu :key="childThree.key" v-if="childThree.children && childThree.children.length > 0">
<!-- <template #icon> <!-- <template #icon>
<Icon icon="ant-design:border-bottom-outlined" :size="20" /> <Icon icon="ant-design:border-bottom-outlined" :size="20" />
</template> --> </template> -->
<template #title> <template #title>
<span @mouseenter="childThree.showContent = true" @mouseleave="childThree.showContent = false">{{ childThree?.title }} <span @mouseenter="childThree.showContent = true"
<span v-if="childThree?.izEnabled == '1' && childThree.level != 5" style="color:red;">(已停用)</span> @mouseleave="childThree.showContent = false">{{ childThree?.title }}
<span v-if="childThree?.izEnabled == '1' && childThree.level != 5"
style="color:red;">(已停用)</span>
<span v-show="childThree.showContent"> <span v-show="childThree.showContent">
<!-- 下拉菜单 --> <!-- 下拉菜单 -->
<a-dropdown :open="menuState[childThree?.key]?.open" @openChange="onMenuOpenChange(childThree.key, $event)"> <a-dropdown :open="menuState[childThree?.key]?.open"
@openChange="onMenuOpenChange(childThree.key, $event)">
<template #overlay> <template #overlay>
<a-menu> <a-menu>
<a-menu-item v-for="itemMenu in menuItems(childThree)" :key="itemMenu.key" :disabled="!itemMenu.canAdd" <a-menu-item v-for="itemMenu in menuItems(childThree)" :key="itemMenu.key"
class="nu-menu-item" @click="() => { closeAllMenus(); itemMenu.action(childThree) }"> :disabled="!itemMenu.canAdd" class="nu-menu-item"
@click="() => { closeAllMenus(); itemMenu.action(childThree) }">
<Icon style="color:#1890FF;" :icon="itemMenu.icon" class="action-icon"></Icon> <Icon style="color:#1890FF;" :icon="itemMenu.icon" class="action-icon"></Icon>
<span style=" color:#1890FF;margin-left: 5px;">{{ itemMenu.label }}</span> <span style=" color:#1890FF;margin-left: 5px;">{{ itemMenu.label }}</span>
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
</template> </template>
<!-- 图标 --> <!-- 图标 -->
<Icon style="color:#1890FF;" :icon="iconClass(childThree.level)" <Icon style="color:#1890FF;" :icon="iconClass(childThree.level)" class="action-icon"
class="action-icon" @mouseenter="onNodeIconEnter(childThree, childThree.children)" @mouseenter="onNodeIconEnter(childThree, childThree.children)"
@mouseleave="onNodeIconLeave(childThree)" /> @mouseleave="onNodeIconLeave(childThree)" />
</a-dropdown> </a-dropdown>
</span> </span>
</span> </span>
</template> </template>
<!-- 第四层判断是否有下级 --> <!-- 第四层判断是否有下级 -->
<a-menu-item :key="childFour.key" v-for="childFour in childThree.children" > <a-menu-item :key="childFour.key" v-for="childFour in childThree.children">
<span @mouseenter="childFour.showContent = true" @mouseleave="childFour.showContent = false" class="auto-wrap">{{ childFour?.title + '(' + childFour?.cycleTypeName + ')'}} <span @mouseenter="childFour.showContent = true" @mouseleave="childFour.showContent = false"
<span v-if="childFour?.izEnabled == '1' && childFour.level != 5" style="color:red;">(已停用)</span> class="auto-wrap">{{ childFour?.title + '(' + childFour?.cycleTypeName + ')' }}
<span v-if="childFour?.izEnabled == '1' && childFour.level != 5"
style="color:red;">(已停用)</span>
<span v-show="childFour.showContent"> <span v-show="childFour.showContent">
<!-- 下拉菜单 --> <!-- 下拉菜单 -->
<a-dropdown :open="menuState[childFour?.key]?.open" @openChange="onMenuOpenChange(childFour.key, $event)"> <a-dropdown :open="menuState[childFour?.key]?.open"
@openChange="onMenuOpenChange(childFour.key, $event)">
<template #overlay> <template #overlay>
<a-menu> <a-menu>
<a-menu-item v-for="itemMenu in menuItems(childFour)" :key="itemMenu.key" :disabled="!itemMenu.canAdd" <a-menu-item v-for="itemMenu in menuItems(childFour)" :key="itemMenu.key"
class="nu-menu-item" @click="() => { closeAllMenus(); itemMenu.action(childFour) }"> :disabled="!itemMenu.canAdd" class="nu-menu-item"
@click="() => { closeAllMenus(); itemMenu.action(childFour) }">
<Icon style="color:#1890FF;" :icon="itemMenu.icon" class="action-icon"></Icon> <Icon style="color:#1890FF;" :icon="itemMenu.icon" class="action-icon"></Icon>
<span style=" color:#1890FF;margin-left: 5px;">{{ itemMenu.label }}</span> <span style=" color:#1890FF;margin-left: 5px;">{{ itemMenu.label }}</span>
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
</template> </template>
<!-- 图标 --> <!-- 图标 -->
<Icon style="color:#1890FF;" :icon="iconClass(childFour.level)" <Icon style="color:#1890FF;" :icon="iconClass(childFour.level)" class="action-icon"
class="action-icon" @mouseenter="onNodeIconEnter(childFour, childFour.children)" @mouseenter="onNodeIconEnter(childFour, childFour.children)"
@mouseleave="onNodeIconLeave(childFour)" /> @mouseleave="onNodeIconLeave(childFour)" />
</a-dropdown> </a-dropdown>
</span> </span>
@ -167,23 +174,27 @@
<!-- <template #icon> <!-- <template #icon>
<Icon icon="ant-design:border-bottom-outlined" :size="20" /> <Icon icon="ant-design:border-bottom-outlined" :size="20" />
</template> --> </template> -->
<span @mouseenter="childThree.showContent = true" @mouseleave="childThree.showContent = false">{{ childThree?.title }} <span @mouseenter="childThree.showContent = true" @mouseleave="childThree.showContent = false">{{
<span v-if="childThree?.izEnabled == '1' && childThree.level != 5" style="color:red;">(已停用)</span> childThree?.title }}
<span v-if="childThree?.izEnabled == '1' && childThree.level != 5"
style="color:red;">(已停用)</span>
<span v-show="childThree.showContent"> <span v-show="childThree.showContent">
<!-- 下拉菜单 --> <!-- 下拉菜单 -->
<a-dropdown :open="menuState[childThree?.key]?.open" @openChange="onMenuOpenChange(childThree.key, $event)"> <a-dropdown :open="menuState[childThree?.key]?.open"
@openChange="onMenuOpenChange(childThree.key, $event)">
<template #overlay> <template #overlay>
<a-menu> <a-menu>
<a-menu-item v-for="itemMenu in menuItems(childThree)" :key="itemMenu.key" :disabled="!itemMenu.canAdd" <a-menu-item v-for="itemMenu in menuItems(childThree)" :key="itemMenu.key"
class="nu-menu-item" @click="() => { closeAllMenus(); itemMenu.action(childThree) }"> :disabled="!itemMenu.canAdd" class="nu-menu-item"
@click="() => { closeAllMenus(); itemMenu.action(childThree) }">
<Icon style="color:#1890FF;" :icon="itemMenu.icon" class="action-icon"></Icon> <Icon style="color:#1890FF;" :icon="itemMenu.icon" class="action-icon"></Icon>
<span style=" color:#1890FF;margin-left: 5px;">{{ itemMenu.label }}</span> <span style=" color:#1890FF;margin-left: 5px;">{{ itemMenu.label }}</span>
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
</template> </template>
<!-- 图标 --> <!-- 图标 -->
<Icon style="color:#1890FF;" :icon="iconClass(childThree.level)" <Icon style="color:#1890FF;" :icon="iconClass(childThree.level)" class="action-icon"
class="action-icon" @mouseenter="onNodeIconEnter(childThree, childThree.children)" @mouseenter="onNodeIconEnter(childThree, childThree.children)"
@mouseleave="onNodeIconLeave(childThree)" /> @mouseleave="onNodeIconLeave(childThree)" />
</a-dropdown> </a-dropdown>
</span> </span>
@ -195,24 +206,25 @@
<!-- <template #icon> <!-- <template #icon>
<Icon icon="ant-design:border-verticle-outlined" :size="20" /> <Icon icon="ant-design:border-verticle-outlined" :size="20" />
</template> --> </template> -->
<span @mouseenter="child.showContent = true" @mouseleave="child.showContent = false">{{ child?.title }} <span @mouseenter="child.showContent = true" @mouseleave="child.showContent = false">{{ child?.title
}}
<span v-if="child?.izEnabled == '1' && child.level != 5" style="color:red;">(已停用)</span> <span v-if="child?.izEnabled == '1' && child.level != 5" style="color:red;">(已停用)</span>
<span v-show="child.showContent"> <span v-show="child.showContent">
<!-- 下拉菜单 --> <!-- 下拉菜单 -->
<a-dropdown :open="menuState[child?.key]?.open" @openChange="onMenuOpenChange(child.key, $event)"> <a-dropdown :open="menuState[child?.key]?.open" @openChange="onMenuOpenChange(child.key, $event)">
<template #overlay> <template #overlay>
<a-menu> <a-menu>
<a-menu-item v-for="itemMenu in menuItems(child)" :key="itemMenu.key" :disabled="!itemMenu.canAdd" <a-menu-item v-for="itemMenu in menuItems(child)" :key="itemMenu.key"
class="nu-menu-item" @click="() => { closeAllMenus(); itemMenu.action(child) }"> :disabled="!itemMenu.canAdd" class="nu-menu-item"
@click="() => { closeAllMenus(); itemMenu.action(child) }">
<Icon style="color:#1890FF;" :icon="itemMenu.icon" class="action-icon"></Icon> <Icon style="color:#1890FF;" :icon="itemMenu.icon" class="action-icon"></Icon>
<span style=" color:#1890FF;margin-left: 5px;">{{ itemMenu.label }}</span> <span style=" color:#1890FF;margin-left: 5px;">{{ itemMenu.label }}</span>
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
</template> </template>
<!-- 图标 --> <!-- 图标 -->
<Icon style="color:#1890FF;" :icon="iconClass(child.level)" <Icon style="color:#1890FF;" :icon="iconClass(child.level)" class="action-icon"
class="action-icon" @mouseenter="onNodeIconEnter(child, child.children)" @mouseenter="onNodeIconEnter(child, child.children)" @mouseleave="onNodeIconLeave(child)" />
@mouseleave="onNodeIconLeave(child)" />
</a-dropdown> </a-dropdown>
</span> </span>
</span> </span>
@ -231,8 +243,9 @@
<a-dropdown :open="menuState[item?.key]?.open" @openChange="onMenuOpenChange(item.key, $event)"> <a-dropdown :open="menuState[item?.key]?.open" @openChange="onMenuOpenChange(item.key, $event)">
<template #overlay> <template #overlay>
<a-menu> <a-menu>
<a-menu-item v-for="itemMenu in menuItems(item)" :key="itemMenu.key" :disabled="!itemMenu.canAdd" <a-menu-item v-for="itemMenu in menuItems(item)" :key="itemMenu.key"
class="nu-menu-item" @click="() => { closeAllMenus(); itemMenu.action(item) }"> :disabled="!itemMenu.canAdd" class="nu-menu-item"
@click="() => { closeAllMenus(); itemMenu.action(item) }">
<Icon style="color:#1890FF;" :icon="itemMenu.icon" class="action-icon"></Icon> <Icon style="color:#1890FF;" :icon="itemMenu.icon" class="action-icon"></Icon>
<span style=" color:#1890FF;margin-left: 5px;">{{ itemMenu.label }}</span> <span style=" color:#1890FF;margin-left: 5px;">{{ itemMenu.label }}</span>
</a-menu-item> </a-menu-item>
@ -298,8 +311,14 @@
preIcon="tabler:settings">配置情绪标签</a-button> --> preIcon="tabler:settings">配置情绪标签</a-button> -->
<!-- <a-button type="primary" class="btnPrivate" @click="handleAdd" <!-- <a-button type="primary" class="btnPrivate" @click="handleAdd"
preIcon="ant-design:plus-outlined">新增服务指令</a-button> --> preIcon="ant-design:plus-outlined">新增服务指令</a-button> -->
<a-button type="primary" class="btnPrivate" @click="handleDirectiveMainOpen" v-show="isShowDM" <a-button type="primary" @click="handleDirectiveMainOpen" v-show="isShowDM"
preIcon="ant-design:profile-outlined">标准指令库</a-button> preIcon="ant-design:profile-outlined">标准指令库</a-button>
<a-button type="primary" preIcon="ant-design:eye-outlined" v-show="ownOrgCode == mainOrgCode"
@click="handleCompare">差异比对</a-button>
<a-button type="primary" preIcon="ant-design:eye-outlined" v-show="ownOrgCode == mainOrgCode"
@click="handleLookNewDirectives">差异指令</a-button>
<!-- <a-button type="primary" @click="handleBatchAdd" preIcon="ant-design:plus-outlined">批量新增</a-button>
<a-button type="primary" @click="onAbnormalListOpen" preIcon="ant-design:edit-twotone">停用指令</a-button> -->
</template> </template>
<!--操作栏--> <!--操作栏-->
<template #action="{ record }"> <template #action="{ record }">
@ -400,6 +419,48 @@
</template> </template>
<EmotionTagList v-if="emotionTagOpen"></EmotionTagList> <EmotionTagList v-if="emotionTagOpen"></EmotionTagList>
</a-drawer> --> </a-drawer> -->
<!-- 差异比对 -->
<a-drawer title="差异比对" width="80vw" :open="compareListOpen" @close="onCompareListClose"
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }">
<template #footer>
<a-button type="primary" @click="onCompareListClose" style="margin-right: 10px;">关闭</a-button>
</template>
<CompareDirectiveList ref="compareListRef" v-if="compareListOpen" :ownOrgCode="ownOrgCode" :ownOrgName="ownOrgName">
</CompareDirectiveList>
</a-drawer>
<!-- 批量新增 -->
<a-drawer title="批量新增" width="80vw" :open="batchAddOpen" @close="onBatchAddClose"
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }">
<template #footer>
<a-button type="primary" @click="onBatchAddClose" style="margin-right: 10px;">关闭</a-button>
<a-button type="primary" @click="onBatchAddSubmit">确认</a-button>
</template>
<DirectiveMediaList ref="dmRef" :ownOrgCode="ownOrgCode" v-if="batchAddOpen"></DirectiveMediaList>
</a-drawer>
<!-- 停用指令 -->
<a-drawer title="停用指令" width="85vw" :open="abnormalListOpen" @close="onAbnormalListClose"
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }">
<template #footer>
<a-button type="primary" @click="onAbnormalListClose" style="margin-right: 10px;">关闭</a-button>
</template>
<AbnormalDirectiveList ref="abnormalListRef" v-if="abnormalListOpen"></AbnormalDirectiveList>
</a-drawer>
<!-- 新增指令 -->
<a-drawer v-model:visible="newDirectiveVisible" title="新增指令" width="85vw" :footer-style="{ textAlign: 'right' }"
:bodyStyle="{ height: '80vh', display: 'flex', flexDirection: 'column', overflow: 'auto' }"
wrapClassName="org-list-modal" @cancel="handleCancelNewDirective">
<template #footer>
<a-button @click="handleCancelNewDirective" type="primary">关闭</a-button>
<!-- <a-button @click="handleAsyncNewDirective" type="primary">同步</a-button> -->
</template>
<div style="padding:0px 8px;">
<CanAddDirectiveList ref="canAddDirectiveRef" :directiveMainOrgInfo="directiveMainOrgInfo"
:existDirectiveIds="existDirectiveIds" @refreshExistIds="refreshDMExistedIds"></CanAddDirectiveList>
</div>
</a-drawer>
<!-- 音频播放 --> <!-- 音频播放 -->
<a-modal v-model:visible="showAudioModal" title="音频播放" :footer="null" @cancel="closeAudioModal" <a-modal v-model:visible="showAudioModal" title="音频播放" :footer="null" @cancel="closeAudioModal"
@ -426,11 +487,11 @@
</template> </template>
<script lang="ts" name="serviceDirective-configServiceDirective" setup> <script lang="ts" name="serviceDirective-configServiceDirective" setup>
import { ref, reactive, watch, onMounted, computed } from 'vue'; import { ref, reactive, watch, onMounted, computed, nextTick } from 'vue';
import { BasicTable, TableAction } from '/@/components/Table'; import { BasicTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage'; import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './ConfigServiceDirective.data'; import { columns, superQuerySchema } from './ConfigServiceDirective.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, tree } from './ConfigServiceDirective.api'; import { list, batchAdd, deleteOne, batchDelete, getImportUrl, getExportUrl, tree } from './ConfigServiceDirective.api';
import ConfigServiceDirectiveModal from './components/ConfigServiceDirectiveModal.vue' import ConfigServiceDirectiveModal from './components/ConfigServiceDirectiveModal.vue'
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue"; import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
@ -446,16 +507,31 @@ import { Empty } from 'ant-design-vue';
import InstructionTagModal from '/@/views/services/InstructionTag/components/InstructionTagModal.vue' import InstructionTagModal from '/@/views/services/InstructionTag/components/InstructionTagModal.vue'
import ConfigServiceCategoryModal from '/@/views/services/serviceCategory/components//ConfigServiceCategoryModal.vue' import ConfigServiceCategoryModal from '/@/views/services/serviceCategory/components//ConfigServiceCategoryModal.vue'
import ConfigServiceTypeModal from '/@/views/services/serviceType/components//ConfigServiceTypeModal.vue' import ConfigServiceTypeModal from '/@/views/services/serviceType/components//ConfigServiceTypeModal.vue'
import DirectiveMediaList from '/@/views/services/directivemedia/DirectiveMediaList.vue'
import { queryByKey } from '/@/views/admin/sysconfig/SysConfig.api' import { queryByKey } from '/@/views/admin/sysconfig/SysConfig.api'
import { getOrgInfo } from '@/api/common/api' import { getOrgInfo } from '@/api/common/api'
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import AbnormalDirectiveList from './components/AbnormalDirectiveList.vue'
import CompareDirectiveList from './components/CompareDirectiveList.vue'
import { idListByDS } from './ConfigServiceDirective.api';
import CanAddDirectiveList from '/@/views/services/canadddirective/CanAddDirectiveList.vue'
const { createMessage, createConfirm } = useMessage(); const { createMessage, createConfirm } = useMessage();
const canAddDirectiveRef = ref()
const existDirectiveIds = ref([])//id
const insRegisterModal = ref(); const insRegisterModal = ref();
const catRegisterModal = ref(); const catRegisterModal = ref();
const typRegisterModal = ref(); const typRegisterModal = ref();
const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE; const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE;
const formRef = ref(); const formRef = ref();
const batchAddOpen = ref(false)
const dmRef = ref()
const abnormalListOpen = ref(false)
const abnormalListRef = ref()
const newDirectiveVisible = ref(false)
const compareListRef = ref()
const compareListOpen = ref(false)
const queryParam = reactive<any>({ const queryParam = reactive<any>({
instructionTagId: '', instructionTagId: '',
categoryId: '', categoryId: '',
@ -482,8 +558,8 @@ const registerModal = ref();
const treeData = ref<any>([]); const treeData = ref<any>([]);
const userStore = useUserStore(); const userStore = useUserStore();
const isShowDM = ref(false)// const isShowDM = ref(false)//
const selectedKeys=ref<any>([]); const selectedKeys = ref<any>([]);
const openKeys=ref<any>([]); const openKeys = ref<any>([]);
//table //table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: { tableProps: {
@ -541,7 +617,10 @@ const typeOpen = ref(false)//服务类型抽屉
const bodyTagOpen = ref(false)// const bodyTagOpen = ref(false)//
const emotionTagOpen = ref(false)// const emotionTagOpen = ref(false)//
const mainOrgCode = ref()// const mainOrgCode = ref()//
const ownOrgCode = ref('') //
const ownOrgName = ref('') //
const filterIzEnabled = ref('enabled')/// const filterIzEnabled = ref('enabled')///
const directiveMainOrgInfo = ref()
function onOpenChange(record: string[]) { function onOpenChange(record: string[]) {
console.log("🚀 ~ onOpenChange ~ record:", record) console.log("🚀 ~ onOpenChange ~ record:", record)
@ -552,7 +631,7 @@ function onOpenChange(record: string[]) {
// } else { // } else {
// state.openKeys = latestOpenKey ? [latestOpenKey] : []; // state.openKeys = latestOpenKey ? [latestOpenKey] : [];
// } // }
} }
/** /**
* 高级查询事件 * 高级查询事件
*/ */
@ -684,9 +763,12 @@ function searchQuery(reloadTree = true, resetId = true) {
} else { } else {
queryParam.izEnabled = '' queryParam.izEnabled = ''
} }
reload().then(() => { reload().then(async res => {
if (reloadTree) { if (reloadTree) {
initTree(); await initTree();
}
if (res.length == 1) {
expandTreeNodeToLevel4(res[0])
} }
}) })
@ -1111,9 +1193,11 @@ function emotionTagsDetail(data) {
function menuItems(data) { function menuItems(data) {
if (data.level === 1) { if (data.level === 1) {
const items = [ const items = [
{ key: 'addIns', label: '新增分类标签', icon: 'ant-design:plus-outlined', canAdd: true, action: addInstruction },
] ]
if (!!mainOrgCode.value && mainOrgCode.value == ownOrgCode.value) {
items.push({ key: 'addIns', label: '新增分类标签', icon: 'ant-design:plus-outlined', canAdd: true && !!mainOrgCode.value && mainOrgCode.value == ownOrgCode.value, action: addInstruction },)
}
if (data.canAdd) { if (data.canAdd) {
items.push({ key: 'addCat', label: '新增服务类别', icon: 'ant-design:plus-outlined', canAdd: data.canAdd, action: addCategory }) items.push({ key: 'addCat', label: '新增服务类别', icon: 'ant-design:plus-outlined', canAdd: data.canAdd, action: addCategory })
} }
@ -1233,17 +1317,17 @@ function handleTreeSelect(selectedKeys: string[], { node }: any) {
searchQuery(false, level != 4); searchQuery(false, level != 4);
} }
function initTree() { async function initTree() {
treeLoading.value = true treeLoading.value = true;
tree({ filterIzEnabled: filterIzEnabled.value }).then(res => { try {
const res = await tree({ filterIzEnabled: filterIzEnabled.value });
treeData.value = res; treeData.value = res;
expandedKeys.value = [] expandedKeys.value = [];
// //
setDefaultExpanded(res) // setDefaultExpanded(res);
}) } finally {
.finally(() => { treeLoading.value = false;
treeLoading.value = false }
})
} }
/** /**
@ -1254,12 +1338,79 @@ function handleDirectiveMainOpen() {
} }
async function getDirectiveMainOrgCode() { async function getDirectiveMainOrgCode() {
let { orgCode } = await getOrgInfo() let { orgCode, orgName } = await getOrgInfo()
ownOrgCode.value = orgCode
ownOrgName.value = orgName
let { configValue } = await queryByKey({ key: 'directive_main_org_code' }) let { configValue } = await queryByKey({ key: 'directive_main_org_code' })
mainOrgCode.value = configValue mainOrgCode.value = configValue
if (orgCode != configValue) isShowDM.value = true if (orgCode != configValue) isShowDM.value = true
} }
function handleBatchAdd() {
batchAddOpen.value = true
nextTick(() => {
dmRef.value?.init()
})
}
function onBatchAddClose() {
batchAddOpen.value = false
}
function onBatchAddSubmit() {
batchAdd(dmRef.value?.selectedRows).then(res => {
createMessage.success('操作成功')
// filterIzEnabled.value = 'all'
searchQuery(true, true)
onBatchAddClose()
})
}
function onAbnormalListOpen() {
abnormalListOpen.value = true
nextTick(() => {
abnormalListRef.value?.reload()
})
}
function onAbnormalListClose() {
abnormalListOpen.value = false
searchQuery(true, true)
}
//
function refreshDMExistedIds(dmOrgInfo, izReset = false, izQuery = true) {
idListByDS({ dataSourceCode: 'master' }).then(res => {
existDirectiveIds.value = res.records
if (izReset) {
canAddDirectiveRef.value?.searchReset()
} else {
canAddDirectiveRef.value?.reload()
}
})
}
function handleLookNewDirectives() {
newDirectiveVisible.value = true
refreshDMExistedIds(directiveMainOrgInfo.value, true)
}
/**
* 关闭新增指令
*/
function handleCancelNewDirective() {
newDirectiveVisible.value = false
}
/**
* 差异比对
*/
function handleCompare() {
compareListOpen.value = true
}
function onCompareListClose() {
compareListOpen.value = false
}
// //
onMounted(() => { onMounted(() => {
if (audioPlayer.value) { if (audioPlayer.value) {
@ -1351,16 +1502,22 @@ audio::-webkit-media-controls-time-remaining-display {
height: 81.5vh; height: 81.5vh;
} }
} }
:deep(.ant-menu-item-selected){
:deep(.ant-menu-item-selected) {
color: #4b4b4b !important; color: #4b4b4b !important;
} }
:deep(.ant-menu-submenu-title){
:deep(.ant-menu-submenu-title) {
color: #4b4b4b !important; color: #4b4b4b !important;
} }
.auto-wrap { .auto-wrap {
word-wrap: break-word; /* 长单词/URL换行 */ word-wrap: break-word;
word-break: break-all; /* 更激进的换行策略 */ /* 长单词/URL换行 */
white-space: normal; /* 默认换行行为 */ word-break: break-all;
/* 更激进的换行策略 */
white-space: normal;
/* 默认换行行为 */
line-height: 20px !important; line-height: 20px !important;
display: inline flow-root; display: inline flow-root;
padding-top: 10px; padding-top: 10px;