Kaynağa Gözat

岗位配置

sunyize 2 yıl önce
ebeveyn
işleme
4675c9e533

+ 6 - 1
src/api/api.js

@@ -10,6 +10,9 @@ const queryall = (params)=>getAction("/sys/role/queryall",params);
 //过期配置
 const addExpire = (params)=>postAction("/sys/expire/add",params);
 const editExpire = (params)=>putAction("/sys/expire/edit",params);
+// 岗位配置
+const addPost = (params)=>postAction("/sys/dictItem/addPost",params);
+const editPost= (params)=>putAction("/sys/dictItem/editPost",params);
 
 //用户管理
 const addUser = (params)=>postAction("/sys/user/add",params);
@@ -165,7 +168,9 @@ export {
   getUserNoticeInfo,
   getDictItemsFromCache,
   editExpire,
-  addExpire
+  addExpire,
+  editPost,
+  addPost
 }
 
 

+ 1 - 1
src/views/system/expireDateConfig.vue

@@ -1,6 +1,6 @@
 <template>
   <a-row :gutter="10">
-    <a-col :md="leftColMd" :sm="24" style="margin-bottom: 20px">
+    <a-col   :sm="24" style="margin-bottom: 20px">
       <a-card :bordered="false">
         <!-- 查询区域 -->
         <div class="table-page-search-wrapper">

+ 2 - 1
src/views/system/modules/UserModal.vue

@@ -63,7 +63,8 @@
         </a-form-model-item>
 
         <a-form-model-item label="人员岗位" :labelCol="labelCol" :wrapperCol="wrapperCol"  >
-          <a-input placeholder="请输入人员岗位" v-model="model.position" />
+<!--          <a-input placeholder="请输入人员岗位" v-model="model.position" />-->
+          <j-dict-select-tag placeholder="请输入人员岗位" v-model="model.position"  dictCode="post_config_dict" />
         </a-form-model-item>
 <!--        <a-form-model-item label="身份" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
 <!--          <a-radio-group  v-model="model.userIdentity"  @change="identityChange">-->

+ 2 - 2
src/views/system/modules/UserRoleModal.vue

@@ -22,7 +22,7 @@
           :expandedKeys="expandedKeysss"
           :checkStrictly="checkStrictly">
           <span slot="hasDatarule" slot-scope="{slotTitle,ruleFlag}">
-            {{ slotTitle }}<a-icon v-if="ruleFlag" type="align-left" style="margin-left:5px;color: red;"></a-icon>
+            {{ slotTitle }}<a-icon v-if="1!==1" type="align-left" style="margin-left:5px;color: red;"></a-icon>
           </span>
         </a-tree>
       </a-form-item>
@@ -49,7 +49,7 @@
       <a-button @click="handleSubmit(true)" type="primary" :loading="loading">保存并关闭</a-button>
     </div>
 
-    <role-datarule-modal ref="datarule"></role-datarule-modal>
+<!--    <role-datarule-modal ref="datarule"></role-datarule-modal>-->
 
   </a-drawer>
 

+ 133 - 0
src/views/system/modules/postConfigModel.vue

@@ -0,0 +1,133 @@
+<template>
+  <a-modal
+    :title="title"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    @ok="handleOk"
+    @cancel="handleCancel"
+    cancelText="关闭"
+    wrapClassName="ant-modal-cust-warp"
+    style="top:5%;height: 85%;overflow-y: hidden">
+
+    <a-spin :spinning="confirmLoading">
+      <a-form-model ref="form"  v-bind="layout"  :model="model" :rules="validatorRules">
+        <a-form-model-item label="岗位名称" required  >
+          <a-input v-model="model.itemText" placeholder="请输入岗位名称"/>
+        </a-form-model-item>
+<!--        <a-form-model-item label="配置名称" required prop="configName">-->
+<!--          <a-input v-model="model.configNumber" placeholder="请输入配置名称"/>-->
+<!--        </a-form-model-item>-->
+
+<!--        <a-form-model-item label="数值"    >-->
+<!--          <a-input-number  v-model="model.configNumber"   :min="1" :max="1000"  :default-value="30"/>-->
+<!--         </a-form-model-item>-->
+
+      </a-form-model>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { addPost, editPost } from '@/api/api'
+  import { getAction } from '@api/manage'
+  export default {
+    name: "postConfigModel",
+    data () {
+      return {
+        title:"操作",
+        visible: false,
+        roleDisabled: false,
+        model: {
+          configName:'',
+          itemText:''
+        },
+        layout: {
+          labelCol: { span: 3 },
+          wrapperCol: { span: 14 },
+        },
+        confirmLoading: false,
+        validatorRules:{
+          configName: [
+            { required: true,message: '请输入岗位名称!'  },
+          ],
+          configNumber: [
+            { required: true, message: '请输入配置数值!' },
+            { min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' },
+            { validator: this.validateRoleName}
+          ]
+        },
+      }
+    },
+    created () {
+      //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      codeActive(){
+
+      },
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+        //编辑页面禁止修改角色编码
+        if(this.model.id){
+          this.roleDisabled = true;
+        }else{
+          this.roleDisabled = false;
+        }
+      },
+      close () {
+        this.$refs.form.clearValidate();
+        this.$emit('close');
+        this.visible = false;
+      },
+
+      handleOk () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let obj;
+            if(that.model.itemText==='' ){
+              that.$message.warning("数值不可为空");
+              that.confirmLoading = false;
+              return false;
+            }
+
+            if(!this.model.id){
+              obj=addPost(this.model);
+            }else{
+              obj=editPost(this.model);
+            }
+            obj.then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+              that.close();
+            })
+          }else{
+            return false;
+          }
+        })
+      },
+      handleCancel () {
+        this.close()
+      },
+
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 139 - 0
src/views/system/postConfig.vue

