服务指令树
This commit is contained in:
parent
07951274bf
commit
d17b1d28a9
|
@ -38,7 +38,7 @@
|
||||||
<BasicTable @register="registerTable">
|
<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>
|
<!-- <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> -->
|
<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">
|
||||||
|
|
|
@ -46,7 +46,7 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const useForm = Form.useForm;
|
const useForm = Form.useForm;
|
||||||
const emit = defineEmits(['register', 'ok']);
|
const emit = defineEmits(['register', 'ok', 'refresh']);
|
||||||
const formData = reactive<Record<string, any>>({
|
const formData = reactive<Record<string, any>>({
|
||||||
id: '',
|
id: '',
|
||||||
instructionName: '',
|
instructionName: '',
|
||||||
|
@ -60,7 +60,7 @@ const confirmLoading = ref<boolean>(false);
|
||||||
//表单验证
|
//表单验证
|
||||||
const validatorRules = reactive({
|
const validatorRules = reactive({
|
||||||
instructionName: [{ required: true, message: '请输入分类标签名称!' },],
|
instructionName: [{ 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 });
|
||||||
|
|
|
@ -1,77 +1,99 @@
|
||||||
<template>
|
<template>
|
||||||
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk"
|
||||||
<InstructionTagForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></InstructionTagForm>
|
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||||
|
<InstructionTagForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit"
|
||||||
|
:formBpm="false">
|
||||||
|
</InstructionTagForm>
|
||||||
</j-modal>
|
</j-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, nextTick, defineExpose } from 'vue';
|
import { ref, nextTick, defineExpose } from 'vue';
|
||||||
import InstructionTagForm from './InstructionTagForm.vue'
|
import InstructionTagForm from './InstructionTagForm.vue'
|
||||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
const title = ref<string>('');
|
import { saveOrUpdate } from '../InstructionTag.api';
|
||||||
const width = ref<number>(800);
|
|
||||||
const visible = ref<boolean>(false);
|
|
||||||
const disableSubmit = ref<boolean>(false);
|
|
||||||
const registerForm = ref();
|
|
||||||
const emit = defineEmits(['register', 'success']);
|
|
||||||
|
|
||||||
/**
|
const { createMessage } = useMessage();
|
||||||
* 新增
|
const title = ref<string>('');
|
||||||
*/
|
const width = ref<number>(800);
|
||||||
function add() {
|
const visible = ref<boolean>(false);
|
||||||
title.value = '新增';
|
const disableSubmit = ref<boolean>(false);
|
||||||
visible.value = true;
|
const registerForm = ref();
|
||||||
nextTick(() => {
|
const emit = defineEmits(['register', 'success', 'refresh']);
|
||||||
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() {
|
function add() {
|
||||||
handleCancel();
|
title.value = '新增';
|
||||||
emit('success');
|
visible.value = true;
|
||||||
}
|
nextTick(() => {
|
||||||
|
registerForm.value.add();
|
||||||
/**
|
|
||||||
* 取消按钮回调事件
|
|
||||||
*/
|
|
||||||
function handleCancel() {
|
|
||||||
visible.value = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
add,
|
|
||||||
edit,
|
|
||||||
disableSubmit,
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @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;
|
||||||
|
}
|
||||||
|
|
||||||
|
function usingOrStop(id, izEnabled) {
|
||||||
|
let params = {
|
||||||
|
id,
|
||||||
|
izEnabled
|
||||||
|
}
|
||||||
|
saveOrUpdate(params, true).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
createMessage.success(res.message);
|
||||||
|
} else {
|
||||||
|
createMessage.warning(res.message);
|
||||||
|
}
|
||||||
|
emit('success')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
add,
|
||||||
|
edit,
|
||||||
|
disableSubmit,
|
||||||
|
usingOrStop,
|
||||||
|
});
|
||||||
</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>
|
||||||
|
|
|
@ -55,7 +55,7 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const useForm = Form.useForm;
|
const useForm = Form.useForm;
|
||||||
const emit = defineEmits(['register', 'ok']);
|
const emit = defineEmits(['register', 'ok', 'refresh']);
|
||||||
const formData = reactive<Record<string, any>>({
|
const formData = reactive<Record<string, any>>({
|
||||||
id: '',
|
id: '',
|
||||||
categoryName: '',
|
categoryName: '',
|
||||||
|
@ -161,11 +161,26 @@ async function submitForm() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function usingOrStop(id, izEnabled) {
|
||||||
|
let params = {
|
||||||
|
id,
|
||||||
|
izEnabled
|
||||||
|
}
|
||||||
|
saveOrUpdate(params, true).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
createMessage.success(res.message);
|
||||||
|
} else {
|
||||||
|
createMessage.warning(res.message);
|
||||||
|
}
|
||||||
|
emit('refresh')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
add,
|
add,
|
||||||
edit,
|
edit,
|
||||||
submitForm,
|
submitForm,
|
||||||
|
usingOrStop,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,77 +1,99 @@
|
||||||
<template>
|
<template>
|
||||||
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk"
|
||||||
<ConfigServiceCategoryForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ConfigServiceCategoryForm>
|
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||||
|
<ConfigServiceCategoryForm ref="registerForm" @ok="submitCallback"
|
||||||
|
:formDisabled="disableSubmit" :formBpm="false">
|
||||||
|
</ConfigServiceCategoryForm>
|
||||||
</j-modal>
|
</j-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, nextTick, defineExpose } from 'vue';
|
import { ref, nextTick, defineExpose } from 'vue';
|
||||||
import ConfigServiceCategoryForm from './ConfigServiceCategoryForm.vue'
|
import ConfigServiceCategoryForm from './ConfigServiceCategoryForm.vue'
|
||||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
const title = ref<string>('');
|
import { saveOrUpdate } from '../ConfigServiceCategory.api';
|
||||||
const width = ref<number>(800);
|
|
||||||
const visible = ref<boolean>(false);
|
|
||||||
const disableSubmit = ref<boolean>(false);
|
|
||||||
const registerForm = ref();
|
|
||||||
const emit = defineEmits(['register', 'success']);
|
|
||||||
|
|
||||||
/**
|
const { createMessage } = useMessage();
|
||||||
* 新增
|
const title = ref<string>('');
|
||||||
*/
|
const width = ref<number>(800);
|
||||||
function add() {
|
const visible = ref<boolean>(false);
|
||||||
title.value = '新增';
|
const disableSubmit = ref<boolean>(false);
|
||||||
visible.value = true;
|
const registerForm = ref();
|
||||||
nextTick(() => {
|
const emit = defineEmits(['register', 'success', 'refresh']);
|
||||||
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() {
|
function add() {
|
||||||
handleCancel();
|
title.value = '新增';
|
||||||
emit('success');
|
visible.value = true;
|
||||||
}
|
nextTick(() => {
|
||||||
|
registerForm.value.add();
|
||||||
/**
|
|
||||||
* 取消按钮回调事件
|
|
||||||
*/
|
|
||||||
function handleCancel() {
|
|
||||||
visible.value = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
add,
|
|
||||||
edit,
|
|
||||||
disableSubmit,
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @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;
|
||||||
|
}
|
||||||
|
|
||||||
|
function usingOrStop(id, izEnabled) {
|
||||||
|
let params = {
|
||||||
|
id,
|
||||||
|
izEnabled
|
||||||
|
}
|
||||||
|
saveOrUpdate(params, true).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
createMessage.success(res.message);
|
||||||
|
} else {
|
||||||
|
createMessage.warning(res.message);
|
||||||
|
}
|
||||||
|
emit('success')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
add,
|
||||||
|
edit,
|
||||||
|
disableSubmit,
|
||||||
|
usingOrStop,
|
||||||
|
});
|
||||||
</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>
|
||||||
|
|
|
@ -13,7 +13,8 @@ enum Api {
|
||||||
exportXls = '/services/serviceDirective/exportXls',
|
exportXls = '/services/serviceDirective/exportXls',
|
||||||
async = '/services/serviceDirective/async',
|
async = '/services/serviceDirective/async',
|
||||||
departList = '/sys/sysDepart/list',
|
departList = '/sys/sysDepart/list',
|
||||||
|
tree = '/services/serviceDirective/tree',
|
||||||
|
queryById = '/services/serviceDirective/queryById',
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -33,7 +34,7 @@ export const getImportUrl = Api.importExcel;
|
||||||
*/
|
*/
|
||||||
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 });
|
export const departList = (params) => defHttp.get({ url: Api.departList, params });
|
||||||
|
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
|
||||||
/**
|
/**
|
||||||
* 删除单个
|
* 删除单个
|
||||||
* @param params
|
* @param params
|
||||||
|
@ -81,4 +82,11 @@ export const saveOrUpdate = (params, isUpdate) => {
|
||||||
*/
|
*/
|
||||||
export const asyncFunc = (params) => {
|
export const asyncFunc = (params) => {
|
||||||
return defHttp.post({ url: Api.async, params }, { isTransformResponse: false });
|
return defHttp.post({ url: Api.async, params }, { isTransformResponse: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取树结构
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const tree = () => defHttp.get({ url: Api.tree });
|
|
@ -5,32 +5,32 @@
|
||||||
<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-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"
|
<j-dict-select-tag v-model:value="queryParam.instructionTagId"
|
||||||
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
|
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
|
||||||
placeholder="请选择分类标签" allowClear :ignoreDisabled="true" />
|
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 and instruction_id = '${queryParam.instructionTagId || ''}' order by sort asc`"
|
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 and instruction_id = '${queryParam.instructionTagId || ''}' order by sort asc`"
|
||||||
placeholder="请选择服务类别" allowClear :ignoreDisabled="true" />
|
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 || ''}' 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="请选择服务类型" allowClear :ignoreDisabled="true" />
|
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="directiveName">
|
<a-form-item name="directiveName">
|
||||||
<template #label><span title="服务指令">服务指令</span></template>
|
<template #label><span title="服务指令">服务指令</span></template>
|
||||||
|
@ -72,31 +72,63 @@
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
<!--引用表格-->
|
<div>
|
||||||
<BasicTable @register="registerTable">
|
<div style="width:350px;float: left;max-height:77vh; overflow:auto;">
|
||||||
<!--插槽:table标题-->
|
<a-empty v-if="treeLoading" />
|
||||||
<template #tableTitle>
|
<a-tree v-else :tree-data="treeData" v-model:expandedKeys="expandedKeys" expandAction="click">
|
||||||
<a-button type="primary" class="btnPrivate" @click="handleinstructionTag"
|
<template #title="{ data }">
|
||||||
preIcon="tabler:settings">配置分类标签</a-button>
|
<span class="node-title" @mouseenter="onNodeEnter(data, data.children)" @mouseleave="onNodeLeave(data)">
|
||||||
<a-button type="primary" class="btnPrivate" @click="handleCategory" preIcon="tabler:settings">配置服务类别</a-button>
|
<span v-if="data.level == 4">{{ data?.title + '(' + data?.cycleTypeName + ')' }}</span>
|
||||||
<a-button type="primary" class="btnPrivate" @click="handleType" preIcon="tabler:settings">配置服务类型</a-button>
|
<span v-else>{{ data?.title }}</span>
|
||||||
<a-button type="primary" class="btnPrivate" @click="handleBodyTag" preIcon="tabler:settings">配置体型标签</a-button>
|
<span v-if="data?.izEnabled == '1'" style="color:red;">(已停用)</span>
|
||||||
<a-button type="primary" class="btnPrivate" @click="handleEmotionTag"
|
<!-- 下拉菜单 -->
|
||||||
preIcon="tabler:settings">配置情绪标签</a-button>
|
<a-dropdown :open="menuState[data?.key]?.open" @openChange="onMenuOpenChange(data.key, $event)">
|
||||||
<a-button type="primary" class="btnPrivate" @click="handleAdd"
|
<template #overlay>
|
||||||
preIcon="ant-design:plus-outlined">新增服务指令</a-button>
|
<a-menu>
|
||||||
</template>
|
<a-menu-item v-for="item in menuItems(data)" :key="item.key"
|
||||||
<!--操作栏-->
|
@click="() => { closeAllMenus(); item.action(data) }">
|
||||||
<template #action="{ record }">
|
<Icon style="color:#1890FF;" :icon="item.icon" class="action-icon"></Icon>
|
||||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
<span style=" color:#1890FF;margin-left: 5px;">{{ item.label }}</span>
|
||||||
</template>
|
</a-menu-item>
|
||||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
</a-menu>
|
||||||
<!-- 音频播放控制 -->
|
</template>
|
||||||
<template v-if="column.dataIndex === 'mp3File'">
|
<!-- 图标 -->
|
||||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
<Icon style="color:#1890FF;" :icon="iconClass(data.level)" class="action-icon"
|
||||||
<a-button v-else type="link" class="btnPrivate" @click="openAudioModal(text)">播放</a-button>
|
@click.stop="openMenu(data, data.children, $event)"
|
||||||
</template>
|
@contextmenu.prevent="openMenu(data, data.children, $event)"></Icon>
|
||||||
<!-- <template v-if="column.dataIndex === 'mp3File'">
|
</a-dropdown>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</a-tree>
|
||||||
|
</div>
|
||||||
|
<div style="width:calc(100% - 360px);float: left;margin-left: 10px;">
|
||||||
|
<!--引用表格-->
|
||||||
|
<BasicTable @register="registerTable">
|
||||||
|
<!--插槽:table标题-->
|
||||||
|
<template #tableTitle>
|
||||||
|
<a-button type="primary" class="btnPrivate" @click="handleinstructionTag"
|
||||||
|
preIcon="tabler:settings">配置分类标签</a-button>
|
||||||
|
<a-button type="primary" class="btnPrivate" @click="handleCategory"
|
||||||
|
preIcon="tabler:settings">配置服务类别</a-button>
|
||||||
|
<a-button type="primary" class="btnPrivate" @click="handleType" preIcon="tabler:settings">配置服务类型</a-button>
|
||||||
|
<a-button type="primary" class="btnPrivate" @click="handleBodyTag"
|
||||||
|
preIcon="tabler:settings">配置体型标签</a-button>
|
||||||
|
<a-button type="primary" class="btnPrivate" @click="handleEmotionTag"
|
||||||
|
preIcon="tabler:settings">配置情绪标签</a-button>
|
||||||
|
<a-button type="primary" class="btnPrivate" @click="handleAdd"
|
||||||
|
preIcon="ant-design:plus-outlined">新增服务指令</a-button>
|
||||||
|
</template>
|
||||||
|
<!--操作栏-->
|
||||||
|
<template #action="{ record }">
|
||||||
|
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||||
|
</template>
|
||||||
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
|
<!-- 音频播放控制 -->
|
||||||
|
<template v-if="column.dataIndex === 'mp3File'">
|
||||||
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||||
|
<a-button v-else type="link" class="btnPrivate" @click="openAudioModal(text)">播放</a-button>
|
||||||
|
</template>
|
||||||
|
<!-- <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>
|
||||||
<div v-else style="display: flex; align-items: center; gap: 8px;">
|
<div v-else style="display: flex; align-items: center; gap: 8px;">
|
||||||
<audio ref="audioPlayer" :src="getFileAccessHttpUrl(text)" hidden></audio>
|
<audio ref="audioPlayer" :src="getFileAccessHttpUrl(text)" hidden></audio>
|
||||||
|
@ -123,20 +155,24 @@
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template> -->
|
</template> -->
|
||||||
<template v-if="column.dataIndex === 'mp4File'">
|
<template v-if="column.dataIndex === 'mp4File'">
|
||||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
<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>
|
<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) =>
|
||||||
item.tagName).join('、')}}</span>
|
item.tagName).join('、')}}</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'emotionTagList'">
|
<template v-if="column.dataIndex === 'emotionTagList'">
|
||||||
<span :title="text.map((item) => item.tagName).join('、')">{{text.map((item) =>
|
<span :title="text.map((item) => item.tagName).join('、')">{{text.map((item) =>
|
||||||
item.tagName).join('、')}}</span>
|
item.tagName).join('、')}}</span>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<ConfigServiceDirectiveModal ref="registerModal" @success="handleSuccess">
|
<ConfigServiceDirectiveModal ref="registerModal" @success="handleSuccess">
|
||||||
</ConfigServiceDirectiveModal>
|
</ConfigServiceDirectiveModal>
|
||||||
|
@ -199,14 +235,19 @@
|
||||||
您的浏览器不支持视频播放。
|
您的浏览器不支持视频播放。
|
||||||
</video>
|
</video>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
|
|
||||||
|
<!-- 分类标签 -->
|
||||||
|
<InstructionTagModal ref="insRegisterModal" @success="reloadTree"></InstructionTagModal>
|
||||||
|
<ConfigServiceCategoryModal ref="catRegisterModal" @success="reloadTree"></ConfigServiceCategoryModal>
|
||||||
|
<ConfigServiceTypeModal ref="typRegisterModal" @success="reloadTree"></ConfigServiceTypeModal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" name="serviceDirective-configServiceDirective" setup>
|
<script lang="ts" name="serviceDirective-configServiceDirective" setup>
|
||||||
import { ref, reactive, watch, onMounted } from 'vue';
|
import { ref, reactive, watch, onMounted, computed } from 'vue';
|
||||||
import { BasicTable, TableAction } from '/@/components/Table';
|
import { BasicTable, TableAction } from '/@/components/Table';
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
import { columns, superQuerySchema } from './ConfigServiceDirective.data';
|
import { columns, superQuerySchema } from './ConfigServiceDirective.data';
|
||||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ConfigServiceDirective.api';
|
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, tree } from './ConfigServiceDirective.api';
|
||||||
import ConfigServiceDirectiveModal from './components/ConfigServiceDirectiveModal.vue'
|
import ConfigServiceDirectiveModal from './components/ConfigServiceDirectiveModal.vue'
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||||
|
@ -218,7 +259,15 @@ 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 { Empty } from 'ant-design-vue';
|
||||||
|
import InstructionTagModal from '/@/views/services/InstructionTag/components/InstructionTagModal.vue'
|
||||||
|
import ConfigServiceCategoryModal from '/@/views/services/serviceCategory/components//ConfigServiceCategoryModal.vue'
|
||||||
|
import ConfigServiceTypeModal from '/@/views/services/serviceType/components//ConfigServiceTypeModal.vue'
|
||||||
|
|
||||||
|
const insRegisterModal = ref();
|
||||||
|
const catRegisterModal = ref();
|
||||||
|
const typRegisterModal = ref();
|
||||||
|
const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE;
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const queryParam = reactive<any>({
|
const queryParam = reactive<any>({
|
||||||
instructionTagId: '',
|
instructionTagId: '',
|
||||||
|
@ -242,6 +291,7 @@ watch(
|
||||||
)
|
)
|
||||||
const toggleSearchStatus = ref<boolean>(false);
|
const toggleSearchStatus = ref<boolean>(false);
|
||||||
const registerModal = ref();
|
const registerModal = ref();
|
||||||
|
const treeData = ref<any>([]);
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
//注册table数据
|
//注册table数据
|
||||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
|
@ -252,6 +302,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
canResize: false,
|
canResize: false,
|
||||||
useSearchForm: false,
|
useSearchForm: false,
|
||||||
showIndexColumn: true,
|
showIndexColumn: true,
|
||||||
|
scroll: { y: '58vh' },
|
||||||
pagination: {
|
pagination: {
|
||||||
current: 1,
|
current: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
@ -341,25 +392,13 @@ function handleDetail(record: Recordable) {
|
||||||
registerModal.value.edit(record);
|
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() {
|
function handleSuccess() {
|
||||||
(selectedRowKeys.value = []) && reload();
|
(selectedRowKeys.value = []) && reload();
|
||||||
|
reloadTree()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -375,10 +414,10 @@ function getTableAction(record) {
|
||||||
label: '编辑',
|
label: '编辑',
|
||||||
onClick: handleEdit.bind(null, record)
|
onClick: handleEdit.bind(null, record)
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// label: '指令资源',
|
label: '指令资源',
|
||||||
// onClick: handleMedia.bind(null, record)
|
onClick: handleMedia.bind(null, record)
|
||||||
// },
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -387,7 +426,6 @@ function getTableAction(record) {
|
||||||
*/
|
*/
|
||||||
function getDropDownAction(record) {
|
function getDropDownAction(record) {
|
||||||
return [
|
return [
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -408,10 +446,6 @@ function searchReset() {
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let rangeField = 'tollPrice,comPrice,'
|
let rangeField = 'tollPrice,comPrice,'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -569,6 +603,237 @@ const stopAudio = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const clickCount = ref(0);
|
||||||
|
const treeChildData = ref<any>([]);
|
||||||
|
const expandedKeys = ref<string[]>([]);
|
||||||
|
|
||||||
|
watch(expandedKeys, () => {
|
||||||
|
console.log('expandedKeys', expandedKeys);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 为每个 node 维护一个菜单状态和 hover 定时器
|
||||||
|
const menuState = reactive<Record<string, { timer?: number, openedByClick: boolean, open: boolean }>>({
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
function onNodeEnter(node, level) {
|
||||||
|
const key = node.key
|
||||||
|
if (!menuState[key]) {
|
||||||
|
menuState[key] = { openedByClick: false, open: false }
|
||||||
|
}
|
||||||
|
// 只有前三级需要自动弹
|
||||||
|
if (level <= 3 && !menuState[key].openedByClick) {
|
||||||
|
menuState[key].timer = window.setTimeout(() => {
|
||||||
|
menuState[key].open = true
|
||||||
|
}, 2000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onNodeLeave(node) {
|
||||||
|
const s = menuState[node.key]
|
||||||
|
if (s?.timer) {
|
||||||
|
clearTimeout(s.timer)
|
||||||
|
delete s.timer
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用户点击图标手动打开
|
||||||
|
function openMenu(node, level, ev) {
|
||||||
|
const key = node.key
|
||||||
|
if (!menuState[key]) menuState[key] = { openedByClick: false, open: false }
|
||||||
|
menuState[key].openedByClick = true
|
||||||
|
menuState[key].open = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 鼠标悬浮:打开或关闭,但不覆盖由点击打开后的状态切换
|
||||||
|
function onNodeHover(key: string, level: number, enter: boolean) {
|
||||||
|
if (!menuState[key]) menuState[key] = { open: false, openedByClick: false }
|
||||||
|
// 只有鼠标移入时,且不是由点击保持打开时,才打开
|
||||||
|
if (enter && !menuState[key].openedByClick) {
|
||||||
|
closeAllMenus()
|
||||||
|
menuState[key].open = true
|
||||||
|
}
|
||||||
|
// 鼠标移出时,如果不是点击打开的,就关闭
|
||||||
|
if (!enter && !menuState[key].openedByClick) {
|
||||||
|
menuState[key].open = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 点击图标:切换状态,并且每次点击前先关闭其它菜单
|
||||||
|
function onIconClick(key: string, level: number) {
|
||||||
|
if (!menuState[key]) menuState[key] = { open: false, openedByClick: false }
|
||||||
|
// 先关掉其它
|
||||||
|
closeAllMenus()
|
||||||
|
// 再切换当前
|
||||||
|
menuState[key].openedByClick = !menuState[key].openedByClick
|
||||||
|
menuState[key].open = menuState[key].openedByClick
|
||||||
|
}
|
||||||
|
|
||||||
|
// 当 Dropdown 自身触发 openChange(比如点击外部关闭)时,同步状态
|
||||||
|
function onMenuOpenChange(key: string, open: boolean) {
|
||||||
|
if (!menuState[key]) menuState[key] = { open: false, openedByClick: false }
|
||||||
|
menuState[key].open = open
|
||||||
|
// 如果是外部关闭,则重置 clicked 状态
|
||||||
|
if (!open) menuState[key].openedByClick = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭所有菜单工具函数
|
||||||
|
function closeAllMenus() {
|
||||||
|
Object.keys(menuState).forEach(k => {
|
||||||
|
menuState[k].open = false
|
||||||
|
menuState[k].openedByClick = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据层级返回图标 class
|
||||||
|
function iconClass(level: number) {
|
||||||
|
switch (level) {
|
||||||
|
case 1: return 'ant-design:setting-twotone'
|
||||||
|
case 2: return 'ant-design:setting-twotone'
|
||||||
|
case 3: return 'ant-design:setting-twotone'
|
||||||
|
case 4: return 'ant-design:setting-outlined'
|
||||||
|
default: return 'ant-design:setting-outlined'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//新增分类标签
|
||||||
|
function addInstruction() {
|
||||||
|
insRegisterModal.value.disableSubmit = false;
|
||||||
|
insRegisterModal.value.add();
|
||||||
|
}
|
||||||
|
//启用分类标签
|
||||||
|
function usingInstruction(data) {
|
||||||
|
insRegisterModal.value.usingOrStop(data.instructionId, '0')
|
||||||
|
}
|
||||||
|
//停用分类标签
|
||||||
|
function stopInstruction(data) {
|
||||||
|
insRegisterModal.value.usingOrStop(data.instructionId, '1')
|
||||||
|
}
|
||||||
|
//新增服务类别
|
||||||
|
function addCategory(data) {
|
||||||
|
catRegisterModal.value.disableSubmit = false;
|
||||||
|
catRegisterModal.value.edit({ instructionId: data.instructionId });
|
||||||
|
}
|
||||||
|
//启用服务类别
|
||||||
|
function usingCategory(data) {
|
||||||
|
catRegisterModal.value.usingOrStop(data.categoryId, '0')
|
||||||
|
}
|
||||||
|
//停用服务类别
|
||||||
|
function stopCategory(data) {
|
||||||
|
catRegisterModal.value.usingOrStop(data.categoryId, '1')
|
||||||
|
}
|
||||||
|
//新增服务类型
|
||||||
|
function addType(data) {
|
||||||
|
typRegisterModal.value.disableSubmit = false;
|
||||||
|
typRegisterModal.value.edit({ instructionId: data.instructionId, categoryId: data.categoryId });
|
||||||
|
}
|
||||||
|
//启用服务类型
|
||||||
|
function usingType(data) {
|
||||||
|
typRegisterModal.value.usingOrStop(data.typeId, '0')
|
||||||
|
}
|
||||||
|
//停用服务类型
|
||||||
|
function stopType(data) {
|
||||||
|
typRegisterModal.value.usingOrStop(data.typeId, '1')
|
||||||
|
}
|
||||||
|
//新增服务指令
|
||||||
|
function addDirective(data) {
|
||||||
|
registerModal.value.disableSubmit = false;
|
||||||
|
registerModal.value.edit({ instructionTagId: data.instructionId, categoryId: data.categoryId, typeId: data.typeId });
|
||||||
|
}
|
||||||
|
//编辑务指令
|
||||||
|
function editDirective(data) {
|
||||||
|
registerModal.value.disableSubmit = false;
|
||||||
|
registerModal.value.queryByIdFunc(data.key);
|
||||||
|
}
|
||||||
|
//启用服务指令
|
||||||
|
function usingDirective(data) {
|
||||||
|
registerModal.value.usingOrStop(data.key, '0');
|
||||||
|
}
|
||||||
|
//停用服务指令
|
||||||
|
function stopDirective(data) {
|
||||||
|
registerModal.value.usingOrStop(data.key, '1');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据层级返回菜单项
|
||||||
|
function menuItems(data) {
|
||||||
|
if (data.level === 1) {
|
||||||
|
const items = [
|
||||||
|
{ key: 'addIns', label: '新增分类标签', icon: 'ant-design:plus-outlined', action: addInstruction },
|
||||||
|
]
|
||||||
|
if (data.canAdd) {
|
||||||
|
items.push({ key: 'addCat', label: '新增服务类别', icon: 'ant-design:plus-outlined', action: addCategory })
|
||||||
|
}
|
||||||
|
if (data.izEnabled === '1') {
|
||||||
|
items.push({ key: 'usingIns', label: '启用分类标签', icon: 'ant-design:check-circle-outlined', action: usingInstruction })
|
||||||
|
} else if (data.izEnabled === '0') {
|
||||||
|
items.push({ key: 'stopIns', label: '停用分类标签', icon: 'ant-design:stop-outlined', action: stopInstruction })
|
||||||
|
}
|
||||||
|
return items
|
||||||
|
}
|
||||||
|
else if (data.level === 2) {
|
||||||
|
const items = [
|
||||||
|
{ key: 'addCat', label: '新增服务类别', icon: 'ant-design:plus-outlined', action: addCategory },
|
||||||
|
]
|
||||||
|
if (data.canAdd) {
|
||||||
|
items.push({ key: 'addTyp', label: '新增服务类型', icon: 'ant-design:plus-outlined', action: addType })
|
||||||
|
}
|
||||||
|
if (data.izEnabled === '1') {
|
||||||
|
items.push({ key: 'usingCat', label: '启用服务类别', icon: 'ant-design:check-circle-outlined', action: usingCategory })
|
||||||
|
} else if (data.izEnabled === '0') {
|
||||||
|
items.push({ key: 'stopCat', label: '停用服务类别', icon: 'ant-design:stop-outlined', action: stopCategory })
|
||||||
|
}
|
||||||
|
return items
|
||||||
|
}
|
||||||
|
else if (data.level === 3) {
|
||||||
|
const items = [
|
||||||
|
{ key: 'addTyp', label: '新增服务类型', icon: 'ant-design:plus-outlined', action: addType },
|
||||||
|
]
|
||||||
|
if (data.canAdd) {
|
||||||
|
items.push({ key: 'addDir', label: '新增服务指令', icon: 'ant-design:plus-outlined', action: addDirective })
|
||||||
|
}
|
||||||
|
if (data.izEnabled === '1') {
|
||||||
|
items.push({ key: 'usingTyp', label: '启用服务类型', icon: 'ant-design:check-circle-outlined', action: usingType })
|
||||||
|
} else if (data.izEnabled === '0') {
|
||||||
|
items.push({ key: 'stopTyp', label: '停用服务类型', icon: 'ant-design:stop-outlined', action: stopType })
|
||||||
|
}
|
||||||
|
return items
|
||||||
|
}
|
||||||
|
else if (data.level === 4) {
|
||||||
|
const items = [
|
||||||
|
{ key: 'editDir', label: '编辑服务指令', icon: 'ant-design:edit-outlined', action: editDirective },
|
||||||
|
]
|
||||||
|
if (data.canAdd) {
|
||||||
|
items.push({ key: 'addDir', label: '新增服务指令', icon: 'ant-design:plus-outlined', action: addDirective })
|
||||||
|
}
|
||||||
|
if (data.izEnabled === '1') {
|
||||||
|
items.push({ key: 'usingDir', label: '启用服务指令', icon: 'ant-design:check-circle-outlined', action: usingDirective })
|
||||||
|
} else if (data.izEnabled === '0') {
|
||||||
|
items.push({ key: 'stopDir', label: '停用服务指令', icon: 'ant-design:stop-outlined', action: stopDirective })
|
||||||
|
}
|
||||||
|
return items
|
||||||
|
}
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 递归取每级第一个 key
|
||||||
|
function setDefaultExpanded(nodes: any[]) {
|
||||||
|
if (!nodes?.length) return
|
||||||
|
const first = nodes[0]
|
||||||
|
expandedKeys.value.push(first.key)
|
||||||
|
if (first.children?.length) {
|
||||||
|
setDefaultExpanded(first.children)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const treeLoading = ref(false)
|
||||||
|
|
||||||
|
function reloadTree() {
|
||||||
|
console.log(3333)
|
||||||
|
tree().then(res => {
|
||||||
|
treeData.value = res;
|
||||||
|
})
|
||||||
|
}
|
||||||
// 添加音频结束监听
|
// 添加音频结束监听
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (audioPlayer.value) {
|
if (audioPlayer.value) {
|
||||||
|
@ -576,10 +841,18 @@ onMounted(() => {
|
||||||
isPlaying.value = false;
|
isPlaying.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
treeLoading.value = true
|
||||||
|
tree().then(res => {
|
||||||
|
treeData.value = res;
|
||||||
|
expandedKeys.value = []
|
||||||
|
//默认展开每级第一个
|
||||||
|
setDefaultExpanded(res)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
treeLoading.value = false
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
@ -626,4 +899,14 @@ audio::-webkit-media-controls-time-remaining-display {
|
||||||
height: 34px;
|
height: 34px;
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.node-title {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-icon {
|
||||||
|
margin-left: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -2,8 +2,18 @@
|
||||||
<j-modal :title="title" width="70vw" :visible="visible" @ok="handleOk"
|
<j-modal :title="title" width="70vw" :visible="visible" @ok="handleOk"
|
||||||
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭"
|
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭"
|
||||||
:maskClosable="false">
|
:maskClosable="false">
|
||||||
<ConfigServiceDirectiveForm ref="registerForm" v-if="visible" @ok="submitCallback" :formDisabled="disableSubmit"
|
<template #footer>
|
||||||
:formBpm="false"></ConfigServiceDirectiveForm>
|
<a-button @click="handleCancel">关闭</a-button>
|
||||||
|
<a-button @click="handleOk" :loading="loading">确定</a-button>
|
||||||
|
<!-- <a-button @click="handleOk" v-show="opeType == 'edit' || opeType == 'audit'">确定</a-button>
|
||||||
|
<a-button @click="handleSave" v-show="opeType == 'editMedia' || opeType == 'auditMedia'">暂存</a-button>
|
||||||
|
<a-button type="primary" @click="handleMediaAsync" v-show="opeType == 'auditMedia'">同步</a-button>
|
||||||
|
<a-button type="primary" @click="handleMediaSyncAllPlat" v-show="opeType == 'editMedia'">同步</a-button> -->
|
||||||
|
</template>
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<ConfigServiceDirectiveForm ref="registerForm" v-if="visible" @ok="submitCallback" :formDisabled="disableSubmit"
|
||||||
|
:formBpm="false"></ConfigServiceDirectiveForm>
|
||||||
|
</a-spin>
|
||||||
</j-modal>
|
</j-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -11,7 +21,11 @@
|
||||||
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';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import { saveOrUpdate, queryById } from '../ConfigServiceDirective.api';
|
||||||
|
|
||||||
|
const loading = ref(false)
|
||||||
|
const { createMessage } = useMessage();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
});
|
});
|
||||||
const title = ref<string>('');
|
const title = ref<string>('');
|
||||||
|
@ -52,7 +66,7 @@ function editMedia(record) {
|
||||||
title.value = '编辑指令资源';
|
title.value = '编辑指令资源';
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
registerForm.value.edit(record,true);
|
registerForm.value.edit(record, true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,11 +92,37 @@ function handleCancel() {
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function usingOrStop(id, izEnabled) {
|
||||||
|
let params = {
|
||||||
|
id,
|
||||||
|
izEnabled
|
||||||
|
}
|
||||||
|
saveOrUpdate(params, true).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
createMessage.success(res.message);
|
||||||
|
} else {
|
||||||
|
createMessage.warning(res.message);
|
||||||
|
}
|
||||||
|
emit('success')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function queryByIdFunc(id) {
|
||||||
|
loading.value = true
|
||||||
|
queryById({ id }).then(res => {
|
||||||
|
edit(res)
|
||||||
|
}).finally(() => {
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
add,
|
add,
|
||||||
edit,
|
edit,
|
||||||
editMedia,
|
editMedia,
|
||||||
disableSubmit,
|
disableSubmit,
|
||||||
|
usingOrStop,
|
||||||
|
queryByIdFunc,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const useForm = Form.useForm;
|
const useForm = Form.useForm;
|
||||||
const emit = defineEmits(['register', 'ok']);
|
const emit = defineEmits(['register', 'ok', 'refresh']);
|
||||||
const formData = reactive<Record<string, any>>({
|
const formData = reactive<Record<string, any>>({
|
||||||
id: '',
|
id: '',
|
||||||
instructionId: '',
|
instructionId: '',
|
||||||
|
@ -184,10 +184,26 @@ async function submitForm() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function usingOrStop(id, izEnabled) {
|
||||||
|
let params = {
|
||||||
|
id,
|
||||||
|
izEnabled
|
||||||
|
}
|
||||||
|
saveOrUpdate(params, true).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
createMessage.success(res.message);
|
||||||
|
} else {
|
||||||
|
createMessage.warning(res.message);
|
||||||
|
}
|
||||||
|
emit('refresh')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
add,
|
add,
|
||||||
edit,
|
edit,
|
||||||
submitForm,
|
submitForm,
|
||||||
|
usingOrStop,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -10,13 +10,16 @@
|
||||||
import { ref, nextTick, defineExpose } from 'vue';
|
import { ref, nextTick, defineExpose } from 'vue';
|
||||||
import ConfigServiceTypeForm from './ConfigServiceTypeForm.vue'
|
import ConfigServiceTypeForm from './ConfigServiceTypeForm.vue'
|
||||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import { saveOrUpdate } from '../ConfigServiceType.api';
|
||||||
|
|
||||||
|
const { createMessage } = useMessage();
|
||||||
const title = ref<string>('');
|
const title = ref<string>('');
|
||||||
const width = ref<number>(800);
|
const width = ref<number>(800);
|
||||||
const visible = ref<boolean>(false);
|
const visible = ref<boolean>(false);
|
||||||
const disableSubmit = ref<boolean>(false);
|
const disableSubmit = ref<boolean>(false);
|
||||||
const registerForm = ref();
|
const registerForm = ref();
|
||||||
const emit = defineEmits(['register', 'success']);
|
const emit = defineEmits(['register', 'success', 'refresh']);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
|
@ -63,10 +66,26 @@ function handleCancel() {
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function usingOrStop(id, izEnabled) {
|
||||||
|
let params = {
|
||||||
|
id,
|
||||||
|
izEnabled
|
||||||
|
}
|
||||||
|
saveOrUpdate(params, true).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
createMessage.success(res.message);
|
||||||
|
} else {
|
||||||
|
createMessage.warning(res.message);
|
||||||
|
}
|
||||||
|
emit('success')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
add,
|
add,
|
||||||
edit,
|
edit,
|
||||||
disableSubmit,
|
disableSubmit,
|
||||||
|
usingOrStop,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue