| | |
| | | <view class="uni-page-modal-5601"> |
| | | <!-- 表头样式 --> |
| | | <OIForm ref="refBaseForm" class="v-headStyle" :form="head_styledef.form" :focusId="focusFieldId" |
| | | @click="onClick" @focus="ontap" @change="onEnterChange" @click-prefix="classAttr_extButton" |
| | | @click-suffix="classAttr_extButton"></OIForm> |
| | | @on-click="onClick" @on-focus="ontap" @on-change="onEnterChange" @on-click-prefix="classAttr_extButton" |
| | | @on-click-suffix="classAttr_extButton"></OIForm> |
| | | |
| | | <view class="view-content"> |
| | | <!-- 码盘子界面 --> |
| | |
| | | src="../../images/mobox_log_200x40.png"> |
| | | </image> |
| | | <checkbox-group @change="checkboxChange"> |
| | | <div class="dv-panel" v-for="(style,ii) in pageData.DefList" |
| | | <div class="dv-panel" v-for="(style,ii) in pageData.DefList" :key="ii" |
| | | @tap="onPanelClick(ii,style.form.htmlobjId)" |
| | | :id="'dvpanel'+style.form.htmlobjId" |
| | | :class="style.form.htmlobjId==active_id?'bk-active':''"> |
| | | <OIForm class="dv-panel-form" :form="style.form" viewMode></OIForm> |
| | | <uni-forms class="dv-panel-form" label-align="right"> |
| | | <view v-for="(item,index) in style.form.items" :key="index"> |
| | | <!-- 栅格布局 --> |
| | | <uni-row v-if="item.name == 'Layout'" :gutter="item.setting.gutter"> |
| | | <uni-col |
| | | :span="item.setting.spanList && item.setting.spanList[key]? item.setting.spanList[key] : 24 / item.setting.col" |
| | | v-for="(col,key) in item.setting.colList" :key="key"> |
| | | <uni-forms-item v-if="col != null" |
| | | :label="col.labelWidth === 0 ? '' : col.label? col.label+':':''" |
| | | :label-width="col.labelWidth || col.labelWidth === 0 ? col.labelWidth : 100+'px'"> |
| | | <view v-if="col.disabled">{{col.value}}</view> |
| | | <input class="uni-input" |
| | | v-else-if="col.name=='Input' || col.name=='InputNumber'" |
| | | :type="col.name=='InputNumber'?'number':'text'" |
| | | v-model="col.value" :placeholder="col.placeholder" |
| | | :maxlength="-1" /> |
| | | <view v-else>{{col.value}}</view> |
| | | |
| | | </uni-forms-item> |
| | | <uni-forms-item v-else label=""></uni-forms-item> |
| | | </uni-col> |
| | | </uni-row> |
| | | <uni-forms-item v-else |
| | | :label="item.labelWidth === 0 ? '' : item.label? item.label+':':''" |
| | | :label-width="item.labelWidth || item.labelWidth === 0 ? item.labelWidth : 100+'px'" |
| | | :style="{ textAlign: item.setting.align }"> |
| | | <view v-if="item.disabled">{{item.value}}</view> |
| | | <input v-else-if="item.name=='Input' || item.name=='InputNumber' " |
| | | class="uni-input" |
| | | :type="item.name=='InputNumber'?'number':'text'" |
| | | v-model="item.value" :disabled="item.disabled" |
| | | :placeholder="item.placeholder" :maxlength="-1" /> |
| | | <view v-else>{{item.value}}</view> |
| | | |
| | | </uni-forms-item> |
| | | </view> |
| | | </uni-forms> |
| | | <!-- <OIForm class="dv-panel-form" :form="style.form" viewMode></OIForm> --> |
| | | |
| | | <div class="dv-panel-button" |
| | | v-if="pageData.Select_Button==true || pageData.Row_Button.length > 0"> |
| | | |
| | | <checkbox v-if="pageData.Select_Button==true" :model="ii" |
| | | <checkbox v-if="pageData.Select_Button==true" :value="ii" |
| | | :checked="style.SelBut_Checked" /> |
| | | <!-- <text></text> --> |
| | | <!-- <button type="primary" @click="savaItem(ii)" v-if="param.Sub_Page[0].OK_Button==true">保存</Button> --> |
| | |
| | | } from "@/api/data.js" |
| | | import dayjs from "dayjs"; |
| | | import OIForm from '@/components/oi-form/index.vue' |
| | | import OIFormItem from '@/components/oi-form/list/index.vue' |
| | | import OIFormInput from '@/components/oi-form/list/input/index.vue' |
| | | import OIFormInputNumber from '@/components/oi-form/list/input-number/index.vue' |
| | | |
| | | export default { |
| | | name: "PageModal5601", |
| | |
| | | }, |
| | | components: { |
| | | OIForm, |
| | | OIFormItem, |
| | | OIFormInput, |
| | | OIFormInputNumber |
| | | |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | selectAttrObj: {}, |
| | | |
| | | global_attr: [], |
| | | refdatastore: [], //引用数据存储区// {attr:'G_PRJ_' + bindattr + '_ID', value:info.id} |
| | | popupType: "center", |
| | | check_list: {}, |
| | | popupParam: {}, |
| | |
| | | item.value = result.decodedata; |
| | | var $this = this; |
| | | let newVal = item.value.trim() |
| | | if (item.oldvalue != newVal) { |
| | | if (newVal) { |
| | | item.oldvalue = newVal; |
| | | var attr = item.fieldId; |
| | | this.head_styledef.form.model[attr] = newVal; |
| | |
| | | |
| | | } |
| | | }, |
| | | |
| | | |
| | | classAttr_extButton(item) { |
| | | var onSuffixClickCallbackEvent = item.bind.onSuffixClickCallbackEvent; //后图标点击事件 |
| | | var onSuffixClickEvent = item.bind.onSuffixClickEvent; //后图标点击回调 |
| | |
| | | |
| | | } else if (item.action_type == "clear_subpage_rows") { |
| | | var value = item.value; |
| | | const pageData = $this.pageDetail.find((page) => { |
| | | const pageIndex = $this.pageDetail.findIndex((page) => { |
| | | return value.page_name == page.Name; |
| | | }); |
| | | if (pageData) { |
| | | if (pageIndex > -1) { |
| | | const pageData = $this.pageDetail[pageIndex] |
| | | pageData.DefList = [] |
| | | pageData.ExtData = {} |
| | | |
| | | $this.$set(this.pageDetail, pageIndex, pageData) |
| | | } |
| | | |
| | | } else if (item.action_type == "set_dlg_current_edit_attr") { |
| | |
| | | if (JSON.stringify(value.row) == '{}') { |
| | | return; |
| | | } |
| | | const pageData = this.pageDetail.find((page) => { |
| | | const pageIndex = $this.pageDetail.findIndex((page, index2, arr) => { |
| | | return value.page_name == page.Name; |
| | | }); |
| | | }) |
| | | if (pageIndex < 0) |
| | | return |
| | | const pageData = $this.pageDetail[pageIndex] |
| | | if (pageData?.DefList) //判断返回的action的page_name是否是待分拣//清除面板中指定id的数据 |
| | | { |
| | | value.row.forEach((row) => { |
| | |
| | | }); |
| | | }); |
| | | } |
| | | $this.$set(this.pageDetail, pageIndex, pageData) |
| | | }, |
| | | //更新分页签中的列表项内容 |
| | | viewActionSetRow(value) { |
| | | const $this = this |
| | | const pageIndex = $this.pageDetail.findIndex(( |
| | | page, index2, arr) => { |
| | | const pageIndex = $this.pageDetail.findIndex((page, index2, arr) => { |
| | | return value.page_name == page.Name; |
| | | }) |
| | | if (pageIndex < 0) |
| | |
| | | if (ele.form.objId == rowData.id) { |
| | | rowData.attrs.forEach(attr => { |
| | | ele.form.items.forEach(ele2 => { |
| | | if (ele2.name != |
| | | 'Layout') { |
| | | if (ele2.fieldId == |
| | | attr |
| | | .attr) { |
| | | ele2.value = |
| | | $this |
| | | .operationNumber( |
| | | ele2 |
| | | .value, |
| | | attr |
| | | .value, |
| | | attr |
| | | .operation |
| | | ) |
| | | if (ele2.name != 'Layout') { |
| | | if (ele2.fieldId == attr.attr) { |
| | | ele2.value = $this.operationNumber( |
| | | ele2.value, |
| | | attr.value, |
| | | attr.operation |
| | | ) |
| | | } |
| | | } else if (ele2.name == |
| | | 'Layout') { |
| | | ele2.setting |
| | | .colList |
| | | .forEach( |
| | | col => { |
| | | if ( |
| | | col) { |
| | | if (col |
| | | .fieldId == |
| | | attr |
| | | .attr |
| | | ) { |
| | | col.value = |
| | | $this |
| | | .operationNumber( |
| | | col |
| | | .value, |
| | | attr |
| | | .value, |
| | | attr |
| | | .operation |
| | | ) |
| | | } |
| | | } |
| | | }) |
| | | } else if (ele2.name == 'Layout') { |
| | | ele2.setting.colList.forEach(col => { |
| | | if (col) { |
| | | if (col.fieldId == attr.attr) { |
| | | col.value = $this |
| | | .operationNumber( |
| | | col.value, |
| | | attr.value, |
| | | attr.operation |
| | | ) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | }); |
| | |
| | | } |
| | | } |
| | | if (bFindCondition) { |
| | | |
| | | rowData.attrs.forEach(attr => { |
| | | ele.form.items.forEach(ele2 => { |
| | | if (ele2.name != |
| | | 'Layout') { |
| | | if (ele2.fieldId == |
| | | attr |
| | | .attr) { |
| | | if (ele2.name != 'Layout') { |
| | | if (ele2.fieldId == attr.attr) { |
| | | ele2.value = |
| | | $this |
| | | .operationNumber( |
| | | ele2 |
| | | .value, |
| | | attr |
| | | .value, |
| | | attr |
| | | .operation |
| | | $this.operationNumber( |
| | | ele2.value, |
| | | attr.value, |
| | | attr.operation |
| | | ) |
| | | } |
| | | } else if (ele2.name == |
| | | 'Layout') { |
| | | ele2.setting |
| | | .colList |
| | | .forEach( |
| | | col => { |
| | | if ( |
| | | col) { |
| | | if (col |
| | | .fieldId == |
| | | attr |
| | | .attr |
| | | ) { |
| | | col.value = |
| | | $this |
| | | .operationNumber( |
| | | col |
| | | .value, |
| | | attr |
| | | .value, |
| | | attr |
| | | .operation |
| | | ) |
| | | } |
| | | } |
| | | }) |
| | | } else if (ele2.name == 'Layout') { |
| | | ele2.setting.colList.forEach(col => { |
| | | if (col) { |
| | | if (col.fieldId == attr.attr) { |
| | | col.value = |
| | | $this.operationNumber( |
| | | col.value, attr |
| | | .value, attr |
| | | .operation) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | }); |
| | |
| | | data.row.forEach(row => { |
| | | detailStyle = JSON.parse(styleStr); |
| | | detailStyle.form.objId = row.id; |
| | | detailStyle.form.htmlobjId = row.id ? row.id.replace(/-/g, '') |
| | | .replace( |
| | | '{', '').replace('}', |
| | | '') : 'null'; |
| | | detailStyle.form.htmlobjId = row.id ? row.id.replace(/-/g, '').replace('{', '').replace( |
| | | '}', '') : 'null'; |
| | | detailStyle.form.attrs = row.attrs; |
| | | row.attrs.forEach(attr => { |
| | | detailStyle.form.items.forEach(ele => { |
| | | if (ele.name != 'Layout') { |
| | | if (ele.fieldId == attr.attr) ele |
| | | .value = |
| | | attr.value; |
| | | if (ele.fieldId == attr.attr) |
| | | ele.value = attr.value; |
| | | } else if (ele.name == 'Layout') { |
| | | ele.setting.colList.forEach( |
| | | col => { |
| | | if (col) { |
| | | if (col.fieldId == |
| | | attr |
| | | .attr) col |
| | | .value = attr |
| | | .value; |
| | | } |
| | | }); |
| | | ele.setting.colList.forEach(col => { |
| | | if (col) { |
| | | if (col.fieldId == attr.attr) |
| | | col.value = attr.value; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | |
| | | cont.attrs.forEach(attr => { |
| | | detailStyle.form.items.forEach(ele => { |
| | | if (ele.name != 'Layout') { |
| | | if (ele.fieldId == attr.attr) ele |
| | | .value = |
| | | attr.value; |
| | | if (ele.fieldId == attr.attr) |
| | | ele.value = attr.value; |
| | | } else if (ele.name == 'Layout') { |
| | | ele.setting.colList.forEach( |
| | | col => { |
| | | if (col) { |
| | | if (col.fieldId == |
| | | attr |
| | | .attr) col |
| | | .value = attr |
| | | .value; |
| | | attr.attr) |
| | | col.value = attr.value; |
| | | } |
| | | }); |
| | | } |
| | |
| | | if (data.clear == false) { |
| | | var isflag = true; |
| | | pageData.DefList.forEach((style, index) => { |
| | | if (style.form.objId == detailStyle.form |
| | | .objId) { |
| | | if (style.form.objId == detailStyle.form.objId) { |
| | | cont.attrs.forEach(attr => { |
| | | style.form.items.forEach( |
| | | ele => { |
| | | if (ele.name != |
| | | 'Layout') { |
| | | if (ele |
| | | .fieldId == |
| | | attr.attr) |
| | | ele |
| | | .value = |
| | | attr.value; |
| | | } else if (ele |
| | | .name == |
| | | 'Layout') { |
| | | ele.setting |
| | | .colList |
| | | .forEach( |
| | | col => { |
| | | if ( |
| | | col |
| | | ) { |
| | | if (col |
| | | .fieldId == |
| | | attr |
| | | .attr |
| | | ) |
| | | col |
| | | .value = |
| | | attr |
| | | .value; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | style.form.items.forEach(ele => { |
| | | if (ele.name != 'Layout') { |
| | | if (ele.fieldId == attr.attr) |
| | | ele.value = attr.value; |
| | | } else if (ele.name == 'Layout') { |
| | | ele.setting.colList.forEach(col => { |
| | | if (col) { |
| | | if (col.fieldId == attr |
| | | .attr) |
| | | col.value = attr.value; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | isflag = false; |
| | | } |
| | |
| | | |
| | | }); |
| | | } |
| | | |
| | | $this.$set(this.pageDetail, pageIndex, pageData) |
| | | }, |
| | | setFormValues(attrs) { |
| | | const head_styledef = this.head_styledef |
| | |
| | | } else if (action.action_type == 'set_dlg_attr_show') { |
| | | var result = action.value; |
| | | result.forEach(async (attr, key) => { |
| | | $this.$data.head_styledef.form.items |
| | | .forEach( |
| | | async (ele, |
| | | index) => { |
| | | //判断是否是栅格表单 |
| | | if (ele.name != 'Layout') { |
| | | if (ele.fieldId == attr |
| | | $this.$data.head_styledef.form.items.forEach(async (ele, |
| | | index) => { |
| | | //判断是否是栅格表单 |
| | | if (ele.name != 'Layout') { |
| | | if (ele.fieldId == attr.attr) { |
| | | ele.show = attr.show; |
| | | } |
| | | } else if (ele.name == 'Layout') { |
| | | ele.setting.colList.forEach((col) => { |
| | | if (col) { |
| | | if (col.fieldId == attr |
| | | .attr) { |
| | | ele.show = attr |
| | | col.show = attr |
| | | .show; |
| | | } |
| | | } else if (ele.name == |
| | | 'Layout') { |
| | | ele.setting.colList |
| | | .forEach( |
| | | col => { |
| | | if (col) { |
| | | if (col |
| | | .fieldId == |
| | | attr |
| | | .attr |
| | | ) { |
| | | col.show = |
| | | attr |
| | | .show; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | var head_styledef = JSON.parse(JSON.stringify($this.$data |
| | | .head_styledef)); |
| | |
| | | console.log($this.head_styledef); |
| | | if (data.result) { |
| | | var result = data.result; |
| | | for (var i = 0; i < result.length; i++) { |
| | | for (var c = 0; c < $this.$data.head_styledef.form.items |
| | | .length; c++) { |
| | | var attr = $this.$data.head_styledef.form.items[c]; |
| | | //判断表单里是否有返回字段,没有就装载到model里,点击确定提交的时候带上这些数据 |
| | | if ($this.head_styledef.form.model[result[i].attr] == |
| | | undefined) { |
| | | $this.head_styledef.form.model[result[i].attr] = |
| | | result[i] |
| | | .value; |
| | | } |
| | | //判断是否是栅格表单 |
| | | if (attr.name != 'Layout') { |
| | | if (attr.fieldId == result[i].attr) { |
| | | attr.value = ''; |
| | | attr.oldvalue = ''; |
| | | attr.value = result[i].value; |
| | | attr.oldvalue = result[i].value; |
| | | $this.head_styledef.form.model[attr.fieldId] = |
| | | result[i] |
| | | .value; |
| | | } |
| | | } else if (attr.name == 'Layout') { |
| | | attr.setting.colList.forEach(col => { |
| | | if (col) { |
| | | if (col.fieldId == result[i].attr) { |
| | | col.value = ''; |
| | | col.oldvalue = ''; |
| | | col.value = result[i].value; |
| | | col.oldvalue = result[i].value; |
| | | $this.head_styledef.form.model[col |
| | | .fieldId] = |
| | | result[i].value; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | var length = 0; |
| | | if (!$this.$data.refdatastore.filter(function(s) { |
| | | return result[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | $this.$data.refdatastore.push(result[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < $this.$data.refdatastore.length; j++) { |
| | | if ($this.$data.refdatastore[j].attr == result[i] |
| | | .attr) { |
| | | $this.$data.refdatastore[j].value = result[i] |
| | | .value; |
| | | } |
| | | } |
| | | } |
| | | $this.setFormValues(result) |
| | | } |
| | | } |
| | | } |
| | | |
| | | }).catch(ex => { |
| | |
| | | attr: a, |
| | | value: obj_attr[a] || "", |
| | | })); |
| | | if ($this.refdatastore.length > 0) { |
| | | for (var i = 0; i < $this.refdatastore.length; i++) { |
| | | if (!req.filter(function(s) { |
| | | return $this.refdatastore[i].attr == s.name |
| | | }).length) { |
| | | req.push({ |
| | | 'attr': $this.refdatastore[i].attr, |
| | | 'value': $this.refdatastore[i].value |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | var extinfo = enviroment; |
| | | extinfo.edit_dlg = { |
| | |
| | | } |
| | | }) |
| | | $this.$set($this.pageDetail, pageIndex, pageData) |
| | | console.log($this.pageDetail) |
| | | |
| | | }, |
| | | } |
| | |
| | | // uni.showModal({title:this.translateSys("tip"),content:JSON.stringify(result.action),showCancel:false,confirmText:this.translateSys("cancel")}); |
| | | |
| | | result.action.forEach(item => { |
| | | if (item.action_type == |
| | | "insert_subtable_page_row" |
| | | ) { //码盘中 |
| | | if (item.action_type == "insert_subtable_page_row") { //码盘中 |
| | | var value = item.value; |
| | | //加载已经码盘数据 |
| | | $this.viewAceionRow(value); |
| | |
| | | |
| | | } else if (item.action_type == "clear_subpage_rows") { |
| | | var value = item.value; |
| | | const pageData = $this.pageDetail.find((page) => { |
| | | const pageIndex = $this.pageDetail.findIndex((page) => { |
| | | return value.page_name == page.Name; |
| | | }); |
| | | if (pageData) { |
| | | if (pageIndex > -1) { |
| | | const pageData = $this.pageDetail[pageIndex] |
| | | pageData.DefList = [] |
| | | pageData.ExtData = {} |
| | | |
| | | $this.$set(this.pageDetail, pageIndex, pageData) |
| | | } |
| | | } else if (item.action_type == "set_dlg_current_edit_attr") { |
| | | if ($this.focusOldFieldId == item.value) |
| | |
| | | padding: 0px; |
| | | margin: 0; |
| | | |
| | | .dv-panel-form-item { |
| | | margin: 0; |
| | | padding: 0px; |
| | | } |
| | | |
| | | .uni-forms-item { |
| | | padding-bottom: 5rpx; |
| | |
| | | vertical-align: middle; |
| | | } |
| | | |
| | | .form-item-span { |
| | | vertical-align: text-top; |
| | | color: #2d8cf0; |
| | | white-space: normal; |
| | | word-break: break-all; |
| | | width: 100%; |
| | | .uni-input:hover { |
| | | border: 1px solid rgb(41, 121, 255); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | background-color: #f3f3f3 !important; |
| | | } |
| | | |
| | | ::v-deep .uni-row { |
| | | margin-bottom: 0px; |
| | | } |
| | | // ::v-deep .uni-row { |
| | | // margin-bottom: 0px; |
| | | // } |
| | | |
| | | .view-tabpage ::v-deep .uni-row { |
| | | margin-bottom: 5px; |
| | | } |
| | | // .view-tabpage ::v-deep .uni-row { |
| | | // margin-bottom: 5px; |
| | | // } |
| | | |
| | | .demo-uni-col { |
| | | height: 36px; |