Browse Source

系统工具

jun.zhang 2 years ago
parent
commit
19fea3e24d

+ 2 - 2
src/App.vue

@@ -184,8 +184,8 @@
             <el-submenu index="10">
               <template slot="title">系统工具</template>
               <el-menu-item index="10-1">岗位核准信息</el-menu-item>
-              <el-menu-item index="10-2">表单构建</el-menu-item>
-              <el-menu-item index="10-3">代码生成</el-menu-item>
+              <el-menu-item index="formConstruction">表单构建</el-menu-item>
+              <el-menu-item index="generateCode">代码生成</el-menu-item>
               <el-menu-item index="10-4">系统接口</el-menu-item>
             </el-submenu>
 

+ 19 - 0
src/router/index.js

@@ -74,6 +74,25 @@ const routes = [
     },
     component: () => import('@/views/Review/secondary/components/userInfo.vue')
   },
+  // 系统工具
+  // 表单构建
+  {
+    path: '/formConstruction',
+    name: 'formConstruction',
+    meta: {
+      inStructure: true
+    },
+    component: () => import('@/views/systemTools/formConstruction/index.vue')
+  },
+  // 代码生成
+  {
+    path: '/generateCode',
+    name: 'generateCode',
+    meta: {
+      inStructure: true
+    },
+    component: () => import('@/views/systemTools/generateCode/index.vue')
+  },
   {
     path: '/recruitmentPlan',
     name: 'recruitmentPlan',

+ 180 - 0
src/views/systemTools/formConstruction/index.vue

@@ -0,0 +1,180 @@
+<!-- 流程模型 -->
+<template>
+  <div class="boxSty">
+    <div class="b-left">
+      <div class="left-title">
+        <span>元素</span>
+        <span
+          ><i class="el-icon-arrow-down"></i
+          ><i style="margin: 0px 10px" class="el-icon-setting"></i
+          ><i class="el-icon-close"></i
+        ></span>
+      </div>
+      <div class="left-tips">
+        拖拽左侧的表单元素到右侧区域,即可生成相应的HTML代码,表单代码,轻松搞定!
+      </div>
+      <el-form
+        style="margin: 20px"
+        ref="form"
+        :model="form"
+        label-width="100px"
+      >
+        <el-form-item label="文本框:">
+          <el-input v-model="form.name"></el-input>
+        </el-form-item>
+        <el-form-item label="多行文本框:">
+          <el-input type="textarea" v-model="form.desc"></el-input>
+        </el-form-item>
+        <el-form-item label="密码框:" prop="pass">
+          <el-input type="password" autocomplete="off"></el-input>
+        </el-form-item>
+        <el-form-item label="下拉框:">
+          <el-select
+            v-model="form.region"
+            placeholder="请选择"
+            style="width: 100%"
+          >
+            <el-option label="区域一" value="shanghai"></el-option>
+            <el-option label="区域二" value="beijing"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="纯文本:"> 这里是纯文字信息 </el-form-item>
+        <el-form-item label="单选框:">
+          <el-radio-group v-model="form.resource">
+            <el-radio label="选项1"></el-radio>
+            <el-radio label="选项2"></el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="复选框:">
+          <el-checkbox-group v-model="form.type">
+            <el-checkbox label="选项1" name="type"></el-checkbox>
+            <el-checkbox label="选项2" name="type"></el-checkbox>
+          </el-checkbox-group>
+        </el-form-item>
+        <el-form-item label="切换按钮:">
+          <el-switch v-model="form.delivery"></el-switch>
+        </el-form-item>
+        <el-form-item label="日期选择:">
+          <el-date-picker
+            type="date"
+            placeholder="选择日期"
+            v-model="form.date1"
+            style="width: 100%"
+          ></el-date-picker>
+        </el-form-item>
+
+        <el-form-item>
+          <el-button
+            style="
+              background-color: #1ab394;
+              border-color: #1ab394;
+              color: #ffffff;
+            "
+            @click="onSubmit"
+            >提交</el-button
+          >
+          <el-button
+            style="
+              background-color: #ed5565;
+              border-color: #ed5565;
+              color: #ffffff;
+            "
+            >关闭</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </div>
+    <div class="b-right">
+      <div class="right-title">
+        <span>拖拽左侧的表单元素到此区域</span>
+        <span>
+          <el-form ref="form" :model="form" label-width="150px">
+            <el-form-item label="请选择显示的列数" style="margin-bottom: 0px">
+              <el-select style="width: 50px">
+                <el-option label="区域一" value="shanghai"></el-option>
+                <el-option label="区域二" value="beijing"></el-option>
+              </el-select> </el-form-item></el-form
+        ></span>
+      </div>
+      <div style="height: 82%"></div>
+      <el-button style="margin-left: 20px" type="warning">复制代码</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      form: {
+        name: "",
+        region: "",
+        date1: "",
+        date2: "",
+        delivery: false,
+        type: [],
+        resource: "",
+        desc: "",
+      },
+    };
+  },
+  methods() {},
+  beforeUpdate() {},
+  methods: {},
+  name: "contract",
+  components: {},
+};
+</script>
+
+
+<style lang="scss" scoped>
+.boxSty {
+  /* margin: 20px; */
+  width: 100%;
+  display: flex;
+}
+.b-left {
+  width: 40%;
+  height: 700px;
+  background: #fff;
+  overflow-y: auto;
+}
+.b-right {
+  margin-left: 20px;
+  width: 60%;
+  height: 600px;
+  background: #fff;
+}
+.left-title {
+  display: flex;
+  justify-content: space-between;
+  padding: 10px 20px;
+  border-bottom: 1px solid #ededee;
+}
+.right-title {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 0px 20px;
+  border-bottom: 1px solid #ededee;
+}
+.left-tips {
+  font-size: 14px;
+  margin: 20px;
+  padding: 12px;
+  width: calc(100% - 64px);
+  border-radius: 10px;
+  height: 50px;
+  color: #31708f;
+  background-color: #d9edf7;
+  border-color: #bce8f1;
+}
+</style>
+<style lang="scss">
+.b-right {
+  .el-input__inner {
+    height: 20px;
+    line-height: 20px;
+  }
+}
+</style>

