Selaa lähdekoodia

domainFunciton

LJJ 9 kuukautta sitten
vanhempi
commit
534300b71b

+ 2 - 1
config/dev.env.js

@@ -7,7 +7,8 @@ module.exports = merge(prodEnv, {
   // AIP_BASE: '"http://192.168.124.108:8082/DPshow_depart_war_exploded/"',
   //AIP_BASE: '"https://duptest.bgyfw.com:8002/DPshow_depart"',
   // AIP_BASE: '"http://10.187.0.72:8072/DPshow_depart"',
-    AIP_BASE: '"http://localhost:8072/DPshow_depart/"',
+  AIP_BASE: '"http://localhost:8072/DPshow_depart_war_exploded/"',
+      // AIP_BASE: '"http://localhost:8072"',
   LUOSIMAO_API: '"6c29b1e55ab2befad0b746db886d10c7"',
   LUOSIMAO_DEV_RESPONSE_CODE: '"0697056754B0C13C745662D33E1AC555"',
   H5_INDEX: '"https://duptest.bgyfw.com:8002/DPshow_depart/api/wxLogin/userAuth?url=https://duptest.bgyfw.com/m/pages/singlePage/index.html"'

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 17620
package-lock.json


+ 1 - 1
src/App.vue

@@ -22,7 +22,7 @@ export default {
       display: table-cell !important;
   }
   #app {
-  
+
   }
   .hoverPointer:hover{
       cursor: pointer;

+ 4 - 4
src/api/customerInfo.js

@@ -5,11 +5,11 @@ class Request {
     getList (data = {}, success, error, exception) {
         return axiosPostWrapper('/api/media/customer/findCustomerPage', data, success, error, exception)
     }
-    // 新增/修改 客户 
+    // 新增/修改 客户
     saveOne (data = {}, success, error, exception) {
         return axiosPostWrapper('/api/media/customer/saveOne', data, success, error, exception)
     }
-    // 删除 
+    // 删除
     deleteTable (data = {}, success, error, exception) {
         return axiosPostWrapper('/api/media/customer/del', data, success, error, exception)
     }
@@ -17,7 +17,7 @@ class Request {
     findOne (data = {}, success, error, exception) {
         return axiosGetWrapper('/api/media/customer/findOne', data, success, error, exception)
     }
-    // 导入 
+    // 导入
     exportIn (data) {
         return urlWrapper('/api/media/customer/exportIn', data)
     }
@@ -27,4 +27,4 @@ class Request {
      }
 }
 
-export default new Request()
+export default new Request()

+ 22 - 0
src/api/domainName.js

@@ -0,0 +1,22 @@
+import { axiosPostWrapper, axiosGetWrapper, urlWrapper ,axiosDeleteWrapper,axiosPostJsonWrapper,postFileWrapper} from './index';
+
+export const managerGetAllRows = (data={}, success, error, exception) => {
+  axiosGetWrapper('/api/biapp/domain/backend/blurSearch', data, success, error, exception);
+};
+
+export const delRowByNameIds = (data={}, success, error, exception) => {
+  axiosPostJsonWrapper('/api/biapp/domain/backend/deleteByIds',data, success, error, exception);
+};
+
+export const createDomain = (data={}, success, error, exception) => {
+  axiosPostJsonWrapper('/api/biapp/domain/backend/createDoMain',data, success, error, exception);
+};
+
+export const auditByNameId = (data={}, success, error, exception) => {
+  axiosPostJsonWrapper('/api/biapp/domainState/backend/changeState',data, success, error, exception);
+};
+
+//!!!!!!!!!!!!
+export const exportExcel= (data={}) => {
+  return urlWrapper('/api/biapp/domain/backend/exportExcel',data);
+};

+ 6 - 3
src/api/index.js

@@ -236,9 +236,12 @@ export const urlWrapper = (api, requestdata) => {
   let ret = '';
   Object.keys(requestdata).forEach((key) => {
     if ({}.hasOwnProperty.call(requestdata, key)) {
-      ret += `${encodeURIComponent(key)}=${encodeURIComponent(requestdata[key])}&`;
+      if(!requestdata[key]==null&&!requestdata[key]==""){
+        ret += `${encodeURIComponent(key)}=${encodeURIComponent(requestdata[key])}&`;
+      }
     }
   });
+
   return uri +"&"+ ret;
 }
 
@@ -279,6 +282,7 @@ export const axiosGetWrapper = (api, requestdata, success, error, exception) =>
         let ret = '';
         Object.keys(param).forEach((key) => {
           if ({}.hasOwnProperty.call(param, key)) {
+            // console.log(key,requestdata[key])
             ret += `${encodeURIComponent(key)}=${encodeURIComponent(param[key])}&`;
           }
         });
@@ -291,7 +295,7 @@ export const axiosGetWrapper = (api, requestdata, success, error, exception) =>
     const request = response.request || {};
     const responseConfig = response.config || {};
     const code = resData.resultCode || 0;
-
+    console.log(resData);
     if (code > 0) {
       if (axios.isCancel(true)) {
         console.warn('请求终止:' + resData.resultMsg || '服务器异常');
@@ -498,7 +502,6 @@ export const postFileWrapper = (api, data, onprogress, success, error, exception
     const request = response.request || {};
     const responseConfig = response.config || {};
     const code = resData.resultCode || 0;
-
     if (code > 0) {
       if (axios.isCancel(true)) {
         console.warn('请求终止:' + resData.resultMsg || '服务器异常');

+ 402 - 0
src/components/domainNameComponents/addDialog.vue

@@ -0,0 +1,402 @@
+<template>
+  <div class="block">
+    <el-dialog :destroy-on-close="true" title="域名管理登记" :visible.sync="dialogVisible" width="50%"
+      :before-close="handleClose">
+      <div style="width: 100%;margin-bottom: 20px;margin-top: -10px;" class="tip">
+        <span>基本信息(必填)</span>
+      </div>
+      <el-form ref="domainForm" :status-icon="true" :rules="rules" :disabled="!isEdit" :inline="false"
+        :model="tableData" class="demo-form-inline">
+        <el-form-item key="name" label="域名" prop="name">
+          <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 2 }" v-model="tableData.name" maxlength="50"
+            placeholder="请输入域名(50字以内)"></el-input>
+        </el-form-item>
+        <el-form-item required label="域名券号">
+          <el-input placeholder="系统自动生成" v-model="tableData.nameId" :disabled="true">
+          </el-input>
+        </el-form-item>
+        <el-form-item key="owner" required label="域名所有人" prop="owner"">
+          <el-input type=" textarea" :autosize="{ minRows: 2, maxRows: 2 }" v-model="tableData.owner" maxlength="50"
+          placeholder="请输入所有人(50字以内)"></el-input>
+        </el-form-item>
+        <el-form-item required label="审核状态">
+          <el-input v-model="tableData.state" placeholder="草稿" :disabled="true">
+          </el-input>
+        </el-form-item>
+
+        <div style="display: flex;">
+          <el-form-item key="reTime" label="域名申请日期" style="margin-right: 20px;" prop="reTime">
+            <el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="tableData.reTime" type="datetime"
+              placeholder="选择日期">
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item key="agency" label="代理机构" prop="agency">
+            <el-select v-model="tableData.agency" placeholder="代理机构">
+              <el-option label="机构1" value="1"></el-option>
+              <el-option label="机构2" value="2"></el-option>
+            </el-select>
+          </el-form-item>
+        </div>
+
+        <div style="display: flex;">
+          <el-form-item label="下次续展日期" style="margin-right: 20px;">
+            <el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="tableData.nextTime" type="datetime"
+              placeholder="选择日期">
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item label="续费日期">
+            <el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="tableData.payTime" type="datetime"
+              placeholder="选择日期">
+            </el-date-picker>
+          </el-form-item>
+        </div>
+        <el-form-item key="amount" label="续费金额" prop="amount">
+          <el-input type="textarea" :autosize="{ minRows: 1, maxRows: 1 }" v-model.number="tableData.amount"
+            maxlength="50" placeholder="请输入金额(50字以内)"></el-input>
+        </el-form-item>
+        <el-form-item key="mode" label="业务模式" prop="mode">
+          <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 2 }" v-model="tableData.mode" maxlength="50"
+            placeholder="请输入业务模式(50字以内)"></el-input>
+        </el-form-item>
+        <el-form-item key="department" label="使用部门" prop="department">
+          <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 2 }" v-model="tableData.depName" maxlength="50"
+            placeholder="请输入使用部门(50字以内)"></el-input>
+        </el-form-item>
+        <el-form-item label="登记人">
+          <el-input v-model="user.UserName" :disabled="true">
+          </el-input>
+        </el-form-item>
+        <el-form-item label="登记日期">
+          <el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="tableData.createTime" disabled type="datetime"
+            placeholder="系统自动生成">
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+
+      <!-- 费用信息子表 -->
+      <el-card class="box-card">
+        <div slot="header" class="clearfix">
+          <span style="line-height: 36px;">
+            <i class="el-icon-date" style="margin-right: 5px;"></i>费用信息子表
+          </span>
+          <el-button v-show="isEdit" @click="deleteChildRow" style="float: right;margin-right: 10px;" size="small"
+            type="danger">删除</el-button>
+          <el-button v-show="isEdit" style="float: right;margin-right: 10px;" size="small" type="primary"
+            @click="childVisible = true, childTableAdd = true">添加</el-button>
+        </div>
+        <el-table @selection-change="handleSelectionChange" :data="childTable" border style="width: 100%">
+          <el-table-column :show-overflow-tooltip="true" align="center" type="selection" width="55">
+          </el-table-column>
+          <el-table-column prop="payType" label="费用类型" width="150">
+          </el-table-column>
+          <el-table-column prop="money" label="金额" width="120">
+          </el-table-column>
+          <el-table-column prop="depAttribute" label="部门属性" width="120">
+          </el-table-column>
+          <el-table-column prop="budgetDep" label="预算部门" width="120">
+          </el-table-column>
+          <el-table-column prop="common" label="备注" width="300">
+          </el-table-column>
+          <el-table-column fixed="right" label="操作" width="100">
+            <template slot-scope="scope">
+              <el-button @click="showChildForm(scope, true, false)" type="text" size="small">查看</el-button>
+              <el-button v-if="isEdit" @click="showChildForm(scope, true, true)" type="text" size="small">编辑</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-card>
+
+      <span slot="footer" class="dialog-footer">
+        <el-button v-show="isEdit" @click="postDomainInfo(operationMap.SAVE)">保存</el-button>
+        <el-button v-show="isEdit" type="primary" @click="postDomainInfo(operationMap.PUBLISH)">发布</el-button>
+        <el-button type="danger" @click="handleClose">关闭</el-button>
+      </span>
+    </el-dialog>
+
+    <!-- 费用信息表的新增及查看弹窗 -->
+    <el-dialog title="费用信息子表" :visible.sync="childVisible" width="35%" :before-close="childhandleClose">
+      <el-form ref="childForm" :disabled="!childIsEdit" :model="childRowInfo" :rules="rules" class="demo-form-inline">
+        <div style="display: flex;">
+          <el-form-item key="payType" prop="payType" label="费用类型" style="margin-right: 20px;">
+            <el-select value-key="childRowInfo.payType" v-model="childRowInfo.payType" placeholder="请选择类型">
+              <el-option label="官费" value="官费"></el-option>
+              <el-option label="代理费" value="代理费"></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item key="depAttribute" label="部门属性" prop="depAttribute">
+            <el-select v-model="childRowInfo.depAttribute" placeholder="请选择属性">
+              <el-option label="职能部门" value="职能部门"></el-option>
+              <el-option label="业务部门" value="业务部门"></el-option>
+            </el-select>
+          </el-form-item>
+        </div>
+        <el-form-item key="money" label="金额" prop="money">
+          <el-input type="textarea" :autosize="{ minRows: 1, maxRows: 1 }" v-model.number="childRowInfo.money"
+            maxlength="50" placeholder="请输入金额(50字以内)"></el-input>
+        </el-form-item>
+        <el-form-item key="budgetDep" label="预算部门" prop="budgetDep">
+          <el-input type="textarea" :autosize="{ minRows: 1, maxRows: 1 }" v-model="childRowInfo.budgeDep"
+            maxlength="50" placeholder="请输入预算部门(50字以内)"></el-input>
+        </el-form-item>
+        <el-form-item key="common" label="备注" prop="common">
+          <el-input type="textarea" :autosize="{ minRows: 5, maxRows: 5 }" v-model="childRowInfo.common" maxlength="200"
+            placeholder="请输入备注(200字以内)"></el-input>
+        </el-form-item>
+
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="cancelChildForm">取 消</el-button>
+        <el-button type="primary" @click="saveChildForm">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+
+</template>
+
+<script>
+import { rulesForDomain } from "@/mixins/rulesForDomain.js";
+import { deepClone } from "@/util/util";
+import { createDomainInfo } from "@/util/createData";
+import { createDomain } from "@/api/domainName"
+import { operationMap } from "@/enums/domain/operationType.js"
+export default {
+  mixins: [rulesForDomain],
+  props: {
+    propData: {
+      //弹窗展示控制
+      dialogState: {
+        type: String,
+        default: false
+      },
+      //所选当前列的数据
+      currentRow: {
+        type: Object,
+        default: {}
+      },
+      currentRowChild: {
+        type: Array,
+        default: []
+      },
+      //操作类型
+      operationType: {
+        type: String,
+      }
+    },
+    functionCode: {
+      type: Object,
+    }
+  },
+  data() {
+    return {
+      operationMap,
+      dialogVisible: this.propData.dialogState,
+      childVisible: false,
+      isEdit: this.propData.opeartionType,
+      input: '',
+      user: {},
+      tableData: this.propData.currentRow,
+      childTable: this.propData.currentRowChild,
+      childRowInfo: {},
+      childIsEdit: true,
+      childTableAdd: false,
+      rowIndex: 0,
+      multipleSelection: [],
+    };
+  },
+  mounted() {
+    this.getUserInfo();
+  },
+  watch: {
+    'propData.dialogState': {
+      handler(newValue, oldValue) {
+        this.dialogVisible = newValue
+      },
+      deep: true,
+    },
+    'propData.currentRow': {
+      handler(newValue, oldValue) {
+        this.tableData = newValue
+      },
+      deep: true,
+    },
+    'propData.operationType': {
+      handler(newValue, oldValue) {
+        this.isEdit = newValue
+      },
+      deep: true,
+    },
+    'propData.currentRowChild': {
+      handler(newValue, oldValue) {
+        this.childTable = newValue
+      },
+      deep: true,
+    }
+  },
+  methods: {
+    postDomainInfo(operationType) {
+      console.log("$", this.functionCode["domain_admin"])
+      if (!this.functionCode["domain_admin"]) {
+        return this.$message({ type: "error", message: "您没有操作权限", duration: 2000, onClose: () => { } })
+      }
+      this.$refs["domainForm"].validate(async (valid) => {
+        if (valid) {
+          if (operationType === null || operationType === "") {
+            this.$message({
+              type: "error",
+              message: "错误,请检查操作类型",
+              duration: 2000,
+              onClose: () => { }
+            });
+          }
+          // 构造请求data
+          const domianInfo = createDomainInfo(this.tableData, this.childTable, this.user.UserName, operationType)
+          await createDomain(domianInfo, success => {
+            this.$message({
+              type: 'success',
+              message: "操作成功"
+            });
+            this.$refs["domainForm"].resetFields();
+            this.reset()
+            this.$emit("reflashTable", domianInfo)
+
+          }, error => {
+            console.warn(error);
+            this.$message({ type: "error", message: error, duration: 2000, onClose: () => { } });
+          }, exception => {
+            console.warn(exception);
+            this.$message({ type: "error", message: exception, duration: 2000, onClose: () => { } });
+          })
+
+        }
+        else {
+          this.$message({
+            type: "error",
+            message: "注意填写格式"
+          });
+        }
+      })
+    },
+
+
+    handleClose(done) {
+      this.$confirm('确认关闭?')
+        .then(_ => {
+          //激活自定义事件
+          this.reset();
+          // this.tableData = {};
+          this.$refs["domainForm"].resetFields();
+          done();
+        })
+        .catch(_ => { });
+    },
+    onSubmit() {
+      console.log('submit!');
+    },
+
+    // 费用子表弹窗关闭前函数
+    childhandleClose(done) {
+      this.$confirm('确认关闭?')
+        .then(_ => {
+          done();
+        })
+        .catch(_ => { });
+    },
+    //自定义事件,重置父组件传递进来的数据
+    reset() {
+      this.$emit("resetPropData", false, "", "", [])
+      // this.$emit("resetCurrentRow", {})
+    },
+    //获取当前用户信息
+
+    getUserInfo() {
+      this.$store.dispatch('getSysUserInfo');
+      this.user = this.$store.state.sysUserInfo;
+    },
+    // 费用子表表单弹窗的展示函数
+    showChildForm(rowInfo, visible, isEdit) {
+      this.childRowInfo = rowInfo.row;
+      this.rowIndex = rowInfo.$index;
+      this.childVisible = visible;
+      this.childIsEdit = isEdit;
+    },
+
+    // 费用子表弹窗取消按钮函数
+    cancelChildForm() {
+      this.resetValue()
+    },
+
+    //子表重置默认值
+    resetValue() {
+      this.childRowInfo = {};
+      this.$set(this.childRowInfo, "payType", "")
+      this.childVisible = false;
+      this.childIsEdit = true;
+      this.childTableAdd = false;
+    },
+
+    // 费用子表弹窗保存按钮函数
+    saveChildForm() {
+      const childRowInfo = deepClone(this.childRowInfo);
+      if (JSON.stringify(childRowInfo) == "{}" || JSON.stringify(childRowInfo) == "") {
+        console.log("childRowInfo为空")
+        return this.$message({
+          type: "error",
+          message: "请填写信息"
+        });
+      }
+      this.$refs["childForm"].validate((valid) => {
+        if (valid) {
+          //判断标识,当前是否为添加
+          if (this.childTableAdd) {
+            if (this.childTable == null || this.childTable == "") {
+              this.childTable = [childRowInfo]
+            } else {
+              this.childTable.push(childRowInfo)
+            }
+          }
+          // 不为添加则定义为修改
+          else {
+            this.childTable[this.rowIndex] = childRowInfo;
+          }
+          //关闭弹窗前重置标识,且清空数据
+          this.resetValue()
+        }
+        else {
+          this.$message({
+            type: 'error',
+            message: "请检查输入数据",
+          })
+        }
+      })
+
+    },
+
+    //当所选费用子表列发生变化的方法
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+
+    //删除所选的费用子表列
+    deleteChildRow() {
+      this.$confirm("确认删除所选费用子表列吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          //过滤掉不被选中的列
+          this.childTable = this.childTable.filter(item => {
+            return !this.multipleSelection.includes(item);
+          });
+        })
+    }
+  }
+}
+</script>
+
+<style scoped>
+.tip {
+  font-size: 15px;
+  font-weight: 600;
+}
+</style>

+ 1 - 1
src/config/fetch.js

@@ -4,7 +4,7 @@ import store from '../store'
 import qs from 'qs'
 
 let requestheaders = {
-  baseURL: process.env.AIP_BASE,
+  // baseURL: process.env.AIP_BASE,
   timeout: 60000,
   headers: {
     // 'Content-Type': 'application/json'

+ 1 - 0
src/config/index.js

@@ -9,4 +9,5 @@ module.exports = {
   luosimaoAPI: process.env.LUOSIMAO_API,
   nodeEnv: process.env.NODE_ENV,
   responseCode: process.env.LUOSIMAO_DEV_RESPONSE_CODE,
+  
 };

+ 16 - 0
src/enums/domain/operationType.js

@@ -0,0 +1,16 @@
+export const operationType = [
+  {
+    type:"保存",
+    value: false
+  },
+  {
+    type:"发布",
+    value: true
+  }
+]
+
+
+export const operationMap = {
+  SAVE: operationType[0].value,
+  PUBLISH: operationType[1].value
+}

+ 39 - 0
src/enums/domain/stateOption.js

@@ -0,0 +1,39 @@
+//审核状态类型
+export const StateOption = [
+        {
+          label: "通过",
+          value: 1
+        },
+        {
+          label: "等待",
+          value: 2
+        },
+        {
+          label: "未通过",
+          value: 3
+        },
+        {
+          label: "草稿",
+          value: 4
+        }
+      ]
+
+export const stateOptionMap = {
+  PASS: {
+    label: StateOption[0].label,
+    value: StateOption[0].value
+  },
+  WAIT: {
+    label: StateOption[1].label,
+    value: StateOption[1].value
+  },
+  NOTPASS: {
+    label: StateOption[2].label,
+    value: StateOption[2].value
+  },
+  DRAFT: {
+    label: StateOption[3].label,
+    value: StateOption[3].value
+  }
+
+}

+ 69 - 0
src/mixins/operationRules.js

@@ -0,0 +1,69 @@
+export const operationRules = {
+  data(){
+    return{
+      functionCode:{}
+    }
+  },
+  mounted() {
+    this.getFunctionCode();
+  },
+  methods:{
+    getFunctionCode(){
+      //获取该用户的所有权限功能
+      const functionsArray = this.$store.state.sysUserInfo.userFunctions;
+      functionsArray.forEach((item)=> {
+      this.functionCode[item.code] = item;
+    })
+
+    console.log("获取功能完成",this.functionCode)
+    },
+   //判断当前域名审核状态,是否可以进行编辑
+    canEdit({state,createUser}){
+      if(state == "等待" || state == "通过" || !createUser == this.$store.state.sysUserInfo.UserName || this.functionCode["domain_admin"]==null){
+        return true;
+      }else{
+        return false;
+      }
+    },
+
+    //判断是否可以进行删除操作
+    canDel({state,createUser}){
+      if((state == "草稿" && createUser == this.$store.state.sysUserInfo.UserName)|| this.functionCode["justice_admin"]!=null){
+        return false;
+      }else{
+        return true;
+      }
+    },
+    //可以改变状态
+    canChangeState({state}){
+      if(this.functionCode["justice_admin"] && state == "等待" ){
+        return false;
+      }else{
+        return true;
+      }
+    },
+    //可以查看
+    canRead({state}){
+      //管理员可以查看本人草稿状态以及全部有效状态的域名信息
+      if(this.functionCode["domain_admin"]){
+        return false;
+      }
+      //法务部领导可以看所有已发布和待审核数据
+      else if((state=="通过"||state=="等待")&&this.functionCode["justice_admin"]){
+        return false;
+      }else{
+        return  true;
+      }
+    },
+
+    //可以进行新增操作
+    canNew(){
+      if(!this.functionCode["domain_admin"]){
+        return false;
+      }else{
+        return true;
+      }
+    }
+
+  }
+}

+ 41 - 0
src/mixins/rulesForDomain.js

@@ -0,0 +1,41 @@
+export const rulesForDomain = {
+
+  data(){
+    //合法域名判断
+    // /^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{2,6}$/.test();
+    var domainName = (rule, value, callback) => {
+        if (value == ''||value==null){
+          callback(new Error('域名不能为空'));
+        }
+        else if (!/^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+[A-Za-z]{2,6}$/.test(value)) {
+          callback(new Error('域名格式错误'));
+        } else {
+          callback();
+        }
+      };
+    return{
+      rules:{
+        name: [
+          { validator: domainName , trigger: 'blur' },
+          { required: true, message: '请输入域名', trigger: 'blur' },
+          { max: 50, message: '长度在50个字以内', trigger: 'blur'}
+        ],
+        owner:[{ required: true, message: '请输入域名所有人', trigger: 'blur' },
+        {  max: 50, message: '长度在50个字以内', trigger: 'blur' }
+        ],
+        reTime:[{ required: true, message: '请选择日期', trigger: 'blur' },
+        ],
+        amount:[{type:'number',trigger:'blur',message:'请输入正确的数字'}],
+        mode:[ {  max: 50, message: '长度在50个字以内', trigger: 'blur' }],
+        department:[{max: 50, message: '长度在50个字以内', trigger: 'blur'}],
+        money:[{type:'number',trigger:'blur',message:'请输入正确的数字'}],
+        budgetDep:[{max: 50, message: '长度在50个字以内', trigger: 'blur'}],
+        common:[{max: 50, message: '长度在50个字以内', trigger: 'blur'}],
+        // nameId:[{type:'number',trigger:'blur',message:'请输入正确的数字'}]
+        }
+    }
+  }
+
+}
+
+

+ 27 - 0
src/mixins/searchItemReset.js

@@ -0,0 +1,27 @@
+export const searchItemReset = {
+    methods: {
+      clearSearchItem(items) {
+        console.log("#########",items)
+        console.log("i was be invo")
+        // 判断是否为数组
+        if (Array.isArray(items)) {
+          //递归清除数组元素
+          items.forEach(item => {
+          this.clearSearchItem(item); // 递归清空数组中的每个元素
+        });
+        }else if (typeof items === 'object' && items !== null) {
+          for (let key in items) {
+            if(key == "page" || key == "size"){
+              continue
+            }
+            this.clearSearchItem(items[key]); // 递归清空对象中的每个属性值
+          }
+        }else{
+        // 处理其他类型的输入,例如字符串或数字
+          items = '';
+          }
+      }
+    }
+
+
+}

+ 10 - 1
src/router/index.js

@@ -346,6 +346,10 @@ import detailExperienceOfficerAnnouncement from '@/views/pages/experienceOfficer
 import experienceOfficerTemplateMessage from '@/views/pages/experienceOfficer/templateMessage/index.vue';
 import detailExperienceOfficerTemplateMessage from '@/views/pages/experienceOfficer/templateMessage/detail.vue';
 
+
+//域名管理
+import domainName from '@/views/pages/doMain/domainName.vue'
+
 import dialog from '@/components/dialog'
 Vue.use(Router);
 
@@ -2056,7 +2060,12 @@ export default new Router({
       },
       name: '查看模板消息',
       component: detailExperienceOfficerTemplateMessage
-    }
+    },
+    {
+      path: '/domainName',
+      name: '域名管理页面',
+      component: domainName
+    },
     ],
   }
   ]

+ 1 - 0
src/store/index.js

@@ -11,6 +11,7 @@ const getSysUserInfoFromStorage = () => {
   return sysUserInfo;
 };
 
+
 export default new Vuex.Store({
   state: {
     areaDetailedSartDate: '',

+ 9 - 0
src/util/createData.js

@@ -0,0 +1,9 @@
+export const  createDomainInfo = (data,childData,user,operationType)=>{
+      const domainInfo = {
+        ...data,
+        payDetailsList: childData ? childData : [],
+        createUser:user,
+        operationType
+      }
+      return domainInfo;
+}

+ 31 - 1
src/util/util.js

@@ -435,4 +435,34 @@ export const checkIdNumberValid = text => {
     }
   }
   return true;
-}
+}
+
+
+
+export const deepClone = (obj)=> {
+    if (obj === null || typeof obj !== 'object') {
+        return obj;
+    }
+
+    // 创建一个新的对象或数组
+    let clone = Array.isArray(obj) ? [] : {};
+
+    // 遍历对象的每个属性进行复制
+    for (let key in obj) {
+        if (Object.prototype.hasOwnProperty.call(obj, key)) {
+            // 递归复制子属性
+            clone[key] = deepClone(obj[key]);
+        }
+    }
+
+    return clone;
+}
+
+
+export const localDateTimeFormat = (localDateTimeObj)=>{
+    if(localDateTimeObj == null){
+        return "";
+    }else{
+        return localDateTimeObj.year + "-" + (localDateTimeObj.monthValue).toString().padStart(2,'0') + "-" + localDateTimeObj.dayOfMonth + " " + localDateTimeObj.hour + ":" + localDateTimeObj.minute + ":" + localDateTimeObj.second;
+    }
+}

+ 375 - 0
src/views/pages/domain/domainName.vue

@@ -0,0 +1,375 @@
+<template>
+  <div class="main">
+    <bread-crumb></bread-crumb>
+    <section class="content-section">
+      <div style="margin: 15px ;"></div>
+      <el-card class="box-card" body-style="padding: 0px;">
+        <div slot="header" class="clearfix">
+          <span style="line-height: 36px;">
+            <i class="el-icon-date" style="margin-right: 5px;"></i>筛选查询
+          </span>
+          <el-button style="float: right;margin-right: 10px;" size="small" @click="clearSearchForm">重置</el-button>
+          <el-button style="float: right;margin-right: 10px;" size="small" type="primary"
+            @click="searchByForm">查询</el-button>
+        </div>
+        <el-form :model="SearchForm" :inline="true" :rules="rules" style="margin-top:20px;" label-position="right"
+          ref="SearchForm" label-width="120px">
+          <el-form-item label="域名:">
+            <el-input v-model="SearchForm.name" size="small" style="width: 350px;" placeholder="请输入域名" maxlength="50">
+            </el-input>
+          </el-form-item>
+          <el-form-item prop="nameId" label="域名券号:">
+            <el-input v-model.number="SearchForm.nameId" size="small" maxlength="20" style="width: 350px;"
+              placeholder="请输入域名券号">
+            </el-input>
+          </el-form-item>
+          <el-form-item label="所有人:">
+            <el-input v-model="SearchForm.owner" size="small" style="width: 350px;" placeholder="请输入域名所有人"
+              maxlength="50">
+            </el-input>
+          </el-form-item>
+          <el-form-item label="申请日期:">
+            <div class="block">
+              <el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="SearchForm.timeBetween" size="small"
+                style="width: 350px;" type="datetimerange" range-separator="至" start-placeholder="开始日期"
+                end-placeholder="结束日期">
+              </el-date-picker>
+            </div>
+          </el-form-item>
+          <el-form-item label="审核状态:">
+            <el-select v-model="SearchForm.state" size="small" style="width: 140px;" placeholder="请选择">
+              <el-option v-for="item in  StateOption" :key="item.value" :label="item.label" :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-form>
+      </el-card>
+
+      <!-- -----------------------------数据表格---------------------------------- -->
+      <el-card class="box-card_table">
+        <div slot="header" class="clearfix">
+          <span style="line-height: 36px;">
+            <i class="el-icon-date" style="margin-right: 5px;"></i>域名管理
+          </span>
+          <el-button @click="ExportExcel" style="float: right;margin-right: 10px;" size="small">数据导出</el-button>
+          <el-button v-if="canNew()" style="float: right;margin-right: 10px;" size="small" type="primary"
+            @click="showDomain({}, true)">新增</el-button>
+        </div>
+        <el-table :ref="tableData" :default-sort="{ prop: 'reTime', order: 'descending' }" v-loading="loading"
+          :data="tableData" border style="width: 100%">
+          <el-table-column :show-overflow-tooltip="true" align="center" type="index" label="序号" width="50">
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" align="center" prop="name" label="域名" width="180">
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" align="center" prop="nameId" label="域名券号" width="180">
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" align="center" prop="owner" label="所有人" width="180">
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" align="center" prop="state" label="审核状态" width="180">
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" align="center" prop="reTime" label="域名申请日期" width="180">
+          </el-table-column>
+          <el-table-column :show-overflow-tooltip="true" align="center" prop="createUser" label="登记人" width="100">
+          </el-table-column>
+          <el-table-column align="center" fixed="right" label="操作">
+            <template slot-scope="scope">
+              <div style="display: flex; justify-content:left;">
+                <el-button :disabled="canEdit(scope.row)" type="text" size="small"
+                  @click="showDomain(scope.row, true)">编辑</el-button>
+                <el-button :disabled="canRead(scope.row)" size="small" type="text"
+                  @click="showDomain(scope.row, false)">查看</el-button>
+                <el-button :disabled="canDel(scope.row)" type="text" size="small"
+                  @click="deleteRow(scope.row.nameId)">删除</el-button>
+                <el-button :disabled="canChangeState(scope.row)" style="font-size: 10px;" type="primary" size="mini"
+                  @click="auditPass(scope.row, stateOptionMap.PASS.value)">审核通过</el-button>
+                <el-button :disabled="canChangeState(scope.row)" style="font-size: 10px;" type="danger" size="mini"
+                  @click="auditPass(scope.row, stateOptionMap.NOTPASS.value)">审核不通过</el-button>
+              </div>
+            </template>
+          </el-table-column>
+
+        </el-table>
+
+        <div class="pageNav">
+          <el-pagination @current-change="handleCurrentChange" :current-page="SearchForm.page" :page-size="10"
+            layout="total,prev, pager, next, jumper" :total="total">
+          </el-pagination>
+        </div>
+      </el-card>
+
+    </section>
+    <addDialog :propData="propData" :functionCode="functionCode" @resetPropData="resetPropData"
+      @reflashTable="reflashTable">
+    </addDialog>
+  </div>
+
+
+</template>
+
+<script>
+import breadCrumb from "@/components/breadCrumb";
+import addDialog from "@/components/domainNameComponents/addDialog";
+import { managerGetAllRows, delRowByNameIds, auditByNameId, exportExcel } from "@/api/domainName";
+import { searchItemReset } from "@/mixins/searchItemReset.js";
+import { operationRules } from "@/mixins/operationRules.js";
+import { deepClone } from "@/util/util";
+import { StateOption, stateOptionMap } from "@/enums/domain/stateOption.js"
+
+export default {
+  mixins: [searchItemReset, operationRules],
+
+  data() {
+    var nameId = (rule, value, callback) => {
+      if (value == '' || /^[0-9]+\.{0,1}[0-9]{0,2}$/.test(value)) {
+        callback();
+      } else {
+        callback(new Error("请输入数字"));
+      }
+    };
+    return {
+      StateOption,
+      stateOptionMap,
+      SearchForm: {
+        name: "",
+        nameId: "",
+        state: "",
+        owner: "",
+        timeBetween: [],
+        reTimeBegin: "",
+        reTimeEnd: "",
+        page: 1,
+        //固定每页最多10行数据
+        size: 10
+      },
+      // 表格数据
+      tableData: [
+      ],
+      propData: {
+        //弹窗展示控制
+        dialogState: false,
+        //操作类型
+        operationType: false,
+        //所选当前列的数据
+        currentRow: {},
+        currentRowChild: []
+      },
+      loading: false,
+      total: 0,
+      diashow: '',
+      rules: {
+        nameId: [{ validator: nameId, trigger: 'blur', message: '请输入正确的数字' }]
+      }
+
+
+    };
+  },
+  mounted() {
+    // 无法使用
+    // this.clearSearchItem(this.SearchForm)
+    this.clearSearchForm();
+    this.searchByForm();
+
+  },
+  methods: {
+    async ExportExcel() {
+      //判断是否为管理员或者法务部人员,不是则不展示数据
+      if (!this.functionCode["justice_admin"] && !this.functionCode["domain_admin"]) {
+        return this.$message({ type: "error", message: "无权导出", duration: 2000, onClose: () => { } });
+      }
+      this.SearchForm.reTimeBegin = this.SearchForm.timeBetween[0] ? this.SearchForm.timeBetween[0] : null;
+      this.SearchForm.reTimeEnd = this.SearchForm.timeBetween[1] ? this.SearchForm.timeBetween[0] : null;
+      const url = await exportExcel(this.SearchForm);
+      console.log("$$$$$", url)
+      window.open(url);
+    },
+    //获取域名信息请求
+    searchByForm() {
+      //判断是否为管理员或者法务部人员,不是则不展示数据
+      if (!this.functionCode["justice_admin"] && !this.functionCode["domain_admin"]) {
+        // this.SearchForm.state = this.stateOptionMap.
+        return this.$message({ type: "error", message: "您没有查看权限", duration: 2000, onClose: () => { } });
+      }
+      this.$refs["SearchForm"].validate(async (valid) => {
+        if (valid) {
+          console.log("######", valid)
+          this.SearchForm.reTimeBegin = this.SearchForm.timeBetween[0];
+          this.SearchForm.reTimeEnd = this.SearchForm.timeBetween[1];
+          this.loading = true;
+          await managerGetAllRows(
+            this.SearchForm,
+            success => {
+              console.log(success)
+              success.records.forEach(item => {
+                switch (eval(item.state)) {
+                  case 1:
+                    item.state = "通过";
+                    break;
+                  case 2:
+                    item.state = "等待";
+                    break;
+                  case 3:
+                    item.state = "未通过";
+                    break;
+                  case 4:
+                    item.state = "草稿";
+                    break;
+                }
+                item.reTime = item.reTime;
+                item.createTime = item.createTime;
+                item.nextTime = item.nextTime;
+                item.payTime = item.payTime;
+              });
+              this.tableData = success.records;
+              this.total = success.total;
+              this.loading = false;
+            },
+            error => {
+              console.warn(error);
+              this.$message({ type: "error", message: error, duration: 2000, onClose: () => { } });
+              this.loading = false;
+            },
+            exception => {
+              console.warn(exception);
+              this.$message({ type: "error", message: exception, duration: 2000, onClose: () => { } });
+              this.loading = false;
+            })
+        }
+        else {
+          this.$message({
+            type: "error",
+            message: "搜索条件不符合规范"
+          });
+        }
+      });
+
+    },
+
+    //删除该列数据请求
+    deleteRow(rowNameId) {
+      if (!this.functionCode["justice_admin"] && !this.functionCode["domain.admin"]) {
+        // this.SearchForm.state = this.stateOptionMap.
+        return this.$message({ type: "error", message: "您没有删除权限", duration: 2000, onClose: () => { } });
+      }
+      const nameIds = [];
+      nameIds.push(rowNameId);
+      console.log(Object.assign({}, { nameIds: nameIds }));
+      this.$confirm("确认删除该条数据吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(async () => {
+          await delRowByNameIds(
+            nameIds,
+            success => {
+              this.$message({
+                type: "success",
+                message: "删除成功!"
+              });
+              this.searchByForm();
+            },
+            error => {
+              this.$message({
+                type: "error",
+                message: "错误"
+              });
+            },
+            exception => {
+              this.$message({
+                type: "error",
+                message: "异常"
+              });
+            }
+          )
+        })
+
+    },
+
+    async auditPass(domainInfo, state) {
+      const data = {
+        nameId: domainInfo.nameId,
+        state: state
+      }
+      await auditByNameId(
+        data,
+        success => {
+          this.$message({
+            type: "success",
+            message: "审核成功!"
+          });
+          this.searchByForm();
+        },
+        error => {
+          this.$message({
+            type: "error",
+            message: "审核错误"
+          });
+        },
+        exception => {
+          this.$message({
+            type: "error",
+            message: "审核异常"
+          })
+        }
+      )
+    },
+
+    // 页面变化函数
+    handleCurrentChange(pageNow) {
+      this.SearchForm.page = pageNow;
+      this.searchByForm();
+    },
+
+    // 表单清空函数
+    clearSearchForm() {
+      this.SearchForm.name = ''
+      this.SearchForm.nameId = ''
+      this.SearchForm.owner = ''
+      this.SearchForm.state = ''
+      this.SearchForm.timeBetween = []
+    },
+
+    //自定义事件,子传递state给父组件,重置弹窗显示状态函数
+    resetPropData(state, rowValue, flag, childRow) {
+      this.propData.dialogState = state;
+      this.propData.currentRow = rowValue;
+      this.propData.operationType = flag;
+      this.propData.currentRowChild = childRow;
+    },
+
+    //编辑按钮点击之后,触发弹窗,传递的row为当前列的数据信息,false为编辑,true为查看
+    showDomain(rowInfo, flag) {
+      this.propData.currentRow = deepClone(rowInfo);
+      this.propData.currentRowChild = deepClone(rowInfo.payDetailsList);
+      this.propData.operationType = flag;
+      this.propData.dialogState = true;
+    },
+    //当通过弹窗新增数据成功之后对表格数据进行更改
+    reflashTable(data) {
+      //将新插入的数据push给表格
+      // this.tableData.push(data);
+      //使用组件的doLayout(),对数据重新排序
+      // this.$ref("tableData").doLayout()
+      //由于部分列值由系统生成,所以需要重新查询
+      this.searchByForm()
+    }
+
+
+  },
+  components: { breadCrumb, addDialog }
+
+
+}
+</script>
+
+<style lang="less" scoped>
+.box-card_table {
+  margin-top: 20px;
+
+}
+
+.pageNav {
+  margin: 20px;
+  float: right;
+}
+</style>

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä