服务指令功能调整 (临时提交) 未完成
This commit is contained in:
parent
ef4c4b7cca
commit
143d55be01
|
@ -23,6 +23,9 @@ VITE_APP_SUB_jeecg-app-1 = '//localhost:8092'
|
||||||
# 试验田机构编码
|
# 试验田机构编码
|
||||||
VITE_SYTJGBM = '101'
|
VITE_SYTJGBM = '101'
|
||||||
|
|
||||||
|
# 服务指令
|
||||||
|
VITE_DIRECTIVE_UPLOAD_PATH = ''
|
||||||
|
|
||||||
# 填写后将作为乾坤子应用启动,主应用注册时AppName需保持一致(放开 VITE_GLOB_QIANKUN_MICRO_APP_NAME 参数表示jeecg-vue3将以乾坤子应用模式启动)
|
# 填写后将作为乾坤子应用启动,主应用注册时AppName需保持一致(放开 VITE_GLOB_QIANKUN_MICRO_APP_NAME 参数表示jeecg-vue3将以乾坤子应用模式启动)
|
||||||
#VITE_GLOB_QIANKUN_MICRO_APP_NAME=jeecg-vue3
|
#VITE_GLOB_QIANKUN_MICRO_APP_NAME=jeecg-vue3
|
||||||
# 作为乾坤子应用启动时必填,需与qiankun主应用注册子应用时填写的 entry 保持一致
|
# 作为乾坤子应用启动时必填,需与qiankun主应用注册子应用时填写的 entry 保持一致
|
||||||
|
|
|
@ -34,7 +34,8 @@
|
||||||
<a-select-option :value="item.value" :disabled="!ignoreDisabled && item.disabled">
|
<a-select-option :value="item.value" :disabled="!ignoreDisabled && item.disabled">
|
||||||
<span :class="[useDicColor && item.color ? 'colorText' : '']"
|
<span :class="[useDicColor && item.color ? 'colorText' : '']"
|
||||||
:style="{ backgroundColor: `${useDicColor && item.color}` }" :title="item.label">
|
:style="{ backgroundColor: `${useDicColor && item.color}` }" :title="item.label">
|
||||||
{{ item.label }}<span style="color:rgb(255 39 39);">{{ ignoreDisabled && item.disabled ? '(已停用)' : '' }}</span>
|
{{ item.label }}<span style="color:rgb(255 39 39);">{{ ignoreDisabled && item.disabled ? '(已停用)' : ''
|
||||||
|
}}</span>
|
||||||
</span>
|
</span>
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</template>
|
</template>
|
||||||
|
@ -76,9 +77,9 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
style: propTypes.any,
|
style: propTypes.any,
|
||||||
ignoreDisabled: propTypes.bool.def(false),
|
ignoreDisabled: propTypes.bool.def(false),
|
||||||
orgCode:'',//组织机构编码 会切换数据源
|
orgCode: '',//组织机构编码 会切换数据源
|
||||||
},
|
},
|
||||||
emits: ['options-change', 'change', 'update:value'],
|
emits: ['options-change', 'change', 'update:value', 'upDictCode'],
|
||||||
setup(props, { emit, refs }) {
|
setup(props, { emit, refs }) {
|
||||||
const dictOptions = ref<any[]>([]);
|
const dictOptions = ref<any[]>([]);
|
||||||
const attrs = useAttrs();
|
const attrs = useAttrs();
|
||||||
|
@ -127,7 +128,7 @@ export default defineComponent({
|
||||||
async function initDictData() {
|
async function initDictData() {
|
||||||
let { dictCode, stringToNumber } = props;
|
let { dictCode, stringToNumber } = props;
|
||||||
//根据字典Code, 初始化字典数组
|
//根据字典Code, 初始化字典数组
|
||||||
const dictData = await initDictOptions(dictCode,props.orgCode);
|
const dictData = await initDictOptions(dictCode, props.orgCode);
|
||||||
|
|
||||||
dictOptions.value = dictData.reduce((prev, next) => {
|
dictOptions.value = dictData.reduce((prev, next) => {
|
||||||
if (next) {
|
if (next) {
|
||||||
|
@ -142,11 +143,13 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
return prev;
|
return prev;
|
||||||
}, []);
|
}, []);
|
||||||
|
emit('upDictCode', dictOptions.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleChange(e) {
|
function handleChange(e) {
|
||||||
const { mode } = unref<Recordable>(getBindValue);
|
const { mode } = unref<Recordable>(getBindValue);
|
||||||
let changeValue: any;
|
let changeValue: any;
|
||||||
|
let changeLabel: any;
|
||||||
// 兼容多选模式
|
// 兼容多选模式
|
||||||
|
|
||||||
//update-begin---author:wangshuai ---date:20230216 for:[QQYUN-4290]公文发文:选择机关代字报错,是因为值改变触发了change事件三次,导致数据发生改变------------
|
//update-begin---author:wangshuai ---date:20230216 for:[QQYUN-4290]公文发文:选择机关代字报错,是因为值改变触发了change事件三次,导致数据发生改变------------
|
||||||
|
@ -162,11 +165,13 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
changeValue = e?.target?.value ?? e;
|
changeValue = e?.target?.value ?? e;
|
||||||
|
// changeLabel = dictOptions.value.filter(d => d.value == changeValue)[0].label
|
||||||
}
|
}
|
||||||
state.value = changeValue;
|
state.value = changeValue;
|
||||||
|
|
||||||
//update-begin---author:wangshuai ---date:20230403 for:【issues/4507】JDictSelectTag组件使用时,浏览器给出警告提示:Expected Function, got Array------------
|
//update-begin---author:wangshuai ---date:20230403 for:【issues/4507】JDictSelectTag组件使用时,浏览器给出警告提示:Expected Function, got Array------------
|
||||||
emit('update:value', changeValue)
|
emit('update:value', changeValue)
|
||||||
|
// emit('upLabel', changeLabel)
|
||||||
//update-end---author:wangshuai ---date:20230403 for:【issues/4507】JDictSelectTag组件使用时,浏览器给出警告提示:Expected Function, got Array述------------
|
//update-end---author:wangshuai ---date:20230403 for:【issues/4507】JDictSelectTag组件使用时,浏览器给出警告提示:Expected Function, got Array述------------
|
||||||
//update-end---author:wangshuai ---date:20230216 for:[QQYUN-4290]公文发文:选择机关代字报错,是因为值改变触发了change事件三次,导致数据发生改变------------
|
//update-end---author:wangshuai ---date:20230216 for:[QQYUN-4290]公文发文:选择机关代字报错,是因为值改变触发了change事件三次,导致数据发生改变------------
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,14 @@ import { useMessage } from "/@/hooks/web/useMessage";
|
||||||
const { createConfirm } = useMessage();
|
const { createConfirm } = useMessage();
|
||||||
|
|
||||||
enum Api {
|
enum Api {
|
||||||
list = '/services/serviceDirective/configServiceDirective/list',
|
list = '/services/serviceDirective/list',
|
||||||
save='/services/serviceDirective/configServiceDirective/add',
|
save='/services/serviceDirective/add',
|
||||||
edit='/services/serviceDirective/configServiceDirective/edit',
|
edit='/services/serviceDirective/edit',
|
||||||
deleteOne = '/services/serviceDirective/configServiceDirective/delete',
|
deleteOne = '/services/serviceDirective/delete',
|
||||||
deleteBatch = '/services/serviceDirective/configServiceDirective/deleteBatch',
|
deleteBatch = '/services/serviceDirective/deleteBatch',
|
||||||
importExcel = '/services/serviceDirective/configServiceDirective/importExcel',
|
importExcel = '/services/serviceDirective/importExcel',
|
||||||
exportXls = '/services/serviceDirective/configServiceDirective/exportXls',
|
exportXls = '/services/serviceDirective/exportXls',
|
||||||
async = '/services/serviceDirective/configServiceDirective/async',
|
async = '/services/serviceDirective/async',
|
||||||
departList = '/sys/sysDepart/list',
|
departList = '/sys/sysDepart/list',
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,11 +93,11 @@
|
||||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
<template v-if="column.dataIndex === 'previewFileMedia'">
|
<template v-if="column.dataIndex === 'previewFileMedia'">
|
||||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||||
<img v-else :src="sysUrlValue + text" style="max-height: 50px;max-width: 80px;">
|
<img v-else :src="text" style="max-height: 50px;max-width: 80px;">
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'immediateFileMedia'">
|
<template v-if="column.dataIndex === 'immediateFileMedia'">
|
||||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||||
<img v-else :src="sysUrlValue + text" style="max-height: 50px;max-width: 80px;">
|
<img v-else :src="text" style="max-height: 50px;max-width: 80px;">
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'bodyTagList'">
|
<template v-if="column.dataIndex === 'bodyTagList'">
|
||||||
<span :title="text.map((item) => item.tagName).join('、')">{{text.map((item) =>
|
<span :title="text.map((item) => item.tagName).join('、')">{{text.map((item) =>
|
||||||
|
@ -110,7 +110,7 @@
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<ConfigServiceDirectiveModal :sysUrlValue="sysUrlValue" ref="registerModal" @success="handleSuccess">
|
<ConfigServiceDirectiveModal ref="registerModal" @success="handleSuccess">
|
||||||
</ConfigServiceDirectiveModal>
|
</ConfigServiceDirectiveModal>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -181,10 +181,8 @@ import ConfigServiceTypeList from '../serviceType/ConfigServiceTypeList.vue';
|
||||||
import BodyTagList from '/@/views/services/directivetag/bodytag/BodyTagList.vue';
|
import BodyTagList from '/@/views/services/directivetag/bodytag/BodyTagList.vue';
|
||||||
import EmotionTagList from '/@/views/services/directivetag/emotiontag/EmotionTagList.vue';
|
import EmotionTagList from '/@/views/services/directivetag/emotiontag/EmotionTagList.vue';
|
||||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||||
import { sysUrl } from '/@/utils/sysBaseInfo/MediaManagePicker.api.ts';
|
|
||||||
|
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const sysUrlValue = ref('')
|
|
||||||
const queryParam = reactive<any>({
|
const queryParam = reactive<any>({
|
||||||
instructionTagId: '',
|
instructionTagId: '',
|
||||||
categoryId: '',
|
categoryId: '',
|
||||||
|
@ -446,9 +444,6 @@ const closeVideoModal = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
sysUrl().then(res => {
|
|
||||||
sysUrlValue.value = res.url
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -10,22 +10,22 @@
|
||||||
id="ConfigServiceDirectiveForm-instructionTagId" name="instructionTagId">
|
id="ConfigServiceDirectiveForm-instructionTagId" name="instructionTagId">
|
||||||
<j-dict-select-tag v-model:value="formData.instructionTagId"
|
<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`"
|
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
|
||||||
placeholder="请选择分类标签" allowClear />
|
placeholder="请选择分类标签" allowClear @upDictCode="upInstructionDictCode" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="ConfigServiceDirectiveForm-categoryId"
|
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="ConfigServiceDirectiveForm-categoryId"
|
||||||
name="categoryId">
|
name="categoryId">
|
||||||
<j-dict-select-tag type="list" v-model:value="formData.categoryId"
|
<j-dict-select-tag type="list" v-model:value="formData.categoryId"
|
||||||
:disabled="!formData.instructionTagId" :dictCode="categoryDictCode" placeholder="请选择服务类别"
|
:disabled="!formData.instructionTagId" :dictCode="categoryDictCode" placeholder="请选择服务类别" allow-clear
|
||||||
allow-clear />
|
@upDictCode="upCategoryDictCode" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="服务类型" v-bind="validateInfos.typeId" id="ConfigServiceDirectiveForm-typeId"
|
<a-form-item label="服务类型" v-bind="validateInfos.typeId" id="ConfigServiceDirectiveForm-typeId"
|
||||||
name="typeId">
|
name="typeId">
|
||||||
<j-dict-select-tag type="list" v-model:value="formData.typeId" :dictCode="typeDictCode"
|
<j-dict-select-tag type="list" v-model:value="formData.typeId" :dictCode="typeDictCode"
|
||||||
:disabled="!formData.categoryId" placeholder="请选择服务类型" allowClear />
|
:disabled="!formData.categoryId" placeholder="请选择服务类型" allowClear @upDictCode="upTypeDictCode" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
<a-form-item label="周期类型" v-bind="validateInfos.cycleType" id="ConfigServiceDirectiveForm-cycleType"
|
<a-form-item label="周期类型" v-bind="validateInfos.cycleType" id="ConfigServiceDirectiveForm-cycleType"
|
||||||
name="cycleType">
|
name="cycleType">
|
||||||
<j-dict-select-tag type="list" v-model:value="formData.cycleType" dictCode="period_type"
|
<j-dict-select-tag type="list" v-model:value="formData.cycleType" dictCode="period_type"
|
||||||
placeholder="请选择周期类型" allowClear />
|
placeholder="请选择周期类型" allowClear @upDictCode="upCycleTypeDictCode" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
|
@ -107,51 +107,31 @@
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="预览图片" v-bind="validateInfos.previewFile">
|
<a-form-item label="服务指令图片" v-bind="validateInfos.previewFile">
|
||||||
<a-button @click="showResourcePicker('previewFile', { maxSelect: 1, fileType: 'image' })" type="link"
|
<JImageUpload :fileMax="1" v-model:value="formData.previewFile" :disabled="!canUploadPreviewImage"
|
||||||
size="small">选取图片</a-button>
|
:bizPath="directiveBizPath">
|
||||||
<!-- <JImageUpload :fileMax="1" v-model:value="formData.previewFileMedia"
|
</JImageUpload>
|
||||||
@change="formData.previewFileChanged = true">
|
|
||||||
</JImageUpload> -->
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="即时指令图片" v-bind="validateInfos.immediateFile">
|
<a-form-item label="即时指令图标" v-bind="validateInfos.immediateFile">
|
||||||
<a-button @click="showResourcePicker('immediateFile', { maxSelect: 1, fileType: 'image' })" type="link"
|
<JImageUpload :fileMax="1" v-model:value="formData.immediateFile" :disabled="!canUploadPreviewImage"
|
||||||
size="small">选取图片</a-button>
|
:bizPath="directiveBizPath">
|
||||||
<!-- <JImageUpload :fileMax="1" v-model:value="formData.immediateFileMedia"
|
</JImageUpload>
|
||||||
@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-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="语音文件" v-bind="validateInfos.mp3File" id="ConfigServiceDirectiveForm-mp3File">
|
<a-form-item label="语音文件" v-bind="validateInfos.mp3File" id="ConfigServiceDirectiveForm-mp3File">
|
||||||
<a-button @click="showResourcePicker('mp3File', { maxSelect: 1, fileType: 'audio' })" type="link"
|
<j-upload v-model:value="formData.mp3File" accept=".mp3" :maxCount="1"
|
||||||
size="small">选取文件</a-button>
|
:disabled="!canUploadPreviewImage" :bizPath="directiveBizPath"></j-upload>
|
||||||
<!-- <j-upload v-model:value="formData.mp3FileMedia" accept=".mp3" :maxCount="1"
|
|
||||||
@change="formData.mp3FileChanged = true"></j-upload> -->
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="视频文件" v-bind="validateInfos.mp4File" id="ConfigServiceDirectiveForm-mp4File">
|
<a-form-item label="视频文件" v-bind="validateInfos.mp4File" id="ConfigServiceDirectiveForm-mp4File">
|
||||||
<a-button @click="showResourcePicker('mp4File', { maxSelect: 1, fileType: 'video' })" type="link"
|
<j-upload v-model:value="formData.mp4File" accept=".mp4" :maxCount="1"
|
||||||
size="small">选取文件</a-button>
|
:disabled="!canUploadPreviewImage" :bizPath="directiveBizPath"></j-upload>
|
||||||
<!-- <j-upload v-model:value="formData.mp4FileMedia" accept=".mp4" :maxCount="1"
|
|
||||||
@change="formData.mp4FileChanged = true"></j-upload> -->
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
@ -166,14 +146,14 @@
|
||||||
<a-col :span="12" v-if="!!formData.mp3File">
|
<a-col :span="12" v-if="!!formData.mp3File">
|
||||||
<a-form-item label="语音预览" id="ConfigServiceDirectiveForm-mp3File">
|
<a-form-item label="语音预览" id="ConfigServiceDirectiveForm-mp3File">
|
||||||
<audio controls disabled="false">
|
<audio controls disabled="false">
|
||||||
<source :src="sysUrlValue + formData.mp3FileMedia">
|
<source :src="getFileAccessHttpUrl(formData.mp3File)">
|
||||||
</audio>
|
</audio>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12" v-if="!!formData.mp4File" :push="!!formData.mp3File ? 0 : 12">
|
<a-col :span="12" v-if="!!formData.mp4File" :push="!!formData.mp3File ? 0 : 12">
|
||||||
<a-form-item label="视频预览" id="ConfigServiceDirectiveForm-mp4File">
|
<a-form-item label="视频预览" id="ConfigServiceDirectiveForm-mp4File">
|
||||||
<video controls>
|
<video controls>
|
||||||
<source :src="sysUrlValue + formData.mp4FileMedia">
|
<source :src="getFileAccessHttpUrl(formData.mp4File)">
|
||||||
</video>
|
</video>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -182,9 +162,6 @@
|
||||||
</template>
|
</template>
|
||||||
</JFormContainer>
|
</JFormContainer>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
|
|
||||||
<MediaResourcePicker :maxSelect="mediaParams.maxSelect" :fileType="mediaParams.fileType"
|
|
||||||
v-model:visible="pickerVisible" @confirm="handleResourceSelected" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
@ -200,30 +177,13 @@ import { saveOrUpdate } from '../ConfigServiceDirective.api';
|
||||||
import { Form } from 'ant-design-vue';
|
import { Form } from 'ant-design-vue';
|
||||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||||
import MediaResourcePicker from '/@/utils/midiaManage/MediaResourcePicker.vue';
|
|
||||||
|
|
||||||
const handleUploadSuccess = (res) => {
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
formDisabled: { type: Boolean, default: false },
|
formDisabled: { type: Boolean, default: false },
|
||||||
formData: { type: Object, default: () => ({}) },
|
formData: { type: Object, default: () => ({}) },
|
||||||
formBpm: { type: Boolean, default: true },
|
formBpm: { type: Boolean, default: true },
|
||||||
sysUrlValue: { type: String, default: '' },
|
|
||||||
});
|
});
|
||||||
const pickerVisible = ref(false);
|
|
||||||
const mediaParams = ref({ maxSelect: 1, fileType: 'any' })
|
|
||||||
const changedMediaObjStr = ref('')
|
|
||||||
const showResourcePicker = (obj, param) => {
|
|
||||||
changedMediaObjStr.value = obj
|
|
||||||
mediaParams.value = param
|
|
||||||
pickerVisible.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleResourceSelected = (selectedResource) => {
|
|
||||||
formData[changedMediaObjStr.value] = selectedResource.id
|
|
||||||
formData[changedMediaObjStr.value + 'Media'] = selectedResource.filePath
|
|
||||||
};
|
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const useForm = Form.useForm;
|
const useForm = Form.useForm;
|
||||||
const emit = defineEmits(['register', 'ok']);
|
const emit = defineEmits(['register', 'ok']);
|
||||||
|
@ -251,10 +211,6 @@ const formData = reactive<Record<string, any>>({
|
||||||
mp4File: '',
|
mp4File: '',
|
||||||
previewFile: '',
|
previewFile: '',
|
||||||
immediateFile: '',
|
immediateFile: '',
|
||||||
mp3FileMedia: '',
|
|
||||||
mp4FileMedia: '',
|
|
||||||
previewFileMedia: '',
|
|
||||||
immediateFileMedia: '',
|
|
||||||
});
|
});
|
||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 6 } });
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 6 } });
|
||||||
|
@ -311,6 +267,55 @@ const disabled = computed(() => {
|
||||||
});
|
});
|
||||||
const categoryDictCode = ref('')
|
const categoryDictCode = ref('')
|
||||||
const typeDictCode = ref('')
|
const typeDictCode = ref('')
|
||||||
|
// 计算属性:是否可以上传预览图片
|
||||||
|
const canUploadPreviewImage = computed(() => {
|
||||||
|
return formData.instructionTagId &&
|
||||||
|
formData.categoryId &&
|
||||||
|
formData.typeId &&
|
||||||
|
formData.directiveName &&
|
||||||
|
formData.cycleType;
|
||||||
|
});
|
||||||
|
|
||||||
|
//分类标签名称
|
||||||
|
const instructionComDictCode = ref([])
|
||||||
|
function upInstructionDictCode(v_) {
|
||||||
|
instructionComDictCode.value = v_
|
||||||
|
}
|
||||||
|
//服务类别名称
|
||||||
|
const categoryComDictCode = ref([])
|
||||||
|
function upCategoryDictCode(v_) {
|
||||||
|
categoryComDictCode.value = v_
|
||||||
|
|
||||||
|
}
|
||||||
|
//服务类型名称
|
||||||
|
const typeComDictCode = ref([])
|
||||||
|
function upTypeDictCode(v_) {
|
||||||
|
typeComDictCode.value = v_
|
||||||
|
|
||||||
|
}
|
||||||
|
//周期类型名称
|
||||||
|
const cycleTypeComDictCode = ref([])
|
||||||
|
function upCycleTypeDictCode(v_) {
|
||||||
|
cycleTypeComDictCode.value = v_
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
watch([instructionComDictCode, categoryComDictCode, typeComDictCode, cycleTypeComDictCode], () => {
|
||||||
|
// 当这些字典数据变化时,强制重新计算 directiveBizPath
|
||||||
|
}, { deep: true });
|
||||||
|
|
||||||
|
const directiveBizPath = computed(() => {
|
||||||
|
if (!canUploadPreviewImage.value) return '';
|
||||||
|
|
||||||
|
// 获取各个字段的字典值
|
||||||
|
const instructionTagName_ = instructionComDictCode.value.filter(d => d.value == formData.instructionTagId)?.[0]?.label;
|
||||||
|
const categoryName_ = categoryComDictCode.value.filter(d => d.value == formData.categoryId)?.[0]?.label;
|
||||||
|
const typeName_ = typeComDictCode.value.filter(d => d.value == formData.typeId)?.[0]?.label;
|
||||||
|
const cycleTypeName_ = cycleTypeComDictCode.value.filter(d => d.value == formData.cycleType)?.[0]?.label;
|
||||||
|
|
||||||
|
// 构建路径
|
||||||
|
return `${instructionTagName_}/${categoryName_}/${typeName_}/${formData.directiveName}/${cycleTypeName_}`;
|
||||||
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => formData.instructionTagId,
|
() => formData.instructionTagId,
|
||||||
|
@ -403,6 +408,9 @@ async function submitForm() {
|
||||||
retrun;
|
retrun;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
model.mediaFileSavePath = directiveBizPath
|
||||||
|
|
||||||
await saveOrUpdate(model, isUpdate.value)
|
await saveOrUpdate(model, isUpdate.value)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|
|
@ -1,80 +1,82 @@
|
||||||
<template>
|
<template>
|
||||||
<j-modal :title="title" width="70vw" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭" :maskClosable="false">
|
<j-modal :title="title" width="70vw" :visible="visible" @ok="handleOk"
|
||||||
<ConfigServiceDirectiveForm ref="registerForm" v-if="visible" @ok="submitCallback" :sysUrlValue="sysUrlValue" :formDisabled="disableSubmit" :formBpm="false"></ConfigServiceDirectiveForm>
|
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭"
|
||||||
|
:maskClosable="false">
|
||||||
|
<ConfigServiceDirectiveForm ref="registerForm" v-if="visible" @ok="submitCallback" :formDisabled="disableSubmit"
|
||||||
|
:formBpm="false"></ConfigServiceDirectiveForm>
|
||||||
</j-modal>
|
</j-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, nextTick, defineExpose , defineProps} from 'vue';
|
import { ref, nextTick, defineExpose, defineProps } from 'vue';
|
||||||
import ConfigServiceDirectiveForm from './ConfigServiceDirectiveForm.vue'
|
import ConfigServiceDirectiveForm from './ConfigServiceDirectiveForm.vue'
|
||||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
sysUrlValue: { type: String, default: '' },
|
});
|
||||||
});
|
const title = ref<string>('');
|
||||||
const title = ref<string>('');
|
const visible = ref<boolean>(false);
|
||||||
const visible = ref<boolean>(false);
|
const disableSubmit = ref<boolean>(false);
|
||||||
const disableSubmit = ref<boolean>(false);
|
const registerForm = ref();
|
||||||
const registerForm = ref();
|
const emit = defineEmits(['register', 'success']);
|
||||||
const emit = defineEmits(['register', 'success']);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
function add() {
|
function add() {
|
||||||
title.value = '新增';
|
title.value = '新增';
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
registerForm.value.add();
|
registerForm.value.add();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
* @param record
|
* @param record
|
||||||
*/
|
*/
|
||||||
function edit(record) {
|
function edit(record) {
|
||||||
title.value = disableSubmit.value ? '详情' : '编辑';
|
title.value = disableSubmit.value ? '详情' : '编辑';
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
registerForm.value.edit(record);
|
registerForm.value.edit(record);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确定按钮点击事件
|
* 确定按钮点击事件
|
||||||
*/
|
*/
|
||||||
function handleOk() {
|
function handleOk() {
|
||||||
registerForm.value.submitForm();
|
registerForm.value.submitForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* form保存回调事件
|
* form保存回调事件
|
||||||
*/
|
*/
|
||||||
function submitCallback() {
|
function submitCallback() {
|
||||||
handleCancel();
|
handleCancel();
|
||||||
emit('success');
|
emit('success');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消按钮回调事件
|
* 取消按钮回调事件
|
||||||
*/
|
*/
|
||||||
function handleCancel() {
|
function handleCancel() {
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
add,
|
add,
|
||||||
edit,
|
edit,
|
||||||
disableSubmit,
|
disableSubmit,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
/**隐藏样式-modal确定按钮 */
|
/**隐藏样式-modal确定按钮 */
|
||||||
.jee-hidden {
|
.jee-hidden {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style lang="less" scoped></style>
|
<style lang="less" scoped></style>
|
||||||
|
|
|
@ -4,14 +4,14 @@ import { useMessage } from "/@/hooks/web/useMessage";
|
||||||
const { createConfirm } = useMessage();
|
const { createConfirm } = useMessage();
|
||||||
|
|
||||||
enum Api {
|
enum Api {
|
||||||
list = '/services/serviceDirective/configServiceDirective/list',
|
list = '/services/serviceDirective/list',
|
||||||
save='/services/serviceDirective/configServiceDirective/add',
|
save='/services/serviceDirective/add',
|
||||||
edit='/services/serviceDirective/configServiceDirective/edit',
|
edit='/services/serviceDirective/edit',
|
||||||
deleteOne = '/services/serviceDirective/configServiceDirective/delete',
|
deleteOne = '/services/serviceDirective/delete',
|
||||||
deleteBatch = '/services/serviceDirective/configServiceDirective/deleteBatch',
|
deleteBatch = '/services/serviceDirective/deleteBatch',
|
||||||
importExcel = '/services/serviceDirective/configServiceDirective/importExcel',
|
importExcel = '/services/serviceDirective/importExcel',
|
||||||
exportXls = '/services/serviceDirective/configServiceDirective/exportXls',
|
exportXls = '/services/serviceDirective/exportXls',
|
||||||
async = '/services/serviceDirective/configServiceDirective/async',
|
async = '/services/serviceDirective/async',
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { useMessage } from "/@/hooks/web/useMessage";
|
||||||
const { createConfirm } = useMessage();
|
const { createConfirm } = useMessage();
|
||||||
|
|
||||||
enum Api {
|
enum Api {
|
||||||
list = '/services/serviceDirective/configServiceDirective/list',
|
list = '/services/serviceDirective/list',
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue