centaline-data-driven 1.2.78 → 1.2.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/centaline/centaline.path.js +0 -2
- package/package.json +1 -1
- package/src/Form.vue +5 -4
- package/src/SearchList.vue +9 -3
- package/src/centaline/css/max.css +4 -1
- package/src/centaline/dynamicContact/src/dynamicContact.vue +5 -1
- package/src/centaline/dynamicDetail/src/dynamicContactList.vue +6 -1
- package/src/centaline/dynamicDetail/src/dynamicPropertyDetailRET.vue +5 -1
- package/src/centaline/dynamicDetail/src/dynamicPropertySimpleDetailRET.vue +5 -1
- package/src/centaline/dynamicForm/index.js +0 -4
- package/src/centaline/dynamicForm/src/dynamicForm.vue +12 -3
- package/src/centaline/dynamicForm/src/dynamicFormListTable.vue +7 -0
- package/src/centaline/dynamicLayout/src/dynamicLayout.vue +16 -270
- package/src/centaline/dynamicLayout/src/dynamicLayoutChildren.vue +6 -12
- package/src/centaline/dynamicLayout/src/dynamicLayoutImage.vue +55 -6
- package/src/centaline/dynamicLayout/src/dynamicLayoutLabel.vue +11 -7
- package/src/centaline/dynamicLayout/src/dynamicLayoutLine.vue +3 -1
- package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +206 -6
- package/src/centaline/loader/src/ctl/CellLayout.js +234 -115
- package/src/centaline/loader/src/ctl/Form.js +11 -4
- package/src/centaline/loader/src/ctl/FormList.js +81 -13
- package/src/centaline/loader/src/ctl/RichText.js +3 -0
- package/src/centaline/loader/src/ctl/SearchScreen.js +22 -22
- package/src/centaline/loader/src/ctl/SearchTable.js +215 -8
- package/src/centaline/loader/src/ctl/lib/LibFunction.js +6 -3
- package/src/main.js +6 -3
- package/wwwroot/static/centaline/centaline-data-driven.js +3 -3
- package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
- package/src/centaline/dynamicLabel/index.js +0 -11
- package/src/centaline/dynamicLabel/src/dynamicLabel.vue +0 -73
- package/src/centaline/dynamicLs/index.js +0 -22
- package/src/centaline/dynamicLs/src/dynamicLs.vue +0 -233
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import dynamicLabel from './src/dynamicLabel';
|
|
2
|
-
|
|
3
|
-
dynamicLabel.install = function (Vue) {
|
|
4
|
-
Vue.component(dynamicLabel.name, dynamicLabel);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
if (typeof window !== 'undefined' && window.Vue) {
|
|
8
|
-
window.Vue.use(dynamicLabel);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default dynamicLabel;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div style="width:100%" v-html="showHtml">
|
|
3
|
-
</div>
|
|
4
|
-
</template>
|
|
5
|
-
|
|
6
|
-
<script>
|
|
7
|
-
//该组件已废弃
|
|
8
|
-
import dynamicElement from '../../mixins/dynamicElement'
|
|
9
|
-
export default {
|
|
10
|
-
name: 'ct-label',
|
|
11
|
-
mixins: [dynamicElement],
|
|
12
|
-
props: ['row'],
|
|
13
|
-
data() {
|
|
14
|
-
return {
|
|
15
|
-
elementOptions: []
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
created() {
|
|
19
|
-
this.getFlagsOptions();
|
|
20
|
-
},
|
|
21
|
-
watch: {
|
|
22
|
-
dynamicData: {
|
|
23
|
-
handler(newVal) {
|
|
24
|
-
this.getFlagsOptions();
|
|
25
|
-
},
|
|
26
|
-
deep: true,
|
|
27
|
-
immediate:true
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
methods: {
|
|
31
|
-
getFlagsOptions() {
|
|
32
|
-
if (this.dynamicData && this.dynamicData.controlType === 'tags') {
|
|
33
|
-
if (typeof this.dynamicData.v2 === 'string') {
|
|
34
|
-
this.$set(this, 'elementOptions', JSON.parse(this.dynamicData.v2));
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
this.$set(this, 'elementOptions', this.dynamicData.v2);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
computed: {
|
|
43
|
-
showHtml() {
|
|
44
|
-
switch (this.elementValue.controlType) {
|
|
45
|
-
case 'd':
|
|
46
|
-
return this.elementValue.code1?this.elementValue.code1.substring(0, 10):'';
|
|
47
|
-
case 'gp':
|
|
48
|
-
return this.elementValue.dn;
|
|
49
|
-
case 'iTi':
|
|
50
|
-
return this.elementValue.code1 + '<slot>-</slot>' + this.elementValue.v2;
|
|
51
|
-
case 'mt':
|
|
52
|
-
case 't':
|
|
53
|
-
case 'p':
|
|
54
|
-
case 'i':
|
|
55
|
-
case 'nm':
|
|
56
|
-
return this.elementValue.code1;
|
|
57
|
-
case 'so':
|
|
58
|
-
case 'sos':
|
|
59
|
-
return this.elementValue.code1?(this.elementValue.code1 + '<slot>:</slot>' + this.elementValue.v2):'';
|
|
60
|
-
case 'tags':
|
|
61
|
-
var itemText = '';
|
|
62
|
-
this.elementValue.code1.forEach((value) => {
|
|
63
|
-
var itemOption = this.elementOptions.find((oValue) => { return oValue.Code === value });
|
|
64
|
-
if (itemOption) {
|
|
65
|
-
itemText += itemOption.Code + ':' + itemOption.Name + ' ';
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
return itemText;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
</script>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import dynamicLs from './src/dynamicLs'
|
|
2
|
-
import dynamicInput from '../dynamicInput/index'
|
|
3
|
-
import dynamicLabel from '../dynamicLabel/index'
|
|
4
|
-
import common from '../common/index'
|
|
5
|
-
import validate from '../validate/index'
|
|
6
|
-
import api from '../api/index'
|
|
7
|
-
|
|
8
|
-
dynamicLs.install = function (Vue) {
|
|
9
|
-
Vue.component(dynamicLs.name, dynamicLs);
|
|
10
|
-
Vue.component(dynamicInput.name, dynamicInput);
|
|
11
|
-
Vue.component(dynamicLabel.name, dynamicLabel);
|
|
12
|
-
|
|
13
|
-
Vue.use(common);
|
|
14
|
-
Vue.use(validate);
|
|
15
|
-
Vue.use(api);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (typeof window !== 'undefined' && window.Vue) {
|
|
19
|
-
window.Vue.use(dynamicLs);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default dynamicLs;
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div style="width:100%">
|
|
3
|
-
<el-form :label-position="'left'" :model="$data" :ref="elementValue.Name" @submit.native.prevent="onSubmit(elementValue.Name)">
|
|
4
|
-
<p v-if="getButtons('top')" style="text-align:right;padding-right:30px">
|
|
5
|
-
<el-button v-for="(btn,bindex) in getButtons('top')" :key="btn.dn" :type="$common.getBtnType(btn.controlType)" size="mini" @click="handlebtn(null, null,btn,elementValue.Rows)">{{btn.dn}}</el-button>
|
|
6
|
-
</p>
|
|
7
|
-
<el-table v-if="elementValue.Rows" :data="elementValue.Rows.slice(1,elementValue.Rows.length)" style="width: 100%">
|
|
8
|
-
<el-table-column v-if="head.controlType !== 'hd'" v-for="(head,index) in elementValue.Rows[0].Row" :label="head.dn" :width="head.wd?head.wd:180" :key="head.fieldName1">
|
|
9
|
-
<template slot-scope="scope">
|
|
10
|
-
<div style="width:100%" v-if="inForm && elementValue.RowEdit === '1'">
|
|
11
|
-
<ct-label v-model="scope.row.Row[index]" v-if="scope.row.Row[index].Read && scope.row.Row[index].Read === '1' && !listEditRow[(scope.$index + 1)]" :dynamicData="scope.row.Row[index]"></ct-label>
|
|
12
|
-
<el-form-item v-else-if="elementValue.RowEdit && elementValue.RowEdit === '1' && listEditRow[(scope.$index + 1)]" label-width="0px" :ref="'elementValue.Rows['+(scope.$index + 1)+'].Row['+index+']'" :rules="listRules[scope.$index + 1][index]" :prop="elementValue.Rows[scope.$index].Row[index].controlType === 'iTi'?'elementValue.Rows['+(scope.$index + 1)+'].Row['+index+']':'elementValue.Rows['+(scope.$index+1)+'].Row['+index+'].code1'">
|
|
13
|
-
<ct-input v-model="scope.row.Row[index]" :optApi="optApi" :dynamicData="scope.row.Row[index]" @input="elementInput" :row="1" @change="changeHandle($event,scope.row.Row[index],scope.$index)" @click="handlebtn(scope.$index, scope.row,scope.row.Row[index],elementValue.Rows)"></ct-input>
|
|
14
|
-
</el-form-item>
|
|
15
|
-
<ct-label v-model="scope.row.Row[index]" v-else :dynamicData="scope.row.Row[index]"></ct-label>
|
|
16
|
-
</div>
|
|
17
|
-
<div style="width:100%" v-else>
|
|
18
|
-
<ct-label v-model="scope.row.Row[index]" v-if="scope.row.Row[index].Read && scope.row.Row[index].Read === '1'" :dynamicData="scope.row.Row[index]"></ct-label>
|
|
19
|
-
<ct-input v-model="scope.row.Row[index]" v-else-if="elementValue.RowEdit && elementValue.RowEdit === '1'" :dynamicData="scope.row.Row[index]" @input="elementInput" :row="1"></ct-input>
|
|
20
|
-
<ct-label v-model="scope.row.Row[index]" v-else :dynamicData="scope.row.Row[index]"></ct-label>
|
|
21
|
-
</div>
|
|
22
|
-
</template>
|
|
23
|
-
</el-table-column>
|
|
24
|
-
<el-table-column v-if="getButtons().length > 0" fixed="right" :width="80 * getButtons().length">
|
|
25
|
-
<template slot-scope="scope">
|
|
26
|
-
<el-button v-for="(btn,bindex) in getButtons()" :key="btn.dn" :type="$common.getBtnType(btn.controlType)" size="mini" @click="handlebtn(scope.$index, scope.row,btn,elementValue.Rows)">{{btn.dn}}</el-button>
|
|
27
|
-
</template>
|
|
28
|
-
</el-table-column>
|
|
29
|
-
</el-table>
|
|
30
|
-
<p v-if="getButtons('down')">
|
|
31
|
-
<el-button v-for="(btn,bindex) in getButtons('down')" :key="btn.dn" :type="$common.getBtnType(btn.controlType)" size="mini" @click="handlebtn(scope.$index, scope.row,btn,elementValue.Rows)">{{btn.dn}}</el-button>
|
|
32
|
-
</p>
|
|
33
|
-
<el-dialog :visible.sync="editShow" v-show="editShow" @closed="$set(editData, 'Fields', []);$set(editData, 'NewRow', false);">
|
|
34
|
-
<ct-form v-model="editData" :dynamicData="editData" :sync="false" :col="1" @ctSubmit="editSave" :isDialog="true"></ct-form>
|
|
35
|
-
</el-dialog>
|
|
36
|
-
</el-form>
|
|
37
|
-
</div>
|
|
38
|
-
</template>
|
|
39
|
-
|
|
40
|
-
<script>
|
|
41
|
-
//该组件已废弃
|
|
42
|
-
import dynamicElement from '../../mixins/dynamicElement'
|
|
43
|
-
export default {
|
|
44
|
-
name: 'ct-ls',
|
|
45
|
-
mixins: [dynamicElement],
|
|
46
|
-
props: ["inForm",'formRefs','scripts','optApi'],
|
|
47
|
-
data() {
|
|
48
|
-
return {
|
|
49
|
-
listHead: [],
|
|
50
|
-
listContent: [],
|
|
51
|
-
listRules: [[]],
|
|
52
|
-
editData: {
|
|
53
|
-
"FormTitle": "编辑",
|
|
54
|
-
"OptApi": this.optApi,
|
|
55
|
-
"Button": [
|
|
56
|
-
{
|
|
57
|
-
"dn": "保存",
|
|
58
|
-
"action": "submit",
|
|
59
|
-
"dt": "p"
|
|
60
|
-
}
|
|
61
|
-
],
|
|
62
|
-
"Fields": [
|
|
63
|
-
|
|
64
|
-
],
|
|
65
|
-
"NewRow": false,
|
|
66
|
-
"Scripts": {}
|
|
67
|
-
},
|
|
68
|
-
editShow: false,
|
|
69
|
-
elementScripts: {
|
|
70
|
-
formData: {}
|
|
71
|
-
},
|
|
72
|
-
formData: {},
|
|
73
|
-
listEditRow: []
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
methods: {
|
|
77
|
-
handlebtn(index, data, button, rows) {
|
|
78
|
-
var self = this;
|
|
79
|
-
var stick = true;
|
|
80
|
-
if (typeof button.onClick !== 'undefined') {
|
|
81
|
-
this.elementScripts.formData.fieldsPath = 'elementValue.Rows[' + (index + 1) + "].Row";
|
|
82
|
-
var onClicks = button.onClick.split(';');
|
|
83
|
-
for (var str in onClicks) {
|
|
84
|
-
if (onClicks[str].trim() === '') {
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
var itemStick = new Function('try{ return this.elementScripts.' + onClicks[str].trim().replace(/\(\s*\)/, '(\'' + button.fieldName1 + '\')') + '}catch(ex){return ' + onClicks[str].trim() + '}').call(this);
|
|
88
|
-
if (stick !== false) {
|
|
89
|
-
stick = itemStick;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
if (stick !== false) {
|
|
94
|
-
var newRow;
|
|
95
|
-
switch (button.action) {
|
|
96
|
-
case 'delete':
|
|
97
|
-
rows.splice(index + 1, 1);
|
|
98
|
-
this.$emit("input", this.elementValue);
|
|
99
|
-
break;
|
|
100
|
-
case 'edit':
|
|
101
|
-
if (this.elementValue.RowEdit === '1') {
|
|
102
|
-
var itemEditRow = this.$common.deepClone(this.listEditRow);
|
|
103
|
-
if (itemEditRow[index + 1] === true) {
|
|
104
|
-
self.$refs[self.elementValue.Name].validate((valid, Obj) => {
|
|
105
|
-
if (valid) {
|
|
106
|
-
itemEditRow[index + 1] = !itemEditRow[index + 1];
|
|
107
|
-
}
|
|
108
|
-
self.listEditRow = itemEditRow;
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
itemEditRow[index + 1] = !itemEditRow[index + 1];
|
|
113
|
-
self.listEditRow = itemEditRow;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
this.$set(this.editData, 'Fields', data.Row);
|
|
118
|
-
this.$set(this, 'editShow', true);
|
|
119
|
-
}
|
|
120
|
-
break;
|
|
121
|
-
case 'add':
|
|
122
|
-
if (this.elementValue.RowEdit === '1') {
|
|
123
|
-
newRow = this.$common.deepClone(rows[0]);
|
|
124
|
-
var i = rows.length;
|
|
125
|
-
rows.push(newRow);
|
|
126
|
-
var rowRules = [];
|
|
127
|
-
for (var j = 0; j < this.elementValue.Rows[i].Row.length; j++) {
|
|
128
|
-
var itemRule = this.$validate.getValidate(this.elementValue.Rows[i].Row[j], this.elementValue.Rows[i].Row);
|
|
129
|
-
if (this.elementValue.Rows[i].Row[j].mrf) {
|
|
130
|
-
var itemValid = this.$validate.dynamicRequiredList.call(this, this.elementValue.Rows[i].Row[j], i);
|
|
131
|
-
itemRule.push(itemValid);
|
|
132
|
-
}
|
|
133
|
-
rowRules.push(itemRule);
|
|
134
|
-
}
|
|
135
|
-
this.listRules.push(rowRules);
|
|
136
|
-
var itemEditRow = this.$common.deepClone(this.listEditRow);
|
|
137
|
-
itemEditRow[rows.length - 1]= true;
|
|
138
|
-
self.listEditRow = itemEditRow;
|
|
139
|
-
this.$emit("input", this.elementValue);
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
newRow = this.$common.deepClone(rows[0]);
|
|
143
|
-
this.$set(this.editData, 'Fields', newRow.Row);
|
|
144
|
-
this.$set(this.editData, 'NewRow', true);
|
|
145
|
-
this.$set(this, 'editShow', true);
|
|
146
|
-
}
|
|
147
|
-
break;
|
|
148
|
-
default:
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
editSave(data) {
|
|
154
|
-
if (data.NewRow === true) {
|
|
155
|
-
this.$set(this.editData, 'NewRow', false);
|
|
156
|
-
this.elementValue.Rows.push({ Row: this.$common.deepClone(data.Fields)});
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
this.editData.Fields.forEach((value) => {
|
|
160
|
-
var updateField = data.Fields.find((uValue) => { return uValue.fieldName1 === value.fieldName1 && uValue.controlType === value.controlType });
|
|
161
|
-
if (updateField && typeof updateField.code1 !== 'undefined') {
|
|
162
|
-
this.$set(value, 'v1', updateField.code1);
|
|
163
|
-
this.$set(value, 'v2', updateField.v2);
|
|
164
|
-
this.$set(value, 'oldOptions', updateField.oldOptions);
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
this.$set(this, 'editShow', false);
|
|
169
|
-
this.$emit("input", this.elementValue);
|
|
170
|
-
},
|
|
171
|
-
getButtons(position) {
|
|
172
|
-
switch (position){
|
|
173
|
-
case 'top':
|
|
174
|
-
return this.elementValue.Button.filter((value) => { return value.position === 'top' });
|
|
175
|
-
case 'down':
|
|
176
|
-
return this.elementValue.Button.filter((value) => { return value.position === 'down' });
|
|
177
|
-
default:
|
|
178
|
-
return this.elementValue.Button.filter((value) => { return typeof value.position === 'undefined' || value.position === 'row' })
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
changeHandle(fieldName, field,index) {
|
|
182
|
-
if (typeof field.onChange !== 'undefined') {
|
|
183
|
-
this.elementScripts.formData.fieldsPath = 'elementValue.Rows[' + (index + 1) + "].Row";
|
|
184
|
-
var changes = field.onChange.split(';');
|
|
185
|
-
for (var str in changes) {
|
|
186
|
-
if (changes[str].trim() === '') {
|
|
187
|
-
continue;
|
|
188
|
-
}
|
|
189
|
-
eval('try{ this.elementScripts.' + changes[str].trim().replace(/\(\s*\)/, '(\'' + fieldName + '\')') + '}catch(ex){' + changes[str].trim() + '}');
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
},
|
|
194
|
-
created() {
|
|
195
|
-
if (this.inForm && this.elementValue.RowEdit === '1') {
|
|
196
|
-
for (var i = 1; i < this.elementValue.Rows.length; i++) {
|
|
197
|
-
var rowRules = [];
|
|
198
|
-
for (var j = 0; j < this.elementValue.Rows[i].Row.length; j++) {
|
|
199
|
-
var itemRule = this.$validate.getValidate(this.elementValue.Rows[i].Row[j], this.elementValue.Rows[i].Row);
|
|
200
|
-
if (this.elementValue.Rows[i].Row[j].mrf) {
|
|
201
|
-
var itemValid = this.$validate.dynamicRequiredList.call(this, this.elementValue.Rows[i].Row[j],i);
|
|
202
|
-
itemRule.push(itemValid);
|
|
203
|
-
}
|
|
204
|
-
rowRules.push(itemRule);
|
|
205
|
-
}
|
|
206
|
-
this.listRules.push(rowRules);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
},
|
|
210
|
-
mounted() {
|
|
211
|
-
var self = this;
|
|
212
|
-
this.$nextTick(function () {
|
|
213
|
-
if (self.inForm && self.elementValue.RowEdit === '1') {
|
|
214
|
-
self.formRefs[self.elementValue.Name] = self.$refs[self.elementValue.Name];
|
|
215
|
-
}
|
|
216
|
-
if (typeof self.scripts !== 'undefined') {
|
|
217
|
-
self.elementScripts = Object.assign({}, self.scripts, self.elementScripts);
|
|
218
|
-
for (var func in self.elementScripts) {
|
|
219
|
-
if (typeof self.elementScripts[func] === 'function') {
|
|
220
|
-
self.editData.Scripts[func] = self.elementScripts[func];
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
self.elementScripts.formData = self.$common.formData();
|
|
224
|
-
self.formData = self.elementScripts.formData;
|
|
225
|
-
self.elementScripts.formData.self = self;
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
this.elementValue.Rows.forEach((value, index) => {
|
|
229
|
-
this.listEditRow[index] = false;
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
</script>
|