调整服务指令-去除指令标签,新增体型标签、情绪标签
This commit is contained in:
parent
6330792804
commit
0f391c0c47
|
@ -14,7 +14,7 @@ enum Api {
|
|||
getDictItems = '/sys/dict/getDictItems/',
|
||||
getTableList = '/sys/user/queryUserComponentData',
|
||||
getCategoryData = '/sys/category/loadAllData',
|
||||
getNuList = '/iot/cameraInfo/nuList',//后期调整
|
||||
getNuList = '/iot/cameraInfo/nuList', //后期调整
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -87,6 +87,12 @@ export const loadDictItem = (params?) => {
|
|||
export const getDictItems = (dictCode) => {
|
||||
return defHttp.get({ url: Api.getDictItems + dictCode }, { joinTime: false });
|
||||
};
|
||||
/**
|
||||
* 根据字典code加载字典text
|
||||
*/
|
||||
export const getDictItemsByOrgCode = (dictCode, orgCode) => {
|
||||
return defHttp.get({ url: Api.getDictItems + dictCode + '/' + orgCode }, { joinTime: false });
|
||||
};
|
||||
/**
|
||||
* 部门用户modal选择列表加载list
|
||||
*/
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
import { defineComponent, computed, watch, watchEffect, ref, unref } from 'vue';
|
||||
import { propTypes } from '/@/utils/propTypes';
|
||||
import { useAttrs } from '/@/hooks/core/useAttrs';
|
||||
import { getDictItems } from "@/api/common/api";
|
||||
import { getDictItems, getDictItemsByOrgCode } from "@/api/common/api";
|
||||
|
||||
export default defineComponent({
|
||||
name: 'JCheckbox',
|
||||
|
@ -23,6 +23,7 @@ export default defineComponent({
|
|||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
orgCode: '',//组织机构编码 会切换数据源
|
||||
},
|
||||
emits: ['change', 'update:value'],
|
||||
setup(props, { emit }) {
|
||||
|
@ -82,15 +83,27 @@ export default defineComponent({
|
|||
temp = encodeURI(temp);
|
||||
}
|
||||
//update-end-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
||||
getDictItems(temp).then((res) => {
|
||||
if (res) {
|
||||
checkOptions.value = res.map((item) => ({ value: item.value, label: item.text, disabled: item.status == 1 && !checkboxArray.value.includes(item.value), color: item.color }));
|
||||
//console.info('res', dictOptions.value);
|
||||
} else {
|
||||
console.error('getDictItems error: : ', res);
|
||||
checkOptions.value = [];
|
||||
}
|
||||
});
|
||||
if (!!props.orgCode) {
|
||||
getDictItemsByOrgCode(temp, props.orgCode).then((res) => {
|
||||
if (res) {
|
||||
checkOptions.value = res.map((item) => ({ value: item.value, label: item.text, disabled: item.status == 1 && !checkboxArray.value.includes(item.value), color: item.color }));
|
||||
//console.info('res', dictOptions.value);
|
||||
} else {
|
||||
console.error('getDictItems error: : ', res);
|
||||
checkOptions.value = [];
|
||||
}
|
||||
});
|
||||
} else {
|
||||
getDictItems(temp).then((res) => {
|
||||
if (res) {
|
||||
checkOptions.value = res.map((item) => ({ value: item.value, label: item.text, disabled: item.status == 1 && !checkboxArray.value.includes(item.value), color: item.color }));
|
||||
//console.info('res', dictOptions.value);
|
||||
} else {
|
||||
console.error('getDictItems error: : ', res);
|
||||
checkOptions.value = [];
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -76,6 +76,7 @@ export default defineComponent({
|
|||
},
|
||||
style: propTypes.any,
|
||||
ignoreDisabled: propTypes.bool.def(false),
|
||||
orgCode:'',//组织机构编码 会切换数据源
|
||||
},
|
||||
emits: ['options-change', 'change', 'update:value'],
|
||||
setup(props, { emit, refs }) {
|
||||
|
@ -126,7 +127,8 @@ export default defineComponent({
|
|||
async function initDictData() {
|
||||
let { dictCode, stringToNumber } = props;
|
||||
//根据字典Code, 初始化字典数组
|
||||
const dictData = await initDictOptions(dictCode);
|
||||
const dictData = await initDictOptions(dictCode,props.orgCode);
|
||||
|
||||
dictOptions.value = dictData.reduce((prev, next) => {
|
||||
if (next) {
|
||||
const value = next['value'];
|
||||
|
|
|
@ -1,164 +1,170 @@
|
|||
<!--字典下拉多选-->
|
||||
<template>
|
||||
<a-select
|
||||
:value="arrayValue"
|
||||
@change="onChange"
|
||||
mode="multiple"
|
||||
:filter-option="filterOption"
|
||||
:disabled="disabled"
|
||||
:placeholder="placeholder"
|
||||
allowClear
|
||||
:getPopupContainer="getParentContainer"
|
||||
>
|
||||
<a-select-option v-for="(item, index) in dictOptions" :key="index" :getPopupContainer="getParentContainer" :value="item.value">
|
||||
<span :class="[useDicColor && item.color ? 'colorText' : '']" :style="{ backgroundColor: `${useDicColor && item.color}` }">{{ item.text || item.label }}</span>
|
||||
<a-select :value="arrayValue" @change="onChange" mode="multiple" :filter-option="filterOption" :disabled="disabled"
|
||||
:placeholder="placeholder" allowClear :getPopupContainer="getParentContainer">
|
||||
<a-select-option v-for="(item, index) in dictOptions" :key="index" :getPopupContainer="getParentContainer"
|
||||
:value="item.value">
|
||||
<span :class="[useDicColor && item.color ? 'colorText' : '']"
|
||||
:style="{ backgroundColor: `${useDicColor && item.color}` }">{{ item.text || item.label }}</span>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, onMounted, ref, nextTick, watch } from 'vue';
|
||||
import { useRuleFormItem } from '/@/hooks/component/useFormItem';
|
||||
import { propTypes } from '/@/utils/propTypes';
|
||||
import { useAttrs } from '/@/hooks/core/useAttrs';
|
||||
import { getDictItems } from '/@/api/common/api';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { setPopContainer } from '/@/utils';
|
||||
import { computed, defineComponent, onMounted, ref, nextTick, watch } from 'vue';
|
||||
import { useRuleFormItem } from '/@/hooks/component/useFormItem';
|
||||
import { propTypes } from '/@/utils/propTypes';
|
||||
import { useAttrs } from '/@/hooks/core/useAttrs';
|
||||
import { getDictItems, getDictItemsByOrgCode } from '/@/api/common/api';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { setPopContainer } from '/@/utils';
|
||||
|
||||
const { createMessage, createErrorModal } = useMessage();
|
||||
export default defineComponent({
|
||||
name: 'JSelectMultiple',
|
||||
components: {},
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
value: propTypes.oneOfType([propTypes.string, propTypes.array]),
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '请选择',
|
||||
required: false,
|
||||
},
|
||||
readOnly: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
options: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
required: false,
|
||||
},
|
||||
triggerChange: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true,
|
||||
},
|
||||
spliter: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ',',
|
||||
},
|
||||
popContainer: {
|
||||
type: String,
|
||||
default: '',
|
||||
required: false,
|
||||
},
|
||||
dictCode: {
|
||||
type: String,
|
||||
required: false,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
useDicColor: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
const { createMessage, createErrorModal } = useMessage();
|
||||
export default defineComponent({
|
||||
name: 'JSelectMultiple',
|
||||
components: {},
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
value: propTypes.oneOfType([propTypes.string, propTypes.array]),
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '请选择',
|
||||
required: false,
|
||||
},
|
||||
emits: ['options-change', 'change', 'input', 'update:value'],
|
||||
setup(props, { emit, refs }) {
|
||||
//console.info(props);
|
||||
const emitData = ref<any[]>([]);
|
||||
const arrayValue = ref<any[]>(!props.value ? [] : props.value.split(props.spliter));
|
||||
const dictOptions = ref<any[]>([]);
|
||||
const attrs = useAttrs();
|
||||
const [state, , , formItemContext] = useRuleFormItem(props, 'value', 'change', emitData);
|
||||
readOnly: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
options: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
required: false,
|
||||
},
|
||||
triggerChange: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true,
|
||||
},
|
||||
spliter: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ',',
|
||||
},
|
||||
popContainer: {
|
||||
type: String,
|
||||
default: '',
|
||||
required: false,
|
||||
},
|
||||
dictCode: {
|
||||
type: String,
|
||||
required: false,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
useDicColor: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
orgCode: '',//组织机构编码 会切换数据源
|
||||
},
|
||||
emits: ['options-change', 'change', 'input', 'update:value'],
|
||||
setup(props, { emit, refs }) {
|
||||
//console.info(props);
|
||||
const emitData = ref<any[]>([]);
|
||||
const arrayValue = ref<any[]>(!props.value ? [] : props.value.split(props.spliter));
|
||||
const dictOptions = ref<any[]>([]);
|
||||
const attrs = useAttrs();
|
||||
const [state, , , formItemContext] = useRuleFormItem(props, 'value', 'change', emitData);
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(() => {
|
||||
if (props.dictCode) {
|
||||
loadDictOptions();
|
||||
} else {
|
||||
dictOptions.value = props.options;
|
||||
}
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.dictCode,
|
||||
() => {
|
||||
if (props.dictCode) {
|
||||
loadDictOptions();
|
||||
} else {
|
||||
dictOptions.value = props.options;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
(val) => {
|
||||
if (!val) {
|
||||
arrayValue.value = [];
|
||||
} else {
|
||||
arrayValue.value = props.value.split(props.spliter);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
//适用于 动态改变下拉选项的操作
|
||||
watch(() => props.options, () => {
|
||||
if (props.dictCode) {
|
||||
// nothing to do
|
||||
} else {
|
||||
dictOptions.value = props.options;
|
||||
}
|
||||
});
|
||||
|
||||
function onChange(selectedValue) {
|
||||
if (props.triggerChange) {
|
||||
emit('change', selectedValue.join(props.spliter));
|
||||
emit('update:value', selectedValue.join(props.spliter));
|
||||
} else {
|
||||
emit('input', selectedValue.join(props.spliter));
|
||||
emit('update:value', selectedValue.join(props.spliter));
|
||||
}
|
||||
// update-begin--author:liaozhiyang---date:20240429---for:【QQYUN-9110】组件有值校验没消失
|
||||
nextTick(() => {
|
||||
formItemContext?.onFieldChange();
|
||||
});
|
||||
// update-end--author:liaozhiyang---date:20240429---for:【QQYUN-9110】组件有值校验没消失
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.dictCode,
|
||||
() => {
|
||||
if (props.dictCode) {
|
||||
loadDictOptions();
|
||||
} else {
|
||||
dictOptions.value = props.options;
|
||||
}
|
||||
}
|
||||
);
|
||||
function getParentContainer(node) {
|
||||
if (!props.popContainer) {
|
||||
return node?.parentNode;
|
||||
} else {
|
||||
// update-begin--author:liaozhiyang---date:20240517---for:【QQYUN-9339】有多个modal弹窗内都有下拉字典多选和下拉搜索组件时,打开另一个modal时组件的options不展示
|
||||
return setPopContainer(node, props.popContainer);
|
||||
// update-end--author:liaozhiyang---date:20240517---for:【QQYUN-9339】有多个modal弹窗内都有下拉字典多选和下拉搜索组件时,打开另一个modal时组件的options不展示
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
(val) => {
|
||||
if (!val) {
|
||||
arrayValue.value = [];
|
||||
// 根据字典code查询字典项
|
||||
function loadDictOptions() {
|
||||
//update-begin-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
||||
let temp = props.dictCode || '';
|
||||
if (temp.indexOf(',') > 0 && temp.indexOf(' ') > 0) {
|
||||
// 编码后 是不包含空格的
|
||||
temp = encodeURI(temp);
|
||||
}
|
||||
//update-end-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
||||
if (!!props.orgCode) {
|
||||
getDictItemsByOrgCode(temp, props.orgCode).then((res) => {
|
||||
if (res) {
|
||||
dictOptions.value = res.map((item) => ({ value: item.value, label: item.text, color: item.color }));
|
||||
//console.info('res', dictOptions.value);
|
||||
} else {
|
||||
arrayValue.value = props.value.split(props.spliter);
|
||||
console.error('getDictItems error: : ', res);
|
||||
dictOptions.value = [];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
//适用于 动态改变下拉选项的操作
|
||||
watch(()=>props.options, ()=>{
|
||||
if (props.dictCode) {
|
||||
// nothing to do
|
||||
} else {
|
||||
dictOptions.value = props.options;
|
||||
}
|
||||
});
|
||||
|
||||
function onChange(selectedValue) {
|
||||
if (props.triggerChange) {
|
||||
emit('change', selectedValue.join(props.spliter));
|
||||
emit('update:value', selectedValue.join(props.spliter));
|
||||
} else {
|
||||
emit('input', selectedValue.join(props.spliter));
|
||||
emit('update:value', selectedValue.join(props.spliter));
|
||||
}
|
||||
// update-begin--author:liaozhiyang---date:20240429---for:【QQYUN-9110】组件有值校验没消失
|
||||
nextTick(() => {
|
||||
formItemContext?.onFieldChange();
|
||||
});
|
||||
// update-end--author:liaozhiyang---date:20240429---for:【QQYUN-9110】组件有值校验没消失
|
||||
}
|
||||
|
||||
function getParentContainer(node) {
|
||||
if (!props.popContainer) {
|
||||
return node?.parentNode;
|
||||
} else {
|
||||
// update-begin--author:liaozhiyang---date:20240517---for:【QQYUN-9339】有多个modal弹窗内都有下拉字典多选和下拉搜索组件时,打开另一个modal时组件的options不展示
|
||||
return setPopContainer(node, props.popContainer);
|
||||
// update-end--author:liaozhiyang---date:20240517---for:【QQYUN-9339】有多个modal弹窗内都有下拉字典多选和下拉搜索组件时,打开另一个modal时组件的options不展示
|
||||
}
|
||||
}
|
||||
|
||||
// 根据字典code查询字典项
|
||||
function loadDictOptions() {
|
||||
//update-begin-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
||||
let temp = props.dictCode || '';
|
||||
if (temp.indexOf(',') > 0 && temp.indexOf(' ') > 0) {
|
||||
// 编码后 是不包含空格的
|
||||
temp = encodeURI(temp);
|
||||
}
|
||||
//update-end-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
||||
} else {
|
||||
getDictItems(temp).then((res) => {
|
||||
if (res) {
|
||||
dictOptions.value = res.map((item) => ({ value: item.value, label: item.text, color:item.color }));
|
||||
dictOptions.value = res.map((item) => ({ value: item.value, label: item.text, color: item.color }));
|
||||
//console.info('res', dictOptions.value);
|
||||
} else {
|
||||
console.error('getDictItems error: : ', res);
|
||||
|
@ -166,34 +172,35 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//update-begin-author:taoyan date:2022-5-31 for: VUEN-1145 下拉多选,搜索时,查不到数据
|
||||
function filterOption(input, option) {
|
||||
return option.children()[0].children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
}
|
||||
//update-end-author:taoyan date:2022-5-31 for: VUEN-1145 下拉多选,搜索时,查不到数据
|
||||
//update-begin-author:taoyan date:2022-5-31 for: VUEN-1145 下拉多选,搜索时,查不到数据
|
||||
function filterOption(input, option) {
|
||||
return option.children()[0].children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
}
|
||||
//update-end-author:taoyan date:2022-5-31 for: VUEN-1145 下拉多选,搜索时,查不到数据
|
||||
|
||||
return {
|
||||
state,
|
||||
attrs,
|
||||
dictOptions,
|
||||
onChange,
|
||||
arrayValue,
|
||||
getParentContainer,
|
||||
filterOption,
|
||||
};
|
||||
},
|
||||
});
|
||||
return {
|
||||
state,
|
||||
attrs,
|
||||
dictOptions,
|
||||
onChange,
|
||||
arrayValue,
|
||||
getParentContainer,
|
||||
filterOption,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style scoped lang='less'>
|
||||
.colorText{
|
||||
.colorText {
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
padding: 0 6px;
|
||||
border-radius: 8px;
|
||||
background-color: red;
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
padding: 0 6px;
|
||||
border-radius: 8px;
|
||||
background-color: red;
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -22,16 +22,16 @@ export const getDictItemsByCode = (code) => {
|
|||
//update-end-author:liusq---date:2023-10-13--for:【issues/777】列表 分类字典不显示
|
||||
|
||||
// update-end--author:liaozhiyang---date:20230908---for:【QQYUN-6417】生产环境字典慢的问题
|
||||
|
||||
};
|
||||
/**
|
||||
* 获取字典数组
|
||||
* @param dictCode 字典Code
|
||||
* @param orgCode 机构编码 查询相应数据源字典
|
||||
* @return List<Map>
|
||||
*/
|
||||
export const initDictOptions = (code) => {
|
||||
export const initDictOptions = (code, orgCode = '') => {
|
||||
//1.优先从缓存中读取字典配置
|
||||
if (getDictItemsByCode(code)) {
|
||||
if (getDictItemsByCode(code) && !orgCode) {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve(getDictItemsByCode(code));
|
||||
});
|
||||
|
@ -43,7 +43,11 @@ export const initDictOptions = (code) => {
|
|||
code = encodeURI(code);
|
||||
}
|
||||
//update-end-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
||||
return defHttp.get({ url: `/sys/dict/getDictItems/${code}` });
|
||||
if (!orgCode) {
|
||||
return defHttp.get({ url: `/sys/dict/getDictItems/${code}` });
|
||||
} else {
|
||||
return defHttp.get({ url: `/sys/dict/getDictItems/${code}/${orgCode}` });
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 获取字典数组
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/directiveTag/directiveTag/list',
|
||||
save='/directiveTag/directiveTag/add',
|
||||
edit='/directiveTag/directiveTag/edit',
|
||||
deleteOne = '/directiveTag/directiveTag/delete',
|
||||
deleteBatch = '/directiveTag/directiveTag/deleteBatch',
|
||||
importExcel = '/directiveTag/directiveTag/importExcel',
|
||||
exportXls = '/directiveTag/directiveTag/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 });
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
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: 'tagName'
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
align: "center",
|
||||
dataIndex: 'sort'
|
||||
},
|
||||
{
|
||||
title: '是否启用',
|
||||
align: "center",
|
||||
dataIndex: 'izEnabled_dictText'
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
tagName: {title: '标签名称',order: 0,view: 'text', type: 'string',},
|
||||
sort: {title: '排序',order: 1,view: 'number', type: 'number',},
|
||||
izEnabled: {title: '是否启用',order: 2,view: 'radio', type: 'string',dictCode: 'iz_enabled',},
|
||||
};
|
|
@ -1,278 +0,0 @@
|
|||
<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="tagName">
|
||||
<template #label><span title="标签名称">标签名称</span></template>
|
||||
<JInput v-model:value="queryParam.tagName" 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" :rowSelection="rowSelection">
|
||||
<!--插槽: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>
|
||||
<!-- 表单区域 -->
|
||||
<DirectiveTagModal ref="registerModal" @success="handleSuccess"></DirectiveTagModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="directiveTag-directiveTag" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './DirectiveTag.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './DirectiveTag.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import DirectiveTagModal from './components/DirectiveTagModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.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,
|
||||
pagination: {
|
||||
current: 1,
|
||||
pageSize: 50,
|
||||
pageSizeOptions: ['50', '70', '100'],
|
||||
},
|
||||
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),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
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>
|
|
@ -1,161 +0,0 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="DirectiveTagForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="标签名称" v-bind="validateInfos.tagName" id="DirectiveTagForm-tagName" name="tagName">
|
||||
<a-input v-model:value="formData.tagName" placeholder="请输入标签名称" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="排序" v-bind="validateInfos.sort" id="DirectiveTagForm-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="DirectiveTagForm-izEnabled" name="izEnabled">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.izEnabled" dictCode="iz_enabled" placeholder="请选择是否启用" allow-clear />
|
||||
</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 '../DirectiveTag.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: '',
|
||||
tagName: '',
|
||||
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({
|
||||
tagName: [{ 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>
|
|
@ -1,77 +0,0 @@
|
|||
<template>
|
||||
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<DirectiveTagForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></DirectiveTagForm>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import DirectiveTagForm from './DirectiveTagForm.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>
|
|
@ -1,72 +0,0 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/serviceCategory/configServiceCategory/list',
|
||||
save='/serviceCategory/configServiceCategory/add',
|
||||
edit='/serviceCategory/configServiceCategory/edit',
|
||||
deleteOne = '/serviceCategory/configServiceCategory/delete',
|
||||
deleteBatch = '/serviceCategory/configServiceCategory/deleteBatch',
|
||||
importExcel = '/serviceCategory/configServiceCategory/importExcel',
|
||||
exportXls = '/serviceCategory/configServiceCategory/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 });
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
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: 'categoryName'
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
align: "center",
|
||||
sorter: true,
|
||||
dataIndex: 'sort'
|
||||
},
|
||||
{
|
||||
title: '是否启用',
|
||||
align: "center",
|
||||
dataIndex: 'izEnabled_dictText'
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
categoryName: {title: '服务类别',order: 0,view: 'text', type: 'string',},
|
||||
sort: {title: '排序',order: 1,view: 'number', type: 'number',},
|
||||
izEnabled: {title: '是否启用',order: 2,view: 'radio', type: 'string',dictCode: '',},
|
||||
};
|
|
@ -1,274 +0,0 @@
|
|||
<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="categoryName">
|
||||
<template #label><span title="服务类别">服务类别</span></template>
|
||||
<JInput v-model:value="queryParam.categoryName" 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" :rowSelection="rowSelection">
|
||||
<!--插槽: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>
|
||||
<!-- 表单区域 -->
|
||||
<ConfigServiceCategoryModal ref="registerModal" @success="handleSuccess"></ConfigServiceCategoryModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="serviceCategory-configServiceCategory" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './ConfigServiceCategory.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ConfigServiceCategory.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import ConfigServiceCategoryModal from './components/ConfigServiceCategoryModal.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),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
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>
|
|
@ -1,165 +0,0 @@
|
|||
<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.categoryName"
|
||||
id="ConfigServiceCategoryForm-categoryName" name="categoryName">
|
||||
<a-input v-model:value="formData.categoryName" 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 '../ConfigServiceCategory.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: '',
|
||||
categoryName: '',
|
||||
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({
|
||||
categoryName: [{ 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>
|
|
@ -1,77 +0,0 @@
|
|||
<template>
|
||||
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<ConfigServiceCategoryForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ConfigServiceCategoryForm>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import ConfigServiceCategoryForm from './ConfigServiceCategoryForm.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>
|
|
@ -1,487 +0,0 @@
|
|||
<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="categoryId">
|
||||
<template #label><span title="服务类别">服务类别</span></template>
|
||||
<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`"
|
||||
:ignoreDisabled="true" placeholder="请选择服务类别" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="typeId">
|
||||
<template #label><span title="服务类型">服务类型</span></template>
|
||||
<j-dict-select-tag type="list" v-model:value="queryParam.typeId"
|
||||
:dictCode="`nu_config_service_type,type_name,id,del_flag = 0 order by sort asc`" placeholder="请选择服务类型"
|
||||
:ignoreDisabled="true" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- <template v-if="toggleSearchStatus"> -->
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="directiveName">
|
||||
<template #label><span title="服务指令">服务指令</span></template>
|
||||
<JInput v-model:value="queryParam.directiveName" placeholder="请输入服务指令名称" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="instructionTagId">
|
||||
<template #label><span title="分类标签">分类标签</span></template>
|
||||
<j-dict-select-tag v-model:value="queryParam.instructionTagId" dictCode="instruction_tag"
|
||||
:ignoreDisabled="true" placeholder="请选分类标签" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- <a-col :lg="6">
|
||||
<a-form-item name="tollPrice">
|
||||
<template #label><span title="收费价格">收费价格</span></template>
|
||||
<JRangeNumber v-model:value="queryParam.tollPrice" class="query-group-cust"></JRangeNumber>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="comPrice">
|
||||
<template #label><span title="提成价格">提成价格</span></template>
|
||||
<JRangeNumber v-model:value="queryParam.comPrice" class="query-group-cust"></JRangeNumber>
|
||||
</a-form-item>
|
||||
</a-col> -->
|
||||
<!-- <a-col :lg="6">
|
||||
<a-form-item name="izReimbursement">
|
||||
<template #label><span title="医保报销">医保报销</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.izReimbursement" dictCode="med_ins_reimb"
|
||||
:ignoreDisabled="true" placeholder="请选择医保报销" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="izPreferential">
|
||||
<template #label><span title="机构优惠">机构优惠</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.izPreferential" dictCode="institutional_discount"
|
||||
:ignoreDisabled="true" placeholder="请选择机构优惠" allowClear />
|
||||
</a-form-item>
|
||||
</a-col> -->
|
||||
<!-- <a-col :lg="6">
|
||||
<a-form-item name="chargingFrequency">
|
||||
<template #label><span title="收费频次">收费频次</span></template>
|
||||
<j-dict-select-tag type="list" v-model:value="queryParam.chargingFrequency" dictCode="billing_frequency"
|
||||
:ignoreDisabled="true" placeholder="请选择收费频次" allowClear />
|
||||
</a-form-item>
|
||||
</a-col> -->
|
||||
<!-- <a-col :lg="6">
|
||||
<a-form-item name="cycleType">
|
||||
<template #label><span title="周期类型">周期类型</span></template>
|
||||
<j-dict-select-tag type="list" v-model:value="queryParam.cycleType" dictCode="period_type"
|
||||
:ignoreDisabled="true" placeholder="请选择周期类型" allowClear />
|
||||
</a-form-item>
|
||||
</a-col> -->
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="tags">
|
||||
<template #label><span title="指令标签">指令标签</span></template>
|
||||
<JSelectMultiple type="list" v-model:value="queryParam.tags"
|
||||
:dictCode="`nu_config_directive_tag,tag_name,id,del_flag = '0' order by sort asc`"
|
||||
:ignoreDisabled="true" placeholder="请选择指令标签" allowClear />
|
||||
</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>
|
||||
<!-- </template> -->
|
||||
<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" v-auth="'serviceDirective:config_service_directive:add'" @click="handleCategory"
|
||||
preIcon="tabler:settings">配置服务类别</a-button>
|
||||
<a-button type="primary" v-auth="'serviceDirective:config_service_directive:add'" @click="handleType"
|
||||
preIcon="tabler:settings">配置服务类型</a-button>
|
||||
<a-button type="primary" v-auth="'serviceDirective:config_service_directive:add'" @click="handleTag"
|
||||
preIcon="tabler:settings">配置指令标签</a-button>
|
||||
<a-button type="primary" v-auth="'serviceDirective:config_service_directive:add'" @click="handleAdd"
|
||||
preIcon="ant-design:plus-outlined">新增服务指令</a-button>
|
||||
<!-- <a-button type="primary" v-auth="'serviceDirective:config_service_directive:exportXls'"
|
||||
preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<j-upload-button type="primary" v-auth="'serviceDirective:config_service_directive:importExcel'"
|
||||
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 v-auth="'serviceDirective:config_service_directive:deleteBatch'">批量操作
|
||||
<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 v-if="column.dataIndex === 'mp3File'">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<audio controls v-else style="width: 100%; max-width: 300px; height: 40px;">
|
||||
<source :src="getFileAccessHttpUrl(text)">
|
||||
</audio>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'mp4File'">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<template v-else>
|
||||
<a-button type="primary" @click="openVideoModal(text)">播放视频</a-button>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<ConfigServiceDirectiveModal ref="registerModal" @success="handleSuccess"></ConfigServiceDirectiveModal>
|
||||
</div>
|
||||
|
||||
<!-- 服务类别 -->
|
||||
<a-drawer title="服务类别" width="60vw" :open="categoryOpen" @close="onCategoryClose">
|
||||
<template #footer>
|
||||
<a-button type="primary" @click="onCategoryClose" style="float: right;">关闭</a-button>
|
||||
</template>
|
||||
<ConfigServiceCategoryList v-if="categoryOpen"></ConfigServiceCategoryList>
|
||||
</a-drawer>
|
||||
|
||||
<!-- 服务类型 -->
|
||||
<a-drawer title="服务类型" width="60vw" :open="typeOpen" @close="onTypeClose">
|
||||
<template #footer>
|
||||
<a-button type="primary" @click="onTypeClose" style="float: right;">关闭</a-button>
|
||||
</template>
|
||||
<ConfigServiceTypeList v-if="typeOpen"></ConfigServiceTypeList>
|
||||
</a-drawer>
|
||||
|
||||
<!-- 指令标签 -->
|
||||
<a-drawer title="指令标签" width="60vw" :open="tagOpen" @close="onTagClose">
|
||||
<template #footer>
|
||||
<a-button type="primary" @click="onTagClose" style="float: right;">关闭</a-button>
|
||||
</template>
|
||||
<DirectiveTagList v-if="tagOpen"></DirectiveTagList>
|
||||
</a-drawer>
|
||||
|
||||
<!-- 视频播放 -->
|
||||
<a-modal v-model:visible="showVideoModal" title="视频播放" :footer="null" @cancel="closeVideoModal"
|
||||
:bodyStyle="{ padding: '0', maxHeight: '80vh', overflow: 'auto' }">
|
||||
<video controls style="width: 100%; max-height: 70vh; display: block; margin: 0 auto;">
|
||||
<source :src="videoUrl">
|
||||
您的浏览器不支持视频播放。
|
||||
</video>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="serviceDirective-configServiceDirective" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './ConfigServiceDirective.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ConfigServiceDirective.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import ConfigServiceDirectiveModal from './components/ConfigServiceDirectiveModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JRangeNumber from "/@/components/Form/src/jeecg/components/JRangeNumber.vue";
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { cloneDeep } from "lodash-es";
|
||||
import ConfigServiceCategoryList from '../serviceCategory/ConfigServiceCategoryList.vue';
|
||||
import ConfigServiceTypeList from '../serviceType/ConfigServiceTypeList.vue';
|
||||
import DirectiveTagList from '../directiveTag/DirectiveTagList.vue';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.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,
|
||||
showIndexColumn: true,
|
||||
actionColumn: {
|
||||
width: 160,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
params.column = 'createTime'
|
||||
params.order = 'desc'
|
||||
let rangerQuery = await setRangeQuery();
|
||||
return Object.assign(params, rangerQuery);
|
||||
},
|
||||
},
|
||||
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: 6,
|
||||
xxl: 4
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
const categoryOpen = ref(false)//服务类别抽屉
|
||||
const typeOpen = ref(false)//服务类型抽屉
|
||||
const tagOpen = ref(false)//指令标签抽屉
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
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),
|
||||
auth: 'serviceDirective:config_service_directive:edit'
|
||||
}, {
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'serviceDirective:config_service_directive:delete'
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let rangeField = 'tollPrice,comPrice,'
|
||||
|
||||
/**
|
||||
* 设置范围查询条件
|
||||
*/
|
||||
async function setRangeQuery() {
|
||||
let queryParamClone = cloneDeep(queryParam);
|
||||
if (rangeField) {
|
||||
let fieldsValue = rangeField.split(',');
|
||||
fieldsValue.forEach(item => {
|
||||
if (queryParamClone[item]) {
|
||||
let range = queryParamClone[item];
|
||||
queryParamClone[item + '_begin'] = range[0];
|
||||
queryParamClone[item + '_end'] = range[1];
|
||||
delete queryParamClone[item];
|
||||
} else {
|
||||
queryParamClone[item + '_begin'] = '';
|
||||
queryParamClone[item + '_end'] = '';
|
||||
}
|
||||
})
|
||||
}
|
||||
return queryParamClone;
|
||||
}
|
||||
|
||||
//服务类别抽屉打开
|
||||
function handleCategory() {
|
||||
categoryOpen.value = true
|
||||
}
|
||||
//服务类型抽屉打开
|
||||
function handleType() {
|
||||
typeOpen.value = true
|
||||
}
|
||||
//指令标签抽屉打开
|
||||
function handleTag() {
|
||||
tagOpen.value = true
|
||||
}
|
||||
//服务类别抽屉关闭
|
||||
function onCategoryClose() {
|
||||
categoryOpen.value = false
|
||||
}
|
||||
|
||||
//服务类型抽屉关闭
|
||||
function onTypeClose() {
|
||||
typeOpen.value = false
|
||||
}
|
||||
//指令标签抽屉关闭
|
||||
function onTagClose() {
|
||||
tagOpen.value = false
|
||||
}
|
||||
|
||||
|
||||
const showVideoModal = ref(false); // 控制模态框显示
|
||||
const videoUrl = ref(''); // 视频 URL
|
||||
|
||||
// 打开视频模态框
|
||||
const openVideoModal = (url) => {
|
||||
videoUrl.value = getFileAccessHttpUrl(url);
|
||||
showVideoModal.value = true;
|
||||
};
|
||||
|
||||
// 关闭视频模态框
|
||||
const closeVideoModal = () => {
|
||||
showVideoModal.value = false;
|
||||
videoUrl.value = '';
|
||||
};
|
||||
</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%;
|
||||
}
|
||||
}
|
||||
|
||||
audio::-webkit-media-controls-timeline {
|
||||
display: none;
|
||||
}
|
||||
|
||||
audio::-webkit-media-controls-current-time-display,
|
||||
audio::-webkit-media-controls-time-remaining-display {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
|
@ -1,74 +0,0 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/ServiceType/configServiceType/list',
|
||||
save='/ServiceType/configServiceType/add',
|
||||
edit='/ServiceType/configServiceType/edit',
|
||||
deleteOne = '/ServiceType/configServiceType/delete',
|
||||
deleteBatch = '/ServiceType/configServiceType/deleteBatch',
|
||||
importExcel = '/ServiceType/configServiceType/importExcel',
|
||||
exportXls = '/ServiceType/configServiceType/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 });
|
||||
}
|
||||
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
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: 'categoryId_dictText'
|
||||
},
|
||||
{
|
||||
title: '服务类型',
|
||||
align: "center",
|
||||
dataIndex: 'typeName'
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
align: "center",
|
||||
sorter: true,
|
||||
dataIndex: 'sort'
|
||||
},
|
||||
{
|
||||
title: '是否启用',
|
||||
align: "center",
|
||||
dataIndex: 'izEnabled_dictText'
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
categoryId: {title: '服务类别id',order: 0,view: 'list', type: 'string',dictCode: '',},
|
||||
typeName: {title: '服务类型名称',order: 1,view: 'text', type: 'string',},
|
||||
sort: {title: '排序',order: 2,view: 'number', type: 'number',},
|
||||
izEnabled: {title: '是否启用',order: 3,view: 'text', type: 'string',},
|
||||
};
|
|
@ -1,282 +0,0 @@
|
|||
<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="categoryId">
|
||||
<template #label><span title="服务类别">服务类别</span></template>
|
||||
<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`"
|
||||
:ignoreDisabled="true" placeholder="请选择服务类别" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="typeName">
|
||||
<template #label><span title="服务类型">服务类型</span></template>
|
||||
<JInput v-model:value="queryParam.typeName" placeholder="请输入服务类型" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<template v-if="toggleSearchStatus">
|
||||
<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>
|
||||
</template>
|
||||
<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" :rowSelection="rowSelection">
|
||||
<!--插槽: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>
|
||||
<!-- 表单区域 -->
|
||||
<ConfigServiceTypeModal ref="registerModal" @success="handleSuccess"></ConfigServiceTypeModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="ServiceType-configServiceType" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './ConfigServiceType.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ConfigServiceType.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import ConfigServiceTypeModal from './components/ConfigServiceTypeModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
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';
|
||||
|
||||
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),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
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>
|
|
@ -1,176 +0,0 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||
name="ConfigServiceTypeForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="ConfigServiceTypeForm-categoryId"
|
||||
name="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`"
|
||||
placeholder="请选择服务类别" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务类型" v-bind="validateInfos.typeName" id="ConfigServiceTypeForm-typeName"
|
||||
name="typeName">
|
||||
<a-input v-model:value="formData.typeName" placeholder="请输入服务类型" allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="排序" v-bind="validateInfos.sort" id="ConfigServiceTypeForm-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="ConfigServiceTypeForm-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 '../ConfigServiceType.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: '',
|
||||
categoryId: '',
|
||||
typeName: '',
|
||||
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({
|
||||
categoryId: [{ required: true, message: '请选择服务类别!' },],
|
||||
typeName: [{ 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>
|
|
@ -1,79 +0,0 @@
|
|||
<template>
|
||||
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk"
|
||||
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<ConfigServiceTypeForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false">
|
||||
</ConfigServiceTypeForm>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import ConfigServiceTypeForm from './ConfigServiceTypeForm.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,17 @@ import { render } from '/@/utils/common/renderUtils';
|
|||
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '分类标签',
|
||||
align: 'center',
|
||||
dataIndex: 'instructionTagId_dictText',
|
||||
width: 100,
|
||||
// customCell: (record, index, column) => {
|
||||
// if (record.instructionRowSpan != null) {
|
||||
// return { rowSpan: record.instructionRowSpan };
|
||||
// }
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '服务类别',
|
||||
align: 'center',
|
||||
|
@ -25,26 +36,29 @@ export const columns: BasicColumn[] = [
|
|||
// }
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '分类标签',
|
||||
align: 'center',
|
||||
dataIndex: 'instructionTagId_dictText',
|
||||
width: 100,
|
||||
// customCell: (record, index, column) => {
|
||||
// if (record.instructionRowSpan != null) {
|
||||
// return { rowSpan: record.instructionRowSpan };
|
||||
// }
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '服务指令名称',
|
||||
align: 'center',
|
||||
dataIndex: 'directiveName',
|
||||
},
|
||||
{
|
||||
title: '指令标签',
|
||||
title: '体型标签',
|
||||
align: 'center',
|
||||
dataIndex: 'tagList',
|
||||
dataIndex: 'bodyTagList',
|
||||
width: 150,
|
||||
ellipsis: false,
|
||||
format(text, record, index) {
|
||||
if (!!text && text.length > 0) {
|
||||
return text.map((item) => item.tagName).join('、');
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '情绪标签',
|
||||
align: 'center',
|
||||
dataIndex: 'emotionTagList',
|
||||
width: 150,
|
||||
ellipsis: false,
|
||||
format(text, record, index) {
|
|
@ -5,10 +5,18 @@
|
|||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||
name="ConfigServiceDirectiveForm">
|
||||
<a-row>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="分类标签" v-bind="validateInfos.instructionTagId"
|
||||
id="ConfigServiceDirectiveForm-instructionTagId" name="instructionTagId">
|
||||
<j-dict-select-tag v-model:value="formData.instructionTagId" v-if="showJMCom" :orgCode="orgCodeParam"
|
||||
dictCode="instruction_tag" placeholder="请选择分类标签" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="ConfigServiceDirectiveForm-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" v-if="showJMCom"
|
||||
:orgCode="orgCodeParam"
|
||||
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 order by sort asc`"
|
||||
placeholder="请选择服务类别" allow-clear />
|
||||
</a-form-item>
|
||||
|
@ -16,15 +24,8 @@
|
|||
<a-col :span="12">
|
||||
<a-form-item label="服务类型" v-bind="validateInfos.typeId" id="ConfigServiceDirectiveForm-typeId"
|
||||
name="typeId">
|
||||
<j-dict-select-tag type="list" v-model:value="formData.typeId" :dictCode="typeDictCode"
|
||||
placeholder="请选择服务类型" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="分类标签" v-bind="validateInfos.instructionTagId"
|
||||
id="ConfigServiceDirectiveForm-instructionTagId" name="instructionTagId">
|
||||
<j-dict-select-tag v-model:value="formData.instructionTagId" dictCode="instruction_tag"
|
||||
placeholder="请选择分类标签" allowClear />
|
||||
<j-dict-select-tag type="list" v-model:value="formData.typeId" :dictCode="typeDictCode" v-if="showJMCom"
|
||||
:orgCode="orgCodeParam" placeholder="请选择服务类型" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
|
@ -33,7 +34,7 @@
|
|||
<a-input v-model:value="formData.directiveName" placeholder="请输入服务指令名称" allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- <a-col :span="12">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="收费价格(元)" v-bind="validateInfos.tollPrice" id="ConfigServiceDirectiveForm-tollPrice"
|
||||
name="tollPrice">
|
||||
<a-input-number v-model:value="formData.tollPrice" placeholder="请输入收费价格" style="width: 100%"
|
||||
|
@ -50,29 +51,22 @@
|
|||
<a-col :span="12">
|
||||
<a-form-item label="医保报销" v-bind="validateInfos.izReimbursement"
|
||||
id="ConfigServiceDirectiveForm-izReimbursement" name="izReimbursement">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.izReimbursement" dictCode="med_ins_reimb"
|
||||
allowClear />
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.izReimbursement" v-if="showJMCom"
|
||||
:orgCode="orgCodeParam" dictCode="med_ins_reimb" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="机构优惠" v-bind="validateInfos.izPreferential"
|
||||
id="ConfigServiceDirectiveForm-izPreferential" name="izPreferential">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.izPreferential"
|
||||
dictCode="institutional_discount" allowClear />
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.izPreferential" v-if="showJMCom"
|
||||
:orgCode="orgCodeParam" dictCode="institutional_discount" allowClear />
|
||||
</a-form-item>
|
||||
</a-col> -->
|
||||
<!-- <a-col :span="12">
|
||||
<a-form-item label="收费频次" v-bind="validateInfos.chargingFrequency"
|
||||
id="ConfigServiceDirectiveForm-chargingFrequency" name="chargingFrequency">
|
||||
<j-dict-select-tag type="list" v-model:value="formData.chargingFrequency" dictCode="billing_frequency"
|
||||
placeholder="请选择收费频次" allowClear />
|
||||
</a-form-item>
|
||||
</a-col> -->
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="周期类型" v-bind="validateInfos.cycleType" id="ConfigServiceDirectiveForm-cycleType"
|
||||
name="cycleType">
|
||||
<j-dict-select-tag type="list" v-model:value="formData.cycleType" dictCode="period_type"
|
||||
placeholder="请选择周期类型" allowClear />
|
||||
<j-dict-select-tag type="list" v-model:value="formData.cycleType" v-if="showJMCom"
|
||||
:orgCode="orgCodeParam" dictCode="period_type" placeholder="请选择周期类型" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
|
@ -96,17 +90,23 @@
|
|||
</a-form-item>
|
||||
</a-col> -->
|
||||
<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">
|
||||
<JCheckbox v-model:value="formData.tags"
|
||||
:dictCode="`nu_config_directive_tag,tag_name,id,del_flag = 0 order by sort asc`" />
|
||||
<JCheckbox v-model:value="formData.bodyTags" v-if="showJMCom" :orgCode="orgCodeParam"
|
||||
:dictCode="`nu_config_body_tag,tag_name,id,del_flag = 0 order by sort asc`" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="情绪标签" :labelCol="labelCol2" :wrapperCol="wrapperCol2" name="emoTags">
|
||||
<JCheckbox v-model:value="formData.emotionTags" v-if="showJMCom" :orgCode="orgCodeParam"
|
||||
:dictCode="`nu_config_emotion_tag,tag_name,id,del_flag = 0 order by sort asc`" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="ConfigServiceDirectiveForm-izEnabled"
|
||||
name="izEnabled">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.izEnabled" dictCode="iz_enabled"
|
||||
placeholder="请选择是否启用" allowClear />
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.izEnabled" v-if="showJMCom"
|
||||
:orgCode="orgCodeParam" dictCode="iz_enabled" placeholder="请选择是否启用" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- <a-col :span="12">
|
||||
|
@ -152,13 +152,13 @@
|
|||
<a-col :span="12">
|
||||
<a-form-item label="语音文件" v-bind="validateInfos.mp3File" id="ConfigServiceDirectiveForm-mp3File"
|
||||
name="mp3File">
|
||||
<j-upload v-model:value="formData.mp3File" accept=".mp3" :maxCount="1"></j-upload>
|
||||
<j-upload v-model:value="formData.mp3File" accept=".mp3" :disabled="true" :maxCount="1"></j-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="视频文件" v-bind="validateInfos.mp4File" id="ConfigServiceDirectiveForm-mp4File"
|
||||
name="mp4File">
|
||||
<j-upload v-model:value="formData.mp4File" accept=".mp4" :maxCount="1"></j-upload>
|
||||
<j-upload v-model:value="formData.mp4File" accept=".mp4" :disabled="true" :maxCount="1"></j-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
@ -192,8 +192,8 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted, watch } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted, watch, onBeforeMount } from 'vue';
|
||||
import { initDictOptions } from '/@/utils/dict';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { JCheckbox } from '/@/components/Form';
|
||||
|
@ -204,6 +204,15 @@ import { saveOrUpdate } from '../ConfigServiceDirective.api';
|
|||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
|
||||
const orgCodeParam = ref('')
|
||||
const showJMCom = ref(false)
|
||||
onBeforeMount(async () => {
|
||||
const dictData = await initDictOptions('org_code')
|
||||
orgCodeParam.value = dictData.filter(d => d.text == 'shi_yan_tian')[0].value
|
||||
showJMCom.value = true
|
||||
})
|
||||
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({}) },
|
||||
|
@ -315,7 +324,8 @@ function add() {
|
|||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
formData.tags = ''
|
||||
formData.bodyTags = ''
|
||||
formData.emotionTags = ''
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
|
@ -365,7 +375,7 @@ async function submitForm() {
|
|||
}
|
||||
|
||||
//提成价格不能高于收费价格
|
||||
if (!!model.comPrice && model.tollPrice <= model.comPrice) {
|
||||
if (model.comPrice != 0 && model.tollPrice <= model.comPrice) {
|
||||
createMessage.warning('提成价格不能高于收费价格!');
|
||||
confirmLoading.value = false;
|
||||
retrun;
|
|
@ -28,7 +28,7 @@
|
|||
<span v-if="!orgData" class="base-info-dn" style="color: #ff4d4f;"> 请先选择机构</span>
|
||||
<span v-else class="org-name">{{ orgData?.departName }}</span>
|
||||
</div>
|
||||
<a-button v-if="orgData" class="reset-btn" type="primary" @click.stop="handleResetOrg">
|
||||
<a-button v-if="!orgSelectedCon" class="reset-btn" type="primary" @click.stop="handleResetOrg">
|
||||
<span>重新选择</span>
|
||||
</a-button>
|
||||
</div>
|
||||
|
@ -81,6 +81,7 @@
|
|||
<a-form-item name="categoryId">
|
||||
<template #label><span title="服务类别">服务类别</span></template>
|
||||
<j-dict-select-tag type="list" v-model:value="queryParam.categoryId"
|
||||
v-if="showJMCom" :orgCode="orgCodeParam"
|
||||
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 order by sort asc`"
|
||||
:ignoreDisabled="true" placeholder="请选择服务类别" allow-clear />
|
||||
</a-form-item>
|
||||
|
@ -88,7 +89,8 @@
|
|||
<a-col :lg="6">
|
||||
<a-form-item name="typeId">
|
||||
<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" v-if="showJMCom"
|
||||
:orgCode="orgCodeParam"
|
||||
:dictCode="`nu_config_service_type,type_name,id,del_flag = 0 order by sort asc`"
|
||||
placeholder="请选择服务类型" :ignoreDisabled="true" allowClear />
|
||||
</a-form-item>
|
||||
|
@ -104,17 +106,27 @@
|
|||
<a-col :lg="6">
|
||||
<a-form-item name="instructionTagId">
|
||||
<template #label><span title="分类标签">分类标签</span></template>
|
||||
<j-dict-select-tag v-model:value="queryParam.instructionTagId"
|
||||
dictCode="instruction_tag" :ignoreDisabled="true" placeholder="请选分类标签"
|
||||
allowClear />
|
||||
<j-dict-select-tag v-model:value="queryParam.instructionTagId" v-if="showJMCom"
|
||||
:orgCode="orgCodeParam" dictCode="instruction_tag" :ignoreDisabled="true"
|
||||
placeholder="请选分类标签" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="tags">
|
||||
<template #label><span title="指令标签">指令标签</span></template>
|
||||
<JSelectMultiple type="list" v-model:value="queryParam.tags"
|
||||
:dictCode="`nu_config_directive_tag,tag_name,id,del_flag = '0' order by sort asc`"
|
||||
:ignoreDisabled="true" placeholder="请选择指令标签" allowClear />
|
||||
<a-form-item name="bodyTags">
|
||||
<template #label><span title="体型标签">体型标签</span></template>
|
||||
<JSelectMultiple type="list" v-model:value="queryParam.bodyTags" v-if="showJMCom"
|
||||
:orgCode="orgCodeParam"
|
||||
:dictCode="`nu_config_body_tag,tag_name,id,del_flag = '0' order by sort asc`"
|
||||
:ignoreDisabled="true" placeholder="请选择体型标签" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="emotionTags">
|
||||
<template #label><span title="情绪标签">情绪标签</span></template>
|
||||
<JSelectMultiple type="list" v-model:value="queryParam.emotionTags" v-if="showJMCom"
|
||||
:orgCode="orgCodeParam"
|
||||
:dictCode="`nu_config_emotion_tag,tag_name,id,del_flag = '0' order by sort asc`"
|
||||
:ignoreDisabled="true" placeholder="请选择情绪标签" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
|
@ -191,7 +203,7 @@
|
|||
<a-radio-button value="unselected">未选择</a-radio-button>
|
||||
</a-radio-group>
|
||||
</div>
|
||||
<ConfigServiceDirectiveListCom @select-change="handleSelectChange" ref="listComRef"
|
||||
<ConfigServiceDirectiveList @select-change="handleSelectChange" ref="listComRef"
|
||||
:queryParams="queryParam" :initialDataIds="initialDataIds" />
|
||||
</a-col>
|
||||
<a-col :span="selectedScreenSpan">
|
||||
|
@ -232,11 +244,19 @@
|
|||
播放视频
|
||||
</a-button>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'tagList'">
|
||||
<span v-if="!record.tagList || record.tagList.length === 0"
|
||||
<template v-else-if="column.dataIndex === 'bodyTagList'">
|
||||
<span v-if="!record.bodyTagList || record.bodyTagList.length === 0"
|
||||
style="font-size: 12px;font-style: italic;">-</span>
|
||||
<template v-else>
|
||||
{{record.tagList.map(item => item.tagName).join('、')}}
|
||||
{{record.bodyTagList.map(item => item.tagName).join('、')}}
|
||||
</template>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'emotionTagList'">
|
||||
<span
|
||||
v-if="!record.emotionTagList || record.emotionTagList.length === 0"
|
||||
style="font-size: 12px;font-style: italic;">-</span>
|
||||
<template v-else>
|
||||
{{record.emotionTagList.map(item => item.tagName).join('、')}}
|
||||
</template>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'previewFile'">
|
||||
|
@ -314,9 +334,10 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" name="synchronization-directive" setup>
|
||||
import { ref, reactive, onMounted, computed } from 'vue';
|
||||
import ConfigServiceDirectiveListCom from '@/views/serviceDirective/serviceDirective/ConfigServiceDirectiveListCom.vue'
|
||||
import { list, asyncFunc } from '@/views/serviceDirective/serviceDirective/ConfigServiceDirective.api';
|
||||
import { ref, reactive, onMounted, computed, onBeforeMount } from 'vue';
|
||||
import { initDictOptions } from '/@/utils/dict';
|
||||
import ConfigServiceDirectiveList from '@/views/services/serviceDirective/ConfigServiceDirectiveList.vue'
|
||||
import { list, asyncFunc } from '@/views/services/serviceDirective/ConfigServiceDirective.api';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { queryDepartTreeSync } from '/@/api/common/api';
|
||||
import { Empty } from 'ant-design-vue';
|
||||
|
@ -328,6 +349,13 @@ import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
|||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
||||
|
||||
const orgCodeParam = ref('')
|
||||
const showJMCom = ref(false)
|
||||
onBeforeMount(async () => {
|
||||
const dictData = await initDictOptions('org_code')
|
||||
orgCodeParam.value = dictData.filter(d => d.text == 'shi_yan_tian')[0].value
|
||||
showJMCom.value = true
|
||||
})
|
||||
const initialDataIds = ref<string[]>([]);
|
||||
const formRef = ref();
|
||||
const { createMessage } = useMessage();
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
export const selectedColumns = [
|
||||
{
|
||||
title: '分类标签',
|
||||
align: 'center',
|
||||
dataIndex: 'instructionTagId_dictText',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: '服务类别',
|
||||
align: 'center',
|
||||
|
@ -11,12 +17,6 @@ export const selectedColumns = [
|
|||
dataIndex: 'typeId_dictText',
|
||||
width: 120, // 添加固定宽度
|
||||
},
|
||||
{
|
||||
title: '分类标签',
|
||||
align: 'center',
|
||||
dataIndex: 'instructionTagId_dictText',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: '服务指令名称',
|
||||
align: 'center',
|
||||
|
@ -24,9 +24,16 @@ export const selectedColumns = [
|
|||
width: 150, // 添加固定宽度
|
||||
},
|
||||
{
|
||||
title: '指令标签',
|
||||
title: '体型标签',
|
||||
align: 'center',
|
||||
dataIndex: 'tagList',
|
||||
dataIndex: 'bodyTagList',
|
||||
width: 150,
|
||||
ellipsis: true, // 确保内容过长时显示省略号
|
||||
},
|
||||
{
|
||||
title: '情绪标签',
|
||||
align: 'center',
|
||||
dataIndex: 'emotionTagList',
|
||||
width: 150,
|
||||
ellipsis: true, // 确保内容过长时显示省略号
|
||||
},
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
enum Api {
|
||||
categoryList = '/serviceCategory/configServiceCategory/list',
|
||||
typeList = '/ServiceType/configServiceType/list',
|
||||
bodyTagsList = '/directiveTag/bodyTag/list',
|
||||
emotionTagsList = '/directiveTag/emotionTag/list',
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 服务类别
|
||||
*/
|
||||
export const categoryList = () => defHttp.get({ url: Api.categoryList });
|
||||
|
||||
/**
|
||||
* 服务类型
|
||||
*/
|
||||
export const typeList = () => defHttp.get({ url: Api.typeList });
|
||||
|
||||
/**
|
||||
* 体型标签
|
||||
*/
|
||||
export const bodyTagsList = () => defHttp.get({ url: Api.bodyTagsList });
|
||||
|
||||
/**
|
||||
* 指令标签
|
||||
*/
|
||||
export const emotionTagsList = () => defHttp.get({ url: Api.emotionTagsList });
|
|
@ -95,6 +95,11 @@ export const dictItemColumns: BasicColumn[] = [
|
|||
dataIndex: 'itemValue',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
dataIndex: 'description',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '字典颜色',
|
||||
dataIndex: 'itemColor',
|
||||
|
|
Loading…
Reference in New Issue