添加域名地址及项目名称等配置
This commit is contained in:
parent
11a21317ef
commit
d7e758fb8d
|
|
@ -7,7 +7,9 @@ enum Api {
|
|||
list = '/workorder/workOrder/list',
|
||||
save='/workorder/workOrder/add',
|
||||
saveSjygl='/sys/dataSource/add',
|
||||
editDepart='/sys/sysDepart/edit',
|
||||
edit='/workorder/workOrder/edit',
|
||||
editUrl='/workorder/workOrder/editUrl',
|
||||
updateMqById='/workorder/workOrder/updateMqById',
|
||||
deleteOne = '/workorder/workOrder/delete',
|
||||
deleteBatch = '/workorder/workOrder/deleteBatch',
|
||||
|
|
@ -73,6 +75,12 @@ export const saveOrUpdate = (params, isUpdate) => {
|
|||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
}
|
||||
export const editUrl = (params, isUpdate) => {
|
||||
return defHttp.post({ url: Api.editUrl, params }, { isTransformResponse: false });
|
||||
}
|
||||
export const editDepart = (params, isUpdate) => {
|
||||
return defHttp.post({ url: Api.editDepart, params }, { isTransformResponse: false });
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -187,10 +187,15 @@ function getTableAction(record) {
|
|||
onClick: handleSjygl.bind(null, record),
|
||||
ifShow: record.status == '0'
|
||||
},
|
||||
{
|
||||
label: '访问配置',
|
||||
onClick: handleFwpz.bind(null, record),
|
||||
ifShow: record.status == '1'
|
||||
},
|
||||
{
|
||||
label: '反馈',
|
||||
onClick: handleQueren.bind(null, record),
|
||||
ifShow: record.status == '1'
|
||||
ifShow: record.status == '2'
|
||||
},
|
||||
];
|
||||
}
|
||||
|
|
@ -204,6 +209,13 @@ function handleQueren(record) {
|
|||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.orgFankui(record);
|
||||
}
|
||||
/**
|
||||
* 访问配置
|
||||
*/
|
||||
function handleFwpz(record) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.orgFwpz(record);
|
||||
}
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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="WorkOrderForm">
|
||||
<a-row class="card-class">
|
||||
<a-col :span="24">
|
||||
<a-form-item label="机构名称" v-bind="validateInfos.orgName" id="WorkOrderForm-orgName" name="orgName">
|
||||
<a-input v-model:value="formData.orgName" disabled allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="机构编码" v-bind="validateInfos.orgCode" id="WorkOrderForm-orgCode" name="orgCode">
|
||||
<a-input v-model:value="formData.orgCode" disabled allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" >
|
||||
<a-form-item label="域名" v-bind="validateInfos.url" id="WorkOrderForm-url"
|
||||
name="url">
|
||||
<a-input v-model:value="formData.url" placeholder="请输入域名" :maxlength="100" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" >
|
||||
<a-form-item label="项目名称" v-bind="validateInfos.contextPath" id="WorkOrderForm-contextPath"
|
||||
name="contextPath">
|
||||
<a-input v-model:value="formData.contextPath" placeholder="请输入项目名称" :maxlength="100" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" >
|
||||
<a-form-item label="媒体资源地址" v-bind="validateInfos.mediaUrl" id="WorkOrderForm-mediaUrl"
|
||||
name="mediaUrl">
|
||||
<a-input v-model:value="formData.mediaUrl" placeholder="请输入媒体资源地址" :maxlength="100" />
|
||||
</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 { getValueType } from '/@/utils';
|
||||
import { editUrl,editDepart } from '../WorkOrder.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
||||
import { url } from 'inspector';
|
||||
|
||||
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: '',
|
||||
orgId: '',
|
||||
orgCode: '',
|
||||
orgName: '',
|
||||
mediaUrl: '',
|
||||
contextPath: '',
|
||||
url: '',
|
||||
});
|
||||
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({
|
||||
mediaUrl: [{ required: true, message: '请输入媒体资源地址!'},],
|
||||
contextPath: [{ required: true, message: '请输入项目名称!'},],
|
||||
url: [{ 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(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
model.status = '2';
|
||||
await editUrl(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
var paramsDepart = { id: model.orgId,url: model.url, contextPath: model.contextPath, mediaUrl: model.mediaUrl,serverUrl: model.url+model.contextPath };
|
||||
editDepart(paramsDepart).then((res) => { });
|
||||
|
||||
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: 0 4px 0 4px;
|
||||
}
|
||||
|
||||
.card-class {
|
||||
padding-top: 24px;
|
||||
padding-bottom: 24px;
|
||||
padding-left: 14px;
|
||||
padding-right: 14px;
|
||||
// background-color: rgba(255, 255, 255, 0.9);
|
||||
background-color: #fcfdff;
|
||||
border-radius: 10px;
|
||||
// box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 12px;
|
||||
margin-bottom: 14px;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,176 @@
|
|||
<template>
|
||||
<!-- <j-modal :title="title" :width="'70vw'" :visible="visible" @ok="handleOk"
|
||||
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
</j-modal> -->
|
||||
|
||||
|
||||
<a-drawer :title="title" :width="'1000'" v-model:visible="visible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleCancel">
|
||||
<WorkOrderForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false">
|
||||
</WorkOrderForm>
|
||||
<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>
|
||||
|
||||
|
||||
<!-- <j-modal title="机构详情" :width="'70vw'" :visible="orgDetailVisible" @cancel="handleOrgDetailCancel">
|
||||
<template #footer>
|
||||
<a-button @click="handleOrgDetailCancel">关闭</a-button>
|
||||
</template>
|
||||
</j-modal> -->
|
||||
|
||||
|
||||
<a-drawer :title="`机构详情`" :width="'1000'" v-model:visible="orgDetailVisible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleOrgDetailCancel">
|
||||
<OrgInfoForm ref="orgDetailRef" :formDisabled="true" :formBpm="false" />
|
||||
<template #footer>
|
||||
<a-button type="primary" style="margin-right: 8px" @click="handleOrgDetailCancel">关闭</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
|
||||
|
||||
|
||||
<a-drawer :title="`反馈`" :width="'1000'" v-model:visible="orgFankuiVisible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleOrgFankuiCancel">
|
||||
<WorkOrderFankui ref="orgFankuiRef" :formDisabled="false" @ok="handleOrgFankuiFankuiCancel" :formBpm="false" />
|
||||
<template #footer>
|
||||
<a-button type="primary" style="margin-right: 8px" @click="handleOrgFankuiCancel">关闭</a-button>
|
||||
<a-button type="primary" @click="handleFankuiOk" v-if="!disableSubmit">确认</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import WorkOrderForm from './WorkOrderForm.vue'
|
||||
import WorkOrderFankui from './WorkOrderFankui.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
import OrgInfoForm from '/@/views/admin/orginfo/components/OrgInfoForm.vue'
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<number>(800);
|
||||
const visible = ref<boolean>(false);
|
||||
const orgDetailVisible = ref<boolean>(false);
|
||||
const orgFankuiVisible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const orgDetailRef = ref();
|
||||
const orgFankuiRef = 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看机构详细信息
|
||||
*/
|
||||
function orgDetail(orgCode) {
|
||||
orgDetailVisible.value = true;
|
||||
nextTick(() => {
|
||||
orgDetailRef?.value?.open(orgCode);
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭机构详情页
|
||||
*/
|
||||
function handleOrgDetailCancel() {
|
||||
orgDetailVisible.value = false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 反馈信息
|
||||
*/
|
||||
function orgFankui(record) {
|
||||
orgFankuiVisible.value = true;
|
||||
nextTick(() => {
|
||||
orgFankuiRef?.value?.open(record);
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 反馈按钮点击事件
|
||||
*/
|
||||
function handleFankuiOk() {
|
||||
orgFankuiRef.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭反馈页
|
||||
*/
|
||||
function handleOrgFankuiCancel() {
|
||||
orgFankuiVisible.value = false;
|
||||
}
|
||||
|
||||
function handleOrgFankuiFankuiCancel() {
|
||||
handleOrgFankuiCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
disableSubmit,
|
||||
orgDetail,
|
||||
orgFankui,
|
||||
orgFwpz,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
||||
|
|
@ -40,12 +40,23 @@
|
|||
<a-button type="primary" @click="handleFankuiOk" v-if="!disableSubmit">确认</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
|
||||
<a-drawer :title="`访问配置`" :width="'1000'" v-model:visible="orgFwpzVisible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleOrgFankuiCancel">
|
||||
<WorkOrderFwpzForm ref="orgFwpzRef" :formDisabled="false" @ok="handleOrgFwpzCancel" :formBpm="false" />
|
||||
<template #footer>
|
||||
<a-button type="primary" style="margin-right: 8px" @click="handleOrgFwpzCancel">关闭</a-button>
|
||||
<a-button type="primary" @click="handleFwpzOk" v-if="!disableSubmit">确认</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import WorkOrderForm from './WorkOrderForm.vue'
|
||||
import WorkOrderFankui from './WorkOrderFankui.vue'
|
||||
import WorkOrderFwpzForm from './WorkOrderFwpzForm.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
import OrgInfoForm from '/@/views/admin/orginfo/components/OrgInfoForm.vue'
|
||||
|
||||
|
|
@ -58,6 +69,8 @@ const disableSubmit = ref<boolean>(false);
|
|||
const registerForm = ref();
|
||||
const orgDetailRef = ref();
|
||||
const orgFankuiRef = ref();
|
||||
const orgFwpzVisible = ref<boolean>(false);
|
||||
const orgFwpzRef = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
/**
|
||||
|
|
@ -149,6 +162,34 @@ function handleOrgFankuiCancel() {
|
|||
orgFankuiVisible.value = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 访问配置信息
|
||||
*/
|
||||
function orgFwpz(record) {
|
||||
orgFwpzVisible.value = true;
|
||||
nextTick(() => {
|
||||
orgFwpzRef?.value?.edit(record);
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 访问配置按钮点击事件
|
||||
*/
|
||||
function handleFwpzOk() {
|
||||
orgFwpzRef.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭访问配置
|
||||
*/
|
||||
function handleOrgFwpzCancel() {
|
||||
orgFwpzVisible.value = false;
|
||||
emit('success');
|
||||
}
|
||||
|
||||
|
||||
function handleOrgFankuiFankuiCancel() {
|
||||
handleOrgFankuiCancel();
|
||||
emit('success');
|
||||
|
|
@ -160,6 +201,7 @@ defineExpose({
|
|||
disableSubmit,
|
||||
orgDetail,
|
||||
orgFankui,
|
||||
orgFwpz,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue