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

add: 字段配置

parent 5fc1b413
......@@ -19,10 +19,12 @@ let nodeIdParams = ""
let exeCount = true
let schemaListObj = {}
window.share && window.share.event.on("editCurrentNodeForm", (params)=> {
// console.log(params)
shareformKey = params
})
window.share && window.share.event.on("editCurrentNodeId", (paramsId)=>{
// console.log(paramsId)
nodeIdParams = paramsId
})
......@@ -132,20 +134,35 @@ angular.module('flowableModeler').controller('FlowableTextPropertyPopupCtrl', ['
angular.module('flowableModeler').controller('FieldReadConfigPopupCtrl', ['$rootScope','$scope', '$http', function($rootScope, $scope, $http) {
window.share && window.share.event.on("editCurrentNodeId", (params)=>{
// console.log(params)
nodeIdParams = params
})
if (nodeIdParams && shareformKey) {
$http.get(FLOWABLE.APP_URL.GetColumnConfig(nodeIdParams, shareformKey))
.success((res)=>{
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)=>{
if (item.FieldCode === pItem.key) {
pItem.defaultUnit = item.Unit
pItem.defaultValue = item.Type
if (item.FieldCode === pItem.FieldName) {
pItem.defaultChecked = item.IsShow === "1" ? 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
$scope.childFieldObj = schemaListObj
// console.log($scope.childFieldObj, "$scope.childFieldObj")
} else {
$scope.property.properties.forEach(el => {
el.defaultValue = ""
el.defaultChecked = true
el.defaultUnit = ""
el.defaultIsRequired = false
});
}
})
}
$scope.isShow = true
$scope.toggleTable=function() {
......@@ -170,17 +188,19 @@ angular.module('flowableModeler').controller('FieldReadConfigPopupCtrl', ['$root
}
$scope.changeValue = function(params) {
// console.log(params)
const data = {
ActID: $rootScope.currentReadResourceId,
Config: "",
FieldCode: params.key,
FieldName: params.title,
FieldType: params.type,
FieldCode: params.FieldName,
FieldName: params.FieldName,
FieldType: 'string',
FormKey: shareformKey,
IsShow: params.defaultChecked ? 1: 0,
Type: params.defaultValue,
Unit: params.defaultUnit,
IsRequired: params.defaultIsRequired
IsRequired: params.defaultIsRequired,
IsReadOnly: params.defaultIsReadOnly
}
$http({method: 'POST', url: FLOWABLE.APP_URL.SaveFieldConfig(), data: data})
.success(function(res) {
......@@ -223,7 +243,7 @@ angular.module('flowableModeler').controller('ExtraFormReadConfig', ['$rootScope
let componentList = []
let arr = []
let chArr = []
console.log(nodeIdParams, "nodeIdParams")
// console.log(nodeIdParams, "nodeIdParams")
if (nodeIdParams) {
$http.get(FLOWABLE.APP_URL.GetAssemblyModel(''))
.success((res)=>{
......@@ -244,7 +264,7 @@ angular.module('flowableModeler').controller('ExtraFormReadConfig', ['$rootScope
componentList = arr
$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
}
$http.get(FLOWABLE.APP_URL.SaveAssemblyConfig(nodeIdParams, params.AssemblyName, OperType))
.success(res=>{
console.log(res)
// console.log(res)
})
}
}]);
\ No newline at end of file
......@@ -100,7 +100,44 @@ angular.module('flowableModeler').controller('FlowableFormReferencePopupCtrl',
window.share && window.share.event.emit("currentNodeForm", $scope.property.value);
// $rootScope.currentFormData = $scope.property.value
$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();
}
})
})
})
} else {
$scope.property.value = null;
......@@ -296,12 +333,12 @@ angular.module('flowableModeler').controller('FlowableFormReferencePopupCtrl',
}
})
var cookie = cookieKeyVal.split("=")[1]
$http.get(FLOWABLE.APP_URL.getFormModelsUrl(cookie))
$http.get(FLOWABLE.APP_URL.getFormModelsUrl(''))
.success(
function(response) {
$scope.state.loadingForms = false;
$scope.state.formError = false;
$scope.forms = response.getMe[0].data;
$scope.forms = response.getMe;
})
.error(
function(data, status, headers, config) {
......
......@@ -10,38 +10,21 @@
</div>
<table class="table" ng-if="isShow">
<tr>
<th></th>
<th>字段</th>
<th>默认值</th>
<th>单位</th>
<th>只读</th>
<th style="text-align: center;">字段名称</th>
<th style="text-align: center;">是否显示</th>
<th style="text-align: center;">是否只读</th>
<th style="text-align: center;">是否必填</th>
</tr>
<tr ng-repeat="child in childFieldObj.properties">
<td style="width: 20px;">
<tr ng-repeat="child in childFieldObj.properties" style="text-align: center;">
<td class="active" title="{{child.title}}">{{child.title}}</td>
<td>
<input type="checkbox" ng-model="child.defaultChecked" ng-change="changeValue(child)"/>
</td>
<td class="active" style="width: 80px;" title="{{child.title}}">{{child.title}}</td>
<td class="active" style="width: 85px;">
<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>
<input type="checkbox" ng-model="child.defaultIsReadOnly" ng-change="changeValue(child)"/>
</td>
<td class="active" style="width: 85px;">
<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;">
<td>
<input type="checkbox" ng-model="child.defaultIsRequired" ng-change="changeValue(child)"/>
</td>
</tr>
......
This diff is collapsed.
......@@ -196,8 +196,8 @@ FLOWABLE.APP_URL = {
/* FORM MODEL URLS */
// 获取模型列表
getFormModelsUrl: function (cookie) {
return `${window.API_ADDRESS}/GetFormModelList?Cookie=${cookie}`;
getFormModelsUrl: function (FormName) {
return `${window.API_ADDRESS}/GetFormListInfo_WithoutForm?FormName=${FormName}&pageIndex=1&pageSize=999&sortFields=id`;
},
// 获取模型详情
getFormModelDetail: function(id, key, cookie) {
......@@ -207,7 +207,10 @@ FLOWABLE.APP_URL = {
GetColumnConfig:function(ACTID, FORMKEY) {
return `${window.API_ADDRESS}/GetColumnConfig?ActID=${ACTID}&FormKey=${FORMKEY}`
},
// 根据表名查询台账配置
GetTableFieldConfig: function(tableName) {
return `${window.API_ADDRESS}/GetTableGroupMetaV3?tableName=${tableName}`
},
// 保存单个字段配置信息
SaveFieldConfig:function() {
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