feat: 模型权限配置所有人均可发起选项

saber
ssc 3 years ago
parent 3c7e971f61
commit 2e66cd657c
  1. 15
      src/views/plugin/workflow/design/model.vue
  2. 12
      src/views/plugin/workflow/process/components/user-option.vue

@ -108,6 +108,7 @@
<user-option ref="userOption"
:user-option="userOption"
all
@submit="handleScopeSubmit"></user-option>
</basic-container>
</template>
@ -264,13 +265,13 @@ export default {
this.categoryId = id
this.searchChange(this.query)
},
handleScopeSubmit(list) {
handleScopeSubmit(list, all) {
list.forEach(l => l.val = l.value)
const { id, modelKey } = this.row
const param = {
modelId: id, modelKey,
scopeList: list
scopeList: all? list.concat([{type: 'WF_ALL', val: 'WF_ALL'}]): list
}
scopeSubmit(param).then(() => {
this.$message.success('操作成功')
@ -278,7 +279,15 @@ export default {
},
handleScope(row) {
scopeList({ modelId: row.id }).then(res => {
this.$set(this.userOption, 'data', res.data.data.map(d => {
const data = res.data.data
const index = data.findIndex(d => d.type == 'WF_ALL')
if (index != -1) {
this.$refs.userOption.switchAll = true
data.splice(index, 1)
}
else this.$refs.userOption.switchAll = false
this.$set(this.userOption, 'data', data.map(d => {
return {
value: d.val,
text: d.text,

@ -6,6 +6,7 @@
width="60%"
:before-close="handleClose"
append-to-body>
<p v-if="all" style="padding: 0 20px;">不限制权限,所有人均可发起:<el-switch v-model="switchAll"></el-switch>平台需单独配置</p>
<el-table v-if="visible"
class="avue-crud"
:data="data"
@ -42,7 +43,7 @@
:key="item.value"
:label="item.label"
:value="item.value"
:disabled="Boolean(data.find(d => d.type == item.value))"></el-option>
:disabled="Boolean(data.find(d => d.type == item.value)) || (switchAll && !['platform'].includes(item.value))"></el-option>
</el-select>
</template>
</el-table-column>
@ -137,7 +138,11 @@ import UserSelect from './user-select.vue'
export default {
props: {
userOption: Object
userOption: Object,
all: {
type: Boolean,
default: false
}
},
components: {
UserSelect,
@ -184,6 +189,7 @@ export default {
},
data() {
return {
switchAll: false,
init: false,
visible: false,
data: [],
@ -272,7 +278,7 @@ export default {
})
},
handleSubmit() {
this.$emit('submit', this.data.filter(d => d.type && d.value))
this.$emit('submit', this.data.filter(d => d.type && d.value), this.switchAll)
this.visible = false
},
handleClose(done) {

Loading…
Cancel
Save