@@ -0,0 +1,139 @@
+<template>
+  <a-row :gutter="10">
+    <a-col   :sm="24" style="margin-bottom: 20px">
+      <a-card :bordered="false">
+        <!-- 查询区域 -->
+        <div class="table-page-search-wrapper">
+          <!-- 搜索区域 -->
+          <a-form layout="inline" @keyup.enter.native="searchQuery">
+            <a-row :gutter="24">
+              <a-col :md="12" :sm="8">
+                <a-form-item label="岗位名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
+                  <a-input placeholder="" v-model="queryParam.itemText"></a-input>
+                </a-form-item>
+              </a-col>
+              <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+            <a-col :md="12" :sm="24">
+               <a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 21px">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+            </a-col>
+          </span>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- 操作按钮区域 -->
+        <div class="table-operator" style="margin: 5px 0 10px 2px">
+          <a-button @click="handleAdd" type="primary" icon="plus">新建数据</a-button>
+        </div>
+        <div style="margin-top: 15px">
+          <a-table
+            style="height:500px"
+            ref="table"
+            size="middle"
+            bordered
+            rowKey="id"
+            :columns="columns"
+            :dataSource="dataSource"
+            :pagination="ipagination"
+            :loading="loading"
+             @change="handleTableChange">
+
+          <span slot="action" slot-scope="text, record">
+             <a-divider type="vertical"/>
+
+
+            <a-dropdown>
+              <a class="ant-dropdown-link">
+                更多 <a-icon type="down"/>
+              </a>
+              <a-menu slot="overlay">
+
+                <a-menu-item>
+                  <a @click="handleEdit(record)">编辑</a>
+                </a-menu-item>
+                <a-menu-item>
+                  <a-popconfirm title="确定删除吗?" @confirm="() => dataDelete(record)">
+                    <a>删除</a>
+                  </a-popconfirm>
+                </a-menu-item>
+              </a-menu>
+            </a-dropdown>
+        </span>
+          </a-table>
+        </div>
+        <!-- 右侧的角色权限配置 -->
+        <user-role-modal ref="modalUserRole"></user-role-modal>
+        <post-config-model ref="modalForm" @ok="modalFormOk"></post-config-model>
+      </a-card>
+    </a-col>
+
+  </a-row>
+</template>
+<script>
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import { deleteAction, postAction, getAction } from '@/api/manage'
+  import postConfigModel from './modules/postConfigModel'
+  import moment from 'moment'
+  import { adminCheck } from '@/api/api'
+  export default {
+    name: 'expireDateConfig',
+    mixins: [JeecgListMixin],
+    components: {
+      postConfigModel,
+      moment
+    },
+    data() {
+      return {
+
+        /* 数据源 */
+        columns: [
+            {
+              title: '岗位',
+              align: 'center',
+              dataIndex: 'itemText',
+            },
+            {
+              title: '创建时间',
+              dataIndex: 'createTime',
+              align:"center",
+              // sorter: true,
+              sorter:(a, b) => { return a.createTime>= b.createTime? 1 : -1 },
+              customRender: (text) => {
+                return moment(text).format('YYYY-MM-DD')
+              }
+            },
+            {
+              title: '操作',
+              dataIndex: 'action',
+              align: 'center',
+              scopedSlots: { customRender: 'action' }
+            }
+          ],
+        url: {
+          list: "/sys/dictItem/listPost"
+        }
+      }
+
+    },
+    methods: {
+      dataDelete(id) {
+        var that = this;
+        deleteAction("/sys/dictItem/delete", {id: id.id}).then((res) => {
+          if (res.success) {
+            that.$message.success('清空完成!');
+            that.$emit('ok');
+          } else {
+            that.$message.warning('清空失败!');
+          }
+        });
+      },
+    }
+  }
+</script>
+<style scoped>
+@import '~@assets/less/common.less';
+  /** Button按钮间距 */
+  .ant-btn {
+    margin-left: 8px
+  }
+</style>