| | |
| | | <uni-forms-item v-if="item.name != 'Layout'&& item.show==true" :label="item.label +':' " |
| | | :label-width="item.labelWidth+'px'"> |
| | | <!-- <text class="txt_title" :style="{'width':item.labelWidth+'px'}">{{item.label}}:</text> --> |
| | | <span class="form-item-span" v-if="item.disabled" |
| | | :style="'width: calc(100% - '+item.labelWidth+'px);'">{{item.value}}</span> |
| | | <!-- 下拉框-单选 item.useDict?item.dict:item.selections--> |
| | | <uni-data-select id="dv_select" v-if="item.name=='Select' && !item.disabled" |
| | | <uni-data-select id="dv_select" v-if="item.name=='Select'" |
| | | :style="'width: calc(100% - '+item.labelWidth-10+'px);'" |
| | | :class="item.disabled?'input-disabled':''" v-model="item.value" :localdata="item.dict" |
| | | @change="onchange(item)" :disabled="item.disabled" :clear="false"></uni-data-select> |
| | | <!-- 文本框/数字框 --> |
| | | <view class="input-wrapper" |
| | | v-if="(item.name=='Input' || item.name=='InputNumber') && !item.disabled"> |
| | | v-if="(item.name=='Input' || item.name=='InputNumber')"> |
| | | <text v-if="item.setting.prefix" class="uni-icon" :class="[item.setting.prefix]" |
| | | @change="classAttr_extButton(item)"></text> |
| | | <input class="uni-input" :class="item.disabled?'input-disabled':''" |
| | |
| | | @click="classAttr_extButton(item)"></text> |
| | | </view> |
| | | <!-- 多行文本 --> |
| | | <view class="input-wrapper" v-if="item.name=='Textarea' && !item.disabled"> |
| | | <view class="input-wrapper" v-if="item.name=='Textarea' "> |
| | | <textarea class="uni-input" :class="item.disabled?'input-disabled':''" :value="item.value" |
| | | :focus="focusFieldId == item.fieldId" :placeholder="item.placeholder" |
| | | @blur="onModelValue(item)" @click="onClick(item)" :data-index="index" |
| | |
| | | <text>{{item.label}}</text> |
| | | </label> |
| | | </checkbox-group> |
| | | <!-- 单选框 --> |
| | | <radio-group class="check_rememberPwd" v-if="item.name=='Radio'" |
| | | :class="item.disabled?'input-disabled':''" :disabled="item.disabled" |
| | | @change="onModelValue(item)"> |
| | | <label v-for="(item2) in item.selections" :key="item2.value"> |
| | | <radio :value="item2.value" :checked="item2.value === item.value" /> |
| | | <text>{{item2.label}}</text> |
| | | </label> |
| | | </radio-group> |
| | | <!-- Switch开关 --> |
| | | <switch class="input-switch" v-if="item.name=='Switch'" |
| | | :class="item.disabled?'input-disabled':''" :disabled="item.disabled" v-model="item.value" |
| | | @change="onModelValue(item)" /> |
| | | <!-- 日期时间 --> |
| | | <view class="input-wrapper" |
| | | v-if="(item.name=='TimePicker' || item.name=='DatePicker') && !item.disabled"> |
| | | v-if="(item.name=='TimePicker' || item.name=='DatePicker')"> |
| | | <picker mode="date" class="date_iput" :class="item.disabled?'input-disabled':''" |
| | | :disabled="item.disabled" :value="item.value" @change="onModelValue(item)"> |
| | | <view class="picker">{{item.value}}</view> |
| | |
| | | :span="item.setting.spanList?item.setting.spanList[key]:24 / item.setting.col"> |
| | | <uni-forms-item v-if="cols!=null && cols.show==true" :label="cols.label +':'" |
| | | :label-width="cols.labelWidth+'px'"> |
| | | <!-- <text class="txt_title" :style="{'width':cols.labelWidth+'px'}">{{cols.label}}:</text> --> |
| | | <span class="form-item-span" v-if="cols.disabled">{{cols.value}}</span> |
| | | <view class="input-wrapper" |
| | | v-if="(cols.name=='Input' || cols.name=='InputNumber') && !cols.disabled"> |
| | | v-if="(cols.name=='Input' || cols.name=='InputNumber') "> |
| | | <text v-if="cols.setting.prefix" class="uni-icon" :class="[cols.setting.prefix]" |
| | | @change="onchange(cols)"></text> |
| | | <input class="uni-input" :class="cols.disabled?'input-disabled':''" |
| | |
| | | @click="onchange(cols)"></text> |
| | | </view> |
| | | <!-- 下拉框-单选 cols.useDict?cols.dict:cols.selections--> |
| | | <uni-data-select id="dv_select" v-if="cols.name=='Select' && !cols.disabled" |
| | | <uni-data-select id="dv_select" v-if="cols.name=='Select' " |
| | | :class="cols.disabled?'input-disabled':''" v-model="cols.value" |
| | | :localdata="cols.dict" @change="onchange(cols)" :disabled="cols.disabled" |
| | | :clear="false"></uni-data-select> |
| | | <!-- 多行文本 --> |
| | | <view class="input-wrapper" v-if="cols.name=='Textarea' && !cols.disabled"> |
| | | <view class="input-wrapper" v-if="cols.name=='Textarea' "> |
| | | <textarea class="uni-input" :value="cols.value" |
| | | :class="cols.disabled?'input-disabled':''" :placeholder="cols.placeholder" |
| | | :focus="focusFieldId == cols.fieldId" @blur="onModelValue(cols)" |
| | |
| | | </view> |
| | | <!-- 复选框 --> |
| | | <checkbox-group class="check_rememberPwd" v-if="cols.name=='Checkbox'" |
| | | :class="cols.disabled?'input-disabled':''" :disabled="item.disabled" |
| | | :class="cols.disabled?'input-disabled':''" :disabled="cols.disabled" |
| | | @change="onModelValue(cols)" :data-ischeck="cols.value" |
| | | :style="{'margin-left':'10rpx'}"> |
| | | <label> |
| | |
| | | <text>{{cols.label}}</text> |
| | | </label> |
| | | </checkbox-group> |
| | | <!-- 单选框 --> |
| | | <radio-group class="check_rememberPwd" v-if="cols.name=='Radio'" |
| | | :class="cols.disabled?'input-disabled':''" :disabled="cols.disabled" |
| | | @change="onModelValue(cols)"> |
| | | <label v-for="(cols2) in cols.selections" :key="cols2.value"> |
| | | <radio :value="cols2.value" :checked="cols2.value === cols.value" /> |
| | | <text>{{cols2.label}}</text> |
| | | </label> |
| | | </radio-group> |
| | | <!-- Switch开关 --> |
| | | <switch v-if="cols.name=='Switch'" :class="cols.disabled?'input-disabled':''" |
| | | :disabled="item.disabled" v-model="cols.value" @change="onModelValue(cols)" |
| | | :disabled="cols.disabled" v-model="cols.value" @change="onModelValue(cols)" |
| | | :style="{'margin-left':'10rpx'}" /> |
| | | <!-- 日期时间 --> |
| | | <view class="input-wrapper" |
| | | v-if="(cols.name=='TimePicker' || cols.name=='DatePicker') && !cols.disabled"> |
| | | <picker mode="date" class="date_iput" :class="cols.disabled?'input-disabled':''" |
| | | :disabled="item.disabled" :value="cols.value" @change="onModelValue(cols)"> |
| | | :disabled="cols.disabled" :value="cols.value" @change="onModelValue(cols)"> |
| | | <view class="picker">{{cols.value}}</view> |
| | | </picker> |
| | | </view> |
| | |
| | | </a> |
| | | </view> |
| | | </view> |
| | | <button type="default" @tap="sava" class="btn_add" v-if="dropdownBtns.length==0" |
| | | :class="saving?'btn_disabled':''" :disabled="saving">{{title}}</button> |
| | | <button type="default" @tap="cancel" class="btn_cancel">{{translateSys('cancel')}}</button> |
| | | <button type="default" @tap="sava" class="btn_add" v-if="dropdownBtns.length==0 && btnName != ''" |
| | | :class="saving?'btn_disabled':''" :disabled="saving">{{btnName}}</button> |
| | | <button type="default" @tap="cancel" :class="(dropdownBtns.length> 0 || btnName != '')?'btn_cancel':'btn_cancel2'">{{translateSys('cancel')}}</button> |
| | | |
| | | </view> |
| | | <!-- 普通弹窗 top bottom center left right --> |
| | |
| | | data() { |
| | | return { |
| | | title: this.translateSys('add2'), |
| | | btnName: "", |
| | | param: {}, |
| | | edit_inital_event: "", //弹窗初始化事件ID |
| | | edit_ok_event: "", //弹窗点击OK 触发事件ID |
| | |
| | | this.$data.param = JSON.parse(options.param); |
| | | this.$data.title = this.$data.param.Add_BtnName ? this.$data.param.Add_BtnName : options |
| | | .titlename; //设置按钮文字 |
| | | this.$data.btnName = this.$data.param.Add_BtnName || "" |
| | | this.loadData(options.paramValue) |
| | | }, |
| | | computed: { |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | |
| | | |
| | | setData: function(obj) { |
| | | let that = this; |
| | | let keys = []; |
| | |
| | | var itemName = ''; |
| | | (res.dict_item_list || []).forEach((item) => { |
| | | if (item.is_default == '1') |
| | | itemName = item.name; |
| | | itemName =item.value ? item.value : item.name |
| | | list.push({ |
| | | text: item.value, |
| | | value: item.name, |
| | | text: item.value ? item.value : item.name, |
| | | value: item.id, |
| | | }); |
| | | }); |
| | | }); |
| | | //有默认值,显示默认值 |
| | | if (itemName) { |
| | | formItem.value = itemName; |
| | |
| | | // console.log(obj_attr); |
| | | var req = Object.keys(obj_attr).map((a) => ({ |
| | | attr: a, |
| | | val: obj_attr[a] || "", |
| | | value: obj_attr[a] || "", |
| | | })); |
| | | |
| | | var info = { |
| | |
| | | // console.log(obj_attr); |
| | | var req = Object.keys(obj_attr).map((a) => ({ |
| | | attr: a, |
| | | val: obj_attr[a] || "", |
| | | value: obj_attr[a] || "", |
| | | })); |
| | | var info = { |
| | | eventid: eventid, |
| | |
| | | // console.log(obj_attr); |
| | | var req = Object.keys(obj_attr).map((a) => ({ |
| | | attr: a, |
| | | val: obj_attr[a] || "", |
| | | value: obj_attr[a] || "", |
| | | })); |
| | | var info = { |
| | | eventid: eventid, |
| | |
| | | if (!onSuffixClickCallbackEvent.id) { |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: this.translate('icon_click_event_empty'), |
| | | content: this.translate('icon_click_callback_empty'), |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | }); |
| | |
| | | } |
| | | this.$data.popupType = 'right' |
| | | // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
| | | this.$refs.popup.open($this.popupType); |
| | | this.$refs.popup.open(this.popupType); |
| | | |
| | | this.DataObjRunCustomEvent_Return(onSuffixClickCallbackEvent.id, '', onSuffixClickEvent.id, |
| | | this.dataObjRunCustomEvent_Return(onSuffixClickCallbackEvent.id, '', onSuffixClickEvent.id, |
| | | item); |
| | | }, |
| | | popupChange(e) { |
| | |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | var fieldId = $this.$data.popupParam.item.fieldId; |
| | | $this.head_styledef.form.model[attr] = name; |
| | | for (var c = 0; c < $this.$data.head_styledef.form.items.length; c++) { |
| | | var attr = $this.$data.head_styledef.form.items[c]; |
| | | if (attr.fieldId == fieldId) { |
| | | attr.value = name; |
| | | } |
| | | if (data.length == 0) { |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content:this.translate("tip_no_select_data"), |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | }); |
| | | return; |
| | | } |
| | | console.log(data); |
| | | // var fieldId = $this.$data.popupParam.item.fieldId; |
| | | // $this.head_styledef.form.model[fieldId] = name; |
| | | // console.log(fieldId,$this.$data.popupParam.item); |
| | | // for (var c = 0; c < $this.$data.head_styledef.form.items.length; c++) { |
| | | // var attr = $this.$data.head_styledef.form.items[c]; |
| | | // if (attr.fieldId == fieldId) { |
| | | // attr.value = name; |
| | | // } |
| | | // } |
| | | // console.log(data); |
| | | // console.log($this.head_styledef.form); |
| | | var callback_eventid = $this.$data.popupParam.button_callback.trim(); |
| | | var info = { |
| | | eventid: callback_eventid, |
| | |
| | | info.dataJson = Base64.encode(JSON.stringify(info.dataJson)); //将字符串转换为base64编码 |
| | | var obj_attr = {}; |
| | | info.attr.forEach(item => { |
| | | obj_attr[item.attr] = item.val; |
| | | obj_attr[item.attr] = item.value; |
| | | }); |
| | | if (!info.eventid.includes('{')) info.eventid = '{' + info.eventid + '}'; |
| | | var dataInfo = { |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | DataObjRunCustomEvent_Return(eventid, data_attr, button_callback, item) { |
| | | dataObjRunCustomEvent_Return(eventid, data_attr, button_callback, item) { |
| | | const $this = this |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: this.$data.param.DataCls.id, // 功能点主数据类标识 |
| | | cls_id: $this.param.DataCls.id, // 功能点主数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: this.translateSys('add2'), |
| | | button_name: $this.translateSys('add2'), |
| | | master: { |
| | | cls_id: this.$data.param.DataCls.id, // button=bottom时 master的cls_id |
| | | cls_id: $this.param.DataCls.id, // button=bottom时 master的cls_id |
| | | //obj_id: '' // button=bottom时 master的obj_id |
| | | } |
| | | }; |
| | | var obj_attr = this.head_styledef.form.model; |
| | | // console.log(obj_attr); |
| | | var obj_attr = $this.head_styledef.form.model; |
| | | console.log(obj_attr); |
| | | var req = Object.keys(obj_attr).map((a) => ({ |
| | | attr: a, |
| | | val: obj_attr[a] || "", |
| | | value: obj_attr[a] || "", |
| | | })); |
| | | if (this.$data.refdatastore.length > 0) { |
| | | for (var i = 0; i < this.$data.refdatastore.length; i++) { |
| | | if ($this.refdatastore.length > 0) { |
| | | for (var i = 0; i < $this.refdatastore.length; i++) { |
| | | if (!req.filter(function(s) { |
| | | return this.$data.refdatastore[i].attr == s.name |
| | | return $this.refdatastore[i].attr == s.name |
| | | }).length) { |
| | | length = 1; |
| | | req.push({ |
| | | 'attr': this.$data.refdatastore[i].attr, |
| | | 'val': this.$data.refdatastore[i].value |
| | | 'attr': $this.refdatastore[i].attr, |
| | | 'value': $this.refdatastore[i].value |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | var extinfo = enviroment; |
| | | extinfo.edit_dlg = { |
| | | type: 'small', //小窗口 |
| | | class_id: this.$data.param.DataCls.id, //当前数据类id |
| | | class_id: $this.param.DataCls.id, //当前数据类id |
| | | } |
| | | extinfo = Base64.encode(JSON.stringify(extinfo)); //将字符串转换为base64编码 |
| | | var global_attr = Base64.encode(JSON.stringify(this.$data.global_attr)); //将字符串转换为base64编码 |
| | | var global_attr = Base64.encode(JSON.stringify($this.global_attr)); //将字符串转换为base64编码 |
| | | var obj_attr = {}; |
| | | req.forEach(item => { |
| | | obj_attr[item.attr] = item.val; |
| | | req.forEach(item2 => { |
| | | obj_attr[item2.attr] = item2.value; |
| | | }); |
| | | let input_param = Base64.encode( |
| | | JSON.stringify( |
| | | Object.keys(obj_attr).map((a) => ({ |
| | | attr: a, |
| | | value: obj_attr[a] || "", |
| | | })) |
| | | ) |
| | | ); |
| | | |
| | | if (!eventid.includes('{')) eventid = '{' + eventid + '}'; |
| | | var dataInfo = { |
| | | ed_type: "0", |
| | | start_transaction: true, |
| | | class_id: this.$data.param.DataCls.id, |
| | | class_id: $this.param.DataCls.id, |
| | | class_name: '', |
| | | event_id: eventid, |
| | | event_name: '', |
| | |
| | | ref_cls_id: '', |
| | | rel_obj_id: '', |
| | | user_login: '', |
| | | data_json: '', |
| | | data_json: [], |
| | | compose_info: '', |
| | | ext_info: extinfo, |
| | | global_attr: global_attr, |
| | | input_param: '', |
| | | input_param:input_param, |
| | | }; |
| | | console.log(dataInfo); |
| | | // return; |
| | |
| | | data |
| | | .err_info.join('<br/>') : ''; |
| | | if (data.ret == 801) { |
| | | if (this.param.Only_Script_Error) { |
| | | if ($this.param.Only_Script_Error) { |
| | | let pos = tip.indexOf(":"); |
| | | if (pos > -1) tip = tip.substring(pos + 1); |
| | | } |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | title: $this.translateSys("tip"), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | confirmText: $this.translateSys("cancel") |
| | | }); |
| | | } else uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: tip + ',' + this.translateSys('tip') + ':' + data |
| | | title: $this.translateSys("tip"), |
| | | content: tip + ',' + $this.translateSys('tip') + ':' + data |
| | | .ret, |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | confirmText: $this.translateSys("cancel") |
| | | }); |
| | | return false |
| | | } else { |
| | |
| | | .join( |
| | | '<br/>') : ''; |
| | | if (tip) uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | title: $this.translateSys("tip"), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | confirmText: $this.translateSys("cancel") |
| | | }); |
| | | |
| | | if (data != "") { |
| | | var actions = data.action; |
| | | console.log(actions); |
| | | if (actions) { |
| | | for (var i = 0; i < actions.length; i++) { |
| | | var action = actions[i]; |
| | | 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> ' + |
| | | this.translateSys("tip"), |
| | | content: this.translateSys( |
| | | $this.translateSys("tip"), |
| | | content: $this.translateSys( |
| | | "quotation_mark_left") + |
| | | action |
| | | .action_type + this.translateSys( |
| | | "quotation_mark_right") + this |
| | | .action_type + $this.translateSys( |
| | | "quotation_mark_right") + $this |
| | | .translate( |
| | | "tip_action_unprocessed") |
| | | }); |
| | |
| | | } else if (action.action_type == 'open_select_userdlg') { |
| | | var style = val.style; |
| | | // style == 'user' ? '选择人员' : style == 'department' ? '选择部门' : style == 'role' ? '选择角色' : '' |
| | | var $this = this; |
| | | var param = { |
| | | item: item, |
| | | button_callback: button_callback, |
| | |
| | | } else if (action.action_type == 'open_data_query_dlg') { |
| | | var d = dialog({ |
| | | title: '<i class="ace-icon fa fa-info-circle"></i> ' + |
| | | this.translateSys("tip"), |
| | | content: this.translateSys( |
| | | $this.translateSys("tip"), |
| | | content: $this.translateSys( |
| | | "quotation_mark_left") + |
| | | action |
| | | .action_type + this.translateSys( |
| | | "quotation_mark_right") + this |
| | | .action_type + $this.translateSys( |
| | | "quotation_mark_right") + $this |
| | | .translate( |
| | | "tip_action_unprocessed") |
| | | }); |
| | | d.show(); |
| | | } else if (action.action_type == 'open_common_dlg') { |
| | | var $this = this; |
| | | |
| | | if (val.common_dlg_id == 'check_list') { |
| | | $this.$data.check_list = val.config; |
| | | $this.setData({check_list:val.config}) |
| | | if (val.config.appear_style == 'sideslip') //判断是否是侧滑 |
| | | $this.$data.popupType = 'right'; |
| | | $this.setData({popupType:"right"}) |
| | | else |
| | | $this.$data.popupType = 'center' |
| | | $this.setData({popupType:"center"}) |
| | | // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
| | | $this.$refs.popup.open($this.$data.popupType); |
| | | $this.$refs.popup.open($this.popupType); |
| | | var popupParam = { |
| | | item: item, |
| | | button_callback: button_callback, |
| | | req: req, |
| | | data_attr: data_attr |
| | | } |
| | | $this.$data.popupParam = popupParam; |
| | | $this.setData({popupParam:popupParam}) |
| | | } |
| | | } else if (action.action_type == 'open_project_query_dlg') { |
| | | //console.log(action.value.select_range); |
| | |
| | | priRel = '4'; |
| | | else if (action.value.select_range == '我下属的项目') |
| | | priRel = '5'; |
| | | |
| | | var $this = this; |
| | | var param_ = { |
| | | item: item, |
| | | button_callback: button_callback, |
| | |
| | | }); |
| | | } else { |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: this.translateSys( |
| | | title: $this.translateSys("tip"), |
| | | content: $this.translateSys( |
| | | "quotation_mark_left") + |
| | | action.action_type + this.translateSys( |
| | | "quotation_mark_right") + this |
| | | action.action_type + $this.translateSys( |
| | | "quotation_mark_right") + $this |
| | | .translate( |
| | | "tip_action_unprocessed"), |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | confirmText: $this.translateSys("cancel") |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "5.2", |
| | | content: this.translateSys("quotation_mark_left") + |
| | | "before_click_button" + this.translateSys( |
| | | "quotation_mark_right") + this.translateSys( |
| | | title: $this.translateSys('tip') + "5.2", |
| | | content: $this.translateSys("quotation_mark_left") + |
| | | "before_click_button" + $this.translateSys( |
| | | "quotation_mark_right") + $this.translateSys( |
| | | "comma") + 'event_id' + eventid, |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | confirmText: $this.translateSys("cancel") |
| | | }); |
| | | } |
| | | } |
| | |
| | | exStr = ex |
| | | let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "5.1", |
| | | title: $this.translateSys('tip') + "5.1", |
| | | content: exStr, |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | confirmText: $this.translateSys("cancel") |
| | | }); |
| | | }); |
| | | }, |
| | |
| | | float: right; |
| | | display: inline-block; |
| | | } |
| | | .btn_cancel2 { |
| | | width: 90%; |
| | | margin: 0 10rpx; |
| | | background: #fff; |
| | | border: none; |
| | | color: #000; |
| | | font-size: 38rpx; |
| | | float: right; |
| | | display: inline-block; |
| | | } |
| | | |
| | | .uni-padding-wrap { |
| | | margin: 2rpx 0 0 10rpx; |