|
@@ -148,15 +148,15 @@
|
|
|
class="avatar-uploader"
|
|
|
action="#"
|
|
|
:show-file-list="false"
|
|
|
- :http-request="(event) => { doUploadAvatar(event, 'homeImgUrl'); }"
|
|
|
+ :http-request="(event) => { doUploadAvatar(event, 'homePageUrl'); }"
|
|
|
:before-upload="beforeAvatarUpload"
|
|
|
:auto-upload="true"
|
|
|
accept="image/png,image/gif,image/jpg,image/jpeg"
|
|
|
>
|
|
|
- <img v-if="!form.homeImgUrl" class="upload-img" src="../../../assets/default-img-home.jpg" alt="">
|
|
|
+ <img v-if="!form.homePageUrl" class="upload-img" src="../../../assets/default-img-home.jpg" alt="">
|
|
|
<div v-else class="upload-img">
|
|
|
- <img :src="form.homeImgUrl">
|
|
|
- <span class="del-img" @click.stop="handleRemove('homeImgUrl')">x</span>
|
|
|
+ <img :src="form.homePageUrl">
|
|
|
+ <span class="del-img" @click.stop="handleRemove('homePageUrl')">x</span>
|
|
|
</div>
|
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
@@ -171,11 +171,11 @@
|
|
|
:auto-upload="true"
|
|
|
accept="image/png,image/gif,image/jpg,image/jpeg"
|
|
|
>
|
|
|
- <!-- <view v-if="!form.transitionPageUrl">
|
|
|
- <i class="el-icon-upload" />
|
|
|
+ <div v-if="!form.transitionPageUrl" class="upload-default">
|
|
|
+ <i class="avatar-uploader-icon el-icon-picture-outline" />
|
|
|
<div class="el-upload__text">上传图片</div>
|
|
|
- </view> -->
|
|
|
- <i v-if="!form.transitionPageUrl" class="el-icon-plus avatar-uploader-icon" />
|
|
|
+ </div>
|
|
|
+ <!-- <i v-if="!form.transitionPageUrl" class="el-icon-plus avatar-uploader-icon" /> -->
|
|
|
<div v-else class="upload-img">
|
|
|
<img :src="form.transitionPageUrl">
|
|
|
<span class="del-img" @click.stop="handleRemove('transitionPageUrl')">x</span>
|
|
@@ -236,6 +236,11 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form>
|
|
|
+ <div class="foot-layout">
|
|
|
+ <el-button style="margin-left: 20px;width: 120px;" @click="back">取 消</el-button>
|
|
|
+ <div style="width: 80px;" />
|
|
|
+ <el-button type="primary" style="width: 120px;" :loading="submitLoading" @click="submit">提 交</el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -297,7 +302,7 @@ export default {
|
|
|
forbidPullDown: false,
|
|
|
// 隐藏底部导航栏 默认: false
|
|
|
hideNavigationBar: false,
|
|
|
- // 首页图片
|
|
|
+ // 首页图片配置
|
|
|
homePageUrl: null,
|
|
|
id: null,
|
|
|
// 是否抓拍人脸 默认:false
|
|
@@ -360,15 +365,49 @@ export default {
|
|
|
},
|
|
|
rules: {
|
|
|
sn: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '请输入设备sn',
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
+ { required: true, whitespace: true, message: '不能为空!', trigger: ['change', 'blur'] }
|
|
|
+ ],
|
|
|
+ tenantId: [
|
|
|
+ { required: true, type: 'number', whitespace: true, message: '不能为空!', trigger: ['change', 'blur'] }
|
|
|
+ ],
|
|
|
+ company: [
|
|
|
+ { required: true, whitespace: true, message: '不能为空!', trigger: ['change', 'blur'] }
|
|
|
+ ],
|
|
|
+ mode: [
|
|
|
+ { required: true, whitespace: true, message: '不能为空!', trigger: ['change', 'blur'] }
|
|
|
+ ],
|
|
|
+ useAlipayFace: [
|
|
|
+ { required: true, type: 'boolean', whitespace: true, message: '不能为空!', trigger: 'blur' }
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ 'form.mode': {
|
|
|
+ handler(value) {
|
|
|
+ if (!value || value === 'public') {
|
|
|
+ this.form.userLibId = null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // watch: {
|
|
|
+ // obj: {
|
|
|
+ // handler(value) {
|
|
|
+ // let temp = null
|
|
|
+ // if (value) {
|
|
|
+ // temp = value
|
|
|
+ // if (!temp.zoloConfig) {
|
|
|
+ // temp.zoloConfig = this.form.zoloConfig
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // this.form = temp
|
|
|
+ // console.info('obj-->', this.form)
|
|
|
+ // },
|
|
|
+ // immediate: true
|
|
|
+ // }
|
|
|
+ // },
|
|
|
mounted() {
|
|
|
this.initData()
|
|
|
},
|
|
@@ -377,9 +416,17 @@ export default {
|
|
|
this.getMerchantList()
|
|
|
this.getSceneList()
|
|
|
this.getUserlibList()
|
|
|
- if (this.obj) {
|
|
|
- this.form = this.obj
|
|
|
- }
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.obj) {
|
|
|
+ if (!this.obj.zoloConfig) {
|
|
|
+ this.obj.zoloConfig = this.form.zoloConfig
|
|
|
+ }
|
|
|
+ this.form = this.obj
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ back() {
|
|
|
+ this.$emit('back')
|
|
|
},
|
|
|
getMerchantList() {
|
|
|
getAllList().then(res => {
|
|
@@ -458,11 +505,15 @@ export default {
|
|
|
}
|
|
|
|
|
|
// 开门信号
|
|
|
- // if (this.form.useSerialPort !== 'RS232') {
|
|
|
- // this.form.
|
|
|
- // }
|
|
|
+ if (this.form.useSerialPort !== 'RS232') {
|
|
|
+ this.form.signalNo = null
|
|
|
+ }
|
|
|
await add(this.form)
|
|
|
- this.$emit('finish')
|
|
|
+ this.$message({
|
|
|
+ message: `${this.form.id ? '修改' : '添加'}成功!`,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.$emit('back')
|
|
|
} catch (e) {
|
|
|
console.info('add', e)
|
|
|
} finally {
|
|
@@ -523,6 +574,30 @@ export default {
|
|
|
.overlength ::v-deep .el-form-item__label {
|
|
|
line-height: 1.4;
|
|
|
}
|
|
|
+ .avatar-uploader .upload-default {
|
|
|
+ border: 1px dashed #d9d9d9;
|
|
|
+ border-radius: 0;
|
|
|
+ cursor: pointer;
|
|
|
+ width: 70px;
|
|
|
+ overflow: hidden;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+ .upload-default .avatar-uploader-icon {
|
|
|
+ color: #8c939d;
|
|
|
+ width: 22px;
|
|
|
+ height: 18px;
|
|
|
+ font-size: 20px;
|
|
|
+ margin-top: 24px;
|
|
|
+ }
|
|
|
+ .upload-default .el-upload__text {
|
|
|
+ margin-top: 8px;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #CED3E3;
|
|
|
+ }
|
|
|
.upload-img {
|
|
|
width: 63px;
|
|
|
height: 91px;
|
|
@@ -560,5 +635,15 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .foot-layout {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ margin-top: 34px;
|
|
|
+ padding-right: 180px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|