| | |
| | | |
| | | <template v-for="paramSetting in paramSettings"> |
| | | |
| | | <div v-if="paramSetting.type==4" class="form-group"> |
| | | <label class="col-md-2 control-label">{{paramSetting.name}}</label> |
| | | </div> |
| | | |
| | | |
| | | <div class="form-group" v-if="paramSetting.type==1"> |
| | | <label class="col-md-2 control-label">{{paramSetting.name}}</label> |
| | | <div class="col-md-8"> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="form-group" v-if="paramSetting.type==2"> |
| | | <label class="col-md-2 control-label">{{paramSetting.name}}</label> |
| | | <div class="col-md-8"> |
| | | <el-select v-model="paramSetting.userValue" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in paramSetting.value" |
| | | :key="item" |
| | | :label="item" |
| | | :value="item"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-radio-group v-model="paramSetting.userValue"> |
| | | <el-radio v-for="item in buttonType" |
| | | :key="item.value" |
| | | :label="item.displayName" |
| | | :value="item.value"></el-radio> |
| | | </el-radio-group> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" v-if="paramSetting.type==3"> |
| | | <label class="col-md-2 control-label">{{paramSetting.name}}</label> |
| | | <div class="col-md-8"> |
| | | <el-checkbox-group v-model="paramSetting.userValue"> |
| | | <template v-for="item in paramSetting.value"> |
| | | <el-checkbox v-bind:label="item" v-bind:value="item"></el-checkbox> |
| | | </template> |
| | | </el-checkbox-group> |
| | | <el-select v-model="paramSetting.userValue" placeholder=""> |
| | | <el-option |
| | | v-for="item in buttonType" |
| | | :key="item.value" |
| | | :label="item.displayName" |
| | | :value="item.displayName"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" v-if="paramSetting.type==4"> |
| | | <label class="col-md-2 control-label">{{paramSetting.name}}</label> |
| | | <div class="col-md-8"> |
| | | <el-select v-model="paramSetting.userValue" multiple placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in buttonType" |
| | | :key="item.value" |
| | | :label="item.displayName" |
| | | :value="item.displayName"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" v-if="paramSetting.type==5"> |
| | | <label class="col-md-2 control-label">{{paramSetting.name}}</label> |
| | | <div class="col-md-8"> |
| | | <el-input type="textarea" :rows="2" v-model="paramSetting.userValue"></el-input> |
| | | <!-- <el-select v-model="paramSetting.userValue" placeholder="">--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in buttonType"--> |
| | | <!-- :key="item.value"--> |
| | | <!-- :label="item.displayName"--> |
| | | <!-- :value="item.value">--> |
| | | <!-- </el-option>--> |
| | | <!-- </el-select>--> |
| | | <el-upload |
| | | class="upload-demo" |
| | | action="/admin/multipleUploadFile/doUpload" |
| | | :on-preview="handlePreview" |
| | | :on-remove="handleRemove" |
| | | :before-remove="beforeRemove" |
| | | multiple |
| | | :limit="3" |
| | | :on-exceed="handleExceed" |
| | | :file-list="fileList"> |
| | | <el-button size="small" type="primary">点击上传</el-button> |
| | | <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> |
| | | </el-upload> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | warehouses: [], |
| | | shops: [], |
| | | categoryList: [], |
| | | buttonType:[], |
| | | fileList:[], |
| | | codeName:'', |
| | | }, |
| | | created: function () { |
| | | this.loadInfo(); |
| | |
| | | data: {}, |
| | | url: basePath + '/admin/busParameterSettings/getAllCategoryList', |
| | | callback: function (data) { |
| | | |
| | | let categoryList = data.rows; |
| | | for (let i = 0; i < categoryList.length; i++) { |
| | | if (categoryList[i].type == 3) { |
| | | if (categoryList[i].value) { |
| | | categoryList[i].value = categoryList[i].value.split(","); |
| | | } |
| | | } |
| | | } |
| | | console.log(categoryList); |
| | | _this.categoryList = categoryList; |
| | | _this.currentCategory = categoryList[0]; |
| | |
| | | }); |
| | | }, |
| | | |
| | | //获取枚举列表 |
| | | loadEnum(codeName){ |
| | | let _this = this; |
| | | //获取枚举列表 |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | url: basePath + '/common/data/getEnums', |
| | | data:{"enumCodes":[_this.codeName]}, |
| | | callback: function (data) { |
| | | _this.buttonType = data.data[''+_this.codeName+'']; |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | //改变编辑页面,切换页面元素 |
| | | changeCategory(index) { |
| | |
| | | callback: function (data) { |
| | | let paramSettings = data.rows; |
| | | for (let i = 0; i < paramSettings.length; i++) { |
| | | if (paramSettings[i].type == 3) { |
| | | paramSettings[i].value = paramSettings[i].value.split(","); |
| | | if (paramSettings[i].userValue) { |
| | | paramSettings[i].userValue = paramSettings[i].userValue.split(","); |
| | | if (paramSettings[i].type === 2) { |
| | | if(paramSettings[i].value != null && paramSettings[i].value != ''){ |
| | | _this.codeName = paramSettings[i].value; |
| | | _this.loadEnum(_this.codeName); |
| | | } |
| | | } else if (paramSettings[i].type == 2) { |
| | | paramSettings[i].value = paramSettings[i].value.split(","); |
| | | |
| | | } |
| | | }else if(paramSettings[i].type === 3){ |
| | | if(paramSettings[i].value != null && paramSettings[i].value != ''){ |
| | | _this.codeName = paramSettings[i].value; |
| | | _this.loadEnum(_this.codeName); |
| | | } |
| | | }else if(paramSettings[i].type === 4){ |
| | | if(paramSettings[i].value != null && paramSettings[i].value != ''){ |
| | | //下拉框回显 |
| | | paramSettings[i].userValue = paramSettings[i].userValue.split(','); |
| | | _this.codeName = paramSettings[i].value; |
| | | _this.loadEnum(_this.codeName); |
| | | } |
| | | }else if(paramSettings[i].type === 5){ |
| | | if(paramSettings[i].value != null && paramSettings[i].value != ''){ |
| | | } |
| | | } |
| | | } |
| | | _this.paramSettings = paramSettings; |
| | | console.log("over"); |
| | |
| | | }); |
| | | }, |
| | | |
| | | submit() { |
| | | handleRemove(file, fileList) { |
| | | console.log(file, fileList); |
| | | }, |
| | | handlePreview(file) { |
| | | console.log(file); |
| | | }, |
| | | handleExceed(files, fileList) { |
| | | this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`); |
| | | }, |
| | | beforeRemove(file, fileList) { |
| | | return this.$confirm(`确定移除 ${ file.name }?`); |
| | | }, |
| | | |
| | | submit() { |
| | | console.log("提交"); |
| | | let _this = this; |
| | | let submitDate = []; |
| | | for (let i = 0; i < _this.paramSettings.length; i++) { |
| | | let paramSetting = _this.paramSettings[i]; |
| | | |
| | | let userValue = paramSetting.userValue; |
| | | |
| | | if (paramSetting.type == 3) { |
| | | if (paramSetting.type == 4) { |
| | | userValue = paramSetting.userValue.join(","); |
| | | } |
| | | let obj = { |
| | | code: paramSetting.code, |
| | | userValue: userValue |
| | | } |
| | | |
| | | submitDate.push(obj); |
| | | } |
| | | |