|
@@ -12,6 +12,7 @@
|
|
|
<el-form :model="form" ref="form" :rules="rules" label-width="100px">
|
|
|
<el-form-item label="分类名称:" prop="typeId">
|
|
|
<el-select
|
|
|
+ :disabled="!refList.show"
|
|
|
filterable
|
|
|
placeholder="请选择"
|
|
|
v-model="form.typeId"
|
|
@@ -64,12 +65,39 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="status">
|
|
|
- <template slot="label"><span>状  态</span>:</template>
|
|
|
+ <template slot="label"
|
|
|
+ ><span style="word-spacing: 22px">状 态</span>:</template
|
|
|
+ >
|
|
|
<el-radio-group v-model="form.status">
|
|
|
<el-radio :label="1">启用</el-radio>
|
|
|
<el-radio :label="0">禁用</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ style="margin-bottom: 20px"
|
|
|
+ label
|
|
|
+ v-for="(item, index) in form.role"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <template v-if="index == 0" slot="label">
|
|
|
+ <span>访问权限:</span>
|
|
|
+ </template>
|
|
|
+ <div class="form_item_content">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ placeholder="请输入手机号"
|
|
|
+ v-onlyInt
|
|
|
+ maxlength="11"
|
|
|
+ v-model="item.value"
|
|
|
+ ></el-input>
|
|
|
+ <i class="iconfont icon-a-zu903" @click="addjurisdiction"></i>
|
|
|
+ <i
|
|
|
+ class="iconfont icon-a-zu904"
|
|
|
+ v-if="form.role.length != 1"
|
|
|
+ @click="deletjurisdiction(index)"
|
|
|
+ ></i>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button size="small" @click="handleClose">取 消</el-button>
|
|
@@ -96,7 +124,8 @@ export default {
|
|
|
linkUrl: '',
|
|
|
name: '',
|
|
|
status: 1,
|
|
|
- typeId: ''
|
|
|
+ typeId: '',
|
|
|
+ role: [{ value: '' }]
|
|
|
},
|
|
|
refList: {},
|
|
|
fileList: [],
|
|
@@ -125,7 +154,8 @@ export default {
|
|
|
name: '',
|
|
|
status: 1,
|
|
|
typeId: '',
|
|
|
- fileSize: ''
|
|
|
+ fileSize: '',
|
|
|
+ role: [{ value: '' }]
|
|
|
}
|
|
|
this.fileList = []
|
|
|
this.$refs['form'].resetFields()
|
|
@@ -150,6 +180,15 @@ export default {
|
|
|
api.GET('/doc/getDetail', { id: this.refList.id }).then(data => {
|
|
|
if (data.code == 0) {
|
|
|
this.form = data.data
|
|
|
+ let role = []
|
|
|
+ if (this.form.role&&this.form.role.length != 0) {
|
|
|
+ this.form.role.forEach(item => {
|
|
|
+ role.push({ value: item })
|
|
|
+ })
|
|
|
+ this.form.role = role
|
|
|
+ } else {
|
|
|
+ this.form.role = [{ value: '' }]
|
|
|
+ }
|
|
|
this.fileList = [{ name: this.form.name, url: this.form.docUrl }]
|
|
|
}
|
|
|
})
|
|
@@ -175,6 +214,29 @@ export default {
|
|
|
this.form.linkUrl = item.linkUrl
|
|
|
}
|
|
|
})
|
|
|
+ this.detailClassifica(val)
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @method 分类详情
|
|
|
+ * **/
|
|
|
+ detailClassifica(val) {
|
|
|
+ let code = {
|
|
|
+ typeId: val
|
|
|
+ }
|
|
|
+ api.POST('/doc/type/detail', code).then(data => {
|
|
|
+ if (data.code == 0) {
|
|
|
+ this.form.role = data.data.role
|
|
|
+ let role = []
|
|
|
+ if (this.form.role&&this.form.role.length != 0) {
|
|
|
+ this.form.role.forEach(item => {
|
|
|
+ role.push({ value: item })
|
|
|
+ })
|
|
|
+ this.form.role = role
|
|
|
+ } else {
|
|
|
+ this.form.role = [{ value: '' }]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
/**
|
|
|
* @method 上传
|
|
@@ -250,13 +312,24 @@ export default {
|
|
|
this.$refs[formName].validate(valid => {
|
|
|
if (valid) {
|
|
|
this.fullscreenLoading = true
|
|
|
+ let role = []
|
|
|
+ for (let item of this.form.role) {
|
|
|
+ if (item.value && item.value.length != 11) {
|
|
|
+ this.fullscreenLoading = false
|
|
|
+ return this.$message.warning('请输入正确的手机号')
|
|
|
+ }
|
|
|
+ if (item.value) {
|
|
|
+ role.push(item.value)
|
|
|
+ }
|
|
|
+ }
|
|
|
let code = {
|
|
|
docUrl: this.form.docUrl,
|
|
|
linkUrl: this.form.linkUrl,
|
|
|
name: this.form.name,
|
|
|
status: this.form.status,
|
|
|
typeId: this.form.typeId,
|
|
|
- fileSize: this.form.fileSize
|
|
|
+ fileSize: this.form.fileSize,
|
|
|
+ role: role
|
|
|
}
|
|
|
this.refList.show ? this.addfile(code) : this.editfile(code)
|
|
|
}
|
|
@@ -296,9 +369,40 @@ export default {
|
|
|
.catch(() => {
|
|
|
this.fullscreenLoading = false
|
|
|
})
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @method 增加访问权限
|
|
|
+ * **/
|
|
|
+ addjurisdiction() {
|
|
|
+ this.form.role.push({ value: '' })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @method 删除访问权限
|
|
|
+ * **/
|
|
|
+ deletjurisdiction(val) {
|
|
|
+ this.form.role.splice(val, 1)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
+.form_item_content {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 10px;
|
|
|
+}
|
|
|
+.icon-a-zu903 {
|
|
|
+ color: #f23f3a;
|
|
|
+ margin-left: 10px;
|
|
|
+ margin-right: 20px;
|
|
|
+ cursor: pointer;
|
|
|
+ font-size: 22px;
|
|
|
+}
|
|
|
+.icon-a-zu904 {
|
|
|
+ cursor: pointer;
|
|
|
+ font-size: 22px;
|
|
|
+}
|
|
|
+.el-icon-minus {
|
|
|
+ margin-right: 16px;
|
|
|
+}
|
|
|
</style>
|