| | |
| | | </span> |
| | | </template> |
| | | <template :slot="item.prop + ''" v-for="item in slotColumnList"> |
| | | <!-- <vciWebRefer |
| | | <vciWebRefer |
| | | v-if="item.type == 'refer'" |
| | | :value="item.value" |
| | | :options="item.referConfig || {}" |
| | | ></vciWebRefer> --> |
| | | ></vciWebRefer> |
| | | </template> |
| | | </avue-form> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getFormTemplate, getFormDetail } from "@/api/formTemplate"; |
| | | import { getFormDetail } from "@/api/formTemplate"; |
| | | import { getDictionary } from "../../api/system/dict"; |
| | | import vciWebRefer from "../refer/vciWebRefer.vue"; |
| | | export default { |
| | |
| | | this.handleResize(); |
| | | }, |
| | | methods: { |
| | | // 初始化 |
| | | init(columnList) { |
| | | if (Array.isArray(columnList)) { |
| | | this.templateRender(columnList); |
| | | } else { |
| | | this.getFormTemplate(); |
| | | } |
| | | }, |
| | | // 接口获取表单数据 |
| | | getFormTemplate() { |
| | | getFormTemplate({ |
| | | templateOid: this.templateOid, |
| | | codeClassifyOid: this.codeClassifyOid, |
| | | }) |
| | | .then((res) => { |
| | | if (res.status === 200) { |
| | | this.$emit('getFormTemplateEnd', res.data) |
| | | this.templateRender(res.data.formDefineVO.items); |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | this.loading = false; |
| | | console.log(err); |
| | | }); |
| | | }, |
| | | // 渲染表单模板 |
| | | templateRender(formItemList) { |
| | | // 无需分组数据 |
| | |
| | | getFormDetail() { |
| | | if (this.type === 'add') return |
| | | if (this.type === "add") return; |
| | | getFormDetail({ templateOid: this.templateOid, oid: this.rowOid }).then( |
| | | getFormDetail({ templateOid: this.templateOid, oid: '213D13D5-76D3-6B42-0932-705693F6B6E4' }).then( |
| | | (res) => { |
| | | this.form = Object.assign(this.form, res.obj) |
| | | console.log(res, "res"); |