| | |
| | | :placeholder="item.placeholder" |
| | | :style="{'width':item.setting.prefix && item.setting.suffix?'78%':item.setting.prefix || item.setting.suffix?'87%':'96%'}" |
| | | :focus="focusFieldId == item.fieldId" @focus="ontap(index,item)" @click="onClick(item)" |
| | | @keyup.enter="onEnterChange(item)" @blur="onEnterChange(item)" :maxlength="-1"/> |
| | | @keyup.enter="onEnterChange(item)" @blur="onEnterChange(item)" :maxlength="-1" /> |
| | | <text v-if="item.setting.suffix" class="uni-icon" :class="[item.setting.suffix]" |
| | | @click="classAttr_extButton(item)"></text> |
| | | </view> |
| | |
| | | <input class="uni-input" v-if="!item.disabled" |
| | | :type="item.name=='InputNumber'?'number':'text'" |
| | | v-model="item.value" :disabled="item.disabled" |
| | | :placeholder="item.placeholder" :maxlength="-1"/> |
| | | :placeholder="item.placeholder" :maxlength="-1" /> |
| | | </view> |
| | | <!-- 栅格布局 --> |
| | | <uni-row class="demo-uni-row" v-if="item.name=='Layout'"> |
| | |
| | | <input class="uni-input" v-if="!cols.disabled" |
| | | :type="cols.name=='InputNumber'?'number':'text'" |
| | | v-model="cols.value" :disabled="cols.disabled" |
| | | :placeholder="cols.placeholder" :maxlength="-1"/> |
| | | :placeholder="cols.placeholder" :maxlength="-1" /> |
| | | </view> |
| | | </uni-col> |
| | | </uni-row> |
| | |
| | | </div> |
| | | </view> |
| | | </view> |
| | | <view> |
| | | <view> |
| | | <uni-popup class="view-popup" ref="popup" background-color="#fff" @change="popupChange"> |
| | | <view class="popup-header">{{check_list.title}}</view> |
| | | <view class="popup-content" :class="{ 'popup-height': popupType === 'left' || popupType === 'right' }" |
| | |
| | | selectAttrObj: {}, |
| | | okLoading: false, |
| | | ok2Loading: false, |
| | | |
| | | |
| | | |
| | | |
| | | global_attr: [], |
| | | refdatastore: [], //引用数据存储区// {attr:'G_PRJ_' + bindattr + '_ID', value:info.id} |
| | | popupType: "center", |
| | |
| | | $this.$data.head_styledef.form.items.forEach(async (ele, index) => { |
| | | if (ele.useDict == true) { //判断useDict是否使用字典 |
| | | await this.DictGetInfo(ele.bind.dict, index, 'mast'); |
| | | } else { |
| | | if (ele?.name === "Select") { |
| | | const selections = ele?.selections || [] |
| | | //有默认值,显示默认值 |
| | | let itemName = ele.value || ""; |
| | | if (itemName) { |
| | | $this.head_styledef.form |
| | | .model[ele.fieldId] = itemName; |
| | | } |
| | | $this.head_styledef.form.items[index].dict = selections.map((a) => { |
| | | return { |
| | | value: a.value, |
| | | text: a.label |
| | | } |
| | | }) |
| | | } |
| | | |
| | | } |
| | | if ($this.focusFieldId == "") { |
| | | if (ele.name == 'Input' || ele.name == 'InputNumber') { |
| | |
| | | $this.detail1_styledef.form.items.forEach(async (ele, index) => { |
| | | if (ele.useDict == true) { //判断useDict是否使用字典 |
| | | await this.DictGetInfo(ele.bind.dict, index, 'sub'); |
| | | } else { |
| | | if (ele?.name === "Select") { |
| | | const selections = ele?.selections || [] |
| | | //有默认值,显示默认值 |
| | | let itemName = ele.value || ""; |
| | | if (itemName) { |
| | | $this.detail1_styledef.form |
| | | .model[ele.fieldId] = itemName; |
| | | } |
| | | $this.detail1_styledef.form.items[index].dict = selections.map((a) => { |
| | | return { |
| | | value: a.value, |
| | | text: a.label |
| | | } |
| | | }) |
| | | } |
| | | |
| | | } |
| | | }); |
| | | } |
| | |
| | | var itemName = ''; |
| | | (result.dict_item_list || []).forEach((item) => { |
| | | if (item.is_default == '1') |
| | | itemName = item.name |
| | | itemName = item.name |
| | | list.push({ |
| | | text: item.value ? item.value : item.name, |
| | | value: item.name, |
| | |
| | | item.value = result.decodedata; |
| | | // uni.hideKeyboard(); |
| | | var $this = this; |
| | | |
| | | // if(item.value=='B61DF51DD50645CEB9D152DD77D2466A'){ |
| | | // this.active_id = 'B61DF51DD50645CEB9D152DD77D2466A'; |
| | | // // var target = uni.createSelectorQuery().select('#B61DF51DD50645CEB9D152DD77D2466A'); |
| | | // uni.createSelectorQuery() |
| | | // .select("#tabpanel")//对应外层节点 |
| | | // .boundingClientRect((container) => { |
| | | // uni.createSelectorQuery() |
| | | // .select("#B61DF51DD50645CEB9D152DD77D2466A")//目标节点 |
| | | // .boundingClientRect((target) => { |
| | | // uni.pageScrollTo({ |
| | | // scrollTop: target.top - container.top,//滚动到实际距离是元素距离顶部的距离减去最外层盒子的滚动距离 |
| | | // }); |
| | | // }) |
| | | // .exec(); |
| | | // }) |
| | | // .exec(); |
| | | // } |
| | | //console.log(item); |
| | | if (item.oldvalue != item.value && item.value.trim() != "") { |
| | | item.oldvalue = item.value; |
| | | var attr = item.fieldId; |
| | |
| | | if (onChangeEvent.id) { //内容变化后事件 |
| | | this.onChange(onChangeEvent); |
| | | } |
| | | |
| | | |
| | | } |
| | | }, |
| | | classAttr_extButton(item) { |
| | | var onSuffixClickCallbackEvent = item.bind.onSuffixClickCallbackEvent; //后图标点击事件 |
| | | var onSuffixClickEvent = item.bind.onSuffixClickEvent; //后图标点击回调 |
| | | |
| | | |
| | | if (!onSuffixClickCallbackEvent.id) { |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | |
| | | this.$data.popupType = 'right' |
| | | // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
| | | this.$refs.popup.open(this.popupType); |
| | | |
| | | |
| | | this.dataObjRunCustomEvent_Return(onSuffixClickCallbackEvent.id, '', onSuffixClickEvent.id, |
| | | item); |
| | | }, |
| | | |
| | | |
| | | getDetailAttrList(list, selectButton) { |
| | | const detailAttrList = []; |
| | | list.forEach(style => { |
| | |
| | | number1 = parseInt(value1) |
| | | if (value2) |
| | | number2 = parseInt(value2) |
| | | if (!operation) { |
| | | return value2; |
| | | } |
| | | if (operation == "+") { |
| | | return number1 + number2 |
| | | } else if (operation == "-") { |
| | |
| | | } else if (operation == "*") { |
| | | return number1 * number2 |
| | | } else if (operation == "/") { |
| | | if (number2) |
| | | return number1 / number2 |
| | | else |
| | | return number1 |
| | | } else return number2 |
| | | if (number2) return number1 / number2; |
| | | else { |
| | | throw new Error(`${this.translate("illegal_dividend")}'${value2}'`); |
| | | return 0; |
| | | } |
| | | } else if (operation == "=") { |
| | | return value2; |
| | | } else { |
| | | throw new Error(`${this.translate("unrecognized_operator")}'${operation}'`); |
| | | return 0; |
| | | } |
| | | }, |
| | | |
| | | //更新分页签中的列表项内容 |
| | |
| | | } |
| | | detailStyleDefList.forEach(ele => { |
| | | value.row.forEach((rowData) => { |
| | | 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) |
| | | } |
| | | } 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 (rowData.id) { |
| | | 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) |
| | | } |
| | | }) |
| | | } |
| | | } 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 (rowData.condition) { |
| | | const conditions = rowData.condition; |
| | | let bFindCondition = true; |
| | | for (let i in conditions) { |
| | | const condition = conditions[i]; |
| | | let bFind = false; |
| | | for (let i2 in ele.form.items) { |
| | | const ele2 = ele.form.items[i2]; |
| | | if (ele2.name != "Layout") { |
| | | if (ele2.fieldId == condition.attr) { |
| | | if (condition.value == ele2.value) { |
| | | bFind = true; |
| | | } |
| | | break; |
| | | } |
| | | } else { |
| | | const colList = ele2.setting.colList || []; |
| | | for (let i3 in colList) { |
| | | const col = colList[i3]; |
| | | if (col.fieldId == condition.attr) { |
| | | if (condition.value == col.value) { |
| | | bFind = true; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | if (bFind) break; |
| | | } |
| | | } |
| | | if (!bFind) { |
| | | bFindCondition = false; |
| | | break; |
| | | } |
| | | } |
| | | if (bFindCondition) { |
| | | 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) |
| | | } |
| | | } 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 (value.page_name == $this.$data.param.Sub_Page[1].Name) { |
| | |
| | | } |
| | | data[index].check = ischeck ? false : true; |
| | | this.$data.check_list.items = data; |
| | | |
| | | |
| | | }, |
| | | popup_cancel(e) { //弹框取消 |
| | | this.$refs.popup.close(); |
| | |
| | | $this.DataObjRunCustomEvent(info, $this.$data.popupParam.data_attr); |
| | | this.$refs.popup.close(); |
| | | }, |
| | | |
| | | |
| | | async DataObjRunCustomEvent(info, data_attr) { |
| | | var $this = this; |
| | | var enviroment = { |
| | |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | }); |
| | | |
| | | |
| | | var actionlist = data.action; |
| | | if (actionlist) { |
| | | console.log(actionlist); |
| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | var length = 0; |
| | | if (!$this.$data.refdatastore.filter(function(s) { |
| | | return result[i].attr == s.attr |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | let exStr = JSON.stringify(ex) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | var extinfo = enviroment; |
| | | extinfo.edit_dlg = { |
| | | type: 'small', //小窗口 |
| | |
| | | })) |
| | | ) |
| | | ); |
| | | |
| | | |
| | | if (!eventid.includes('{')) eventid = '{' + eventid + '}'; |
| | | var dataInfo = { |
| | | ed_type: "0", |
| | |
| | | showCancel: false, |
| | | confirmText: $this.translateSys("cancel") |
| | | }); |
| | | |
| | | |
| | | if (data != "") { |
| | | var actions = data.action; |
| | | if (actions) { |
| | |
| | | console.log(action) |
| | | var val = action.value; |
| | | var enviroment = JSON.stringify(enviroment); |
| | | |
| | | |
| | | if (action.action_type == 'open_panel') { |
| | | var d = dialog({ |
| | | title: '<i class="ace-icon fa fa-info-circle"></i> ' + |
| | |
| | | }); |
| | | d.show(); |
| | | } else if (action.action_type == 'open_common_dlg') { |
| | | |
| | | |
| | | if (val.common_dlg_id == 'check_list') { |
| | | $this.setData({ |
| | | check_list: val.config |
| | |
| | | attr] = |
| | | data[0].ID + |
| | | ';' + data[0].Name; |
| | | |
| | | |
| | | // $this.$data.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; |
| | | // $this.$data.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; |
| | | var callback_eventid = param |
| | |
| | | attr: param.req, |
| | | dataJson: [], |
| | | } |
| | | |
| | | |
| | | $this.DataObjRunCustomEvent( |
| | | info); |
| | | } |
| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | let exStr = JSON.stringify(ex) |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | | //确定 |
| | | ok() { |
| | | this.Before_OK_Event = this.param.Sub_Page[0].Before_ok; |
| | |
| | | .demo-uni-row .uni-input { |
| | | width: calc(100% - 120px); |
| | | } |
| | | |
| | | .popup-header { |
| | | font-size: 42rpx; |
| | | font-weight: bold; |
| | | margin: 20rpx 20rpx 0px 20rpx; |
| | | } |
| | | |
| | | |
| | | .view_popup_CheckList { |
| | | margin-bottom: 20rpx; |
| | | } |
| | | |
| | | |
| | | .popup-footer { |
| | | float: right; |
| | | position: absolute; |
| | | bottom: 0; |
| | | right: 20rpx; |
| | | } |
| | | |
| | | |
| | | button.btn_popup_add { |
| | | width: 180rpx; |
| | | margin-top: 50rpx; |
| | |
| | | /* float: left; */ |
| | | display: inline-block; |
| | | } |
| | | |
| | | |
| | | button.btn_popup_cancel { |
| | | width: 180rpx; |
| | | margin-top: 50rpx; |
| | |
| | | /* float: right; */ |
| | | display: inline-block; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | </style> |