| | |
| | | <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> |
| | | <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> |
| | | </head> |
| | | <style> |
| | | .el-upload__input { |
| | | display: none !important; |
| | | } |
| | | </style> |
| | | <body> |
| | | <div class="ibox-content" id="app" v-cloak> |
| | | |
| | |
| | | <template v-for="paramSetting in paramSettings"> |
| | | |
| | | <div class="form-group" v-if="paramSetting.type==1"> |
| | | <label class="col-md-2 control-label">{{paramSetting.name}}</label> |
| | | <div class="col-md-8"> |
| | | <label class="col-md-4 control-label">{{paramSetting.name}}</label> |
| | | <div class="col-md-6"> |
| | | <el-input v-model="paramSetting.userValue"></el-input> |
| | | </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"> |
| | | <label class="col-md-4 control-label">{{paramSetting.name}}</label> |
| | | <div class="col-md-6" style="float:left;margin-top: 8px;"> |
| | | <el-radio-group v-model="paramSetting.userValue"> |
| | | <el-radio v-for="item in buttonType" |
| | | <el-radio v-for="item in buttonTypeTwo" |
| | | :key="item.value" |
| | | :label="item.displayName" |
| | | :value="item.value"></el-radio> |
| | | :value="item.displayName"></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"> |
| | | <label class="col-md-4 control-label">{{paramSetting.name}}</label> |
| | | <div class="col-md-6"> |
| | | <el-select v-model="paramSetting.userValue" placeholder=""> |
| | | <el-option |
| | | v-for="item in buttonType" |
| | | v-for="item in buttonTypeThree" |
| | | :key="item.value" |
| | | :label="item.displayName" |
| | | :value="item.displayName"> |
| | |
| | | </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"> |
| | | <label class="col-md-4 control-label">{{paramSetting.name}}</label> |
| | | <div class="col-md-6"> |
| | | <el-select v-model="paramSetting.userValue" multiple placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in buttonType" |
| | | v-for="item in buttonTypeFour" |
| | | :key="item.value" |
| | | :label="item.displayName" |
| | | :value="item.displayName"> |
| | |
| | | </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-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>--> |
| | | <label class="col-md-4 control-label">{{paramSetting.name}}</label> |
| | | <div class="col-md-6"> |
| | | <el-upload |
| | | class="upload-demo" |
| | | action="/admin/multipleUploadFile/doUpload" |
| | | :on-preview="handlePreview" |
| | | :on-success="uploadSuccess" |
| | | :on-remove="handleRemove" |
| | | :before-remove="beforeRemove" |
| | | multiple |
| | | :limit="3" |
| | | :limit="1" |
| | | :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> |
| | | |
| | | <div class="form-group" v-if="paramSetting.type==6"> |
| | | <label class="col-md-4 control-label">{{paramSetting.name}}</label> |
| | | <div class="col-md-6"> |
| | | <el-upload |
| | | action="/admin/multipleUploadFile/doUpload" |
| | | :show-file-list="false" |
| | | :on-success="imageLineSuccess"> |
| | | <img v-if="imageLine" :src="imageLine" style="max-width: 300px;"> |
| | | <el-button size="small" type="primary">点击上传</el-button> |
| | | </el-upload> |
| | | </div> |
| | | </div> |
| | |
| | | warehouses: [], |
| | | shops: [], |
| | | categoryList: [], |
| | | buttonType:[], |
| | | buttonTypeThree:[], |
| | | buttonTypeFour:[], |
| | | buttonTypeTwo:[], |
| | | fileList:[], |
| | | codeName:'', |
| | | imageLine:'', |
| | | type:2, |
| | | }, |
| | | created: function () { |
| | | this.loadInfo(); |
| | |
| | | }, |
| | | |
| | | //获取枚举列表 |
| | | loadEnum(codeName){ |
| | | loadEnum(codeName,type){ |
| | | let _this = this; |
| | | //获取枚举列表 |
| | | AjaxProxy.requst({ |
| | |
| | | url: basePath + '/common/data/getEnums', |
| | | data:{"enumCodes":[_this.codeName]}, |
| | | callback: function (data) { |
| | | _this.buttonType = data.data[''+_this.codeName+'']; |
| | | if(_this.type === 3){ |
| | | _this.buttonTypeThree = data.data[''+_this.codeName+'']; |
| | | }else if(_this.type === 4){ |
| | | _this.buttonTypeFour = data.data[''+_this.codeName+'']; |
| | | }else if(_this.type === 2){ |
| | | _this.buttonTypeTwo = data.data[''+_this.codeName+'']; |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | |
| | | for (let i = 0; i < paramSettings.length; i++) { |
| | | if (paramSettings[i].type === 2) { |
| | | if(paramSettings[i].value != null && paramSettings[i].value != ''){ |
| | | if(paramSettings[i].userValue === '1'){ |
| | | paramSettings[i].userValue = '是'; |
| | | }else if(paramSettings[i].userValue === '2'){ |
| | | paramSettings[i].userValue = '否'; |
| | | } |
| | | _this.codeName = paramSettings[i].value; |
| | | _this.loadEnum(_this.codeName); |
| | | _this.type = paramSettings[i].type; |
| | | _this.loadEnum(_this.codeName,_this.type); |
| | | } |
| | | }else if(paramSettings[i].type === 3){ |
| | | if(paramSettings[i].value != null && paramSettings[i].value != ''){ |
| | | _this.codeName = paramSettings[i].value; |
| | | _this.loadEnum(_this.codeName); |
| | | _this.type = paramSettings[i].type; |
| | | _this.loadEnum(_this.codeName,_this.type); |
| | | } |
| | | }else if(paramSettings[i].type === 4){ |
| | | if(paramSettings[i].value != null && paramSettings[i].value != ''){ |
| | | //下拉框回显 |
| | | paramSettings[i].userValue = paramSettings[i].userValue.split(','); |
| | | if (paramSettings[i].userValue != null && paramSettings[i].userValue != '') { |
| | | paramSettings[i].userValue = paramSettings[i].userValue.split(','); |
| | | } |
| | | _this.codeName = paramSettings[i].value; |
| | | _this.loadEnum(_this.codeName); |
| | | _this.type = paramSettings[i].type; |
| | | _this.loadEnum(_this.codeName,_this.type); |
| | | } |
| | | }else if(paramSettings[i].type === 5){ |
| | | if(paramSettings[i].value != null && paramSettings[i].value != ''){ |
| | | _this.fileList.push(paramSettings[i].userValue); |
| | | } |
| | | }else if(paramSettings[i].type === 6){ |
| | | _this.imageLine = paramSettings[i].userValue; |
| | | } |
| | | } |
| | | _this.paramSettings = paramSettings; |
| | |
| | | console.log(file); |
| | | }, |
| | | handleExceed(files, fileList) { |
| | | this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`); |
| | | this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`); |
| | | }, |
| | | beforeRemove(file, fileList) { |
| | | return this.$confirm(`确定移除 ${ file.name }?`); |
| | | }, |
| | | uploadSuccess(res, file) { |
| | | this.imageLine = res.path; |
| | | }, |
| | | imageLineSuccess(res, file) { |
| | | this.imageLine = res.path; |
| | | }, |
| | | |
| | | submit() { |
| | |
| | | if (paramSetting.type == 4) { |
| | | userValue = paramSetting.userValue.join(","); |
| | | } |
| | | |
| | | if (paramSetting.type == 6) { |
| | | userValue = _this.imageLine; |
| | | } |
| | | let obj = { |
| | | code: paramSetting.code, |
| | | userValue: userValue |