| | |
| | | <template> |
| | | <view class="content"> |
| | | <view class="v-area" v-for="(classattr,index) in classAttrList"> |
| | | <div class="class_attr_title" style="display: none;"> |
| | | <div class="title_line"></div> |
| | | <div class="title_icon" :style="{'background-color':classattr.BkColor}"> |
| | | <i class="ace-icon fa" :class="classattr.ImgFontStyle"></i> |
| | | </div> |
| | | <span class="title">{{classattr.Name}}</span> |
| | | <a href="javascript:;" class="arrow" @tap="onarrow(index,classattr.Open)"><i class="ace-icon fa " |
| | | :class="classattr.Open?'fa-angle-down':'fa-angle-up'"></i></a> |
| | | </div> |
| | | <div class="class_attr_body" :style="{'display':classattr.Open?'block':'none'}"> |
| | | <div class="dv_field_div" v-for="(attr,iindex) in classattr.Attr"> |
| | | <view class="form-group" |
| | | v-if="attr.Type=='字符串' || attr.Type=='可变长字符串' || attr.Type=='整数' || attr.Type=='浮点数' ||attr.Type=='char' || attr.Type=='varchar' || attr.Type=='int' || attr.Type=='float'" |
| | | :style="{'display':attr.hidden == true?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:<i |
| | | class="i_tishi" v-if="attr.notempty==true">*</i></text> <!-- attr.NotEmpty=='1' --> |
| | | <div class="text-right" v-if="attr.ext_button==true"> |
| | | <a @tap="classAttr_extButton(index,iindex)"><i |
| | | class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <input |
| | | :type="attr.Type=='整数' || attr.Type=='浮点数' || attr.Type=='int' || attr.Type=='float'?'number':'text'" |
| | | :value="attr.Value" @focus="ontap" @blur="onevent" v-if="attr.Height=='1'" |
| | | :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" |
| | | :disabled="attr.edit?false:true"> |
| | | <!-- =='flase'?true:false --> |
| | | <textarea :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='2'" |
| | | :data-index="index" :data-iindex="iindex" style="height:60px;" |
| | | :style="{'width':attr.Width}" :disabled="attr.edit?false:true"></textarea> |
| | | <textarea :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='3'" |
| | | :data-index="index" :data-iindex="iindex" style="height:90px;" |
| | | :style="{'width':attr.Width}" :disabled="attr.edit?false:true"></textarea> |
| | | <!-- 扫码后事件返回 --> |
| | | <div class="input_vallist"> |
| | | <ul v-for="(inputval,vindex) in inputValList"> |
| | | <li><span>{{inputval.Name}}</span><a href="javascript:;" |
| | | @tap="inputValListIsDel(vindex)"><i class="ace-icon fa fa-times"></i></a> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | | <input |
| | | :type="attr.Type=='整数' || attr.Type=='浮点数' || attr.Type=='int' || attr.Type=='float' ?'number':'text'" |
| | | class="attr_field" :value="attr.Value" @focus="ontap" @blur="onevent" |
| | | v-if="attr.Height=='1'" :data-index="index" :data-iindex="iindex" |
| | | :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - (attr.ext_button==true?9:0) +'%'}" |
| | | :disabled="attr.edit?false:true"> |
| | | <textarea class="attr_field" :value="attr.Value" @focus="ontap" @blur="onevent" |
| | | v-else-if="attr.Height=='2'" :data-index="index" :data-iindex="iindex" |
| | | style="height:60px;" |
| | | :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - (attr.ext_button==true?9:0) +'%'}" |
| | | :disabled="attr.edit?false:true"></textarea> |
| | | <textarea class="attr_field" :value="attr.Value" @focus="ontap" @blur="onevent" |
| | | v-else-if="attr.Height=='3'" :data-index="index" :data-iindex="iindex" |
| | | style="height:90px;" |
| | | :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - (attr.ext_button==true?9:0) +'%'}" |
| | | :disabled="attr.edit?false:true"></textarea> |
| | | <div class="text-right2" v-if="attr.ext_button==true"> |
| | | <a @tap="classAttr_extButton(index,iindex)"><i |
| | | class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <i class="i_tishi" v-if="attr.notempty==true">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='布尔值' || attr.Type=='bool'" |
| | | :style="{'display':attr.hidden == true?'none':''}"> |
| | | <checkbox-group class="check_rememberPwd" @change="oncheck" :data-ischeck="attr.Value" |
| | | :data-index="index" :data-iindex="iindex" |
| | | :style="{'margin-left': classattr.control_style=='左右布局'?classattr.title_p_wdith+2 +'%':'10rpx'}"> |
| | | <label> |
| | | <checkbox :value="attr.Value" :checked="attr.Value" /> |
| | | <text>{{attr.DispName}}<i class="i_tishi" v-if="attr.notempty==true">*</i></text> |
| | | </label> |
| | | </checkbox-group> |
| | | </view> |
| | | <view class="form-group" |
| | | v-if="attr.Type=='日期' || attr.Type=='时间' || attr.Type=='date' || attr.Type=='datetime'" |
| | | :style="{'display':attr.hidden == true?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:<i |
| | | class="i_tishi" v-if="attr.notempty==true">*</i></text> |
| | | <picker mode="date" :value="attr.Value" @change="ondateTime" class="date_iput" |
| | | :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}"> |
| | | <view class="picker">{{attr.Value}}</view> |
| | | </picker> |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | | <picker mode="date" :value="attr.Value" @change="ondateTime" class="date_iput attr_field" |
| | | :data-index="index" :data-iindex="iindex" |
| | | :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) +'%'}"> |
| | | <view class="picker">{{attr.Value}}</view> |
| | | </picker> |
| | | <i class="i_tishi" v-if="attr.notempty==true">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" |
| | | v-if="attr.Type=='字典' || attr.Type=='字典-字符串' || attr.Type=='字典-整数' || attr.Type=='dict' || attr.Type=='dict-char' || attr.Type=='dict-int'" |
| | | :style="{'display':attr.hidden == true?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" |
| | | v-if="attr.notempty==true">*</i></text> |
| | | <picker class="section_iput" @change="onchange" :range="attr.dictitem" range-key="CN_S_NAME" |
| | | v-if="attr.select==false" :data-index="index" :data-iindex="iindex" |
| | | :style="{'width':attr.Width}" :disabled="attr.edit?false:true"> |
| | | <label class="">{{ attr.Value }}</label> |
| | | </picker> |
| | | <select-cy :value="attr.Value" :name="attr.Name" :options="attr.dictitem" |
| | | showClearIcon="true" @change="onchange2" v-else-if="attr.select==true" |
| | | :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" |
| | | :disabled="attr.edit?false:true"></select-cy> |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | | <picker class="section_iput attr_field" @change="onchange" :range="attr.dictitem" |
| | | range-key="CN_S_NAME" v-if="attr.select==false" :data-index="index" |
| | | :data-iindex="iindex" |
| | | :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) +'%'}"> |
| | | <label class="">{{ attr.Value }}</label> |
| | | </picker> |
| | | <select-cy :value="attr.Value" :name="attr.Name" :options="attr.dictitem" |
| | | showClearIcon="true" @change="onchange2" v-else-if="attr.select==true" |
| | | :data-index="index" :data-iindex="iindex" |
| | | :style="{'display':'inline-block','margin-left':'8px','width':attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) +'%'}"></select-cy> |
| | | <i class="i_tishi" v-if="attr.notempty==true">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" |
| | | v-if="attr.Type=='引用对象(单个)' || attr.Type=='引用对象(多个)' ||attr.Type=='obj-ref' || attr.Type=='obj-ref-multi'" |
| | | :style="{'display':attr.hidden == true?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" |
| | | v-if="attr.notempty==true">*</i></text> |
| | | <div class="text-right" v-if="attr.Type=='引用对象(单个)'|| attr.Type=='obj-ref'"> |
| | | <a @tap="classAttr_AddRef" :data-classid="attr.RelCls.split('|')[0]" |
| | | :data-classname="attr.RelCls.split('|')[1]"><i |
| | | class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <div class="text-right" v-if="attr.Type=='引用对象(多个)'|| attr.Type=='obj-ref-multi'"> |
| | | <picker class="select" @change="classAttr_AddRef" :range="attr.RelClsList" |
| | | range-key="name" :data-index="index" :data-iindex="iindex"> |
| | | <label class="">{{ attr.Value }}</label> |
| | | </picker> |
| | | <a class="class_attr_add_ref"><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <input type="text" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" |
| | | disabled="true"> |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | | <input type="text" class="attr_field" :data-index="index" :data-iindex="iindex" |
| | | :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - 9 +'%'}" |
| | | disabled="true"> |
| | | <div class="text-right2" v-if="attr.Type=='引用对象(单个)'|| attr.Type=='obj-ref'"> |
| | | <a @tap="classAttr_AddRef" :data-classid="attr.RelCls.split('|')[0]" |
| | | :data-classname="attr.RelCls.split('|')[1]"><i |
| | | class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <div class="text-right2" v-if="attr.Type=='引用对象(多个)'|| attr.Type=='obj-ref-multi'"> |
| | | <picker class="select" @change="classAttr_AddRef" :range="attr.RelClsList" |
| | | range-key="name" :data-index="index" :data-iindex="iindex"> |
| | | <label class="">{{ attr.Value }}</label> |
| | | </picker> |
| | | <a class="class_attr_add_ref"><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <i class="i_tishi" v-if="attr.notempty==true">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='引用人员' ||attr.Type=='user' " |
| | | :style="{'display':attr.hidden == true?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" |
| | | v-if="attr.notempty==true">*</i></text> |
| | | <div class="text-right"> |
| | | <a class="class_attr_add_per" @tap="classAttr_AddPer(index,iindex)"><i |
| | | class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true"> |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | | <input type="text" class="attr_field" :value="attr.Value" |
| | | :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - 9 +'%'}" |
| | | disabled="true"> |
| | | <div class="text-right2"> |
| | | <a class="class_attr_add_per" @tap="classAttr_AddPer(index,iindex)"><i |
| | | class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <i class="i_tishi" v-if="attr.notempty==true">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='引用项目' ||attr.Type=='project'" |
| | | :style="{'display':attr.hidden == true ?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" |
| | | v-if="attr.notempty==true">*</i></text> |
| | | <div class="text-right"> |
| | | <a href="#" class="class_attr_add_prj" @tap="classAttr_AddPrj(index,iindex)"><i |
| | | class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true"> |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | | <input type="text" class="attr_field" :value="attr.Value" |
| | | :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - 9 +'%'}" |
| | | disabled="true"> |
| | | <div class="text-right2"> |
| | | <a class="class_attr_add_prj" @tap="classAttr_AddPrj(index,iindex)"><i |
| | | class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <i class="i_tishi" v-if="attr.notempty==true">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='编码' || attr.Type=='code'" |
| | | :style="{'display':attr.hidden == true ?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" |
| | | v-if="attr.notempty==true">*</i></text> |
| | | <input type="text" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" |
| | | :disabled="attr.edit?false:true"> |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | | <input type="text" class="attr_field" :data-index="index" :data-iindex="iindex" |
| | | :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) +'%'}" |
| | | :disabled="attr.edit?false:true"> |
| | | <i class="i_tishi" v-if="attr.notempty==true">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='省市区' ||attr.Type=='region'" |
| | | :style="{'display':attr.hidden == true?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" |
| | | v-if="attr.notempty==true">*</i></text> |
| | | <pickerAddress class="date_iput" @change="addresschange" :data-index="index" |
| | | :data-iindex="iindex" :style="{'width':attr.Width}">{{attr.Value}}</pickerAddress> |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | | <pickerAddress class="date_iput attr_field" @change="addresschange" :data-index="index" |
| | | :data-iindex="iindex" |
| | | :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) +'%'}"> |
| | | {{attr.Value}} |
| | | </pickerAddress> |
| | | <i class="i_tishi" v-if="attr.notempty==true">*</i> |
| | | </view> |
| | | </view> |
| | | </div> |
| | | </div> |
| | | |
| | | </view> |
| | | <button type="default" @tap="cancel" class="btn_cancel">取消</button> |
| | | <button type="default" @tap="sava" class="btn_add">{{title}}</button> |
| | | <!-- 普通弹窗 top bottom center left right --> |
| | | <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' }" |
| | | :style="{'width':check_list.width?check_list.width+'px':'200px','height':check_list.height?check_list.height+'px':'88%'}"> |
| | | <view class="popup-cont" :style="{'height':check_list.height?check_list.height-45+'px':'415px'}"> |
| | | <view class="view_popup_CheckList" v-for="(item,index) in check_list.items"> |
| | | <checkbox-group class="check_list" @change="checkChange" :data-ischeck="item.check" |
| | | :data-index="index" :style="{'margin-left': '10rpx'}"> |
| | | <label> |
| | | <checkbox :value="item.check" :checked="item.check" /> |
| | | <text>{{item.name}}</text> |
| | | </label> |
| | | </checkbox-group> |
| | | </view> |
| | | </view> |
| | | <view class="popup-footer"> |
| | | <button type="default" @tap="popup_sava" class="btn_popup_add">确定</button> |
| | | <button type="default" @tap="popup_cancel" class="btn_popup_cancel">取消</button> |
| | | </view> |
| | | </view> |
| | | </uni-popup> |
| | | </view> |
| | | <!-- <button class="button" type="primary" @click="classAttr_extButton('right')"><text class="button-text">右侧</text></button> --> |
| | | |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import pickerAddress from '../../js/pickerAddress/pickerAddress.vue' |
| | | import utils from "@/js/utils.js" |
| | | import { |
| | | classAttrList, |
| | | classGridStyleInfo, |
| | | dataObjAdd, |
| | | dataObjRunCustomEvent |
| | | } from "@/api/index.js" |
| | | |
| | | export default { |
| | | components: { |
| | | pickerAddress |
| | | }, |
| | | data() { |
| | | return { |
| | | title: '新增', |
| | | param: {}, |
| | | classAttrList: [], |
| | | classGridStyle: [], |
| | | edit_inital_event: "", //弹窗初始化事件ID |
| | | edit_ok_event: "", //弹窗点击OK 触发事件ID |
| | | edit_select_compose_event: "", //选择组成对象时调用 |
| | | edit_compose_cls_id: "", |
| | | global_attr: [], |
| | | refdatastore: [], //引用数据存储区// {attr:'G_PRJ_' + bindattr + '_ID', value:info.id} |
| | | inputValList: [{ |
| | | Name: "test" |
| | | }, { |
| | | Name: "test2" |
| | | }, { |
| | | Name: "test3" |
| | | }, { |
| | | Name: "test4" |
| | | }, { |
| | | Name: "test5" |
| | | }, { |
| | | Name: "test6" |
| | | }, { |
| | | Name: "test7" |
| | | }], |
| | | popupType: "center", |
| | | check_list: {}, |
| | | popupParam: {}, |
| | | } |
| | | }, |
| | | onNavigationBarButtonTap(e) { |
| | | //刷新 |
| | | uni.redirectTo({ |
| | | url: '../modal/classAttr?param=' + JSON.stringify(this.param) + |
| | | "&titlename=" + this.title |
| | | }); |
| | | |
| | | }, |
| | | onLoad(options) { |
| | | // console.log(options); |
| | | uni.setNavigationBarTitle({ |
| | | title: options.titlename |
| | | }); //设置顶部标题 |
| | | var param = JSON.parse(options.param); |
| | | this.$data.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //设置按钮文字 |
| | | // console.log(param); |
| | | if (!param.EditDlgMode) { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "该功能点未配置编辑窗口,请重新配置!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | return; |
| | | } |
| | | if (!param.Edit_dlg.Name) { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "该功能点未配置窗口样式,请重新配置!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | return; |
| | | } |
| | | this.$data.param = param; |
| | | |
| | | this.loadData() |
| | | }, |
| | | methods: { |
| | | setData(obj) { |
| | | let that = this; |
| | | let keys = []; |
| | | let val, data; |
| | | |
| | | Object.keys(obj).forEach(function(key) { |
| | | keys = key.split("."); |
| | | val = obj[key]; |
| | | data = that.$data; |
| | | keys.forEach(function(key2, index) { |
| | | if (index + 1 == keys.length) { |
| | | that.$set(data, key2, val); |
| | | } else { |
| | | if (!data[key2]) { |
| | | that.$set(data, key2, {}); |
| | | } |
| | | } |
| | | data = data[key2]; |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | async loadData() { |
| | | try { |
| | | var edit_dlg = { |
| | | Model: this.param.EditDlgMode, |
| | | Name: this.param.Edit_dlg.Name |
| | | } |
| | | var dataInfo = { |
| | | class_id: this.param.clsid |
| | | }; |
| | | this.$data.classAttrList = await classAttrList(dataInfo) || [] |
| | | |
| | | var gridstyleInfo = { |
| | | class_id: this.param.clsid, |
| | | name: this.param.Edit_dlg.Name, |
| | | type: '2' |
| | | }; |
| | | |
| | | const res = await classGridStyleInfo(gridstyleInfo) |
| | | res.StyleDef = JSON.parse(res.StyleDef); |
| | | this.$data.classGridStyle = res; |
| | | // console.log($this.$data.classGridStyle); |
| | | this.class_attr_init(); |
| | | |
| | | } catch (ex) { |
| | | uni.showModal({ |
| | | title: "错误1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | } |
| | | }, |
| | | classAttr_extButton(index, iindex) { //弹框层显示 type:top bottom center left right |
| | | var $this = this; |
| | | $this.$data.popupType = 'right' |
| | | // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
| | | $this.$refs.popup.open($this.popupType); |
| | | var data_attr = $this.$data.classAttrList[index].Attr[iindex]; |
| | | // var value = action.value; |
| | | // var action ={"action_type":"open_common_dlg","value":{"common_dlg_id":"check_list","config":{"title":"生产工单","appear_style":"sideslip","width":250,"multiple_choice":"1","items":[{"id":"133D50D7-D798-4D2E-A15F-308365092DF5","name":"5100691673", "check":false},{"id":"22992021-7D3B-4959-86B7-EF184B596AC6","name":"5100691674", "check":false},{"id":"48FBBE8E-594D-45D5-8C24-385C661C4A1C","name":"5100691675", "check":false},{"id":"4E429C60-325A-42ED-BEA3-B3397C07CCA1","name":"5100691668", "check":false}]}}} |
| | | // if (action.action_type == 'open_common_dlg') { |
| | | // var value = action.value; |
| | | // if(value.common_dlg_id == 'check_list'){ |
| | | // $this.$data.check_list= value.config; |
| | | // } |
| | | // } |
| | | // var popupParam={ |
| | | // index: index, |
| | | // iindex: iindex, |
| | | // button_callback:"", |
| | | // req:"", |
| | | // data_attr:data_attr |
| | | // } |
| | | // $this.$data.popupParam= popupParam; |
| | | // return; |
| | | var before_click_button = $this.$data.classAttrList[index].Attr[iindex].before_click_button; |
| | | var button_callback = $this.$data.classAttrList[index].Attr[iindex].button_callback; |
| | | if (!before_click_button) { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "before_click_button-event_id为空!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | return; |
| | | } |
| | | if (!button_callback) { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "button_callback-event_id为空!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | return; |
| | | } |
| | | this.DataObjRunCustomEvent_Return(before_click_button, data_attr, button_callback, index, iindex); |
| | | }, |
| | | popupChange(e) { |
| | | console.log('当前模式:' + e.type + ',状态:' + e.show); |
| | | }, |
| | | checkChange(e) { //弹框check选择 |
| | | // console.log(e.target.dataset); |
| | | var index = e.target.dataset.index; |
| | | var ischeck = e.target.dataset.ischeck; |
| | | var data = this.$data.check_list.items; |
| | | // this.$data.check_list.items=[]; |
| | | if (this.$data.check_list.multiple_choice == "0") { //判断时单选还是多选 |
| | | for (var i in data) { |
| | | data[i].check = false; |
| | | } |
| | | } |
| | | data[index].check = ischeck ? false : true; |
| | | this.$data.check_list.items = data; |
| | | |
| | | }, |
| | | popup_cancel(e) { //弹框取消 |
| | | this.$refs.popup.close(); |
| | | }, |
| | | popup_sava(e) { //弹框确定 |
| | | var $this = this; |
| | | var items = $this.$data.check_list.items; |
| | | var data = []; |
| | | var name = ""; |
| | | for (var i = 0; i < items.length; i++) { |
| | | if (items[i].check == true) { |
| | | if (name) |
| | | name += ';'; |
| | | name += items[i].name; |
| | | data.push({ |
| | | id: items[i].id, |
| | | name: items[i].name |
| | | }); |
| | | } |
| | | } |
| | | if (!$this.$data.popupParam) { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "popupParam为空!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | return; |
| | | } |
| | | $this.$data.classAttrList[$this.$data.popupParam.index].Attr[$this.$data.popupParam.iindex].Value = name; |
| | | console.log(data); |
| | | var callback_eventid = $this.$data.popupParam.button_callback.trim(); |
| | | var info = { |
| | | eventid: callback_eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: $this.$data.param.clsid, |
| | | objid: "", |
| | | attr: $this.$data.popupParam.req, |
| | | dataJson: data |
| | | } |
| | | $this.DataObjRunCustomEvent(info, $this.$data.popupParam.data_attr); |
| | | this.$refs.popup.close(); |
| | | }, |
| | | cancel(e) { |
| | | uni.navigateBack({ |
| | | delta: 1 //返回层数,2则上上页 |
| | | }); |
| | | }, |
| | | ontap(e) { //扫码功能 |
| | | var $ele = e; |
| | | //console.log(e.target) |
| | | getApp().onScan((result) => { |
| | | //console.log(result.decodedata); |
| | | this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = |
| | | result.decodedata; |
| | | uni.hideKeyboard(); |
| | | this.onevent($ele, result.decodedata); |
| | | }) |
| | | }, |
| | | onarrow(index, open) { |
| | | // console.log(index+'--'+open); |
| | | this.$data.classAttrList[index].Open = open == true ? false : true; |
| | | }, |
| | | ondateTime(e) { |
| | | //console.log(e.target) |
| | | this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e.target |
| | | .value; |
| | | }, |
| | | onchange(e) { |
| | | // console.log(e.target); |
| | | var value = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].dictitem[e |
| | | .target.value]; |
| | | var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]; |
| | | if (value.Name != data_attr.Value) { |
| | | this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = value |
| | | .Name; |
| | | // console.log(this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value); |
| | | var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] |
| | | .action; |
| | | if (eventid) { |
| | | // self.event_no_sub = 1; |
| | | var req = []; |
| | | var attrlist = this.$data.classAttrList; |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | req.push(this.formatAttr(ar)) |
| | | } |
| | | } |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: this.$data.param.clsid, |
| | | objid: "", |
| | | attr: req, |
| | | dataJson: [] |
| | | } |
| | | this.DataObjRunCustomEvent(info); |
| | | } |
| | | } |
| | | |
| | | }, |
| | | onchange2(item, value, delvalue) { |
| | | // console.log(item); |
| | | // console.log(value); |
| | | // console.log(delvalue); |
| | | //为空时,清空属性value |
| | | if (item.length == 0) { |
| | | var index, iindex, dindex = 0; |
| | | for (var i in this.$data.classAttrList) { |
| | | for (var j in this.$data.classAttrList[i].Attr) { |
| | | if (delvalue[0].attr == this.$data.classAttrList[i].Attr[j].Name) { |
| | | this.$data.classAttrList[i].Attr[j].Value = ""; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | for (var v in item) { |
| | | var index, iindex, dindex = 0; |
| | | for (var i in this.$data.classAttrList) { |
| | | for (var j in this.$data.classAttrList[i].Attr) { |
| | | if (item[v].attr == this.$data.classAttrList[i].Attr[j].Name) { |
| | | index = i; |
| | | iindex = j; |
| | | } |
| | | } |
| | | } |
| | | var itemvalue = item[v]; |
| | | var data_attr = this.$data.classAttrList[index].Attr[iindex]; |
| | | |
| | | console.log(data_attr); |
| | | if (itemvalue.Name != data_attr.Value) { |
| | | this.$data.classAttrList[index].Attr[iindex].Value = value; |
| | | // console.log(this.$data.classAttrList[index].Attr[iindex].Value); |
| | | var eventid = this.$data.classAttrList[index].Attr[iindex].action; |
| | | if (eventid) { |
| | | // self.event_no_sub = 1; |
| | | var req = []; |
| | | var attrlist = this.$data.classAttrList; |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if (utils.classUtils.attrTypeIsDict(ar.Type)) |
| | | req.push({ |
| | | attr: ar.Name, |
| | | value: itemvalue.Name |
| | | }); |
| | | else |
| | | req.push(this.formatAttr(ar)) |
| | | } |
| | | } |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: this.$data.param.clsid, |
| | | objid: "", |
| | | attr: req, |
| | | dataJson: [], |
| | | } |
| | | this.DataObjRunCustomEvent(info); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | }, |
| | | onevent(e, decodedata) { |
| | | // console.log(e.target); |
| | | var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]; |
| | | // console.log(decodedata); |
| | | if (e.target.value != data_attr.Value) { |
| | | this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = |
| | | decodedata ? decodedata : e.target.value; |
| | | var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] |
| | | .action; |
| | | if (eventid) { |
| | | // self.event_no_sub = 1; |
| | | var req = []; |
| | | var attrlist = this.$data.classAttrList; |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | req.push(this.formatAttr(ar)) |
| | | } |
| | | } |
| | | |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: this.$data.param.clsid, |
| | | objid: "", |
| | | attr: req, |
| | | dataJson: [], |
| | | } |
| | | this.DataObjRunCustomEvent(info, data_attr); |
| | | } |
| | | } |
| | | |
| | | }, |
| | | oncheck(e) { |
| | | // console.log(e.target); |
| | | var ischecked = e.target.dataset.ischeck ? false : true; |
| | | var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]; |
| | | // console.log(data_attr); |
| | | if (ischecked != data_attr.Value) { |
| | | this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = ischecked; |
| | | var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] |
| | | .action; |
| | | if (eventid) { |
| | | // self.event_no_sub = 1; |
| | | var req = []; |
| | | var attrlist = this.$data.classAttrList; |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | req.push(this.formatAttr(ar)) |
| | | |
| | | } |
| | | } |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: this.$data.param.clsid, |
| | | objid: "", |
| | | attr: req, |
| | | dataJson: [], |
| | | } |
| | | this.DataObjRunCustomEvent(info); |
| | | } |
| | | } |
| | | |
| | | }, |
| | | inputValListIsDel(index) { |
| | | // console.log(index); |
| | | this.$data.inputValList.splice(index, 1); //删除tabPagejson的内容 |
| | | // console.log(this.$data.inputValList); |
| | | }, |
| | | addresschange(e) { |
| | | // console.log(e.target); |
| | | console.log(e.data.join(';')) |
| | | this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e.data.join( |
| | | ';'); |
| | | }, |
| | | classAttr_AddPer(index, iindex) { |
| | | var param = { |
| | | index: index, |
| | | iindex: iindex |
| | | }; |
| | | var $this = this; |
| | | uni.navigateTo({ |
| | | url: '../selpsn/index?mulit=false¶m=' + JSON.stringify(param), |
| | | events: { |
| | | AddPer(data, param) { |
| | | // console.log(param); |
| | | console.log(data); |
| | | $this.$data.classAttrList[param.index].Attr[param.iindex].Value = data[0].Name; |
| | | $this.$data.classAttrList[param.index].Attr[param.iindex].ValID = data[0].Login + ';' + |
| | | data[0].Name; |
| | | |
| | | var eventid = $this.$data.classAttrList[param.index].Attr[param.iindex].action; |
| | | if (eventid) { |
| | | eventid = eventid.trim(); |
| | | if (eventid) { |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "4", |
| | | projectid: "", |
| | | rclsid: "", |
| | | robjid: "", |
| | | userlogin: data[0].Login, |
| | | clsid: $this.$data.param.clsid, |
| | | objid: "", |
| | | attr: [], |
| | | dataJson: [], |
| | | } |
| | | |
| | | // var data_attr = $this.$data.classAttrList[param.index].Attr[param.iindex]; |
| | | $this.DataObjRunCustomEvent(info); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | classAttr_AddRef(e) { |
| | | console.log(e.target); |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "此功能还未实现!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | // var value=this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.target.value]; |
| | | // this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value; |
| | | }, |
| | | classAttr_AddPrj(index, iindex) { |
| | | var param = { |
| | | index: index, |
| | | iindex: iindex |
| | | }; |
| | | var $this = this; |
| | | uni.navigateTo({ |
| | | url: '../selPrj/index?relation=-1¶m=' + JSON.stringify(param), |
| | | events: { |
| | | AddPer(data, param) { |
| | | // console.log(param); |
| | | // console.log(data); |
| | | $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 eventid = $this.$data.classAttrList[param.index].Attr[param.iindex].action; |
| | | if (eventid) { |
| | | eventid = eventid.trim(); |
| | | if (eventid) { |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "2", |
| | | projectid: data[0].ID, |
| | | rclsid: "", |
| | | robjid: "", |
| | | userlogin: "", |
| | | clsid: $this.$data.param.clsid, |
| | | objid: "", |
| | | attr: [], |
| | | dataJson: [], |
| | | } |
| | | |
| | | // var data_attr = $this.$data.classAttrList[param.index].Attr[param.iindex]; |
| | | $this.DataObjRunCustomEvent(info); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | sava() { |
| | | if (this.$data.edit_ok_event) |
| | | this.OKDataObjRunCustomEvent(); |
| | | else |
| | | this.add(); |
| | | }, |
| | | add() { |
| | | uni.showLoading({ |
| | | title: "加载中...", |
| | | mask: true |
| | | }); |
| | | var req = []; |
| | | var attrlist = this.$data.classAttrList; |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if (ar.Value == '请选择' || ar.Value == '——请选择——') ar.Value = ''; |
| | | if (utils.classUtils.attrTypeIsDict(ar.Type)) { |
| | | if (ar.select == true) { //判断下拉是否多选 |
| | | var valStr = ""; |
| | | for (var v in ar.Value) { |
| | | if (valStr) |
| | | valStr += ";"; |
| | | valStr += ar.Value[v]; |
| | | } |
| | | req.push({ |
| | | name: ar.Name, |
| | | value: valStr |
| | | }); |
| | | } else |
| | | req.push({ |
| | | name: ar.Name, |
| | | value: ar.Value |
| | | }); |
| | | } else { |
| | | const node = this.formatAttr(ar) |
| | | req.push({ |
| | | name: node.attr, |
| | | value: node.value |
| | | }); |
| | | } |
| | | |
| | | if (ar.notempty == true && !ar.Value) { |
| | | // if(ar.NotEmpty=='1'){ |
| | | uni.hideLoading(); |
| | | // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000}); |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: ar.DispName + '不能为空!', |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: this.$data.param.clsid, // 功能点主数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: '新增', |
| | | master: { |
| | | cls_id: this.$data.param.clsid, |
| | | } |
| | | }; |
| | | |
| | | var dataInfo = { |
| | | class_id: this.$data.param.clsid, |
| | | data_obj_id: '', |
| | | masterclsid: '', |
| | | req: JSON.stringify(req), |
| | | upfile: JSON.stringify([]), |
| | | post_data: JSON.stringify({}), |
| | | compose: JSON.stringify([]), |
| | | refdatastore: JSON.stringify([]), |
| | | extinfo: JSON.stringify(enviroment), |
| | | not_trigger_sys_event: '' |
| | | }; |
| | | |
| | | console.log(dataInfo); |
| | | // return |
| | | dataObjAdd(dataInfo).then(data => { |
| | | console.log(data); |
| | | uni.hideLoading(); |
| | | if (data.Action) { |
| | | var action = JSON.parse(data.Action); |
| | | console.log(action); |
| | | if (action.ret == '0') { |
| | | if (action.ret != 0) { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: '执行脚本失败,' + action.result, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | return; |
| | | } |
| | | if (action.info) { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: '执行脚本失败,' + action.info, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | return; |
| | | } |
| | | if (action.result_type == '0') { |
| | | uni.showToast({ |
| | | title: action.result, |
| | | icon: "success", |
| | | duration: 3000 |
| | | }); |
| | | } |
| | | |
| | | // "{"ret":0, "result_type":0, "result":"创建成功123123123","info":""}" |
| | | } |
| | | } else |
| | | uni.showToast({ |
| | | title: "创建成功!", |
| | | icon: "success", |
| | | duration: 3000 |
| | | }); |
| | | |
| | | // this.class_attr_init(); |
| | | |
| | | }).catch(ex => { |
| | | console.log(ex); |
| | | uni.hideLoading(); |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | }); |
| | | }, |
| | | class_attr_init() { |
| | | const attrlist = this.$data.classGridStyle.StyleDef?.show_style || [] |
| | | var newattrlist = []; |
| | | if (this.$data.classAttrList.length > 0) { |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var open = attrlist[i].open; |
| | | var name = attrlist[i].attrgroup_name; |
| | | var attrs = attrlist[i].attrs; |
| | | for (var s = 0; s < this.$data.classAttrList.length; s++) { |
| | | var clsattr = this.$data.classAttrList[s]; |
| | | if (name == clsattr.Name) { |
| | | var attr = []; |
| | | for (var j = 0; j < attrs.length; j++) { |
| | | for (var l = 0; l < clsattr.Attr.length; l++) { |
| | | var ca = clsattr.Attr[l]; |
| | | if (attrs[j].attr == ca.Name) { |
| | | ca.action = attrs[j].action; |
| | | ca.edit = attrs[j].edit; |
| | | ca.notempty = attrs[j].notempty; |
| | | ca.ext_button = attrs[j].ext_button; |
| | | ca.button_img = attrs[j].button_img; |
| | | ca.button_tooltip = attrs[j].button_tooltip; |
| | | ca.before_click_button = attrs[j].before_click_button; |
| | | ca.button_callback = attrs[j].button_callback; |
| | | ca.hidden = attrs[j].hidden; |
| | | ca.select = attrs[j].select == undefined ? false : attrs[j].select; |
| | | ca.Value = ""; |
| | | if (ca.dictitem) { |
| | | if (ca.select == true) |
| | | ca.Value = []; //ca.dictitem[0].CN_S_NAME; |
| | | else |
| | | ca.Value = '请选择'; //ca.dictitem[0].CN_S_NAME; |
| | | var dictitemlist = []; |
| | | for (var d = 0; d < ca.dictitem.length; d++) { |
| | | ca.dictitem[d].label = ca.dictitem[d].CN_S_NAME; |
| | | ca.dictitem[d].value = ca.dictitem[d].CN_S_NAME; |
| | | ca.dictitem[d].attr = ca.Name; |
| | | if (ca.dictitem[d].CN_C_IS_DEFAULT == '1') |
| | | ca.Value = ca.dictitem[d].CN_S_NAME; |
| | | } |
| | | } |
| | | if (utils.classUtils.attrTypeIsDateTime(ca.Type)) { |
| | | var nowDate = new Date(); |
| | | var date = { |
| | | year: nowDate.getFullYear(), |
| | | month: nowDate.getMonth() + 1, |
| | | day: nowDate.getDate() |
| | | } |
| | | ca.Value = date.year + '-' + (date.month >= 10 ? date.month : '0' + date |
| | | .month) + '-' + (date.day >= 10 ? date.day : '0' + date.day); |
| | | } |
| | | if (utils.classUtils.attrTypeIsObjRefMulti(ca.Type)) { |
| | | var relClsList = []; |
| | | var attr_rescls = ca.RelCls.split(','); |
| | | for (var ii in attr_rescls) { |
| | | var rescls = attr_rescls[ii].split('|'); |
| | | relClsList.push({ |
| | | id: rescls[0], |
| | | name: rescls[1] |
| | | }); |
| | | } |
| | | ca.RelClsList = relClsList; |
| | | ca.Value = '请'; |
| | | } |
| | | if (utils.classUtils.attrTypeIsRegion(ca.Type)) |
| | | ca.Value = '请选择'; |
| | | if (utils.classUtils.attrTypeIsBool(ca.Type)) |
| | | ca.Value = false; |
| | | |
| | | attr.push(ca); |
| | | } |
| | | } |
| | | } |
| | | newattrlist.push({ |
| | | BkColor: clsattr.BkColor, |
| | | HasAce: clsattr.HasAce, |
| | | ImgFontStyle: clsattr.ImgFontStyle, |
| | | Name: clsattr.Name, |
| | | Order: clsattr.Order, |
| | | Open: open, |
| | | Attr: attr, |
| | | control_style: this.$data.classGridStyle.StyleDef.control_style, |
| | | title_p_wdith: this.$data.classGridStyle.StyleDef.title_p_wdith |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | if (newattrlist.length > 0) { |
| | | this.$data.classAttrList = newattrlist; |
| | | } |
| | | var req = []; |
| | | |
| | | |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].attrs |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | req.push({ |
| | | attr: ar.attr, |
| | | value: ar.value ? ar.value : '' |
| | | }); |
| | | } |
| | | } |
| | | var eventlist = this.$data.classGridStyle.StyleDef.event; |
| | | |
| | | if (eventlist) { |
| | | if (eventlist.length > 0) { |
| | | for (var i = 0; i < eventlist.length; i++) { |
| | | if (eventlist[i].event_id == 'before_ok') { |
| | | this.$data.edit_ok_event = eventlist[i]; |
| | | } else if (eventlist[i].event_id == 'initial') { |
| | | this.$data.edit_inital_event = eventlist[i]; |
| | | } else if (eventlist[i].event_id == 'before_select_compose') { |
| | | this.$data.edit_select_compose_event = eventlist[i].scrip_id; |
| | | this.$data.edit_compose_cls_id = eventlist[i].compose_cls_id; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | console.log(req); |
| | | if (this.$data.edit_inital_event) { |
| | | var eventid = this.$data.edit_inital_event.scrip_id; |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: this.$data.param.clsid, |
| | | objid: "", |
| | | attr: req, |
| | | } |
| | | this.ini_DataObjRunCustomEvent(info); |
| | | } |
| | | |
| | | console.log(this.$data.classGridStyle); |
| | | console.log(this.$data.classAttrList); |
| | | |
| | | } else { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "未找到可显示的的属性", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | } |
| | | }, |
| | | ini_DataObjRunCustomEvent(info) { |
| | | var param = { |
| | | EditStyle: this.$data.param.Edit_dlg.Name, |
| | | ViewStyle: this.$data.param.Edit_dlg.Name, |
| | | NotTriggerSysEvent: 0, |
| | | enviroment: { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: this.$data.param.clsid, // 功能点主数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: '新增', |
| | | master: { |
| | | cls_id: this.$data.param.clsid, // button=bottom时 master的cls_id |
| | | //obj_id: '' // button=bottom时 master的obj_id |
| | | } |
| | | } |
| | | } |
| | | var inputparameter = ''; |
| | | var global_attr = ''; |
| | | |
| | | var dataInfo = { |
| | | edtype: info.edtype, |
| | | eventid: info.eventid, |
| | | projectid: info.projectid, |
| | | rclsid: info.rclsid, |
| | | robjid: info.robjid, |
| | | userlogin: info.userlogin, |
| | | clsid: info.clsid, |
| | | objid: info.objid, |
| | | attr: JSON.stringify(info.attr), |
| | | extinfo: JSON.stringify(param.enviroment), |
| | | inputparameter: inputparameter, |
| | | global_attr: global_attr |
| | | } |
| | | console.log(dataInfo); |
| | | dataObjRunCustomEvent(dataInfo).then(data => { |
| | | data = JSON.parse(data); |
| | | var actionlist = data.action; |
| | | if (actionlist) { |
| | | for (var j = 0; j < actionlist.length; j++) { |
| | | var action = actionlist[j]; |
| | | var action_type = action.action_type; |
| | | var value = action.value; |
| | | if (action_type == 'set_dlg_attr') { |
| | | if (value) { |
| | | console.log(value); |
| | | for (var i = 0; i < value.length; i++) { |
| | | for (var a = 0; a < this.$data.classAttrList.length; a++) { |
| | | for (var l = 0; l < this.$data.classAttrList[a].Attr.length; l++) { |
| | | var ca = this.$data.classAttrList[a].Attr[l]; |
| | | if (value[i].attr == ca.Name) { |
| | | if (utils.classUtils.attrTypeIsDict(ca.Type)) { |
| | | var dictItemList = []; |
| | | for (var d in value[i].choice_list) { |
| | | var list_val = value[i].choice_list[d]; |
| | | dictItemList.push({ |
| | | "CN_S_NAME": list_val, |
| | | "Name": list_val, |
| | | "label": list_val, |
| | | "value": list_val |
| | | }); |
| | | |
| | | } |
| | | ca.dictitem = dictItemList; |
| | | // attr[j].dictitem = val[i].choice_list; |
| | | } else { |
| | | ca.Value = value[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | var length = 0; |
| | | if (!this.$data.refdatastore.filter(function(s) { |
| | | return value[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | this.$data.refdatastore.push(value[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < this.$data.refdatastore.length; j++) { |
| | | if (this.$data.refdatastore[j].attr == value[i].attr) { |
| | | this.$data.refdatastore[j].value = value[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (action_type == 'open_select_userdlg') { |
| | | uni.showModal({ |
| | | title: "错误2.2", |
| | | content: "open_select_userdlg这个action_type还未处理!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | } |
| | | // else if (action_type == 'tip_dlg') { |
| | | |
| | | // } |
| | | } |
| | | } |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: "错误2.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | }); |
| | | }, |
| | | DataObjRunCustomEvent(info, data_attr) { |
| | | var $this = this; |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: this.$data.param.clsid, // 功能点主数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: '新增', |
| | | master: { |
| | | cls_id: this.$data.param.clsid, // button=bottom时 master的cls_id |
| | | //obj_id: '' // button=bottom时 master的obj_id |
| | | } |
| | | }; |
| | | if (data_attr) { |
| | | enviroment.edit_dlg = { |
| | | type: 'small', //小窗口 |
| | | class_id: this.$data.param.clsid, //当前数据类id |
| | | } |
| | | if (data_attr) { |
| | | enviroment.edit_dlg.form_control = { //所属的表单控件 |
| | | name: data_attr.Name, //字段属性 |
| | | text: data_attr.DispName, //显示文本 |
| | | group_name: data_attr.GroupName, //属性组 |
| | | type: data_attr.Type, //字段类型 |
| | | readonly: data_attr.ReadOnly, //是否只读 |
| | | button_img: data_attr.button_img, //引用按钮的图标 |
| | | button_tooltip: data_attr.button_tooltip //引用按钮的tooltip |
| | | } |
| | | } |
| | | } |
| | | var dataInfo = { |
| | | edtype: info.edtype, |
| | | eventid: info.eventid, |
| | | projectid: info.projectid.replace('{', '').replace('}', ''), |
| | | rclsid: info.rclsid, |
| | | robjid: info.robjid, |
| | | userlogin: info.userlogin, |
| | | clsid: info.clsid, |
| | | objid: info.objid, |
| | | attr: JSON.stringify(info.attr), |
| | | extinfo: JSON.stringify(enviroment), |
| | | inputparameter: "", |
| | | global_attr: JSON.stringify(this.$data.global_attr), |
| | | dataJson: JSON.stringify(info.dataJson) |
| | | } |
| | | console.log(dataInfo); |
| | | |
| | | dataObjRunCustomEvent(dataInfo).then(data => { |
| | | data = JSON.parse(data); |
| | | var actionlist = data.action; |
| | | |
| | | if (actionlist) { |
| | | console.log(actionlist); |
| | | for (var i = 0; i < actionlist.length; i++) { |
| | | var action = actionlist[i]; |
| | | if (action.action_type == 'set_dlg_attr') { |
| | | var result = action.value; |
| | | for (var i = 0; i < result.length; i++) { |
| | | if (result[i].choice_list) { |
| | | for (var c = 0; c < $this.$data.classAttrList.length; c++) { |
| | | var attr = $this.$data.classAttrList[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | if (attr[j].Name == result[i].attr) { |
| | | if (utils.classUtils.attrTypeIsDict(attr[j].Type)) { |
| | | var dictItemList = []; |
| | | for (var d in result[i].choice_list) { |
| | | var val = result[i].choice_list[d]; |
| | | dictItemList.push({ |
| | | "CN_S_NAME": val, |
| | | "Name": val, |
| | | "label": val, |
| | | "value": val |
| | | }); |
| | | } |
| | | attr[j].dictitem = dictItemList; |
| | | // attr[j].dictitem = result[i].choice_list; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | for (var c = 0; c < $this.$data.classAttrList.length; c++) { |
| | | var attr = $this.$data.classAttrList[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | console.log(attr[j].Name + '==' + result[i].attr); |
| | | if (attr[j].Name == result[i].attr) { |
| | | attr[j].Value = 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; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } else if (data.action[i].action_type == 'set_global_attr') { |
| | | $this.$data.global_attr = data.action[i].value || []; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (data.result) { |
| | | var result = data.result; |
| | | for (var i = 0; i < result.length; i++) { |
| | | for (var c = 0; c < $this.$data.classAttrList.length; c++) { |
| | | var attr = $this.$data.classAttrList[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | if (attr[j].Name == result[i].attr) { |
| | | attr[j].Value = 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; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: "错误3.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | }); |
| | | }, |
| | | OKDataObjRunCustomEvent() { |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: this.$data.param.clsid, // 功能点主数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: '新增', |
| | | master: { |
| | | cls_id: this.$data.param.clsid, // button=bottom时 master的cls_id |
| | | |
| | | } |
| | | }; |
| | | |
| | | var eventid = this.$data.edit_ok_event.scrip_id; |
| | | var req = []; |
| | | var attrlist = this.$data.classAttrList; |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if (ar.Value == '请选择' || ar.Value == '——请选择——') ar.Value = ''; |
| | | req.push(this.formatAttr(ar)) |
| | | } |
| | | } |
| | | |
| | | if (this.$data.refdatastore.length > 0) { |
| | | for (var i = 0; i < this.$data.refdatastore.length; i++) { |
| | | if (!req.filter(function(s) { |
| | | return this.$data.refdatastore[i].attr == s.name |
| | | }).length) { |
| | | length = 1; |
| | | req.push({ |
| | | 'attr': this.$data.refdatastore[i].attr, |
| | | 'value': this.$data.refdatastore[i].value |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: this.$data.param.clsid, |
| | | objid: "", |
| | | attr: req, |
| | | } |
| | | var dataInfo = { |
| | | edtype: info.edtype, |
| | | eventid: info.eventid, |
| | | projectid: info.projectid, |
| | | rclsid: info.rclsid, |
| | | robjid: info.robjid, |
| | | userlogin: info.userlogin, |
| | | clsid: info.clsid, |
| | | objid: info.objid, |
| | | attr: JSON.stringify(info.attr), |
| | | extinfo: JSON.stringify(enviroment), |
| | | global_attr: JSON.stringify(this.$data.global_attr) |
| | | } |
| | | console.log(dataInfo); |
| | | dataObjRunCustomEvent(dataInfo).then(data => { |
| | | data = JSON.parse(data); |
| | | var result = data.result; |
| | | for (var i = 0; i < result.length; i++) { |
| | | // self.class_attr_ele.find('.attr_field[data-field="' + result[i].attr + '"]').val(result[i].value).data('val', 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.add(); |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: "错误4.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | }); |
| | | }, |
| | | DataObjRunCustomEvent_Return(eventid, data_attr, button_callback, index, iindex) { |
| | | var $this = this; |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: this.$data.param.clsid, // 功能点主数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: '新增', |
| | | master: { |
| | | cls_id: this.$data.param.clsid, // button=bottom时 master的cls_id |
| | | //obj_id: '' // button=bottom时 master的obj_id |
| | | } |
| | | }; |
| | | var req = []; |
| | | var attrlist = this.$data.classAttrList; |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | req.push(this.formatAttr(ar)) |
| | | } |
| | | } |
| | | // if (this.$data.refdatastore.length > 0) { |
| | | // for (var i = 0; i < this.$data.refdatastore.length; i++) { |
| | | // if (!req.filter(function (s) { |
| | | // return $this.$data.refdatastore[i].attr == s.name |
| | | // }).length) { |
| | | // length = 1; |
| | | // req.push({ 'attr': this.$data.refdatastore[i].attr, 'val': this.$data.refdatastore[i].value }); |
| | | // } |
| | | // } |
| | | // } |
| | | var extinfo = enviroment; |
| | | extinfo.edit_dlg = { |
| | | type: 'small', //小窗口 |
| | | class_id: this.$data.param.clsid, //当前数据类id |
| | | } |
| | | if (data_attr) { |
| | | extinfo.edit_dlg.form_control = { //所属的表单控件 |
| | | name: data_attr.Name, //字段属性 |
| | | text: data_attr.DispName, //显示文本 |
| | | group_name: data_attr.GroupName, //属性组 |
| | | type: data_attr.Type, //字段类型 |
| | | readonly: data_attr.ReadOnly, //是否只读 |
| | | button_img: data_attr.button_img, //引用按钮的图标 |
| | | button_tooltip: data_attr.button_tooltip //引用按钮的tooltip |
| | | } |
| | | } |
| | | var dataInfo = { |
| | | edtype: "0", |
| | | eventid: eventid, |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: this.$data.param.clsid, |
| | | objid: '', |
| | | attr: JSON.stringify(req), |
| | | extinfo: JSON.stringify(extinfo), |
| | | global_attr: JSON.stringify(this.$data.global_attr) |
| | | } |
| | | console.log(dataInfo); |
| | | dataObjRunCustomEvent(dataInfo).then(data => { |
| | | data = JSON.parse(data) |
| | | console.log(data); |
| | | if (data != "") { |
| | | var actions = data.action; |
| | | console.log(actions); |
| | | if (actions) { |
| | | for (var i = 0; i < actions.length; i++) { |
| | | var action = actions[i]; |
| | | 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> ' + '提示', |
| | | content: action.action_type + '此action尚未处理!' |
| | | }); |
| | | d.show(); |
| | | } else if (action.action_type == 'open_select_userdlg') { |
| | | var style = val.style; |
| | | // style == 'user' ? '选择人员' : style == 'department' ? '选择部门' : style == 'role' ? '选择角色' : '' |
| | | var $this = this; |
| | | var param = { |
| | | index: index, |
| | | iindex: iindex, |
| | | button_callback: button_callback, |
| | | req: req, |
| | | data_attr: data_attr |
| | | } |
| | | uni.navigateTo({ |
| | | url: '../selpsn/index?mulit=false¶m=' + JSON.stringify( |
| | | param), |
| | | events: { |
| | | AddPer(data, param) { |
| | | // console.log(param); |
| | | console.log(data); |
| | | var callback_eventid = param.button_callback.trim(); |
| | | var info = { |
| | | eventid: callback_eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: $this.$data.param.clsid, |
| | | objid: "", |
| | | attr: param.req, |
| | | inputparameter: data, |
| | | dataJson: [], |
| | | } |
| | | $this.DataObjRunCustomEvent(info, param.data_attr); |
| | | } |
| | | } |
| | | }); |
| | | } else if (action.action_type == 'open_data_query_dlg') { |
| | | var d = dialog({ |
| | | title: '<i class="ace-icon fa fa-info-circle"></i> ' + '提示', |
| | | content: action.action_type + '此action尚未处理!' |
| | | }); |
| | | 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; |
| | | if (val.config.appear_style == 'sideslip') //判断是否是侧滑 |
| | | $this.$data.popupType = 'right'; |
| | | else |
| | | $this.$data.popupType = 'center' |
| | | // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
| | | $this.$refs.popup.open($this.$data.popupType); |
| | | var popupParam = { |
| | | index: index, |
| | | iindex: iindex, |
| | | button_callback: button_callback, |
| | | req: req, |
| | | data_attr: data_attr |
| | | } |
| | | $this.$data.popupParam = popupParam; |
| | | } |
| | | } else if (action.action_type == 'open_project_query_dlg') { |
| | | //console.log(action.value.select_range); |
| | | //console.log(action.value.mulit_select); |
| | | var priRel = '-1'; |
| | | if (action.value.select_range == '全部相关') |
| | | priRel = '0'; |
| | | else if (action.value.select_range == '我负责的项目') |
| | | priRel = '1'; |
| | | else if (action.value.select_range == '我创建的') |
| | | priRel = '2'; |
| | | else if (action.value.select_range == '我参与的' || action.value |
| | | .select_range == '我参加的') |
| | | priRel = '3'; |
| | | else if (action.value.select_range == '我关注的') |
| | | priRel = '4'; |
| | | else if (action.value.select_range == '我下属的项目') |
| | | priRel = '5'; |
| | | |
| | | var $this = this; |
| | | var param_ = { |
| | | index: index, |
| | | iindex: iindex, |
| | | button_callback: button_callback, |
| | | req: req |
| | | } |
| | | uni.navigateTo({ |
| | | url: '../selPrj/index?relation=' + priRel + '¶m=' + JSON |
| | | .stringify(param_), |
| | | events: { |
| | | AddPer(data, param) { |
| | | $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.button_callback.trim(); |
| | | if (callback_eventid) { |
| | | var info = { |
| | | eventid: callback_eventid, |
| | | edtype: "2", |
| | | projectid: data[0].ID, |
| | | rclsid: "", |
| | | robjid: "", |
| | | userlogin: "", |
| | | clsid: $this.$data.param.clsid, |
| | | objid: "", |
| | | attr: param.req, |
| | | dataJson: [], |
| | | } |
| | | |
| | | $this.DataObjRunCustomEvent(info); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | var d = dialog({ |
| | | title: '<i class="ace-icon fa fa-info-circle"></i> ' + '提示', |
| | | content: action.action_type + '此action尚未处理!' |
| | | }); |
| | | d.show(); |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | uni.showModal({ |
| | | title: "提示5.2", |
| | | content: '调用 before_click_button 脚本返回空,event_id' + eventid, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | } |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: "提示5.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | }); |
| | | }, |
| | | formatAttr(attr) { |
| | | if (utils.classUtils.attrTypeIsObjRefMulti(attr.Type)) //if(ar.Type=='引用对象(多个)') |
| | | if (attr.Value == '请') ar.Value = ''; |
| | | if (utils.classUtils.attrTypeIsUser(attr.Type) || utils.classUtils.attrTypeIsProject(attr |
| | | .Type)) //if(ar.Type=='引用人员' || ar.Type=='引用项目') |
| | | return { |
| | | attr: attr.Name, |
| | | value: attr.ValID ? attr.ValID : '' |
| | | }; |
| | | else if (utils.classUtils.attrTypeIsBool(attr.Type)) //if(ar.Type=='布尔值') |
| | | return { |
| | | attr: attr.Name, |
| | | value: attr.Value ? '1' : '0' |
| | | }; |
| | | else |
| | | return { |
| | | attr: attr.Name, |
| | | value: attr.Value ? attr.Value : '' |
| | | }; |
| | | }, |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | <style> |
| | | .class_attr_title { |
| | | font-size: 44rpx; |
| | | padding-bottom: 22rpx; |
| | | position: relative; |
| | | padding-bottom: 22rpx; |
| | | position: relative; |
| | | } |
| | | |
| | | .class_attr_title .title_line { |
| | | border-bottom: 2rpx solid #aaa; |
| | | position: relative; |
| | | bottom: -50rpx; |
| | | width: calc(100% - 290rpx); |
| | | margin-left: 100px; |
| | | border-bottom: 2rpx solid #aaa; |
| | | position: relative; |
| | | bottom: -50rpx; |
| | | width: calc(100% - 290rpx); |
| | | margin-left: 100px; |
| | | } |
| | | |
| | | .class_attr_title .title_icon { |
| | | border-radius: 50%; |
| | | width: 100rpx; |
| | | border-radius: 50%; |
| | | width: 100rpx; |
| | | line-height: 64rpx; |
| | | display: inline-block; |
| | | vertical-align: middle; |
| | | padding-top: 10rpx; |
| | | display: inline-block; |
| | | vertical-align: middle; |
| | | padding-top: 10rpx; |
| | | padding-left: 20rpx; |
| | | text-align: center; |
| | | color: #fff; |
| | | text-align: center; |
| | | color: #fff; |
| | | } |
| | | |
| | | .class_attr_title i { |
| | | color: #2c6aa0!important; |
| | | color: #2c6aa0 !important; |
| | | } |
| | | |
| | | .class_attr_title .title_icon i { |
| | | font-size: 80rpx; |
| | | font-size: 80rpx; |
| | | } |
| | | |
| | | .class_attr_title .title { |
| | | padding-right: 22rpx; |
| | | display: inline-block; |
| | | background-color: #fff; |
| | | position: relative; |
| | | bottom: -8rpx; |
| | | padding-right: 22rpx; |
| | | display: inline-block; |
| | | background-color: #fff; |
| | | position: relative; |
| | | bottom: -8rpx; |
| | | } |
| | | |
| | | .class_attr_title .arrow { |
| | | position: absolute; |
| | | position: absolute; |
| | | top: 6rpx; |
| | | right: 30rpx; |
| | | font-size: 60rpx; |
| | | } |
| | | |
| | | input::-webkit-input-placeholder { |
| | | font-size: 12rpx; |
| | | } |
| | | textarea{ |
| | | |
| | | textarea { |
| | | width: 98%; |
| | | border: 1px solid #d5d5d5; |
| | | padding: 10rpx 8rpx 12rpx; |
| | |
| | | color: #046db3; |
| | | margin-top: 4px; |
| | | } |
| | | input{ |
| | | |
| | | input { |
| | | border: 1px solid #d5d5d5; |
| | | width: 98%; |
| | | height: 52rpx; |
| | |
| | | transition-duration: 0.1s; |
| | | margin-top: 4rpx; |
| | | } |
| | | .select{ |
| | | |
| | | .select { |
| | | width: 20px; |
| | | position: absolute; |
| | | opacity: 0; |
| | | } |
| | | |
| | | .class_attr_body .form-group { |
| | | margin: 20rpx 30rpx; |
| | | /* margin-left: -12px; |
| | | /* margin-left: -12px; |
| | | margin-right: -12px; */ |
| | | } |
| | | .form-group > label[class*="col-"] { |
| | | margin-bottom: 8rpx; |
| | | |
| | | .form-group>label[class*="col-"] { |
| | | margin-bottom: 8rpx; |
| | | font-size: 32rpx; |
| | | } |
| | | |
| | | .form-group label { |
| | | vertical-align: middle; |
| | | line-height: 60rpx; |
| | | vertical-align: middle; |
| | | line-height: 60rpx; |
| | | } |
| | | |
| | | .no-padding-right { |
| | | padding-right: 0 !important; |
| | | padding-right: 0 !important; |
| | | } |
| | | |
| | | .col-xs-12 { |
| | | width: 100%; |
| | | width: 100%; |
| | | } |
| | | .tx_title{ |
| | | font-size: 36rpx; |
| | | |
| | | .tx_title { |
| | | font-size: 32rpx; |
| | | } |
| | | .tx_title2{ |
| | | font-size: 36rpx; |
| | | |
| | | .tx_title2 { |
| | | font-size: 32rpx; |
| | | text-align: right; |
| | | display: inline-block; |
| | | vertical-align: -2px; |
| | | } |
| | | .text-right{ |
| | | |
| | | .text-right { |
| | | margin-right: 20rpx; |
| | | margin-top: -6rpx; |
| | | display: inline-block; |
| | | float: right; |
| | | font-size: 44rpx; |
| | | font-size: 48rpx; |
| | | } |
| | | |
| | | .text-right a, |
| | | .text-right2 a { |
| | | color: #337ab7; |
| | | } |
| | | |
| | | .text-right2 { |
| | | margin: 0; |
| | | vertical-align: -4px; |
| | | margin-left: 9px; |
| | | float: none; |
| | | font-size: 44rpx; |
| | | font-size: 48rpx; |
| | | display: inline-block; |
| | | } |
| | | .section_iput{ |
| | | |
| | | .section_iput { |
| | | border: 1px solid #d5d5d5; |
| | | width: 98%; |
| | | height: 62rpx; |
| | |
| | | box-shadow: none !important; |
| | | transition-duration: 0.1s; |
| | | } |
| | | .date_iput{ |
| | | |
| | | .date_iput { |
| | | border: 1px solid #d5d5d5; |
| | | /* width: 98%; */ |
| | | height: 62rpx; |
| | |
| | | box-shadow: none !important; |
| | | transition-duration: 0.1s; |
| | | } |
| | | |
| | | button.btn_add { |
| | | width: 49.5%; |
| | | margin-top: 50rpx; |
| | | padding: 20rpx; |
| | | line-height: 1.5; |
| | | background: #27A6E1; |
| | | border: none; |
| | | color: #fff; |
| | | font-size: 38rpx; |
| | | font-weight: bold; |
| | | float: right; |
| | | display: inline-block; |
| | | } |
| | | .i_tishi{ |
| | | |
| | | button.btn_cancel { |
| | | width: 49.5%; |
| | | margin-top: 50rpx; |
| | | padding: 20rpx; |
| | | line-height: 1.5; |
| | | background: #27A6E1; |
| | | border: none; |
| | | color: #fff; |
| | | font-size: 38rpx; |
| | | font-weight: bold; |
| | | float: left; |
| | | display: inline-block; |
| | | } |
| | | |
| | | .i_tishi { |
| | | color: red; |
| | | vertical-align: sub; |
| | | font-style: initial; |
| | | margin-left: 20rpx; |
| | | font-size: 17px; |
| | | } |
| | | .attr_field{ |
| | | |
| | | .attr_field { |
| | | display: inline-block; |
| | | vertical-align: middle; |
| | | margin-left: 8px; |
| | | /* width: 71%; */ |
| | | } |
| | | </style> |
| | | |
| | | <template> |
| | | <view class="content"> |
| | | <view class="v-area" v-for="(classattr,index) in classAttrList"> |
| | | <div class="class_attr_title"> |
| | | <div class="title_line"></div> |
| | | <div class="title_icon" :style="{'background-color':classattr.BkColor}"> |
| | | <i class="ace-icon fa" :class="classattr.ImgFontStyle"></i> |
| | | </div> |
| | | <span class="title">{{classattr.Name}}</span> |
| | | <a href="javascript:;" class="arrow" @tap="onarrow(index,classattr.Open)"><i class="ace-icon fa ":class="classattr.Open?'fa-angle-down':'fa-angle-up'"></i></a> |
| | | </div> |
| | | <div class="class_attr_body" :style="{'display':classattr.Open?'block':'none'}"> |
| | | <div class="dv_field_div" v-for="(attr,iindex) in classattr.Attr"> |
| | | <view class="form-group" v-if="attr.Type=='字符串' || attr.Type=='可变长字符串' || attr.Type=='整数' || attr.Type=='浮点数'" :style="{'display':attr.hidden == 'True'?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:<i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i></text> |
| | | <div class="text-right" v-if="attr.ext_button==true"> |
| | | <a @tap="classAttr_extButton(index,iindex)" ><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <input type="text" :value="attr.Value" @focus="ontap" @blur="onevent" v-if="attr.Height=='1'" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" :readonly="attr.edit=='Flase'?true:false" > |
| | | <textarea :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='2'" :data-index="index":data-iindex="iindex" style="height:60px;" :style="{'width':attr.Width}" :readonly="attr.edit=='Flase'?true:false"></textarea> |
| | | <textarea :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='3'" :data-index="index":data-iindex="iindex" style="height:90px;" :style="{'width':attr.Width}" :readonly="attr.edit=='Flase'?true:false"></textarea> |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | | <input type="text" class="attr_field" :value="attr.Value" @focus="ontap" @blur="onevent" v-if="attr.Height=='1'" :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.NotEmpty=='1'?10:5) - (attr.ext_button==true?9:0) +'%'}" :readonly="attr.edit=='Flase'?true:false" > |
| | | <textarea class="attr_field" :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='2'" :data-index="index":data-iindex="iindex" style="height:60px;" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.NotEmpty=='1'?10:5) - (attr.ext_button==true?9:0) +'%'}" :readonly="attr.edit=='Flase'?true:false"></textarea> |
| | | <textarea class="attr_field" :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='3'" :data-index="index":data-iindex="iindex" style="height:90px;" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.NotEmpty=='1'?10:5) - (attr.ext_button==true?9:0) +'%'}" :readonly="attr.edit=='Flase'?true:false"></textarea> |
| | | <div class="text-right2" v-if="attr.ext_button==true"> |
| | | <a @tap="classAttr_extButton(index,iindex)" ><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='布尔值'" :style="{'display':attr.hidden == 'True'?'none':''}"> |
| | | <checkbox-group class="check_rememberPwd" @change="oncheck" :data-ischeck="attr.Value" :data-index="index" :data-iindex="iindex" :style="{'margin-left': classattr.control_style=='左右布局'?classattr.title_p_wdith+2 +'%':'10rpx'}"> |
| | | <label> |
| | | <checkbox :value="attr.Value" :checked="attr.Value"/> |
| | | <text>{{attr.DispName}}<i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i></text> |
| | | </label> |
| | | </checkbox-group> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='日期' || attr.Type=='时间'" :style="{'display':attr.hidden == 'True'?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:<i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i></text> |
| | | <picker mode="date" :value="attr.Value" @change="ondateTime" class="date_iput" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}"> |
| | | <view class="picker">{{attr.Value}}</view> |
| | | </picker> |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | | <picker mode="date" :value="attr.Value" @change="ondateTime" class="date_iput attr_field" :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.NotEmpty=='1'?10:5) +'%'}"> |
| | | <view class="picker">{{attr.Value}}</view> |
| | | </picker> |
| | | <i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='字典' || attr.Type=='字典-字符串'" :style="{'display':attr.hidden == 'True'?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i></text> |
| | | <picker class="section_iput" @change="onchange" :range="attr.dictitem" range-key="CN_S_NAME" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}"> |
| | | <label class="">{{ attr.Value }}</label> |
| | | </picker> |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | | <picker class="section_iput attr_field" @change="onchange" :range="attr.dictitem" range-key="CN_S_NAME" :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.NotEmpty=='1'?10:5) +'%'}"> |
| | | <label class="">{{ attr.Value }}</label> |
| | | </picker> |
| | | <i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='引用对象(单个)' || attr.Type=='引用对象(多个)'" :style="{'display':attr.hidden == 'True'?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i></text> |
| | | <div class="text-right" v-if="attr.Type=='引用对象(单个)'"> |
| | | <a @tap="classAttr_AddRef" :data-classid="attr.RelCls.split('|')[0]" :data-classname="attr.RelCls.split('|')[1]" ><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <div class="text-right" v-if="attr.Type=='引用对象(多个)'"> |
| | | <picker class="select" @change="classAttr_AddRef" :range="attr.RelClsList" range-key="name" :data-index="index" :data-iindex="iindex"> |
| | | <label class="">{{ attr.Value }}</label> |
| | | </picker> |
| | | <a class="class_attr_add_ref"><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <input type="text" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" disabled="true" > |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | | <input type="text" class="attr_field" :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.NotEmpty=='1'?10:5) - 9 +'%'}" disabled="true" > |
| | | <div class="text-right2" v-if="attr.Type=='引用对象(单个)'"> |
| | | <a @tap="classAttr_AddRef" :data-classid="attr.RelCls.split('|')[0]" :data-classname="attr.RelCls.split('|')[1]" ><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <div class="text-right2" v-if="attr.Type=='引用对象(多个)'"> |
| | | <picker class="select" @change="classAttr_AddRef" :range="attr.RelClsList" range-key="name" :data-index="index" :data-iindex="iindex"> |
| | | <label class="">{{ attr.Value }}</label> |
| | | </picker> |
| | | <a class="class_attr_add_ref"><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='引用人员'" :style="{'display':attr.hidden == 'True'?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i></text> |
| | | <div class="text-right"> |
| | | <a class="class_attr_add_per" @tap="classAttr_AddPer(index,iindex)"><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true" > |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | | <input type="text" class="attr_field" :value="attr.Value" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.NotEmpty=='1'?10:5) - 9 +'%'}" disabled="true" > |
| | | <div class="text-right2"> |
| | | <a class="class_attr_add_per" @tap="classAttr_AddPer(index,iindex)"><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='引用项目'" :style="{'display':attr.hidden == 'True'?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i></text> |
| | | <div class="text-right"> |
| | | <a href="#" class="class_attr_add_prj" @tap="classAttr_AddPrj(index,iindex)"><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true" > |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | | <input type="text" class="attr_field" :value="attr.Value" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.NotEmpty=='1'?10:5) - 9 +'%'}" disabled="true" > |
| | | <div class="text-right2"> |
| | | <a class="class_attr_add_prj" @tap="classAttr_AddPrj(index,iindex)"><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='编码'" :style="{'display':attr.hidden == 'True'?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i></text> |
| | | <input type="text" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" :readonly="attr.edit=='Flase'?true:false" > |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | | <input type="text" class="attr_field" :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.NotEmpty=='1'?10:5) +'%'}" :readonly="attr.edit=='Flase'?true:false" > |
| | | <i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='省市区'" :style="{'display':attr.hidden == 'True'?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i></text> |
| | | <pickerAddress class="date_iput" @change="addresschange" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" >{{attr.Value}}</pickerAddress> |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | | <pickerAddress class="date_iput attr_field" @change="addresschange" :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.NotEmpty=='1'?10:5) +'%'}">{{attr.Value}}</pickerAddress> |
| | | <i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i> |
| | | </view> |
| | | </view> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <button type="default" @tap="sava" class="btn_add">{{title}}</button> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import pickerAddress from '../../js/pickerAddress/pickerAddress.vue' |
| | | export default { |
| | | components: { |
| | | pickerAddress |
| | | }, |
| | | data() { |
| | | return { |
| | | title: '新增', |
| | | param:{}, |
| | | classAttrList:[], |
| | | classGridStyle:[], |
| | | edit_inital_event:"", //弹窗初始化事件ID |
| | | edit_ok_event:"", //弹窗点击OK 触发事件ID |
| | | edit_select_compose_event:"", //选择组成对象时调用 |
| | | edit_compose_cls_id:"", |
| | | global_attr:[], |
| | | refdatastore: [], //引用数据存储区// {attr:'G_PRJ_' + bindattr + '_ID', value:info.id} |
| | | |
| | | } |
| | | }, |
| | | onLoad(options) { |
| | | // console.log(options); |
| | | this.$data.title = options.titlename; //设置按钮文字 |
| | | uni.setNavigationBarTitle({ title: options.titlename}); //设置顶部标题 |
| | | var param = JSON.parse(options.param); |
| | | // console.log(param); |
| | | if(!param.EditDlgMode){ |
| | | uni.showModal({title:"提示",content:"该功能点未配置编辑窗口,请重新配置!",showCancel:false,confirmText:"取消"}); |
| | | return; |
| | | } |
| | | if(!param.Edit_dlg.Name){ |
| | | uni.showModal({title:"提示",content:"该功能点未配置窗口样式,请重新配置!",showCancel:false,confirmText:"取消"}); |
| | | return; |
| | | } |
| | | this.$data.param = param; |
| | | var edit_dlg = { |
| | | Model: param.EditDlgMode, |
| | | Name: param.Edit_dlg.Name |
| | | } |
| | | var dataInfo = { |
| | | class_id: param.clsid |
| | | }; |
| | | var $this = this; |
| | | $this.$store.state.thisareaFuncID = param.clsid; |
| | | // console.log($this.$store.getters.getclassAttrList); |
| | | //获取 |
| | | if($this.$store.getters.getclassAttrList){ |
| | | $this.$data.classAttrList = $this.$store.getters.getclassAttrList.data; |
| | | $this.classGridStyleInfo(); |
| | | }else |
| | | $this.$store.dispatch('classAttrList',dataInfo).then(success=>{ |
| | | // console.log(success); |
| | | if (success.code=='00000') { |
| | | $this.$data.classAttrList = success.data; |
| | | |
| | | $this.classGridStyleInfo(); |
| | | }else{ |
| | | uni.showModal({title:"错误1",content:success.msg,showCancel:false,confirmText:"取消"}); |
| | | } |
| | | }).catch(ex=>{ |
| | | // console.log(ex); |
| | | uni.showModal({title:"错误1.1",content:ex.errMsg,showCancel:false,confirmText:"取消"}); |
| | | }); |
| | | |
| | | |
| | | }, |
| | | methods: { |
| | | async classGridStyleInfo(){ |
| | | var $this = this; |
| | | var gridstyleInfo = { |
| | | class_id: $this.$data.param.clsid, |
| | | name: $this.$data.param.Edit_dlg.Name, |
| | | type: '2' |
| | | }; |
| | | $this.$store.state.thisEditName = $this.$data.param.Edit_dlg.Name |
| | | // console.log($this.$store.getters.getclassGridStyleInfo); |
| | | //获取 |
| | | if($this.$store.getters.getclassGridStyleInfo){ |
| | | $this.$data.classGridStyle = $this.$store.getters.getclassGridStyleInfo.data; |
| | | $this.class_attr_init(); |
| | | }else{ |
| | | //console.log(gridstyleInfo); |
| | | $this.$store.dispatch('classGridStyleInfo',gridstyleInfo).then(success=>{ |
| | | // console.log(success); |
| | | if (success.code=='00000') { |
| | | success.data.StyleDef = JSON.parse(success.data.StyleDef); |
| | | $this.$data.classGridStyle = success.data; |
| | | |
| | | $this.class_attr_init(); |
| | | }else{ |
| | | uni.showModal({title:"错误1.2",content:success.msg,showCancel:false,confirmText:"取消"}); |
| | | } |
| | | }).catch(ex=>{ |
| | | console.log(ex); |
| | | uni.showModal({title:"错误1.3",content:ex.errMsg,showCancel:false,confirmText:"取消"}); |
| | | }); |
| | | } |
| | | }, |
| | | ontap(e){ //扫码功能 |
| | | //console.log(e.target) |
| | | getApp().onScan((result)=>{ |
| | | //console.log(result.decodedata); |
| | | this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result.decodedata; |
| | | }) |
| | | }, |
| | | onarrow(index,open){ |
| | | // console.log(index+'--'+open); |
| | | this.$data.classAttrList[index].Open=open==true?false:true; |
| | | }, |
| | | ondateTime(e) { |
| | | //console.log(e.target) |
| | | this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=e.target.value; |
| | | }, |
| | | onchange(e) { |
| | | // console.log(e.target); |
| | | var value=this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].dictitem[e.target.value]; |
| | | var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]; |
| | | // console.log(data_attr); |
| | | if (value.Name != data_attr.Value) { |
| | | this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value.Name; |
| | | var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].action; |
| | | if (eventid) { |
| | | // self.event_no_sub = 1; |
| | | var req=[]; |
| | | var attrlist = this.$data.classAttrList; |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if(ar.Type=='引用对象(多个)') |
| | | if(ar.Value=='请') ar.Value=''; |
| | | if(ar.Type=='引用人员' || ar.Type=='引用项目') |
| | | req.push({ attr: ar.Name, val: ar.ValID ?ar.ValID :'' }); |
| | | else if(ar.Type=='布尔值') |
| | | req.push({ attr: ar.Name, val: ar.Value?'1':'0'}); |
| | | else |
| | | req.push({ attr: ar.Name, val: ar.Value ?ar.Value :''}); |
| | | } |
| | | } |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: this.$data.param.clsid, |
| | | objid: "", |
| | | attr: req, |
| | | } |
| | | this.DataObjRunCustomEvent(info); |
| | | } |
| | | } |
| | | |
| | | }, |
| | | onevent(e){ |
| | | // console.log(e.target); |
| | | var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]; |
| | | // console.log(data_attr); |
| | | if (e.target.value != data_attr.Value) { |
| | | this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=e.target.value; |
| | | var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].action; |
| | | if (eventid) { |
| | | // self.event_no_sub = 1; |
| | | var req=[]; |
| | | var attrlist = this.$data.classAttrList; |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if(ar.Type=='引用对象(多个)') |
| | | if(ar.Value=='请') ar.Value=''; |
| | | if(ar.Type=='引用人员' || ar.Type=='引用项目') |
| | | req.push({ attr: ar.Name, val: ar.ValID ?ar.ValID :'' }); |
| | | else if(ar.Type=='布尔值') |
| | | req.push({ attr: ar.Name, val: ar.Value?'1':'0'}); |
| | | else |
| | | req.push({ attr: ar.Name, val: ar.Value ?ar.Value :''}); |
| | | } |
| | | } |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: this.$data.param.clsid, |
| | | objid: "", |
| | | attr: req, |
| | | } |
| | | this.DataObjRunCustomEvent(info, data_attr); |
| | | } |
| | | } |
| | | |
| | | }, |
| | | oncheck(e) { |
| | | // console.log(e.target); |
| | | var ischecked = e.target.dataset.ischeck?false:true; |
| | | var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]; |
| | | // console.log(data_attr); |
| | | if (ischecked != data_attr.Value) { |
| | | this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=ischecked; |
| | | var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].action; |
| | | if (eventid) { |
| | | // self.event_no_sub = 1; |
| | | var req=[]; |
| | | var attrlist = this.$data.classAttrList; |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if(ar.Type=='引用对象(多个)') |
| | | if(ar.Value=='请') ar.Value=''; |
| | | if(ar.Type=='引用人员' || ar.Type=='引用项目') |
| | | req.push({ attr: ar.Name, val: ar.ValID ?ar.ValID :'' }); |
| | | else if(ar.Type=='布尔值') |
| | | req.push({ attr: ar.Name, val: ar.Value?'1':'0'}); |
| | | else |
| | | req.push({ attr: ar.Name, val: ar.Value ?ar.Value :''}); |
| | | |
| | | } |
| | | } |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: this.$data.param.clsid, |
| | | objid: "", |
| | | attr: req, |
| | | } |
| | | this.DataObjRunCustomEvent(info); |
| | | } |
| | | } |
| | | |
| | | }, |
| | | addresschange(e) { |
| | | // console.log(e.target); |
| | | console.log(e.data.join(';')) |
| | | this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=e.data.join(';'); |
| | | }, |
| | | classAttr_extButton(index,iindex){ |
| | | var $this = this; |
| | | var before_click_button = $this.$data.classAttrList[index].Attr[iindex].before_click_button; |
| | | var button_callback = $this.$data.classAttrList[index].Attr[iindex].button_callback; |
| | | if(!before_click_button){ |
| | | uni.showModal({title:"提示",content:"before_click_button-event_id为空!",showCancel:false,confirmText:"取消"}); |
| | | return; |
| | | } |
| | | if(!button_callback){ |
| | | uni.showModal({title:"提示",content:"button_callback-event_id为空!",showCancel:false,confirmText:"取消"}); |
| | | return; |
| | | } |
| | | var data_attr = this.$data.classAttrList[index].Attr[iindex]; |
| | | this.DataObjRunCustomEvent_Return(before_click_button, data_attr, button_callback, index,iindex); |
| | | }, |
| | | classAttr_AddPer(index,iindex){ |
| | | var param={index:index,iindex:iindex}; |
| | | var $this = this; |
| | | uni.navigateTo({ |
| | | url:'../selpsn/index?mulit=false¶m='+JSON.stringify(param), |
| | | events:{ |
| | | AddPer(data,param){ |
| | | // console.log(param); |
| | | console.log(data); |
| | | $this.$data.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; |
| | | $this.$data.classAttrList[param.index].Attr[param.iindex].ValID=data[0].Login+';'+data[0].Name; |
| | | |
| | | var eventid = $this.$data.classAttrList[param.index].Attr[param.iindex].action; |
| | | if (eventid) { |
| | | eventid = eventid.trim(); |
| | | if (eventid) { |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "4", |
| | | projectid: "", |
| | | rclsid: "", |
| | | robjid: "", |
| | | userlogin: data[0].Login, |
| | | clsid: $this.$data.param.clsid, |
| | | objid: "", |
| | | attr: [], |
| | | } |
| | | |
| | | // var data_attr = $this.$data.classAttrList[param.index].Attr[param.iindex]; |
| | | $this.DataObjRunCustomEvent(info); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | classAttr_AddRef(e){ |
| | | console.log(e.target); |
| | | uni.showModal({title:"提示",content:"此功能还未实现!",showCancel:false,confirmText:"取消"}); |
| | | // var value=this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.target.value]; |
| | | // this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value; |
| | | }, |
| | | classAttr_AddPrj(index,iindex){ |
| | | var param={index:index,iindex:iindex}; |
| | | var $this = this; |
| | | uni.navigateTo({ |
| | | url:'../selPrj/index?relation=-1¶m='+JSON.stringify(param), |
| | | events:{ |
| | | AddPer(data,param){ |
| | | // console.log(param); |
| | | // console.log(data); |
| | | $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 eventid = $this.$data.classAttrList[param.index].Attr[param.iindex].action; |
| | | if (eventid) { |
| | | eventid = eventid.trim(); |
| | | if (eventid) { |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "2", |
| | | projectid: data[0].ID, |
| | | rclsid: "", |
| | | robjid: "", |
| | | userlogin: "", |
| | | clsid: $this.$data.param.clsid, |
| | | objid: "", |
| | | attr: [], |
| | | } |
| | | |
| | | // var data_attr = $this.$data.classAttrList[param.index].Attr[param.iindex]; |
| | | $this.DataObjRunCustomEvent(info); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | sava(){ |
| | | if (this.$data.edit_ok_event) |
| | | this.OKDataObjRunCustomEvent(); |
| | | else |
| | | this.add(); |
| | | }, |
| | | add(){ |
| | | var req=[]; |
| | | var attrlist = this.$data.classAttrList; |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if(ar.NotEmpty=='1'){ |
| | | uni.showModal({title:"提示",content:'字段:'+ar.Name+',值不能为空!',showCancel:false,confirmText:"取消"}); |
| | | return; |
| | | } |
| | | if(ar.Value=='请选择') ar.Value=''; |
| | | if(ar.Type=='引用对象(多个)') |
| | | if(ar.Value=='请') ar.Value=''; |
| | | if(ar.Type=='引用人员' || ar.Type=='引用项目') |
| | | req.push({ name: ar.Name, value: ar.ValID ?ar.ValID :'' }); |
| | | else if(ar.Type=='布尔值') |
| | | req.push({ name: ar.Name, value: ar.Value?'1':'0'}); |
| | | else |
| | | req.push({ name: ar.Name, value: ar.Value ?ar.Value :''}); |
| | | } |
| | | } |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: this.$data.param.clsid, // 功能点主数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: '新增', |
| | | master: { |
| | | cls_id: this.$data.param.clsid, |
| | | } |
| | | }; |
| | | |
| | | var dataInfo={ |
| | | class_id: this.$data.param.clsid, data_obj_id: '', masterclsid: '', |
| | | req: JSON.stringify(req), upfile: JSON.stringify([]), post_data: JSON.stringify({}), |
| | | compose: JSON.stringify([]), refdatastore: JSON.stringify([]), extinfo: JSON.stringify(enviroment), |
| | | not_trigger_sys_event: '' |
| | | }; |
| | | console.log(dataInfo); |
| | | this.$store.dispatch('addclassattr',dataInfo).then(success=>{ |
| | | console.log(success); |
| | | if (success.code=='00000') { |
| | | this.class_attr_init(); |
| | | }else{ |
| | | uni.showModal({title:"错误5",content:success.msg,showCancel:false,confirmText:"取消"}); |
| | | } |
| | | }).catch(ex=>{ |
| | | // console.log(ex); |
| | | uni.showModal({title:"错误5.1",content:ex.errMsg,showCancel:false,confirmText:"取消"}); |
| | | }); |
| | | }, |
| | | class_attr_init(){ |
| | | var attrlist = this.$data.classGridStyle.StyleDef.show_style |
| | | var newattrlist = []; |
| | | if (this.$data.classAttrList.length > 0) { |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var open = attrlist[i].open; |
| | | var name = attrlist[i].attrgroup_name; |
| | | var attrs = attrlist[i].attrs; |
| | | for (var s = 0; s < this.$data.classAttrList.length; s++) { |
| | | var clsattr = this.$data.classAttrList[s]; |
| | | if (name == clsattr.Name) { |
| | | var attr = []; |
| | | for (var j = 0; j < attrs.length; j++) { |
| | | for (var l = 0; l < clsattr.Attr.length; l++) { |
| | | var ca = clsattr.Attr[l]; |
| | | if (attrs[j].attr == ca.Name) { |
| | | ca.action = attrs[j].action; |
| | | ca.edit = attrs[j].edit; |
| | | ca.notempty = attrs[j].notempty; |
| | | ca.ext_button = attrs[j].ext_button; |
| | | ca.button_img = attrs[j].button_img; |
| | | ca.button_tooltip = attrs[j].button_tooltip; |
| | | ca.before_click_button = attrs[j].before_click_button; |
| | | ca.button_callback = attrs[j].button_callback; |
| | | ca.hidden = attrs[j].hidden; |
| | | attr.push(ca); |
| | | if(ca.dictitem){ |
| | | // var dictitem=ca.dictitem; |
| | | // var dictitemlist=[]; |
| | | // for (var d = 0; d < dictitem.length; d++) { |
| | | // dictitemlist.push(dictitem[d].CN_S_NAME); |
| | | // } |
| | | // ca.dictitemlist = dictitemlist; |
| | | ca.Value = ca.dictitem[0].CN_S_NAME; |
| | | } |
| | | if(ca.Type=='日期' || ca.Type=='时间'){ |
| | | var nowDate = new Date(); |
| | | var date = {year: nowDate.getFullYear(),month: nowDate.getMonth() + 1,day: nowDate.getDate()} |
| | | ca.Value = date.year + '-' + (date.month >= 10 ? date.month : '0' + date.month) + '-' + (date.day >= 10 ? date.day : '0' + date.day); |
| | | } |
| | | if(ca.Type=='引用对象(多个)'){ |
| | | var relClsList=[]; |
| | | var attr_rescls = ca.RelCls.split(','); |
| | | for(var ii in attr_rescls){ |
| | | var rescls = attr_rescls[ii].split('|'); |
| | | relClsList.push({id:rescls[0],name:rescls[1]}); |
| | | } |
| | | ca.RelClsList = relClsList; |
| | | ca.Value = '请'; |
| | | } |
| | | if(ca.Type=='省市区') |
| | | ca.Value = '请选择'; |
| | | if(ca.Type=='布尔值') |
| | | ca.Value = false; |
| | | } |
| | | } |
| | | } |
| | | newattrlist.push({ |
| | | BkColor: clsattr.BkColor, |
| | | HasAce: clsattr.HasAce, |
| | | ImgFontStyle: clsattr.ImgFontStyle, |
| | | Name: clsattr.Name, |
| | | Order: clsattr.Order, |
| | | Open: open, |
| | | Attr: attr, |
| | | control_style:this.$data.classGridStyle.StyleDef.control_style, |
| | | title_p_wdith:this.$data.classGridStyle.StyleDef.title_p_wdith |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | if (newattrlist.length > 0) { |
| | | this.$data.classAttrList = newattrlist; |
| | | } |
| | | var req=[]; |
| | | if (this.$data.classGridStyle.StyleDef) { |
| | | if (this.$data.classGridStyle.StyleDef.show_style.length > 0) { |
| | | var attrlist = this.$data.classGridStyle.StyleDef.show_style |
| | | // $el.find('.attr_field').prop('readonly', true); |
| | | // $el.find('.attr_field').prop('disabled', true); |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].attrs |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | req.push({ attr: ar.attr, val: ar.value?ar.value:'' }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | var eventlist = this.$data.classGridStyle.StyleDef.event; |
| | | if (eventlist) { |
| | | if (eventlist.length > 0) { |
| | | for (var i = 0; i < eventlist.length; i++) { |
| | | if (eventlist[i].event_id == 'before_ok') { |
| | | this.$data.edit_ok_event = eventlist[i]; |
| | | } else if (eventlist[i].event_id == 'initial') { |
| | | this.$data.edit_inital_event = eventlist[i]; |
| | | } else if (eventlist[i].event_id == 'before_select_compose') { |
| | | this.$data.edit_select_compose_event = eventlist[i].scrip_id; |
| | | this.$data.edit_compose_cls_id = eventlist[i].compose_cls_id; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | console.log(req); |
| | | if (this.$data.edit_inital_event) { |
| | | var eventid = this.$data.edit_inital_event.scrip_id; |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: this.$data.param.clsid, |
| | | objid: "", |
| | | attr: req, |
| | | } |
| | | this.ini_DataObjRunCustomEvent(info); |
| | | } |
| | | console.log(this.$data.classGridStyle); |
| | | console.log(this.$data.classAttrList); |
| | | |
| | | } else { |
| | | uni.showModal({title:"提示",content:"未找到可显示的的属性",showCancel:false,confirmText:"取消"}); |
| | | } |
| | | }, |
| | | ini_DataObjRunCustomEvent(info){ |
| | | var param = { |
| | | EditStyle: this.$data.param.Edit_dlg.Name, |
| | | ViewStyle: this.$data.param.Edit_dlg.Name, |
| | | NotTriggerSysEvent: 0, |
| | | enviroment: { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: this.$data.param.clsid, // 功能点主数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: '新增', |
| | | master: { |
| | | cls_id: this.$data.param.clsid, // button=bottom时 master的cls_id |
| | | //obj_id: '' // button=bottom时 master的obj_id |
| | | } |
| | | } |
| | | } |
| | | var inputparameter = ''; |
| | | var global_attr = ''; |
| | | |
| | | var dataInfo = { |
| | | edtype: info.edtype, eventid: info.eventid, projectid: info.projectid, |
| | | rclsid: info.rclsid, robjid: info.robjid, userlogin: info.userlogin, clsid: info.clsid, objid: info.objid, |
| | | attr: JSON.stringify(info.attr), extinfo: JSON.stringify(param), inputparameter: inputparameter, global_attr: global_attr |
| | | } |
| | | console.log(dataInfo); |
| | | this.$store.dispatch('DataObjRunCustomEventInfo',dataInfo).then(success=>{ |
| | | console.log(success); |
| | | if (success.code=='00000') { |
| | | var data = JSON.parse(success.data); |
| | | var actionlist = data.action; |
| | | if (actionlist) { |
| | | for (var j = 0; j < actionlist.length; j++) { |
| | | var action = actionlist[j] |
| | | var action_type = action.action_type; |
| | | var value = action.value; |
| | | if (action_type == 'set_dlg_attr') { |
| | | if (value) { |
| | | var val = value; |
| | | if (typeof value == 'string') { |
| | | val = JSON.parse(value); |
| | | } |
| | | console.log(val); |
| | | for (var i = 0; i < val.length; i++) { |
| | | for (var a = 0; a < this.$data.classAttrList.length; a++) { |
| | | for (var l = 0; l < this.$data.classAttrList[a].Attr.length; l++) { |
| | | var ca = this.$data.classAttrList[a].Attr[l]; |
| | | if (val[i].attr == ca.Name) { |
| | | ca.value = val[i].value; |
| | | } |
| | | } |
| | | } |
| | | // if ($el_attr.data('type') == 'bool') { |
| | | // $el_attr.prop('checked', val[i].value == 'Y' || val[i].value == 'y' || val[i].value == '1') |
| | | // } |
| | | // else { |
| | | // if (val[i].choice_list) { |
| | | // $el_attr.empty(); |
| | | // val[i].choice_list.forEach(function (list) { |
| | | // $el_attr.append('<option value="' + list + '">' + list + '</option>'); |
| | | // }) |
| | | // } |
| | | // $el_attr.val(val[i].value); |
| | | // } |
| | | // $el_attr.data('val', val[i].value); |
| | | |
| | | var length = 0; |
| | | if (!this.$data.refdatastore.filter(function (s) { |
| | | return val[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | this.$data.refdatastore.push(val[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < this.$data.refdatastore.length; j++) { |
| | | if (this.$data.refdatastore[j].attr == val[i].attr) { |
| | | this.$data.refdatastore[j].value = val[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (action_type == 'open_select_userdlg') { |
| | | uni.showModal({title:"错误2.2",content:"open_select_userdlg这个action_type还未处理!",showCancel:false,confirmText:"取消"}); |
| | | } |
| | | } |
| | | } |
| | | |
| | | }else{ |
| | | uni.showModal({title:"错误2",content:success.msg,showCancel:false,confirmText:"取消"}); |
| | | } |
| | | }).catch(ex=>{ |
| | | // console.log(ex); |
| | | uni.showModal({title:"错误2.1",content:ex.errMsg,showCancel:false,confirmText:"取消"}); |
| | | }); |
| | | }, |
| | | DataObjRunCustomEvent(info,data_attr){ |
| | | var $this = this; |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: this.$data.param.clsid, // 功能点主数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: '新增', |
| | | master: { |
| | | cls_id: this.$data.param.clsid, // button=bottom时 master的cls_id |
| | | //obj_id: '' // button=bottom时 master的obj_id |
| | | } |
| | | }; |
| | | if(data_attr){ |
| | | enviroment.edit_dlg = { |
| | | type: 'small',//小窗口 |
| | | class_id: this.$data.param.clsid,//当前数据类id |
| | | } |
| | | if (data_attr) { |
| | | enviroment.edit_dlg.form_control = {//所属的表单控件 |
| | | name: data_attr.Name,//字段属性 |
| | | text: data_attr.DispName,//显示文本 |
| | | group_name: data_attr.GroupName,//属性组 |
| | | type: data_attr.Type,//字段类型 |
| | | readonly: data_attr.ReadOnly,//是否只读 |
| | | button_img: data_attr.button_img,//引用按钮的图标 |
| | | button_tooltip: data_attr.button_tooltip//引用按钮的tooltip |
| | | } |
| | | } |
| | | } |
| | | var dataInfo = { |
| | | edtype: info.edtype, eventid: info.eventid, projectid: info.projectid.replace('{','').replace('}',''), |
| | | rclsid: info.rclsid, robjid: info.robjid, userlogin: info.userlogin, clsid: info.clsid, objid: info.objid, |
| | | attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), inputparameter: '', global_attr: JSON.stringify(this.$data.global_attr) |
| | | } |
| | | console.log(dataInfo); |
| | | this.$store.dispatch('DataObjRunCustomEventInfo',dataInfo).then(success=>{ |
| | | console.log(success); |
| | | if (success.code=='00000') { |
| | | var data = JSON.parse(success.data); |
| | | var actionlist = data.action; |
| | | |
| | | if (actionlist) { |
| | | console.log(actionlist); |
| | | for (var i = 0; i < actionlist.length; i++) { |
| | | var action = actionlist[i]; |
| | | if (action.action_type == 'set_dlg_attr') { |
| | | var result = action.value; |
| | | for (var i = 0; i < result.length; i++) { |
| | | if (result[i].choice_list) { |
| | | for (var c = 0; c < $this.$data.classAttrList.length; c++) { |
| | | var attr = $this.$data.classAttrList[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | if(attr[j].Name==result[i].attr){ |
| | | if(attr[j].Type=='字典' || attr[j].Type=='字典-字符串'){ |
| | | attr[j].dictitem = result[i].choice_list; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | for (var c = 0; c < $this.$data.classAttrList.length; c++) { |
| | | var attr = $this.$data.classAttrList[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | console.log(attr[j].Name+'=='+result[i].attr); |
| | | if(attr[j].Name==result[i].attr){ |
| | | attr[j].Value = 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; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } else if (data.action[i].action_type == 'set_global_attr') { |
| | | $this.$data.global_attr = data.action[i].value || []; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (data.result) { |
| | | var result = data.result; |
| | | for (var i = 0; i < result.length; i++) { |
| | | for (var c = 0; c < $this.$data.classAttrList.length; c++) { |
| | | var attr = $this.$data.classAttrList[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | if(attr[j].Name==result[i].attr){ |
| | | attr[j].Value = 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; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | uni.showModal({title:"错误3",content:success.msg,showCancel:false,confirmText:"取消"}); |
| | | } |
| | | }).catch(ex=>{ |
| | | // console.log(ex); |
| | | uni.showModal({title:"错误3.1",content:ex.errMsg,showCancel:false,confirmText:"取消"}); |
| | | }); |
| | | }, |
| | | OKDataObjRunCustomEvent(){ |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: this.$data.param.clsid, // 功能点主数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: '新增', |
| | | master: { |
| | | cls_id: this.$data.param.clsid, // button=bottom时 master的cls_id |
| | | |
| | | } |
| | | }; |
| | | |
| | | var eventid = this.$data.edit_ok_event.scrip_id; |
| | | var req=[]; |
| | | var attrlist = this.$data.classAttrList; |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if(ar.Value=='请选择') ar.Value=''; |
| | | if(ar.Type=='引用对象(多个)') |
| | | if(ar.Value=='请') ar.Value=''; |
| | | if(ar.Type=='引用人员' || ar.Type=='引用项目') |
| | | req.push({ attr: ar.Name, val: ar.ValID ?ar.ValID :'' }); |
| | | else if(ar.Type=='布尔值') |
| | | req.push({ attr: ar.Name, val: ar.Value?'1':'0'}); |
| | | else |
| | | req.push({ attr: ar.Name, val: ar.Value }); |
| | | } |
| | | } |
| | | |
| | | if (this.$data.refdatastore.length > 0) { |
| | | for (var i = 0; i < this.$data.refdatastore.length; i++) { |
| | | if (!req.filter(function (s) { |
| | | return this.$data.refdatastore[i].attr == s.name |
| | | }).length) { |
| | | length = 1; |
| | | req.push({ 'attr': this.$data.refdatastore[i].attr, 'val': this.$data.refdatastore[i].value }); |
| | | } |
| | | } |
| | | } |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: this.$data.param.clsid, |
| | | objid: "", |
| | | attr: req, |
| | | } |
| | | var dataInfo = { |
| | | edtype: info.edtype, eventid: info.eventid, projectid: info.projectid,rclsid: info.rclsid, |
| | | robjid: info.robjid, userlogin: info.userlogin, clsid: info.clsid, objid: info.objid, |
| | | attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), global_attr: JSON.stringify(this.$data.global_attr) |
| | | } |
| | | console.log(dataInfo); |
| | | this.$store.dispatch('DataObjRunCustomEventInfo',dataInfo).then(success=>{ |
| | | console.log(success); |
| | | if (success.code=='00000') { |
| | | var data = JSON.parse(success.data); |
| | | var result = data.result; |
| | | for (var i = 0; i < result.length; i++) { |
| | | // self.class_attr_ele.find('.attr_field[data-field="' + result[i].attr + '"]').val(result[i].value).data('val', 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.add(); |
| | | }else{ |
| | | uni.showModal({title:"错误4",content:success.msg,showCancel:false,confirmText:"取消"}); |
| | | } |
| | | }).catch(ex=>{ |
| | | // console.log(ex); |
| | | uni.showModal({title:"错误4.1",content:ex.errMsg,showCancel:false,confirmText:"取消"}); |
| | | }); |
| | | }, |
| | | DataObjRunCustomEvent_Return(eventid,data_attr,button_callback,index,iindex){ |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: this.$data.param.clsid, // 功能点主数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: '新增', |
| | | master: { |
| | | cls_id: this.$data.param.clsid, // button=bottom时 master的cls_id |
| | | //obj_id: '' // button=bottom时 master的obj_id |
| | | } |
| | | }; |
| | | var req=[]; |
| | | var attrlist = this.$data.classAttrList; |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if(ar.Value=='请选择') ar.Value=''; |
| | | if(ar.Type=='引用对象(多个)') |
| | | if(ar.Value=='请') ar.Value=''; |
| | | if(ar.Type=='引用人员' || ar.Type=='引用项目') |
| | | req.push({ attr: ar.Name, val: ar.ValID ?ar.ValID :'' }); |
| | | else if(ar.Type=='布尔值') |
| | | req.push({ attr: ar.Name, val: ar.Value?'1':'0'}); |
| | | else |
| | | req.push({ attr: ar.Name, val: ar.Value }); |
| | | } |
| | | } |
| | | if (this.$data.refdatastore.length > 0) { |
| | | for (var i = 0; i < this.$data.refdatastore.length; i++) { |
| | | if (!req.filter(function (s) { |
| | | return this.$data.refdatastore[i].attr == s.name |
| | | }).length) { |
| | | length = 1; |
| | | req.push({ 'attr': this.$data.refdatastore[i].attr, 'val': this.$data.refdatastore[i].value }); |
| | | } |
| | | } |
| | | } |
| | | var extinfo = enviroment; |
| | | extinfo.edit_dlg = { |
| | | type: 'small',//小窗口 |
| | | class_id: this.$data.param.clsid,//当前数据类id |
| | | } |
| | | if (data_attr) { |
| | | extinfo.edit_dlg.form_control = {//所属的表单控件 |
| | | name: data_attr.Name,//字段属性 |
| | | text: data_attr.DispName,//显示文本 |
| | | group_name: data_attr.GroupName,//属性组 |
| | | type: data_attr.Type,//字段类型 |
| | | readonly: data_attr.ReadOnly,//是否只读 |
| | | button_img: data_attr.button_img,//引用按钮的图标 |
| | | button_tooltip: data_attr.button_tooltip//引用按钮的tooltip |
| | | } |
| | | } |
| | | var dataInfo = { |
| | | edtype: "0", eventid: eventid, projectid: '',rclsid: '', robjid: '', userlogin: '', |
| | | clsid: this.$data.param.clsid, objid: '',attr: JSON.stringify(req), |
| | | extinfo: JSON.stringify(extinfo), global_attr: JSON.stringify(this.$data.global_attr) |
| | | } |
| | | console.log(dataInfo); |
| | | this.$store.dispatch('DataObjRunCustomEventInfo',dataInfo).then(success=>{ |
| | | console.log(success); |
| | | if (success.code=='00000') { |
| | | var data = JSON.parse(success.data); |
| | | if (data != "") { |
| | | |
| | | var actions = data.action; |
| | | console.log(actions); |
| | | if (actions) { |
| | | for (var i = 0; i < actions.length; i++) { |
| | | var action = actions[i]; |
| | | 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> ' + '提示', |
| | | content: action.action_type + '此action尚未处理!' |
| | | }); |
| | | d.show(); |
| | | } |
| | | else if (action.action_type == 'open_select_userdlg') { |
| | | var style = val.style; |
| | | // style == 'user' ? '选择人员' : style == 'department' ? '选择部门' : style == 'role' ? '选择角色' : '' |
| | | var $this = this; |
| | | var param={ |
| | | index: index, |
| | | iindex:iindex, |
| | | button_callback:button_callback, |
| | | req:req, |
| | | data_attr:data_attr |
| | | } |
| | | uni.navigateTo({ |
| | | url:'../selpsn/index?mulit=false¶m='+JSON.stringify(param), |
| | | events:{ |
| | | AddPer(data,param){ |
| | | // console.log(param); |
| | | console.log(data); |
| | | var callback_eventid = param.button_callback.trim(); |
| | | var info = { |
| | | eventid: callback_eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: $this.$data.param.clsid, |
| | | objid: "", |
| | | attr: param.req, |
| | | inputparameter: data |
| | | } |
| | | $this.DataObjRunCustomEvent(info, param.data_attr); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | else if (action.action_type == 'open_data_query_dlg') { |
| | | |
| | | } |
| | | else if (action.action_type == 'open_common_dlg') { |
| | | var value = action.value; |
| | | var d = dialog({ |
| | | title: '<i class="ace-icon fa fa-info-circle"></i> ' + '提示', |
| | | content: action.action_type + '此action尚未处理!' |
| | | }); |
| | | d.show(); |
| | | } |
| | | else if (action.action_type == 'open_project_query_dlg') { |
| | | //console.log(action.value.select_range); |
| | | //console.log(action.value.mulit_select); |
| | | var priRel = '-1'; |
| | | if (action.value.select_range == '全部相关') |
| | | priRel = '0'; |
| | | else if (action.value.select_range == '我负责的项目') |
| | | priRel = '1'; |
| | | else if (action.value.select_range == '我创建的') |
| | | priRel = '2'; |
| | | else if (action.value.select_range == '我参与的' || action.value.select_range == '我参加的') |
| | | priRel = '3'; |
| | | else if (action.value.select_range == '我关注的') |
| | | priRel = '4'; |
| | | else if (action.value.select_range == '我下属的项目') |
| | | priRel = '5'; |
| | | |
| | | var $this = this; |
| | | var param_={ |
| | | index: index, |
| | | iindex:iindex, |
| | | button_callback:button_callback, |
| | | req:req |
| | | } |
| | | uni.navigateTo({ |
| | | url:'../selPrj/index?relation='+priRel+'¶m='+JSON.stringify(param_), |
| | | events:{ |
| | | AddPer(data,param){ |
| | | $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.button_callback.trim(); |
| | | if (callback_eventid) { |
| | | var info = { |
| | | eventid: callback_eventid, |
| | | edtype: "2", |
| | | projectid: data[0].ID, |
| | | rclsid: "", |
| | | robjid: "", |
| | | userlogin: "", |
| | | clsid: $this.$data.param.clsid, |
| | | objid: "", |
| | | attr: param.req, |
| | | } |
| | | |
| | | $this.DataObjRunCustomEvent(info); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | var d = dialog({ |
| | | title: '<i class="ace-icon fa fa-info-circle"></i> ' + '提示', |
| | | content: action.action_type + '此action尚未处理!' |
| | | }); |
| | | d.show(); |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | uni.showModal({title:"错误5.2",content: '调用 before_click_button 脚本返回空,event_id' + eventid,showCancel:false,confirmText:"取消"}); |
| | | } |
| | | }else{ |
| | | uni.showModal({title:"错误5",content:success.msg,showCancel:false,confirmText:"取消"}); |
| | | } |
| | | }).catch(ex=>{ |
| | | // console.log(ex); |
| | | uni.showModal({title:"错误5.1",content:ex.errMsg,showCancel:false,confirmText:"取消"}); |
| | | }); |
| | | }, |
| | | |
| | | |
| | | } |
| | | .input_vallist { |
| | | max-height: 350rpx; |
| | | overflow-y: auto; |
| | | display: none; |
| | | } |
| | | </script> |
| | | |
| | | .input_vallist ul { |
| | | /* border: 1px solid red; */ |
| | | padding: 0 20rpx; |
| | | } |
| | | |
| | | .input_vallist ul li { |
| | | list-style: none; |
| | | padding: 20rpx; |
| | | border-bottom: 1px solid #ccc; |
| | | } |
| | | |
| | | .input_vallist ul li a { |
| | | float: right; |
| | | } |
| | | |
| | | .input_vallist ul li a i { |
| | | font-size: 45rpx; |
| | | } |
| | | |
| | | .view-popup { |
| | | position: relative; |
| | | } |
| | | |
| | | .popup-content { |
| | | @include flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | padding: 30rpx; |
| | | background-color: #fff; |
| | | /* height: 150px; */ |
| | | /* border: 1px solid red; */ |
| | | } |
| | | |
| | | .popup-cont { |
| | | overflow-y: auto; |
| | | /* border: 1px solid red; */ |
| | | } |
| | | |
| | | .popup-height { |
| | | @include height; |
| | | /* width: 200px; */ |
| | | } |
| | | |
| | | .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; |
| | | margin-right: 20rpx; |
| | | padding: 15rpx; |
| | | line-height: 1.5; |
| | | background: #27A6E1; |
| | | border: none; |
| | | color: #fff; |
| | | font-size: 38rpx; |
| | | font-weight: bold; |
| | | /* float: left; */ |
| | | display: inline-block; |
| | | } |
| | | |
| | | button.btn_popup_cancel { |
| | | width: 180rpx; |
| | | margin-top: 50rpx; |
| | | padding: 15rpx; |
| | | line-height: 1.5; |
| | | background: #27A6E1; |
| | | border: none; |
| | | color: #fff; |
| | | font-size: 38rpx; |
| | | font-weight: bold; |
| | | /* float: right; */ |
| | | display: inline-block; |
| | | } |
| | | </style> |
| | | <style> |
| | | .touch-item { |
| | | background-color: #F8F9FC; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | width: 100%; |
| | | overflow: hidden |
| | | } |
| | | |
| | | .itemcontent { |
| | | display: flex; |
| | | flex-direction: column; |
| | | padding: 5px 10px; |
| | | border-bottom: 1px solid #eeeeee; |
| | | margin-right: 0; |
| | | margin-left: -100px; |
| | | width: 100%; |
| | | -webkit-transition: all 0.4s; |
| | | transition: all 0.4s; |
| | | -webkit-transform: translateX(100px); |
| | | transform: translateX(100px); |
| | | position: relative; |
| | | } |
| | | |
| | | .itembtn { |
| | | width: 100px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: center; |
| | | background-color: #119bf8; |
| | | color: white; |
| | | position: relative; |
| | | -webkit-transform: translateX(100px); |
| | | transform: translateX(100px); |
| | | -webkit-transition: all 0.4s; |
| | | transition: all 0.4s; |
| | | } |
| | | |
| | | .touch-move-active .itemcontent, |
| | | .touch-move-active .itembtn { |
| | | -webkit-transform: translateX(0); |
| | | transform: translateX(0); |
| | | } |
| | | </style> |