+ 571 - 0
src/views/systemTools/generateCode/index.vue

@@ -0,0 +1,571 @@
+<!-- 流程模型 -->
+<template>
+  <div class="recruitmentPlanBox">
+    <div class="header">
+      <el-form
+        :inline="true"
+        :model="planHeaderForm"
+        class="demo-form-inline"
+        ref="planHeaderForm"
+      >
+        <el-form-item
+          label="表名称:"
+          prop="name"
+          style="margin-left: 20px; margin-top: 20px"
+        >
+          <el-input v-model="planHeaderForm.name"></el-input>
+        </el-form-item>
+        <el-form-item label="表描述:" prop="cardId" style="margin-top: 20px">
+          <el-input v-model="planHeaderForm.cardId"></el-input>
+        </el-form-item>
+        <el-form-item label="表时间:" style="margin-top: 20px">
+          <el-date-picker
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item>
+          <el-button
+            round
+            type="primary"
+            icon="el-icon-search"
+            @click="onSearch"
+            style="margin-left: 10px; margin-top: 20px"
+            >搜索</el-button
+          >
+          <el-button
+            round
+            icon="el-icon-refresh"
+            @click="resetForm('planHeaderForm')"
+            style="margin-left: 10px; margin-top: 20px"
+            >重置</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </div>
+    <div class="content">
+      <div class="con">
+        <el-button
+          icon="el-icon-download"
+          style="
+            margin-left: 10px;
+            background-color: rgb(99 164 207);
+            border-color: rgb(99 164 207);
+            color: #ffffff;
+          "
+          >生成</el-button
+        >
+        <el-button
+          icon="el-icon-upload2"
+          style="
+            margin-left: 10px;
+            background-color: #1ab394;
+            border-color: #1ab394;
+            color: #ffffff;
+          "
+          >导入</el-button
+        >
+        <el-button
+          icon="el-icon-edit-outline"
+          style="
+            margin-left: 10px;
+            background-color: rgb(97 217 173);
+            border-color: rgb(97 217 173);
+            color: #ffffff;
+          "
+          >修改</el-button
+        >
+        <el-button
+          icon="el-icon-close"
+          style="
+            margin-left: 10px;
+            background-color: rgb(235 144 144);
+            border-color: rgb(235 144 144);
+            color: #ffffff;
+          "
+          >删除</el-button
+        >
+      </div>
+      <!-- 右侧栏 -->
+      <div class="con cons">
+        <div class="b_r b_ro">
+          <i class="el-icon-search" title="搜索"></i>
+        </div>
+        <div class="b_r">
+          <i class="el-icon-refresh" title="刷新"></i>
+        </div>
+        <div class="b_r" @click="show = !show">
+          <i class="el-icon-notebook-2" title="切换"></i>
+        </div>
+        <div class="b_r b_rs">
+          <el-dropdown :hide-on-click="false">
+            <div class="b_rf">
+              <i class="el-icon-s-grid" title="列"></i>
+              <i class="el-icon-caret-bottom" title="列"></i>
+            </div>
+            <!-- 右侧栏 -->
+            <!-- 下拉菜单 -->
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item>
+                <el-checkbox v-model="showColumn.bh">编号</el-checkbox>
+              </el-dropdown-item>
+              <el-dropdown-item>
+                <el-checkbox v-model="showColumn.xh">序号</el-checkbox>
+              </el-dropdown-item>
+              <el-dropdown-item>
+                <el-checkbox v-model="showColumn.bmc">表名称</el-checkbox>
+              </el-dropdown-item>
+              <el-dropdown-item>
+                <el-checkbox v-model="showColumn.bms">表描述</el-checkbox>
+              </el-dropdown-item>
+              <el-dropdown-item>
+                <el-checkbox v-model="showColumn.stlmc">实体类名称</el-checkbox>
+              </el-dropdown-item>
+              <el-dropdown-item>
+                <el-checkbox v-model="showColumn.cjss">创建时间</el-checkbox>
+              </el-dropdown-item>
+              <el-dropdown-item>
+                <el-checkbox v-model="showColumn.gxss">更新时间</el-checkbox>
+              </el-dropdown-item>
+              <el-dropdown-item>
+                <el-checkbox v-model="showColumn.post">操作</el-checkbox>
+              </el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+          <!-- 下拉菜单 -->
+        </div>
+        <plan-con></plan-con>
+      </div>
+    </div>
+    <!-- 右侧栏 -->
+    <!-- 切换前列表 -->
+    <el-table
+      v-show="show"
+      ref="multipleTable"
+      :data="tableData"
+      tooltip-effect="dark"
+      style="width: 100%"
+      @select="handleSelectionChange"
+      @select-all="handleSelectionChangeall"
+    >
+      <el-table-column type="selection"> </el-table-column>
+      <el-table-column label="编号" v-if="showColumn.bh">
+        <template slot-scope="scope">{{ scope.row.bh }}</template>
+      </el-table-column>
+      <el-table-column label="序号" v-if="showColumn.xh">
+        <template slot-scope="scope">{{ scope.row.xh }}</template>
+      </el-table-column>
+      <el-table-column label="表名称" v-if="showColumn.bmc">
+        <template slot-scope="scope">{{ scope.row.bmc }}</template>
+      </el-table-column>
+      <el-table-column label="表描述" v-if="showColumn.bms">
+        <template slot-scope="scope">{{ scope.row.bms }}</template>
+      </el-table-column>
+      <el-table-column label="实体类名称" v-if="showColumn.stlmc">
+      </el-table-column>
+      <el-table-column label="创建时间" v-if="showColumn.cjss">
+      </el-table-column>
+      <el-table-column label="更新时间" v-if="showColumn.gxss">
+      </el-table-column>
+      <el-table-column
+        prop="num"
+        label="操作"
+        width="300"
+        v-if="showColumn.post"
+      >
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="primary"
+            @click="handleEdit(scope.$index, scope.row)"
+            >编辑</el-button
+          >
+          <el-button
+            size="mini"
+            type="success"
+            @click="handledeploy(scope.$index, scope.row)"
+            >部署</el-button
+          >
+          <el-button
+            size="mini"
+            type="warning"
+            @click="handleExport(scope.$index, scope.row)"
+            >导出</el-button
+          >
+          <el-button
+            size="mini"
+            type="danger"
+            @click="handleDelete(scope.$index, scope.row)"
+            >删除</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- 切换前列表 -->
+    <!-- 分页 -->
+    <div class="block">
+      <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="currentPage4"
+        :page-sizes="[10, 20, 30, 40]"
+        :page-size="100"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="100"
+      >
+      </el-pagination>
+    </div>
+    <!-- 切换后列表 -->
+    <div v-show="!show">
+      <div v-for="(item, index) in tableData" class="col-md" :key="index">
+        <el-checkbox
+          v-model="item.show"
+          style="width: 100%; white-space: normal"
+          @change="handleCheckedCitiesChange(item)"
+          class="checkboxs"
+        >
+          <el-row :gutter="20" class="grid-text" v-if="showColumn.inviteid">
+            <el-col :span="8">
+              <div class="grid-content bg-purple">ID</div>
+            </el-col>
+            <el-col :span="16">
+              <div class="grid-content bg-purple">{{ item.date }}</div>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20" class="grid-text" v-if="showColumn.serial">
+            <el-col :span="8">
+              <div class="grid-content bg-purple">KEY</div>
+            </el-col>
+            <el-col :span="16">
+              <div class="grid-content bg-purple">{{ item.key }}</div>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20" class="grid-text" v-if="showColumn.organid">
+            <el-col :span="8">
+              <div class="grid-content bg-purple">名称</div>
+            </el-col>
+            <el-col :span="16">
+              <div class="grid-content bg-purple">{{ item.date }}</div>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20" class="grid-text" v-if="showColumn.wanttype">
+            <el-col :span="8">
+              <div class="grid-content bg-purple">版本</div>
+            </el-col>
+            <el-col :span="16">
+              <div class="grid-content bg-purple">{{ item.name }}</div>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20" class="grid-text" v-if="showColumn.wantyear">
+            <el-col :span="8">
+              <div class="grid-content bg-purple">创建时间</div>
+            </el-col>
+            <el-col :span="16">
+              <div class="grid-content bg-purple">{{ item.type }}</div>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20" class="grid-text" v-if="showColumn.planwant">
+            <el-col :span="8">
+              <div class="grid-content bg-purple">最后更新时间</div>
+            </el-col>
+            <el-col :span="16">
+              <div class="grid-content bg-purple">{{ item.year }}</div>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20" class="grid-text" v-if="showColumn.wantnumber">
+            <el-col :span="8">
+              <div class="grid-content bg-purple">元数据</div>
+            </el-col>
+            <el-col :span="16">
+              <div class="grid-content bg-purple">{{ item.number }}</div>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20" class="grid-text" v-if="showColumn.post">
+            <el-col :span="8">
+              <div class="grid-content bg-purple">操作</div>
+            </el-col>
+            <el-col :span="16">
+              <div class="grid-content bg-purple">{{ item.nums }}</div>
+            </el-col>
+          </el-row>
+        </el-checkbox>
+      </div>
+    </div>
+    <!-- 切换后列表 -->
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      currentPage1: 5,
+      currentPage2: 5,
+      currentPage3: 5,
+      currentPage4: 1,
+      visible: false,
+      show: true, //表单切换
+      planHeaderForm: {
+        unit: "",
+        years: "",
+        cardId: "",
+      },
+      tableData: [
+        {
+          nh: "123223",
+          xh: "1",
+          bmc: "岗位设置流程",
+          bms: "2222222221",
+          stlmc: "6667766",
+          cjss: "2020-07-14 13:45:59",
+          gxsj: "2020-07-14 13:45:59",
+        },
+      ],
+      multipleSelection: [],
+      showColumn: {
+        bh: false,
+        xh: true,
+        bmc: true,
+        bms: true,
+        stlmc: true,
+        cjss: true,
+        gxss: true,
+        post: true,
+      },
+      options: [
+        {
+          value: "选项1",
+          label: "所有",
+        },
+        {
+          value: "选项2",
+          label: "正常",
+        },
+        {
+          value: "选项3",
+          label: "作废",
+        },
+      ],
+      value: "",
+    };
+  },
+  methods() {
+    // 发请求得到showColumnInitData的列的名字
+    if (localStorage.getItem("columnSet")) {
+      this.showColumn = JSON.parse(localStorage.getItem("columnSet")); 
+    } else {
+      this.showColumn = {
+        inviteid: false,
+        serial: true,
+        organid: true,
+        want: true,
+        wanttype: true,
+        wantyear: true,
+        planwant: true,
+        wantnumber: true,
+        hired: true,
+        remark: true,
+        creator: true,
+        creationtime: true,
+        modifier: true,
+        modifiertime: true,
+        accessory: true,
+      };
+    }
+  },
+  beforeUpdate() {
+    if (this.show) {
+      this.$nextTick(() => {
+        //在数据加载完,重新渲染表格
+        this.$refs["multipleTable"].doLayout();
+      });
+    }
+  },
+  methods: {
+    handleEdit(index, row) {
+      console.log(index, row);
+    },
+    handleDelete(index, row) {
+      console.log(index, row);
+    },
+    handledeploy(index, row) {
+      console.log(index, row);
+    },
+    handleExport(index, row) {
+      console.log(index, row);
+    },
+    handleSizeChange(val) {
+      console.log(`每页 ${val} 条`);
+    },
+    handleCurrentChange(val) {
+      console.log(`当前页: ${val}`);
+    },
+    handleSelectionChange(selection, val) {
+      val.show = !val.show;
+    },
+    handleSelectionChangeall(selection) {
+      if (selection.length == 0) {
+        this.tableData.forEach((val) => {
+          val.show = false;
+        });
+      } else {
+        selection.forEach((val) => {
+          val.show = true;
+        });
+      }
+    },
+    handleCheckedCitiesChange(val) {
+      this.$refs.multipleTable.toggleRowSelection(val);
+    },
+    saveColumn() {
+      localStorage.setItem("columnSet", JSON.stringify(this.showColumn));
+      this.visible = false;
+    },
+  },
+  name: "contract",
+  components: {},
+};
+</script>
+
+<style scoped>
+.recruitmentPlanBox {
+  height: 100%;
+  min-width: 1200px;
+}
+
+.recruitmentPlanBox .header {
+  background: #ffffff;
+  border-radius: 10px;
+  box-shadow: 1px 1px 3px rgb(0 0 0 / 20%);
+  margin-bottom: 20px;
+}
+
+.recruitmentPlanBox .con {
+  /* background: #ffffff; */
+  height: calc(100% - 90px);
+  padding: 20px 0px 10px 0px;
+  margin-right: 20px;
+  display: flex;
+}
+
+.content {
+  display: flex;
+  border-radius: 10px 10px 0 0;
+  justify-content: space-between;
+  background: #ffffff;
+}
+
+.cons {
+  display: flex;
+}
+
+.b_r {
+  border: 1px solid #dcdcdc;
+  border-right: none;
+  color: #000;
+  font-size: 24px;
+  cursor: pointer;
+}
+
+.b_rs {
+  border: 1px solid #dcdcdc;
+  color: #000;
+  font-size: 24px;
+  cursor: pointer;
+  border-radius: 0 5px 5px 0;
+}
+
+.b_ro {
+  border-radius: 5px 0 0 5px;
+}
+
+.b_rf {
+  display: flex;
+  align-items: center;
+}
+
+.b_r:hover {
+  color: #ffffff;
+  background-color: #999;
+}
+
+.b_rf:hover {
+  color: #ffffff;
+  background-color: #999;
+}
+
+.el-icon-caret-bottom {
+  font-size: 16px;
+}
+
+.el-icon-search {
+  padding: 10px 10px 10px 10px;
+  font-size: 16px;
+  font-weight: 600;
+}
+
+.el-icon-refresh {
+  padding: 10px 10px 10px 10px;
+  font-size: 16px;
+  font-weight: 600;
+}
+
+.el-icon-notebook-2 {
+  padding: 10px 10px 10px 10px;
+  font-size: 16px;
+  font-weight: 600;
+}
+
+.el-icon-s-grid {
+  padding: 10px 0px 10px 10px;
+  font-size: 16px;
+  font-weight: 500;
+}
+
+.el-icon-caret-bottom {
+  padding: 10px 10px 10px 0;
+  font-size: 10px;
+  font-weight: 500;
+}
+
+.fade-enter-active,
+.fade-leave-active {
+  transition: opacity 0.3s;
+}
+
+.fade-enter,
+.fade-leave-to {
+  opacity: 0;
+}
+
+.chenkbox {
+  display: flex;
+  flex-direction: column;
+}
+
+.col-md {
+  background: #fff;
+  padding: 15px;
+}
+
+.grid-text {
+  margin-top: 5px;
+}
+
+::v-deep .el-checkbox__label {
+  width: 100%;
+}
+
+::v-deep .checkboxs .el-checkbox__input {
+  margin-left: 10px;
+}
+
+.block {
+  padding: 30px 0 20px 30px;
+  background-color: #fff;
+  border-radius: 0 0 10px 10px;
+}
+</style>