部门管理增加省、市、区选择
This commit is contained in:
parent
53b7241cfb
commit
345b51130f
|
@ -138,8 +138,10 @@
|
||||||
<a-col :span="selectedScreenSpan">
|
<a-col :span="selectedScreenSpan">
|
||||||
<div style="height: 31px;margin-left: 4px;">
|
<div style="height: 31px;margin-left: 4px;">
|
||||||
<a-tag color="#2db7f5">
|
<a-tag color="#2db7f5">
|
||||||
已选择<span style="font-size: 13px;font-weight: bold;">{{ ' ' +
|
已选择
|
||||||
Array.from(selectedItems.values()).length + ' ' }}</span>条
|
<span style="font-size: 13px;font-weight: bold;">
|
||||||
|
{{ ' ' + selectedSize + ' ' }}
|
||||||
|
</span>条
|
||||||
</a-tag>
|
</a-tag>
|
||||||
</div>
|
</div>
|
||||||
<a-card size="small" :bordered="false" class="selected-list-container">
|
<a-card size="small" :bordered="false" class="selected-list-container">
|
||||||
|
@ -207,17 +209,18 @@
|
||||||
<script lang="ts" name="synchronization-directive" setup>
|
<script lang="ts" name="synchronization-directive" setup>
|
||||||
import { ref, onMounted, computed, onBeforeMount, reactive } from 'vue';
|
import { ref, onMounted, computed, onBeforeMount, reactive } from 'vue';
|
||||||
import { initDictOptions } from '/@/utils/dict';
|
import { initDictOptions } from '/@/utils/dict';
|
||||||
import { list, asyncFunc } from '@/views/services/serviceDirective/ConfigServiceDirective.api';
|
|
||||||
import { queryDepartTreeSync } from '/@/api/common/api';
|
import { queryDepartTreeSync } from '/@/api/common/api';
|
||||||
import { Empty } from 'ant-design-vue';
|
import { Empty } from 'ant-design-vue';
|
||||||
import { Modal } from 'ant-design-vue';
|
import { Modal } from 'ant-design-vue';
|
||||||
import { useMessage } from "/@/hooks/web/useMessage";
|
import { useMessage } from "/@/hooks/web/useMessage";
|
||||||
import AsyncListComponent from '@/components/dataAsync/AsyncMainList.vue'
|
import AsyncListComponent from '@/components/dataAsync/AsyncMainList.vue'
|
||||||
|
import { number } from 'vue-types';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
// showJMCom: { type: Boolean, default: false },
|
selectedSize: 0
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['changeShowJMCom', 'viewTypeChanged','sourceOrgCodeChanged']);
|
const emit = defineEmits(['changeShowJMCom', 'viewTypeChanged', 'sourceOrgCodeChanged', 'orgChanged']);
|
||||||
|
|
||||||
interface OrganizationData {
|
interface OrganizationData {
|
||||||
id?: string;
|
id?: string;
|
||||||
|
@ -300,45 +303,10 @@ const handleOrgSelected = async (org) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadOrgData = async (org) => {
|
const loadOrgData = async (org) => {
|
||||||
try {
|
|
||||||
// 清空当前选择
|
|
||||||
selectedItems.value.clear();
|
|
||||||
// 清空初始化数据
|
|
||||||
initialDataIds.value = [];
|
|
||||||
|
|
||||||
// 加载新机构数据
|
|
||||||
const res = await list({ dataSourceCode: org.orgCode, pageNo: 1, pageSize: -1 });
|
|
||||||
|
|
||||||
// 更新机构数据
|
// 更新机构数据
|
||||||
orgData.value = org;
|
orgData.value = org;
|
||||||
|
|
||||||
// 如果有数据,更新右侧列表
|
emit('orgChanged', org)
|
||||||
if (res.records && res.records.length > 0) {
|
|
||||||
const newRecords = res.records;
|
|
||||||
newRecords.forEach(record => {
|
|
||||||
selectedItems.value.set(record.id, record);
|
|
||||||
if (!orgData.value?.operationStartTime || new Date() >= new Date(orgData.value?.operationStartTime)) {
|
|
||||||
initialDataIds.value.push(record.id);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 更新左侧列表的选中状态
|
|
||||||
listComRef.value?.updateSelection?.(newRecords);
|
|
||||||
} else {
|
|
||||||
// 没有数据时也确保清空
|
|
||||||
selectedItems.value.clear();
|
|
||||||
listComRef.value?.updateSelection?.([]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 切换视图
|
|
||||||
orgSelectedCon.value = false;
|
|
||||||
} catch (err) {
|
|
||||||
console.error('机构数据查询失败:', err);
|
|
||||||
createMessage.error('机构数据查询失败');
|
|
||||||
// 失败时也确保清空状态
|
|
||||||
selectedItems.value.clear();
|
|
||||||
listComRef.value?.updateSelection?.([]);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -346,6 +314,10 @@ const handleResetOrg = () => {
|
||||||
orgSelectedCon.value = true
|
orgSelectedCon.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const resetOrgSelectedCon = (v_) => {
|
||||||
|
orgSelectedCon.value = v_
|
||||||
|
}
|
||||||
|
|
||||||
//数据同步
|
//数据同步
|
||||||
const handleAsync = () => {
|
const handleAsync = () => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
|
@ -509,6 +481,8 @@ onMounted(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
orgData,
|
||||||
|
resetOrgSelectedCon
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<SyncComponent ref="syncComRef" @changeShowJMCom="changeShowJMCom" @sourceOrgCodeChanged="sourceOrgCodeChanged"
|
<SyncComponent ref="syncComRef" :selectedSize="Array.from(selectedItems.values()).length"
|
||||||
@viewTypeChanged="viewTypeChanged">
|
@changeShowJMCom="changeShowJMCom" @sourceOrgCodeChanged="sourceOrgCodeChanged"
|
||||||
|
@viewTypeChanged="viewTypeChanged" @orgChanged="orgChanged">
|
||||||
<!-- 表单 -->
|
<!-- 表单 -->
|
||||||
<template #searchFormSlot>
|
<template #searchFormSlot>
|
||||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
|
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
|
||||||
|
@ -143,85 +144,26 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="synchronization-directive2" lang="ts">
|
<script setup name="synchronization-directive2" lang="ts">
|
||||||
|
// ↓↓↓↓↓ 组件自带
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
import SyncComponent from '/@/components/Sync/SyncComponent.vue'
|
import SyncComponent from '/@/components/Sync/SyncComponent.vue'
|
||||||
import ConfigServiceDirectiveList from '@/views/services/serviceDirective/ConfigServiceDirectiveList.vue'
|
|
||||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils'
|
|
||||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
||||||
|
import { useMessage } from "/@/hooks/web/useMessage";
|
||||||
|
// ↑↑↑↑↑ 组件自带
|
||||||
|
// ↓↓↓↓↓ 服务指令用
|
||||||
|
import { list, asyncFunc } from '@/views/services/serviceDirective/ConfigServiceDirective.api';
|
||||||
|
import ConfigServiceDirectiveList from '@/views/services/serviceDirective/ConfigServiceDirectiveList.vue'
|
||||||
|
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils'
|
||||||
|
import { selectedColumns } from './org.data';
|
||||||
|
// ↑↑↑↑↑ 服务指令用
|
||||||
|
|
||||||
// 表格列定义
|
// >>>>>>>>>>>>>组件:无需处理代码
|
||||||
const selectedColumns = [
|
const { createMessage } = useMessage();
|
||||||
{
|
const syncComRef = ref(null)
|
||||||
title: '服务指令',
|
const sourceOrgCode = ref('')
|
||||||
dataIndex: 'directiveName',
|
const showJMCom = ref(false)
|
||||||
key: 'directiveName',
|
|
||||||
width: 150
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '服务类别',
|
|
||||||
dataIndex: 'categoryName',
|
|
||||||
key: 'categoryName',
|
|
||||||
width: 120
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '服务类型',
|
|
||||||
dataIndex: 'typeName',
|
|
||||||
key: 'typeName',
|
|
||||||
width: 120
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '分类标签',
|
|
||||||
dataIndex: 'instructionTagName',
|
|
||||||
key: 'instructionTagName',
|
|
||||||
width: 120
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '体型标签',
|
|
||||||
dataIndex: 'bodyTagList',
|
|
||||||
key: 'bodyTagList',
|
|
||||||
width: 150
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '情绪标签',
|
|
||||||
dataIndex: 'emotionTagList',
|
|
||||||
key: 'emotionTagList',
|
|
||||||
width: 150
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '预览图',
|
|
||||||
dataIndex: 'previewFile',
|
|
||||||
key: 'previewFile',
|
|
||||||
width: 120
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '即时图',
|
|
||||||
dataIndex: 'immediateFile',
|
|
||||||
key: 'immediateFile',
|
|
||||||
width: 120
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '音频',
|
|
||||||
dataIndex: 'mp3File',
|
|
||||||
key: 'mp3File',
|
|
||||||
width: 150
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '视频',
|
|
||||||
dataIndex: 'mp4File',
|
|
||||||
key: 'mp4File',
|
|
||||||
width: 120
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '操作',
|
|
||||||
dataIndex: 'action',
|
|
||||||
key: 'action',
|
|
||||||
width: 80,
|
|
||||||
fixed: 'right'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
const labelCol = reactive({
|
const labelCol = reactive({
|
||||||
xs: 24,
|
xs: 24,
|
||||||
sm: 4,
|
sm: 4,
|
||||||
|
@ -232,13 +174,6 @@ const wrapperCol = reactive({
|
||||||
xs: 24,
|
xs: 24,
|
||||||
sm: 20,
|
sm: 20,
|
||||||
});
|
});
|
||||||
const sourceOrgCode = ref('')
|
|
||||||
const syncComRef = ref(null)
|
|
||||||
const listComRef = ref();
|
|
||||||
const selectedItems = ref(new Map<string | number, any>());
|
|
||||||
const queryParam = ref({ viewType: 'all' })//源数据查询参数
|
|
||||||
const initialDataIds = ref<string[]>([]);
|
|
||||||
const showJMCom = ref(false)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取到了试验田的机构编码
|
* 获取到了试验田的机构编码
|
||||||
|
@ -255,19 +190,59 @@ const sourceOrgCodeChanged = (v_) => {
|
||||||
const changeShowJMCom = (v_) => {
|
const changeShowJMCom = (v_) => {
|
||||||
showJMCom.value = v_
|
showJMCom.value = v_
|
||||||
}
|
}
|
||||||
|
// <<<<<<<<<<<<<组件:无需处理代码
|
||||||
/**
|
/**
|
||||||
* 源数据的全部、已选择、未选择变更时触发
|
* 机构变更
|
||||||
* @param v_ all、selected、unselected
|
|
||||||
*/
|
*/
|
||||||
const viewTypeChanged = (v_) => {
|
const orgChanged = async (org) => {
|
||||||
queryParam.value.viewType = v_
|
// 清空当前选择
|
||||||
//组件内部监听了queryParam值的变化,自动刷新
|
selectedItems.value.clear();
|
||||||
|
// 清空初始化数据
|
||||||
|
initialDataIds.value = [];
|
||||||
|
try {
|
||||||
|
// 加载新机构数据
|
||||||
|
const res = await list({ dataSourceCode: org.orgCode, pageNo: 1, pageSize: -1 });
|
||||||
|
// 如果有数据,更新右侧列表
|
||||||
|
if (res.records && res.records.length > 0) {
|
||||||
|
const newRecords = res.records;
|
||||||
|
newRecords.forEach(record => {
|
||||||
|
selectedItems.value.set(record.id, record);
|
||||||
|
if (!syncComRef.value.orgData.value?.operationStartTime || new Date() >= new Date(syncComRef.value.orgData.value?.operationStartTime)) {
|
||||||
|
initialDataIds.value.push(record.id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 更新左侧列表的选中状态
|
||||||
|
listComRef.value?.updateSelection?.(newRecords);
|
||||||
|
} else {
|
||||||
|
// 没有数据时也确保清空
|
||||||
|
selectedItems.value.clear();
|
||||||
|
listComRef.value?.updateSelection?.([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 切换视图
|
||||||
|
syncComRef.value.resetOrgSelectedCon(false);
|
||||||
|
|
||||||
|
console.log("🌊 ~ orgChanged ~ selectedItems.value:", selectedItems.value)
|
||||||
|
} catch (err) {
|
||||||
|
console.error('机构数据查询失败:', err);
|
||||||
|
createMessage.error('机构数据查询失败');
|
||||||
|
// 失败时也确保清空状态
|
||||||
|
selectedItems.value.clear();
|
||||||
|
listComRef.value?.updateSelection?.([]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// >>>>>>>>>>>>>组件:需要处理代码
|
||||||
|
// <<<<<<<<<<<<<组件:需要处理代码
|
||||||
|
|
||||||
|
// >>>>>>>>>>>>>非组件代码
|
||||||
|
const listComRef = ref();
|
||||||
|
const selectedItems = ref(new Map<string | number, any>());
|
||||||
|
const queryParam = ref({ viewType: 'all' })//源数据查询参数
|
||||||
|
const initialDataIds = ref<string[]>([]);
|
||||||
const showVideoModal = ref(false);
|
const showVideoModal = ref(false);
|
||||||
const videoUrl = ref('');
|
const videoUrl = ref('');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询
|
* 查询
|
||||||
*/
|
*/
|
||||||
|
@ -283,6 +258,14 @@ function searchReset() {
|
||||||
listComRef.value?.reload();
|
listComRef.value?.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 源数据的全部、已选择、未选择变更时触发
|
||||||
|
* @param v_ all、selected、unselected
|
||||||
|
*/
|
||||||
|
const viewTypeChanged = (v_) => {
|
||||||
|
queryParam.value.viewType = v_
|
||||||
|
//组件内部监听了queryParam值的变化,自动刷新
|
||||||
|
}
|
||||||
const handleSelectChange = (items: Map<string | number, any>) => {
|
const handleSelectChange = (items: Map<string | number, any>) => {
|
||||||
selectedItems.value = new Map(items);
|
selectedItems.value = new Map(items);
|
||||||
};
|
};
|
||||||
|
@ -301,6 +284,7 @@ const closeVideoModal = () => {
|
||||||
showVideoModal.value = false;
|
showVideoModal.value = false;
|
||||||
videoUrl.value = '';
|
videoUrl.value = '';
|
||||||
};
|
};
|
||||||
|
// <<<<<<<<<<<<<非组件代码
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|
|
@ -65,7 +65,7 @@ export const saveOrUpdateDict = (params, isUpdate) => {
|
||||||
* 查询全部树形节点数据
|
* 查询全部树形节点数据
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export const loadTreeData = (params) => defHttp.get({ url: Api.loadTreeData, params });
|
export const loadTreeData = (params) => defHttp.get({ url: Api.loadTreeData,timeout:100*1000, params });
|
||||||
/**
|
/**
|
||||||
* 查询子节点数据
|
* 查询子节点数据
|
||||||
* @param params
|
* @param params
|
||||||
|
|
|
@ -64,4 +64,10 @@ export const formSchema: FormSchema[] = [
|
||||||
required: true,
|
required: true,
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '编码(非必要无需填写)',
|
||||||
|
field: 'code',
|
||||||
|
required: false,
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose width="550px" :title="getTitle" @ok="handleSubmit">
|
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose width="50vw" :title="getTitle" @ok="handleSubmit">
|
||||||
<BasicForm @register="registerForm" />
|
<BasicForm @register="registerForm" />
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
|
@ -21,11 +21,11 @@
|
||||||
showActionButtonGroup: false,
|
showActionButtonGroup: false,
|
||||||
labelCol: {
|
labelCol: {
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 4 },
|
sm: { span: 5 },
|
||||||
},
|
},
|
||||||
wrapperCol: {
|
wrapperCol: {
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 18 },
|
sm: { span: 15 },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
//表单赋值
|
//表单赋值
|
||||||
|
|
|
@ -147,6 +147,9 @@
|
||||||
* 成功回调
|
* 成功回调
|
||||||
*/
|
*/
|
||||||
async function handleSuccess({ isUpdate,isSubAdd, values, expandedArr }) {
|
async function handleSuccess({ isUpdate,isSubAdd, values, expandedArr }) {
|
||||||
|
reload();
|
||||||
|
return
|
||||||
|
//几百条数据:直接重新加载比框架写的代码要加载快得多 框架设计师不知道在寻思鸡毛🤡 新增一条数据几百个请求处理 处理半天处理不完
|
||||||
if (isUpdate) {
|
if (isUpdate) {
|
||||||
//编辑回调
|
//编辑回调
|
||||||
updateTableDataRecord(values.id, values);
|
updateTableDataRecord(values.id, values);
|
||||||
|
|
|
@ -1,6 +1,22 @@
|
||||||
<template>
|
<template>
|
||||||
<BasicModal :title="title" :width="800" v-bind="$attrs" @ok="handleOk" @register="registerModal">
|
<BasicModal :title="title" :width="800" v-bind="$attrs" @ok="handleOk" @register="registerModal">
|
||||||
<BasicForm @register="registerForm" />
|
<BasicForm @register="registerForm">
|
||||||
|
<!-- 省份 -->
|
||||||
|
<template #province="{ model, field }">
|
||||||
|
<j-dict-select-tag @change="provinceChanged(model)" v-model:value="model[field]"
|
||||||
|
:dictCode="getProvinceDictCode()" placeholder="请选择所在省份" :disabled="model.orgCategory != '1'" />
|
||||||
|
</template>
|
||||||
|
<!-- 城市 -->
|
||||||
|
<template #city="{ model, field }">
|
||||||
|
<j-dict-select-tag @change="cityChanged(model)" v-model:value="model[field]" :dictCode="getCityDictCode(model)"
|
||||||
|
placeholder="请选择所在城市" :disabled="model.orgCategory != '1' && !model.province" />
|
||||||
|
</template>
|
||||||
|
<!-- 区县 -->
|
||||||
|
<template #district="{ model, field }">
|
||||||
|
<j-dict-select-tag v-model:value="model[field]" :dictCode="getDistrictDictCode(model)" placeholder="请选择所在区县"
|
||||||
|
:disabled="model.orgCategory != '1' && (!model.province || !model.city)" />
|
||||||
|
</template>
|
||||||
|
</BasicForm>
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -12,6 +28,8 @@
|
||||||
|
|
||||||
import { saveOrUpdateDepart } from '../depart.api';
|
import { saveOrUpdateDepart } from '../depart.api';
|
||||||
import { useBasicFormSchema, orgCategoryOptions } from '../depart.data';
|
import { useBasicFormSchema, orgCategoryOptions } from '../depart.data';
|
||||||
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
|
|
||||||
|
|
||||||
const emit = defineEmits(['success', 'register']);
|
const emit = defineEmits(['success', 'register']);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -93,4 +111,32 @@
|
||||||
setModalProps({ confirmLoading: false });
|
setModalProps({ confirmLoading: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省份字典
|
||||||
|
*/
|
||||||
|
function getProvinceDictCode() {
|
||||||
|
return 'sys_category,name,id,pid = \'xzqhdm\' order by code asc'
|
||||||
|
}
|
||||||
|
function provinceChanged(model) {
|
||||||
|
model.city = null
|
||||||
|
model.district = null
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 城市字典
|
||||||
|
* @param v_
|
||||||
|
*/
|
||||||
|
function getCityDictCode(v_) {
|
||||||
|
return 'sys_category,name,id,pid = \'' + v_.province + '\' order by code asc'
|
||||||
|
}
|
||||||
|
function cityChanged(model) {
|
||||||
|
model.district = null
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 区县字典
|
||||||
|
* @param v_
|
||||||
|
*/
|
||||||
|
function getDistrictDictCode(v_) {
|
||||||
|
return 'sys_category,name,id,pid = \'' + v_.city + '\' order by code asc'
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,6 +1,22 @@
|
||||||
<template>
|
<template>
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<BasicForm @register="registerForm" />
|
<BasicForm @register="registerForm">
|
||||||
|
<!-- 省份 -->
|
||||||
|
<template #province="{ model, field }">
|
||||||
|
<j-dict-select-tag @change="provinceChanged(model)" v-model:value="model[field]"
|
||||||
|
:dictCode="getProvinceDictCode()" placeholder="请选择所在省份" :disabled="model.orgCategory != '1'" />
|
||||||
|
</template>
|
||||||
|
<!-- 城市 -->
|
||||||
|
<template #city="{ model, field }">
|
||||||
|
<j-dict-select-tag @change="cityChanged(model)" v-model:value="model[field]" :dictCode="getCityDictCode(model)"
|
||||||
|
placeholder="请选择所在城市" :disabled="model.orgCategory != '1' && !model.province" />
|
||||||
|
</template>
|
||||||
|
<!-- 区县 -->
|
||||||
|
<template #district="{ model, field }">
|
||||||
|
<j-dict-select-tag v-model:value="model[field]" :dictCode="getDistrictDictCode(model)" placeholder="请选择所在区县"
|
||||||
|
:disabled="model.orgCategory != '1' && (!model.province || !model.city)" />
|
||||||
|
</template>
|
||||||
|
</BasicForm>
|
||||||
<div class="j-box-bottom-button offset-20" style="margin-top: 30px">
|
<div class="j-box-bottom-button offset-20" style="margin-top: 30px">
|
||||||
<div class="j-box-bottom-button-float" :class="[`${prefixCls}`]">
|
<div class="j-box-bottom-button-float" :class="[`${prefixCls}`]">
|
||||||
<a-button preIcon="ant-design:sync-outlined" @click="onReset">重置</a-button>
|
<a-button preIcon="ant-design:sync-outlined" @click="onReset">重置</a-button>
|
||||||
|
@ -16,6 +32,7 @@
|
||||||
import { saveOrUpdateDepart } from '../depart.api';
|
import { saveOrUpdateDepart } from '../depart.api';
|
||||||
import { useBasicFormSchema, orgCategoryOptions } from '../depart.data';
|
import { useBasicFormSchema, orgCategoryOptions } from '../depart.data';
|
||||||
import { useDesign } from '/@/hooks/web/useDesign';
|
import { useDesign } from '/@/hooks/web/useDesign';
|
||||||
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
|
|
||||||
const { prefixCls } = useDesign('j-depart-form-content');
|
const { prefixCls } = useDesign('j-depart-form-content');
|
||||||
|
|
||||||
|
@ -113,16 +130,45 @@
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省份字典
|
||||||
|
*/
|
||||||
|
function getProvinceDictCode() {
|
||||||
|
return 'sys_category,name,id,pid = \'xzqhdm\' order by code asc'
|
||||||
|
}
|
||||||
|
function provinceChanged(model) {
|
||||||
|
model.city = null
|
||||||
|
model.district = null
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 城市字典
|
||||||
|
* @param v_
|
||||||
|
*/
|
||||||
|
function getCityDictCode(v_) {
|
||||||
|
return 'sys_category,name,id,pid = \'' + v_.province + '\' order by code asc'
|
||||||
|
}
|
||||||
|
function cityChanged(model) {
|
||||||
|
model.district = null
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 区县字典
|
||||||
|
* @param v_
|
||||||
|
*/
|
||||||
|
function getDistrictDictCode(v_) {
|
||||||
|
return 'sys_category,name,id,pid = \'' + v_.city + '\' order by code asc'
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
// update-begin-author:liusq date:20230625 for: [issues/563]暗色主题部分失效
|
// update-begin-author:liusq date:20230625 for: [issues/563]暗色主题部分失效
|
||||||
|
|
||||||
@prefix-cls: ~'@{namespace}-j-depart-form-content';
|
@prefix-cls: ~'@{namespace}-j-depart-form-content';
|
||||||
|
|
||||||
/*begin 兼容暗夜模式*/
|
/*begin 兼容暗夜模式*/
|
||||||
.@{prefix-cls} {
|
.@{prefix-cls} {
|
||||||
background: @component-background;
|
background: @component-background;
|
||||||
border-top: 1px solid @border-color-base;
|
border-top: 1px solid @border-color-base;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*end 兼容暗夜模式*/
|
/*end 兼容暗夜模式*/
|
||||||
// update-end-author:liusq date:20230625 for: [issues/563]暗色主题部分失效
|
// update-end-author:liusq date:20230625 for: [issues/563]暗色主题部分失效</style>
|
||||||
</style>
|
|
||||||
|
|
|
@ -36,6 +36,24 @@ export function useBasicFormSchema() {
|
||||||
component: 'RadioButtonGroup',
|
component: 'RadioButtonGroup',
|
||||||
componentProps: { options: [] },
|
componentProps: { options: [] },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'province',
|
||||||
|
label: '省份',
|
||||||
|
component: 'Input',
|
||||||
|
slot: 'province',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'city',
|
||||||
|
label: '城市',
|
||||||
|
component: 'Input',
|
||||||
|
slot: 'city',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'district',
|
||||||
|
label: '区县',
|
||||||
|
component: 'Input',
|
||||||
|
slot: 'district',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'platType',
|
field: 'platType',
|
||||||
label: '业务平台类型',
|
label: '业务平台类型',
|
||||||
|
@ -49,12 +67,6 @@ export function useBasicFormSchema() {
|
||||||
message: '请选择平台类型'
|
message: '请选择平台类型'
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
field: 'departOrder',
|
|
||||||
label: '排序',
|
|
||||||
component: 'InputNumber',
|
|
||||||
componentProps: {},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
field: 'operationStartTime',
|
field: 'operationStartTime',
|
||||||
label: '运营开始时间',
|
label: '运营开始时间',
|
||||||
|
@ -131,6 +143,12 @@ export function useBasicFormSchema() {
|
||||||
placeholder: '请输入备注',
|
placeholder: '请输入备注',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'departOrder',
|
||||||
|
label: '排序',
|
||||||
|
component: 'InputNumber',
|
||||||
|
componentProps: {},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'picUrl',
|
field: 'picUrl',
|
||||||
label: '机构图片',
|
label: '机构图片',
|
||||||
|
|
Loading…
Reference in New Issue