Commit 12faf450f4d9bcc5e45d310a67f74717c81c2c96

Authored by fengtao
1 parent 26d29cb8

pref:优化转换函数启用后不允许编辑和删除

... ... @@ -29,18 +29,21 @@
29 29 icon: 'ant-design:font-size-outlined',
30 30 auth: 'api:yt:js:test',
31 31 onClick: handleBindTest.bind(null, record),
  32 + ifShow: record.status == 0,
32 33 },
33 34 {
34 35 label: '编辑',
35 36 icon: 'clarity:note-edit-line',
36 37 auth: 'api:yt:js:update',
37 38 onClick: handleCreateOrEdit.bind(null, record),
  39 + ifShow: record.status == 0,
38 40 },
39 41 {
40 42 label: '删除',
41 43 icon: 'ant-design:delete-outlined',
42 44 auth: 'api:yt:js:delete',
43 45 color: 'error',
  46 + ifShow: record.status == 0,
44 47 popConfirm: {
45 48 title: '是否确认删除',
46 49 confirm: handleDeleteOrBatchDelete.bind(null, record),
... ... @@ -50,16 +53,16 @@
50 53 />
51 54 </template>
52 55 <template #status="{ record }">
53   - <Switch
54   - :checked="record.status === 1"
55   - :loading="record.pendingStatus"
56   - checkedChildren="启用"
57   - unCheckedChildren="禁用"
58   - @change="(checked:boolean)=>statusChange(checked,record)"
59   - />
  56 + <Authority value="api:yt:js:update:status">
  57 + <Switch
  58 + :checked="record.status === 1"
  59 + :loading="record.pendingStatus"
  60 + checkedChildren="启用"
  61 + unCheckedChildren="禁用"
  62 + @change="(checked:boolean)=>statusChange(checked,record)"
  63 + />
  64 + </Authority>
60 65 </template>
61   - <!-- <Authority value="api:yt:js:update:status">
62   - </Authority> -->
63 66 </BasicTable>
64 67 <ConverScriptModal @register="registerModal" @success="handleSuccess" />
65 68 </div>
... ...