服务指令文件同步
This commit is contained in:
parent
0e4720b3f2
commit
40d5dfbfcc
|
@ -14,6 +14,7 @@ enum Api {
|
|||
exportXls = '/services/serviceDirective/exportXls',
|
||||
async = '/services/serviceDirective/async',
|
||||
departList = '/sys/sysDepart/list',
|
||||
syncMediaForBiz = '/services/serviceDirective/syncMediaForBiz',
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -90,3 +91,11 @@ export const audit = (params) => {
|
|||
export const asyncFunc = (params) => {
|
||||
return defHttp.post({ url: Api.async, params }, { isTransformResponse: false });
|
||||
};
|
||||
|
||||
/**
|
||||
* 审批通过后将指令资源同步给业务平台
|
||||
* @param params
|
||||
*/
|
||||
export const syncMediaForBiz = (params) => {
|
||||
return defHttp.post({ url: Api.syncMediaForBiz, params });
|
||||
};
|
|
@ -316,6 +316,7 @@ function handleSuperQuery(params) {
|
|||
*/
|
||||
function handleAdd() {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.auditSaveMeida = false;
|
||||
registerModal.value.add();
|
||||
}
|
||||
|
||||
|
@ -324,6 +325,7 @@ function handleAdd() {
|
|||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.auditSaveMeida = false;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
|
@ -332,6 +334,7 @@ function handleEdit(record: Recordable) {
|
|||
*/
|
||||
function handleMedia(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.auditSaveMeida = false;
|
||||
registerModal.value.editMedia(record);
|
||||
}
|
||||
|
||||
|
@ -340,6 +343,7 @@ function handleMedia(record: Recordable) {
|
|||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.auditSaveMeida = false;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ 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, audit } from '../ConfigServiceDirective.api';
|
||||
import { saveOrUpdate, audit, syncMediaForBiz } from '../ConfigServiceDirective.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
|
@ -246,6 +246,7 @@ const formData = reactive<Record<string, any>>({
|
|||
immediateFile: '',
|
||||
status: '',
|
||||
statusVal: undefined,
|
||||
sysOrgCode: undefined,
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 6 } });
|
||||
|
@ -466,6 +467,10 @@ async function submitForm() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核
|
||||
* 包含通知业务系统更新各字典及指令主表的数据状态
|
||||
*/
|
||||
function submitAudit() {
|
||||
if (formData.statusVal == 'auditPass') {
|
||||
formData.status = 2
|
||||
|
@ -477,12 +482,24 @@ function submitAudit() {
|
|||
}
|
||||
audit(formData)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success('操作成功!');
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
createMessage.success('操作成功!');
|
||||
emit('ok');
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步媒体资源给业务平台
|
||||
*
|
||||
*/
|
||||
function syncMediaForBizFunc() {
|
||||
formData.mediaFileSavePath = directiveBizPath
|
||||
syncMediaForBiz(formData)
|
||||
.then((res) => {
|
||||
createMessage.success('操作成功!');
|
||||
emit('ok');
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
|
@ -494,6 +511,7 @@ defineExpose({
|
|||
edit,
|
||||
submitForm,
|
||||
submitAudit,
|
||||
syncMediaForBizFunc,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -2,12 +2,18 @@
|
|||
<j-modal :title="title" width="70vw" :visible="visible" @ok="handleOk"
|
||||
:okButtonProps="{ class: { 'jee-hidden': (disableSubmit && !isAudit) } }" @cancel="handleCancel" cancelText="关闭"
|
||||
:maskClosable="false">
|
||||
<template #footer>
|
||||
<a-button @click="handleCancel">关闭</a-button>
|
||||
<a-button @click="handleOk" v-show="!auditSaveMeida">确定</a-button>
|
||||
<a-button @click="handleSave" v-show="auditSaveMeida">暂存</a-button>
|
||||
<a-button type="primary" @click="handleMediaAsync" v-show="auditSaveMeida">同步</a-button>
|
||||
</template>
|
||||
<ConfigServiceDirectiveForm ref="registerForm" v-if="visible" @ok="submitCallback" :formDisabled="disableSubmit"
|
||||
:formBpm="false"></ConfigServiceDirectiveForm>
|
||||
</j-modal>
|
||||
<j-modal title="审核列表" width="70vw" :visible="auditVisible" :okButtonProps="{ class: { 'jee-hidden': true } }"
|
||||
@cancel="handleAuditCancel" cancelText="关闭" :maskClosable="false">
|
||||
<ServiceDirectiveAuditList></ServiceDirectiveAuditList>
|
||||
<ServiceDirectiveAuditList ref="auditListRef"></ServiceDirectiveAuditList>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
|
@ -24,7 +30,9 @@ const visible = ref<boolean>(false);
|
|||
const auditVisible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const isAudit = ref<boolean>(false);
|
||||
const auditSaveMeida = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const auditListRef = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
|
||||
|
@ -70,6 +78,7 @@ function audit(record) {
|
|||
*/
|
||||
function openAuditList() {
|
||||
auditVisible.value = true;
|
||||
auditListRef.value?.open();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -95,6 +104,20 @@ function handleOk() {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂存
|
||||
*/
|
||||
function handleSave() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* 给业务同步资源
|
||||
*/
|
||||
function handleMediaAsync() {
|
||||
registerForm.value.syncMediaForBizFunc();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
|
@ -115,6 +138,7 @@ function handleCancel() {
|
|||
*/
|
||||
function handleAuditCancel() {
|
||||
auditVisible.value = false;
|
||||
emit('success')
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
|
@ -125,6 +149,7 @@ defineExpose({
|
|||
audit,
|
||||
isAudit,
|
||||
openAuditList,
|
||||
auditSaveMeida,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -129,6 +129,7 @@ const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDat
|
|||
function handleAudit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.isAudit = true;
|
||||
registerModal.value.auditSaveMeida = false;
|
||||
registerModal.value.audit(record);
|
||||
}
|
||||
|
||||
|
@ -144,6 +145,7 @@ function handleSuccess() {
|
|||
*/
|
||||
function handleMedia(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.auditSaveMeida = true;
|
||||
registerModal.value.editMedia(record);
|
||||
}
|
||||
|
||||
|
@ -241,6 +243,10 @@ const stopAudio = () => {
|
|||
}
|
||||
};
|
||||
|
||||
function open() {
|
||||
reload()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// 添加音频结束监听
|
||||
if (audioPlayer.value) {
|
||||
|
@ -250,6 +256,10 @@ onMounted(() => {
|
|||
}
|
||||
});
|
||||
|
||||
defineExpose({
|
||||
open
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
|
Loading…
Reference in New Issue