AIFormRuleOptions.js 656 B

12345678910111213141516171819
  1. import AIFormRuleField from "@/pages/ie/components/ai-form/items/templates/AIFormRuleField";
  2. export default {
  3. mixins: [AIFormRuleField],
  4. methods: {
  5. async initColumns() {
  6. let opts = this.rule.options
  7. if (this.rule.dictOptions) {
  8. const dicts = await this.$store.cache.dispatch(
  9. 'cachedData/GET_DICT',
  10. this.rule.dictOptions
  11. )
  12. // 转化为标准数据,更契合uView数据结构
  13. opts = dicts.map(d => ({text: d.dictLabel, value: d.dictValue}))
  14. }
  15. this.columns = opts || []
  16. }
  17. }
  18. }