|
|
@@ -1152,6 +1152,14 @@
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ parameterGetByCode({
|
|
|
+ code: 'component_attribute'
|
|
|
+ }).then((res) => {
|
|
|
+ this.lbjtList = this.parseComponentAttributeOptions(
|
|
|
+ res?.name || res?.value
|
|
|
+ );
|
|
|
+ });
|
|
|
+
|
|
|
//新增
|
|
|
|
|
|
this.$set(
|
|
|
@@ -1648,20 +1656,22 @@
|
|
|
// });
|
|
|
// console.log('produceTypeList',this.produceTypeList);
|
|
|
// },
|
|
|
- // // 属性类型字典
|
|
|
- // async getLbjtListList(code) {
|
|
|
- // let { data: res } = await getByCode(code);
|
|
|
- // console.log('res----', res);
|
|
|
+ parseComponentAttributeOptions(value) {
|
|
|
+ if (!value) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
|
|
|
- // this.lbjtList = res.map((item) => {
|
|
|
- // let values = Object.keys(item);
|
|
|
- // return {
|
|
|
- // value: Number(values[0]),
|
|
|
- // label: item[values[0]]
|
|
|
- // };
|
|
|
- // });
|
|
|
- // console.log('lbjtList',this.lbjtList);
|
|
|
- // },
|
|
|
+ const options = [];
|
|
|
+ const optionRegExp = /(\d+)\s*[::]\s*([^;;))]+)/g;
|
|
|
+ let match;
|
|
|
+ while ((match = optionRegExp.exec(String(value))) !== null) {
|
|
|
+ options.push({
|
|
|
+ value: Number(match[1]),
|
|
|
+ label: match[2].trim()
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return options;
|
|
|
+ },
|
|
|
async getDictList(code) {
|
|
|
let { data: res } = await getByCode(code);
|
|
|
|