修改bug
This commit is contained in:
parent
fd2d25510c
commit
dec4bc7c35
|
|
@ -23,10 +23,10 @@ VITE_APP_SUB_jeecg-app-1 = '//localhost:8091'
|
|||
# 管理平台静态资源路径
|
||||
VITE_OPE_MEDIA_ADDRESS = 'https://www.focusnu.com/media/'
|
||||
|
||||
# 长者标签-体型标签默认图片
|
||||
VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'default/bodyDefault.png'
|
||||
# 长者标签-情绪标签默认图片
|
||||
VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'default/emoDefault.png'
|
||||
# 长者标签-标签默认图片
|
||||
VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'directive/index/index/moren.png'
|
||||
# 长者标签-标签焦点图片
|
||||
VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'directive/index/index/morencheck.png'
|
||||
# 服务指令-服务指令图片(大)默认图片
|
||||
VITE_DEFAULT_DIRECTIVE_PRE_PIC = 'default/predefault.png'
|
||||
# 服务指令-服务指令图片(小)默认图片
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ VITE_APP_SUB_jeecg-app-1 = '//localhost:8092'
|
|||
# 管理平台静态资源路径
|
||||
VITE_OPE_MEDIA_ADDRESS = 'https://www.focusnu.com/media/upFiles/'
|
||||
|
||||
# 长者标签-体型标签默认图片
|
||||
VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'default/bodyDefault.png'
|
||||
# 长者标签-情绪标签默认图片
|
||||
VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'default/emoDefault.png'
|
||||
# 长者标签-标签默认图片
|
||||
VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'directive/index/index/moren.png'
|
||||
# 长者标签-标签焦点图片
|
||||
VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'directive/index/index/morenCheck.png'
|
||||
# 服务指令-服务指令图片(大)默认图片
|
||||
VITE_DEFAULT_DIRECTIVE_PRE_PIC = 'default/predefault.png'
|
||||
# 服务指令-服务指令图片(小)默认图片
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ VITE_APP_SUB_jeecg-app-1 = '//localhost:8092'
|
|||
# 管理平台静态资源路径
|
||||
VITE_OPE_MEDIA_ADDRESS = 'https://www.focusnu.com/media/upFiles/'
|
||||
|
||||
# 长者标签-体型标签默认图片
|
||||
VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'default/bodyDefault.png'
|
||||
# 长者标签-情绪标签默认图片
|
||||
VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'default/emoDefault.png'
|
||||
# 长者标签-标签默认图片
|
||||
VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'directive/index/index/moren.png'
|
||||
# 长者标签-标签焦点图片
|
||||
VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'directive/index/index/morenCheck.png'
|
||||
# 服务指令-服务指令图片(大)默认图片
|
||||
VITE_DEFAULT_DIRECTIVE_PRE_PIC = 'default/predefault.png'
|
||||
# 服务指令-服务指令图片(小)默认图片
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ VITE_GLOB_API_URL_PREFIX=
|
|||
# 管理平台静态资源路径
|
||||
VITE_OPE_MEDIA_ADDRESS = 'https://www.focusnu.com/media/'
|
||||
|
||||
# 长者标签-体型标签默认图片
|
||||
VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'default/bodyDefault.png'
|
||||
# 长者标签-情绪标签默认图片
|
||||
VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'default/emoDefault.png'
|
||||
# 长者标签-标签默认图片
|
||||
VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'directive/index/index/moren.png'
|
||||
# 长者标签-标签焦点图片
|
||||
VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'directive/index/index/morenCheck.png'
|
||||
# 服务指令-服务指令图片(大)默认图片
|
||||
VITE_DEFAULT_DIRECTIVE_PRE_PIC = 'default/predefault.png'
|
||||
# 服务指令-服务指令图片(小)默认图片
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="clearfix">
|
||||
<a-upload :listType="listType" accept="image/*" :multiple="multiple" :action="currentUploadUrl"
|
||||
:data="{ biz: bizPath, ...extraUploadData }" :headers="headers" v-model:fileList="uploadFileList"
|
||||
:beforeUpload="beforeUpload" :disabled="disabled" @change="handleChange" @preview="handlePreview">
|
||||
:beforeUpload="beforeUpload" :disabled="disabled" @change="handleChange" @preview="handlePreview" :showUploadList="{showPreviewIcon:false}">
|
||||
<div v-if="uploadVisible">
|
||||
<div v-if="listType == 'picture-card'">
|
||||
<LoadingOutlined v-if="loading" />
|
||||
|
|
@ -26,11 +26,11 @@
|
|||
</div>
|
||||
</a-modal> -->
|
||||
|
||||
<a-modal :open="previewVisible" :width="modalWidth"
|
||||
<!-- <a-modal :open="previewVisible" :width="modalWidth"
|
||||
:bodyStyle="{ padding: 0, display: 'flex', justifyContent: 'center', alignItems: 'center' }" :footer="null"
|
||||
@cancel="handleCancel">
|
||||
<img ref="previewImgRef" class="preview-img" :src="previewImage" @load="handleImageLoad" />
|
||||
</a-modal>
|
||||
</a-modal> -->
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/resourcesManagement/nuResourcesManagement/list',
|
||||
save='/resourcesManagement/nuResourcesManagement/add',
|
||||
edit='/resourcesManagement/nuResourcesManagement/edit',
|
||||
deleteOne = '/resourcesManagement/nuResourcesManagement/delete',
|
||||
deleteBatch = '/resourcesManagement/nuResourcesManagement/deleteBatch',
|
||||
importExcel = '/resourcesManagement/nuResourcesManagement/importExcel',
|
||||
exportXls = '/resourcesManagement/nuResourcesManagement/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,50 @@
|
|||
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: 'resourcesType_dictText'
|
||||
},
|
||||
{
|
||||
title: '附件类型',
|
||||
align: "center",
|
||||
dataIndex: 'fileType_dictText'
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
align: "center",
|
||||
dataIndex: 'name'
|
||||
},
|
||||
{
|
||||
title: '附件',
|
||||
align: "center",
|
||||
dataIndex: 'filePath',
|
||||
customRender: render.renderImage,
|
||||
},
|
||||
{
|
||||
title: '选中图片',
|
||||
align: "center",
|
||||
dataIndex: 'checkPicPath',
|
||||
customRender: render.renderImage,
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
align: "center",
|
||||
dataIndex: 'content'
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
resourcesType: {title: '资源类型',order: 0,view: 'list', type: 'string',dictCode: 'resources_type',},
|
||||
fileType: {title: '附件类型',order: 1,view: 'list', type: 'string',dictCode: 'file_type',},
|
||||
name: {title: '名称',order: 2,view: 'text', type: 'string',},
|
||||
filePath: {title: '附件',order: 3,view: 'image', type: 'string',},
|
||||
checkPicPath: {title: '选中图片',order: 4,view: 'image', type: 'string',},
|
||||
content: {title: '备注',order: 5,view: 'textarea', type: 'string',},
|
||||
};
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
<template>
|
||||
<div class="p-2">
|
||||
<a-row>
|
||||
<a-col :span="12" v-for="(item,index) in dataList" :key="index">
|
||||
<a-card style="margin: 5px;">
|
||||
<template #title><span :title="item.name">{{ item.name }}</span></template>
|
||||
<template #extra><a @click="handleCheck(item)">选择</a></template>
|
||||
<a-row style="text-align: center;">
|
||||
<a-col :span="12">
|
||||
<a-row>
|
||||
<a-col :sapn="24">
|
||||
<img :width="50" :height="50" :src="opeMediaAddress + item.filePath" />
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
默认图标
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-row>
|
||||
<a-col :sapn="24">
|
||||
<img :width="50" :height="50" :src="opeMediaAddress + item.checkPicPath" />
|
||||
</a-col>
|
||||
<a-col :sapn="24">
|
||||
焦点图标
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="resourcesManagement-nuResourcesManagement" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
|
||||
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
|
||||
const dataList = ref([]);
|
||||
const imageUrl = ref('https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png');
|
||||
|
||||
|
||||
function open() {
|
||||
defHttp.get({ url: '/resourcesManagement/nuResourcesManagement/list', params: { pageSize: -1,resourcesType:'1' } }).then(res => {
|
||||
console.log("🚀 ~ open ~ res:", res)
|
||||
dataList.value = res.records;
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
function handleCheck(record) {
|
||||
console.log("🚀 ~ handleCheck ~ record:", record)
|
||||
emit('ok', record);
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
});
|
||||
|
||||
</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,70 @@
|
|||
<template>
|
||||
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
|
||||
<NuResourcesManagementList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuResourcesManagementList>
|
||||
<template #footer>
|
||||
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
|
||||
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import NuResourcesManagementList from './NuResourcesManagementList.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', 'ok']);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function open() {
|
||||
title.value = '选择长者标签图片';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.open();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback(record) {
|
||||
handleCancel();
|
||||
emit('ok',record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
||||
|
|
@ -0,0 +1,197 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuResourcesManagementForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="资源类型" v-bind="validateInfos.resourcesType" id="NuResourcesManagementForm-resourcesType" name="resourcesType">
|
||||
<j-dict-select-tag v-model:value="formData.resourcesType" dictCode="resources_type" placeholder="请选择类型" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="附件类型" v-bind="validateInfos.fileType" id="NuResourcesManagementForm-fileType" name="fileType">
|
||||
<j-dict-select-tag v-model:value="formData.fileType" dictCode="file_type" placeholder="请选择附件类型" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="名称" v-bind="validateInfos.name" id="NuResourcesManagementForm-name" name="name">
|
||||
<a-input v-model:value="formData.name" maxlength="20" show-count placeholder="请输入名称" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" v-if="formData.fileType == 'image'">
|
||||
<a-form-item label="附件" v-bind="validateInfos.filePath" id="NuResourcesManagementForm-filePath" name="filePath">
|
||||
<j-image-upload :fileMax="1" v-model:value="formData.filePath" ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" v-if="formData.fileType == 'image'">
|
||||
<a-form-item label="选中图片" v-bind="validateInfos.checkPicPath" id="NuResourcesManagementForm-checkPicPath" name="checkPicPath">
|
||||
<j-image-upload :fileMax="1" v-model:value="formData.checkPicPath" ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" v-if="formData.fileType == 'video'">
|
||||
<a-form-item label="视频" v-bind="validateInfos.filePath" id="NuResourcesManagementForm-filePath" name="filePath">
|
||||
<j-upload :fileMax="1" v-model:value="formData.filePath" ></j-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" v-if="formData.fileType == 'audio'">
|
||||
<a-form-item label="音频" v-bind="validateInfos.filePath" id="NuResourcesManagementForm-filePath" name="filePath">
|
||||
<j-upload :fileMax="1" v-model:value="formData.filePath" ></j-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" v-if="formData.fileType == 'document'">
|
||||
<a-form-item label="文档" v-bind="validateInfos.filePath" id="NuResourcesManagementForm-filePath" name="filePath">
|
||||
<j-upload :fileMax="1" v-model:value="formData.filePath" ></j-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="备注" v-bind="validateInfos.content" id="NuResourcesManagementForm-content" name="content">
|
||||
<a-textarea v-model:value="formData.content" maxlength="50" show-count :rows="4" placeholder="请输入备注" />
|
||||
</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 JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../NuResourcesManagement.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: '',
|
||||
resourcesType: '',
|
||||
fileType: '',
|
||||
name: '',
|
||||
filePath: '',
|
||||
checkPicPath: '',
|
||||
content: '',
|
||||
});
|
||||
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({
|
||||
resourcesType: [{ required: true, message: '请选择类型' }],
|
||||
fileType: [{ required: true, message: '请选择附件类型' }],
|
||||
name: [{ required: true, message: '请输入名称' }],
|
||||
filePath: [{ 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,82 @@
|
|||
<template>
|
||||
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
|
||||
<NuResourcesManagementForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuResourcesManagementForm>
|
||||
<template #footer>
|
||||
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
|
||||
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import NuResourcesManagementForm from './NuResourcesManagementForm.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,6 +1,6 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="true">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="ElderTagForm">
|
||||
<a-row class="card-class">
|
||||
|
|
@ -29,21 +29,24 @@
|
|||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="默认图标" v-bind="validateInfos.pic" id="ElderTagForm-pic" name="pic">
|
||||
<!-- <JImageUploadToOpe v-if="opeType == 'dmlook'" :fileMax="1" v-model:value="dmlookVal">
|
||||
<span style="margin-left:155px;">
|
||||
<a-button v-if="!disabled" @click="handleElderTag">选择图标</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
<a-col :span="12" style="margin-top: 10px;">
|
||||
<a-form-item label="默认图标" v-bind="validateInfos.pic" id="ElderTagForm-pic" name="pic" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
|
||||
<!-- <JImageUploadToOpe :toOpe="true" :bizPath="upBizPrefix + '/zzxx/zzbq'" :fileMax="1"
|
||||
v-model:value="formData.pic" :disabled="true" >
|
||||
</JImageUploadToOpe> -->
|
||||
<JImageUploadToOpe :toOpe="true" :bizPath="upBizPrefix + '/zzxx/zzbq'" :fileMax="1"
|
||||
v-model:value="formData.pic" :disabled="!!formData.id || !isMain">
|
||||
</JImageUploadToOpe>
|
||||
<img :width="50" :height="50" :src="opeMediaAddress+formData.pic" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="焦点图标" v-bind="validateInfos.picFocus" id="ElderTagForm-picFocus" name="picFocus">
|
||||
<!-- <JImageUploadToOpe v-if="opeType == 'dmlook'" :fileMax="1" v-model:value="dmlookVal">
|
||||
<a-col :span="12" style="margin-top: 10px;">
|
||||
<a-form-item label="焦点图标" v-bind="validateInfos.picFocus" id="ElderTagForm-picFocus" name="picFocus" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
|
||||
<!-- <JImageUploadToOpe :toOpe="true" :bizPath="upBizPrefix + '/zzxx/zzbq'" :fileMax="1"
|
||||
v-model:value="formData.picFocus" :disabled="true" >
|
||||
</JImageUploadToOpe> -->
|
||||
<JImageUploadToOpe :toOpe="true" :bizPath="upBizPrefix + '/zzxx/zzbq'" :fileMax="1"
|
||||
v-model:value="formData.picFocus" :disabled="!!formData.id || !isMain">
|
||||
</JImageUploadToOpe>
|
||||
<img :width="50" :height="50" :src="opeMediaAddress+formData.picFocus" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- <a-col :span="24">
|
||||
|
|
@ -61,6 +64,7 @@
|
|||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
<NuResourcesManagementListModal ref="elderTagModal" @ok="handleElderTagOk"></NuResourcesManagementListModal>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
|
|
@ -75,6 +79,7 @@ import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue'
|
|||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
import JImageUploadToOpe from '/@/components/Form/src/jeecg/components/JImageUploadToOpe.vue';
|
||||
import NuResourcesManagementListModal from '/@/views/admin/resourcesManagement/NuResourcesManagementListModal.vue';
|
||||
import { queryUpBizPrefix } from '/@/api/common/api'
|
||||
|
||||
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
|
||||
|
|
@ -87,6 +92,7 @@ const props = defineProps({
|
|||
isMain: false,//是否主指令库
|
||||
});
|
||||
const dmlookVal = ref('')
|
||||
const elderTagModal = ref();
|
||||
const defaultBodyPic = import.meta.env.VITE_DEFAULT_ELDER_TAG_BODY_PIC
|
||||
const defaultEmoPic = import.meta.env.VITE_DEFAULT_ELDER_TAG_EMO_PIC
|
||||
const upBizPrefix = ref('')
|
||||
|
|
@ -116,7 +122,7 @@ const formData = reactive<Record<string, any>>({
|
|||
tagName: '',
|
||||
price: 0,
|
||||
pic: defaultBodyPic,
|
||||
picFocus: defaultBodyPic,
|
||||
picFocus: defaultEmoPic,
|
||||
sort: 99,
|
||||
izEnabled: 'Y',
|
||||
describ: '',
|
||||
|
|
@ -124,6 +130,8 @@ const formData = reactive<Record<string, any>>({
|
|||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||
const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 10 } });
|
||||
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 14 } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
|
|
@ -151,7 +159,7 @@ const disabled = computed(() => {
|
|||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
edit({pic:'',pic});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -255,6 +263,18 @@ function handleTypeChanged(v_) {
|
|||
}
|
||||
}
|
||||
|
||||
//打开选择标签页面
|
||||
function handleElderTag(){
|
||||
elderTagModal.value.disableSubmit = true
|
||||
elderTagModal.value.open();
|
||||
}
|
||||
//选择标签图片回调
|
||||
function handleElderTagOk(record){
|
||||
console.log("🚀 ~ handleElderTagOk ~ record:", record)
|
||||
formData.pic = record.filePath
|
||||
formData.picFocus = record.checkPicPath
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@
|
|||
<a-button @click="handleCancel" style="margin-right: 8px;">关闭</a-button>
|
||||
<a-button @click="handleOk" v-show="!disableSubmit">确认</a-button>
|
||||
</template>
|
||||
<ElderTagForm v-if="disableSubmit" ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"
|
||||
<ElderTagForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"
|
||||
:mediaApiAddress="mediaApiAddress" :opeType="opeType" :isMain="isMain"></ElderTagForm>
|
||||
<ElderTagFormEdit v-else ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"
|
||||
:mediaApiAddress="mediaApiAddress" :opeType="opeType" :isMain="isMain"></ElderTagFormEdit>
|
||||
<!-- <ElderTagFormEdit v-else ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"
|
||||
:mediaApiAddress="mediaApiAddress" :opeType="opeType" :isMain="isMain"></ElderTagFormEdit> -->
|
||||
</a-drawer>
|
||||
<a-drawer :title="'标准标签库'" width="80vw" v-model:visible="etmVisible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" @close="handleCancelETM" :maskClosable="true">
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<a-col :span="24">
|
||||
<a-form-item label="供应商地址" v-bind="validateInfos.suppliersAddress"
|
||||
id="NuConfigSuppliersApplyForm-suppliersAddress" name="suppliersAddress">
|
||||
<a-input v-model:value="formData.suppliersAddress" placeholder="请输入供应商地址" disabled></a-input>
|
||||
<a-textarea v-model:value="formData.suppliersAddress" placeholder="请输入供应商地址" rows="2" disabled></a-textarea>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
|
|
@ -67,6 +67,7 @@
|
|||
<!-- <a-input v-model:value="formData.applyStatus" placeholder="请输入审核状态" ></a-input> -->
|
||||
<a-select v-model:value="formData.applyStatus" placeholder="请选择审核状态" style="width: 200px"
|
||||
:disabled="false">
|
||||
<a-select-option value="1">待审核</a-select-option>
|
||||
<a-select-option value="2">审核通过</a-select-option>
|
||||
<a-select-option value="3">审核驳回</a-select-option>
|
||||
<a-select-option value="4">待审核</a-select-option>
|
||||
|
|
@ -74,7 +75,7 @@
|
|||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" v-show="formData.applyStatus == 3 || formData.applyStatus == 5" v-if="!disabled">
|
||||
<a-col :span="24" v-show="formData.applyStatus == 3 || formData.applyStatus == 5">
|
||||
<a-form-item label="驳回原因" v-bind="validateInfos.applyContent" id="NuConfigSuppliersApplyForm-applyContent"
|
||||
name="applyContent">
|
||||
<a-textarea :maxlength="50" show-count v-model:value="formData.applyContent" placeholder="请输入驳回原因" rows="4"></a-textarea>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<a-col :span="24">
|
||||
<a-form-item label="供应商地址" v-bind="validateInfos.suppliersAddress"
|
||||
id="NuConfigSuppliersApplyForm-suppliersAddress" name="suppliersAddress">
|
||||
<a-input v-model:value="formData.suppliersAddress" placeholder="请输入供应商地址" disabled></a-input>
|
||||
<a-textarea v-model:value="formData.suppliersAddress" placeholder="请输入供应商地址" rows="2" disabled></a-textarea>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
|
|
|
|||
Loading…
Reference in New Issue