Merge branch 'main' of http://123.132.248.154:10000/HC_YFZX/CaiYuanYiTiHua
commit
f8efe3b391
|
|
@ -102,6 +102,17 @@
|
|||
:pagination="false"
|
||||
v-if="node.formType == 1"
|
||||
>
|
||||
<template #headerCell="{ column }">
|
||||
<template v-if="column.dataIndex === 'required'">
|
||||
<a-checkbox v-model:checked="requiredCheck" @change="handleChangeCheck('required',$event)">{{column.title}}</a-checkbox>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'disabled'">
|
||||
<a-checkbox v-model:checked="disabledCheck" @change="handleChangeCheck('disabled',$event)">{{column.title}}</a-checkbox>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'ifShow'">
|
||||
<a-checkbox v-model:checked="ifShowCheck" @change="handleChangeCheck('ifShow',$event)">{{column.title}}</a-checkbox>
|
||||
</template>
|
||||
</template>
|
||||
<template #bodyCell="{ column, text, record }">
|
||||
<template v-if="['label', 'field'].includes(column.dataIndex)">
|
||||
<div>
|
||||
|
|
@ -191,6 +202,9 @@
|
|||
const flowWfDataStore = flowStore();
|
||||
const labelCol = { span: 7 };
|
||||
const wrapperCol = { span: 17 };
|
||||
const requiredCheck = ref(false)
|
||||
const disabledCheck = ref(false)
|
||||
const ifShowCheck = ref(false)
|
||||
// 表单选择声明
|
||||
const props = defineProps({
|
||||
disabled: {
|
||||
|
|
@ -421,6 +435,22 @@
|
|||
function handleDeleteAuthField(key) {
|
||||
node.value.authFields = node.value.authFields.filter((item) => item.field !== key);
|
||||
}
|
||||
const handleChangeCheck = (type: string, data) => {
|
||||
let checked = data.target.checked
|
||||
node.value.authFields.forEach(item => {
|
||||
switch (type) {
|
||||
case 'required':
|
||||
item.required = checked
|
||||
break
|
||||
case 'disabled':
|
||||
item.disabled = checked
|
||||
break
|
||||
case 'ifShow':
|
||||
item.ifShow = checked
|
||||
break
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.site-space-compact-wrapper {
|
||||
|
|
|
|||
|
|
@ -246,6 +246,17 @@
|
|||
:pagination="false"
|
||||
v-if="node.formType == 1"
|
||||
>
|
||||
<template #headerCell="{ column }">
|
||||
<template v-if="column.dataIndex === 'required'">
|
||||
<a-checkbox v-model:checked="requiredCheck" @change="handleChangeCheck('required',$event)">{{column.title}}</a-checkbox>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'disabled'">
|
||||
<a-checkbox v-model:checked="disabledCheck" @change="handleChangeCheck('disabled',$event)">{{column.title}}</a-checkbox>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'ifShow'">
|
||||
<a-checkbox v-model:checked="ifShowCheck" @change="handleChangeCheck('ifShow',$event)">{{column.title}}</a-checkbox>
|
||||
</template>
|
||||
</template>
|
||||
<template #bodyCell="{ column, text, record }">
|
||||
<template v-if="['label', 'fieldName'].includes(column.dataIndex)">
|
||||
<div>
|
||||
|
|
@ -549,6 +560,9 @@
|
|||
const activeKey = ref('1');
|
||||
const nodeId = ref('');
|
||||
let node: any = ref({});
|
||||
const requiredCheck = ref(false)
|
||||
const disabledCheck = ref(false)
|
||||
const ifShowCheck = ref(false)
|
||||
const props = defineProps({
|
||||
element: {
|
||||
type: Object,
|
||||
|
|
@ -974,6 +988,22 @@
|
|||
function handleDeleteAuthField(key) {
|
||||
node.value.authFields = node.value.authFields.filter((item) => item.field !== key);
|
||||
}
|
||||
const handleChangeCheck = (type: string, data) => {
|
||||
let checked = data.target.checked
|
||||
node.value.authFields.forEach(item => {
|
||||
switch (type) {
|
||||
case 'required':
|
||||
item.required = checked
|
||||
break
|
||||
case 'disabled':
|
||||
item.disabled = checked
|
||||
break
|
||||
case 'ifShow':
|
||||
item.ifShow = checked
|
||||
break
|
||||
}
|
||||
})
|
||||
}
|
||||
defineExpose({});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,9 @@ export function useSplitMenu(splitType: Ref<MenuSplitTyeEnum>) {
|
|||
genMenus();
|
||||
},
|
||||
);
|
||||
watch(() => permissionStore.getChangeMenu, () => {
|
||||
genMenus();
|
||||
})
|
||||
|
||||
// Handle left menu split
|
||||
async function handleSplitLeftMenu(parentPath: string) {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import { PageEnum } from '@/enums/pageEnum';
|
|||
|
||||
import { router } from '@/router';
|
||||
import { LAYOUT } from '@/router/constant';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
interface PermissionState {
|
||||
// Permission code list
|
||||
|
|
@ -42,6 +43,7 @@ interface PermissionState {
|
|||
backMenuList: Menu[];
|
||||
// 菜单列表
|
||||
frontMenuList: Menu[];
|
||||
changeMenu: number;
|
||||
}
|
||||
|
||||
export const usePermissionStore = defineStore({
|
||||
|
|
@ -61,8 +63,12 @@ export const usePermissionStore = defineStore({
|
|||
// menu List
|
||||
// 菜单列表
|
||||
frontMenuList: [],
|
||||
changeMenu: dayjs().valueOf()
|
||||
}),
|
||||
getters: {
|
||||
getChangeMenu(state): number {
|
||||
return state.changeMenu;
|
||||
},
|
||||
getPermCodeList(state): string[] | number[] {
|
||||
return state.permCodeList;
|
||||
},
|
||||
|
|
@ -89,6 +95,10 @@ export const usePermissionStore = defineStore({
|
|||
list?.length > 0 && this.setLastBuildMenuTime();
|
||||
},
|
||||
|
||||
setChangeMenu(){
|
||||
this.changeMenu = dayjs().valueOf();
|
||||
},
|
||||
|
||||
setFrontMenuList(list: Menu[]) {
|
||||
this.frontMenuList = list;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -335,7 +335,11 @@
|
|||
});
|
||||
|
||||
baseComponentCommonAttrs.forEach((item) => {
|
||||
if (formType_design.value != 2 || !['dataTable', 'fieldName'].includes(item.name)) {
|
||||
if (
|
||||
(formType_design.value != 2 &&
|
||||
!['Divider', 'Button'].includes(formConfig.value.currentItem?.component)) ||
|
||||
!['dataTable', 'fieldName'].includes(item.name)
|
||||
) {
|
||||
item.category = 'input';
|
||||
if (item.includes) {
|
||||
if (item.includes.includes(formConfig.value.currentItem!.component)) {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
</template>
|
||||
</BasicForm>
|
||||
<template v-for="(item, useIndex) in createOrModifyList[index]" :key="useIndex">
|
||||
<CreateOrModifyComponent :data="item" />
|
||||
<CreateOrModifyComponent :data="item" :createOrModifyData="createOrModifyData" :isUpdate="isUpdate" :isDetail="isDetail"/>
|
||||
</template>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
|
|
@ -117,7 +117,7 @@
|
|||
<!-- todo 创建/修改 人/时间 -->
|
||||
<template v-if="!(tabsColumns.length > 1)">
|
||||
<template v-for="(item, index) in createOrModifyList" :key="index">
|
||||
<CreateOrModifyComponent :data="item" />
|
||||
<CreateOrModifyComponent :data="item" :createOrModifyData="createOrModifyData"/>
|
||||
</template>
|
||||
</template>
|
||||
</BasicModal>
|
||||
|
|
@ -139,6 +139,7 @@
|
|||
import { subTableStore } from '@/store/modules/subTable';
|
||||
import { changeCardStructure, cardNestStructure } from '@/views/demo/onlineform/util.ts';
|
||||
import CreateOrModifyComponent from '@/views/demo/onlineform/formCall/CreateOrModifyComponent/index.vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
const subTableDataStore = subTableStore();
|
||||
|
||||
|
|
@ -171,6 +172,7 @@
|
|||
const scrollValue = ref();
|
||||
const cardLayout = ref([]);
|
||||
const createOrModifyList = ref([]);
|
||||
const createOrModifyData = ref({})
|
||||
// 按钮
|
||||
const buttonLayout = ref([]);
|
||||
// 脚本
|
||||
|
|
@ -408,6 +410,11 @@
|
|||
}
|
||||
if (unref(isUpdate) && !unref(isDetail)) {
|
||||
getTitle.value = '编辑';
|
||||
Object.keys(data.infoUseMainTableData).forEach(itemKey => {
|
||||
if(itemKey.indexOf('_time_') !== -1 || itemKey.indexOf('_user_') !== -1){
|
||||
createOrModifyData.value[itemKey] = data.infoUseMainTableData[itemKey]
|
||||
}
|
||||
})
|
||||
data.btnList.forEach((element) => {
|
||||
if (element.prop === 'Edit' && element.isWFlow) {
|
||||
flowCode.value = element.wFlowCode;
|
||||
|
|
@ -436,6 +443,11 @@
|
|||
}
|
||||
if (!unref(isUpdate) && unref(isDetail)) {
|
||||
getTitle.value = '详情';
|
||||
Object.keys(data.infoUseMainTableData).forEach(itemKey => {
|
||||
if(itemKey.indexOf('_time_') !== -1 || itemKey.indexOf('_user_') !== -1){
|
||||
createOrModifyData.value[itemKey] = data.infoUseMainTableData[itemKey]
|
||||
}
|
||||
})
|
||||
let isTabs = false;
|
||||
data.tab = changeCardStructure(data.tab);
|
||||
data.tab.forEach((itemComponent) => {
|
||||
|
|
@ -592,11 +604,22 @@
|
|||
async function ModalSureClick() {
|
||||
try {
|
||||
let values = await validate();
|
||||
// 将老创建人创建时间赋值
|
||||
values = {...values, ...createOrModifyData.value}
|
||||
// 添加校验后脚本
|
||||
let cardValueList = Object.values(cardValues.value);
|
||||
cardValueList.forEach((item) => {
|
||||
values = { ...values, ...item };
|
||||
});
|
||||
Object.keys(values).forEach(itemKey => {
|
||||
if(!isUpdate.value){
|
||||
if(itemKey.indexOf('_time_') !== -1) values[itemKey] = dayjs().format('YYYY-MM-DD HH:mm:ss')
|
||||
if(itemKey.indexOf('_user_') !== -1) values[itemKey] = localStorage.getItem('fireUserLoginName')
|
||||
}else{
|
||||
if(itemKey.indexOf('_modify_time') !== -1) values[itemKey] = dayjs().format('YYYY-MM-DD HH:mm:ss')
|
||||
if(itemKey.indexOf('_modify_user') !== -1) values[itemKey] = localStorage.getItem('fireUserLoginName')
|
||||
}
|
||||
})
|
||||
codeClickFunction('afterValidateForm', afterValidateForm.value);
|
||||
console.log('values', values);
|
||||
let query = values;
|
||||
|
|
|
|||
|
|
@ -24,14 +24,20 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, defineProps } from 'vue'
|
||||
import { ref, defineProps, onMounted } from 'vue'
|
||||
import { UserOutlined, FieldTimeOutlined } from '@ant-design/icons-vue';
|
||||
import dayjs from 'dayjs';
|
||||
const props = defineProps(['data'])
|
||||
const props = defineProps(['data', 'createOrModifyData', 'isUpdate', 'isDetail'])
|
||||
const show = props.data.display
|
||||
const isTime = ['createtime', 'modifytime'].includes(props.data.type)
|
||||
const nowTime = ref(dayjs().format('YYYY-MM-DD HH:mm:ss'))
|
||||
const userName = localStorage.getItem('fireUserLoginName')
|
||||
const userName = ref(localStorage.getItem('fireUserLoginName'))
|
||||
onMounted(() => {
|
||||
if(props.isUpdate || props.isDetail){
|
||||
nowTime.value = props.createOrModifyData[props.data.field]
|
||||
userName.value = props.createOrModifyData[props.data.field]
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
|
|
|||
|
|
@ -61,7 +61,8 @@
|
|||
// api
|
||||
import { getMenuList } from '@/api/demo/system';
|
||||
import { fun_GetPageList, fun_DeleteForm } from '@/api/demo/formModule';
|
||||
|
||||
import { usePermissionStore } from '@/store/modules/permission';
|
||||
const permissionStore = usePermissionStore();
|
||||
defineOptions({ name: 'FormModule' });
|
||||
const searchInfo = reactive<Recordable>({});
|
||||
const { createConfirm, createMessage } = useMessage();
|
||||
|
|
@ -136,6 +137,8 @@
|
|||
createMessage.warn('删除失败');
|
||||
}
|
||||
reload();
|
||||
await permissionStore.buildRoutesAction()
|
||||
permissionStore.setChangeMenu()
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -173,9 +176,11 @@
|
|||
}
|
||||
|
||||
// 新增、编辑-保存后,刷新
|
||||
function submitReload() {
|
||||
async function submitReload() {
|
||||
clearSelectedRowKeys();
|
||||
reload();
|
||||
await permissionStore.buildRoutesAction()
|
||||
permissionStore.setChangeMenu()
|
||||
}
|
||||
|
||||
function onBtnClicked(domId) {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
<a-input
|
||||
v-model:value="db.tableName"
|
||||
:disabled="!isNewTable(db)"
|
||||
@change="changeTableName(db)"
|
||||
@change="if (!db.tableName) db.tableName = db.name;"
|
||||
/>
|
||||
</a-col>
|
||||
<a-col class="gutter-row" :span="11">
|
||||
|
|
@ -155,7 +155,7 @@
|
|||
dataType: '',
|
||||
length: 0,
|
||||
columnDescription: '',
|
||||
isNullable: 0,
|
||||
isNullable: 1,
|
||||
isIdentity: 0,
|
||||
isPrimarykey: 0,
|
||||
decimalDigits: 0,
|
||||
|
|
@ -295,7 +295,7 @@
|
|||
schemas = sch.schemas;
|
||||
schemas?.forEach((item: any, index: number) => {
|
||||
// 过滤分割线、按钮
|
||||
if (item.component && !item.component.includes(notComponentArray)) {
|
||||
if (item.component && !notComponentArray.includes(item.component)) {
|
||||
// 图斑组件
|
||||
if (fieldArray.includes(item.field)) {
|
||||
db_temp.dbColumnInfoList.push({
|
||||
|
|
@ -304,7 +304,7 @@
|
|||
dataType: 'varchar',
|
||||
length: 200,
|
||||
columnDescription: '图斑组件id',
|
||||
isNullable: 0,
|
||||
isNullable: 1,
|
||||
isIdentity: 0,
|
||||
isPrimarykey: 0,
|
||||
decimalDigits: 0,
|
||||
|
|
@ -315,7 +315,7 @@
|
|||
dataType: 'geometry(GEOMETRY)',
|
||||
length: 0,
|
||||
columnDescription: '图斑组件',
|
||||
isNullable: 0,
|
||||
isNullable: 1,
|
||||
isIdentity: 0,
|
||||
isPrimarykey: 0,
|
||||
decimalDigits: 0,
|
||||
|
|
@ -323,6 +323,7 @@
|
|||
|
||||
item.componentProps.dataTable = db_temp.tableName;
|
||||
item.componentProps.fieldName = 'gid';
|
||||
item.csType = 'string';
|
||||
}
|
||||
// 子表-递归
|
||||
else if (item.component == 'Grid' && item.type == 'subTable') {
|
||||
|
|
@ -338,6 +339,7 @@
|
|||
);
|
||||
item.componentProps.dataTable =
|
||||
res?.columns[0]?.children[0]?.componentProps?.dataTable;
|
||||
item.csType = 'string';
|
||||
}
|
||||
// 布局控件
|
||||
else if (gridArray.includes(item.component)) {
|
||||
|
|
@ -359,6 +361,7 @@
|
|||
);
|
||||
ch.componentProps.dataTable =
|
||||
res?.columns[0]?.children[0]?.componentProps?.dataTable;
|
||||
ch.csType = 'string';
|
||||
}
|
||||
// 选项卡-图斑组件/布局组件
|
||||
else if (fieldArray.includes(ch.field) || gridArray.includes(ch.component)) {
|
||||
|
|
@ -392,6 +395,7 @@
|
|||
// componentProps
|
||||
ch.componentProps.dataTable = temp.tableName;
|
||||
ch.componentProps.fieldName = temp.dbColumnName;
|
||||
ch.csType = 'string';
|
||||
|
||||
db_temp.dbColumnInfoList.push(temp);
|
||||
}
|
||||
|
|
@ -484,11 +488,12 @@
|
|||
schemas = sch.children;
|
||||
schemas?.forEach((item: any, index: number) => {
|
||||
// 过滤分割线、按钮
|
||||
if (item.component && !item.component.includes(notComponentArray)) {
|
||||
if (item.component && !notComponentArray.includes(item.component)) {
|
||||
if (fieldArray.includes(item.field)) {
|
||||
// 子表-图斑组件
|
||||
item.componentProps.dataTable = db_temp.tableName;
|
||||
item.componentProps.fieldName = 'gid';
|
||||
item.csType = 'string';
|
||||
// item.componentProps.fieldName = 'geom';
|
||||
} else if (item.component == 'Grid' && item.type == 'subTable') {
|
||||
// 子表-递归
|
||||
|
|
@ -504,6 +509,7 @@
|
|||
);
|
||||
item.componentProps.dataTable =
|
||||
res?.columns[0]?.children[0]?.componentProps?.dataTable;
|
||||
item.csType = 'string';
|
||||
} else if (gridArray.includes(item.component)) {
|
||||
// 选项卡
|
||||
if (item.component == 'Tabs') {
|
||||
|
|
@ -523,6 +529,7 @@
|
|||
);
|
||||
ch.componentProps.dataTable =
|
||||
res?.columns[0]?.children[0]?.componentProps?.dataTable;
|
||||
ch.csType = 'string';
|
||||
}
|
||||
// 选项卡-图斑组件/布局组件
|
||||
else if (fieldArray.includes(ch.field) || gridArray.includes(ch.component)) {
|
||||
|
|
@ -548,6 +555,7 @@
|
|||
// componentProps
|
||||
ch.componentProps.dataTable = temp.tableName;
|
||||
ch.componentProps.fieldName = temp.dbColumnName;
|
||||
ch.csType = 'string';
|
||||
|
||||
db_temp.dbColumnInfoList.push(temp);
|
||||
}
|
||||
|
|
@ -571,6 +579,7 @@
|
|||
);
|
||||
ch.componentProps.dataTable =
|
||||
res?.columns[0]?.children[0]?.componentProps?.dataTable;
|
||||
ch.csType = 'string';
|
||||
}
|
||||
// 卡片布局-图斑组件/布局组件
|
||||
else if (fieldArray.includes(ch.field) || gridArray.includes(ch.component)) {
|
||||
|
|
@ -596,6 +605,8 @@
|
|||
// componentProps
|
||||
ch.componentProps.dataTable = temp.tableName;
|
||||
ch.componentProps.fieldName = temp.dbColumnName;
|
||||
ch.csType = 'string';
|
||||
|
||||
db_temp.dbColumnInfoList.push(temp);
|
||||
}
|
||||
});
|
||||
|
|
@ -618,6 +629,7 @@
|
|||
);
|
||||
ch.componentProps.dataTable =
|
||||
res?.columns[0]?.children[0]?.componentProps?.dataTable;
|
||||
ch.csType = 'string';
|
||||
}
|
||||
// 栅格布局-图斑组件/布局组件
|
||||
else if (fieldArray.includes(ch.field) || gridArray.includes(ch.component)) {
|
||||
|
|
@ -643,6 +655,7 @@
|
|||
// componentProps
|
||||
ch.componentProps.dataTable = temp.tableName;
|
||||
ch.componentProps.fieldName = temp.dbColumnName;
|
||||
ch.csType = 'string';
|
||||
db_temp.dbColumnInfoList.push(temp);
|
||||
}
|
||||
});
|
||||
|
|
@ -667,6 +680,7 @@
|
|||
);
|
||||
ch.componentProps.dataTable =
|
||||
res?.columns[0]?.children[0]?.componentProps?.dataTable;
|
||||
ch.csType = 'string';
|
||||
}
|
||||
// 卡片组-图斑组件/布局组件
|
||||
else if (fieldArray.includes(ch.field) || gridArray.includes(ch.component)) {
|
||||
|
|
@ -692,6 +706,7 @@
|
|||
// componentProps
|
||||
ch.componentProps.dataTable = temp.tableName;
|
||||
ch.componentProps.fieldName = temp.dbColumnName;
|
||||
ch.csType = 'string';
|
||||
|
||||
db_temp.dbColumnInfoList.push(temp);
|
||||
}
|
||||
|
|
@ -771,8 +786,28 @@
|
|||
if (checkflag) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 表名变化后修改表单里的表名
|
||||
db_list.value.forEach((db, db_index) => {
|
||||
if (db.name != db.tableName) {
|
||||
// scheme
|
||||
let scheme_replace = saveFormDatas.scheme.scheme;
|
||||
scheme_replace = replaceInJson(scheme_replace, db.name, db.tableName);
|
||||
saveFormDatas.scheme.scheme = scheme_replace;
|
||||
|
||||
// db
|
||||
// db.name = db.tableName;
|
||||
db.dbColumnInfoList?.forEach((d, d_index) => {
|
||||
d.tableName = db.tableName;
|
||||
db.dbColumnInfoList[d_index] = d;
|
||||
});
|
||||
db_list.value[db_index] = db;
|
||||
}
|
||||
});
|
||||
|
||||
// 设置子表的relationField
|
||||
getRelationField();
|
||||
|
||||
if (props.isAddVisible) {
|
||||
db_list.value.forEach(async (db) => {
|
||||
// 新增
|
||||
|
|
@ -796,7 +831,7 @@
|
|||
if (!oldDbColumnArray.includes(dbColumn.dbColumnName)) {
|
||||
dbColumn.isNullable = 1;
|
||||
let query: any = {
|
||||
dbCode: forminfoDbCode,
|
||||
dbCode: forminfoDbCode || 'hcsystemdb',
|
||||
dbColumn: dbColumn,
|
||||
};
|
||||
await AddColumn(query);
|
||||
|
|
@ -832,11 +867,13 @@
|
|||
}
|
||||
|
||||
// 检测:数据库是否有此表
|
||||
let query: any = { tableName: db.tableName };
|
||||
let res = await CheckTableExist(query);
|
||||
if (res) {
|
||||
createMessage.warn('数据库已有表' + db.tableName);
|
||||
flag = true;
|
||||
if (db.tableName) {
|
||||
let query: any = { tableName: db.tableName };
|
||||
let res = await CheckTableExist(query);
|
||||
if (res) {
|
||||
createMessage.warn('数据库已有表' + db.tableName);
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!flag) {
|
||||
|
|
@ -859,16 +896,16 @@
|
|||
}
|
||||
|
||||
// 检测:数据库字段名的命名规则
|
||||
if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(dbColumn.dbColumnName)) {
|
||||
if (dbColumn.dbColumnName && !/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(dbColumn.dbColumnName)) {
|
||||
createMessage.warn('字段名不符合数据库字段名的命名规则!');
|
||||
flag = true;
|
||||
}
|
||||
|
||||
// 检测:字段名不能重复
|
||||
if (!dbColumns.includes(dbColumn.dbColumnName)) {
|
||||
if (dbColumn.dbColumnName && !dbColumns.includes(dbColumn.dbColumnName)) {
|
||||
dbColumns.push(dbColumn.dbColumnName);
|
||||
} else {
|
||||
createMessage.warn('字段名不能重复!');
|
||||
createMessage.warn('同表内的字段名不能重复!');
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
|
|
@ -881,6 +918,17 @@
|
|||
return results;
|
||||
}
|
||||
|
||||
// 表名变化后修改表单里的表名
|
||||
function replaceInJson(jsonString, itemToReplace, newItem) {
|
||||
// 使用动态生成的正则表达式进行全局替换
|
||||
// 注意需要对itemToReplace中的特殊字符进行转义
|
||||
let escapedItem = itemToReplace.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
|
||||
let regex = new RegExp(escapedItem, 'g');
|
||||
let replacedJsonString = jsonString.replace(regex, newItem);
|
||||
|
||||
return replacedJsonString;
|
||||
}
|
||||
|
||||
// 设置子表的relationField
|
||||
function getRelationField() {
|
||||
// 确定primaryKey
|
||||
|
|
@ -923,22 +971,6 @@
|
|||
closeModalDeleteGrid();
|
||||
}
|
||||
|
||||
// 表名变化后修改表单里的表名
|
||||
function changeTableName(db) {
|
||||
if (db.tableName) {
|
||||
// 小写
|
||||
db.tableName = db.tableName.toLowerCase();
|
||||
|
||||
let scheme_replace = JSON.stringify(saveFormDatas.scheme.scheme);
|
||||
scheme_replace = scheme_replace.replace(db.name, db.tableName);
|
||||
saveFormDatas.scheme.scheme = JSON.parse(scheme_replace);
|
||||
db.name = db.tableName;
|
||||
db.dbColumnInfoList?.forEach((d) => {
|
||||
d.tableName = db.tableName;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 非提交关闭窗口时,栅格布局清除取出来的表单组件删除掉
|
||||
function closeModalDeleteGrid() {
|
||||
// 非提交
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'type'">
|
||||
{{ record.type ? '空间类型' : '非空间类型' }}
|
||||
{{ record.type ? '空间表' : '普通表' }}
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<TableAction
|
||||
|
|
|
|||
|
|
@ -33,9 +33,10 @@
|
|||
>
|
||||
<a-radio value="2">角色</a-radio>
|
||||
<a-radio value="1">用户</a-radio>
|
||||
<a-radio value="3">所有用户</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item ref="title" label="授权对象" name="objectId">
|
||||
<a-form-item ref="title" label="授权对象" name="objectId" v-if="formData.objectType != '3'">
|
||||
<a-select
|
||||
v-if="formData.objectType == '2'"
|
||||
v-model:value="formData.objectId"
|
||||
|
|
@ -245,7 +246,7 @@
|
|||
});
|
||||
}
|
||||
function getCodeListData() {
|
||||
fun_GetPageList({page:1,limit:9999999}).then((res: Recordable) => {
|
||||
fun_GetPageList({ page: 1, limit: 9999999 }).then((res: Recordable) => {
|
||||
const arr: any = [];
|
||||
if (res.items) {
|
||||
res.items.forEach((item) => {
|
||||
|
|
@ -317,7 +318,7 @@
|
|||
const rules = reactive({
|
||||
code: [{ required: true, message: '请选择功能', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
||||
objectId: [{ required: true, message: '请选择授权对象', trigger: 'blur' }],
|
||||
// objectId: [{ required: true, message: '请选择授权对象', trigger: 'blur' }],
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
|
|
@ -327,14 +328,18 @@
|
|||
.validate()
|
||||
.then(() => {
|
||||
const params = formData.value;
|
||||
if (formData.value.objectType == '1') {
|
||||
const objectObj = userOptions.value.filter((ele) => ele.value == params.objectId);
|
||||
console.log('objectObj', objectObj);
|
||||
params.objectName = objectObj[0].label;
|
||||
if (params.objectId) {
|
||||
if (formData.value.objectType == '1') {
|
||||
const objectObj = userOptions.value.filter((ele) => ele.value == params.objectId);
|
||||
console.log('objectObj', objectObj);
|
||||
params.objectName = objectObj[0].label;
|
||||
} else {
|
||||
const objectObj = roleOptions.value.filter((ele) => ele.value == params.objectId);
|
||||
console.log('objectObj', objectObj);
|
||||
params.objectName = objectObj[0].label;
|
||||
}
|
||||
} else {
|
||||
const objectObj = roleOptions.value.filter((ele) => ele.value == params.objectId);
|
||||
console.log('objectObj', objectObj);
|
||||
params.objectName = objectObj[0].label;
|
||||
params.objectName = '所有用户';
|
||||
}
|
||||
|
||||
const codeObj = codeOptions.value.filter((ele) => ele.value == params.code);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ export const columns: BasicColumn[] = [
|
|||
color = 'yellow';
|
||||
text = '用户';
|
||||
}
|
||||
if (formType == 3 || formType == '3') {
|
||||
color = 'orange';
|
||||
text = '所有用户';
|
||||
}
|
||||
return h(Tag, { color: color }, () => text);
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue