Commit c3efd5df authored by 王万里's avatar 王万里

add: 字段配置

parent 5fc1b413
...@@ -19,10 +19,12 @@ let nodeIdParams = "" ...@@ -19,10 +19,12 @@ let nodeIdParams = ""
let exeCount = true let exeCount = true
let schemaListObj = {} let schemaListObj = {}
window.share && window.share.event.on("editCurrentNodeForm", (params)=> { window.share && window.share.event.on("editCurrentNodeForm", (params)=> {
// console.log(params)
shareformKey = params shareformKey = params
}) })
window.share && window.share.event.on("editCurrentNodeId", (paramsId)=>{ window.share && window.share.event.on("editCurrentNodeId", (paramsId)=>{
// console.log(paramsId)
nodeIdParams = paramsId nodeIdParams = paramsId
}) })
...@@ -132,20 +134,35 @@ angular.module('flowableModeler').controller('FlowableTextPropertyPopupCtrl', [' ...@@ -132,20 +134,35 @@ angular.module('flowableModeler').controller('FlowableTextPropertyPopupCtrl', ['
angular.module('flowableModeler').controller('FieldReadConfigPopupCtrl', ['$rootScope','$scope', '$http', function($rootScope, $scope, $http) { angular.module('flowableModeler').controller('FieldReadConfigPopupCtrl', ['$rootScope','$scope', '$http', function($rootScope, $scope, $http) {
window.share && window.share.event.on("editCurrentNodeId", (params)=>{ window.share && window.share.event.on("editCurrentNodeId", (params)=>{
// console.log(params)
nodeIdParams = params nodeIdParams = params
}) })
if (nodeIdParams && shareformKey) { if (nodeIdParams && shareformKey) {
$http.get(FLOWABLE.APP_URL.GetColumnConfig(nodeIdParams, shareformKey)) $http.get(FLOWABLE.APP_URL.GetColumnConfig(nodeIdParams, shareformKey))
.success((res)=>{ .success((res)=>{
if (res.FieldConfigList && res.FieldConfigList.length > 0) { if (res.FieldConfigList && res.FieldConfigList.length > 0) {
res.FieldConfigList.forEach((item)=>{
var result = [];
var obj = {};
for(var i =0; i<res.FieldConfigList.length; i++){
if(!obj[res.FieldConfigList[i].FieldCode]){
result.push(res.FieldConfigList[i]);
obj[res.FieldConfigList[i].FieldCode] = true;
}
}
result.forEach((item)=>{
$scope.property.properties.forEach((pItem)=>{ $scope.property.properties.forEach((pItem)=>{
if (item.FieldCode === pItem.key) { if (item.FieldCode === pItem.FieldName) {
pItem.defaultUnit = item.Unit
pItem.defaultValue = item.Type
pItem.defaultChecked = item.IsShow === "1" ? true : false pItem.defaultChecked = item.IsShow === "1" ? true : false
pItem.defaultIsRequired = item.IsRequired === "true" ? true : false pItem.defaultIsRequired = item.IsRequired === "true" ? true : false
if (item.IsReadOnly === "true" || item.IsReadOnly === "1") {
pItem.defaultIsReadOnly = true
} else {
pItem.defaultIsReadOnly = false
}
} }
}) })
}) })
...@@ -153,16 +170,17 @@ angular.module('flowableModeler').controller('FieldReadConfigPopupCtrl', ['$root ...@@ -153,16 +170,17 @@ angular.module('flowableModeler').controller('FieldReadConfigPopupCtrl', ['$root
$scope.childFieldObj = schemaListObj $scope.childFieldObj = schemaListObj
// console.log($scope.childFieldObj, "$scope.childFieldObj")
} else { } else {
$scope.property.properties.forEach(el => { $scope.property.properties.forEach(el => {
el.defaultValue = ""
el.defaultChecked = true el.defaultChecked = true
el.defaultUnit = ""
el.defaultIsRequired = false el.defaultIsRequired = false
}); });
} }
}) })
} }
$scope.isShow = true $scope.isShow = true
$scope.toggleTable=function() { $scope.toggleTable=function() {
...@@ -170,17 +188,19 @@ angular.module('flowableModeler').controller('FieldReadConfigPopupCtrl', ['$root ...@@ -170,17 +188,19 @@ angular.module('flowableModeler').controller('FieldReadConfigPopupCtrl', ['$root
} }
$scope.changeValue = function(params) { $scope.changeValue = function(params) {
// console.log(params)
const data = { const data = {
ActID: $rootScope.currentReadResourceId, ActID: $rootScope.currentReadResourceId,
Config: "", Config: "",
FieldCode: params.key, FieldCode: params.FieldName,
FieldName: params.title, FieldName: params.FieldName,
FieldType: params.type, FieldType: 'string',
FormKey: shareformKey, FormKey: shareformKey,
IsShow: params.defaultChecked ? 1: 0, IsShow: params.defaultChecked ? 1: 0,
Type: params.defaultValue, Type: params.defaultValue,
Unit: params.defaultUnit, Unit: params.defaultUnit,
IsRequired: params.defaultIsRequired IsRequired: params.defaultIsRequired,
IsReadOnly: params.defaultIsReadOnly
} }
$http({method: 'POST', url: FLOWABLE.APP_URL.SaveFieldConfig(), data: data}) $http({method: 'POST', url: FLOWABLE.APP_URL.SaveFieldConfig(), data: data})
.success(function(res) { .success(function(res) {
...@@ -223,7 +243,7 @@ angular.module('flowableModeler').controller('ExtraFormReadConfig', ['$rootScope ...@@ -223,7 +243,7 @@ angular.module('flowableModeler').controller('ExtraFormReadConfig', ['$rootScope
let componentList = [] let componentList = []
let arr = [] let arr = []
let chArr = [] let chArr = []
console.log(nodeIdParams, "nodeIdParams") // console.log(nodeIdParams, "nodeIdParams")
if (nodeIdParams) { if (nodeIdParams) {
$http.get(FLOWABLE.APP_URL.GetAssemblyModel('')) $http.get(FLOWABLE.APP_URL.GetAssemblyModel(''))
.success((res)=>{ .success((res)=>{
...@@ -244,7 +264,7 @@ angular.module('flowableModeler').controller('ExtraFormReadConfig', ['$rootScope ...@@ -244,7 +264,7 @@ angular.module('flowableModeler').controller('ExtraFormReadConfig', ['$rootScope
componentList = arr componentList = arr
$scope.componentList = componentList $scope.componentList = componentList
console.log($scope.componentList, '$scope.componentList') // console.log($scope.componentList, '$scope.componentList')
}) })
}) })
} }
...@@ -256,7 +276,7 @@ angular.module('flowableModeler').controller('ExtraFormReadConfig', ['$rootScope ...@@ -256,7 +276,7 @@ angular.module('flowableModeler').controller('ExtraFormReadConfig', ['$rootScope
} }
$http.get(FLOWABLE.APP_URL.SaveAssemblyConfig(nodeIdParams, params.AssemblyName, OperType)) $http.get(FLOWABLE.APP_URL.SaveAssemblyConfig(nodeIdParams, params.AssemblyName, OperType))
.success(res=>{ .success(res=>{
console.log(res) // console.log(res)
}) })
} }
}]); }]);
\ No newline at end of file
...@@ -100,7 +100,44 @@ angular.module('flowableModeler').controller('FlowableFormReferencePopupCtrl', ...@@ -100,7 +100,44 @@ angular.module('flowableModeler').controller('FlowableFormReferencePopupCtrl',
window.share && window.share.event.emit("currentNodeForm", $scope.property.value); window.share && window.share.event.emit("currentNodeForm", $scope.property.value);
// $rootScope.currentFormData = $scope.property.value // $rootScope.currentFormData = $scope.property.value
$scope.updatePropertyInModel($scope.property); $scope.updatePropertyInModel($scope.property);
const formKey = $scope.selectedForm.TableName
const nodeId = $rootScope.currentReadResourceId || $rootScope.resourceId
$http.get(FLOWABLE.APP_URL.GetTableFieldConfig(formKey))
.success((res)=>{
let formArr = []
const Values = res.getMe[0].Values
const Groups = res.getMe[0].Groups
Values.forEach((item)=>{
formArr.push({
ActID: nodeId,
Config: '',
FieldCode: item.FieldName,
FieldName: item.FieldName,
FieldType: 'string',
FormKey: formKey,
IsShow: 1,
Type:"",
Unit:"",
IsRequired: false,
IsReadOnly: "0"
})
})
var result = [];
var obj = {};
for(var i =0; i<formArr.length; i++){
if(!obj[formArr[i].FieldCode]){
result.push(formArr[i]);
obj[formArr[i].FieldCode] = true;
}
}
$http({method: 'POST', url: FLOWABLE.APP_URL.SaveColumnConfig(nodeId, decodeURI(formKey)), data: result})
.success((ret)=>{
if (ret.statusCode === "0000") {
$scope.close(); $scope.close();
}
})
})
}) })
} else { } else {
$scope.property.value = null; $scope.property.value = null;
...@@ -296,12 +333,12 @@ angular.module('flowableModeler').controller('FlowableFormReferencePopupCtrl', ...@@ -296,12 +333,12 @@ angular.module('flowableModeler').controller('FlowableFormReferencePopupCtrl',
} }
}) })
var cookie = cookieKeyVal.split("=")[1] var cookie = cookieKeyVal.split("=")[1]
$http.get(FLOWABLE.APP_URL.getFormModelsUrl(cookie)) $http.get(FLOWABLE.APP_URL.getFormModelsUrl(''))
.success( .success(
function(response) { function(response) {
$scope.state.loadingForms = false; $scope.state.loadingForms = false;
$scope.state.formError = false; $scope.state.formError = false;
$scope.forms = response.getMe[0].data; $scope.forms = response.getMe;
}) })
.error( .error(
function(data, status, headers, config) { function(data, status, headers, config) {
......
...@@ -10,38 +10,21 @@ ...@@ -10,38 +10,21 @@
</div> </div>
<table class="table" ng-if="isShow"> <table class="table" ng-if="isShow">
<tr> <tr>
<th></th> <th style="text-align: center;">字段名称</th>
<th>字段</th> <th style="text-align: center;">是否显示</th>
<th>默认值</th> <th style="text-align: center;">是否只读</th>
<th>单位</th> <th style="text-align: center;">是否必填</th>
<th>只读</th>
</tr> </tr>
<tr ng-repeat="child in childFieldObj.properties"> <tr ng-repeat="child in childFieldObj.properties" style="text-align: center;">
<td style="width: 20px;">
<td class="active" title="{{child.title}}">{{child.title}}</td>
<td>
<input type="checkbox" ng-model="child.defaultChecked" ng-change="changeValue(child)"/> <input type="checkbox" ng-model="child.defaultChecked" ng-change="changeValue(child)"/>
</td> </td>
<td class="active" style="width: 80px;" title="{{child.title}}">{{child.title}}</td> <td>
<td class="active" style="width: 85px;"> <input type="checkbox" ng-model="child.defaultIsReadOnly" ng-change="changeValue(child)"/>
<select ng-model="child.defaultValue" ng-change="changeValue(child)">
<option value="无"></option>
<option value="本人">本人</option>
<option value="本部门">本部门</option>
<option value="部门主管">部门主管</option>
<option value="财务">财务</option>
<option value="当前时间">当前时间</option>
<option value="所属站点">所属站点</option>
</select>
</td> </td>
<td class="active" style="width: 85px;"> <td>
<select ng-model="child.defaultUnit" ng-change="changeValue(child)">
<option value="无"></option>
<option value="个"></option>
<option value="本"></option>
<option value="元"></option>
<option value="万元">万元</option>
</select>
</td>
<td style="width: 45px;text-align: center;">
<input type="checkbox" ng-model="child.defaultIsRequired" ng-change="changeValue(child)"/> <input type="checkbox" ng-model="child.defaultIsRequired" ng-change="changeValue(child)"/>
</td> </td>
</tr> </tr>
......
...@@ -373,12 +373,29 @@ angular.module('flowableModeler') ...@@ -373,12 +373,29 @@ angular.module('flowableModeler')
} }
} }
function generatorArr(objCollections) {
let arr = []
objCollections.Schema.forEach((item)=>{
arr.push({
...item,
key: item.Alias,
defaultChecked: true,
title: item.Alias,
defaultValue: item.PresetValue,
defaultUnit: item.Unit,
defaultIsRequired: false
})
})
return arr
}
// 新增节点逻辑 // 新增节点逻辑
// console.log("新增节点逻辑") // console.log("新增节点逻辑")
// console.log(nodeIdList, 'nodeIdList nodeIdList nodeIdList nodeIdList') // console.log(nodeIdList, 'nodeIdList nodeIdList nodeIdList nodeIdList')
window.share && window.share.event.on("currentNodeForm", (params)=> { window.share && window.share.event.on("currentNodeForm", (params)=> {
formKey = params.key // console.log(params)
formKey = params.name //表名
// console.log(formKey, "currentNodeForm...currentNodeForm") // console.log(formKey, "currentNodeForm...currentNodeForm")
nodeIdList.push({ nodeIdList.push({
nodeId: $rootScope.currentReadResourceId, nodeId: $rootScope.currentReadResourceId,
...@@ -386,31 +403,26 @@ angular.module('flowableModeler') ...@@ -386,31 +403,26 @@ angular.module('flowableModeler')
}) })
if ($rootScope.currentReadResourceId && formKey) { if ($rootScope.currentReadResourceId && formKey) {
let currentObjArr = [] let currentObjArr = []
$http.get(FLOWABLE.APP_URL.GetColumnConfig($rootScope.resourceId, formKey)) $http.get(FLOWABLE.APP_URL.GetTableFieldConfig(formKey))
.success((res)=>{ .success((res)=>{
// console.log("新增节点逻辑,新增success、")
let FormJson = JSON.parse(res.FormJson)
const formJsonProperties = FormJson.schema.properties
let formArr = [] let formArr = []
const Values = res.getMe[0].Values
for (key in formJsonProperties) { const Groups = res.getMe[0].Groups
for (let ckey in formJsonProperties[key].properties) { Values.forEach((item)=>{
let params = formJsonProperties[key].properties[ckey]
formArr.push({ formArr.push({
ActID: $rootScope.currentReadResourceId, ActID: $rootScope.currentReadResourceId,
Config: '', Config: '',
FieldCode: ckey, FieldCode: item.FieldName,
FieldName: params.title, FieldName: item.FieldName,
FieldType: params.type, FieldType: 'string',
FormKey: formKey, FormKey: formKey,
IsShow: 1, IsShow: 1,
Type:"", Type:"",
Unit:"", Unit:"",
IsRequired: false IsRequired: false,
IsReadOnly: "0"
})
}) })
}
}
var result = []; var result = [];
var obj = {}; var obj = {};
for(var i =0; i<formArr.length; i++){ for(var i =0; i<formArr.length; i++){
...@@ -419,18 +431,7 @@ angular.module('flowableModeler') ...@@ -419,18 +431,7 @@ angular.module('flowableModeler')
obj[formArr[i].FieldCode] = true; obj[formArr[i].FieldCode] = true;
} }
} }
$http({method: 'POST', url: FLOWABLE.APP_URL.SaveColumnConfig($rootScope.currentReadResourceId, decodeURI(formKey)), data: result})
.success(function(res) {
// console.log(res)
})
let fatherObj = FormJson.schema.properties
function generatorArr(objCollections) {
let arr = []
for(let key in objCollections) {
arr.push({...objCollections[key],key})
}
return arr
}
let fieldTitle = { let fieldTitle = {
description: '', description: '',
hasReadWriteMode: false, hasReadWriteMode: false,
...@@ -470,7 +471,7 @@ angular.module('flowableModeler') ...@@ -470,7 +471,7 @@ angular.module('flowableModeler')
writeModeTemplateUrl: "editor-app/configuration/properties/extra-form-write-config.html?version=" + (new Date()).getTime(), writeModeTemplateUrl: "editor-app/configuration/properties/extra-form-write-config.html?version=" + (new Date()).getTime(),
} }
currentObjArr.push(fieldTitle) currentObjArr.push(fieldTitle)
for(let key in fatherObj) { Groups.forEach((item)=>{
const currentObj = { const currentObj = {
description: '', description: '',
hasReadWriteMode: false, hasReadWriteMode: false,
...@@ -479,16 +480,18 @@ angular.module('flowableModeler') ...@@ -479,16 +480,18 @@ angular.module('flowableModeler')
mode: "read", mode: "read",
readModeTemplateUrl: "editor-app/configuration/properties/form-field-read-config.html?version=" + (new Date()).getTime(), readModeTemplateUrl: "editor-app/configuration/properties/form-field-read-config.html?version=" + (new Date()).getTime(),
readonly: false, readonly: false,
title: fatherObj[key].title, title: item.GroupName,
type: "cusFieldConfig", type: "cusFieldConfig",
value: true, value: true,
properties: generatorArr(fatherObj[key].properties), properties: generatorArr(item),
writeModeTemplateUrl: "editor-app/configuration/properties/form-field-write-config.html?version=" + (new Date()).getTime(), writeModeTemplateUrl: "editor-app/configuration/properties/form-field-write-config.html?version=" + (new Date()).getTime(),
} }
currentObjArr.push(currentObj) currentObjArr.push(currentObj)
} })
currentObjArr.push(extraFormTitle) // currentObjArr.push(extraFormTitle)
currentObjArr.push(extraFormObj) // currentObjArr.push(extraFormObj)
// console.log(currentObjArr)
$rootScope.formKeyList = selectedItem.properties $rootScope.formKeyList = selectedItem.properties
let preArr = [] let preArr = []
...@@ -502,29 +505,171 @@ angular.module('flowableModeler') ...@@ -502,29 +505,171 @@ angular.module('flowableModeler')
selectedItem.properties = preArr.concat(currentObjArr).concat(nextArr) selectedItem.properties = preArr.concat(currentObjArr).concat(nextArr)
console.log(selectedItem.properties, "selectedItem.properties") // console.log(selectedItem.properties, "selectedItem.properties")
// const Values = res.getMe[0].Values
}) })
// 之前的逻辑
// $http.get(FLOWABLE.APP_URL.GetColumnConfig($rootScope.resourceId, formKey))
// .success((res)=>{
// // console.log("新增节点逻辑,新增success、")
// let FormJson = JSON.parse(res.FormJson)
// const formJsonProperties = FormJson.schema.properties
// let formArr = []
// for (key in formJsonProperties) {
// for (let ckey in formJsonProperties[key].properties) {
// let params = formJsonProperties[key].properties[ckey]
// formArr.push({
// ActID: $rootScope.currentReadResourceId,
// Config: '',
// FieldCode: ckey,
// FieldName: params.title,
// FieldType: params.type,
// FormKey: formKey,
// IsShow: 1,
// Type:"",
// Unit:"",
// IsRequired: false
// })
// }
// }
// var result = [];
// var obj = {};
// for(var i =0; i<formArr.length; i++){
// if(!obj[formArr[i].FieldCode]){
// result.push(formArr[i]);
// obj[formArr[i].FieldCode] = true;
// }
// }
// $http({method: 'POST', url: FLOWABLE.APP_URL.SaveColumnConfig($rootScope.currentReadResourceId, decodeURI(formKey)), data: result})
// .success(function(res) {
// // console.log(res)
// })
// let fatherObj = FormJson.schema.properties
// function generatorArr(objCollections) {
// let arr = []
// for(let key in objCollections) {
// arr.push({...objCollections[key],key})
// }
// return arr
// }
// let fieldTitle = {
// description: '',
// hasReadWriteMode: false,
// hidden: false,
// mode: "read",
// readModeTemplateUrl: "",
// readonly: false,
// title: '表单字段',
// type: "string",
// value: true,
// writeModeTemplateUrl: "",
// }
// const extraFormTitle = {
// description: '',
// hasReadWriteMode: false,
// hidden: false,
// mode: "read",
// readModeTemplateUrl: "",
// readonly: false,
// title: '外接表单',
// type: "string",
// value: true,
// writeModeTemplateUrl: "",
// }
// const extraFormObj = {
// description: '',
// hasReadWriteMode: false,
// hidden: false,
// key: key,
// mode: "read",
// readModeTemplateUrl: "editor-app/configuration/properties/extra-form-read-config.html?version=" + (new Date()).getTime(),
// readonly: false,
// title: '',
// type: "extraForm",
// value: true,
// properties: ['product'],
// writeModeTemplateUrl: "editor-app/configuration/properties/extra-form-write-config.html?version=" + (new Date()).getTime(),
// }
// currentObjArr.push(fieldTitle)
// for(let key in fatherObj) {
// const currentObj = {
// description: '',
// hasReadWriteMode: false,
// hidden: false,
// key: key,
// mode: "read",
// readModeTemplateUrl: "editor-app/configuration/properties/form-field-read-config.html?version=" + (new Date()).getTime(),
// readonly: false,
// title: fatherObj[key].title,
// type: "cusFieldConfig",
// value: true,
// properties: generatorArr(fatherObj[key].properties),
// writeModeTemplateUrl: "editor-app/configuration/properties/form-field-write-config.html?version=" + (new Date()).getTime(),
// }
// currentObjArr.push(currentObj)
// }
// currentObjArr.push(extraFormTitle)
// currentObjArr.push(extraFormObj)
// console.log(currentObjArr)
// $rootScope.formKeyList = selectedItem.properties
// let preArr = []
// let nextArr = []
// if ($rootScope.formKeyList.length > 14 && $rootScope.formKeyList[14].key === "oryx-formreference") {
// preArr = $rootScope.formKeyList.slice(0,15)
// nextArr = $rootScope.formKeyList.slice(15)
// }
// selectedItem.properties = preArr.concat(currentObjArr).concat(nextArr)
// console.log(selectedItem.properties, "selectedItem.properties")
// })
} }
}) })
// / 以下处理新增编辑逻辑 // / 以下处理新增编辑逻辑
// console.log(selectedItem, ":selectedItem.selectedItemselectedItemselectedItem") // console.log(selectedItem, ":selectedItem.selectedItemselectedItemselectedItem")
if (nodeIdList.length > 0 && selectCurrentNodeId && selectedItem && selectedItem.properties.length > 14 && selectedItem.properties[14].value){ if (nodeIdList.length > 0 && selectCurrentNodeId && selectedItem && selectedItem.properties.length > 14 && selectedItem.properties[14].value){
let clickedShape = selectedItem.properties[14].value.key // console.log(selectedItem.properties[14].value)
let clickedShape = selectedItem.properties[14].value.name
let currentObjArr = [] let currentObjArr = []
$http.get(FLOWABLE.APP_URL.GetColumnConfig(selectCurrentNodeId, clickedShape)) $http.get(FLOWABLE.APP_URL.GetTableFieldConfig(clickedShape))
.success((response)=>{
$http.get(FLOWABLE.APP_URL.GetColumnConfig(selectCurrentNodeId ,clickedShape))
.success((res)=>{ .success((res)=>{
// console.log("以下处理新增编辑逻辑,新增success、") let currentAddGroups = response.getMe[0].Groups
let FormJson = JSON.parse(res.FormJson) if (res.FieldConfigList && res.FieldConfigList.length > 0) {
let fatherObj = FormJson.schema.properties var addResult = [];
function generatorArr(objCollections) { var obj = {};
let arr = [] for(var i =0; i<res.FieldConfigList.length; i++){
for(let key in objCollections) { if(!obj[res.FieldConfigList[i].FieldCode]){
arr.push({...objCollections[key],key}) addResult.push(res.FieldConfigList[i]);
obj[res.FieldConfigList[i].FieldCode] = true;
} }
return arr
} }
addResult.forEach((item)=>{
currentAddGroups.forEach(cItem=>{
cItem.Schema.forEach((sItem)=>{
if (item.FieldCode === sItem.FieldName) {
sItem.IsRequired = item.IsRequired
sItem.IsShow = item.IsShow
sItem.IsReadOnly = item.IsReadOnly
}
})
})
})
// console.log(currentAddGroups)
let fieldTitle = { let fieldTitle = {
description: '', description: '',
hasReadWriteMode: false, hasReadWriteMode: false,
...@@ -564,7 +709,8 @@ angular.module('flowableModeler') ...@@ -564,7 +709,8 @@ angular.module('flowableModeler')
writeModeTemplateUrl: "editor-app/configuration/properties/extra-form-write-config.html?version=" + (new Date()).getTime(), writeModeTemplateUrl: "editor-app/configuration/properties/extra-form-write-config.html?version=" + (new Date()).getTime(),
} }
currentObjArr.push(fieldTitle) currentObjArr.push(fieldTitle)
for(let key in fatherObj) {
currentAddGroups.forEach((item)=>{
const currentObj = { const currentObj = {
description: '', description: '',
hasReadWriteMode: false, hasReadWriteMode: false,
...@@ -573,60 +719,82 @@ angular.module('flowableModeler') ...@@ -573,60 +719,82 @@ angular.module('flowableModeler')
mode: "read", mode: "read",
readModeTemplateUrl: "editor-app/configuration/properties/form-field-read-config.html?version=" + (new Date()).getTime(), readModeTemplateUrl: "editor-app/configuration/properties/form-field-read-config.html?version=" + (new Date()).getTime(),
readonly: false, readonly: false,
title: fatherObj[key].title, title: item.GroupName,
type: "cusFieldConfig", type: "cusFieldConfig",
value: true, value: true,
properties: generatorArr(fatherObj[key].properties), properties: generatorArr(item),
writeModeTemplateUrl: "editor-app/configuration/properties/form-field-write-config.html?version=" + (new Date()).getTime(), writeModeTemplateUrl: "editor-app/configuration/properties/form-field-write-config.html?version=" + (new Date()).getTime(),
} }
currentObjArr.push(currentObj) currentObjArr.push(currentObj)
} })
currentObjArr.push(extraFormTitle) // currentObjArr.push(extraFormTitle)
currentObjArr.push(extraFormObj) // currentObjArr.push(extraFormObj)
// console.log(currentObjArr)
$rootScope.formKeyList = selectedItem.properties $rootScope.formKeyList = selectedItem.properties
let preArr = [] let preArr = []
let nextArr = [] let nextArr = []
if ($rootScope.formKeyList.length > 14 && $rootScope.formKeyList[14].key === "oryx-formreference") { if ($rootScope.formKeyList.length > 14 && $rootScope.formKeyList[14].key === "oryx-formreference") {
preArr = $rootScope.formKeyList.slice(0,15) preArr = $rootScope.formKeyList.slice(0,15)
nextArr = $rootScope.formKeyList.slice(15) nextArr = $rootScope.formKeyList.slice(15)
} }
selectedItem.properties = preArr.concat(currentObjArr).concat(nextArr) selectedItem.properties = preArr.concat(currentObjArr).concat(nextArr)
}
})
}) })
} }
// 以下处理保存之后得读取数值 // 以下处理保存之后得读取数值
// console.log("以下处理保存之后得读取数值") // console.log("以下处理保存之后得读取数值")
// console.log(selectedItem, ":selectedItem.selectedItemselectedItemselectedItem") // console.log(selectedItem, ":selectedItem.selectedItemselectedItemselectedItem")
// console.log(nodeIdList, 'nodeIdList nodeIdList nodeIdList nodeIdList') // console.log(nodeIdList, 'nodeIdList nodeIdList nodeIdList nodeIdList')
// console.log(selectCurrentNodeId, "selectCurrentNodeIdselectCurrentNodeIdselectCurrentNodeIdselectCurrentNodeId")
if (nodeIdList.length === 0) { if (nodeIdList.length === 0) {
window.share && window.share.event.on("readEditNodeId", (params)=> { window.share && window.share.event.on("readEditNodeId", (params)=> {
// console.log(params ,"editNodeeditNodeeditNode") // console.log(params ,"editNodeeditNodeeditNode")
if (selectedItem && selectedItem.properties.length > 14 && selectedItem.properties[14].value) { if (selectedItem && selectedItem.properties.length > 14 && selectedItem.properties[14].value) {
// console.log("编辑,读取字段配置,进来了") // console.log("编辑,读取字段配置,进来了")
let clickedShape = selectedItem.properties[14].value.key // console.log(selectedItem.properties[14].value)
let clickedShape = selectedItem.properties[14].value.name
let clickedShapeKey = selectedItem.properties[14].value.key
window.share && window.share.event.emit("editCurrentNodeForm", clickedShape); window.share && window.share.event.emit("editCurrentNodeForm", clickedShape);
window.share && window.share.event.emit("editCurrentNodeId", params); window.share && window.share.event.emit("editCurrentNodeId", params);
let currentObjArr = [] let currentObjArr = []
$http.get(FLOWABLE.APP_URL.GetColumnConfig(params, clickedShape)) $http.get(FLOWABLE.APP_URL.GetTableFieldConfig(clickedShape))
.success((response)=>{
$http.get(FLOWABLE.APP_URL.GetColumnConfig(params ,clickedShape))
.success((res)=>{ .success((res)=>{
let FormJson = JSON.parse(res.FormJson) let currentGroups = response.getMe[0].Groups
let fatherObj = FormJson.schema.properties if (res.FieldConfigList && res.FieldConfigList.length > 0) {
function generatorArr(objCollections) { var result = [];
let arr = [] var obj = {};
for(let key in objCollections) { for(var i =0; i<res.FieldConfigList.length; i++){
arr.push({...objCollections[key],key}) if(!obj[res.FieldConfigList[i].FieldCode]){
result.push(res.FieldConfigList[i]);
obj[res.FieldConfigList[i].FieldCode] = true;
} }
return arr
} }
result.forEach((item)=>{
currentGroups.forEach(cItem=>{
cItem.Schema.forEach((sItem)=>{
if (item.FieldCode === sItem.FieldName) {
sItem.IsRequired = item.IsRequired
sItem.IsShow = item.IsShow
sItem.IsReadOnly = item.IsReadOnly
}
})
})
})
let fieldTitle = { let fieldTitle = {
description: '', description: '',
hasReadWriteMode: false, hasReadWriteMode: false,
...@@ -651,6 +819,7 @@ angular.module('flowableModeler') ...@@ -651,6 +819,7 @@ angular.module('flowableModeler')
value: true, value: true,
writeModeTemplateUrl: "", writeModeTemplateUrl: "",
} }
const extraFormObj = { const extraFormObj = {
description: '', description: '',
hasReadWriteMode: false, hasReadWriteMode: false,
...@@ -666,7 +835,8 @@ angular.module('flowableModeler') ...@@ -666,7 +835,8 @@ angular.module('flowableModeler')
writeModeTemplateUrl: "editor-app/configuration/properties/extra-form-write-config.html?version=" + (new Date()).getTime(), writeModeTemplateUrl: "editor-app/configuration/properties/extra-form-write-config.html?version=" + (new Date()).getTime(),
} }
currentObjArr.push(fieldTitle) currentObjArr.push(fieldTitle)
for(let key in fatherObj) {
currentGroups.forEach((item)=>{
const currentObj = { const currentObj = {
description: '', description: '',
hasReadWriteMode: false, hasReadWriteMode: false,
...@@ -675,17 +845,19 @@ angular.module('flowableModeler') ...@@ -675,17 +845,19 @@ angular.module('flowableModeler')
mode: "read", mode: "read",
readModeTemplateUrl: "editor-app/configuration/properties/form-field-read-config.html?version=" + (new Date()).getTime(), readModeTemplateUrl: "editor-app/configuration/properties/form-field-read-config.html?version=" + (new Date()).getTime(),
readonly: false, readonly: false,
title: fatherObj[key].title, title: item.GroupName,
type: "cusFieldConfig", type: "cusFieldConfig",
value: true, value: true,
properties: generatorArr(fatherObj[key].properties), properties: generatorArr(item),
writeModeTemplateUrl: "editor-app/configuration/properties/form-field-write-config.html?version=" + (new Date()).getTime(), writeModeTemplateUrl: "editor-app/configuration/properties/form-field-write-config.html?version=" + (new Date()).getTime(),
} }
currentObjArr.push(currentObj) currentObjArr.push(currentObj)
} })
currentObjArr.push(extraFormTitle) // currentObjArr.push(extraFormTitle)
currentObjArr.push(extraFormObj) // currentObjArr.push(extraFormObj)
// console.log(currentObjArr)
$rootScope.formKeyList = selectedItem.properties $rootScope.formKeyList = selectedItem.properties
let preArr = [] let preArr = []
...@@ -699,7 +871,13 @@ angular.module('flowableModeler') ...@@ -699,7 +871,13 @@ angular.module('flowableModeler')
selectedItem.properties = preArr.concat(currentObjArr).concat(nextArr) selectedItem.properties = preArr.concat(currentObjArr).concat(nextArr)
} else {
}
})
}) })
} }
}) })
} }
...@@ -776,7 +954,6 @@ angular.module('flowableModeler') ...@@ -776,7 +954,6 @@ angular.module('flowableModeler')
// }) // })
// } // }
// Need to wrap this in an $apply block, see http://jimhoskins.com/2012/12/17/angularjs-and-apply.html // Need to wrap this in an $apply block, see http://jimhoskins.com/2012/12/17/angularjs-and-apply.html
$scope.safeApply(function () { $scope.safeApply(function () {
$scope.selectedItem = selectedItem; $scope.selectedItem = selectedItem;
...@@ -789,6 +966,7 @@ angular.module('flowableModeler') ...@@ -789,6 +966,7 @@ angular.module('flowableModeler')
} else { } else {
selectCurrentNodeId = "" selectCurrentNodeId = ""
} }
}); });
} else { } else {
......
...@@ -196,8 +196,8 @@ FLOWABLE.APP_URL = { ...@@ -196,8 +196,8 @@ FLOWABLE.APP_URL = {
/* FORM MODEL URLS */ /* FORM MODEL URLS */
// 获取模型列表 // 获取模型列表
getFormModelsUrl: function (cookie) { getFormModelsUrl: function (FormName) {
return `${window.API_ADDRESS}/GetFormModelList?Cookie=${cookie}`; return `${window.API_ADDRESS}/GetFormListInfo_WithoutForm?FormName=${FormName}&pageIndex=1&pageSize=999&sortFields=id`;
}, },
// 获取模型详情 // 获取模型详情
getFormModelDetail: function(id, key, cookie) { getFormModelDetail: function(id, key, cookie) {
...@@ -207,7 +207,10 @@ FLOWABLE.APP_URL = { ...@@ -207,7 +207,10 @@ FLOWABLE.APP_URL = {
GetColumnConfig:function(ACTID, FORMKEY) { GetColumnConfig:function(ACTID, FORMKEY) {
return `${window.API_ADDRESS}/GetColumnConfig?ActID=${ACTID}&FormKey=${FORMKEY}` return `${window.API_ADDRESS}/GetColumnConfig?ActID=${ACTID}&FormKey=${FORMKEY}`
}, },
// 根据表名查询台账配置
GetTableFieldConfig: function(tableName) {
return `${window.API_ADDRESS}/GetTableGroupMetaV3?tableName=${tableName}`
},
// 保存单个字段配置信息 // 保存单个字段配置信息
SaveFieldConfig:function() { SaveFieldConfig:function() {
return `${window.API_ADDRESS}/SaveFieldConfig` return `${window.API_ADDRESS}/SaveFieldConfig`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment