修改formCreate
This commit is contained in:
parent
974c306ba3
commit
3dfbe37f9f
@ -64,7 +64,15 @@ public class ModuleController {
|
||||
// 获取模块详情
|
||||
@GetMapping("/{id}")
|
||||
public ResponseResult getById(@PathVariable String id) {
|
||||
return ResponseResult.successData(moduleService.getById(id));
|
||||
Map<String, Object> moduleMap=null;
|
||||
try {
|
||||
LambdaQueryWrapper<Module> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(Module::getId, id);
|
||||
moduleMap = moduleService.getMap(wrapper);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return ResponseResult.successData(moduleMap);
|
||||
}
|
||||
|
||||
// 新增:根据pid判断是否有子节点
|
||||
|
@ -62,11 +62,13 @@ public class Module implements Serializable {
|
||||
/**
|
||||
* 样式数据
|
||||
*/
|
||||
@TableField(value = "canvas_style_data", jdbcType = JdbcType.VARCHAR)
|
||||
private String canvasStyleData;
|
||||
|
||||
/**
|
||||
* 组件数据
|
||||
*/
|
||||
@TableField(value = "component_data", jdbcType = JdbcType.VARCHAR)
|
||||
private String componentData;
|
||||
|
||||
/**
|
||||
|
@ -32,6 +32,7 @@ const onDatasetUpdate = () => {
|
||||
res.quotaList.pop()
|
||||
view.value.xAxis.push(...res.dimensionList, ...res.quotaList)
|
||||
const viewTarget = view.value
|
||||
debugger
|
||||
useEmitt().emitter.emit('calcData-' + viewTarget.id, viewTarget)
|
||||
snapshotStore.recordSnapshotCache('calc', view.value.id)
|
||||
})
|
||||
|
61139
core/core-frontend/src/fcDesignerPro/index.es.js
Normal file
61139
core/core-frontend/src/fcDesignerPro/index.es.js
Normal file
File diff suppressed because one or more lines are too long
1548
core/core-frontend/src/fcDesignerPro/index.umd.js
Normal file
1548
core/core-frontend/src/fcDesignerPro/index.umd.js
Normal file
File diff suppressed because one or more lines are too long
59788
core/core-frontend/src/fcDesignerPro/pc/index.es.js
Normal file
59788
core/core-frontend/src/fcDesignerPro/pc/index.es.js
Normal file
File diff suppressed because one or more lines are too long
1533
core/core-frontend/src/fcDesignerPro/pc/index.umd.js
Normal file
1533
core/core-frontend/src/fcDesignerPro/pc/index.umd.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
16363
core/core-frontend/src/fcDesignerPro/render/vant/form-create.es.js
Normal file
16363
core/core-frontend/src/fcDesignerPro/render/vant/form-create.es.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -168,7 +168,7 @@ export default {
|
||||
all: '全部',
|
||||
successful_go_to: '导出成功,前往',
|
||||
failed_go_to: '导出失败,前往',
|
||||
data_set: '数据集',
|
||||
data_set: '数据集1',
|
||||
view: '图表',
|
||||
organization: '所属组织',
|
||||
download: '下载',
|
||||
@ -858,7 +858,7 @@ export default {
|
||||
menu: '菜单权限',
|
||||
panel: '仪表板',
|
||||
screen: '数据大屏',
|
||||
dataset: '数据集',
|
||||
dataset: '数据集2',
|
||||
datasource: '数据源',
|
||||
all_types: '全部类型',
|
||||
empty_desc: '请选择用户/角色以及资源类型',
|
||||
@ -2011,7 +2011,7 @@ export default {
|
||||
time_all: '日期-年月日时分秒',
|
||||
dataset_sync: ' ( 数据同步中... )',
|
||||
sheet_warn: '有多个 Sheet 页,默认抽取第一个',
|
||||
datalist: '数据集',
|
||||
datalist: '数据集3',
|
||||
name: '数据集名称',
|
||||
add_group: '添加分组',
|
||||
add_scene: '添加场景',
|
||||
@ -2150,7 +2150,7 @@ export default {
|
||||
next_exec_time: '下次执行时间',
|
||||
last_exec_status: '上次执行结果',
|
||||
task_status: '任务状态',
|
||||
dataset: '数据集',
|
||||
dataset: '数据集4',
|
||||
search_by_name: '根据名称搜索',
|
||||
underway: '等待执行',
|
||||
stopped: '执行结束',
|
||||
@ -2879,7 +2879,7 @@ export default {
|
||||
cancel: '取消',
|
||||
select_ds_group_folder: '请选择数据集分组所属文件夹',
|
||||
app_no_datasource_tips: '存在未配置的数据源',
|
||||
dataset: '数据集',
|
||||
dataset: '数据集5',
|
||||
delete: '删除',
|
||||
delete_success: '删除成功',
|
||||
save_success: '保存成功',
|
||||
@ -3496,7 +3496,7 @@ export default {
|
||||
big_data_screen: '数据大屏',
|
||||
big_screen: '大屏',
|
||||
dashboard: '仪表板',
|
||||
data_set: '数据集',
|
||||
data_set: '数据集6',
|
||||
data_source: '数据源',
|
||||
recently_used: '最近使用',
|
||||
my_collection: '我的收藏',
|
||||
@ -4347,7 +4347,7 @@ export default {
|
||||
relation: {
|
||||
no_permission: '没有查看权限',
|
||||
datasource: '数据源',
|
||||
dataset: '数据集',
|
||||
dataset: '数据集7',
|
||||
dashboard: '仪表板',
|
||||
dataV: '数据大屏',
|
||||
analysis: '血缘分析',
|
||||
|
@ -3,6 +3,8 @@ import '@/style/index.less'
|
||||
import 'normalize.css/normalize.css'
|
||||
import '@antv/s2/dist/style.min.css'
|
||||
import App from './App.vue'
|
||||
import FcDesigner from '@/fcDesignerPro/index.es.js'
|
||||
|
||||
import ElementPlus from 'element-plus';
|
||||
import 'element-plus/theme-chalk/index.css';
|
||||
import { setupI18n } from '@/plugins/vue-i18n'
|
||||
@ -12,7 +14,7 @@ import { setupElementPlus, setupElementPlusIcons } from '@/plugins/element-plus'
|
||||
// 注册数据大屏组件
|
||||
import { setupCustomComponent } from '@/custom-component'
|
||||
import { installDirective } from '@/directive'
|
||||
import FcDesigner from '@form-create/designer';
|
||||
// import FcDesigner from '@form-create/designer';
|
||||
import '@/utils/DateUtil'
|
||||
import '@/permission'
|
||||
import WebSocketPlugin from '../../websocket'
|
||||
|
@ -10,7 +10,7 @@ import { pathValid } from '@/store/modules/permission'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import { useAppStoreWithOut } from '@/store/modules/app'
|
||||
import { useRoute } from 'vue-router'
|
||||
|
||||
import router from '@/router'
|
||||
const appStore = useAppStoreWithOut()
|
||||
const { wsCache } = useCache()
|
||||
export interface InnerInteractive {
|
||||
@ -62,7 +62,7 @@ export const interactiveStore = defineStore('interactive', {
|
||||
menuAuth: false
|
||||
}
|
||||
this.data[flag] = tempData
|
||||
|
||||
|
||||
if (flag === 0) {
|
||||
wsCache.set('panel-weight', {})
|
||||
}
|
||||
@ -75,8 +75,14 @@ export const interactiveStore = defineStore('interactive', {
|
||||
if (!resParam) {
|
||||
const route = useRoute()
|
||||
const appId:any = ref('')
|
||||
if (route.query.id) {
|
||||
if (route && route.query.id) {
|
||||
appId.value = route.query.id
|
||||
}else{
|
||||
if(router.currentRoute.value.query.id){
|
||||
appId.value = router.currentRoute.value.query.id
|
||||
}else if(router.currentRoute.value.query.appId){
|
||||
appId.value = router.currentRoute.value.query.appId
|
||||
}
|
||||
}
|
||||
const method = apiMap[flag]
|
||||
param.appId = appId.value
|
||||
|
@ -125,11 +125,11 @@ function moreClic(event:any ,data:any){ // 更多操作
|
||||
function editClic(data:any){
|
||||
console.log(data)
|
||||
if(data.type == '03'){
|
||||
window.open('/#/dvsCanvas?dvId=' +data.id+'&appId='+projectInfo.value.id , '_blank');
|
||||
window.open('/#/dvsCanvas?dvId=' + data.id+'&appId=' + projectInfo.value.id, '_blank');
|
||||
}else if(data.type == '0301'){
|
||||
window.open('/#/dashboard?resourceId=' + data.id+'&appId='+projectInfo.value.id, '_blank');
|
||||
window.open('/#/dashboard?resourceId=' + data.id + '&appId='+projectInfo.value.id, '_blank');
|
||||
}else if(data.type == '09'){
|
||||
window.open('/#/formcreatedesigner?moduleId=' +data.id, '_blank');
|
||||
window.open('/#/formcreatedesigner?moduleId=' +data.id + '&appId='+projectInfo.value.id, '_blank');
|
||||
}
|
||||
// window.open('/#/dvCanvas?dvId=' + "1097641013486424064", '_blank');
|
||||
}
|
||||
|
@ -296,7 +296,6 @@ const saveDataset = () => {
|
||||
}
|
||||
request.apiConfiguration = ''
|
||||
request.appId = appId.value
|
||||
debugger
|
||||
checkRepeat(request).then(res => {
|
||||
let method = request.id === '' ? save : update
|
||||
if (!request.type.startsWith('API')) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
v-model="formData"
|
||||
v-model:api="fapi"
|
||||
:rule="rule"
|
||||
:field="field"
|
||||
:option="option"
|
||||
@submit="onSubmit"
|
||||
></form-create>
|
||||
@ -26,6 +27,152 @@ watch(() => props.moduleInfo, val => { // 初始化数据
|
||||
moduleInfo.value = val
|
||||
getInit()
|
||||
})
|
||||
|
||||
const field = ref([{
|
||||
label: '商品表',
|
||||
children: [
|
||||
{
|
||||
label: '商品ID',
|
||||
item: 'input',
|
||||
field: 'goods_id',
|
||||
update: {
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '商品名称',
|
||||
field: 'goods_name',
|
||||
item: 'input',
|
||||
},
|
||||
{
|
||||
label: '商品分类',
|
||||
field: 'goods_cate',
|
||||
rule: {
|
||||
"type": "select",
|
||||
"field": "Fyvqm1ef5b5ud9c",
|
||||
"title": "选择器",
|
||||
"info": "",
|
||||
"effect": {
|
||||
"fetch": ""
|
||||
},
|
||||
"$required": false,
|
||||
"options": [
|
||||
{
|
||||
"label": "电子产品",
|
||||
"value": "电子产品"
|
||||
},
|
||||
{
|
||||
"label": "日用百货",
|
||||
"value": "日用百货"
|
||||
},
|
||||
{
|
||||
"label": "时尚女装",
|
||||
"value": "时尚女装"
|
||||
},
|
||||
{
|
||||
"label": "潮牌男装",
|
||||
"value": "潮牌男装"
|
||||
}
|
||||
],
|
||||
"_fc_id": "id_Flmkm1ef5b5udac",
|
||||
"name": "ref_Fzvkm1ef5b5udbc",
|
||||
"display": true,
|
||||
"hidden": false,
|
||||
"_fc_drag_tag": "select"
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '商品上架时间',
|
||||
field: 'goods_update_time',
|
||||
rule: [
|
||||
{
|
||||
"type": "datePicker",
|
||||
"field": "Fip1m14iqwv9ccc",
|
||||
"title": "日期",
|
||||
"info": "",
|
||||
"$required": false,
|
||||
"props": {
|
||||
"type": "datetime"
|
||||
},
|
||||
"_fc_id": "id_Fg4gm14iqwv9cdc",
|
||||
"name": "ref_Fba2m14iqwv9cec",
|
||||
"display": true,
|
||||
"hidden": false,
|
||||
"_fc_drag_tag": "datePicker"
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
}, {
|
||||
label: '用户表',
|
||||
children: [
|
||||
{
|
||||
label: '用户ID',
|
||||
field: 'user_id',
|
||||
item: 'input',
|
||||
update: {
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '手机号',
|
||||
field: 'phone',
|
||||
rule: {
|
||||
"type": "input",
|
||||
"field": "Fif4m1efbeddguc",
|
||||
"title": "手机号",
|
||||
"info": "",
|
||||
"$required": false,
|
||||
"_fc_id": "id_F3a9m1efbedegvc",
|
||||
"name": "ref_Festm1efbedegwc",
|
||||
"display": true,
|
||||
"hidden": false,
|
||||
"_fc_drag_tag": "input",
|
||||
"validate": [
|
||||
{
|
||||
"transform": "[[FORM-CREATE-PREFIX-function anonymous(val\n) {\nthis.type = Array.isArray(val) ? 'array' : (typeof val); return val;\n}-FORM-CREATE-SUFFIX]]",
|
||||
"mode": "pattern",
|
||||
"trigger": "blur",
|
||||
"pattern": "^(?:(?:\\+|00)86)?1[3-9]\\d{9}$",
|
||||
"message": "请输入正确的手机号"
|
||||
}
|
||||
]
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '用户名称',
|
||||
field: 'username',
|
||||
item: 'input',
|
||||
},
|
||||
{
|
||||
label: '用户备注',
|
||||
field: 'user_mark',
|
||||
item: 'textarea',
|
||||
},
|
||||
{
|
||||
label: '用户头像',
|
||||
field: 'avatar',
|
||||
rule: {
|
||||
"type": "upload",
|
||||
"field": "F0gfm1ef9o5mffc",
|
||||
"title": "用户头像",
|
||||
"info": "",
|
||||
"$required": false,
|
||||
"props": {
|
||||
"action": "/",
|
||||
"onSuccess": "[[FORM-CREATE-PREFIX-function anonymous(res,file\n) {\nfile.url = res.data.url;\n}-FORM-CREATE-SUFFIX]]"
|
||||
},
|
||||
"_fc_id": "id_Fsokm1ef9o5mfgc",
|
||||
"name": "ref_Fv5hm1ef9o5mfhc",
|
||||
"display": true,
|
||||
"hidden": false,
|
||||
"_fc_drag_tag": "upload"
|
||||
}
|
||||
},
|
||||
]
|
||||
}])
|
||||
|
||||
|
||||
const option :any = ref({});
|
||||
const rule :any = ref([]);
|
||||
const fapi = ref(null);
|
||||
|
@ -3,31 +3,37 @@
|
||||
<div style="display: flex;justify-content: flex-end;padding: 10px;">
|
||||
<el-button type="primary" @click="exportData">保存</el-button>
|
||||
</div>
|
||||
<!-- <el-button @click="exportData">显示</el-button> -->
|
||||
<FcDesigner ref="designerRef" style="width: 100vw;height:calc(100vh - 60px) " />
|
||||
<FcDesigner ref="designerRef" style="width: 100vw;height:calc(100vh - 60px) " :field="field"
|
||||
:appId="appId" :config="config"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref, toRefs, watch, nextTick } from 'vue';
|
||||
import { ElMessage,ElMessageBox } from 'element-plus-secondary'
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { ElMessage } from 'element-plus-secondary'
|
||||
|
||||
import formCreate from "@form-create/element-ui";
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { moduleById,moduleUpdate } from '@/api/application/module'
|
||||
const route = useRoute()
|
||||
|
||||
const appId:any = ref(route.query.appId)
|
||||
if(route.query.appId == null){
|
||||
appId.value = '00'
|
||||
}
|
||||
const designerRef:any = ref();
|
||||
const field:any = [{}]
|
||||
const config:any = {
|
||||
fieldReadonly: false,
|
||||
showSaveBtn: true,
|
||||
// varList: [],
|
||||
// fieldList: []
|
||||
}
|
||||
const exportData = () => {
|
||||
if (!designerRef.value) return;
|
||||
|
||||
|
||||
|
||||
// 获取规则和配置
|
||||
const rules = JSON.stringify(designerRef.value.getRule()) ;
|
||||
const options = JSON.stringify(designerRef.value.getOption());
|
||||
|
||||
|
||||
let data = {
|
||||
id:route.query.moduleId,
|
||||
canvasStyleData:rules,
|
||||
@ -39,32 +45,25 @@ const exportData = () => {
|
||||
}else{
|
||||
ElMessage.error('修改失败')
|
||||
}
|
||||
|
||||
|
||||
}).catch(() => {
|
||||
|
||||
|
||||
})
|
||||
// console.log(rule,option)
|
||||
|
||||
// option.value = formCreate.parseJson(options)
|
||||
// rule.value = formCreate.parseJson(rules)
|
||||
// dialogVisible.value = true
|
||||
|
||||
};
|
||||
onMounted(() => {
|
||||
console.log(route.query.moduleId)
|
||||
|
||||
if(route.query.moduleId == null){
|
||||
return
|
||||
}
|
||||
|
||||
appId.value = route.query.moduleId
|
||||
route.query.moduleId
|
||||
moduleById(route.query.moduleId).then(res => {
|
||||
if(res.code ==0){
|
||||
|
||||
if(res.data.data.canvas_style_data != null && res.data.data.canvas_style_data != ""){
|
||||
designerRef.value.setOption(formCreate.parseJson(res.data.data.component_data))
|
||||
designerRef.value.setRule( formCreate.parseJson(res.data.data.canvas_style_data))
|
||||
designerRef.value.setRule( formCreate.parseJson(res.data.data.canvas_style_data))
|
||||
}
|
||||
}
|
||||
console.log(res.data.data)
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@ -73,10 +72,10 @@ onMounted(() => {
|
||||
</style>
|
||||
<style>
|
||||
|
||||
._fc-m-tools-l{
|
||||
/* display: none; */
|
||||
/* ._fc-m-tools-l{
|
||||
display: none;
|
||||
}
|
||||
._fc-m-tools-r{
|
||||
/* display: none; */
|
||||
}
|
||||
display: none;
|
||||
} */
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user