qj-common 4.2.2 → 4.2.3
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/package.json
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
<h3 class="template-title" v-if="title">
|
|
4
4
|
<p>{{ title }}</p>
|
|
5
5
|
</h3>
|
|
6
|
-
<el-form v-if="
|
|
6
|
+
<el-form v-if="temInput" :model="ruleForm" :rules="rules ? rules : {}" ref="ruleForm" :label-width="labelWidth ? labelWidth : '10rem'" class="demo-ruleForm">
|
|
7
7
|
<el-form-item
|
|
8
|
-
v-for="(item, index) in
|
|
8
|
+
v-for="(item, index) in temInput"
|
|
9
9
|
:key="index"
|
|
10
10
|
v-if="('state' in item ? item.state : true) && ('btnArray' in item ? true : 'label' in item)"
|
|
11
11
|
:label="'label' in item && ('state' in item ? item.state : true) ? item.label + ':' : ''"
|
|
@@ -121,7 +121,7 @@ import tempSelect from './components/temp-select';
|
|
|
121
121
|
import tempUpload from './components/temp-upload';
|
|
122
122
|
const querystring = require('querystring');
|
|
123
123
|
export default {
|
|
124
|
-
props: ['
|
|
124
|
+
props: ['temInput', 'rules', 'labelWidth', 'tabState', 'title'],
|
|
125
125
|
components: {
|
|
126
126
|
tempSelect,
|
|
127
127
|
tempUpload,
|
|
@@ -194,7 +194,7 @@ export default {
|
|
|
194
194
|
setReset() {
|
|
195
195
|
//数据重置
|
|
196
196
|
this.$refs['ruleForm'].resetFields();
|
|
197
|
-
this.
|
|
197
|
+
this.temInput.forEach((el) => {
|
|
198
198
|
if ('label' in el) {
|
|
199
199
|
if (el.type === 'cascader') {
|
|
200
200
|
el.value = [];
|
|
@@ -220,7 +220,7 @@ export default {
|
|
|
220
220
|
this.tabState.value = this.ruleForm[this.tabState.name];
|
|
221
221
|
for (let i in this.tabState.dataTemplate) {
|
|
222
222
|
if (i === this.tabState.value) {
|
|
223
|
-
this.
|
|
223
|
+
this.temInput.forEach((el) => {
|
|
224
224
|
if ('state' in el) {
|
|
225
225
|
if (this.tabState.dataTemplate[i].includes(el.name)) {
|
|
226
226
|
el.state = true; //是否显示
|
|
@@ -248,7 +248,7 @@ export default {
|
|
|
248
248
|
if (valid) {
|
|
249
249
|
if (url) {
|
|
250
250
|
let data = JSON.parse(JSON.stringify(this.ruleForm)); //去除数据的双向绑定
|
|
251
|
-
this.
|
|
251
|
+
this.temInput.forEach((el) => {
|
|
252
252
|
if ('label' in el) {
|
|
253
253
|
if (el.type === 'cascader') {
|
|
254
254
|
if (el.value.length > 0) {
|
|
@@ -316,7 +316,7 @@ export default {
|
|
|
316
316
|
selChange(val, item) {
|
|
317
317
|
//select选中的事件
|
|
318
318
|
console.log(item, '目前选中的值');
|
|
319
|
-
console.log(this.
|
|
319
|
+
console.log(this.temInput);
|
|
320
320
|
this.$emit('selChange', val, item);
|
|
321
321
|
},
|
|
322
322
|
},
|
|
@@ -324,8 +324,8 @@ export default {
|
|
|
324
324
|
ruleForm: {
|
|
325
325
|
get() {
|
|
326
326
|
let ruleForm = {};
|
|
327
|
-
// console.log(this.
|
|
328
|
-
this.
|
|
327
|
+
// console.log(this.temInput, "ccccccccccccccc");
|
|
328
|
+
this.temInput.forEach((el) => {
|
|
329
329
|
if ('state' in el) {
|
|
330
330
|
el.state && el.name ? this.$set(ruleForm, el.name, el.value) : '';
|
|
331
331
|
} else {
|
|
@@ -549,7 +549,7 @@
|
|
|
549
549
|
<template-input
|
|
550
550
|
:labelWidth="dialogData.template.labelWidth"
|
|
551
551
|
:rules="dialogData.template.rules"
|
|
552
|
-
:
|
|
552
|
+
:temInput="dialogData.template.html"
|
|
553
553
|
@cancel="dialogCancel"
|
|
554
554
|
@getData="getDataList"
|
|
555
555
|
@handleSelect="handleSelect"
|