xianniu-ui 0.8.14 → 0.8.16
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/lib/xianniu-ui.common.js +40251 -33194
- package/lib/xianniu-ui.umd.js +40251 -33194
- package/lib/xianniu-ui.umd.min.js +60 -51
- package/package.json +1 -1
- package/packages/import/main.vue +30 -5
- package/packages/search/main.vue +1 -1
package/package.json
CHANGED
package/packages/import/main.vue
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
size="small"
|
|
10
10
|
>
|
|
11
11
|
<div class="xn-import">
|
|
12
|
+
<slot name="form"></slot>
|
|
12
13
|
<el-link
|
|
13
14
|
class="mb-20"
|
|
14
15
|
type="success"
|
|
@@ -45,8 +46,8 @@
|
|
|
45
46
|
</template>
|
|
46
47
|
<div v-if="tip" slot="tip" class="el-upload__tip">{{ tip }}</div>
|
|
47
48
|
</el-upload>
|
|
48
|
-
<slot name="desc" class="xn-import-desc
|
|
49
|
-
<el-alert title="注:" type="warning">
|
|
49
|
+
<slot name="desc" v-if="showDesc" class="xn-import-desc fz-12">
|
|
50
|
+
<el-alert title="注:" class=" mt-10" type="warning">
|
|
50
51
|
<div>
|
|
51
52
|
<p>
|
|
52
53
|
1、非系统模板的文件会导入失败,请务必使用系统模板,点击上方按钮进行下载
|
|
@@ -84,10 +85,18 @@ export default {
|
|
|
84
85
|
type: String,
|
|
85
86
|
default: ".xls,.xlsx",
|
|
86
87
|
},
|
|
88
|
+
showDesc: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: true,
|
|
91
|
+
},
|
|
87
92
|
templateConfig: {
|
|
88
93
|
type: Object,
|
|
89
94
|
default: () => {},
|
|
90
95
|
},
|
|
96
|
+
beforeConfirm: {
|
|
97
|
+
type: Function,
|
|
98
|
+
default: () => {},
|
|
99
|
+
},
|
|
91
100
|
},
|
|
92
101
|
data() {
|
|
93
102
|
return {
|
|
@@ -133,10 +142,26 @@ export default {
|
|
|
133
142
|
this.$utils.download(this.templateConfig);
|
|
134
143
|
},
|
|
135
144
|
handleConfirm() {
|
|
136
|
-
if (
|
|
137
|
-
|
|
145
|
+
if (
|
|
146
|
+
this.beforeConfirm &&
|
|
147
|
+
typeof this.beforeConfirm === "function" &&
|
|
148
|
+
this.isPromise(this.beforeConfirm())
|
|
149
|
+
) {
|
|
150
|
+
this.beforeConfirm().then(() => {
|
|
151
|
+
if (!this.fileList.length) {
|
|
152
|
+
return this.$message.warning("请选择要上传的文件");
|
|
153
|
+
}
|
|
154
|
+
this.submit();
|
|
155
|
+
});
|
|
156
|
+
} else {
|
|
157
|
+
if (!this.fileList.length) {
|
|
158
|
+
return this.$message.warning("请选择要上传的文件");
|
|
159
|
+
}
|
|
160
|
+
this.submit();
|
|
138
161
|
}
|
|
139
|
-
|
|
162
|
+
},
|
|
163
|
+
isPromise(obj) {
|
|
164
|
+
return obj && Object.prototype.toString.call(obj) === "[object Promise]";
|
|
140
165
|
},
|
|
141
166
|
},
|
|
142
167
|
};
|
package/packages/search/main.vue
CHANGED
|
@@ -306,7 +306,7 @@ export default {
|
|
|
306
306
|
},
|
|
307
307
|
setData(key, data) {
|
|
308
308
|
const row =
|
|
309
|
-
this.form.value && this.form.value.find((item) => item.label === key);
|
|
309
|
+
this.form.value && this.form.value.find((item) => item.label === key || item.prop === key);
|
|
310
310
|
this.$set(row, "data", data);
|
|
311
311
|
},
|
|
312
312
|
setValue(key, value) {
|