瀏覽代碼

jpt权限

Leo 2 年之前
父節點
當前提交
928ab6d853
共有 2 個文件被更改,包括 13 次插入10 次删除
  1. 1 1
      src/module/datasource/component/SyncTaskAdd.jsx
  2. 12 9
      src/module/jptmgmt/page/JptMgmt.jsx

+ 1 - 1
src/module/datasource/component/SyncTaskAdd.jsx

@@ -392,7 +392,7 @@ export default function SyncTaskAdd() {
       showDrawer()
       setIsFinishBuild(true)
     } else {
-      message.error('构建失败,请检查表单数据')
+      message.error(data.msg)
     }
     setBuilding(false)
   }

+ 12 - 9
src/module/jptmgmt/page/JptMgmt.jsx

@@ -114,6 +114,7 @@ const JptMgmt = () => {
           unCheckedChildren="关闭"
           loading={switchLoading}
           defaultChecked={val}
+          disabled={!['1', '2', '4'].includes(localStorage.getItem('role'))}
           onChange={checked => changeTaskState(checked, record.key)}
         />
       ),
@@ -133,6 +134,7 @@ const JptMgmt = () => {
           </Button>
           <Button
             type="link"
+            disabled={!['1', '2', '4'].includes(localStorage.getItem('role'))}
             onClick={() => {
               setCurrentJpt(record.key)
               setIsEditJptPsd(true)
@@ -254,15 +256,16 @@ const JptMgmt = () => {
   return (
     <JptWrapper>
       <div className="create_btn">
-        {jptList.length === 0 && (
-          <Button
-            type="primary"
-            onClick={() => {
-              setIsCreateJptProgram(true)
-            }}>
-            创建
-          </Button>
-        )}
+        {jptList.length === 0 &&
+          ['1', '2', '4'].includes(localStorage.getItem('role')) && (
+            <Button
+              type="primary"
+              onClick={() => {
+                setIsCreateJptProgram(true)
+              }}>
+              创建
+            </Button>
+          )}
       </div>
       <Table
         columns={columns}