Merge branch 'master' of http://47.115.223.229:8888/yangjun/nursing_unit_vue
This commit is contained in:
commit
bcfabb7667
6
.env
6
.env
|
@ -1,11 +1,11 @@
|
||||||
# port
|
# port
|
||||||
VITE_PORT = 3101
|
VITE_PORT = 3103
|
||||||
|
|
||||||
# 网站标题
|
# 网站标题
|
||||||
VITE_GLOB_APP_TITLE = 护理单元业务系统
|
VITE_GLOB_APP_TITLE = 护理单元业务平台
|
||||||
|
|
||||||
# 简称,此变量只能是字符/下划线
|
# 简称,此变量只能是字符/下划线
|
||||||
VITE_GLOB_APP_SHORT_NAME = 护理单元业务系统
|
VITE_GLOB_APP_SHORT_NAME = 护理单元业务平台
|
||||||
|
|
||||||
# 单点登录服务端地址
|
# 单点登录服务端地址
|
||||||
VITE_GLOB_APP_CAS_BASE_URL=http://cas.test.com:8443/cas
|
VITE_GLOB_APP_CAS_BASE_URL=http://cas.test.com:8443/cas
|
||||||
|
|
|
@ -6,13 +6,13 @@ VITE_PUBLIC_PATH = /
|
||||||
|
|
||||||
|
|
||||||
# 跨域代理,您可以配置多个 ,请注意,没有换行符
|
# 跨域代理,您可以配置多个 ,请注意,没有换行符
|
||||||
VITE_PROXY = [["/nursing-unit-001","http://localhost:8081/nursing-unit_001"],["/upload","http://localhost:3300/upload"]]
|
VITE_PROXY = [["/nursing-unit_101","http://localhost:8091/nursing-unit_101"],["/upload","http://localhost:3300/upload"]]
|
||||||
|
|
||||||
#后台接口全路径地址(必填)
|
#后台接口全路径地址(必填)
|
||||||
VITE_GLOB_DOMAIN_URL=http://localhost:8081/nursing-unit_001
|
VITE_GLOB_DOMAIN_URL=http://localhost:8091/nursing-unit_101
|
||||||
|
|
||||||
#后台接口父地址(必填)
|
#后台接口父地址(必填)
|
||||||
VITE_GLOB_API_URL=/nursing-unit-001
|
VITE_GLOB_API_URL=/nursing-unit_101
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_GLOB_API_URL_PREFIX=
|
VITE_GLOB_API_URL_PREFIX=
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
# 是否打开mock
|
# 是否打开mock
|
||||||
VITE_USE_MOCK = true
|
VITE_USE_MOCK = false
|
||||||
|
|
||||||
# 发布路径
|
# 发布路径
|
||||||
VITE_PUBLIC_PATH = /
|
VITE_PUBLIC_PATH = /
|
||||||
|
|
||||||
|
|
||||||
# 跨域代理,您可以配置多个 ,请注意,没有换行符
|
# 跨域代理,您可以配置多个 ,请注意,没有换行符
|
||||||
VITE_PROXY = [["/nursing-unit-002","http://localhost:8082/nursing-unit_002"],["/upload","http://localhost:3300/upload"]]
|
VITE_PROXY = [["/nursing-unit_102","http://localhost:8092/nursing-unit_102"],["/upload","http://localhost:3300/upload"]]
|
||||||
|
|
||||||
#后台接口全路径地址(必填)
|
#后台接口全路径地址(必填)
|
||||||
VITE_GLOB_DOMAIN_URL=http://localhost:8082/nursing-unit_002
|
VITE_GLOB_DOMAIN_URL=http://localhost:8092/nursing-unit_102
|
||||||
|
|
||||||
#后台接口父地址(必填)
|
#后台接口父地址(必填)
|
||||||
VITE_GLOB_API_URL=/nursing-unit-002
|
VITE_GLOB_API_URL=/nursing-unit_102
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_GLOB_API_URL_PREFIX=
|
VITE_GLOB_API_URL_PREFIX=
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
# 是否打开mock
|
# 是否打开mock
|
||||||
VITE_USE_MOCK = true
|
VITE_USE_MOCK = false
|
||||||
|
|
||||||
# 发布路径
|
# 发布路径
|
||||||
VITE_PUBLIC_PATH = /
|
VITE_PUBLIC_PATH = /
|
||||||
|
|
||||||
|
|
||||||
# 跨域代理,您可以配置多个 ,请注意,没有换行符
|
# 跨域代理,您可以配置多个 ,请注意,没有换行符
|
||||||
VITE_PROXY = [["/nursing-unit-003","http://localhost:8083/nursing-unit_003"],["/upload","http://localhost:3300/upload"]]
|
VITE_PROXY = [["/nursing-unit_103","http://localhost:8093/nursing-unit_103"],["/upload","http://localhost:3300/upload"]]
|
||||||
|
|
||||||
#后台接口全路径地址(必填)
|
#后台接口全路径地址(必填)
|
||||||
VITE_GLOB_DOMAIN_URL=http://localhost:8083/nursing-unit_003
|
VITE_GLOB_DOMAIN_URL=http://localhost:8093/nursing-unit_103
|
||||||
|
|
||||||
#后台接口父地址(必填)
|
#后台接口父地址(必填)
|
||||||
VITE_GLOB_API_URL=/nursing-unit-003
|
VITE_GLOB_API_URL=/nursing-unit_103
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_GLOB_API_URL_PREFIX=
|
VITE_GLOB_API_URL_PREFIX=
|
||||||
|
|
|
@ -15,7 +15,8 @@ enum Api {
|
||||||
getDictItems = '/sys/dict/getDictItems/',
|
getDictItems = '/sys/dict/getDictItems/',
|
||||||
getTableList = '/sys/user/queryUserComponentData',
|
getTableList = '/sys/user/queryUserComponentData',
|
||||||
getCategoryData = '/sys/category/loadAllData',
|
getCategoryData = '/sys/category/loadAllData',
|
||||||
getNuList = '/iot/tplink/cameraInfo/nuList',//后期调整
|
getNuList = '/iot/tplink/cameraInfo/nuList',
|
||||||
|
getOrgName = '/sys/api/getOrgName',
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -158,3 +159,11 @@ export const getFileblob = (url, parameter) => {
|
||||||
export const uploadMyFile = (url, data) => {
|
export const uploadMyFile = (url, data) => {
|
||||||
return defHttp.uploadMyFile(url, data);
|
return defHttp.uploadMyFile(url, data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取机构名称
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const getOrgName = () => {
|
||||||
|
return defHttp.get({ url: Api.getOrgName });
|
||||||
|
};
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 9.0 KiB |
|
@ -1,17 +1,17 @@
|
||||||
<template>
|
<template>
|
||||||
<Header :class="getHeaderClass" style="background-image: url('../resource/img/bj.png');">
|
<Header :class="getHeaderClass" style="background-image: url('../resource/img/bj.png');">
|
||||||
<!-- left start -->
|
<!-- left start -->
|
||||||
<div :class="`${prefixCls}-left`" >
|
<div :class="`${prefixCls}-left`">
|
||||||
<!-- logo -->
|
<!-- logo -->
|
||||||
<AppLogo v-if="getShowHeaderLogo || getIsMobile" :class="`${prefixCls}-logo`" :theme="getHeaderTheme" :style="getLogoWidth" />
|
<AppLogo v-if="getShowHeaderLogo || getIsMobile" :class="`${prefixCls}-logo`" :theme="getHeaderTheme"
|
||||||
<LayoutTrigger
|
:style="getLogoWidth" />
|
||||||
v-if="(getShowContent && getShowHeaderTrigger && !getSplit && !getIsMixSidebar) || getIsMobile"
|
<LayoutTrigger v-if="(getShowContent && getShowHeaderTrigger && !getSplit && !getIsMixSidebar) || getIsMobile"
|
||||||
:theme="getHeaderTheme"
|
:theme="getHeaderTheme" :sider="false" />
|
||||||
:sider="false"
|
|
||||||
/>
|
|
||||||
<LayoutBreadcrumb v-if="getShowContent && getShowBread" :theme="getHeaderTheme" />
|
<LayoutBreadcrumb v-if="getShowContent && getShowBread" :theme="getHeaderTheme" />
|
||||||
<!-- 欢迎语 -->
|
<!-- 欢迎语 -->
|
||||||
<span v-if="getShowContent && getShowBreadTitle && !getIsMobile" style="background: #e3f6fc !important;" :class="[prefixCls, `${prefixCls}--${getHeaderTheme}`,'headerIntroductionClass']"> {{t('layout.header.welcomeIn')}} {{ title }} </span>
|
<span v-if="getShowContent && getShowBreadTitle && !getIsMobile" style="background: #e3f6fc !important;"
|
||||||
|
:class="[prefixCls, `${prefixCls}--${getHeaderTheme}`, 'headerIntroductionClass']">
|
||||||
|
{{ t('layout.header.welcomeIn') }} {{ title }} </span>
|
||||||
</div>
|
</div>
|
||||||
<!-- left end -->
|
<!-- left end -->
|
||||||
|
|
||||||
|
@ -24,19 +24,20 @@
|
||||||
<!-- action -->
|
<!-- action -->
|
||||||
<div :class="`${prefixCls}-action`">
|
<div :class="`${prefixCls}-action`">
|
||||||
<!-- <AppSearch :class="`${prefixCls}-action__item `" v-if="getShowSearch" /> -->
|
<!-- <AppSearch :class="`${prefixCls}-action__item `" v-if="getShowSearch" /> -->
|
||||||
|
<span >{{ orgName }}</span>
|
||||||
|
<a-divider type="vertical" />
|
||||||
<ErrorAction v-if="getUseErrorHandle" :class="`${prefixCls}-action__item error-action`" />
|
<ErrorAction v-if="getUseErrorHandle" :class="`${prefixCls}-action__item error-action`" />
|
||||||
<a-divider type="vertical" v-if="getUseErrorHandle" />
|
<a-divider type="vertical" v-if="getUseErrorHandle" />
|
||||||
<Notify v-if="getShowNotice" :class="`${prefixCls}-action__item notify-item`" />
|
<Notify v-if="getShowNotice" :class="`${prefixCls}-action__item notify-item`" />
|
||||||
<a-divider type="vertical" v-if="getShowNotice" />
|
<a-divider type="vertical" v-if="getShowNotice" />
|
||||||
<FullScreen v-if="getShowFullScreen" :class="`${prefixCls}-action__item fullscreen-item`" />
|
<FullScreen v-if="getShowFullScreen" :class="`${prefixCls}-action__item fullscreen-item`" />
|
||||||
<a-divider type="vertical" v-if="getShowFullScreen" />
|
<a-divider type="vertical" v-if="getShowFullScreen" />
|
||||||
<LockScreen v-if="getUseLockPage" />
|
<LockScreen v-if="getUseLockPage" />
|
||||||
<a-divider type="vertical" v-if="getUseLockPage" />
|
<a-divider type="vertical" v-if="getUseLockPage" />
|
||||||
<!-- <AppLocalePicker v-if="getShowLocalePicker" :reload="true" :showText="false" :class="`${prefixCls}-action__item`" /> -->
|
<!-- <AppLocalePicker v-if="getShowLocalePicker" :reload="true" :showText="false" :class="`${prefixCls}-action__item`" /> -->
|
||||||
|
|
||||||
<UserDropDown :theme="getHeaderTheme" />
|
<UserDropDown :theme="getHeaderTheme" />
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
<SettingDrawer v-if="getShowSetting" :class="`${prefixCls}-action__item`" />
|
<SettingDrawer v-if="getShowSetting" :class="`${prefixCls}-action__item`" />
|
||||||
<!-- ai助手 -->
|
<!-- ai助手 -->
|
||||||
<!-- <Aide></Aide> -->
|
<!-- <Aide></Aide> -->
|
||||||
|
@ -45,218 +46,227 @@
|
||||||
<LoginSelect ref="loginSelectRef" @success="loginSelectOk"></LoginSelect>
|
<LoginSelect ref="loginSelectRef" @success="loginSelectOk"></LoginSelect>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, unref, computed, ref, onMounted, toRaw } from 'vue';
|
import { defineComponent, unref, computed, ref, onMounted, toRaw } from 'vue';
|
||||||
import { useGlobSetting } from '/@/hooks/setting';
|
import { useGlobSetting } from '/@/hooks/setting';
|
||||||
import { propTypes } from '/@/utils/propTypes';
|
import { propTypes } from '/@/utils/propTypes';
|
||||||
|
|
||||||
import { Layout } from 'ant-design-vue';
|
import { Layout } from 'ant-design-vue';
|
||||||
import { AppLogo } from '/@/components/Application';
|
import { AppLogo } from '/@/components/Application';
|
||||||
import LayoutMenu from '../menu/index.vue';
|
import LayoutMenu from '../menu/index.vue';
|
||||||
import LayoutTrigger from '../trigger/index.vue';
|
import LayoutTrigger from '../trigger/index.vue';
|
||||||
|
|
||||||
import { AppSearch } from '/@/components/Application';
|
import { AppSearch } from '/@/components/Application';
|
||||||
|
|
||||||
import { useHeaderSetting } from '/@/hooks/setting/useHeaderSetting';
|
import { useHeaderSetting } from '/@/hooks/setting/useHeaderSetting';
|
||||||
import { useMenuSetting } from '/@/hooks/setting/useMenuSetting';
|
import { useMenuSetting } from '/@/hooks/setting/useMenuSetting';
|
||||||
import { useRootSetting } from '/@/hooks/setting/useRootSetting';
|
import { useRootSetting } from '/@/hooks/setting/useRootSetting';
|
||||||
|
|
||||||
import { MenuModeEnum, MenuSplitTyeEnum } from '/@/enums/menuEnum';
|
import { MenuModeEnum, MenuSplitTyeEnum } from '/@/enums/menuEnum';
|
||||||
import { SettingButtonPositionEnum } from '/@/enums/appEnum';
|
import { SettingButtonPositionEnum } from '/@/enums/appEnum';
|
||||||
import { AppLocalePicker } from '/@/components/Application';
|
import { AppLocalePicker } from '/@/components/Application';
|
||||||
|
|
||||||
import { UserDropDown, LayoutBreadcrumb, FullScreen, Notify, ErrorAction, LockScreen } from './components';
|
import { UserDropDown, LayoutBreadcrumb, FullScreen, Notify, ErrorAction, LockScreen } from './components';
|
||||||
import { useAppInject } from '/@/hooks/web/useAppInject';
|
import { useAppInject } from '/@/hooks/web/useAppInject';
|
||||||
import { useDesign } from '/@/hooks/web/useDesign';
|
import { useDesign } from '/@/hooks/web/useDesign';
|
||||||
|
|
||||||
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
|
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
|
||||||
import { useLocale } from '/@/locales/useLocale';
|
import { useLocale } from '/@/locales/useLocale';
|
||||||
|
|
||||||
import LoginSelect from '/@/views/sys/login/LoginSelect.vue';
|
import LoginSelect from '/@/views/sys/login/LoginSelect.vue';
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
import Aide from "@/views/dashboard/ai/components/aide/index.vue"
|
import Aide from "@/views/dashboard/ai/components/aide/index.vue"
|
||||||
const { t } = useI18n();
|
import { getOrgName } from '@/api/common/api'
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'LayoutHeader',
|
name: 'LayoutHeader',
|
||||||
components: {
|
components: {
|
||||||
Header: Layout.Header,
|
Header: Layout.Header,
|
||||||
AppLogo,
|
AppLogo,
|
||||||
LayoutTrigger,
|
LayoutTrigger,
|
||||||
LayoutBreadcrumb,
|
LayoutBreadcrumb,
|
||||||
LayoutMenu,
|
LayoutMenu,
|
||||||
UserDropDown,
|
UserDropDown,
|
||||||
AppLocalePicker,
|
AppLocalePicker,
|
||||||
FullScreen,
|
FullScreen,
|
||||||
Notify,
|
Notify,
|
||||||
AppSearch,
|
AppSearch,
|
||||||
ErrorAction,
|
ErrorAction,
|
||||||
LockScreen,
|
LockScreen,
|
||||||
LoginSelect,
|
LoginSelect,
|
||||||
SettingDrawer: createAsyncComponent(() => import('/@/layouts/default/setting/index.vue'), {
|
SettingDrawer: createAsyncComponent(() => import('/@/layouts/default/setting/index.vue'), {
|
||||||
loading: true,
|
loading: true,
|
||||||
}),
|
}),
|
||||||
Aide
|
Aide
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
fixed: propTypes.bool,
|
fixed: propTypes.bool,
|
||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
const { prefixCls } = useDesign('layout-header');
|
const { prefixCls } = useDesign('layout-header');
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const { getShowTopMenu, getShowHeaderTrigger, getSplit, getIsMixMode, getMenuWidth, getIsMixSidebar } = useMenuSetting();
|
const { getShowTopMenu, getShowHeaderTrigger, getSplit, getIsMixMode, getMenuWidth, getIsMixSidebar } = useMenuSetting();
|
||||||
const { getUseErrorHandle, getShowSettingButton, getSettingButtonPosition } = useRootSetting();
|
const { getUseErrorHandle, getShowSettingButton, getSettingButtonPosition } = useRootSetting();
|
||||||
const { title } = useGlobSetting();
|
const { title } = useGlobSetting();
|
||||||
|
const orgName = ref('')
|
||||||
|
const {
|
||||||
|
getHeaderTheme,
|
||||||
|
getShowFullScreen,
|
||||||
|
getShowNotice,
|
||||||
|
getShowContent,
|
||||||
|
getShowBread,
|
||||||
|
getShowHeaderLogo,
|
||||||
|
getShowHeader,
|
||||||
|
getShowSearch,
|
||||||
|
getUseLockPage,
|
||||||
|
getShowBreadTitle,
|
||||||
|
} = useHeaderSetting();
|
||||||
|
|
||||||
const {
|
const { getShowLocalePicker } = useLocale();
|
||||||
getHeaderTheme,
|
|
||||||
getShowFullScreen,
|
|
||||||
getShowNotice,
|
|
||||||
getShowContent,
|
|
||||||
getShowBread,
|
|
||||||
getShowHeaderLogo,
|
|
||||||
getShowHeader,
|
|
||||||
getShowSearch,
|
|
||||||
getUseLockPage,
|
|
||||||
getShowBreadTitle,
|
|
||||||
} = useHeaderSetting();
|
|
||||||
|
|
||||||
const { getShowLocalePicker } = useLocale();
|
const { getIsMobile } = useAppInject();
|
||||||
|
|
||||||
const { getIsMobile } = useAppInject();
|
const getHeaderClass = computed(() => {
|
||||||
|
const theme = unref(getHeaderTheme);
|
||||||
const getHeaderClass = computed(() => {
|
return [
|
||||||
const theme = unref(getHeaderTheme);
|
|
||||||
return [
|
|
||||||
prefixCls,
|
|
||||||
{
|
|
||||||
[`${prefixCls}--fixed`]: props.fixed,
|
|
||||||
[`${prefixCls}--mobile`]: unref(getIsMobile),
|
|
||||||
[`${prefixCls}--${theme}`]: theme,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
const getShowSetting = computed(() => {
|
|
||||||
if (!unref(getShowSettingButton)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const settingButtonPosition = unref(getSettingButtonPosition);
|
|
||||||
|
|
||||||
if (settingButtonPosition === SettingButtonPositionEnum.AUTO) {
|
|
||||||
return unref(getShowHeader);
|
|
||||||
}
|
|
||||||
return settingButtonPosition === SettingButtonPositionEnum.HEADER;
|
|
||||||
});
|
|
||||||
|
|
||||||
const getLogoWidth = computed(() => {
|
|
||||||
if (!unref(getIsMixMode) || unref(getIsMobile)) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
const width = unref(getMenuWidth) < 180 ? 180 : unref(getMenuWidth);
|
|
||||||
return { width: `${width}px` };
|
|
||||||
});
|
|
||||||
|
|
||||||
const getSplitType = computed(() => {
|
|
||||||
return unref(getSplit) ? MenuSplitTyeEnum.TOP : MenuSplitTyeEnum.NONE;
|
|
||||||
});
|
|
||||||
|
|
||||||
const getMenuMode = computed(() => {
|
|
||||||
return unref(getSplit) ? MenuModeEnum.HORIZONTAL : null;
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页多租户部门弹窗逻辑
|
|
||||||
*/
|
|
||||||
const loginSelectRef = ref();
|
|
||||||
|
|
||||||
function showLoginSelect() {
|
|
||||||
//update-begin---author:liusq Date:20220101 for:判断登录进来是否需要弹窗选择租户----
|
|
||||||
//判断是否是登陆进来
|
|
||||||
const loginInfo = toRaw(userStore.getLoginInfo) || {};
|
|
||||||
if (!!loginInfo.isLogin) {
|
|
||||||
loginSelectRef.value.show(loginInfo);
|
|
||||||
}
|
|
||||||
//update-end---author:liusq Date:20220101 for:判断登录进来是否需要弹窗选择租户----
|
|
||||||
}
|
|
||||||
|
|
||||||
function loginSelectOk() {
|
|
||||||
console.log('成功。。。。。');
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
showLoginSelect();
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
prefixCls,
|
prefixCls,
|
||||||
getHeaderClass,
|
{
|
||||||
getShowHeaderLogo,
|
[`${prefixCls}--fixed`]: props.fixed,
|
||||||
getHeaderTheme,
|
[`${prefixCls}--mobile`]: unref(getIsMobile),
|
||||||
getShowHeaderTrigger,
|
[`${prefixCls}--${theme}`]: theme,
|
||||||
getIsMobile,
|
},
|
||||||
getShowBreadTitle,
|
];
|
||||||
getShowBread,
|
});
|
||||||
getShowContent,
|
|
||||||
getSplitType,
|
const getShowSetting = computed(() => {
|
||||||
getSplit,
|
if (!unref(getShowSettingButton)) {
|
||||||
getMenuMode,
|
return false;
|
||||||
getShowTopMenu,
|
}
|
||||||
getShowLocalePicker,
|
const settingButtonPosition = unref(getSettingButtonPosition);
|
||||||
getShowFullScreen,
|
|
||||||
getShowNotice,
|
if (settingButtonPosition === SettingButtonPositionEnum.AUTO) {
|
||||||
getUseErrorHandle,
|
return unref(getShowHeader);
|
||||||
getLogoWidth,
|
}
|
||||||
getIsMixSidebar,
|
return settingButtonPosition === SettingButtonPositionEnum.HEADER;
|
||||||
getShowSettingButton,
|
});
|
||||||
getShowSetting,
|
|
||||||
getShowSearch,
|
const getLogoWidth = computed(() => {
|
||||||
getUseLockPage,
|
if (!unref(getIsMixMode) || unref(getIsMobile)) {
|
||||||
loginSelectOk,
|
return {};
|
||||||
loginSelectRef,
|
}
|
||||||
title,
|
const width = unref(getMenuWidth) < 180 ? 180 : unref(getMenuWidth);
|
||||||
t
|
return { width: `${width}px` };
|
||||||
};
|
});
|
||||||
},
|
|
||||||
});
|
const getSplitType = computed(() => {
|
||||||
|
return unref(getSplit) ? MenuSplitTyeEnum.TOP : MenuSplitTyeEnum.NONE;
|
||||||
|
});
|
||||||
|
|
||||||
|
const getMenuMode = computed(() => {
|
||||||
|
return unref(getSplit) ? MenuModeEnum.HORIZONTAL : null;
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页多租户部门弹窗逻辑
|
||||||
|
*/
|
||||||
|
const loginSelectRef = ref();
|
||||||
|
|
||||||
|
function showLoginSelect() {
|
||||||
|
//update-begin---author:liusq Date:20220101 for:判断登录进来是否需要弹窗选择租户----
|
||||||
|
//判断是否是登陆进来
|
||||||
|
const loginInfo = toRaw(userStore.getLoginInfo) || {};
|
||||||
|
if (!!loginInfo.isLogin) {
|
||||||
|
loginSelectRef.value.show(loginInfo);
|
||||||
|
}
|
||||||
|
//update-end---author:liusq Date:20220101 for:判断登录进来是否需要弹窗选择租户----
|
||||||
|
}
|
||||||
|
|
||||||
|
function loginSelectOk() {
|
||||||
|
console.log('成功。。。。。');
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getOrgName().then(res => {
|
||||||
|
orgName.value = res.orgName
|
||||||
|
})
|
||||||
|
showLoginSelect();
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
prefixCls,
|
||||||
|
getHeaderClass,
|
||||||
|
getShowHeaderLogo,
|
||||||
|
getHeaderTheme,
|
||||||
|
getShowHeaderTrigger,
|
||||||
|
getIsMobile,
|
||||||
|
getShowBreadTitle,
|
||||||
|
getShowBread,
|
||||||
|
getShowContent,
|
||||||
|
getSplitType,
|
||||||
|
getSplit,
|
||||||
|
getMenuMode,
|
||||||
|
getShowTopMenu,
|
||||||
|
getShowLocalePicker,
|
||||||
|
getShowFullScreen,
|
||||||
|
getShowNotice,
|
||||||
|
getUseErrorHandle,
|
||||||
|
getLogoWidth,
|
||||||
|
getIsMixSidebar,
|
||||||
|
getShowSettingButton,
|
||||||
|
getShowSetting,
|
||||||
|
getShowSearch,
|
||||||
|
getUseLockPage,
|
||||||
|
loginSelectOk,
|
||||||
|
loginSelectRef,
|
||||||
|
title,
|
||||||
|
t,
|
||||||
|
orgName,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
@import './index.less';
|
@import './index.less';
|
||||||
//update-begin---author:scott ---date:2022-09-30 for:默认隐藏顶部菜单面包屑-----------
|
//update-begin---author:scott ---date:2022-09-30 for:默认隐藏顶部菜单面包屑-----------
|
||||||
//顶部欢迎语展示样式
|
//顶部欢迎语展示样式
|
||||||
@prefix-cls: ~'@{namespace}-layout-header';
|
@prefix-cls: ~'@{namespace}-layout-header';
|
||||||
|
|
||||||
.ant-layout .@{prefix-cls} {
|
.ant-layout .@{prefix-cls} {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
// update-begin--author:liaozhiyang---date:20240407---for:【QQYUN-8762】顶栏高度
|
// update-begin--author:liaozhiyang---date:20240407---for:【QQYUN-8762】顶栏高度
|
||||||
height: @header-height;
|
height: @header-height;
|
||||||
// update-end--author:liaozhiyang---date:20240407---for:【QQYUN-8762】顶栏高度
|
// update-end--author:liaozhiyang---date:20240407---for:【QQYUN-8762】顶栏高度
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
.headerIntroductionClass {
|
||||||
|
margin-right: 4px;
|
||||||
|
margin-bottom: 2px;
|
||||||
|
border-bottom: 0px;
|
||||||
|
border-left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--light {
|
||||||
.headerIntroductionClass {
|
.headerIntroductionClass {
|
||||||
margin-right: 4px;
|
color: #000;
|
||||||
margin-bottom: 2px;
|
|
||||||
border-bottom: 0px;
|
|
||||||
border-left: 0px;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
&--light {
|
|
||||||
.headerIntroductionClass {
|
&--dark {
|
||||||
color: #000;
|
.headerIntroductionClass {
|
||||||
}
|
color: rgba(255, 255, 255, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
&--dark {
|
.anticon,
|
||||||
.headerIntroductionClass {
|
.truncate {
|
||||||
color: rgba(255, 255, 255, 1);
|
color: rgba(255, 255, 255, 1);
|
||||||
}
|
|
||||||
.anticon, .truncate {
|
|
||||||
color: rgba(255, 255, 255, 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//update-end---author:scott ---date::2022-09-30 for:默认隐藏顶部菜单面包屑--------------
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//update-end---author:scott ---date::2022-09-30 for:默认隐藏顶部菜单面包屑--------------
|
||||||
|
}
|
||||||
|
|
||||||
.jeecg-layout-header--light {
|
.jeecg-layout-header--light {
|
||||||
border-bottom: 0px;
|
border-bottom: 0px;
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
<!--引用表格-->
|
<!--引用表格-->
|
||||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
<BasicTable @register="registerTable">
|
||||||
<!--插槽:table标题-->
|
<!--插槽:table标题-->
|
||||||
<template #tableTitle>
|
<template #tableTitle>
|
||||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||||
|
@ -203,13 +203,6 @@ function getTableAction(record) {
|
||||||
}, {
|
}, {
|
||||||
label: '详情',
|
label: '详情',
|
||||||
onClick: handleDetail.bind(null, record),
|
onClick: handleDetail.bind(null, record),
|
||||||
}, {
|
|
||||||
label: '删除',
|
|
||||||
popConfirm: {
|
|
||||||
title: '是否确认删除',
|
|
||||||
confirm: handleDelete.bind(null, record),
|
|
||||||
placement: 'topLeft',
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
<!--引用表格-->
|
<!--引用表格-->
|
||||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
<BasicTable @register="registerTable">
|
||||||
<!--插槽:table标题-->
|
<!--插槽:table标题-->
|
||||||
<template #tableTitle>
|
<template #tableTitle>
|
||||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||||
|
@ -203,13 +203,6 @@ function getTableAction(record) {
|
||||||
}, {
|
}, {
|
||||||
label: '详情',
|
label: '详情',
|
||||||
onClick: handleDetail.bind(null, record),
|
onClick: handleDetail.bind(null, record),
|
||||||
}, {
|
|
||||||
label: '删除',
|
|
||||||
popConfirm: {
|
|
||||||
title: '是否确认删除',
|
|
||||||
confirm: handleDelete.bind(null, record),
|
|
||||||
placement: 'topLeft',
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,72 @@
|
||||||
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
import { useMessage } from "/@/hooks/web/useMessage";
|
||||||
|
|
||||||
|
const { createConfirm } = useMessage();
|
||||||
|
|
||||||
|
enum Api {
|
||||||
|
list = '/services/instructionTag/list',
|
||||||
|
save='/services/instructionTag/add',
|
||||||
|
edit='/services/instructionTag/edit',
|
||||||
|
deleteOne = '/services/instructionTag/delete',
|
||||||
|
deleteBatch = '/services/instructionTag/deleteBatch',
|
||||||
|
importExcel = '/services/instructionTag/importExcel',
|
||||||
|
exportXls = '/services/instructionTag/exportXls',
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出api
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const getExportUrl = Api.exportXls;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入api
|
||||||
|
*/
|
||||||
|
export const getImportUrl = Api.importExcel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表接口
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除单个
|
||||||
|
* @param params
|
||||||
|
* @param handleSuccess
|
||||||
|
*/
|
||||||
|
export const deleteOne = (params,handleSuccess) => {
|
||||||
|
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||||
|
handleSuccess();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
* @param params
|
||||||
|
* @param handleSuccess
|
||||||
|
*/
|
||||||
|
export const batchDelete = (params, handleSuccess) => {
|
||||||
|
createConfirm({
|
||||||
|
iconType: 'warning',
|
||||||
|
title: '确认删除',
|
||||||
|
content: '是否删除选中数据',
|
||||||
|
okText: '确认',
|
||||||
|
cancelText: '取消',
|
||||||
|
onOk: () => {
|
||||||
|
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
||||||
|
handleSuccess();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存或者更新
|
||||||
|
* @param params
|
||||||
|
* @param isUpdate
|
||||||
|
*/
|
||||||
|
export const saveOrUpdate = (params, isUpdate) => {
|
||||||
|
let url = isUpdate ? Api.edit : Api.save;
|
||||||
|
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
import {BasicColumn} from '/@/components/Table';
|
||||||
|
import {FormSchema} from '/@/components/Table';
|
||||||
|
import { rules} from '/@/utils/helper/validator';
|
||||||
|
import { render } from '/@/utils/common/renderUtils';
|
||||||
|
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||||
|
//列表数据
|
||||||
|
export const columns: BasicColumn[] = [
|
||||||
|
{
|
||||||
|
title: '分类标签',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'instructionName'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '排序',
|
||||||
|
align: "center",
|
||||||
|
sorter: true,
|
||||||
|
dataIndex: 'sort'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '是否启用',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'izEnabled_dictText'
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
// 高级查询数据
|
||||||
|
export const superQuerySchema = {
|
||||||
|
instructionTagName: {title: '分类标签',order: 0,view: 'text', type: 'string',},
|
||||||
|
sort: {title: '排序',order: 1,view: 'number', type: 'number',},
|
||||||
|
izEnabled: {title: '是否启用',order: 2,view: 'radio', type: 'string',dictCode: '',},
|
||||||
|
};
|
|
@ -0,0 +1,266 @@
|
||||||
|
<template>
|
||||||
|
<div class="p-2">
|
||||||
|
<!--查询区域-->
|
||||||
|
<div class="jeecg-basic-table-form-container">
|
||||||
|
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
|
||||||
|
:wrapper-col="wrapperCol">
|
||||||
|
<a-row :gutter="24">
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item name="instructionName">
|
||||||
|
<template #label><span title="分类标签">分类标签</span></template>
|
||||||
|
<JInput v-model:value="queryParam.instructionName" allowClear placeholder="请输入分类标签" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item name="izEnabled">
|
||||||
|
<template #label><span title="是否启用">是否启用</span></template>
|
||||||
|
<j-dict-select-tag type='list' v-model:value="queryParam.izEnabled" dictCode="iz_enabled"
|
||||||
|
:ignoreDisabled="true" placeholder="请选择是否启用" allowClear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
|
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||||
|
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
|
||||||
|
style="margin-left: 8px">重置</a-button>
|
||||||
|
<!-- <a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
|
||||||
|
{{ toggleSearchStatus ? '收起' : '展开' }}
|
||||||
|
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
|
||||||
|
</a> -->
|
||||||
|
</a-col>
|
||||||
|
</span>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
<!--引用表格-->
|
||||||
|
<BasicTable @register="registerTable">
|
||||||
|
<!--插槽:table标题-->
|
||||||
|
<template #tableTitle>
|
||||||
|
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||||
|
<!-- <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||||
|
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> -->
|
||||||
|
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||||
|
<template #overlay>
|
||||||
|
<a-menu>
|
||||||
|
<a-menu-item key="1" @click="batchHandleDelete">
|
||||||
|
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||||
|
删除
|
||||||
|
</a-menu-item>
|
||||||
|
</a-menu>
|
||||||
|
</template>
|
||||||
|
<a-button>批量操作
|
||||||
|
<Icon icon="mdi:chevron-down"></Icon>
|
||||||
|
</a-button>
|
||||||
|
</a-dropdown>
|
||||||
|
<!-- 高级查询 -->
|
||||||
|
<!-- <super-query :config="superQueryConfig" @search="handleSuperQuery" /> -->
|
||||||
|
</template>
|
||||||
|
<!--操作栏-->
|
||||||
|
<template #action="{ record }">
|
||||||
|
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||||
|
</template>
|
||||||
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<!-- 表单区域 -->
|
||||||
|
<InstructionTagModal ref="registerModal" @success="handleSuccess"></InstructionTagModal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" name="serviceInstructionTag-instructionTag" setup>
|
||||||
|
import { ref, reactive } from 'vue';
|
||||||
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||||
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
|
import { columns, superQuerySchema } from './InstructionTag.data';
|
||||||
|
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './InstructionTag.api';
|
||||||
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
|
import InstructionTagModal from './components/InstructionTagModal.vue'
|
||||||
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
|
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||||
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
|
|
||||||
|
const formRef = ref();
|
||||||
|
const queryParam = reactive<any>({});
|
||||||
|
const toggleSearchStatus = ref<boolean>(false);
|
||||||
|
const registerModal = ref();
|
||||||
|
const userStore = useUserStore();
|
||||||
|
//注册table数据
|
||||||
|
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
|
tableProps: {
|
||||||
|
title: '分类标签',
|
||||||
|
api: list,
|
||||||
|
columns,
|
||||||
|
canResize: false,
|
||||||
|
useSearchForm: false,
|
||||||
|
actionColumn: {
|
||||||
|
width: 160,
|
||||||
|
fixed: 'right',
|
||||||
|
},
|
||||||
|
beforeFetch: async (params) => {
|
||||||
|
params.column = 'sort'
|
||||||
|
params.order = 'asc'
|
||||||
|
return Object.assign(params, queryParam);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
exportConfig: {
|
||||||
|
name: "分类标签",
|
||||||
|
url: getExportUrl,
|
||||||
|
params: queryParam,
|
||||||
|
},
|
||||||
|
importConfig: {
|
||||||
|
url: getImportUrl,
|
||||||
|
success: handleSuccess
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||||
|
const labelCol = reactive({
|
||||||
|
xs: 24,
|
||||||
|
sm: 4,
|
||||||
|
xl: 8,
|
||||||
|
xxl: 8
|
||||||
|
});
|
||||||
|
const wrapperCol = reactive({
|
||||||
|
xs: 24,
|
||||||
|
sm: 20,
|
||||||
|
xl: 16,
|
||||||
|
xxl: 16
|
||||||
|
});
|
||||||
|
|
||||||
|
// 高级查询配置
|
||||||
|
const superQueryConfig = reactive(superQuerySchema);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 高级查询事件
|
||||||
|
*/
|
||||||
|
function handleSuperQuery(params) {
|
||||||
|
Object.keys(params).map((k) => {
|
||||||
|
queryParam[k] = params[k];
|
||||||
|
});
|
||||||
|
searchQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增事件
|
||||||
|
*/
|
||||||
|
function handleAdd() {
|
||||||
|
registerModal.value.disableSubmit = false;
|
||||||
|
registerModal.value.add();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑事件
|
||||||
|
*/
|
||||||
|
function handleEdit(record: Recordable) {
|
||||||
|
registerModal.value.disableSubmit = false;
|
||||||
|
registerModal.value.edit(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
function handleDetail(record: Recordable) {
|
||||||
|
registerModal.value.disableSubmit = true;
|
||||||
|
registerModal.value.edit(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除事件
|
||||||
|
*/
|
||||||
|
async function handleDelete(record) {
|
||||||
|
await deleteOne({ id: record.id }, handleSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除事件
|
||||||
|
*/
|
||||||
|
async function batchHandleDelete() {
|
||||||
|
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成功回调
|
||||||
|
*/
|
||||||
|
function handleSuccess() {
|
||||||
|
(selectedRowKeys.value = []) && reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作栏
|
||||||
|
*/
|
||||||
|
function getTableAction(record) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: '编辑',
|
||||||
|
onClick: handleEdit.bind(null, record)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '详情',
|
||||||
|
onClick: handleDetail.bind(null, record),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下拉操作栏
|
||||||
|
*/
|
||||||
|
function getDropDownAction(record) {
|
||||||
|
return [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询
|
||||||
|
*/
|
||||||
|
function searchQuery() {
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置
|
||||||
|
*/
|
||||||
|
function searchReset() {
|
||||||
|
formRef.value.resetFields();
|
||||||
|
selectedRowKeys.value = [];
|
||||||
|
//刷新数据
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.jeecg-basic-table-form-container {
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
.table-page-search-submitButtons {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-group-cust {
|
||||||
|
min-width: 100px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-group-split-cust {
|
||||||
|
width: 30px;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-form-item:not(.ant-form-item-with-help) {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
height: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-picker),
|
||||||
|
:deep(.ant-input-number) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,165 @@
|
||||||
|
<template>
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<JFormContainer :disabled="disabled">
|
||||||
|
<template #detail>
|
||||||
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||||
|
name="ConfigServiceCategoryForm">
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="分类标签名称" v-bind="validateInfos.instructionName"
|
||||||
|
id="ConfigServiceCategoryForm-instructionName" name="instructionName">
|
||||||
|
<a-input v-model:value="formData.instructionName" placeholder="请输入分类标签名称" allow-clear></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="排序" v-bind="validateInfos.sort" id="ConfigServiceCategoryForm-sort" name="sort">
|
||||||
|
<a-input-number v-model:value="formData.sort" placeholder="请输入排序" style="width: 100%" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="ConfigServiceCategoryForm-izEnabled"
|
||||||
|
name="izEnabled">
|
||||||
|
<j-dict-select-tag type='radio' v-model:value="formData.izEnabled" dictCode="iz_enabled"
|
||||||
|
placeholder="请选择是否启用" allowClear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</template>
|
||||||
|
</JFormContainer>
|
||||||
|
</a-spin>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
|
||||||
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
|
import { getValueType } from '/@/utils';
|
||||||
|
import { saveOrUpdate } from '../InstructionTag.api';
|
||||||
|
import { Form } from 'ant-design-vue';
|
||||||
|
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||||
|
const props = defineProps({
|
||||||
|
formDisabled: { type: Boolean, default: false },
|
||||||
|
formData: { type: Object, default: () => ({}) },
|
||||||
|
formBpm: { type: Boolean, default: true }
|
||||||
|
});
|
||||||
|
const formRef = ref();
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
const emit = defineEmits(['register', 'ok']);
|
||||||
|
const formData = reactive<Record<string, any>>({
|
||||||
|
id: '',
|
||||||
|
instructionName: '',
|
||||||
|
sort: 99,
|
||||||
|
izEnabled: '0',
|
||||||
|
});
|
||||||
|
const { createMessage } = useMessage();
|
||||||
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||||
|
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||||
|
const confirmLoading = ref<boolean>(false);
|
||||||
|
//表单验证
|
||||||
|
const validatorRules = reactive({
|
||||||
|
instructionName: [{ required: true, message: '请输入分类标签名称!' },],
|
||||||
|
sort: [{ required: true, message: '请输入排序!'}, { pattern: /^\d+$/, message: '请输入正整数!'},],
|
||||||
|
izEnabled: [{ required: true, message: '请选择是否启用!' },],
|
||||||
|
});
|
||||||
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||||
|
|
||||||
|
// 表单禁用
|
||||||
|
const disabled = computed(() => {
|
||||||
|
if (props.formBpm === true) {
|
||||||
|
if (props.formData.disabled === false) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return props.formDisabled;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
function add() {
|
||||||
|
edit({});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
function edit(record) {
|
||||||
|
nextTick(() => {
|
||||||
|
resetFields();
|
||||||
|
const tmpData = {};
|
||||||
|
Object.keys(formData).forEach((key) => {
|
||||||
|
if (record.hasOwnProperty(key)) {
|
||||||
|
tmpData[key] = record[key]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//赋值
|
||||||
|
Object.assign(formData, tmpData);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交数据
|
||||||
|
*/
|
||||||
|
async function submitForm() {
|
||||||
|
try {
|
||||||
|
// 触发表单验证
|
||||||
|
await validate();
|
||||||
|
} catch ({ errorFields }) {
|
||||||
|
if (errorFields) {
|
||||||
|
const firstField = errorFields[0];
|
||||||
|
if (firstField) {
|
||||||
|
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Promise.reject(errorFields);
|
||||||
|
}
|
||||||
|
confirmLoading.value = true;
|
||||||
|
const isUpdate = ref<boolean>(false);
|
||||||
|
//时间格式化
|
||||||
|
let model = formData;
|
||||||
|
if (model.id) {
|
||||||
|
isUpdate.value = true;
|
||||||
|
}
|
||||||
|
//循环数据
|
||||||
|
for (let data in model) {
|
||||||
|
//如果该数据是数组并且是字符串类型
|
||||||
|
if (model[data] instanceof Array) {
|
||||||
|
let valueType = getValueType(formRef.value.getProps, data);
|
||||||
|
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||||
|
if (valueType === 'string') {
|
||||||
|
model[data] = model[data].join(',');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await saveOrUpdate(model, isUpdate.value)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
createMessage.success(res.message);
|
||||||
|
emit('ok');
|
||||||
|
} else {
|
||||||
|
createMessage.warning(res.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
confirmLoading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
add,
|
||||||
|
edit,
|
||||||
|
submitForm,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.antd-modal-form {
|
||||||
|
padding: 14px;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,77 @@
|
||||||
|
<template>
|
||||||
|
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||||
|
<InstructionTagForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></InstructionTagForm>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, nextTick, defineExpose } from 'vue';
|
||||||
|
import InstructionTagForm from './InstructionTagForm.vue'
|
||||||
|
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||||
|
|
||||||
|
const title = ref<string>('');
|
||||||
|
const width = ref<number>(800);
|
||||||
|
const visible = ref<boolean>(false);
|
||||||
|
const disableSubmit = ref<boolean>(false);
|
||||||
|
const registerForm = ref();
|
||||||
|
const emit = defineEmits(['register', 'success']);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
function add() {
|
||||||
|
title.value = '新增';
|
||||||
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
registerForm.value.add();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @param record
|
||||||
|
*/
|
||||||
|
function edit(record) {
|
||||||
|
title.value = disableSubmit.value ? '详情' : '编辑';
|
||||||
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
registerForm.value.edit(record);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确定按钮点击事件
|
||||||
|
*/
|
||||||
|
function handleOk() {
|
||||||
|
registerForm.value.submitForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* form保存回调事件
|
||||||
|
*/
|
||||||
|
function submitCallback() {
|
||||||
|
handleCancel();
|
||||||
|
emit('success');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消按钮回调事件
|
||||||
|
*/
|
||||||
|
function handleCancel() {
|
||||||
|
visible.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
add,
|
||||||
|
edit,
|
||||||
|
disableSubmit,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
/**隐藏样式-modal确定按钮 */
|
||||||
|
.jee-hidden {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style lang="less" scoped></style>
|
|
@ -5,6 +5,11 @@ import { render } from '/@/utils/common/renderUtils';
|
||||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||||
//列表数据
|
//列表数据
|
||||||
export const columns: BasicColumn[] = [
|
export const columns: BasicColumn[] = [
|
||||||
|
{
|
||||||
|
title: '分类标签',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'instructionId_dictText'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '服务类别',
|
title: '服务类别',
|
||||||
align: "center",
|
align: "center",
|
||||||
|
|
|
@ -5,6 +5,14 @@
|
||||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
|
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
|
||||||
:wrapper-col="wrapperCol">
|
:wrapper-col="wrapperCol">
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item name="instructionId">
|
||||||
|
<template #label><span title="分类标签">分类标签</span></template>
|
||||||
|
<j-dict-select-tag type='list' v-model:value="queryParam.instructionId"
|
||||||
|
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
|
||||||
|
:ignoreDisabled="true" placeholder="请选择服务类别" allowClear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
<a-col :lg="6">
|
<a-col :lg="6">
|
||||||
<a-form-item name="categoryName">
|
<a-form-item name="categoryName">
|
||||||
<template #label><span title="服务类别">服务类别</span></template>
|
<template #label><span title="服务类别">服务类别</span></template>
|
||||||
|
@ -35,7 +43,7 @@
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
<!--引用表格-->
|
<!--引用表格-->
|
||||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
<BasicTable @register="registerTable">
|
||||||
<!--插槽:table标题-->
|
<!--插槽:table标题-->
|
||||||
<template #tableTitle>
|
<template #tableTitle>
|
||||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||||
|
@ -199,14 +207,6 @@ function getTableAction(record) {
|
||||||
label: '详情',
|
label: '详情',
|
||||||
onClick: handleDetail.bind(null, record),
|
onClick: handleDetail.bind(null, record),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: '删除',
|
|
||||||
popConfirm: {
|
|
||||||
title: '是否确认删除',
|
|
||||||
confirm: handleDelete.bind(null, record),
|
|
||||||
placement: 'topLeft',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,19 @@
|
||||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||||
name="ConfigServiceCategoryForm">
|
name="ConfigServiceCategoryForm">
|
||||||
<a-row>
|
<a-row>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="分类标签" v-bind="validateInfos.instructionId" id="ConfigServiceTypeForm-instructionId"
|
||||||
|
name="instructionId">
|
||||||
|
<j-dict-select-tag type='list' v-model:value="formData.instructionId"
|
||||||
|
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
|
||||||
|
placeholder="请选择分类标签" allowClear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="服务类别名称" v-bind="validateInfos.categoryName"
|
<a-form-item label="服务类别名称" v-bind="validateInfos.categoryName"
|
||||||
id="ConfigServiceCategoryForm-categoryName" name="categoryName">
|
id="ConfigServiceCategoryForm-categoryName" name="categoryName">
|
||||||
<a-input v-model:value="formData.categoryName" placeholder="请输入服务类别名称" allow-clear></a-input>
|
<a-input v-model:value="formData.categoryName" placeholder="请输入服务类别名称"
|
||||||
|
:disabled="!formData.instructionId" allow-clear></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
|
@ -52,6 +61,7 @@ const formData = reactive<Record<string, any>>({
|
||||||
categoryName: '',
|
categoryName: '',
|
||||||
sort: 99,
|
sort: 99,
|
||||||
izEnabled: '0',
|
izEnabled: '0',
|
||||||
|
instructionId: '',
|
||||||
});
|
});
|
||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||||
|
@ -59,8 +69,9 @@ const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||||
const confirmLoading = ref<boolean>(false);
|
const confirmLoading = ref<boolean>(false);
|
||||||
//表单验证
|
//表单验证
|
||||||
const validatorRules = reactive({
|
const validatorRules = reactive({
|
||||||
|
instructionId: [{ required: true, message: '请选择分类标签!' }],
|
||||||
categoryName: [{ required: true, message: '请输入服务类别名称!' },],
|
categoryName: [{ required: true, message: '请输入服务类别名称!' },],
|
||||||
sort: [{ required: true, message: '请输入排序!'}, { pattern: /^\d+$/, message: '请输入正整数!'},],
|
sort: [{ required: true, message: '请输入排序!' }, { pattern: /^\d+$/, message: '请输入正整数!' },],
|
||||||
izEnabled: [{ required: true, message: '请选择是否启用!' },],
|
izEnabled: [{ required: true, message: '请选择是否启用!' },],
|
||||||
});
|
});
|
||||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||||
|
|
|
@ -4,13 +4,16 @@ import { useMessage } from "/@/hooks/web/useMessage";
|
||||||
const { createConfirm } = useMessage();
|
const { createConfirm } = useMessage();
|
||||||
|
|
||||||
enum Api {
|
enum Api {
|
||||||
list = '/services/serviceDirective/configServiceDirective/list',
|
list = '/services/serviceDirective/list',
|
||||||
save='/services/serviceDirective/configServiceDirective/add',
|
save='/services/serviceDirective/add',
|
||||||
edit='/services/serviceDirective/configServiceDirective/edit',
|
edit='/services/serviceDirective/edit',
|
||||||
deleteOne = '/services/serviceDirective/configServiceDirective/delete',
|
deleteOne = '/services/serviceDirective/delete',
|
||||||
deleteBatch = '/services/serviceDirective/configServiceDirective/deleteBatch',
|
deleteBatch = '/services/serviceDirective/deleteBatch',
|
||||||
importExcel = '/services/serviceDirective/configServiceDirective/importExcel',
|
importExcel = '/services/serviceDirective/importExcel',
|
||||||
exportXls = '/services/serviceDirective/configServiceDirective/exportXls',
|
exportXls = '/services/serviceDirective/exportXls',
|
||||||
|
async = '/services/serviceDirective/async',
|
||||||
|
departList = '/sys/sysDepart/list',
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,6 +32,7 @@ export const getImportUrl = Api.importExcel;
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||||
|
export const departList = (params) => defHttp.get({ url: Api.departList, params });
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除单个
|
* 删除单个
|
||||||
|
@ -70,3 +74,11 @@ export const saveOrUpdate = (params, isUpdate) => {
|
||||||
let url = isUpdate ? Api.edit : Api.save;
|
let url = isUpdate ? Api.edit : Api.save;
|
||||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步数据
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const asyncFunc = (params) => {
|
||||||
|
return defHttp.post({ url: Api.async, params }, { isTransformResponse: false });
|
||||||
|
}
|
|
@ -1,4 +1,5 @@
|
||||||
import { BasicColumn } from '/@/components/Table';
|
import { BasicColumn } from '/@/components/Table';
|
||||||
|
import { render } from '/@/utils/common/renderUtils';
|
||||||
//列表数据
|
//列表数据
|
||||||
export const columns: BasicColumn[] = [
|
export const columns: BasicColumn[] = [
|
||||||
{
|
{
|
||||||
|
@ -106,14 +107,34 @@ export const columns: BasicColumn[] = [
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '预览图片',
|
title: '服务指令图片',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
dataIndex: 'previewFileMedia',
|
dataIndex: 'previewFile',
|
||||||
|
customRender: render.renderImage,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '即时指令图片',
|
title: '服务指令描述',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
dataIndex: 'immediateFileMedia',
|
dataIndex: 'serviceContent',
|
||||||
|
width: 200,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '指令音频文件',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'mp3File',
|
||||||
|
width: 120,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '指令视频文件',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'mp4File',
|
||||||
|
width: 120,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '即时指令图标',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'immediateFile',
|
||||||
|
customRender: render.renderImage,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -8,24 +8,27 @@
|
||||||
<a-col :lg="6">
|
<a-col :lg="6">
|
||||||
<a-form-item name="instructionTagId">
|
<a-form-item name="instructionTagId">
|
||||||
<template #label><span title="分类标签">分类标签</span></template>
|
<template #label><span title="分类标签">分类标签</span></template>
|
||||||
<j-dict-select-tag v-model:value="queryParam.instructionTagId" dictCode="instruction_tag"
|
<j-dict-select-tag v-model:value="queryParam.instructionTagId"
|
||||||
:ignoreDisabled="true" placeholder="请选分类标签" allowClear />
|
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
|
||||||
|
placeholder="请选择分类标签" allowClear :ignoreDisabled="true" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
<a-col :lg="6">
|
<a-col :lg="6">
|
||||||
<a-form-item name="categoryId">
|
<a-form-item name="categoryId">
|
||||||
<template #label><span title="服务类别">服务类别</span></template>
|
<template #label><span title="服务类别">服务类别</span></template>
|
||||||
<j-dict-select-tag type="list" v-model:value="queryParam.categoryId"
|
<j-dict-select-tag type="list" v-model:value="queryParam.categoryId"
|
||||||
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 order by sort asc`"
|
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 and instruction_id = '${queryParam.instructionTagId || ''}' order by sort asc`"
|
||||||
:ignoreDisabled="true" placeholder="请选择服务类别" allow-clear />
|
placeholder="请选择服务类别" allowClear :ignoreDisabled="true" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
<a-col :lg="6">
|
<a-col :lg="6">
|
||||||
<a-form-item name="typeId">
|
<a-form-item name="typeId">
|
||||||
<template #label><span title="服务类型">服务类型</span></template>
|
<template #label><span title="服务类型">服务类型</span></template>
|
||||||
<j-dict-select-tag type="list" v-model:value="queryParam.typeId"
|
<j-dict-select-tag type="list" v-model:value="queryParam.typeId"
|
||||||
:dictCode="`nu_config_service_type,type_name,id,del_flag = 0 and category_id = ${queryParam.categoryId || -1} order by sort asc`"
|
:dictCode="`nu_config_service_type,type_name,id,del_flag = 0 and category_id = '${queryParam.categoryId || ''}' order by sort asc`"
|
||||||
placeholder="请选择服务类型" :ignoreDisabled="true" allowClear />
|
placeholder="请选择服务类型" allowClear :ignoreDisabled="true" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :lg="6">
|
<a-col :lg="6">
|
||||||
|
@ -53,7 +56,7 @@
|
||||||
<a-col :lg="6">
|
<a-col :lg="6">
|
||||||
<a-form-item name="izEnabled">
|
<a-form-item name="izEnabled">
|
||||||
<template #label><span title="是否启用">是否启用</span></template>
|
<template #label><span title="是否启用">是否启用</span></template>
|
||||||
<j-dict-select-tag type='list' v-model:value="queryParam.izEnabled" dictCode="iz_enabled"
|
<j-dict-select-tag type='list' v-model:value="queryParam.izEnabled" dictCode="directive_status"
|
||||||
:ignoreDisabled="true" placeholder="请选择是否启用" allowClear />
|
:ignoreDisabled="true" placeholder="请选择是否启用" allowClear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -73,29 +76,56 @@
|
||||||
<BasicTable @register="registerTable">
|
<BasicTable @register="registerTable">
|
||||||
<!--插槽:table标题-->
|
<!--插槽:table标题-->
|
||||||
<template #tableTitle>
|
<template #tableTitle>
|
||||||
<a-button type="primary" class="btnPrivate" v-auth="'serviceDirective:config_service_directive:add'"
|
<a-button type="primary" class="btnPrivate" @click="handleinstructionTag"
|
||||||
@click="handleCategory" preIcon="tabler:settings">配置服务类别</a-button>
|
preIcon="tabler:settings">配置分类标签</a-button>
|
||||||
<a-button type="primary" class="btnPrivate" v-auth="'serviceDirective:config_service_directive:add'"
|
<a-button type="primary" class="btnPrivate" @click="handleCategory" preIcon="tabler:settings">配置服务类别</a-button>
|
||||||
@click="handleType" preIcon="tabler:settings">配置服务类型</a-button>
|
<a-button type="primary" class="btnPrivate" @click="handleType" preIcon="tabler:settings">配置服务类型</a-button>
|
||||||
<a-button type="primary" class="btnPrivate" v-auth="'serviceDirective:config_service_directive:add'"
|
<a-button type="primary" class="btnPrivate" @click="handleBodyTag" preIcon="tabler:settings">配置体型标签</a-button>
|
||||||
@click="handleBodyTag" preIcon="tabler:settings">配置体型标签</a-button>
|
<a-button type="primary" class="btnPrivate" @click="handleEmotionTag"
|
||||||
<a-button type="primary" class="btnPrivate" v-auth="'serviceDirective:config_service_directive:add'"
|
preIcon="tabler:settings">配置情绪标签</a-button>
|
||||||
@click="handleEmotionTag" preIcon="tabler:settings">配置情绪标签</a-button>
|
<a-button type="primary" class="btnPrivate" @click="handleAdd"
|
||||||
<a-button type="primary" class="btnPrivate" v-auth="'serviceDirective:config_service_directive:add'"
|
preIcon="ant-design:plus-outlined">新增服务指令</a-button>
|
||||||
@click="handleAdd" preIcon="ant-design:plus-outlined">新增服务指令</a-button>
|
|
||||||
</template>
|
</template>
|
||||||
<!--操作栏-->
|
<!--操作栏-->
|
||||||
<template #action="{ record }">
|
<template #action="{ record }">
|
||||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
<template v-if="column.dataIndex === 'previewFileMedia'">
|
<!-- 音频播放控制 -->
|
||||||
|
<template v-if="column.dataIndex === 'mp3File'">
|
||||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||||
<img v-else :src="sysUrlValue + text" style="max-height: 50px;max-width: 80px;">
|
<a-button v-else type="link" class="btnPrivate" @click="openAudioModal(text)">播放</a-button>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'immediateFileMedia'">
|
<!-- <template v-if="column.dataIndex === 'mp3File'">
|
||||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||||
<img v-else :src="sysUrlValue + text" style="max-height: 50px;max-width: 80px;">
|
<div v-else style="display: flex; align-items: center; gap: 8px;">
|
||||||
|
<audio ref="audioPlayer" :src="getFileAccessHttpUrl(text)" hidden></audio>
|
||||||
|
<a-button v-if="!currentPlayingAudio || currentPlayingAudio !== text" type="link" @click="playAudio(text)"
|
||||||
|
preIcon="ant-design:play-circle-outlined">
|
||||||
|
播放
|
||||||
|
</a-button>
|
||||||
|
|
||||||
|
<template v-else>
|
||||||
|
<a-button v-if="isPlaying" type="link" @click="pauseAudio" preIcon="ant-design:pause-circle-outlined">
|
||||||
|
暂停
|
||||||
|
</a-button>
|
||||||
|
<a-button v-else type="link" @click="resumeAudio" preIcon="ant-design:play-circle-outlined">
|
||||||
|
播放
|
||||||
|
</a-button>
|
||||||
|
|
||||||
|
<a-button type="link" @click="restartAudio" preIcon="ant-design:reload-outlined">
|
||||||
|
重播
|
||||||
|
</a-button>
|
||||||
|
|
||||||
|
<a-button type="link" @click="stopAudio" preIcon="ant-design:stop-outlined">
|
||||||
|
停止
|
||||||
|
</a-button>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</template> -->
|
||||||
|
<template v-if="column.dataIndex === 'mp4File'">
|
||||||
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||||
|
<a-button v-else type="link" class="btnPrivate" @click="openVideoModal(text)">播放</a-button>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'bodyTagList'">
|
<template v-if="column.dataIndex === 'bodyTagList'">
|
||||||
<span :title="text.map((item) => item.tagName).join('、')">{{text.map((item) =>
|
<span :title="text.map((item) => item.tagName).join('、')">{{text.map((item) =>
|
||||||
|
@ -108,10 +138,18 @@
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<ConfigServiceDirectiveModal :sysUrlValue="sysUrlValue" ref="registerModal" @success="handleSuccess">
|
<ConfigServiceDirectiveModal ref="registerModal" @success="handleSuccess">
|
||||||
</ConfigServiceDirectiveModal>
|
</ConfigServiceDirectiveModal>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 分类标签 -->
|
||||||
|
<a-drawer title="分类标签" width="60vw" :open="insTagOpen" @close="onInsTagClose">
|
||||||
|
<template #footer>
|
||||||
|
<a-button type="primary" @click="onInsTagClose" style="float: right;">关闭</a-button>
|
||||||
|
</template>
|
||||||
|
<InstructionTag v-if="insTagOpen"></InstructionTag>
|
||||||
|
</a-drawer>
|
||||||
|
|
||||||
<!-- 服务类别 -->
|
<!-- 服务类别 -->
|
||||||
<a-drawer title="服务类别" width="60vw" :open="categoryOpen" @close="onCategoryClose">
|
<a-drawer title="服务类别" width="60vw" :open="categoryOpen" @close="onCategoryClose">
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
@ -144,6 +182,15 @@
|
||||||
<EmotionTagList v-if="emotionTagOpen"></EmotionTagList>
|
<EmotionTagList v-if="emotionTagOpen"></EmotionTagList>
|
||||||
</a-drawer>
|
</a-drawer>
|
||||||
|
|
||||||
|
<!-- 音频播放 -->
|
||||||
|
<a-modal v-model:visible="showAudioModal" title="音频播放" :footer="null" @cancel="closeAudioModal"
|
||||||
|
:bodyStyle="{ padding: '0', maxHeight: '80vh', overflow: 'auto' }" :keyboard="true">
|
||||||
|
<audio controls style="width: 100%; display: block; margin: 20px auto;">
|
||||||
|
<source :src="audioUrl">
|
||||||
|
您的浏览器不支持音频播放。
|
||||||
|
</audio>
|
||||||
|
</a-modal>
|
||||||
|
|
||||||
<!-- 视频播放 -->
|
<!-- 视频播放 -->
|
||||||
<a-modal v-model:visible="showVideoModal" title="视频播放" :footer="null" @cancel="closeVideoModal"
|
<a-modal v-model:visible="showVideoModal" title="视频播放" :footer="null" @cancel="closeVideoModal"
|
||||||
:bodyStyle="{ padding: '0', maxHeight: '80vh', overflow: 'auto' }">
|
:bodyStyle="{ padding: '0', maxHeight: '80vh', overflow: 'auto' }">
|
||||||
|
@ -155,7 +202,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" name="serviceDirective-configServiceDirective" setup>
|
<script lang="ts" name="serviceDirective-configServiceDirective" setup>
|
||||||
import { ref, reactive, onMounted } from 'vue';
|
import { ref, reactive, watch, onMounted } 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';
|
||||||
|
@ -166,15 +213,33 @@ import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
import { cloneDeep } from "lodash-es";
|
import { cloneDeep } from "lodash-es";
|
||||||
import ConfigServiceCategoryList from '../serviceCategory/ConfigServiceCategoryList.vue';
|
import ConfigServiceCategoryList from '../serviceCategory/ConfigServiceCategoryList.vue';
|
||||||
|
import InstructionTag from '../instructiontag/InstructionTag.vue';
|
||||||
import ConfigServiceTypeList from '../serviceType/ConfigServiceTypeList.vue';
|
import ConfigServiceTypeList from '../serviceType/ConfigServiceTypeList.vue';
|
||||||
import BodyTagList from '/@/views/services/directivetag/bodytag/BodyTagList.vue';
|
import BodyTagList from '/@/views/services/directivetag/bodytag/BodyTagList.vue';
|
||||||
import EmotionTagList from '/@/views/services/directivetag/emotiontag/EmotionTagList.vue';
|
import EmotionTagList from '/@/views/services/directivetag/emotiontag/EmotionTagList.vue';
|
||||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||||
import { sysUrl } from '/@/utils/sysBaseInfo/MediaManagePicker.api';
|
|
||||||
|
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const sysUrlValue = ref('')
|
const queryParam = reactive<any>({
|
||||||
const queryParam = reactive<any>({});
|
instructionTagId: '',
|
||||||
|
categoryId: '',
|
||||||
|
typeId: '',
|
||||||
|
});
|
||||||
|
watch(
|
||||||
|
() => queryParam.instructionTagId,
|
||||||
|
() => {
|
||||||
|
queryParam.categoryId = ''
|
||||||
|
queryParam.typeId = ''
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// 当服务类别变动,清空服务类型
|
||||||
|
watch(
|
||||||
|
() => queryParam.categoryId,
|
||||||
|
() => {
|
||||||
|
queryParam.typeId = ''
|
||||||
|
}
|
||||||
|
)
|
||||||
const toggleSearchStatus = ref<boolean>(false);
|
const toggleSearchStatus = ref<boolean>(false);
|
||||||
const registerModal = ref();
|
const registerModal = ref();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
@ -193,7 +258,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
pageSizeOptions: ['10', '20', '50', '100'],
|
pageSizeOptions: ['10', '20', '50', '100'],
|
||||||
},
|
},
|
||||||
actionColumn: {
|
actionColumn: {
|
||||||
width: 160,
|
width: 200,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
},
|
},
|
||||||
beforeFetch: async (params) => {
|
beforeFetch: async (params) => {
|
||||||
|
@ -228,6 +293,7 @@ const wrapperCol = reactive({
|
||||||
// 高级查询配置
|
// 高级查询配置
|
||||||
const superQueryConfig = reactive(superQuerySchema);
|
const superQueryConfig = reactive(superQuerySchema);
|
||||||
|
|
||||||
|
const insTagOpen = ref(false)//分类标签抽屉
|
||||||
const categoryOpen = ref(false)//服务类别抽屉
|
const categoryOpen = ref(false)//服务类别抽屉
|
||||||
const typeOpen = ref(false)//服务类型抽屉
|
const typeOpen = ref(false)//服务类型抽屉
|
||||||
const bodyTagOpen = ref(false)//体型标签抽屉
|
const bodyTagOpen = ref(false)//体型标签抽屉
|
||||||
|
@ -259,6 +325,14 @@ function handleEdit(record: Recordable) {
|
||||||
registerModal.value.edit(record);
|
registerModal.value.edit(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑指令资源
|
||||||
|
*/
|
||||||
|
function handleMedia(record: Recordable) {
|
||||||
|
registerModal.value.disableSubmit = false;
|
||||||
|
registerModal.value.editMedia(record);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 详情
|
* 详情
|
||||||
*/
|
*/
|
||||||
|
@ -294,21 +368,17 @@ function handleSuccess() {
|
||||||
function getTableAction(record) {
|
function getTableAction(record) {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
label: '编辑',
|
|
||||||
onClick: handleEdit.bind(null, record),
|
|
||||||
auth: 'serviceDirective:config_service_directive:edit'
|
|
||||||
}, {
|
|
||||||
label: '详情',
|
label: '详情',
|
||||||
onClick: handleDetail.bind(null, record),
|
onClick: handleDetail.bind(null, record),
|
||||||
}, {
|
},
|
||||||
label: '删除',
|
{
|
||||||
popConfirm: {
|
label: '编辑',
|
||||||
title: '是否确认删除',
|
onClick: handleEdit.bind(null, record)
|
||||||
confirm: handleDelete.bind(null, record),
|
},
|
||||||
placement: 'topLeft',
|
// {
|
||||||
},
|
// label: '指令资源',
|
||||||
auth: 'serviceDirective:config_service_directive:delete'
|
// onClick: handleMedia.bind(null, record)
|
||||||
}
|
// },
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -366,6 +436,10 @@ async function setRangeQuery() {
|
||||||
return queryParamClone;
|
return queryParamClone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//分类标签抽屉打开
|
||||||
|
function handleinstructionTag() {
|
||||||
|
insTagOpen.value = true
|
||||||
|
}
|
||||||
//服务类别抽屉打开
|
//服务类别抽屉打开
|
||||||
function handleCategory() {
|
function handleCategory() {
|
||||||
categoryOpen.value = true
|
categoryOpen.value = true
|
||||||
|
@ -382,11 +456,15 @@ function handleBodyTag() {
|
||||||
function handleEmotionTag() {
|
function handleEmotionTag() {
|
||||||
emotionTagOpen.value = true
|
emotionTagOpen.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//分类标签抽屉关闭
|
||||||
|
function onInsTagClose() {
|
||||||
|
insTagOpen.value = false
|
||||||
|
}
|
||||||
//服务类别抽屉关闭
|
//服务类别抽屉关闭
|
||||||
function onCategoryClose() {
|
function onCategoryClose() {
|
||||||
categoryOpen.value = false
|
categoryOpen.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
//服务类型抽屉关闭
|
//服务类型抽屉关闭
|
||||||
function onTypeClose() {
|
function onTypeClose() {
|
||||||
typeOpen.value = false
|
typeOpen.value = false
|
||||||
|
@ -400,6 +478,21 @@ function onEmotionTagClose() {
|
||||||
emotionTagOpen.value = false
|
emotionTagOpen.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const showAudioModal = ref(false); // 控制音频模态框显示
|
||||||
|
const audioUrl = ref(''); // 音频 URL
|
||||||
|
|
||||||
|
// 打开音频模态框
|
||||||
|
const openAudioModal = (url) => {
|
||||||
|
audioUrl.value = getFileAccessHttpUrl(url);
|
||||||
|
showAudioModal.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关闭音频模态框
|
||||||
|
const closeAudioModal = () => {
|
||||||
|
showAudioModal.value = false;
|
||||||
|
audioUrl.value = '';
|
||||||
|
};
|
||||||
|
|
||||||
const showVideoModal = ref(false); // 控制模态框显示
|
const showVideoModal = ref(false); // 控制模态框显示
|
||||||
const videoUrl = ref(''); // 视频 URL
|
const videoUrl = ref(''); // 视频 URL
|
||||||
|
|
||||||
|
@ -415,10 +508,77 @@ const closeVideoModal = () => {
|
||||||
videoUrl.value = '';
|
videoUrl.value = '';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 添加以下响应式变量
|
||||||
|
const audioPlayer = ref<HTMLAudioElement | null>(null);
|
||||||
|
const currentPlayingAudio = ref<string | null>(null);
|
||||||
|
const isPlaying = ref(false);
|
||||||
|
|
||||||
|
// 添加音频控制方法
|
||||||
|
const playAudio = (url: string) => {
|
||||||
|
if (currentPlayingAudio.value && currentPlayingAudio.value !== url) {
|
||||||
|
// 如果正在播放其他音频,先停止
|
||||||
|
stopAudio();
|
||||||
|
}
|
||||||
|
|
||||||
|
currentPlayingAudio.value = url;
|
||||||
|
isPlaying.value = true;
|
||||||
|
|
||||||
|
// 确保audio元素存在
|
||||||
|
if (audioPlayer.value) {
|
||||||
|
audioPlayer.value.src = getFileAccessHttpUrl(url);
|
||||||
|
audioPlayer.value.play().catch(e => {
|
||||||
|
console.error('播放失败:', e);
|
||||||
|
isPlaying.value = false;
|
||||||
|
currentPlayingAudio.value = null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const pauseAudio = () => {
|
||||||
|
if (audioPlayer.value) {
|
||||||
|
audioPlayer.value.pause();
|
||||||
|
isPlaying.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const resumeAudio = () => {
|
||||||
|
if (audioPlayer.value) {
|
||||||
|
audioPlayer.value.play().catch(e => {
|
||||||
|
console.error('继续播放失败:', e);
|
||||||
|
});
|
||||||
|
isPlaying.value = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const restartAudio = () => {
|
||||||
|
if (audioPlayer.value) {
|
||||||
|
audioPlayer.value.currentTime = 0;
|
||||||
|
audioPlayer.value.play().catch(e => {
|
||||||
|
console.error('重新播放失败:', e);
|
||||||
|
});
|
||||||
|
isPlaying.value = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const stopAudio = () => {
|
||||||
|
if (audioPlayer.value) {
|
||||||
|
audioPlayer.value.pause();
|
||||||
|
audioPlayer.value.currentTime = 0;
|
||||||
|
isPlaying.value = false;
|
||||||
|
currentPlayingAudio.value = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 添加音频结束监听
|
||||||
|
onMounted(() => {
|
||||||
|
if (audioPlayer.value) {
|
||||||
|
audioPlayer.value.addEventListener('ended', () => {
|
||||||
|
isPlaying.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
sysUrl().then(res => {
|
|
||||||
sysUrlValue.value = res.url
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -4,27 +4,28 @@
|
||||||
<template #detail>
|
<template #detail>
|
||||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||||
name="ConfigService2DirectiveForm">
|
name="ConfigService2DirectiveForm">
|
||||||
<a-row>
|
<a-row v-show="!isEditMedia">
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="分类标签" v-bind="validateInfos.instructionTagId"
|
<a-form-item label="分类标签" v-bind="validateInfos.instructionTagId"
|
||||||
id="ConfigServiceDirectiveForm-instructionTagId" name="instructionTagId">
|
id="ConfigServiceDirectiveForm-instructionTagId" name="instructionTagId">
|
||||||
<j-dict-select-tag v-model:value="formData.instructionTagId" dictCode="instruction_tag"
|
<j-dict-select-tag v-model:value="formData.instructionTagId"
|
||||||
placeholder="请选择分类标签" allowClear />
|
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
|
||||||
|
placeholder="请选择分类标签" allowClear @upDictCode="upInstructionDictCode" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="ConfigServiceDirectiveForm-categoryId"
|
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="ConfigServiceDirectiveForm-categoryId"
|
||||||
name="categoryId">
|
name="categoryId">
|
||||||
<j-dict-select-tag type="list" v-model:value="formData.categoryId"
|
<j-dict-select-tag type="list" v-model:value="formData.categoryId"
|
||||||
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 order by sort asc`"
|
:disabled="!formData.instructionTagId" :dictCode="categoryDictCode" placeholder="请选择服务类别" allow-clear
|
||||||
placeholder="请选择服务类别" allow-clear />
|
@upDictCode="upCategoryDictCode" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="服务类型" v-bind="validateInfos.typeId" id="ConfigServiceDirectiveForm-typeId"
|
<a-form-item label="服务类型" v-bind="validateInfos.typeId" id="ConfigServiceDirectiveForm-typeId"
|
||||||
name="typeId">
|
name="typeId">
|
||||||
<j-dict-select-tag type="list" v-model:value="formData.typeId" :dictCode="typeDictCode"
|
<j-dict-select-tag type="list" v-model:value="formData.typeId" :dictCode="typeDictCode"
|
||||||
placeholder="请选择服务类型" allowClear />
|
:disabled="!formData.categoryId" placeholder="请选择服务类型" allowClear @upDictCode="upTypeDictCode" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
|
@ -65,7 +66,7 @@
|
||||||
<a-form-item label="周期类型" v-bind="validateInfos.cycleType" id="ConfigServiceDirectiveForm-cycleType"
|
<a-form-item label="周期类型" v-bind="validateInfos.cycleType" id="ConfigServiceDirectiveForm-cycleType"
|
||||||
name="cycleType">
|
name="cycleType">
|
||||||
<j-dict-select-tag type="list" v-model:value="formData.cycleType" dictCode="period_type"
|
<j-dict-select-tag type="list" v-model:value="formData.cycleType" dictCode="period_type"
|
||||||
placeholder="请选择周期类型" allowClear />
|
placeholder="请选择周期类型" allowClear @upDictCode="upCycleTypeDictCode" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
|
@ -75,14 +76,8 @@
|
||||||
placeholder="请输入服务时长(分钟)" allow-clear />
|
placeholder="请输入服务时长(分钟)" allow-clear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
|
||||||
<a-form-item label="服务说明" v-bind="validateInfos.serviceContent"
|
|
||||||
id="ConfigServiceDirectiveForm-serviceContent" name="serviceContent">
|
|
||||||
<a-textarea v-model:value="formData.serviceContent" :rows="2" placeholder="请输入服务说明" />
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row>
|
<a-row v-show="!isEditMedia">
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="体型标签" id="ConfigServiceDirectiveForm-typeId" :labelCol="labelCol2"
|
<a-form-item label="体型标签" id="ConfigServiceDirectiveForm-typeId" :labelCol="labelCol2"
|
||||||
:wrapperCol="wrapperCol2" name="typeId">
|
:wrapperCol="wrapperCol2" name="typeId">
|
||||||
|
@ -99,91 +94,84 @@
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="ConfigServiceDirectiveForm-izEnabled"
|
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="ConfigServiceDirectiveForm-izEnabled"
|
||||||
name="izEnabled">
|
name="izEnabled">
|
||||||
<j-dict-select-tag type='radio' v-model:value="formData.izEnabled" dictCode="iz_enabled"
|
<span v-if="formData.izEnabled == 2">未授权</span>
|
||||||
|
<j-dict-select-tag v-else type='radio' v-model:value="formData.izEnabled" dictCode="iz_enabled"
|
||||||
placeholder="请选择是否启用" allowClear />
|
placeholder="请选择是否启用" allowClear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row>
|
<a-row v-if="formData.izEnabled == 0 || formData.izEnabled == 1">
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="预览图片" v-bind="validateInfos.previewFile">
|
<a-form-item label="服务指令图片" v-bind="validateInfos.previewFile">
|
||||||
<a-button @click="showResourcePicker('previewFile', { maxSelect: 1, fileType: 'image' })" type="link"
|
<span v-if="!formData.previewFile">无文件</span>
|
||||||
size="small">选取图片</a-button>
|
<JImageUpload v-else :fileMax="1" v-model:value="formData.previewFile" disabled
|
||||||
<!-- <JImageUpload :fileMax="1" v-model:value="formData.previewFileMedia"
|
:bizPath="directiveBizPath">
|
||||||
@change="formData.previewFileChanged = true">
|
</JImageUpload>
|
||||||
</JImageUpload> -->
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="即时指令图片" v-bind="validateInfos.immediateFile">
|
<a-form-item label="服务指令描述" v-bind="validateInfos.serviceContent"
|
||||||
<a-button @click="showResourcePicker('immediateFile', { maxSelect: 1, fileType: 'image' })" type="link"
|
id="ConfigServiceDirectiveForm-serviceContent" name="serviceContent">
|
||||||
size="small">选取图片</a-button>
|
<span v-if="!formData.serviceContent">暂无描述</span>
|
||||||
<!-- <JImageUpload :fileMax="1" v-model:value="formData.immediateFileMedia"
|
<a-textarea v-else v-model:value="formData.serviceContent" :rows="2" disabled />
|
||||||
@change="formData.immediateFileChanged = true">
|
|
||||||
</JImageUpload> -->
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row>
|
<!-- <a-row v-if="formData.izEnabled == 0 || formData.izEnabled == 1">
|
||||||
<a-col :span="12" v-if="!!formData.previewFile">
|
|
||||||
<a-form-item label="预览图片" id="ConfigServiceDirectiveForm-previewFile">
|
|
||||||
<img :src="sysUrlValue + formData.previewFileMedia" style="max-width: 100px; max-height: 100px;" />
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="12" v-if="!!formData.immediateFile" :push="!!formData.previewFile ? 0 : 12">
|
|
||||||
<a-form-item label="即时指令图片" id="ConfigServiceDirectiveForm-immediateFile">
|
|
||||||
<img :src="sysUrlValue + formData.immediateFileMedia" style="max-width: 100px; max-height: 100px;" />
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
<a-row>
|
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="语音文件" v-bind="validateInfos.mp3File" id="ConfigServiceDirectiveForm-mp3File">
|
<a-form-item label="指令音频文件" v-bind="validateInfos.mp3File" id="ConfigServiceDirectiveForm-mp3File">
|
||||||
<a-button @click="showResourcePicker('mp3File', { maxSelect: 1, fileType: 'audio' })" type="link"
|
<span v-if="!formData.mp3File">无文件</span>
|
||||||
size="small">选取文件</a-button>
|
<j-upload v-else v-model:value="formData.mp3File" accept=".mp3" :maxCount="1" disabled
|
||||||
<!-- <j-upload v-model:value="formData.mp3FileMedia" accept=".mp3" :maxCount="1"
|
:bizPath="directiveBizPath"></j-upload>
|
||||||
@change="formData.mp3FileChanged = true"></j-upload> -->
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="视频文件" v-bind="validateInfos.mp4File" id="ConfigServiceDirectiveForm-mp4File">
|
<a-form-item label="指令视频文件" v-bind="validateInfos.mp4File" id="ConfigServiceDirectiveForm-mp4File">
|
||||||
<a-button @click="showResourcePicker('mp4File', { maxSelect: 1, fileType: 'video' })" type="link"
|
<span v-if="!formData.mp4File">无文件</span>
|
||||||
size="small">选取文件</a-button>
|
<j-upload v-else v-model:value="formData.mp4File" accept=".mp4" :maxCount="1" disabled
|
||||||
<!-- <j-upload v-model:value="formData.mp4FileMedia" accept=".mp4" :maxCount="1"
|
:bizPath="directiveBizPath"></j-upload>
|
||||||
@change="formData.mp4FileChanged = true"></j-upload> -->
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
<a-row>
|
||||||
|
</a-row>
|
||||||
|
</a-row> -->
|
||||||
</a-form>
|
</a-form>
|
||||||
</template>
|
</template>
|
||||||
</JFormContainer>
|
</JFormContainer>
|
||||||
<JFormContainer>
|
<JFormContainer v-if="formData.izEnabled == 0 || formData.izEnabled == 1">
|
||||||
<template #detail>
|
<template #detail>
|
||||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||||
name="ConfigServiceDirectiveForm">
|
name="ConfigServiceDirectiveForm">
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="12" v-if="!!formData.mp3File">
|
<a-col :span="12">
|
||||||
<a-form-item label="语音预览" id="ConfigServiceDirectiveForm-mp3File">
|
<a-form-item label="指令音频文件" id="ConfigServiceDirectiveForm-mp3File">
|
||||||
<audio controls disabled="false">
|
<span v-if="!formData.mp3File">无文件</span>
|
||||||
<source :src="sysUrlValue + formData.mp3FileMedia">
|
<audio v-else controls disabled="false">
|
||||||
|
<source :src="getFileAccessHttpUrl(formData.mp3File)">
|
||||||
</audio>
|
</audio>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12" v-if="!!formData.mp4File" :push="!!formData.mp3File ? 0 : 12">
|
<a-col :span="12">
|
||||||
<a-form-item label="视频预览" id="ConfigServiceDirectiveForm-mp4File">
|
<a-form-item label="指令视频文件" id="ConfigServiceDirectiveForm-mp4File">
|
||||||
<video controls>
|
<span v-if="!formData.mp4File">无文件</span>
|
||||||
<source :src="sysUrlValue + formData.mp4FileMedia">
|
<video v-else controls>
|
||||||
|
<source :src="getFileAccessHttpUrl(formData.mp4File)">
|
||||||
</video>
|
</video>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="即时指令图标" v-bind="validateInfos.immediateFile">
|
||||||
|
<span v-if="!formData.immediateFile">无文件</span>
|
||||||
|
<JImageUpload v-else :fileMax="1" v-model:value="formData.immediateFile" disabled
|
||||||
|
:bizPath="directiveBizPath">
|
||||||
|
</JImageUpload>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
</template>
|
</template>
|
||||||
</JFormContainer>
|
</JFormContainer>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
|
|
||||||
<MediaResourcePicker :maxSelect="mediaParams.maxSelect" :fileType="mediaParams.fileType"
|
|
||||||
v-model:visible="pickerVisible" @confirm="handleResourceSelected" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
@ -199,30 +187,13 @@ import { saveOrUpdate } from '../ConfigServiceDirective.api';
|
||||||
import { Form } from 'ant-design-vue';
|
import { Form } from 'ant-design-vue';
|
||||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||||
import MediaResourcePicker from '/@/utils/midiaManage/MediaResourcePicker.vue';
|
|
||||||
|
|
||||||
const handleUploadSuccess = (res) => {
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
formDisabled: { type: Boolean, default: false },
|
formDisabled: { type: Boolean, default: false },
|
||||||
formData: { type: Object, default: () => ({}) },
|
formData: { type: Object, default: () => ({}) },
|
||||||
formBpm: { type: Boolean, default: true },
|
formBpm: { type: Boolean, default: true },
|
||||||
sysUrlValue: { type: String, default: '' },
|
|
||||||
});
|
});
|
||||||
const pickerVisible = ref(false);
|
|
||||||
const mediaParams = ref({ maxSelect: 1, fileType: 'any' })
|
|
||||||
const changedMediaObjStr = ref('')
|
|
||||||
const showResourcePicker = (obj, param) => {
|
|
||||||
changedMediaObjStr.value = obj
|
|
||||||
mediaParams.value = param
|
|
||||||
pickerVisible.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleResourceSelected = (selectedResource) => {
|
|
||||||
formData[changedMediaObjStr.value] = selectedResource.id
|
|
||||||
formData[changedMediaObjStr.value + 'Media'] = selectedResource.filePath
|
|
||||||
};
|
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const useForm = Form.useForm;
|
const useForm = Form.useForm;
|
||||||
const emit = defineEmits(['register', 'ok']);
|
const emit = defineEmits(['register', 'ok']);
|
||||||
|
@ -241,7 +212,7 @@ const formData = reactive<Record<string, any>>({
|
||||||
sort: 99,
|
sort: 99,
|
||||||
serviceContent: '',
|
serviceContent: '',
|
||||||
serviceDuration: '5',
|
serviceDuration: '5',
|
||||||
izEnabled: '0',
|
izEnabled: '2',
|
||||||
createBy: '',
|
createBy: '',
|
||||||
createTime: '',
|
createTime: '',
|
||||||
updateBy: '',
|
updateBy: '',
|
||||||
|
@ -250,10 +221,6 @@ const formData = reactive<Record<string, any>>({
|
||||||
mp4File: '',
|
mp4File: '',
|
||||||
previewFile: '',
|
previewFile: '',
|
||||||
immediateFile: '',
|
immediateFile: '',
|
||||||
mp3FileMedia: '',
|
|
||||||
mp4FileMedia: '',
|
|
||||||
previewFileMedia: '',
|
|
||||||
immediateFileMedia: '',
|
|
||||||
});
|
});
|
||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 6 } });
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 6 } });
|
||||||
|
@ -261,6 +228,7 @@ const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||||
const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 3 } });
|
const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 3 } });
|
||||||
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 20 } });
|
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 20 } });
|
||||||
const confirmLoading = ref<boolean>(false);
|
const confirmLoading = ref<boolean>(false);
|
||||||
|
const isEditMedia = ref(false)
|
||||||
//表单验证
|
//表单验证
|
||||||
const validatorRules = reactive({
|
const validatorRules = reactive({
|
||||||
categoryId: [{ required: true, message: '请选择服务类别!' },],
|
categoryId: [{ required: true, message: '请选择服务类别!' },],
|
||||||
|
@ -308,20 +276,81 @@ const disabled = computed(() => {
|
||||||
}
|
}
|
||||||
return props.formDisabled;
|
return props.formDisabled;
|
||||||
});
|
});
|
||||||
|
const categoryDictCode = ref('')
|
||||||
const typeDictCode = ref('')
|
const typeDictCode = ref('')
|
||||||
|
// 计算属性:是否可以上传预览图片
|
||||||
|
const canUploadPreviewImage = computed(() => {
|
||||||
|
return formData.instructionTagId &&
|
||||||
|
formData.categoryId &&
|
||||||
|
formData.typeId &&
|
||||||
|
formData.directiveName &&
|
||||||
|
formData.cycleType;
|
||||||
|
});
|
||||||
|
|
||||||
|
//分类标签名称
|
||||||
|
const instructionComDictCode = ref([])
|
||||||
|
function upInstructionDictCode(v_) {
|
||||||
|
instructionComDictCode.value = v_
|
||||||
|
}
|
||||||
|
//服务类别名称
|
||||||
|
const categoryComDictCode = ref([])
|
||||||
|
function upCategoryDictCode(v_) {
|
||||||
|
categoryComDictCode.value = v_
|
||||||
|
|
||||||
|
}
|
||||||
|
//服务类型名称
|
||||||
|
const typeComDictCode = ref([])
|
||||||
|
function upTypeDictCode(v_) {
|
||||||
|
typeComDictCode.value = v_
|
||||||
|
|
||||||
|
}
|
||||||
|
//周期类型名称
|
||||||
|
const cycleTypeComDictCode = ref([])
|
||||||
|
function upCycleTypeDictCode(v_) {
|
||||||
|
cycleTypeComDictCode.value = v_
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
watch([instructionComDictCode, categoryComDictCode, typeComDictCode, cycleTypeComDictCode], () => {
|
||||||
|
// 当这些字典数据变化时,强制重新计算 directiveBizPath
|
||||||
|
}, { deep: true });
|
||||||
|
|
||||||
|
const directiveBizPath = computed(() => {
|
||||||
|
if (!canUploadPreviewImage.value) return '';
|
||||||
|
|
||||||
|
// 获取各个字段的字典值
|
||||||
|
const instructionTagName_ = instructionComDictCode.value.filter(d => d.value == formData.instructionTagId)?.[0]?.label;
|
||||||
|
const categoryName_ = categoryComDictCode.value.filter(d => d.value == formData.categoryId)?.[0]?.label;
|
||||||
|
const typeName_ = typeComDictCode.value.filter(d => d.value == formData.typeId)?.[0]?.label;
|
||||||
|
const cycleTypeName_ = cycleTypeComDictCode.value.filter(d => d.value == formData.cycleType)?.[0]?.label;
|
||||||
|
|
||||||
|
// 构建路径
|
||||||
|
return 'directive/' + `${instructionTagName_}/${categoryName_}/${typeName_}/${formData.directiveName}/${cycleTypeName_}`;
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => formData.instructionTagId,
|
||||||
|
(newInstructionTagId) => {
|
||||||
|
if (!newInstructionTagId) {
|
||||||
|
formData.categoryId = ''
|
||||||
|
formData.typeId = ''
|
||||||
|
categoryDictCode.value = 'nu_config_service_category,category_name,id,1=2';
|
||||||
|
} else {
|
||||||
|
categoryDictCode.value = `nu_config_service_category,category_name,id,del_flag = 0 and instruction_id = '${newInstructionTagId}' order by sort asc`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
watch(
|
watch(
|
||||||
() => formData.categoryId,
|
() => formData.categoryId,
|
||||||
(newCategoryId) => {
|
(newCategoryId) => {
|
||||||
if (!newCategoryId) {
|
if (!newCategoryId) {
|
||||||
formData.typeId = '';
|
formData.typeId = ''
|
||||||
typeDictCode.value = 'nu_config_service_type,type_name,id,del_flag = 99 order by sort asc';
|
typeDictCode.value = 'nu_config_service_type,type_name,id,del_flag = 99 order by sort asc';
|
||||||
} else {
|
} else {
|
||||||
typeDictCode.value = `nu_config_service_type,type_name,id,del_flag = 0 and category_id = '${newCategoryId}' order by sort asc`;
|
typeDictCode.value = `nu_config_service_type,type_name,id,del_flag = 0 and category_id = '${newCategoryId}' order by sort asc`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
|
@ -331,8 +360,10 @@ function add() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
|
* isEditMedia_是否为编辑指令资源 (隐藏业务字段)
|
||||||
*/
|
*/
|
||||||
function edit(record) {
|
function edit(record, isEditMedia_ = false) {
|
||||||
|
isEditMedia.value = isEditMedia_
|
||||||
formData.bodyTags = ''
|
formData.bodyTags = ''
|
||||||
formData.emotionTags = ''
|
formData.emotionTags = ''
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
|
@ -390,6 +421,9 @@ async function submitForm() {
|
||||||
retrun;
|
retrun;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
model.mediaFileSavePath = directiveBizPath
|
||||||
|
|
||||||
await saveOrUpdate(model, isUpdate.value)
|
await saveOrUpdate(model, isUpdate.value)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|
|
@ -1,80 +1,95 @@
|
||||||
<template>
|
<template>
|
||||||
<j-modal :title="title" width="70vw" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭" :maskClosable="false">
|
<j-modal :title="title" width="70vw" :visible="visible" @ok="handleOk"
|
||||||
<ConfigServiceDirectiveForm ref="registerForm" v-if="visible" @ok="submitCallback" :sysUrlValue="sysUrlValue" :formDisabled="disableSubmit" :formBpm="false"></ConfigServiceDirectiveForm>
|
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭"
|
||||||
|
:maskClosable="false">
|
||||||
|
<ConfigServiceDirectiveForm ref="registerForm" v-if="visible" @ok="submitCallback" :formDisabled="disableSubmit"
|
||||||
|
:formBpm="false"></ConfigServiceDirectiveForm>
|
||||||
</j-modal>
|
</j-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, nextTick, defineExpose , defineProps} from 'vue';
|
import { ref, nextTick, defineExpose, defineProps } from 'vue';
|
||||||
import ConfigServiceDirectiveForm from './ConfigServiceDirectiveForm.vue'
|
import ConfigServiceDirectiveForm from './ConfigServiceDirectiveForm.vue'
|
||||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
sysUrlValue: { type: String, default: '' },
|
});
|
||||||
|
const title = ref<string>('');
|
||||||
|
const visible = ref<boolean>(false);
|
||||||
|
const disableSubmit = ref<boolean>(false);
|
||||||
|
const registerForm = ref();
|
||||||
|
const emit = defineEmits(['register', 'success']);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
function add() {
|
||||||
|
title.value = '新增';
|
||||||
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
registerForm.value.add();
|
||||||
});
|
});
|
||||||
const title = ref<string>('');
|
}
|
||||||
const visible = ref<boolean>(false);
|
|
||||||
const disableSubmit = ref<boolean>(false);
|
|
||||||
const registerForm = ref();
|
|
||||||
const emit = defineEmits(['register', 'success']);
|
|
||||||
|
|
||||||
|
/**
|
||||||
/**
|
* 编辑
|
||||||
* 新增
|
* @param record
|
||||||
*/
|
*/
|
||||||
function add() {
|
function edit(record) {
|
||||||
title.value = '新增';
|
title.value = disableSubmit.value ? '详情' : '编辑';
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
registerForm.value.add();
|
registerForm.value.edit(record);
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
* @param record
|
|
||||||
*/
|
|
||||||
function edit(record) {
|
|
||||||
title.value = disableSubmit.value ? '详情' : '编辑';
|
|
||||||
visible.value = true;
|
|
||||||
nextTick(() => {
|
|
||||||
registerForm.value.edit(record);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 确定按钮点击事件
|
|
||||||
*/
|
|
||||||
function handleOk() {
|
|
||||||
registerForm.value.submitForm();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* form保存回调事件
|
|
||||||
*/
|
|
||||||
function submitCallback() {
|
|
||||||
handleCancel();
|
|
||||||
emit('success');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 取消按钮回调事件
|
|
||||||
*/
|
|
||||||
function handleCancel() {
|
|
||||||
visible.value = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
add,
|
|
||||||
edit,
|
|
||||||
disableSubmit,
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑指令资源
|
||||||
|
* @param record
|
||||||
|
*/
|
||||||
|
function editMedia(record) {
|
||||||
|
title.value = '编辑指令资源';
|
||||||
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
registerForm.value.edit(record,true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确定按钮点击事件
|
||||||
|
*/
|
||||||
|
function handleOk() {
|
||||||
|
registerForm.value.submitForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* form保存回调事件
|
||||||
|
*/
|
||||||
|
function submitCallback() {
|
||||||
|
handleCancel();
|
||||||
|
emit('success');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消按钮回调事件
|
||||||
|
*/
|
||||||
|
function handleCancel() {
|
||||||
|
visible.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
add,
|
||||||
|
edit,
|
||||||
|
editMedia,
|
||||||
|
disableSubmit,
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
/**隐藏样式-modal确定按钮 */
|
/**隐藏样式-modal确定按钮 */
|
||||||
.jee-hidden {
|
.jee-hidden {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style lang="less" scoped></style>
|
<style lang="less" scoped></style>
|
||||||
|
|
|
@ -5,6 +5,11 @@ import { render } from '/@/utils/common/renderUtils';
|
||||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||||
//列表数据
|
//列表数据
|
||||||
export const columns: BasicColumn[] = [
|
export const columns: BasicColumn[] = [
|
||||||
|
{
|
||||||
|
title: '分类标签',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'instructionId_dictText'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '服务类别',
|
title: '服务类别',
|
||||||
align: "center",
|
align: "center",
|
||||||
|
|
|
@ -5,11 +5,17 @@
|
||||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
|
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
|
||||||
:wrapper-col="wrapperCol">
|
:wrapper-col="wrapperCol">
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item name="instructionId">
|
||||||
|
<template #label><span title="分类标签">分类标签</span></template>
|
||||||
|
<j-dict-select-tag type='list' v-model:value="queryParam.instructionId" :dictCode="instructionDictCode"
|
||||||
|
:ignoreDisabled="true" placeholder="请选择分类标签" allowClear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
<a-col :lg="6">
|
<a-col :lg="6">
|
||||||
<a-form-item name="categoryId">
|
<a-form-item name="categoryId">
|
||||||
<template #label><span title="服务类别">服务类别</span></template>
|
<template #label><span title="服务类别">服务类别</span></template>
|
||||||
<j-dict-select-tag type='list' v-model:value="queryParam.categoryId"
|
<j-dict-select-tag type='list' v-model:value="queryParam.categoryId" :dictCode="categoryDictCode"
|
||||||
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 order by sort asc`"
|
|
||||||
:ignoreDisabled="true" placeholder="请选择服务类别" allowClear />
|
:ignoreDisabled="true" placeholder="请选择服务类别" allowClear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -34,10 +40,6 @@
|
||||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
|
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
|
||||||
style="margin-left: 8px">重置</a-button>
|
style="margin-left: 8px">重置</a-button>
|
||||||
<!-- <a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
|
|
||||||
{{ toggleSearchStatus ? '收起' : '展开' }}
|
|
||||||
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
|
|
||||||
</a> -->
|
|
||||||
</a-col>
|
</a-col>
|
||||||
</span>
|
</span>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -45,12 +47,10 @@
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
<!--引用表格-->
|
<!--引用表格-->
|
||||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
<BasicTable @register="registerTable">
|
||||||
<!--插槽:table标题-->
|
<!--插槽:table标题-->
|
||||||
<template #tableTitle>
|
<template #tableTitle>
|
||||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||||
<!-- <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
|
||||||
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> -->
|
|
||||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||||
<template #overlay>
|
<template #overlay>
|
||||||
<a-menu>
|
<a-menu>
|
||||||
|
@ -64,8 +64,6 @@
|
||||||
<Icon icon="mdi:chevron-down"></Icon>
|
<Icon icon="mdi:chevron-down"></Icon>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
<!-- 高级查询 -->
|
|
||||||
<!-- <super-query :config="superQueryConfig" @search="handleSuperQuery" /> -->
|
|
||||||
</template>
|
</template>
|
||||||
<!--操作栏-->
|
<!--操作栏-->
|
||||||
<template #action="{ record }">
|
<template #action="{ record }">
|
||||||
|
@ -80,16 +78,16 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" name="ServiceType-configServiceType" setup>
|
<script lang="ts" name="ServiceType-configServiceType" setup>
|
||||||
import { ref, reactive } from 'vue';
|
import { ref, reactive, computed, watch } from 'vue';
|
||||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
import { columns, superQuerySchema } from './ConfigServiceType.data';
|
import { columns, superQuerySchema } from './ConfigServiceType.data';
|
||||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ConfigServiceType.api';
|
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ConfigServiceType.api';
|
||||||
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
import ConfigServiceTypeModal from './components/ConfigServiceTypeModal.vue'
|
import ConfigServiceTypeModal from './components/ConfigServiceTypeModal.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";
|
||||||
import { Avatar } from 'ant-design-vue';
|
|
||||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
|
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
|
@ -97,6 +95,7 @@ const queryParam = reactive<any>({});
|
||||||
const toggleSearchStatus = ref<boolean>(false);
|
const toggleSearchStatus = ref<boolean>(false);
|
||||||
const registerModal = ref();
|
const registerModal = ref();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
|
||||||
//注册table数据
|
//注册table数据
|
||||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
tableProps: {
|
tableProps: {
|
||||||
|
@ -139,8 +138,19 @@ const wrapperCol = reactive({
|
||||||
xxl: 16
|
xxl: 16
|
||||||
});
|
});
|
||||||
|
|
||||||
// 高级查询配置
|
// 计算 dictCode
|
||||||
const superQueryConfig = reactive(superQuerySchema);
|
const instructionDictCode = 'nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc';
|
||||||
|
const categoryDictCode = computed(() => {
|
||||||
|
if (!queryParam.instructionId) {
|
||||||
|
return 'nu_config_service_category,category_name,id,del_flag = 0';
|
||||||
|
}
|
||||||
|
return `nu_config_service_category,category_name,id,del_flag = 0 and instruction_id = ${queryParam.instructionId} order by sort asc`;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 监听 instructionId 变化,清空二级
|
||||||
|
watch(() => queryParam.instructionId, async (newIns) => {
|
||||||
|
queryParam.categoryId = '';
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 高级查询事件
|
* 高级查询事件
|
||||||
|
@ -208,13 +218,6 @@ function getTableAction(record) {
|
||||||
}, {
|
}, {
|
||||||
label: '详情',
|
label: '详情',
|
||||||
onClick: handleDetail.bind(null, record),
|
onClick: handleDetail.bind(null, record),
|
||||||
}, {
|
|
||||||
label: '删除',
|
|
||||||
popConfirm: {
|
|
||||||
title: '是否确认删除',
|
|
||||||
confirm: handleDelete.bind(null, record),
|
|
||||||
placement: 'topLeft',
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -245,8 +248,6 @@ function searchReset() {
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|
|
@ -5,18 +5,26 @@
|
||||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||||
name="ConfigServiceTypeForm">
|
name="ConfigServiceTypeForm">
|
||||||
<a-row>
|
<a-row>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="分类标签" v-bind="validateInfos.instructionId" id="ConfigServiceTypeForm-instructionId"
|
||||||
|
name="instructionId">
|
||||||
|
<j-dict-select-tag type='list' v-model:value="formData.instructionId"
|
||||||
|
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
|
||||||
|
placeholder="请选择分类标签" allowClear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="ConfigServiceTypeForm-categoryId"
|
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="ConfigServiceTypeForm-categoryId"
|
||||||
name="categoryId">
|
name="categoryId">
|
||||||
<j-dict-select-tag type='list' v-model:value="formData.categoryId"
|
<j-dict-select-tag type='list' v-model:value="formData.categoryId" :dictCode="categoryDictCode"
|
||||||
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 order by sort asc`"
|
placeholder="请选择服务类别" allowClear :disabled="!formData.instructionId" />
|
||||||
placeholder="请选择服务类别" allowClear />
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="服务类型" v-bind="validateInfos.typeName" id="ConfigServiceTypeForm-typeName"
|
<a-form-item label="服务类型" v-bind="validateInfos.typeName" id="ConfigServiceTypeForm-typeName"
|
||||||
name="typeName">
|
name="typeName">
|
||||||
<a-input v-model:value="formData.typeName" placeholder="请输入服务类型" allow-clear></a-input>
|
<a-input v-model:value="formData.typeName" placeholder="请输入服务类型" allow-clear
|
||||||
|
:disabled="!formData.categoryId"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
|
@ -39,7 +47,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
|
import { ref, reactive, defineExpose, nextTick, defineProps, computed, watch } from 'vue';
|
||||||
import { defHttp } from '/@/utils/http/axios';
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
|
@ -58,6 +66,7 @@ const useForm = Form.useForm;
|
||||||
const emit = defineEmits(['register', 'ok']);
|
const emit = defineEmits(['register', 'ok']);
|
||||||
const formData = reactive<Record<string, any>>({
|
const formData = reactive<Record<string, any>>({
|
||||||
id: '',
|
id: '',
|
||||||
|
instructionId: '',
|
||||||
categoryId: '',
|
categoryId: '',
|
||||||
typeName: '',
|
typeName: '',
|
||||||
sort: 99,
|
sort: 99,
|
||||||
|
@ -67,15 +76,30 @@ const { createMessage } = useMessage();
|
||||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||||
const confirmLoading = ref<boolean>(false);
|
const confirmLoading = ref<boolean>(false);
|
||||||
|
|
||||||
//表单验证
|
//表单验证
|
||||||
const validatorRules = reactive({
|
const validatorRules = reactive({
|
||||||
categoryId: [{ required: true, message: '请选择服务类别!' },],
|
instructionId: [{ required: true, message: '请选择分类标签!' }],
|
||||||
typeName: [{ required: true, message: '请输入服务类型名称!' },],
|
categoryId: [{ required: true, message: '请选择服务类别!' }],
|
||||||
sort: [{ required: true, message: '请输入排序!'}, { pattern: /^\d+$/, message: '请输入正整数!'},],
|
typeName: [{ required: true, message: '请输入服务类型名称!' }],
|
||||||
izEnabled: [{ required: true, message: '请选择是否启用!' },],
|
sort: [{ required: true, message: '请输入排序!' }, { pattern: /^\d+$/, message: '请输入正整数!' }],
|
||||||
|
izEnabled: [{ required: true, message: '请选择是否启用!' }],
|
||||||
});
|
});
|
||||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||||
|
|
||||||
|
// 计算 dictCode
|
||||||
|
const categoryDictCode = computed(() => {
|
||||||
|
if (!formData.instructionId) {
|
||||||
|
return 'nu_config_service_category,category_name,id,1=2';
|
||||||
|
}
|
||||||
|
return `nu_config_service_category,category_name,id,del_flag = 0 and instruction_id = ${formData.instructionId} order by sort asc`;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 监听 instructionId 变化,清空 categoryId
|
||||||
|
watch(() => formData.instructionId, () => {
|
||||||
|
formData.categoryId = '';
|
||||||
|
});
|
||||||
|
|
||||||
// 表单禁用
|
// 表单禁用
|
||||||
const disabled = computed(() => {
|
const disabled = computed(() => {
|
||||||
if (props.formBpm === true) {
|
if (props.formBpm === true) {
|
||||||
|
@ -88,7 +112,6 @@ const disabled = computed(() => {
|
||||||
return props.formDisabled;
|
return props.formDisabled;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
|
@ -105,9 +128,9 @@ function edit(record) {
|
||||||
const tmpData = {};
|
const tmpData = {};
|
||||||
Object.keys(formData).forEach((key) => {
|
Object.keys(formData).forEach((key) => {
|
||||||
if (record.hasOwnProperty(key)) {
|
if (record.hasOwnProperty(key)) {
|
||||||
tmpData[key] = record[key]
|
tmpData[key] = record[key];
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
//赋值
|
//赋值
|
||||||
Object.assign(formData, tmpData);
|
Object.assign(formData, tmpData);
|
||||||
});
|
});
|
||||||
|
@ -161,7 +184,6 @@ async function submitForm() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
add,
|
add,
|
||||||
edit,
|
edit,
|
||||||
|
@ -173,4 +195,4 @@ defineExpose({
|
||||||
.antd-modal-form {
|
.antd-modal-form {
|
||||||
padding: 14px;
|
padding: 14px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -34,11 +34,11 @@ export const columns: BasicColumn[] = [
|
||||||
dataIndex: 'phone',
|
dataIndex: 'phone',
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// title: '部门',
|
title: '部门',
|
||||||
// width: 150,
|
width: 150,
|
||||||
// dataIndex: 'orgCodeTxt',
|
dataIndex: 'orgCodeTxt',
|
||||||
// },
|
},
|
||||||
{
|
{
|
||||||
title: '可登录类型',
|
title: '可登录类型',
|
||||||
width: 150,
|
width: 150,
|
||||||
|
@ -204,37 +204,37 @@ export const formSchema: FormSchema[] = [
|
||||||
immediate: false,
|
immediate: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// label: '所属部门',
|
label: '所属部门',
|
||||||
// field: 'selecteddeparts',
|
field: 'selecteddeparts',
|
||||||
// component: 'JSelectDept',
|
component: 'JSelectDept',
|
||||||
// componentProps: ({ formActionType, formModel }) => {
|
componentProps: ({ formActionType, formModel }) => {
|
||||||
// return {
|
return {
|
||||||
// sync: false,
|
sync: false,
|
||||||
// checkStrictly: true,
|
checkStrictly: true,
|
||||||
// defaultExpandLevel: 2,
|
defaultExpandLevel: 2,
|
||||||
|
|
||||||
// onSelect: (options, values) => {
|
onSelect: (options, values) => {
|
||||||
// const { updateSchema } = formActionType;
|
const { updateSchema } = formActionType;
|
||||||
// //所属部门修改后更新负责部门下拉框数据
|
//所属部门修改后更新负责部门下拉框数据
|
||||||
// updateSchema([
|
updateSchema([
|
||||||
// {
|
{
|
||||||
// field: 'departIds',
|
field: 'departIds',
|
||||||
// componentProps: { options },
|
componentProps: { options },
|
||||||
// },
|
},
|
||||||
// ]);
|
]);
|
||||||
// //update-begin---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
|
//update-begin---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
|
||||||
// if(!values){
|
if(!values){
|
||||||
// formModel.departIds = [];
|
formModel.departIds = [];
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
// //update-end---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
|
//update-end---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
|
||||||
// //所属部门修改后更新负责部门数据
|
//所属部门修改后更新负责部门数据
|
||||||
// formModel.departIds && (formModel.departIds = formModel.departIds.filter((item) => values.value.indexOf(item) > -1));
|
formModel.departIds && (formModel.departIds = formModel.departIds.filter((item) => values.value.indexOf(item) > -1));
|
||||||
// },
|
},
|
||||||
// };
|
};
|
||||||
// },
|
},
|
||||||
// },
|
},
|
||||||
{
|
{
|
||||||
label: '租户',
|
label: '租户',
|
||||||
field: 'relTenantIds',
|
field: 'relTenantIds',
|
||||||
|
|
Loading…
Reference in New Issue