Compare commits
3 Commits
4b88a29ab3
...
ef4c4b7cca
Author | SHA1 | Date |
---|---|---|
|
ef4c4b7cca | |
|
002536f31b | |
|
9e7c7f13e7 |
|
@ -18,7 +18,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { defineProps } from 'vue';
|
||||
import PreviewComponent from './PreviewPickerComponent.vue';
|
||||
import PreviewComponent from './PreviewComponent.vue';
|
||||
|
||||
const props = defineProps({
|
||||
record: {
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
enum Api {
|
||||
sysUrl = '/api/baseInfo/sysUrl',
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取机构配置的协议域名
|
||||
*/
|
||||
export const sysUrl = () => defHttp.get({ url: Api.sysUrl });
|
|
@ -396,7 +396,7 @@ async function submitForm() {
|
|||
}
|
||||
}
|
||||
if(model.status == '2'){
|
||||
model.buildStatus = '3'
|
||||
model.buildStatus = 'approvalPass'//代表加盟审批通过
|
||||
}
|
||||
await saveOrUpdate(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
|
|
|
@ -10,42 +10,42 @@
|
|||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="机构名称" v-bind="validateInfos.comName" id="OrgApplyInfoForm-comName" name="comName">
|
||||
{{formData.comName}}
|
||||
{{ formData.comName }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="机构所在地">
|
||||
{{cityViewValue}}
|
||||
{{ cityViewValue }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="机构负责人" v-bind="validateInfos.orgLeader" id="OrgApplyInfoForm-orgLeader"
|
||||
name="orgLeader">
|
||||
{{formData.orgLeader}}
|
||||
{{ formData.orgLeader }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="机构负责人电话" v-bind="validateInfos.orgLeaderPhone" id="OrgApplyInfoForm-orgLeaderPhone"
|
||||
name="orgLeaderPhone">
|
||||
{{formData.orgLeaderPhone}}
|
||||
{{ formData.orgLeaderPhone }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="机构房屋性质" v-bind="validateInfos.orgPropertyType" id="OrgApplyInfoForm-orgPropertyType"
|
||||
name="orgPropertyType">
|
||||
{{formData.orgPropertyType}}
|
||||
{{ formData.orgPropertyType }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="机构建筑面积" v-bind="validateInfos.orgBuildingArea" id="OrgApplyInfoForm-orgBuildingArea"
|
||||
name="orgBuildingArea">
|
||||
{{formData.orgBuildingArea}}㎡
|
||||
{{ formData.orgBuildingArea }}㎡
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="机构地址" v-bind="validateInfos.orgAddress" id="OrgApplyInfoForm-orgAddress"
|
||||
name="orgAddress">
|
||||
{{formData.orgAddress}}
|
||||
{{ formData.orgAddress }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
@ -57,9 +57,9 @@
|
|||
<a-row v-if="formData.buildStatus == '3'">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="加盟合同" v-bind="validateInfos.contract" id="OrgApplyInfoForm-contract">
|
||||
<JUpload v-model:value="formData.contract" :maxCount="1" accept=".pdf"></JUpload>
|
||||
<JUpload v-model:value="formData.contract" :maxCount="1" accept=".pdf"></JUpload>
|
||||
</a-form-item>
|
||||
<div style="margin-top: 15px;margin-left:20%;color:#8e8e8e;font-size:12px;">说明:请上传pdf文件,并且只能上传一份文件</div>
|
||||
<div style="margin-top: 15px;margin-left:20%;color:#8e8e8e;font-size:12px;">说明:请上传pdf文件,并且只能上传一份文件</div>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="备注信息" v-bind="validateInfos.contractNote" id="OrgApplyInfoForm-contractNote"
|
||||
|
@ -274,6 +274,7 @@ async function submitForm() {
|
|||
}
|
||||
}
|
||||
model.workOrderStatus = '1'
|
||||
model.buildStatus = 'contractSubmit'//给后端判断是否为合同上传并提交状态
|
||||
await submitContract(model)
|
||||
.then((res) => {
|
||||
emit('ok');
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/services/directiveTag/bodyTag/list',
|
||||
save='/services/directiveTag/bodyTag/add',
|
||||
edit='/services/directiveTag/bodyTag/edit',
|
||||
deleteOne = '/services/directiveTag/bodyTag/delete',
|
||||
deleteBatch = '/services/directiveTag/bodyTag/deleteBatch',
|
||||
importExcel = '/services/directiveTag/bodyTag/importExcel',
|
||||
exportXls = '/services/directiveTag/bodyTag/exportXls',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const deleteOne = (params,handleSuccess) => {
|
||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
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',},
|
||||
};
|
|
@ -0,0 +1,278 @@
|
|||
<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>
|
||||
<!-- 表单区域 -->
|
||||
<BodyTagModal ref="registerModal" @success="handleSuccess"></BodyTagModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="bodyTag-bodyTag" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './BodyTag.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BodyTag.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import BodyTagModal from './components/BodyTagModal.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>
|
|
@ -0,0 +1,161 @@
|
|||
<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 '../BodyTag.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>
|
|
@ -0,0 +1,77 @@
|
|||
<template>
|
||||
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<BodyTagForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></BodyTagForm>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import BodyTagForm from './BodyTagForm.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>
|
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/services/directiveTag/emotionTag/list',
|
||||
save='/services/directiveTag/emotionTag/add',
|
||||
edit='/services/directiveTag/emotionTag/edit',
|
||||
deleteOne = '/services/directiveTag/emotionTag/delete',
|
||||
deleteBatch = '/services/directiveTag/emotionTag/deleteBatch',
|
||||
importExcel = '/services/directiveTag/emotionTag/importExcel',
|
||||
exportXls = '/services/directiveTag/emotionTag/exportXls',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const deleteOne = (params,handleSuccess) => {
|
||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
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',},
|
||||
};
|
|
@ -0,0 +1,278 @@
|
|||
<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>
|
||||
<!-- 表单区域 -->
|
||||
<EmotionTagModal ref="registerModal" @success="handleSuccess"></EmotionTagModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="emotionTag-emotionTag" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './EmotionTag.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './EmotionTag.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import EmotionTagModal from './components/EmotionTagModal.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>
|
|
@ -0,0 +1,161 @@
|
|||
<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 '../EmotionTag.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>
|
|
@ -0,0 +1,77 @@
|
|||
<template>
|
||||
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<EmotionTagForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></EmotionTagForm>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import EmotionTagForm from './EmotionTagForm.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>
|
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/services/instructionTag/list',
|
||||
save='/services/instructionTag/add',
|
||||
edit='/services/instructionTag/edit',
|
||||
deleteOne = '/services/instructionTag/delete',
|
||||
deleteBatch = '/services/instructionTag/deleteBatch',
|
||||
importExcel = '/services/instructionTag/importExcel',
|
||||
exportXls = '/services/instructionTag/exportXls',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const deleteOne = (params,handleSuccess) => {
|
||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
import {BasicColumn} from '/@/components/Table';
|
||||
import {FormSchema} from '/@/components/Table';
|
||||
import { rules} from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '分类标签',
|
||||
align: "center",
|
||||
dataIndex: 'instructionName'
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
align: "center",
|
||||
sorter: true,
|
||||
dataIndex: 'sort'
|
||||
},
|
||||
{
|
||||
title: '是否启用',
|
||||
align: "center",
|
||||
dataIndex: 'izEnabled_dictText'
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
instructionTagName: {title: '分类标签',order: 0,view: 'text', type: 'string',},
|
||||
sort: {title: '排序',order: 1,view: 'number', type: 'number',},
|
||||
izEnabled: {title: '是否启用',order: 2,view: 'radio', type: 'string',dictCode: '',},
|
||||
};
|
|
@ -0,0 +1,274 @@
|
|||
<template>
|
||||
<div class="p-2">
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
|
||||
:wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="instructionName">
|
||||
<template #label><span title="分类标签">分类标签</span></template>
|
||||
<JInput v-model:value="queryParam.instructionName" allowClear placeholder="请输入分类标签" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="izEnabled">
|
||||
<template #label><span title="是否启用">是否启用</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.izEnabled" dictCode="iz_enabled"
|
||||
:ignoreDisabled="true" placeholder="请选择是否启用" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||
<a-col :lg="6">
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
|
||||
style="margin-left: 8px">重置</a-button>
|
||||
<!-- <a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
|
||||
{{ toggleSearchStatus ? '收起' : '展开' }}
|
||||
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
|
||||
</a> -->
|
||||
</a-col>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :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>
|
||||
<!-- 表单区域 -->
|
||||
<InstructionTagModal ref="registerModal" @success="handleSuccess"></InstructionTagModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="serviceInstructionTag-instructionTag" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './InstructionTag.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './InstructionTag.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import InstructionTagModal from './components/InstructionTagModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '分类标签',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 160,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
params.column = 'sort'
|
||||
params.order = 'asc'
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "分类标签",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs: 24,
|
||||
sm: 4,
|
||||
xl: 8,
|
||||
xxl: 8
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
xl: 16,
|
||||
xxl: 16
|
||||
});
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
searchQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record)
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
{
|
||||
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>
|
|
@ -0,0 +1,165 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||
name="ConfigServiceCategoryForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="分类标签名称" v-bind="validateInfos.instructionName"
|
||||
id="ConfigServiceCategoryForm-instructionName" name="instructionName">
|
||||
<a-input v-model:value="formData.instructionName" placeholder="请输入分类标签名称" allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="排序" v-bind="validateInfos.sort" id="ConfigServiceCategoryForm-sort" name="sort">
|
||||
<a-input-number v-model:value="formData.sort" placeholder="请输入排序" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="ConfigServiceCategoryForm-izEnabled"
|
||||
name="izEnabled">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.izEnabled" dictCode="iz_enabled"
|
||||
placeholder="请选择是否启用" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../InstructionTag.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({}) },
|
||||
formBpm: { type: Boolean, default: true }
|
||||
});
|
||||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
instructionName: '',
|
||||
sort: 99,
|
||||
izEnabled: '0',
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
instructionName: [{ required: true, message: '请输入分类标签名称!' },],
|
||||
sort: [{ required: true, message: '请输入排序!'}, { pattern: /^\d+$/, message: '请输入正整数!'},],
|
||||
izEnabled: [{ required: true, message: '请选择是否启用!' },],
|
||||
});
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
|
||||
// 表单禁用
|
||||
const disabled = computed(() => {
|
||||
if (props.formBpm === true) {
|
||||
if (props.formData.disabled === false) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if (record.hasOwnProperty(key)) {
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
async function submitForm() {
|
||||
try {
|
||||
// 触发表单验证
|
||||
await validate();
|
||||
} catch ({ errorFields }) {
|
||||
if (errorFields) {
|
||||
const firstField = errorFields[0];
|
||||
if (firstField) {
|
||||
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(errorFields);
|
||||
}
|
||||
confirmLoading.value = true;
|
||||
const isUpdate = ref<boolean>(false);
|
||||
//时间格式化
|
||||
let model = formData;
|
||||
if (model.id) {
|
||||
isUpdate.value = true;
|
||||
}
|
||||
//循环数据
|
||||
for (let data in model) {
|
||||
//如果该数据是数组并且是字符串类型
|
||||
if (model[data] instanceof Array) {
|
||||
let valueType = getValueType(formRef.value.getProps, data);
|
||||
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||
if (valueType === 'string') {
|
||||
model[data] = model[data].join(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
await saveOrUpdate(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success(res.message);
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
padding: 14px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,77 @@
|
|||
<template>
|
||||
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<InstructionTagForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></InstructionTagForm>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import InstructionTagForm from './InstructionTagForm.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<number>(800);
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
title.value = '新增';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.add();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function edit(record) {
|
||||
title.value = disableSubmit.value ? '详情' : '编辑';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.edit(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/services/serviceCategory/configServiceCategory/list',
|
||||
save='/services/serviceCategory/configServiceCategory/add',
|
||||
edit='/services/serviceCategory/configServiceCategory/edit',
|
||||
deleteOne = '/services/serviceCategory/configServiceCategory/delete',
|
||||
deleteBatch = '/services/serviceCategory/configServiceCategory/deleteBatch',
|
||||
importExcel = '/services/serviceCategory/configServiceCategory/importExcel',
|
||||
exportXls = '/services/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 });
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
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: 'instructionId_dictText'
|
||||
},
|
||||
{
|
||||
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: '',},
|
||||
};
|
|
@ -0,0 +1,282 @@
|
|||
<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="instructionId">
|
||||
<template #label><span title="分类标签">分类标签</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.instructionId"
|
||||
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
|
||||
:ignoreDisabled="true" placeholder="请选择服务类别" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-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>
|
|
@ -0,0 +1,176 @@
|
|||
<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.instructionId" id="ConfigServiceTypeForm-instructionId"
|
||||
name="instructionId">
|
||||
<j-dict-select-tag type='list' v-model:value="formData.instructionId"
|
||||
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
|
||||
placeholder="请选择分类标签" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务类别名称" v-bind="validateInfos.categoryName"
|
||||
id="ConfigServiceCategoryForm-categoryName" name="categoryName">
|
||||
<a-input v-model:value="formData.categoryName" placeholder="请输入服务类别名称"
|
||||
:disabled="!formData.instructionId" 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',
|
||||
instructionId: '',
|
||||
});
|
||||
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({
|
||||
instructionId: [{ required: true, message: '请选择分类标签!' }],
|
||||
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>
|
|
@ -0,0 +1,77 @@
|
|||
<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,8 +1,4 @@
|
|||
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[] = [
|
||||
{
|
||||
|
@ -10,34 +6,34 @@ export const columns: BasicColumn[] = [
|
|||
align: 'center',
|
||||
dataIndex: 'instructionTagId_dictText',
|
||||
width: 100,
|
||||
// customCell: (record, index, column) => {
|
||||
// if (record.instructionRowSpan != null) {
|
||||
// return { rowSpan: record.instructionRowSpan };
|
||||
// }
|
||||
// },
|
||||
customCell: (record, index, column) => {
|
||||
if (record.instructionRowSpan != null) {
|
||||
return { rowSpan: record.instructionRowSpan };
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '服务类别',
|
||||
align: 'center',
|
||||
dataIndex: 'categoryId_dictText',
|
||||
// customCell: (record, index, column) => {
|
||||
// if (record.categoryRowSpan != null) {
|
||||
// return { rowSpan: record.categoryRowSpan };
|
||||
// }
|
||||
// },
|
||||
customCell: (record, index, column) => {
|
||||
if (record.categoryRowSpan != null) {
|
||||
return { rowSpan: record.categoryRowSpan };
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '服务类型',
|
||||
align: 'center',
|
||||
dataIndex: 'typeId_dictText',
|
||||
// customCell: (record, index, column) => {
|
||||
// if (record.typeRowSpan != null) {
|
||||
// return { rowSpan: record.typeRowSpan };
|
||||
// }
|
||||
// },
|
||||
customCell: (record, index, column) => {
|
||||
if (record.typeRowSpan != null) {
|
||||
return { rowSpan: record.typeRowSpan };
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '服务指令名称',
|
||||
title: '服务指令',
|
||||
align: 'center',
|
||||
dataIndex: 'directiveName',
|
||||
},
|
||||
|
@ -47,13 +43,13 @@ export const columns: BasicColumn[] = [
|
|||
dataIndex: 'bodyTagList',
|
||||
width: 150,
|
||||
ellipsis: false,
|
||||
format(text, record, index) {
|
||||
if (!!text && text.length > 0) {
|
||||
return text.map((item) => item.tagName).join('、');
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
// format(text, record, index) {
|
||||
// if (!!text) {
|
||||
// return text.map((item) => item.tagName).join('、');
|
||||
// } else {
|
||||
// return '-';
|
||||
// }
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '情绪标签',
|
||||
|
@ -61,13 +57,36 @@ export const columns: BasicColumn[] = [
|
|||
dataIndex: 'emotionTagList',
|
||||
width: 150,
|
||||
ellipsis: false,
|
||||
format(text, record, index) {
|
||||
if (!!text && text.length > 0) {
|
||||
return text.map((item) => item.tagName).join('、');
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
// format(text, record, index) {
|
||||
// if (!!text) {
|
||||
// return text.map((item) => item.tagName).join('、');
|
||||
// } else {
|
||||
// return '-';
|
||||
// }
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '收费价格',
|
||||
align: 'center',
|
||||
dataIndex: 'tollPrice',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '提成价格',
|
||||
align: 'center',
|
||||
dataIndex: 'comPrice',
|
||||
},
|
||||
{
|
||||
title: '医保报销',
|
||||
align: 'center',
|
||||
dataIndex: 'izReimbursement_dictText',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '机构优惠',
|
||||
align: 'center',
|
||||
dataIndex: 'izPreferential_dictText',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '周期类型',
|
||||
|
@ -103,7 +122,7 @@ export const superQuerySchema = {
|
|||
categoryId: { title: '服务类别', order: 0, view: 'list', type: 'string', dictCode: '' },
|
||||
typeId: { title: '服务类型', order: 1, view: 'list', type: 'string', dictCode: '' },
|
||||
instructionTagId: { title: '分类标签', order: 2, view: 'list', type: 'string', dictCode: 'instruction_tag' },
|
||||
directiveName: { title: '服务指令名称', order: 3, view: 'text', type: 'string' },
|
||||
directiveName: { title: '服务指令', order: 3, view: 'text', type: 'string' },
|
||||
tollPrice: { title: '收费价格', order: 4, view: 'number', type: 'number' },
|
||||
comPrice: { title: '提成价格', order: 5, view: 'number', type: 'number' },
|
||||
izReimbursement: { title: '医保报销', order: 6, view: 'radio', type: 'string', dictCode: '' },
|
||||
|
|
|
@ -1,136 +1,236 @@
|
|||
<template>
|
||||
<div class="p-2">
|
||||
<BasicTable @register="registerTable" :scroll="{ y: '56vh' }" :rowClassName="getRowClassName" size="small">
|
||||
<template #tableTitle></template>
|
||||
<!--查询区域-->
|
||||
<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="instructionTagId">
|
||||
<template #label><span title="分类标签">分类标签</span></template>
|
||||
<j-dict-select-tag v-model:value="queryParam.instructionTagId"
|
||||
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
|
||||
placeholder="请选择分类标签" allowClear :ignoreDisabled="true" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<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 and instruction_id = '${queryParam.instructionTagId || ''}' order by sort asc`"
|
||||
placeholder="请选择服务类别" allowClear :ignoreDisabled="true" />
|
||||
</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 and category_id = '${queryParam.categoryId || ''}' order by sort asc`"
|
||||
placeholder="请选择服务类型" allowClear :ignoreDisabled="true" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<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="bodyTags">
|
||||
<template #label><span title="体型标签">体型标签</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.bodyTags"
|
||||
: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>
|
||||
<j-dict-select-tag type="list" v-model:value="queryParam.emotionTags"
|
||||
: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 :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-col>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" class="btnPrivate" @click="handleinstructionTag"
|
||||
preIcon="tabler:settings">配置分类标签</a-button>
|
||||
<a-button type="primary" class="btnPrivate" @click="handleCategory" preIcon="tabler:settings">配置服务类别</a-button>
|
||||
<a-button type="primary" class="btnPrivate" @click="handleType" preIcon="tabler:settings">配置服务类型</a-button>
|
||||
<a-button type="primary" class="btnPrivate" @click="handleBodyTag" preIcon="tabler:settings">配置体型标签</a-button>
|
||||
<a-button type="primary" class="btnPrivate" @click="handleEmotionTag"
|
||||
preIcon="tabler:settings">配置情绪标签</a-button>
|
||||
<a-button type="primary" class="btnPrivate" @click="handleAdd"
|
||||
preIcon="ant-design:plus-outlined">新增服务指令</a-button>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
<template v-if="column.dataIndex === 'previewFileMedia'">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<img v-else :src="testOrgInfo.url + text" style="max-height: 50px;max-width: 80px;">
|
||||
<img v-else :src="sysUrlValue + text" style="max-height: 50px;max-width: 80px;">
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'immediateFileMedia'">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<img v-else :src="testOrgInfo.url + text" style="max-height: 50px;max-width: 80px;">
|
||||
<img v-else :src="sysUrlValue + text" style="max-height: 50px;max-width: 80px;">
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'bodyTagList'">
|
||||
<span :title="text.map((item) => item.tagName).join('、')">{{text.map((item) =>
|
||||
item.tagName).join('、')}}</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'emotionTagList'">
|
||||
<span :title="text.map((item) => item.tagName).join('、')">{{text.map((item) =>
|
||||
item.tagName).join('、')}}</span>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
|
||||
<ConfigServiceDirectiveModal ref="registerModal" :testOrgInfo="testOrgInfo" @success="handleSuccess"></ConfigServiceDirectiveModal>
|
||||
|
||||
<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>
|
||||
<!-- 表单区域 -->
|
||||
<ConfigServiceDirectiveModal :sysUrlValue="sysUrlValue" ref="registerModal" @success="handleSuccess">
|
||||
</ConfigServiceDirectiveModal>
|
||||
</div>
|
||||
|
||||
<!-- 分类标签 -->
|
||||
<a-drawer title="分类标签" width="60vw" :open="insTagOpen" @close="onInsTagClose">
|
||||
<template #footer>
|
||||
<a-button type="primary" @click="onInsTagClose" style="float: right;">关闭</a-button>
|
||||
</template>
|
||||
<InstructionTag v-if="insTagOpen"></InstructionTag>
|
||||
</a-drawer>
|
||||
|
||||
<!-- 服务类别 -->
|
||||
<a-drawer title="服务类别" width="60vw" :open="categoryOpen" @close="onCategoryClose">
|
||||
<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="bodyTagOpen" @close="onBodyTagClose">
|
||||
<template #footer>
|
||||
<a-button type="primary" @click="onBodyTagClose" style="float: right;">关闭</a-button>
|
||||
</template>
|
||||
<BodyTagList v-if="bodyTagOpen"></BodyTagList>
|
||||
</a-drawer>
|
||||
|
||||
<!-- 情绪标签 -->
|
||||
<a-drawer title="情绪标签" width="60vw" :open="emotionTagOpen" @close="onEmotionTagClose">
|
||||
<template #footer>
|
||||
<a-button type="primary" @click="onEmotionTagClose" style="float: right;">关闭</a-button>
|
||||
</template>
|
||||
<EmotionTagList v-if="emotionTagOpen"></EmotionTagList>
|
||||
</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, watch } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { ref, reactive, watch, onMounted } from 'vue';
|
||||
import { BasicTable, 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 ConfigServiceDirectiveModal from './components/ConfigServiceDirectiveModal.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';
|
||||
import { cloneDeep } from "lodash-es";
|
||||
import ConfigServiceCategoryList from '../serviceCategory/ConfigServiceCategoryList.vue';
|
||||
import InstructionTag from '../instructiontag/InstructionTag.vue';
|
||||
import ConfigServiceTypeList from '../serviceType/ConfigServiceTypeList.vue';
|
||||
import BodyTagList from '/@/views/services/directivetag/bodytag/BodyTagList.vue';
|
||||
import EmotionTagList from '/@/views/services/directivetag/emotiontag/EmotionTagList.vue';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { sysUrl } from '/@/utils/sysBaseInfo/MediaManagePicker.api.ts';
|
||||
|
||||
const props = defineProps({
|
||||
queryParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
initialDataIds: { // 初始化数据ID
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
testOrgInfo: {//试验田机构信息
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
const formRef = ref();
|
||||
const sysUrlValue = ref('')
|
||||
const queryParam = reactive<any>({
|
||||
instructionTagId: '',
|
||||
categoryId: '',
|
||||
typeId: '',
|
||||
});
|
||||
watch(
|
||||
() => queryParam.instructionTagId,
|
||||
() => {
|
||||
queryParam.categoryId = ''
|
||||
queryParam.typeId = ''
|
||||
}
|
||||
)
|
||||
|
||||
const emit = defineEmits(['select-change']);
|
||||
const queryParam = reactive<any>({});
|
||||
// 当服务类别变动,清空服务类型
|
||||
watch(
|
||||
() => queryParam.categoryId,
|
||||
() => {
|
||||
queryParam.typeId = ''
|
||||
}
|
||||
)
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const selectedRowIds = ref<Set<string | number>>(new Set());
|
||||
const allSelectedItems = ref<Map<string | number, any>>(new Map());
|
||||
|
||||
// 行类名函数
|
||||
const getRowClassName = (record) => {
|
||||
return selectedRowIds.value.has(record.id) ? 'selected-row' : '';
|
||||
};
|
||||
|
||||
// 切换选择状态
|
||||
const toggleSelect = (record) => {
|
||||
if (selectedRowIds.value.has(record.id)) {
|
||||
selectedRowIds.value.delete(record.id);
|
||||
allSelectedItems.value.delete(record.id);
|
||||
} else {
|
||||
selectedRowIds.value.add(record.id);
|
||||
allSelectedItems.value.set(record.id, record);
|
||||
}
|
||||
updateSelectedItems();
|
||||
};
|
||||
|
||||
// 移除选中项
|
||||
const removeSelected = (record) => {
|
||||
if (props.initialDataIds.includes(record.id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
selectedRowIds.value.delete(record.id);
|
||||
allSelectedItems.value.delete(record.id);
|
||||
updateSelectedItems();
|
||||
};
|
||||
|
||||
// 暴露给父组件的方法
|
||||
const removeSelectedItem = (id: string | number) => {
|
||||
selectedRowIds.value.delete(id);
|
||||
allSelectedItems.value.delete(id);
|
||||
updateSelectedItems();
|
||||
};
|
||||
|
||||
// 更新已选择项并通知父组件
|
||||
const updateSelectedItems = () => {
|
||||
emit('select-change', new Map(allSelectedItems.value));
|
||||
};
|
||||
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
watch(() => props.queryParams, (newParams) => {
|
||||
reload();
|
||||
}, { deep: true });
|
||||
|
||||
// 注册表格
|
||||
const userStore = useUserStore();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '服务指令',
|
||||
api: list,
|
||||
columns,
|
||||
size: 'small',
|
||||
showTableSetting: false,
|
||||
canResize: false,
|
||||
useSearchForm: false,
|
||||
showIndexColumn: true,
|
||||
pagination: {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
pageSizeOptions: ['10', '20', '50', '100'],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
width: 160,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
Object.assign(params, props.queryParams);
|
||||
params.dataSourceCode = import.meta.env.VITE_SYTJGBM;
|
||||
params.column = 'createTime'
|
||||
params.order = 'desc'
|
||||
params.selectedRowIds = Array.from(selectedRowIds.value)
|
||||
return params;
|
||||
let rangerQuery = await setRangeQuery();
|
||||
return Object.assign(params, rangerQuery);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
|
@ -143,107 +243,213 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
|||
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 insTagOpen = ref(false)//分类标签抽屉
|
||||
const categoryOpen = ref(false)//服务类别抽屉
|
||||
const typeOpen = ref(false)//服务类型抽屉
|
||||
const bodyTagOpen = ref(false)//体型标签抽屉
|
||||
const emotionTagOpen = 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) {
|
||||
const actions = [
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record)
|
||||
}, {
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}
|
||||
];
|
||||
|
||||
if (selectedRowIds.value.has(record.id)) {
|
||||
actions.push({
|
||||
label: '移除',
|
||||
color: 'error',
|
||||
disabled: props.initialDataIds.includes(record.id),
|
||||
onClick: () => {
|
||||
removeSelected(record);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
actions.push({
|
||||
label: '选择',
|
||||
onClick: () => {
|
||||
toggleSelect(record);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return actions;
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [];
|
||||
return [
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
const showVideoModal = ref(false);
|
||||
const videoUrl = ref('');
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
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 handleinstructionTag() {
|
||||
insTagOpen.value = true
|
||||
}
|
||||
//服务类别抽屉打开
|
||||
function handleCategory() {
|
||||
categoryOpen.value = true
|
||||
}
|
||||
//服务类型抽屉打开
|
||||
function handleType() {
|
||||
typeOpen.value = true
|
||||
}
|
||||
//体型标签抽屉打开
|
||||
function handleBodyTag() {
|
||||
bodyTagOpen.value = true
|
||||
}
|
||||
//情绪标签抽屉打开
|
||||
function handleEmotionTag() {
|
||||
emotionTagOpen.value = true
|
||||
}
|
||||
|
||||
//分类标签抽屉关闭
|
||||
function onInsTagClose() {
|
||||
insTagOpen.value = false
|
||||
}
|
||||
//服务类别抽屉关闭
|
||||
function onCategoryClose() {
|
||||
categoryOpen.value = false
|
||||
}
|
||||
//服务类型抽屉关闭
|
||||
function onTypeClose() {
|
||||
typeOpen.value = false
|
||||
}
|
||||
//体型标签抽屉关闭
|
||||
function onBodyTagClose() {
|
||||
bodyTagOpen.value = false
|
||||
}
|
||||
//体型标签抽屉关闭
|
||||
function onEmotionTagClose() {
|
||||
emotionTagOpen.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 = '';
|
||||
};
|
||||
|
||||
// 子组件中添加以下方法
|
||||
const updateSelection = (selectedRecords: any[]) => {
|
||||
selectedRowIds.value.clear();
|
||||
allSelectedItems.value.clear();
|
||||
|
||||
if (selectedRecords && selectedRecords.length > 0) {
|
||||
selectedRecords.forEach(record => {
|
||||
selectedRowIds.value.add(record.id);
|
||||
allSelectedItems.value.set(record.id, record);
|
||||
});
|
||||
}
|
||||
|
||||
// 更新表格的选中状态
|
||||
if (registerTable) {
|
||||
registerTable.toggleRowSelection?.(Array.from(selectedRowIds.value), true);
|
||||
}
|
||||
};
|
||||
|
||||
// 在子组件的script部分添加
|
||||
const getAllData = async (queryParams) => {
|
||||
try {
|
||||
// 设置不分页参数
|
||||
const params = {
|
||||
...queryParams,
|
||||
pageNo: 1,
|
||||
pageSize: -1,
|
||||
dataSourceCode: import.meta.env.VITE_SYTJGBM,
|
||||
column: 'createTime',
|
||||
order: 'desc'
|
||||
};
|
||||
|
||||
const res = await list(params);
|
||||
return res.records || [];
|
||||
} catch (error) {
|
||||
console.error("获取全部数据失败:", error);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
// 暴露给父组件的方法
|
||||
defineExpose({
|
||||
removeSelectedItem,
|
||||
updateSelection,
|
||||
reload,
|
||||
getAllData // 新增方法
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
sysUrl().then(res => {
|
||||
sysUrlValue.value = res.url
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
@ -286,15 +492,8 @@ audio::-webkit-media-controls-time-remaining-display {
|
|||
display: none;
|
||||
}
|
||||
|
||||
:deep(.ant-table-title) {
|
||||
display: none !important;
|
||||
.btnPrivate {
|
||||
height: 34px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
:deep(.selected-row) {
|
||||
background-color: #e6f7ff !important;
|
||||
|
||||
&:hover td {
|
||||
background-color: #e6f7ff !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -3,28 +3,29 @@
|
|||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||
name="ConfigServiceDirectiveForm">
|
||||
name="ConfigService2DirectiveForm">
|
||||
<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" :orgCode="orgCodeParam"
|
||||
dictCode="instruction_tag" placeholder="请选择分类标签" allowClear />
|
||||
<j-dict-select-tag v-model:value="formData.instructionTagId"
|
||||
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
|
||||
placeholder="请选择分类标签" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="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" :orgCode="orgCodeParam"
|
||||
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 order by sort asc`"
|
||||
placeholder="请选择服务类别" allow-clear />
|
||||
<j-dict-select-tag type="list" v-model:value="formData.categoryId"
|
||||
:disabled="!formData.instructionTagId" :dictCode="categoryDictCode" placeholder="请选择服务类别"
|
||||
allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<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"
|
||||
:orgCode="orgCodeParam" placeholder="请选择服务类型" allowClear />
|
||||
:disabled="!formData.categoryId" placeholder="请选择服务类型" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
|
@ -50,22 +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" :orgCode="orgCodeParam"
|
||||
dictCode="med_ins_reimb" allowClear />
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.izReimbursement" 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" :orgCode="orgCodeParam"
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.izPreferential"
|
||||
dictCode="institutional_discount" allowClear />
|
||||
</a-form-item>
|
||||
</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" :orgCode="orgCodeParam"
|
||||
dictCode="period_type" placeholder="请选择周期类型" allowClear />
|
||||
<j-dict-select-tag type="list" v-model:value="formData.cycleType" dictCode="period_type"
|
||||
placeholder="请选择周期类型" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
|
@ -86,37 +87,71 @@
|
|||
<a-col :span="24">
|
||||
<a-form-item label="体型标签" id="ConfigServiceDirectiveForm-typeId" :labelCol="labelCol2"
|
||||
:wrapperCol="wrapperCol2" name="typeId">
|
||||
<JCheckbox v-model:value="formData.bodyTags" :orgCode="orgCodeParam"
|
||||
<JCheckbox v-model:value="formData.bodyTags"
|
||||
: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" :orgCode="orgCodeParam"
|
||||
<JCheckbox v-model:value="formData.emotionTags"
|
||||
: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" :orgCode="orgCodeParam"
|
||||
dictCode="iz_enabled" placeholder="请选择是否启用" allowClear />
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.izEnabled" dictCode="iz_enabled"
|
||||
placeholder="请选择是否启用" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="预览图片">
|
||||
<span v-if="!formData.previewFileMedia" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<img v-else :src="testOrgInfo.url + formData.previewFileMedia"
|
||||
style="max-height: 100px;max-width: 100px;">
|
||||
<a-form-item label="预览图片" v-bind="validateInfos.previewFile">
|
||||
<a-button @click="showResourcePicker('previewFile', { maxSelect: 1, fileType: 'image' })" type="link"
|
||||
size="small">选取图片</a-button>
|
||||
<!-- <JImageUpload :fileMax="1" v-model:value="formData.previewFileMedia"
|
||||
@change="formData.previewFileChanged = true">
|
||||
</JImageUpload> -->
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="即时指令图片" v-bind="validateInfos.immediateFile">
|
||||
<span v-if="!formData.immediateFileMedia" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<img v-else :src="testOrgInfo.url + formData.immediateFileMedia"
|
||||
style="max-height: 100px;max-width: 100px;">
|
||||
<a-button @click="showResourcePicker('immediateFile', { maxSelect: 1, fileType: 'image' })" type="link"
|
||||
size="small">选取图片</a-button>
|
||||
<!-- <JImageUpload :fileMax="1" v-model:value="formData.immediateFileMedia"
|
||||
@change="formData.immediateFileChanged = true">
|
||||
</JImageUpload> -->
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :span="12" v-if="!!formData.previewFile">
|
||||
<a-form-item label="预览图片" id="ConfigServiceDirectiveForm-previewFile">
|
||||
<img :src="sysUrlValue + formData.previewFileMedia" style="max-width: 100px; max-height: 100px;" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" v-if="!!formData.immediateFile" :push="!!formData.previewFile ? 0 : 12">
|
||||
<a-form-item label="即时指令图片" id="ConfigServiceDirectiveForm-immediateFile">
|
||||
<img :src="sysUrlValue + formData.immediateFileMedia" style="max-width: 100px; max-height: 100px;" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="语音文件" v-bind="validateInfos.mp3File" id="ConfigServiceDirectiveForm-mp3File">
|
||||
<a-button @click="showResourcePicker('mp3File', { maxSelect: 1, fileType: 'audio' })" type="link"
|
||||
size="small">选取文件</a-button>
|
||||
<!-- <j-upload v-model:value="formData.mp3FileMedia" accept=".mp3" :maxCount="1"
|
||||
@change="formData.mp3FileChanged = true"></j-upload> -->
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="视频文件" v-bind="validateInfos.mp4File" id="ConfigServiceDirectiveForm-mp4File">
|
||||
<a-button @click="showResourcePicker('mp4File', { maxSelect: 1, fileType: 'video' })" type="link"
|
||||
size="small">选取文件</a-button>
|
||||
<!-- <j-upload v-model:value="formData.mp4FileMedia" accept=".mp4" :maxCount="1"
|
||||
@change="formData.mp4FileChanged = true"></j-upload> -->
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
@ -128,17 +163,17 @@
|
|||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||
name="ConfigServiceDirectiveForm">
|
||||
<a-row>
|
||||
<a-col :span="12" v-if="!!formData.mp3FileMedia">
|
||||
<a-form-item label="语音预览">
|
||||
<a-col :span="12" v-if="!!formData.mp3File">
|
||||
<a-form-item label="语音预览" id="ConfigServiceDirectiveForm-mp3File">
|
||||
<audio controls disabled="false">
|
||||
<source :src="testOrgInfo.url + formData.mp3FileMedia">
|
||||
<source :src="sysUrlValue + formData.mp3FileMedia">
|
||||
</audio>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" v-if="!!formData.mp4FileMedia" :push="!!formData.mp3FileMedia ? 0 : 12">
|
||||
<a-form-item label="视频预览">
|
||||
<a-col :span="12" v-if="!!formData.mp4File" :push="!!formData.mp3File ? 0 : 12">
|
||||
<a-form-item label="视频预览" id="ConfigServiceDirectiveForm-mp4File">
|
||||
<video controls>
|
||||
<source :src="testOrgInfo.url + formData.mp4FileMedia">
|
||||
<source :src="sysUrlValue + formData.mp4FileMedia">
|
||||
</video>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
@ -147,10 +182,14 @@
|
|||
</template>
|
||||
</JFormContainer>
|
||||
</a-spin>
|
||||
|
||||
<MediaResourcePicker :maxSelect="mediaParams.maxSelect" :fileType="mediaParams.fileType"
|
||||
v-model:visible="pickerVisible" @confirm="handleResourceSelected" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, watch } from 'vue';
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted, watch } 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 { JCheckbox } from '/@/components/Form';
|
||||
|
@ -161,18 +200,30 @@ 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';
|
||||
import MediaResourcePicker from '/@/utils/midiaManage/MediaResourcePicker.vue';
|
||||
|
||||
const orgCodeParam = import.meta.env.VITE_SYTJGBM
|
||||
const handleUploadSuccess = (res) => {
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({}) },
|
||||
formBpm: { type: Boolean, default: true },
|
||||
testOrgInfo: {//试验田机构信息
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
sysUrlValue: { type: String, default: '' },
|
||||
});
|
||||
const pickerVisible = ref(false);
|
||||
const mediaParams = ref({ maxSelect: 1, fileType: 'any' })
|
||||
const changedMediaObjStr = ref('')
|
||||
const showResourcePicker = (obj, param) => {
|
||||
changedMediaObjStr.value = obj
|
||||
mediaParams.value = param
|
||||
pickerVisible.value = true;
|
||||
};
|
||||
|
||||
const handleResourceSelected = (selectedResource) => {
|
||||
formData[changedMediaObjStr.value] = selectedResource.id
|
||||
formData[changedMediaObjStr.value + 'Media'] = selectedResource.filePath
|
||||
};
|
||||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
|
@ -200,10 +251,10 @@ const formData = reactive<Record<string, any>>({
|
|||
mp4File: '',
|
||||
previewFile: '',
|
||||
immediateFile: '',
|
||||
previewFileMedia: '',
|
||||
immediateFileMedia: '',
|
||||
mp3FileMedia: '',
|
||||
mp4FileMedia: '',
|
||||
previewFileMedia: '',
|
||||
immediateFileMedia: '',
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 6 } });
|
||||
|
@ -258,20 +309,32 @@ const disabled = computed(() => {
|
|||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
const categoryDictCode = ref('')
|
||||
const typeDictCode = ref('')
|
||||
|
||||
watch(
|
||||
() => formData.instructionTagId,
|
||||
(newInstructionTagId) => {
|
||||
if (!newInstructionTagId) {
|
||||
formData.categoryId = ''
|
||||
formData.typeId = ''
|
||||
categoryDictCode.value = 'nu_config_service_category,category_name,id,1=2';
|
||||
} else {
|
||||
categoryDictCode.value = `nu_config_service_category,category_name,id,del_flag = 0 and instruction_id = '${newInstructionTagId}' order by sort asc`;
|
||||
}
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => formData.categoryId,
|
||||
(newCategoryId) => {
|
||||
if (!newCategoryId) {
|
||||
formData.typeId = '';
|
||||
formData.typeId = ''
|
||||
typeDictCode.value = 'nu_config_service_type,type_name,id,del_flag = 99 order by sort asc';
|
||||
} else {
|
||||
typeDictCode.value = `nu_config_service_type,type_name,id,del_flag = 0 and category_id = '${newCategoryId}' order by sort asc`;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
|
|
|
@ -1,87 +1,80 @@
|
|||
<template>
|
||||
<j-modal :title="title" width="70vw" :visible="visible" @ok="handleOk"
|
||||
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭"
|
||||
:maskClosable="false">
|
||||
<ConfigServiceDirectiveForm ref="registerForm" v-if="visible" :testOrgInfo="testOrgInfo" @ok="submitCallback"
|
||||
:formDisabled="disableSubmit" :formBpm="false"></ConfigServiceDirectiveForm>
|
||||
<j-modal :title="title" width="70vw" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭" :maskClosable="false">
|
||||
<ConfigServiceDirectiveForm ref="registerForm" v-if="visible" @ok="submitCallback" :sysUrlValue="sysUrlValue" :formDisabled="disableSubmit" :formBpm="false"></ConfigServiceDirectiveForm>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import ConfigServiceDirectiveForm from './ConfigServiceDirectiveForm.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
import { array } from 'vue-types';
|
||||
import { ref, nextTick, defineExpose , defineProps} from 'vue';
|
||||
import ConfigServiceDirectiveForm from './ConfigServiceDirectiveForm.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
|
||||
const props = defineProps({
|
||||
sysUrlValue: { type: String, default: '' },
|
||||
});
|
||||
const title = ref<string>('');
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
const title = ref<string>('');
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
const props = defineProps({
|
||||
testOrgInfo: {//试验田机构信息
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
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();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
title.value = '新增';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.add();
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
disableSubmit,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function edit(record) {
|
||||
title.value = disableSubmit.value ? '详情' : '编辑';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.edit(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/services/ServiceType/configServiceType/list',
|
||||
save='/services/ServiceType/configServiceType/add',
|
||||
edit='/services/ServiceType/configServiceType/edit',
|
||||
deleteOne = '/services/ServiceType/configServiceType/delete',
|
||||
deleteBatch = '/services/ServiceType/configServiceType/deleteBatch',
|
||||
importExcel = '/services/ServiceType/configServiceType/importExcel',
|
||||
exportXls = '/services/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 });
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
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: 'instructionId_dictText'
|
||||
},
|
||||
{
|
||||
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',},
|
||||
};
|
|
@ -0,0 +1,290 @@
|
|||
<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="instructionId">
|
||||
<template #label><span title="分类标签">分类标签</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.instructionId" :dictCode="instructionDictCode"
|
||||
:ignoreDisabled="true" placeholder="请选择分类标签" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="categoryId">
|
||||
<template #label><span title="服务类别">服务类别</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.categoryId" :dictCode="categoryDictCode"
|
||||
: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-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-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>
|
||||
</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, computed, watch } 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 { defHttp } from '/@/utils/http/axios';
|
||||
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 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
|
||||
});
|
||||
|
||||
// 计算 dictCode
|
||||
const instructionDictCode = 'nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc';
|
||||
const categoryDictCode = computed(() => {
|
||||
if (!queryParam.instructionId) {
|
||||
return 'nu_config_service_category,category_name,id,del_flag = 0';
|
||||
}
|
||||
return `nu_config_service_category,category_name,id,del_flag = 0 and instruction_id = ${queryParam.instructionId} order by sort asc`;
|
||||
});
|
||||
|
||||
// 监听 instructionId 变化,清空二级
|
||||
watch(() => queryParam.instructionId, async (newIns) => {
|
||||
queryParam.categoryId = '';
|
||||
});
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
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>
|
|
@ -0,0 +1,198 @@
|
|||
<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.instructionId" id="ConfigServiceTypeForm-instructionId"
|
||||
name="instructionId">
|
||||
<j-dict-select-tag type='list' v-model:value="formData.instructionId"
|
||||
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
|
||||
placeholder="请选择分类标签" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="ConfigServiceTypeForm-categoryId"
|
||||
name="categoryId">
|
||||
<j-dict-select-tag type='list' v-model:value="formData.categoryId" :dictCode="categoryDictCode"
|
||||
placeholder="请选择服务类别" allowClear :disabled="!formData.instructionId" />
|
||||
</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
|
||||
:disabled="!formData.categoryId"></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, watch } 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: '',
|
||||
instructionId: '',
|
||||
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({
|
||||
instructionId: [{ required: true, message: '请选择分类标签!' }],
|
||||
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 });
|
||||
|
||||
// 计算 dictCode
|
||||
const categoryDictCode = computed(() => {
|
||||
if (!formData.instructionId) {
|
||||
return 'nu_config_service_category,category_name,id,1=2';
|
||||
}
|
||||
return `nu_config_service_category,category_name,id,del_flag = 0 and instruction_id = ${formData.instructionId} order by sort asc`;
|
||||
});
|
||||
|
||||
// 监听 instructionId 变化,清空 categoryId
|
||||
watch(() => formData.instructionId, () => {
|
||||
formData.categoryId = '';
|
||||
});
|
||||
|
||||
// 表单禁用
|
||||
const disabled = computed(() => {
|
||||
if (props.formBpm === true) {
|
||||
if (props.formData.disabled === false) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if (record.hasOwnProperty(key)) {
|
||||
tmpData[key] = record[key];
|
||||
}
|
||||
});
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
async function submitForm() {
|
||||
try {
|
||||
// 触发表单验证
|
||||
await validate();
|
||||
} catch ({ errorFields }) {
|
||||
if (errorFields) {
|
||||
const firstField = errorFields[0];
|
||||
if (firstField) {
|
||||
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(errorFields);
|
||||
}
|
||||
confirmLoading.value = true;
|
||||
const isUpdate = ref<boolean>(false);
|
||||
//时间格式化
|
||||
let model = formData;
|
||||
if (model.id) {
|
||||
isUpdate.value = true;
|
||||
}
|
||||
//循环数据
|
||||
for (let data in model) {
|
||||
//如果该数据是数组并且是字符串类型
|
||||
if (model[data] instanceof Array) {
|
||||
let valueType = getValueType(formRef.value.getProps, data);
|
||||
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||
if (valueType === 'string') {
|
||||
model[data] = model[data].join(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
await saveOrUpdate(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success(res.message);
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
padding: 14px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,79 @@
|
|||
<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>
|
|
@ -0,0 +1,81 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/services/serviceDirective/configServiceDirective/list',
|
||||
save='/services/serviceDirective/configServiceDirective/add',
|
||||
edit='/services/serviceDirective/configServiceDirective/edit',
|
||||
deleteOne = '/services/serviceDirective/configServiceDirective/delete',
|
||||
deleteBatch = '/services/serviceDirective/configServiceDirective/deleteBatch',
|
||||
importExcel = '/services/serviceDirective/configServiceDirective/importExcel',
|
||||
exportXls = '/services/serviceDirective/configServiceDirective/exportXls',
|
||||
async = '/services/serviceDirective/configServiceDirective/async',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出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 });
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步数据
|
||||
* @param params
|
||||
*/
|
||||
export const asyncFunc = (params) => {
|
||||
return defHttp.post({ url: Api.async, params }, { isTransformResponse: false });
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
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: 'instructionTagId_dictText',
|
||||
width: 100,
|
||||
// customCell: (record, index, column) => {
|
||||
// if (record.instructionRowSpan != null) {
|
||||
// return { rowSpan: record.instructionRowSpan };
|
||||
// }
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '服务类别',
|
||||
align: 'center',
|
||||
dataIndex: 'categoryId_dictText',
|
||||
// customCell: (record, index, column) => {
|
||||
// if (record.categoryRowSpan != null) {
|
||||
// return { rowSpan: record.categoryRowSpan };
|
||||
// }
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '服务类型',
|
||||
align: 'center',
|
||||
dataIndex: 'typeId_dictText',
|
||||
// customCell: (record, index, column) => {
|
||||
// if (record.typeRowSpan != null) {
|
||||
// return { rowSpan: record.typeRowSpan };
|
||||
// }
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '服务指令名称',
|
||||
align: 'center',
|
||||
dataIndex: 'directiveName',
|
||||
},
|
||||
{
|
||||
title: '体型标签',
|
||||
align: 'center',
|
||||
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) {
|
||||
if (!!text && text.length > 0) {
|
||||
return text.map((item) => item.tagName).join('、');
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '周期类型',
|
||||
align: 'center',
|
||||
dataIndex: 'cycleType_dictText',
|
||||
},
|
||||
{
|
||||
title: '服务时长(分钟)',
|
||||
align: 'center',
|
||||
dataIndex: 'serviceDuration',
|
||||
width: 135,
|
||||
},
|
||||
{
|
||||
title: '是否启用',
|
||||
align: 'center',
|
||||
dataIndex: 'izEnabled_dictText',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '预览图片',
|
||||
align: 'center',
|
||||
dataIndex: 'previewFileMedia',
|
||||
},
|
||||
{
|
||||
title: '即时指令图片',
|
||||
align: 'center',
|
||||
dataIndex: 'immediateFileMedia',
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
categoryId: { title: '服务类别', order: 0, view: 'list', type: 'string', dictCode: '' },
|
||||
typeId: { title: '服务类型', order: 1, view: 'list', type: 'string', dictCode: '' },
|
||||
instructionTagId: { title: '分类标签', order: 2, view: 'list', type: 'string', dictCode: 'instruction_tag' },
|
||||
directiveName: { title: '服务指令名称', order: 3, view: 'text', type: 'string' },
|
||||
tollPrice: { title: '收费价格', order: 4, view: 'number', type: 'number' },
|
||||
comPrice: { title: '提成价格', order: 5, view: 'number', type: 'number' },
|
||||
izReimbursement: { title: '医保报销', order: 6, view: 'radio', type: 'string', dictCode: '' },
|
||||
izPreferential: { title: '机构优惠', order: 7, view: 'radio', type: 'string', dictCode: '' },
|
||||
chargingFrequency: { title: '收费频次', order: 8, view: 'list', type: 'string', dictCode: '' },
|
||||
cycleType: { title: '周期类型', order: 9, view: 'list', type: 'string', dictCode: '' },
|
||||
sort: { title: '排序', order: 10, view: 'number', type: 'number' },
|
||||
serviceContent: { title: '服务说明', order: 11, view: 'textarea', type: 'string' },
|
||||
serviceDuration: { title: '服务时长(分钟)', order: 12, view: 'text', type: 'string' },
|
||||
izEnabled: { title: '是否启用', order: 13, view: 'radio', type: 'string', dictCode: '' },
|
||||
createBy: { title: '创建人', order: 14, view: 'text', type: 'string' },
|
||||
createTime: { title: '创建日期', order: 15, view: 'datetime', type: 'string' },
|
||||
updateBy: { title: '更新人', order: 16, view: 'text', type: 'string' },
|
||||
updateTime: { title: '更新日期', order: 17, view: 'datetime', type: 'string' },
|
||||
mp3File: { title: '语音文件', order: 18, view: 'file', type: 'string' },
|
||||
mp4File: { title: '视频文件', order: 19, view: 'file', type: 'string' },
|
||||
};
|
|
@ -0,0 +1,300 @@
|
|||
<template>
|
||||
<div class="p-2">
|
||||
<BasicTable @register="registerTable" :scroll="{ y: '56vh' }" :rowClassName="getRowClassName" size="small">
|
||||
<template #tableTitle></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 === 'previewFileMedia'">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<img v-else :src="testOrgInfo.url + text" style="max-height: 50px;max-width: 80px;">
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'immediateFileMedia'">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<img v-else :src="testOrgInfo.url + text" style="max-height: 50px;max-width: 80px;">
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
|
||||
<ConfigServiceDirectiveModal ref="registerModal" :testOrgInfo="testOrgInfo" @success="handleSuccess"></ConfigServiceDirectiveModal>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="serviceDirective-configServiceDirective" setup>
|
||||
import { ref, reactive, watch } 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 ConfigServiceDirectiveModal from './components/ConfigServiceDirectiveModal.vue'
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
|
||||
const props = defineProps({
|
||||
queryParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
initialDataIds: { // 初始化数据ID
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
testOrgInfo: {//试验田机构信息
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
});
|
||||
|
||||
const emit = defineEmits(['select-change']);
|
||||
const queryParam = reactive<any>({});
|
||||
const registerModal = ref();
|
||||
const selectedRowIds = ref<Set<string | number>>(new Set());
|
||||
const allSelectedItems = ref<Map<string | number, any>>(new Map());
|
||||
|
||||
// 行类名函数
|
||||
const getRowClassName = (record) => {
|
||||
return selectedRowIds.value.has(record.id) ? 'selected-row' : '';
|
||||
};
|
||||
|
||||
// 切换选择状态
|
||||
const toggleSelect = (record) => {
|
||||
if (selectedRowIds.value.has(record.id)) {
|
||||
selectedRowIds.value.delete(record.id);
|
||||
allSelectedItems.value.delete(record.id);
|
||||
} else {
|
||||
selectedRowIds.value.add(record.id);
|
||||
allSelectedItems.value.set(record.id, record);
|
||||
}
|
||||
updateSelectedItems();
|
||||
};
|
||||
|
||||
// 移除选中项
|
||||
const removeSelected = (record) => {
|
||||
if (props.initialDataIds.includes(record.id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
selectedRowIds.value.delete(record.id);
|
||||
allSelectedItems.value.delete(record.id);
|
||||
updateSelectedItems();
|
||||
};
|
||||
|
||||
// 暴露给父组件的方法
|
||||
const removeSelectedItem = (id: string | number) => {
|
||||
selectedRowIds.value.delete(id);
|
||||
allSelectedItems.value.delete(id);
|
||||
updateSelectedItems();
|
||||
};
|
||||
|
||||
// 更新已选择项并通知父组件
|
||||
const updateSelectedItems = () => {
|
||||
emit('select-change', new Map(allSelectedItems.value));
|
||||
};
|
||||
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
watch(() => props.queryParams, (newParams) => {
|
||||
reload();
|
||||
}, { deep: true });
|
||||
|
||||
// 注册表格
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '服务指令',
|
||||
api: list,
|
||||
columns,
|
||||
size: 'small',
|
||||
showTableSetting: false,
|
||||
canResize: false,
|
||||
useSearchForm: false,
|
||||
showIndexColumn: true,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
Object.assign(params, props.queryParams);
|
||||
params.dataSourceCode = import.meta.env.VITE_SYTJGBM;
|
||||
params.column = 'createTime'
|
||||
params.order = 'desc'
|
||||
params.selectedRowIds = Array.from(selectedRowIds.value)
|
||||
return params;
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "服务指令",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
function getTableAction(record) {
|
||||
const actions = [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}
|
||||
];
|
||||
|
||||
if (selectedRowIds.value.has(record.id)) {
|
||||
actions.push({
|
||||
label: '移除',
|
||||
color: 'error',
|
||||
disabled: props.initialDataIds.includes(record.id),
|
||||
onClick: () => {
|
||||
removeSelected(record);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
actions.push({
|
||||
label: '选择',
|
||||
onClick: () => {
|
||||
toggleSelect(record);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return actions;
|
||||
}
|
||||
|
||||
function getDropDownAction(record) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const showVideoModal = ref(false);
|
||||
const videoUrl = ref('');
|
||||
|
||||
const openVideoModal = (url) => {
|
||||
videoUrl.value = getFileAccessHttpUrl(url);
|
||||
showVideoModal.value = true;
|
||||
};
|
||||
|
||||
const closeVideoModal = () => {
|
||||
showVideoModal.value = false;
|
||||
videoUrl.value = '';
|
||||
};
|
||||
|
||||
// 子组件中添加以下方法
|
||||
const updateSelection = (selectedRecords: any[]) => {
|
||||
selectedRowIds.value.clear();
|
||||
allSelectedItems.value.clear();
|
||||
|
||||
if (selectedRecords && selectedRecords.length > 0) {
|
||||
selectedRecords.forEach(record => {
|
||||
selectedRowIds.value.add(record.id);
|
||||
allSelectedItems.value.set(record.id, record);
|
||||
});
|
||||
}
|
||||
|
||||
// 更新表格的选中状态
|
||||
if (registerTable) {
|
||||
registerTable.toggleRowSelection?.(Array.from(selectedRowIds.value), true);
|
||||
}
|
||||
};
|
||||
|
||||
// 在子组件的script部分添加
|
||||
const getAllData = async (queryParams) => {
|
||||
try {
|
||||
// 设置不分页参数
|
||||
const params = {
|
||||
...queryParams,
|
||||
pageNo: 1,
|
||||
pageSize: -1,
|
||||
dataSourceCode: import.meta.env.VITE_SYTJGBM,
|
||||
column: 'createTime',
|
||||
order: 'desc'
|
||||
};
|
||||
|
||||
const res = await list(params);
|
||||
return res.records || [];
|
||||
} catch (error) {
|
||||
console.error("获取全部数据失败:", error);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
// 暴露给父组件的方法
|
||||
defineExpose({
|
||||
removeSelectedItem,
|
||||
updateSelection,
|
||||
reload,
|
||||
getAllData // 新增方法
|
||||
});
|
||||
|
||||
</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;
|
||||
}
|
||||
|
||||
:deep(.ant-table-title) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
:deep(.selected-row) {
|
||||
background-color: #e6f7ff !important;
|
||||
|
||||
&:hover td {
|
||||
background-color: #e6f7ff !important;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,369 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<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" :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" :orgCode="orgCodeParam"
|
||||
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 order by sort asc`"
|
||||
placeholder="请选择服务类别" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<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"
|
||||
:orgCode="orgCodeParam" placeholder="请选择服务类型" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="服务指令名称" v-bind="validateInfos.directiveName"
|
||||
id="ConfigServiceDirectiveForm-directiveName" name="directiveName">
|
||||
<a-input v-model:value="formData.directiveName" placeholder="请输入服务指令名称" allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<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%"
|
||||
precision="4" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="提成价格(元)" v-bind="validateInfos.comPrice" id="ConfigServiceDirectiveForm-comPrice"
|
||||
name="comPrice">
|
||||
<a-input-number v-model:value="formData.comPrice" placeholder="请输入提成价格" style="width: 100%"
|
||||
precision="4" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<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" :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" :orgCode="orgCodeParam"
|
||||
dictCode="institutional_discount" allowClear />
|
||||
</a-form-item>
|
||||
</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" :orgCode="orgCodeParam"
|
||||
dictCode="period_type" placeholder="请选择周期类型" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="服务时长(分钟)" v-bind="validateInfos.serviceDuration"
|
||||
id="ConfigServiceDirectiveForm-serviceDuration" name="serviceDuration">
|
||||
<a-input-number v-model:value="formData.serviceDuration" :min="5" :max="55" :step="5"
|
||||
placeholder="请输入服务时长(分钟)" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="服务说明" v-bind="validateInfos.serviceContent"
|
||||
id="ConfigServiceDirectiveForm-serviceContent" name="serviceContent">
|
||||
<a-textarea v-model:value="formData.serviceContent" :rows="2" placeholder="请输入服务说明" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="体型标签" id="ConfigServiceDirectiveForm-typeId" :labelCol="labelCol2"
|
||||
:wrapperCol="wrapperCol2" name="typeId">
|
||||
<JCheckbox v-model:value="formData.bodyTags" :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" :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" :orgCode="orgCodeParam"
|
||||
dictCode="iz_enabled" placeholder="请选择是否启用" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="预览图片">
|
||||
<span v-if="!formData.previewFileMedia" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<img v-else :src="testOrgInfo.url + formData.previewFileMedia"
|
||||
style="max-height: 100px;max-width: 100px;">
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="即时指令图片" v-bind="validateInfos.immediateFile">
|
||||
<span v-if="!formData.immediateFileMedia" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<img v-else :src="testOrgInfo.url + formData.immediateFileMedia"
|
||||
style="max-height: 100px;max-width: 100px;">
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
<JFormContainer>
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||
name="ConfigServiceDirectiveForm">
|
||||
<a-row>
|
||||
<a-col :span="12" v-if="!!formData.mp3FileMedia">
|
||||
<a-form-item label="语音预览">
|
||||
<audio controls disabled="false">
|
||||
<source :src="testOrgInfo.url + formData.mp3FileMedia">
|
||||
</audio>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" v-if="!!formData.mp4FileMedia" :push="!!formData.mp3FileMedia ? 0 : 12">
|
||||
<a-form-item label="视频预览">
|
||||
<video controls>
|
||||
<source :src="testOrgInfo.url + formData.mp4FileMedia">
|
||||
</video>
|
||||
</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, watch } from 'vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { JCheckbox } from '/@/components/Form';
|
||||
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
||||
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
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 = import.meta.env.VITE_SYTJGBM
|
||||
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({}) },
|
||||
formBpm: { type: Boolean, default: true },
|
||||
testOrgInfo: {//试验田机构信息
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
});
|
||||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
categoryId: '',
|
||||
typeId: '',
|
||||
instructionTagId: '',
|
||||
directiveName: '',
|
||||
tollPrice: 0,
|
||||
comPrice: 0,
|
||||
izReimbursement: '0',
|
||||
izPreferential: '0',
|
||||
chargingFrequency: '',
|
||||
cycleType: '',
|
||||
sort: 99,
|
||||
serviceContent: '',
|
||||
serviceDuration: '5',
|
||||
izEnabled: '0',
|
||||
createBy: '',
|
||||
createTime: '',
|
||||
updateBy: '',
|
||||
updateTime: '',
|
||||
mp3File: '',
|
||||
mp4File: '',
|
||||
previewFile: '',
|
||||
immediateFile: '',
|
||||
previewFileMedia: '',
|
||||
immediateFileMedia: '',
|
||||
mp3FileMedia: '',
|
||||
mp4FileMedia: '',
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 6 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||
const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 3 } });
|
||||
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 20 } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
categoryId: [{ required: true, message: '请选择服务类别!' },],
|
||||
typeId: [{ required: true, message: '请选择服务类型!' },],
|
||||
instructionTagId: [{ required: true, message: '请选择分类标签!' },],
|
||||
directiveName: [{ required: true, message: '请输入服务指令名称!' },],
|
||||
tollPrice: [{ required: true, message: '请输入收费价格!' }, { pattern: /^(([0-9]*)|([0]\.\d{0,4}|[1-9][0-9]*\.\d{0,4}))$/, message: '请输入正确的金额!' },],
|
||||
comPrice: [{ required: false }, { pattern: /^(([0-9]*)|([0]\.\d{0,4}|[1-9][0-9]*\.\d{0,4}))$/, message: '请输入正确的金额!' },],
|
||||
izReimbursement: [{ required: true, message: '请选择是否参与医保报销!' },],
|
||||
izPreferential: [{ required: true, message: '请选择是否参与机构优惠!' },],
|
||||
// chargingFrequency: [{ required: true, message: '请选择收费频次!' },],
|
||||
cycleType: [{ required: true, message: '请选择周期类型!' },],
|
||||
// sort: [{ required: true, message: '请输入排序!' }, { pattern: /^\d+$/, message: '请输入正整数!' },],
|
||||
serviceDuration: [
|
||||
{ required: true, message: '请输入服务时长(分钟)!' },
|
||||
{ pattern: /^\d+$/, message: '请输入正整数!' },
|
||||
{
|
||||
validator: (_, value) => {
|
||||
if (value % 5 !== 0) {
|
||||
return Promise.reject('请输入5的倍数!');
|
||||
}
|
||||
return Promise.resolve();
|
||||
},
|
||||
},
|
||||
{
|
||||
validator: (_, value) => {
|
||||
if (value < 5 || value > 55) {
|
||||
return Promise.reject('请输入5到55之间的值!');
|
||||
}
|
||||
return Promise.resolve();
|
||||
},
|
||||
},
|
||||
],
|
||||
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;
|
||||
});
|
||||
const typeDictCode = ref('')
|
||||
|
||||
watch(
|
||||
() => formData.categoryId,
|
||||
(newCategoryId) => {
|
||||
if (!newCategoryId) {
|
||||
formData.typeId = '';
|
||||
typeDictCode.value = 'nu_config_service_type,type_name,id,del_flag = 99 order by sort asc';
|
||||
} else {
|
||||
typeDictCode.value = `nu_config_service_type,type_name,id,del_flag = 0 and category_id = '${newCategoryId}' order by sort asc`;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
formData.bodyTags = ''
|
||||
formData.emotionTags = ''
|
||||
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(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//提成价格不能高于收费价格
|
||||
if (model.comPrice != 0 && model.tollPrice <= model.comPrice) {
|
||||
createMessage.warning('提成价格不能高于收费价格!');
|
||||
confirmLoading.value = false;
|
||||
retrun;
|
||||
}
|
||||
|
||||
await saveOrUpdate(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success(res.message);
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
padding: 14px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,87 @@
|
|||
<template>
|
||||
<j-modal :title="title" width="70vw" :visible="visible" @ok="handleOk"
|
||||
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭"
|
||||
:maskClosable="false">
|
||||
<ConfigServiceDirectiveForm ref="registerForm" v-if="visible" :testOrgInfo="testOrgInfo" @ok="submitCallback"
|
||||
:formDisabled="disableSubmit" :formBpm="false"></ConfigServiceDirectiveForm>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import ConfigServiceDirectiveForm from './ConfigServiceDirectiveForm.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
import { array } from 'vue-types';
|
||||
|
||||
const title = ref<string>('');
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
const props = defineProps({
|
||||
testOrgInfo: {//试验田机构信息
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
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>
|
|
@ -162,8 +162,8 @@ import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMult
|
|||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
import { getOrgInfo } from '/@/api/common/api';
|
||||
// 以下为服务指令引用:
|
||||
import { list, asyncFunc } from '@/views/services/serviceDirective/ConfigServiceDirective.api';
|
||||
import ConfigServiceDirectiveList from '@/views/services/serviceDirective/ConfigServiceDirectiveList.vue'
|
||||
import { list, asyncFunc } from './directiveCom/ConfigServiceDirective.api';
|
||||
import ConfigServiceDirectiveList from './directiveCom/ConfigServiceDirectiveList.vue'
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils'
|
||||
import { selectedColumns } from './directive.data';
|
||||
|
||||
|
|
Loading…
Reference in New Issue