Commit 1837a095 authored by “yiyousong”'s avatar “yiyousong”

perf: 优化页面

parent 35d4afc3
...@@ -50,9 +50,9 @@ export default { ...@@ -50,9 +50,9 @@ export default {
async getOptions() { async getOptions() {
if (this.$_.isEmpty(this.info)) return this.options; if (this.$_.isEmpty(this.info)) return this.options;
let { serviceApi, fieldTypeValue } = this.info; let { serviceApi, fieldTypeValue } = this.info;
fieldTypeValue = JSON.parse(fieldTypeValue); let fieldType = JSON.parse(fieldTypeValue);
if (!serviceApi && fieldTypeValue) { if (!serviceApi && fieldTypeValue) {
this.options = fieldTypeValue; this.options = fieldType;
} else if (serviceApi) { } else if (serviceApi) {
let res = await request(this.api + serviceApi, "post", { let res = await request(this.api + serviceApi, "post", {
size: -1, size: -1,
...@@ -61,8 +61,8 @@ export default { ...@@ -61,8 +61,8 @@ export default {
}); });
if (res.data.code == 1) { if (res.data.code == 1) {
let { data } = res.data.data; let { data } = res.data.data;
const firstKey = Object.keys(fieldTypeValue)[0]; const firstKey = Object.keys(fieldType)[0];
const firstValue = fieldTypeValue[firstKey]; const firstValue = fieldType[firstKey];
data.forEach((v) => { data.forEach((v) => {
this.options[v[firstValue]] = v[firstKey]; this.options[v[firstValue]] = v[firstKey];
}); });
......
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